@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
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
import { a as G, r as z } from "./dist-DqKFpce5.js";
|
|
2
|
+
import { t as J } from "./dist-CVy-ulDZ.js";
|
|
3
|
+
import { t as Q } from "./dist-CTvBzxW8.js";
|
|
4
|
+
import { i as W, n as Z, r as w, t as ee } from "./dist-D4FePjTS.js";
|
|
5
|
+
import { t as te } from "./dist-BuFiu480.js";
|
|
6
|
+
import { r as oe, t as re } from "./dist-j7FOUrFU.js";
|
|
7
|
+
import { t as j } from "./dist-DISvWx7U.js";
|
|
8
|
+
import { a as F, i as ne, n as ae, r as se, t as ie } from "./dist-C2aTw0m62.js";
|
|
9
|
+
import * as a from "react";
|
|
10
|
+
import { jsx as h, jsxs as le } from "react/jsx-runtime";
|
|
11
|
+
var ce = Object.defineProperty, d = (r, e) => ce(r, "name", {
|
|
12
|
+
value: e,
|
|
13
|
+
configurable: !0
|
|
14
|
+
}), [I, Se] = W("Tooltip", [F]), _ = F(), ue = "TooltipProvider", pe = 700, k = "tooltip.open", [de, S] = I(ue), fe = /* @__PURE__ */ d((r) => {
|
|
15
|
+
const { __scopeTooltip: e, delayDuration: t = pe, skipDelayDuration: o = 300, disableHoverableContent: s = !1, children: n } = r, i = a.useRef(!0), f = a.useRef(!1), u = a.useRef(0);
|
|
16
|
+
return a.useEffect(() => {
|
|
17
|
+
const c = u.current;
|
|
18
|
+
return () => window.clearTimeout(c);
|
|
19
|
+
}, []), /* @__PURE__ */ h(de, {
|
|
20
|
+
scope: e,
|
|
21
|
+
isOpenDelayedRef: i,
|
|
22
|
+
delayDuration: t,
|
|
23
|
+
onOpen: a.useCallback(() => {
|
|
24
|
+
o <= 0 || (window.clearTimeout(u.current), i.current = !1);
|
|
25
|
+
}, [o]),
|
|
26
|
+
onClose: a.useCallback(() => {
|
|
27
|
+
o <= 0 || (window.clearTimeout(u.current), u.current = window.setTimeout(() => i.current = !0, o));
|
|
28
|
+
}, [o]),
|
|
29
|
+
isPointerInTransitRef: f,
|
|
30
|
+
onPointerInTransitChange: a.useCallback((c) => {
|
|
31
|
+
f.current = c;
|
|
32
|
+
}, []),
|
|
33
|
+
disableHoverableContent: s,
|
|
34
|
+
children: n
|
|
35
|
+
});
|
|
36
|
+
}, "TooltipProvider"), A = "Tooltip", [ve, R] = I(A), Te = /* @__PURE__ */ d((r) => {
|
|
37
|
+
const { __scopeTooltip: e, children: t, open: o, defaultOpen: s, onOpenChange: n, disableHoverableContent: i, delayDuration: f } = r, u = S(A, r.__scopeTooltip), c = _(e), [p, T] = a.useState(null), [v, g] = a.useState(void 0), x = te(), l = a.useRef(0), m = i ?? u.disableHoverableContent, C = f ?? u.delayDuration, b = a.useRef(!1), [P, y] = ee({
|
|
38
|
+
prop: o,
|
|
39
|
+
defaultProp: s ?? !1,
|
|
40
|
+
onChange: /* @__PURE__ */ d((H) => {
|
|
41
|
+
H ? (u.onOpen(), document.dispatchEvent(new CustomEvent(k))) : u.onClose(), n?.(H);
|
|
42
|
+
}, "onChange"),
|
|
43
|
+
caller: A
|
|
44
|
+
}), L = a.useMemo(() => P ? b.current ? "delayed-open" : "instant-open" : "closed", [P]), O = a.useCallback(() => {
|
|
45
|
+
window.clearTimeout(l.current), l.current = 0, b.current = !1, y(!0);
|
|
46
|
+
}, [y]), D = a.useCallback(() => {
|
|
47
|
+
window.clearTimeout(l.current), l.current = 0, y(!1);
|
|
48
|
+
}, [y]), M = a.useCallback(() => {
|
|
49
|
+
window.clearTimeout(l.current), l.current = window.setTimeout(() => {
|
|
50
|
+
b.current = !0, y(!0), l.current = 0;
|
|
51
|
+
}, C);
|
|
52
|
+
}, [C, y]);
|
|
53
|
+
return a.useEffect(() => () => {
|
|
54
|
+
l.current && (window.clearTimeout(l.current), l.current = 0);
|
|
55
|
+
}, []), /* @__PURE__ */ h(ne, {
|
|
56
|
+
...c,
|
|
57
|
+
children: /* @__PURE__ */ h(ve, {
|
|
58
|
+
scope: e,
|
|
59
|
+
contentId: v ?? x,
|
|
60
|
+
setContentId: g,
|
|
61
|
+
open: P,
|
|
62
|
+
stateAttribute: L,
|
|
63
|
+
trigger: p,
|
|
64
|
+
onTriggerChange: T,
|
|
65
|
+
onTriggerEnter: a.useCallback(() => {
|
|
66
|
+
u.isOpenDelayedRef.current ? M() : O();
|
|
67
|
+
}, [
|
|
68
|
+
u.isOpenDelayedRef,
|
|
69
|
+
M,
|
|
70
|
+
O
|
|
71
|
+
]),
|
|
72
|
+
onTriggerLeave: a.useCallback(() => {
|
|
73
|
+
m ? D() : (window.clearTimeout(l.current), l.current = 0);
|
|
74
|
+
}, [D, m]),
|
|
75
|
+
onOpen: O,
|
|
76
|
+
onClose: D,
|
|
77
|
+
disableHoverableContent: m,
|
|
78
|
+
children: t
|
|
79
|
+
})
|
|
80
|
+
});
|
|
81
|
+
}, "Tooltip"), N = "TooltipTrigger", he = /* @__PURE__ */ a.forwardRef(/* @__PURE__ */ d(function(e, t) {
|
|
82
|
+
const { __scopeTooltip: o, ...s } = e, n = R(N, o), i = S(N, o), f = _(o), u = G(t, a.useRef(null), n.onTriggerChange), c = a.useRef(!1), p = a.useRef(!1), T = a.useCallback(() => c.current = !1, []);
|
|
83
|
+
return a.useEffect(() => () => document.removeEventListener("pointerup", T), [T]), /* @__PURE__ */ h(ie, {
|
|
84
|
+
asChild: !0,
|
|
85
|
+
...f,
|
|
86
|
+
children: /* @__PURE__ */ h(J.button, {
|
|
87
|
+
"aria-describedby": n.open ? n.contentId : void 0,
|
|
88
|
+
"data-state": n.stateAttribute,
|
|
89
|
+
...s,
|
|
90
|
+
ref: u,
|
|
91
|
+
onPointerMove: w(e.onPointerMove, (v) => {
|
|
92
|
+
v.pointerType !== "touch" && !p.current && !i.isPointerInTransitRef.current && (n.onTriggerEnter(), p.current = !0);
|
|
93
|
+
}),
|
|
94
|
+
onPointerLeave: w(e.onPointerLeave, () => {
|
|
95
|
+
n.onTriggerLeave(), p.current = !1;
|
|
96
|
+
}),
|
|
97
|
+
onPointerDown: w(e.onPointerDown, () => {
|
|
98
|
+
n.open && n.onClose(), c.current = !0, document.addEventListener("pointerup", T, { once: !0 });
|
|
99
|
+
}),
|
|
100
|
+
onFocus: w(e.onFocus, () => {
|
|
101
|
+
c.current || n.onOpen();
|
|
102
|
+
}),
|
|
103
|
+
onBlur: w(e.onBlur, n.onClose),
|
|
104
|
+
onClick: w(e.onClick, n.onClose)
|
|
105
|
+
})
|
|
106
|
+
});
|
|
107
|
+
}, "TooltipTrigger")), B = "TooltipPortal", [ge, me] = I(B, { forceMount: void 0 }), Ce = /* @__PURE__ */ d((r) => {
|
|
108
|
+
const { __scopeTooltip: e, forceMount: t, children: o, container: s } = r, n = R(B, e);
|
|
109
|
+
return /* @__PURE__ */ h(ge, {
|
|
110
|
+
scope: e,
|
|
111
|
+
forceMount: t,
|
|
112
|
+
children: /* @__PURE__ */ h(j, {
|
|
113
|
+
present: t || n.open,
|
|
114
|
+
children: /* @__PURE__ */ h(re, {
|
|
115
|
+
asChild: !0,
|
|
116
|
+
container: s,
|
|
117
|
+
children: o
|
|
118
|
+
})
|
|
119
|
+
})
|
|
120
|
+
});
|
|
121
|
+
}, "TooltipPortal"), E = "TooltipContent", xe = /* @__PURE__ */ a.forwardRef(/* @__PURE__ */ d(function(e, t) {
|
|
122
|
+
const o = me(E, e.__scopeTooltip), { forceMount: s = o.forceMount, side: n = "top", ...i } = e, f = R(E, e.__scopeTooltip);
|
|
123
|
+
return /* @__PURE__ */ h(j, {
|
|
124
|
+
present: s || f.open,
|
|
125
|
+
children: f.disableHoverableContent ? /* @__PURE__ */ h(U, {
|
|
126
|
+
side: n,
|
|
127
|
+
...i,
|
|
128
|
+
ref: t
|
|
129
|
+
}) : /* @__PURE__ */ h(ye, {
|
|
130
|
+
side: n,
|
|
131
|
+
...i,
|
|
132
|
+
ref: t
|
|
133
|
+
})
|
|
134
|
+
});
|
|
135
|
+
}, "TooltipContent")), ye = /* @__PURE__ */ a.forwardRef(/* @__PURE__ */ d(function(e, t) {
|
|
136
|
+
const o = R(E, e.__scopeTooltip), s = S(E, e.__scopeTooltip), n = a.useRef(null), i = G(t, n), [f, u] = a.useState(null), { trigger: c, onClose: p } = o, T = n.current, { onPointerInTransitChange: v } = s, g = a.useCallback(() => {
|
|
137
|
+
u(null), v(!1);
|
|
138
|
+
}, [v]), x = a.useCallback((l, m) => {
|
|
139
|
+
const C = l.currentTarget, b = {
|
|
140
|
+
x: l.clientX,
|
|
141
|
+
y: l.clientY
|
|
142
|
+
}, P = $(b, Y(b, C.getBoundingClientRect())), y = q(m.getBoundingClientRect()), L = K([...P, ...y]);
|
|
143
|
+
u(L), v(!0);
|
|
144
|
+
}, [v]);
|
|
145
|
+
return a.useEffect(() => () => g(), [g]), a.useEffect(() => {
|
|
146
|
+
if (c && T) {
|
|
147
|
+
const l = /* @__PURE__ */ d((C) => x(C, T), "handleTriggerLeave"), m = /* @__PURE__ */ d((C) => x(C, c), "handleContentLeave");
|
|
148
|
+
return c.addEventListener("pointerleave", l), T.addEventListener("pointerleave", m), () => {
|
|
149
|
+
c.removeEventListener("pointerleave", l), T.removeEventListener("pointerleave", m);
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
}, [
|
|
153
|
+
c,
|
|
154
|
+
T,
|
|
155
|
+
x,
|
|
156
|
+
g
|
|
157
|
+
]), a.useEffect(() => {
|
|
158
|
+
if (f) {
|
|
159
|
+
const l = /* @__PURE__ */ d((m) => {
|
|
160
|
+
const C = m.target, b = {
|
|
161
|
+
x: m.clientX,
|
|
162
|
+
y: m.clientY
|
|
163
|
+
}, P = c?.contains(C) || T?.contains(C), y = !X(b, f);
|
|
164
|
+
P ? g() : y && (g(), p());
|
|
165
|
+
}, "handleTrackPointerGrace");
|
|
166
|
+
return document.addEventListener("pointermove", l), () => document.removeEventListener("pointermove", l);
|
|
167
|
+
}
|
|
168
|
+
}, [
|
|
169
|
+
c,
|
|
170
|
+
T,
|
|
171
|
+
f,
|
|
172
|
+
p,
|
|
173
|
+
g
|
|
174
|
+
]), /* @__PURE__ */ h(U, {
|
|
175
|
+
...e,
|
|
176
|
+
ref: i
|
|
177
|
+
});
|
|
178
|
+
}, "TooltipContentHoverable")), be = z("TooltipContent"), U = /* @__PURE__ */ a.forwardRef(/* @__PURE__ */ d(function(e, t) {
|
|
179
|
+
const { __scopeTooltip: o, children: s, "aria-label": n, id: i, onEscapeKeyDown: f, onPointerDownOutside: u, ...c } = e, p = R(E, o), T = _(o), { onClose: v } = p;
|
|
180
|
+
a.useEffect(() => (document.addEventListener(k, v), () => document.removeEventListener(k, v)), [v]), a.useEffect(() => {
|
|
181
|
+
if (p.trigger) {
|
|
182
|
+
const x = /* @__PURE__ */ d((l) => {
|
|
183
|
+
l.target instanceof Node && l.target.contains(p.trigger) && v();
|
|
184
|
+
}, "handleScroll");
|
|
185
|
+
return window.addEventListener("scroll", x, { capture: !0 }), () => window.removeEventListener("scroll", x, { capture: !0 });
|
|
186
|
+
}
|
|
187
|
+
}, [p.trigger, v]);
|
|
188
|
+
const { setContentId: g } = p;
|
|
189
|
+
return Z(() => (g(i), () => {
|
|
190
|
+
g(void 0);
|
|
191
|
+
}), [i, g]), /* @__PURE__ */ h(oe, {
|
|
192
|
+
asChild: !0,
|
|
193
|
+
disableOutsidePointerEvents: !1,
|
|
194
|
+
onEscapeKeyDown: f,
|
|
195
|
+
onPointerDownOutside: u,
|
|
196
|
+
onFocusOutside: (x) => x.preventDefault(),
|
|
197
|
+
onDismiss: v,
|
|
198
|
+
children: /* @__PURE__ */ le(se, {
|
|
199
|
+
"data-state": p.stateAttribute,
|
|
200
|
+
role: n ? void 0 : "tooltip",
|
|
201
|
+
id: n ? void 0 : p.contentId,
|
|
202
|
+
...T,
|
|
203
|
+
...c,
|
|
204
|
+
ref: t,
|
|
205
|
+
style: {
|
|
206
|
+
...c.style,
|
|
207
|
+
"--radix-tooltip-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
208
|
+
"--radix-tooltip-content-available-width": "var(--radix-popper-available-width)",
|
|
209
|
+
"--radix-tooltip-content-available-height": "var(--radix-popper-available-height)",
|
|
210
|
+
"--radix-tooltip-trigger-width": "var(--radix-popper-anchor-width)",
|
|
211
|
+
"--radix-tooltip-trigger-height": "var(--radix-popper-anchor-height)"
|
|
212
|
+
},
|
|
213
|
+
children: [/* @__PURE__ */ h(be, { children: s }), n ? /* @__PURE__ */ h(Q, {
|
|
214
|
+
id: p.contentId,
|
|
215
|
+
role: "tooltip",
|
|
216
|
+
children: n
|
|
217
|
+
}) : null]
|
|
218
|
+
})
|
|
219
|
+
});
|
|
220
|
+
}, "TooltipContentImpl")), Pe = /* @__PURE__ */ a.forwardRef(/* @__PURE__ */ d(function(e, t) {
|
|
221
|
+
const { __scopeTooltip: o, ...s } = e, n = _(o);
|
|
222
|
+
return /* @__PURE__ */ h(ae, {
|
|
223
|
+
...n,
|
|
224
|
+
...s,
|
|
225
|
+
ref: t
|
|
226
|
+
});
|
|
227
|
+
}, "TooltipArrow"));
|
|
228
|
+
function Y(r, e) {
|
|
229
|
+
const t = Math.abs(e.top - r.y), o = Math.abs(e.bottom - r.y), s = Math.abs(e.right - r.x), n = Math.abs(e.left - r.x);
|
|
230
|
+
switch (Math.min(t, o, s, n)) {
|
|
231
|
+
case n:
|
|
232
|
+
return "left";
|
|
233
|
+
case s:
|
|
234
|
+
return "right";
|
|
235
|
+
case t:
|
|
236
|
+
return "top";
|
|
237
|
+
case o:
|
|
238
|
+
return "bottom";
|
|
239
|
+
default:
|
|
240
|
+
throw new Error("unreachable");
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
d(Y, "getExitSideFromRect");
|
|
244
|
+
function $(r, e, t = 5) {
|
|
245
|
+
const o = [];
|
|
246
|
+
switch (e) {
|
|
247
|
+
case "top":
|
|
248
|
+
o.push({
|
|
249
|
+
x: r.x - t,
|
|
250
|
+
y: r.y + t
|
|
251
|
+
}, {
|
|
252
|
+
x: r.x + t,
|
|
253
|
+
y: r.y + t
|
|
254
|
+
});
|
|
255
|
+
break;
|
|
256
|
+
case "bottom":
|
|
257
|
+
o.push({
|
|
258
|
+
x: r.x - t,
|
|
259
|
+
y: r.y - t
|
|
260
|
+
}, {
|
|
261
|
+
x: r.x + t,
|
|
262
|
+
y: r.y - t
|
|
263
|
+
});
|
|
264
|
+
break;
|
|
265
|
+
case "left":
|
|
266
|
+
o.push({
|
|
267
|
+
x: r.x + t,
|
|
268
|
+
y: r.y - t
|
|
269
|
+
}, {
|
|
270
|
+
x: r.x + t,
|
|
271
|
+
y: r.y + t
|
|
272
|
+
});
|
|
273
|
+
break;
|
|
274
|
+
case "right":
|
|
275
|
+
o.push({
|
|
276
|
+
x: r.x - t,
|
|
277
|
+
y: r.y - t
|
|
278
|
+
}, {
|
|
279
|
+
x: r.x - t,
|
|
280
|
+
y: r.y + t
|
|
281
|
+
});
|
|
282
|
+
break;
|
|
283
|
+
}
|
|
284
|
+
return o;
|
|
285
|
+
}
|
|
286
|
+
d($, "getPaddedExitPoints");
|
|
287
|
+
function q(r) {
|
|
288
|
+
const { top: e, right: t, bottom: o, left: s } = r;
|
|
289
|
+
return [
|
|
290
|
+
{
|
|
291
|
+
x: s,
|
|
292
|
+
y: e
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
x: t,
|
|
296
|
+
y: e
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
x: t,
|
|
300
|
+
y: o
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
x: s,
|
|
304
|
+
y: o
|
|
305
|
+
}
|
|
306
|
+
];
|
|
307
|
+
}
|
|
308
|
+
d(q, "getPointsFromRect");
|
|
309
|
+
function X(r, e) {
|
|
310
|
+
const { x: t, y: o } = r;
|
|
311
|
+
let s = !1;
|
|
312
|
+
for (let n = 0, i = e.length - 1; n < e.length; i = n++) {
|
|
313
|
+
const f = e[n], u = e[i], c = f.x, p = f.y, T = u.x, v = u.y;
|
|
314
|
+
p > o != v > o && t < (T - c) * (o - p) / (v - p) + c && (s = !s);
|
|
315
|
+
}
|
|
316
|
+
return s;
|
|
317
|
+
}
|
|
318
|
+
d(X, "isPointInPolygon");
|
|
319
|
+
function K(r) {
|
|
320
|
+
const e = r.slice();
|
|
321
|
+
return e.sort((t, o) => t.x < o.x ? -1 : t.x > o.x ? 1 : t.y < o.y ? -1 : t.y > o.y ? 1 : 0), V(e);
|
|
322
|
+
}
|
|
323
|
+
d(K, "getHull");
|
|
324
|
+
function V(r) {
|
|
325
|
+
if (r.length <= 1) return r.slice();
|
|
326
|
+
const e = [];
|
|
327
|
+
for (let o = 0; o < r.length; o++) {
|
|
328
|
+
const s = r[o];
|
|
329
|
+
for (; e.length >= 2; ) {
|
|
330
|
+
const n = e[e.length - 1], i = e[e.length - 2];
|
|
331
|
+
if ((n.x - i.x) * (s.y - i.y) >= (n.y - i.y) * (s.x - i.x)) e.pop();
|
|
332
|
+
else break;
|
|
333
|
+
}
|
|
334
|
+
e.push(s);
|
|
335
|
+
}
|
|
336
|
+
e.pop();
|
|
337
|
+
const t = [];
|
|
338
|
+
for (let o = r.length - 1; o >= 0; o--) {
|
|
339
|
+
const s = r[o];
|
|
340
|
+
for (; t.length >= 2; ) {
|
|
341
|
+
const n = t[t.length - 1], i = t[t.length - 2];
|
|
342
|
+
if ((n.x - i.x) * (s.y - i.y) >= (n.y - i.y) * (s.x - i.x)) t.pop();
|
|
343
|
+
else break;
|
|
344
|
+
}
|
|
345
|
+
t.push(s);
|
|
346
|
+
}
|
|
347
|
+
return t.pop(), e.length === 1 && t.length === 1 && e[0].x === t[0].x && e[0].y === t[0].y ? e : e.concat(t);
|
|
348
|
+
}
|
|
349
|
+
d(V, "getHullPresorted");
|
|
350
|
+
var Me = fe, He = Te, Ne = he, Ge = Ce, je = xe, Fe = Pe;
|
|
351
|
+
export {
|
|
352
|
+
He as a,
|
|
353
|
+
Me as i,
|
|
354
|
+
je as n,
|
|
355
|
+
Ne as o,
|
|
356
|
+
Ge as r,
|
|
357
|
+
Fe as t
|
|
358
|
+
};
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import * as r from "react";
|
|
2
|
+
import { jsx as A } from "react/jsx-runtime";
|
|
3
|
+
function Y(e, o = []) {
|
|
4
|
+
let t = [];
|
|
5
|
+
function i(c, s) {
|
|
6
|
+
const l = r.createContext(s);
|
|
7
|
+
l.displayName = c + "Context";
|
|
8
|
+
const u = t.length;
|
|
9
|
+
t = [...t, s];
|
|
10
|
+
const a = (d) => {
|
|
11
|
+
const { scope: w, children: m, ...v } = d, E = w?.[e]?.[u] || l, C = r.useMemo(() => v, Object.values(v));
|
|
12
|
+
return /* @__PURE__ */ A(E.Provider, {
|
|
13
|
+
value: C,
|
|
14
|
+
children: m
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
a.displayName = c + "Provider";
|
|
18
|
+
function f(d, w, m = {}) {
|
|
19
|
+
const { optional: v = !1 } = m, E = w?.[e]?.[u] || l, C = r.useContext(E);
|
|
20
|
+
if (C) return C;
|
|
21
|
+
if (s !== void 0) return s;
|
|
22
|
+
if (!v)
|
|
23
|
+
throw new Error(`\`${d}\` must be used within \`${c}\``);
|
|
24
|
+
}
|
|
25
|
+
return [a, f];
|
|
26
|
+
}
|
|
27
|
+
const n = () => {
|
|
28
|
+
const c = t.map((s) => r.createContext(s));
|
|
29
|
+
return function(l) {
|
|
30
|
+
const u = l?.[e] || c;
|
|
31
|
+
return r.useMemo(() => ({ [`__scope${e}`]: {
|
|
32
|
+
...l,
|
|
33
|
+
[e]: u
|
|
34
|
+
} }), [l, u]);
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
return n.scopeName = e, [i, I(n, ...o)];
|
|
38
|
+
}
|
|
39
|
+
function I(...e) {
|
|
40
|
+
const o = e[0];
|
|
41
|
+
if (e.length === 1) return o;
|
|
42
|
+
const t = () => {
|
|
43
|
+
const i = e.map((n) => ({
|
|
44
|
+
useScope: n(),
|
|
45
|
+
scopeName: n.scopeName
|
|
46
|
+
}));
|
|
47
|
+
return function(c) {
|
|
48
|
+
const s = i.reduce((l, { useScope: u, scopeName: a }) => {
|
|
49
|
+
const f = u(c)[`__scope${a}`];
|
|
50
|
+
return {
|
|
51
|
+
...l,
|
|
52
|
+
...f
|
|
53
|
+
};
|
|
54
|
+
}, {});
|
|
55
|
+
return r.useMemo(() => ({ [`__scope${o.scopeName}`]: s }), [s]);
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
return t.scopeName = o.scopeName, t;
|
|
59
|
+
}
|
|
60
|
+
var j = Object.defineProperty, p = (e, o) => j(e, "name", {
|
|
61
|
+
value: o,
|
|
62
|
+
configurable: !0
|
|
63
|
+
}), x = !!(typeof window < "u" && window.document && window.document.createElement);
|
|
64
|
+
function F(e, o, { checkForDefaultPrevented: t = !0 } = {}) {
|
|
65
|
+
return /* @__PURE__ */ p(function(n) {
|
|
66
|
+
if (e?.(n), t === !1 || !n || !n.defaultPrevented) return o?.(n);
|
|
67
|
+
}, "handleEvent");
|
|
68
|
+
}
|
|
69
|
+
p(F, "composeEventHandlers");
|
|
70
|
+
function N(e) {
|
|
71
|
+
if (!x) throw new Error("Cannot access window outside of the DOM");
|
|
72
|
+
return e?.ownerDocument?.defaultView ?? window;
|
|
73
|
+
}
|
|
74
|
+
p(N, "getOwnerWindow");
|
|
75
|
+
function S(e) {
|
|
76
|
+
if (!x) throw new Error("Cannot access document outside of the DOM");
|
|
77
|
+
return e?.ownerDocument ?? document;
|
|
78
|
+
}
|
|
79
|
+
p(S, "getOwnerDocument");
|
|
80
|
+
function y(e, o = !1) {
|
|
81
|
+
const { activeElement: t } = S(e);
|
|
82
|
+
if (!t?.nodeName) return null;
|
|
83
|
+
if (O(t) && t.contentDocument) return y(t.contentDocument.body, o);
|
|
84
|
+
if (o) {
|
|
85
|
+
const i = t.getAttribute("aria-activedescendant");
|
|
86
|
+
if (i) {
|
|
87
|
+
const n = S(t).getElementById(i);
|
|
88
|
+
if (n) return n;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return t;
|
|
92
|
+
}
|
|
93
|
+
p(y, "getActiveElement");
|
|
94
|
+
function O(e) {
|
|
95
|
+
return e.tagName === "IFRAME";
|
|
96
|
+
}
|
|
97
|
+
p(O, "isFrame");
|
|
98
|
+
var P = globalThis?.document ? r.useLayoutEffect : () => {
|
|
99
|
+
}, $ = r[" useEffectEvent ".trim().toString()], b = r[" useInsertionEffect ".trim().toString()];
|
|
100
|
+
function T(e) {
|
|
101
|
+
if (typeof $ == "function") return $(e);
|
|
102
|
+
const o = r.useRef(() => {
|
|
103
|
+
throw new Error("Cannot call an event handler while rendering.");
|
|
104
|
+
});
|
|
105
|
+
return typeof b == "function" ? b(() => {
|
|
106
|
+
o.current = e;
|
|
107
|
+
}) : P(() => {
|
|
108
|
+
o.current = e;
|
|
109
|
+
}), r.useMemo(() => ((...t) => o.current?.(...t)), []);
|
|
110
|
+
}
|
|
111
|
+
var U = Object.defineProperty, h = (e, o) => U(e, "name", {
|
|
112
|
+
value: o,
|
|
113
|
+
configurable: !0
|
|
114
|
+
}), H = r[" useInsertionEffect ".trim().toString()] || P;
|
|
115
|
+
function B({ prop: e, defaultProp: o, onChange: t = /* @__PURE__ */ h(() => {
|
|
116
|
+
}, "onChange"), caller: i }) {
|
|
117
|
+
const [n, c, s] = D({
|
|
118
|
+
defaultProp: o,
|
|
119
|
+
onChange: t
|
|
120
|
+
}), l = e !== void 0;
|
|
121
|
+
return [l ? e : n, r.useCallback((a) => {
|
|
122
|
+
if (l) {
|
|
123
|
+
const f = M(a) ? a(e) : a;
|
|
124
|
+
f !== e && s.current?.(f);
|
|
125
|
+
} else c(a);
|
|
126
|
+
}, [
|
|
127
|
+
l,
|
|
128
|
+
e,
|
|
129
|
+
c,
|
|
130
|
+
s
|
|
131
|
+
])];
|
|
132
|
+
}
|
|
133
|
+
h(B, "useControllableState");
|
|
134
|
+
function D({ defaultProp: e, onChange: o }) {
|
|
135
|
+
const [t, i] = r.useState(e), n = r.useRef(t), c = r.useRef(o);
|
|
136
|
+
return H(() => {
|
|
137
|
+
c.current = o;
|
|
138
|
+
}, [o]), r.useEffect(() => {
|
|
139
|
+
n.current !== t && (c.current?.(t), n.current = t);
|
|
140
|
+
}, [t, n]), [
|
|
141
|
+
t,
|
|
142
|
+
i,
|
|
143
|
+
c
|
|
144
|
+
];
|
|
145
|
+
}
|
|
146
|
+
h(D, "useUncontrolledState");
|
|
147
|
+
function M(e) {
|
|
148
|
+
return typeof e == "function";
|
|
149
|
+
}
|
|
150
|
+
h(M, "isFunction");
|
|
151
|
+
var _ = /* @__PURE__ */ Symbol("RADIX:SYNC_STATE");
|
|
152
|
+
function L(e, o, t, i) {
|
|
153
|
+
const { prop: n, defaultProp: c, onChange: s, caller: l } = o, u = n !== void 0, a = T(s), f = [{
|
|
154
|
+
...t,
|
|
155
|
+
state: c
|
|
156
|
+
}];
|
|
157
|
+
i && f.push(i);
|
|
158
|
+
const [d, w] = r.useReducer((C, g) => {
|
|
159
|
+
if (g.type === _) return {
|
|
160
|
+
...C,
|
|
161
|
+
state: g.state
|
|
162
|
+
};
|
|
163
|
+
const R = e(C, g);
|
|
164
|
+
return u && !Object.is(R.state, C.state) && a(R.state), R;
|
|
165
|
+
}, ...f), m = d.state, v = r.useRef(m);
|
|
166
|
+
r.useEffect(() => {
|
|
167
|
+
v.current !== m && (v.current = m, u || a(m));
|
|
168
|
+
}, [
|
|
169
|
+
m,
|
|
170
|
+
v,
|
|
171
|
+
u
|
|
172
|
+
]);
|
|
173
|
+
const E = r.useMemo(() => n !== void 0 ? {
|
|
174
|
+
...d,
|
|
175
|
+
state: n
|
|
176
|
+
} : d, [d, n]);
|
|
177
|
+
return r.useEffect(() => {
|
|
178
|
+
u && !Object.is(n, d.state) && w({
|
|
179
|
+
type: _,
|
|
180
|
+
state: n
|
|
181
|
+
});
|
|
182
|
+
}, [
|
|
183
|
+
n,
|
|
184
|
+
d.state,
|
|
185
|
+
u
|
|
186
|
+
]), [E, w];
|
|
187
|
+
}
|
|
188
|
+
h(L, "useControllableStateReducer");
|
|
189
|
+
export {
|
|
190
|
+
Y as i,
|
|
191
|
+
P as n,
|
|
192
|
+
F as r,
|
|
193
|
+
B as t
|
|
194
|
+
};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { n as y } from "./dist-D4FePjTS.js";
|
|
2
|
+
import * as o from "react";
|
|
3
|
+
var P = Object.defineProperty, f = (n, e) => P(n, "name", {
|
|
4
|
+
value: e,
|
|
5
|
+
configurable: !0
|
|
6
|
+
});
|
|
7
|
+
function g(n, e) {
|
|
8
|
+
return o.useReducer((t, r) => e[t][r] ?? t, n);
|
|
9
|
+
}
|
|
10
|
+
f(g, "useStateMachine");
|
|
11
|
+
var h = /* @__PURE__ */ f((n) => {
|
|
12
|
+
const { present: e, children: t } = n, r = M(e), s = typeof t == "function" ? t({ present: r.isPresent }) : o.Children.only(t), u = O(r.ref, v(s));
|
|
13
|
+
return typeof t == "function" || r.isPresent ? o.cloneElement(s, { ref: u }) : null;
|
|
14
|
+
}, "Presence");
|
|
15
|
+
function M(n) {
|
|
16
|
+
const [e, t] = o.useState(), r = o.useRef(null), s = o.useRef(n), u = o.useRef("none"), i = o.useRef(void 0), [a, l] = g(n ? "mounted" : "unmounted", {
|
|
17
|
+
mounted: {
|
|
18
|
+
UNMOUNT: "unmounted",
|
|
19
|
+
ANIMATION_OUT: "unmountSuspended"
|
|
20
|
+
},
|
|
21
|
+
unmountSuspended: {
|
|
22
|
+
MOUNT: "mounted",
|
|
23
|
+
ANIMATION_END: "unmounted"
|
|
24
|
+
},
|
|
25
|
+
unmounted: { MOUNT: "mounted" }
|
|
26
|
+
});
|
|
27
|
+
return o.useEffect(() => {
|
|
28
|
+
a === "mounted" ? (u.current = i.current ?? N(r.current), i.current = void 0) : u.current = "none";
|
|
29
|
+
}, [a]), y(() => {
|
|
30
|
+
const c = r.current, m = s.current;
|
|
31
|
+
if (m !== n) {
|
|
32
|
+
const d = u.current, p = N(c);
|
|
33
|
+
n ? (i.current = p, l("MOUNT")) : p === "none" || c?.display === "none" ? l("UNMOUNT") : l(m && d !== p ? "ANIMATION_OUT" : "UNMOUNT"), s.current = n;
|
|
34
|
+
}
|
|
35
|
+
}, [n, l]), y(() => {
|
|
36
|
+
if (e) {
|
|
37
|
+
let c;
|
|
38
|
+
const m = e.ownerDocument.defaultView ?? window, d = /* @__PURE__ */ f((R) => {
|
|
39
|
+
const E = N(r.current).includes(CSS.escape(R.animationName));
|
|
40
|
+
if (R.target === e && E && (l("ANIMATION_END"), !s.current)) {
|
|
41
|
+
const T = e.style.animationFillMode;
|
|
42
|
+
e.style.animationFillMode = "forwards", c = m.setTimeout(() => {
|
|
43
|
+
e.style.animationFillMode === "forwards" && (e.style.animationFillMode = T);
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}, "handleAnimationEnd"), p = /* @__PURE__ */ f((R) => {
|
|
47
|
+
R.target === e && (u.current = N(r.current));
|
|
48
|
+
}, "handleAnimationStart");
|
|
49
|
+
return e.addEventListener("animationstart", p), e.addEventListener("animationcancel", d), e.addEventListener("animationend", d), () => {
|
|
50
|
+
m.clearTimeout(c), e.removeEventListener("animationstart", p), e.removeEventListener("animationcancel", d), e.removeEventListener("animationend", d);
|
|
51
|
+
};
|
|
52
|
+
} else l("ANIMATION_END");
|
|
53
|
+
}, [e, l]), {
|
|
54
|
+
isPresent: ["mounted", "unmountSuspended"].includes(a),
|
|
55
|
+
ref: o.useCallback((c) => {
|
|
56
|
+
if (c) {
|
|
57
|
+
const m = getComputedStyle(c);
|
|
58
|
+
r.current = m, i.current = N(m);
|
|
59
|
+
} else r.current = null;
|
|
60
|
+
t(c);
|
|
61
|
+
}, [])
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
f(M, "usePresence");
|
|
65
|
+
function A(n, e) {
|
|
66
|
+
if (typeof n == "function") return n(e);
|
|
67
|
+
n != null && (n.current = e);
|
|
68
|
+
}
|
|
69
|
+
f(A, "setRef");
|
|
70
|
+
function O(...n) {
|
|
71
|
+
const e = o.useRef(n);
|
|
72
|
+
return e.current = n, o.useCallback((t) => {
|
|
73
|
+
const r = e.current;
|
|
74
|
+
let s = !1;
|
|
75
|
+
const u = r.map((i) => {
|
|
76
|
+
const a = A(i, t);
|
|
77
|
+
return !s && typeof a == "function" && (s = !0), a;
|
|
78
|
+
});
|
|
79
|
+
if (s) return () => {
|
|
80
|
+
for (let i = 0; i < u.length; i++) {
|
|
81
|
+
const a = u[i];
|
|
82
|
+
typeof a == "function" ? a() : A(r[i], null);
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
}, []);
|
|
86
|
+
}
|
|
87
|
+
f(O, "useStableComposedRefs");
|
|
88
|
+
function N(n) {
|
|
89
|
+
return n?.animationName || "none";
|
|
90
|
+
}
|
|
91
|
+
f(N, "getAnimationName");
|
|
92
|
+
function v(n) {
|
|
93
|
+
let e = Object.getOwnPropertyDescriptor(n.props, "ref")?.get, t = e && "isReactWarning" in e && e.isReactWarning;
|
|
94
|
+
return t ? n.ref : (e = Object.getOwnPropertyDescriptor(n, "ref")?.get, t = e && "isReactWarning" in e && e.isReactWarning, t ? n.props.ref : n.props.ref || n.ref);
|
|
95
|
+
}
|
|
96
|
+
f(v, "getElementRef");
|
|
97
|
+
export {
|
|
98
|
+
h as t
|
|
99
|
+
};
|