@konstructio/ui 0.1.2-alpha.101 → 0.1.2-alpha.103
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/AlertDialogTrigger-CgcsW_ta.js +109 -0
- package/dist/{Breadcrumb-Bmv0vzgt.js → Breadcrumb-Cp3abB2w.js} +1 -1
- package/dist/Checkbox-DzAx7n67.js +249 -0
- package/dist/{CommandInput-CYYsk_31.js → CommandInput-BnvRMfLI.js} +2 -2
- package/dist/{Counter-DWKyr569.js → Counter-CY0xGnVM.js} +2 -2
- package/dist/{DayPicker-CwO8Zff5.js → DayPicker-kweJz134.js} +750 -746
- package/dist/{DropdownButton-Beel5_gN.js → DropdownButton-DnlwdPmb.js} +1 -1
- package/dist/FlagSelectorList-BoYG-_It.js +852 -0
- package/dist/{HamburgerTrigger-7a4POUaM.js → HamburgerTrigger-1vOTrm8-.js} +2 -2
- package/dist/{Input-DG3snJf_.js → Input-CW0VwW2T.js} +4 -4
- package/dist/{Modal-Bcu6LLAp.js → Modal-Bfzggwlr.js} +2 -2
- package/dist/{Spinner-BegZ5yd7.js → Spinner-Lw9mZYhg.js} +1 -1
- package/dist/Switch-WBRr8uOJ.js +196 -0
- package/dist/Toast-ByH-l4XK.js +459 -0
- package/dist/{Wrapper-DwxJAkNQ.js → Wrapper-ClJ_Mham.js} +2 -2
- package/dist/{Wrapper-DtT29fc5.js → Wrapper-XeeD3av7.js} +1 -1
- package/dist/components/Alert/Alert.js +2 -2
- 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/Breadcrumb/Breadcrumb.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 +1 -1
- 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 +1 -1
- 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/Counter/Counter.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/components/CalendarMonth/CalendarMonth.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/Datepicker/DatePicker.js +2 -3
- package/dist/components/Drawer/Drawer.js +2 -2
- package/dist/components/DropdownButton/DropdownButton.js +1 -1
- package/dist/components/Filter/Filter.js +4 -3
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.hook.js +23 -24
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +60 -65
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.hook.js +35 -43
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.js +40 -45
- package/dist/components/Filter/components/DateRangeFilterDropdown/DateRangeFilterDropdown.hook.js +33 -34
- package/dist/components/Filter/components/DateRangeFilterDropdown/DateRangeFilterDropdown.js +45 -51
- package/dist/components/Filter/components/FilterDropdown/FilterDropdown.js +28 -0
- package/dist/components/Filter/components/TextMultiSelect/TextMultiSelect.js +56 -61
- package/dist/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.hook.js +33 -34
- package/dist/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.js +70 -75
- package/dist/components/Filter/contexts/filter.provider.js +8 -5
- package/dist/components/Filter/utils/index.js +1 -1
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/LineChart/LineChart.js +1 -1
- package/dist/components/Modal/Modal.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/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/PhoneNumberInput/PhoneNumberInput.js +2 -2
- package/dist/components/PhoneNumberInput/components/FlagSelectorList/FlagSelectorList.js +1 -1
- package/dist/components/PhoneNumberInput/components/FlagSelectorWrapper/FlagSelectorWrapper.js +2 -2
- package/dist/components/PhoneNumberInput/components/TruncateText/TruncateText.js +2 -2
- package/dist/components/PhoneNumberInput/components/Wrapper.js +1 -1
- package/dist/components/PhoneNumberInput/components/index.js +2 -2
- package/dist/components/PhoneNumberInput/contexts/index.js +1 -1
- package/dist/components/PhoneNumberInput/contexts/phone-number.provider.js +1 -1
- package/dist/components/PieChart/PieChart.js +1 -1
- package/dist/components/Range/Range.js +1 -1
- package/dist/components/Select/components/List/List.js +1 -1
- package/dist/components/Sidebar/components/HamburgerTrigger/HamburgerTrigger.js +1 -1
- package/dist/components/Sidebar/components/NavigationOption/NavigationOption.js +1 -1
- package/dist/components/Sidebar/components/Wrapper/Wrapper.js +1 -1
- package/dist/components/Sidebar/components/index.js +1 -1
- package/dist/components/Slider/Slider.js +1 -1
- package/dist/components/Spinner/Spinner.js +1 -1
- 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/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/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/Toast/Toast.js +1 -1
- package/dist/components/Tooltip/Tooltip.js +1 -1
- package/dist/components/VirtualizedTable/VirtualizedTable.js +87 -87
- package/dist/components/VirtualizedTable/components/Actions/Actions.js +19 -19
- package/dist/components/VirtualizedTable/components/Body/Body.js +50 -49
- package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +67 -21
- package/dist/components/VirtualizedTable/components/ExpandableRow/ExpandableRow.js +1 -1
- package/dist/components/VirtualizedTable/components/Filter/Filter.js +53 -63
- package/dist/components/VirtualizedTable/components/FormPaginate/FormPaginate.js +10 -10
- package/dist/components/VirtualizedTable/components/Header/Header.js +47 -34
- package/dist/components/VirtualizedTable/components/Pagination/Pagination.js +19 -15
- package/dist/components/VirtualizedTable/components/Skeleton/Skeleton.js +10 -10
- package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.js +1 -1
- package/dist/components/VirtualizedTable/components/WrapperBody/WrapperBody.js +8 -8
- package/dist/components/VirtualizedTable/contexts/index.js +1 -1
- package/dist/components/VirtualizedTable/contexts/table.context.js +1 -0
- package/dist/components/VirtualizedTable/contexts/table.provider.js +1 -1
- package/dist/components/index.js +10 -10
- package/dist/{components-CYt24H4n.js → components-BIHlj4yH.js} +1 -1
- package/dist/{debounce-KoeGNmnW.js → debounce-C5Ycjilj.js} +14 -14
- package/dist/dist-2bGlmy8N2.js +165 -0
- package/dist/dist-BiJrNvNo.js +193 -0
- package/dist/dist-BuFiu480.js +13 -0
- package/dist/dist-C2aTw0m62.js +1320 -0
- package/dist/{dist-DvoMuWKO2.js → dist-C2s4VX-42.js} +4 -4
- package/dist/dist-CT6d9xe7.js +441 -0
- package/dist/dist-CTvBzxW8.js +31 -0
- package/dist/dist-CVDFmWf2.js +358 -0
- package/dist/dist-D4FePjTS.js +194 -0
- package/dist/dist-DISvWx7U.js +99 -0
- package/dist/dist-Db6UeFo4.js +291 -0
- package/dist/{dist-DGO9opgu.js → dist-Dse3gSmZ.js} +49 -49
- package/dist/dist-j7FOUrFU.js +206 -0
- package/dist/{dist-C8NWUTUh.js → dist-l-aDnQZC.js} +1 -1
- package/dist/es2015-BWf6xQHm.js +222 -0
- package/dist/index.js +10 -10
- package/dist/{isObject-1ZmdWuhC.js → isObject-BeFFiVJK.js} +8 -8
- package/dist/lib/components/Alert/Alert.types.d.ts +1 -1
- package/dist/lib/components/AlertDialog/AlertDialog.types.d.ts +1 -1
- package/dist/lib/components/AlertDialog/components/AlertDialogTrigger.types.d.ts +2 -2
- package/dist/lib/components/Autocomplete/Autocomplete.types.d.ts +1 -1
- package/dist/lib/components/Breadcrumb/Breadcrumb.types.d.ts +1 -1
- package/dist/lib/components/Breadcrumb/components/BackButton/BackButton.types.d.ts +1 -1
- package/dist/lib/components/Breadcrumb/components/Item/Item.types.d.ts +1 -1
- package/dist/lib/components/Button/Button.types.d.ts +1 -1
- package/dist/lib/components/ButtonGroup/ButtonGroup.types.d.ts +1 -1
- package/dist/lib/components/Card/Card.types.d.ts +1 -1
- package/dist/lib/components/Checkbox/Checkbox.types.d.ts +1 -1
- package/dist/lib/components/Command/Command.types.d.ts +1 -1
- package/dist/lib/components/Counter/Counter.types.d.ts +1 -1
- package/dist/lib/components/DateRangePicker/DateRangePicker.types.d.ts +1 -1
- package/dist/lib/components/Drawer/Drawer.types.d.ts +1 -1
- package/dist/lib/components/Filter/Filter.types.d.ts +1 -1
- package/dist/lib/components/Filter/components/BadgeDropdown/BadgeMultiSelect.hook.d.ts +2 -3
- package/dist/lib/components/Filter/components/DateFilterDropdown/DateFilterDropdown.hook.d.ts +1 -2
- package/dist/lib/components/Filter/components/DateRangeFilterDropdown/DateRangeFilterDropdown.hook.d.ts +2 -3
- package/dist/lib/components/Filter/components/DateRangeFilterDropdown/DateRangeFilterDropdown.types.d.ts +1 -1
- package/dist/lib/components/Filter/components/FilterDropdown/FilterDropdown.d.ts +3 -0
- package/dist/lib/components/Filter/components/FilterDropdown/FilterDropdown.types.d.ts +9 -0
- package/dist/lib/components/Filter/components/ResetButton/ResetButton.types.d.ts +1 -1
- package/dist/lib/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.hook.d.ts +1 -2
- package/dist/lib/components/Filter/contexts/filter.context.d.ts +1 -0
- package/dist/lib/components/ImageUpload/ImageUpload.types.d.ts +1 -1
- package/dist/lib/components/Input/Input.types.d.ts +1 -1
- package/dist/lib/components/LineChart/LineChart.types.d.ts +1 -1
- package/dist/lib/components/Loading/Loading.types.d.ts +1 -1
- package/dist/lib/components/Modal/Modal.types.d.ts +1 -1
- package/dist/lib/components/Modal/components/Wrapper/Wrapper.types.d.ts +1 -1
- package/dist/lib/components/MultiSelectDropdown/components/Item/Item.types.d.ts +1 -1
- package/dist/lib/components/MultiSelectDropdown/components/List/List.types.d.ts +1 -1
- package/dist/lib/components/MultiSelectDropdown/components/Wrapper/Wrapper.types.d.ts +1 -1
- package/dist/lib/components/ProgressBar/ProgressBar.types.d.ts +1 -1
- package/dist/lib/components/Radio/Radio.types.d.ts +1 -1
- package/dist/lib/components/RadioCard/RadioCard.types.d.ts +1 -1
- package/dist/lib/components/RadioCardGroup/RadioCardGroup.types.d.ts +1 -1
- package/dist/lib/components/RadioGroup/RadioGroup.types.d.ts +1 -1
- package/dist/lib/components/Range/Range.types.d.ts +1 -1
- package/dist/lib/components/Select/Select.types.d.ts +1 -1
- package/dist/lib/components/Sidebar/Sidebar.types.d.ts +2 -2
- package/dist/lib/components/Sidebar/components/Label/Label.types.d.ts +1 -1
- package/dist/lib/components/Slider/Slider.types.d.ts +1 -1
- package/dist/lib/components/Spinner/Spinner.types.d.ts +2 -2
- package/dist/lib/components/Stepper/Stepper.types.d.ts +1 -1
- package/dist/lib/components/Stepper/components/StepItem/StepItem.types.d.ts +1 -1
- package/dist/lib/components/Switch/Switch.types.d.ts +1 -1
- package/dist/lib/components/Table/Table.types.d.ts +1 -1
- package/dist/lib/components/Tabs/Tabs.types.d.ts +1 -1
- package/dist/lib/components/TagSelect/TagSelect.types.d.ts +1 -1
- package/dist/lib/components/TagSelect/components/Item/Item.types.d.ts +2 -2
- package/dist/lib/components/TagSelect/components/List/List.types.d.ts +1 -1
- package/dist/lib/components/TagSelect/components/Wrapper/Wrapper.types.d.ts +1 -1
- package/dist/lib/components/TagSelect/contexts/TagSelect.types.d.ts +1 -1
- package/dist/lib/components/TextArea/TextArea.types.d.ts +1 -1
- package/dist/lib/components/Toast/Toast.types.d.ts +1 -1
- package/dist/lib/components/Typography/Typography.types.d.ts +1 -1
- package/dist/lib/components/VirtualizedTable/VirtualizedTable.types.d.ts +27 -3
- package/dist/lib/components/VirtualizedTable/components/Body/Body.d.ts +1 -1
- package/dist/lib/components/VirtualizedTable/components/Body/Body.types.d.ts +1 -0
- package/dist/lib/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.types.d.ts +2 -0
- package/dist/lib/components/VirtualizedTable/components/Filter/Filter.types.d.ts +1 -1
- package/dist/lib/components/VirtualizedTable/components/Header/Header.d.ts +1 -1
- package/dist/lib/components/VirtualizedTable/components/Header/Header.types.d.ts +1 -0
- package/dist/lib/components/VirtualizedTable/components/Pagination/Pagination.types.d.ts +2 -0
- package/dist/lib/components/VirtualizedTable/components/TruncateText/TruncateText.types.d.ts +1 -1
- package/dist/lib/components/VirtualizedTable/contexts/table.context.d.ts +2 -0
- package/dist/lib/components/VirtualizedTable/contexts/table.provider.d.ts +1 -1
- package/dist/lib/components/VirtualizedTable/contexts/table.types.d.ts +1 -0
- package/dist/lib/contexts/theme.context.d.ts +1 -1
- package/dist/lib/contexts/theme.hook.d.ts +1 -1
- package/dist/package.json +34 -33
- package/dist/{phone-number.provider-CJJOFYk-.js → phone-number.provider-BxQCTxp8.js} +457 -457
- package/dist/{prop-types-CaJpPVsa.js → prop-types-CfEYxTbR.js} +52 -52
- package/dist/styles.css +1 -1
- package/dist/{table.provider-9uUt5a-s.js → table.provider-2sAkE7z_.js} +395 -368
- package/dist/{utils-B6A9pnrH.js → utils-B-BTGYA5.js} +193 -193
- package/dist/{x-CESTrenk.js → x-BI9jmc7e.js} +1 -1
- package/package.json +34 -33
- package/dist/AlertDialogTrigger-HhbFOOUE.js +0 -124
- package/dist/Checkbox-B1rTwzR3.js +0 -240
- package/dist/FlagSelectorList-BARhzfj2.js +0 -848
- package/dist/Switch-1RGhhTtg.js +0 -178
- package/dist/Toast-CS-igZor.js +0 -467
- package/dist/dist-7edduNXi.js +0 -398
- package/dist/dist-BkYHh2kH.js +0 -408
- package/dist/dist-C6Cif8-U.js +0 -28
- package/dist/dist-CeuUxVmT.js +0 -13
- package/dist/dist-CfYOvauX.js +0 -125
- package/dist/dist-CktbIsHq.js +0 -264
- package/dist/dist-DGqWMRtc.js +0 -183
- package/dist/dist-DdFwUrO22.js +0 -11
- package/dist/dist-DnGj9MTf.js +0 -1692
- package/dist/dist-eAwtFCCA.js +0 -87
- /package/dist/{dist-AihTpWdF2.js → dist-AihTpWdF.js} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as
|
|
1
|
+
import { n } from "./dist-D4FePjTS.js";
|
|
2
|
+
import * as z from "react";
|
|
3
3
|
function u(r) {
|
|
4
|
-
const [h, e] =
|
|
5
|
-
return
|
|
4
|
+
const [h, e] = z.useState(void 0);
|
|
5
|
+
return n(() => {
|
|
6
6
|
if (r) {
|
|
7
7
|
e({
|
|
8
8
|
width: r.offsetWidth,
|
|
@@ -0,0 +1,441 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { t as i } from "./dist-CVy-ulDZ.js";
|
|
2
|
+
import * as t from "react";
|
|
3
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
4
|
+
var n = Object.defineProperty, d = (r, e) => n(r, "name", {
|
|
5
|
+
value: e,
|
|
6
|
+
configurable: !0
|
|
7
|
+
}), l = Object.freeze({
|
|
8
|
+
position: "absolute",
|
|
9
|
+
border: 0,
|
|
10
|
+
width: 1,
|
|
11
|
+
height: 1,
|
|
12
|
+
padding: 0,
|
|
13
|
+
margin: -1,
|
|
14
|
+
overflow: "hidden",
|
|
15
|
+
clip: "rect(0, 0, 0, 0)",
|
|
16
|
+
whiteSpace: "nowrap",
|
|
17
|
+
wordWrap: "normal"
|
|
18
|
+
}), f = /* @__PURE__ */ t.forwardRef(/* @__PURE__ */ d(function(e, a) {
|
|
19
|
+
return /* @__PURE__ */ o(i.span, {
|
|
20
|
+
...e,
|
|
21
|
+
ref: a,
|
|
22
|
+
style: {
|
|
23
|
+
...l,
|
|
24
|
+
...e.style
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}, "VisuallyHidden")), p = f;
|
|
28
|
+
export {
|
|
29
|
+
f as n,
|
|
30
|
+
p as t
|
|
31
|
+
};
|