-
Notifications
You must be signed in to change notification settings - Fork 97
feat(forms): new light/dark mode colors #1838
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
Conversation
| ...commonArgs | ||
| }} | ||
| argTypes={{ | ||
| tabIndex: { control: 'number' }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needed (and has parity with File) to observe focus state.
| if (value.transparency !== undefined) { | ||
| _transparency = value.transparency; | ||
| } | ||
| _transparency = _transparency === undefined ? value.transparency : _transparency; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If transparency exists along with a variable parameter, the transparency should override the variable's rgba alpha value. This allows us to one-off tweak
getColor({
theme,
variable: 'background.disabled',
transparency: theme.opacity[300]
});as seen with StyledRadioInput.
| import { TextEncoder } from 'node:util'; | ||
|
|
||
| global.TextEncoder = TextEncoder; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needed due to the addition of renderToString in StyledTextInput.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this matches browser behavior. 😰 I always get nervous about using node utils in tests when the component will leverage browser APIs in practice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a pass over everything sans Tiles and most looks good to me! 🔥 work! just one thing i noticed that has some implications on our Buttons package.
while reviewing InputGroup, it appears that the hover state of the neutral button is one shade too dark/light (blue-800/500) instead of using the expected blue-700/600 or border/primaryEmphasis.
the initial design intent for the neutral button was to visually align with inputs, including on hover treatment (but not active).
ive included a comparison diagram below. i’ve provided a visual of the intention below. but plz let me know if i might have missed something and this is intentional. sorry we didnt catch this earlier, as i know this affects a package we’ve already marked as done
p.s. since the changes would come from buttons, and the rest of the forms look good to me, i'll approve! ty again!
|
Icon should be We discussed this in Figma already, maybe I configured something wrong 🤔 |
| const height = `${theme.space.base * (isCompact ? 8 : 10)}px`; | ||
|
|
||
| return css` | ||
| max-height: ${height}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes a 2px height bump difference between Select and Input due to wrapper border.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we include an annotation? 👀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. In general, I'm really looking to getting rid of all this faux/wrapper/media/input differentiation in v9 with a new component.next that rolls everything into one.
| interface IStyledTileProps { | ||
| isDisabled?: boolean; | ||
| isFocused?: boolean; | ||
| isSelected?: boolean; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
State info shouldn't be used when CSS can solve using :has()
| top: 0; | ||
| left: 0; | ||
| opacity: 0; | ||
| z-index: 1; | ||
| margin: 0; | ||
| cursor: ${props => (props.disabled ? 'default' : 'pointer')}; | ||
| width: 100%; | ||
| height: 100%; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now the visibly hidden input is truly interactive – similar to the approach used by ColorSwatch. This will allow us to revisit Tiles and add a isCheckboxGroup feature similar to ColorSwatch so that Tiles isn't constrained to behave as a radio-only group.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed Tile (others were reviewed on Friday). Looks good. 🙌
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple small comments, but nothing blocking. Thanks for pushing the Select style fixes 🚀
| }); | ||
| const trackDisabledLowerBackgroundColor = hasLowerTrack | ||
| ? getColor({ theme, variable: 'border.emphasis' }) | ||
| : ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's quite a few ternary's in this file (from the original implementation). Curious if we can get away with simplifying:
const trackDisabledLowerBackgroundColor = hasLowerTrack && getColor({ ... });There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I was thinking the same but resisted updates due to the focus of this PR. Let's try to revisit down the road.
| const height = `${theme.space.base * (isCompact ? 8 : 10)}px`; | ||
|
|
||
| return css` | ||
| max-height: ${height}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we include an annotation? 👀
| color: ${activeColor}; | ||
| } | ||
| ${StyledTile}:has(:checked) && { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✨ new css features ftw
| import { TextEncoder } from 'node:util'; | ||
|
|
||
| global.TextEncoder = TextEncoder; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this matches browser behavior. 😰 I always get nervous about using node utils in tests when the component will leverage browser APIs in practice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! 💯
| const readOnlyBackgroundColor = disabledBackgroundColor; | ||
| const calendarPickerColor = getColor({ theme, variable: 'foreground.subtle' }); | ||
| const calendarPickerIcon = renderToString(<ChevronIcon color={calendarPickerColor} />); | ||
| const calendarPickerBackgroundImage = `url("data:image/svg+xml,${encodeURIComponent(calendarPickerIcon)}")`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice hack!




Description
Completed recolor work for
Input,Checkbox,Radio,Toggle,Range,Select,FileUpload,File,FileList,FauxInput,MediaInput, andTiles. Components inheriting this work includeTextarea&InputGroup.Detail
Note that
Hint,Label, andMessagewere completed with #1816Checklist
npm start)?bedrock)