Skip to content

Commit b19c1db

Browse files
committed
add Storybook story
1 parent cf75d1b commit b19c1db

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import { Meta, StoryObj } from '@storybook/react';
2+
import { ExperienceControl } from './index';
3+
4+
const meta: Meta< typeof ExperienceControl > = {
5+
title: 'Components/ExperienceControl',
6+
component: ExperienceControl,
7+
};
8+
9+
export default meta;
10+
type Story = StoryObj< typeof ExperienceControl >;
11+
12+
export const Default: Story = {
13+
args: {
14+
label: 'How was your experience?',
15+
selectedExperience: 'good',
16+
onChange: () => {},
17+
},
18+
};
19+
20+
export const WithHelpText: Story = {
21+
args: {
22+
label: 'Rate your satisfaction',
23+
selectedExperience: 'good',
24+
helpText: 'Please select an option that best describes your experience',
25+
onChange: () => {},
26+
},
27+
};
28+
29+
export const PreSelectedBad: Story = {
30+
args: {
31+
label: 'How was the support?',
32+
selectedExperience: 'bad',
33+
onChange: () => {},
34+
},
35+
};
36+
37+
// Example of using the Base component directly
38+
export const CustomBase: Story = {
39+
render: () => (
40+
<ExperienceControl.Base label="Custom Experience Control">
41+
<ExperienceControl.Option isSelected onClick={ () => {} }>
42+
1
43+
</ExperienceControl.Option>
44+
</ExperienceControl.Base>
45+
),
46+
};

packages/components/src/experience-control/style.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ $experience-types: (
5353
width: 32px;
5454
border-width: 1px;
5555
border-style: solid;
56+
justify-content: center;
5657

5758
&:focus {
5859
box-shadow: none;

0 commit comments

Comments
 (0)