@konstructio/ui 0.1.2-alpha.103 → 0.1.2-alpha.104
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/README.md +15 -21
- package/dist/{AdditionalOptions-Cj29eeMF.js → AdditionalOptions-D0BAS2HG.js} +1 -1
- package/dist/{AlertDialogTrigger-CgcsW_ta.js → AlertDialogTrigger-BGo_acd5.js} +3 -3
- package/dist/{Checkbox-DzAx7n67.js → Checkbox-B_ngk9Dj.js} +56 -56
- package/dist/{Combination-cjXRJS03.js → Combination-CnMM05mt.js} +51 -45
- package/dist/{CommandInput-BnvRMfLI.js → CommandInput-BLq69pOT.js} +1 -1
- package/dist/Counter-BV680M5r.js +195 -0
- package/dist/DropdownButton-DfNojmCW.js +493 -0
- package/dist/{FlagSelectorList-BoYG-_It.js → FlagSelectorList-CkTR3j6O.js} +222 -218
- package/dist/{HamburgerTrigger-1vOTrm8-.js → HamburgerTrigger-DRylBL2d.js} +1 -1
- package/dist/{ImageUpload-DZTm4SBB.js → ImageUpload-DiwymQcU.js} +1 -1
- package/dist/{Input-CW0VwW2T.js → Input-Cf44DzfE.js} +18 -18
- package/dist/{Loading-fD0Xiyeq.js → Loading-DUh9PMJN.js} +3 -1
- package/dist/Modal-Dyn088X7.js +81 -0
- package/dist/Sidebar.css +1 -1
- package/dist/{Spinner-Lw9mZYhg.js → Spinner-CUwE2bLm.js} +1 -1
- package/dist/{Switch-WBRr8uOJ.js → Switch-aPhL5rNG.js} +4 -4
- package/dist/{Toast-ByH-l4XK.js → Toast-3NEz7LLa.js} +149 -148
- package/dist/Wrapper-BhqUVI1G.js +171 -0
- package/dist/Wrapper-CVJSuYWx.js +114 -0
- package/dist/{Wrapper-XeeD3av7.js → Wrapper-DP6Sxngx.js} +185 -180
- package/dist/components/Alert/Alert.js +21 -21
- package/dist/components/AlertDialog/AlertDialog.js +1 -1
- package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
- package/dist/components/AlertDialog/components/index.js +1 -1
- package/dist/components/AlertDialog/hooks/useAlertDialog.js +14 -10
- package/dist/components/Autocomplete/components/List/List.js +22 -26
- package/dist/components/Autocomplete/components/List/List.variants.js +7 -19
- package/dist/components/Autocomplete/hooks/useAutocomplete.js +39 -38
- package/dist/components/Autocomplete/hooks/useNavigationList.js +2 -1
- package/dist/components/Badge/Badge.js +37 -36
- package/dist/components/Button/Button.js +1 -1
- package/dist/components/Checkbox/Checkbox.js +1 -1
- package/dist/components/Command/Command.js +2 -2
- package/dist/components/Command/components/Command.js +6 -6
- package/dist/components/Command/components/CommandEmpty.js +1 -1
- package/dist/components/Command/components/CommandGroup.js +1 -1
- package/dist/components/Command/components/CommandInput.js +1 -1
- package/dist/components/Command/components/CommandItem.js +1 -1
- package/dist/components/Command/components/CommandList.js +2 -2
- package/dist/components/Command/components/CommandSeparator.js +1 -1
- package/dist/components/Command/components/DialogContent.js +2 -2
- package/dist/components/Command/components/DialogOverlay.js +1 -1
- package/dist/components/Command/components/index.js +1 -1
- package/dist/components/Command/contexts/Command.provider.js +16 -12
- package/dist/components/Counter/Counter.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/components/CalendarMonth/CalendarMonth.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/components/IndependentModeCalendar/IndependentModeCalendar.js +57 -58
- package/dist/components/DateRangePicker/components/CalendarPanel/components/TogetherModeCalendar/TogetherModeCalendar.js +42 -43
- package/dist/components/DateRangePicker/components/CalendarPanel/constants/dayPickerClassNames.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/constants/index.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/hooks/index.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/hooks/useIndependentCarousel.js +42 -50
- package/dist/components/DateRangePicker/components/CalendarPanel/hooks/useTogetherCarousel.js +61 -79
- package/dist/components/DateRangePicker/components/CalendarPanel/utils/index.js +1 -1
- package/dist/components/DateRangePicker/components/DateTimeInputs/components/EndInputFields/EndInputFields.js +1 -1
- package/dist/components/DateRangePicker/components/DateTimeInputs/components/StartInputFields/StartInputFields.js +1 -1
- package/dist/components/DateRangePicker/components/DateTimeInputs/hooks/useDateTimeInputs.js +89 -122
- package/dist/components/Datepicker/DatePicker.js +13 -13
- package/dist/components/Drawer/Drawer.js +54 -49
- package/dist/components/Drawer/hooks/useDrawer.js +39 -44
- package/dist/components/DropdownButton/DropdownButton.js +1 -1
- package/dist/components/Filter/Filter.js +23 -22
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.hook.js +42 -56
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +1 -1
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.hook.js +30 -43
- package/dist/components/Filter/components/DateRangeFilterDropdown/DateRangeFilterDropdown.hook.js +36 -49
- package/dist/components/Filter/components/FilterDropdown/FilterDropdown.js +1 -1
- package/dist/components/Filter/components/ResetButton/ResetButton.js +21 -18
- package/dist/components/Filter/components/TextMultiSelect/TextMultiSelect.js +1 -1
- package/dist/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.hook.js +31 -45
- package/dist/components/Filter/contexts/filter.provider.js +15 -10
- package/dist/components/Filter/events/index.js +26 -5
- package/dist/components/Filter/hooks/index.js +4 -0
- package/dist/components/Filter/hooks/useFilterDropdownSync.js +26 -0
- package/dist/components/ImageUpload/ImageUpload.js +1 -1
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/Loading/Loading.js +1 -1
- package/dist/components/Modal/Modal.js +1 -1
- package/dist/components/Modal/components/Body/Body.js +1 -1
- package/dist/components/Modal/components/Footer/Footer.js +1 -1
- package/dist/components/Modal/components/Header/Header.js +1 -1
- package/dist/components/Modal/components/Wrapper/Wrapper.js +1 -1
- package/dist/components/Modal/components/index.js +1 -1
- package/dist/components/Modal/contexts/Modal.provider.js +26 -19
- package/dist/components/MultiSelectDropdown/MultiSelectDropdown.js +1 -1
- package/dist/components/MultiSelectDropdown/components/List/List.js +1 -1
- package/dist/components/MultiSelectDropdown/components/Wrapper/Wrapper.js +1 -1
- package/dist/components/MultiSelectDropdown/components/index.js +1 -1
- package/dist/components/MultiSelectDropdown/hooks/useMultiSelectDropdown.js +14 -13
- package/dist/components/PhoneNumberInput/PhoneNumberInput.js +1 -1
- package/dist/components/PhoneNumberInput/components/FlagContent/FlagContent.js +6 -4
- package/dist/components/PhoneNumberInput/components/FlagSelectorList/FlagSelectorList.js +1 -1
- package/dist/components/PhoneNumberInput/components/FlagSelectorWrapper/FlagSelectorWrapper.js +16 -16
- package/dist/components/PhoneNumberInput/components/TruncateText/TruncateText.js +1 -1
- package/dist/components/PhoneNumberInput/components/Wrapper.js +1 -1
- package/dist/components/PhoneNumberInput/components/index.js +2 -2
- package/dist/components/PieChart/PieChart.js +33 -32
- package/dist/components/ProgressBar/ProgressBar.js +26 -20
- package/dist/components/Radio/Radio.js +28 -30
- package/dist/components/RadioCardGroup/RadioCardGroup.js +18 -18
- package/dist/components/RadioGroup/RadioGroup.js +24 -24
- package/dist/components/Range/Range.js +15 -13
- package/dist/components/Select/Select.js +2 -2
- package/dist/components/Select/components/AdditionalOptions/AdditionalOptions.js +1 -1
- package/dist/components/Select/components/List/List.js +2 -2
- package/dist/components/Select/components/ListItem/ListItem.js +30 -30
- package/dist/components/Select/components/Wrapper.js +1 -1
- package/dist/components/Select/components/index.js +2 -2
- package/dist/components/Select/hooks/useSelect.js +39 -38
- package/dist/components/Sidebar/Sidebar.js +21 -18
- package/dist/components/Sidebar/components/CollapseTrigger/CollapseTrigger.js +30 -0
- package/dist/components/Sidebar/components/CollapseTrigger/CollapseTrigger.variants.js +20 -0
- package/dist/components/Sidebar/components/HamburgerTrigger/HamburgerTrigger.js +1 -1
- package/dist/components/Sidebar/components/Logo/Logo.js +14 -10
- package/dist/components/Sidebar/components/Logo/Logo.variants.js +14 -4
- package/dist/components/Sidebar/components/NavigationOption/NavigationOption.js +41 -37
- package/dist/components/Sidebar/components/NavigationOption/NavigationOption.variants.js +4 -5
- package/dist/components/Sidebar/components/Wrapper/Wrapper.js +75 -68
- package/dist/components/Sidebar/components/index.js +17 -15
- package/dist/components/Sidebar/contexts/SidebarContext.js +8 -5
- package/dist/components/Slider/Slider.js +17 -15
- package/dist/components/Spinner/Spinner.js +1 -1
- package/dist/components/Stepper/Stepper.variants.js +6 -6
- package/dist/components/Stepper/hooks/useStepItemLogic.js +12 -17
- package/dist/components/Switch/Switch.js +1 -1
- package/dist/components/Table/components/Filter.js +1 -1
- package/dist/components/Tabs/Tabs.js +1 -1
- package/dist/components/Tabs/Tabs.variants.js +1 -1
- package/dist/components/Tabs/components/Content.js +1 -1
- package/dist/components/Tabs/components/List.js +1 -1
- package/dist/components/Tabs/components/Trigger.js +1 -1
- package/dist/components/Tag/Tag.js +1 -1
- package/dist/components/Tag/Tag.variants.js +17 -17
- package/dist/components/TagSelect/TagSelect.js +1 -1
- package/dist/components/TagSelect/components/Wrapper/Wrapper.js +1 -1
- package/dist/components/TagSelect/components/index.js +1 -1
- package/dist/components/TagSelect/hooks/useTagSelect.js +12 -11
- package/dist/components/TimePicker/components/HoursList/HoursList.js +34 -38
- package/dist/components/TimePicker/components/MeridianList/MeridianList.js +25 -29
- package/dist/components/TimePicker/components/MinutesList/MinutesList.js +33 -33
- package/dist/components/TimePicker/components/Wrapper/Wrapper.js +91 -99
- package/dist/components/TimePicker/components/WrapperList/WrapperList.js +29 -30
- package/dist/components/TimePicker/contexts/time-picker.provider.js +10 -10
- package/dist/components/Toast/Toast.js +1 -1
- package/dist/components/Toast/Toast.variants.js +1 -1
- package/dist/components/Tooltip/Tooltip.js +1 -1
- package/dist/components/VirtualizedTable/VirtualizedTable.js +32 -29
- package/dist/components/VirtualizedTable/components/Actions/Actions.js +0 -2
- package/dist/components/VirtualizedTable/components/Body/Body.js +5 -5
- package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +1 -1
- package/dist/components/VirtualizedTable/components/Filter/Filter.js +55 -53
- package/dist/components/VirtualizedTable/components/FormPaginate/FormPaginate.js +1 -1
- package/dist/components/VirtualizedTable/components/Header/Header.js +1 -1
- package/dist/components/VirtualizedTable/contexts/index.js +1 -1
- package/dist/components/VirtualizedTable/contexts/table.provider.js +1 -1
- package/dist/components/VirtualizedTable/events/filters/filters.js +7 -0
- package/dist/components/VirtualizedTable/events/index.js +10 -25
- package/dist/components/VirtualizedTable/events/refresh/refresh.js +7 -0
- package/dist/components/VirtualizedTable/events/row/row.js +22 -0
- package/dist/components/VirtualizedTable/utils/get-table-id.js +4 -0
- package/dist/components/VirtualizedTable/utils/index.js +4 -2
- package/dist/components/index.js +95 -89
- package/dist/{components-BIHlj4yH.js → components-Cf345jTv.js} +45 -41
- package/dist/constants-CxJJRVK3.js +31 -0
- package/dist/{dist-DISvWx7U.js → dist-BUocnzkM.js} +1 -1
- package/dist/{dist-Dse3gSmZ.js → dist-BZNE2Tnx.js} +4 -4
- package/dist/{dist-2bGlmy8N2.js → dist-BaPW7qXd2.js} +27 -26
- package/dist/dist-BdobXn93.js +192 -0
- package/dist/dist-BlPTJNIm.js +118 -0
- package/dist/{dist-BiJrNvNo.js → dist-C3YVLapk.js} +29 -28
- package/dist/dist-C4j75TwZ.js +20 -0
- package/dist/dist-CCdbu9GU.js +46 -0
- package/dist/dist-CzKqHuqJ2.js +427 -0
- package/dist/dist-D-yS0HN8.js +228 -0
- package/dist/dist-D5XYRjmR.js +15 -0
- package/dist/dist-DDck_2lb.js +451 -0
- package/dist/{dist-C2aTw0m62.js → dist-DFCz63oC2.js} +5 -5
- package/dist/dist-DGOjiAnB2.js +14 -0
- package/dist/dist-DKryKPmP.js +193 -0
- package/dist/{dist-CTvBzxW8.js → dist-DX0sBG3Q.js} +1 -1
- package/dist/dist-DYIabsrY.js +17 -0
- package/dist/dist-pWlMx4Fi2.js +36 -0
- package/dist/{dist-CVDFmWf2.js → dist-tGUUcv8n.js} +17 -16
- package/dist/dist-xCbHbMLA.js +116 -0
- package/dist/{es2015-BWf6xQHm.js → es2015-CoHq2g4y.js} +95 -86
- package/dist/es2015-DigR3dar.js +795 -0
- package/dist/events.types-BG1Uh8i6.js +6 -0
- package/dist/hooks/index.js +6 -4
- package/dist/hooks/useClickOutside.js +14 -0
- package/dist/index.js +146 -138
- package/dist/lib/components/Autocomplete/components/List/List.variants.d.ts +0 -1
- package/dist/lib/components/DropdownButton/DropdownButton.d.ts +5 -6
- package/dist/lib/components/DropdownButton/DropdownButton.types.d.ts +2 -0
- package/dist/lib/components/Filter/Filter.types.d.ts +2 -0
- package/dist/lib/components/Filter/contexts/filter.context.d.ts +1 -0
- package/dist/lib/components/Filter/events/index.d.ts +10 -2
- package/dist/lib/components/Filter/hooks/index.d.ts +1 -0
- package/dist/lib/components/Filter/hooks/useFilterDropdownSync.d.ts +2 -0
- package/dist/lib/components/Filter/hooks/useFilterDropdownSync.types.d.ts +5 -0
- package/dist/lib/components/PieChart/PieChart.types.d.ts +4 -4
- package/dist/lib/components/ProgressBar/ProgressBar.types.d.ts +2 -0
- package/dist/lib/components/Select/hooks/useSelect.d.ts +2 -1
- package/dist/lib/components/Sidebar/Sidebar.d.ts +2 -2
- package/dist/lib/components/Sidebar/Sidebar.types.d.ts +6 -5
- package/dist/lib/components/Sidebar/components/CollapseTrigger/CollapseTrigger.d.ts +4 -0
- package/dist/lib/components/Sidebar/components/CollapseTrigger/CollapseTrigger.types.d.ts +4 -0
- package/dist/lib/components/Sidebar/components/CollapseTrigger/CollapseTrigger.variants.d.ts +1 -0
- package/dist/lib/components/Sidebar/components/Logo/Logo.types.d.ts +8 -0
- package/dist/lib/components/Sidebar/components/Logo/Logo.variants.d.ts +3 -1
- package/dist/lib/components/Sidebar/components/index.d.ts +2 -0
- package/dist/lib/components/Sidebar/contexts/SidebarContext.d.ts +12 -0
- package/dist/lib/components/VirtualizedTable/VirtualizedTable.d.ts +1 -0
- package/dist/lib/components/VirtualizedTable/events/events.types.d.ts +11 -0
- package/dist/lib/components/VirtualizedTable/events/filters/filters.d.ts +1 -0
- package/dist/lib/components/VirtualizedTable/events/index.d.ts +4 -14
- package/dist/lib/components/VirtualizedTable/events/refresh/refresh.d.ts +2 -0
- package/dist/lib/components/VirtualizedTable/events/refresh/refresh.types.d.ts +3 -0
- package/dist/lib/components/VirtualizedTable/events/row/row.d.ts +3 -0
- package/dist/lib/components/VirtualizedTable/utils/get-table-id.d.ts +1 -0
- package/dist/lib/components/VirtualizedTable/utils/index.d.ts +1 -0
- package/dist/lib/components/index.d.ts +2 -2
- package/dist/lib/hooks/index.d.ts +1 -0
- package/dist/lib/hooks/useClickOutside.d.ts +2 -0
- package/dist/package.json +24 -24
- package/dist/styles.css +1 -1
- package/dist/{table.provider-2sAkE7z_.js → table.provider-B0BafHuU.js} +395 -381
- package/dist/ui/civo-theme.css +4 -0
- package/dist/ui/kubefirst-theme.css +4 -0
- package/package.json +24 -24
- package/dist/Counter-CY0xGnVM.js +0 -208
- package/dist/DropdownButton-DnlwdPmb.js +0 -92
- package/dist/Modal-Bfzggwlr.js +0 -76
- package/dist/Wrapper-ClJ_Mham.js +0 -110
- package/dist/Wrapper-DNEn4fef.js +0 -161
- package/dist/constants-DXrF9vV4.js +0 -31
- package/dist/dist-B-Aoze_D.js +0 -10
- package/dist/dist-BuFiu480.js +0 -13
- package/dist/dist-C2s4VX-42.js +0 -31
- package/dist/dist-CT6d9xe7.js +0 -441
- package/dist/dist-CVy-ulDZ.js +0 -42
- package/dist/dist-D4FePjTS.js +0 -194
- package/dist/dist-Db6UeFo4.js +0 -291
- package/dist/dist-DqKFpce5.js +0 -98
- package/dist/dist-j7FOUrFU.js +0 -206
- package/dist/dist-l-aDnQZC.js +0 -62
- package/dist/dist-ppXKUlVt.js +0 -10
- /package/dist/{x-a_LpoXzG.js → x-a_LpoXzG2.js} +0 -0
package/dist/Wrapper-DNEn4fef.js
DELETED
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
import { t as r } from "./utils-Cx-WzRZF.js";
|
|
2
|
-
import { LoaderIcon as re } from "./assets/icons/components/Loader.js";
|
|
3
|
-
import { t as le } from "./createLucideIcon-MbzNWCaI.js";
|
|
4
|
-
import { t as ne } from "./chevron-up-Bjpvg6ui.js";
|
|
5
|
-
import { Typography as se } from "./components/Typography/Typography.js";
|
|
6
|
-
import { useSelectContext as oe } from "./components/Select/contexts/select.hook.js";
|
|
7
|
-
import { List as ie } from "./components/Select/components/List/List.js";
|
|
8
|
-
import { inputVariants as ce, labelVariants as me, selectVariants as pe } from "./components/Select/Select.variants.js";
|
|
9
|
-
import { useSelect as ue } from "./components/Select/hooks/useSelect.js";
|
|
10
|
-
import { forwardRef as fe, useEffect as de, useId as xe, useImperativeHandle as he, useMemo as ve, useRef as w } from "react";
|
|
11
|
-
import { jsx as l, jsxs as o } from "react/jsx-runtime";
|
|
12
|
-
var Ne = [["path", {
|
|
13
|
-
d: "m21 21-4.34-4.34",
|
|
14
|
-
key: "14j7rj"
|
|
15
|
-
}], ["circle", {
|
|
16
|
-
cx: "11",
|
|
17
|
-
cy: "11",
|
|
18
|
-
r: "8",
|
|
19
|
-
key: "4ej97u"
|
|
20
|
-
}]], Ce = le("search", Ne), Re = fe(({ additionalOptions: z, className: O, defaultValue: x, disabled: t = !1, error: f, groupedOptions: R, iconClassName: F, inputClassName: S, isInfiniteScrollEnabled: T = !1, isLoading: g, isRequired: h, label: v, labelAction: E, labelClassName: M, labelWrapperClassName: W, listClassName: _, listItemClassName: $, listItemSecondRowClassName: H, name: d, noOptionsText: P, placeholder: N, searchable: k = !1, showSearchIcon: C, theme: U, visibleItems: q, wrapperClassName: A, onFetchMoreOptions: B, onBlur: D, onSearchChange: G, ...y }, J) => {
|
|
21
|
-
const I = xe(), i = w(null), j = w(null), K = w(0), { isOpen: c, options: n, searchTerm: Q, value: s, setCanFilter: X, setSearchTerm: Y, setValue: m, toggleOpen: Z } = oe(), e = ve(() => n.find(({ value: a }) => a === s), [n, s]), { wrapperRef: ee, wrapperInputRef: L, handleOpen: V } = ue({
|
|
22
|
-
ulRef: j,
|
|
23
|
-
inputRef: i,
|
|
24
|
-
disabled: t,
|
|
25
|
-
internalValue: e,
|
|
26
|
-
onBlur: D
|
|
27
|
-
}), p = d ? `${I}-${d}` : I;
|
|
28
|
-
he(J, () => i.current, [i]), de(() => {
|
|
29
|
-
if (x && !s) {
|
|
30
|
-
const a = n && n.find((u) => u.value === x);
|
|
31
|
-
a && m(a.value);
|
|
32
|
-
}
|
|
33
|
-
}, [
|
|
34
|
-
x,
|
|
35
|
-
n,
|
|
36
|
-
m,
|
|
37
|
-
s
|
|
38
|
-
]);
|
|
39
|
-
const te = (a) => {
|
|
40
|
-
const u = a.target.value;
|
|
41
|
-
X(!0), m(""), Y(u ?? ""), G?.(u);
|
|
42
|
-
const b = n.find((ae) => ae.value.toLocaleLowerCase() === u.toLocaleLowerCase());
|
|
43
|
-
m(b ? b.value : e?.value ?? "");
|
|
44
|
-
};
|
|
45
|
-
return /* @__PURE__ */ o("div", {
|
|
46
|
-
ref: ee,
|
|
47
|
-
className: r("flex flex-col gap-2 w-full relative", A),
|
|
48
|
-
"data-theme": U,
|
|
49
|
-
children: [
|
|
50
|
-
v ? /* @__PURE__ */ o("div", {
|
|
51
|
-
className: r("flex items-center justify-between", W),
|
|
52
|
-
children: [/* @__PURE__ */ o("label", {
|
|
53
|
-
id: p,
|
|
54
|
-
className: r(me({ className: M })),
|
|
55
|
-
htmlFor: p,
|
|
56
|
-
onClick: () => !t && V(),
|
|
57
|
-
children: [v, h && /* @__PURE__ */ l("span", {
|
|
58
|
-
className: "text-red-600 dark:text-red-500 ml-1",
|
|
59
|
-
children: "*"
|
|
60
|
-
})]
|
|
61
|
-
}), E]
|
|
62
|
-
}) : null,
|
|
63
|
-
/* @__PURE__ */ o("div", {
|
|
64
|
-
ref: L,
|
|
65
|
-
id: p,
|
|
66
|
-
className: r(pe({
|
|
67
|
-
className: O,
|
|
68
|
-
hasError: !!f,
|
|
69
|
-
disabled: t
|
|
70
|
-
})),
|
|
71
|
-
role: "combobox",
|
|
72
|
-
onClick: () => !t && Z(!c),
|
|
73
|
-
"aria-expanded": c,
|
|
74
|
-
tabIndex: K.current,
|
|
75
|
-
"aria-labelledby": p,
|
|
76
|
-
children: [/* @__PURE__ */ o("div", {
|
|
77
|
-
className: "flex gap-2.5 items-center flex-1",
|
|
78
|
-
children: [
|
|
79
|
-
e?.leftIcon && !C && /* @__PURE__ */ l("span", {
|
|
80
|
-
className: "w-4 h-4 flex justify-center items-center dark:text-metal-50",
|
|
81
|
-
children: e.leftIcon
|
|
82
|
-
}),
|
|
83
|
-
C && /* @__PURE__ */ l(Ce, { className: r("w-4", "h-4", "text-zinc-500", "select-none", "transition-colors", "duration-300", "dark:text-metal-300", "dark:group-focus-within:text-metal-50") }),
|
|
84
|
-
k ? /* @__PURE__ */ l("input", {
|
|
85
|
-
type: "text",
|
|
86
|
-
value: c ? Q : e?.label ?? s ?? "",
|
|
87
|
-
onChange: te,
|
|
88
|
-
placeholder: N,
|
|
89
|
-
className: r(ce({ className: S }), { "text-red-700 placeholder:text-red-700": !!f }),
|
|
90
|
-
onClick: (a) => {
|
|
91
|
-
a.stopPropagation(), t || V();
|
|
92
|
-
},
|
|
93
|
-
"aria-label": v || N,
|
|
94
|
-
"aria-labelledby": p,
|
|
95
|
-
required: h,
|
|
96
|
-
autoComplete: "off",
|
|
97
|
-
autoCapitalize: "words",
|
|
98
|
-
disabled: t,
|
|
99
|
-
tabIndex: -1,
|
|
100
|
-
...y
|
|
101
|
-
}) : /* @__PURE__ */ o(se, {
|
|
102
|
-
variant: "body2",
|
|
103
|
-
className: r("flex-1 text-zinc-400 text-sm dark:text-metal-400 flex gap-2 items-center", {
|
|
104
|
-
"text-red-700": !!f,
|
|
105
|
-
"select-none": !e,
|
|
106
|
-
"text-metal-800 dark:text-metal-50": e,
|
|
107
|
-
"text-metal-400/50 dark:text-metal-50/50": t
|
|
108
|
-
}, e?.wrapperClassNameOnSelectedValue),
|
|
109
|
-
children: [
|
|
110
|
-
e?.label || N,
|
|
111
|
-
" ",
|
|
112
|
-
e?.showRightComponentOnselectedValue ? e?.rightComponent : null
|
|
113
|
-
]
|
|
114
|
-
})
|
|
115
|
-
]
|
|
116
|
-
}), g ? /* @__PURE__ */ l(re, {
|
|
117
|
-
size: 16,
|
|
118
|
-
className: "text-metal-400 animate-spin select-none"
|
|
119
|
-
}) : !C && /* @__PURE__ */ l(ne, {
|
|
120
|
-
"data-state": c ? "open" : "closed",
|
|
121
|
-
className: r("w-4 h-4 text-zinc-500 transition-all duration-100 data-[state=open]:rotate-0 data-[state=closed]:rotate-180 select-none dark:group-focus-within:text-metal-50", F, {
|
|
122
|
-
"text-red-700": !!f,
|
|
123
|
-
"text-metal-400/50 dark:group-focus-within:text-zinc-500": t
|
|
124
|
-
})
|
|
125
|
-
})]
|
|
126
|
-
}),
|
|
127
|
-
/* @__PURE__ */ l("input", {
|
|
128
|
-
ref: i,
|
|
129
|
-
type: "text",
|
|
130
|
-
name: d,
|
|
131
|
-
className: "hidden",
|
|
132
|
-
"aria-hidden": "true",
|
|
133
|
-
required: h,
|
|
134
|
-
inert: !0,
|
|
135
|
-
defaultValue: e?.value ?? s ?? void 0,
|
|
136
|
-
...y
|
|
137
|
-
}),
|
|
138
|
-
c && /* @__PURE__ */ l(ie, {
|
|
139
|
-
ref: j,
|
|
140
|
-
additionalOptions: z,
|
|
141
|
-
className: _,
|
|
142
|
-
groupedOptions: R,
|
|
143
|
-
itemClassName: $,
|
|
144
|
-
name: d,
|
|
145
|
-
wrapperInputRef: L,
|
|
146
|
-
inputRef: i,
|
|
147
|
-
options: n,
|
|
148
|
-
isLoading: !!g,
|
|
149
|
-
searchable: k,
|
|
150
|
-
listItemSecondRowClassName: H,
|
|
151
|
-
isInfiniteScrollEnabled: T,
|
|
152
|
-
onFetchMoreOptions: B,
|
|
153
|
-
noOptionsText: P,
|
|
154
|
-
visibleItems: q
|
|
155
|
-
})
|
|
156
|
-
]
|
|
157
|
-
});
|
|
158
|
-
});
|
|
159
|
-
export {
|
|
160
|
-
Re as t
|
|
161
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { t } from "./utils-Cx-WzRZF.js";
|
|
2
|
-
var o = (e) => ({
|
|
3
|
-
root: t("w-fit", e?.root),
|
|
4
|
-
months: t("flex", e?.months),
|
|
5
|
-
month: t("flex flex-col w-[259px]", e?.month),
|
|
6
|
-
month_caption: "hidden",
|
|
7
|
-
nav: "hidden",
|
|
8
|
-
day_button: t("size-[30px]", "flex", "items-center", "justify-center", "text-sm", "font-semibold", "cursor-pointer", "rounded-full", "hover:bg-slate-100", "dark:hover:bg-metal-700", "transition-colors", "text-[#314158]", "dark:text-white", "focus:outline-none", "focus-visible:outline-none", e?.dayButton),
|
|
9
|
-
day: t("p-0", "w-[37px]", "h-[38px]", "text-center", "align-middle", e?.day),
|
|
10
|
-
selected: t("[&>button]:bg-blue-600", "[&>button]:text-white", "[&>button]:hover:bg-blue-700", "dark:[&>button]:bg-aurora-500", "dark:[&>button]:hover:bg-aurora-500", "dark:[&>button]:text-metal-900", e?.selected),
|
|
11
|
-
range_start: t("drp-range-start", "[&>button]:!bg-blue-600", "[&>button]:!text-white", "[&>button]:!rounded-full", "[&>button]:hover:!bg-blue-700", "[&>button]:relative", "[&>button]:z-10", "dark:[&>button]:!bg-aurora-500", "dark:[&>button]:hover:!bg-aurora-500", "dark:[&>button]:!text-metal-900", "!relative", "before:absolute", "before:top-[4px]", "before:bottom-[4px]", "before:left-1/2", "before:right-0", "before:!bg-[#EFF6FF]", "dark:before:!bg-aurora-500/10", "last:before:!hidden", e?.rangeStart),
|
|
12
|
-
range_end: t("drp-range-end", "[&>button]:!bg-blue-600", "[&>button]:!text-white", "[&>button]:!rounded-full", "[&>button]:hover:!bg-blue-700", "[&>button]:relative", "[&>button]:z-10", "dark:[&>button]:!bg-aurora-500", "dark:[&>button]:hover:!bg-aurora-500", "dark:[&>button]:!text-metal-900", "!relative", "before:absolute", "before:top-[4px]", "before:bottom-[4px]", "before:left-0", "before:right-1/2", "before:!bg-[#EFF6FF]", "dark:before:!bg-aurora-500/10", "first:before:!hidden", e?.rangeEnd),
|
|
13
|
-
range_middle: t("drp-range-middle", "!relative", "before:absolute", "before:top-[4px]", "before:bottom-[4px]", "before:left-0", "before:right-0", "before:!bg-[#EFF6FF]", "dark:before:!bg-aurora-500/10", "first:before:rounded-l-full", "last:before:rounded-r-full", "[&>button]:!text-[#314158]", "[&>button]:!bg-transparent", "[&>button]:!rounded-full", "[&>button]:relative", "[&>button]:z-10", "[&>button]:hover:!bg-blue-100", "dark:[&>button]:!text-white", "dark:[&>button]:hover:!bg-aurora-500/20", e?.rangeMiddle),
|
|
14
|
-
table: t("w-full border-collapse table-fixed", e?.table),
|
|
15
|
-
weekdays: t("text-[#62748e]", "dark:text-metal-400", e?.weekdays),
|
|
16
|
-
weeks: t("[&>tr>td]:p-0", "[&>tr]:h-[38px]", e?.weeks),
|
|
17
|
-
weekday: t("font-semibold", "text-xs", "uppercase", "text-[#62748e]", "dark:text-metal-400", "pb-4", "w-[37px]", e?.weekday),
|
|
18
|
-
today: t("[&>button]:text-[#155dfc]", "dark:[&>button]:text-aurora-500", e?.today),
|
|
19
|
-
month_grid: "w-full",
|
|
20
|
-
disabled: t("[&>button]:opacity-50", "[&>button]:cursor-not-allowed", e?.disabled),
|
|
21
|
-
outside: t("[&>button]:!text-slate-400", "dark:[&>button]:!text-metal-500", e?.outside)
|
|
22
|
-
}), a = 259, b = 32, n = 720 * 60 * 60 * 1e3, d = 56, l = 28, u = 38;
|
|
23
|
-
export {
|
|
24
|
-
l as a,
|
|
25
|
-
a as i,
|
|
26
|
-
d as n,
|
|
27
|
-
u as o,
|
|
28
|
-
n as r,
|
|
29
|
-
o as s,
|
|
30
|
-
b as t
|
|
31
|
-
};
|
package/dist/dist-B-Aoze_D.js
DELETED
package/dist/dist-BuFiu480.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { n as e } from "./dist-D4FePjTS.js";
|
|
2
|
-
import * as r from "react";
|
|
3
|
-
var s = r[" useId ".trim().toString()] || (() => {
|
|
4
|
-
}), f = 0;
|
|
5
|
-
function c(t) {
|
|
6
|
-
const [o, a] = r.useState(s());
|
|
7
|
-
return e(() => {
|
|
8
|
-
t || a((u) => u ?? String(f++));
|
|
9
|
-
}, [t]), t || (o ? `radix-${o}` : "");
|
|
10
|
-
}
|
|
11
|
-
export {
|
|
12
|
-
c as t
|
|
13
|
-
};
|
package/dist/dist-C2s4VX-42.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { n } from "./dist-D4FePjTS.js";
|
|
2
|
-
import * as z from "react";
|
|
3
|
-
function u(r) {
|
|
4
|
-
const [h, e] = z.useState(void 0);
|
|
5
|
-
return n(() => {
|
|
6
|
-
if (r) {
|
|
7
|
-
e({
|
|
8
|
-
width: r.offsetWidth,
|
|
9
|
-
height: r.offsetHeight
|
|
10
|
-
});
|
|
11
|
-
const f = new ResizeObserver((i) => {
|
|
12
|
-
if (!Array.isArray(i) || !i.length) return;
|
|
13
|
-
const b = i[0];
|
|
14
|
-
let o, t;
|
|
15
|
-
if ("borderBoxSize" in b) {
|
|
16
|
-
const s = b.borderBoxSize, d = Array.isArray(s) ? s[0] : s;
|
|
17
|
-
o = d.inlineSize, t = d.blockSize;
|
|
18
|
-
} else
|
|
19
|
-
o = r.offsetWidth, t = r.offsetHeight;
|
|
20
|
-
e({
|
|
21
|
-
width: o,
|
|
22
|
-
height: t
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
return f.observe(r, { box: "border-box" }), () => f.unobserve(r);
|
|
26
|
-
} else e(void 0);
|
|
27
|
-
}, [r]), h;
|
|
28
|
-
}
|
|
29
|
-
export {
|
|
30
|
-
u as t
|
|
31
|
-
};
|
package/dist/dist-CT6d9xe7.js
DELETED
|
@@ -1,441 +0,0 @@
|
|
|
1
|
-
import { a as D } from "./dist-DqKFpce5.js";
|
|
2
|
-
import { t as B } from "./dist-CVy-ulDZ.js";
|
|
3
|
-
import { i as be, r as T, t as we } from "./dist-D4FePjTS.js";
|
|
4
|
-
import { t as Re } from "./dist-C2s4VX-42.js";
|
|
5
|
-
import { t as Pe } from "./dist-B-Aoze_D.js";
|
|
6
|
-
import { t as xe } from "./dist-l-aDnQZC.js";
|
|
7
|
-
import * as u from "react";
|
|
8
|
-
import { Fragment as Ee, jsx as S, jsxs as _e } from "react/jsx-runtime";
|
|
9
|
-
function ee(t, [e, r]) {
|
|
10
|
-
return Math.min(r, Math.max(e, t));
|
|
11
|
-
}
|
|
12
|
-
function Ce(t) {
|
|
13
|
-
const e = u.useRef({
|
|
14
|
-
value: t,
|
|
15
|
-
previous: t
|
|
16
|
-
});
|
|
17
|
-
return u.useMemo(() => (e.current.value !== t && (e.current.previous = e.current.value, e.current.value = t), e.current.previous), [t]);
|
|
18
|
-
}
|
|
19
|
-
var Me = Object.defineProperty, c = (t, e) => Me(t, "name", {
|
|
20
|
-
value: e,
|
|
21
|
-
configurable: !0
|
|
22
|
-
}), te = ["PageUp", "PageDown"], ne = [
|
|
23
|
-
"ArrowUp",
|
|
24
|
-
"ArrowDown",
|
|
25
|
-
"ArrowLeft",
|
|
26
|
-
"ArrowRight"
|
|
27
|
-
], re = {
|
|
28
|
-
"from-left": [
|
|
29
|
-
"Home",
|
|
30
|
-
"PageDown",
|
|
31
|
-
"ArrowDown",
|
|
32
|
-
"ArrowLeft"
|
|
33
|
-
],
|
|
34
|
-
"from-right": [
|
|
35
|
-
"Home",
|
|
36
|
-
"PageDown",
|
|
37
|
-
"ArrowDown",
|
|
38
|
-
"ArrowRight"
|
|
39
|
-
],
|
|
40
|
-
"from-bottom": [
|
|
41
|
-
"Home",
|
|
42
|
-
"PageDown",
|
|
43
|
-
"ArrowDown",
|
|
44
|
-
"ArrowLeft"
|
|
45
|
-
],
|
|
46
|
-
"from-top": [
|
|
47
|
-
"Home",
|
|
48
|
-
"PageDown",
|
|
49
|
-
"ArrowUp",
|
|
50
|
-
"ArrowLeft"
|
|
51
|
-
]
|
|
52
|
-
}, A = "Slider", [Y, ye, Te] = xe(A), [$, je] = be(A, [Te]), [De, K] = $(A), Ge = /* @__PURE__ */ u.forwardRef(/* @__PURE__ */ c(function(e, r) {
|
|
53
|
-
const { name: o, min: i = 0, max: n = 100, step: l = 1, orientation: a = "horizontal", disabled: d = !1, minStepsBetweenThumbs: f = 0, defaultValue: h = [i], value: g, onValueChange: s = /* @__PURE__ */ c(() => {
|
|
54
|
-
}, "onValueChange"), onValueCommit: m = /* @__PURE__ */ c(() => {
|
|
55
|
-
}, "onValueCommit"), inverted: R = !1, form: p, ...v } = e, w = u.useRef(/* @__PURE__ */ new Set()), P = u.useRef(0), E = u.useRef(!1), _ = a === "horizontal" ? Ve : Ie, [x, z] = u.useState(null), pe = D(r, z), [C = [], L] = we({
|
|
56
|
-
prop: g,
|
|
57
|
-
defaultProp: h,
|
|
58
|
-
onChange: /* @__PURE__ */ c((b) => {
|
|
59
|
-
[...w.current][P.current]?.focus({
|
|
60
|
-
preventScroll: !0,
|
|
61
|
-
focusVisible: E.current
|
|
62
|
-
}), E.current = !1, s(b);
|
|
63
|
-
}, "onChange")
|
|
64
|
-
}), X = u.useRef(C), ve = u.useRef(C);
|
|
65
|
-
u.useEffect(() => {
|
|
66
|
-
const b = p ? x?.ownerDocument.getElementById(p) : x?.closest("form");
|
|
67
|
-
if (b instanceof HTMLFormElement) {
|
|
68
|
-
const y = /* @__PURE__ */ c(() => L(ve.current), "reset");
|
|
69
|
-
return b.addEventListener("reset", y), () => b.removeEventListener("reset", y);
|
|
70
|
-
}
|
|
71
|
-
}, [
|
|
72
|
-
x,
|
|
73
|
-
p,
|
|
74
|
-
L
|
|
75
|
-
]);
|
|
76
|
-
function W(b) {
|
|
77
|
-
M(b, de(C, b));
|
|
78
|
-
}
|
|
79
|
-
c(W, "handleSlideStart");
|
|
80
|
-
function q(b) {
|
|
81
|
-
M(b, P.current);
|
|
82
|
-
}
|
|
83
|
-
c(q, "handleSlideMove");
|
|
84
|
-
function J() {
|
|
85
|
-
String(C) !== String(X.current) && m(C);
|
|
86
|
-
}
|
|
87
|
-
c(J, "handleSlideEnd");
|
|
88
|
-
function M(b, y, { commit: O } = { commit: !1 }) {
|
|
89
|
-
const F = G(l), N = ee(I(Math.round((b - i) / l) * l + i, F), [i, n]);
|
|
90
|
-
L((H = []) => {
|
|
91
|
-
const V = ce(H, N, y);
|
|
92
|
-
if (Se(V, f * l)) {
|
|
93
|
-
P.current = V.indexOf(N);
|
|
94
|
-
const Q = String(V) !== String(H);
|
|
95
|
-
return Q && O && m(V), Q ? V : H;
|
|
96
|
-
} else return H;
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
return c(M, "updateValues"), /* @__PURE__ */ S(De, {
|
|
100
|
-
scope: e.__scopeSlider,
|
|
101
|
-
name: o,
|
|
102
|
-
disabled: d,
|
|
103
|
-
min: i,
|
|
104
|
-
max: n,
|
|
105
|
-
valueIndexToChangeRef: P,
|
|
106
|
-
thumbs: w.current,
|
|
107
|
-
values: C,
|
|
108
|
-
orientation: a,
|
|
109
|
-
form: p,
|
|
110
|
-
children: /* @__PURE__ */ S(Y.Provider, {
|
|
111
|
-
scope: e.__scopeSlider,
|
|
112
|
-
children: /* @__PURE__ */ S(Y.Slot, {
|
|
113
|
-
scope: e.__scopeSlider,
|
|
114
|
-
children: /* @__PURE__ */ S(_, {
|
|
115
|
-
"aria-disabled": d,
|
|
116
|
-
"data-disabled": d ? "" : void 0,
|
|
117
|
-
...v,
|
|
118
|
-
ref: pe,
|
|
119
|
-
onPointerDown: T(v.onPointerDown, () => {
|
|
120
|
-
d || (X.current = C, E.current = !1);
|
|
121
|
-
}),
|
|
122
|
-
min: i,
|
|
123
|
-
max: n,
|
|
124
|
-
inverted: R,
|
|
125
|
-
onSlideStart: d ? void 0 : W,
|
|
126
|
-
onSlideMove: d ? void 0 : q,
|
|
127
|
-
onSlideEnd: d ? void 0 : J,
|
|
128
|
-
onHomeKeyDown: () => {
|
|
129
|
-
d || (E.current = !0, M(i, 0, { commit: !0 }));
|
|
130
|
-
},
|
|
131
|
-
onEndKeyDown: () => {
|
|
132
|
-
d || (E.current = !0, M(n, C.length - 1, { commit: !0 }));
|
|
133
|
-
},
|
|
134
|
-
onStepKeyDown: ({ event: b, direction: y }) => {
|
|
135
|
-
if (!d) {
|
|
136
|
-
E.current = !0;
|
|
137
|
-
const O = te.includes(b.key) || b.shiftKey && ne.includes(b.key) ? 10 : 1, F = P.current, N = C[F];
|
|
138
|
-
M(he(N, {
|
|
139
|
-
min: i,
|
|
140
|
-
step: l,
|
|
141
|
-
direction: y,
|
|
142
|
-
multiplier: O
|
|
143
|
-
}), F, { commit: !0 });
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
})
|
|
147
|
-
})
|
|
148
|
-
})
|
|
149
|
-
});
|
|
150
|
-
}, "Slider")), [oe, ie] = $(A, {
|
|
151
|
-
startEdge: "left",
|
|
152
|
-
endEdge: "right",
|
|
153
|
-
size: "width",
|
|
154
|
-
direction: 1
|
|
155
|
-
}), Ve = /* @__PURE__ */ u.forwardRef(/* @__PURE__ */ c(function(e, r) {
|
|
156
|
-
const { min: o, max: i, dir: n, inverted: l, onSlideStart: a, onSlideMove: d, onSlideEnd: f, onStepKeyDown: h, ...g } = e, [s, m] = u.useState(null), R = D(r, m), p = u.useRef(void 0), v = Pe(n), w = v === "ltr", P = w && !l || !w && l;
|
|
157
|
-
function E(_) {
|
|
158
|
-
const x = p.current || s.getBoundingClientRect(), z = k([0, x.width], P ? [o, i] : [i, o]);
|
|
159
|
-
return p.current = x, z(_ - x.left);
|
|
160
|
-
}
|
|
161
|
-
return c(E, "getValueFromPointer"), /* @__PURE__ */ S(oe, {
|
|
162
|
-
scope: e.__scopeSlider,
|
|
163
|
-
startEdge: P ? "left" : "right",
|
|
164
|
-
endEdge: P ? "right" : "left",
|
|
165
|
-
direction: P ? 1 : -1,
|
|
166
|
-
size: "width",
|
|
167
|
-
children: /* @__PURE__ */ S(se, {
|
|
168
|
-
dir: v,
|
|
169
|
-
"data-orientation": "horizontal",
|
|
170
|
-
...g,
|
|
171
|
-
ref: R,
|
|
172
|
-
style: {
|
|
173
|
-
...g.style,
|
|
174
|
-
"--radix-slider-thumb-transform": "translateX(-50%)"
|
|
175
|
-
},
|
|
176
|
-
onSlideStart: (_) => {
|
|
177
|
-
const x = E(_.clientX);
|
|
178
|
-
a?.(x);
|
|
179
|
-
},
|
|
180
|
-
onSlideMove: (_) => {
|
|
181
|
-
const x = E(_.clientX);
|
|
182
|
-
d?.(x);
|
|
183
|
-
},
|
|
184
|
-
onSlideEnd: () => {
|
|
185
|
-
p.current = void 0, f?.();
|
|
186
|
-
},
|
|
187
|
-
onStepKeyDown: (_) => {
|
|
188
|
-
const x = re[P ? "from-left" : "from-right"].includes(_.key);
|
|
189
|
-
h?.({
|
|
190
|
-
event: _,
|
|
191
|
-
direction: x ? -1 : 1
|
|
192
|
-
});
|
|
193
|
-
}
|
|
194
|
-
})
|
|
195
|
-
});
|
|
196
|
-
}, "SliderHorizontal")), Ie = /* @__PURE__ */ u.forwardRef(/* @__PURE__ */ c(function(e, r) {
|
|
197
|
-
const { min: o, max: i, inverted: n, onSlideStart: l, onSlideMove: a, onSlideEnd: d, onStepKeyDown: f, ...h } = e, g = u.useRef(null), s = D(r, g), m = u.useRef(void 0), R = !n;
|
|
198
|
-
function p(v) {
|
|
199
|
-
const w = m.current || g.current.getBoundingClientRect(), P = k([0, w.height], R ? [i, o] : [o, i]);
|
|
200
|
-
return m.current = w, P(v - w.top);
|
|
201
|
-
}
|
|
202
|
-
return c(p, "getValueFromPointer"), /* @__PURE__ */ S(oe, {
|
|
203
|
-
scope: e.__scopeSlider,
|
|
204
|
-
startEdge: R ? "bottom" : "top",
|
|
205
|
-
endEdge: R ? "top" : "bottom",
|
|
206
|
-
size: "height",
|
|
207
|
-
direction: R ? 1 : -1,
|
|
208
|
-
children: /* @__PURE__ */ S(se, {
|
|
209
|
-
"data-orientation": "vertical",
|
|
210
|
-
...h,
|
|
211
|
-
ref: s,
|
|
212
|
-
style: {
|
|
213
|
-
...h.style,
|
|
214
|
-
"--radix-slider-thumb-transform": "translateY(50%)"
|
|
215
|
-
},
|
|
216
|
-
onSlideStart: (v) => {
|
|
217
|
-
const w = p(v.clientY);
|
|
218
|
-
l?.(w);
|
|
219
|
-
},
|
|
220
|
-
onSlideMove: (v) => {
|
|
221
|
-
const w = p(v.clientY);
|
|
222
|
-
a?.(w);
|
|
223
|
-
},
|
|
224
|
-
onSlideEnd: () => {
|
|
225
|
-
m.current = void 0, d?.();
|
|
226
|
-
},
|
|
227
|
-
onStepKeyDown: (v) => {
|
|
228
|
-
const w = re[R ? "from-bottom" : "from-top"].includes(v.key);
|
|
229
|
-
f?.({
|
|
230
|
-
event: v,
|
|
231
|
-
direction: w ? -1 : 1
|
|
232
|
-
});
|
|
233
|
-
}
|
|
234
|
-
})
|
|
235
|
-
});
|
|
236
|
-
}, "SliderVertical")), se = /* @__PURE__ */ u.forwardRef(/* @__PURE__ */ c(function(e, r) {
|
|
237
|
-
const { __scopeSlider: o, onSlideStart: i, onSlideMove: n, onSlideEnd: l, onHomeKeyDown: a, onEndKeyDown: d, onStepKeyDown: f, ...h } = e, g = K(A, o);
|
|
238
|
-
return /* @__PURE__ */ S(B.span, {
|
|
239
|
-
...h,
|
|
240
|
-
ref: r,
|
|
241
|
-
onKeyDown: T(e.onKeyDown, (s) => {
|
|
242
|
-
s.key === "Home" ? (a(s), s.preventDefault()) : s.key === "End" ? (d(s), s.preventDefault()) : te.concat(ne).includes(s.key) && (f(s), s.preventDefault());
|
|
243
|
-
}),
|
|
244
|
-
onPointerDown: T(e.onPointerDown, (s) => {
|
|
245
|
-
const m = s.target;
|
|
246
|
-
m.setPointerCapture(s.pointerId), s.preventDefault(), g.thumbs.has(m) ? m.focus({
|
|
247
|
-
preventScroll: !0,
|
|
248
|
-
focusVisible: !1
|
|
249
|
-
}) : i(s);
|
|
250
|
-
}),
|
|
251
|
-
onPointerMove: T(e.onPointerMove, (s) => {
|
|
252
|
-
s.target.hasPointerCapture(s.pointerId) && n(s);
|
|
253
|
-
}),
|
|
254
|
-
onPointerUp: T(e.onPointerUp, (s) => {
|
|
255
|
-
const m = s.target;
|
|
256
|
-
m.hasPointerCapture(s.pointerId) && (m.releasePointerCapture(s.pointerId), l(s));
|
|
257
|
-
})
|
|
258
|
-
});
|
|
259
|
-
}, "SliderImpl")), Be = "SliderTrack", Xe = /* @__PURE__ */ u.forwardRef(/* @__PURE__ */ c(function(e, r) {
|
|
260
|
-
const { __scopeSlider: o, ...i } = e, n = K(Be, o);
|
|
261
|
-
return /* @__PURE__ */ S(B.span, {
|
|
262
|
-
"data-disabled": n.disabled ? "" : void 0,
|
|
263
|
-
"data-orientation": n.orientation,
|
|
264
|
-
...i,
|
|
265
|
-
ref: r
|
|
266
|
-
});
|
|
267
|
-
}, "SliderTrack")), Z = "SliderRange", We = /* @__PURE__ */ u.forwardRef(/* @__PURE__ */ c(function(e, r) {
|
|
268
|
-
const { __scopeSlider: o, ...i } = e, n = K(Z, o), l = ie(Z, o), a = D(r, u.useRef(null)), d = n.values.length, f = n.values.map((s) => j(s, n.min, n.max)), h = d > 1 ? Math.min(...f) : 0, g = 100 - Math.max(...f);
|
|
269
|
-
return /* @__PURE__ */ S(B.span, {
|
|
270
|
-
"data-orientation": n.orientation,
|
|
271
|
-
"data-disabled": n.disabled ? "" : void 0,
|
|
272
|
-
...i,
|
|
273
|
-
ref: a,
|
|
274
|
-
style: {
|
|
275
|
-
...e.style,
|
|
276
|
-
[l.startEdge]: h + "%",
|
|
277
|
-
[l.endEdge]: g + "%"
|
|
278
|
-
}
|
|
279
|
-
});
|
|
280
|
-
}, "SliderRange")), [Ae, ae] = $("SliderThumb"), Ke = "SliderThumbProvider";
|
|
281
|
-
function le(t) {
|
|
282
|
-
const { __scopeSlider: e, name: r, children: o, internal_do_not_use_render: i } = t, n = K(Ke, e), l = ye(e), [a, d] = u.useState(null), f = u.useMemo(() => a ? l().findIndex((v) => v.ref.current === a) : -1, [l, a]), h = Re(a), g = a ? !!n.form || !!a.closest("form") : !0, s = n.values[f], m = r ?? (n.name ? n.name + (n.values.length > 1 ? "[]" : "") : void 0), R = s === void 0 ? 0 : j(s, n.min, n.max);
|
|
283
|
-
u.useEffect(() => {
|
|
284
|
-
if (a)
|
|
285
|
-
return n.thumbs.add(a), () => {
|
|
286
|
-
n.thumbs.delete(a);
|
|
287
|
-
};
|
|
288
|
-
}, [a, n.thumbs]);
|
|
289
|
-
const p = {
|
|
290
|
-
value: s,
|
|
291
|
-
name: m,
|
|
292
|
-
form: n.form,
|
|
293
|
-
isFormControl: g,
|
|
294
|
-
index: f,
|
|
295
|
-
thumb: a,
|
|
296
|
-
onThumbChange: d,
|
|
297
|
-
percent: R,
|
|
298
|
-
size: h
|
|
299
|
-
};
|
|
300
|
-
return /* @__PURE__ */ S(Ae, {
|
|
301
|
-
scope: e,
|
|
302
|
-
...p,
|
|
303
|
-
children: ge(i) ? i(p) : o
|
|
304
|
-
});
|
|
305
|
-
}
|
|
306
|
-
c(le, "SliderThumbProvider");
|
|
307
|
-
var U = "SliderThumbTrigger", Fe = /* @__PURE__ */ u.forwardRef(/* @__PURE__ */ c(function(e, r) {
|
|
308
|
-
const { __scopeSlider: o, ...i } = e, n = K(U, o), l = ie(U, o), { index: a, value: d, percent: f, size: h, onThumbChange: g } = ae(U, o), s = D(r, g), m = ue(a, n.values.length), R = h?.[l.size], p = R ? fe(R, f, l.direction) : 0;
|
|
309
|
-
return /* @__PURE__ */ S("span", {
|
|
310
|
-
style: {
|
|
311
|
-
transform: "var(--radix-slider-thumb-transform)",
|
|
312
|
-
position: "absolute",
|
|
313
|
-
[l.startEdge]: `calc(${f}% + ${p}px)`
|
|
314
|
-
},
|
|
315
|
-
children: /* @__PURE__ */ S(Y.ItemSlot, {
|
|
316
|
-
scope: o,
|
|
317
|
-
children: /* @__PURE__ */ S(B.span, {
|
|
318
|
-
role: "slider",
|
|
319
|
-
"aria-label": e["aria-label"] || m,
|
|
320
|
-
"aria-valuemin": n.min,
|
|
321
|
-
"aria-valuenow": d,
|
|
322
|
-
"aria-valuemax": n.max,
|
|
323
|
-
"aria-orientation": n.orientation,
|
|
324
|
-
"data-orientation": n.orientation,
|
|
325
|
-
"data-disabled": n.disabled ? "" : void 0,
|
|
326
|
-
tabIndex: n.disabled ? void 0 : 0,
|
|
327
|
-
...i,
|
|
328
|
-
ref: s,
|
|
329
|
-
style: d === void 0 ? { display: "none" } : e.style,
|
|
330
|
-
onFocus: T(e.onFocus, () => {
|
|
331
|
-
n.valueIndexToChangeRef.current = a;
|
|
332
|
-
})
|
|
333
|
-
})
|
|
334
|
-
})
|
|
335
|
-
});
|
|
336
|
-
}, "SliderThumbTrigger")), qe = /* @__PURE__ */ u.forwardRef(/* @__PURE__ */ c(function(e, r) {
|
|
337
|
-
const { __scopeSlider: o, name: i, ...n } = e;
|
|
338
|
-
return /* @__PURE__ */ S(le, {
|
|
339
|
-
__scopeSlider: o,
|
|
340
|
-
name: i,
|
|
341
|
-
internal_do_not_use_render: ({ index: l, isFormControl: a }) => /* @__PURE__ */ _e(Ee, { children: [/* @__PURE__ */ S(Fe, {
|
|
342
|
-
...n,
|
|
343
|
-
ref: r,
|
|
344
|
-
__scopeSlider: o
|
|
345
|
-
}), a ? /* @__PURE__ */ S(He, { __scopeSlider: o }, l) : null] })
|
|
346
|
-
});
|
|
347
|
-
}, "SliderThumb")), Ne = "SliderBubbleInput", He = /* @__PURE__ */ u.forwardRef(/* @__PURE__ */ c(function({ __scopeSlider: e, ...r }, o) {
|
|
348
|
-
const { value: i, name: n, form: l } = ae(Ne, e), a = u.useRef(null), d = D(a, o), f = Ce(i);
|
|
349
|
-
return u.useEffect(() => {
|
|
350
|
-
const h = a.current;
|
|
351
|
-
if (!h) return;
|
|
352
|
-
const g = window.HTMLInputElement.prototype, s = Object.getOwnPropertyDescriptor(g, "value").set;
|
|
353
|
-
if (f !== i && s) {
|
|
354
|
-
const m = new Event("input", { bubbles: !0 });
|
|
355
|
-
s.call(h, i), h.dispatchEvent(m);
|
|
356
|
-
}
|
|
357
|
-
}, [f, i]), /* @__PURE__ */ S(B.input, {
|
|
358
|
-
style: { display: "none" },
|
|
359
|
-
name: n,
|
|
360
|
-
form: l,
|
|
361
|
-
...r,
|
|
362
|
-
ref: d,
|
|
363
|
-
defaultValue: i
|
|
364
|
-
});
|
|
365
|
-
}, "SliderBubbleInput"));
|
|
366
|
-
function ce(t = [], e, r) {
|
|
367
|
-
const o = [...t];
|
|
368
|
-
return o[r] = e, o.sort((i, n) => i - n);
|
|
369
|
-
}
|
|
370
|
-
c(ce, "getNextSortedValues");
|
|
371
|
-
function j(t, e, r) {
|
|
372
|
-
return ee(100 / (r - e) * (t - e), [0, 100]);
|
|
373
|
-
}
|
|
374
|
-
c(j, "convertValueToPercentage");
|
|
375
|
-
function ue(t, e) {
|
|
376
|
-
return e > 2 ? `Value ${t + 1} of ${e}` : e === 2 ? ["Minimum", "Maximum"][t] : void 0;
|
|
377
|
-
}
|
|
378
|
-
c(ue, "getLabel");
|
|
379
|
-
function de(t, e) {
|
|
380
|
-
if (t.length === 1) return 0;
|
|
381
|
-
const r = t.map((i) => Math.abs(i - e)), o = Math.min(...r);
|
|
382
|
-
return r.indexOf(o);
|
|
383
|
-
}
|
|
384
|
-
c(de, "getClosestValueIndex");
|
|
385
|
-
function fe(t, e, r) {
|
|
386
|
-
const o = t / 2;
|
|
387
|
-
return (o - k([0, 50], [0, o])(e) * r) * r;
|
|
388
|
-
}
|
|
389
|
-
c(fe, "getThumbInBoundsOffset");
|
|
390
|
-
function me(t) {
|
|
391
|
-
return t.slice(0, -1).map((e, r) => t[r + 1] - e);
|
|
392
|
-
}
|
|
393
|
-
c(me, "getStepsBetweenValues");
|
|
394
|
-
function Se(t, e) {
|
|
395
|
-
if (e > 0) {
|
|
396
|
-
const r = me(t);
|
|
397
|
-
return Math.min(...r) >= e;
|
|
398
|
-
}
|
|
399
|
-
return !0;
|
|
400
|
-
}
|
|
401
|
-
c(Se, "hasMinStepsBetweenValues");
|
|
402
|
-
function k(t, e) {
|
|
403
|
-
return (r) => {
|
|
404
|
-
if (t[0] === t[1] || e[0] === e[1]) return e[0];
|
|
405
|
-
const o = (e[1] - e[0]) / (t[1] - t[0]);
|
|
406
|
-
return e[0] + o * (r - t[0]);
|
|
407
|
-
};
|
|
408
|
-
}
|
|
409
|
-
c(k, "linearScale");
|
|
410
|
-
function G(t) {
|
|
411
|
-
if (!Number.isFinite(t)) return 0;
|
|
412
|
-
const e = t.toString();
|
|
413
|
-
if (e.includes("e")) {
|
|
414
|
-
const [o, i] = e.split("e"), n = o.split(".")[1] || "", l = Number(i);
|
|
415
|
-
return Math.max(0, n.length - l);
|
|
416
|
-
}
|
|
417
|
-
const r = e.split(".")[1];
|
|
418
|
-
return r ? r.length : 0;
|
|
419
|
-
}
|
|
420
|
-
c(G, "getDecimalCount");
|
|
421
|
-
function I(t, e) {
|
|
422
|
-
const r = Math.pow(10, e);
|
|
423
|
-
return Math.round(t * r) / r;
|
|
424
|
-
}
|
|
425
|
-
c(I, "roundValue");
|
|
426
|
-
function he(t, { min: e, step: r, direction: o, multiplier: i }) {
|
|
427
|
-
const n = G(r), l = (t - e) / r, a = Math.round(l), d = I(a * r + e, n) === I(t, n);
|
|
428
|
-
let f;
|
|
429
|
-
return d ? f = a + i * o : o > 0 ? f = Math.ceil(l) : f = Math.floor(l), I(f * r + e, n);
|
|
430
|
-
}
|
|
431
|
-
c(he, "getNextStepValue");
|
|
432
|
-
function ge(t) {
|
|
433
|
-
return typeof t == "function";
|
|
434
|
-
}
|
|
435
|
-
c(ge, "isFunction");
|
|
436
|
-
export {
|
|
437
|
-
Xe as i,
|
|
438
|
-
We as n,
|
|
439
|
-
qe as r,
|
|
440
|
-
Ge as t
|
|
441
|
-
};
|