-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create inputter component #28
Comments
Discovery work... initial text input states created in Sketch. Rationale and a query on the disabled state's label appearance below... Typography As it is part of the component and the component is disabled maybe it should be? But, I think it could be better if the Label was still of good visual contrast for a11y? People still need to understand what is disabled, don't they? The label itself still has a purpose and is not in itself redundant? (It also appears to be the more commonly used pattern.) |
I noticed 'Hover' mentioned in the states, but input fields do not usually have a hover state? |
The hover state will be relevant for the checkbox and radio and other input types. It may be a good idea to list all the different input types we are planning on making available. Here's the MDN page on |
Validation An error message is preceded by a warning icon (font awesome) to make the error state more distinct to colourblind users. The message also appears in Muon Purple for visual awareness which meets a11y contrast requirements. |
Checkboxes Here's the first iteration for a simple checkbox. ColoursIn general, checkboxes tend to use blue as the colour when selected. These designs use Muon purple instead. The hover state follows button style and uses black. The unchecked box uses #333333 1px border (due to size). This also means that the Focus state colour had to change to a 2px wide outline #CCCCCC grey (instead of Muon purple like the button) in order to contrast well especially at the smaller size, 1px border. This is not likely to cause any misunderstanding but happy to look further into options if it is a technical problem (ie. requiring just one focus state style globally). SizeSize is currently 12px sq with rounded corners which is generally the native shape and size (although some systems use square corners). The optimal target area for touch screens should remain 42px sq regardless to keep it usable. (See CTA research/documentation for why). Indeterminate stateI have included an indeterminate attribute state for where the value is neither true nor false but is there a requirement for this at all? MSDN say there are no browsers that currently support it? Ref: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox LabelsExamples with appended labels coming next. |
Radio buttons follow the same principles as the checkbox regarding colours and focus... The outer ring is 1px (#333333 by default) the space between the inside of that ring and the 'selected' circle is 1.5px (for clarity) making the circle 7px diameter. Selected state is Muon purple, hover is black (#000000) and Focus is a 2px outline #cccccc. |
Following discovery work and iterations for states (see #2 (comment)) this is the latest proposed design for the text input field (single). |
Input with icon + date scenario (calendar icon could be switched for search icon etc). default, focus, and active states. The text highlight is also shown over the dd. Based on behaviour as described on MDN: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input |
Select variant of inputter. Uses a similar looking Input box and icon. Width determined by longest data. Question: On click the drop down list could be the browser default? - This is how it is on Nuclues and the simplistic Government design systems that (correctly) obscure the initial view. Or did we need a custom version of this so that it can be customised by different brands? |
This is looking good! For reference, here's a great article on Right-to-left styling: https://rtlstyling.com/posts/rtl-styling In some cases things are not switched over, depending on the context and content type. |
With reference to the Helper and Tooltip, I like to suggest that the triangle/chevron should be placed at the start of the Helper rather than at the end. I mention this as the position of the triangle/chevron for a raw HTML I'm aware that the variant tested better with the triangle/chevron at the end. We can of course respect this decision when it's used. My rational for this is to keep it as close to HTML's default and most likely the majority expectations. |
I've researched the show/hide toggle variant a little further. Typically something like a password component will have a way to reveal the content as a toggle, but displayed as •••• by default. Looking at Google Material DS they utilise the eye/eye-slash icon at the end of the input field. Interestingly they refer to it as the 'visibility' icon so the reverse meaning to how we use it as Show/Hide. This I think is down to interactive icons describing 'intent' rather than current status. Is it a question of direction that may need to be answered before it gets to the brand side of things? However, whilst we already have an input field that can accommodate an icon (like Date above) the more raw HTML variant tends to be to use an associated checkbox below the field. (As this example seen on W3 schools...) From experience though this could be problematic if used with validation messaging. This same issue was addressed in password where we moved the show/hide toggle to the top-right above the input field, but that's surely a brand level decision? What are others thoughts on the subject? (also @andij the fontawesome eye-slash required a bounding box that was a couple of pixels larger to fit the icon at the same font size - so another alignment to consider (others sat within the 24px sq but all aligned central). |
Ok - I see. I still think the show/hide toggle question is a valid one. But, due to getting muddled over the naming - I think it's safe to say this is out of scope for the inputter and should be transferred to a password component when and if created. Thanks for clarifying. |
The input field could only be as long as it needs to be as defined by the placeholder/mono/mask or data input. Labels on above are just to demonstrate the example and do not dictate the usage which is neutral at this stage). |
Mask & Separator - #123 |
Reopening this as it was automatically closed when PR #136 was merged. |
Here I've added screenshots of the latest development to the Search, Date and Select input types on Firefox, Edge, Chrome and Safari on Mac. There are quite a number of browser specific overrides to pseudo elements to achieve this. These changes are noted in comments within the global stylesheet for inputter type="date" and the component stylesheet for inputter select I'd like to test these in Windows High Contrast, but my Windows machine is out of action at the moment. SearchDateSelect |
|
Here are a few notes following the alpha release that I'd like to capture. These are either points for discussion or to raise as tickets.
|
Closing this as all outstanding items have their respective tickets created. |
Outcome
To create a wrapper component to display the following form control types:
Scope
Elements and types
Properties
IgnoreSeparatorDisableEventBubbling *Slot
Tokens
Has-Mask*Has-Helper *Has-Separator *Note*: Above tokens enable/disable mask, separator & helper functionality (if the design system decides to use them or not).
States (active/focus/disabled/hover) #185
Events
Addon Features
Mixin
Child Components
Parent Class
The text was updated successfully, but these errors were encountered: