Skip to content

Commit f5ba758

Browse files
roshni73shreeyash07
authored andcommitted
Add Missing stories and audit storybook
1 parent 55d401d commit f5ba758

File tree

9 files changed

+109
-2
lines changed

9 files changed

+109
-2
lines changed

Diff for: packages/go-ui-storybook/src/stories/Alert.stories.tsx

+4
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export const Info: Story = {
3232
name: 'info',
3333
title: 'Information',
3434
type: 'info',
35+
nonDismissable: true,
3536
description: 'This alert provides informative details to the user.',
3637
},
3738
parameters: {
@@ -48,6 +49,7 @@ export const Success: Story = {
4849
name: 'success',
4950
title: 'Success',
5051
type: 'success',
52+
nonDismissable: true,
5153
description: 'This alert indicates a successful operation or task.',
5254
},
5355
parameters: {
@@ -64,6 +66,7 @@ export const Warning : Story = {
6466
name: 'warning',
6567
title: 'Warning',
6668
type: 'warning',
69+
nonDismissable: true,
6770
description: 'This alert warns the user about potential issues or risks.',
6871
},
6972
};
@@ -73,6 +76,7 @@ export const Danger : Story = {
7376
name: 'danger',
7477
title: 'Danger',
7578
type: 'danger',
79+
nonDismissable: true,
7680
description: 'This alert indicates a dangerous or potentially harmful situation.',
7781
},
7882
parameters: {

Diff for: packages/go-ui-storybook/src/stories/Button.stories.ts

+47-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ const meta = {
2121
onClick: fn(),
2222
},
2323
tags: ['autodocs'],
24-
argTypes: {},
2524
} satisfies Meta<typeof Button>;
2625

2726
export default meta;
@@ -42,6 +41,22 @@ export const Primary: Story = {
4241
},
4342
};
4443

