@taiv/ui 1.13.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/icons.d.ts +7 -1
- package/dist/assets/icons.d.ts.map +1 -1
- package/dist/assets/icons.js +6 -1
- 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.js +1 -1
- package/dist/components/Info/Modals/Modals.stories.d.ts.map +1 -1
- package/dist/components/Info/Modals/Modals.stories.js +4 -3
- 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.map +1 -1
- package/dist/components/Info/Notifications/Notifications.stories.js +3 -2
- 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.map +1 -1
- package/dist/components/Inputs/Buttons/Button/Button.stories.js +5 -4
- 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/Box/Box.stories.d.ts.map +1 -1
- package/dist/components/Layout/Box/Box.stories.js +3 -2
- package/dist/components/Layout/Card/Card.d.ts.map +1 -1
- package/dist/components/Layout/Card/Card.js +1 -1
- package/dist/components/Layout/Card/Card.stories.d.ts.map +1 -1
- package/dist/components/Layout/Card/Card.stories.js +2 -1
- package/dist/components/Layout/Center/Center.stories.d.ts.map +1 -1
- package/dist/components/Layout/Center/Center.stories.js +2 -1
- package/dist/components/Layout/Frame/Frame.js +1 -1
- package/dist/components/Layout/Frame/Frame.stories.d.ts.map +1 -1
- package/dist/components/Layout/Frame/Frame.stories.js +3 -2
- package/dist/components/Layout/Grid/Grid.stories.d.ts.map +1 -1
- package/dist/components/Layout/Grid/Grid.stories.js +2 -1
- package/dist/components/Layout/Group/Group.stories.d.ts.map +1 -1
- package/dist/components/Layout/Group/Group.stories.js +5 -4
- package/dist/components/Layout/Loader/Loader.stories.d.ts.map +1 -1
- package/dist/components/Layout/Loader/Loader.stories.js +3 -2
- package/dist/components/Layout/SectionCard/SectionCard.js +1 -1
- package/dist/components/Layout/SectionCard/SectionCard.stories.js +2 -2
- package/dist/components/Layout/Stack/Stack.stories.d.ts.map +1 -1
- package/dist/components/Layout/Stack/Stack.stories.js +3 -2
- 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.map +1 -1
- package/dist/components/Layout/Tabs/Tabs.js +5 -4
- package/dist/components/Layout/Tabs/Tabs.stories.d.ts.map +1 -1
- package/dist/components/Layout/Tabs/Tabs.stories.js +6 -5
- package/dist/components/Misc/IconBadge/IconBadge.js +1 -1
- 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 +3 -2
- package/dist/components/Typography/Formula/Formula.stories.js +2 -2
- 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.map +1 -1
- package/dist/components/Typography/Fraction/Fraction.stories.js +2 -1
- package/dist/components/Typography/Text/Text.stories.js +1 -1
- package/dist/components/Typography/Title/Title.stories.js +1 -1
- 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/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.js +1 -1
- package/dist/docs/design/Colors.stories.d.ts.map +1 -1
- package/dist/docs/design/Colors.stories.js +6 -5
- 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/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 +38 -27
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Stepper as MantineStepper } from '@mantine/core';
|
|
3
|
+
import { IconCheck, IconPackage } from '@tabler/icons-react';
|
|
4
|
+
import { Step } from './Step';
|
|
5
|
+
const definition = {
|
|
6
|
+
label: 'Choose Plan',
|
|
7
|
+
description: 'Select your base package',
|
|
8
|
+
icon: _jsx(IconPackage, { size: 16 }),
|
|
9
|
+
completedIcon: _jsx(IconCheck, { size: 16 }),
|
|
10
|
+
};
|
|
11
|
+
const meta = {
|
|
12
|
+
title: 'Components/Misc/Stepper/Step',
|
|
13
|
+
component: Step,
|
|
14
|
+
parameters: {
|
|
15
|
+
layout: 'centered',
|
|
16
|
+
docs: {
|
|
17
|
+
description: {
|
|
18
|
+
component: 'Step renders one step item (label, description, icon states, and optional content) and is intended to be used as a direct child of Stepper.',
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
decorators: [
|
|
23
|
+
(Story) => (_jsx(MantineStepper, { active: 0, onStepClick: () => { }, children: _jsx(Story, {}) })),
|
|
24
|
+
],
|
|
25
|
+
args: {
|
|
26
|
+
label: definition.label,
|
|
27
|
+
description: definition.description,
|
|
28
|
+
icon: definition.icon,
|
|
29
|
+
completedIcon: definition.completedIcon,
|
|
30
|
+
header: definition.header,
|
|
31
|
+
},
|
|
32
|
+
argTypes: {
|
|
33
|
+
label: {
|
|
34
|
+
control: { type: 'text' },
|
|
35
|
+
description: 'Label of the step',
|
|
36
|
+
table: { type: { summary: 'ReactNode' } },
|
|
37
|
+
},
|
|
38
|
+
description: {
|
|
39
|
+
control: { type: 'text' },
|
|
40
|
+
description: 'Description of the step',
|
|
41
|
+
table: { type: { summary: 'ReactNode' } },
|
|
42
|
+
},
|
|
43
|
+
icon: {
|
|
44
|
+
control: false,
|
|
45
|
+
description: 'Icon when the step is active or not completed',
|
|
46
|
+
table: { type: { summary: 'ReactNode' }, defaultValue: { summary: 'index + 1' } },
|
|
47
|
+
},
|
|
48
|
+
completedIcon: {
|
|
49
|
+
control: false,
|
|
50
|
+
description: 'Icon when the step is completed',
|
|
51
|
+
table: { type: { summary: 'ReactNode' }, defaultValue: { summary: 'index + 1' } },
|
|
52
|
+
},
|
|
53
|
+
header: {
|
|
54
|
+
control: { type: 'object' },
|
|
55
|
+
description: 'Header displayed under the Stepper',
|
|
56
|
+
table: { type: { summary: 'ReactNode' } },
|
|
57
|
+
},
|
|
58
|
+
loading: {
|
|
59
|
+
control: { type: 'boolean' },
|
|
60
|
+
description: 'Show loading indicator instead of icon',
|
|
61
|
+
table: { type: { summary: 'boolean' }, defaultValue: { summary: 'false' } },
|
|
62
|
+
},
|
|
63
|
+
allowStepSelect: {
|
|
64
|
+
control: { type: 'boolean' },
|
|
65
|
+
description: 'Toggle allowing step to be clicked',
|
|
66
|
+
table: { type: { summary: 'boolean' }, defaultValue: { summary: 'false' } },
|
|
67
|
+
},
|
|
68
|
+
completed: {
|
|
69
|
+
control: { type: 'boolean' },
|
|
70
|
+
description: 'Final step to be used as header only',
|
|
71
|
+
table: { type: { summary: 'boolean' }, defaultValue: { summary: 'false' } },
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
export default meta;
|
|
76
|
+
const interactiveRender = (args) => {
|
|
77
|
+
return (_jsx(Step, { ...args }));
|
|
78
|
+
};
|
|
79
|
+
export const Default = {};
|
|
80
|
+
export const Loading = {
|
|
81
|
+
render: interactiveRender,
|
|
82
|
+
args: { loading: true },
|
|
83
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type StepperProps as MantineStepperProps } from '@mantine/core';
|
|
2
|
+
import { type StepProps } from './Step';
|
|
3
|
+
import { type StepperVariant } from './variants';
|
|
4
|
+
export interface StepperProps extends Omit<MantineStepperProps, 'children' | 'active'> {
|
|
5
|
+
activeStep: number;
|
|
6
|
+
steps: StepProps[];
|
|
7
|
+
variant?: StepperVariant;
|
|
8
|
+
}
|
|
9
|
+
export declare const Stepper: ({ activeStep, steps, variant, size, iconSize, orientation, allowNextStepsSelect, styles, ...props }: StepperProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
//# sourceMappingURL=Stepper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Stepper.d.ts","sourceRoot":"","sources":["../../../../src/components/Misc/Stepper/Stepper.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA6B,KAAK,YAAY,IAAI,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpG,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAc,KAAK,cAAc,EAAwB,MAAM,YAAY,CAAC;AACnF,MAAM,WAAW,YAAa,SAAQ,IAAI,CAAC,mBAAmB,EAAE,UAAU,GAAG,QAAQ,CAAC;IACpF,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B;AAED,eAAO,MAAM,OAAO,GAAI,qGAUrB,YAAY,4CAqFd,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Stepper as MantineStepper } from '@mantine/core';
|
|
3
|
+
import { Step } from './Step';
|
|
4
|
+
import { baseStyles, DEFAULT_ICON_SIZE_PX } from './variants';
|
|
5
|
+
;
|
|
6
|
+
export const Stepper = ({ activeStep, steps, variant = 'primary', size = 'md', iconSize = DEFAULT_ICON_SIZE_PX[size], orientation = 'horizontal', allowNextStepsSelect = false, styles, ...props }) => {
|
|
7
|
+
const resolvedBaseStyles = baseStyles(variant, props.color);
|
|
8
|
+
const stepItems = steps.filter((step) => !step.completed);
|
|
9
|
+
const completedStep = steps.find((step) => step.completed);
|
|
10
|
+
const style = orientation === 'horizontal'
|
|
11
|
+
? {
|
|
12
|
+
...resolvedBaseStyles,
|
|
13
|
+
root: {
|
|
14
|
+
boxSizing: 'border-box',
|
|
15
|
+
width: '100%',
|
|
16
|
+
maxWidth: '100%',
|
|
17
|
+
},
|
|
18
|
+
steps: {
|
|
19
|
+
alignItems: 'flex-start',
|
|
20
|
+
boxSizing: 'border-box',
|
|
21
|
+
width: '100%',
|
|
22
|
+
gap: '1.5rem',
|
|
23
|
+
},
|
|
24
|
+
step: {
|
|
25
|
+
...resolvedBaseStyles.step,
|
|
26
|
+
flexDirection: 'column',
|
|
27
|
+
alignItems: 'center',
|
|
28
|
+
position: 'relative',
|
|
29
|
+
flex: '1 1 0',
|
|
30
|
+
minWidth: 0,
|
|
31
|
+
width: 'auto',
|
|
32
|
+
maxWidth: 'none',
|
|
33
|
+
},
|
|
34
|
+
stepBody: {
|
|
35
|
+
...resolvedBaseStyles.stepBody,
|
|
36
|
+
marginLeft: 0,
|
|
37
|
+
marginRight: 0,
|
|
38
|
+
marginTop: '0.8rem',
|
|
39
|
+
display: 'flex',
|
|
40
|
+
flexDirection: 'column',
|
|
41
|
+
alignItems: 'stretch',
|
|
42
|
+
boxSizing: 'border-box',
|
|
43
|
+
},
|
|
44
|
+
stepLabel: {
|
|
45
|
+
...resolvedBaseStyles.stepLabel,
|
|
46
|
+
textAlign: 'center',
|
|
47
|
+
whiteSpace: 'nowrap',
|
|
48
|
+
alignSelf: 'stretch',
|
|
49
|
+
},
|
|
50
|
+
stepDescription: {
|
|
51
|
+
...resolvedBaseStyles.stepDescription,
|
|
52
|
+
textAlign: 'center',
|
|
53
|
+
boxSizing: 'border-box',
|
|
54
|
+
overflowWrap: 'break-word',
|
|
55
|
+
minWidth: '8rem',
|
|
56
|
+
},
|
|
57
|
+
separator: {
|
|
58
|
+
flex: '1 1 0',
|
|
59
|
+
height: '2px',
|
|
60
|
+
marginTop: `calc(${(iconSize) / 32}rem - 0.0625rem)`,
|
|
61
|
+
marginLeft: '-2rem',
|
|
62
|
+
marginRight: '-2rem',
|
|
63
|
+
},
|
|
64
|
+
content: {
|
|
65
|
+
...resolvedBaseStyles.content,
|
|
66
|
+
marginTop: '1rem',
|
|
67
|
+
},
|
|
68
|
+
...styles
|
|
69
|
+
}
|
|
70
|
+
: { ...resolvedBaseStyles, ...styles };
|
|
71
|
+
return (_jsxs(MantineStepper, { ...props, active: activeStep, iconSize: iconSize, size: size, orientation: orientation, allowNextStepsSelect: allowNextStepsSelect, style: { zoom: 1.5 }, styles: style, children: [stepItems.map((step, index) => (_jsx(Step, { ...step, children: step.header }, index))), completedStep ? _jsx(MantineStepper.Completed, { children: completedStep.header }) : null] }));
|
|
72
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { Stepper } from './Stepper';
|
|
3
|
+
declare const meta: Meta<typeof Stepper>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const Color: Story;
|
|
8
|
+
export declare const Size: Story;
|
|
9
|
+
export declare const Orientation: Story;
|
|
10
|
+
export declare const Icons: Story;
|
|
11
|
+
export declare const Header: Story;
|
|
12
|
+
export declare const AllowNextStepSelect: Story;
|
|
13
|
+
//# sourceMappingURL=Stepper.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Stepper.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/Misc/Stepper/Stepper.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAS5D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAyBpC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,OAAO,CA+D9B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAiBnC,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAGnB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,KAGlB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAGzB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAGnB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAOpB,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,KAGjC,CAAC"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { IconCheck, IconCreditCard, IconFileText, IconPackage, IconSettings, } from '@tabler/icons-react';
|
|
4
|
+
import { Stepper } from './Stepper';
|
|
5
|
+
const checkoutSteps = [
|
|
6
|
+
{ label: 'Choose Plan', description: 'Select your base package' },
|
|
7
|
+
{ label: 'Add-Ons', description: 'Customize your setup' },
|
|
8
|
+
{ label: 'Payment', description: 'Enter billing details' },
|
|
9
|
+
{ label: 'Confirm', description: 'Review and submit' },
|
|
10
|
+
];
|
|
11
|
+
const iconSteps = [
|
|
12
|
+
{ label: 'Plan', description: 'Choose plan', icon: _jsx(IconPackage, { size: 16 }), completedIcon: _jsx(IconCheck, { size: 16 }) },
|
|
13
|
+
{ label: 'Config', description: 'Configure', icon: _jsx(IconSettings, { size: 16 }), completedIcon: _jsx(IconCheck, { size: 16 }) },
|
|
14
|
+
{ label: 'Payment', description: 'Pay', icon: _jsx(IconCreditCard, { size: 16 }), completedIcon: _jsx(IconCheck, { size: 16 }) },
|
|
15
|
+
{ label: 'Review', description: 'Review', icon: _jsx(IconFileText, { size: 16 }), completedIcon: _jsx(IconCheck, { size: 16 }) },
|
|
16
|
+
];
|
|
17
|
+
const completedSteps = [
|
|
18
|
+
{ label: 'Choose Plan', description: 'Select your base package', header: 'Step 1 header' },
|
|
19
|
+
{ label: 'Add-Ons', description: 'Customize your setup', header: 'Step 2 header' },
|
|
20
|
+
{ label: 'Payment', description: 'Enter billing details', header: 'Step 3 header' },
|
|
21
|
+
{ label: 'Confirm', description: 'Review and submit', header: 'Step 4 header' },
|
|
22
|
+
{ label: 'Done', completed: true, header: 'All steps are completed.' },
|
|
23
|
+
];
|
|
24
|
+
const meta = {
|
|
25
|
+
title: 'Components/Misc/Stepper',
|
|
26
|
+
component: Stepper,
|
|
27
|
+
parameters: {
|
|
28
|
+
layout: 'centered',
|
|
29
|
+
docs: {
|
|
30
|
+
description: {
|
|
31
|
+
component: 'The Stepper component is a reusable wrapper around Mantine Stepper for building linear, multi-step flows like onboarding, checkout, and setup forms.',
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
args: {
|
|
36
|
+
activeStep: 1,
|
|
37
|
+
steps: checkoutSteps,
|
|
38
|
+
variant: 'primary',
|
|
39
|
+
size: 'md',
|
|
40
|
+
orientation: 'horizontal',
|
|
41
|
+
},
|
|
42
|
+
argTypes: {
|
|
43
|
+
activeStep: {
|
|
44
|
+
control: { type: 'number', min: 0, max: checkoutSteps.length },
|
|
45
|
+
description: 'Index of the active step',
|
|
46
|
+
table: { type: { summary: 'number' } },
|
|
47
|
+
},
|
|
48
|
+
steps: {
|
|
49
|
+
control: false,
|
|
50
|
+
description: 'Array of step definitions (label, description, icon, etc.)',
|
|
51
|
+
table: { type: { summary: 'Step[]' } },
|
|
52
|
+
},
|
|
53
|
+
variant: {
|
|
54
|
+
control: { type: 'select' },
|
|
55
|
+
options: ['primary'],
|
|
56
|
+
description: 'Variant for Stepper color scheme',
|
|
57
|
+
table: { type: { summary: "'primary'" }, defaultValue: { summary: "'primary'" } },
|
|
58
|
+
},
|
|
59
|
+
size: {
|
|
60
|
+
control: { type: 'select' },
|
|
61
|
+
options: ['xs', 'sm', 'md', 'lg', 'xl'],
|
|
62
|
+
description: 'Stepper control size',
|
|
63
|
+
table: { type: { summary: "'xs' | 'sm' | 'md' | 'lg' | 'xl'" }, defaultValue: { summary: "'md'" } },
|
|
64
|
+
},
|
|
65
|
+
iconSize: {
|
|
66
|
+
control: { type: 'number', min: 12, max: 64, step: 2 },
|
|
67
|
+
description: 'Size of the step circles in pixels',
|
|
68
|
+
table: { type: { summary: 'number' }, defaultValue: { summary: '42' } },
|
|
69
|
+
},
|
|
70
|
+
orientation: {
|
|
71
|
+
control: { type: 'inline-radio' },
|
|
72
|
+
options: ['horizontal', 'vertical'],
|
|
73
|
+
description: 'Layout direction of the stepper',
|
|
74
|
+
table: { type: { summary: "'horizontal' | 'vertical'" }, defaultValue: { summary: "'horizontal'" } },
|
|
75
|
+
},
|
|
76
|
+
allowNextStepsSelect: {
|
|
77
|
+
control: { type: 'boolean' },
|
|
78
|
+
description: 'Allow clicking steps to set active step',
|
|
79
|
+
table: { type: { summary: 'boolean' }, defaultValue: { summary: 'false' } },
|
|
80
|
+
},
|
|
81
|
+
onStepClick: {
|
|
82
|
+
control: false,
|
|
83
|
+
description: 'Event handler for step click',
|
|
84
|
+
table: { category: 'Events', type: { summary: '(stepIndex: number) => void' }, }
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
export default meta;
|
|
89
|
+
const interactiveRender = (args) => {
|
|
90
|
+
const [activeStep, setActiveStep] = useState(args.activeStep);
|
|
91
|
+
useEffect(() => {
|
|
92
|
+
setActiveStep(args.activeStep);
|
|
93
|
+
}, [args.activeStep]);
|
|
94
|
+
return (_jsx(Stepper, { ...args, activeStep: activeStep, onStepClick: (stepIndex) => setActiveStep(stepIndex) }));
|
|
95
|
+
};
|
|
96
|
+
export const Default = {
|
|
97
|
+
render: interactiveRender,
|
|
98
|
+
};
|
|
99
|
+
export const Color = {
|
|
100
|
+
render: interactiveRender,
|
|
101
|
+
args: { color: 'red' },
|
|
102
|
+
};
|
|
103
|
+
export const Size = {
|
|
104
|
+
render: interactiveRender,
|
|
105
|
+
args: { size: 'xl' },
|
|
106
|
+
};
|
|
107
|
+
export const Orientation = {
|
|
108
|
+
render: interactiveRender,
|
|
109
|
+
args: { orientation: 'vertical' },
|
|
110
|
+
};
|
|
111
|
+
export const Icons = {
|
|
112
|
+
render: interactiveRender,
|
|
113
|
+
args: { steps: iconSteps },
|
|
114
|
+
};
|
|
115
|
+
export const Header = {
|
|
116
|
+
render: interactiveRender,
|
|
117
|
+
args: {
|
|
118
|
+
steps: completedSteps,
|
|
119
|
+
activeStep: 4,
|
|
120
|
+
allowNextStepsSelect: true
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
export const AllowNextStepSelect = {
|
|
124
|
+
render: interactiveRender,
|
|
125
|
+
args: { allowNextStepsSelect: true },
|
|
126
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export declare const componentVariants: {
|
|
2
|
+
primary: {
|
|
3
|
+
color: "#00A6F4";
|
|
4
|
+
};
|
|
5
|
+
};
|
|
6
|
+
export type StepperVariant = keyof typeof componentVariants;
|
|
7
|
+
export declare const baseStyles: (variant: StepperVariant, color?: any) => {
|
|
8
|
+
step: {
|
|
9
|
+
fontFamily: string;
|
|
10
|
+
WebkitFontSmoothing: string;
|
|
11
|
+
MozOsxFontSmoothing: string;
|
|
12
|
+
fontWeight: number;
|
|
13
|
+
};
|
|
14
|
+
stepBody: {
|
|
15
|
+
color: any;
|
|
16
|
+
fontFamily: string;
|
|
17
|
+
WebkitFontSmoothing: string;
|
|
18
|
+
MozOsxFontSmoothing: string;
|
|
19
|
+
fontWeight: number;
|
|
20
|
+
};
|
|
21
|
+
stepIcon: {
|
|
22
|
+
'&:not([data-progress]):not([data-completed])': {
|
|
23
|
+
backgroundColor: string;
|
|
24
|
+
color: "#D9D9D9";
|
|
25
|
+
borderColor: "#D9D9D9";
|
|
26
|
+
};
|
|
27
|
+
'&[data-progress]': {
|
|
28
|
+
backgroundColor: string;
|
|
29
|
+
color: any;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
stepLabel: {
|
|
33
|
+
color: any;
|
|
34
|
+
fontFamily: string;
|
|
35
|
+
WebkitFontSmoothing: string;
|
|
36
|
+
MozOsxFontSmoothing: string;
|
|
37
|
+
fontWeight: number;
|
|
38
|
+
};
|
|
39
|
+
stepDescription: {
|
|
40
|
+
fontFamily: string;
|
|
41
|
+
WebkitFontSmoothing: string;
|
|
42
|
+
MozOsxFontSmoothing: string;
|
|
43
|
+
fontWeight: number;
|
|
44
|
+
};
|
|
45
|
+
content: {
|
|
46
|
+
textAlign: "center";
|
|
47
|
+
fontFamily: string;
|
|
48
|
+
WebkitFontSmoothing: string;
|
|
49
|
+
MozOsxFontSmoothing: string;
|
|
50
|
+
fontWeight: number;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
export declare const DEFAULT_ICON_SIZE_PX: Record<string, number>;
|
|
54
|
+
//# sourceMappingURL=variants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variants.d.ts","sourceRoot":"","sources":["../../../../src/components/Misc/Stepper/variants.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,iBAAiB;;;;CAI7B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,iBAAiB,CAAC;AAE5D,eAAO,MAAM,UAAU,GAAI,SAAS,cAAc,EAAE,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiC9D,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAMvD,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { fontBase } from '../../../constants/font';
|
|
2
|
+
import { primary, neutral, white } from '../../../constants/colors';
|
|
3
|
+
export const componentVariants = {
|
|
4
|
+
primary: {
|
|
5
|
+
color: primary[200],
|
|
6
|
+
},
|
|
7
|
+
};
|
|
8
|
+
export const baseStyles = (variant, color) => {
|
|
9
|
+
const variantColor = color !== null && color !== void 0 ? color : componentVariants[variant].color;
|
|
10
|
+
return {
|
|
11
|
+
step: {
|
|
12
|
+
...fontBase,
|
|
13
|
+
},
|
|
14
|
+
stepBody: {
|
|
15
|
+
...fontBase,
|
|
16
|
+
color: variantColor,
|
|
17
|
+
},
|
|
18
|
+
stepIcon: {
|
|
19
|
+
'&:not([data-progress]):not([data-completed])': {
|
|
20
|
+
backgroundColor: white,
|
|
21
|
+
color: neutral[100],
|
|
22
|
+
borderColor: neutral[100],
|
|
23
|
+
},
|
|
24
|
+
'&[data-progress]': {
|
|
25
|
+
backgroundColor: white,
|
|
26
|
+
color: variantColor,
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
stepLabel: {
|
|
30
|
+
...fontBase,
|
|
31
|
+
color: variantColor
|
|
32
|
+
},
|
|
33
|
+
stepDescription: {
|
|
34
|
+
...fontBase,
|
|
35
|
+
},
|
|
36
|
+
content: {
|
|
37
|
+
...fontBase,
|
|
38
|
+
textAlign: 'center',
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
export const DEFAULT_ICON_SIZE_PX = {
|
|
43
|
+
xs: 34,
|
|
44
|
+
sm: 36,
|
|
45
|
+
md: 42,
|
|
46
|
+
lg: 48,
|
|
47
|
+
xl: 52,
|
|
48
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CollapsibleText.d.ts","sourceRoot":"","sources":["../../../../src/components/Typography/CollapsibleText/CollapsibleText.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"CollapsibleText.d.ts","sourceRoot":"","sources":["../../../../src/components/Typography/CollapsibleText/CollapsibleText.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAGpD,UAAU,oBAAoB;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,OAAO,SAAS,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC7B,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACrC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,QAAA,MAAM,eAAe,GAAI,2DAAoE,oBAAoB,4CAuBhH,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -6,8 +6,9 @@ import { Group } from '../../Layout/Group/Group';
|
|
|
6
6
|
import { Text } from '../Text/Text';
|
|
7
7
|
import { Transition } from '../../Misc/Transition/Transition';
|
|
8
8
|
import { UnstyledButton } from '../../Inputs/Buttons/UnstyledButton/UnstyledButton';
|
|
9
|
+
import { spacing } from '../../../constants/spacing';
|
|
9
10
|
const CollapsibleText = ({ text, variant = 'body', className, opened, setOpened, children }) => {
|
|
10
|
-
return (_jsxs(_Fragment, { children: [_jsx(UnstyledButton, { className: className, onClick: () => setOpened(!opened), children: _jsxs(Group, { gap:
|
|
11
|
+
return (_jsxs(_Fragment, { children: [_jsx(UnstyledButton, { className: className, onClick: () => setOpened(!opened), children: _jsxs(Group, { gap: spacing.xs, align: "center", children: [_jsx(Text, { variant: variant, color: primary[200], children: text }), _jsx(IconCaretDownFilled, { size: 18, style: {
|
|
11
12
|
color: primary[200],
|
|
12
13
|
transform: opened ? 'rotate(180deg)' : 'none',
|
|
13
14
|
transition: 'transform 200ms ease',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CollapsibleText.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/Typography/CollapsibleText/CollapsibleText.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"CollapsibleText.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/Typography/CollapsibleText/CollapsibleText.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAMpD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,eAAe,CAuCtC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAgBnC,eAAO,MAAM,OAAO,EAAE,KAerB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KASzB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KA4B3B,CAAC"}
|
|
@@ -3,6 +3,7 @@ import { useState } from 'react';
|
|
|
3
3
|
import { CollapsibleText } from './CollapsibleText';
|
|
4
4
|
import { Stack } from '../../Layout/Stack/Stack';
|
|
5
5
|
import { Text } from '../Text/Text';
|
|
6
|
+
import { spacing } from '../../../constants/spacing';
|
|
6
7
|
const meta = {
|
|
7
8
|
title: 'Components/Typography/CollapsibleText',
|
|
8
9
|
component: CollapsibleText,
|
|
@@ -51,7 +52,7 @@ const CollapsibleTextWithState = (props) => {
|
|
|
51
52
|
export const Default = {
|
|
52
53
|
render: (args) => {
|
|
53
54
|
const [opened, setOpened] = useState(false);
|
|
54
|
-
return (_jsx(CollapsibleText, { text: args.text, variant: args.variant, opened: opened, setOpened: setOpened, children: _jsx(Stack, { gap:
|
|
55
|
+
return (_jsx(CollapsibleText, { text: args.text, variant: args.variant, opened: opened, setOpened: setOpened, children: _jsx(Stack, { gap: spacing.sm, style: { paddingTop: spacing.xs }, children: _jsx(Text, { variant: "body", children: "Expanded content goes here. You can put forms, lists, or any other content." }) }) }));
|
|
55
56
|
},
|
|
56
57
|
args: {
|
|
57
58
|
text: 'Show more',
|
|
@@ -59,10 +60,10 @@ export const Default = {
|
|
|
59
60
|
},
|
|
60
61
|
};
|
|
61
62
|
export const WithContent = {
|
|
62
|
-
render: () => (_jsx(CollapsibleTextWithState, { text: "Section with content", children: _jsxs(Stack, { gap:
|
|
63
|
+
render: () => (_jsx(CollapsibleTextWithState, { text: "Section with content", children: _jsxs(Stack, { gap: spacing.xs, style: { paddingTop: spacing.xs }, children: [_jsx(Text, { variant: "body", children: "First paragraph of expanded content." }), _jsx(Text, { variant: "body", children: "Second paragraph. Use CollapsibleText for a single-line label that expands." })] }) })),
|
|
63
64
|
};
|
|
64
65
|
export const OpenAndClosed = {
|
|
65
|
-
render: () => (_jsxs(Stack, { gap: "
|
|
66
|
+
render: () => (_jsxs(Stack, { gap: "20px", children: [_jsxs("div", { children: [_jsx(Text, { variant: "label", style: { marginBottom: spacing.xs, display: 'block' }, children: "Closed" }), _jsx(CollapsibleTextWithState, { text: "Closed state (click to expand)" })] }), _jsxs("div", { children: [_jsx(Text, { variant: "label", style: { marginBottom: spacing.xs, display: 'block' }, children: "Open" }), _jsx(CollapsibleTextWithState, { text: "Open state (click to collapse)", initialOpened: true, children: _jsx(Stack, { gap: spacing.xs, style: { paddingTop: spacing.xs }, children: _jsx(Text, { variant: "body", children: "Content is visible when opened." }) }) })] })] })),
|
|
66
67
|
parameters: {
|
|
67
68
|
docs: {
|
|
68
69
|
description: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CollapsibleTitle.d.ts","sourceRoot":"","sources":["../../../../src/components/Typography/CollapsibleTitle/CollapsibleTitle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"CollapsibleTitle.d.ts","sourceRoot":"","sources":["../../../../src/components/Typography/CollapsibleTitle/CollapsibleTitle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAY1B,UAAU,qBAAqB;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACrC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,QAAA,MAAM,gBAAgB,GAAI,4DAA4D,qBAAqB,4CA4B1G,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { IconCaretDownFilled } from '@tabler/icons-react';
|
|
3
3
|
import { neutral } from '../../../constants/colors';
|
|
4
|
+
import { spacing } from '../../../constants/spacing';
|
|
4
5
|
import { Box } from '../../Layout/Box/Box';
|
|
5
6
|
import { Group } from '../../Layout/Group/Group';
|
|
6
7
|
import { Stack } from '../../Layout/Stack/Stack';
|
|
@@ -9,7 +10,7 @@ import { Title } from '../Title/Title';
|
|
|
9
10
|
import { Transition } from '../../Misc/Transition/Transition';
|
|
10
11
|
import { UnstyledButton } from '../../Inputs/Buttons/UnstyledButton/UnstyledButton';
|
|
11
12
|
const CollapsibleTitle = ({ title, subText, className, opened, setOpened, children }) => {
|
|
12
|
-
return (_jsxs(_Fragment, { children: [_jsx(UnstyledButton, { className: className, onClick: () => setOpened(!opened), children: _jsxs(Stack, { gap:
|
|
13
|
+
return (_jsxs(_Fragment, { children: [_jsx(UnstyledButton, { className: className, onClick: () => setOpened(!opened), children: _jsxs(Stack, { gap: spacing.xxs, children: [_jsxs(Group, { gap: spacing.xs, align: "center", children: [_jsx(Title, { variant: "sectionSubheader", size: "md", weight: "medium", children: title }), _jsx(IconCaretDownFilled, { size: 18, style: {
|
|
13
14
|
color: neutral[200],
|
|
14
15
|
transform: opened ? 'rotate(180deg)' : 'none',
|
|
15
16
|
transition: 'transform 200ms ease',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CollapsibleTitle.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/Typography/CollapsibleTitle/CollapsibleTitle.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"CollapsibleTitle.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/Typography/CollapsibleTitle/CollapsibleTitle.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAKtD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,gBAAgB,CAsCvC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAgBnC,eAAO,MAAM,OAAO,EAAE,KAoBrB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAazB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KA4B3B,CAAC"}
|
|
@@ -3,6 +3,7 @@ import { useState } from 'react';
|
|
|
3
3
|
import { CollapsibleTitle } from './CollapsibleTitle';
|
|
4
4
|
import { Stack } from '../../Layout/Stack/Stack';
|
|
5
5
|
import { Text } from '../Text/Text';
|
|
6
|
+
import { spacing } from '../../../constants/spacing';
|
|
6
7
|
const meta = {
|
|
7
8
|
title: 'Components/Typography/CollapsibleTitle',
|
|
8
9
|
component: CollapsibleTitle,
|
|
@@ -50,7 +51,7 @@ const CollapsibleTitleWithState = (props) => {
|
|
|
50
51
|
export const Default = {
|
|
51
52
|
render: (args) => {
|
|
52
53
|
const [opened, setOpened] = useState(false);
|
|
53
|
-
return (_jsx(CollapsibleTitle, { title: args.title, subText: args.subText, opened: opened, setOpened: setOpened, children: _jsx(Stack, { gap:
|
|
54
|
+
return (_jsx(CollapsibleTitle, { title: args.title, subText: args.subText, opened: opened, setOpened: setOpened, children: _jsx(Stack, { gap: spacing.sm, style: { paddingTop: spacing.xs }, children: _jsx(Text, { variant: "body", children: "Expanded content goes here. You can put forms, lists, or any other content." }) }) }));
|
|
54
55
|
},
|
|
55
56
|
args: {
|
|
56
57
|
title: 'Title',
|
|
@@ -58,10 +59,10 @@ export const Default = {
|
|
|
58
59
|
},
|
|
59
60
|
};
|
|
60
61
|
export const WithContent = {
|
|
61
|
-
render: () => (_jsx(CollapsibleTitleWithState, { title: "Section with content", subText: "Click to expand", children: _jsxs(Stack, { gap:
|
|
62
|
+
render: () => (_jsx(CollapsibleTitleWithState, { title: "Section with content", subText: "Click to expand", children: _jsxs(Stack, { gap: spacing.xs, style: { paddingTop: spacing.xs }, children: [_jsx(Text, { variant: "body", children: "First paragraph of expanded content." }), _jsx(Text, { variant: "body", children: "Second paragraph. The header uses a medium-weight title and caption subtext by default." })] }) })),
|
|
62
63
|
};
|
|
63
64
|
export const OpenAndClosed = {
|
|
64
|
-
render: () => (_jsxs(Stack, { gap: "
|
|
65
|
+
render: () => (_jsxs(Stack, { gap: "20px", children: [_jsxs("div", { children: [_jsx(Text, { variant: "label", style: { marginBottom: spacing.xs, display: 'block' }, children: "Closed" }), _jsx(CollapsibleTitleWithState, { title: "Closed state", subText: "(click to expand)" })] }), _jsxs("div", { children: [_jsx(Text, { variant: "label", style: { marginBottom: spacing.xs, display: 'block' }, children: "Open" }), _jsx(CollapsibleTitleWithState, { title: "Open state", subText: "(click to collapse)", initialOpened: true, children: _jsx(Stack, { gap: spacing.xs, style: { paddingTop: spacing.xs }, children: _jsx(Text, { variant: "body", children: "Content is visible when opened." }) }) })] })] })),
|
|
65
66
|
parameters: {
|
|
66
67
|
docs: {
|
|
67
68
|
description: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Formula.d.ts","sourceRoot":"","sources":["../../../../src/components/Typography/Formula/Formula.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"Formula.d.ts","sourceRoot":"","sources":["../../../../src/components/Typography/Formula/Formula.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAM/D,UAAU,YAAY;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,OAAO,UAAU,CAAC;IACjC,IAAI,CAAC,EAAE,MAAM,OAAO,QAAQ,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAqMD,QAAA,MAAM,OAAO,GAAI,qCAAqC,YAAY,4CAKjE,CAAC;AAEF,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { spacing } from '../../../constants/spacing';
|
|
2
3
|
import { Text } from '../Text/Text';
|
|
3
4
|
import { Fraction } from '../Fraction/Fraction';
|
|
4
5
|
import { Group } from '../../Layout/Group/Group';
|
|
@@ -114,12 +115,12 @@ class FormulaParser {
|
|
|
114
115
|
}
|
|
115
116
|
// Update the renderer to handle subscript
|
|
116
117
|
const FormulaRenderer = ({ nodes, weight, size, color }) => {
|
|
117
|
-
return (_jsx(Group, { gap:
|
|
118
|
+
return (_jsx(Group, { gap: spacing.xs, children: nodes.map((node, index) => {
|
|
118
119
|
switch (node.type) {
|
|
119
120
|
case 'default':
|
|
120
121
|
return (_jsx(Text, { weight: weight, size: size, color: color, children: node.value }, index));
|
|
121
122
|
case 'operator':
|
|
122
|
-
return (_jsx(Text, { weight: weight, size: size, color: color, mx:
|
|
123
|
+
return (_jsx(Text, { weight: weight, size: size, color: color, mx: spacing.xxs, children: node.value === '*' ? '×' : node.value }, index));
|
|
123
124
|
case 'subscript':
|
|
124
125
|
return (_jsxs(Text, { weight: weight, size: size, color: color, children: [node.value, _jsx("sub", { children: node.subscript })] }, index));
|
|
125
126
|
case 'fraction':
|
|
@@ -54,7 +54,7 @@ export const Default = {
|
|
|
54
54
|
},
|
|
55
55
|
};
|
|
56
56
|
export const Operations = {
|
|
57
|
-
render: () => (_jsxs(Stack, { gap: "
|
|
57
|
+
render: () => (_jsxs(Stack, { gap: "10px", children: [_jsx(Formula, { expression: "a + b" }), _jsx(Formula, { expression: "a - b" }), _jsx(Formula, { expression: "a * b" }), _jsx(Formula, { expression: "a / b" }), _jsx(Formula, { expression: "Revenue_a * Revenue_b" })] })),
|
|
58
58
|
};
|
|
59
59
|
export const StructuringEquations = {
|
|
60
60
|
parameters: {
|
|
@@ -71,7 +71,7 @@ export const StructuringEquations = {
|
|
|
71
71
|
},
|
|
72
72
|
},
|
|
73
73
|
},
|
|
74
|
-
render: () => (_jsxs(Stack, { gap: "
|
|
74
|
+
render: () => (_jsxs(Stack, { gap: "10px", children: [_jsx(Formula, { expression: "a + b / c" }), _jsx(Formula, { expression: "(a + b) / c" }), _jsx(Formula, { expression: "(a + b) / (c + d)" })] })),
|
|
75
75
|
};
|
|
76
76
|
export const CustomOverrides = {
|
|
77
77
|
parameters: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Fraction.d.ts","sourceRoot":"","sources":["../../../../src/components/Typography/Fraction/Fraction.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAQ,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"Fraction.d.ts","sourceRoot":"","sources":["../../../../src/components/Typography/Fraction/Fraction.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAQ,SAAS,EAAE,MAAM,cAAc,CAAC;AAI/C,UAAU,aAAc,SAAQ,IAAI,CAAC,SAAS,EAAE,UAAU,GAAG,QAAQ,CAAC;IACpE,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,WAAW,EAAE,KAAK,CAAC,SAAS,CAAC;CAC9B;AAED,QAAA,MAAM,QAAQ,GAAI,0DAAmE,aAAa,4CAajG,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -3,8 +3,9 @@ import { Divider } from '../../Layout/Divider/Divider';
|
|
|
3
3
|
import { textStyle } from '../../../constants';
|
|
4
4
|
import { Text } from '../Text/Text';
|
|
5
5
|
import { Stack } from '../../Layout/Stack/Stack';
|
|
6
|
+
import { spacing } from '../../../constants/spacing';
|
|
6
7
|
const Fraction = ({ numerator, denominator, variant = 'body', color, weight, size }) => {
|
|
7
8
|
const selectedVariant = textStyle[variant];
|
|
8
|
-
return (_jsxs(Stack, { sx: { display: 'inline-flex', alignItems: 'center', lineHeight: 1 }, gap:
|
|
9
|
+
return (_jsxs(Stack, { sx: { display: 'inline-flex', alignItems: 'center', lineHeight: 1 }, gap: spacing.xxs, children: [_jsx(Text, { variant: variant, color: color, weight: weight, size: size, sx: { display: 'block', textAlign: 'center' }, children: numerator }), _jsx(Divider, { color: color || selectedVariant.color, width: "100%" }), _jsx(Text, { variant: variant, color: color, weight: weight, size: size, sx: { display: 'block', textAlign: 'center' }, children: denominator })] }));
|
|
9
10
|
};
|
|
10
11
|
export { Fraction };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Fraction.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/Typography/Fraction/Fraction.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"Fraction.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/Typography/Fraction/Fraction.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAKtC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,QAAQ,CAyD/B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KASrB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAStB,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAW7B,CAAC"}
|