@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
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCopy } from '../../hooks/useCopy';
|
|
3
|
+
import { Button } from '../../components/Inputs/Buttons/Button/Button';
|
|
4
|
+
import { IconCopy } from '@tabler/icons-react';
|
|
5
|
+
const meta = {
|
|
6
|
+
title: 'Hooks/Copy',
|
|
7
|
+
tags: ['!dev'],
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: 'centered',
|
|
10
|
+
},
|
|
11
|
+
argTypes: {
|
|
12
|
+
value: {
|
|
13
|
+
control: { type: 'text' },
|
|
14
|
+
description: 'The value to copy',
|
|
15
|
+
table: {
|
|
16
|
+
type: { summary: 'string' },
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
label: {
|
|
20
|
+
control: { type: 'text' },
|
|
21
|
+
description: 'Optional label for what the value is',
|
|
22
|
+
table: {
|
|
23
|
+
type: { summary: 'string' },
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
showNotification: {
|
|
27
|
+
control: { type: 'boolean' },
|
|
28
|
+
description: 'Show notification after copy',
|
|
29
|
+
table: {
|
|
30
|
+
type: { summary: 'boolean' },
|
|
31
|
+
defaultValue: { summary: 'true' },
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
notificationMessage: {
|
|
35
|
+
control: { type: 'text' },
|
|
36
|
+
description: 'Custom notification message override - use this sparingly',
|
|
37
|
+
table: {
|
|
38
|
+
type: { summary: 'string' },
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
export default meta;
|
|
44
|
+
const DefaultDemo = (args) => {
|
|
45
|
+
const { copy } = useCopy();
|
|
46
|
+
return (_jsxs(Button, { variant: "secondary", leftIcon: _jsx(IconCopy, {}), onClick: () => copy({
|
|
47
|
+
value: args.value,
|
|
48
|
+
label: args.label || undefined,
|
|
49
|
+
showNotification: args.showNotification,
|
|
50
|
+
notificationMessage: args.notificationMessage || undefined,
|
|
51
|
+
}), children: ["Copy ", args.label] }));
|
|
52
|
+
};
|
|
53
|
+
export const Default = {
|
|
54
|
+
args: {
|
|
55
|
+
value: '12345',
|
|
56
|
+
label: undefined,
|
|
57
|
+
showNotification: true,
|
|
58
|
+
notificationMessage: undefined,
|
|
59
|
+
},
|
|
60
|
+
render: (args) => _jsx(DefaultDemo, { ...args }),
|
|
61
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useConfirmationModal.d.ts","sourceRoot":"","sources":["../../src/hooks/useConfirmationModal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"useConfirmationModal.d.ts","sourceRoot":"","sources":["../../src/hooks/useConfirmationModal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAInE,eAAO,MAAM,oBAAoB;oBACR;QACrB,OAAO,CAAC,EAAE,OAAO,CAAC,MAAM,OAAO,aAAa,EAAE,OAAO,CAAC,CAAC;QACvD,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,IAAI,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;QAC1B,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;QACvB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;QACtB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;KACxB;qBAwFuB,MAAM;;CAa/B,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { modals } from '@mantine/modals';
|
|
4
4
|
import { neutral } from '../constants/colors';
|
|
5
|
+
import { spacing } from '../constants/spacing';
|
|
5
6
|
import { Title } from '../components/Typography/Title/Title';
|
|
6
7
|
import { Stack } from '../components/Layout/Stack/Stack';
|
|
7
8
|
import { Center } from '../components/Layout/Center/Center';
|
|
@@ -10,7 +11,7 @@ import { Button } from '../components/Inputs/Buttons/Button/Button';
|
|
|
10
11
|
import { Group } from '../components/Layout/Group/Group';
|
|
11
12
|
export const useConfirmationModal = () => {
|
|
12
13
|
const show = (options) => {
|
|
13
|
-
const { variant = 'confirm', title, message, confirmLabel, cancelLabel, icon, onConfirm, onCancel, size = '
|
|
14
|
+
const { variant = 'confirm', title, message, confirmLabel, cancelLabel, icon, onConfirm, onCancel, size = '400px' } = options;
|
|
14
15
|
const handleConfirm = () => {
|
|
15
16
|
if (onConfirm)
|
|
16
17
|
onConfirm();
|
|
@@ -23,16 +24,16 @@ export const useConfirmationModal = () => {
|
|
|
23
24
|
};
|
|
24
25
|
const selectedVariant = modalVariants[variant];
|
|
25
26
|
const iconContainer = {
|
|
26
|
-
width: '
|
|
27
|
-
height: '
|
|
27
|
+
width: '42px',
|
|
28
|
+
height: '42px',
|
|
28
29
|
borderRadius: '50%',
|
|
29
30
|
backgroundColor: selectedVariant.iconBackgroundColor,
|
|
30
31
|
border: `2px solid ${selectedVariant.iconColor}`,
|
|
31
32
|
};
|
|
32
33
|
const coloredIcon = icon && React.cloneElement(icon, { color: icon.props.color || selectedVariant.iconColor });
|
|
33
|
-
const modalIcon = coloredIcon || _jsx("i", { className: selectedVariant.icon, style: { color: selectedVariant.iconColor, fontSize: '
|
|
34
|
+
const modalIcon = coloredIcon || _jsx("i", { className: selectedVariant.icon, style: { color: selectedVariant.iconColor, fontSize: '20px' } });
|
|
34
35
|
const ConfirmModalContent = () => {
|
|
35
|
-
return (_jsx(Center, { h: "100%", w: "100%", children: _jsxs(Stack, { gap: "
|
|
36
|
+
return (_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 }), _jsxs(Stack, { gap: spacing.xxs, align: "center", children: [_jsx(Title, { variant: "cardHeader", align: "center", children: title || selectedVariant.title }), _jsx(Title, { variant: "cardSubheader", align: "center", children: message || selectedVariant.message })] })] }), _jsx(Center, { h: "100%", w: "100%", children: _jsxs(Group, { gap: "10px", align: "center", children: [_jsx(Button, { onClick: handleCancel, variant: "secondary", children: cancelLabel || selectedVariant.cancelLabel }), _jsx(Button, { onClick: handleConfirm, variant: selectedVariant.buttonVariant, children: confirmLabel || selectedVariant.confirmLabel })] }) })] }) }));
|
|
36
37
|
};
|
|
37
38
|
modals.open({
|
|
38
39
|
children: _jsx(ConfirmModalContent, {}),
|
|
@@ -44,13 +45,13 @@ export const useConfirmationModal = () => {
|
|
|
44
45
|
boxShadow: '0px 0px 19px 0px #00000040',
|
|
45
46
|
},
|
|
46
47
|
header: {
|
|
47
|
-
padding:
|
|
48
|
+
padding: spacing.sm,
|
|
48
49
|
},
|
|
49
50
|
close: {
|
|
50
51
|
borderRadius: '16px',
|
|
51
52
|
backgroundColor: neutral[50],
|
|
52
|
-
width: '
|
|
53
|
-
height: '
|
|
53
|
+
width: '18px',
|
|
54
|
+
height: '18px',
|
|
54
55
|
'&:hover': {
|
|
55
56
|
backgroundColor: neutral[50],
|
|
56
57
|
},
|
|
@@ -59,7 +60,7 @@ export const useConfirmationModal = () => {
|
|
|
59
60
|
},
|
|
60
61
|
},
|
|
61
62
|
body: {
|
|
62
|
-
padding:
|
|
63
|
+
padding: `0 ${spacing.xxl} ${spacing.lg} ${spacing.xxl}`,
|
|
63
64
|
},
|
|
64
65
|
},
|
|
65
66
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useInfoModal.d.ts","sourceRoot":"","sources":["../../src/hooks/useInfoModal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"useInfoModal.d.ts","sourceRoot":"","sources":["../../src/hooks/useInfoModal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAGnE,eAAO,MAAM,YAAY;oBACA;QAAE,OAAO,CAAC,EAAE,MAAM,OAAO,aAAa,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE;qBA8EpJ,MAAM;;CAa/B,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { modals } from '@mantine/modals';
|
|
4
4
|
import { neutral } from '../constants/colors';
|
|
5
|
+
import { spacing } from '../constants/spacing';
|
|
5
6
|
import { Title } from '../components/Typography/Title/Title';
|
|
6
7
|
import { Stack } from '../components/Layout/Stack/Stack';
|
|
7
8
|
import { Center } from '../components/Layout/Center/Center';
|
|
@@ -9,7 +10,7 @@ import { modalVariants } from '../components/Info/Modals/variants';
|
|
|
9
10
|
import { Button } from '../components/Inputs/Buttons/Button/Button';
|
|
10
11
|
export const useInfoModal = () => {
|
|
11
12
|
const show = (options) => {
|
|
12
|
-
const { variant = 'info', title, message, icon, onConfirm, size = '
|
|
13
|
+
const { variant = 'info', title, message, icon, onConfirm, size = '350px' } = options;
|
|
13
14
|
const handleConfirm = () => {
|
|
14
15
|
if (onConfirm)
|
|
15
16
|
onConfirm();
|
|
@@ -17,16 +18,16 @@ export const useInfoModal = () => {
|
|
|
17
18
|
};
|
|
18
19
|
const selectedVariant = modalVariants[variant];
|
|
19
20
|
const iconContainer = {
|
|
20
|
-
width: '
|
|
21
|
-
height: '
|
|
21
|
+
width: '42px',
|
|
22
|
+
height: '42px',
|
|
22
23
|
borderRadius: '50%',
|
|
23
24
|
backgroundColor: selectedVariant.iconBackgroundColor,
|
|
24
25
|
border: `2px solid ${selectedVariant.iconColor}`,
|
|
25
26
|
};
|
|
26
27
|
const coloredIcon = icon && React.cloneElement(icon, { color: icon.props.color || selectedVariant.iconColor });
|
|
27
|
-
const modalIcon = coloredIcon || _jsx("i", { className: selectedVariant.icon, style: { color: selectedVariant.iconColor, fontSize: '
|
|
28
|
+
const modalIcon = coloredIcon || _jsx("i", { className: selectedVariant.icon, style: { color: selectedVariant.iconColor, fontSize: '20px' } });
|
|
28
29
|
const InfoModalContent = () => {
|
|
29
|
-
return (_jsx(Center, { h: "100%", w: "100%", children: _jsxs(Stack, { gap: "
|
|
30
|
+
return (_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 }), _jsxs(Stack, { gap: spacing.xxs, align: "center", children: [_jsx(Title, { variant: "cardHeader", align: "center", children: title || selectedVariant.title }), _jsx(Title, { variant: "cardSubheader", align: "center", children: message || selectedVariant.message })] })] }), _jsx(Center, { h: "100%", w: "100%", children: _jsx(Button, { onClick: handleConfirm, variant: selectedVariant.buttonVariant, children: "OK" }) })] }) }));
|
|
30
31
|
};
|
|
31
32
|
modals.open({
|
|
32
33
|
children: _jsx(InfoModalContent, {}),
|
|
@@ -38,13 +39,13 @@ export const useInfoModal = () => {
|
|
|
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 useInfoModal = () => {
|
|
|
53
54
|
},
|
|
54
55
|
},
|
|
55
56
|
body: {
|
|
56
|
-
padding:
|
|
57
|
+
padding: `0 ${spacing.xxl} ${spacing.lg} ${spacing.xxl}`,
|
|
57
58
|
},
|
|
58
59
|
},
|
|
59
60
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useMediaQuery as useMantineMediaQuery } from '@mantine/hooks';
|
|
2
|
-
import {
|
|
2
|
+
import { breakpoints } from '../constants/breakpoints';
|
|
3
3
|
export declare const useMediaQuery: typeof useMantineMediaQuery;
|
|
4
|
-
export declare const useScreenSize: () => keyof typeof
|
|
4
|
+
export declare const useScreenSize: () => keyof typeof breakpoints;
|
|
5
5
|
export declare const useMobile: () => boolean;
|
|
6
6
|
export declare const useTablet: () => boolean;
|
|
7
7
|
export declare const useLaptop: () => boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useMediaQuery as useMantineMediaQuery } from '@mantine/hooks';
|
|
2
|
-
import {
|
|
2
|
+
import { breakpoints } from '../constants/breakpoints';
|
|
3
3
|
export const useMediaQuery = useMantineMediaQuery;
|
|
4
4
|
export const useScreenSize = () => {
|
|
5
5
|
const isMobile = useMobile();
|
|
@@ -16,8 +16,8 @@ export const useScreenSize = () => {
|
|
|
16
16
|
return 'DESKTOP';
|
|
17
17
|
return 'WIDE';
|
|
18
18
|
};
|
|
19
|
-
export const useMobile = () => useMediaQuery(`(max-width: ${
|
|
20
|
-
export const useTablet = () => useMediaQuery(`(max-width: ${
|
|
21
|
-
export const useLaptop = () => useMediaQuery(`(max-width: ${
|
|
22
|
-
export const useDesktop = () => useMediaQuery(`(max-width: ${
|
|
23
|
-
export const useWide = () => useMediaQuery(`(max-width: ${
|
|
19
|
+
export const useMobile = () => useMediaQuery(`(max-width: ${breakpoints.MOBILE}px)`);
|
|
20
|
+
export const useTablet = () => useMediaQuery(`(max-width: ${breakpoints.TABLET}px)`);
|
|
21
|
+
export const useLaptop = () => useMediaQuery(`(max-width: ${breakpoints.LAPTOP}px)`);
|
|
22
|
+
export const useDesktop = () => useMediaQuery(`(max-width: ${breakpoints.DESKTOP}px)`);
|
|
23
|
+
export const useWide = () => useMediaQuery(`(max-width: ${breakpoints.WIDE}px)`);
|
package/package.json
CHANGED
|
@@ -1,24 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "@taiv/ui",
|
|
3
|
-
"version": "1.12.0",
|
|
4
2
|
"author": "Taiv",
|
|
5
|
-
"description": "Taiv's web UI Toolkit built on Mantine v6",
|
|
6
|
-
"main": "dist/index.js",
|
|
7
|
-
"types": "dist/index.d.ts",
|
|
8
|
-
"files": [
|
|
9
|
-
"dist"
|
|
10
|
-
],
|
|
11
|
-
"repository": {
|
|
12
|
-
"type": "git",
|
|
13
|
-
"url": "https://github.com/alborz-taiv/taiv-ui"
|
|
14
|
-
},
|
|
15
|
-
"scripts": {
|
|
16
|
-
"build": "tsc",
|
|
17
|
-
"dev": "npm link && tsc --watch",
|
|
18
|
-
"clean": "rm -rf dist",
|
|
19
|
-
"storybook": "storybook dev -p 6006",
|
|
20
|
-
"build-storybook": "storybook build"
|
|
21
|
-
},
|
|
22
3
|
"dependencies": {
|
|
23
4
|
"@emotion/react": "^11.14.0",
|
|
24
5
|
"@mantine/core": "^6.0.0",
|
|
@@ -26,29 +7,59 @@
|
|
|
26
7
|
"@mantine/hooks": "^6.0.0",
|
|
27
8
|
"@mantine/modals": "^6.0.0",
|
|
28
9
|
"@mantine/notifications": "^6.0.0",
|
|
29
|
-
"@tabler/icons-react": "^
|
|
10
|
+
"@tabler/icons-react": "^3.41.1",
|
|
30
11
|
"dayjs": "^1.11.18",
|
|
31
12
|
"recharts": "^2.8.0"
|
|
32
13
|
},
|
|
33
|
-
"
|
|
34
|
-
"react": "^17.0.0",
|
|
35
|
-
"react-dom": "^17.0.0"
|
|
36
|
-
},
|
|
14
|
+
"description": "Taiv's web UI Toolkit built on Mantine v6",
|
|
37
15
|
"devDependencies": {
|
|
38
|
-
"@
|
|
39
|
-
"@storybook/addon-
|
|
40
|
-
"@storybook/
|
|
16
|
+
"@biomejs/biome": "2.4",
|
|
17
|
+
"@storybook/addon-docs": "^10.3.3",
|
|
18
|
+
"@storybook/addon-onboarding": "^10.3.3",
|
|
19
|
+
"@storybook/react-vite": "^10.3.3",
|
|
41
20
|
"@types/react": "^17.0.87",
|
|
42
21
|
"@types/react-dom": "^17.0.26",
|
|
43
22
|
"chromatic": "^13.3.0",
|
|
44
|
-
"storybook": "^
|
|
23
|
+
"storybook": "^10.3.3",
|
|
45
24
|
"typescript": "^5.0.2"
|
|
46
25
|
},
|
|
47
26
|
"exports": {
|
|
48
27
|
".": "./dist/components/index.js",
|
|
49
|
-
"./hooks": "./dist/hooks/index.js",
|
|
50
28
|
"./constants": "./dist/constants/index.js",
|
|
51
|
-
"./
|
|
52
|
-
"./types": "./dist/types/index.js"
|
|
53
|
-
|
|
29
|
+
"./hooks": "./dist/hooks/index.js",
|
|
30
|
+
"./types": "./dist/types/index.js",
|
|
31
|
+
"./utils": "./dist/utils/index.js"
|
|
32
|
+
},
|
|
33
|
+
"files": [
|
|
34
|
+
"dist"
|
|
35
|
+
],
|
|
36
|
+
"main": "dist/index.js",
|
|
37
|
+
"name": "@taiv/ui",
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"react": "^17.0.0",
|
|
40
|
+
"react-dom": "^17.0.0"
|
|
41
|
+
},
|
|
42
|
+
"repository": {
|
|
43
|
+
"type": "git",
|
|
44
|
+
"url": "https://github.com/alborz-taiv/taiv-ui"
|
|
45
|
+
},
|
|
46
|
+
"scripts": {
|
|
47
|
+
"assist": "biome check --linter-enabled=false --formatter-enabled=false src",
|
|
48
|
+
"assist:fix": "biome check --linter-enabled=false --formatter-enabled=false --write src",
|
|
49
|
+
"biome:check": "biome check src",
|
|
50
|
+
"biome:check:path": "biome check",
|
|
51
|
+
"biome:fix": "biome check --write src",
|
|
52
|
+
"biome:fix:path": "biome check --write",
|
|
53
|
+
"build": "tsc",
|
|
54
|
+
"build-storybook": "storybook build",
|
|
55
|
+
"clean": "rm -rf dist",
|
|
56
|
+
"dev": "npm link && tsc --watch",
|
|
57
|
+
"format": "biome check --linter-enabled=false --assist-enabled=false src",
|
|
58
|
+
"format:fix": "biome check --linter-enabled=false --assist-enabled=false --write src",
|
|
59
|
+
"lint": "biome check --formatter-enabled=false --assist-enabled=false src",
|
|
60
|
+
"lint:fix": "biome check --formatter-enabled=false --assist-enabled=false --write src",
|
|
61
|
+
"storybook": "storybook dev -p 6006"
|
|
62
|
+
},
|
|
63
|
+
"types": "dist/index.d.ts",
|
|
64
|
+
"version": "1.14.0"
|
|
54
65
|
}
|