@taiv/ui 1.13.0 → 1.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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
|
@@ -3,6 +3,7 @@ import { useState } from 'react';
|
|
|
3
3
|
import { SegmentedControl } from './SegmentedControl';
|
|
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 sampleData = [
|
|
7
8
|
{ label: 'React', value: 'react' },
|
|
8
9
|
{ label: 'Angular', value: 'ng' },
|
|
@@ -157,7 +158,7 @@ export const Default = {
|
|
|
157
158
|
},
|
|
158
159
|
};
|
|
159
160
|
export const Sizes = {
|
|
160
|
-
render: () => (_jsxs(Stack, { gap:
|
|
161
|
+
render: () => (_jsxs(Stack, { gap: spacing.lg, children: [_jsx(SegmentedControl, { size: "sm", data: sampleData, value: "react", onChange: () => { } }), _jsx(SegmentedControl, { size: "md", data: sampleData, value: "ng", onChange: () => { } }), _jsx(SegmentedControl, { size: "lg", data: sampleData, value: "vue", onChange: () => { } })] })),
|
|
161
162
|
parameters: {
|
|
162
163
|
docs: {
|
|
163
164
|
source: {
|
|
@@ -177,7 +178,7 @@ export const StringData = {
|
|
|
177
178
|
},
|
|
178
179
|
};
|
|
179
180
|
export const States = {
|
|
180
|
-
render: () => (_jsxs(Stack, { gap:
|
|
181
|
+
render: () => (_jsxs(Stack, { gap: spacing.lg, style: { minWidth: '280px' }, children: [_jsx(SegmentedControl, { data: sampleData, value: "react", onChange: () => { } }), _jsx(SegmentedControl, { data: sampleData, value: "react", onChange: () => { }, disabled: true }), _jsx(SegmentedControl, { data: [
|
|
181
182
|
{ value: 'preview', label: 'Preview', disabled: true },
|
|
182
183
|
{ value: 'code', label: 'Code' },
|
|
183
184
|
{ value: 'export', label: 'Export' },
|
|
@@ -191,7 +192,7 @@ export const States = {
|
|
|
191
192
|
},
|
|
192
193
|
};
|
|
193
194
|
export const FullWidth = {
|
|
194
|
-
render: () => (_jsx("div", { style: { width: '
|
|
195
|
+
render: () => (_jsx("div", { style: { width: '360px', maxWidth: '100%' }, children: _jsx(SegmentedControl, { fullWidth: true, data: sampleData, value: "react", onChange: () => { } }) })),
|
|
195
196
|
parameters: {
|
|
196
197
|
docs: {
|
|
197
198
|
source: {
|
|
@@ -201,7 +202,7 @@ export const FullWidth = {
|
|
|
201
202
|
},
|
|
202
203
|
};
|
|
203
204
|
export const Orientation = {
|
|
204
|
-
render: () => (_jsxs(Group, { gap:
|
|
205
|
+
render: () => (_jsxs(Group, { gap: spacing.xxl, align: "flex-start", children: [_jsx(SegmentedControl, { data: sampleData, value: "ng", onChange: () => { }, orientation: "horizontal" }), _jsx(SegmentedControl, { data: sampleData, value: "vue", onChange: () => { }, orientation: "vertical" })] })),
|
|
205
206
|
parameters: {
|
|
206
207
|
docs: {
|
|
207
208
|
source: {
|
|
@@ -211,7 +212,7 @@ export const Orientation = {
|
|
|
211
212
|
},
|
|
212
213
|
};
|
|
213
214
|
export const CustomStyles = {
|
|
214
|
-
render: () => (_jsx(Group, { gap: "
|
|
215
|
+
render: () => (_jsx(Group, { gap: "20px", children: _jsx(SegmentedControl, { data: sampleData, value: "react", onChange: () => { }, styles: {
|
|
215
216
|
root: {
|
|
216
217
|
backgroundColor: '#f0f4f8',
|
|
217
218
|
},
|
|
@@ -3,8 +3,8 @@ declare const componentSizes: {
|
|
|
3
3
|
readonly sm: {
|
|
4
4
|
readonly fontSize: string;
|
|
5
5
|
readonly lineHeight: string;
|
|
6
|
-
readonly width:
|
|
7
|
-
readonly height:
|
|
6
|
+
readonly width: 24;
|
|
7
|
+
readonly height: 18;
|
|
8
8
|
readonly mantineSize: "md";
|
|
9
9
|
readonly thumbScale: 1.3;
|
|
10
10
|
readonly thumbTranslate: 2;
|
|
@@ -12,8 +12,8 @@ declare const componentSizes: {
|
|
|
12
12
|
readonly md: {
|
|
13
13
|
readonly fontSize: string;
|
|
14
14
|
readonly lineHeight: string;
|
|
15
|
-
readonly width:
|
|
16
|
-
readonly height:
|
|
15
|
+
readonly width: 48;
|
|
16
|
+
readonly height: 28;
|
|
17
17
|
readonly mantineSize: "xl";
|
|
18
18
|
readonly thumbScale: 1.3;
|
|
19
19
|
readonly thumbTranslate: 10;
|
|
@@ -4,8 +4,8 @@ import { neutral, primary } from '../../../../constants/colors';
|
|
|
4
4
|
import { fontBase, fontSize } from '../../../../constants/font';
|
|
5
5
|
// Size Presets
|
|
6
6
|
const componentSizes = {
|
|
7
|
-
sm: { width:
|
|
8
|
-
md: { width:
|
|
7
|
+
sm: { width: 24, height: 18, mantineSize: 'md', thumbScale: 1.3, thumbTranslate: 2, ...fontSize['sm'] },
|
|
8
|
+
md: { width: 48, height: 28, mantineSize: 'xl', thumbScale: 1.3, thumbTranslate: 10, ...fontSize['md'] },
|
|
9
9
|
};
|
|
10
10
|
const Toggle = ({ checked, onChange, styles, size = 'md', label, ...props }) => {
|
|
11
11
|
const selectedSize = componentSizes[size];
|
|
@@ -13,11 +13,11 @@ const Toggle = ({ checked, onChange, styles, size = 'md', label, ...props }) =>
|
|
|
13
13
|
container: {
|
|
14
14
|
display: 'flex',
|
|
15
15
|
alignItems: 'center',
|
|
16
|
-
gap: '
|
|
16
|
+
gap: '10px',
|
|
17
17
|
},
|
|
18
18
|
track: {
|
|
19
|
-
width: `${selectedSize.width}
|
|
20
|
-
height: `${selectedSize.height}
|
|
19
|
+
width: `${selectedSize.width}px`,
|
|
20
|
+
height: `${selectedSize.height}px`,
|
|
21
21
|
transition: 'background-color 300ms ease-in-out',
|
|
22
22
|
cursor: 'pointer',
|
|
23
23
|
backgroundColor: checked ? primary[200] : neutral[50],
|
|
@@ -114,7 +114,7 @@ export const Default = {
|
|
|
114
114
|
},
|
|
115
115
|
};
|
|
116
116
|
export const Sizes = {
|
|
117
|
-
render: () => (_jsxs(Group, { gap: "
|
|
117
|
+
render: () => (_jsxs(Group, { gap: "20px", children: [_jsx(Toggle, { size: "sm", label: "Small Toggle", checked: true }), _jsx(Toggle, { size: "md", label: "Medium Toggle (Default)", checked: false })] })),
|
|
118
118
|
parameters: {
|
|
119
119
|
docs: {
|
|
120
120
|
source: {
|
|
@@ -124,7 +124,7 @@ export const Sizes = {
|
|
|
124
124
|
},
|
|
125
125
|
};
|
|
126
126
|
export const States = {
|
|
127
|
-
render: () => (_jsxs(Group, { gap: "
|
|
127
|
+
render: () => (_jsxs(Group, { gap: "20px", children: [_jsx(Toggle, { label: "Normal Toggle", checked: true }), _jsx(Toggle, { label: "Disabled Toggle", checked: false, disabled: true }), _jsx(Toggle, { label: "Toggle with Description", description: "This is a description that provides additional context", checked: true }), _jsx(Toggle, { label: "Toggle with Error", error: "This field is required", checked: false })] })),
|
|
128
128
|
parameters: {
|
|
129
129
|
docs: {
|
|
130
130
|
source: {
|
|
@@ -134,7 +134,7 @@ export const States = {
|
|
|
134
134
|
},
|
|
135
135
|
};
|
|
136
136
|
export const WithoutLabel = {
|
|
137
|
-
render: () => (_jsxs(Group, { gap: "
|
|
137
|
+
render: () => (_jsxs(Group, { gap: "20px", children: [_jsx(Toggle, { checked: true }), _jsx(Toggle, { checked: false })] })),
|
|
138
138
|
parameters: {
|
|
139
139
|
docs: {
|
|
140
140
|
source: {
|
|
@@ -144,7 +144,7 @@ export const WithoutLabel = {
|
|
|
144
144
|
},
|
|
145
145
|
};
|
|
146
146
|
export const CustomStyles = {
|
|
147
|
-
render: () => (_jsxs(Group, { gap: "
|
|
147
|
+
render: () => (_jsxs(Group, { gap: "20px", children: [_jsx(Toggle, { label: "Custom Styled Toggle", checked: true, styles: {
|
|
148
148
|
track: {
|
|
149
149
|
backgroundColor: '#ff6b6b',
|
|
150
150
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../../../../src/components/Inputs/Dates/DatePicker/DatePicker.tsx"],"names":[],"mappings":"AACA,OAAO,EAA6C,oBAAoB,IAAI,2BAA2B,EAAE,MAAM,gBAAgB,CAAC;AAEhI,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../../../../src/components/Inputs/Dates/DatePicker/DatePicker.tsx"],"names":[],"mappings":"AACA,OAAO,EAA6C,oBAAoB,IAAI,2BAA2B,EAAE,MAAM,gBAAgB,CAAC;AAEhI,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,MAAM,WAAW,eAAe,CAAC,CAAC,SAAS,SAAS,GAAG,UAAU,GAAG,OAAO,GAAG,SAAS,CAAE,SAAQ,IAAI,CAAC,2BAA2B,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC;IAC7I,IAAI,CAAC,EAAE,MAAM,OAAO,cAAc,CAAC;IACnC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,UAAU,GAAI,CAAC,SAAS,SAAS,GAAG,UAAU,GAAG,OAAO,GAAG,SAAS,EAAE,qEAQhF,eAAe,CAAC,CAAC,CAAC,4CA+EpB,CAAC"}
|
|
@@ -3,15 +3,16 @@ import { DatePickerInput as MantineDatePickerInput } from '@mantine/dates';
|
|
|
3
3
|
import { createStyles } from '@mantine/core';
|
|
4
4
|
import { neutral } from '../../../../constants/colors';
|
|
5
5
|
import { fontBase } from '../../../../constants/font';
|
|
6
|
+
import { spacing } from '../../../../constants/spacing';
|
|
6
7
|
import { componentSizes } from '../../Dropdowns/shared/sizes';
|
|
7
8
|
export const DatePicker = ({ size = 'md', width, fullWidth = false, placeholder = 'Pick Date', showIcon = true, styles, ...props }) => {
|
|
8
9
|
const selectedSize = componentSizes[size];
|
|
9
10
|
const { classes } = createStyles(() => ({
|
|
10
11
|
root: {
|
|
11
|
-
width: fullWidth ? '100%' : width || (props.type === 'range' ? `${selectedSize.minWidth * 1.2}
|
|
12
|
+
width: fullWidth ? '100%' : width || (props.type === 'range' ? `${selectedSize.minWidth * 1.2}px` : `${selectedSize.minWidth}px`), // Range inputs are slightly wider than regular inputs
|
|
12
13
|
},
|
|
13
14
|
input: {
|
|
14
|
-
height: `${selectedSize.height}
|
|
15
|
+
height: `${selectedSize.height}px`,
|
|
15
16
|
paddingRight: selectedSize.inputPadding,
|
|
16
17
|
...fontBase,
|
|
17
18
|
fontSize: selectedSize.fontSize,
|
|
@@ -30,7 +31,7 @@ export const DatePicker = ({ size = 'md', width, fullWidth = false, placeholder
|
|
|
30
31
|
},
|
|
31
32
|
label: {
|
|
32
33
|
...fontBase,
|
|
33
|
-
fontSize: `calc(${selectedSize.fontSize} -
|
|
34
|
+
fontSize: `calc(${selectedSize.fontSize} - 1px)`,
|
|
34
35
|
color: neutral[200],
|
|
35
36
|
},
|
|
36
37
|
calendar: {
|
|
@@ -64,7 +65,7 @@ export const DatePicker = ({ size = 'md', width, fullWidth = false, placeholder
|
|
|
64
65
|
},
|
|
65
66
|
...styles,
|
|
66
67
|
}))();
|
|
67
|
-
return (_jsx(MantineDatePickerInput, { icon: showIcon ? _jsx("i", { className: "far fa-calendar", style: { fontSize: 14, marginLeft:
|
|
68
|
+
return (_jsx(MantineDatePickerInput, { icon: showIcon ? _jsx("i", { className: "far fa-calendar", style: { fontSize: 14, marginLeft: spacing.xxs } }) : undefined, radius: "lg", size: "xl", classNames: {
|
|
68
69
|
root: classes.root,
|
|
69
70
|
input: classes.input,
|
|
70
71
|
placeholder: classes.placeholder,
|
|
@@ -127,7 +127,7 @@ export const Default = {
|
|
|
127
127
|
},
|
|
128
128
|
};
|
|
129
129
|
export const Sizes = {
|
|
130
|
-
render: () => (_jsxs(Group, { gap: "
|
|
130
|
+
render: () => (_jsxs(Group, { gap: "20px", children: [_jsx(DatePicker, { size: "sm" }), _jsx(DatePicker, {}), _jsx(DatePicker, { size: "lg" })] })),
|
|
131
131
|
parameters: {
|
|
132
132
|
docs: {
|
|
133
133
|
source: {
|
|
@@ -137,7 +137,7 @@ export const Sizes = {
|
|
|
137
137
|
},
|
|
138
138
|
};
|
|
139
139
|
export const States = {
|
|
140
|
-
render: () => (_jsxs(Group, { gap: "
|
|
140
|
+
render: () => (_jsxs(Group, { gap: "20px", children: [_jsx(DatePicker, { label: "Normal DatePicker" }), _jsx(DatePicker, { label: "Disabled DatePicker", disabled: true }), _jsx(DatePicker, { label: "Required DatePicker", required: true }), _jsx(DatePicker, { label: "DatePicker with Description", description: "Please select your preferred date" }), _jsx(DatePicker, { label: "DatePicker with Error", error: "This field is required" })] })),
|
|
141
141
|
parameters: {
|
|
142
142
|
docs: {
|
|
143
143
|
source: {
|
|
@@ -147,7 +147,7 @@ export const States = {
|
|
|
147
147
|
},
|
|
148
148
|
};
|
|
149
149
|
export const WithAndWithoutIcon = {
|
|
150
|
-
render: () => (_jsxs(Group, { gap: "
|
|
150
|
+
render: () => (_jsxs(Group, { gap: "20px", children: [_jsx(DatePicker, { label: "With Icon", placeholder: "Select date", showIcon: true }), _jsx(DatePicker, { label: "Without Icon", placeholder: "Select date", showIcon: false })] })),
|
|
151
151
|
parameters: {
|
|
152
152
|
docs: {
|
|
153
153
|
source: {
|
|
@@ -167,7 +167,7 @@ export const FullWidth = {
|
|
|
167
167
|
},
|
|
168
168
|
};
|
|
169
169
|
export const CustomStyles = {
|
|
170
|
-
render: () => (_jsxs(Group, { gap: "
|
|
170
|
+
render: () => (_jsxs(Group, { gap: "20px", children: [_jsx(DatePicker, { label: "Custom Styled DatePicker", placeholder: "Select date", styles: {
|
|
171
171
|
input: {
|
|
172
172
|
borderColor: '#ff6b6b',
|
|
173
173
|
'&:focus': {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CascadingSelect.d.ts","sourceRoot":"","sources":["../../../../../src/components/Inputs/Dropdowns/CascadingSelect/CascadingSelect.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,EAAU,WAAW,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"CascadingSelect.d.ts","sourceRoot":"","sources":["../../../../../src/components/Inputs/Dropdowns/CascadingSelect/CascadingSelect.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,EAAU,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAIvD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,MAAM,MAAM,wBAAwB,GAAG;IACrC,MAAM,EAAE,YAAY,CAAC;IACrB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,QAAQ,CAAC,EAAE,wBAAwB,EAAE,CAAC;CACvC,CAAC;AAEF,MAAM,WAAW,oBAAqB,SAAQ,IAAI,CAAC,WAAW,EAAE,OAAO,GAAG,MAAM,CAAC;IAC/E,IAAI,CAAC,EAAE,wBAAwB,EAAE,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,QAAA,MAAM,eAAe,GAAI,wEAAiH,oBAAoB,4CA+E7J,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -5,9 +5,10 @@ import { componentSizes } from '../shared/sizes';
|
|
|
5
5
|
import { Select } from '../Select/Select';
|
|
6
6
|
import { Text } from '../../../Typography/Text/Text';
|
|
7
7
|
import { fontBase } from '../../../../constants/font';
|
|
8
|
+
import { spacing } from '../../../../constants/spacing';
|
|
8
9
|
const CascadingSelect = ({ data = [], value, placeholder = 'Select an option', size = 'md', width, fullWidth = false, styles, ...props }) => {
|
|
9
10
|
const selectedSize = componentSizes[size];
|
|
10
|
-
const computedWidth = fullWidth ? '100%' : width || `${selectedSize.minWidth}
|
|
11
|
+
const computedWidth = fullWidth ? '100%' : width || `${selectedSize.minWidth}px`;
|
|
11
12
|
// Flatten the hierarchy into a flat array with depth information
|
|
12
13
|
const flattenHierarchy = (items, depth = 0) => {
|
|
13
14
|
const result = [];
|
|
@@ -21,7 +22,7 @@ const CascadingSelect = ({ data = [], value, placeholder = 'Select an option', s
|
|
|
21
22
|
};
|
|
22
23
|
const flattenedData = flattenHierarchy(data);
|
|
23
24
|
const DropdownItem = ({ value, label, icon, depth, ...others }) => {
|
|
24
|
-
const indentLevel = depth *
|
|
25
|
+
const indentLevel = depth * 8;
|
|
25
26
|
return (_jsx(Box, { sx: {
|
|
26
27
|
display: 'flex',
|
|
27
28
|
alignItems: 'center',
|
|
@@ -29,7 +30,7 @@ const CascadingSelect = ({ data = [], value, placeholder = 'Select an option', s
|
|
|
29
30
|
borderRadius: '8px',
|
|
30
31
|
transition: 'background-color 200ms ease-in-out',
|
|
31
32
|
cursor: 'pointer',
|
|
32
|
-
}, ...others, children: _jsxs(Group, { spacing:
|
|
33
|
+
}, ...others, children: _jsxs(Group, { spacing: spacing.xs, sx: { marginLeft: `${indentLevel}px` }, children: [icon && _jsx(Box, { sx: { display: 'flex', alignItems: 'center', color: neutral[200], fontSize: selectedSize.fontSize }, children: icon }), _jsx(Text, { style: { ...fontBase, color: neutral[200], fontSize: selectedSize.fontSize }, children: label })] }) }));
|
|
33
34
|
};
|
|
34
35
|
const style = {
|
|
35
36
|
input: {
|
|
@@ -37,7 +38,7 @@ const CascadingSelect = ({ data = [], value, placeholder = 'Select an option', s
|
|
|
37
38
|
border: `1px solid ${neutral[100]}`,
|
|
38
39
|
borderRadius: '8px',
|
|
39
40
|
transition: 'all 200ms ease-in-out',
|
|
40
|
-
height: `${selectedSize.height}
|
|
41
|
+
height: `${selectedSize.height}px`,
|
|
41
42
|
...fontBase,
|
|
42
43
|
fontSize: selectedSize.fontSize,
|
|
43
44
|
padding: selectedSize.inputPadding,
|
|
@@ -48,7 +49,7 @@ const CascadingSelect = ({ data = [], value, placeholder = 'Select an option', s
|
|
|
48
49
|
transition: 'background-color 200ms ease-in-out',
|
|
49
50
|
padding: 0,
|
|
50
51
|
fontSize: selectedSize.fontSize,
|
|
51
|
-
marginBottom:
|
|
52
|
+
marginBottom: spacing.xxs,
|
|
52
53
|
'&[data-selected]': {
|
|
53
54
|
backgroundColor: neutral[50],
|
|
54
55
|
color: neutral[200],
|
|
@@ -228,7 +228,7 @@ export const Default = {
|
|
|
228
228
|
},
|
|
229
229
|
};
|
|
230
230
|
export const Sizes = {
|
|
231
|
-
render: () => (_jsxs(Group, { gap: "
|
|
231
|
+
render: () => (_jsxs(Group, { gap: "20px", children: [_jsx(CascadingSelect, { size: "sm", data: simpleHierarchyData, placeholder: "Small Cascading Select" }), _jsx(CascadingSelect, { size: "md", data: simpleHierarchyData, placeholder: "Medium Cascading Select (Default)" }), _jsx(CascadingSelect, { size: "lg", data: simpleHierarchyData, placeholder: "Large Cascading Select" })] })),
|
|
232
232
|
parameters: {
|
|
233
233
|
docs: {
|
|
234
234
|
source: {
|
|
@@ -238,7 +238,7 @@ export const Sizes = {
|
|
|
238
238
|
},
|
|
239
239
|
};
|
|
240
240
|
export const WithIcons = {
|
|
241
|
-
render: () => (_jsxs(Group, { gap: "
|
|
241
|
+
render: () => (_jsxs(Group, { gap: "20px", children: [_jsx(CascadingSelect, { label: "Categories with Icons", data: categoryData, placeholder: "Select with icons" }), _jsx(CascadingSelect, { label: "Simple Hierarchy", data: simpleHierarchyData, placeholder: "Select without icons" })] })),
|
|
242
242
|
parameters: {
|
|
243
243
|
docs: {
|
|
244
244
|
source: {
|
|
@@ -248,7 +248,7 @@ export const WithIcons = {
|
|
|
248
248
|
},
|
|
249
249
|
};
|
|
250
250
|
export const States = {
|
|
251
|
-
render: () => (_jsxs(Group, { gap: "
|
|
251
|
+
render: () => (_jsxs(Group, { gap: "20px", children: [_jsx(CascadingSelect, { label: "Normal Cascading Select", data: simpleHierarchyData, placeholder: "Select option" }), _jsx(CascadingSelect, { label: "Disabled Cascading Select", data: simpleHierarchyData, placeholder: "Select option", disabled: true }), _jsx(CascadingSelect, { label: "Required Cascading Select", data: simpleHierarchyData, placeholder: "Select option", required: true }), _jsx(CascadingSelect, { label: "Cascading Select with Description", description: "Please choose an option from the hierarchy", data: simpleHierarchyData, placeholder: "Select option" }), _jsx(CascadingSelect, { label: "Cascading Select with Error", error: "This field is required", data: simpleHierarchyData, placeholder: "Select option" })] })),
|
|
252
252
|
parameters: {
|
|
253
253
|
docs: {
|
|
254
254
|
source: {
|
|
@@ -258,7 +258,7 @@ export const States = {
|
|
|
258
258
|
},
|
|
259
259
|
};
|
|
260
260
|
export const WithFeatures = {
|
|
261
|
-
render: () => (_jsxs(Group, { gap: "
|
|
261
|
+
render: () => (_jsxs(Group, { gap: "20px", children: [_jsx(CascadingSelect, { label: "Clearable Cascading Select", data: simpleHierarchyData, placeholder: "Select option", clearable: true, value: "level2a" }), _jsx(CascadingSelect, { label: "Searchable Cascading Select", data: categoryData, placeholder: "Search categories", searchable: true })] })),
|
|
262
262
|
parameters: {
|
|
263
263
|
docs: {
|
|
264
264
|
source: {
|
|
@@ -326,7 +326,7 @@ export const DeepHierarchy = {
|
|
|
326
326
|
},
|
|
327
327
|
};
|
|
328
328
|
export const CustomStyles = {
|
|
329
|
-
render: () => (_jsxs(Group, { gap: "
|
|
329
|
+
render: () => (_jsxs(Group, { gap: "20px", children: [_jsx(CascadingSelect, { label: "Custom Styled Cascading Select", data: simpleHierarchyData, placeholder: "Select option", styles: {
|
|
330
330
|
input: {
|
|
331
331
|
borderColor: '#ff6b6b',
|
|
332
332
|
'&:focus': {
|
|
@@ -6,13 +6,13 @@ import { Select } from '../Select/Select';
|
|
|
6
6
|
import Fonts from './font-options';
|
|
7
7
|
const FontSelect = ({ data, value, placeholder = 'Select a font', size = 'md', width, fullWidth = false, styles, ...props }) => {
|
|
8
8
|
const selectedSize = componentSizes[size];
|
|
9
|
-
const computedWidth = fullWidth ? '100%' : width || `${selectedSize.minWidth}
|
|
9
|
+
const computedWidth = fullWidth ? '100%' : width || `${selectedSize.minWidth}px`;
|
|
10
10
|
const DropdownItem = ({ value, label, ...others }) => (_jsx(Box, { title: label, children: _jsx("div", { style: {
|
|
11
11
|
fontFamily: value,
|
|
12
12
|
fontSize: selectedSize.fontSize,
|
|
13
13
|
color: neutral[200],
|
|
14
14
|
padding: selectedSize.dropdownPadding,
|
|
15
|
-
borderRadius: '
|
|
15
|
+
borderRadius: '5px',
|
|
16
16
|
transition: 'background-color 200ms ease-in-out',
|
|
17
17
|
}, ...others, children: label }) }));
|
|
18
18
|
const style = {
|
|
@@ -22,7 +22,7 @@ const FontSelect = ({ data, value, placeholder = 'Select a font', size = 'md', w
|
|
|
22
22
|
border: `1px solid ${neutral[100]}`,
|
|
23
23
|
borderRadius: '8px',
|
|
24
24
|
transition: 'all 200ms ease-in-out',
|
|
25
|
-
height: `${selectedSize.height}
|
|
25
|
+
height: `${selectedSize.height}px`,
|
|
26
26
|
fontSize: selectedSize.fontSize,
|
|
27
27
|
padding: selectedSize.inputPadding,
|
|
28
28
|
},
|
|
@@ -134,7 +134,7 @@ export const Default = {
|
|
|
134
134
|
},
|
|
135
135
|
};
|
|
136
136
|
export const Variants = {
|
|
137
|
-
render: () => (_jsxs(Group, { gap: "
|
|
137
|
+
render: () => (_jsxs(Group, { gap: "20px", children: [_jsx(FontSelect, { label: "Default Font Select" }), _jsx(FontSelect, { label: "With Custom Data", data: [
|
|
138
138
|
{ value: 'Arial', label: 'Arial' },
|
|
139
139
|
{ value: 'Helvetica', label: 'Helvetica' },
|
|
140
140
|
{ value: 'Times New Roman', label: 'Times New Roman' },
|
|
@@ -149,7 +149,7 @@ export const Variants = {
|
|
|
149
149
|
},
|
|
150
150
|
};
|
|
151
151
|
export const Sizes = {
|
|
152
|
-
render: () => (_jsxs(Group, { gap: "
|
|
152
|
+
render: () => (_jsxs(Group, { gap: "20px", children: [_jsx(FontSelect, { size: "sm" }), _jsx(FontSelect, { size: "md" }), _jsx(FontSelect, { size: "lg" })] })),
|
|
153
153
|
parameters: {
|
|
154
154
|
docs: {
|
|
155
155
|
source: {
|
|
@@ -159,7 +159,7 @@ export const Sizes = {
|
|
|
159
159
|
},
|
|
160
160
|
};
|
|
161
161
|
export const States = {
|
|
162
|
-
render: () => (_jsxs(Group, { gap: "
|
|
162
|
+
render: () => (_jsxs(Group, { gap: "20px", children: [_jsx(FontSelect, { label: "Normal Font Select" }), _jsx(FontSelect, { label: "Disabled Font Select", disabled: true }), _jsx(FontSelect, { label: "Required Font Select", required: true }), _jsx(FontSelect, { label: "Font Select with Description", description: "Choose your preferred font" }), _jsx(FontSelect, { label: "Font Select with Error", error: "Please select a font" })] })),
|
|
163
163
|
parameters: {
|
|
164
164
|
docs: {
|
|
165
165
|
source: {
|
|
@@ -169,7 +169,7 @@ export const States = {
|
|
|
169
169
|
},
|
|
170
170
|
};
|
|
171
171
|
export const AdditionalFunctionality = {
|
|
172
|
-
render: () => (_jsxs(Group, { gap: "
|
|
172
|
+
render: () => (_jsxs(Group, { gap: "20px", children: [_jsx(FontSelect, { label: "Clearable Font Select", clearable: true, value: "Poppins" }), _jsx(FontSelect, { label: "Searchable Font Select", searchable: true })] })),
|
|
173
173
|
parameters: {
|
|
174
174
|
docs: {
|
|
175
175
|
source: {
|
|
@@ -179,7 +179,7 @@ export const AdditionalFunctionality = {
|
|
|
179
179
|
},
|
|
180
180
|
};
|
|
181
181
|
export const CustomStyling = {
|
|
182
|
-
render: () => (_jsxs(Group, { gap: "
|
|
182
|
+
render: () => (_jsxs(Group, { gap: "20px", children: [_jsx(FontSelect, { label: "Custom Styled Font Select", styles: {
|
|
183
183
|
input: {
|
|
184
184
|
borderColor: '#ff6b6b',
|
|
185
185
|
'&:focus': {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiSelect.d.ts","sourceRoot":"","sources":["../../../../../src/components/Inputs/Dropdowns/MultiSelect/MultiSelect.tsx"],"names":[],"mappings":"AACA,OAAO,EAAqC,gBAAgB,IAAI,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAC/G,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"MultiSelect.d.ts","sourceRoot":"","sources":["../../../../../src/components/Inputs/Dropdowns/MultiSelect/MultiSelect.tsx"],"names":[],"mappings":"AACA,OAAO,EAAqC,gBAAgB,IAAI,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAC/G,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,UAAU,gBAAiB,SAAQ,uBAAuB;IACxD,IAAI,CAAC,EAAE,MAAM,OAAO,cAAc,CAAC;IACnC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;CACpC;AAED,eAAO,MAAM,WAAW,GAAI,2DAA6F,gBAAgB,4CA0FxI,CAAC"}
|
|
@@ -2,14 +2,15 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { MultiSelect as MantineMultiSelect } from '@mantine/core';
|
|
3
3
|
import { neutral, primary } from '../../../../constants/colors';
|
|
4
4
|
import { fontBase } from '../../../../constants/font';
|
|
5
|
+
import { spacing } from '../../../../constants/spacing';
|
|
5
6
|
import { componentSizes } from '../shared/sizes';
|
|
6
7
|
export const MultiSelect = ({ size = 'md', width, fullWidth = false, placeholder = 'Select options', styles, ...props }) => {
|
|
7
8
|
const selectedSize = componentSizes[size];
|
|
8
|
-
const computedWidth = fullWidth ? '100%' : width || `${selectedSize.maxWidth}
|
|
9
|
+
const computedWidth = fullWidth ? '100%' : width || `${selectedSize.maxWidth}px`;
|
|
9
10
|
const style = {
|
|
10
11
|
input: {
|
|
11
12
|
height: 'auto',
|
|
12
|
-
minHeight: `${selectedSize.height}
|
|
13
|
+
minHeight: `${selectedSize.height}px`,
|
|
13
14
|
padding: selectedSize.inputPadding,
|
|
14
15
|
display: 'flex',
|
|
15
16
|
alignItems: 'center',
|
|
@@ -32,7 +33,7 @@ export const MultiSelect = ({ size = 'md', width, fullWidth = false, placeholder
|
|
|
32
33
|
},
|
|
33
34
|
item: {
|
|
34
35
|
padding: selectedSize.dropdownPadding,
|
|
35
|
-
marginBottom:
|
|
36
|
+
marginBottom: spacing.xs,
|
|
36
37
|
borderRadius: '8px',
|
|
37
38
|
...fontBase,
|
|
38
39
|
fontSize: selectedSize.fontSize,
|
|
@@ -56,7 +57,7 @@ export const MultiSelect = ({ size = 'md', width, fullWidth = false, placeholder
|
|
|
56
57
|
padding: selectedSize.valuePadding,
|
|
57
58
|
borderRadius: '25px',
|
|
58
59
|
...fontBase,
|
|
59
|
-
fontSize: `calc(${selectedSize.fontSize} -
|
|
60
|
+
fontSize: `calc(${selectedSize.fontSize} - 1.25px)`,
|
|
60
61
|
color: primary[300],
|
|
61
62
|
backgroundColor: primary[50],
|
|
62
63
|
'&:hover': {
|
|
@@ -64,7 +65,7 @@ export const MultiSelect = ({ size = 'md', width, fullWidth = false, placeholder
|
|
|
64
65
|
},
|
|
65
66
|
},
|
|
66
67
|
defaultValueRemove: {
|
|
67
|
-
marginLeft:
|
|
68
|
+
marginLeft: spacing.sm,
|
|
68
69
|
borderRadius: '50%',
|
|
69
70
|
display: 'flex',
|
|
70
71
|
alignItems: 'center',
|
|
@@ -77,7 +78,7 @@ export const MultiSelect = ({ size = 'md', width, fullWidth = false, placeholder
|
|
|
77
78
|
},
|
|
78
79
|
label: {
|
|
79
80
|
...fontBase,
|
|
80
|
-
fontSize: `calc(${selectedSize.fontSize} -
|
|
81
|
+
fontSize: `calc(${selectedSize.fontSize} - 1px)`,
|
|
81
82
|
color: neutral[200],
|
|
82
83
|
},
|
|
83
84
|
defaultValueLabel: {
|
|
@@ -167,7 +167,7 @@ export const Default = {
|
|
|
167
167
|
},
|
|
168
168
|
};
|
|
169
169
|
export const Variants = {
|
|
170
|
-
render: () => (_jsxs(Group, { gap: "
|
|
170
|
+
render: () => (_jsxs(Group, { gap: "20px", children: [_jsx(MultiSelect, { label: "Basic Multi Select", data: basicOptions }), _jsx(MultiSelect, { label: "Tag Selection", data: tagOptions, placeholder: "Select technologies" })] })),
|
|
171
171
|
parameters: {
|
|
172
172
|
docs: {
|
|
173
173
|
source: {
|
|
@@ -177,7 +177,7 @@ export const Variants = {
|
|
|
177
177
|
},
|
|
178
178
|
};
|
|
179
179
|
export const Sizes = {
|
|
180
|
-
render: () => (_jsxs(Group, { gap: "
|
|
180
|
+
render: () => (_jsxs(Group, { gap: "20px", children: [_jsx(MultiSelect, { size: "sm", label: "Small MultiSelect", data: basicOptions }), _jsx(MultiSelect, { size: "md", label: "Medium MultiSelect (Default)", data: basicOptions }), _jsx(MultiSelect, { size: "lg", label: "Large MultiSelect", data: basicOptions })] })),
|
|
181
181
|
parameters: {
|
|
182
182
|
docs: {
|
|
183
183
|
source: {
|
|
@@ -188,7 +188,7 @@ export const Sizes = {
|
|
|
188
188
|
},
|
|
189
189
|
};
|
|
190
190
|
export const States = {
|
|
191
|
-
render: () => (_jsxs(Group, { gap: "
|
|
191
|
+
render: () => (_jsxs(Group, { gap: "20px", children: [_jsx(MultiSelect, { label: "Normal Multi Select", data: basicOptions }), _jsx(MultiSelect, { label: "Disabled Multi Select", data: basicOptions, disabled: true }), _jsx(MultiSelect, { label: "Required Multi Select", data: basicOptions, required: true }), _jsx(MultiSelect, { label: "Multi Select with Description", description: "Select multiple options", data: basicOptions }), _jsx(MultiSelect, { label: "Multi Select with Error", error: "Please select at least one option", data: basicOptions })] })),
|
|
192
192
|
parameters: {
|
|
193
193
|
docs: {
|
|
194
194
|
source: {
|
|
@@ -198,7 +198,7 @@ export const States = {
|
|
|
198
198
|
},
|
|
199
199
|
};
|
|
200
200
|
export const AdditionalFunctionality = {
|
|
201
|
-
render: () => (_jsxs(Group, { gap: "
|
|
201
|
+
render: () => (_jsxs(Group, { gap: "20px", children: [_jsx(MultiSelect, { label: "Tags", placeholder: "Add or select tags", creatable: true, clearable: true, data: tagOptions }), _jsx(MultiSelect, { label: "Limited Selection", data: basicOptions, maxSelectedValues: 3, placeholder: "Max 3 selections" })] })),
|
|
202
202
|
parameters: {
|
|
203
203
|
docs: {
|
|
204
204
|
source: {
|
|
@@ -216,7 +216,7 @@ export const AdditionalFunctionality = {
|
|
|
216
216
|
},
|
|
217
217
|
};
|
|
218
218
|
export const CustomStyling = {
|
|
219
|
-
render: () => (_jsxs(Group, { gap: "
|
|
219
|
+
render: () => (_jsxs(Group, { gap: "20px", children: [_jsx(MultiSelect, { label: "Custom Styled Multi Select", data: basicOptions, styles: {
|
|
220
220
|
input: {
|
|
221
221
|
borderColor: '#ff6b6b',
|
|
222
222
|
'&:focus': {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../../../src/components/Inputs/Dropdowns/Select/Select.tsx"],"names":[],"mappings":"AACA,OAAO,EAA2B,WAAW,IAAI,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAC3F,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../../../src/components/Inputs/Dropdowns/Select/Select.tsx"],"names":[],"mappings":"AACA,OAAO,EAA2B,WAAW,IAAI,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAC3F,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,MAAM,WAAW,WAAY,SAAQ,kBAAkB;IACrD,IAAI,CAAC,EAAE,MAAM,OAAO,cAAc,CAAC;IACnC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;CACpC;AAED,eAAO,MAAM,MAAM,GAAI,2DAA+F,WAAW,4CAqEhI,CAAC"}
|
|
@@ -2,15 +2,16 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { Select as MantineSelect } from '@mantine/core';
|
|
3
3
|
import { neutral, red } from '../../../../constants/colors';
|
|
4
4
|
import { fontBase } from '../../../../constants/font';
|
|
5
|
+
import { spacing } from '../../../../constants/spacing';
|
|
5
6
|
import { componentSizes } from '../shared/sizes';
|
|
6
7
|
export const Select = ({ size = 'md', width, fullWidth = false, placeholder = 'Select an option', styles, ...props }) => {
|
|
7
8
|
const selectedSize = componentSizes[size];
|
|
8
9
|
const style = {
|
|
9
10
|
root: {
|
|
10
|
-
width: fullWidth ? '100%' : width || `${selectedSize.minWidth}
|
|
11
|
+
width: fullWidth ? '100%' : width || `${selectedSize.minWidth}px`,
|
|
11
12
|
},
|
|
12
13
|
input: {
|
|
13
|
-
height: `${selectedSize.height}
|
|
14
|
+
height: `${selectedSize.height}px`,
|
|
14
15
|
paddingRight: selectedSize.inputPadding,
|
|
15
16
|
...fontBase,
|
|
16
17
|
fontSize: selectedSize.fontSize,
|
|
@@ -29,7 +30,7 @@ export const Select = ({ size = 'md', width, fullWidth = false, placeholder = 'S
|
|
|
29
30
|
},
|
|
30
31
|
label: {
|
|
31
32
|
...fontBase,
|
|
32
|
-
fontSize: `calc(${selectedSize.fontSize} -
|
|
33
|
+
fontSize: `calc(${selectedSize.fontSize} - 1px)`,
|
|
33
34
|
color: neutral[200],
|
|
34
35
|
},
|
|
35
36
|
dropdown: {
|
|
@@ -39,7 +40,7 @@ export const Select = ({ size = 'md', width, fullWidth = false, placeholder = 'S
|
|
|
39
40
|
},
|
|
40
41
|
item: {
|
|
41
42
|
padding: selectedSize.dropdownPadding,
|
|
42
|
-
marginBottom:
|
|
43
|
+
marginBottom: spacing.xxs,
|
|
43
44
|
...fontBase,
|
|
44
45
|
fontSize: selectedSize.fontSize,
|
|
45
46
|
color: neutral[200],
|
|
@@ -64,7 +65,7 @@ export const Select = ({ size = 'md', width, fullWidth = false, placeholder = 'S
|
|
|
64
65
|
},
|
|
65
66
|
error: {
|
|
66
67
|
...fontBase,
|
|
67
|
-
fontSize: `calc(${selectedSize.fontSize} - 0.
|
|
68
|
+
fontSize: `calc(${selectedSize.fontSize} - 0.5px)`,
|
|
68
69
|
color: red[200]
|
|
69
70
|
},
|
|
70
71
|
...styles,
|
|
@@ -158,7 +158,7 @@ export const Default = {
|
|
|
158
158
|
},
|
|
159
159
|
};
|
|
160
160
|
export const Sizes = {
|
|
161
|
-
render: () => (_jsxs(Group, { gap: "
|
|
161
|
+
render: () => (_jsxs(Group, { gap: "20px", children: [_jsx(Select, { size: "sm", label: "Small Select", data: basicOptions }), _jsx(Select, { size: "md", label: "Medium Select (Default)", data: basicOptions }), _jsx(Select, { size: "lg", label: "Large Select", data: basicOptions })] })),
|
|
162
162
|
parameters: {
|
|
163
163
|
docs: {
|
|
164
164
|
source: {
|
|
@@ -169,7 +169,7 @@ export const Sizes = {
|
|
|
169
169
|
},
|
|
170
170
|
};
|
|
171
171
|
export const States = {
|
|
172
|
-
render: () => (_jsxs(Group, { gap: "
|
|
172
|
+
render: () => (_jsxs(Group, { gap: "20px", children: [_jsx(Select, { label: "Normal Select", data: basicOptions, placeholder: "Select option" }), _jsx(Select, { label: "Disabled Select", data: basicOptions, placeholder: "Select option", disabled: true }), _jsx(Select, { label: "Required Select", data: basicOptions, placeholder: "Select option", required: true }), _jsx(Select, { label: "Select with Description", description: "Please choose an option", data: basicOptions, placeholder: "Select option" }), _jsx(Select, { label: "Select with Error", error: "This field is required", data: basicOptions, placeholder: "Select option" })] })),
|
|
173
173
|
parameters: {
|
|
174
174
|
docs: {
|
|
175
175
|
source: {
|
|
@@ -179,7 +179,7 @@ export const States = {
|
|
|
179
179
|
},
|
|
180
180
|
};
|
|
181
181
|
export const WithFeatures = {
|
|
182
|
-
render: () => (_jsxs(Group, { gap: "
|
|
182
|
+
render: () => (_jsxs(Group, { gap: "20px", children: [_jsx(Select, { label: "Searchable Select", placeholder: "Type to search...", searchable: true, data: countryOptions }), _jsx(Select, { label: "Clearable Select", data: basicOptions, clearable: true, value: "option1" })] })),
|
|
183
183
|
parameters: {
|
|
184
184
|
docs: {
|
|
185
185
|
source: {
|
|
@@ -206,7 +206,7 @@ export const FullWidth = {
|
|
|
206
206
|
},
|
|
207
207
|
};
|
|
208
208
|
export const CustomStyles = {
|
|
209
|
-
render: () => (_jsxs(Group, { gap: "
|
|
209
|
+
render: () => (_jsxs(Group, { gap: "20px", children: [_jsx(Select, { label: "Custom Styled Select", data: basicOptions, placeholder: "Select option", styles: {
|
|
210
210
|
input: {
|
|
211
211
|
borderColor: '#ff6b6b',
|
|
212
212
|
'&:focus': {
|