44+
export const PrimaryButtonWithIcon: Story = {
45+
args: {
46+
name: 'button',
47+
variant: 'primary',
48+
children: 'Primary Button',
49+
// icons: <DownloadTwoFillIcon /> ,
50+
},
51+
parameters: {
52+
design: {
53+
type: 'figma',
54+
url: 'https://www.figma.com/file/k9SOqgh5jk9PxzuBKdMKsA/IFRC-GO---UI-Library?type=design&node-id=11261-189962&mode=design&t=H77btqXhNDop8ZRl-4',
55+
allowFullscreen: false,
56+
},
57+
},
58+
};
59+
4560
export const Secondary: Story = {
4661
args: {
4762
name: 'button',
@@ -57,6 +72,22 @@ export const Secondary: Story = {
5772
},
5873
};
5974

75+
export const SecondaryButtonWithIcon: Story = {
76+
args: {
77+
name: 'button',
78+
variant: 'primary',
79+
children: 'Primary Button',
80+
// icons: <DownloadTwoFillIcon /> ,
81+
},
82+
parameters: {
83+
design: {
84+
type: 'figma',
85+
url: 'https://www.figma.com/file/k9SOqgh5jk9PxzuBKdMKsA/IFRC-GO---UI-Library?type=design&node-id=11261-189950&mode=design&t=H77btqXhNDop8ZRl-4',
86+
allowFullscreen: false,
87+
},
88+
},
89+
};
90+
6091
export const Tertiary: Story = {
6192
args: {
6293
name: 'button',
@@ -72,6 +103,21 @@ export const Tertiary: Story = {
72103
},
73104
};
74105

106+
export const TertiaryButtonWithIcon: Story = {
107+
args: {
108+
name: 'button',
109+
variant: 'primary',
110+
children: 'Primary Button',
111+
// icons: <DownloadTwoFillIcon /> ,
112+
},
113+
parameters: {
114+
design: {
115+
type: 'figma',
116+
url: 'https://www.figma.com/file/k9SOqgh5jk9PxzuBKdMKsA/IFRC-GO---UI-Library?type=design&node-id=11261-189955&mode=design&t=H77btqXhNDop8ZRl-4',
117+
allowFullscreen: false,
118+
},
119+
},
120+
};
75121
export const TertiaryOnDark: Story = {
76122
args: {
77123
name: 'button',

Diff for: packages/go-ui-storybook/src/stories/IconButton.stories.tsx

+17
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,23 @@ export const Default: Story = {
3636
variant: 'primary',
3737
},
3838
};
39+
40+
export const Secondary: Story = {
41+
args: {
42+
title: 'Add Item',
43+
children: <AddFillIcon />,
44+
variant: 'secondary',
45+
},
46+
};
47+
48+
export const Tertiary: Story = {
49+
args: {
50+
title: 'Add Item',
51+
children: <AddFillIcon />,
52+
variant: 'tertiary',
53+
},
54+
};
55+
3956
export const Disabled: Story = {
4057
args: {
4158
title: 'Download',

Diff for: packages/go-ui-storybook/src/stories/LegendItem.stories.tsx

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { AlertInformationLineIcon } from '@ifrc-go/icons';
12
import { LegendItemProps } from '@ifrc-go/ui';
23
import type {
34
Meta,
@@ -36,3 +37,10 @@ export const WithDifferentColor: Story = {
3637
color: 'orange',
3738
},
3839
};
40+
export const WithIcon: Story = {
41+
args: {
42+
label: 'Emergency appeal',
43+
color: 'green',
44+
icons: <AlertInformationLineIcon />,
45+
},
46+
};

Diff for: packages/go-ui-storybook/src/stories/RawFileInput.stories.tsx

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { UploadTwoLineIcon } from '@ifrc-go/icons';
12
import { RawFileInputProps } from '@ifrc-go/ui';
23
import type {
34
Meta,
@@ -50,6 +51,7 @@ export const WithAccept: Story = {
5051
name: 'RawFileInput',
5152
accept: 'image/png,image/jpeg',
5253
children: 'Upload Image',
54+
variant: 'secondary',
5355
multiple: false,
5456
onChange: fn(),
5557
},
@@ -59,6 +61,7 @@ export const Disabled: Story = {
5961
args: {
6062
name: 'RawFileInput',
6163
children: 'Export',
64+
variant: 'secondary',
6265
multiple: false,
6366
onChange: fn(),
6467
disabled: true,
@@ -69,8 +72,19 @@ export const ReadOnly: Story = {
6972
args: {
7073
name: 'RawFileInput',
7174
children: 'Export',
75+
variant: 'secondary',
7276
readOnly: true,
7377
multiple: false,
7478
onChange: fn(),
7579
},
7680
};
81+
export const WithIcon: Story = {
82+
args: {
83+
name: 'RawFileInput',
84+
children: 'Export',
85+
variant: 'secondary',
86+
icons: <UploadTwoLineIcon />,
87+
multiple: false,
88+
onChange: fn(),
89+
},
90+
};

Diff for: packages/go-ui-storybook/src/stories/Tooltip.stories.tsx

+8
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,11 @@ export const Default: Story = {
4343
preferredWidth: 20,
4444
},
4545
};
46+
47+
export const WithoutTitle: Story = {
48+
render: Template,
49+
args: {
50+
description: 'Click here to access our help documentation and support resources.',
51+
preferredWidth: 20,
52+
},
53+
};

Diff for: packages/ui/src/components/Button/index.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,16 @@ import useBasicLayout from '#hooks/useBasicLayout';
1414
import styles from './styles.module.css';
1515

1616
// NOTE: Adding a 'tertiary-on-dark' to use 'tertiary' button on darker backgrounds
17-
export type ButtonVariant = 'primary' | 'secondary' | 'tertiary' | 'tertiary-on-dark' | 'dropdown-item';
17+
export type ButtonVariant = 'primary' | 'secondary' | 'tertiary' | 'tertiary-on-dark' | 'dropdown-item' | 'process' | 'grey-tertiary';
1818

1919
const buttonVariantToClassNameMap: Record<ButtonVariant, string> = {
2020
primary: styles.primary,
2121
secondary: styles.secondary,
2222
tertiary: styles.tertiary,
2323
'tertiary-on-dark': styles.tertiaryOnDark,
2424
'dropdown-item': styles.dropdownItem,
25+
process: styles.process,
26+
'grey-tertiary': styles.greyTertiary,
2527
};
2628

2729
const spacingTypeToClassNameMap: Record<SpacingType, string> = {

Diff for: packages/ui/src/components/LegendItem/index.tsx

+7
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export interface Props {
66
className?: string;
77
colorClassName?: string;
88
label?: React.ReactNode;
9+
icons?:React.ReactNode
910
iconSrc?: string;
1011
color?: string;
1112
iconClassName?: string;
@@ -18,6 +19,7 @@ function LegendItem(props: Props) {
1819
iconClassName,
1920
color,
2021
label,
22+
icons,
2123
iconSrc,
2224
} = props;
2325

@@ -42,6 +44,11 @@ function LegendItem(props: Props) {
4244
className={_cs(styles.color, colorClassName)}
4345
/>
4446
)}
47+
{icons && (
48+
<div>
49+
{icons}
50+
</div>
51+
)}
4552
<div className={styles.label}>
4653
{label}
4754
</div>

Diff for: packages/ui/src/components/Tooltip/index.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ function Tooltip(props: Props) {
8989
<Container
9090
heading={title}
9191
withInternalPadding
92+
withHeaderBorder
9293
contentViewType="vertical"
9394
>
9495
{description}

0 commit comments

Comments
 (0)