@iota/apps-ui-kit 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/dist/index.d.ts +1622 -0
- package/dist/index.es.js +8805 -0
- package/dist/index.es.js.map +1 -0
- package/dist/index.umd.js +198 -0
- package/dist/index.umd.js.map +1 -0
- package/dist/style.css +1 -0
- package/package.json +5 -2
- package/src/lib/components/atoms/badge/Badge.tsx +37 -0
- package/src/lib/components/atoms/badge/badge.classes.ts +24 -0
- package/src/lib/components/atoms/badge/badge.enums.ts +8 -0
- package/src/lib/components/atoms/badge/index.ts +6 -0
- package/src/lib/components/atoms/button/Button.tsx +99 -0
- package/src/lib/components/atoms/button/button-variants/ButtonPill.tsx +23 -0
- package/src/lib/components/atoms/button/button-variants/ButtonUnstyled.tsx +27 -0
- package/src/lib/components/atoms/button/button-variants/buttonVariants.types.ts +11 -0
- package/src/lib/components/atoms/button/button-variants/index.ts +5 -0
- package/src/lib/components/atoms/button/button.classes.ts +53 -0
- package/src/lib/components/atoms/button/button.enums.ts +21 -0
- package/src/lib/components/atoms/button/index.ts +7 -0
- package/src/lib/components/atoms/button-segment/ButtonSegment.tsx +86 -0
- package/src/lib/components/atoms/button-segment/buttonSegment.classes.ts +45 -0
- package/src/lib/components/atoms/button-segment/buttonSegment.enums.ts +7 -0
- package/src/lib/components/atoms/button-segment/index.ts +5 -0
- package/src/lib/components/atoms/checkbox/Checkbox.tsx +114 -0
- package/src/lib/components/atoms/checkbox/index.ts +4 -0
- package/src/lib/components/atoms/divider/Divider.tsx +48 -0
- package/src/lib/components/atoms/divider/divider.classes.ts +11 -0
- package/src/lib/components/atoms/divider/divider.enums.ts +7 -0
- package/src/lib/components/atoms/divider/index.ts +6 -0
- package/src/lib/components/atoms/header/Header.tsx +73 -0
- package/src/lib/components/atoms/header/index.ts +4 -0
- package/src/lib/components/atoms/index.ts +22 -0
- package/src/lib/components/atoms/info-box/InfoBox.tsx +73 -0
- package/src/lib/components/atoms/info-box/index.ts +5 -0
- package/src/lib/components/atoms/info-box/infoBox.classes.ts +14 -0
- package/src/lib/components/atoms/info-box/infoBox.enums.ts +12 -0
- package/src/lib/components/atoms/key-value-info/KeyValueInfo.tsx +156 -0
- package/src/lib/components/atoms/key-value-info/index.ts +6 -0
- package/src/lib/components/atoms/key-value-info/keyValue.enums.ts +7 -0
- package/src/lib/components/atoms/label-text/LabelText.tsx +93 -0
- package/src/lib/components/atoms/label-text/index.ts +5 -0
- package/src/lib/components/atoms/label-text/labelText.classes.ts +22 -0
- package/src/lib/components/atoms/label-text/labelText.enums.ts +8 -0
- package/src/lib/components/atoms/list-item/ListItem.tsx +89 -0
- package/src/lib/components/atoms/list-item/index.ts +4 -0
- package/src/lib/components/atoms/loading-indicator/LoadingIndicator.tsx +38 -0
- package/src/lib/components/atoms/loading-indicator/index.ts +4 -0
- package/src/lib/components/atoms/panel/Panel.tsx +30 -0
- package/src/lib/components/atoms/panel/index.ts +4 -0
- package/src/lib/components/atoms/placeholder/Placeholder.tsx +27 -0
- package/src/lib/components/atoms/placeholder/index.ts +4 -0
- package/src/lib/components/atoms/radio-button/RadioButton.tsx +68 -0
- package/src/lib/components/atoms/radio-button/index.ts +4 -0
- package/src/lib/components/atoms/secondary-text/SecondaryText.tsx +28 -0
- package/src/lib/components/atoms/secondary-text/index.ts +4 -0
- package/src/lib/components/atoms/skeleton/Skeleton.tsx +47 -0
- package/src/lib/components/atoms/skeleton/index.ts +4 -0
- package/src/lib/components/atoms/snackbar/Snackbar.tsx +69 -0
- package/src/lib/components/atoms/snackbar/index.ts +5 -0
- package/src/lib/components/atoms/snackbar/snackbar.classes.ts +14 -0
- package/src/lib/components/atoms/snackbar/snackbar.enums.tsx +7 -0
- package/src/lib/components/atoms/tooltip/Tooltip.tsx +34 -0
- package/src/lib/components/atoms/tooltip/index.ts +5 -0
- package/src/lib/components/atoms/tooltip/tooltip.classes.ts +11 -0
- package/src/lib/components/atoms/tooltip/tooltip.enums.ts +9 -0
- package/src/lib/components/atoms/visual-asset-card/VisualAssetCard.tsx +93 -0
- package/src/lib/components/atoms/visual-asset-card/index.ts +5 -0
- package/src/lib/components/atoms/visual-asset-card/visualAssetCard.enums.ts +7 -0
- package/src/lib/components/index.ts +8 -0
- package/src/lib/components/molecules/account/Account.tsx +174 -0
- package/src/lib/components/molecules/account/index.ts +4 -0
- package/src/lib/components/molecules/address/Address.tsx +101 -0
- package/src/lib/components/molecules/address/index.ts +4 -0
- package/src/lib/components/molecules/card/Card.tsx +70 -0
- package/src/lib/components/molecules/card/CardAction.tsx +78 -0
- package/src/lib/components/molecules/card/CardBody.tsx +61 -0
- package/src/lib/components/molecules/card/CardImage.tsx +43 -0
- package/src/lib/components/molecules/card/CardImagePlaceholder.tsx +146 -0
- package/src/lib/components/molecules/card/card.classes.ts +26 -0
- package/src/lib/components/molecules/card/card.enums.ts +25 -0
- package/src/lib/components/molecules/card/index.ts +8 -0
- package/src/lib/components/molecules/chip/Chip.tsx +105 -0
- package/src/lib/components/molecules/chip/chip.classes.ts +32 -0
- package/src/lib/components/molecules/chip/chip.enums.ts +7 -0
- package/src/lib/components/molecules/chip/index.ts +4 -0
- package/src/lib/components/molecules/display-stats/DisplayStats.tsx +104 -0
- package/src/lib/components/molecules/display-stats/displayStats.classes.ts +36 -0
- package/src/lib/components/molecules/display-stats/displayStats.enums.ts +13 -0
- package/src/lib/components/molecules/display-stats/index.ts +5 -0
- package/src/lib/components/molecules/dropdown/Dropdown.tsx +10 -0
- package/src/lib/components/molecules/dropdown/dropdownPosition.enums.ts +7 -0
- package/src/lib/components/molecules/dropdown/index.ts +5 -0
- package/src/lib/components/molecules/index.ts +17 -0
- package/src/lib/components/molecules/input/Input.tsx +245 -0
- package/src/lib/components/molecules/input/InputWrapper.tsx +97 -0
- package/src/lib/components/molecules/input/TextArea.tsx +149 -0
- package/src/lib/components/molecules/input/index.ts +8 -0
- package/src/lib/components/molecules/input/input.classes.ts +14 -0
- package/src/lib/components/molecules/input/input.enums.ts +14 -0
- package/src/lib/components/molecules/input/input.types.ts +29 -0
- package/src/lib/components/molecules/navbar-item/NavbarItem.tsx +48 -0
- package/src/lib/components/molecules/navbar-item/NavbarItemHorizontal.tsx +65 -0
- package/src/lib/components/molecules/navbar-item/NavbarItemVertical.tsx +54 -0
- package/src/lib/components/molecules/navbar-item/index.ts +5 -0
- package/src/lib/components/molecules/navbar-item/navbarItem.classes.ts +16 -0
- package/src/lib/components/molecules/navbar-item/navbarItem.enums.ts +7 -0
- package/src/lib/components/molecules/search/Search.tsx +189 -0
- package/src/lib/components/molecules/search/index.ts +5 -0
- package/src/lib/components/molecules/search/search.classes.ts +20 -0
- package/src/lib/components/molecules/search/search.enums.ts +7 -0
- package/src/lib/components/molecules/segmented-button/SegmentedButton.tsx +34 -0
- package/src/lib/components/molecules/segmented-button/index.ts +6 -0
- package/src/lib/components/molecules/segmented-button/segmentedButton.classes.ts +12 -0
- package/src/lib/components/molecules/segmented-button/segmentedButton.enums.ts +8 -0
- package/src/lib/components/molecules/select/Select.tsx +223 -0
- package/src/lib/components/molecules/select/index.ts +5 -0
- package/src/lib/components/molecules/select/select.enums.ts +7 -0
- package/src/lib/components/molecules/table-cell/TableCell.tsx +62 -0
- package/src/lib/components/molecules/table-cell/index.ts +4 -0
- package/src/lib/components/molecules/table-header-cell/TableHeaderCell.tsx +126 -0
- package/src/lib/components/molecules/table-header-cell/index.ts +5 -0
- package/src/lib/components/molecules/table-header-cell/tableHeaderCell.enums.ts +7 -0
- package/src/lib/components/molecules/title/Title.tsx +69 -0
- package/src/lib/components/molecules/title/index.ts +5 -0
- package/src/lib/components/molecules/title/titleClasses.constants.ts +14 -0
- package/src/lib/components/molecules/title/titleSize.enums.ts +7 -0
- package/src/lib/components/organisms/accordion/Accordion.tsx +111 -0
- package/src/lib/components/organisms/accordion/accordion.classes.ts +4 -0
- package/src/lib/components/organisms/accordion/index.ts +4 -0
- package/src/lib/components/organisms/dialog/Dialog.tsx +122 -0
- package/src/lib/components/organisms/dialog/dialog.enums.ts +7 -0
- package/src/lib/components/organisms/dialog/index.ts +5 -0
- package/src/lib/components/organisms/index.ts +7 -0
- package/src/lib/components/organisms/navbar/Navbar.tsx +100 -0
- package/src/lib/components/organisms/navbar/NavbarSlideout.tsx +58 -0
- package/src/lib/components/organisms/navbar/index.ts +5 -0
- package/src/lib/components/organisms/table/Table.tsx +224 -0
- package/src/lib/components/organisms/table/TableContext.tsx +55 -0
- package/src/lib/components/organisms/table/index.ts +4 -0
- package/src/lib/constants/colors.constants.ts +127 -0
- package/src/lib/constants/index.ts +4 -0
- package/src/lib/enums/index.ts +4 -0
- package/src/lib/enums/screenSize.enums.ts +9 -0
- package/src/lib/index.ts +8 -0
- package/src/lib/styles/fonts.css +5 -0
- package/src/lib/styles/index.css +136 -0
- package/src/lib/tailwind/base.presets.ts +47 -0
- package/src/lib/tailwind/constants/fontSizes.constants.ts +201 -0
- package/src/lib/tailwind/constants/index.ts +6 -0
- package/src/lib/tailwind/constants/scaling.constants.ts +41 -0
- package/src/lib/tailwind/constants/variableSpacing.constants.ts +66 -0
- package/src/lib/tailwind/helpers.ts +20 -0
- package/src/lib/tailwind/index.ts +5 -0
- package/src/lib/tailwind/responsive.presets.ts +36 -0
- package/src/lib/tailwind/static.presets.ts +25 -0
- package/src/lib/tailwind/types.ts +6 -0
- package/src/lib/utils/format.ts +8 -0
- package/src/lib/utils/index.ts +4 -0
- package/src/storybook/blocks/Showcase.tsx +20 -0
- package/src/storybook/blocks/TypeSet.tsx +34 -0
- package/src/storybook/blocks/TypeSetItem.tsx +74 -0
- package/src/storybook/blocks/index.ts +6 -0
- package/src/storybook/constants/index.ts +5 -0
- package/src/storybook/constants/typeset.constants.ts +39 -0
- package/src/storybook/constants/variableSpacing.constants.ts +6 -0
- package/src/storybook/helpers/getFontSizeLabel.ts +15 -0
- package/src/storybook/helpers/index.ts +4 -0
- package/src/storybook/stories/atoms/Badge.stories.tsx +32 -0
- package/src/storybook/stories/atoms/Button.stories.tsx +45 -0
- package/src/storybook/stories/atoms/ButtonSegment.stories.tsx +45 -0
- package/src/storybook/stories/atoms/Checkbox.stories.tsx +34 -0
- package/src/storybook/stories/atoms/CustomScrollbar.stories.tsx +22 -0
- package/src/storybook/stories/atoms/Divider.stories.tsx +41 -0
- package/src/storybook/stories/atoms/Header.stories.tsx +58 -0
- package/src/storybook/stories/atoms/InfoBox.stories.tsx +67 -0
- package/src/storybook/stories/atoms/KeyValueInfo.stories.tsx +59 -0
- package/src/storybook/stories/atoms/LabelText.stories.tsx +55 -0
- package/src/storybook/stories/atoms/ListItem.stories.tsx +41 -0
- package/src/storybook/stories/atoms/LoadingIndicator.stories.tsx +32 -0
- package/src/storybook/stories/atoms/Panel.stories.tsx +36 -0
- package/src/storybook/stories/atoms/Placeholder.stories.tsx +33 -0
- package/src/storybook/stories/atoms/RadioButton.stories.tsx +51 -0
- package/src/storybook/stories/atoms/Skeleton.stories.tsx +33 -0
- package/src/storybook/stories/atoms/Snackbar.stories.tsx +42 -0
- package/src/storybook/stories/atoms/Tooltip.stories.tsx +57 -0
- package/src/storybook/stories/atoms/VisualAssetCard.stories.tsx +56 -0
- package/src/storybook/stories/components/VariableSpacingShowcase.tsx +46 -0
- package/src/storybook/stories/components/index.ts +4 -0
- package/src/storybook/stories/design-tokens/colors.stories.mdx +23 -0
- package/src/storybook/stories/design-tokens/icons.stories.mdx +17 -0
- package/src/storybook/stories/design-tokens/typeset.stories.mdx +15 -0
- package/src/storybook/stories/design-tokens/variable-spacing.stories.mdx +10 -0
- package/src/storybook/stories/molecules/Account.stories.tsx +69 -0
- package/src/storybook/stories/molecules/Address.stories.tsx +39 -0
- package/src/storybook/stories/molecules/Card.stories.tsx +115 -0
- package/src/storybook/stories/molecules/Chip.stories.tsx +122 -0
- package/src/storybook/stories/molecules/DisplayStats.stories.tsx +63 -0
- package/src/storybook/stories/molecules/Dropdown.stories.tsx +38 -0
- package/src/storybook/stories/molecules/Input.stories.tsx +161 -0
- package/src/storybook/stories/molecules/NavbarItem.stories.tsx +45 -0
- package/src/storybook/stories/molecules/Search.stories.tsx +100 -0
- package/src/storybook/stories/molecules/SegmentedButton.stories.tsx +107 -0
- package/src/storybook/stories/molecules/Select.stories.tsx +102 -0
- package/src/storybook/stories/molecules/TableCell.stories.tsx +46 -0
- package/src/storybook/stories/molecules/TableHeaderCell.stories.tsx +34 -0
- package/src/storybook/stories/molecules/TextArea.stories.tsx +80 -0
- package/src/storybook/stories/molecules/Title.stories.tsx +76 -0
- package/src/storybook/stories/organisms/Accordion.stories.tsx +70 -0
- package/src/storybook/stories/organisms/Dialog.stories.tsx +103 -0
- package/src/storybook/stories/organisms/Navbar.stories.tsx +77 -0
- package/src/storybook/stories/organisms/Table.stories.tsx +154 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// Copyright (c) 2024 IOTA Stiftung
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
5
|
+
|
|
6
|
+
import { Button } from '@/components/atoms/button/Button';
|
|
7
|
+
import { ButtonSize, ButtonType } from '@/components/atoms/button';
|
|
8
|
+
|
|
9
|
+
const meta: Meta<typeof Button> = {
|
|
10
|
+
component: Button,
|
|
11
|
+
tags: ['autodocs'],
|
|
12
|
+
render: (props) => {
|
|
13
|
+
return <Button {...props} />;
|
|
14
|
+
},
|
|
15
|
+
} satisfies Meta<typeof Button>;
|
|
16
|
+
|
|
17
|
+
export default meta;
|
|
18
|
+
|
|
19
|
+
type Story = StoryObj<typeof meta>;
|
|
20
|
+
|
|
21
|
+
export const Default: Story = {
|
|
22
|
+
args: {
|
|
23
|
+
text: 'Button',
|
|
24
|
+
},
|
|
25
|
+
argTypes: {
|
|
26
|
+
text: {
|
|
27
|
+
control: 'text',
|
|
28
|
+
},
|
|
29
|
+
size: {
|
|
30
|
+
control: {
|
|
31
|
+
type: 'select',
|
|
32
|
+
options: Object.values(ButtonSize),
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
type: {
|
|
36
|
+
control: {
|
|
37
|
+
type: 'select',
|
|
38
|
+
options: Object.values(ButtonType),
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
disabled: {
|
|
42
|
+
control: 'boolean',
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// Copyright (c) 2024 IOTA Stiftung
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
5
|
+
|
|
6
|
+
import { ButtonSegment, ButtonSegmentType } from '@/components/atoms/';
|
|
7
|
+
|
|
8
|
+
const meta: Meta<typeof ButtonSegment> = {
|
|
9
|
+
component: ButtonSegment,
|
|
10
|
+
tags: ['autodocs'],
|
|
11
|
+
render: (props) => {
|
|
12
|
+
return (
|
|
13
|
+
<div className="flex flex-col items-start gap-2">
|
|
14
|
+
<ButtonSegment {...props} />
|
|
15
|
+
</div>
|
|
16
|
+
);
|
|
17
|
+
},
|
|
18
|
+
} satisfies Meta<typeof ButtonSegment>;
|
|
19
|
+
|
|
20
|
+
export default meta;
|
|
21
|
+
|
|
22
|
+
type Story = StoryObj<typeof meta>;
|
|
23
|
+
|
|
24
|
+
export const Default: Story = {
|
|
25
|
+
args: {
|
|
26
|
+
label: 'Label',
|
|
27
|
+
},
|
|
28
|
+
argTypes: {
|
|
29
|
+
label: {
|
|
30
|
+
control: 'text',
|
|
31
|
+
},
|
|
32
|
+
selected: {
|
|
33
|
+
control: 'boolean',
|
|
34
|
+
},
|
|
35
|
+
disabled: {
|
|
36
|
+
control: 'boolean',
|
|
37
|
+
},
|
|
38
|
+
type: {
|
|
39
|
+
control: {
|
|
40
|
+
type: 'select',
|
|
41
|
+
options: Object.values(ButtonSegmentType),
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// Copyright (c) 2024 IOTA Stiftung
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
5
|
+
import { Checkbox } from '@/components';
|
|
6
|
+
|
|
7
|
+
const meta: Meta<typeof Checkbox> = {
|
|
8
|
+
component: Checkbox,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
render: (props) => {
|
|
11
|
+
return (
|
|
12
|
+
<div className="flex">
|
|
13
|
+
<Checkbox {...props} />
|
|
14
|
+
</div>
|
|
15
|
+
);
|
|
16
|
+
},
|
|
17
|
+
} satisfies Meta<typeof Checkbox>;
|
|
18
|
+
|
|
19
|
+
export default meta;
|
|
20
|
+
|
|
21
|
+
type Story = StoryObj<typeof meta>;
|
|
22
|
+
|
|
23
|
+
export const Default: Story = {
|
|
24
|
+
args: {
|
|
25
|
+
label: 'Label',
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const LabelFirst: Story = {
|
|
30
|
+
args: {
|
|
31
|
+
label: 'Label',
|
|
32
|
+
isLabelFirst: true,
|
|
33
|
+
},
|
|
34
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// Copyright (c) 2024 IOTA Stiftung
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import type { StoryObj } from '@storybook/react';
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
title: 'Token Showcase/Scrollbar',
|
|
8
|
+
tags: ['autodocs'],
|
|
9
|
+
render: () => {
|
|
10
|
+
return (
|
|
11
|
+
<div className="h-[300px] w-1/2 overflow-y-scroll">
|
|
12
|
+
<div className="h-[500px]"></div>
|
|
13
|
+
</div>
|
|
14
|
+
);
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default meta;
|
|
19
|
+
|
|
20
|
+
type Story = StoryObj<typeof meta>;
|
|
21
|
+
|
|
22
|
+
export const Default: Story = {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// Copyright (c) 2024 IOTA Stiftung
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
5
|
+
|
|
6
|
+
import { Divider } from '@/components/atoms/divider';
|
|
7
|
+
import { DividerType } from '@/components/atoms/divider';
|
|
8
|
+
|
|
9
|
+
const meta: Meta<typeof Divider> = {
|
|
10
|
+
component: Divider,
|
|
11
|
+
tags: ['autodocs'],
|
|
12
|
+
render: (props) => {
|
|
13
|
+
return (
|
|
14
|
+
<div className="flex h-96 items-center justify-center">
|
|
15
|
+
<Divider {...props} />
|
|
16
|
+
</div>
|
|
17
|
+
);
|
|
18
|
+
},
|
|
19
|
+
} satisfies Meta<typeof Divider>;
|
|
20
|
+
|
|
21
|
+
export default meta;
|
|
22
|
+
|
|
23
|
+
type Story = StoryObj<typeof meta>;
|
|
24
|
+
|
|
25
|
+
export const Default: Story = {
|
|
26
|
+
args: {
|
|
27
|
+
width: 'w-3/4',
|
|
28
|
+
height: 'h-3/4',
|
|
29
|
+
},
|
|
30
|
+
argTypes: {
|
|
31
|
+
width: {
|
|
32
|
+
control: 'text',
|
|
33
|
+
},
|
|
34
|
+
type: {
|
|
35
|
+
control: {
|
|
36
|
+
type: 'select',
|
|
37
|
+
options: Object.values(DividerType),
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// Copyright (c) 2024 IOTA Stiftung
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import { Header } from '@/lib/components/atoms/header';
|
|
5
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
6
|
+
|
|
7
|
+
const meta: Meta<typeof Header> = {
|
|
8
|
+
component: Header,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
render: (props) => {
|
|
11
|
+
return (
|
|
12
|
+
<div className="flex flex-col items-start gap-2">
|
|
13
|
+
<Header {...props} />
|
|
14
|
+
</div>
|
|
15
|
+
);
|
|
16
|
+
},
|
|
17
|
+
} satisfies Meta<typeof Header>;
|
|
18
|
+
|
|
19
|
+
export default meta;
|
|
20
|
+
|
|
21
|
+
type Story = StoryObj<typeof meta>;
|
|
22
|
+
|
|
23
|
+
export const Default: Story = {
|
|
24
|
+
args: {
|
|
25
|
+
title: 'Header',
|
|
26
|
+
onBack: undefined,
|
|
27
|
+
onClose: undefined,
|
|
28
|
+
},
|
|
29
|
+
argTypes: {
|
|
30
|
+
titleCentered: {
|
|
31
|
+
control: 'boolean',
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export const Centered: Story = {
|
|
37
|
+
args: {
|
|
38
|
+
title: 'Header',
|
|
39
|
+
titleCentered: true,
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const CenteredNoIcon: Story = {
|
|
44
|
+
args: {
|
|
45
|
+
title: 'Header',
|
|
46
|
+
titleCentered: true,
|
|
47
|
+
onBack: undefined,
|
|
48
|
+
onClose: undefined,
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export const NoIcon: Story = {
|
|
53
|
+
args: {
|
|
54
|
+
title: 'Header',
|
|
55
|
+
onBack: undefined,
|
|
56
|
+
onClose: undefined,
|
|
57
|
+
},
|
|
58
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// Copyright (c) 2024 IOTA Stiftung
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
5
|
+
import { InfoBox, InfoBoxStyle, InfoBoxType } from '@/components';
|
|
6
|
+
import { Info } from '@iota/apps-ui-icons';
|
|
7
|
+
|
|
8
|
+
const meta: Meta<typeof InfoBox> = {
|
|
9
|
+
component: InfoBox,
|
|
10
|
+
tags: ['autodocs'],
|
|
11
|
+
render: (props) => {
|
|
12
|
+
return <InfoBox {...props} />;
|
|
13
|
+
},
|
|
14
|
+
} satisfies Meta<typeof InfoBox>;
|
|
15
|
+
|
|
16
|
+
export default meta;
|
|
17
|
+
|
|
18
|
+
type Story = StoryObj<typeof meta>;
|
|
19
|
+
|
|
20
|
+
export const Default: Story = {
|
|
21
|
+
args: {
|
|
22
|
+
type: InfoBoxType.Default,
|
|
23
|
+
title: 'Title',
|
|
24
|
+
supportingText: 'This is an info box',
|
|
25
|
+
style: InfoBoxStyle.Default,
|
|
26
|
+
icon: <Info />,
|
|
27
|
+
},
|
|
28
|
+
argTypes: {
|
|
29
|
+
type: {
|
|
30
|
+
control: {
|
|
31
|
+
type: 'select',
|
|
32
|
+
options: Object.values(InfoBoxType),
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
title: {
|
|
36
|
+
control: {
|
|
37
|
+
type: 'text',
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
supportingText: {
|
|
41
|
+
control: {
|
|
42
|
+
type: 'text',
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
icon: {
|
|
46
|
+
control: 'none',
|
|
47
|
+
},
|
|
48
|
+
style: {
|
|
49
|
+
control: {
|
|
50
|
+
type: 'select',
|
|
51
|
+
options: Object.values(InfoBoxStyle),
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export const WithoutIcon: Story = {
|
|
58
|
+
args: {
|
|
59
|
+
type: InfoBoxType.Default,
|
|
60
|
+
title: 'Title',
|
|
61
|
+
supportingText: 'This is an info box without an icon',
|
|
62
|
+
style: InfoBoxStyle.Default,
|
|
63
|
+
},
|
|
64
|
+
render: (props) => {
|
|
65
|
+
return <InfoBox {...props} />;
|
|
66
|
+
},
|
|
67
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// Copyright (c) 2024 IOTA Stiftung
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
5
|
+
import { KeyValueInfo, TooltipPosition, ValueSize } from '@/components';
|
|
6
|
+
|
|
7
|
+
const meta: Meta<typeof KeyValueInfo> = {
|
|
8
|
+
component: KeyValueInfo,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
render: (props) => {
|
|
11
|
+
return (
|
|
12
|
+
<div className="w-1/2">
|
|
13
|
+
<KeyValueInfo {...props} />
|
|
14
|
+
</div>
|
|
15
|
+
);
|
|
16
|
+
},
|
|
17
|
+
} satisfies Meta<typeof KeyValueInfo>;
|
|
18
|
+
|
|
19
|
+
export default meta;
|
|
20
|
+
|
|
21
|
+
type Story = StoryObj<typeof meta>;
|
|
22
|
+
|
|
23
|
+
export const Default: Story = {
|
|
24
|
+
args: {
|
|
25
|
+
keyText: 'Label',
|
|
26
|
+
value: 'Value',
|
|
27
|
+
supportingLabel: 'IOTA',
|
|
28
|
+
size: ValueSize.Small,
|
|
29
|
+
},
|
|
30
|
+
argTypes: {
|
|
31
|
+
keyText: {
|
|
32
|
+
control: 'text',
|
|
33
|
+
},
|
|
34
|
+
value: {
|
|
35
|
+
control: 'text',
|
|
36
|
+
},
|
|
37
|
+
copyText: {
|
|
38
|
+
control: 'text',
|
|
39
|
+
},
|
|
40
|
+
tooltipText: {
|
|
41
|
+
control: 'text',
|
|
42
|
+
},
|
|
43
|
+
tooltipPosition: {
|
|
44
|
+
control: {
|
|
45
|
+
type: 'select',
|
|
46
|
+
options: Object.values(TooltipPosition),
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
supportingLabel: {
|
|
50
|
+
control: 'text',
|
|
51
|
+
},
|
|
52
|
+
size: {
|
|
53
|
+
control: {
|
|
54
|
+
type: 'select',
|
|
55
|
+
options: Object.values(ValueSize),
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// Copyright (c) 2024 IOTA Stiftung
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
5
|
+
|
|
6
|
+
import { LabelText, LabelTextSize, TooltipPosition } from '@/components';
|
|
7
|
+
|
|
8
|
+
const meta: Meta<typeof LabelText> = {
|
|
9
|
+
component: LabelText,
|
|
10
|
+
tags: ['autodocs'],
|
|
11
|
+
render: (props) => {
|
|
12
|
+
return <LabelText {...props} />;
|
|
13
|
+
},
|
|
14
|
+
} satisfies Meta<typeof LabelText>;
|
|
15
|
+
|
|
16
|
+
export default meta;
|
|
17
|
+
|
|
18
|
+
type Story = StoryObj<typeof meta>;
|
|
19
|
+
|
|
20
|
+
export const Default: Story = {
|
|
21
|
+
args: {
|
|
22
|
+
text: '12,000.00',
|
|
23
|
+
label: 'Label',
|
|
24
|
+
size: LabelTextSize.Medium,
|
|
25
|
+
supportingLabel: 'IOTA',
|
|
26
|
+
isCentered: false,
|
|
27
|
+
},
|
|
28
|
+
argTypes: {
|
|
29
|
+
size: {
|
|
30
|
+
control: 'select',
|
|
31
|
+
options: Object.values(LabelTextSize),
|
|
32
|
+
},
|
|
33
|
+
label: {
|
|
34
|
+
control: 'text',
|
|
35
|
+
},
|
|
36
|
+
isCentered: {
|
|
37
|
+
control: 'boolean',
|
|
38
|
+
},
|
|
39
|
+
supportingLabel: {
|
|
40
|
+
control: 'text',
|
|
41
|
+
},
|
|
42
|
+
text: {
|
|
43
|
+
control: 'text',
|
|
44
|
+
},
|
|
45
|
+
tooltipText: {
|
|
46
|
+
control: 'text',
|
|
47
|
+
},
|
|
48
|
+
tooltipPosition: {
|
|
49
|
+
control: {
|
|
50
|
+
type: 'select',
|
|
51
|
+
options: Object.values(TooltipPosition),
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// Copyright (c) 2024 IOTA Stiftung
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import { ListItem } from '@/components';
|
|
5
|
+
import { Seed } from '@iota/apps-ui-icons';
|
|
6
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
7
|
+
|
|
8
|
+
const meta = {
|
|
9
|
+
component: ListItem,
|
|
10
|
+
tags: ['autodocs'],
|
|
11
|
+
render: (props) => {
|
|
12
|
+
return (
|
|
13
|
+
<div className="flex flex-col">
|
|
14
|
+
<ListItem {...props}>
|
|
15
|
+
<div className="flex flex-row items-center gap-2">
|
|
16
|
+
<Seed />
|
|
17
|
+
<div>Item 1</div>
|
|
18
|
+
</div>
|
|
19
|
+
</ListItem>
|
|
20
|
+
</div>
|
|
21
|
+
);
|
|
22
|
+
},
|
|
23
|
+
} satisfies Meta<typeof ListItem>;
|
|
24
|
+
|
|
25
|
+
export default meta;
|
|
26
|
+
|
|
27
|
+
type Story = StoryObj<typeof meta>;
|
|
28
|
+
|
|
29
|
+
export const Default: Story = {
|
|
30
|
+
argTypes: {
|
|
31
|
+
showRightIcon: {
|
|
32
|
+
control: 'boolean',
|
|
33
|
+
},
|
|
34
|
+
isDisabled: {
|
|
35
|
+
control: 'boolean',
|
|
36
|
+
},
|
|
37
|
+
hideBottomBorder: {
|
|
38
|
+
control: 'boolean',
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// Copyright (c) 2024 IOTA Stiftung
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import { LoadingIndicator } from '@/lib/components/atoms';
|
|
5
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
6
|
+
|
|
7
|
+
const meta: Meta<typeof LoadingIndicator> = {
|
|
8
|
+
component: LoadingIndicator,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
render: (props) => {
|
|
11
|
+
return <LoadingIndicator {...props} />;
|
|
12
|
+
},
|
|
13
|
+
} satisfies Meta<typeof LoadingIndicator>;
|
|
14
|
+
|
|
15
|
+
export default meta;
|
|
16
|
+
|
|
17
|
+
type Story = StoryObj<typeof meta>;
|
|
18
|
+
|
|
19
|
+
export const Default: Story = {
|
|
20
|
+
args: {},
|
|
21
|
+
argTypes: {
|
|
22
|
+
color: {
|
|
23
|
+
control: 'text',
|
|
24
|
+
},
|
|
25
|
+
size: {
|
|
26
|
+
control: 'text',
|
|
27
|
+
},
|
|
28
|
+
text: {
|
|
29
|
+
control: 'text',
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// Copyright (c) 2024 IOTA Stiftung
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
5
|
+
import { Address, Panel, Title } from '@/components';
|
|
6
|
+
|
|
7
|
+
const meta: Meta<typeof Panel> = {
|
|
8
|
+
component: Panel,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
render: (props) => {
|
|
11
|
+
return (
|
|
12
|
+
<Panel {...props}>
|
|
13
|
+
<div className="flex flex-col items-start gap-2">
|
|
14
|
+
<Title title="Title" subtitle="subtitle" />
|
|
15
|
+
<div className=" px-md--rs pb-sm--rs">
|
|
16
|
+
<Address text="0x0d7...3f34" isCopyable />
|
|
17
|
+
<Address text="0x0d7...3f35" isCopyable />
|
|
18
|
+
<Address text="0x0d7...3f36" isCopyable />
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
</Panel>
|
|
22
|
+
);
|
|
23
|
+
},
|
|
24
|
+
} satisfies Meta<typeof Panel>;
|
|
25
|
+
|
|
26
|
+
export default meta;
|
|
27
|
+
|
|
28
|
+
type Story = StoryObj<typeof meta>;
|
|
29
|
+
|
|
30
|
+
export const Default: Story = {
|
|
31
|
+
argTypes: {
|
|
32
|
+
hasBorder: {
|
|
33
|
+
control: 'boolean',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Copyright (c) 2024 IOTA Stiftung
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
5
|
+
import { Placeholder } from '@/components';
|
|
6
|
+
|
|
7
|
+
const meta: Meta<typeof Placeholder> = {
|
|
8
|
+
component: Placeholder,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
render: (props) => {
|
|
11
|
+
return <Placeholder {...props} />;
|
|
12
|
+
},
|
|
13
|
+
} satisfies Meta<typeof Placeholder>;
|
|
14
|
+
|
|
15
|
+
export default meta;
|
|
16
|
+
|
|
17
|
+
type Story = StoryObj<typeof meta>;
|
|
18
|
+
|
|
19
|
+
export const Default: Story = {
|
|
20
|
+
args: {},
|
|
21
|
+
argTypes: {
|
|
22
|
+
width: {
|
|
23
|
+
control: {
|
|
24
|
+
type: 'text',
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
height: {
|
|
28
|
+
control: {
|
|
29
|
+
type: 'text',
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// Copyright (c) 2024 IOTA Stiftung
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
5
|
+
|
|
6
|
+
import { RadioButton } from '@/components/atoms';
|
|
7
|
+
import { useEffect, useState } from 'react';
|
|
8
|
+
|
|
9
|
+
const meta: Meta<typeof RadioButton> = {
|
|
10
|
+
component: RadioButton,
|
|
11
|
+
tags: ['autodocs'],
|
|
12
|
+
render: (props) => {
|
|
13
|
+
const { isChecked } = props;
|
|
14
|
+
const [checked, setIsChecked] = useState<boolean>(isChecked ?? false);
|
|
15
|
+
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
setIsChecked(isChecked ?? false);
|
|
18
|
+
}, [isChecked]);
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<RadioButton
|
|
22
|
+
{...props}
|
|
23
|
+
isChecked={checked}
|
|
24
|
+
onChange={(e) => setIsChecked(e.target.checked)}
|
|
25
|
+
/>
|
|
26
|
+
);
|
|
27
|
+
},
|
|
28
|
+
} satisfies Meta<typeof RadioButton>;
|
|
29
|
+
|
|
30
|
+
export default meta;
|
|
31
|
+
|
|
32
|
+
type Story = StoryObj<typeof meta>;
|
|
33
|
+
|
|
34
|
+
export const Default: Story = {
|
|
35
|
+
args: {
|
|
36
|
+
label: 'Radio Button',
|
|
37
|
+
isChecked: false,
|
|
38
|
+
isDisabled: false,
|
|
39
|
+
},
|
|
40
|
+
argTypes: {
|
|
41
|
+
label: {
|
|
42
|
+
control: 'text',
|
|
43
|
+
},
|
|
44
|
+
isChecked: {
|
|
45
|
+
control: 'boolean',
|
|
46
|
+
},
|
|
47
|
+
isDisabled: {
|
|
48
|
+
control: 'boolean',
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Copyright (c) 2024 IOTA Stiftung
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
5
|
+
import { Card, CardImage, ImageShape, Skeleton } from '@/components';
|
|
6
|
+
|
|
7
|
+
const meta: Meta<typeof Skeleton> = {
|
|
8
|
+
component: Skeleton,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
} satisfies Meta<typeof Skeleton>;
|
|
11
|
+
|
|
12
|
+
export default meta;
|
|
13
|
+
|
|
14
|
+
type Story = StoryObj<typeof meta>;
|
|
15
|
+
|
|
16
|
+
export const SkeletonCard: Story = {
|
|
17
|
+
render: () => (
|
|
18
|
+
<Card>
|
|
19
|
+
<CardImage shape={ImageShape.SquareRounded}>
|
|
20
|
+
<div className="h-10 w-10 animate-pulse bg-neutral-90 dark:bg-neutral-12" />
|
|
21
|
+
<Skeleton widthClass="w-10" heightClass="h-10" isRounded={false} />
|
|
22
|
+
</CardImage>
|
|
23
|
+
<div className="flex flex-col gap-y-xs">
|
|
24
|
+
<Skeleton widthClass="w-40" heightClass="h-3.5" />
|
|
25
|
+
<Skeleton widthClass="w-32" heightClass="h-3" hasSecondaryColors />
|
|
26
|
+
</div>
|
|
27
|
+
<div className="ml-auto flex flex-col gap-y-xs">
|
|
28
|
+
<Skeleton widthClass="w-20" heightClass="h-3.5" />
|
|
29
|
+
<Skeleton widthClass="w-16" heightClass="h-3" hasSecondaryColors />
|
|
30
|
+
</div>
|
|
31
|
+
</Card>
|
|
32
|
+
),
|
|
33
|
+
};
|