welcome-ui 8.0.0 → 8.1.0-alpha.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/AXB53BZF-XKOjjeWO.mjs +25 -0
- package/dist/Accordion.mjs +30 -23
- package/dist/Alert.mjs +76 -70
- package/dist/AspectRatio.mjs +8 -10
- package/dist/Avatar.mjs +48 -47
- package/dist/{BYC7LY2E-CVjUW1dr.mjs → BYC7LY2E-CWSI38FM.mjs} +355 -351
- package/dist/Badge.mjs +25 -25
- package/dist/Box.mjs +5 -5
- package/dist/Breadcrumb.mjs +173 -168
- package/dist/Button.mjs +72 -67
- package/dist/ButtonGroup.mjs +13 -12
- package/dist/Card.mjs +14 -14
- package/dist/Checkbox.mjs +2 -2
- package/dist/ClearButton.mjs +15 -15
- package/dist/CloseButton.mjs +9 -9
- package/dist/{CustomInput-D_13Gd_3.mjs → CustomPopper-CZt4RioF.mjs} +3200 -3047
- package/dist/DatePicker.mjs +81 -80
- package/dist/DateTimePicker.mjs +67 -62
- package/dist/DateTimePickerCommon.mjs +1 -1
- package/dist/Drawer.mjs +190 -174
- package/dist/DropdownMenu.mjs +389 -386
- package/dist/Field.mjs +104 -92
- package/dist/FieldGroup.mjs +12 -9
- package/dist/FileDrop.mjs +613 -576
- package/dist/FileUpload.mjs +95 -74
- package/dist/Files.mjs +46 -46
- package/dist/Flex.mjs +13 -13
- package/dist/Grid.mjs +29 -29
- package/dist/Hint.mjs +12 -12
- package/dist/ITI7HKP4-C89kOQb8.mjs +474 -0
- package/dist/Icon.mjs +24 -24
- package/dist/Icons.mjs +988 -988
- package/dist/IconsFont.mjs +159 -159
- package/dist/InputText.mjs +65 -57
- package/dist/{JC64G2H7-Dey-8h60.mjs → JC64G2H7-afsomHuH.mjs} +109 -108
- package/dist/KUU7WJ55-CzsjuIMv.mjs +61 -0
- package/dist/LVA2YJMS-C-kJ1lkr.mjs +873 -0
- package/dist/Label.mjs +37 -35
- package/dist/Link.mjs +28 -24
- package/dist/Loader.mjs +20 -16
- package/dist/Logo.mjs +55 -42
- package/dist/MTZPJQMC-TybFZCho.mjs +15 -0
- package/dist/Modal.mjs +272 -249
- package/dist/NLEBE274-oSxMftGy.mjs +84 -0
- package/dist/P2CTZE2T-DOT1mNnX.mjs +301 -0
- package/dist/P4IRICAX-CWSZLTGz.mjs +37 -0
- package/dist/Pagination.mjs +104 -104
- package/dist/PasswordInput.mjs +35 -34
- package/dist/Picker.mjs +35 -33
- package/dist/Popover.mjs +100 -93
- package/dist/QYJ6MIDR-DJ-vUdAM.mjs +98 -0
- package/dist/Radio.mjs +58 -52
- package/dist/RadioGroup.mjs +46 -46
- package/dist/RadioTab.mjs +37 -35
- package/dist/{SYRFVSLH-cVmYtx36.mjs → SYRFVSLH-B6m278Vb.mjs} +18 -17
- package/dist/Search.mjs +175 -161
- package/dist/Select.mjs +885 -847
- package/dist/Shape.mjs +9 -9
- package/dist/Slider.mjs +359 -336
- package/dist/Stack.mjs +22 -24
- package/dist/Swiper.mjs +324 -311
- package/dist/Table.mjs +23 -23
- package/dist/Tabs.mjs +250 -245
- package/dist/Tag.mjs +51 -49
- package/dist/Text.mjs +49 -47
- package/dist/Textarea.mjs +39 -39
- package/dist/TimePicker.mjs +57 -56
- package/dist/Toast.mjs +144 -137
- package/dist/Toggle.mjs +27 -24
- package/dist/Tooltip.mjs +115 -111
- package/dist/UniversalLink.mjs +16 -16
- package/dist/VEVQD5MH-0w9Y7Ytc.mjs +20 -0
- package/dist/{VGCJ63VH-B39w1tBw.mjs → VGCJ63VH-C0UPBY-5.mjs} +61 -62
- package/dist/VariantIcon.mjs +14 -22
- package/dist/WelcomeLoader.mjs +4863 -9223
- package/dist/WuiProvider.mjs +69 -58
- package/dist/X5NMLKT6-BJw3xE-K.mjs +25 -0
- package/dist/YV4JVR4I-DPC8mMuG.mjs +344 -0
- package/dist/downshift.esm-B7Jil1wW.mjs +1082 -0
- package/dist/{field-styles-DLIhqG_8.mjs → field-styles-BVlRlvuu.mjs} +2 -2
- package/dist/{hex-to-rgba-BIDK-3ab.mjs → hex-to-rgba-DU_XzKIK.mjs} +2 -2
- package/dist/hide-focus-rings-root-CCXdysih.mjs +15 -0
- package/dist/index-5HBq1O6Z.mjs +185 -0
- package/dist/{index-C7zM96J_.mjs → index-BaLGEKs7.mjs} +8 -8
- package/dist/{index-BYdkhqH4.mjs → index-CBBbX29m.mjs} +3652 -3584
- package/dist/index-CYmF7qCH.mjs +11 -0
- package/dist/index-C_k-m0Rl.mjs +36 -0
- package/dist/index-D8v_VJ9z.mjs +26 -0
- package/dist/{index-BNGGwOCo.mjs → index-DAZ1SYdj.mjs} +7 -7
- package/dist/{index-SbQUT2mU.mjs → index-DgSynio4.mjs} +244 -239
- package/dist/index-DpkNUfAS.mjs +11 -0
- package/dist/{index-DqBUFsqP.mjs → index-DvzWKxKE.mjs} +7 -7
- package/dist/{index-BJAZgeHL.mjs → index-QaLwIvZS.mjs} +8 -8
- package/dist/{index-BQtDgQBH.mjs → index-SQQQ4dEE.mjs} +8 -8
- package/dist/index-i_anpNhw.mjs +66 -0
- package/dist/index-wl3X6EM1.mjs +16 -0
- package/dist/jsx-runtime-B7I4PJ0H.mjs +613 -0
- package/dist/radio-group-C0fUHvam.mjs +52 -0
- package/dist/theme.mjs +1175 -1120
- package/dist/throttle-CW18pWlW.mjs +13 -0
- package/dist/types/components/Accordion/index.d.ts +1 -1
- package/dist/types/components/Accordion/styles.d.ts +2 -2
- package/dist/types/components/Accordion/theme.d.ts +1 -1
- package/dist/types/components/Alert/index.d.ts +2 -2
- package/dist/types/components/Alert/styles.d.ts +9 -9
- package/dist/types/components/Alert/theme.d.ts +4 -4
- package/dist/types/components/Avatar/index.d.ts +2 -3
- package/dist/types/components/Avatar/styles.d.ts +8 -8
- package/dist/types/components/Avatar/theme.d.ts +3 -3
- package/dist/types/components/Avatar/utils.d.ts +1 -1
- package/dist/types/components/Badge/index.d.ts +2 -2
- package/dist/types/components/Badge/styles.d.ts +5 -5
- package/dist/types/components/Badge/theme.d.ts +1 -1
- package/dist/types/components/Breadcrumb/Item.d.ts +1 -1
- package/dist/types/components/Breadcrumb/index.d.ts +2 -2
- package/dist/types/components/Breadcrumb/theme.d.ts +1 -1
- package/dist/types/components/Button/index.d.ts +4 -5
- package/dist/types/components/Button/styles.d.ts +1 -1
- package/dist/types/components/Button/theme.d.ts +7 -7
- package/dist/types/components/ButtonGroup/index.d.ts +3 -3
- package/dist/types/components/Card/Cover.styles.d.ts +4 -4
- package/dist/types/components/Card/index.d.ts +2 -3
- package/dist/types/components/Card/theme.d.ts +1 -1
- package/dist/types/components/Checkbox/index.d.ts +2 -2
- package/dist/types/components/Checkbox/styles.d.ts +1 -1
- package/dist/types/components/Checkbox/theme.d.ts +1 -1
- package/dist/types/components/ClearButton/index.d.ts +5 -6
- package/dist/types/components/ClearButton/styles.d.ts +4 -4
- package/dist/types/components/CloseButton/styles.d.ts +4 -4
- package/dist/types/components/DatePicker/index.d.ts +3 -3
- package/dist/types/components/DateTimePicker/index.d.ts +2 -2
- package/dist/types/components/DateTimePickerCommon/CustomHeader.d.ts +1 -1
- package/dist/types/components/DateTimePickerCommon/CustomInput.d.ts +5 -5
- package/dist/types/components/DateTimePickerCommon/CustomPopper.d.ts +1 -1
- package/dist/types/components/DateTimePickerCommon/index.d.ts +2 -2
- package/dist/types/components/DateTimePickerCommon/theme.d.ts +1 -1
- package/dist/types/components/DateTimePickerCommon/utils.d.ts +2 -2
- package/dist/types/components/Drawer/AssetDrawer/Header.d.ts +1 -1
- package/dist/types/components/Drawer/AssetDrawer/index.d.ts +1 -1
- package/dist/types/components/Drawer/index.d.ts +12 -12
- package/dist/types/components/Drawer/styles.d.ts +5 -5
- package/dist/types/components/Drawer/theme.d.ts +2 -2
- package/dist/types/components/DropdownMenu/index.d.ts +4 -4
- package/dist/types/components/DropdownMenu/theme.d.ts +1 -1
- package/dist/types/components/Field/index.d.ts +8 -8
- package/dist/types/components/Field/styles.d.ts +1 -1
- package/dist/types/components/Field/utils.d.ts +1 -1
- package/dist/types/components/FileDrop/FilePreview.d.ts +2 -2
- package/dist/types/components/FileDrop/Message.d.ts +1 -1
- package/dist/types/components/FileDrop/index.d.ts +20 -20
- package/dist/types/components/FileDrop/theme.d.ts +1 -1
- package/dist/types/components/FileUpload/index.d.ts +13 -13
- package/dist/types/components/Files/index.d.ts +5 -5
- package/dist/types/components/Files/types.d.ts +1 -1
- package/dist/types/components/Hint/index.d.ts +1 -2
- package/dist/types/components/Hint/theme.d.ts +1 -1
- package/dist/types/components/Icon/index.d.ts +3 -3
- package/dist/types/components/Icon/styles.d.ts +3 -3
- package/dist/types/components/Icon/theme.d.ts +3 -3
- package/dist/types/components/Icons/Sun/content.json.d.ts +2 -1
- package/dist/types/components/Icons/index.d.ts +2 -2
- package/dist/types/components/IconsFont/index.d.ts +2 -3
- package/dist/types/components/IconsFont/styles.d.ts +1 -1
- package/dist/types/components/InputText/index.d.ts +1 -1
- package/dist/types/components/InputText/styles.d.ts +1 -1
- package/dist/types/components/Label/index.d.ts +2 -3
- package/dist/types/components/Label/theme.d.ts +1 -1
- package/dist/types/components/Link/index.d.ts +5 -5
- package/dist/types/components/Link/styles.d.ts +4 -4
- package/dist/types/components/Link/theme.d.ts +1 -1
- package/dist/types/components/Loader/index.d.ts +1 -1
- package/dist/types/components/Loader/styles.d.ts +4 -4
- package/dist/types/components/Loader/theme.d.ts +4 -4
- package/dist/types/components/Logo/Solutions.d.ts +1 -2
- package/dist/types/components/Logo/Symbol.d.ts +1 -2
- package/dist/types/components/Logo/Wui.d.ts +1 -2
- package/dist/types/components/Logo/index.d.ts +5 -5
- package/dist/types/components/Modal/Assets/Backdrop.d.ts +5 -6
- package/dist/types/components/Modal/Assets/Iframe.d.ts +1 -2
- package/dist/types/components/Modal/Assets/index.d.ts +9 -9
- package/dist/types/components/Modal/Assets/styles.d.ts +8 -8
- package/dist/types/components/Modal/Close.d.ts +3 -4
- package/dist/types/components/Modal/Content.d.ts +3 -5
- package/dist/types/components/Modal/Footer.d.ts +1 -1
- package/dist/types/components/Modal/Header.d.ts +2 -2
- package/dist/types/components/Modal/index.d.ts +17 -17
- package/dist/types/components/Modal/styles.d.ts +7 -7
- package/dist/types/components/Modal/theme.d.ts +2 -2
- package/dist/types/components/Pagination/index.d.ts +2 -2
- package/dist/types/components/Pagination/theme.d.ts +1 -1
- package/dist/types/components/Pagination/utils.d.ts +1 -1
- package/dist/types/components/Picker/index.d.ts +1 -1
- package/dist/types/components/Picker/styles.d.ts +1 -1
- package/dist/types/components/Popover/Arrow.d.ts +1 -2
- package/dist/types/components/Popover/Content.d.ts +2 -3
- package/dist/types/components/Popover/Popover.d.ts +4 -5
- package/dist/types/components/Popover/PopoverHover.d.ts +3 -4
- package/dist/types/components/Popover/Trigger.d.ts +1 -1
- package/dist/types/components/Popover/styles.d.ts +4 -4
- package/dist/types/components/Popover/theme.d.ts +1 -1
- package/dist/types/components/Popover/usePopover.d.ts +6 -6
- package/dist/types/components/Radio/index.d.ts +3 -3
- package/dist/types/components/Radio/styles.d.ts +5 -5
- package/dist/types/components/Radio/theme.d.ts +1 -1
- package/dist/types/components/RadioGroup/index.d.ts +2 -2
- package/dist/types/components/RadioTab/index.d.ts +3 -3
- package/dist/types/components/RadioTab/styles.d.ts +3 -9
- package/dist/types/components/RadioTab/theme.d.ts +1 -1
- package/dist/types/components/Search/index.d.ts +5 -5
- package/dist/types/components/Select/index.d.ts +11 -11
- package/dist/types/components/Select/styles.d.ts +6 -6
- package/dist/types/components/Select/utils.d.ts +11 -7
- package/dist/types/components/Shape/index.d.ts +1 -1
- package/dist/types/components/Shape/styles.d.ts +3 -3
- package/dist/types/components/Slider/Range.d.ts +3 -3
- package/dist/types/components/Slider/index.d.ts +2 -2
- package/dist/types/components/Slider/styles.d.ts +16 -16
- package/dist/types/components/Slider/theme.d.ts +1 -1
- package/dist/types/components/Stack/index.d.ts +1 -1
- package/dist/types/components/Swiper/index.d.ts +17 -18
- package/dist/types/components/Swiper/styles.d.ts +56 -56
- package/dist/types/components/Swiper/theme.d.ts +1 -1
- package/dist/types/components/System/index.d.ts +14 -14
- package/dist/types/components/Table/index.d.ts +6 -7
- package/dist/types/components/Table/styles.d.ts +1 -1
- package/dist/types/components/Table/theme.d.ts +1 -1
- package/dist/types/components/Tabs/ActiveBar.d.ts +5 -5
- package/dist/types/components/Tabs/TabList.d.ts +4 -4
- package/dist/types/components/Tabs/TabPanel.d.ts +2 -2
- package/dist/types/components/Tabs/styles.d.ts +2 -2
- package/dist/types/components/Tabs/theme.d.ts +2 -2
- package/dist/types/components/Tag/index.d.ts +2 -3
- package/dist/types/components/Tag/styles.d.ts +1 -1
- package/dist/types/components/Tag/theme.d.ts +3 -3
- package/dist/types/components/Text/index.d.ts +2 -2
- package/dist/types/components/Textarea/index.d.ts +1 -1
- package/dist/types/components/Textarea/theme.d.ts +1 -1
- package/dist/types/components/TimePicker/index.d.ts +2 -2
- package/dist/types/components/Toast/Growl.d.ts +1 -1
- package/dist/types/components/Toast/Snackbar.d.ts +1 -1
- package/dist/types/components/Toast/ToastWrapper.d.ts +5 -5
- package/dist/types/components/Toast/index.d.ts +6 -6
- package/dist/types/components/Toast/styles.d.ts +16 -16
- package/dist/types/components/Toast/theme.d.ts +2 -2
- package/dist/types/components/Toast/utils.d.ts +13 -13
- package/dist/types/components/Toggle/index.d.ts +3 -3
- package/dist/types/components/Toggle/styles.d.ts +5 -4
- package/dist/types/components/Toggle/theme.d.ts +6 -6
- package/dist/types/components/Tooltip/index.d.ts +2 -2
- package/dist/types/components/Tooltip/styles.d.ts +1 -1
- package/dist/types/components/Tooltip/theme.d.ts +1 -1
- package/dist/types/components/VariantIcon/index.d.ts +1 -1
- package/dist/types/components/VariantIcon/styles.d.ts +1 -1
- package/dist/types/components/VariantIcon/theme.d.ts +3 -3
- package/dist/types/components/WuiProvider/font.d.ts +3 -5
- package/dist/types/components/WuiProvider/index.d.ts +1 -1
- package/dist/types/theme/colors.d.ts +3 -11
- package/dist/types/theme/dark.d.ts +1 -1
- package/dist/types/theme/defaultFields.d.ts +10 -10
- package/dist/types/theme/fonts.d.ts +5 -5
- package/dist/types/theme/index.d.ts +31 -31
- package/dist/types/theme/screens.d.ts +1 -1
- package/dist/types/theme/space.d.ts +1 -1
- package/dist/types/theme/typography.d.ts +1 -1
- package/dist/types/utils/field-styles.d.ts +6 -6
- package/dist/types/utils/index.d.ts +2 -2
- package/dist/types/utils/ts-utils.d.ts +1 -1
- package/dist/types/utils/use-copy-text.d.ts +1 -1
- package/dist/types/utils/use-create-portal.d.ts +1 -1
- package/dist/types/utils/use-viewport.d.ts +2 -2
- package/dist/types/utils/wrap-children.d.ts +1 -1
- package/dist/{use-fork-ref-CUZErtAC.mjs → use-fork-ref-DvaCTfQ_.mjs} +4 -3
- package/dist/use-viewport-CWpjoHXy.mjs +16 -0
- package/dist/utils.mjs +96 -85
- package/dist/wrap-children-DBSD-X5-.mjs +9 -0
- package/package.json +9 -36
- package/dist/AXB53BZF-CGoc4K3d.mjs +0 -25
- package/dist/ITI7HKP4-BONrZ9Pq.mjs +0 -473
- package/dist/KUU7WJ55-3sP-w1F1.mjs +0 -61
- package/dist/LVA2YJMS-qFC9J-lt.mjs +0 -1479
- package/dist/MTZPJQMC-C0Xe_WK4.mjs +0 -13
- package/dist/NLEBE274-C94QU78N.mjs +0 -84
- package/dist/P2CTZE2T-YPes1GXe.mjs +0 -297
- package/dist/P4IRICAX-DzXqUYe-.mjs +0 -37
- package/dist/QYJ6MIDR-BLLqyXdd.mjs +0 -97
- package/dist/VEVQD5MH-ZMnHV8ZJ.mjs +0 -20
- package/dist/X5NMLKT6-uFSu0Lii.mjs +0 -25
- package/dist/YV4JVR4I-BGfUf3Nu.mjs +0 -341
- package/dist/downshift.esm-CEHW4VDy.mjs +0 -1085
- package/dist/hide-focus-rings-root-BNyva1yb.mjs +0 -14
- package/dist/index-BDeIsk2X.mjs +0 -184
- package/dist/index-BRDOakbf.mjs +0 -11
- package/dist/index-BpRjq7lj.mjs +0 -11
- package/dist/index-BrfXjmHY.mjs +0 -36
- package/dist/index-CExLVjET.mjs +0 -26
- package/dist/index-DEJJvyGk.mjs +0 -66
- package/dist/index-u1oHKa7X.mjs +0 -16
- package/dist/radio-group-CGC6DTFJ.mjs +0 -51
- package/dist/throttle-BDBzFeFj.mjs +0 -13
- package/dist/use-viewport-m3glsbna.mjs +0 -16
- package/dist/wrap-children-aq69jtFP.mjs +0 -12
package/dist/Slider.mjs
CHANGED
|
@@ -1,48 +1,49 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { Box as
|
|
5
|
-
import { Hint as
|
|
6
|
-
import {
|
|
7
|
-
import { InputText as O } from "./InputText.mjs";
|
|
2
|
+
import { j as s } from "./jsx-runtime-B7I4PJ0H.mjs";
|
|
3
|
+
import { useState as D, useRef as S, useCallback as ie, useEffect as F } from "react";
|
|
4
|
+
import { Box as m } from "./Box.mjs";
|
|
5
|
+
import { Hint as ee } from "./Hint.mjs";
|
|
6
|
+
import { InputText as W } from "./InputText.mjs";
|
|
8
7
|
import { forwardRef as le } from "./System.mjs";
|
|
9
|
-
|
|
8
|
+
import { Text as ae } from "./Text.mjs";
|
|
9
|
+
import z, { th as l, css as $ } from "@xstyled/styled-components";
|
|
10
|
+
const H = $`
|
|
10
11
|
appearance: none;
|
|
11
12
|
cursor: pointer;
|
|
12
13
|
height: 20;
|
|
13
14
|
width: 20;
|
|
14
15
|
transform: scale(1);
|
|
15
16
|
transition:
|
|
16
|
-
background-color ${
|
|
17
|
-
border-color ${
|
|
17
|
+
background-color ${l.transition("medium")},
|
|
18
|
+
border-color ${l.transition("medium")},
|
|
18
19
|
transform 100ms ease-in-out;
|
|
19
|
-
`,
|
|
20
|
-
${
|
|
20
|
+
`, _ = $`
|
|
21
|
+
${l("sliders.focused")};
|
|
21
22
|
transform: scale(1.2);
|
|
22
|
-
`,
|
|
23
|
+
`, ce = $`
|
|
23
24
|
position: absolute;
|
|
24
25
|
width: 100%;
|
|
25
|
-
height: ${
|
|
26
|
-
`,
|
|
27
|
-
({ borderSelectorColor: o, disabled: c }) =>
|
|
28
|
-
${
|
|
26
|
+
height: ${l("space.xs")};
|
|
27
|
+
`, he = z.input(
|
|
28
|
+
({ borderSelectorColor: o, disabled: c }) => $`
|
|
29
|
+
${l("sliders.default")};
|
|
29
30
|
appearance: none;
|
|
30
31
|
cursor: pointer;
|
|
31
32
|
background-repeat: no-repeat;
|
|
32
33
|
border-radius: 0;
|
|
33
34
|
margin: auto 0;
|
|
34
35
|
width: 100%;
|
|
35
|
-
height: ${
|
|
36
|
+
height: ${l("space.xs")};
|
|
36
37
|
|
|
37
38
|
&::-webkit-slider-thumb {
|
|
38
|
-
${
|
|
39
|
-
${
|
|
39
|
+
${l("sliders.selector")};
|
|
40
|
+
${H};
|
|
40
41
|
border-color: ${o || "transparent"};
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
&::-moz-range-thumb {
|
|
44
|
-
${
|
|
45
|
-
${
|
|
45
|
+
${l("sliders.selector")};
|
|
46
|
+
${H};
|
|
46
47
|
border-color: ${o || "transparent"};
|
|
47
48
|
}
|
|
48
49
|
|
|
@@ -51,42 +52,42 @@ const W = b`
|
|
|
51
52
|
outline: none;
|
|
52
53
|
|
|
53
54
|
&::-webkit-slider-thumb {
|
|
54
|
-
${
|
|
55
|
+
${_};
|
|
55
56
|
}
|
|
56
57
|
|
|
57
58
|
&::-moz-range-thumb {
|
|
58
|
-
${
|
|
59
|
+
${_};
|
|
59
60
|
}
|
|
60
61
|
}
|
|
61
62
|
|
|
62
|
-
${c &&
|
|
63
|
-
${
|
|
63
|
+
${c && $`
|
|
64
|
+
${l("sliders.disabled")}
|
|
64
65
|
cursor: not-allowed;
|
|
65
66
|
|
|
66
67
|
&::-webkit-slider-thumb {
|
|
67
|
-
${
|
|
68
|
+
${l("sliders.selector.disabled")};
|
|
68
69
|
cursor: not-allowed;
|
|
69
70
|
}
|
|
70
71
|
|
|
71
72
|
&::-moz-range-thumb {
|
|
72
|
-
${
|
|
73
|
+
${l("sliders.selector.disabled")};
|
|
73
74
|
cursor: not-allowed;
|
|
74
75
|
}
|
|
75
76
|
|
|
76
77
|
&:active {
|
|
77
78
|
&::-webkit-slider-thumb {
|
|
78
|
-
${
|
|
79
|
+
${l("sliders.focused.disabled")};
|
|
79
80
|
}
|
|
80
81
|
|
|
81
82
|
&::-moz-range-thumb {
|
|
82
|
-
${
|
|
83
|
+
${l("sliders.focused.disabled")};
|
|
83
84
|
}
|
|
84
85
|
}
|
|
85
86
|
`};
|
|
86
87
|
`
|
|
87
|
-
),
|
|
88
|
-
({ borderSelectorColor: o, disabled: c }) =>
|
|
89
|
-
${
|
|
88
|
+
), re = z.input(
|
|
89
|
+
({ borderSelectorColor: o, disabled: c }) => $`
|
|
90
|
+
${l("sliders.rangeInput")}
|
|
90
91
|
appearance: none;
|
|
91
92
|
pointer-events: none;
|
|
92
93
|
position: absolute;
|
|
@@ -94,24 +95,24 @@ const W = b`
|
|
|
94
95
|
width: 100%;
|
|
95
96
|
outline: none;
|
|
96
97
|
z-index: 1;
|
|
97
|
-
top: ${
|
|
98
|
+
top: ${l("space.xxs")};
|
|
98
99
|
|
|
99
100
|
&::-webkit-slider-thumb {
|
|
100
|
-
${
|
|
101
|
-
${
|
|
101
|
+
${l("sliders.selector")};
|
|
102
|
+
${H};
|
|
102
103
|
|
|
103
104
|
border-color: ${o || "transparent"};
|
|
104
|
-
top: ${
|
|
105
|
+
top: ${l("space.sm")};
|
|
105
106
|
pointer-events: all;
|
|
106
107
|
position: relative;
|
|
107
108
|
}
|
|
108
109
|
|
|
109
110
|
&::-moz-range-thumb {
|
|
110
|
-
${
|
|
111
|
-
${
|
|
111
|
+
${l("sliders.selector")};
|
|
112
|
+
${H};
|
|
112
113
|
|
|
113
114
|
border-color: ${o || "transparent"};
|
|
114
|
-
top: ${
|
|
115
|
+
top: ${l("space.sm")};
|
|
115
116
|
pointer-events: all;
|
|
116
117
|
position: relative;
|
|
117
118
|
}
|
|
@@ -119,53 +120,53 @@ const W = b`
|
|
|
119
120
|
&:active,
|
|
120
121
|
&:focus-visible {
|
|
121
122
|
&::-webkit-slider-thumb {
|
|
122
|
-
${
|
|
123
|
+
${_};
|
|
123
124
|
}
|
|
124
125
|
|
|
125
126
|
&::-moz-range-thumb {
|
|
126
|
-
${
|
|
127
|
+
${_};
|
|
127
128
|
}
|
|
128
129
|
}
|
|
129
130
|
|
|
130
|
-
${c &&
|
|
131
|
+
${c && $`
|
|
131
132
|
&::-webkit-slider-thumb {
|
|
132
|
-
${
|
|
133
|
+
${l("sliders.selector.disabled")};
|
|
133
134
|
cursor: not-allowed;
|
|
134
135
|
}
|
|
135
136
|
|
|
136
137
|
&::-moz-range-thumb {
|
|
137
|
-
${
|
|
138
|
+
${l("sliders.selector.disabled")};
|
|
138
139
|
cursor: not-allowed;
|
|
139
140
|
}
|
|
140
141
|
|
|
141
142
|
&:active {
|
|
142
143
|
&::-webkit-slider-thumb {
|
|
143
|
-
${
|
|
144
|
+
${l("sliders.focused.disabled")};
|
|
144
145
|
}
|
|
145
146
|
|
|
146
147
|
&::-moz-range-thumb {
|
|
147
|
-
${
|
|
148
|
+
${l("sliders.focused.disabled")};
|
|
148
149
|
}
|
|
149
150
|
}
|
|
150
151
|
`};
|
|
151
152
|
`
|
|
152
|
-
),
|
|
153
|
-
() =>
|
|
154
|
-
${
|
|
153
|
+
), pe = z(m)(
|
|
154
|
+
() => $`
|
|
155
|
+
${ce};
|
|
155
156
|
background-color: beige-40;
|
|
156
157
|
`
|
|
157
|
-
),
|
|
158
|
-
({ disabled: o }) =>
|
|
159
|
-
${
|
|
158
|
+
), me = z(m)(
|
|
159
|
+
({ disabled: o }) => $`
|
|
160
|
+
${ce};
|
|
160
161
|
background-color: primary-40;
|
|
161
162
|
|
|
162
|
-
${o &&
|
|
163
|
-
${
|
|
163
|
+
${o && $`
|
|
164
|
+
${l("sliders.disabled")}
|
|
164
165
|
cursor: not-allowed;
|
|
165
166
|
`};
|
|
166
167
|
`
|
|
167
|
-
),
|
|
168
|
-
() =>
|
|
168
|
+
), ue = z(m)(
|
|
169
|
+
() => $`
|
|
169
170
|
position: absolute;
|
|
170
171
|
|
|
171
172
|
:before {
|
|
@@ -177,16 +178,16 @@ const W = b`
|
|
|
177
178
|
transform: translate(-50%);
|
|
178
179
|
}
|
|
179
180
|
`
|
|
180
|
-
),
|
|
181
|
-
() =>
|
|
181
|
+
), de = z(ee)(
|
|
182
|
+
() => $`
|
|
182
183
|
position: absolute;
|
|
183
184
|
color: neutral-50;
|
|
184
185
|
top: 0;
|
|
185
186
|
transform: translate(-50%);
|
|
186
187
|
white-space: nowrap;
|
|
187
188
|
`
|
|
188
|
-
),
|
|
189
|
-
({ isVisible: o }) =>
|
|
189
|
+
), Y = z.outputBox(
|
|
190
|
+
({ isVisible: o }) => $`
|
|
190
191
|
opacity: 0;
|
|
191
192
|
visibility: hidden;
|
|
192
193
|
transition:
|
|
@@ -195,337 +196,359 @@ const W = b`
|
|
|
195
196
|
transform 150ms ease-in-out;
|
|
196
197
|
position: absolute;
|
|
197
198
|
text-align: center;
|
|
198
|
-
transform: translate(-50%, calc(-100% + -${
|
|
199
|
+
transform: translate(-50%, calc(-100% + -${l("space.xs")}));
|
|
199
200
|
|
|
200
|
-
${o &&
|
|
201
|
+
${o && $`
|
|
201
202
|
opacity: 100;
|
|
202
203
|
visibility: visible;
|
|
203
|
-
transform: translate(-50%, calc(-100% + -${
|
|
204
|
+
transform: translate(-50%, calc(-100% + -${l("space.sm")}));
|
|
204
205
|
`}
|
|
205
206
|
`
|
|
206
|
-
),
|
|
207
|
-
() =>
|
|
208
|
-
${
|
|
207
|
+
), Z = z(m)(
|
|
208
|
+
() => $`
|
|
209
|
+
${l("sliders.output.tooltip")};
|
|
209
210
|
flex: 1 1 auto;
|
|
210
211
|
margin: auto;
|
|
211
|
-
min-width: ${
|
|
212
|
-
padding: ${
|
|
212
|
+
min-width: ${l("space.xxs")};
|
|
213
|
+
padding: ${l("space.xs")} ${l("space.sm")};
|
|
213
214
|
`
|
|
214
|
-
),
|
|
215
|
+
), oe = 20, B = ({
|
|
215
216
|
min: o,
|
|
216
217
|
step: c,
|
|
217
|
-
toCompare:
|
|
218
|
-
value:
|
|
218
|
+
toCompare: x,
|
|
219
|
+
value: v
|
|
219
220
|
}) => {
|
|
220
|
-
let n = Math.min(
|
|
221
|
-
return n = Math.max(n, o),
|
|
221
|
+
let n = Math.min(v, x - 1 * c);
|
|
222
|
+
return n = Math.max(n, o), q(n, c);
|
|
222
223
|
}, L = ({
|
|
223
224
|
max: o,
|
|
224
225
|
step: c,
|
|
225
|
-
toCompare:
|
|
226
|
-
value:
|
|
226
|
+
toCompare: x,
|
|
227
|
+
value: v
|
|
227
228
|
}) => {
|
|
228
|
-
let n = Math.max(
|
|
229
|
-
return n = Math.min(n, o),
|
|
230
|
-
},
|
|
229
|
+
let n = Math.max(v, x + 1 * c);
|
|
230
|
+
return n = Math.min(n, o), q(n, c);
|
|
231
|
+
}, $e = le(
|
|
231
232
|
({
|
|
232
233
|
borderSelectorColor: o = "neutral-10",
|
|
233
234
|
disabled: c,
|
|
234
|
-
hint:
|
|
235
|
-
label:
|
|
235
|
+
hint: x,
|
|
236
|
+
label: v,
|
|
236
237
|
max: n,
|
|
237
|
-
min:
|
|
238
|
-
onChange:
|
|
239
|
-
step:
|
|
240
|
-
tooltip:
|
|
241
|
-
type:
|
|
238
|
+
min: i,
|
|
239
|
+
onChange: j,
|
|
240
|
+
step: a = 1,
|
|
241
|
+
tooltip: R,
|
|
242
|
+
type: b,
|
|
242
243
|
value: p,
|
|
243
|
-
values:
|
|
244
|
+
values: E,
|
|
244
245
|
...G
|
|
245
|
-
},
|
|
246
|
-
const [u,
|
|
247
|
-
const t =
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
246
|
+
}, J) => {
|
|
247
|
+
const [u, M] = D(i), [d, I] = D(n), [N, g] = D(n), [w, y] = D(n), T = S(null), P = S(null), k = S(null), K = S(null), C = S(null), [A, Q] = D(!1), [O, X] = D(!1), r = (e) => {
|
|
248
|
+
const t = B({
|
|
249
|
+
min: i,
|
|
250
|
+
step: a,
|
|
251
|
+
toCompare: d,
|
|
252
|
+
value: parseInt(e.target.value, 10)
|
|
252
253
|
});
|
|
253
|
-
|
|
254
|
-
},
|
|
254
|
+
g(t), M(t), e.target.value = t.toString();
|
|
255
|
+
}, f = (e) => {
|
|
255
256
|
const t = L({
|
|
256
|
-
|
|
257
|
+
max: n,
|
|
258
|
+
step: a,
|
|
257
259
|
toCompare: u,
|
|
258
|
-
|
|
259
|
-
max: n
|
|
260
|
+
value: parseInt(e.target.value, 10)
|
|
260
261
|
});
|
|
261
|
-
|
|
262
|
-
},
|
|
262
|
+
y(t), I(t), e.target.value = t.toString();
|
|
263
|
+
}, te = (e, t) => {
|
|
263
264
|
if (e.preventDefault(), t === "min") {
|
|
264
|
-
let
|
|
265
|
-
e.key === "ArrowRight" && (
|
|
265
|
+
let h = u;
|
|
266
|
+
e.key === "ArrowRight" && (h = B({ min: i, step: a, toCompare: d, value: h + a })), e.key === "ArrowLeft" && (h = B({ min: i, step: a, toCompare: d, value: h - a })), g(h), M(h), j({ max: d, min: h });
|
|
266
267
|
}
|
|
267
268
|
if (t === "max") {
|
|
268
|
-
let
|
|
269
|
-
e.key === "ArrowRight" && (
|
|
269
|
+
let h = d;
|
|
270
|
+
e.key === "ArrowRight" && (h = L({ max: n, step: a, toCompare: u, value: h + a })), e.key === "ArrowLeft" && (h = L({ max: n, step: a, toCompare: u, value: h - a })), y(h), I(h), j({ max: h, min: u });
|
|
270
271
|
}
|
|
271
|
-
},
|
|
272
|
+
}, V = ie(
|
|
272
273
|
(e) => {
|
|
273
|
-
const t = Math.round((e -
|
|
274
|
+
const t = Math.round((e - i) / (n - i) * 100);
|
|
274
275
|
return t < 0 ? 0 : t > 100 ? 100 : t;
|
|
275
276
|
},
|
|
276
|
-
[
|
|
277
|
-
)
|
|
277
|
+
[i, n]
|
|
278
|
+
), ne = () => {
|
|
279
|
+
R && O === !1 && X(!0);
|
|
280
|
+
}, se = () => {
|
|
281
|
+
j({ max: d, min: u }), R && Q(!1);
|
|
282
|
+
};
|
|
278
283
|
return F(() => {
|
|
279
|
-
if (
|
|
280
|
-
const e =
|
|
281
|
-
|
|
284
|
+
if (P.current) {
|
|
285
|
+
const e = V(u), t = V(parseInt(P.current.value, 10));
|
|
286
|
+
k.current && (k.current.style.left = `${e}%`, k.current.style.width = `${t - e}%`);
|
|
282
287
|
}
|
|
283
|
-
}, [u,
|
|
284
|
-
if (
|
|
285
|
-
const e =
|
|
286
|
-
if (
|
|
287
|
-
const
|
|
288
|
-
K.current.style.left = `calc(${
|
|
288
|
+
}, [u, V]), F(() => {
|
|
289
|
+
if (T.current) {
|
|
290
|
+
const e = V(parseInt(T.current.value, 10)), t = V(d);
|
|
291
|
+
if (k.current && (k.current.style.width = `${t - e}%`), K.current) {
|
|
292
|
+
const h = V(u) / 100;
|
|
293
|
+
K.current.style.left = `calc(${h * 100}% + ${(0.5 - h) * oe}px)`;
|
|
289
294
|
}
|
|
290
|
-
if (
|
|
291
|
-
const
|
|
292
|
-
|
|
295
|
+
if (C.current) {
|
|
296
|
+
const h = V(d) / 100;
|
|
297
|
+
C.current.style.left = `calc(${h * 100}% + ${(0.5 - h) * oe}px)`;
|
|
293
298
|
}
|
|
294
299
|
}
|
|
295
|
-
}, [u,
|
|
300
|
+
}, [u, d, V]), F(() => {
|
|
296
301
|
if (p) {
|
|
297
302
|
if (!isNaN(p.min) && p.min !== u) {
|
|
298
|
-
const e =
|
|
299
|
-
|
|
303
|
+
const e = B({ min: i, step: a, toCompare: d, value: p.min || i });
|
|
304
|
+
M(e), g(e);
|
|
300
305
|
}
|
|
301
|
-
if (!isNaN(p.max) && p.max !==
|
|
302
|
-
const e = L({
|
|
303
|
-
|
|
306
|
+
if (!isNaN(p.max) && p.max !== d) {
|
|
307
|
+
const e = L({ max: n, step: a, toCompare: u, value: p.max || n });
|
|
308
|
+
I(e), y(e);
|
|
304
309
|
}
|
|
305
310
|
}
|
|
306
|
-
}, [p]), /* @__PURE__ */
|
|
307
|
-
|
|
308
|
-
{
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
311
|
+
}, [p]), /* @__PURE__ */ s.jsxs(m, { position: "relative", ref: J, w: "100%", children: [
|
|
312
|
+
v && /* @__PURE__ */ s.jsx(ae, { as: "label", variant: "sm", children: v }),
|
|
313
|
+
/* @__PURE__ */ s.jsxs(m, { alignItems: "center", display: "flex", gap: "sm", children: [
|
|
314
|
+
(b === "inline" || b === "fields") && (b === "fields" ? /* @__PURE__ */ s.jsx(
|
|
315
|
+
W,
|
|
316
|
+
{
|
|
317
|
+
disabled: c,
|
|
318
|
+
max: d,
|
|
319
|
+
min: i,
|
|
320
|
+
onBlur: () => {
|
|
321
|
+
const e = B({
|
|
322
|
+
min: i,
|
|
323
|
+
step: a,
|
|
324
|
+
toCompare: d,
|
|
325
|
+
value: N
|
|
326
|
+
});
|
|
327
|
+
g(e), M(e), j({ max: d, min: e });
|
|
328
|
+
},
|
|
329
|
+
onChange: (e) => {
|
|
330
|
+
let t = parseInt(e.target.value, 10);
|
|
331
|
+
isNaN(t) && (t = 0), g(t);
|
|
332
|
+
},
|
|
333
|
+
onKeyDown: (e) => {
|
|
334
|
+
if (e.key === "Enter") {
|
|
335
|
+
const t = B({
|
|
336
|
+
min: i,
|
|
337
|
+
step: a,
|
|
338
|
+
toCompare: d,
|
|
339
|
+
value: N
|
|
340
|
+
});
|
|
341
|
+
g(t), M(t), j({ max: d, min: t });
|
|
342
|
+
}
|
|
343
|
+
},
|
|
344
|
+
size: "sm",
|
|
345
|
+
type: "number",
|
|
346
|
+
value: N.toString(),
|
|
347
|
+
w: 72
|
|
334
348
|
}
|
|
335
|
-
},
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
}
|
|
413
|
-
|
|
349
|
+
) : /* @__PURE__ */ s.jsx(m, { children: i })),
|
|
350
|
+
/* @__PURE__ */ s.jsxs(m, { flexGrow: "1", position: "relative", children: [
|
|
351
|
+
R && /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
352
|
+
/* @__PURE__ */ s.jsx(Y, { isVisible: A, ref: K, children: /* @__PURE__ */ s.jsx(Z, { children: u }) }),
|
|
353
|
+
/* @__PURE__ */ s.jsx(Y, { isVisible: O, ref: C, children: /* @__PURE__ */ s.jsx(Z, { children: d }) })
|
|
354
|
+
] }),
|
|
355
|
+
/* @__PURE__ */ s.jsxs(m, { h: 20, pb: "sm", position: "relative", pt: "sm", w: "100%", children: [
|
|
356
|
+
/* @__PURE__ */ s.jsx(
|
|
357
|
+
re,
|
|
358
|
+
{
|
|
359
|
+
...G,
|
|
360
|
+
borderSelectorColor: o,
|
|
361
|
+
disabled: c,
|
|
362
|
+
max: n,
|
|
363
|
+
min: i,
|
|
364
|
+
onChange: r,
|
|
365
|
+
onKeyDown: (e) => te(e, "min"),
|
|
366
|
+
onMouseDown: ne,
|
|
367
|
+
onMouseUp: se,
|
|
368
|
+
ref: T,
|
|
369
|
+
step: a,
|
|
370
|
+
type: "range",
|
|
371
|
+
value: u
|
|
372
|
+
}
|
|
373
|
+
),
|
|
374
|
+
/* @__PURE__ */ s.jsx(
|
|
375
|
+
re,
|
|
376
|
+
{
|
|
377
|
+
...G,
|
|
378
|
+
borderSelectorColor: o,
|
|
379
|
+
disabled: c,
|
|
380
|
+
max: n,
|
|
381
|
+
min: i,
|
|
382
|
+
onChange: f,
|
|
383
|
+
onKeyDown: (e) => te(e, "max"),
|
|
384
|
+
onMouseDown: ne,
|
|
385
|
+
onMouseUp: se,
|
|
386
|
+
ref: P,
|
|
387
|
+
step: a,
|
|
388
|
+
type: "range",
|
|
389
|
+
value: d
|
|
390
|
+
}
|
|
391
|
+
),
|
|
392
|
+
/* @__PURE__ */ s.jsx(pe, {}),
|
|
393
|
+
/* @__PURE__ */ s.jsx(me, { disabled: c, ref: k })
|
|
394
|
+
] }),
|
|
395
|
+
E && /* @__PURE__ */ s.jsx(m, { h: 24, ml: 10, mr: 10, position: "relative", children: E.reduce((e, t) => e.includes(t) ? e : [...e, t], []).filter((e) => e >= i && e <= n).map((e, t) => /* @__PURE__ */ s.jsx(ue, { left: `${V(e)}%`, children: /* @__PURE__ */ s.jsx(de, { children: e }) }, `${e}-${t}`)) })
|
|
396
|
+
] }),
|
|
397
|
+
(b === "inline" || b === "fields") && (b === "fields" ? /* @__PURE__ */ s.jsx(
|
|
398
|
+
W,
|
|
399
|
+
{
|
|
400
|
+
disabled: c,
|
|
401
|
+
max: n,
|
|
402
|
+
min: u + 1,
|
|
403
|
+
onBlur: () => {
|
|
404
|
+
const e = L({
|
|
405
|
+
max: n,
|
|
406
|
+
step: a,
|
|
407
|
+
toCompare: u,
|
|
408
|
+
value: w
|
|
409
|
+
});
|
|
410
|
+
y(e), I(e), j({ max: e, min: u });
|
|
411
|
+
},
|
|
412
|
+
onChange: (e) => {
|
|
413
|
+
let t = parseInt(e.target.value, 10);
|
|
414
|
+
isNaN(t) && (t = 0), y(t);
|
|
415
|
+
},
|
|
416
|
+
onKeyDown: (e) => {
|
|
417
|
+
if (e.key === "Enter") {
|
|
418
|
+
const t = L({
|
|
419
|
+
max: n,
|
|
420
|
+
step: a,
|
|
421
|
+
toCompare: u,
|
|
422
|
+
value: w
|
|
423
|
+
});
|
|
424
|
+
y(t), I(t), j({ max: t, min: u });
|
|
425
|
+
}
|
|
426
|
+
},
|
|
427
|
+
size: "sm",
|
|
428
|
+
type: "number",
|
|
429
|
+
value: w.toString(),
|
|
430
|
+
w: 72
|
|
414
431
|
}
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
w: 72
|
|
420
|
-
}
|
|
421
|
-
) : /* @__PURE__ */ r.createElement($, null, n))), g && /* @__PURE__ */ r.createElement(X, { color: "neutral-50", mt: 0 }, g));
|
|
432
|
+
) : /* @__PURE__ */ s.jsx(m, { children: n }))
|
|
433
|
+
] }),
|
|
434
|
+
x && /* @__PURE__ */ s.jsx(ee, { color: "neutral-50", mt: 0, children: x })
|
|
435
|
+
] });
|
|
422
436
|
}
|
|
423
|
-
),
|
|
437
|
+
), be = 20, q = (o, c) => Math.round(o / c) * c, U = (o, c, x, v) => (o = q(o, v), o < c ? c : o > x ? x : o), fe = le(
|
|
424
438
|
({
|
|
425
439
|
borderSelectorColor: o = "neutral-10",
|
|
426
440
|
disabled: c,
|
|
427
|
-
hint:
|
|
428
|
-
label:
|
|
441
|
+
hint: x,
|
|
442
|
+
label: v,
|
|
429
443
|
max: n,
|
|
430
|
-
min:
|
|
431
|
-
onChange:
|
|
432
|
-
step:
|
|
433
|
-
tooltip:
|
|
434
|
-
type:
|
|
444
|
+
min: i,
|
|
445
|
+
onChange: j,
|
|
446
|
+
step: a = 1,
|
|
447
|
+
tooltip: R,
|
|
448
|
+
type: b,
|
|
435
449
|
value: p,
|
|
436
|
-
values:
|
|
450
|
+
values: E,
|
|
437
451
|
...G
|
|
438
|
-
},
|
|
439
|
-
const u = S(null),
|
|
440
|
-
|
|
441
|
-
},
|
|
442
|
-
|
|
443
|
-
let f =
|
|
444
|
-
|
|
445
|
-
},
|
|
446
|
-
let f = parseInt(
|
|
447
|
-
isNaN(f) && (f = 0),
|
|
452
|
+
}, J) => {
|
|
453
|
+
const u = S(null), M = S(null), [d, I] = D(!1), [N, g] = D(U(p, i, n, a)), [w, y] = D(U(p, i, n, a)), T = (r) => {
|
|
454
|
+
r = q(r, a), y(r);
|
|
455
|
+
}, P = (r) => {
|
|
456
|
+
r.preventDefault();
|
|
457
|
+
let f = w;
|
|
458
|
+
r.key === "ArrowRight" && (f = U(f + a, i, n, a)), r.key === "ArrowLeft" && (f = U(f - a, i, n, a)), y(f), g(f), j(f);
|
|
459
|
+
}, k = (r) => {
|
|
460
|
+
let f = parseInt(r.target.value, 10);
|
|
461
|
+
isNaN(f) && (f = 0), g(f);
|
|
448
462
|
}, K = () => {
|
|
449
|
-
const
|
|
450
|
-
|
|
451
|
-
},
|
|
452
|
-
|
|
453
|
-
},
|
|
454
|
-
(
|
|
455
|
-
[
|
|
456
|
-
)
|
|
463
|
+
const r = U(N, i, n, a);
|
|
464
|
+
g(r), y(r), j(r);
|
|
465
|
+
}, C = (r) => {
|
|
466
|
+
r.key === "Enter" && K();
|
|
467
|
+
}, A = ie(
|
|
468
|
+
(r) => Math.round((r - i) / (n - i) * 100),
|
|
469
|
+
[i, n]
|
|
470
|
+
), Q = (r) => {
|
|
471
|
+
const f = parseInt(r.target.value, 10);
|
|
472
|
+
T(f), g(f);
|
|
473
|
+
}, O = () => {
|
|
474
|
+
R && d === !1 && I(!0);
|
|
475
|
+
}, X = () => {
|
|
476
|
+
j(w), R && I(!1);
|
|
477
|
+
};
|
|
457
478
|
return F(() => {
|
|
458
|
-
if (u.current && (u.current.style.backgroundSize = `${
|
|
459
|
-
const
|
|
460
|
-
|
|
479
|
+
if (u.current && (u.current.style.backgroundSize = `${A(w)}% 100%`), M.current) {
|
|
480
|
+
const r = A(w) / 100;
|
|
481
|
+
M.current.style.left = `calc(${r * 100}% + ${(0.5 - r) * be}px)`;
|
|
461
482
|
}
|
|
462
|
-
}, [
|
|
463
|
-
!isNaN(p) && p !==
|
|
464
|
-
}, [p]), /* @__PURE__ */
|
|
465
|
-
|
|
466
|
-
{
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
483
|
+
}, [w, A]), F(() => {
|
|
484
|
+
!isNaN(p) && p !== w && p && (T(p), g(p));
|
|
485
|
+
}, [p]), /* @__PURE__ */ s.jsxs(m, { display: "flex", flexDirection: "column", position: "relative", ref: J, children: [
|
|
486
|
+
v && /* @__PURE__ */ s.jsx(ae, { as: "label", variant: "sm", children: v }),
|
|
487
|
+
/* @__PURE__ */ s.jsxs(m, { alignItems: "center", display: "flex", gap: "sm", children: [
|
|
488
|
+
(b === "inline" || b === "left-field") && (b === "left-field" ? /* @__PURE__ */ s.jsx(
|
|
489
|
+
W,
|
|
490
|
+
{
|
|
491
|
+
disabled: c,
|
|
492
|
+
max: n,
|
|
493
|
+
min: i,
|
|
494
|
+
onBlur: K,
|
|
495
|
+
onChange: k,
|
|
496
|
+
onKeyDown: C,
|
|
497
|
+
size: "sm",
|
|
498
|
+
type: "number",
|
|
499
|
+
value: N.toString(),
|
|
500
|
+
w: 72
|
|
501
|
+
}
|
|
502
|
+
) : /* @__PURE__ */ s.jsx(m, { children: i })),
|
|
503
|
+
/* @__PURE__ */ s.jsxs(m, { display: "flex", flexDirection: "column", flexGrow: "1", h: 20, position: "relative", children: [
|
|
504
|
+
/* @__PURE__ */ s.jsx(
|
|
505
|
+
he,
|
|
506
|
+
{
|
|
507
|
+
borderSelectorColor: o,
|
|
508
|
+
disabled: c,
|
|
509
|
+
list: "tickmarks",
|
|
510
|
+
max: n,
|
|
511
|
+
min: i,
|
|
512
|
+
onChange: Q,
|
|
513
|
+
onKeyDown: P,
|
|
514
|
+
onMouseDown: O,
|
|
515
|
+
onMouseUp: X,
|
|
516
|
+
ref: u,
|
|
517
|
+
step: a,
|
|
518
|
+
type: "range",
|
|
519
|
+
value: w,
|
|
520
|
+
...G
|
|
521
|
+
}
|
|
522
|
+
),
|
|
523
|
+
R && /* @__PURE__ */ s.jsx(Y, { isVisible: d, ref: M, children: /* @__PURE__ */ s.jsx(Z, { children: w }) }),
|
|
524
|
+
E && /* @__PURE__ */ s.jsx(m, { h: 24, ml: 10, mr: 10, mt: 5, position: "relative", children: E.reduce((r, f) => r.includes(f) ? r : [...r, f], []).filter((r) => r >= i && r <= n).map((r, f) => /* @__PURE__ */ s.jsx(ue, { left: `${A(r)}%`, children: /* @__PURE__ */ s.jsx(de, { children: r }) }, `${r}-${f}`)) })
|
|
525
|
+
] }),
|
|
526
|
+
(b === "inline" || b === "right-field") && (b === "right-field" ? /* @__PURE__ */ s.jsx(
|
|
527
|
+
W,
|
|
528
|
+
{
|
|
529
|
+
disabled: c,
|
|
530
|
+
max: n,
|
|
531
|
+
min: i,
|
|
532
|
+
onBlur: K,
|
|
533
|
+
onChange: k,
|
|
534
|
+
onKeyDown: C,
|
|
535
|
+
size: "sm",
|
|
536
|
+
type: "number",
|
|
537
|
+
value: N.toString(),
|
|
538
|
+
w: 72
|
|
539
|
+
}
|
|
540
|
+
) : /* @__PURE__ */ s.jsx(m, { children: n }))
|
|
541
|
+
] }),
|
|
542
|
+
x && /* @__PURE__ */ s.jsx(ee, { color: "neutral-50", mt: 0, children: x })
|
|
543
|
+
] });
|
|
521
544
|
}
|
|
522
545
|
);
|
|
523
|
-
|
|
524
|
-
const
|
|
546
|
+
fe.displayName = "Slider";
|
|
547
|
+
const Ve = Object.assign(fe, { Range: $e });
|
|
525
548
|
export {
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
549
|
+
Ve as Slider,
|
|
550
|
+
fe as SliderComponent,
|
|
551
|
+
U as ensureMinMax,
|
|
552
|
+
q as round,
|
|
553
|
+
be as thumbWidth
|
|
531
554
|
};
|