@alixpartners/ui-components 2.6.0 → 2.6.2
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/{RichTextEditor-JH6YBGiw.js → RichTextEditor-xCakhho7.js} +1 -1
- package/dist/{ToastProvider-DVycF0zU.js → ToastProvider-D5LImZ-Q.js} +26 -26
- package/dist/assets/Dialog.css +1 -1
- package/dist/components/Banner/Banner.d.ts +1 -1
- package/dist/components/Banner/Banner.test.js +1 -1
- package/dist/components/Button/Button.d.ts +1 -1
- package/dist/components/Button/Button.test.js +2 -2
- package/dist/components/Checkbox/Checkbox.d.ts +1 -1
- package/dist/components/Checkbox/Checkbox.js +3 -3
- package/dist/components/Checkbox/Checkbox.test.js +1 -1
- package/dist/components/CorusHeader/CorusHeader.d.ts +1 -1
- package/dist/components/CorusHeader/CorusHeader.js +1 -1
- package/dist/components/CorusHeader/DropdownItemContent.d.ts +1 -1
- package/dist/components/CorusHeader/DropdownItemContent.js +5 -5
- package/dist/components/CorusHeader/DropdownMenu.d.ts +1 -1
- package/dist/components/CorusHeader/DropdownMenu.js +1 -1
- package/dist/components/CorusHeader/MegaMenuContent.d.ts +1 -1
- package/dist/components/CorusHeader/MegaMenuContent.js +14 -14
- package/dist/components/CorusHeader/UserProfileIcon.d.ts +1 -1
- package/dist/components/Creatable/Creatable.d.ts +1 -1
- package/dist/components/Creatable/Creatable.js +1 -1
- package/dist/components/Datepicker/Datepicker.d.ts +1 -1
- package/dist/components/Datepicker/Datepicker.js +1 -1
- package/dist/components/Datepicker/Datepicker.test.js +1 -1
- package/dist/components/Dialog/Dialog.d.ts +8 -2
- package/dist/components/Dialog/Dialog.js +227 -195
- package/dist/components/Dialog/Dialog.test.js +227 -202
- package/dist/components/DragAndDrop/DragAndDrop.d.ts +1 -1
- package/dist/components/DragAndDrop/DragAndDrop.test.js +2 -2
- package/dist/components/Dropdown/Dropdown.d.ts +1 -1
- package/dist/components/Dropdown/Dropdown.js +1 -1
- package/dist/components/FilePicker/FilePicker.d.ts +9 -9
- package/dist/components/FilePicker/FilePicker.test.js +2 -2
- package/dist/components/Ghost/Ghost.d.ts +1 -1
- package/dist/components/Ghost/Ghost.test.js +1 -1
- package/dist/components/Icon/Icon.d.ts +1 -1
- package/dist/components/Icons/IconsGallery.d.ts +1 -1
- package/dist/components/Illustration/Illustration.d.ts +1 -1
- package/dist/components/Illustration/Illustration.test.js +1 -1
- package/dist/components/Input/Input.test.js +1 -1
- package/dist/components/Logo/Logo.d.ts +1 -1
- package/dist/components/Logos/LogosGallery.d.ts +1 -1
- package/dist/components/NavBar/NavBar.d.ts +1 -1
- package/dist/components/NavBar/NavBar.js +1 -1
- package/dist/components/Radio/Radio.d.ts +1 -1
- package/dist/components/Radio/Radio.js +9 -9
- package/dist/components/RadioGroup/RadioGroup.d.ts +1 -1
- package/dist/components/RadioGroup/RadioGroup.js +11 -11
- package/dist/components/RadioGroup/RadioGroup.test.js +1 -1
- package/dist/components/RichTextEditor/RichTextEditor.d.ts +1 -1
- package/dist/components/RichTextEditor/RichTextEditor.js +2 -2
- package/dist/components/RichTextEditor/RichTextEditor.test.js +2 -2
- package/dist/components/Search/Search.d.ts +1 -1
- package/dist/components/Search/Search.test.js +1 -1
- package/dist/components/Spinner/Spinner.d.ts +1 -1
- package/dist/components/SplitButton/SplitButton.d.ts +1 -1
- package/dist/components/SplitButton/SplitButton.js +3 -3
- package/dist/components/SplitButton/SplitButton.test.js +1 -1
- package/dist/components/Tab/Tab.d.ts +1 -1
- package/dist/components/TabNavigation/TabNavigation.d.ts +1 -1
- package/dist/components/Tag/Tag.d.ts +1 -1
- package/dist/components/Tag/Tag.test.js +1 -1
- package/dist/components/TagsFields/TagsFields.d.ts +1 -1
- package/dist/components/TagsFields/TagsFields.js +1 -1
- package/dist/components/Textarea/Textarea.d.ts +1 -1
- package/dist/components/Textarea/Textarea.test.js +1 -1
- package/dist/components/Toast/Toast.test.js +1 -1
- package/dist/components/ToastProvider/ToastProvider.d.ts +1 -2
- package/dist/components/ToastProvider/ToastProvider.js +1 -1
- package/dist/components/ToastProvider/ToastProvider.test.js +4 -4
- package/dist/components/Toggle/Toggle.d.ts +1 -1
- package/dist/components/Toggle/Toggle.js +126 -211
- package/dist/components/Toggle/Toggle.test.js +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.js +61 -60
- package/dist/{index-6DGSlWJb.js → index-C2s_VtSb.js} +3 -3
- package/dist/index-C8H9A55g.js +222 -0
- package/dist/{index-CcsZYEYy.js → index-CCFDXH-J.js} +28 -29
- package/dist/index-CCnm5-ML.js +230 -0
- package/dist/{index-BVZdJVFB.js → index-CFqDEbIR.js} +191 -192
- package/dist/index-CfIcUHKK.js +70 -0
- package/dist/index-ChQc_Cm6.js +1544 -0
- package/dist/index-CmGGeUr0.js +142 -0
- package/dist/{index-IR8HlW5P.js → index-D_L0ncPJ.js} +4 -4
- package/dist/{index-banDzeKa.js → index-DkTDHhag.js} +1 -1
- package/dist/index-Ii4UOx3H.js +599 -0
- package/dist/{index-6j3vTf--.js → index-Nyh2Wa71.js} +5 -5
- package/dist/index-z_kiwVc3.js +237 -0
- package/dist/main.js +3 -3
- package/dist/storybook-docs-page.d.ts +1 -1
- package/dist/{useToast-CpwrYPvx.js → useToast-Cz5MGKnw.js} +1 -1
- package/dist/{vi.bdSIJ99Y-DWCVXj6K.js → vi.bdSIJ99Y-017e_Pkz.js} +3 -3
- package/package.json +1 -1
- package/dist/index-B4szHVNJ.js +0 -248
- package/dist/index-Bq1FiX6B.js +0 -93
- package/dist/index-CE9NpYQR.js +0 -604
- package/dist/index-CHy8gqvu.js +0 -353
- package/dist/index-CarlZuEo.js +0 -1610
- package/dist/index-DH9SO8qV.js +0 -221
- package/dist/index-kgC_DL6e.js +0 -216
|
@@ -3,11 +3,11 @@ import * as l from "react";
|
|
|
3
3
|
import { useState as ee } from "react";
|
|
4
4
|
import { c as j } from "../../clsx-OuTLNxxd.js";
|
|
5
5
|
import te from "../Icon/Icon.js";
|
|
6
|
-
import { P as F, u as oe,
|
|
7
|
-
import { P as le, D as ie } from "../../index-
|
|
8
|
-
import { u as se } from "../../index-
|
|
9
|
-
import { R as ae, A as ce, a as ue, c as B, C as pe } from "../../index-
|
|
10
|
-
import { P as K } from "../../index-
|
|
6
|
+
import { P as F, u as oe, d as G, c as C, b as re, g as ne } from "../../index-z_kiwVc3.js";
|
|
7
|
+
import { P as le, D as ie } from "../../index-CmGGeUr0.js";
|
|
8
|
+
import { u as se } from "../../index-C2s_VtSb.js";
|
|
9
|
+
import { R as ae, A as ce, a as ue, c as B, C as pe } from "../../index-ChQc_Cm6.js";
|
|
10
|
+
import { P as K } from "../../index-CfIcUHKK.js";
|
|
11
11
|
import '../../assets/Tooltip.css';var de = Object.freeze({
|
|
12
12
|
// See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
|
|
13
13
|
position: "absolute",
|
|
@@ -31,16 +31,16 @@ import '../../assets/Tooltip.css';var de = Object.freeze({
|
|
|
31
31
|
)
|
|
32
32
|
);
|
|
33
33
|
U.displayName = fe;
|
|
34
|
-
var
|
|
34
|
+
var ve = U, [D] = re("Tooltip", [
|
|
35
35
|
B
|
|
36
|
-
]), L = B(), V = "TooltipProvider",
|
|
36
|
+
]), L = B(), V = "TooltipProvider", he = 700, A = "tooltip.open", [_e, I] = D(V), $ = (e) => {
|
|
37
37
|
const {
|
|
38
38
|
__scopeTooltip: o,
|
|
39
|
-
delayDuration: t =
|
|
39
|
+
delayDuration: t = he,
|
|
40
40
|
skipDelayDuration: r = 300,
|
|
41
41
|
disableHoverableContent: n = !1,
|
|
42
42
|
children: s
|
|
43
|
-
} = e, a = l.useRef(!0),
|
|
43
|
+
} = e, a = l.useRef(!0), h = l.useRef(!1), i = l.useRef(0);
|
|
44
44
|
return l.useEffect(() => {
|
|
45
45
|
const p = i.current;
|
|
46
46
|
return () => window.clearTimeout(p);
|
|
@@ -51,17 +51,17 @@ var he = U, [D] = re("Tooltip", [
|
|
|
51
51
|
isOpenDelayedRef: a,
|
|
52
52
|
delayDuration: t,
|
|
53
53
|
onOpen: l.useCallback(() => {
|
|
54
|
-
|
|
55
|
-
}, [
|
|
54
|
+
window.clearTimeout(i.current), a.current = !1;
|
|
55
|
+
}, []),
|
|
56
56
|
onClose: l.useCallback(() => {
|
|
57
|
-
|
|
57
|
+
window.clearTimeout(i.current), i.current = window.setTimeout(
|
|
58
58
|
() => a.current = !0,
|
|
59
59
|
r
|
|
60
|
-
)
|
|
60
|
+
);
|
|
61
61
|
}, [r]),
|
|
62
|
-
isPointerInTransitRef:
|
|
62
|
+
isPointerInTransitRef: h,
|
|
63
63
|
onPointerInTransitChange: l.useCallback((p) => {
|
|
64
|
-
|
|
64
|
+
h.current = p;
|
|
65
65
|
}, []),
|
|
66
66
|
disableHoverableContent: n,
|
|
67
67
|
children: s
|
|
@@ -77,8 +77,8 @@ var R = "Tooltip", [me, O] = D(R), Y = (e) => {
|
|
|
77
77
|
defaultOpen: n,
|
|
78
78
|
onOpenChange: s,
|
|
79
79
|
disableHoverableContent: a,
|
|
80
|
-
delayDuration:
|
|
81
|
-
} = e, i = I(R, e.__scopeTooltip), p = L(o), [u,
|
|
80
|
+
delayDuration: h
|
|
81
|
+
} = e, i = I(R, e.__scopeTooltip), p = L(o), [u, v] = l.useState(null), f = se(), d = l.useRef(0), m = a ?? i.disableHoverableContent, T = h ?? i.delayDuration, _ = l.useRef(!1), [x, g] = oe({
|
|
82
82
|
prop: r,
|
|
83
83
|
defaultProp: n ?? !1,
|
|
84
84
|
onChange: (S) => {
|
|
@@ -86,30 +86,30 @@ var R = "Tooltip", [me, O] = D(R), Y = (e) => {
|
|
|
86
86
|
},
|
|
87
87
|
caller: R
|
|
88
88
|
}), w = l.useMemo(() => x ? _.current ? "delayed-open" : "instant-open" : "closed", [x]), E = l.useCallback(() => {
|
|
89
|
-
window.clearTimeout(
|
|
89
|
+
window.clearTimeout(d.current), d.current = 0, _.current = !1, g(!0);
|
|
90
90
|
}, [g]), P = l.useCallback(() => {
|
|
91
|
-
window.clearTimeout(
|
|
91
|
+
window.clearTimeout(d.current), d.current = 0, g(!1);
|
|
92
92
|
}, [g]), H = l.useCallback(() => {
|
|
93
|
-
window.clearTimeout(
|
|
94
|
-
_.current = !0, g(!0),
|
|
93
|
+
window.clearTimeout(d.current), d.current = window.setTimeout(() => {
|
|
94
|
+
_.current = !0, g(!0), d.current = 0;
|
|
95
95
|
}, T);
|
|
96
96
|
}, [T, g]);
|
|
97
97
|
return l.useEffect(() => () => {
|
|
98
|
-
|
|
98
|
+
d.current && (window.clearTimeout(d.current), d.current = 0);
|
|
99
99
|
}, []), /* @__PURE__ */ c(ae, { ...p, children: /* @__PURE__ */ c(
|
|
100
100
|
me,
|
|
101
101
|
{
|
|
102
102
|
scope: o,
|
|
103
|
-
contentId:
|
|
103
|
+
contentId: f,
|
|
104
104
|
open: x,
|
|
105
105
|
stateAttribute: w,
|
|
106
106
|
trigger: u,
|
|
107
|
-
onTriggerChange:
|
|
107
|
+
onTriggerChange: v,
|
|
108
108
|
onTriggerEnter: l.useCallback(() => {
|
|
109
109
|
i.isOpenDelayedRef.current ? H() : E();
|
|
110
110
|
}, [i.isOpenDelayedRef, H, E]),
|
|
111
111
|
onTriggerLeave: l.useCallback(() => {
|
|
112
|
-
m ? P() : (window.clearTimeout(
|
|
112
|
+
m ? P() : (window.clearTimeout(d.current), d.current = 0);
|
|
113
113
|
}, [P, m]),
|
|
114
114
|
onOpen: E,
|
|
115
115
|
onClose: P,
|
|
@@ -121,22 +121,22 @@ var R = "Tooltip", [me, O] = D(R), Y = (e) => {
|
|
|
121
121
|
Y.displayName = R;
|
|
122
122
|
var N = "TooltipTrigger", X = l.forwardRef(
|
|
123
123
|
(e, o) => {
|
|
124
|
-
const { __scopeTooltip: t, ...r } = e, n = O(N, t), s = I(N, t), a = L(t),
|
|
125
|
-
return l.useEffect(() => () => document.removeEventListener("pointerup",
|
|
124
|
+
const { __scopeTooltip: t, ...r } = e, n = O(N, t), s = I(N, t), a = L(t), h = l.useRef(null), i = G(o, h, n.onTriggerChange), p = l.useRef(!1), u = l.useRef(!1), v = l.useCallback(() => p.current = !1, []);
|
|
125
|
+
return l.useEffect(() => () => document.removeEventListener("pointerup", v), [v]), /* @__PURE__ */ c(ce, { asChild: !0, ...a, children: /* @__PURE__ */ c(
|
|
126
126
|
F.button,
|
|
127
127
|
{
|
|
128
128
|
"aria-describedby": n.open ? n.contentId : void 0,
|
|
129
129
|
"data-state": n.stateAttribute,
|
|
130
130
|
...r,
|
|
131
131
|
ref: i,
|
|
132
|
-
onPointerMove: C(e.onPointerMove, (
|
|
133
|
-
|
|
132
|
+
onPointerMove: C(e.onPointerMove, (f) => {
|
|
133
|
+
f.pointerType !== "touch" && !u.current && !s.isPointerInTransitRef.current && (n.onTriggerEnter(), u.current = !0);
|
|
134
134
|
}),
|
|
135
135
|
onPointerLeave: C(e.onPointerLeave, () => {
|
|
136
136
|
n.onTriggerLeave(), u.current = !1;
|
|
137
137
|
}),
|
|
138
138
|
onPointerDown: C(e.onPointerDown, () => {
|
|
139
|
-
n.open && n.onClose(), p.current = !0, document.addEventListener("pointerup",
|
|
139
|
+
n.open && n.onClose(), p.current = !0, document.addEventListener("pointerup", v, { once: !0 });
|
|
140
140
|
}),
|
|
141
141
|
onFocus: C(e.onFocus, () => {
|
|
142
142
|
p.current || n.onOpen();
|
|
@@ -161,31 +161,31 @@ var b = "TooltipContent", W = l.forwardRef(
|
|
|
161
161
|
return /* @__PURE__ */ c(K, { present: r || a.open, children: a.disableHoverableContent ? /* @__PURE__ */ c(z, { side: n, ...s, ref: o }) : /* @__PURE__ */ c(ge, { side: n, ...s, ref: o }) });
|
|
162
162
|
}
|
|
163
163
|
), ge = l.forwardRef((e, o) => {
|
|
164
|
-
const t = O(b, e.__scopeTooltip), r = I(b, e.__scopeTooltip), n = l.useRef(null), s = G(o, n), [a,
|
|
165
|
-
|
|
166
|
-
}, [
|
|
164
|
+
const t = O(b, e.__scopeTooltip), r = I(b, e.__scopeTooltip), n = l.useRef(null), s = G(o, n), [a, h] = l.useState(null), { trigger: i, onClose: p } = t, u = n.current, { onPointerInTransitChange: v } = r, f = l.useCallback(() => {
|
|
165
|
+
h(null), v(!1);
|
|
166
|
+
}, [v]), d = l.useCallback(
|
|
167
167
|
(m, T) => {
|
|
168
168
|
const _ = m.currentTarget, x = { x: m.clientX, y: m.clientY }, g = we(x, _.getBoundingClientRect()), w = Ee(x, g), E = Pe(T.getBoundingClientRect()), P = Oe([...w, ...E]);
|
|
169
|
-
|
|
169
|
+
h(P), v(!0);
|
|
170
170
|
},
|
|
171
|
-
[
|
|
171
|
+
[v]
|
|
172
172
|
);
|
|
173
|
-
return l.useEffect(() => () =>
|
|
173
|
+
return l.useEffect(() => () => f(), [f]), l.useEffect(() => {
|
|
174
174
|
if (i && u) {
|
|
175
|
-
const m = (_) =>
|
|
175
|
+
const m = (_) => d(_, u), T = (_) => d(_, i);
|
|
176
176
|
return i.addEventListener("pointerleave", m), u.addEventListener("pointerleave", T), () => {
|
|
177
177
|
i.removeEventListener("pointerleave", m), u.removeEventListener("pointerleave", T);
|
|
178
178
|
};
|
|
179
179
|
}
|
|
180
|
-
}, [i, u,
|
|
180
|
+
}, [i, u, d, f]), l.useEffect(() => {
|
|
181
181
|
if (a) {
|
|
182
182
|
const m = (T) => {
|
|
183
183
|
const _ = T.target, x = { x: T.clientX, y: T.clientY }, g = (i == null ? void 0 : i.contains(_)) || (u == null ? void 0 : u.contains(_)), w = !Re(x, a);
|
|
184
|
-
g ?
|
|
184
|
+
g ? f() : w && (f(), p());
|
|
185
185
|
};
|
|
186
186
|
return document.addEventListener("pointermove", m), () => document.removeEventListener("pointermove", m);
|
|
187
187
|
}
|
|
188
|
-
}, [i, u, a, p,
|
|
188
|
+
}, [i, u, a, p, f]), /* @__PURE__ */ c(z, { ...e, ref: s });
|
|
189
189
|
}), [xe, Ce] = D(R, { isInside: !1 }), be = ne("TooltipContent"), z = l.forwardRef(
|
|
190
190
|
(e, o) => {
|
|
191
191
|
const {
|
|
@@ -194,14 +194,15 @@ var b = "TooltipContent", W = l.forwardRef(
|
|
|
194
194
|
"aria-label": n,
|
|
195
195
|
onEscapeKeyDown: s,
|
|
196
196
|
onPointerDownOutside: a,
|
|
197
|
-
...
|
|
197
|
+
...h
|
|
198
198
|
} = e, i = O(b, t), p = L(t), { onClose: u } = i;
|
|
199
199
|
return l.useEffect(() => (document.addEventListener(A, u), () => document.removeEventListener(A, u)), [u]), l.useEffect(() => {
|
|
200
200
|
if (i.trigger) {
|
|
201
|
-
const
|
|
202
|
-
d
|
|
201
|
+
const v = (f) => {
|
|
202
|
+
const d = f.target;
|
|
203
|
+
d != null && d.contains(i.trigger) && u();
|
|
203
204
|
};
|
|
204
|
-
return window.addEventListener("scroll",
|
|
205
|
+
return window.addEventListener("scroll", v, { capture: !0 }), () => window.removeEventListener("scroll", v, { capture: !0 });
|
|
205
206
|
}
|
|
206
207
|
}, [i.trigger, u]), /* @__PURE__ */ c(
|
|
207
208
|
ie,
|
|
@@ -210,17 +211,17 @@ var b = "TooltipContent", W = l.forwardRef(
|
|
|
210
211
|
disableOutsidePointerEvents: !1,
|
|
211
212
|
onEscapeKeyDown: s,
|
|
212
213
|
onPointerDownOutside: a,
|
|
213
|
-
onFocusOutside: (
|
|
214
|
+
onFocusOutside: (v) => v.preventDefault(),
|
|
214
215
|
onDismiss: u,
|
|
215
216
|
children: /* @__PURE__ */ k(
|
|
216
217
|
pe,
|
|
217
218
|
{
|
|
218
219
|
"data-state": i.stateAttribute,
|
|
219
220
|
...p,
|
|
220
|
-
...
|
|
221
|
+
...h,
|
|
221
222
|
ref: o,
|
|
222
223
|
style: {
|
|
223
|
-
...
|
|
224
|
+
...h.style,
|
|
224
225
|
"--radix-tooltip-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
225
226
|
"--radix-tooltip-content-available-width": "var(--radix-popper-available-width)",
|
|
226
227
|
"--radix-tooltip-content-available-height": "var(--radix-popper-available-height)",
|
|
@@ -229,7 +230,7 @@ var b = "TooltipContent", W = l.forwardRef(
|
|
|
229
230
|
},
|
|
230
231
|
children: [
|
|
231
232
|
/* @__PURE__ */ c(be, { children: r }),
|
|
232
|
-
/* @__PURE__ */ c(xe, { scope: t, isInside: !0, children: /* @__PURE__ */ c(
|
|
233
|
+
/* @__PURE__ */ c(xe, { scope: t, isInside: !0, children: /* @__PURE__ */ c(ve, { id: i.contentId, role: "tooltip", children: n || r }) })
|
|
233
234
|
]
|
|
234
235
|
}
|
|
235
236
|
)
|
|
@@ -306,8 +307,8 @@ function Re(e, o) {
|
|
|
306
307
|
const { x: t, y: r } = e;
|
|
307
308
|
let n = !1;
|
|
308
309
|
for (let s = 0, a = o.length - 1; s < o.length; a = s++) {
|
|
309
|
-
const
|
|
310
|
-
u > r !=
|
|
310
|
+
const h = o[s], i = o[a], p = h.x, u = h.y, v = i.x, f = i.y;
|
|
311
|
+
u > r != f > r && t < (v - p) * (r - u) / (f - u) + p && (n = !n);
|
|
311
312
|
}
|
|
312
313
|
return n;
|
|
313
314
|
}
|
|
@@ -366,23 +367,23 @@ function Xe({
|
|
|
366
367
|
theme: n = "dark",
|
|
367
368
|
tipSide: s = "top",
|
|
368
369
|
tipAlignment: a = "center",
|
|
369
|
-
keepVisible:
|
|
370
|
+
keepVisible: h = !1,
|
|
370
371
|
startVisible: i = !1,
|
|
371
372
|
onClose: p,
|
|
372
373
|
className: u
|
|
373
374
|
}) {
|
|
374
|
-
const [
|
|
375
|
+
const [v, f] = ee(i);
|
|
375
376
|
if (t)
|
|
376
377
|
return /* @__PURE__ */ c(Z, { children: e });
|
|
377
|
-
const
|
|
378
|
-
|
|
378
|
+
const d = () => {
|
|
379
|
+
f(!1);
|
|
379
380
|
}, m = (_) => {
|
|
380
|
-
_.key === "Escape" &&
|
|
381
|
+
_.key === "Escape" && f(!1);
|
|
381
382
|
};
|
|
382
|
-
return /* @__PURE__ */ c(Le, { children: /* @__PURE__ */ c(ke, { defaultOpen: i, open:
|
|
383
|
-
if (
|
|
384
|
-
return
|
|
385
|
-
|
|
383
|
+
return /* @__PURE__ */ c(Le, { children: /* @__PURE__ */ c(ke, { defaultOpen: i, open: v, onOpenChange: (_) => {
|
|
384
|
+
if (h)
|
|
385
|
+
return f(!0);
|
|
386
|
+
f(_), _ || p == null || p();
|
|
386
387
|
}, children: /* @__PURE__ */ k("div", { className: j(y["tooltip-container"], u), children: [
|
|
387
388
|
/* @__PURE__ */ c(Ae, { asChild: !0, children: /* @__PURE__ */ c("div", { onKeyDown: m, role: "button", style: {
|
|
388
389
|
display: "flex",
|
|
@@ -393,7 +394,7 @@ function Xe({
|
|
|
393
394
|
zIndex: 9999
|
|
394
395
|
}, align: a, side: s, sideOffset: 0, children: /* @__PURE__ */ k("div", { id: "tooltip", role: "tooltip", className: j(y.tooltip, y[`tooltip-${r}`], y[`tooltip-${n}`], y[`tooltip-${s}`], y[`tooltip-${a}`], p && y.closable), children: [
|
|
395
396
|
/* @__PURE__ */ c("div", { className: y["tooltip-content"], children: o }),
|
|
396
|
-
(p ||
|
|
397
|
+
(p || h) && r === "md" && /* @__PURE__ */ c("button", { className: y["tooltip-close-button"], onClick: d, children: /* @__PURE__ */ c(te, { icon: "ap-icon-close", className: y["tooltip-close-icon"] }) }),
|
|
397
398
|
/* @__PURE__ */ c(Me, { width: 12, height: 6, className: y["tooltip-arrow"] })
|
|
398
399
|
] }) }) })
|
|
399
400
|
] }) }) });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as e from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { h as o } from "./index-z_kiwVc3.js";
|
|
3
3
|
var n = e[" useId ".trim().toString()] || (() => {
|
|
4
4
|
}), a = 0;
|
|
5
5
|
function f(r) {
|
|
@@ -12,10 +12,10 @@ function c(r) {
|
|
|
12
12
|
const t = e.useRef(r);
|
|
13
13
|
return e.useEffect(() => {
|
|
14
14
|
t.current = r;
|
|
15
|
-
}), e.useMemo(() => (
|
|
15
|
+
}), e.useMemo(() => (...s) => {
|
|
16
16
|
var u;
|
|
17
17
|
return (u = t.current) == null ? void 0 : u.call(t, ...s);
|
|
18
|
-
}
|
|
18
|
+
}, []);
|
|
19
19
|
}
|
|
20
20
|
export {
|
|
21
21
|
c as a,
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import * as i from "react";
|
|
2
|
+
import g from "react";
|
|
3
|
+
import { b as L, d as P, e as G, P as K, c as A, u as $ } from "./index-z_kiwVc3.js";
|
|
4
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
5
|
+
import { u as J, a as Q } from "./index-C2s_VtSb.js";
|
|
6
|
+
function W(e) {
|
|
7
|
+
const o = e + "CollectionProvider", [u, n] = L(o), [_, v] = u(
|
|
8
|
+
o,
|
|
9
|
+
{ collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
|
|
10
|
+
), I = (f) => {
|
|
11
|
+
const { scope: t, children: a } = f, d = g.useRef(null), r = g.useRef(/* @__PURE__ */ new Map()).current;
|
|
12
|
+
return /* @__PURE__ */ m(_, { scope: t, itemMap: r, collectionRef: d, children: a });
|
|
13
|
+
};
|
|
14
|
+
I.displayName = o;
|
|
15
|
+
const C = e + "CollectionSlot", h = G(C), p = g.forwardRef(
|
|
16
|
+
(f, t) => {
|
|
17
|
+
const { scope: a, children: d } = f, r = v(C, a), c = P(t, r.collectionRef);
|
|
18
|
+
return /* @__PURE__ */ m(h, { ref: c, children: d });
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
p.displayName = C;
|
|
22
|
+
const s = e + "CollectionItemSlot", R = "data-radix-collection-item", F = G(s), b = g.forwardRef(
|
|
23
|
+
(f, t) => {
|
|
24
|
+
const { scope: a, children: d, ...r } = f, c = g.useRef(null), T = P(t, c), w = v(s, a);
|
|
25
|
+
return g.useEffect(() => (w.itemMap.set(c, { ref: c, ...r }), () => void w.itemMap.delete(c))), /* @__PURE__ */ m(F, { [R]: "", ref: T, children: d });
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
b.displayName = s;
|
|
29
|
+
function E(f) {
|
|
30
|
+
const t = v(e + "CollectionConsumer", f);
|
|
31
|
+
return g.useCallback(() => {
|
|
32
|
+
const d = t.collectionRef.current;
|
|
33
|
+
if (!d) return [];
|
|
34
|
+
const r = Array.from(d.querySelectorAll(`[${R}]`));
|
|
35
|
+
return Array.from(t.itemMap.values()).sort(
|
|
36
|
+
(w, y) => r.indexOf(w.ref.current) - r.indexOf(y.ref.current)
|
|
37
|
+
);
|
|
38
|
+
}, [t.collectionRef, t.itemMap]);
|
|
39
|
+
}
|
|
40
|
+
return [
|
|
41
|
+
{ Provider: I, Slot: p, ItemSlot: b },
|
|
42
|
+
E,
|
|
43
|
+
n
|
|
44
|
+
];
|
|
45
|
+
}
|
|
46
|
+
var X = i.createContext(void 0);
|
|
47
|
+
function Z(e) {
|
|
48
|
+
const o = i.useContext(X);
|
|
49
|
+
return e || o || "ltr";
|
|
50
|
+
}
|
|
51
|
+
var N = "rovingFocusGroup.onEntryFocus", ee = { bubbles: !1, cancelable: !0 }, x = "RovingFocusGroup", [D, k, te] = W(x), [oe, Ie] = L(
|
|
52
|
+
x,
|
|
53
|
+
[te]
|
|
54
|
+
), [re, ne] = oe(x), U = i.forwardRef(
|
|
55
|
+
(e, o) => /* @__PURE__ */ m(D.Provider, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ m(D.Slot, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ m(ce, { ...e, ref: o }) }) })
|
|
56
|
+
);
|
|
57
|
+
U.displayName = x;
|
|
58
|
+
var ce = i.forwardRef((e, o) => {
|
|
59
|
+
const {
|
|
60
|
+
__scopeRovingFocusGroup: u,
|
|
61
|
+
orientation: n,
|
|
62
|
+
loop: _ = !1,
|
|
63
|
+
dir: v,
|
|
64
|
+
currentTabStopId: I,
|
|
65
|
+
defaultCurrentTabStopId: C,
|
|
66
|
+
onCurrentTabStopIdChange: h,
|
|
67
|
+
onEntryFocus: p,
|
|
68
|
+
preventScrollOnEntryFocus: s = !1,
|
|
69
|
+
...R
|
|
70
|
+
} = e, F = i.useRef(null), b = P(o, F), E = Z(v), [f, t] = $({
|
|
71
|
+
prop: I,
|
|
72
|
+
defaultProp: C ?? null,
|
|
73
|
+
onChange: h,
|
|
74
|
+
caller: x
|
|
75
|
+
}), [a, d] = i.useState(!1), r = Q(p), c = k(u), T = i.useRef(!1), [w, y] = i.useState(0);
|
|
76
|
+
return i.useEffect(() => {
|
|
77
|
+
const l = F.current;
|
|
78
|
+
if (l)
|
|
79
|
+
return l.addEventListener(N, r), () => l.removeEventListener(N, r);
|
|
80
|
+
}, [r]), /* @__PURE__ */ m(
|
|
81
|
+
re,
|
|
82
|
+
{
|
|
83
|
+
scope: u,
|
|
84
|
+
orientation: n,
|
|
85
|
+
dir: E,
|
|
86
|
+
loop: _,
|
|
87
|
+
currentTabStopId: f,
|
|
88
|
+
onItemFocus: i.useCallback(
|
|
89
|
+
(l) => t(l),
|
|
90
|
+
[t]
|
|
91
|
+
),
|
|
92
|
+
onItemShiftTab: i.useCallback(() => d(!0), []),
|
|
93
|
+
onFocusableItemAdd: i.useCallback(
|
|
94
|
+
() => y((l) => l + 1),
|
|
95
|
+
[]
|
|
96
|
+
),
|
|
97
|
+
onFocusableItemRemove: i.useCallback(
|
|
98
|
+
() => y((l) => l - 1),
|
|
99
|
+
[]
|
|
100
|
+
),
|
|
101
|
+
children: /* @__PURE__ */ m(
|
|
102
|
+
K.div,
|
|
103
|
+
{
|
|
104
|
+
tabIndex: a || w === 0 ? -1 : 0,
|
|
105
|
+
"data-orientation": n,
|
|
106
|
+
...R,
|
|
107
|
+
ref: b,
|
|
108
|
+
style: { outline: "none", ...e.style },
|
|
109
|
+
onMouseDown: A(e.onMouseDown, () => {
|
|
110
|
+
T.current = !0;
|
|
111
|
+
}),
|
|
112
|
+
onFocus: A(e.onFocus, (l) => {
|
|
113
|
+
const H = !T.current;
|
|
114
|
+
if (l.target === l.currentTarget && H && !a) {
|
|
115
|
+
const O = new CustomEvent(N, ee);
|
|
116
|
+
if (l.currentTarget.dispatchEvent(O), !O.defaultPrevented) {
|
|
117
|
+
const M = c().filter((S) => S.focusable), j = M.find((S) => S.active), q = M.find((S) => S.id === f), z = [j, q, ...M].filter(
|
|
118
|
+
Boolean
|
|
119
|
+
).map((S) => S.ref.current);
|
|
120
|
+
Y(z, s);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
T.current = !1;
|
|
124
|
+
}),
|
|
125
|
+
onBlur: A(e.onBlur, () => d(!1))
|
|
126
|
+
}
|
|
127
|
+
)
|
|
128
|
+
}
|
|
129
|
+
);
|
|
130
|
+
}), B = "RovingFocusGroupItem", V = i.forwardRef(
|
|
131
|
+
(e, o) => {
|
|
132
|
+
const {
|
|
133
|
+
__scopeRovingFocusGroup: u,
|
|
134
|
+
focusable: n = !0,
|
|
135
|
+
active: _ = !1,
|
|
136
|
+
tabStopId: v,
|
|
137
|
+
children: I,
|
|
138
|
+
...C
|
|
139
|
+
} = e, h = J(), p = v || h, s = ne(B, u), R = s.currentTabStopId === p, F = k(u), { onFocusableItemAdd: b, onFocusableItemRemove: E, currentTabStopId: f } = s;
|
|
140
|
+
return i.useEffect(() => {
|
|
141
|
+
if (n)
|
|
142
|
+
return b(), () => E();
|
|
143
|
+
}, [n, b, E]), /* @__PURE__ */ m(
|
|
144
|
+
D.ItemSlot,
|
|
145
|
+
{
|
|
146
|
+
scope: u,
|
|
147
|
+
id: p,
|
|
148
|
+
focusable: n,
|
|
149
|
+
active: _,
|
|
150
|
+
children: /* @__PURE__ */ m(
|
|
151
|
+
K.span,
|
|
152
|
+
{
|
|
153
|
+
tabIndex: R ? 0 : -1,
|
|
154
|
+
"data-orientation": s.orientation,
|
|
155
|
+
...C,
|
|
156
|
+
ref: o,
|
|
157
|
+
onMouseDown: A(e.onMouseDown, (t) => {
|
|
158
|
+
n ? s.onItemFocus(p) : t.preventDefault();
|
|
159
|
+
}),
|
|
160
|
+
onFocus: A(e.onFocus, () => s.onItemFocus(p)),
|
|
161
|
+
onKeyDown: A(e.onKeyDown, (t) => {
|
|
162
|
+
if (t.key === "Tab" && t.shiftKey) {
|
|
163
|
+
s.onItemShiftTab();
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
if (t.target !== t.currentTarget) return;
|
|
167
|
+
const a = ie(t, s.orientation, s.dir);
|
|
168
|
+
if (a !== void 0) {
|
|
169
|
+
if (t.metaKey || t.ctrlKey || t.altKey || t.shiftKey) return;
|
|
170
|
+
t.preventDefault();
|
|
171
|
+
let r = F().filter((c) => c.focusable).map((c) => c.ref.current);
|
|
172
|
+
if (a === "last") r.reverse();
|
|
173
|
+
else if (a === "prev" || a === "next") {
|
|
174
|
+
a === "prev" && r.reverse();
|
|
175
|
+
const c = r.indexOf(t.currentTarget);
|
|
176
|
+
r = s.loop ? ue(r, c + 1) : r.slice(c + 1);
|
|
177
|
+
}
|
|
178
|
+
setTimeout(() => Y(r));
|
|
179
|
+
}
|
|
180
|
+
}),
|
|
181
|
+
children: typeof I == "function" ? I({ isCurrentTabStop: R, hasTabStop: f != null }) : I
|
|
182
|
+
}
|
|
183
|
+
)
|
|
184
|
+
}
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
);
|
|
188
|
+
V.displayName = B;
|
|
189
|
+
var se = {
|
|
190
|
+
ArrowLeft: "prev",
|
|
191
|
+
ArrowUp: "prev",
|
|
192
|
+
ArrowRight: "next",
|
|
193
|
+
ArrowDown: "next",
|
|
194
|
+
PageUp: "first",
|
|
195
|
+
Home: "first",
|
|
196
|
+
PageDown: "last",
|
|
197
|
+
End: "last"
|
|
198
|
+
};
|
|
199
|
+
function ae(e, o) {
|
|
200
|
+
return o !== "rtl" ? e : e === "ArrowLeft" ? "ArrowRight" : e === "ArrowRight" ? "ArrowLeft" : e;
|
|
201
|
+
}
|
|
202
|
+
function ie(e, o, u) {
|
|
203
|
+
const n = ae(e.key, u);
|
|
204
|
+
if (!(o === "vertical" && ["ArrowLeft", "ArrowRight"].includes(n)) && !(o === "horizontal" && ["ArrowUp", "ArrowDown"].includes(n)))
|
|
205
|
+
return se[n];
|
|
206
|
+
}
|
|
207
|
+
function Y(e, o = !1) {
|
|
208
|
+
const u = document.activeElement;
|
|
209
|
+
for (const n of e)
|
|
210
|
+
if (n === u || (n.focus({ preventScroll: o }), document.activeElement !== u)) return;
|
|
211
|
+
}
|
|
212
|
+
function ue(e, o) {
|
|
213
|
+
return e.map((u, n) => e[(o + n) % e.length]);
|
|
214
|
+
}
|
|
215
|
+
var ve = U, Ce = V;
|
|
216
|
+
export {
|
|
217
|
+
Ce as I,
|
|
218
|
+
ve as R,
|
|
219
|
+
W as a,
|
|
220
|
+
Ie as c,
|
|
221
|
+
Z as u
|
|
222
|
+
};
|