@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
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import * as r from "react";
|
|
2
|
+
import { jsx as P } from "react/jsx-runtime";
|
|
3
|
+
var N = Object.defineProperty, f = (e, t) => N(e, "name", {
|
|
4
|
+
value: t,
|
|
5
|
+
configurable: !0
|
|
6
|
+
});
|
|
7
|
+
// @__NO_SIDE_EFFECTS__
|
|
8
|
+
function T(e, t) {
|
|
9
|
+
const n = r.createContext(t);
|
|
10
|
+
n.displayName = e + "Context";
|
|
11
|
+
const i = /* @__PURE__ */ f((c) => {
|
|
12
|
+
const { children: s, ...u } = c, l = r.useMemo(() => u, Object.values(u));
|
|
13
|
+
return /* @__PURE__ */ P(n.Provider, {
|
|
14
|
+
value: l,
|
|
15
|
+
children: s
|
|
16
|
+
});
|
|
17
|
+
}, "Provider");
|
|
18
|
+
i.displayName = e + "Provider";
|
|
19
|
+
function o(c, s = {}) {
|
|
20
|
+
const { optional: u = !1 } = s, l = r.useContext(n);
|
|
21
|
+
if (l) return l;
|
|
22
|
+
if (t !== void 0) return t;
|
|
23
|
+
if (!u)
|
|
24
|
+
throw new Error(`\`${c}\` must be used within \`${e}\``);
|
|
25
|
+
}
|
|
26
|
+
return f(o, "useContext"), [i, o];
|
|
27
|
+
}
|
|
28
|
+
f(T, "createContext");
|
|
29
|
+
// @__NO_SIDE_EFFECTS__
|
|
30
|
+
function U(e, t = []) {
|
|
31
|
+
let n = [];
|
|
32
|
+
function i(c, s) {
|
|
33
|
+
const u = r.createContext(s);
|
|
34
|
+
u.displayName = c + "Context";
|
|
35
|
+
const l = n.length;
|
|
36
|
+
n = [...n, s];
|
|
37
|
+
const a = /* @__PURE__ */ f((m) => {
|
|
38
|
+
const { scope: w, children: v, ...p } = m, h = w?.[e]?.[l] || u, C = r.useMemo(() => p, Object.values(p));
|
|
39
|
+
return /* @__PURE__ */ P(h.Provider, {
|
|
40
|
+
value: C,
|
|
41
|
+
children: v
|
|
42
|
+
});
|
|
43
|
+
}, "Provider");
|
|
44
|
+
a.displayName = c + "Provider";
|
|
45
|
+
function d(m, w, v = {}) {
|
|
46
|
+
const { optional: p = !1 } = v, h = w?.[e]?.[l] || u, C = r.useContext(h);
|
|
47
|
+
if (C) return C;
|
|
48
|
+
if (s !== void 0) return s;
|
|
49
|
+
if (!p)
|
|
50
|
+
throw new Error(`\`${m}\` must be used within \`${c}\``);
|
|
51
|
+
}
|
|
52
|
+
return f(d, "useContext"), [a, d];
|
|
53
|
+
}
|
|
54
|
+
f(i, "createContext");
|
|
55
|
+
const o = /* @__PURE__ */ f(() => {
|
|
56
|
+
const c = n.map((s) => r.createContext(s));
|
|
57
|
+
return /* @__PURE__ */ f(function(u) {
|
|
58
|
+
const l = u?.[e] || c;
|
|
59
|
+
return r.useMemo(() => ({ [`__scope${e}`]: {
|
|
60
|
+
...u,
|
|
61
|
+
[e]: l
|
|
62
|
+
} }), [u, l]);
|
|
63
|
+
}, "useScope");
|
|
64
|
+
}, "createScope");
|
|
65
|
+
return o.scopeName = e, [i, y(o, ...t)];
|
|
66
|
+
}
|
|
67
|
+
f(U, "createContextScope");
|
|
68
|
+
function y(...e) {
|
|
69
|
+
const t = e[0];
|
|
70
|
+
if (e.length === 1) return t;
|
|
71
|
+
const n = /* @__PURE__ */ f(() => {
|
|
72
|
+
const i = e.map((o) => ({
|
|
73
|
+
useScope: o(),
|
|
74
|
+
scopeName: o.scopeName
|
|
75
|
+
}));
|
|
76
|
+
return /* @__PURE__ */ f(function(c) {
|
|
77
|
+
const s = i.reduce((u, { useScope: l, scopeName: a }) => {
|
|
78
|
+
const d = l(c)[`__scope${a}`];
|
|
79
|
+
return {
|
|
80
|
+
...u,
|
|
81
|
+
...d
|
|
82
|
+
};
|
|
83
|
+
}, {});
|
|
84
|
+
return r.useMemo(() => ({ [`__scope${t.scopeName}`]: s }), [s]);
|
|
85
|
+
}, "useComposedScopes");
|
|
86
|
+
}, "createScope");
|
|
87
|
+
return n.scopeName = t.scopeName, n;
|
|
88
|
+
}
|
|
89
|
+
f(y, "composeContextScopes");
|
|
90
|
+
var H = Object.defineProperty, E = (e, t) => H(e, "name", {
|
|
91
|
+
value: t,
|
|
92
|
+
configurable: !0
|
|
93
|
+
}), O = !!(typeof window < "u" && window.document && window.document.createElement);
|
|
94
|
+
function B(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
|
|
95
|
+
return /* @__PURE__ */ E(function(o) {
|
|
96
|
+
if (e?.(o), n === !1 || !o || !o.defaultPrevented) return t?.(o);
|
|
97
|
+
}, "handleEvent");
|
|
98
|
+
}
|
|
99
|
+
E(B, "composeEventHandlers");
|
|
100
|
+
function L(e) {
|
|
101
|
+
if (!O) throw new Error("Cannot access window outside of the DOM");
|
|
102
|
+
return e?.ownerDocument?.defaultView ?? window;
|
|
103
|
+
}
|
|
104
|
+
E(L, "getOwnerWindow");
|
|
105
|
+
function x(e) {
|
|
106
|
+
if (!O) throw new Error("Cannot access document outside of the DOM");
|
|
107
|
+
return e?.ownerDocument ?? document;
|
|
108
|
+
}
|
|
109
|
+
E(x, "getOwnerDocument");
|
|
110
|
+
function D(e, t = !1) {
|
|
111
|
+
const { activeElement: n } = x(e);
|
|
112
|
+
if (!n?.nodeName) return null;
|
|
113
|
+
if (M(n) && n.contentDocument) return D(n.contentDocument.body, t);
|
|
114
|
+
if (t) {
|
|
115
|
+
const i = n.getAttribute("aria-activedescendant");
|
|
116
|
+
if (i) {
|
|
117
|
+
const o = x(n).getElementById(i);
|
|
118
|
+
if (o) return o;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return n;
|
|
122
|
+
}
|
|
123
|
+
E(D, "getActiveElement");
|
|
124
|
+
function M(e) {
|
|
125
|
+
return e.tagName === "IFRAME";
|
|
126
|
+
}
|
|
127
|
+
E(M, "isFrame");
|
|
128
|
+
var j = globalThis?.document ? r.useLayoutEffect : () => {
|
|
129
|
+
}, W = Object.defineProperty, Y = (e, t) => W(e, "name", {
|
|
130
|
+
value: t,
|
|
131
|
+
configurable: !0
|
|
132
|
+
}), $ = r[" useEffectEvent ".trim().toString()], b = r[" useInsertionEffect ".trim().toString()];
|
|
133
|
+
function A(e) {
|
|
134
|
+
if (typeof $ == "function") return $(e);
|
|
135
|
+
const t = r.useRef(() => {
|
|
136
|
+
throw new Error("Cannot call an event handler while rendering.");
|
|
137
|
+
});
|
|
138
|
+
return typeof b == "function" ? b(() => {
|
|
139
|
+
t.current = e;
|
|
140
|
+
}) : j(() => {
|
|
141
|
+
t.current = e;
|
|
142
|
+
}), r.useMemo(() => ((...n) => t.current?.(...n)), []);
|
|
143
|
+
}
|
|
144
|
+
Y(A, "useEffectEvent");
|
|
145
|
+
var V = Object.defineProperty, S = (e, t) => V(e, "name", {
|
|
146
|
+
value: t,
|
|
147
|
+
configurable: !0
|
|
148
|
+
}), X = r[" useInsertionEffect ".trim().toString()] || j;
|
|
149
|
+
function k({ prop: e, defaultProp: t, onChange: n = /* @__PURE__ */ S(() => {
|
|
150
|
+
}, "onChange"), caller: i }) {
|
|
151
|
+
const [o, c, s] = I({
|
|
152
|
+
defaultProp: t,
|
|
153
|
+
onChange: n
|
|
154
|
+
}), u = e !== void 0;
|
|
155
|
+
return [u ? e : o, r.useCallback((a) => {
|
|
156
|
+
if (u) {
|
|
157
|
+
const d = F(a) ? a(e) : a;
|
|
158
|
+
d !== e && s.current?.(d);
|
|
159
|
+
} else c(a);
|
|
160
|
+
}, [
|
|
161
|
+
u,
|
|
162
|
+
e,
|
|
163
|
+
c,
|
|
164
|
+
s
|
|
165
|
+
])];
|
|
166
|
+
}
|
|
167
|
+
S(k, "useControllableState");
|
|
168
|
+
function I({ defaultProp: e, onChange: t }) {
|
|
169
|
+
const [n, i] = r.useState(e), o = r.useRef(n), c = r.useRef(t);
|
|
170
|
+
return X(() => {
|
|
171
|
+
c.current = t;
|
|
172
|
+
}, [t]), r.useEffect(() => {
|
|
173
|
+
o.current !== n && (c.current?.(n), o.current = n);
|
|
174
|
+
}, [n, o]), [
|
|
175
|
+
n,
|
|
176
|
+
i,
|
|
177
|
+
c
|
|
178
|
+
];
|
|
179
|
+
}
|
|
180
|
+
S(I, "useUncontrolledState");
|
|
181
|
+
function F(e) {
|
|
182
|
+
return typeof e == "function";
|
|
183
|
+
}
|
|
184
|
+
S(F, "isFunction");
|
|
185
|
+
var _ = /* @__PURE__ */ Symbol("RADIX:SYNC_STATE");
|
|
186
|
+
function q(e, t, n, i) {
|
|
187
|
+
const { prop: o, defaultProp: c, onChange: s, caller: u } = t, l = o !== void 0, a = A(s), d = [{
|
|
188
|
+
...n,
|
|
189
|
+
state: c
|
|
190
|
+
}];
|
|
191
|
+
i && d.push(i);
|
|
192
|
+
const [m, w] = r.useReducer((C, g) => {
|
|
193
|
+
if (g.type === _) return {
|
|
194
|
+
...C,
|
|
195
|
+
state: g.state
|
|
196
|
+
};
|
|
197
|
+
const R = e(C, g);
|
|
198
|
+
return l && !Object.is(R.state, C.state) && a(R.state), R;
|
|
199
|
+
}, ...d), v = m.state, p = r.useRef(v);
|
|
200
|
+
r.useEffect(() => {
|
|
201
|
+
p.current !== v && (p.current = v, l || a(v));
|
|
202
|
+
}, [
|
|
203
|
+
v,
|
|
204
|
+
p,
|
|
205
|
+
l
|
|
206
|
+
]);
|
|
207
|
+
const h = r.useMemo(() => o !== void 0 ? {
|
|
208
|
+
...m,
|
|
209
|
+
state: o
|
|
210
|
+
} : m, [m, o]);
|
|
211
|
+
return r.useEffect(() => {
|
|
212
|
+
l && !Object.is(o, m.state) && w({
|
|
213
|
+
type: _,
|
|
214
|
+
state: o
|
|
215
|
+
});
|
|
216
|
+
}, [
|
|
217
|
+
o,
|
|
218
|
+
m.state,
|
|
219
|
+
l
|
|
220
|
+
]), [h, w];
|
|
221
|
+
}
|
|
222
|
+
S(q, "useControllableStateReducer");
|
|
223
|
+
export {
|
|
224
|
+
U as i,
|
|
225
|
+
j as n,
|
|
226
|
+
B as r,
|
|
227
|
+
k as t
|
|
228
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as t from "react";
|
|
2
|
+
var f = Object.defineProperty, u = (e, r) => f(e, "name", {
|
|
3
|
+
value: r,
|
|
4
|
+
configurable: !0
|
|
5
|
+
});
|
|
6
|
+
function c(e) {
|
|
7
|
+
const r = t.useRef(e);
|
|
8
|
+
return t.useEffect(() => {
|
|
9
|
+
r.current = e;
|
|
10
|
+
}), t.useMemo(() => ((...a) => r.current?.(...a)), []);
|
|
11
|
+
}
|
|
12
|
+
u(c, "useCallbackRef");
|
|
13
|
+
export {
|
|
14
|
+
c as t
|
|
15
|
+
};
|
|
@@ -0,0 +1,451 @@
|
|
|
1
|
+
import { a as D } from "./dist-xCbHbMLA.js";
|
|
2
|
+
import { t as B } from "./dist-CCdbu9GU.js";
|
|
3
|
+
import { i as we, r as T, t as Pe } from "./dist-D-yS0HN8.js";
|
|
4
|
+
import { t as Re } from "./dist-pWlMx4Fi2.js";
|
|
5
|
+
import { t as _e } from "./dist-CzKqHuqJ2.js";
|
|
6
|
+
import { t as xe } from "./dist-DGOjiAnB2.js";
|
|
7
|
+
import * as u from "react";
|
|
8
|
+
import { Fragment as Ee, jsx as S, jsxs as ye } from "react/jsx-runtime";
|
|
9
|
+
var Ce = Object.defineProperty, Me = (t, e) => Ce(t, "name", {
|
|
10
|
+
value: e,
|
|
11
|
+
configurable: !0
|
|
12
|
+
});
|
|
13
|
+
function j(t, [e, r]) {
|
|
14
|
+
return Math.min(r, Math.max(e, t));
|
|
15
|
+
}
|
|
16
|
+
Me(j, "clamp");
|
|
17
|
+
var Te = Object.defineProperty, De = (t, e) => Te(t, "name", {
|
|
18
|
+
value: e,
|
|
19
|
+
configurable: !0
|
|
20
|
+
});
|
|
21
|
+
function te(t) {
|
|
22
|
+
const e = u.useRef({
|
|
23
|
+
value: t,
|
|
24
|
+
previous: t
|
|
25
|
+
});
|
|
26
|
+
return u.useMemo(() => (e.current.value !== t && (e.current.previous = e.current.value, e.current.value = t), e.current.previous), [t]);
|
|
27
|
+
}
|
|
28
|
+
De(te, "usePrevious");
|
|
29
|
+
var Ve = Object.defineProperty, c = (t, e) => Ve(t, "name", {
|
|
30
|
+
value: e,
|
|
31
|
+
configurable: !0
|
|
32
|
+
}), ne = ["PageUp", "PageDown"], re = [
|
|
33
|
+
"ArrowUp",
|
|
34
|
+
"ArrowDown",
|
|
35
|
+
"ArrowLeft",
|
|
36
|
+
"ArrowRight"
|
|
37
|
+
], oe = {
|
|
38
|
+
"from-left": [
|
|
39
|
+
"Home",
|
|
40
|
+
"PageDown",
|
|
41
|
+
"ArrowDown",
|
|
42
|
+
"ArrowLeft"
|
|
43
|
+
],
|
|
44
|
+
"from-right": [
|
|
45
|
+
"Home",
|
|
46
|
+
"PageDown",
|
|
47
|
+
"ArrowDown",
|
|
48
|
+
"ArrowRight"
|
|
49
|
+
],
|
|
50
|
+
"from-bottom": [
|
|
51
|
+
"Home",
|
|
52
|
+
"PageDown",
|
|
53
|
+
"ArrowDown",
|
|
54
|
+
"ArrowLeft"
|
|
55
|
+
],
|
|
56
|
+
"from-top": [
|
|
57
|
+
"Home",
|
|
58
|
+
"PageDown",
|
|
59
|
+
"ArrowUp",
|
|
60
|
+
"ArrowLeft"
|
|
61
|
+
]
|
|
62
|
+
}, A = "Slider", [U, Ie, Be] = _e(A), [Y, qe] = we(A, [Be]), [Ae, K] = Y(A), Je = /* @__PURE__ */ u.forwardRef(/* @__PURE__ */ c(function(e, r) {
|
|
63
|
+
const { name: o, min: i = 0, max: n = 100, step: l = 1, orientation: s = "horizontal", disabled: d = !1, minStepsBetweenThumbs: f = 0, defaultValue: h = [i], value: p, onValueChange: a = /* @__PURE__ */ c(() => {
|
|
64
|
+
}, "onValueChange"), onValueCommit: m = /* @__PURE__ */ c(() => {
|
|
65
|
+
}, "onValueCommit"), inverted: P = !1, form: g, ...v } = e, w = u.useRef(/* @__PURE__ */ new Set()), R = u.useRef(0), x = u.useRef(!1), E = s === "horizontal" ? Ke : Fe, [_, k] = u.useState(null), ve = D(r, k), [y = [], z] = Pe({
|
|
66
|
+
prop: p,
|
|
67
|
+
defaultProp: h,
|
|
68
|
+
onChange: /* @__PURE__ */ c((b) => {
|
|
69
|
+
[...w.current][R.current]?.focus({
|
|
70
|
+
preventScroll: !0,
|
|
71
|
+
focusVisible: x.current
|
|
72
|
+
}), x.current = !1, a(b);
|
|
73
|
+
}, "onChange")
|
|
74
|
+
}), W = u.useRef(y), be = u.useRef(y);
|
|
75
|
+
u.useEffect(() => {
|
|
76
|
+
const b = g ? _?.ownerDocument.getElementById(g) : _?.closest("form");
|
|
77
|
+
if (b instanceof HTMLFormElement) {
|
|
78
|
+
const M = /* @__PURE__ */ c(() => z(be.current), "reset");
|
|
79
|
+
return b.addEventListener("reset", M), () => b.removeEventListener("reset", M);
|
|
80
|
+
}
|
|
81
|
+
}, [
|
|
82
|
+
_,
|
|
83
|
+
g,
|
|
84
|
+
z
|
|
85
|
+
]);
|
|
86
|
+
function q(b) {
|
|
87
|
+
C(b, fe(y, b));
|
|
88
|
+
}
|
|
89
|
+
c(q, "handleSlideStart");
|
|
90
|
+
function J(b) {
|
|
91
|
+
C(b, R.current);
|
|
92
|
+
}
|
|
93
|
+
c(J, "handleSlideMove");
|
|
94
|
+
function Q() {
|
|
95
|
+
String(y) !== String(W.current) && m(y);
|
|
96
|
+
}
|
|
97
|
+
c(Q, "handleSlideEnd");
|
|
98
|
+
function C(b, M, { commit: L } = { commit: !1 }) {
|
|
99
|
+
const F = X(l), N = j(I(Math.round((b - i) / l) * l + i, F), [i, n]);
|
|
100
|
+
z((H = []) => {
|
|
101
|
+
const V = ue(H, N, M);
|
|
102
|
+
if (he(V, f * l)) {
|
|
103
|
+
R.current = V.indexOf(N);
|
|
104
|
+
const Z = String(V) !== String(H);
|
|
105
|
+
return Z && L && m(V), Z ? V : H;
|
|
106
|
+
} else return H;
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
return c(C, "updateValues"), /* @__PURE__ */ S(Ae, {
|
|
110
|
+
scope: e.__scopeSlider,
|
|
111
|
+
name: o,
|
|
112
|
+
disabled: d,
|
|
113
|
+
min: i,
|
|
114
|
+
max: n,
|
|
115
|
+
valueIndexToChangeRef: R,
|
|
116
|
+
thumbs: w.current,
|
|
117
|
+
values: y,
|
|
118
|
+
orientation: s,
|
|
119
|
+
form: g,
|
|
120
|
+
children: /* @__PURE__ */ S(U.Provider, {
|
|
121
|
+
scope: e.__scopeSlider,
|
|
122
|
+
children: /* @__PURE__ */ S(U.Slot, {
|
|
123
|
+
scope: e.__scopeSlider,
|
|
124
|
+
children: /* @__PURE__ */ S(E, {
|
|
125
|
+
"aria-disabled": d,
|
|
126
|
+
"data-disabled": d ? "" : void 0,
|
|
127
|
+
...v,
|
|
128
|
+
ref: ve,
|
|
129
|
+
onPointerDown: T(v.onPointerDown, () => {
|
|
130
|
+
d || (W.current = y, x.current = !1);
|
|
131
|
+
}),
|
|
132
|
+
min: i,
|
|
133
|
+
max: n,
|
|
134
|
+
inverted: P,
|
|
135
|
+
onSlideStart: d ? void 0 : q,
|
|
136
|
+
onSlideMove: d ? void 0 : J,
|
|
137
|
+
onSlideEnd: d ? void 0 : Q,
|
|
138
|
+
onHomeKeyDown: () => {
|
|
139
|
+
d || (x.current = !0, C(i, 0, { commit: !0 }));
|
|
140
|
+
},
|
|
141
|
+
onEndKeyDown: () => {
|
|
142
|
+
d || (x.current = !0, C(n, y.length - 1, { commit: !0 }));
|
|
143
|
+
},
|
|
144
|
+
onStepKeyDown: ({ event: b, direction: M }) => {
|
|
145
|
+
if (!d) {
|
|
146
|
+
x.current = !0;
|
|
147
|
+
const L = ne.includes(b.key) || b.shiftKey && re.includes(b.key) ? 10 : 1, F = R.current, N = y[F];
|
|
148
|
+
C(pe(N, {
|
|
149
|
+
min: i,
|
|
150
|
+
step: l,
|
|
151
|
+
direction: M,
|
|
152
|
+
multiplier: L
|
|
153
|
+
}), F, { commit: !0 });
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
})
|
|
157
|
+
})
|
|
158
|
+
})
|
|
159
|
+
});
|
|
160
|
+
}, "Slider")), [ie, ae] = Y(A, {
|
|
161
|
+
startEdge: "left",
|
|
162
|
+
endEdge: "right",
|
|
163
|
+
size: "width",
|
|
164
|
+
direction: 1
|
|
165
|
+
}), Ke = /* @__PURE__ */ u.forwardRef(/* @__PURE__ */ c(function(e, r) {
|
|
166
|
+
const { min: o, max: i, dir: n, inverted: l, onSlideStart: s, onSlideMove: d, onSlideEnd: f, onStepKeyDown: h, ...p } = e, [a, m] = u.useState(null), P = D(r, m), g = u.useRef(void 0), v = xe(n), w = v === "ltr", R = w && !l || !w && l;
|
|
167
|
+
function x(E) {
|
|
168
|
+
const _ = g.current || a.getBoundingClientRect(), k = O([0, _.width], R ? [o, i] : [i, o]);
|
|
169
|
+
return g.current = _, k(E - _.left);
|
|
170
|
+
}
|
|
171
|
+
return c(x, "getValueFromPointer"), /* @__PURE__ */ S(ie, {
|
|
172
|
+
scope: e.__scopeSlider,
|
|
173
|
+
startEdge: R ? "left" : "right",
|
|
174
|
+
endEdge: R ? "right" : "left",
|
|
175
|
+
direction: R ? 1 : -1,
|
|
176
|
+
size: "width",
|
|
177
|
+
children: /* @__PURE__ */ S(se, {
|
|
178
|
+
dir: v,
|
|
179
|
+
"data-orientation": "horizontal",
|
|
180
|
+
...p,
|
|
181
|
+
ref: P,
|
|
182
|
+
style: {
|
|
183
|
+
...p.style,
|
|
184
|
+
"--radix-slider-thumb-transform": "translateX(-50%)"
|
|
185
|
+
},
|
|
186
|
+
onSlideStart: (E) => {
|
|
187
|
+
const _ = x(E.clientX);
|
|
188
|
+
s?.(_);
|
|
189
|
+
},
|
|
190
|
+
onSlideMove: (E) => {
|
|
191
|
+
const _ = x(E.clientX);
|
|
192
|
+
d?.(_);
|
|
193
|
+
},
|
|
194
|
+
onSlideEnd: () => {
|
|
195
|
+
g.current = void 0, f?.();
|
|
196
|
+
},
|
|
197
|
+
onStepKeyDown: (E) => {
|
|
198
|
+
const _ = oe[R ? "from-left" : "from-right"].includes(E.key);
|
|
199
|
+
h?.({
|
|
200
|
+
event: E,
|
|
201
|
+
direction: _ ? -1 : 1
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
})
|
|
205
|
+
});
|
|
206
|
+
}, "SliderHorizontal")), Fe = /* @__PURE__ */ u.forwardRef(/* @__PURE__ */ c(function(e, r) {
|
|
207
|
+
const { min: o, max: i, inverted: n, onSlideStart: l, onSlideMove: s, onSlideEnd: d, onStepKeyDown: f, ...h } = e, p = u.useRef(null), a = D(r, p), m = u.useRef(void 0), P = !n;
|
|
208
|
+
function g(v) {
|
|
209
|
+
const w = m.current || p.current.getBoundingClientRect(), R = O([0, w.height], P ? [i, o] : [o, i]);
|
|
210
|
+
return m.current = w, R(v - w.top);
|
|
211
|
+
}
|
|
212
|
+
return c(g, "getValueFromPointer"), /* @__PURE__ */ S(ie, {
|
|
213
|
+
scope: e.__scopeSlider,
|
|
214
|
+
startEdge: P ? "bottom" : "top",
|
|
215
|
+
endEdge: P ? "top" : "bottom",
|
|
216
|
+
size: "height",
|
|
217
|
+
direction: P ? 1 : -1,
|
|
218
|
+
children: /* @__PURE__ */ S(se, {
|
|
219
|
+
"data-orientation": "vertical",
|
|
220
|
+
...h,
|
|
221
|
+
ref: a,
|
|
222
|
+
style: {
|
|
223
|
+
...h.style,
|
|
224
|
+
"--radix-slider-thumb-transform": "translateY(50%)"
|
|
225
|
+
},
|
|
226
|
+
onSlideStart: (v) => {
|
|
227
|
+
const w = g(v.clientY);
|
|
228
|
+
l?.(w);
|
|
229
|
+
},
|
|
230
|
+
onSlideMove: (v) => {
|
|
231
|
+
const w = g(v.clientY);
|
|
232
|
+
s?.(w);
|
|
233
|
+
},
|
|
234
|
+
onSlideEnd: () => {
|
|
235
|
+
m.current = void 0, d?.();
|
|
236
|
+
},
|
|
237
|
+
onStepKeyDown: (v) => {
|
|
238
|
+
const w = oe[P ? "from-bottom" : "from-top"].includes(v.key);
|
|
239
|
+
f?.({
|
|
240
|
+
event: v,
|
|
241
|
+
direction: w ? -1 : 1
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
})
|
|
245
|
+
});
|
|
246
|
+
}, "SliderVertical")), se = /* @__PURE__ */ u.forwardRef(/* @__PURE__ */ c(function(e, r) {
|
|
247
|
+
const { __scopeSlider: o, onSlideStart: i, onSlideMove: n, onSlideEnd: l, onHomeKeyDown: s, onEndKeyDown: d, onStepKeyDown: f, ...h } = e, p = K(A, o);
|
|
248
|
+
return /* @__PURE__ */ S(B.span, {
|
|
249
|
+
...h,
|
|
250
|
+
ref: r,
|
|
251
|
+
onKeyDown: T(e.onKeyDown, (a) => {
|
|
252
|
+
a.key === "Home" ? (s(a), a.preventDefault()) : a.key === "End" ? (d(a), a.preventDefault()) : ne.concat(re).includes(a.key) && (f(a), a.preventDefault());
|
|
253
|
+
}),
|
|
254
|
+
onPointerDown: T(e.onPointerDown, (a) => {
|
|
255
|
+
const m = a.target;
|
|
256
|
+
m.setPointerCapture(a.pointerId), a.preventDefault(), p.thumbs.has(m) ? m.focus({
|
|
257
|
+
preventScroll: !0,
|
|
258
|
+
focusVisible: !1
|
|
259
|
+
}) : i(a);
|
|
260
|
+
}),
|
|
261
|
+
onPointerMove: T(e.onPointerMove, (a) => {
|
|
262
|
+
a.target.hasPointerCapture(a.pointerId) && n(a);
|
|
263
|
+
}),
|
|
264
|
+
onPointerUp: T(e.onPointerUp, (a) => {
|
|
265
|
+
const m = a.target;
|
|
266
|
+
m.hasPointerCapture(a.pointerId) && (m.releasePointerCapture(a.pointerId), l(a));
|
|
267
|
+
})
|
|
268
|
+
});
|
|
269
|
+
}, "SliderImpl")), Ne = "SliderTrack", Qe = /* @__PURE__ */ u.forwardRef(/* @__PURE__ */ c(function(e, r) {
|
|
270
|
+
const { __scopeSlider: o, ...i } = e, n = K(Ne, o);
|
|
271
|
+
return /* @__PURE__ */ S(B.span, {
|
|
272
|
+
"data-disabled": n.disabled ? "" : void 0,
|
|
273
|
+
"data-orientation": n.orientation,
|
|
274
|
+
...i,
|
|
275
|
+
ref: r
|
|
276
|
+
});
|
|
277
|
+
}, "SliderTrack")), ee = "SliderRange", Ze = /* @__PURE__ */ u.forwardRef(/* @__PURE__ */ c(function(e, r) {
|
|
278
|
+
const { __scopeSlider: o, ...i } = e, n = K(ee, o), l = ae(ee, o), s = D(r, u.useRef(null)), d = n.values.length, f = n.values.map((a) => G(a, n.min, n.max)), h = d > 1 ? Math.min(...f) : 0, p = 100 - Math.max(...f);
|
|
279
|
+
return /* @__PURE__ */ S(B.span, {
|
|
280
|
+
"data-orientation": n.orientation,
|
|
281
|
+
"data-disabled": n.disabled ? "" : void 0,
|
|
282
|
+
...i,
|
|
283
|
+
ref: s,
|
|
284
|
+
style: {
|
|
285
|
+
...e.style,
|
|
286
|
+
[l.startEdge]: h + "%",
|
|
287
|
+
[l.endEdge]: p + "%"
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
}, "SliderRange")), [He, le] = Y("SliderThumb"), Oe = "SliderThumbProvider";
|
|
291
|
+
function ce(t) {
|
|
292
|
+
const { __scopeSlider: e, name: r, children: o, internal_do_not_use_render: i } = t, n = K(Oe, e), l = Ie(e), [s, d] = u.useState(null), f = u.useMemo(() => s ? l().findIndex((v) => v.ref.current === s) : -1, [l, s]), h = Re(s), p = s ? !!n.form || !!s.closest("form") : !0, a = n.values[f], m = r ?? (n.name ? n.name + (n.values.length > 1 ? "[]" : "") : void 0), P = a === void 0 ? 0 : G(a, n.min, n.max);
|
|
293
|
+
u.useEffect(() => {
|
|
294
|
+
if (s)
|
|
295
|
+
return n.thumbs.add(s), () => {
|
|
296
|
+
n.thumbs.delete(s);
|
|
297
|
+
};
|
|
298
|
+
}, [s, n.thumbs]);
|
|
299
|
+
const g = {
|
|
300
|
+
value: a,
|
|
301
|
+
name: m,
|
|
302
|
+
form: n.form,
|
|
303
|
+
isFormControl: p,
|
|
304
|
+
index: f,
|
|
305
|
+
thumb: s,
|
|
306
|
+
onThumbChange: d,
|
|
307
|
+
percent: P,
|
|
308
|
+
size: h
|
|
309
|
+
};
|
|
310
|
+
return /* @__PURE__ */ S(He, {
|
|
311
|
+
scope: e,
|
|
312
|
+
...g,
|
|
313
|
+
children: ge(i) ? i(g) : o
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
c(ce, "SliderThumbProvider");
|
|
317
|
+
var $ = "SliderThumbTrigger", ke = /* @__PURE__ */ u.forwardRef(/* @__PURE__ */ c(function(e, r) {
|
|
318
|
+
const { __scopeSlider: o, ...i } = e, n = K($, o), l = ae($, o), { index: s, value: d, percent: f, size: h, onThumbChange: p } = le($, o), a = D(r, p), m = de(s, n.values.length), P = h?.[l.size], g = P ? me(P, f, l.direction) : 0;
|
|
319
|
+
return /* @__PURE__ */ S("span", {
|
|
320
|
+
style: {
|
|
321
|
+
transform: "var(--radix-slider-thumb-transform)",
|
|
322
|
+
position: "absolute",
|
|
323
|
+
[l.startEdge]: `calc(${f}% + ${g}px)`
|
|
324
|
+
},
|
|
325
|
+
children: /* @__PURE__ */ S(U.ItemSlot, {
|
|
326
|
+
scope: o,
|
|
327
|
+
children: /* @__PURE__ */ S(B.span, {
|
|
328
|
+
role: "slider",
|
|
329
|
+
"aria-label": e["aria-label"] || m,
|
|
330
|
+
"aria-valuemin": n.min,
|
|
331
|
+
"aria-valuenow": d,
|
|
332
|
+
"aria-valuemax": n.max,
|
|
333
|
+
"aria-orientation": n.orientation,
|
|
334
|
+
"data-orientation": n.orientation,
|
|
335
|
+
"data-disabled": n.disabled ? "" : void 0,
|
|
336
|
+
tabIndex: n.disabled ? void 0 : 0,
|
|
337
|
+
...i,
|
|
338
|
+
ref: a,
|
|
339
|
+
style: d === void 0 ? { display: "none" } : e.style,
|
|
340
|
+
onFocus: T(e.onFocus, () => {
|
|
341
|
+
n.valueIndexToChangeRef.current = s;
|
|
342
|
+
})
|
|
343
|
+
})
|
|
344
|
+
})
|
|
345
|
+
});
|
|
346
|
+
}, "SliderThumbTrigger")), et = /* @__PURE__ */ u.forwardRef(/* @__PURE__ */ c(function(e, r) {
|
|
347
|
+
const { __scopeSlider: o, name: i, ...n } = e;
|
|
348
|
+
return /* @__PURE__ */ S(ce, {
|
|
349
|
+
__scopeSlider: o,
|
|
350
|
+
name: i,
|
|
351
|
+
internal_do_not_use_render: ({ index: l, isFormControl: s }) => /* @__PURE__ */ ye(Ee, { children: [/* @__PURE__ */ S(ke, {
|
|
352
|
+
...n,
|
|
353
|
+
ref: r,
|
|
354
|
+
__scopeSlider: o
|
|
355
|
+
}), s ? /* @__PURE__ */ S(Le, { __scopeSlider: o }, l) : null] })
|
|
356
|
+
});
|
|
357
|
+
}, "SliderThumb")), ze = "SliderBubbleInput", Le = /* @__PURE__ */ u.forwardRef(/* @__PURE__ */ c(function({ __scopeSlider: e, ...r }, o) {
|
|
358
|
+
const { value: i, name: n, form: l } = le(ze, e), s = u.useRef(null), d = D(s, o), f = te(i);
|
|
359
|
+
return u.useEffect(() => {
|
|
360
|
+
const h = s.current;
|
|
361
|
+
if (!h) return;
|
|
362
|
+
const p = window.HTMLInputElement.prototype, a = Object.getOwnPropertyDescriptor(p, "value").set;
|
|
363
|
+
if (f !== i && a) {
|
|
364
|
+
const m = new Event("input", { bubbles: !0 });
|
|
365
|
+
a.call(h, i), h.dispatchEvent(m);
|
|
366
|
+
}
|
|
367
|
+
}, [f, i]), /* @__PURE__ */ S(B.input, {
|
|
368
|
+
style: { display: "none" },
|
|
369
|
+
name: n,
|
|
370
|
+
form: l,
|
|
371
|
+
...r,
|
|
372
|
+
ref: d,
|
|
373
|
+
defaultValue: i
|
|
374
|
+
});
|
|
375
|
+
}, "SliderBubbleInput"));
|
|
376
|
+
function ue(t = [], e, r) {
|
|
377
|
+
const o = [...t];
|
|
378
|
+
return o[r] = e, o.sort((i, n) => i - n);
|
|
379
|
+
}
|
|
380
|
+
c(ue, "getNextSortedValues");
|
|
381
|
+
function G(t, e, r) {
|
|
382
|
+
return j(100 / (r - e) * (t - e), [0, 100]);
|
|
383
|
+
}
|
|
384
|
+
c(G, "convertValueToPercentage");
|
|
385
|
+
function de(t, e) {
|
|
386
|
+
return e > 2 ? `Value ${t + 1} of ${e}` : e === 2 ? ["Minimum", "Maximum"][t] : void 0;
|
|
387
|
+
}
|
|
388
|
+
c(de, "getLabel");
|
|
389
|
+
function fe(t, e) {
|
|
390
|
+
if (t.length === 1) return 0;
|
|
391
|
+
const r = t.map((i) => Math.abs(i - e)), o = Math.min(...r);
|
|
392
|
+
return r.indexOf(o);
|
|
393
|
+
}
|
|
394
|
+
c(fe, "getClosestValueIndex");
|
|
395
|
+
function me(t, e, r) {
|
|
396
|
+
const o = t / 2;
|
|
397
|
+
return (o - O([0, 50], [0, o])(e) * r) * r;
|
|
398
|
+
}
|
|
399
|
+
c(me, "getThumbInBoundsOffset");
|
|
400
|
+
function Se(t) {
|
|
401
|
+
return t.slice(0, -1).map((e, r) => t[r + 1] - e);
|
|
402
|
+
}
|
|
403
|
+
c(Se, "getStepsBetweenValues");
|
|
404
|
+
function he(t, e) {
|
|
405
|
+
if (e > 0) {
|
|
406
|
+
const r = Se(t);
|
|
407
|
+
return Math.min(...r) >= e;
|
|
408
|
+
}
|
|
409
|
+
return !0;
|
|
410
|
+
}
|
|
411
|
+
c(he, "hasMinStepsBetweenValues");
|
|
412
|
+
function O(t, e) {
|
|
413
|
+
return (r) => {
|
|
414
|
+
if (t[0] === t[1] || e[0] === e[1]) return e[0];
|
|
415
|
+
const o = (e[1] - e[0]) / (t[1] - t[0]);
|
|
416
|
+
return e[0] + o * (r - t[0]);
|
|
417
|
+
};
|
|
418
|
+
}
|
|
419
|
+
c(O, "linearScale");
|
|
420
|
+
function X(t) {
|
|
421
|
+
if (!Number.isFinite(t)) return 0;
|
|
422
|
+
const e = t.toString();
|
|
423
|
+
if (e.includes("e")) {
|
|
424
|
+
const [o, i] = e.split("e"), n = o.split(".")[1] || "", l = Number(i);
|
|
425
|
+
return Math.max(0, n.length - l);
|
|
426
|
+
}
|
|
427
|
+
const r = e.split(".")[1];
|
|
428
|
+
return r ? r.length : 0;
|
|
429
|
+
}
|
|
430
|
+
c(X, "getDecimalCount");
|
|
431
|
+
function I(t, e) {
|
|
432
|
+
const r = Math.pow(10, e);
|
|
433
|
+
return Math.round(t * r) / r;
|
|
434
|
+
}
|
|
435
|
+
c(I, "roundValue");
|
|
436
|
+
function pe(t, { min: e, step: r, direction: o, multiplier: i }) {
|
|
437
|
+
const n = X(r), l = (t - e) / r, s = Math.round(l), d = I(s * r + e, n) === I(t, n);
|
|
438
|
+
let f;
|
|
439
|
+
return d ? f = s + i * o : o > 0 ? f = Math.ceil(l) : f = Math.floor(l), I(f * r + e, n);
|
|
440
|
+
}
|
|
441
|
+
c(pe, "getNextStepValue");
|
|
442
|
+
function ge(t) {
|
|
443
|
+
return typeof t == "function";
|
|
444
|
+
}
|
|
445
|
+
c(ge, "isFunction");
|
|
446
|
+
export {
|
|
447
|
+
Qe as i,
|
|
448
|
+
Ze as n,
|
|
449
|
+
et as r,
|
|
450
|
+
Je as t
|
|
451
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as Xt } from "./dist-
|
|
2
|
-
import { t as Ot } from "./dist-
|
|
3
|
-
import { i as ve, n as xt } from "./dist-
|
|
4
|
-
import { t as xe } from "./dist-
|
|
5
|
-
import { t as ye } from "./dist-
|
|
1
|
+
import { a as Xt } from "./dist-xCbHbMLA.js";
|
|
2
|
+
import { t as Ot } from "./dist-CCdbu9GU.js";
|
|
3
|
+
import { i as ve, n as xt } from "./dist-D-yS0HN8.js";
|
|
4
|
+
import { t as xe } from "./dist-D5XYRjmR.js";
|
|
5
|
+
import { t as ye } from "./dist-pWlMx4Fi2.js";
|
|
6
6
|
import * as O from "react";
|
|
7
7
|
import { useLayoutEffect as be } from "react";
|
|
8
8
|
import * as Ae from "react-dom";
|