@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
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
import { inputFontSize } from '../../../../constants/font';
|
|
2
2
|
export const componentSizes = {
|
|
3
3
|
sm: {
|
|
4
|
-
height:
|
|
4
|
+
height: 32,
|
|
5
5
|
...inputFontSize['sm'],
|
|
6
|
-
inputPadding: '
|
|
7
|
-
dropdownPadding: '
|
|
8
|
-
valuePadding: '
|
|
9
|
-
minWidth:
|
|
10
|
-
maxWidth:
|
|
6
|
+
inputPadding: '2.5px 20px 2.5px 10px',
|
|
7
|
+
dropdownPadding: '5px 10px',
|
|
8
|
+
valuePadding: '10px 8px 10px 10px',
|
|
9
|
+
minWidth: 180,
|
|
10
|
+
maxWidth: 250,
|
|
11
11
|
dropdownHeight: 260,
|
|
12
12
|
},
|
|
13
13
|
md: {
|
|
14
|
-
height:
|
|
14
|
+
height: 38,
|
|
15
15
|
...inputFontSize['md'],
|
|
16
|
-
inputPadding: '
|
|
17
|
-
dropdownPadding: '
|
|
18
|
-
valuePadding: '
|
|
19
|
-
minWidth:
|
|
20
|
-
maxWidth:
|
|
16
|
+
inputPadding: '5px 22.5px 5px 10px',
|
|
17
|
+
dropdownPadding: '7.5px 11.25px',
|
|
18
|
+
valuePadding: '12.5px 10px 12.5px 12.5px',
|
|
19
|
+
minWidth: 220,
|
|
20
|
+
maxWidth: 328,
|
|
21
21
|
dropdownHeight: 330,
|
|
22
22
|
},
|
|
23
23
|
lg: {
|
|
24
|
-
height:
|
|
24
|
+
height: 48,
|
|
25
25
|
...inputFontSize['lg'],
|
|
26
|
-
inputPadding: '
|
|
27
|
-
dropdownPadding: '
|
|
28
|
-
valuePadding: '
|
|
29
|
-
minWidth:
|
|
30
|
-
maxWidth:
|
|
26
|
+
inputPadding: '7.5px 25px 7.5px 10px',
|
|
27
|
+
dropdownPadding: '10px 15px',
|
|
28
|
+
valuePadding: '12.5px 10px 12.5px 12.5px',
|
|
29
|
+
minWidth: 300,
|
|
30
|
+
maxWidth: 420,
|
|
31
31
|
dropdownHeight: 385,
|
|
32
32
|
},
|
|
33
33
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Slider.d.ts","sourceRoot":"","sources":["../../../../../src/components/Inputs/Sliders/Slider/Slider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAA2B,WAAW,IAAI,kBAAkB,EAAa,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"Slider.d.ts","sourceRoot":"","sources":["../../../../../src/components/Inputs/Sliders/Slider/Slider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAA2B,WAAW,IAAI,kBAAkB,EAAa,MAAM,eAAe,CAAC;AAKtG,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,MAAM,WAAW,WAAY,SAAQ,kBAAkB;IACrD,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,OAAO,cAAc,CAAC;IACnC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;CACxC;AAED,QAAA,MAAM,MAAM,GAAI,kGAAyI,WAAW,4CA8FnK,CAAC;AAEF,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -3,17 +3,18 @@ import { Slider as MantineSlider } from '@mantine/core';
|
|
|
3
3
|
import { useHover } from '@mantine/hooks';
|
|
4
4
|
import { neutral, primary } from '../../../../constants/colors';
|
|
5
5
|
import { fontBase, textStyle } from '../../../../constants/font';
|
|
6
|
+
import { spacing } from '../../../../constants/spacing';
|
|
6
7
|
import { componentSizes } from '../shared/sizes';
|
|
7
8
|
const Slider = ({ width, size = 'md', value, setValue, disabled = false, styles, animate = false, label, fullWidth = false, compact = false, ...props }) => {
|
|
8
9
|
const { hovered, ref } = useHover();
|
|
9
10
|
const sliderColor = disabled ? neutral[100] : primary[200];
|
|
10
11
|
const selectedSize = componentSizes[size];
|
|
11
|
-
const computedWidth = fullWidth ? '100%' : width || `${selectedSize.width}
|
|
12
|
+
const computedWidth = fullWidth ? '100%' : width || `${selectedSize.width}px`;
|
|
12
13
|
const wrapperStyle = {
|
|
13
14
|
container: {
|
|
14
15
|
width: fullWidth ? '100%' : 'auto',
|
|
15
16
|
display: 'flex',
|
|
16
|
-
gap: '
|
|
17
|
+
gap: '10px',
|
|
17
18
|
alignItems: 'center',
|
|
18
19
|
},
|
|
19
20
|
label: {
|
|
@@ -30,23 +31,23 @@ const Slider = ({ width, size = 'md', value, setValue, disabled = false, styles,
|
|
|
30
31
|
whiteSpace: 'nowrap',
|
|
31
32
|
flexShrink: 0,
|
|
32
33
|
textAlign: 'right',
|
|
33
|
-
minWidth: '
|
|
34
|
+
minWidth: '20px',
|
|
34
35
|
},
|
|
35
36
|
sliderContainer: {
|
|
36
37
|
display: 'flex',
|
|
37
38
|
alignItems: 'center',
|
|
38
|
-
gap: '
|
|
39
|
+
gap: '10px',
|
|
39
40
|
flex: fullWidth ? 1 : 'none',
|
|
40
41
|
},
|
|
41
42
|
};
|
|
42
43
|
const sliderStyle = {
|
|
43
44
|
root: {
|
|
44
45
|
flex: 1,
|
|
45
|
-
minWidth: '
|
|
46
|
+
minWidth: '100px',
|
|
46
47
|
},
|
|
47
48
|
thumb: {
|
|
48
|
-
width: `${selectedSize.thumbSize}
|
|
49
|
-
height: `${selectedSize.thumbSize}
|
|
49
|
+
width: `${selectedSize.thumbSize}px`,
|
|
50
|
+
height: `${selectedSize.thumbSize}px`,
|
|
50
51
|
backgroundColor: sliderColor,
|
|
51
52
|
borderColor: sliderColor,
|
|
52
53
|
boxShadow: '0 2px 2px rgba(0,0,0,0.2)',
|
|
@@ -57,22 +58,22 @@ const Slider = ({ width, size = 'md', value, setValue, disabled = false, styles,
|
|
|
57
58
|
cursor: disabled ? 'default' : 'pointer',
|
|
58
59
|
},
|
|
59
60
|
track: {
|
|
60
|
-
height: `${selectedSize.trackHeight}
|
|
61
|
+
height: `${selectedSize.trackHeight}px`,
|
|
61
62
|
backgroundColor: sliderColor,
|
|
62
63
|
},
|
|
63
64
|
bar: {
|
|
64
|
-
height: `${selectedSize.trackHeight}
|
|
65
|
+
height: `${selectedSize.trackHeight}px`,
|
|
65
66
|
backgroundColor: sliderColor,
|
|
66
67
|
},
|
|
67
68
|
marksContainer: {
|
|
68
|
-
height: `${selectedSize.trackHeight}
|
|
69
|
+
height: `${selectedSize.trackHeight}px`,
|
|
69
70
|
},
|
|
70
71
|
mark: {
|
|
71
|
-
width: '
|
|
72
|
-
height: '
|
|
72
|
+
width: '7px',
|
|
73
|
+
height: '7px',
|
|
73
74
|
borderColor: neutral[50],
|
|
74
75
|
backgroundColor: neutral[50],
|
|
75
|
-
transform: 'translateY(-
|
|
76
|
+
transform: 'translateY(-1.5px) translateX(-2px)',
|
|
76
77
|
},
|
|
77
78
|
markFilled: {
|
|
78
79
|
borderColor: sliderColor,
|
|
@@ -81,7 +82,7 @@ const Slider = ({ width, size = 'md', value, setValue, disabled = false, styles,
|
|
|
81
82
|
markLabel: {
|
|
82
83
|
...textStyle['caption'],
|
|
83
84
|
color: disabled ? neutral[100] : neutral[200],
|
|
84
|
-
marginTop:
|
|
85
|
+
marginTop: spacing.xs,
|
|
85
86
|
textAlign: 'center',
|
|
86
87
|
},
|
|
87
88
|
...styles,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VolumeSlider.d.ts","sourceRoot":"","sources":["../../../../../src/components/Inputs/Sliders/VolumeSlider/VolumeSlider.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"VolumeSlider.d.ts","sourceRoot":"","sources":["../../../../../src/components/Inputs/Sliders/VolumeSlider/VolumeSlider.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAU,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAGvD,UAAU,iBAAkB,SAAQ,IAAI,CAAC,WAAW,EAAE,OAAO,CAAC;CAAG;AAEjE,QAAA,MAAM,YAAY,GAAI,wCAA+D,iBAAiB,4CAmCrG,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { IconVolume, IconVolume2, IconVolume3 } from '@tabler/icons-react';
|
|
3
3
|
import { neutral } from '../../../../constants/colors';
|
|
4
|
+
import { spacing } from '../../../../constants/spacing';
|
|
4
5
|
import { Slider } from '../Slider/Slider';
|
|
5
6
|
import { componentSizes } from '../shared/sizes';
|
|
6
7
|
const VolumeSlider = ({ compact = false, size = 'md', fullWidth = false, ...props }) => {
|
|
@@ -19,16 +20,16 @@ const VolumeSlider = ({ compact = false, size = 'md', fullWidth = false, ...prop
|
|
|
19
20
|
container: {
|
|
20
21
|
display: 'flex',
|
|
21
22
|
alignItems: 'center',
|
|
22
|
-
gap: '
|
|
23
|
+
gap: '10px',
|
|
23
24
|
width: fullWidth ? '100%' : 'auto',
|
|
24
|
-
padding:
|
|
25
|
+
padding: `${spacing.xs} 0`,
|
|
25
26
|
},
|
|
26
27
|
iconContainer: {
|
|
27
28
|
display: 'flex',
|
|
28
29
|
alignItems: 'center',
|
|
29
30
|
justifyContent: 'center',
|
|
30
|
-
width: `${selectedSize.iconSize
|
|
31
|
-
height: `${selectedSize.iconSize
|
|
31
|
+
width: `${selectedSize.iconSize}px`,
|
|
32
|
+
height: `${selectedSize.iconSize}px`,
|
|
32
33
|
flexShrink: 0,
|
|
33
34
|
},
|
|
34
35
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export declare const componentSizes: {
|
|
2
2
|
readonly sm: {
|
|
3
|
-
readonly width:
|
|
4
|
-
readonly trackHeight:
|
|
5
|
-
readonly thumbSize:
|
|
3
|
+
readonly width: 200;
|
|
4
|
+
readonly trackHeight: 4;
|
|
5
|
+
readonly thumbSize: 10;
|
|
6
6
|
readonly labelFontSize: {
|
|
7
7
|
fontSize: string;
|
|
8
8
|
lineHeight: string;
|
|
@@ -14,9 +14,9 @@ export declare const componentSizes: {
|
|
|
14
14
|
readonly iconSize: 18;
|
|
15
15
|
};
|
|
16
16
|
readonly md: {
|
|
17
|
-
readonly width:
|
|
18
|
-
readonly trackHeight:
|
|
19
|
-
readonly thumbSize:
|
|
17
|
+
readonly width: 300;
|
|
18
|
+
readonly trackHeight: 5;
|
|
19
|
+
readonly thumbSize: 12.5;
|
|
20
20
|
readonly labelFontSize: {
|
|
21
21
|
fontSize: string;
|
|
22
22
|
lineHeight: string;
|
|
@@ -28,9 +28,9 @@ export declare const componentSizes: {
|
|
|
28
28
|
readonly iconSize: 22;
|
|
29
29
|
};
|
|
30
30
|
readonly lg: {
|
|
31
|
-
readonly width:
|
|
32
|
-
readonly trackHeight:
|
|
33
|
-
readonly thumbSize:
|
|
31
|
+
readonly width: 400;
|
|
32
|
+
readonly trackHeight: 6;
|
|
33
|
+
readonly thumbSize: 15;
|
|
34
34
|
readonly labelFontSize: {
|
|
35
35
|
fontSize: string;
|
|
36
36
|
lineHeight: string;
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { inputFontSize } from '../../../../constants/font';
|
|
2
2
|
export const componentSizes = {
|
|
3
3
|
sm: {
|
|
4
|
-
width:
|
|
5
|
-
trackHeight:
|
|
6
|
-
thumbSize:
|
|
4
|
+
width: 200,
|
|
5
|
+
trackHeight: 4,
|
|
6
|
+
thumbSize: 10,
|
|
7
7
|
labelFontSize: inputFontSize['sm'],
|
|
8
8
|
valueFontSize: inputFontSize['sm'],
|
|
9
9
|
iconSize: 18,
|
|
10
10
|
},
|
|
11
11
|
md: {
|
|
12
|
-
width:
|
|
13
|
-
trackHeight:
|
|
14
|
-
thumbSize:
|
|
12
|
+
width: 300,
|
|
13
|
+
trackHeight: 5,
|
|
14
|
+
thumbSize: 12.5,
|
|
15
15
|
labelFontSize: inputFontSize['md'],
|
|
16
16
|
valueFontSize: inputFontSize['md'],
|
|
17
17
|
iconSize: 22,
|
|
18
18
|
},
|
|
19
19
|
lg: {
|
|
20
|
-
width:
|
|
21
|
-
trackHeight:
|
|
22
|
-
thumbSize:
|
|
20
|
+
width: 400,
|
|
21
|
+
trackHeight: 6,
|
|
22
|
+
thumbSize: 15,
|
|
23
23
|
labelFontSize: inputFontSize['lg'],
|
|
24
24
|
valueFontSize: inputFontSize['lg'],
|
|
25
25
|
iconSize: 26,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutoComplete.d.ts","sourceRoot":"","sources":["../../../../../src/components/Inputs/TextInputs/AutoComplete/AutoComplete.tsx"],"names":[],"mappings":"AACA,OAAO,EAAuC,iBAAiB,IAAI,wBAAwB,EAAE,MAAM,eAAe,CAAC;AACnH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"AutoComplete.d.ts","sourceRoot":"","sources":["../../../../../src/components/Inputs/TextInputs/AutoComplete/AutoComplete.tsx"],"names":[],"mappings":"AACA,OAAO,EAAuC,iBAAiB,IAAI,wBAAwB,EAAE,MAAM,eAAe,CAAC;AACnH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,MAAM,WAAW,iBAAkB,SAAQ,wBAAwB;IACjE,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,YAAY,GAAI,2DAA+F,iBAAiB,4CA4D5I,CAAC"}
|
|
@@ -2,13 +2,14 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { Autocomplete as MantineAutocomplete } 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 '../../Dropdowns/shared/sizes';
|
|
6
7
|
export const AutoComplete = ({ size = 'md', width, fullWidth = false, placeholder = 'Select an option', styles, ...props }) => {
|
|
7
8
|
const selectedSize = componentSizes[size];
|
|
8
|
-
const computedWidth = fullWidth ? '100%' : width || `${selectedSize.minWidth}
|
|
9
|
+
const computedWidth = fullWidth ? '100%' : width || `${selectedSize.minWidth}px`;
|
|
9
10
|
const style = {
|
|
10
11
|
input: {
|
|
11
|
-
height: `${selectedSize.height}
|
|
12
|
+
height: `${selectedSize.height}px`,
|
|
12
13
|
fontSize: selectedSize.fontSize,
|
|
13
14
|
padding: selectedSize.inputPadding,
|
|
14
15
|
...fontBase,
|
|
@@ -25,7 +26,7 @@ export const AutoComplete = ({ size = 'md', width, fullWidth = false, placeholde
|
|
|
25
26
|
},
|
|
26
27
|
label: {
|
|
27
28
|
...fontBase,
|
|
28
|
-
fontSize: `calc(${selectedSize.fontSize} - 0.
|
|
29
|
+
fontSize: `calc(${selectedSize.fontSize} - 0.5px)`,
|
|
29
30
|
color: neutral[200],
|
|
30
31
|
},
|
|
31
32
|
dropdown: {
|
|
@@ -35,7 +36,7 @@ export const AutoComplete = ({ size = 'md', width, fullWidth = false, placeholde
|
|
|
35
36
|
},
|
|
36
37
|
item: {
|
|
37
38
|
padding: selectedSize.dropdownPadding,
|
|
38
|
-
marginBottom:
|
|
39
|
+
marginBottom: spacing.xs,
|
|
39
40
|
...fontBase,
|
|
40
41
|
fontSize: selectedSize.fontSize,
|
|
41
42
|
color: neutral[200],
|
|
@@ -127,7 +127,7 @@ export const Default = {
|
|
|
127
127
|
},
|
|
128
128
|
};
|
|
129
129
|
export const Variants = {
|
|
130
|
-
render: () => (_jsxs(Group, { gap: "
|
|
130
|
+
render: () => (_jsxs(Group, { gap: "20px", children: [_jsx(AutoComplete, { label: "Basic AutoComplete", data: basicOptions }), _jsx(AutoComplete, { label: "With Placeholder", placeholder: "Search fruits...", data: basicOptions }), _jsx(AutoComplete, { label: "With Description", description: "Select your favorite fruit", data: basicOptions })] })),
|
|
131
131
|
parameters: {
|
|
132
132
|
docs: {
|
|
133
133
|
source: {
|
|
@@ -137,7 +137,7 @@ export const Variants = {
|
|
|
137
137
|
},
|
|
138
138
|
};
|
|
139
139
|
export const Sizes = {
|
|
140
|
-
render: () => (_jsxs(Group, { gap: "
|
|
140
|
+
render: () => (_jsxs(Group, { gap: "20px", children: [_jsx(AutoComplete, { size: "sm", label: "Small AutoComplete", data: basicOptions }), _jsx(AutoComplete, { size: "md", label: "Medium AutoComplete (Default)", data: basicOptions }), _jsx(AutoComplete, { size: "lg", label: "Large AutoComplete", data: basicOptions })] })),
|
|
141
141
|
parameters: {
|
|
142
142
|
docs: {
|
|
143
143
|
source: {
|
|
@@ -148,7 +148,7 @@ export const Sizes = {
|
|
|
148
148
|
},
|
|
149
149
|
};
|
|
150
150
|
export const States = {
|
|
151
|
-
render: () => (_jsxs(Group, { gap: "
|
|
151
|
+
render: () => (_jsxs(Group, { gap: "20px", children: [_jsx(AutoComplete, { label: "Normal AutoComplete", data: basicOptions }), _jsx(AutoComplete, { label: "Disabled AutoComplete", data: basicOptions, disabled: true }), _jsx(AutoComplete, { label: "Required AutoComplete", data: basicOptions, required: true }), _jsx(AutoComplete, { label: "AutoComplete with Description", description: "Please select an option", data: basicOptions }), _jsx(AutoComplete, { label: "AutoComplete with Error", error: "This field is required", data: basicOptions })] })),
|
|
152
152
|
parameters: {
|
|
153
153
|
docs: {
|
|
154
154
|
source: {
|
|
@@ -158,7 +158,7 @@ export const States = {
|
|
|
158
158
|
},
|
|
159
159
|
};
|
|
160
160
|
export const AdditionalFunctionality = {
|
|
161
|
-
render: () => (_jsxs(Group, { gap: "
|
|
161
|
+
render: () => (_jsxs(Group, { gap: "20px", children: [_jsx(AutoComplete, { label: "Country Search", data: countryOptions, placeholder: "Search countries..." }), _jsx(AutoComplete, { label: "Custom Width AutoComplete", width: "300px", data: basicOptions }), _jsx(AutoComplete, { label: "Large Dataset", data: Array.from({ length: 50 }, (_, i) => `Option ${i + 1}`), placeholder: "Search options..." })] })),
|
|
162
162
|
parameters: {
|
|
163
163
|
docs: {
|
|
164
164
|
source: {
|
|
@@ -182,7 +182,7 @@ export const AdditionalFunctionality = {
|
|
|
182
182
|
},
|
|
183
183
|
};
|
|
184
184
|
export const CustomStyling = {
|
|
185
|
-
render: () => (_jsxs(Group, { gap: "
|
|
185
|
+
render: () => (_jsxs(Group, { gap: "20px", children: [_jsx(AutoComplete, { label: "Custom Styled AutoComplete", data: basicOptions, styles: {
|
|
186
186
|
input: {
|
|
187
187
|
borderColor: '#ff6b6b',
|
|
188
188
|
'&:focus': {
|
|
@@ -5,13 +5,13 @@ import { fontBase } from '../../../../constants/font';
|
|
|
5
5
|
import { componentSizes } from '../shared/sizes';
|
|
6
6
|
const NumberInput = ({ size = 'md', width, fullWidth = false, styles, step = 1, ...props }) => {
|
|
7
7
|
const selectedSize = componentSizes[size];
|
|
8
|
-
const computedWidth = fullWidth ? '100%' : width || `${selectedSize.width}
|
|
8
|
+
const computedWidth = fullWidth ? '100%' : width || `${selectedSize.width}px`;
|
|
9
9
|
const hasError = !!props.error;
|
|
10
10
|
const style = {
|
|
11
11
|
input: {
|
|
12
|
-
height: `${selectedSize.height}
|
|
12
|
+
height: `${selectedSize.height}px`,
|
|
13
13
|
fontSize: selectedSize.fontSize,
|
|
14
|
-
padding: '0
|
|
14
|
+
padding: '0 10px',
|
|
15
15
|
...fontBase,
|
|
16
16
|
color: neutral[200],
|
|
17
17
|
transition: 'all 200ms ease-in-out',
|
|
@@ -28,19 +28,19 @@ const NumberInput = ({ size = 'md', width, fullWidth = false, styles, step = 1,
|
|
|
28
28
|
height: 'auto',
|
|
29
29
|
margin: 'auto 0',
|
|
30
30
|
gap: 0,
|
|
31
|
-
width: '
|
|
31
|
+
width: '48px',
|
|
32
32
|
alignItems: 'center',
|
|
33
33
|
},
|
|
34
34
|
control: {
|
|
35
35
|
color: hasError ? red[200] : neutral[200],
|
|
36
36
|
border: 'none',
|
|
37
37
|
background: 'transparent',
|
|
38
|
-
width: '
|
|
39
|
-
height: '
|
|
38
|
+
width: '20px',
|
|
39
|
+
height: '12px',
|
|
40
40
|
flex: '0 0 auto',
|
|
41
41
|
'& svg': {
|
|
42
|
-
width: '
|
|
43
|
-
height: '
|
|
42
|
+
width: '20px',
|
|
43
|
+
height: '12px',
|
|
44
44
|
},
|
|
45
45
|
'&:hover': {
|
|
46
46
|
cursor: 'pointer',
|
|
@@ -48,12 +48,12 @@ const NumberInput = ({ size = 'md', width, fullWidth = false, styles, step = 1,
|
|
|
48
48
|
},
|
|
49
49
|
label: {
|
|
50
50
|
...fontBase,
|
|
51
|
-
fontSize: `calc(${selectedSize.fontSize} - 0.
|
|
51
|
+
fontSize: `calc(${selectedSize.fontSize} - 0.5px)`,
|
|
52
52
|
color: neutral[200],
|
|
53
53
|
},
|
|
54
54
|
error: {
|
|
55
55
|
...fontBase,
|
|
56
|
-
fontSize: `calc(${selectedSize.fontSize} - 0.
|
|
56
|
+
fontSize: `calc(${selectedSize.fontSize} - 0.5px)`,
|
|
57
57
|
color: red[200],
|
|
58
58
|
},
|
|
59
59
|
...styles,
|
|
@@ -151,7 +151,7 @@ export const Default = {
|
|
|
151
151
|
},
|
|
152
152
|
};
|
|
153
153
|
export const Variants = {
|
|
154
|
-
render: () => (_jsxs(Group, { gap: "
|
|
154
|
+
render: () => (_jsxs(Group, { gap: "20px", children: [_jsx(NumberInput, { label: "Basic Number Input" }), _jsx(NumberInput, { label: "With Placeholder", placeholder: "Enter a value" }), _jsx(NumberInput, { label: "With Description", description: "Enter a value between 0 and 100", min: 0, max: 100 })] })),
|
|
155
155
|
parameters: {
|
|
156
156
|
docs: {
|
|
157
157
|
source: {
|
|
@@ -161,7 +161,7 @@ export const Variants = {
|
|
|
161
161
|
},
|
|
162
162
|
};
|
|
163
163
|
export const Sizes = {
|
|
164
|
-
render: () => (_jsxs(Group, { gap: "
|
|
164
|
+
render: () => (_jsxs(Group, { gap: "20px", children: [_jsx(NumberInput, { size: "sm", label: "Small Number Input", placeholder: "Small value" }), _jsx(NumberInput, { size: "md", label: "Medium Number Input (Default)", placeholder: "Medium value" }), _jsx(NumberInput, { size: "lg", label: "Large Number Input", placeholder: "Large value" })] })),
|
|
165
165
|
parameters: {
|
|
166
166
|
docs: {
|
|
167
167
|
source: {
|
|
@@ -172,7 +172,7 @@ export const Sizes = {
|
|
|
172
172
|
},
|
|
173
173
|
};
|
|
174
174
|
export const States = {
|
|
175
|
-
render: () => (_jsxs(Group, { gap: "
|
|
175
|
+
render: () => (_jsxs(Group, { gap: "20px", children: [_jsx(NumberInput, { label: "Normal Number Input" }), _jsx(NumberInput, { label: "Disabled Number Input", disabled: true }), _jsx(NumberInput, { label: "Required Number Input", required: true }), _jsx(NumberInput, { label: "Number Input with Description", description: "Please enter a numeric value" }), _jsx(NumberInput, { label: "Number Input with Error", error: "Value is required" })] })),
|
|
176
176
|
parameters: {
|
|
177
177
|
docs: {
|
|
178
178
|
source: {
|
|
@@ -182,7 +182,7 @@ export const States = {
|
|
|
182
182
|
},
|
|
183
183
|
};
|
|
184
184
|
export const AdditionalFunctionality = {
|
|
185
|
-
render: () => (_jsxs(Group, { gap: "
|
|
185
|
+
render: () => (_jsxs(Group, { gap: "20px", children: [_jsx(NumberInput, { label: "Step of 1", placeholder: "Integer values", step: 1 }), _jsx(NumberInput, { label: "Step of 0.5", placeholder: "Decimal values", step: 0.5, precision: 1 }), _jsx(NumberInput, { label: "With Min/Max", placeholder: "Between 0 and 10", min: 0, max: 10, step: 1 }), _jsx(NumberInput, { label: "Custom Width", placeholder: "Custom width", width: "3000px" })] })),
|
|
186
186
|
parameters: {
|
|
187
187
|
docs: {
|
|
188
188
|
source: {
|
|
@@ -209,7 +209,7 @@ export const AdditionalFunctionality = {
|
|
|
209
209
|
},
|
|
210
210
|
};
|
|
211
211
|
export const CustomStyling = {
|
|
212
|
-
render: () => (_jsxs(Group, { gap: "
|
|
212
|
+
render: () => (_jsxs(Group, { gap: "20px", children: [_jsx(NumberInput, { label: "Custom Styled Number Input", styles: {
|
|
213
213
|
input: {
|
|
214
214
|
borderColor: '#ff6b6b',
|
|
215
215
|
'&:focus': {
|
|
@@ -11,16 +11,16 @@ const mantineSize = {
|
|
|
11
11
|
};
|
|
12
12
|
const PasswordInput = ({ size = 'md', width, fullWidth = false, styles, placeholder = 'Enter password', ...props }) => {
|
|
13
13
|
const selectedSize = componentSizes[size];
|
|
14
|
-
const computedWidth = fullWidth ? '100%' : width || `${selectedSize.width}
|
|
14
|
+
const computedWidth = fullWidth ? '100%' : width || `${selectedSize.width}px`;
|
|
15
15
|
const style = {
|
|
16
16
|
input: {
|
|
17
17
|
...fontBase,
|
|
18
18
|
color: neutral[200],
|
|
19
19
|
transition: 'all 200ms ease-in-out',
|
|
20
20
|
borderRadius: '8px',
|
|
21
|
-
height: `${selectedSize.height}
|
|
21
|
+
height: `${selectedSize.height}px`,
|
|
22
22
|
fontSize: selectedSize.fontSize,
|
|
23
|
-
padding: '0
|
|
23
|
+
padding: '0 10px',
|
|
24
24
|
'&[data-invalid]': {
|
|
25
25
|
borderColor: red[200],
|
|
26
26
|
'&::placeholder': {
|
|
@@ -31,19 +31,19 @@ const PasswordInput = ({ size = 'md', width, fullWidth = false, styles, placehol
|
|
|
31
31
|
label: {
|
|
32
32
|
...fontBase,
|
|
33
33
|
color: neutral[200],
|
|
34
|
-
fontSize: `calc(${selectedSize.fontSize} - 0.
|
|
34
|
+
fontSize: `calc(${selectedSize.fontSize} - 0.5px)`,
|
|
35
35
|
},
|
|
36
36
|
error: {
|
|
37
37
|
...fontBase,
|
|
38
|
-
fontSize: `calc(${selectedSize.fontSize} - 0.
|
|
38
|
+
fontSize: `calc(${selectedSize.fontSize} - 0.5px)`,
|
|
39
39
|
color: red[200],
|
|
40
40
|
},
|
|
41
41
|
innerInput: {
|
|
42
42
|
...fontBase,
|
|
43
43
|
color: neutral[200],
|
|
44
|
-
height: `${selectedSize.height}
|
|
44
|
+
height: `${selectedSize.height}px`,
|
|
45
45
|
fontSize: selectedSize.fontSize,
|
|
46
|
-
padding: '0
|
|
46
|
+
padding: '0 10px',
|
|
47
47
|
'&[data-invalid]': {
|
|
48
48
|
color: neutral[200],
|
|
49
49
|
'&::placeholder': {
|
|
@@ -53,7 +53,7 @@ const PasswordInput = ({ size = 'md', width, fullWidth = false, styles, placehol
|
|
|
53
53
|
},
|
|
54
54
|
visibilityToggle: {
|
|
55
55
|
color: neutral[200],
|
|
56
|
-
marginRight: '
|
|
56
|
+
marginRight: '12.5px',
|
|
57
57
|
'&:hover': {
|
|
58
58
|
backgroundColor: 'transparent',
|
|
59
59
|
},
|
|
@@ -138,7 +138,7 @@ export const Default = {
|
|
|
138
138
|
},
|
|
139
139
|
};
|
|
140
140
|
export const Variants = {
|
|
141
|
-
render: () => (_jsxs(Group, { gap: "
|
|
141
|
+
render: () => (_jsxs(Group, { gap: "20px", children: [_jsx(PasswordInput, { label: "Basic Password Input" }), _jsx(PasswordInput, { label: "With Placeholder", placeholder: "Enter your password" }), _jsx(PasswordInput, { label: "With Description", description: "Password must be at least 8 characters" })] })),
|
|
142
142
|
parameters: {
|
|
143
143
|
docs: {
|
|
144
144
|
source: {
|
|
@@ -148,7 +148,7 @@ export const Variants = {
|
|
|
148
148
|
},
|
|
149
149
|
};
|
|
150
150
|
export const Sizes = {
|
|
151
|
-
render: () => (_jsxs(Group, { gap: "
|
|
151
|
+
render: () => (_jsxs(Group, { gap: "20px", children: [_jsx(PasswordInput, { size: "sm", label: "Small Password", placeholder: "Enter password" }), _jsx(PasswordInput, { size: "md", label: "Medium Password (Default)", placeholder: "Enter password" }), _jsx(PasswordInput, { size: "lg", label: "Large Password", placeholder: "Enter password" })] })),
|
|
152
152
|
parameters: {
|
|
153
153
|
docs: {
|
|
154
154
|
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(PasswordInput, { label: "Normal Password Input" }), _jsx(PasswordInput, { label: "Disabled Password Input", disabled: true }), _jsx(PasswordInput, { label: "Required Password Input", required: true }), _jsx(PasswordInput, { label: "Password Input with Description", description: "Password must be at least 8 characters" }), _jsx(PasswordInput, { label: "Password Input with Error", error: "Password is too short" })] })),
|
|
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(PasswordInput, { label: "New Password", description: "Password must be at least 8 characters", placeholder: "Create a strong password" }), _jsx(PasswordInput, { label: "Confirm Password", placeholder: "Re-enter password", error: "Passwords do not match" }), _jsx(PasswordInput, { label: "Custom Width Password", width: "300px" })] })),
|
|
173
173
|
parameters: {
|
|
174
174
|
docs: {
|
|
175
175
|
source: {
|
|
@@ -193,7 +193,7 @@ export const AdditionalFunctionality = {
|
|
|
193
193
|
},
|
|
194
194
|
};
|
|
195
195
|
export const CustomStyling = {
|
|
196
|
-
render: () => (_jsxs(Group, { gap: "
|
|
196
|
+
render: () => (_jsxs(Group, { gap: "20px", children: [_jsx(PasswordInput, { label: "Custom Styled Password Input", styles: {
|
|
197
197
|
input: {
|
|
198
198
|
borderColor: '#ff6b6b',
|
|
199
199
|
'&:focus': {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchBar.d.ts","sourceRoot":"","sources":["../../../../../src/components/Inputs/TextInputs/SearchBar/SearchBar.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"SearchBar.d.ts","sourceRoot":"","sources":["../../../../../src/components/Inputs/TextInputs/SearchBar/SearchBar.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAO/C,UAAU,cAAe,SAAQ,cAAc;IAC7C,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,QAAA,MAAM,SAAS,GAAI,8CAA6D,cAAc,4CAmC7F,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -2,10 +2,11 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { TextInput } from '../TextInput/TextInput';
|
|
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
|
const SearchBar = ({ width, fullWidth = false, size = 'md', styles, ...props }) => {
|
|
7
8
|
const selectedSize = componentSizes[size || 'md'];
|
|
8
|
-
const computedWidth = fullWidth ? '100%' : width || `${selectedSize.width}
|
|
9
|
+
const computedWidth = fullWidth ? '100%' : width || `${selectedSize.width}px`;
|
|
9
10
|
const style = {
|
|
10
11
|
input: {
|
|
11
12
|
...fontBase,
|
|
@@ -13,7 +14,7 @@ const SearchBar = ({ width, fullWidth = false, size = 'md', styles, ...props })
|
|
|
13
14
|
color: neutral[200],
|
|
14
15
|
border: `1px solid ${neutral[100]}`,
|
|
15
16
|
borderRadius: '8px',
|
|
16
|
-
height: `${selectedSize.height}
|
|
17
|
+
height: `${selectedSize.height}px`,
|
|
17
18
|
transition: 'all 200ms ease-in-out',
|
|
18
19
|
'&[data-invalid]': {
|
|
19
20
|
borderColor: red[200],
|
|
@@ -25,6 +26,6 @@ const SearchBar = ({ width, fullWidth = false, size = 'md', styles, ...props })
|
|
|
25
26
|
},
|
|
26
27
|
...styles,
|
|
27
28
|
};
|
|
28
|
-
return (_jsx(TextInput, { placeholder: "Search", width: computedWidth, styles: style, icon: _jsx("i", { className: "fas fa-search", style: { fontSize: 14, marginLeft:
|
|
29
|
+
return (_jsx(TextInput, { placeholder: "Search", width: computedWidth, styles: style, icon: _jsx("i", { className: "fas fa-search", style: { fontSize: 14, marginLeft: spacing.xxs } }), size: 'lg', fullWidth: fullWidth, ...props }));
|
|
29
30
|
};
|
|
30
31
|
export { SearchBar };
|
|
@@ -113,7 +113,7 @@ export const Default = {
|
|
|
113
113
|
},
|
|
114
114
|
};
|
|
115
115
|
export const Variants = {
|
|
116
|
-
render: () => (_jsxs(Group, { gap: "
|
|
116
|
+
render: () => (_jsxs(Group, { gap: "20px", children: [_jsx(SearchBar, { label: "Find Users", description: "Search by name, email, or username" }), _jsx(SearchBar, { placeholder: "Search products..." }), _jsx(SearchBar, { label: "Product Search", error: "Search query is too short" })] })),
|
|
117
117
|
parameters: {
|
|
118
118
|
docs: {
|
|
119
119
|
source: {
|
|
@@ -123,7 +123,7 @@ export const Variants = {
|
|
|
123
123
|
},
|
|
124
124
|
};
|
|
125
125
|
export const Sizes = {
|
|
126
|
-
render: () => (_jsxs(Group, { gap: "
|
|
126
|
+
render: () => (_jsxs(Group, { gap: "20px", children: [_jsx(SearchBar, { size: "sm" }), _jsx(SearchBar, { size: "md" }), _jsx(SearchBar, { size: "lg" })] })),
|
|
127
127
|
parameters: {
|
|
128
128
|
docs: {
|
|
129
129
|
source: {
|
|
@@ -134,7 +134,7 @@ export const Sizes = {
|
|
|
134
134
|
},
|
|
135
135
|
};
|
|
136
136
|
export const States = {
|
|
137
|
-
render: () => (_jsxs(Group, { gap: "
|
|
137
|
+
render: () => (_jsxs(Group, { gap: "20px", children: [_jsx(SearchBar, { label: "Normal Search Bar" }), _jsx(SearchBar, { label: "Disabled Search Bar", disabled: true }), _jsx(SearchBar, { label: "Required Search Bar", required: true }), _jsx(SearchBar, { label: "Search Bar with Description", description: "Enter your search terms" }), _jsx(SearchBar, { label: "Search Bar with Error", error: "Please enter a valid search term" })] })),
|
|
138
138
|
parameters: {
|
|
139
139
|
docs: {
|
|
140
140
|
source: {
|
|
@@ -144,7 +144,7 @@ export const States = {
|
|
|
144
144
|
},
|
|
145
145
|
};
|
|
146
146
|
export const AdditionalFunctionality = {
|
|
147
|
-
render: () => (_jsxs(Group, { gap: "
|
|
147
|
+
render: () => (_jsxs(Group, { gap: "20px", children: [_jsx(SearchBar, { width: 400, placeholder: "Search products..." }), _jsx(SearchBar, { label: "Find Users", description: "Search by name, email, or username" }), _jsx(SearchBar, { label: "Product Search", error: "Search query is too short" })] })),
|
|
148
148
|
parameters: {
|
|
149
149
|
docs: {
|
|
150
150
|
source: {
|
|
@@ -166,7 +166,7 @@ export const AdditionalFunctionality = {
|
|
|
166
166
|
},
|
|
167
167
|
};
|
|
168
168
|
export const CustomStyling = {
|
|
169
|
-
render: () => (_jsxs(Group, { gap: "
|
|
169
|
+
render: () => (_jsxs(Group, { gap: "20px", children: [_jsx(SearchBar, { label: "Custom Styled Search Bar", styles: {
|
|
170
170
|
input: {
|
|
171
171
|
borderColor: '#ff6b6b',
|
|
172
172
|
'&:focus': {
|