@taiv/ui 1.12.0 → 1.14.0
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/dist/assets/assets.d.ts +5 -0
- package/dist/assets/assets.d.ts.map +1 -0
- package/dist/assets/assets.js +18 -0
- package/dist/assets/icons.d.ts +12 -0
- package/dist/assets/icons.d.ts.map +1 -0
- package/dist/assets/icons.js +62 -0
- package/dist/assets/svgs/GoogleIcon.d.ts +5 -0
- package/dist/assets/svgs/GoogleIcon.d.ts.map +1 -0
- package/dist/assets/svgs/GoogleIcon.js +2 -0
- package/dist/components/Data/Cards/ChartCard/ChartCard.d.ts.map +1 -1
- package/dist/components/Data/Cards/ChartCard/ChartCard.js +3 -2
- package/dist/components/Data/Cards/PieChartCard/PieChartCard.d.ts.map +1 -1
- package/dist/components/Data/Cards/PieChartCard/PieChartCard.js +2 -1
- package/dist/components/Data/Cards/StatsCard/StatsCard.d.ts.map +1 -1
- package/dist/components/Data/Cards/StatsCard/StatsCard.js +2 -1
- package/dist/components/Data/Chart/Chart.d.ts.map +1 -1
- package/dist/components/Data/Chart/Chart.js +5 -4
- package/dist/components/Data/Chart/Chart.stories.d.ts.map +1 -1
- package/dist/components/Data/Chart/Chart.stories.js +6 -5
- package/dist/components/Data/CheckboxTable/CheckboxTable.d.ts.map +1 -1
- package/dist/components/Data/CheckboxTable/CheckboxTable.js +15 -14
- package/dist/components/Data/PieChart/PieChart.d.ts.map +1 -1
- package/dist/components/Data/PieChart/PieChart.js +4 -3
- package/dist/components/Data/PieChart/PieChart.stories.d.ts.map +1 -1
- package/dist/components/Data/PieChart/PieChart.stories.js +4 -3
- package/dist/components/Data/Progress/Progress.stories.d.ts.map +1 -1
- package/dist/components/Data/Progress/Progress.stories.js +7 -6
- package/dist/components/Data/RemovableItemList/RemovableItemList.d.ts.map +1 -1
- package/dist/components/Data/RemovableItemList/RemovableItemList.js +4 -3
- package/dist/components/Info/Badge/Badge.stories.d.ts.map +1 -1
- package/dist/components/Info/Badge/Badge.stories.js +5 -4
- package/dist/components/Info/Badge/sizes.d.ts.map +1 -1
- package/dist/components/Info/Badge/sizes.js +7 -6
- package/dist/components/Info/Badge/variants.d.ts.map +1 -1
- package/dist/components/Info/Badge/variants.js +3 -2
- package/dist/components/Info/InfoCard/InfoCard.d.ts.map +1 -1
- package/dist/components/Info/InfoCard/InfoCard.js +2 -1
- package/dist/components/Info/Modals/FormModal/FormModal.d.ts.map +1 -1
- package/dist/components/Info/Modals/FormModal/FormModal.js +12 -11
- package/dist/components/Info/Modals/FormModal/FormModal.stories.js +11 -11
- package/dist/components/Info/Modals/Modal/Modal.d.ts.map +1 -1
- package/dist/components/Info/Modals/Modal/Modal.js +7 -6
- package/dist/components/Info/Modals/Modal/Modal.stories.d.ts +7 -0
- package/dist/components/Info/Modals/Modal/Modal.stories.d.ts.map +1 -0
- package/dist/components/Info/Modals/Modal/Modal.stories.js +61 -0
- package/dist/components/Info/Modals/Modals.stories.d.ts +16 -0
- package/dist/components/Info/Modals/Modals.stories.d.ts.map +1 -0
- package/dist/components/Info/Modals/Modals.stories.js +102 -0
- package/dist/components/Info/Notifications/NotificationProvider/NotificationProvider.d.ts.map +1 -1
- package/dist/components/Info/Notifications/NotificationProvider/NotificationProvider.js +7 -6
- package/dist/components/Info/Notifications/Notifications.stories.d.ts +10 -0
- package/dist/components/Info/Notifications/Notifications.stories.d.ts.map +1 -0
- package/dist/components/Info/Notifications/Notifications.stories.js +107 -0
- package/dist/components/Info/Tooltips/FormulaTooltip/FormulaTooltip.d.ts.map +1 -1
- package/dist/components/Info/Tooltips/FormulaTooltip/FormulaTooltip.js +2 -1
- package/dist/components/Info/Tooltips/InfoTooltip/InfoTooltip.d.ts +4 -4
- package/dist/components/Info/Tooltips/InfoTooltip/InfoTooltip.js +4 -4
- package/dist/components/Info/Tooltips/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/Info/Tooltips/Tooltip/Tooltip.js +2 -1
- package/dist/components/Inputs/Buttons/Button/Button.js +2 -2
- package/dist/components/Inputs/Buttons/Button/Button.stories.d.ts +1 -0
- package/dist/components/Inputs/Buttons/Button/Button.stories.d.ts.map +1 -1
- package/dist/components/Inputs/Buttons/Button/Button.stories.js +53 -46
- package/dist/components/Inputs/Buttons/Button/sizes.d.ts.map +1 -1
- package/dist/components/Inputs/Buttons/Button/sizes.js +4 -3
- package/dist/components/Inputs/Buttons/IconButton/IconButton.js +2 -2
- package/dist/components/Inputs/Buttons/IconButton/IconButton.stories.d.ts.map +1 -1
- package/dist/components/Inputs/Buttons/IconButton/IconButton.stories.js +7 -6
- package/dist/components/Inputs/Buttons/IconButton/sizes.d.ts.map +1 -1
- package/dist/components/Inputs/Buttons/IconButton/sizes.js +4 -3
- package/dist/components/Inputs/Buttons/SSOButton/SSOButton.d.ts +35 -0
- package/dist/components/Inputs/Buttons/SSOButton/SSOButton.d.ts.map +1 -0
- package/dist/components/Inputs/Buttons/SSOButton/SSOButton.js +37 -0
- package/dist/components/Inputs/Buttons/SSOButton/SSOButton.stories.d.ts +14 -0
- package/dist/components/Inputs/Buttons/SSOButton/SSOButton.stories.d.ts.map +1 -0
- package/dist/components/Inputs/Buttons/SSOButton/SSOButton.stories.js +121 -0
- package/dist/components/Inputs/Buttons/UnstyledButton/UnstyledButton.stories.d.ts.map +1 -1
- package/dist/components/Inputs/Buttons/UnstyledButton/UnstyledButton.stories.js +4 -3
- package/dist/components/Inputs/Buttons/shared/variants.d.ts +29 -29
- package/dist/components/Inputs/Buttons/shared/variants.d.ts.map +1 -1
- package/dist/components/Inputs/Buttons/shared/variants.js +6 -5
- package/dist/components/Inputs/Controls/Checkbox/Checkbox.stories.js +3 -3
- package/dist/components/Inputs/Controls/Radio/Radio.js +1 -1
- package/dist/components/Inputs/Controls/Radio/Radio.stories.js +3 -3
- package/dist/components/Inputs/Controls/RadioList/RadioList.d.ts.map +1 -1
- package/dist/components/Inputs/Controls/RadioList/RadioList.js +3 -2
- package/dist/components/Inputs/Controls/RadioList/RadioList.stories.d.ts.map +1 -1
- package/dist/components/Inputs/Controls/RadioList/RadioList.stories.js +3 -2
- package/dist/components/Inputs/Controls/SegmentedControl/SegmentedControl.stories.d.ts.map +1 -1
- package/dist/components/Inputs/Controls/SegmentedControl/SegmentedControl.stories.js +6 -5
- package/dist/components/Inputs/Controls/Toggle/Toggle.d.ts +4 -4
- package/dist/components/Inputs/Controls/Toggle/Toggle.js +5 -5
- package/dist/components/Inputs/Controls/Toggle/Toggle.stories.js +4 -4
- package/dist/components/Inputs/Dates/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/components/Inputs/Dates/DatePicker/DatePicker.js +5 -4
- package/dist/components/Inputs/Dates/DatePicker/DatePicker.stories.js +4 -4
- package/dist/components/Inputs/Dropdowns/CascadingSelect/CascadingSelect.d.ts.map +1 -1
- package/dist/components/Inputs/Dropdowns/CascadingSelect/CascadingSelect.js +6 -5
- package/dist/components/Inputs/Dropdowns/CascadingSelect/CascadingSelect.stories.js +5 -5
- package/dist/components/Inputs/Dropdowns/FontSelect/FontSelect.js +3 -3
- package/dist/components/Inputs/Dropdowns/FontSelect/FontSelect.stories.js +5 -5
- package/dist/components/Inputs/Dropdowns/MultiSelect/MultiSelect.d.ts.map +1 -1
- package/dist/components/Inputs/Dropdowns/MultiSelect/MultiSelect.js +7 -6
- package/dist/components/Inputs/Dropdowns/MultiSelect/MultiSelect.stories.js +5 -5
- package/dist/components/Inputs/Dropdowns/Select/Select.d.ts.map +1 -1
- package/dist/components/Inputs/Dropdowns/Select/Select.js +6 -5
- package/dist/components/Inputs/Dropdowns/Select/Select.stories.js +4 -4
- package/dist/components/Inputs/Dropdowns/shared/sizes.js +18 -18
- package/dist/components/Inputs/Sliders/Slider/Slider.d.ts.map +1 -1
- package/dist/components/Inputs/Sliders/Slider/Slider.js +15 -14
- package/dist/components/Inputs/Sliders/VolumeSlider/VolumeSlider.d.ts.map +1 -1
- package/dist/components/Inputs/Sliders/VolumeSlider/VolumeSlider.js +5 -4
- package/dist/components/Inputs/Sliders/shared/sizes.d.ts +9 -9
- package/dist/components/Inputs/Sliders/shared/sizes.js +9 -9
- package/dist/components/Inputs/TextInputs/AutoComplete/AutoComplete.d.ts.map +1 -1
- package/dist/components/Inputs/TextInputs/AutoComplete/AutoComplete.js +5 -4
- package/dist/components/Inputs/TextInputs/AutoComplete/AutoComplete.stories.js +5 -5
- package/dist/components/Inputs/TextInputs/NumberInput/NumberInput.js +10 -10
- package/dist/components/Inputs/TextInputs/NumberInput/NumberInput.stories.js +5 -5
- package/dist/components/Inputs/TextInputs/PasswordInput/PasswordInput.js +8 -8
- package/dist/components/Inputs/TextInputs/PasswordInput/PasswordInput.stories.js +5 -5
- package/dist/components/Inputs/TextInputs/SearchBar/SearchBar.d.ts.map +1 -1
- package/dist/components/Inputs/TextInputs/SearchBar/SearchBar.js +4 -3
- package/dist/components/Inputs/TextInputs/SearchBar/SearchBar.stories.js +5 -5
- package/dist/components/Inputs/TextInputs/TextArea/TextArea.d.ts.map +1 -1
- package/dist/components/Inputs/TextInputs/TextArea/TextArea.js +6 -5
- package/dist/components/Inputs/TextInputs/TextArea/TextArea.stories.js +5 -5
- package/dist/components/Inputs/TextInputs/TextInput/TextInput.js +5 -5
- package/dist/components/Inputs/TextInputs/TextInput/TextInput.stories.js +5 -5
- package/dist/components/Inputs/TextInputs/shared/sizes.d.ts +6 -6
- package/dist/components/Inputs/TextInputs/shared/sizes.js +3 -3
- package/dist/components/Layout/AutoGrid/AutoGrid.stories.d.ts +7 -0
- package/dist/components/Layout/AutoGrid/AutoGrid.stories.d.ts.map +1 -0
- package/dist/components/Layout/AutoGrid/AutoGrid.stories.js +78 -0
- package/dist/components/Layout/Box/Box.d.ts +1 -3
- package/dist/components/Layout/Box/Box.d.ts.map +1 -1
- package/dist/components/Layout/Box/Box.js +2 -2
- package/dist/components/Layout/Box/Box.stories.d.ts +1 -2
- package/dist/components/Layout/Box/Box.stories.d.ts.map +1 -1
- package/dist/components/Layout/Box/Box.stories.js +28 -98
- package/dist/components/Layout/Card/Card.d.ts +1 -1
- package/dist/components/Layout/Card/Card.d.ts.map +1 -1
- package/dist/components/Layout/Card/Card.js +2 -2
- package/dist/components/Layout/Card/Card.stories.d.ts +10 -0
- package/dist/components/Layout/Card/Card.stories.d.ts.map +1 -0
- package/dist/components/Layout/Card/Card.stories.js +92 -0
- package/dist/components/Layout/Center/Center.d.ts +2 -3
- package/dist/components/Layout/Center/Center.d.ts.map +1 -1
- package/dist/components/Layout/Center/Center.js +2 -2
- package/dist/components/Layout/Center/Center.stories.d.ts +8 -0
- package/dist/components/Layout/Center/Center.stories.d.ts.map +1 -0
- package/dist/components/Layout/Center/Center.stories.js +70 -0
- package/dist/components/Layout/Divider/Divider.stories.d.ts +7 -0
- package/dist/components/Layout/Divider/Divider.stories.d.ts.map +1 -0
- package/dist/components/Layout/Divider/Divider.stories.js +67 -0
- package/dist/components/Layout/Frame/Frame.js +1 -1
- package/dist/components/Layout/Frame/Frame.stories.d.ts +8 -0
- package/dist/components/Layout/Frame/Frame.stories.d.ts.map +1 -0
- package/dist/components/Layout/Frame/Frame.stories.js +78 -0
- package/dist/components/Layout/Grid/Grid.stories.d.ts +8 -0
- package/dist/components/Layout/Grid/Grid.stories.d.ts.map +1 -0
- package/dist/components/Layout/Grid/Grid.stories.js +72 -0
- package/dist/components/Layout/Group/Group.stories.d.ts +10 -0
- package/dist/components/Layout/Group/Group.stories.d.ts.map +1 -0
- package/dist/components/Layout/Group/Group.stories.js +114 -0
- package/dist/components/Layout/Loader/Loader.stories.d.ts +10 -0
- package/dist/components/Layout/Loader/Loader.stories.d.ts.map +1 -0
- package/dist/components/Layout/Loader/Loader.stories.js +68 -0
- package/dist/components/Layout/SectionCard/SectionCard.d.ts +3 -5
- package/dist/components/Layout/SectionCard/SectionCard.d.ts.map +1 -1
- package/dist/components/Layout/SectionCard/SectionCard.js +3 -8
- package/dist/components/Layout/SectionCard/SectionCard.stories.d.ts +9 -0
- package/dist/components/Layout/SectionCard/SectionCard.stories.d.ts.map +1 -0
- package/dist/components/Layout/SectionCard/SectionCard.stories.js +98 -0
- package/dist/components/Layout/Stack/Stack.stories.d.ts +1 -2
- package/dist/components/Layout/Stack/Stack.stories.d.ts.map +1 -1
- package/dist/components/Layout/Stack/Stack.stories.js +47 -66
- package/dist/components/Layout/Table/Table.stories.d.ts.map +1 -1
- package/dist/components/Layout/Table/Table.stories.js +4 -3
- package/dist/components/Layout/Tabs/Tabs.d.ts +2 -4
- package/dist/components/Layout/Tabs/Tabs.d.ts.map +1 -1
- package/dist/components/Layout/Tabs/Tabs.js +7 -6
- package/dist/components/Layout/Tabs/Tabs.stories.d.ts +9 -0
- package/dist/components/Layout/Tabs/Tabs.stories.d.ts.map +1 -0
- package/dist/components/Layout/Tabs/Tabs.stories.js +141 -0
- package/dist/components/Misc/IconBadge/IconBadge.js +1 -1
- package/dist/components/Misc/IconBadge/IconBadge.stories.d.ts +7 -0
- package/dist/components/Misc/IconBadge/IconBadge.stories.d.ts.map +1 -0
- package/dist/components/Misc/IconBadge/IconBadge.stories.js +48 -0
- package/dist/components/Misc/Stepper/Step.d.ts +16 -0
- package/dist/components/Misc/Stepper/Step.d.ts.map +1 -0
- package/dist/components/Misc/Stepper/Step.js +7 -0
- package/dist/components/Misc/Stepper/Step.stories.d.ts +477 -0
- package/dist/components/Misc/Stepper/Step.stories.d.ts.map +1 -0
- package/dist/components/Misc/Stepper/Step.stories.js +83 -0
- package/dist/components/Misc/Stepper/Stepper.d.ts +10 -0
- package/dist/components/Misc/Stepper/Stepper.d.ts.map +1 -0
- package/dist/components/Misc/Stepper/Stepper.js +72 -0
- package/dist/components/Misc/Stepper/Stepper.stories.d.ts +13 -0
- package/dist/components/Misc/Stepper/Stepper.stories.d.ts.map +1 -0
- package/dist/components/Misc/Stepper/Stepper.stories.js +126 -0
- package/dist/components/Misc/Stepper/variants.d.ts +54 -0
- package/dist/components/Misc/Stepper/variants.d.ts.map +1 -0
- package/dist/components/Misc/Stepper/variants.js +48 -0
- package/dist/components/Typography/CollapsibleText/CollapsibleText.d.ts.map +1 -1
- package/dist/components/Typography/CollapsibleText/CollapsibleText.js +2 -1
- package/dist/components/Typography/CollapsibleText/CollapsibleText.stories.d.ts.map +1 -1
- package/dist/components/Typography/CollapsibleText/CollapsibleText.stories.js +4 -3
- package/dist/components/Typography/CollapsibleTitle/CollapsibleTitle.d.ts.map +1 -1
- package/dist/components/Typography/CollapsibleTitle/CollapsibleTitle.js +2 -1
- package/dist/components/Typography/CollapsibleTitle/CollapsibleTitle.stories.d.ts.map +1 -1
- package/dist/components/Typography/CollapsibleTitle/CollapsibleTitle.stories.js +4 -3
- package/dist/components/Typography/Formula/Formula.d.ts.map +1 -1
- package/dist/components/Typography/Formula/Formula.js +5 -4
- package/dist/components/Typography/Formula/Formula.stories.d.ts +10 -0
- package/dist/components/Typography/Formula/Formula.stories.d.ts.map +1 -0
- package/dist/components/Typography/Formula/Formula.stories.js +85 -0
- package/dist/components/Typography/Fraction/Fraction.d.ts.map +1 -1
- package/dist/components/Typography/Fraction/Fraction.js +2 -1
- package/dist/components/Typography/Fraction/Fraction.stories.d.ts +9 -0
- package/dist/components/Typography/Fraction/Fraction.stories.d.ts.map +1 -0
- package/dist/components/Typography/Fraction/Fraction.stories.js +87 -0
- package/dist/components/Typography/Text/Text.d.ts.map +1 -1
- package/dist/components/Typography/Text/Text.js +6 -0
- package/dist/components/Typography/Text/Text.stories.d.ts +10 -0
- package/dist/components/Typography/Text/Text.stories.d.ts.map +1 -0
- package/dist/components/Typography/Text/Text.stories.js +101 -0
- package/dist/components/Typography/Title/Title.stories.d.ts +9 -0
- package/dist/components/Typography/Title/Title.stories.d.ts.map +1 -0
- package/dist/components/Typography/Title/Title.stories.js +98 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +3 -0
- package/dist/constants/breakpoints.d.ts +1 -1
- package/dist/constants/breakpoints.js +1 -1
- package/dist/constants/colors.d.ts +1 -0
- package/dist/constants/colors.d.ts.map +1 -1
- package/dist/constants/colors.js +1 -0
- package/dist/constants/font.js +10 -10
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/index.js +1 -0
- package/dist/constants/spacing.d.ts +12 -0
- package/dist/constants/spacing.d.ts.map +1 -0
- package/dist/constants/spacing.js +11 -0
- package/dist/docs/AIGeneratedBanner.d.ts +2 -0
- package/dist/docs/AIGeneratedBanner.d.ts.map +1 -0
- package/dist/docs/AIGeneratedBanner.js +5 -0
- package/dist/docs/design/Colors.stories.d.ts +7 -0
- package/dist/docs/design/Colors.stories.d.ts.map +1 -0
- package/dist/docs/design/Colors.stories.js +29 -0
- package/dist/docs/design/Spacing.stories.d.ts +6 -0
- package/dist/docs/design/Spacing.stories.d.ts.map +1 -0
- package/dist/docs/design/Spacing.stories.js +24 -0
- package/dist/docs/hooks/Copy.stories.d.ts +6 -0
- package/dist/docs/hooks/Copy.stories.d.ts.map +1 -0
- package/dist/docs/hooks/Copy.stories.js +61 -0
- package/dist/hooks/useConfirmationModal.d.ts.map +1 -1
- package/dist/hooks/useConfirmationModal.js +10 -9
- package/dist/hooks/useInfoModal.d.ts.map +1 -1
- package/dist/hooks/useInfoModal.js +10 -9
- package/dist/hooks/useMediaQuery.d.ts +2 -2
- package/dist/hooks/useMediaQuery.js +6 -6
- package/package.json +43 -32
|
@@ -1,51 +1,66 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Stack } from './Stack';
|
|
3
|
-
import {
|
|
3
|
+
import { Text } from '../../Typography/Text/Text';
|
|
4
|
+
import { Card } from '../Card/Card';
|
|
5
|
+
import { Group } from '../Group/Group';
|
|
6
|
+
import { neutral } from '../../../constants/colors';
|
|
7
|
+
import { spacing } from '../../../constants/spacing';
|
|
4
8
|
const meta = {
|
|
5
|
-
title: '
|
|
9
|
+
title: 'Components/Layout/Stack',
|
|
6
10
|
component: Stack,
|
|
11
|
+
parameters: {
|
|
12
|
+
layout: 'centered',
|
|
13
|
+
},
|
|
7
14
|
argTypes: {
|
|
8
|
-
|
|
9
|
-
control:
|
|
10
|
-
|
|
11
|
-
description: 'align-items CSS property',
|
|
15
|
+
children: {
|
|
16
|
+
control: false,
|
|
17
|
+
description: 'Content to arrange within the stack',
|
|
12
18
|
table: {
|
|
13
|
-
type: { summary: '
|
|
19
|
+
type: { summary: 'ReactNode' },
|
|
14
20
|
},
|
|
15
21
|
},
|
|
16
22
|
justify: {
|
|
17
23
|
control: { type: 'select' },
|
|
18
24
|
options: ['flex-start', 'center', 'flex-end', 'space-between', 'space-around', 'space-evenly'],
|
|
19
|
-
description: '
|
|
25
|
+
description: 'Vertical alignment',
|
|
20
26
|
table: {
|
|
21
|
-
type: { summary: '
|
|
27
|
+
type: { summary: "'flex-start' | 'center' | 'flex-end' | 'space-between' | 'space-around' | 'space-evenly'" },
|
|
28
|
+
defaultValue: { summary: "'flex-start'" },
|
|
22
29
|
},
|
|
23
30
|
},
|
|
24
|
-
|
|
31
|
+
align: {
|
|
25
32
|
control: { type: 'select' },
|
|
26
|
-
options: ['
|
|
27
|
-
description: '
|
|
33
|
+
options: ['stretch', 'center', 'flex-start', 'flex-end', 'baseline'],
|
|
34
|
+
description: 'Horizontal alignment',
|
|
28
35
|
table: {
|
|
29
|
-
type: { summary: '
|
|
36
|
+
type: { summary: "'stretch' | 'center' | 'flex-start' | 'flex-end' | 'baseline'" },
|
|
37
|
+
defaultValue: { summary: "'stretch'" },
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
gap: {
|
|
41
|
+
control: { type: 'text' },
|
|
42
|
+
description: 'Spacing between items',
|
|
43
|
+
table: {
|
|
44
|
+
type: { summary: 'string' },
|
|
30
45
|
},
|
|
31
46
|
},
|
|
32
47
|
width: {
|
|
33
48
|
control: { type: 'text' },
|
|
34
|
-
description: 'Custom width',
|
|
49
|
+
description: 'Custom width override',
|
|
35
50
|
table: {
|
|
36
51
|
type: { summary: 'string | number' },
|
|
37
52
|
},
|
|
38
53
|
},
|
|
39
|
-
|
|
54
|
+
h: {
|
|
40
55
|
control: { type: 'text' },
|
|
41
|
-
description: 'Custom
|
|
56
|
+
description: 'Custom height override',
|
|
42
57
|
table: {
|
|
43
|
-
type: { summary: 'string' },
|
|
58
|
+
type: { summary: 'string | number' },
|
|
44
59
|
},
|
|
45
60
|
},
|
|
46
61
|
styles: {
|
|
47
62
|
control: { type: 'object' },
|
|
48
|
-
description: 'Custom styles
|
|
63
|
+
description: 'Custom styles override - use this sparingly',
|
|
49
64
|
table: {
|
|
50
65
|
type: { summary: 'Record<string, CSSObject>' },
|
|
51
66
|
},
|
|
@@ -53,56 +68,22 @@ const meta = {
|
|
|
53
68
|
},
|
|
54
69
|
};
|
|
55
70
|
export default meta;
|
|
56
|
-
const
|
|
57
|
-
backgroundColor: theme.colors[color][0],
|
|
58
|
-
color: theme.colors[color][9],
|
|
59
|
-
padding: theme.spacing.md,
|
|
60
|
-
borderRadius: theme.radius.md,
|
|
61
|
-
border: `1px solid ${theme.colors[color][3]}`,
|
|
62
|
-
textAlign: 'center',
|
|
63
|
-
minHeight: '60px',
|
|
64
|
-
display: 'flex',
|
|
65
|
-
alignItems: 'center',
|
|
66
|
-
justifyContent: 'center',
|
|
67
|
-
}), children: children }));
|
|
71
|
+
const SampleCard = ({ label }) => (_jsx(Card, { children: _jsx(Text, { weight: "bold", children: label }) }));
|
|
68
72
|
export const Default = {
|
|
69
73
|
args: {
|
|
70
|
-
|
|
71
|
-
justify:
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
render: () => (_jsxs("div", { style: { display: 'flex', gap: '2rem', flexWrap: 'wrap' }, children: [_jsxs("div", { children: [_jsx("h4", { children: "Justify Content" }), _jsxs("div", { style: { display: 'flex', gap: '1rem', flexDirection: 'column' }, children: [_jsxs("div", { children: [_jsx("strong", { children: "flex-start" }), _jsxs(Stack, { justify: "flex-start", spacing: "sm", style: { height: '200px', border: '1px solid #ccc', padding: '1rem' }, children: [_jsx(SampleBox, { color: "blue", children: "Item 1" }), _jsx(SampleBox, { color: "green", children: "Item 2" })] })] }), _jsxs("div", { children: [_jsx("strong", { children: "center" }), _jsxs(Stack, { justify: "center", spacing: "sm", style: { height: '200px', border: '1px solid #ccc', padding: '1rem' }, children: [_jsx(SampleBox, { color: "blue", children: "Item 1" }), _jsx(SampleBox, { color: "green", children: "Item 2" })] })] }), _jsxs("div", { children: [_jsx("strong", { children: "space-between" }), _jsxs(Stack, { justify: "space-between", spacing: "sm", style: { height: '200px', border: '1px solid #ccc', padding: '1rem' }, children: [_jsx(SampleBox, { color: "blue", children: "Item 1" }), _jsx(SampleBox, { color: "green", children: "Item 2" })] })] })] })] }), _jsxs("div", { children: [_jsx("h4", { children: "Align Items" }), _jsxs("div", { style: { display: 'flex', gap: '1rem', flexDirection: 'column' }, children: [_jsxs("div", { children: [_jsx("strong", { children: "stretch" }), _jsxs(Stack, { align: "stretch", spacing: "sm", style: { height: '200px', border: '1px solid #ccc', padding: '1rem' }, children: [_jsx(SampleBox, { color: "blue", children: "Item 1" }), _jsx(SampleBox, { color: "green", children: "Item 2" })] })] }), _jsxs("div", { children: [_jsx("strong", { children: "center" }), _jsxs(Stack, { align: "center", spacing: "sm", style: { height: '200px', border: '1px solid #ccc', padding: '1rem' }, children: [_jsx(SampleBox, { color: "blue", children: "Item 1" }), _jsx(SampleBox, { color: "green", children: "Item 2" })] })] }), _jsxs("div", { children: [_jsx("strong", { children: "flex-end" }), _jsxs(Stack, { align: "flex-end", spacing: "sm", style: { height: '200px', border: '1px solid #ccc', padding: '1rem' }, children: [_jsx(SampleBox, { color: "blue", children: "Item 1" }), _jsx(SampleBox, { color: "green", children: "Item 2" })] })] })] })] })] })),
|
|
78
|
-
parameters: {
|
|
79
|
-
docs: {
|
|
80
|
-
source: {
|
|
81
|
-
code: `<Stack justify="center" align="center" spacing="md">
|
|
82
|
-
<Box>Centered Item 1</Box>
|
|
83
|
-
<Box>Centered Item 2</Box>
|
|
84
|
-
</Stack>`,
|
|
85
|
-
},
|
|
86
|
-
},
|
|
74
|
+
children: undefined,
|
|
75
|
+
justify: undefined,
|
|
76
|
+
align: undefined,
|
|
77
|
+
gap: undefined,
|
|
78
|
+
h: undefined,
|
|
79
|
+
width: undefined,
|
|
80
|
+
styles: undefined,
|
|
87
81
|
},
|
|
82
|
+
decorators: [
|
|
83
|
+
(Story) => (_jsx("div", { style: { width: '500px', backgroundColor: neutral[25], padding: '20px' }, children: _jsx(Story, {}) })),
|
|
84
|
+
],
|
|
85
|
+
render: (args) => (_jsxs(Stack, { ...args, children: [_jsx(SampleCard, { label: "Item 1" }), _jsx(SampleCard, { label: "Item 2" }), _jsx(SampleCard, { label: "Item 3" })] })),
|
|
88
86
|
};
|
|
89
|
-
export const
|
|
90
|
-
render: () => (
|
|
91
|
-
parameters: {
|
|
92
|
-
docs: {
|
|
93
|
-
source: {
|
|
94
|
-
code: `<Stack spacing="lg">
|
|
95
|
-
<Box>Item 1</Box>
|
|
96
|
-
<Box>Item 2</Box>
|
|
97
|
-
<Box>Item 3</Box>
|
|
98
|
-
</Stack>
|
|
99
|
-
|
|
100
|
-
<Stack gap="2rem">
|
|
101
|
-
<Box>Item 1</Box>
|
|
102
|
-
<Box>Item 2</Box>
|
|
103
|
-
<Box>Item 3</Box>
|
|
104
|
-
</Stack>`,
|
|
105
|
-
},
|
|
106
|
-
},
|
|
107
|
-
},
|
|
87
|
+
export const PositionContent = {
|
|
88
|
+
render: () => (_jsx(Stack, { gap: spacing.lg, justify: "flex-start", children: _jsx(Group, { children: ['flex-start', 'center', 'space-between'].map((val) => (_jsxs("div", { children: [_jsx(Text, { variant: "label", mb: spacing.sm, children: _jsxs("code", { children: ["justify=", '"' + val + '"'] }) }), _jsxs(Stack, { justify: val, spacing: spacing.sm, sx: { height: '200px', width: '200px', border: `1px dashed ${neutral[50]}`, padding: spacing.xs }, children: [_jsx(SampleCard, { label: "A" }), _jsx(SampleCard, { label: "B" })] })] }, val))) }) })),
|
|
108
89
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout/Table/Table.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Table.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout/Table/Table.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAWhC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,KAAK,CA6B5B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAuQnC,eAAO,MAAM,UAAU,EAAE,KAmBxB,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,KAqBvC,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,KAoBnC,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAmB3B,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,KAsBlC,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,KAerC,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAa7B,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,KAajC,CAAC"}
|
|
@@ -6,6 +6,7 @@ import { Text } from '../../Typography/Text/Text';
|
|
|
6
6
|
import { Center } from '../Center/Center';
|
|
7
7
|
import { IconInfoCircle } from '@tabler/icons-react';
|
|
8
8
|
import { neutral } from '../../../constants/colors';
|
|
9
|
+
import { spacing } from '../../../constants/spacing';
|
|
9
10
|
import { Group } from '../Group/Group';
|
|
10
11
|
const meta = {
|
|
11
12
|
title: 'Components/Layout/Table',
|
|
@@ -173,7 +174,7 @@ const ProductListItem = ({ data }) => {
|
|
|
173
174
|
return status;
|
|
174
175
|
}
|
|
175
176
|
};
|
|
176
|
-
return (_jsxs("tr", { children: [_jsx("td", { children: data.name }), _jsx("td", { children: data.category }), _jsxs("td", { children: ["$", data.price.toFixed(2)] }), _jsx("td", { children: data.stock }), _jsx("td", { children: _jsx(Badge, { color: getStatusColor(data.status), variant: "filled", size: "sm", children: getStatusLabel(data.status) }) }), _jsx("td", { children: _jsxs("div", { style: { display: 'flex', gap:
|
|
177
|
+
return (_jsxs("tr", { children: [_jsx("td", { children: data.name }), _jsx("td", { children: data.category }), _jsxs("td", { children: ["$", data.price.toFixed(2)] }), _jsx("td", { children: data.stock }), _jsx("td", { children: _jsx(Badge, { color: getStatusColor(data.status), variant: "filled", size: "sm", children: getStatusLabel(data.status) }) }), _jsx("td", { children: _jsxs("div", { style: { display: 'flex', gap: spacing.sm }, children: [_jsx(Button, { size: "sm", variant: "primary", children: "Edit" }), _jsx(Button, { size: "sm", variant: "secondary", children: "View" })] }) })] }));
|
|
177
178
|
};
|
|
178
179
|
const ProjectListItem = ({ data }) => {
|
|
179
180
|
const getPriorityColor = (priority) => {
|
|
@@ -188,7 +189,7 @@ const ProjectListItem = ({ data }) => {
|
|
|
188
189
|
return 'neutral';
|
|
189
190
|
}
|
|
190
191
|
};
|
|
191
|
-
return (_jsxs("tr", { children: [_jsx("td", { children: data.title }), _jsx("td", { children: data.team.join(', ') }), _jsx("td", { children: _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap:
|
|
192
|
+
return (_jsxs("tr", { children: [_jsx("td", { children: data.title }), _jsx("td", { children: data.team.join(', ') }), _jsx("td", { children: _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: spacing.sm }, children: [_jsx("div", { style: {
|
|
192
193
|
flex: 1,
|
|
193
194
|
height: '8px',
|
|
194
195
|
backgroundColor: '#e0e0e0',
|
|
@@ -289,7 +290,7 @@ export const TableWithPlaceholder = {
|
|
|
289
290
|
{ heading: 'Name', style: { width: '50%' } },
|
|
290
291
|
{ heading: 'Email', style: { width: '50%' } },
|
|
291
292
|
],
|
|
292
|
-
placeholder: (_jsx(Center, { py: '
|
|
293
|
+
placeholder: (_jsx(Center, { py: '50px', children: _jsxs(Group, { gap: spacing.xs, align: 'center', children: [_jsx(IconInfoCircle, { color: neutral[200], size: '20px' }), _jsx(Text, { children: "No data available at this time" })] }) })),
|
|
293
294
|
},
|
|
294
295
|
parameters: {
|
|
295
296
|
docs: {
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TabsProps as MantineTabsProps } from '@mantine/core';
|
|
3
|
-
export interface TabsProps extends Omit<MantineTabsProps, 'children' | 'onChange'
|
|
3
|
+
export interface TabsProps extends Omit<MantineTabsProps, 'children' | 'onChange'> {
|
|
4
4
|
children: React.ReactNode;
|
|
5
5
|
defaultValue?: string;
|
|
6
6
|
value?: string;
|
|
7
7
|
onChange?: (value: string | null) => void;
|
|
8
|
-
orientation?: 'horizontal' | 'vertical';
|
|
9
|
-
placement?: 'left' | 'right' | 'top' | 'bottom';
|
|
10
8
|
variant?: 'default' | 'outline' | 'pills';
|
|
11
9
|
}
|
|
12
|
-
export declare const Tabs: (({ children, defaultValue, value, onChange,
|
|
10
|
+
export declare const Tabs: (({ children, defaultValue, value, onChange, variant, styles, ...props }: TabsProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
13
11
|
List: React.ForwardRefExoticComponent<import("@mantine/core").TabsListProps & React.RefAttributes<HTMLDivElement>>;
|
|
14
12
|
Tab: React.ForwardRefExoticComponent<import("@mantine/core").TabProps & React.RefAttributes<HTMLButtonElement>>;
|
|
15
13
|
Panel: React.ForwardRefExoticComponent<import("@mantine/core").TabsPanelProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout/Tabs/Tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAuB,SAAS,IAAI,gBAAgB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout/Tabs/Tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAuB,SAAS,IAAI,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAKnF,MAAM,WAAW,SAAU,SAAQ,IAAI,CAAC,gBAAgB,EAAE,UAAU,GAAG,UAAU,CAAC;IAChF,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC1C,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;CAC3C;AA+CD,eAAO,MAAM,IAAI,4EA7C0F,SAAS;;;;CAiDlH,CAAC"}
|
|
@@ -2,7 +2,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { Tabs as MantineTabs } from '@mantine/core';
|
|
3
3
|
import { fontBase } from '../../../constants/font';
|
|
4
4
|
import { colors } from '../../../constants/colors';
|
|
5
|
-
|
|
5
|
+
import { spacing } from '../../../constants/spacing';
|
|
6
|
+
const TabsComponent = ({ children, defaultValue, value, onChange, variant = 'default', styles, ...props }) => {
|
|
6
7
|
const style = {
|
|
7
8
|
root: {
|
|
8
9
|
width: '100%',
|
|
@@ -12,7 +13,7 @@ const TabsComponent = ({ children, defaultValue, value, onChange, orientation =
|
|
|
12
13
|
gap: '0',
|
|
13
14
|
},
|
|
14
15
|
tab: {
|
|
15
|
-
padding:
|
|
16
|
+
padding: `${spacing.sm} 28px`,
|
|
16
17
|
backgroundColor: 'transparent',
|
|
17
18
|
color: colors.neutral[300],
|
|
18
19
|
'&:hover': {
|
|
@@ -31,15 +32,15 @@ const TabsComponent = ({ children, defaultValue, value, onChange, orientation =
|
|
|
31
32
|
},
|
|
32
33
|
tabLabel: {
|
|
33
34
|
...fontBase,
|
|
34
|
-
fontSize: '
|
|
35
|
-
lineHeight: '
|
|
35
|
+
fontSize: '16px',
|
|
36
|
+
lineHeight: '24px',
|
|
36
37
|
},
|
|
37
38
|
panel: {
|
|
38
|
-
padding:
|
|
39
|
+
padding: `${spacing.lg} ${spacing.sm}`,
|
|
39
40
|
},
|
|
40
41
|
...styles,
|
|
41
42
|
};
|
|
42
|
-
return (_jsx(MantineTabs, { styles: style, radius: "lg", defaultValue: defaultValue, value: value,
|
|
43
|
+
return (_jsx(MantineTabs, { styles: style, radius: "lg", defaultValue: defaultValue, value: value, variant: variant, ...props, children: children }));
|
|
43
44
|
};
|
|
44
45
|
export const Tabs = Object.assign(TabsComponent, {
|
|
45
46
|
List: MantineTabs.List,
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { Tabs } from './Tabs';
|
|
3
|
+
declare const meta: Meta<typeof Tabs>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const Variants: Story;
|
|
8
|
+
export declare const CustomStyling: Story;
|
|
9
|
+
//# sourceMappingURL=Tabs.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tabs.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout/Tabs/Tabs.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAM9B,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,IAAI,CA2D3B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAyBrB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KA4BtB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAyE3B,CAAC"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Tabs } from './Tabs';
|
|
3
|
+
import { Stack } from '../Stack/Stack';
|
|
4
|
+
import { primary } from '../../../constants/colors';
|
|
5
|
+
import { spacing } from '../../../constants/spacing';
|
|
6
|
+
import { Text } from '../../Typography/Text/Text';
|
|
7
|
+
const meta = {
|
|
8
|
+
title: 'Components/Layout/Tabs',
|
|
9
|
+
component: Tabs,
|
|
10
|
+
parameters: {
|
|
11
|
+
layout: 'centered',
|
|
12
|
+
docs: {
|
|
13
|
+
description: {
|
|
14
|
+
component: "[View Mantine Docs](https://v6.mantine.dev/core/tabs/)\n\nThe Tabs component organizes content into sections that users can switch between. It extends Mantine v6's Tabs component with custom styling and variant options.",
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
argTypes: {
|
|
19
|
+
children: {
|
|
20
|
+
control: false,
|
|
21
|
+
description: 'Tab content — composed of Tabs.List, Tabs.Tab, and Tabs.Panel',
|
|
22
|
+
table: {
|
|
23
|
+
type: { summary: 'ReactNode' },
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
variant: {
|
|
27
|
+
control: { type: 'select' },
|
|
28
|
+
options: ['default', 'outline', 'pills'],
|
|
29
|
+
description: 'The preset variant to use for styling',
|
|
30
|
+
table: {
|
|
31
|
+
type: { summary: "'default' | 'outline' | 'pills'" },
|
|
32
|
+
defaultValue: { summary: "'default'" },
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
defaultValue: {
|
|
36
|
+
control: { type: 'select' },
|
|
37
|
+
options: ['overview', 'details', 'settings'],
|
|
38
|
+
description: 'The default tab when the component is mounted',
|
|
39
|
+
table: {
|
|
40
|
+
type: { summary: 'string' },
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
value: {
|
|
44
|
+
control: { type: 'text' },
|
|
45
|
+
description: 'The currently active tab value',
|
|
46
|
+
table: {
|
|
47
|
+
type: { summary: 'string' },
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
onChange: {
|
|
51
|
+
action: 'changed',
|
|
52
|
+
description: 'Called when the active tab changes',
|
|
53
|
+
table: {
|
|
54
|
+
type: { summary: '(value: string | null) => void' },
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
styles: {
|
|
58
|
+
control: { type: 'object' },
|
|
59
|
+
description: 'Override for styling',
|
|
60
|
+
table: {
|
|
61
|
+
type: { summary: 'Record<string, CSSObject>' },
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
export default meta;
|
|
67
|
+
export const Default = {
|
|
68
|
+
args: {
|
|
69
|
+
children: undefined,
|
|
70
|
+
variant: 'default',
|
|
71
|
+
defaultValue: 'overview',
|
|
72
|
+
},
|
|
73
|
+
decorators: [
|
|
74
|
+
(Story) => (_jsx("div", { style: { width: '600px' }, children: _jsx(Story, {}) })),
|
|
75
|
+
],
|
|
76
|
+
render: (args) => (_jsxs(Tabs, { ...args, children: [_jsxs(Tabs.List, { children: [_jsx(Tabs.Tab, { value: "overview", children: "Overview" }), _jsx(Tabs.Tab, { value: "details", children: "Details" }), _jsx(Tabs.Tab, { value: "settings", children: "Settings" })] }), _jsx(Tabs.Panel, { mt: spacing.lg, value: "overview", children: _jsx(Text, { variant: "subtle", children: "This is the tab panel for Overview" }) }), _jsx(Tabs.Panel, { mt: spacing.lg, value: "details", children: _jsx(Text, { variant: "subtle", children: "This is the tab panel for Details" }) }), _jsx(Tabs.Panel, { mt: spacing.lg, value: "settings", children: _jsx(Text, { variant: "subtle", children: "This is the tab panel for Settings" }) })] })),
|
|
77
|
+
};
|
|
78
|
+
export const Variants = {
|
|
79
|
+
render: () => (_jsxs(Stack, { spacing: "48px", py: spacing.xl, sx: { width: '600px' }, children: [_jsx(Tabs, { defaultValue: "overview", variant: "default", children: _jsxs(Tabs.List, { children: [_jsx(Tabs.Tab, { value: "overview", children: "Default" }), _jsx(Tabs.Tab, { value: "details", children: "Tab 2" }), _jsx(Tabs.Tab, { value: "settings", children: "Tab 3" })] }) }), _jsx(Tabs, { defaultValue: "overview", variant: "outline", children: _jsxs(Tabs.List, { children: [_jsx(Tabs.Tab, { value: "overview", children: "Outline" }), _jsx(Tabs.Tab, { value: "details", children: "Tab 2" }), _jsx(Tabs.Tab, { value: "settings", children: "Tab 3" })] }) }), _jsx(Tabs, { defaultValue: "overview", variant: "pills", children: _jsxs(Tabs.List, { children: [_jsx(Tabs.Tab, { value: "overview", children: "Pills" }), _jsx(Tabs.Tab, { value: "details", children: "Tab 2" }), _jsx(Tabs.Tab, { value: "settings", children: "Tab 3" })] }) })] })),
|
|
80
|
+
};
|
|
81
|
+
export const CustomStyling = {
|
|
82
|
+
args: {
|
|
83
|
+
defaultValue: 'overview',
|
|
84
|
+
styles: {
|
|
85
|
+
root: {
|
|
86
|
+
background: primary[200],
|
|
87
|
+
padding: '20px',
|
|
88
|
+
borderRadius: '12px',
|
|
89
|
+
},
|
|
90
|
+
tab: {
|
|
91
|
+
color: 'white',
|
|
92
|
+
'&:hover': {
|
|
93
|
+
color: 'white',
|
|
94
|
+
backgroundColor: primary[300],
|
|
95
|
+
},
|
|
96
|
+
'&[data-active]': {
|
|
97
|
+
color: 'white',
|
|
98
|
+
backgroundColor: primary[100],
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
panel: {
|
|
102
|
+
color: 'white',
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
decorators: [
|
|
107
|
+
(Story) => (_jsx("div", { style: { width: '600px' }, children: _jsx(Story, {}) })),
|
|
108
|
+
],
|
|
109
|
+
render: (args) => (_jsxs(Tabs, { variant: "pills", ...args, children: [_jsxs(Tabs.List, { children: [_jsx(Tabs.Tab, { value: "overview", children: "Overview" }), _jsx(Tabs.Tab, { value: "details", children: "Details" })] }), _jsx(Tabs.Panel, { mt: spacing.lg, value: "overview", children: "Overview" }), _jsx(Tabs.Panel, { mt: spacing.lg, value: "details", children: "Details" })] })),
|
|
110
|
+
parameters: {
|
|
111
|
+
docs: {
|
|
112
|
+
source: {
|
|
113
|
+
code: `<Tabs
|
|
114
|
+
defaultValue="overview"
|
|
115
|
+
styles={{
|
|
116
|
+
root: {
|
|
117
|
+
background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
|
|
118
|
+
padding: '20px',
|
|
119
|
+
borderRadius: '12px',
|
|
120
|
+
},
|
|
121
|
+
tab: {
|
|
122
|
+
color: 'rgba(255, 255, 255, 0.8)',
|
|
123
|
+
'&[data-active]': {
|
|
124
|
+
color: 'white',
|
|
125
|
+
backgroundColor: 'rgba(255, 255, 255, 0.2)',
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
panel: { color: 'white' },
|
|
129
|
+
}}
|
|
130
|
+
>
|
|
131
|
+
<Tabs.List>
|
|
132
|
+
<Tabs.Tab value="overview">Overview</Tabs.Tab>
|
|
133
|
+
<Tabs.Tab value="details">Details</Tabs.Tab>
|
|
134
|
+
</Tabs.List>
|
|
135
|
+
<Tabs.Panel value="overview">Overview content</Tabs.Panel>
|
|
136
|
+
<Tabs.Panel value="details">Details content</Tabs.Panel>
|
|
137
|
+
</Tabs>`,
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
};
|
|
@@ -12,7 +12,7 @@ export const IconBadge = ({ icon, color }) => {
|
|
|
12
12
|
if (React.isValidElement(icon) && icon.props && typeof icon.props.size === 'number') {
|
|
13
13
|
const iconSize = icon.props.size;
|
|
14
14
|
const badgeSize = iconSize + 12;
|
|
15
|
-
return `${badgeSize
|
|
15
|
+
return `${badgeSize}px`;
|
|
16
16
|
}
|
|
17
17
|
};
|
|
18
18
|
return (_jsx("div", { style: {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { IconBadge } from './IconBadge';
|
|
3
|
+
declare const meta: Meta<typeof IconBadge>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
//# sourceMappingURL=IconBadge.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconBadge.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/Misc/IconBadge/IconBadge.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,SAAS,CAsChC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAKrB,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { IconBadge } from './IconBadge';
|
|
3
|
+
import { IconHeart, IconBell, IconStar, IconCheck, IconSettings, IconShield } from '@tabler/icons-react';
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'Components/Misc/IconBadge',
|
|
6
|
+
component: IconBadge,
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: 'centered',
|
|
9
|
+
docs: {
|
|
10
|
+
description: {
|
|
11
|
+
component: 'The IconBadge component is just a colored icon wrapped in a circular background.',
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
argTypes: {
|
|
16
|
+
icon: {
|
|
17
|
+
control: { type: 'select' },
|
|
18
|
+
options: ['Heart', 'Bell', 'Star', 'Check', 'Settings', 'Shield'],
|
|
19
|
+
mapping: {
|
|
20
|
+
Heart: _jsx(IconHeart, { size: 20 }),
|
|
21
|
+
Bell: _jsx(IconBell, { size: 20 }),
|
|
22
|
+
Star: _jsx(IconStar, { size: 20 }),
|
|
23
|
+
Check: _jsx(IconCheck, { size: 20 }),
|
|
24
|
+
Settings: _jsx(IconSettings, { size: 20 }),
|
|
25
|
+
Shield: _jsx(IconShield, { size: 20 }),
|
|
26
|
+
},
|
|
27
|
+
description: 'The icon element to display inside the badge',
|
|
28
|
+
table: {
|
|
29
|
+
type: { summary: 'ReactNode' },
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
color: {
|
|
33
|
+
control: { type: 'select' },
|
|
34
|
+
options: ['blue', 'green', 'yellow', 'red', 'purple', 'salmon', 'gray'],
|
|
35
|
+
description: 'Primitive color for the badge background and icon',
|
|
36
|
+
table: {
|
|
37
|
+
type: { summary: "'blue' | 'green' | 'yellow' | 'red' | 'purple' | 'salmon' | 'gray'" },
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
export default meta;
|
|
43
|
+
export const Default = {
|
|
44
|
+
args: {
|
|
45
|
+
icon: _jsx(IconHeart, { size: 20 }),
|
|
46
|
+
color: 'blue',
|
|
47
|
+
},
|
|
48
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Stepper as MantineStepper } from '@mantine/core';
|
|
3
|
+
export interface StepProps {
|
|
4
|
+
label?: React.ReactNode;
|
|
5
|
+
description?: React.ReactNode;
|
|
6
|
+
icon?: React.ReactNode;
|
|
7
|
+
completedIcon?: React.ReactNode;
|
|
8
|
+
header?: React.ReactNode;
|
|
9
|
+
loading?: boolean;
|
|
10
|
+
allowStepSelect?: boolean;
|
|
11
|
+
completed?: boolean;
|
|
12
|
+
}
|
|
13
|
+
type MantineStepProps = React.ComponentProps<typeof MantineStepper.Step>;
|
|
14
|
+
export declare const Step: ({ label, description, icon, completedIcon, header, loading, allowStepSelect, ...props }: StepProps & Omit<MantineStepProps, keyof StepProps>) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=Step.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Step.d.ts","sourceRoot":"","sources":["../../../../src/components/Misc/Stepper/Step.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,eAAe,CAAC;AAE1D,MAAM,WAAW,SAAS;IACxB,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,KAAK,gBAAgB,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,cAAc,CAAC,IAAI,CAAC,CAAC;AAEzE,eAAO,MAAM,IAAI,GAAI,yFASlB,SAAS,GAAG,IAAI,CAAC,gBAAgB,EAAE,MAAM,SAAS,CAAC,4CAcrD,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Stepper as MantineStepper } from '@mantine/core';
|
|
3
|
+
;
|
|
4
|
+
export const Step = ({ label, description, icon, completedIcon, header, loading, allowStepSelect, ...props }) => {
|
|
5
|
+
const resolvedStepIndex = typeof props.step === 'number' ? props.step + 1 : null;
|
|
6
|
+
return (_jsx(MantineStepper.Step, { ...props, label: label, description: description, icon: icon !== null && icon !== void 0 ? icon : resolvedStepIndex, completedIcon: completedIcon !== null && completedIcon !== void 0 ? completedIcon : resolvedStepIndex, loading: loading !== null && loading !== void 0 ? loading : false, allowStepSelect: allowStepSelect !== null && allowStepSelect !== void 0 ? allowStepSelect : false }));
|
|
7
|
+
};
|