@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
|
@@ -3,6 +3,7 @@ import { IconCheck, IconCircleFilled } from '@tabler/icons-react';
|
|
|
3
3
|
import { Badge } from './Badge';
|
|
4
4
|
import { Group } from '../../Layout/Group/Group';
|
|
5
5
|
import { Stack } from '../../Layout/Stack/Stack';
|
|
6
|
+
import { spacing } from '../../../constants/spacing';
|
|
6
7
|
const meta = {
|
|
7
8
|
title: 'Components/Info/Badge',
|
|
8
9
|
component: Badge,
|
|
@@ -79,14 +80,14 @@ export const Default = {
|
|
|
79
80
|
},
|
|
80
81
|
};
|
|
81
82
|
export const Variants = {
|
|
82
|
-
render: () => (_jsxs(Group, { gap:
|
|
83
|
+
render: () => (_jsxs(Group, { gap: spacing.lg, children: [_jsx(Badge, { variant: "outline", color: "primary", children: "Outline" }), _jsx(Badge, { variant: "filled", color: "primary", children: "Filled" }), _jsx(Badge, { variant: "gradient", color: "primary", children: "Gradient" })] })),
|
|
83
84
|
};
|
|
84
85
|
export const Colors = {
|
|
85
|
-
render: () => (_jsxs(Group, { gap:
|
|
86
|
+
render: () => (_jsxs(Group, { gap: spacing.lg, style: { flexWrap: 'wrap' }, children: [_jsx(Badge, { variant: "outline", color: "primary", children: "Primary" }), _jsx(Badge, { variant: "outline", color: "success", children: "Success" }), _jsx(Badge, { variant: "outline", color: "warning", children: "Warning" }), _jsx(Badge, { variant: "outline", color: "error", children: "Error" }), _jsx(Badge, { variant: "outline", color: "neutral", children: "Neutral" })] })),
|
|
86
87
|
};
|
|
87
88
|
export const Sizes = {
|
|
88
|
-
render: () => (_jsxs(Group, { gap:
|
|
89
|
+
render: () => (_jsxs(Group, { gap: spacing.lg, align: "flex-end", children: [_jsx(Badge, { size: "sm", color: "primary", children: "Small" }), _jsx(Badge, { size: "md", color: "primary", children: "Medium" }), _jsx(Badge, { size: "lg", color: "primary", children: "Large" })] })),
|
|
89
90
|
};
|
|
90
91
|
export const WithLeftIcon = {
|
|
91
|
-
render: () => (_jsxs(Stack, { gap:
|
|
92
|
+
render: () => (_jsxs(Stack, { gap: spacing.lg, children: [_jsxs(Group, { gap: spacing.lg, children: [_jsx(Badge, { size: "sm", leftIcon: _jsx(IconCheck, {}), color: "success", children: "Completed" }), _jsx(Badge, { size: "sm", variant: "filled", leftIcon: _jsx(IconCircleFilled, {}), color: "success", children: "Online" }), _jsx(Badge, { size: "sm", variant: "gradient", leftIcon: _jsx(IconCheck, {}), color: "success", children: "In Progress" })] }), _jsxs(Group, { gap: spacing.lg, children: [_jsx(Badge, { leftIcon: _jsx(IconCheck, {}), color: "success", children: "Completed" }), _jsx(Badge, { variant: "filled", leftIcon: _jsx(IconCircleFilled, {}), color: "success", children: "Online" }), _jsx(Badge, { variant: "gradient", leftIcon: _jsx(IconCheck, {}), color: "success", children: "In Progress" })] }), _jsxs(Group, { gap: spacing.lg, children: [_jsx(Badge, { size: "lg", leftIcon: _jsx(IconCheck, {}), color: "success", children: "Completed" }), _jsx(Badge, { size: "lg", variant: "filled", leftIcon: _jsx(IconCircleFilled, {}), color: "success", children: "Online" }), _jsx(Badge, { size: "lg", variant: "gradient", leftIcon: _jsx(IconCheck, {}), color: "success", children: "In Progress" })] })] })),
|
|
92
93
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sizes.d.ts","sourceRoot":"","sources":["../../../../src/components/Info/Badge/sizes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sizes.d.ts","sourceRoot":"","sources":["../../../../src/components/Info/Badge/sizes.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsBtB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,MAAM,OAAO,UAAU,CAAC"}
|
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import { inputFontSize } from '../../../constants/font';
|
|
2
|
+
import { spacing } from '../../../constants/spacing';
|
|
2
3
|
export const badgeSizes = {
|
|
3
4
|
sm: {
|
|
4
5
|
mantineSize: 'md',
|
|
5
|
-
padding:
|
|
6
|
-
height: '
|
|
6
|
+
padding: `${spacing.xs} ${spacing.sm}`,
|
|
7
|
+
height: '15px',
|
|
7
8
|
fontSize: inputFontSize['sm'],
|
|
8
9
|
iconSize: 10,
|
|
9
10
|
},
|
|
10
11
|
md: {
|
|
11
12
|
mantineSize: 'lg',
|
|
12
|
-
padding:
|
|
13
|
-
height: '
|
|
13
|
+
padding: `${spacing.xs} ${spacing.sm}`,
|
|
14
|
+
height: '25px',
|
|
14
15
|
fontSize: inputFontSize['md'],
|
|
15
16
|
iconSize: 14,
|
|
16
17
|
},
|
|
17
18
|
lg: {
|
|
18
19
|
mantineSize: 'xl',
|
|
19
|
-
padding:
|
|
20
|
-
height: '
|
|
20
|
+
padding: `${spacing.xs} ${spacing.sm}`,
|
|
21
|
+
height: '30px',
|
|
21
22
|
fontSize: inputFontSize['lg'],
|
|
22
23
|
iconSize: 16,
|
|
23
24
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"variants.d.ts","sourceRoot":"","sources":["../../../../src/components/Info/Badge/variants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"variants.d.ts","sourceRoot":"","sources":["../../../../src/components/Info/Badge/variants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAGnD,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,QAAQ,GAAG,UAAU,CAAC;AAE7D,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,MAAM,CAAC;AAE7C,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAAC,YAAY,EAAE,SAAS,CAAC,CAoBnF"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { colors } from '../../../constants/colors';
|
|
2
|
+
import { spacing } from '../../../constants/spacing';
|
|
2
3
|
export function getVariantStyles(color) {
|
|
3
4
|
return {
|
|
4
5
|
outline: {
|
|
@@ -6,7 +7,7 @@ export function getVariantStyles(color) {
|
|
|
6
7
|
color: colors[color][200],
|
|
7
8
|
backgroundColor: 'transparent',
|
|
8
9
|
borderRadius: '8px',
|
|
9
|
-
padding:
|
|
10
|
+
padding: `${spacing.xs} ${spacing.sm}`,
|
|
10
11
|
},
|
|
11
12
|
filled: {
|
|
12
13
|
backgroundColor: colors[color][50],
|
|
@@ -16,7 +17,7 @@ export function getVariantStyles(color) {
|
|
|
16
17
|
background: `linear-gradient(to right, ${colors[color][50]}, ${colors[color][200]})`,
|
|
17
18
|
color: 'white',
|
|
18
19
|
borderRadius: '16px',
|
|
19
|
-
padding:
|
|
20
|
+
padding: `${spacing.xs} ${spacing.sm}`,
|
|
20
21
|
},
|
|
21
22
|
};
|
|
22
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InfoCard.d.ts","sourceRoot":"","sources":["../../../../src/components/Info/InfoCard/InfoCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAQ,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEzD,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"InfoCard.d.ts","sourceRoot":"","sources":["../../../../src/components/Info/InfoCard/InfoCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAQ,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEzD,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAGnD,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;IAChE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,OAAO,MAAM,CAAC;CAC/B;AAED,eAAO,MAAM,QAAQ,GAAI,qCAAiD,aAAa,4CAwBtF,CAAC"}
|
|
@@ -2,13 +2,14 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { Card } from '../../Layout/Card/Card';
|
|
3
3
|
import { Center } from '../../Layout/Center/Center';
|
|
4
4
|
import { colors } from '../../../constants/colors';
|
|
5
|
+
import { spacing } from '../../../constants/spacing';
|
|
5
6
|
export const InfoCard = ({ children, variant = 'primary', ...cardProps }) => {
|
|
6
7
|
const colorPalette = colors[variant];
|
|
7
8
|
const style = {
|
|
8
9
|
border: `1px solid ${colorPalette[200]}`,
|
|
9
10
|
backgroundColor: colorPalette[25],
|
|
10
11
|
color: colorPalette[200] + ' !important',
|
|
11
|
-
padding:
|
|
12
|
+
padding: `${spacing.xxl} 64px`,
|
|
12
13
|
};
|
|
13
14
|
return (_jsx(Card, { shadow: "lg", style: style, sx: {
|
|
14
15
|
'& *': {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/Info/Modals/FormModal/FormModal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"FormModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/Info/Modals/FormModal/FormModal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAI5C,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,IAAI,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IAC1B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,OAAO,aAAa,CAAC;IAC1C,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,SAAS,GAAI,uJAavB,cAAc,4CAiGhB,CAAC"}
|
|
@@ -2,22 +2,23 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { Modal as MantineModal } from "@mantine/core";
|
|
4
4
|
import { neutral } from "../../../../constants/colors";
|
|
5
|
+
import { spacing } from '../../../../constants/spacing';
|
|
5
6
|
import { Stack } from "../../../Layout/Stack/Stack";
|
|
6
7
|
import { Center } from "../../../Layout/Center/Center";
|
|
7
8
|
import { modalVariants } from "../variants";
|
|
8
9
|
import { Group } from "../../../Layout/Group/Group";
|
|
9
10
|
import { Button } from "../../../Inputs/Buttons/Button/Button";
|
|
10
|
-
export const FormModal = ({ opened, onClose, icon, children, size = "
|
|
11
|
+
export const FormModal = ({ opened, onClose, icon, children, size = "400px", modalVariant = "info", confirmButtonDisabled = false, confirmButtonLoading = false, onCancel, onConfirm, cancelLabel, confirmLabel, }) => {
|
|
11
12
|
const selectedVariant = modalVariants[modalVariant];
|
|
12
13
|
const iconContainer = {
|
|
13
|
-
width: "
|
|
14
|
-
height: "
|
|
14
|
+
width: "42px",
|
|
15
|
+
height: "42px",
|
|
15
16
|
borderRadius: "50%",
|
|
16
17
|
backgroundColor: selectedVariant.iconBackgroundColor,
|
|
17
18
|
border: `2px solid ${selectedVariant.iconColor}`,
|
|
18
19
|
};
|
|
19
20
|
const coloredIcon = icon && React.cloneElement(icon, { color: icon.props.color || selectedVariant.iconColor });
|
|
20
|
-
const modalIcon = coloredIcon || (_jsx("i", { className: selectedVariant.icon, style: { color: selectedVariant.iconColor, fontSize: "
|
|
21
|
+
const modalIcon = coloredIcon || (_jsx("i", { className: selectedVariant.icon, style: { color: selectedVariant.iconColor, fontSize: "20px" } }));
|
|
21
22
|
return (_jsx(MantineModal, { opened: opened, onClose: onClose, centered: true, radius: "16px", overlayProps: {
|
|
22
23
|
opacity: 0,
|
|
23
24
|
blur: 4,
|
|
@@ -28,8 +29,8 @@ export const FormModal = ({ opened, onClose, icon, children, size = "40rem", mod
|
|
|
28
29
|
style: {
|
|
29
30
|
borderRadius: "16px",
|
|
30
31
|
backgroundColor: neutral[50],
|
|
31
|
-
width: "
|
|
32
|
-
height: "
|
|
32
|
+
width: "18px",
|
|
33
|
+
height: "18px",
|
|
33
34
|
},
|
|
34
35
|
}, styles: {
|
|
35
36
|
content: {
|
|
@@ -38,13 +39,13 @@ export const FormModal = ({ opened, onClose, icon, children, size = "40rem", mod
|
|
|
38
39
|
boxShadow: "0px 0px 19px 0px #00000040",
|
|
39
40
|
},
|
|
40
41
|
header: {
|
|
41
|
-
padding:
|
|
42
|
+
padding: spacing.sm,
|
|
42
43
|
},
|
|
43
44
|
close: {
|
|
44
45
|
borderRadius: "16px",
|
|
45
46
|
backgroundColor: neutral[50],
|
|
46
|
-
width: "
|
|
47
|
-
height: "
|
|
47
|
+
width: "18px",
|
|
48
|
+
height: "18px",
|
|
48
49
|
"&:hover": {
|
|
49
50
|
backgroundColor: neutral[50],
|
|
50
51
|
},
|
|
@@ -53,7 +54,7 @@ export const FormModal = ({ opened, onClose, icon, children, size = "40rem", mod
|
|
|
53
54
|
},
|
|
54
55
|
},
|
|
55
56
|
body: {
|
|
56
|
-
padding:
|
|
57
|
+
padding: `0 ${spacing.xxl} ${spacing.lg} ${spacing.xxl}`,
|
|
57
58
|
},
|
|
58
|
-
}, children: _jsx(Center, { h: "100%", w: "100%", children: _jsxs(Stack, { gap: "
|
|
59
|
+
}, children: _jsx(Center, { h: "100%", w: "100%", children: _jsxs(Stack, { gap: "20px", h: "100%", w: "100%", align: "center", children: [_jsxs(Stack, { gap: spacing.lg, align: "center", children: [_jsx(Center, { style: iconContainer, children: modalIcon }), children && (_jsx(Stack, { gap: spacing.xxs, align: "center", children: children }))] }), _jsx(Center, { h: "100%", w: "100%", children: _jsxs(Group, { gap: "10px", align: "center", children: [_jsx(Button, { onClick: onCancel, variant: "secondary", children: cancelLabel || selectedVariant.cancelLabel }), _jsx(Button, { onClick: onConfirm, variant: selectedVariant.buttonVariant, disabled: confirmButtonDisabled, loading: confirmButtonLoading, children: confirmLabel || selectedVariant.confirmLabel })] }) })] }) }) }));
|
|
59
60
|
};
|
|
@@ -48,7 +48,7 @@ const meta = {
|
|
|
48
48
|
description: "Modal size (CSS value or number in px).",
|
|
49
49
|
table: {
|
|
50
50
|
type: { summary: "string | number" },
|
|
51
|
-
defaultValue: { summary: "'
|
|
51
|
+
defaultValue: { summary: "'400px'" },
|
|
52
52
|
},
|
|
53
53
|
},
|
|
54
54
|
modalVariant: {
|
|
@@ -106,7 +106,7 @@ export default meta;
|
|
|
106
106
|
export const Default = {
|
|
107
107
|
args: {
|
|
108
108
|
modalVariant: "info",
|
|
109
|
-
size: "
|
|
109
|
+
size: "400px",
|
|
110
110
|
cancelLabel: "",
|
|
111
111
|
confirmLabel: "",
|
|
112
112
|
},
|
|
@@ -130,7 +130,7 @@ return (
|
|
|
130
130
|
onCancel={() => setOpened(false)}
|
|
131
131
|
onConfirm={() => setOpened(false)}
|
|
132
132
|
modalVariant='info'
|
|
133
|
-
size='
|
|
133
|
+
size='400px'
|
|
134
134
|
children={
|
|
135
135
|
<Title variant="cardSubheader" align="center">
|
|
136
136
|
Example message.
|
|
@@ -165,7 +165,7 @@ export const Variants = {
|
|
|
165
165
|
render: () => {
|
|
166
166
|
const [opened, setOpened] = useState(false);
|
|
167
167
|
const [variant, setVariant] = useState("info");
|
|
168
|
-
return (_jsxs(_Fragment, { children: [_jsx(Center, { children: _jsx(Group, { gap: "
|
|
168
|
+
return (_jsxs(_Fragment, { children: [_jsx(Center, { children: _jsx(Group, { gap: "10px", children: Object.keys(modalVariants).map((v) => (_jsx(Button, { onClick: () => {
|
|
169
169
|
setVariant(v);
|
|
170
170
|
setOpened(true);
|
|
171
171
|
}, children: v }, v))) }) }), _jsx(FormModal, { opened: opened, onClose: () => setOpened(false), onCancel: () => setOpened(false), onConfirm: () => setOpened(false), modalVariant: variant, children: _jsx(Title, { variant: "cardSubheader", align: "center", children: modalVariants[variant].message }) })] }));
|
|
@@ -174,13 +174,13 @@ export const Variants = {
|
|
|
174
174
|
export const Sizes = {
|
|
175
175
|
render: () => {
|
|
176
176
|
const [opened, setOpened] = useState(false);
|
|
177
|
-
const [size, setSize] = useState("
|
|
177
|
+
const [size, setSize] = useState("400px");
|
|
178
178
|
const sizes = [
|
|
179
|
-
{ label: "
|
|
180
|
-
{ label: "
|
|
181
|
-
{ label: "
|
|
179
|
+
{ label: "300px", value: "300px" },
|
|
180
|
+
{ label: "400px (Default)", value: "400px" },
|
|
181
|
+
{ label: "600px", value: "600px" },
|
|
182
182
|
];
|
|
183
|
-
return (_jsxs(_Fragment, { children: [_jsx(Center, { children: _jsx(Group, { gap: "
|
|
183
|
+
return (_jsxs(_Fragment, { children: [_jsx(Center, { children: _jsx(Group, { gap: "10px", children: sizes.map(({ label, value }) => (_jsx(Button, { onClick: () => {
|
|
184
184
|
setSize(value);
|
|
185
185
|
setOpened(true);
|
|
186
186
|
}, children: label }, value))) }) }), _jsx(FormModal, { opened: opened, onClose: () => setOpened(false), onCancel: () => setOpened(false), onConfirm: () => setOpened(false), size: size, children: _jsxs(Title, { variant: "cardSubheader", align: "center", children: ["Modal size: ", size] }) })] }));
|
|
@@ -196,7 +196,7 @@ export const ConfirmButtonDisabled = {
|
|
|
196
196
|
render: () => {
|
|
197
197
|
const [opened, setOpened] = useState(false);
|
|
198
198
|
const [name, setName] = useState("");
|
|
199
|
-
return (_jsxs(_Fragment, { children: [_jsx(Center, { children: _jsx(Button, { onClick: () => setOpened(true), children: "Open FormModal" }) }), _jsx(FormModal, { opened: opened, onClose: () => setOpened(false), onCancel: () => setOpened(false), onConfirm: () => setOpened(false), confirmButtonDisabled: name.trim().length === 0, children: _jsxs(Stack, { gap: "
|
|
199
|
+
return (_jsxs(_Fragment, { children: [_jsx(Center, { children: _jsx(Button, { onClick: () => setOpened(true), children: "Open FormModal" }) }), _jsx(FormModal, { opened: opened, onClose: () => setOpened(false), onCancel: () => setOpened(false), onConfirm: () => setOpened(false), confirmButtonDisabled: name.trim().length === 0, children: _jsxs(Stack, { gap: "10px", align: "center", children: [_jsx(Title, { variant: "cardSubheader", align: "center", children: "Enter your name to enable the confirm button." }), _jsx(TextInput, { label: "Name", placeholder: "Enter your name", value: name, onChange: (e) => setName(e.target.value) })] }) })] }));
|
|
200
200
|
},
|
|
201
201
|
};
|
|
202
202
|
export const ConfirmButtonLoading = {
|
|
@@ -217,6 +217,6 @@ export const CompleteExample = {
|
|
|
217
217
|
render: () => {
|
|
218
218
|
const [opened, setOpened] = useState(false);
|
|
219
219
|
const [quantity, setQuantity] = useState(1);
|
|
220
|
-
return (_jsxs(_Fragment, { children: [_jsx(Center, { children: _jsx(Button, { onClick: () => setOpened(true), children: "Add to Cart" }) }), _jsx(FormModal, { opened: opened, onClose: () => setOpened(false), onCancel: () => setOpened(false), onConfirm: () => setOpened(false), modalVariant: "confirm", icon: _jsx(IconShoppingCart, { color: primary[200] }), cancelLabel: "Cancel", confirmLabel: "Add to Cart", children: _jsxs(Stack, { gap: "
|
|
220
|
+
return (_jsxs(_Fragment, { children: [_jsx(Center, { children: _jsx(Button, { onClick: () => setOpened(true), children: "Add to Cart" }) }), _jsx(FormModal, { opened: opened, onClose: () => setOpened(false), onCancel: () => setOpened(false), onConfirm: () => setOpened(false), modalVariant: "confirm", icon: _jsx(IconShoppingCart, { color: primary[200] }), cancelLabel: "Cancel", confirmLabel: "Add to Cart", children: _jsxs(Stack, { gap: "10px", align: "center", children: [_jsx(Title, { variant: "cardHeader", align: "center", children: "Add Item to Cart" }), _jsx(Title, { variant: "cardSubheader", align: "center", children: "Select the quantity you would like to add." }), _jsx(NumberInput, { label: "Quantity", value: quantity, onChange: (val) => setQuantity(val !== null && val !== void 0 ? val : 1), min: 1, max: 99, step: 1 })] }) })] }));
|
|
221
221
|
},
|
|
222
222
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../../../src/components/Info/Modals/Modal/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../../../src/components/Info/Modals/Modal/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,UAAU,UAAU;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB;AAGD,eAAO,MAAM,KAAK,GAAI,6DAAuE,UAAU,4CAoEtG,CAAC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Modal as MantineModal } from '@mantine/core';
|
|
3
3
|
import { neutral } from '../../../../constants/colors';
|
|
4
|
+
import { spacing } from '../../../../constants/spacing';
|
|
4
5
|
import { Title } from '../../../Typography/Title/Title';
|
|
5
6
|
import { Stack } from '../../../Layout/Stack/Stack';
|
|
6
7
|
import { Center } from '../../../Layout/Center/Center';
|
|
7
8
|
// Base modal is intended to be extended and customized - use InfoModal or ConfirmationModal for common use cases
|
|
8
|
-
export const Modal = ({ opened, onClose, icon, title, subtitle, children, width = '
|
|
9
|
+
export const Modal = ({ opened, onClose, icon, title, subtitle, children, width = '400px' }) => {
|
|
9
10
|
return (_jsx(MantineModal, { opened: opened, onClose: onClose, centered: true, radius: '16px', overlayProps: {
|
|
10
11
|
opacity: 0,
|
|
11
12
|
blur: 4,
|
|
@@ -16,8 +17,8 @@ export const Modal = ({ opened, onClose, icon, title, subtitle, children, width
|
|
|
16
17
|
style: {
|
|
17
18
|
borderRadius: '16px',
|
|
18
19
|
backgroundColor: neutral[50],
|
|
19
|
-
width: '
|
|
20
|
-
height: '
|
|
20
|
+
width: '18px',
|
|
21
|
+
height: '18px',
|
|
21
22
|
},
|
|
22
23
|
}, styles: {
|
|
23
24
|
content: {
|
|
@@ -26,7 +27,7 @@ export const Modal = ({ opened, onClose, icon, title, subtitle, children, width
|
|
|
26
27
|
boxShadow: '0px 0px 19px 0px #00000040',
|
|
27
28
|
},
|
|
28
29
|
header: {
|
|
29
|
-
padding:
|
|
30
|
+
padding: spacing.sm,
|
|
30
31
|
},
|
|
31
32
|
close: {
|
|
32
33
|
'&:hover': {
|
|
@@ -37,7 +38,7 @@ export const Modal = ({ opened, onClose, icon, title, subtitle, children, width
|
|
|
37
38
|
},
|
|
38
39
|
},
|
|
39
40
|
body: {
|
|
40
|
-
padding:
|
|
41
|
+
padding: `0 ${spacing.xxl} ${spacing.lg} ${spacing.xxl}`,
|
|
41
42
|
},
|
|
42
|
-
}, children: _jsx(Center, { h: "100%", w: "100%", children: _jsxs(Stack, { gap: "
|
|
43
|
+
}, children: _jsx(Center, { h: "100%", w: "100%", children: _jsxs(Stack, { gap: "20px", h: "100%", w: "100%", align: "center", children: [_jsxs(Stack, { gap: spacing.lg, align: "center", children: [icon, _jsxs(Stack, { gap: spacing.xxs, align: "center", children: [_jsx(Title, { variant: "cardHeader", align: "center", children: title }), subtitle && (_jsx(Title, { variant: "cardSubheader", align: "center", children: subtitle }))] })] }), _jsx(Center, { h: "100%", w: "100%", children: children })] }) }) }));
|
|
43
44
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { Modal } from './Modal';
|
|
3
|
+
declare const meta: Meta<typeof Modal>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
//# sourceMappingURL=Modal.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Modal.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Info/Modals/Modal/Modal.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAMhC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,KAAK,CAoC5B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAenC,eAAO,MAAM,OAAO,EAAE,KAerB,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { Modal } from './Modal';
|
|
4
|
+
import { Text } from '../../../Typography/Text/Text';
|
|
5
|
+
import { Button } from '../../../Inputs/Buttons/Button/Button';
|
|
6
|
+
import { IconEdit, IconTrash } from '@tabler/icons-react';
|
|
7
|
+
import taivLogo from '../../../../assets/brand/taiv-logo-dark.svg';
|
|
8
|
+
const meta = {
|
|
9
|
+
title: 'Components/Info/Modals/Modal',
|
|
10
|
+
component: Modal,
|
|
11
|
+
parameters: {
|
|
12
|
+
layout: 'centered',
|
|
13
|
+
},
|
|
14
|
+
argTypes: {
|
|
15
|
+
title: {
|
|
16
|
+
control: { type: 'text' },
|
|
17
|
+
description: 'Modal title',
|
|
18
|
+
table: { type: { summary: 'string' } },
|
|
19
|
+
},
|
|
20
|
+
subtitle: {
|
|
21
|
+
control: { type: 'text' },
|
|
22
|
+
description: 'Optional subtitle below the title',
|
|
23
|
+
table: { type: { summary: 'string' } },
|
|
24
|
+
},
|
|
25
|
+
width: {
|
|
26
|
+
control: { type: 'text' },
|
|
27
|
+
description: 'Custom width override',
|
|
28
|
+
table: {
|
|
29
|
+
type: { summary: 'string | number' },
|
|
30
|
+
defaultValue: { summary: "'400px'" },
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
children: { control: false, description: 'Modal content', table: { type: { summary: 'ReactNode' } } },
|
|
34
|
+
opened: { control: false, description: 'Controls the state of the modal', table: { type: { summary: 'boolean' } } },
|
|
35
|
+
onClose: { control: false, description: 'Callback function when the modal is closed', table: { type: { summary: '() => void' } } },
|
|
36
|
+
icon: { control: { type: 'select' },
|
|
37
|
+
options: ['Edit', 'Trash', 'TaivLogo'],
|
|
38
|
+
mapping: {
|
|
39
|
+
Edit: _jsx(IconEdit, {}),
|
|
40
|
+
Trash: _jsx(IconTrash, {}),
|
|
41
|
+
TaivLogo: _jsx("img", { src: taivLogo, width: 64, height: 64, alt: "Taiv Logo" }),
|
|
42
|
+
}, description: 'Custom icon or image to display at the top of the modal', table: { type: { summary: 'ReactNode' } } },
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
export default meta;
|
|
46
|
+
const ModalWithState = ({ title, subtitle, children, width, icon }) => {
|
|
47
|
+
const [opened, setOpened] = useState(false);
|
|
48
|
+
return (_jsxs(_Fragment, { children: [_jsx(Button, { onClick: () => setOpened(true), children: "Open Modal" }), _jsx(Modal, { opened: opened, onClose: () => setOpened(false), title: title, subtitle: subtitle, width: width, icon: icon, children: children })] }));
|
|
49
|
+
};
|
|
50
|
+
export const Default = {
|
|
51
|
+
render: (args) => (_jsx(ModalWithState, { ...args, children: _jsx(Text, { children: "This is the modal content area where you can place any React components." }) })),
|
|
52
|
+
args: {
|
|
53
|
+
title: 'Modal Title',
|
|
54
|
+
subtitle: 'Optional subtitle text',
|
|
55
|
+
children: undefined,
|
|
56
|
+
opened: undefined,
|
|
57
|
+
onClose: undefined,
|
|
58
|
+
icon: undefined,
|
|
59
|
+
width: undefined,
|
|
60
|
+
},
|
|
61
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { modalVariants } from './variants';
|
|
3
|
+
interface ModalHookArgs {
|
|
4
|
+
variant: keyof typeof modalVariants;
|
|
5
|
+
title: string;
|
|
6
|
+
message: string;
|
|
7
|
+
}
|
|
8
|
+
declare const meta: Meta<ModalHookArgs>;
|
|
9
|
+
export default meta;
|
|
10
|
+
type Story = StoryObj<ModalHookArgs>;
|
|
11
|
+
export declare const Default: Story;
|
|
12
|
+
export declare const InfoVariants: Story;
|
|
13
|
+
export declare const ConfirmationDefault: Story;
|
|
14
|
+
export declare const ConfirmationVariants: Story;
|
|
15
|
+
export declare const FormModalDemo: Story;
|
|
16
|
+
//# sourceMappingURL=Modals.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Modals.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/Info/Modals/Modals.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAU5D,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAG3C,UAAU,aAAa;IACrB,OAAO,EAAE,MAAM,OAAO,aAAa,CAAC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,aAAa,CA+B7B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,CAAC;AAoBrC,eAAO,MAAM,OAAO,EAAE,KAOrB,CAAC;AAeF,eAAO,MAAM,YAAY,EAAE,KAE1B,CAAC;AAsBF,eAAO,MAAM,mBAAmB,EAAE,KAOjC,CAAC;AAeF,eAAO,MAAM,oBAAoB,EAAE,KAElC,CAAC;AA8BF,eAAO,MAAM,aAAa,EAAE,KAE3B,CAAC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { Group } from '../../Layout/Group/Group';
|
|
4
|
+
import { Stack } from '../../Layout/Stack/Stack';
|
|
5
|
+
import { Button } from '../../Inputs/Buttons/Button/Button';
|
|
6
|
+
import { useInfoModal } from '../../../hooks/useInfoModal';
|
|
7
|
+
import { useConfirmationModal } from '../../../hooks/useConfirmationModal';
|
|
8
|
+
import { FormModal } from './FormModal/FormModal';
|
|
9
|
+
import { TextInput } from '../../Inputs/TextInputs/TextInput/TextInput';
|
|
10
|
+
import { Title } from '../../Typography/Title/Title';
|
|
11
|
+
import { modalVariants } from './variants';
|
|
12
|
+
import { spacing } from '../../../constants/spacing';
|
|
13
|
+
const meta = {
|
|
14
|
+
title: 'Hooks/Modals',
|
|
15
|
+
tags: ['!dev'],
|
|
16
|
+
parameters: {
|
|
17
|
+
layout: 'centered',
|
|
18
|
+
},
|
|
19
|
+
argTypes: {
|
|
20
|
+
variant: {
|
|
21
|
+
control: { type: 'select' },
|
|
22
|
+
options: Object.keys(modalVariants),
|
|
23
|
+
description: 'Preset modal style',
|
|
24
|
+
table: {
|
|
25
|
+
type: { summary: "'confirm' | 'info' | 'success' | 'error' | 'warning' | 'cancel'" },
|
|
26
|
+
defaultValue: { summary: "'info'" },
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
title: {
|
|
30
|
+
control: { type: 'text' },
|
|
31
|
+
description: 'Optional title override',
|
|
32
|
+
table: {
|
|
33
|
+
type: { summary: 'string' },
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
message: {
|
|
37
|
+
control: { type: 'text' },
|
|
38
|
+
description: 'Optional message override',
|
|
39
|
+
table: {
|
|
40
|
+
type: { summary: 'string' },
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
export default meta;
|
|
46
|
+
const DefaultDemo = (args) => {
|
|
47
|
+
const { show } = useInfoModal();
|
|
48
|
+
return (_jsx(Button, { onClick: () => show({
|
|
49
|
+
variant: args.variant,
|
|
50
|
+
title: args.title || undefined,
|
|
51
|
+
message: args.message || undefined,
|
|
52
|
+
}), children: "Show Info Modal" }));
|
|
53
|
+
};
|
|
54
|
+
export const Default = {
|
|
55
|
+
args: {
|
|
56
|
+
variant: 'info',
|
|
57
|
+
message: undefined,
|
|
58
|
+
title: undefined,
|
|
59
|
+
},
|
|
60
|
+
render: (args) => _jsx(DefaultDemo, { ...args }),
|
|
61
|
+
};
|
|
62
|
+
const InfoVariantsDemo = () => {
|
|
63
|
+
const { show } = useInfoModal();
|
|
64
|
+
return (_jsxs(Group, { gap: spacing.xs, children: [_jsx(Button, { variant: "primary", onClick: () => show({ variant: 'info' }), children: "Info" }), _jsx(Button, { variant: "success", onClick: () => show({ variant: 'success' }), children: "Success" }), _jsx(Button, { variant: "cancel", onClick: () => show({ variant: 'error' }), children: "Error" }), _jsx(Button, { variant: "warning", onClick: () => show({ variant: 'warning' }), children: "Warning" })] }));
|
|
65
|
+
};
|
|
66
|
+
export const InfoVariants = {
|
|
67
|
+
render: () => _jsx(InfoVariantsDemo, {}),
|
|
68
|
+
};
|
|
69
|
+
const ConfirmationDefaultDemo = (args) => {
|
|
70
|
+
const { show } = useConfirmationModal();
|
|
71
|
+
return (_jsx(Button, { onClick: () => show({
|
|
72
|
+
variant: args.variant,
|
|
73
|
+
title: args.title || undefined,
|
|
74
|
+
message: args.message || undefined,
|
|
75
|
+
onConfirm: () => console.log('Confirmed'),
|
|
76
|
+
onCancel: () => console.log('Cancelled'),
|
|
77
|
+
}), children: "Show Confirmation Modal" }));
|
|
78
|
+
};
|
|
79
|
+
export const ConfirmationDefault = {
|
|
80
|
+
args: {
|
|
81
|
+
variant: 'confirm',
|
|
82
|
+
title: undefined,
|
|
83
|
+
message: undefined,
|
|
84
|
+
},
|
|
85
|
+
render: (args) => _jsx(ConfirmationDefaultDemo, { ...args }),
|
|
86
|
+
};
|
|
87
|
+
const ConfirmationVariantsDemo = () => {
|
|
88
|
+
const { show } = useConfirmationModal();
|
|
89
|
+
return (_jsxs(Group, { gap: spacing.xs, children: [_jsx(Button, { variant: "primary", onClick: () => show({ variant: 'confirm', onConfirm: () => console.log('confirmed') }), children: "Confirm" }), _jsx(Button, { variant: "cancel", onClick: () => show({ variant: 'cancel', onConfirm: () => console.log('confirmed') }), children: "Cancel" }), _jsx(Button, { variant: "warning", onClick: () => show({ variant: 'warning', onConfirm: () => console.log('confirmed') }), children: "Warning" }), _jsx(Button, { variant: "success", onClick: () => show({ variant: 'success', onConfirm: () => console.log('confirmed') }), children: "Success" })] }));
|
|
90
|
+
};
|
|
91
|
+
export const ConfirmationVariants = {
|
|
92
|
+
render: () => _jsx(ConfirmationVariantsDemo, {}),
|
|
93
|
+
};
|
|
94
|
+
const FormModalExample = () => {
|
|
95
|
+
const [opened, setOpened] = useState(false);
|
|
96
|
+
const [name, setName] = useState('');
|
|
97
|
+
const [email, setEmail] = useState('');
|
|
98
|
+
return (_jsxs(_Fragment, { children: [_jsx(Button, { onClick: () => setOpened(true), children: "Add User" }), _jsx(FormModal, { opened: opened, onClose: () => setOpened(false), onCancel: () => setOpened(false), onConfirm: () => setOpened(false), modalVariant: "info", confirmLabel: "Submit", confirmButtonDisabled: name.trim().length === 0, children: _jsxs(Stack, { gap: "10px", align: "center", children: [_jsx(Title, { variant: "cardSubheader", align: "center", children: "Fill out the user information below." }), _jsx(TextInput, { label: "Name", placeholder: "Enter a name", value: name, onChange: (e) => setName(e.target.value) }), _jsx(TextInput, { label: "Email", placeholder: "Enter an email", value: email, onChange: (e) => setEmail(e.target.value) })] }) })] }));
|
|
99
|
+
};
|
|
100
|
+
export const FormModalDemo = {
|
|
101
|
+
render: () => _jsx(FormModalExample, {}),
|
|
102
|
+
};
|
package/dist/components/Info/Notifications/NotificationProvider/NotificationProvider.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationProvider.d.ts","sourceRoot":"","sources":["../../../../../src/components/Info/Notifications/NotificationProvider/NotificationProvider.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NotificationProvider.d.ts","sourceRoot":"","sources":["../../../../../src/components/Info/Notifications/NotificationProvider/NotificationProvider.tsx"],"names":[],"mappings":"AAOA,eAAO,MAAM,oBAAoB,+CA2ChC,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { Notifications } from '@mantine/notifications';
|
|
3
3
|
import { createStyles } from '@mantine/core';
|
|
4
4
|
import { neutral } from '../../../../constants/colors';
|
|
5
|
+
import { spacing } from '../../../../constants/spacing';
|
|
5
6
|
import { useMobile } from '../../../../hooks/useMediaQuery';
|
|
6
7
|
export const NotificationProvider = () => {
|
|
7
8
|
const isMobile = useMobile();
|
|
@@ -10,26 +11,26 @@ export const NotificationProvider = () => {
|
|
|
10
11
|
zIndex: 2000,
|
|
11
12
|
'& .mantine-Notification-root': {
|
|
12
13
|
backgroundColor: 'white',
|
|
13
|
-
padding:
|
|
14
|
+
padding: `${spacing.md} ${spacing.lg}`,
|
|
14
15
|
minHeight: 'auto',
|
|
15
16
|
borderRadius: '0 8px 8px 0',
|
|
16
17
|
},
|
|
17
18
|
'& .mantine-Notification-title': {
|
|
18
|
-
fontSize: '
|
|
19
|
+
fontSize: '15px',
|
|
19
20
|
fontWeight: 500,
|
|
20
21
|
fontFamily: 'Poppins, sans-serif !important',
|
|
21
22
|
color: neutral[300],
|
|
22
23
|
},
|
|
23
24
|
'& .mantine-Notification-description': {
|
|
24
|
-
fontSize: '
|
|
25
|
+
fontSize: '12.5px',
|
|
25
26
|
color: neutral[200],
|
|
26
27
|
fontFamily: 'Poppins, sans-serif !important',
|
|
27
28
|
lineHeight: 1.4,
|
|
28
29
|
},
|
|
29
30
|
'& .mantine-Notification-icon': {
|
|
30
|
-
marginRight:
|
|
31
|
-
marginLeft:
|
|
32
|
-
fontSize: '
|
|
31
|
+
marginRight: spacing.lg,
|
|
32
|
+
marginLeft: spacing.sm,
|
|
33
|
+
fontSize: '20px',
|
|
33
34
|
backgroundColor: 'transparent !important',
|
|
34
35
|
},
|
|
35
36
|
'& .mantine-Notification-icon > div': {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { NotificationProvider } from './NotificationProvider/NotificationProvider';
|
|
3
|
+
declare const meta: Meta<typeof NotificationProvider>;
|
|
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 GenericError: Story;
|
|
9
|
+
export declare const AsyncNotifications: Story;
|
|
10
|
+
//# sourceMappingURL=Notifications.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Notifications.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/Info/Notifications/Notifications.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;AAMnF,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,oBAAoB,CAuC3C,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAqBnC,eAAO,MAAM,OAAO,EAAE,KAQrB,CAAC;AAgBF,eAAO,MAAM,QAAQ,EAAE,KAEtB,CAAC;AAQF,eAAO,MAAM,YAAY,EAAE,KAE1B,CAAC;AAyCF,eAAO,MAAM,kBAAkB,EAAE,KAEhC,CAAC"}
|