@konstructio/ui 0.1.2-alpha.75 → 0.1.2-alpha.76
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/components/Alert/Alert.d.ts +2 -2
- package/dist/components/Alert/Alert.types.d.ts +3 -1
- package/dist/components/AlertDialog/AlertDialog.d.ts +2 -2
- package/dist/components/AlertDialog/AlertDialog.js +1 -1
- package/dist/components/AlertDialog/AlertDialog.types.d.ts +5 -3
- package/dist/components/AlertDialog/components/AlertDialogTrigger.d.ts +2 -2
- package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
- package/dist/components/AlertDialog/components/AlertDialogTrigger.types.d.ts +4 -2
- package/dist/components/AlertDialog/components/index.js +1 -1
- package/dist/components/Autocomplete/Autocomplete.d.ts +2 -2
- package/dist/components/Autocomplete/Autocomplete.types.d.ts +3 -1
- package/dist/components/Badge/Badge.d.ts +2 -2
- package/dist/components/Badge/Badge.types.d.ts +3 -1
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +2 -2
- package/dist/components/Breadcrumb/Breadcrumb.types.d.ts +3 -1
- package/dist/components/Breadcrumb/components/Item/Item.d.ts +2 -2
- package/dist/components/Breadcrumb/components/Item/Item.types.d.ts +3 -1
- package/dist/components/Button/Button.d.ts +2 -2
- package/dist/components/Button/Button.types.d.ts +3 -1
- package/dist/components/Card/Card.d.ts +2 -2
- package/dist/components/Card/Card.types.d.ts +3 -1
- package/dist/components/Checkbox/Checkbox.d.ts +2 -2
- package/dist/components/Checkbox/Checkbox.types.d.ts +3 -1
- package/dist/components/Command/Command.d.ts +2 -2
- package/dist/components/Command/Command.js +2 -2
- package/dist/components/Command/Command.types.d.ts +3 -1
- 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 +1 -1
- package/dist/components/Command/components/DialogOverlay.js +1 -1
- package/dist/components/Counter/Counter.d.ts +2 -2
- package/dist/components/Counter/Counter.types.d.ts +3 -1
- package/dist/components/DateRangePicker/DateRangePicker.d.ts +2 -2
- package/dist/components/DateRangePicker/DateRangePicker.types.d.ts +3 -1
- package/dist/components/Datepicker/DatePicker.d.ts +2 -2
- package/dist/components/Datepicker/DatePicker.types.d.ts +3 -1
- package/dist/components/Filter/Filter.types.d.ts +5 -3
- package/dist/components/Filter/components/ResetButton/ResetButton.types.d.ts +1 -1
- package/dist/components/ImageUpload/ImageUpload.d.ts +2 -2
- package/dist/components/ImageUpload/ImageUpload.types.d.ts +3 -1
- package/dist/components/Input/Input.d.ts +2 -2
- package/dist/components/Input/Input.types.d.ts +3 -1
- package/dist/components/LineChart/LineChart.d.ts +2 -2
- package/dist/components/LineChart/LineChart.types.d.ts +4 -2
- package/dist/components/Loading/Loading.d.ts +2 -2
- package/dist/components/Loading/Loading.types.d.ts +3 -1
- package/dist/components/MultiSelectDropdown/MultiSelectDropdown.d.ts +2 -2
- package/dist/components/MultiSelectDropdown/MultiSelectDropdown.types.d.ts +3 -1
- package/dist/components/MultiSelectDropdown/components/Wrapper/Wrapper.types.d.ts +1 -1
- package/dist/components/PhoneNumberInput/components/TruncateText/TruncateText.js +1 -1
- package/dist/components/ProgressBar/ProgressBar.d.ts +2 -2
- package/dist/components/ProgressBar/ProgressBar.types.d.ts +3 -1
- package/dist/components/Radio/Radio.d.ts +2 -2
- package/dist/components/Radio/Radio.types.d.ts +3 -1
- package/dist/components/RadioCard/RadioCard.d.ts +2 -2
- package/dist/components/RadioCard/RadioCard.types.d.ts +5 -3
- package/dist/components/RadioCardGroup/RadioCardGroup.d.ts +2 -2
- package/dist/components/RadioCardGroup/RadioCardGroup.types.d.ts +4 -2
- package/dist/components/RadioGroup/RadioGroup.d.ts +2 -2
- package/dist/components/RadioGroup/RadioGroup.types.d.ts +4 -2
- package/dist/components/Range/Range.d.ts +2 -2
- package/dist/components/Range/Range.types.d.ts +3 -1
- package/dist/components/Select/Select.d.ts +2 -2
- package/dist/components/Select/Select.types.d.ts +3 -1
- package/dist/components/Select/components/AdditionalOptions/AdditionalOptions.types.d.ts +1 -1
- package/dist/components/Select/components/List/List.types.d.ts +1 -1
- package/dist/components/Sidebar/Sidebar.d.ts +1 -1
- package/dist/components/Sidebar/Sidebar.types.d.ts +3 -1
- package/dist/components/Sidebar/components/Footer/Footer.d.ts +2 -2
- package/dist/components/Sidebar/components/Footer/Footer.types.d.ts +3 -1
- package/dist/components/Sidebar/components/Logo/Logo.d.ts +2 -2
- package/dist/components/Sidebar/components/Logo/Logo.types.d.ts +3 -1
- package/dist/components/Sidebar/components/Navigation/Navigation.d.ts +2 -2
- package/dist/components/Sidebar/components/Navigation/Navigation.types.d.ts +7 -5
- package/dist/components/Sidebar/components/NavigationGroup/NavigationGroup.d.ts +2 -2
- package/dist/components/Sidebar/components/NavigationGroup/NavigationGroup.types.d.ts +3 -1
- package/dist/components/Sidebar/components/NavigationOption/NavigationOption.d.ts +2 -2
- package/dist/components/Sidebar/components/NavigationOption/NavigationOption.types.d.ts +3 -1
- package/dist/components/Sidebar/components/NavigationSeparator/NavigationSeparator.d.ts +2 -2
- package/dist/components/Sidebar/components/NavigationSeparator/NavigationSeparator.types.d.ts +3 -1
- package/dist/components/Sidebar/components/NavigationTitle/NavigationTitle.d.ts +2 -2
- package/dist/components/Sidebar/components/NavigationTitle/NavigationTitle.js +1 -5
- package/dist/components/Sidebar/components/NavigationTitle/NavigationTitle.types.d.ts +3 -1
- package/dist/components/Sidebar/components/index.d.ts +7 -7
- package/dist/components/Slider/Slider.d.ts +2 -2
- package/dist/components/Slider/Slider.types.d.ts +3 -1
- package/dist/components/Spinner/Spinner.d.ts +2 -2
- package/dist/components/Spinner/Spinner.types.d.ts +4 -2
- package/dist/components/Stepper/Stepper.d.ts +2 -2
- package/dist/components/Stepper/Stepper.types.d.ts +3 -1
- package/dist/components/Switch/Switch.d.ts +2 -2
- package/dist/components/Switch/Switch.types.d.ts +3 -1
- package/dist/components/Table/Table.types.d.ts +3 -1
- package/dist/components/Tabs/Tabs.d.ts +1 -1
- package/dist/components/Tabs/Tabs.types.d.ts +3 -1
- package/dist/components/Tag/Tag.d.ts +2 -2
- package/dist/components/Tag/Tag.types.d.ts +3 -1
- package/dist/components/TagSelect/TagSelect.d.ts +2 -2
- package/dist/components/TagSelect/TagSelect.js +3 -1
- package/dist/components/TagSelect/TagSelect.types.d.ts +4 -2
- package/dist/components/TagSelect/components/Item/Item.types.d.ts +1 -1
- package/dist/components/TagSelect/components/Wrapper/Wrapper.types.d.ts +1 -1
- package/dist/components/TagSelect/contexts/TagSelect.types.d.ts +1 -1
- package/dist/components/TextArea/TextArea.d.ts +2 -2
- package/dist/components/TextArea/TextArea.types.d.ts +3 -1
- package/dist/components/TimePicker/TimePicker.d.ts +2 -2
- package/dist/components/TimePicker/TimePicker.types.d.ts +3 -1
- package/dist/components/TimePicker/components/HoursList/HoursList.types.d.ts +1 -1
- package/dist/components/TimePicker/components/MeridianList/MeridianList.types.d.ts +1 -1
- package/dist/components/TimePicker/components/MinutesList/MinutesList.types.d.ts +1 -1
- package/dist/components/TimePicker/components/Wrapper/Wrapper.types.d.ts +1 -1
- package/dist/components/TimePicker/components/WrapperList/WrapperList.types.d.ts +1 -1
- package/dist/components/Toast/Toast.d.ts +2 -2
- package/dist/components/Toast/Toast.js +3 -4
- package/dist/components/Toast/Toast.types.d.ts +3 -1
- package/dist/components/Tooltip/Tooltip.d.ts +2 -2
- package/dist/components/Tooltip/Tooltip.js +20 -20
- package/dist/components/Tooltip/Tooltip.types.d.ts +3 -1
- package/dist/components/Typography/Typography.d.ts +2 -2
- package/dist/components/Typography/Typography.types.d.ts +3 -1
- package/dist/components/VirtualizedTable/VirtualizedTable.types.d.ts +1 -1
- package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.d.ts +1 -1
- package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.js +55 -26
- package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.types.d.ts +4 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/index-BvEpLnOv.js +144 -0
- package/dist/{index-Dd_ZmIqU.js → index-C7zAY3xv.js} +1 -1
- package/dist/{index-Dfq4O3b4.js → index-CrCTywU1.js} +1 -1
- package/dist/{index-9a-FL_6D.js → index-DWyM654o.js} +41 -42
- package/dist/{index-B7-5g1Sm.js → index-mPinF0Ho.js} +407 -401
- package/dist/package.json +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/dist/index-CESXsoMn.js +0 -14
- package/dist/index-URQGEGX7.js +0 -136
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import * as r from "react";
|
|
2
|
+
import { P as m, c as p, d as U, u as z } from "./index--l0zux8V.js";
|
|
3
|
+
import { u as T } from "./index-DLcqcWxM.js";
|
|
4
|
+
import { u as b } from "./index-0ioNhtNM.js";
|
|
5
|
+
import { jsx as P } from "react/jsx-runtime";
|
|
6
|
+
import H from "react-dom";
|
|
7
|
+
function K(n, e = globalThis?.document) {
|
|
8
|
+
const t = b(n);
|
|
9
|
+
r.useEffect(() => {
|
|
10
|
+
const o = (s) => {
|
|
11
|
+
s.key === "Escape" && t(s);
|
|
12
|
+
};
|
|
13
|
+
return e.addEventListener("keydown", o, { capture: !0 }), () => e.removeEventListener("keydown", o, { capture: !0 });
|
|
14
|
+
}, [t, e]);
|
|
15
|
+
}
|
|
16
|
+
var j = "DismissableLayer", h = "dismissableLayer.update", X = "dismissableLayer.pointerDownOutside", Y = "dismissableLayer.focusOutside", R, B = r.createContext({
|
|
17
|
+
layers: /* @__PURE__ */ new Set(),
|
|
18
|
+
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
19
|
+
branches: /* @__PURE__ */ new Set()
|
|
20
|
+
}), x = r.forwardRef(
|
|
21
|
+
(n, e) => {
|
|
22
|
+
const {
|
|
23
|
+
disableOutsidePointerEvents: t = !1,
|
|
24
|
+
onEscapeKeyDown: o,
|
|
25
|
+
onPointerDownOutside: s,
|
|
26
|
+
onFocusOutside: a,
|
|
27
|
+
onInteractOutside: d,
|
|
28
|
+
onDismiss: l,
|
|
29
|
+
...E
|
|
30
|
+
} = n, c = r.useContext(B), [u, S] = r.useState(null), f = u?.ownerDocument ?? globalThis?.document, [, A] = r.useState({}), N = T(e, (i) => S(i)), D = Array.from(c.layers), [W] = [...c.layersWithOutsidePointerEventsDisabled].slice(-1), _ = D.indexOf(W), O = u ? D.indexOf(u) : -1, k = c.layersWithOutsidePointerEventsDisabled.size > 0, L = O >= _, M = G((i) => {
|
|
31
|
+
const v = i.target, w = [...c.branches].some((y) => y.contains(v));
|
|
32
|
+
!L || w || (s?.(i), d?.(i), i.defaultPrevented || l?.());
|
|
33
|
+
}, f), C = J((i) => {
|
|
34
|
+
const v = i.target;
|
|
35
|
+
[...c.branches].some((y) => y.contains(v)) || (a?.(i), d?.(i), i.defaultPrevented || l?.());
|
|
36
|
+
}, f);
|
|
37
|
+
return K((i) => {
|
|
38
|
+
O === c.layers.size - 1 && (o?.(i), !i.defaultPrevented && l && (i.preventDefault(), l()));
|
|
39
|
+
}, f), r.useEffect(() => {
|
|
40
|
+
if (u)
|
|
41
|
+
return t && (c.layersWithOutsidePointerEventsDisabled.size === 0 && (R = f.body.style.pointerEvents, f.body.style.pointerEvents = "none"), c.layersWithOutsidePointerEventsDisabled.add(u)), c.layers.add(u), g(), () => {
|
|
42
|
+
t && c.layersWithOutsidePointerEventsDisabled.size === 1 && (f.body.style.pointerEvents = R);
|
|
43
|
+
};
|
|
44
|
+
}, [u, f, t, c]), r.useEffect(() => () => {
|
|
45
|
+
u && (c.layers.delete(u), c.layersWithOutsidePointerEventsDisabled.delete(u), g());
|
|
46
|
+
}, [u, c]), r.useEffect(() => {
|
|
47
|
+
const i = () => A({});
|
|
48
|
+
return document.addEventListener(h, i), () => document.removeEventListener(h, i);
|
|
49
|
+
}, []), /* @__PURE__ */ P(
|
|
50
|
+
m.div,
|
|
51
|
+
{
|
|
52
|
+
...E,
|
|
53
|
+
ref: N,
|
|
54
|
+
style: {
|
|
55
|
+
pointerEvents: k ? L ? "auto" : "none" : void 0,
|
|
56
|
+
...n.style
|
|
57
|
+
},
|
|
58
|
+
onFocusCapture: p(n.onFocusCapture, C.onFocusCapture),
|
|
59
|
+
onBlurCapture: p(n.onBlurCapture, C.onBlurCapture),
|
|
60
|
+
onPointerDownCapture: p(
|
|
61
|
+
n.onPointerDownCapture,
|
|
62
|
+
M.onPointerDownCapture
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
x.displayName = j;
|
|
69
|
+
var q = "DismissableLayerBranch", F = r.forwardRef((n, e) => {
|
|
70
|
+
const t = r.useContext(B), o = r.useRef(null), s = T(e, o);
|
|
71
|
+
return r.useEffect(() => {
|
|
72
|
+
const a = o.current;
|
|
73
|
+
if (a)
|
|
74
|
+
return t.branches.add(a), () => {
|
|
75
|
+
t.branches.delete(a);
|
|
76
|
+
};
|
|
77
|
+
}, [t.branches]), /* @__PURE__ */ P(m.div, { ...n, ref: s });
|
|
78
|
+
});
|
|
79
|
+
F.displayName = q;
|
|
80
|
+
function G(n, e = globalThis?.document) {
|
|
81
|
+
const t = b(n), o = r.useRef(!1), s = r.useRef(() => {
|
|
82
|
+
});
|
|
83
|
+
return r.useEffect(() => {
|
|
84
|
+
const a = (l) => {
|
|
85
|
+
if (l.target && !o.current) {
|
|
86
|
+
let E = function() {
|
|
87
|
+
I(
|
|
88
|
+
X,
|
|
89
|
+
t,
|
|
90
|
+
c,
|
|
91
|
+
{ discrete: !0 }
|
|
92
|
+
);
|
|
93
|
+
};
|
|
94
|
+
const c = { originalEvent: l };
|
|
95
|
+
l.pointerType === "touch" ? (e.removeEventListener("click", s.current), s.current = E, e.addEventListener("click", s.current, { once: !0 })) : E();
|
|
96
|
+
} else
|
|
97
|
+
e.removeEventListener("click", s.current);
|
|
98
|
+
o.current = !1;
|
|
99
|
+
}, d = window.setTimeout(() => {
|
|
100
|
+
e.addEventListener("pointerdown", a);
|
|
101
|
+
}, 0);
|
|
102
|
+
return () => {
|
|
103
|
+
window.clearTimeout(d), e.removeEventListener("pointerdown", a), e.removeEventListener("click", s.current);
|
|
104
|
+
};
|
|
105
|
+
}, [e, t]), {
|
|
106
|
+
// ensures we check React component tree (not just DOM tree)
|
|
107
|
+
onPointerDownCapture: () => o.current = !0
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
function J(n, e = globalThis?.document) {
|
|
111
|
+
const t = b(n), o = r.useRef(!1);
|
|
112
|
+
return r.useEffect(() => {
|
|
113
|
+
const s = (a) => {
|
|
114
|
+
a.target && !o.current && I(Y, t, { originalEvent: a }, {
|
|
115
|
+
discrete: !1
|
|
116
|
+
});
|
|
117
|
+
};
|
|
118
|
+
return e.addEventListener("focusin", s), () => e.removeEventListener("focusin", s);
|
|
119
|
+
}, [e, t]), {
|
|
120
|
+
onFocusCapture: () => o.current = !0,
|
|
121
|
+
onBlurCapture: () => o.current = !1
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
function g() {
|
|
125
|
+
const n = new CustomEvent(h);
|
|
126
|
+
document.dispatchEvent(n);
|
|
127
|
+
}
|
|
128
|
+
function I(n, e, t, { discrete: o }) {
|
|
129
|
+
const s = t.originalEvent.target, a = new CustomEvent(n, { bubbles: !1, cancelable: !0, detail: t });
|
|
130
|
+
e && s.addEventListener(n, e, { once: !0 }), o ? U(s, a) : s.dispatchEvent(a);
|
|
131
|
+
}
|
|
132
|
+
var ne = x, re = F, Q = "Portal", V = r.forwardRef((n, e) => {
|
|
133
|
+
const { container: t, ...o } = n, [s, a] = r.useState(!1);
|
|
134
|
+
z(() => a(!0), []);
|
|
135
|
+
const d = t || s && globalThis?.document?.body;
|
|
136
|
+
return d ? H.createPortal(/* @__PURE__ */ P(m.div, { ...o, ref: e }), d) : null;
|
|
137
|
+
});
|
|
138
|
+
V.displayName = Q;
|
|
139
|
+
export {
|
|
140
|
+
re as B,
|
|
141
|
+
x as D,
|
|
142
|
+
V as P,
|
|
143
|
+
ne as R
|
|
144
|
+
};
|
|
@@ -3,7 +3,7 @@ import * as l from "react";
|
|
|
3
3
|
import { forwardRef as I } from "react";
|
|
4
4
|
import { c as x, b as M } from "./index--l0zux8V.js";
|
|
5
5
|
import { u } from "./index-DLcqcWxM.js";
|
|
6
|
-
import { T as L, c as A, R as $, P as F, O as B, W as G, C as W, d as j, e as Y, b as f } from "./index-
|
|
6
|
+
import { T as L, c as A, R as $, P as F, O as B, W as G, C as W, d as j, e as Y, b as f } from "./index-DWyM654o.js";
|
|
7
7
|
import { Button as k } from "./components/Button/Button.js";
|
|
8
8
|
import { cn as q } from "./utils/index.js";
|
|
9
9
|
var H = /* @__PURE__ */ Symbol("radix.slottable");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as Ee, P as ke, O as Se, C as Ie } from "./index-
|
|
1
|
+
import { R as Ee, P as ke, O as Se, C as Ie } from "./index-DWyM654o.js";
|
|
2
2
|
import * as n from "react";
|
|
3
3
|
import { P as C } from "./index--l0zux8V.js";
|
|
4
4
|
import { u as P } from "./index-BKMaItIC.js";
|
|
@@ -2,10 +2,9 @@ import * as i from "react";
|
|
|
2
2
|
import { P as O, c as _, b as Ee, a as ye, e as he } from "./index--l0zux8V.js";
|
|
3
3
|
import { u as F, c as Ce } from "./index-DLcqcWxM.js";
|
|
4
4
|
import { u as w } from "./index-BKMaItIC.js";
|
|
5
|
-
import {
|
|
5
|
+
import { P as De, D as be } from "./index-BvEpLnOv.js";
|
|
6
6
|
import { u as $ } from "./index-0ioNhtNM.js";
|
|
7
7
|
import { jsx as u, jsxs as j, Fragment as B } from "react/jsx-runtime";
|
|
8
|
-
import { P as be } from "./index-CESXsoMn.js";
|
|
9
8
|
import { P as U } from "./index-3fEdeexs.js";
|
|
10
9
|
import { R as Re } from "./Combination-BtmnusWq.js";
|
|
11
10
|
var x = "focusScope.autoFocusOnMount", W = "focusScope.autoFocusOnUnmount", q = { bubbles: !1, cancelable: !0 }, Ae = "FocusScope", Q = i.forwardRef((e, t) => {
|
|
@@ -15,7 +14,7 @@ var x = "focusScope.autoFocusOnMount", W = "focusScope.autoFocusOnUnmount", q =
|
|
|
15
14
|
onMountAutoFocus: r,
|
|
16
15
|
onUnmountAutoFocus: a,
|
|
17
16
|
...l
|
|
18
|
-
} = e, [s,
|
|
17
|
+
} = e, [s, v] = i.useState(null), p = $(r), E = $(a), c = i.useRef(null), d = F(t, (f) => v(f)), m = i.useRef({
|
|
19
18
|
paused: !1,
|
|
20
19
|
pause() {
|
|
21
20
|
this.paused = !0;
|
|
@@ -27,11 +26,11 @@ var x = "focusScope.autoFocusOnMount", W = "focusScope.autoFocusOnUnmount", q =
|
|
|
27
26
|
i.useEffect(() => {
|
|
28
27
|
if (o) {
|
|
29
28
|
let f = function(C) {
|
|
30
|
-
if (
|
|
29
|
+
if (m.paused || !s) return;
|
|
31
30
|
const h = C.target;
|
|
32
31
|
s.contains(h) ? c.current = h : b(c.current, { select: !0 });
|
|
33
32
|
}, D = function(C) {
|
|
34
|
-
if (
|
|
33
|
+
if (m.paused || !s) return;
|
|
35
34
|
const h = C.relatedTarget;
|
|
36
35
|
h !== null && (s.contains(h) || b(c.current, { select: !0 }));
|
|
37
36
|
}, g = function(C) {
|
|
@@ -45,9 +44,9 @@ var x = "focusScope.autoFocusOnMount", W = "focusScope.autoFocusOnUnmount", q =
|
|
|
45
44
|
document.removeEventListener("focusin", f), document.removeEventListener("focusout", D), N.disconnect();
|
|
46
45
|
};
|
|
47
46
|
}
|
|
48
|
-
}, [o, s,
|
|
47
|
+
}, [o, s, m.paused]), i.useEffect(() => {
|
|
49
48
|
if (s) {
|
|
50
|
-
Y.add(
|
|
49
|
+
Y.add(m);
|
|
51
50
|
const f = document.activeElement;
|
|
52
51
|
if (!s.contains(f)) {
|
|
53
52
|
const g = new CustomEvent(x, q);
|
|
@@ -56,21 +55,21 @@ var x = "focusScope.autoFocusOnMount", W = "focusScope.autoFocusOnUnmount", q =
|
|
|
56
55
|
return () => {
|
|
57
56
|
s.removeEventListener(x, p), setTimeout(() => {
|
|
58
57
|
const g = new CustomEvent(W, q);
|
|
59
|
-
s.addEventListener(W, E), s.dispatchEvent(g), g.defaultPrevented || b(f ?? document.body, { select: !0 }), s.removeEventListener(W, E), Y.remove(
|
|
58
|
+
s.addEventListener(W, E), s.dispatchEvent(g), g.defaultPrevented || b(f ?? document.body, { select: !0 }), s.removeEventListener(W, E), Y.remove(m);
|
|
60
59
|
}, 0);
|
|
61
60
|
};
|
|
62
61
|
}
|
|
63
|
-
}, [s, p, E,
|
|
62
|
+
}, [s, p, E, m]);
|
|
64
63
|
const P = i.useCallback(
|
|
65
64
|
(f) => {
|
|
66
|
-
if (!n && !o ||
|
|
65
|
+
if (!n && !o || m.paused) return;
|
|
67
66
|
const D = f.key === "Tab" && !f.altKey && !f.ctrlKey && !f.metaKey, g = document.activeElement;
|
|
68
67
|
if (D && g) {
|
|
69
68
|
const N = f.currentTarget, [C, h] = Ne(N);
|
|
70
69
|
C && h ? !f.shiftKey && g === h ? (f.preventDefault(), n && b(C, { select: !0 })) : f.shiftKey && g === C && (f.preventDefault(), n && b(h, { select: !0 })) : g === N && f.preventDefault();
|
|
71
70
|
}
|
|
72
71
|
},
|
|
73
|
-
[n, o,
|
|
72
|
+
[n, o, m.paused]
|
|
74
73
|
);
|
|
75
74
|
return /* @__PURE__ */ u(O.div, { tabIndex: -1, ...l, ref: d, onKeyDown: P });
|
|
76
75
|
});
|
|
@@ -168,17 +167,17 @@ var Fe = function(e) {
|
|
|
168
167
|
}, we = function(e, t, n, o) {
|
|
169
168
|
var r = Me(t, Array.isArray(e) ? e : [e]);
|
|
170
169
|
I[n] || (I[n] = /* @__PURE__ */ new WeakMap());
|
|
171
|
-
var a = I[n], l = [], s = /* @__PURE__ */ new Set(),
|
|
170
|
+
var a = I[n], l = [], s = /* @__PURE__ */ new Set(), v = new Set(r), p = function(c) {
|
|
172
171
|
!c || s.has(c) || (s.add(c), p(c.parentNode));
|
|
173
172
|
};
|
|
174
173
|
r.forEach(p);
|
|
175
174
|
var E = function(c) {
|
|
176
|
-
!c ||
|
|
175
|
+
!c || v.has(c) || Array.prototype.forEach.call(c.children, function(d) {
|
|
177
176
|
if (s.has(d))
|
|
178
177
|
E(d);
|
|
179
178
|
else
|
|
180
179
|
try {
|
|
181
|
-
var
|
|
180
|
+
var m = d.getAttribute(o), P = m !== null && m !== "false", f = (A.get(d) || 0) + 1, D = (a.get(d) || 0) + 1;
|
|
182
181
|
A.set(d, f), a.set(d, D), l.push(d), f === 1 && P && S.set(d, !0), D === 1 && d.setAttribute(n, "true"), P || d.setAttribute(o, "true");
|
|
183
182
|
} catch (g) {
|
|
184
183
|
console.error("aria-hidden: cannot operate on ", d, g);
|
|
@@ -187,8 +186,8 @@ var Fe = function(e) {
|
|
|
187
186
|
};
|
|
188
187
|
return E(t), s.clear(), k++, function() {
|
|
189
188
|
l.forEach(function(c) {
|
|
190
|
-
var d = A.get(c) - 1,
|
|
191
|
-
A.set(c, d), a.set(c,
|
|
189
|
+
var d = A.get(c) - 1, m = a.get(c) - 1;
|
|
190
|
+
A.set(c, d), a.set(c, m), d || (S.has(c) || c.removeAttribute(o), S.delete(c)), m || c.removeAttribute(n);
|
|
192
191
|
}), k--, k || (A = /* @__PURE__ */ new WeakMap(), A = /* @__PURE__ */ new WeakMap(), S = /* @__PURE__ */ new WeakMap(), I = {});
|
|
193
192
|
};
|
|
194
193
|
}, xe = function(e, t, n) {
|
|
@@ -201,9 +200,9 @@ var Fe = function(e) {
|
|
|
201
200
|
// @__NO_SIDE_EFFECTS__
|
|
202
201
|
function We(e) {
|
|
203
202
|
const t = /* @__PURE__ */ Le(e), n = i.forwardRef((o, r) => {
|
|
204
|
-
const { children: a, ...l } = o, s = i.Children.toArray(a),
|
|
205
|
-
if (
|
|
206
|
-
const p =
|
|
203
|
+
const { children: a, ...l } = o, s = i.Children.toArray(a), v = s.find(Ue);
|
|
204
|
+
if (v) {
|
|
205
|
+
const p = v.props.children, E = s.map((c) => c === v ? i.Children.count(p) > 1 ? i.Children.only(null) : i.isValidElement(p) ? p.props.children : null : c);
|
|
207
206
|
return /* @__PURE__ */ u(t, { ...l, ref: r, children: i.isValidElement(p) ? i.cloneElement(p, void 0, E) : null });
|
|
208
207
|
}
|
|
209
208
|
return /* @__PURE__ */ u(t, { ...l, ref: r, children: a });
|
|
@@ -231,8 +230,8 @@ function Ke(e, t) {
|
|
|
231
230
|
for (const o in t) {
|
|
232
231
|
const r = e[o], a = t[o];
|
|
233
232
|
/^on[A-Z]/.test(o) ? r && a ? n[o] = (...s) => {
|
|
234
|
-
const
|
|
235
|
-
return r(...s),
|
|
233
|
+
const v = a(...s);
|
|
234
|
+
return r(...s), v;
|
|
236
235
|
} : r && (n[o] = r) : o === "style" ? n[o] = { ...r, ...a } : o === "className" && (n[o] = [r, a].filter(Boolean).join(" "));
|
|
237
236
|
}
|
|
238
237
|
return { ...e, ...n };
|
|
@@ -241,7 +240,7 @@ function Ge(e) {
|
|
|
241
240
|
let t = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning;
|
|
242
241
|
return n ? e.ref : (t = Object.getOwnPropertyDescriptor(e, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
|
|
243
242
|
}
|
|
244
|
-
var M = "Dialog", [te,
|
|
243
|
+
var M = "Dialog", [te, at] = Ee(M), [Ve, y] = te(M), ne = (e) => {
|
|
245
244
|
const {
|
|
246
245
|
__scopeDialog: t,
|
|
247
246
|
children: n,
|
|
@@ -249,7 +248,7 @@ var M = "Dialog", [te, st] = Ee(M), [Ve, y] = te(M), ne = (e) => {
|
|
|
249
248
|
defaultOpen: r,
|
|
250
249
|
onOpenChange: a,
|
|
251
250
|
modal: l = !0
|
|
252
|
-
} = e, s = i.useRef(null),
|
|
251
|
+
} = e, s = i.useRef(null), v = i.useRef(null), [p, E] = ye({
|
|
253
252
|
prop: o,
|
|
254
253
|
defaultProp: r ?? !1,
|
|
255
254
|
onChange: a,
|
|
@@ -260,7 +259,7 @@ var M = "Dialog", [te, st] = Ee(M), [Ve, y] = te(M), ne = (e) => {
|
|
|
260
259
|
{
|
|
261
260
|
scope: t,
|
|
262
261
|
triggerRef: s,
|
|
263
|
-
contentRef:
|
|
262
|
+
contentRef: v,
|
|
264
263
|
contentId: w(),
|
|
265
264
|
titleId: w(),
|
|
266
265
|
descriptionId: w(),
|
|
@@ -296,7 +295,7 @@ var K = "DialogPortal", [He, ae] = te(K, {
|
|
|
296
295
|
forceMount: void 0
|
|
297
296
|
}), se = (e) => {
|
|
298
297
|
const { __scopeDialog: t, forceMount: n, children: o, container: r } = e, a = y(K, t);
|
|
299
|
-
return /* @__PURE__ */ u(He, { scope: t, forceMount: n, children: i.Children.map(o, (l) => /* @__PURE__ */ u(U, { present: n || a.open, children: /* @__PURE__ */ u(
|
|
298
|
+
return /* @__PURE__ */ u(He, { scope: t, forceMount: n, children: i.Children.map(o, (l) => /* @__PURE__ */ u(U, { present: n || a.open, children: /* @__PURE__ */ u(De, { asChild: !0, container: r, children: l }) })) });
|
|
300
299
|
};
|
|
301
300
|
se.displayName = K;
|
|
302
301
|
var T = "DialogOverlay", ie = i.forwardRef(
|
|
@@ -380,7 +379,7 @@ var Be = i.forwardRef(
|
|
|
380
379
|
}
|
|
381
380
|
), ue = i.forwardRef(
|
|
382
381
|
(e, t) => {
|
|
383
|
-
const { __scopeDialog: n, trapFocus: o, onOpenAutoFocus: r, onCloseAutoFocus: a, ...l } = e, s = y(R, n),
|
|
382
|
+
const { __scopeDialog: n, trapFocus: o, onOpenAutoFocus: r, onCloseAutoFocus: a, ...l } = e, s = y(R, n), v = i.useRef(null), p = F(t, v);
|
|
384
383
|
return Te(), /* @__PURE__ */ j(B, { children: [
|
|
385
384
|
/* @__PURE__ */ u(
|
|
386
385
|
Q,
|
|
@@ -391,7 +390,7 @@ var Be = i.forwardRef(
|
|
|
391
390
|
onMountAutoFocus: r,
|
|
392
391
|
onUnmountAutoFocus: a,
|
|
393
392
|
children: /* @__PURE__ */ u(
|
|
394
|
-
|
|
393
|
+
be,
|
|
395
394
|
{
|
|
396
395
|
role: "dialog",
|
|
397
396
|
id: s.contentId,
|
|
@@ -407,7 +406,7 @@ var Be = i.forwardRef(
|
|
|
407
406
|
),
|
|
408
407
|
/* @__PURE__ */ j(B, { children: [
|
|
409
408
|
/* @__PURE__ */ u(Ze, { titleId: s.titleId }),
|
|
410
|
-
/* @__PURE__ */ u(ze, { contentRef:
|
|
409
|
+
/* @__PURE__ */ u(ze, { contentRef: v, descriptionId: s.descriptionId })
|
|
411
410
|
] })
|
|
412
411
|
] });
|
|
413
412
|
}
|
|
@@ -425,7 +424,7 @@ var fe = "DialogDescription", de = i.forwardRef(
|
|
|
425
424
|
}
|
|
426
425
|
);
|
|
427
426
|
de.displayName = fe;
|
|
428
|
-
var pe = "DialogClose",
|
|
427
|
+
var pe = "DialogClose", ve = i.forwardRef(
|
|
429
428
|
(e, t) => {
|
|
430
429
|
const { __scopeDialog: n, ...o } = e, r = y(pe, n);
|
|
431
430
|
return /* @__PURE__ */ u(
|
|
@@ -439,16 +438,16 @@ var pe = "DialogClose", me = i.forwardRef(
|
|
|
439
438
|
);
|
|
440
439
|
}
|
|
441
440
|
);
|
|
442
|
-
|
|
441
|
+
ve.displayName = pe;
|
|
443
442
|
function V(e) {
|
|
444
443
|
return e ? "open" : "closed";
|
|
445
444
|
}
|
|
446
|
-
var
|
|
445
|
+
var me = "DialogTitleWarning", [st, ge] = he(me, {
|
|
447
446
|
contentName: R,
|
|
448
447
|
titleName: G,
|
|
449
448
|
docsSlug: "dialog"
|
|
450
449
|
}), Ze = ({ titleId: e }) => {
|
|
451
|
-
const t = ge(
|
|
450
|
+
const t = ge(me), n = `\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
452
451
|
|
|
453
452
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
454
453
|
|
|
@@ -462,18 +461,18 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
462
461
|
const r = e.current?.getAttribute("aria-describedby");
|
|
463
462
|
t && r && (document.getElementById(t) || console.warn(o));
|
|
464
463
|
}, [o, e, t]), null;
|
|
465
|
-
},
|
|
464
|
+
}, it = ne, ct = re, ut = se, lt = ie, ft = ce, dt = le, pt = de, vt = ve;
|
|
466
465
|
export {
|
|
467
|
-
|
|
466
|
+
ft as C,
|
|
468
467
|
le as D,
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
468
|
+
lt as O,
|
|
469
|
+
ut as P,
|
|
470
|
+
it as R,
|
|
471
|
+
ct as T,
|
|
472
|
+
st as W,
|
|
474
473
|
se as a,
|
|
475
474
|
vt as b,
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
475
|
+
at as c,
|
|
476
|
+
dt as d,
|
|
477
|
+
pt as e
|
|
479
478
|
};
|