File tree Expand file tree Collapse file tree 3 files changed +40
-9
lines changed
components/fields/RadioGroup Expand file tree Collapse file tree 3 files changed +40
-9
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ const RadioButtonElement = tasty(ItemBase, {
3535 } ,
3636} ) ;
3737
38- const RadioButtonSelectedElement = tasty ( RadioButtonElement , {
38+ const TabRadioButtonSelectedElement = tasty ( RadioButtonElement , {
3939 qa : 'RadioSelected' ,
4040 styles : {
4141 fill : '#white' ,
@@ -277,7 +277,7 @@ function Radio(props: CubeRadioProps, ref) {
277277 if ( isButton ) {
278278 const ButtonElement =
279279 isRadioSelected && contextType === 'tabs'
280- ? RadioButtonSelectedElement
280+ ? TabRadioButtonSelectedElement
281281 : RadioButtonElement ;
282282
283283 return (
Original file line number Diff line number Diff line change 11import { StoryFn } from '@storybook/react-vite' ;
22
3- import { TEXT_VALUE_ARG } from '../../../stories/FormFieldArgs' ;
43import { baseProps } from '../../../stories/lists/baseProps' ;
4+ import { Flow } from '../../layout/Flow' ;
55
66import { Radio } from './Radio' ;
77import { CubeRadioGroupProps } from './RadioGroup' ;
@@ -298,8 +298,37 @@ export const CustomButtonTypes: StoryFn<CubeRadioGroupProps> = () => (
298298) ;
299299
300300// Disabled state
301- export const DisabledState = Template . bind ( { } ) ;
302- DisabledState . args = {
303- type : 'tabs' ,
304- isDisabled : true ,
305- } ;
301+ export const DisabledState : StoryFn < CubeRadioGroupProps > = ( ) => (
302+ < Flow gap = "2x" >
303+ < Radio . Group
304+ type = "radio"
305+ isDisabled = { true }
306+ defaultValue = "yes"
307+ label = "Radio (Disabled)"
308+ >
309+ < Radio value = "yes" > Yes</ Radio >
310+ < Radio value = "no" > No</ Radio >
311+ < Radio value = "maybe" > Maybe</ Radio >
312+ </ Radio . Group >
313+ < Radio . Group
314+ type = "button"
315+ isDisabled = { true }
316+ defaultValue = "yes"
317+ label = "Button (Disabled)"
318+ >
319+ < Radio value = "yes" > Yes</ Radio >
320+ < Radio value = "no" > No</ Radio >
321+ < Radio value = "maybe" > Maybe</ Radio >
322+ </ Radio . Group >
323+ < Radio . Group
324+ type = "tabs"
325+ isDisabled = { true }
326+ defaultValue = "yes"
327+ label = "Tabs (Disabled)"
328+ >
329+ < Radio value = "yes" > Yes</ Radio >
330+ < Radio value = "no" > No</ Radio >
331+ < Radio value = "maybe" > Maybe</ Radio >
332+ </ Radio . Group >
333+ </ Flow >
334+ ) ;
Original file line number Diff line number Diff line change @@ -60,7 +60,9 @@ export const DEFAULT_OUTLINE_STYLES: Styles = {
6060 fill : {
6161 '' : '#dark.0' ,
6262 hovered : '#dark.03' ,
63- 'pressed | (selected & !hovered)' : '#dark.06' ,
63+ selected : '#dark.09' ,
64+ 'selected & hovered' : '#dark.12' ,
65+ pressed : '#dark.09' ,
6466 disabled : '#dark.04' ,
6567 } ,
6668 color : {
You can’t perform that action at this time.
0 commit comments