Skip to content

Commit 9d4d4ae

Browse files
crssthafrozenhelium
authored andcommitted
feat(go-ui): Update storybook
Separete components into common groups Uppdate stories to incorporate v2 changes Add stories for new layout and view components Updated stories for button component feat(components): added Chip, Expandable Container and InputSection
1 parent ec90cf5 commit 9d4d4ae

57 files changed

Lines changed: 1298 additions & 292 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/go-ui-storybook/src/stories/BarChart.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const maxValue = Math.max(...data.map(valueSelector));
2727
type BarChartSpecificProps = BarChartProps<Option>;
2828
type Story = StoryObj<BarChartSpecificProps>;
2929
const meta: Meta<BarChartSpecificProps> = {
30-
title: 'Components/BarChart',
30+
title: 'Visualization/BarChart',
3131
component: BarChart,
3232
parameters: {
3333
layout: 'centered',
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import { BlockViewProps } from '@ifrc-go/ui';
2+
import type {
3+
Meta,
4+
StoryObj,
5+
} from '@storybook/react';
6+
7+
import BlockView from './BlockView';
8+
9+
type Story = StoryObj<BlockViewProps>;
10+
11+
const meta: Meta<BlockViewProps> = {
12+
title: 'Views/BlockView',
13+
component: BlockView,
14+
parameters: {
15+
layout: 'centered',
16+
},
17+
args: {
18+
spacing: 'md',
19+
withPadding: true,
20+
before: <div className="page-container-header"> Header</div>,
21+
after: <div className="page-container-footer">Footer</div>,
22+
children: (
23+
<div className="page-container">
24+
<div className="page-container-main">
25+
Content
26+
</div>
27+
</div>),
28+
},
29+
decorators: [
30+
(Story) => (
31+
<div className="dash-border">
32+
<Story />
33+
</div>
34+
),
35+
],
36+
};
37+
38+
export default meta;
39+
40+
export const Default: Story = {};
41+
42+
export const WithSpacing: Story = {
43+
args: {
44+
spacing: 'xl',
45+
},
46+
};
47+
48+
export const WithoutPadding: Story = {
49+
args: {
50+
withPadding: false,
51+
},
52+
};
53+
54+
export const WithSeparators: Story = {
55+
args: {
56+
withBeforeSeparator: true,
57+
withAfterSeparator: true,
58+
},
59+
};
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import {
2+
BlockView as PureBlockView,
3+
BlockViewProps,
4+
} from '@ifrc-go/ui';
5+
6+
function BlockView(props: BlockViewProps) {
7+
return (
8+
<PureBlockView {...props} /> // eslint-disable-line react/jsx-props-no-spreading
9+
);
10+
}
11+
12+
export default BlockView;

packages/go-ui-storybook/src/stories/BooleanInput.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import BooleanInput from './BooleanInput';
1111
type Story = StoryObj<typeof BooleanInput>;
1212

1313
const meta: Meta<typeof BooleanInput> = {
14-
title: 'Components/BooleanInput',
14+
title: 'Inputs/BooleanInput',
1515
component: BooleanInput,
1616
parameters: {
1717
layout: 'centered',

packages/go-ui-storybook/src/stories/BooleanOutput.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import BooleanOutput from './BooleanOutput';
99
type Story = StoryObj<BooleanOutputProps>;
1010

1111
const meta: Meta<typeof BooleanOutput> = {
12-
title: 'Components/BooleanOutput',
12+
title: 'Outputs/BooleanOutput',
1313
component: BooleanOutput,
1414
parameters: {
1515
layout: 'centered',

packages/go-ui-storybook/src/stories/Button.stories.ts

Lines changed: 0 additions & 94 deletions
This file was deleted.

0 commit comments

Comments
 (0)