Skip to content

Commit ad12b0a

Browse files
committed
chore: minor fixes
1 parent d8197dd commit ad12b0a

File tree

3 files changed

+40
-9
lines changed

3 files changed

+40
-9
lines changed

src/components/fields/RadioGroup/Radio.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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 (

src/components/fields/RadioGroup/RadioGroup.stories.tsx

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { StoryFn } from '@storybook/react-vite';
22

3-
import { TEXT_VALUE_ARG } from '../../../stories/FormFieldArgs';
43
import { baseProps } from '../../../stories/lists/baseProps';
4+
import { Flow } from '../../layout/Flow';
55

66
import { Radio } from './Radio';
77
import { 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+
);

src/data/item-themes.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff 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: {

0 commit comments

Comments
 (0)