[BOOKINGSG-9221][GZ] migrate radio button to linaria#1105
[BOOKINGSG-9221][GZ] migrate radio button to linaria#1105ghazwan-gt wants to merge 14 commits intopre-release/v4from
Conversation
| radioUncheckedDisabled: Locator; | ||
| radioCheckedDisabled: Locator; | ||
|
|
||
| radioFocusableDisabled: Locator; |
| ).toMatchAriaSnapshot(` | ||
| - radio [disabled] [checked] | ||
| `); | ||
|
|
There was a problem hiding this comment.
should we add aria snapshot test for radioUncheckedDisabled to make it complete?
| &.${classes.inputDisabledVisual} { | ||
| cursor: not-allowed; | ||
| } | ||
|
|
||
| &:not(.${classes.inputDisabledVisual}):hover + .${classes.icon} { | ||
| @media (pointer: fine) { | ||
| color: ${Colour["icon-hover"]}; | ||
| } | ||
| } |
There was a problem hiding this comment.
hmm we could do this
const inputActive = css`
&:hover + svg {
// ...
}
`
and only apply inputActive when !disabledVisual
| height: 100%; | ||
| width: 100%; | ||
| color: ${Colour["icon-subtle"]}; | ||
| transition: ${Motion["duration-150"]} ${Motion["ease-default"]}; |
There was a problem hiding this comment.
height, width, transition could be a common icon class and uncheckedIcon and checkedIcon can define the colour
| color: ${Colour["icon-subtle"]}; | ||
| transition: ${Motion["duration-150"]} ${Motion["ease-default"]}; | ||
|
|
||
| &.${classes.iconDisabled} { |
There was a problem hiding this comment.
this could be a separate css tag
|
|
||
| export default function Story() { | ||
| return ( | ||
| <> |
There was a problem hiding this comment.
use the story-column-container here to add more spacing between the size variants
| protected readonly component = "radio-button"; | ||
|
|
||
| public readonly locators: { | ||
| components: { |
There was a problem hiding this comment.
ah I intended this to contain the common internal locators for components only. so this nesting of locators is not needed
| await expect( | ||
| story.getContainer( | ||
| story.locators.components.radioUncheckedDefault | ||
| ) | ||
| ).toMatchAriaSnapshot(` | ||
| - radio | ||
| `); | ||
|
|
||
| await expect( | ||
| story.getContainer( | ||
| story.locators.components.radioCheckedDefault | ||
| ) | ||
| ).toMatchAriaSnapshot(` | ||
| - radio [checked] | ||
| `); | ||
|
|
||
| await expect( | ||
| story.getContainer( | ||
| story.locators.components.radioCheckedDisabled | ||
| ) | ||
| ).toMatchAriaSnapshot(` | ||
| - radio [disabled] [checked] | ||
| `); |
There was a problem hiding this comment.
can merge into a single snapshot and target story.layout
Checklist
classNameis chained correctly withclsx