@telia/teddy 0.0.12 → 0.0.14
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/assets/{5161b177f001ea1a.svg → 4bbd022cee9b0f06.svg} +12 -9
- package/dist/assets/badge.css +1 -1
- package/dist/assets/main.css +1 -1
- package/dist/badge-C6I_qxYL.js +1853 -0
- package/dist/components/accordion/accordion.js +2 -2
- package/dist/components/accordion/index.js +1 -1
- package/dist/components/badge/badge.js +2 -2
- package/dist/components/badge/index.js +1 -1
- package/dist/components/card/card.d.ts +10 -2
- package/dist/components/card/card.js +2 -2
- package/dist/components/card/index.js +1 -1
- package/dist/components/field-error-text/field-error-text.js +1 -1
- package/dist/components/icon/icon.js +1 -1
- package/dist/components/icon/index.js +1 -1
- package/dist/components/index.js +2 -2
- package/dist/components/input/input.js +1 -1
- package/dist/components/modal/index.js +1 -1
- package/dist/components/modal/modal.js +2 -2
- package/dist/components/notification/index.js +1 -1
- package/dist/components/notification/notification.d.ts +1 -1
- package/dist/components/notification/notification.js +2 -2
- package/dist/components/toggle/index.js +1 -1
- package/dist/components/toggle/toggle.d.ts +1 -1
- package/dist/components/toggle/toggle.js +2 -2
- package/dist/icons/category.d.ts +60 -57
- package/dist/icons/category.js +53 -52
- package/dist/icons/name.d.ts +1 -1
- package/dist/icons/name.js +4 -3
- package/dist/main.js +2 -2
- package/dist/utils/layout/index.d.ts +3 -1
- package/dist/utils/layout/index.js +28 -24
- package/dist/utils/layout/inset.d.ts +478 -0
- package/dist/utils/layout/inset.js +32 -0
- package/dist/utils/layout/position.d.ts +64 -0
- package/dist/utils/layout/position.js +20 -0
- package/package.json +1 -1
- package/dist/badge-DscsRVHR.js +0 -1825
|
@@ -0,0 +1,1853 @@
|
|
|
1
|
+
import './assets/badge.css';
|
|
2
|
+
import { jsx as l, Fragment as ft, jsxs as Oe } from "react/jsx-runtime";
|
|
3
|
+
import { c as w } from "./clsx-DB4S2d7J.js";
|
|
4
|
+
import * as v from "react";
|
|
5
|
+
import s, { forwardRef as S, useState as me, useRef as k, useEffect as V, useCallback as De, createElement as y, Fragment as hn, Children as yn } from "react";
|
|
6
|
+
import { b as q, _ as x, $ as Me, a as bt } from "./index-DpfSJps6.js";
|
|
7
|
+
import { d as Ye, a as pe, h as _e, e as z, c as ee, f as ne, g as Cn, i as wn, $ as xn, b as En } from "./index-FPIZOCcD.js";
|
|
8
|
+
import { $ as Rn } from "./navigation-menu-DKuyW8zE.js";
|
|
9
|
+
import { $ as T } from "./index-DM5e-Whg.js";
|
|
10
|
+
import Nn from "react-dom";
|
|
11
|
+
import { $ as An } from "./radio-group-B--zT3OL.js";
|
|
12
|
+
import { Box as Sn } from "./components/box/box.js";
|
|
13
|
+
import { Flex as Se } from "./components/flex/flex.js";
|
|
14
|
+
import "./components/grid/grid.js";
|
|
15
|
+
import "./assets/4bbd022cee9b0f06.svg";
|
|
16
|
+
import { Icon as te } from "./components/icon/icon.js";
|
|
17
|
+
import { Link as In } from "./components/link/link.js";
|
|
18
|
+
import { Button as Fe } from "./components/button/button.js";
|
|
19
|
+
import "./components/field-error-text/field-error-text.js";
|
|
20
|
+
import "./components/helper-text/helper-text.js";
|
|
21
|
+
import "./components/input/input.js";
|
|
22
|
+
import { Label as kn } from "./components/label/label.js";
|
|
23
|
+
import "./components/spinner/spinner.js";
|
|
24
|
+
import { Text as mt } from "./components/text/text.js";
|
|
25
|
+
import "./components/text-field/text-field.js";
|
|
26
|
+
import { Heading as re } from "./components/heading/heading.js";
|
|
27
|
+
import "./components/visually-hidden/visually-hidden.js";
|
|
28
|
+
import { TextSpacing as Tn } from "./components/text-spacing/text-spacing.js";
|
|
29
|
+
import { composeRefs as Le } from "./utils/composeRefs.js";
|
|
30
|
+
import { composeEventHandlers as Pn } from "./utils/composeEventHandlers.js";
|
|
31
|
+
const Ce = "focusScope.autoFocusOnMount", we = "focusScope.autoFocusOnUnmount", Ze = {
|
|
32
|
+
bubbles: !1,
|
|
33
|
+
cancelable: !0
|
|
34
|
+
}, On = /* @__PURE__ */ S((e, t) => {
|
|
35
|
+
const { loop: n = !1, trapped: o = !1, onMountAutoFocus: r, onUnmountAutoFocus: a, ...i } = e, [c, u] = me(null), b = Ye(r), m = Ye(a), f = k(null), $ = q(
|
|
36
|
+
t,
|
|
37
|
+
(d) => u(d)
|
|
38
|
+
), C = k({
|
|
39
|
+
paused: !1,
|
|
40
|
+
pause() {
|
|
41
|
+
this.paused = !0;
|
|
42
|
+
},
|
|
43
|
+
resume() {
|
|
44
|
+
this.paused = !1;
|
|
45
|
+
}
|
|
46
|
+
}).current;
|
|
47
|
+
V(() => {
|
|
48
|
+
if (o) {
|
|
49
|
+
let d = function(g) {
|
|
50
|
+
if (C.paused || !c)
|
|
51
|
+
return;
|
|
52
|
+
const E = g.target;
|
|
53
|
+
c.contains(E) ? f.current = E : H(f.current, {
|
|
54
|
+
select: !0
|
|
55
|
+
});
|
|
56
|
+
}, p = function(g) {
|
|
57
|
+
if (C.paused || !c)
|
|
58
|
+
return;
|
|
59
|
+
const E = g.relatedTarget;
|
|
60
|
+
E !== null && (c.contains(E) || H(f.current, {
|
|
61
|
+
select: !0
|
|
62
|
+
}));
|
|
63
|
+
}, _ = function(g) {
|
|
64
|
+
if (document.activeElement === document.body)
|
|
65
|
+
for (const N of g)
|
|
66
|
+
N.removedNodes.length > 0 && H(c);
|
|
67
|
+
};
|
|
68
|
+
document.addEventListener("focusin", d), document.addEventListener("focusout", p);
|
|
69
|
+
const h = new MutationObserver(_);
|
|
70
|
+
return c && h.observe(c, {
|
|
71
|
+
childList: !0,
|
|
72
|
+
subtree: !0
|
|
73
|
+
}), () => {
|
|
74
|
+
document.removeEventListener("focusin", d), document.removeEventListener("focusout", p), h.disconnect();
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
}, [
|
|
78
|
+
o,
|
|
79
|
+
c,
|
|
80
|
+
C.paused
|
|
81
|
+
]), V(() => {
|
|
82
|
+
if (c) {
|
|
83
|
+
Je.add(C);
|
|
84
|
+
const d = document.activeElement;
|
|
85
|
+
if (!c.contains(d)) {
|
|
86
|
+
const _ = new CustomEvent(Ce, Ze);
|
|
87
|
+
c.addEventListener(Ce, b), c.dispatchEvent(_), _.defaultPrevented || (Dn(Hn(pt(c)), {
|
|
88
|
+
select: !0
|
|
89
|
+
}), document.activeElement === d && H(c));
|
|
90
|
+
}
|
|
91
|
+
return () => {
|
|
92
|
+
c.removeEventListener(Ce, b), setTimeout(() => {
|
|
93
|
+
const _ = new CustomEvent(we, Ze);
|
|
94
|
+
c.addEventListener(we, m), c.dispatchEvent(_), _.defaultPrevented || H(d ?? document.body, {
|
|
95
|
+
select: !0
|
|
96
|
+
}), c.removeEventListener(we, m), Je.remove(C);
|
|
97
|
+
}, 0);
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
}, [
|
|
101
|
+
c,
|
|
102
|
+
b,
|
|
103
|
+
m,
|
|
104
|
+
C
|
|
105
|
+
]);
|
|
106
|
+
const R = De((d) => {
|
|
107
|
+
if (!n && !o || C.paused)
|
|
108
|
+
return;
|
|
109
|
+
const p = d.key === "Tab" && !d.altKey && !d.ctrlKey && !d.metaKey, _ = document.activeElement;
|
|
110
|
+
if (p && _) {
|
|
111
|
+
const h = d.currentTarget, [g, E] = Mn(h);
|
|
112
|
+
g && E ? !d.shiftKey && _ === E ? (d.preventDefault(), n && H(g, {
|
|
113
|
+
select: !0
|
|
114
|
+
})) : d.shiftKey && _ === g && (d.preventDefault(), n && H(E, {
|
|
115
|
+
select: !0
|
|
116
|
+
})) : _ === h && d.preventDefault();
|
|
117
|
+
}
|
|
118
|
+
}, [
|
|
119
|
+
n,
|
|
120
|
+
o,
|
|
121
|
+
C.paused
|
|
122
|
+
]);
|
|
123
|
+
return /* @__PURE__ */ y(T.div, x({
|
|
124
|
+
tabIndex: -1
|
|
125
|
+
}, i, {
|
|
126
|
+
ref: $,
|
|
127
|
+
onKeyDown: R
|
|
128
|
+
}));
|
|
129
|
+
});
|
|
130
|
+
function Dn(e, { select: t = !1 } = {}) {
|
|
131
|
+
const n = document.activeElement;
|
|
132
|
+
for (const o of e)
|
|
133
|
+
if (H(o, {
|
|
134
|
+
select: t
|
|
135
|
+
}), document.activeElement !== n)
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
function Mn(e) {
|
|
139
|
+
const t = pt(e), n = Qe(t, e), o = Qe(t.reverse(), e);
|
|
140
|
+
return [
|
|
141
|
+
n,
|
|
142
|
+
o
|
|
143
|
+
];
|
|
144
|
+
}
|
|
145
|
+
function pt(e) {
|
|
146
|
+
const t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
|
|
147
|
+
acceptNode: (o) => {
|
|
148
|
+
const r = o.tagName === "INPUT" && o.type === "hidden";
|
|
149
|
+
return o.disabled || o.hidden || r ? NodeFilter.FILTER_SKIP : o.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
for (; n.nextNode(); )
|
|
153
|
+
t.push(n.currentNode);
|
|
154
|
+
return t;
|
|
155
|
+
}
|
|
156
|
+
function Qe(e, t) {
|
|
157
|
+
for (const n of e)
|
|
158
|
+
if (!Fn(n, {
|
|
159
|
+
upTo: t
|
|
160
|
+
}))
|
|
161
|
+
return n;
|
|
162
|
+
}
|
|
163
|
+
function Fn(e, { upTo: t }) {
|
|
164
|
+
if (getComputedStyle(e).visibility === "hidden")
|
|
165
|
+
return !0;
|
|
166
|
+
for (; e; ) {
|
|
167
|
+
if (t !== void 0 && e === t)
|
|
168
|
+
return !1;
|
|
169
|
+
if (getComputedStyle(e).display === "none")
|
|
170
|
+
return !0;
|
|
171
|
+
e = e.parentElement;
|
|
172
|
+
}
|
|
173
|
+
return !1;
|
|
174
|
+
}
|
|
175
|
+
function Ln(e) {
|
|
176
|
+
return e instanceof HTMLInputElement && "select" in e;
|
|
177
|
+
}
|
|
178
|
+
function H(e, { select: t = !1 } = {}) {
|
|
179
|
+
if (e && e.focus) {
|
|
180
|
+
const n = document.activeElement;
|
|
181
|
+
e.focus({
|
|
182
|
+
preventScroll: !0
|
|
183
|
+
}), e !== n && Ln(e) && t && e.select();
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
const Je = Bn();
|
|
187
|
+
function Bn() {
|
|
188
|
+
let e = [];
|
|
189
|
+
return {
|
|
190
|
+
add(t) {
|
|
191
|
+
const n = e[0];
|
|
192
|
+
t !== n && (n == null || n.pause()), e = et(e, t), e.unshift(t);
|
|
193
|
+
},
|
|
194
|
+
remove(t) {
|
|
195
|
+
var n;
|
|
196
|
+
e = et(e, t), (n = e[0]) === null || n === void 0 || n.resume();
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
function et(e, t) {
|
|
201
|
+
const n = [
|
|
202
|
+
...e
|
|
203
|
+
], o = n.indexOf(t);
|
|
204
|
+
return o !== -1 && n.splice(o, 1), n;
|
|
205
|
+
}
|
|
206
|
+
function Hn(e) {
|
|
207
|
+
return e.filter(
|
|
208
|
+
(t) => t.tagName !== "A"
|
|
209
|
+
);
|
|
210
|
+
}
|
|
211
|
+
const zn = /* @__PURE__ */ S((e, t) => {
|
|
212
|
+
var n;
|
|
213
|
+
const { container: o = globalThis == null || (n = globalThis.document) === null || n === void 0 ? void 0 : n.body, ...r } = e;
|
|
214
|
+
return o ? /* @__PURE__ */ Nn.createPortal(/* @__PURE__ */ y(T.div, x({}, r, {
|
|
215
|
+
ref: t
|
|
216
|
+
})), o) : null;
|
|
217
|
+
});
|
|
218
|
+
let xe = 0;
|
|
219
|
+
function Vn() {
|
|
220
|
+
V(() => {
|
|
221
|
+
var e, t;
|
|
222
|
+
const n = document.querySelectorAll("[data-radix-focus-guard]");
|
|
223
|
+
return document.body.insertAdjacentElement("afterbegin", (e = n[0]) !== null && e !== void 0 ? e : tt()), document.body.insertAdjacentElement("beforeend", (t = n[1]) !== null && t !== void 0 ? t : tt()), xe++, () => {
|
|
224
|
+
xe === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach(
|
|
225
|
+
(o) => o.remove()
|
|
226
|
+
), xe--;
|
|
227
|
+
};
|
|
228
|
+
}, []);
|
|
229
|
+
}
|
|
230
|
+
function tt() {
|
|
231
|
+
const e = document.createElement("span");
|
|
232
|
+
return e.setAttribute("data-radix-focus-guard", ""), e.tabIndex = 0, e.style.cssText = "outline: none; opacity: 0; position: fixed; pointer-events: none", e;
|
|
233
|
+
}
|
|
234
|
+
var O = function() {
|
|
235
|
+
return O = Object.assign || function(t) {
|
|
236
|
+
for (var n, o = 1, r = arguments.length; o < r; o++) {
|
|
237
|
+
n = arguments[o];
|
|
238
|
+
for (var a in n)
|
|
239
|
+
Object.prototype.hasOwnProperty.call(n, a) && (t[a] = n[a]);
|
|
240
|
+
}
|
|
241
|
+
return t;
|
|
242
|
+
}, O.apply(this, arguments);
|
|
243
|
+
};
|
|
244
|
+
function _t(e, t) {
|
|
245
|
+
var n = {};
|
|
246
|
+
for (var o in e)
|
|
247
|
+
Object.prototype.hasOwnProperty.call(e, o) && t.indexOf(o) < 0 && (n[o] = e[o]);
|
|
248
|
+
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
249
|
+
for (var r = 0, o = Object.getOwnPropertySymbols(e); r < o.length; r++)
|
|
250
|
+
t.indexOf(o[r]) < 0 && Object.prototype.propertyIsEnumerable.call(e, o[r]) && (n[o[r]] = e[o[r]]);
|
|
251
|
+
return n;
|
|
252
|
+
}
|
|
253
|
+
function Wn(e, t, n) {
|
|
254
|
+
if (n || arguments.length === 2)
|
|
255
|
+
for (var o = 0, r = t.length, a; o < r; o++)
|
|
256
|
+
(a || !(o in t)) && (a || (a = Array.prototype.slice.call(t, 0, o)), a[o] = t[o]);
|
|
257
|
+
return e.concat(a || Array.prototype.slice.call(t));
|
|
258
|
+
}
|
|
259
|
+
var fe = "right-scroll-bar-position", be = "width-before-scroll-bar", jn = "with-scroll-bars-hidden", qn = "--removed-body-scroll-bar-size";
|
|
260
|
+
function Ee(e, t) {
|
|
261
|
+
return typeof e == "function" ? e(t) : e && (e.current = t), e;
|
|
262
|
+
}
|
|
263
|
+
function Un(e, t) {
|
|
264
|
+
var n = me(function() {
|
|
265
|
+
return {
|
|
266
|
+
// value
|
|
267
|
+
value: e,
|
|
268
|
+
// last callback
|
|
269
|
+
callback: t,
|
|
270
|
+
// "memoized" public interface
|
|
271
|
+
facade: {
|
|
272
|
+
get current() {
|
|
273
|
+
return n.value;
|
|
274
|
+
},
|
|
275
|
+
set current(o) {
|
|
276
|
+
var r = n.value;
|
|
277
|
+
r !== o && (n.value = o, n.callback(o, r));
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
};
|
|
281
|
+
})[0];
|
|
282
|
+
return n.callback = t, n.facade;
|
|
283
|
+
}
|
|
284
|
+
var Gn = typeof window < "u" ? v.useLayoutEffect : v.useEffect, nt = /* @__PURE__ */ new WeakMap();
|
|
285
|
+
function Kn(e, t) {
|
|
286
|
+
var n = Un(t || null, function(o) {
|
|
287
|
+
return e.forEach(function(r) {
|
|
288
|
+
return Ee(r, o);
|
|
289
|
+
});
|
|
290
|
+
});
|
|
291
|
+
return Gn(function() {
|
|
292
|
+
var o = nt.get(n);
|
|
293
|
+
if (o) {
|
|
294
|
+
var r = new Set(o), a = new Set(e), i = n.current;
|
|
295
|
+
r.forEach(function(c) {
|
|
296
|
+
a.has(c) || Ee(c, null);
|
|
297
|
+
}), a.forEach(function(c) {
|
|
298
|
+
r.has(c) || Ee(c, i);
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
nt.set(n, e);
|
|
302
|
+
}, [e]), n;
|
|
303
|
+
}
|
|
304
|
+
function Xn(e) {
|
|
305
|
+
return e;
|
|
306
|
+
}
|
|
307
|
+
function Yn(e, t) {
|
|
308
|
+
t === void 0 && (t = Xn);
|
|
309
|
+
var n = [], o = !1, r = {
|
|
310
|
+
read: function() {
|
|
311
|
+
if (o)
|
|
312
|
+
throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
|
|
313
|
+
return n.length ? n[n.length - 1] : e;
|
|
314
|
+
},
|
|
315
|
+
useMedium: function(a) {
|
|
316
|
+
var i = t(a, o);
|
|
317
|
+
return n.push(i), function() {
|
|
318
|
+
n = n.filter(function(c) {
|
|
319
|
+
return c !== i;
|
|
320
|
+
});
|
|
321
|
+
};
|
|
322
|
+
},
|
|
323
|
+
assignSyncMedium: function(a) {
|
|
324
|
+
for (o = !0; n.length; ) {
|
|
325
|
+
var i = n;
|
|
326
|
+
n = [], i.forEach(a);
|
|
327
|
+
}
|
|
328
|
+
n = {
|
|
329
|
+
push: function(c) {
|
|
330
|
+
return a(c);
|
|
331
|
+
},
|
|
332
|
+
filter: function() {
|
|
333
|
+
return n;
|
|
334
|
+
}
|
|
335
|
+
};
|
|
336
|
+
},
|
|
337
|
+
assignMedium: function(a) {
|
|
338
|
+
o = !0;
|
|
339
|
+
var i = [];
|
|
340
|
+
if (n.length) {
|
|
341
|
+
var c = n;
|
|
342
|
+
n = [], c.forEach(a), i = n;
|
|
343
|
+
}
|
|
344
|
+
var u = function() {
|
|
345
|
+
var m = i;
|
|
346
|
+
i = [], m.forEach(a);
|
|
347
|
+
}, b = function() {
|
|
348
|
+
return Promise.resolve().then(u);
|
|
349
|
+
};
|
|
350
|
+
b(), n = {
|
|
351
|
+
push: function(m) {
|
|
352
|
+
i.push(m), b();
|
|
353
|
+
},
|
|
354
|
+
filter: function(m) {
|
|
355
|
+
return i = i.filter(m), n;
|
|
356
|
+
}
|
|
357
|
+
};
|
|
358
|
+
}
|
|
359
|
+
};
|
|
360
|
+
return r;
|
|
361
|
+
}
|
|
362
|
+
function Zn(e) {
|
|
363
|
+
e === void 0 && (e = {});
|
|
364
|
+
var t = Yn(null);
|
|
365
|
+
return t.options = O({ async: !0, ssr: !1 }, e), t;
|
|
366
|
+
}
|
|
367
|
+
var vt = function(e) {
|
|
368
|
+
var t = e.sideCar, n = _t(e, ["sideCar"]);
|
|
369
|
+
if (!t)
|
|
370
|
+
throw new Error("Sidecar: please provide `sideCar` property to import the right car");
|
|
371
|
+
var o = t.read();
|
|
372
|
+
if (!o)
|
|
373
|
+
throw new Error("Sidecar medium not found");
|
|
374
|
+
return v.createElement(o, O({}, n));
|
|
375
|
+
};
|
|
376
|
+
vt.isSideCarExport = !0;
|
|
377
|
+
function Qn(e, t) {
|
|
378
|
+
return e.useMedium(t), vt;
|
|
379
|
+
}
|
|
380
|
+
var $t = Zn(), Re = function() {
|
|
381
|
+
}, ve = v.forwardRef(function(e, t) {
|
|
382
|
+
var n = v.useRef(null), o = v.useState({
|
|
383
|
+
onScrollCapture: Re,
|
|
384
|
+
onWheelCapture: Re,
|
|
385
|
+
onTouchMoveCapture: Re
|
|
386
|
+
}), r = o[0], a = o[1], i = e.forwardProps, c = e.children, u = e.className, b = e.removeScrollBar, m = e.enabled, f = e.shards, $ = e.sideCar, C = e.noIsolation, R = e.inert, d = e.allowPinchZoom, p = e.as, _ = p === void 0 ? "div" : p, h = _t(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom", "as"]), g = $, E = Kn([n, t]), N = O(O({}, h), r);
|
|
387
|
+
return v.createElement(
|
|
388
|
+
v.Fragment,
|
|
389
|
+
null,
|
|
390
|
+
m && v.createElement(g, { sideCar: $t, removeScrollBar: b, shards: f, noIsolation: C, inert: R, setCallbacks: a, allowPinchZoom: !!d, lockRef: n }),
|
|
391
|
+
i ? v.cloneElement(v.Children.only(c), O(O({}, N), { ref: E })) : v.createElement(_, O({}, N, { className: u, ref: E }), c)
|
|
392
|
+
);
|
|
393
|
+
});
|
|
394
|
+
ve.defaultProps = {
|
|
395
|
+
enabled: !0,
|
|
396
|
+
removeScrollBar: !0,
|
|
397
|
+
inert: !1
|
|
398
|
+
};
|
|
399
|
+
ve.classNames = {
|
|
400
|
+
fullWidth: be,
|
|
401
|
+
zeroRight: fe
|
|
402
|
+
};
|
|
403
|
+
var Jn = function() {
|
|
404
|
+
if (typeof __webpack_nonce__ < "u")
|
|
405
|
+
return __webpack_nonce__;
|
|
406
|
+
};
|
|
407
|
+
function eo() {
|
|
408
|
+
if (!document)
|
|
409
|
+
return null;
|
|
410
|
+
var e = document.createElement("style");
|
|
411
|
+
e.type = "text/css";
|
|
412
|
+
var t = Jn();
|
|
413
|
+
return t && e.setAttribute("nonce", t), e;
|
|
414
|
+
}
|
|
415
|
+
function to(e, t) {
|
|
416
|
+
e.styleSheet ? e.styleSheet.cssText = t : e.appendChild(document.createTextNode(t));
|
|
417
|
+
}
|
|
418
|
+
function no(e) {
|
|
419
|
+
var t = document.head || document.getElementsByTagName("head")[0];
|
|
420
|
+
t.appendChild(e);
|
|
421
|
+
}
|
|
422
|
+
var oo = function() {
|
|
423
|
+
var e = 0, t = null;
|
|
424
|
+
return {
|
|
425
|
+
add: function(n) {
|
|
426
|
+
e == 0 && (t = eo()) && (to(t, n), no(t)), e++;
|
|
427
|
+
},
|
|
428
|
+
remove: function() {
|
|
429
|
+
e--, !e && t && (t.parentNode && t.parentNode.removeChild(t), t = null);
|
|
430
|
+
}
|
|
431
|
+
};
|
|
432
|
+
}, ro = function() {
|
|
433
|
+
var e = oo();
|
|
434
|
+
return function(t, n) {
|
|
435
|
+
v.useEffect(function() {
|
|
436
|
+
return e.add(t), function() {
|
|
437
|
+
e.remove();
|
|
438
|
+
};
|
|
439
|
+
}, [t && n]);
|
|
440
|
+
};
|
|
441
|
+
}, gt = function() {
|
|
442
|
+
var e = ro(), t = function(n) {
|
|
443
|
+
var o = n.styles, r = n.dynamic;
|
|
444
|
+
return e(o, r), null;
|
|
445
|
+
};
|
|
446
|
+
return t;
|
|
447
|
+
}, ao = {
|
|
448
|
+
left: 0,
|
|
449
|
+
top: 0,
|
|
450
|
+
right: 0,
|
|
451
|
+
gap: 0
|
|
452
|
+
}, Ne = function(e) {
|
|
453
|
+
return parseInt(e || "", 10) || 0;
|
|
454
|
+
}, co = function(e) {
|
|
455
|
+
var t = window.getComputedStyle(document.body), n = t[e === "padding" ? "paddingLeft" : "marginLeft"], o = t[e === "padding" ? "paddingTop" : "marginTop"], r = t[e === "padding" ? "paddingRight" : "marginRight"];
|
|
456
|
+
return [Ne(n), Ne(o), Ne(r)];
|
|
457
|
+
}, io = function(e) {
|
|
458
|
+
if (e === void 0 && (e = "margin"), typeof window > "u")
|
|
459
|
+
return ao;
|
|
460
|
+
var t = co(e), n = document.documentElement.clientWidth, o = window.innerWidth;
|
|
461
|
+
return {
|
|
462
|
+
left: t[0],
|
|
463
|
+
top: t[1],
|
|
464
|
+
right: t[2],
|
|
465
|
+
gap: Math.max(0, o - n + t[2] - t[0])
|
|
466
|
+
};
|
|
467
|
+
}, so = gt(), Z = "data-scroll-locked", lo = function(e, t, n, o) {
|
|
468
|
+
var r = e.left, a = e.top, i = e.right, c = e.gap;
|
|
469
|
+
return n === void 0 && (n = "margin"), `
|
|
470
|
+
.`.concat(jn, ` {
|
|
471
|
+
overflow: hidden `).concat(o, `;
|
|
472
|
+
padding-right: `).concat(c, "px ").concat(o, `;
|
|
473
|
+
}
|
|
474
|
+
body[`).concat(Z, `] {
|
|
475
|
+
overflow: hidden `).concat(o, `;
|
|
476
|
+
overscroll-behavior: contain;
|
|
477
|
+
`).concat([
|
|
478
|
+
t && "position: relative ".concat(o, ";"),
|
|
479
|
+
n === "margin" && `
|
|
480
|
+
padding-left: `.concat(r, `px;
|
|
481
|
+
padding-top: `).concat(a, `px;
|
|
482
|
+
padding-right: `).concat(i, `px;
|
|
483
|
+
margin-left:0;
|
|
484
|
+
margin-top:0;
|
|
485
|
+
margin-right: `).concat(c, "px ").concat(o, `;
|
|
486
|
+
`),
|
|
487
|
+
n === "padding" && "padding-right: ".concat(c, "px ").concat(o, ";")
|
|
488
|
+
].filter(Boolean).join(""), `
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
.`).concat(fe, ` {
|
|
492
|
+
right: `).concat(c, "px ").concat(o, `;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
.`).concat(be, ` {
|
|
496
|
+
margin-right: `).concat(c, "px ").concat(o, `;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
.`).concat(fe, " .").concat(fe, ` {
|
|
500
|
+
right: 0 `).concat(o, `;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
.`).concat(be, " .").concat(be, ` {
|
|
504
|
+
margin-right: 0 `).concat(o, `;
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
body[`).concat(Z, `] {
|
|
508
|
+
`).concat(qn, ": ").concat(c, `px;
|
|
509
|
+
}
|
|
510
|
+
`);
|
|
511
|
+
}, ot = function() {
|
|
512
|
+
var e = parseInt(document.body.getAttribute(Z) || "0", 10);
|
|
513
|
+
return isFinite(e) ? e : 0;
|
|
514
|
+
}, uo = function() {
|
|
515
|
+
v.useEffect(function() {
|
|
516
|
+
return document.body.setAttribute(Z, (ot() + 1).toString()), function() {
|
|
517
|
+
var e = ot() - 1;
|
|
518
|
+
e <= 0 ? document.body.removeAttribute(Z) : document.body.setAttribute(Z, e.toString());
|
|
519
|
+
};
|
|
520
|
+
}, []);
|
|
521
|
+
}, fo = function(e) {
|
|
522
|
+
var t = e.noRelative, n = e.noImportant, o = e.gapMode, r = o === void 0 ? "margin" : o;
|
|
523
|
+
uo();
|
|
524
|
+
var a = v.useMemo(function() {
|
|
525
|
+
return io(r);
|
|
526
|
+
}, [r]);
|
|
527
|
+
return v.createElement(so, { styles: lo(a, !t, r, n ? "" : "!important") });
|
|
528
|
+
}, Ie = !1;
|
|
529
|
+
if (typeof window < "u")
|
|
530
|
+
try {
|
|
531
|
+
var se = Object.defineProperty({}, "passive", {
|
|
532
|
+
get: function() {
|
|
533
|
+
return Ie = !0, !0;
|
|
534
|
+
}
|
|
535
|
+
});
|
|
536
|
+
window.addEventListener("test", se, se), window.removeEventListener("test", se, se);
|
|
537
|
+
} catch {
|
|
538
|
+
Ie = !1;
|
|
539
|
+
}
|
|
540
|
+
var K = Ie ? { passive: !1 } : !1, bo = function(e) {
|
|
541
|
+
return e.tagName === "TEXTAREA";
|
|
542
|
+
}, ht = function(e, t) {
|
|
543
|
+
var n = window.getComputedStyle(e);
|
|
544
|
+
return (
|
|
545
|
+
// not-not-scrollable
|
|
546
|
+
n[t] !== "hidden" && // contains scroll inside self
|
|
547
|
+
!(n.overflowY === n.overflowX && !bo(e) && n[t] === "visible")
|
|
548
|
+
);
|
|
549
|
+
}, mo = function(e) {
|
|
550
|
+
return ht(e, "overflowY");
|
|
551
|
+
}, po = function(e) {
|
|
552
|
+
return ht(e, "overflowX");
|
|
553
|
+
}, rt = function(e, t) {
|
|
554
|
+
var n = t;
|
|
555
|
+
do {
|
|
556
|
+
typeof ShadowRoot < "u" && n instanceof ShadowRoot && (n = n.host);
|
|
557
|
+
var o = yt(e, n);
|
|
558
|
+
if (o) {
|
|
559
|
+
var r = Ct(e, n), a = r[1], i = r[2];
|
|
560
|
+
if (a > i)
|
|
561
|
+
return !0;
|
|
562
|
+
}
|
|
563
|
+
n = n.parentNode;
|
|
564
|
+
} while (n && n !== document.body);
|
|
565
|
+
return !1;
|
|
566
|
+
}, _o = function(e) {
|
|
567
|
+
var t = e.scrollTop, n = e.scrollHeight, o = e.clientHeight;
|
|
568
|
+
return [
|
|
569
|
+
t,
|
|
570
|
+
n,
|
|
571
|
+
o
|
|
572
|
+
];
|
|
573
|
+
}, vo = function(e) {
|
|
574
|
+
var t = e.scrollLeft, n = e.scrollWidth, o = e.clientWidth;
|
|
575
|
+
return [
|
|
576
|
+
t,
|
|
577
|
+
n,
|
|
578
|
+
o
|
|
579
|
+
];
|
|
580
|
+
}, yt = function(e, t) {
|
|
581
|
+
return e === "v" ? mo(t) : po(t);
|
|
582
|
+
}, Ct = function(e, t) {
|
|
583
|
+
return e === "v" ? _o(t) : vo(t);
|
|
584
|
+
}, $o = function(e, t) {
|
|
585
|
+
return e === "h" && t === "rtl" ? -1 : 1;
|
|
586
|
+
}, go = function(e, t, n, o, r) {
|
|
587
|
+
var a = $o(e, window.getComputedStyle(t).direction), i = a * o, c = n.target, u = t.contains(c), b = !1, m = i > 0, f = 0, $ = 0;
|
|
588
|
+
do {
|
|
589
|
+
var C = Ct(e, c), R = C[0], d = C[1], p = C[2], _ = d - p - a * R;
|
|
590
|
+
(R || _) && yt(e, c) && (f += _, $ += R), c = c.parentNode;
|
|
591
|
+
} while (
|
|
592
|
+
// portaled content
|
|
593
|
+
!u && c !== document.body || // self content
|
|
594
|
+
u && (t.contains(c) || t === c)
|
|
595
|
+
);
|
|
596
|
+
return (m && (r && f === 0 || !r && i > f) || !m && (r && $ === 0 || !r && -i > $)) && (b = !0), b;
|
|
597
|
+
}, de = function(e) {
|
|
598
|
+
return "changedTouches" in e ? [e.changedTouches[0].clientX, e.changedTouches[0].clientY] : [0, 0];
|
|
599
|
+
}, at = function(e) {
|
|
600
|
+
return [e.deltaX, e.deltaY];
|
|
601
|
+
}, ct = function(e) {
|
|
602
|
+
return e && "current" in e ? e.current : e;
|
|
603
|
+
}, ho = function(e, t) {
|
|
604
|
+
return e[0] === t[0] && e[1] === t[1];
|
|
605
|
+
}, yo = function(e) {
|
|
606
|
+
return `
|
|
607
|
+
.block-interactivity-`.concat(e, ` {pointer-events: none;}
|
|
608
|
+
.allow-interactivity-`).concat(e, ` {pointer-events: all;}
|
|
609
|
+
`);
|
|
610
|
+
}, Co = 0, X = [];
|
|
611
|
+
function wo(e) {
|
|
612
|
+
var t = v.useRef([]), n = v.useRef([0, 0]), o = v.useRef(), r = v.useState(Co++)[0], a = v.useState(function() {
|
|
613
|
+
return gt();
|
|
614
|
+
})[0], i = v.useRef(e);
|
|
615
|
+
v.useEffect(function() {
|
|
616
|
+
i.current = e;
|
|
617
|
+
}, [e]), v.useEffect(function() {
|
|
618
|
+
if (e.inert) {
|
|
619
|
+
document.body.classList.add("block-interactivity-".concat(r));
|
|
620
|
+
var d = Wn([e.lockRef.current], (e.shards || []).map(ct), !0).filter(Boolean);
|
|
621
|
+
return d.forEach(function(p) {
|
|
622
|
+
return p.classList.add("allow-interactivity-".concat(r));
|
|
623
|
+
}), function() {
|
|
624
|
+
document.body.classList.remove("block-interactivity-".concat(r)), d.forEach(function(p) {
|
|
625
|
+
return p.classList.remove("allow-interactivity-".concat(r));
|
|
626
|
+
});
|
|
627
|
+
};
|
|
628
|
+
}
|
|
629
|
+
}, [e.inert, e.lockRef.current, e.shards]);
|
|
630
|
+
var c = v.useCallback(function(d, p) {
|
|
631
|
+
if ("touches" in d && d.touches.length === 2)
|
|
632
|
+
return !i.current.allowPinchZoom;
|
|
633
|
+
var _ = de(d), h = n.current, g = "deltaX" in d ? d.deltaX : h[0] - _[0], E = "deltaY" in d ? d.deltaY : h[1] - _[1], N, j = d.target, F = Math.abs(g) > Math.abs(E) ? "h" : "v";
|
|
634
|
+
if ("touches" in d && F === "h" && j.type === "range")
|
|
635
|
+
return !1;
|
|
636
|
+
var U = rt(F, j);
|
|
637
|
+
if (!U)
|
|
638
|
+
return !0;
|
|
639
|
+
if (U ? N = F : (N = F === "v" ? "h" : "v", U = rt(F, j)), !U)
|
|
640
|
+
return !1;
|
|
641
|
+
if (!o.current && "changedTouches" in d && (g || E) && (o.current = N), !N)
|
|
642
|
+
return !0;
|
|
643
|
+
var G = o.current || N;
|
|
644
|
+
return go(G, p, d, G === "h" ? g : E, !0);
|
|
645
|
+
}, []), u = v.useCallback(function(d) {
|
|
646
|
+
var p = d;
|
|
647
|
+
if (!(!X.length || X[X.length - 1] !== a)) {
|
|
648
|
+
var _ = "deltaY" in p ? at(p) : de(p), h = t.current.filter(function(N) {
|
|
649
|
+
return N.name === p.type && N.target === p.target && ho(N.delta, _);
|
|
650
|
+
})[0];
|
|
651
|
+
if (h && h.should) {
|
|
652
|
+
p.cancelable && p.preventDefault();
|
|
653
|
+
return;
|
|
654
|
+
}
|
|
655
|
+
if (!h) {
|
|
656
|
+
var g = (i.current.shards || []).map(ct).filter(Boolean).filter(function(N) {
|
|
657
|
+
return N.contains(p.target);
|
|
658
|
+
}), E = g.length > 0 ? c(p, g[0]) : !i.current.noIsolation;
|
|
659
|
+
E && p.cancelable && p.preventDefault();
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
}, []), b = v.useCallback(function(d, p, _, h) {
|
|
663
|
+
var g = { name: d, delta: p, target: _, should: h };
|
|
664
|
+
t.current.push(g), setTimeout(function() {
|
|
665
|
+
t.current = t.current.filter(function(E) {
|
|
666
|
+
return E !== g;
|
|
667
|
+
});
|
|
668
|
+
}, 1);
|
|
669
|
+
}, []), m = v.useCallback(function(d) {
|
|
670
|
+
n.current = de(d), o.current = void 0;
|
|
671
|
+
}, []), f = v.useCallback(function(d) {
|
|
672
|
+
b(d.type, at(d), d.target, c(d, e.lockRef.current));
|
|
673
|
+
}, []), $ = v.useCallback(function(d) {
|
|
674
|
+
b(d.type, de(d), d.target, c(d, e.lockRef.current));
|
|
675
|
+
}, []);
|
|
676
|
+
v.useEffect(function() {
|
|
677
|
+
return X.push(a), e.setCallbacks({
|
|
678
|
+
onScrollCapture: f,
|
|
679
|
+
onWheelCapture: f,
|
|
680
|
+
onTouchMoveCapture: $
|
|
681
|
+
}), document.addEventListener("wheel", u, K), document.addEventListener("touchmove", u, K), document.addEventListener("touchstart", m, K), function() {
|
|
682
|
+
X = X.filter(function(d) {
|
|
683
|
+
return d !== a;
|
|
684
|
+
}), document.removeEventListener("wheel", u, K), document.removeEventListener("touchmove", u, K), document.removeEventListener("touchstart", m, K);
|
|
685
|
+
};
|
|
686
|
+
}, []);
|
|
687
|
+
var C = e.removeScrollBar, R = e.inert;
|
|
688
|
+
return v.createElement(
|
|
689
|
+
v.Fragment,
|
|
690
|
+
null,
|
|
691
|
+
R ? v.createElement(a, { styles: yo(r) }) : null,
|
|
692
|
+
C ? v.createElement(fo, { gapMode: "margin" }) : null
|
|
693
|
+
);
|
|
694
|
+
}
|
|
695
|
+
const xo = Qn($t, wo);
|
|
696
|
+
var wt = v.forwardRef(function(e, t) {
|
|
697
|
+
return v.createElement(ve, O({}, e, { ref: t, sideCar: xo }));
|
|
698
|
+
});
|
|
699
|
+
wt.classNames = ve.classNames;
|
|
700
|
+
const Eo = wt;
|
|
701
|
+
var Ro = function(e) {
|
|
702
|
+
if (typeof document > "u")
|
|
703
|
+
return null;
|
|
704
|
+
var t = Array.isArray(e) ? e[0] : e;
|
|
705
|
+
return t.ownerDocument.body;
|
|
706
|
+
}, Y = /* @__PURE__ */ new WeakMap(), le = /* @__PURE__ */ new WeakMap(), ue = {}, Ae = 0, xt = function(e) {
|
|
707
|
+
return e && (e.host || xt(e.parentNode));
|
|
708
|
+
}, No = function(e, t) {
|
|
709
|
+
return t.map(function(n) {
|
|
710
|
+
if (e.contains(n))
|
|
711
|
+
return n;
|
|
712
|
+
var o = xt(n);
|
|
713
|
+
return o && e.contains(o) ? o : (console.error("aria-hidden", n, "in not contained inside", e, ". Doing nothing"), null);
|
|
714
|
+
}).filter(function(n) {
|
|
715
|
+
return !!n;
|
|
716
|
+
});
|
|
717
|
+
}, Ao = function(e, t, n, o) {
|
|
718
|
+
var r = No(t, Array.isArray(e) ? e : [e]);
|
|
719
|
+
ue[n] || (ue[n] = /* @__PURE__ */ new WeakMap());
|
|
720
|
+
var a = ue[n], i = [], c = /* @__PURE__ */ new Set(), u = new Set(r), b = function(f) {
|
|
721
|
+
!f || c.has(f) || (c.add(f), b(f.parentNode));
|
|
722
|
+
};
|
|
723
|
+
r.forEach(b);
|
|
724
|
+
var m = function(f) {
|
|
725
|
+
!f || u.has(f) || Array.prototype.forEach.call(f.children, function($) {
|
|
726
|
+
if (c.has($))
|
|
727
|
+
m($);
|
|
728
|
+
else
|
|
729
|
+
try {
|
|
730
|
+
var C = $.getAttribute(o), R = C !== null && C !== "false", d = (Y.get($) || 0) + 1, p = (a.get($) || 0) + 1;
|
|
731
|
+
Y.set($, d), a.set($, p), i.push($), d === 1 && R && le.set($, !0), p === 1 && $.setAttribute(n, "true"), R || $.setAttribute(o, "true");
|
|
732
|
+
} catch (_) {
|
|
733
|
+
console.error("aria-hidden: cannot operate on ", $, _);
|
|
734
|
+
}
|
|
735
|
+
});
|
|
736
|
+
};
|
|
737
|
+
return m(t), c.clear(), Ae++, function() {
|
|
738
|
+
i.forEach(function(f) {
|
|
739
|
+
var $ = Y.get(f) - 1, C = a.get(f) - 1;
|
|
740
|
+
Y.set(f, $), a.set(f, C), $ || (le.has(f) || f.removeAttribute(o), le.delete(f)), C || f.removeAttribute(n);
|
|
741
|
+
}), Ae--, Ae || (Y = /* @__PURE__ */ new WeakMap(), Y = /* @__PURE__ */ new WeakMap(), le = /* @__PURE__ */ new WeakMap(), ue = {});
|
|
742
|
+
};
|
|
743
|
+
}, So = function(e, t, n) {
|
|
744
|
+
n === void 0 && (n = "data-aria-hidden");
|
|
745
|
+
var o = Array.from(Array.isArray(e) ? e : [e]), r = t || Ro(e);
|
|
746
|
+
return r ? (o.push.apply(o, Array.from(r.querySelectorAll("[aria-live]"))), Ao(o, r, n, "aria-hidden")) : function() {
|
|
747
|
+
return null;
|
|
748
|
+
};
|
|
749
|
+
};
|
|
750
|
+
const Et = "Dialog", [Rt, Ca] = pe(Et), [Io, P] = Rt(Et), ko = (e) => {
|
|
751
|
+
const { __scopeDialog: t, children: n, open: o, defaultOpen: r, onOpenChange: a, modal: i = !0 } = e, c = k(null), u = k(null), [b = !1, m] = ee({
|
|
752
|
+
prop: o,
|
|
753
|
+
defaultProp: r,
|
|
754
|
+
onChange: a
|
|
755
|
+
});
|
|
756
|
+
return /* @__PURE__ */ y(Io, {
|
|
757
|
+
scope: t,
|
|
758
|
+
triggerRef: c,
|
|
759
|
+
contentRef: u,
|
|
760
|
+
contentId: ne(),
|
|
761
|
+
titleId: ne(),
|
|
762
|
+
descriptionId: ne(),
|
|
763
|
+
open: b,
|
|
764
|
+
onOpenChange: m,
|
|
765
|
+
onOpenToggle: De(
|
|
766
|
+
() => m(
|
|
767
|
+
(f) => !f
|
|
768
|
+
),
|
|
769
|
+
[
|
|
770
|
+
m
|
|
771
|
+
]
|
|
772
|
+
),
|
|
773
|
+
modal: i
|
|
774
|
+
}, n);
|
|
775
|
+
}, To = "DialogTrigger", Po = /* @__PURE__ */ S((e, t) => {
|
|
776
|
+
const { __scopeDialog: n, ...o } = e, r = P(To, n), a = q(t, r.triggerRef);
|
|
777
|
+
return /* @__PURE__ */ y(T.button, x({
|
|
778
|
+
type: "button",
|
|
779
|
+
"aria-haspopup": "dialog",
|
|
780
|
+
"aria-expanded": r.open,
|
|
781
|
+
"aria-controls": r.contentId,
|
|
782
|
+
"data-state": Be(r.open)
|
|
783
|
+
}, o, {
|
|
784
|
+
ref: a,
|
|
785
|
+
onClick: z(e.onClick, r.onOpenToggle)
|
|
786
|
+
}));
|
|
787
|
+
}), Nt = "DialogPortal", [Oo, At] = Rt(Nt, {
|
|
788
|
+
forceMount: void 0
|
|
789
|
+
}), Do = (e) => {
|
|
790
|
+
const { __scopeDialog: t, forceMount: n, children: o, container: r } = e, a = P(Nt, t);
|
|
791
|
+
return /* @__PURE__ */ y(Oo, {
|
|
792
|
+
scope: t,
|
|
793
|
+
forceMount: n
|
|
794
|
+
}, yn.map(
|
|
795
|
+
o,
|
|
796
|
+
(i) => /* @__PURE__ */ y(_e, {
|
|
797
|
+
present: n || a.open
|
|
798
|
+
}, /* @__PURE__ */ y(zn, {
|
|
799
|
+
asChild: !0,
|
|
800
|
+
container: r
|
|
801
|
+
}, i))
|
|
802
|
+
));
|
|
803
|
+
}, ke = "DialogOverlay", Mo = /* @__PURE__ */ S((e, t) => {
|
|
804
|
+
const n = At(ke, e.__scopeDialog), { forceMount: o = n.forceMount, ...r } = e, a = P(ke, e.__scopeDialog);
|
|
805
|
+
return a.modal ? /* @__PURE__ */ y(_e, {
|
|
806
|
+
present: o || a.open
|
|
807
|
+
}, /* @__PURE__ */ y(Fo, x({}, r, {
|
|
808
|
+
ref: t
|
|
809
|
+
}))) : null;
|
|
810
|
+
}), Fo = /* @__PURE__ */ S((e, t) => {
|
|
811
|
+
const { __scopeDialog: n, ...o } = e, r = P(ke, n);
|
|
812
|
+
return (
|
|
813
|
+
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
814
|
+
// ie. when `Overlay` and `Content` are siblings
|
|
815
|
+
/* @__PURE__ */ y(Eo, {
|
|
816
|
+
as: Me,
|
|
817
|
+
allowPinchZoom: !0,
|
|
818
|
+
shards: [
|
|
819
|
+
r.contentRef
|
|
820
|
+
]
|
|
821
|
+
}, /* @__PURE__ */ y(T.div, x({
|
|
822
|
+
"data-state": Be(r.open)
|
|
823
|
+
}, o, {
|
|
824
|
+
ref: t,
|
|
825
|
+
style: {
|
|
826
|
+
pointerEvents: "auto",
|
|
827
|
+
...o.style
|
|
828
|
+
}
|
|
829
|
+
})))
|
|
830
|
+
);
|
|
831
|
+
}), oe = "DialogContent", Lo = /* @__PURE__ */ S((e, t) => {
|
|
832
|
+
const n = At(oe, e.__scopeDialog), { forceMount: o = n.forceMount, ...r } = e, a = P(oe, e.__scopeDialog);
|
|
833
|
+
return /* @__PURE__ */ y(_e, {
|
|
834
|
+
present: o || a.open
|
|
835
|
+
}, a.modal ? /* @__PURE__ */ y(Bo, x({}, r, {
|
|
836
|
+
ref: t
|
|
837
|
+
})) : /* @__PURE__ */ y(Ho, x({}, r, {
|
|
838
|
+
ref: t
|
|
839
|
+
})));
|
|
840
|
+
}), Bo = /* @__PURE__ */ S((e, t) => {
|
|
841
|
+
const n = P(oe, e.__scopeDialog), o = k(null), r = q(t, n.contentRef, o);
|
|
842
|
+
return V(() => {
|
|
843
|
+
const a = o.current;
|
|
844
|
+
if (a)
|
|
845
|
+
return So(a);
|
|
846
|
+
}, []), /* @__PURE__ */ y(St, x({}, e, {
|
|
847
|
+
ref: r,
|
|
848
|
+
trapFocus: n.open,
|
|
849
|
+
disableOutsidePointerEvents: !0,
|
|
850
|
+
onCloseAutoFocus: z(e.onCloseAutoFocus, (a) => {
|
|
851
|
+
var i;
|
|
852
|
+
a.preventDefault(), (i = n.triggerRef.current) === null || i === void 0 || i.focus();
|
|
853
|
+
}),
|
|
854
|
+
onPointerDownOutside: z(e.onPointerDownOutside, (a) => {
|
|
855
|
+
const i = a.detail.originalEvent, c = i.button === 0 && i.ctrlKey === !0;
|
|
856
|
+
(i.button === 2 || c) && a.preventDefault();
|
|
857
|
+
}),
|
|
858
|
+
onFocusOutside: z(
|
|
859
|
+
e.onFocusOutside,
|
|
860
|
+
(a) => a.preventDefault()
|
|
861
|
+
)
|
|
862
|
+
}));
|
|
863
|
+
}), Ho = /* @__PURE__ */ S((e, t) => {
|
|
864
|
+
const n = P(oe, e.__scopeDialog), o = k(!1), r = k(!1);
|
|
865
|
+
return /* @__PURE__ */ y(St, x({}, e, {
|
|
866
|
+
ref: t,
|
|
867
|
+
trapFocus: !1,
|
|
868
|
+
disableOutsidePointerEvents: !1,
|
|
869
|
+
onCloseAutoFocus: (a) => {
|
|
870
|
+
var i;
|
|
871
|
+
if ((i = e.onCloseAutoFocus) === null || i === void 0 || i.call(e, a), !a.defaultPrevented) {
|
|
872
|
+
var c;
|
|
873
|
+
o.current || (c = n.triggerRef.current) === null || c === void 0 || c.focus(), a.preventDefault();
|
|
874
|
+
}
|
|
875
|
+
o.current = !1, r.current = !1;
|
|
876
|
+
},
|
|
877
|
+
onInteractOutside: (a) => {
|
|
878
|
+
var i, c;
|
|
879
|
+
(i = e.onInteractOutside) === null || i === void 0 || i.call(e, a), a.defaultPrevented || (o.current = !0, a.detail.originalEvent.type === "pointerdown" && (r.current = !0));
|
|
880
|
+
const u = a.target;
|
|
881
|
+
((c = n.triggerRef.current) === null || c === void 0 ? void 0 : c.contains(u)) && a.preventDefault(), a.detail.originalEvent.type === "focusin" && r.current && a.preventDefault();
|
|
882
|
+
}
|
|
883
|
+
}));
|
|
884
|
+
}), St = /* @__PURE__ */ S((e, t) => {
|
|
885
|
+
const { __scopeDialog: n, trapFocus: o, onOpenAutoFocus: r, onCloseAutoFocus: a, ...i } = e, c = P(oe, n), u = k(null), b = q(t, u);
|
|
886
|
+
return Vn(), /* @__PURE__ */ y(hn, null, /* @__PURE__ */ y(On, {
|
|
887
|
+
asChild: !0,
|
|
888
|
+
loop: !0,
|
|
889
|
+
trapped: o,
|
|
890
|
+
onMountAutoFocus: r,
|
|
891
|
+
onUnmountAutoFocus: a
|
|
892
|
+
}, /* @__PURE__ */ y(Rn, x({
|
|
893
|
+
role: "dialog",
|
|
894
|
+
id: c.contentId,
|
|
895
|
+
"aria-describedby": c.descriptionId,
|
|
896
|
+
"aria-labelledby": c.titleId,
|
|
897
|
+
"data-state": Be(c.open)
|
|
898
|
+
}, i, {
|
|
899
|
+
ref: b,
|
|
900
|
+
onDismiss: () => c.onOpenChange(!1)
|
|
901
|
+
}))), !1);
|
|
902
|
+
}), zo = "DialogTitle", Vo = /* @__PURE__ */ S((e, t) => {
|
|
903
|
+
const { __scopeDialog: n, ...o } = e, r = P(zo, n);
|
|
904
|
+
return /* @__PURE__ */ y(T.h2, x({
|
|
905
|
+
id: r.titleId
|
|
906
|
+
}, o, {
|
|
907
|
+
ref: t
|
|
908
|
+
}));
|
|
909
|
+
}), Wo = "DialogDescription", jo = /* @__PURE__ */ S((e, t) => {
|
|
910
|
+
const { __scopeDialog: n, ...o } = e, r = P(Wo, n);
|
|
911
|
+
return /* @__PURE__ */ y(T.p, x({
|
|
912
|
+
id: r.descriptionId
|
|
913
|
+
}, o, {
|
|
914
|
+
ref: t
|
|
915
|
+
}));
|
|
916
|
+
}), qo = "DialogClose", Uo = /* @__PURE__ */ S((e, t) => {
|
|
917
|
+
const { __scopeDialog: n, ...o } = e, r = P(qo, n);
|
|
918
|
+
return /* @__PURE__ */ y(T.button, x({
|
|
919
|
+
type: "button"
|
|
920
|
+
}, o, {
|
|
921
|
+
ref: t,
|
|
922
|
+
onClick: z(
|
|
923
|
+
e.onClick,
|
|
924
|
+
() => r.onOpenChange(!1)
|
|
925
|
+
)
|
|
926
|
+
}));
|
|
927
|
+
});
|
|
928
|
+
function Be(e) {
|
|
929
|
+
return e ? "open" : "closed";
|
|
930
|
+
}
|
|
931
|
+
const Go = ko, Ko = Po, Xo = Do, Yo = Mo, Zo = Lo, Qo = Vo, Jo = jo, er = Uo, D = {
|
|
932
|
+
"teddy-modal__overlay": "_teddy-modal__overlay_vfo5b_17",
|
|
933
|
+
"teddy-modal__content": "_teddy-modal__content_vfo5b_29",
|
|
934
|
+
"teddy-modal__scroll": "_teddy-modal__scroll_vfo5b_47",
|
|
935
|
+
"teddy-modal__image": "_teddy-modal__image_vfo5b_51",
|
|
936
|
+
"teddy-modal__close--floating": "_teddy-modal__close--floating_vfo5b_61",
|
|
937
|
+
"teddy-modal__group": "_teddy-modal__group_vfo5b_66",
|
|
938
|
+
"teddy-modal__group--title": "_teddy-modal__group--title_vfo5b_70",
|
|
939
|
+
"teddy-modal__group--scroll": "_teddy-modal__group--scroll_vfo5b_76",
|
|
940
|
+
"teddy-modal__group--action": "_teddy-modal__group--action_vfo5b_85",
|
|
941
|
+
"modal-overlay-no-op": "_modal-overlay-no-op_vfo5b_1",
|
|
942
|
+
"teddy-fade-in": "_teddy-fade-in_vfo5b_1",
|
|
943
|
+
"teddy-fade-out": "_teddy-fade-out_vfo5b_1",
|
|
944
|
+
"modal-content-show": "_modal-content-show_vfo5b_1",
|
|
945
|
+
"modal-content-hide": "_modal-content-hide_vfo5b_1"
|
|
946
|
+
}, M = "teddy-modal", ae = s.createContext({
|
|
947
|
+
imageRef: null,
|
|
948
|
+
actionGroupRef: null,
|
|
949
|
+
scrollRef: null
|
|
950
|
+
}), It = (e) => {
|
|
951
|
+
const t = s.useRef(null), n = s.useRef(null), o = s.useRef(null);
|
|
952
|
+
return /* @__PURE__ */ l(ae.Provider, { value: { imageRef: t, actionGroupRef: n, scrollRef: o }, children: /* @__PURE__ */ l(Go, { ...e, modal: !0 }) });
|
|
953
|
+
};
|
|
954
|
+
It.displayName = "Dialog.Root";
|
|
955
|
+
const kt = s.forwardRef(
|
|
956
|
+
({ children: e, ...t }, n) => /* @__PURE__ */ l(Ko, { ...t, ref: n, asChild: !0, children: e })
|
|
957
|
+
);
|
|
958
|
+
kt.displayName = "Dialog.Trigger";
|
|
959
|
+
const Tt = s.createContext(!1), He = s.forwardRef(
|
|
960
|
+
({ className: e, forceMount: t, container: n, ...o }, r) => {
|
|
961
|
+
const a = w([D[`${M}__overlay`]], e);
|
|
962
|
+
return /* @__PURE__ */ l(Tt.Provider, { value: !0, children: /* @__PURE__ */ l(Xo, { container: n, forceMount: t, children: /* @__PURE__ */ l(Yo, { className: a, ref: r, ...o }) }) });
|
|
963
|
+
}
|
|
964
|
+
);
|
|
965
|
+
He.displayName = "Dialog.Content";
|
|
966
|
+
const it = s.forwardRef(
|
|
967
|
+
function({ asChild: t, children: n, className: o, ...r }, a) {
|
|
968
|
+
const i = w([D[`${M}__scroll`]], o), c = s.useContext(ae);
|
|
969
|
+
return /* @__PURE__ */ l(
|
|
970
|
+
Zo,
|
|
971
|
+
{
|
|
972
|
+
...r,
|
|
973
|
+
ref: a,
|
|
974
|
+
className: w([D[`${M}__content`]]),
|
|
975
|
+
asChild: !0,
|
|
976
|
+
children: /* @__PURE__ */ l(Se, { children: /* @__PURE__ */ l(
|
|
977
|
+
Se,
|
|
978
|
+
{
|
|
979
|
+
...t ? { as: void 0, asChild: t } : {},
|
|
980
|
+
direction: "column",
|
|
981
|
+
align: "start",
|
|
982
|
+
maxWidth: { md: "600px" },
|
|
983
|
+
className: i,
|
|
984
|
+
ref: c.scrollRef,
|
|
985
|
+
children: n
|
|
986
|
+
}
|
|
987
|
+
) })
|
|
988
|
+
}
|
|
989
|
+
);
|
|
990
|
+
}
|
|
991
|
+
), Pt = s.forwardRef(
|
|
992
|
+
({ forceMount: e, ...t }, n) => s.useContext(Tt) ? /* @__PURE__ */ l(it, { ref: n, ...t }) : /* @__PURE__ */ l(He, { forceMount: e, children: /* @__PURE__ */ l(it, { ref: n, ...t }) })
|
|
993
|
+
);
|
|
994
|
+
Pt.displayName = "Dialog.Content";
|
|
995
|
+
const Ot = s.createContext(!1), ze = s.forwardRef(
|
|
996
|
+
({ className: e, variant: t, ...n }, o) => {
|
|
997
|
+
const r = s.useContext(ae).scrollRef, [a, i] = s.useState(!1);
|
|
998
|
+
V(() => {
|
|
999
|
+
if (r != null && r.current) {
|
|
1000
|
+
const u = r.current.scrollHeight > r.current.clientHeight;
|
|
1001
|
+
i(u);
|
|
1002
|
+
}
|
|
1003
|
+
}, [r]);
|
|
1004
|
+
const c = w(
|
|
1005
|
+
[D[`${M}__group`]],
|
|
1006
|
+
{
|
|
1007
|
+
[D[`${M}__group--action`]]: t === "action",
|
|
1008
|
+
[D[`${M}__group--title`]]: t === "title",
|
|
1009
|
+
[D[`${M}__group--scroll`]]: a
|
|
1010
|
+
},
|
|
1011
|
+
e
|
|
1012
|
+
);
|
|
1013
|
+
return /* @__PURE__ */ l(Ot.Provider, { value: !0, children: /* @__PURE__ */ l(
|
|
1014
|
+
Se,
|
|
1015
|
+
{
|
|
1016
|
+
...t === "action" ? {
|
|
1017
|
+
gap: "200",
|
|
1018
|
+
justify: { md: "end" },
|
|
1019
|
+
align: { sm: "stretch", md: "end" },
|
|
1020
|
+
direction: { sm: "column-reverse", md: "row" }
|
|
1021
|
+
} : { direction: "column" },
|
|
1022
|
+
ref: o,
|
|
1023
|
+
...n,
|
|
1024
|
+
className: c
|
|
1025
|
+
}
|
|
1026
|
+
) });
|
|
1027
|
+
}
|
|
1028
|
+
);
|
|
1029
|
+
ze.displayName = "Dialog.Group";
|
|
1030
|
+
const st = s.forwardRef(
|
|
1031
|
+
function(t, n) {
|
|
1032
|
+
return /* @__PURE__ */ l(Qo, { asChild: !0, children: /* @__PURE__ */ l(re, { variant: "title-200", as: "h2", ...t, asChild: !1, ref: n }) });
|
|
1033
|
+
}
|
|
1034
|
+
), Dt = s.forwardRef((e, t) => s.useContext(Ot) ? /* @__PURE__ */ l(st, { ...e, ref: t }) : /* @__PURE__ */ l(ze, { variant: "title", children: /* @__PURE__ */ l(st, { ...e, ref: t }) }));
|
|
1035
|
+
Dt.displayName = "Dialog.Title";
|
|
1036
|
+
const Mt = s.forwardRef((e, t) => /* @__PURE__ */ l(Jo, { asChild: !0, children: /* @__PURE__ */ l(mt, { as: "p", variant: "paragraph-100", ...e, asChild: !1, ref: t }) }));
|
|
1037
|
+
Mt.displayName = "Dialog.Description";
|
|
1038
|
+
const Ft = s.forwardRef(({ asChild: e, ...t }, n) => {
|
|
1039
|
+
const o = w([D[`${M}__image`]], t.className), r = s.useContext(ae);
|
|
1040
|
+
return /* @__PURE__ */ l(e ? Me : "img", { ...t, className: o, ref: Le(r.imageRef, n) });
|
|
1041
|
+
});
|
|
1042
|
+
Ft.displayName = "Dialog.Image";
|
|
1043
|
+
const Lt = s.forwardRef(
|
|
1044
|
+
({ className: e, ...t }, n) => {
|
|
1045
|
+
const o = w([D[`${M}__close`]], {
|
|
1046
|
+
[D[`${M}__close--floating`]]: t.slot === "floating",
|
|
1047
|
+
className: e
|
|
1048
|
+
}), r = s.useContext(ae).imageRef, [a, i] = s.useState(!1);
|
|
1049
|
+
return V(() => {
|
|
1050
|
+
r != null && r.current && i(!0);
|
|
1051
|
+
}, [r]), /* @__PURE__ */ l(er, { ...t, className: o, ref: n, asChild: !0, children: t.children || /* @__PURE__ */ l(Fe, { variant: a ? "primary-negative" : "tertiary-purple", iconOnly: !0, "aria-label": t["aria-label"], children: /* @__PURE__ */ l(te, { name: "close" }) }) });
|
|
1052
|
+
}
|
|
1053
|
+
);
|
|
1054
|
+
Lt.displayName = "Dialog.Close";
|
|
1055
|
+
const wa = Object.assign(It, { Trigger: kt, Content: Pt, Title: Dt, Overlay: He, Description: Mt, Close: Lt, Image: Ft, Group: ze }), Q = {
|
|
1056
|
+
"teddy-notification": "_teddy-notification_q80ka_3",
|
|
1057
|
+
"teddy-notification__dismiss": "_teddy-notification__dismiss_q80ka_14",
|
|
1058
|
+
"teddy-notification--success": "_teddy-notification--success_q80ka_18",
|
|
1059
|
+
"teddy-notification--warning": "_teddy-notification--warning_q80ka_23",
|
|
1060
|
+
"teddy-notification--error": "_teddy-notification--error_q80ka_28",
|
|
1061
|
+
"teddy-notification--information": "_teddy-notification--information_q80ka_33",
|
|
1062
|
+
"teddy-notification__heading": "_teddy-notification__heading_q80ka_38",
|
|
1063
|
+
"teddy-notification__icon": "_teddy-notification__icon_q80ka_43"
|
|
1064
|
+
}, Bt = "Collapsible", [tr, Ht] = pe(Bt), [nr, Ve] = tr(Bt), or = /* @__PURE__ */ S((e, t) => {
|
|
1065
|
+
const { __scopeCollapsible: n, open: o, defaultOpen: r, disabled: a, onOpenChange: i, ...c } = e, [u = !1, b] = ee({
|
|
1066
|
+
prop: o,
|
|
1067
|
+
defaultProp: r,
|
|
1068
|
+
onChange: i
|
|
1069
|
+
});
|
|
1070
|
+
return /* @__PURE__ */ y(nr, {
|
|
1071
|
+
scope: n,
|
|
1072
|
+
disabled: a,
|
|
1073
|
+
contentId: ne(),
|
|
1074
|
+
open: u,
|
|
1075
|
+
onOpenToggle: De(
|
|
1076
|
+
() => b(
|
|
1077
|
+
(m) => !m
|
|
1078
|
+
),
|
|
1079
|
+
[
|
|
1080
|
+
b
|
|
1081
|
+
]
|
|
1082
|
+
)
|
|
1083
|
+
}, /* @__PURE__ */ y(T.div, x({
|
|
1084
|
+
"data-state": We(u),
|
|
1085
|
+
"data-disabled": a ? "" : void 0
|
|
1086
|
+
}, c, {
|
|
1087
|
+
ref: t
|
|
1088
|
+
})));
|
|
1089
|
+
}), rr = "CollapsibleTrigger", ar = /* @__PURE__ */ S((e, t) => {
|
|
1090
|
+
const { __scopeCollapsible: n, ...o } = e, r = Ve(rr, n);
|
|
1091
|
+
return /* @__PURE__ */ y(T.button, x({
|
|
1092
|
+
type: "button",
|
|
1093
|
+
"aria-controls": r.contentId,
|
|
1094
|
+
"aria-expanded": r.open || !1,
|
|
1095
|
+
"data-state": We(r.open),
|
|
1096
|
+
"data-disabled": r.disabled ? "" : void 0,
|
|
1097
|
+
disabled: r.disabled
|
|
1098
|
+
}, o, {
|
|
1099
|
+
ref: t,
|
|
1100
|
+
onClick: z(e.onClick, r.onOpenToggle)
|
|
1101
|
+
}));
|
|
1102
|
+
}), zt = "CollapsibleContent", cr = /* @__PURE__ */ S((e, t) => {
|
|
1103
|
+
const { forceMount: n, ...o } = e, r = Ve(zt, e.__scopeCollapsible);
|
|
1104
|
+
return /* @__PURE__ */ y(
|
|
1105
|
+
_e,
|
|
1106
|
+
{
|
|
1107
|
+
present: n || r.open
|
|
1108
|
+
},
|
|
1109
|
+
({ present: a }) => /* @__PURE__ */ y(ir, x({}, o, {
|
|
1110
|
+
ref: t,
|
|
1111
|
+
present: a
|
|
1112
|
+
}))
|
|
1113
|
+
);
|
|
1114
|
+
}), ir = /* @__PURE__ */ S((e, t) => {
|
|
1115
|
+
const { __scopeCollapsible: n, present: o, children: r, ...a } = e, i = Ve(zt, n), [c, u] = me(o), b = k(null), m = q(t, b), f = k(0), $ = f.current, C = k(0), R = C.current, d = i.open || c, p = k(d), _ = k();
|
|
1116
|
+
return V(() => {
|
|
1117
|
+
const h = requestAnimationFrame(
|
|
1118
|
+
() => p.current = !1
|
|
1119
|
+
);
|
|
1120
|
+
return () => cancelAnimationFrame(h);
|
|
1121
|
+
}, []), Cn(() => {
|
|
1122
|
+
const h = b.current;
|
|
1123
|
+
if (h) {
|
|
1124
|
+
_.current = _.current || {
|
|
1125
|
+
transitionDuration: h.style.transitionDuration,
|
|
1126
|
+
animationName: h.style.animationName
|
|
1127
|
+
}, h.style.transitionDuration = "0s", h.style.animationName = "none";
|
|
1128
|
+
const g = h.getBoundingClientRect();
|
|
1129
|
+
f.current = g.height, C.current = g.width, p.current || (h.style.transitionDuration = _.current.transitionDuration, h.style.animationName = _.current.animationName), u(o);
|
|
1130
|
+
}
|
|
1131
|
+
}, [
|
|
1132
|
+
i.open,
|
|
1133
|
+
o
|
|
1134
|
+
]), /* @__PURE__ */ y(T.div, x({
|
|
1135
|
+
"data-state": We(i.open),
|
|
1136
|
+
"data-disabled": i.disabled ? "" : void 0,
|
|
1137
|
+
id: i.contentId,
|
|
1138
|
+
hidden: !d
|
|
1139
|
+
}, a, {
|
|
1140
|
+
ref: m,
|
|
1141
|
+
style: {
|
|
1142
|
+
"--radix-collapsible-content-height": $ ? `${$}px` : void 0,
|
|
1143
|
+
"--radix-collapsible-content-width": R ? `${R}px` : void 0,
|
|
1144
|
+
...e.style
|
|
1145
|
+
}
|
|
1146
|
+
}), d && r);
|
|
1147
|
+
});
|
|
1148
|
+
function We(e) {
|
|
1149
|
+
return e ? "open" : "closed";
|
|
1150
|
+
}
|
|
1151
|
+
const Vt = or, Wt = ar, jt = cr, J = "teddy-notification", qt = s.createContext(void 0), Ut = s.forwardRef(
|
|
1152
|
+
({ className: e, open: t, defaultOpen: n, onOpenChange: o, variant: r, ...a }, i) => {
|
|
1153
|
+
const c = w([Q[`${J}`]], Q[`${J}--${r}`], e), [u = !0, b] = ee({
|
|
1154
|
+
prop: t,
|
|
1155
|
+
defaultProp: n,
|
|
1156
|
+
onChange: o
|
|
1157
|
+
});
|
|
1158
|
+
return /* @__PURE__ */ l(qt.Provider, { value: { variant: r }, children: /* @__PURE__ */ l(Vt, { open: u, onOpenChange: b, asChild: !0, children: /* @__PURE__ */ l(jt, { asChild: !0, children: /* @__PURE__ */ l(br, { variant: "white", bordered: !0, ...a, ref: i, className: c }) }) }) });
|
|
1159
|
+
}
|
|
1160
|
+
);
|
|
1161
|
+
Ut.displayName = "Notification";
|
|
1162
|
+
function sr(e) {
|
|
1163
|
+
switch (e) {
|
|
1164
|
+
case "success":
|
|
1165
|
+
return "check-circle-filled";
|
|
1166
|
+
case "error":
|
|
1167
|
+
return "error-filled";
|
|
1168
|
+
case "warning":
|
|
1169
|
+
return "alert-filled";
|
|
1170
|
+
case "information":
|
|
1171
|
+
return "info-filled";
|
|
1172
|
+
}
|
|
1173
|
+
}
|
|
1174
|
+
const Gt = s.forwardRef(
|
|
1175
|
+
({ className: e, ...t }, n) => {
|
|
1176
|
+
const o = w([Q[`${J}__icon`]], e), r = s.useContext(qt), a = t.name || sr(r == null ? void 0 : r.variant);
|
|
1177
|
+
return a ? /* @__PURE__ */ l(te, { size: "md", ...t, name: a, ref: n, className: o }) : null;
|
|
1178
|
+
}
|
|
1179
|
+
);
|
|
1180
|
+
Gt.displayName = "Notification.Icon";
|
|
1181
|
+
const Kt = s.forwardRef(
|
|
1182
|
+
({ className: e, ...t }, n) => {
|
|
1183
|
+
const o = w([Q[`${J}__heading`]], e);
|
|
1184
|
+
return /* @__PURE__ */ l(re, { ...t, variant: "subsection-100", asChild: !1, ref: n, className: o });
|
|
1185
|
+
}
|
|
1186
|
+
);
|
|
1187
|
+
Kt.displayName = "Notification.Heading";
|
|
1188
|
+
const Xt = s.forwardRef(
|
|
1189
|
+
({ className: e, ...t }, n) => {
|
|
1190
|
+
const o = w([Q[`${J}__text`]], e);
|
|
1191
|
+
return /* @__PURE__ */ l(mt, { ...t, ref: n, className: o });
|
|
1192
|
+
}
|
|
1193
|
+
);
|
|
1194
|
+
Xt.displayName = "Notification.Text";
|
|
1195
|
+
const Yt = s.forwardRef(
|
|
1196
|
+
({ className: e, children: t, ...n }, o) => {
|
|
1197
|
+
const r = w([Q[`${J}__dismiss`]], e);
|
|
1198
|
+
return /* @__PURE__ */ l(Wt, { asChild: !0, children: /* @__PURE__ */ l(
|
|
1199
|
+
Fe,
|
|
1200
|
+
{
|
|
1201
|
+
iconOnly: !0,
|
|
1202
|
+
"aria-label": "Lukk",
|
|
1203
|
+
variant: "tertiary-purple",
|
|
1204
|
+
...n,
|
|
1205
|
+
ref: o,
|
|
1206
|
+
className: r,
|
|
1207
|
+
children: t || /* @__PURE__ */ l(te, { name: "close" })
|
|
1208
|
+
}
|
|
1209
|
+
) });
|
|
1210
|
+
}
|
|
1211
|
+
);
|
|
1212
|
+
Yt.displayName = "Notification.Dismiss";
|
|
1213
|
+
const xa = Object.assign(Ut, {
|
|
1214
|
+
Text: Xt,
|
|
1215
|
+
Heading: Kt,
|
|
1216
|
+
Icon: Gt,
|
|
1217
|
+
Dismiss: Yt
|
|
1218
|
+
}), A = {
|
|
1219
|
+
"teddy-card": "_teddy-card_z2nmw_3",
|
|
1220
|
+
"teddy-card__slot": "_teddy-card__slot_z2nmw_15",
|
|
1221
|
+
"teddy-card__slot--bottom": "_teddy-card__slot--bottom_z2nmw_18",
|
|
1222
|
+
"teddy-card__slot--center": "_teddy-card__slot--center_z2nmw_21",
|
|
1223
|
+
"teddy-card__action": "_teddy-card__action_z2nmw_42",
|
|
1224
|
+
"teddy-card__action--disabled": "_teddy-card__action--disabled_z2nmw_42",
|
|
1225
|
+
"teddy-card--border": "_teddy-card--border_z2nmw_63",
|
|
1226
|
+
"teddy-card--purple-light": "_teddy-card--purple-light_z2nmw_66",
|
|
1227
|
+
"teddy-card--purple-dark": "_teddy-card--purple-dark_z2nmw_82",
|
|
1228
|
+
"teddy-card--white": "_teddy-card--white_z2nmw_103",
|
|
1229
|
+
"teddy-card--gray": "_teddy-card--gray_z2nmw_119",
|
|
1230
|
+
"teddy-card--beige": "_teddy-card--beige_z2nmw_135",
|
|
1231
|
+
"teddy-card__image--as-background": "_teddy-card__image--as-background_z2nmw_151",
|
|
1232
|
+
"teddy-card__heading": "_teddy-card__heading_z2nmw_154",
|
|
1233
|
+
"teddy-card--background-image": "_teddy-card--background-image_z2nmw_157",
|
|
1234
|
+
"teddy-card__image": "_teddy-card__image_z2nmw_151",
|
|
1235
|
+
"teddy-card__image--inset-top": "_teddy-card__image--inset-top_z2nmw_172",
|
|
1236
|
+
"teddy-card__image--inset-bottom": "_teddy-card__image--inset-bottom_z2nmw_175",
|
|
1237
|
+
"teddy-card__image--inset-left": "_teddy-card__image--inset-left_z2nmw_178",
|
|
1238
|
+
"teddy-card__image--inset-right": "_teddy-card__image--inset-right_z2nmw_181"
|
|
1239
|
+
}, I = "teddy-card", Te = `${I}__action`, dr = ["purple-light", "purple-dark", "gray", "white", "beige"], je = s.createContext(void 0), Zt = s.forwardRef(
|
|
1240
|
+
({ className: e, children: t, backgroundImageSrc: n, variant: o, bordered: r, ...a }, i) => {
|
|
1241
|
+
const c = s.useRef(null), u = s.useRef(null), b = w(
|
|
1242
|
+
[A[`${I}`]],
|
|
1243
|
+
{
|
|
1244
|
+
[A[`${I}--${o}`]]: o,
|
|
1245
|
+
[A[`${I}--border`]]: r,
|
|
1246
|
+
[A[`${I}--background-image`]]: n
|
|
1247
|
+
},
|
|
1248
|
+
e
|
|
1249
|
+
);
|
|
1250
|
+
return /* @__PURE__ */ l(
|
|
1251
|
+
Tn,
|
|
1252
|
+
{
|
|
1253
|
+
...a,
|
|
1254
|
+
style: n ? { background: `url(${n})`, ...a.style } : a.style,
|
|
1255
|
+
onClick: Pn(a.onClick, (m) => {
|
|
1256
|
+
var f;
|
|
1257
|
+
if (!m.isDefaultPrevented()) {
|
|
1258
|
+
if (u.current)
|
|
1259
|
+
return u.current.click();
|
|
1260
|
+
(f = c.current) == null || f.click();
|
|
1261
|
+
}
|
|
1262
|
+
}),
|
|
1263
|
+
ref: i,
|
|
1264
|
+
className: b,
|
|
1265
|
+
children: /* @__PURE__ */ l(je.Provider, { value: { buttonRef: c, linkRef: u, variant: o }, children: t })
|
|
1266
|
+
}
|
|
1267
|
+
);
|
|
1268
|
+
}
|
|
1269
|
+
);
|
|
1270
|
+
Zt.displayName = "Card";
|
|
1271
|
+
const Qt = s.forwardRef(
|
|
1272
|
+
({ className: e, variant: t = "title-200", as: n = "h2", ...o }, r) => {
|
|
1273
|
+
const a = w([A[`${I}__heading`]], e);
|
|
1274
|
+
return /* @__PURE__ */ l(
|
|
1275
|
+
re,
|
|
1276
|
+
{
|
|
1277
|
+
...o,
|
|
1278
|
+
...o.asChild ? { as: void 0, asChild: !0 } : { as: n, asChild: !1 },
|
|
1279
|
+
variant: t,
|
|
1280
|
+
ref: r,
|
|
1281
|
+
className: a
|
|
1282
|
+
}
|
|
1283
|
+
);
|
|
1284
|
+
}
|
|
1285
|
+
);
|
|
1286
|
+
Qt.displayName = "Card.Heading";
|
|
1287
|
+
const Jt = s.forwardRef(({ className: e, ...t }, n) => {
|
|
1288
|
+
const o = w([A[`${I}__content`]], e);
|
|
1289
|
+
return /* @__PURE__ */ l("div", { ...t, ref: n, className: o });
|
|
1290
|
+
});
|
|
1291
|
+
Jt.displayName = "Card.Content";
|
|
1292
|
+
const lr = s.forwardRef(({ className: e, align: t, ...n }, o) => {
|
|
1293
|
+
const r = w(
|
|
1294
|
+
[
|
|
1295
|
+
A[`${I}__slot`],
|
|
1296
|
+
{
|
|
1297
|
+
[A[`${I}__slot--center`]]: t === "top" || t === "bottom",
|
|
1298
|
+
[A[`${I}__slot--bottom`]]: t == null ? void 0 : t.includes("bottom")
|
|
1299
|
+
}
|
|
1300
|
+
],
|
|
1301
|
+
e
|
|
1302
|
+
);
|
|
1303
|
+
return /* @__PURE__ */ l(
|
|
1304
|
+
Sn,
|
|
1305
|
+
{
|
|
1306
|
+
position: "absolute",
|
|
1307
|
+
top: t != null && t.includes("top") ? "0" : void 0,
|
|
1308
|
+
bottom: t != null && t.includes("bottom") ? "0" : void 0,
|
|
1309
|
+
left: t != null && t.includes("left") ? "200" : t != null && t.includes("right") ? void 0 : "50%",
|
|
1310
|
+
right: t != null && t.includes("right") ? "200" : void 0,
|
|
1311
|
+
...n,
|
|
1312
|
+
ref: o,
|
|
1313
|
+
className: r
|
|
1314
|
+
}
|
|
1315
|
+
);
|
|
1316
|
+
}), ur = [
|
|
1317
|
+
"top",
|
|
1318
|
+
"bottom",
|
|
1319
|
+
"left",
|
|
1320
|
+
"right",
|
|
1321
|
+
"all",
|
|
1322
|
+
"top-right-left",
|
|
1323
|
+
"bottom-left-right",
|
|
1324
|
+
"top-left",
|
|
1325
|
+
"top-right",
|
|
1326
|
+
"bottom-left",
|
|
1327
|
+
"bottom-right",
|
|
1328
|
+
"top-bottom",
|
|
1329
|
+
"left-right"
|
|
1330
|
+
], en = s.forwardRef(({ className: e, ...t }, n) => {
|
|
1331
|
+
var r, a, i, c, u, b, m, f;
|
|
1332
|
+
const o = w(
|
|
1333
|
+
[A[`${I}__image`]],
|
|
1334
|
+
{
|
|
1335
|
+
[A[`${I}__image--inset-top`]]: ((r = t.inset) == null ? void 0 : r.includes("top")) || ((a = t.inset) == null ? void 0 : a.includes("all")),
|
|
1336
|
+
[A[`${I}__image--inset-bottom`]]: ((i = t.inset) == null ? void 0 : i.includes("bottom")) || ((c = t.inset) == null ? void 0 : c.includes("all")),
|
|
1337
|
+
[A[`${I}__image--inset-left`]]: ((u = t.inset) == null ? void 0 : u.includes("left")) || ((b = t.inset) == null ? void 0 : b.includes("all")),
|
|
1338
|
+
[A[`${I}__image--inset-right`]]: ((m = t.inset) == null ? void 0 : m.includes("right")) || ((f = t.inset) == null ? void 0 : f.includes("all"))
|
|
1339
|
+
},
|
|
1340
|
+
e
|
|
1341
|
+
);
|
|
1342
|
+
return /* @__PURE__ */ l("img", { ...t, ref: n, className: o });
|
|
1343
|
+
});
|
|
1344
|
+
en.displayName = "Card.Image";
|
|
1345
|
+
function fr(e) {
|
|
1346
|
+
switch (e) {
|
|
1347
|
+
case "purple-dark":
|
|
1348
|
+
return "primary-negative";
|
|
1349
|
+
default:
|
|
1350
|
+
return "primary";
|
|
1351
|
+
}
|
|
1352
|
+
}
|
|
1353
|
+
const tn = s.forwardRef(
|
|
1354
|
+
({ className: e, iconOnly: t = !1, ...n }, o) => {
|
|
1355
|
+
const r = s.useContext(je), a = w(
|
|
1356
|
+
[A[`${I}__button`]],
|
|
1357
|
+
A[Te],
|
|
1358
|
+
{
|
|
1359
|
+
[A[`${Te}--disabled`]]: n.disabled
|
|
1360
|
+
},
|
|
1361
|
+
e
|
|
1362
|
+
), i = Le(r == null ? void 0 : r.buttonRef, o);
|
|
1363
|
+
return /* @__PURE__ */ l(ft, { children: /* @__PURE__ */ l(
|
|
1364
|
+
Fe,
|
|
1365
|
+
{
|
|
1366
|
+
...!t || !n["aria-label"] ? { iconOnly: !1, "aria-label": void 0 } : { iconOnly: !0, "aria-label": n["aria-label"] },
|
|
1367
|
+
...n,
|
|
1368
|
+
ref: i,
|
|
1369
|
+
variant: fr(r == null ? void 0 : r.variant),
|
|
1370
|
+
className: a
|
|
1371
|
+
}
|
|
1372
|
+
) });
|
|
1373
|
+
}
|
|
1374
|
+
);
|
|
1375
|
+
tn.displayName = "Card.Button";
|
|
1376
|
+
const nn = s.forwardRef(
|
|
1377
|
+
({ className: e, ...t }, n) => {
|
|
1378
|
+
const o = s.useContext(je), r = w([A[`${I}__link`]], A[Te], e), a = Le(o == null ? void 0 : o.linkRef, n);
|
|
1379
|
+
return /* @__PURE__ */ l(In, { ...t, ref: a, className: r });
|
|
1380
|
+
}
|
|
1381
|
+
);
|
|
1382
|
+
nn.displayName = "Card.Link";
|
|
1383
|
+
const br = Object.assign(Zt, {
|
|
1384
|
+
Heading: Qt,
|
|
1385
|
+
Content: Jt,
|
|
1386
|
+
Image: en,
|
|
1387
|
+
Button: tn,
|
|
1388
|
+
Link: nn,
|
|
1389
|
+
Slot: lr,
|
|
1390
|
+
variantOptions: dr,
|
|
1391
|
+
insetOptions: ur
|
|
1392
|
+
}), on = "Switch", [mr, Ea] = pe(on), [pr, _r] = mr(on), vr = /* @__PURE__ */ S((e, t) => {
|
|
1393
|
+
const { __scopeSwitch: n, name: o, checked: r, defaultChecked: a, required: i, disabled: c, value: u = "on", onCheckedChange: b, ...m } = e, [f, $] = me(null), C = q(
|
|
1394
|
+
t,
|
|
1395
|
+
(h) => $(h)
|
|
1396
|
+
), R = k(!1), d = f ? !!f.closest("form") : !0, [p = !1, _] = ee({
|
|
1397
|
+
prop: r,
|
|
1398
|
+
defaultProp: a,
|
|
1399
|
+
onChange: b
|
|
1400
|
+
});
|
|
1401
|
+
return /* @__PURE__ */ y(pr, {
|
|
1402
|
+
scope: n,
|
|
1403
|
+
checked: p,
|
|
1404
|
+
disabled: c
|
|
1405
|
+
}, /* @__PURE__ */ y(T.button, x({
|
|
1406
|
+
type: "button",
|
|
1407
|
+
role: "switch",
|
|
1408
|
+
"aria-checked": p,
|
|
1409
|
+
"aria-required": i,
|
|
1410
|
+
"data-state": rn(p),
|
|
1411
|
+
"data-disabled": c ? "" : void 0,
|
|
1412
|
+
disabled: c,
|
|
1413
|
+
value: u
|
|
1414
|
+
}, m, {
|
|
1415
|
+
ref: C,
|
|
1416
|
+
onClick: z(e.onClick, (h) => {
|
|
1417
|
+
_(
|
|
1418
|
+
(g) => !g
|
|
1419
|
+
), d && (R.current = h.isPropagationStopped(), R.current || h.stopPropagation());
|
|
1420
|
+
})
|
|
1421
|
+
})), d && /* @__PURE__ */ y(hr, {
|
|
1422
|
+
control: f,
|
|
1423
|
+
bubbles: !R.current,
|
|
1424
|
+
name: o,
|
|
1425
|
+
value: u,
|
|
1426
|
+
checked: p,
|
|
1427
|
+
required: i,
|
|
1428
|
+
disabled: c,
|
|
1429
|
+
style: {
|
|
1430
|
+
transform: "translateX(-100%)"
|
|
1431
|
+
}
|
|
1432
|
+
}));
|
|
1433
|
+
}), $r = "SwitchThumb", gr = /* @__PURE__ */ S((e, t) => {
|
|
1434
|
+
const { __scopeSwitch: n, ...o } = e, r = _r($r, n);
|
|
1435
|
+
return /* @__PURE__ */ y(T.span, x({
|
|
1436
|
+
"data-state": rn(r.checked),
|
|
1437
|
+
"data-disabled": r.disabled ? "" : void 0
|
|
1438
|
+
}, o, {
|
|
1439
|
+
ref: t
|
|
1440
|
+
}));
|
|
1441
|
+
}), hr = (e) => {
|
|
1442
|
+
const { control: t, checked: n, bubbles: o = !0, ...r } = e, a = k(null), i = wn(n), c = An(t);
|
|
1443
|
+
return V(() => {
|
|
1444
|
+
const u = a.current, b = window.HTMLInputElement.prototype, f = Object.getOwnPropertyDescriptor(b, "checked").set;
|
|
1445
|
+
if (i !== n && f) {
|
|
1446
|
+
const $ = new Event("click", {
|
|
1447
|
+
bubbles: o
|
|
1448
|
+
});
|
|
1449
|
+
f.call(u, n), u.dispatchEvent($);
|
|
1450
|
+
}
|
|
1451
|
+
}, [
|
|
1452
|
+
i,
|
|
1453
|
+
n,
|
|
1454
|
+
o
|
|
1455
|
+
]), /* @__PURE__ */ y("input", x({
|
|
1456
|
+
type: "checkbox",
|
|
1457
|
+
"aria-hidden": !0,
|
|
1458
|
+
defaultChecked: n
|
|
1459
|
+
}, r, {
|
|
1460
|
+
tabIndex: -1,
|
|
1461
|
+
ref: a,
|
|
1462
|
+
style: {
|
|
1463
|
+
...e.style,
|
|
1464
|
+
...c,
|
|
1465
|
+
position: "absolute",
|
|
1466
|
+
pointerEvents: "none",
|
|
1467
|
+
opacity: 0,
|
|
1468
|
+
margin: 0
|
|
1469
|
+
}
|
|
1470
|
+
}));
|
|
1471
|
+
};
|
|
1472
|
+
function rn(e) {
|
|
1473
|
+
return e ? "checked" : "unchecked";
|
|
1474
|
+
}
|
|
1475
|
+
const yr = vr, Cr = gr, ce = {
|
|
1476
|
+
"teddy-toggle": "_teddy-toggle_1rp8d_3",
|
|
1477
|
+
"teddy-toggle__input": "_teddy-toggle__input_1rp8d_10",
|
|
1478
|
+
"teddy-toggle__thumb": "_teddy-toggle__thumb_1rp8d_78",
|
|
1479
|
+
"teddy-toggle__indicator": "_teddy-toggle__indicator_1rp8d_104"
|
|
1480
|
+
}, ie = "teddy-toggle", qe = s.createContext(void 0), an = s.forwardRef(
|
|
1481
|
+
({ className: e, id: t, children: n, ...o }, r) => {
|
|
1482
|
+
const a = w([ce[`${ie}`]], e), i = s.useId(), [c, u] = s.useState(!1), [b, m] = s.useState(!1);
|
|
1483
|
+
return /* @__PURE__ */ l("div", { ...o, ref: r, className: a, children: /* @__PURE__ */ l(qe.Provider, { value: { id: t ?? i, isDisabled: c, setIsDisabled: u, isRequired: b, setIsRequired: m }, children: n }) });
|
|
1484
|
+
}
|
|
1485
|
+
);
|
|
1486
|
+
an.displayName = "Toggle";
|
|
1487
|
+
const cn = s.forwardRef(
|
|
1488
|
+
({ className: e, ...t }, n) => {
|
|
1489
|
+
const o = w([ce[`${ie}__label`]], e), r = s.useContext(qe);
|
|
1490
|
+
return /* @__PURE__ */ l(
|
|
1491
|
+
kn,
|
|
1492
|
+
{
|
|
1493
|
+
...t,
|
|
1494
|
+
htmlFor: r == null ? void 0 : r.id,
|
|
1495
|
+
isRequired: r == null ? void 0 : r.isRequired,
|
|
1496
|
+
disabled: r == null ? void 0 : r.isDisabled,
|
|
1497
|
+
ref: n,
|
|
1498
|
+
className: o
|
|
1499
|
+
}
|
|
1500
|
+
);
|
|
1501
|
+
}
|
|
1502
|
+
);
|
|
1503
|
+
cn.displayName = "Toggle.Label";
|
|
1504
|
+
const sn = s.forwardRef(
|
|
1505
|
+
({ className: e, children: t, ...n }, o) => {
|
|
1506
|
+
const r = w([ce[`${ie}__input`]], e), a = s.useContext(qe);
|
|
1507
|
+
return s.useEffect(() => {
|
|
1508
|
+
a && a.setIsDisabled(n.disabled === !0);
|
|
1509
|
+
}, [a, n.disabled]), s.useEffect(() => {
|
|
1510
|
+
a && a.setIsRequired(n.required === !0);
|
|
1511
|
+
}, [a, n.required]), /* @__PURE__ */ l(yr, { ...n, id: a == null ? void 0 : a.id, ref: o, className: r, children: t || /* @__PURE__ */ Oe(ft, { children: [
|
|
1512
|
+
/* @__PURE__ */ l($e, {}),
|
|
1513
|
+
/* @__PURE__ */ l(dn, {})
|
|
1514
|
+
] }) });
|
|
1515
|
+
}
|
|
1516
|
+
);
|
|
1517
|
+
sn.displayName = "Toggle.Input";
|
|
1518
|
+
const $e = s.forwardRef(
|
|
1519
|
+
({ className: e, ...t }, n) => {
|
|
1520
|
+
const o = w([ce[`${ie}__thumb`]], e);
|
|
1521
|
+
return /* @__PURE__ */ l(Cr, { ...t, ref: n, className: o });
|
|
1522
|
+
}
|
|
1523
|
+
);
|
|
1524
|
+
$e.displayName = "Toggle.Thumb";
|
|
1525
|
+
const dn = s.forwardRef(
|
|
1526
|
+
({ className: e, ...t }, n) => {
|
|
1527
|
+
const o = w([ce[`${ie}__indicator`]], e);
|
|
1528
|
+
return /* @__PURE__ */ l(te, { name: "checkmark-bold", size: "xxs", ...t, ref: n, className: o });
|
|
1529
|
+
}
|
|
1530
|
+
);
|
|
1531
|
+
$e.displayName = "Toggle.Indicator";
|
|
1532
|
+
const Ra = Object.assign(an, {
|
|
1533
|
+
Label: cn,
|
|
1534
|
+
Input: sn,
|
|
1535
|
+
Thumb: $e,
|
|
1536
|
+
Indicator: dn
|
|
1537
|
+
}), wr = "_slideDown_fs2mc_1", xr = "_slideUp_fs2mc_1", L = {
|
|
1538
|
+
"teddy-accordion--indented": "_teddy-accordion--indented_fs2mc_3",
|
|
1539
|
+
"teddy-accordion__trigger": "_teddy-accordion__trigger_fs2mc_3",
|
|
1540
|
+
"teddy-accordion__content": "_teddy-accordion__content_fs2mc_4",
|
|
1541
|
+
"teddy-accordion--negative": "_teddy-accordion--negative_fs2mc_13",
|
|
1542
|
+
"teddy-accordion__header": "_teddy-accordion__header_fs2mc_13",
|
|
1543
|
+
"teddy-accordion__title": "_teddy-accordion__title_fs2mc_17",
|
|
1544
|
+
"teddy-accordion__item": "_teddy-accordion__item_fs2mc_28",
|
|
1545
|
+
"teddy-accordion": "_teddy-accordion_fs2mc_3",
|
|
1546
|
+
"teddy-accordion__indicator": "_teddy-accordion__indicator_fs2mc_107",
|
|
1547
|
+
slideDown: wr,
|
|
1548
|
+
slideUp: xr
|
|
1549
|
+
}, W = "Accordion", Er = [
|
|
1550
|
+
"Home",
|
|
1551
|
+
"End",
|
|
1552
|
+
"ArrowDown",
|
|
1553
|
+
"ArrowUp",
|
|
1554
|
+
"ArrowLeft",
|
|
1555
|
+
"ArrowRight"
|
|
1556
|
+
], [Ue, Rr, Nr] = xn(W), [ge, Na] = pe(W, [
|
|
1557
|
+
Nr,
|
|
1558
|
+
Ht
|
|
1559
|
+
]), Ge = Ht(), ln = /* @__PURE__ */ s.forwardRef((e, t) => {
|
|
1560
|
+
const { type: n, ...o } = e, r = o, a = o;
|
|
1561
|
+
return /* @__PURE__ */ s.createElement(Ue.Provider, {
|
|
1562
|
+
scope: e.__scopeAccordion
|
|
1563
|
+
}, n === "multiple" ? /* @__PURE__ */ s.createElement(kr, x({}, a, {
|
|
1564
|
+
ref: t
|
|
1565
|
+
})) : /* @__PURE__ */ s.createElement(Ir, x({}, r, {
|
|
1566
|
+
ref: t
|
|
1567
|
+
})));
|
|
1568
|
+
});
|
|
1569
|
+
ln.propTypes = {
|
|
1570
|
+
type(e) {
|
|
1571
|
+
const t = e.value || e.defaultValue;
|
|
1572
|
+
return e.type && ![
|
|
1573
|
+
"single",
|
|
1574
|
+
"multiple"
|
|
1575
|
+
].includes(e.type) ? new Error("Invalid prop `type` supplied to `Accordion`. Expected one of `single | multiple`.") : e.type === "multiple" && typeof t == "string" ? new Error("Invalid prop `type` supplied to `Accordion`. Expected `single` when `defaultValue` or `value` is type `string`.") : e.type === "single" && Array.isArray(t) ? new Error("Invalid prop `type` supplied to `Accordion`. Expected `multiple` when `defaultValue` or `value` is type `string[]`.") : null;
|
|
1576
|
+
}
|
|
1577
|
+
};
|
|
1578
|
+
const [un, Ar] = ge(W), [fn, Sr] = ge(W, {
|
|
1579
|
+
collapsible: !1
|
|
1580
|
+
}), Ir = /* @__PURE__ */ s.forwardRef((e, t) => {
|
|
1581
|
+
const { value: n, defaultValue: o, onValueChange: r = () => {
|
|
1582
|
+
}, collapsible: a = !1, ...i } = e, [c, u] = ee({
|
|
1583
|
+
prop: n,
|
|
1584
|
+
defaultProp: o,
|
|
1585
|
+
onChange: r
|
|
1586
|
+
});
|
|
1587
|
+
return /* @__PURE__ */ s.createElement(un, {
|
|
1588
|
+
scope: e.__scopeAccordion,
|
|
1589
|
+
value: c ? [
|
|
1590
|
+
c
|
|
1591
|
+
] : [],
|
|
1592
|
+
onItemOpen: u,
|
|
1593
|
+
onItemClose: s.useCallback(
|
|
1594
|
+
() => a && u(""),
|
|
1595
|
+
[
|
|
1596
|
+
a,
|
|
1597
|
+
u
|
|
1598
|
+
]
|
|
1599
|
+
)
|
|
1600
|
+
}, /* @__PURE__ */ s.createElement(fn, {
|
|
1601
|
+
scope: e.__scopeAccordion,
|
|
1602
|
+
collapsible: a
|
|
1603
|
+
}, /* @__PURE__ */ s.createElement(bn, x({}, i, {
|
|
1604
|
+
ref: t
|
|
1605
|
+
}))));
|
|
1606
|
+
}), kr = /* @__PURE__ */ s.forwardRef((e, t) => {
|
|
1607
|
+
const { value: n, defaultValue: o, onValueChange: r = () => {
|
|
1608
|
+
}, ...a } = e, [i = [], c] = ee({
|
|
1609
|
+
prop: n,
|
|
1610
|
+
defaultProp: o,
|
|
1611
|
+
onChange: r
|
|
1612
|
+
}), u = s.useCallback(
|
|
1613
|
+
(m) => c(
|
|
1614
|
+
(f = []) => [
|
|
1615
|
+
...f,
|
|
1616
|
+
m
|
|
1617
|
+
]
|
|
1618
|
+
),
|
|
1619
|
+
[
|
|
1620
|
+
c
|
|
1621
|
+
]
|
|
1622
|
+
), b = s.useCallback(
|
|
1623
|
+
(m) => c(
|
|
1624
|
+
(f = []) => f.filter(
|
|
1625
|
+
($) => $ !== m
|
|
1626
|
+
)
|
|
1627
|
+
),
|
|
1628
|
+
[
|
|
1629
|
+
c
|
|
1630
|
+
]
|
|
1631
|
+
);
|
|
1632
|
+
return /* @__PURE__ */ s.createElement(un, {
|
|
1633
|
+
scope: e.__scopeAccordion,
|
|
1634
|
+
value: i,
|
|
1635
|
+
onItemOpen: u,
|
|
1636
|
+
onItemClose: b
|
|
1637
|
+
}, /* @__PURE__ */ s.createElement(fn, {
|
|
1638
|
+
scope: e.__scopeAccordion,
|
|
1639
|
+
collapsible: !0
|
|
1640
|
+
}, /* @__PURE__ */ s.createElement(bn, x({}, a, {
|
|
1641
|
+
ref: t
|
|
1642
|
+
}))));
|
|
1643
|
+
}), [Tr, he] = ge(W), bn = /* @__PURE__ */ s.forwardRef((e, t) => {
|
|
1644
|
+
const { __scopeAccordion: n, disabled: o, dir: r, orientation: a = "vertical", ...i } = e, c = s.useRef(null), u = q(c, t), b = Rr(n), f = En(r) === "ltr", $ = z(e.onKeyDown, (C) => {
|
|
1645
|
+
var R;
|
|
1646
|
+
if (!Er.includes(C.key))
|
|
1647
|
+
return;
|
|
1648
|
+
const d = C.target, p = b().filter((G) => {
|
|
1649
|
+
var ye;
|
|
1650
|
+
return !((ye = G.ref.current) !== null && ye !== void 0 && ye.disabled);
|
|
1651
|
+
}), _ = p.findIndex(
|
|
1652
|
+
(G) => G.ref.current === d
|
|
1653
|
+
), h = p.length;
|
|
1654
|
+
if (_ === -1)
|
|
1655
|
+
return;
|
|
1656
|
+
C.preventDefault();
|
|
1657
|
+
let g = _;
|
|
1658
|
+
const E = 0, N = h - 1, j = () => {
|
|
1659
|
+
g = _ + 1, g > N && (g = E);
|
|
1660
|
+
}, F = () => {
|
|
1661
|
+
g = _ - 1, g < E && (g = N);
|
|
1662
|
+
};
|
|
1663
|
+
switch (C.key) {
|
|
1664
|
+
case "Home":
|
|
1665
|
+
g = E;
|
|
1666
|
+
break;
|
|
1667
|
+
case "End":
|
|
1668
|
+
g = N;
|
|
1669
|
+
break;
|
|
1670
|
+
case "ArrowRight":
|
|
1671
|
+
a === "horizontal" && (f ? j() : F());
|
|
1672
|
+
break;
|
|
1673
|
+
case "ArrowDown":
|
|
1674
|
+
a === "vertical" && j();
|
|
1675
|
+
break;
|
|
1676
|
+
case "ArrowLeft":
|
|
1677
|
+
a === "horizontal" && (f ? F() : j());
|
|
1678
|
+
break;
|
|
1679
|
+
case "ArrowUp":
|
|
1680
|
+
a === "vertical" && F();
|
|
1681
|
+
break;
|
|
1682
|
+
}
|
|
1683
|
+
const U = g % h;
|
|
1684
|
+
(R = p[U].ref.current) === null || R === void 0 || R.focus();
|
|
1685
|
+
});
|
|
1686
|
+
return /* @__PURE__ */ s.createElement(Tr, {
|
|
1687
|
+
scope: n,
|
|
1688
|
+
disabled: o,
|
|
1689
|
+
direction: r,
|
|
1690
|
+
orientation: a
|
|
1691
|
+
}, /* @__PURE__ */ s.createElement(Ue.Slot, {
|
|
1692
|
+
scope: n
|
|
1693
|
+
}, /* @__PURE__ */ s.createElement(T.div, x({}, i, {
|
|
1694
|
+
"data-orientation": a,
|
|
1695
|
+
ref: u,
|
|
1696
|
+
onKeyDown: o ? void 0 : $
|
|
1697
|
+
}))));
|
|
1698
|
+
}), Pe = "AccordionItem", [Pr, Ke] = ge(Pe), Or = /* @__PURE__ */ s.forwardRef((e, t) => {
|
|
1699
|
+
const { __scopeAccordion: n, value: o, ...r } = e, a = he(Pe, n), i = Ar(Pe, n), c = Ge(n), u = ne(), b = o && i.value.includes(o) || !1, m = a.disabled || e.disabled;
|
|
1700
|
+
return /* @__PURE__ */ s.createElement(Pr, {
|
|
1701
|
+
scope: n,
|
|
1702
|
+
open: b,
|
|
1703
|
+
disabled: m,
|
|
1704
|
+
triggerId: u
|
|
1705
|
+
}, /* @__PURE__ */ s.createElement(Vt, x({
|
|
1706
|
+
"data-orientation": a.orientation,
|
|
1707
|
+
"data-state": mn(b)
|
|
1708
|
+
}, c, r, {
|
|
1709
|
+
ref: t,
|
|
1710
|
+
disabled: m,
|
|
1711
|
+
open: b,
|
|
1712
|
+
onOpenChange: (f) => {
|
|
1713
|
+
f ? i.onItemOpen(o) : i.onItemClose(o);
|
|
1714
|
+
}
|
|
1715
|
+
})));
|
|
1716
|
+
}), Dr = "AccordionHeader", Mr = /* @__PURE__ */ s.forwardRef((e, t) => {
|
|
1717
|
+
const { __scopeAccordion: n, ...o } = e, r = he(W, n), a = Ke(Dr, n);
|
|
1718
|
+
return /* @__PURE__ */ s.createElement(T.h3, x({
|
|
1719
|
+
"data-orientation": r.orientation,
|
|
1720
|
+
"data-state": mn(a.open),
|
|
1721
|
+
"data-disabled": a.disabled ? "" : void 0
|
|
1722
|
+
}, o, {
|
|
1723
|
+
ref: t
|
|
1724
|
+
}));
|
|
1725
|
+
}), dt = "AccordionTrigger", Fr = /* @__PURE__ */ s.forwardRef((e, t) => {
|
|
1726
|
+
const { __scopeAccordion: n, ...o } = e, r = he(W, n), a = Ke(dt, n), i = Sr(dt, n), c = Ge(n);
|
|
1727
|
+
return /* @__PURE__ */ s.createElement(Ue.ItemSlot, {
|
|
1728
|
+
scope: n
|
|
1729
|
+
}, /* @__PURE__ */ s.createElement(Wt, x({
|
|
1730
|
+
"aria-disabled": a.open && !i.collapsible || void 0,
|
|
1731
|
+
"data-orientation": r.orientation,
|
|
1732
|
+
id: a.triggerId
|
|
1733
|
+
}, c, o, {
|
|
1734
|
+
ref: t
|
|
1735
|
+
})));
|
|
1736
|
+
}), Lr = "AccordionContent", Br = /* @__PURE__ */ s.forwardRef((e, t) => {
|
|
1737
|
+
const { __scopeAccordion: n, ...o } = e, r = he(W, n), a = Ke(Lr, n), i = Ge(n);
|
|
1738
|
+
return /* @__PURE__ */ s.createElement(jt, x({
|
|
1739
|
+
role: "region",
|
|
1740
|
+
"aria-labelledby": a.triggerId,
|
|
1741
|
+
"data-orientation": r.orientation
|
|
1742
|
+
}, i, o, {
|
|
1743
|
+
ref: t,
|
|
1744
|
+
style: {
|
|
1745
|
+
"--radix-accordion-content-height": "var(--radix-collapsible-content-height)",
|
|
1746
|
+
"--radix-accordion-content-width": "var(--radix-collapsible-content-width)",
|
|
1747
|
+
...e.style
|
|
1748
|
+
}
|
|
1749
|
+
}));
|
|
1750
|
+
});
|
|
1751
|
+
function mn(e) {
|
|
1752
|
+
return e ? "open" : "closed";
|
|
1753
|
+
}
|
|
1754
|
+
const Hr = ln, zr = Or, Vr = Mr, Wr = Fr, jr = Br, B = "teddy-accordion", pn = s.forwardRef(
|
|
1755
|
+
({ className: e, variant: t = "default", children: n, indented: o = !1, ...r }, a) => {
|
|
1756
|
+
const i = w(
|
|
1757
|
+
L[B],
|
|
1758
|
+
L[`${B}--${t}`],
|
|
1759
|
+
{
|
|
1760
|
+
[L[`${B}--indented`]]: o
|
|
1761
|
+
},
|
|
1762
|
+
e
|
|
1763
|
+
);
|
|
1764
|
+
return /* @__PURE__ */ l(Hr, { ...r, ref: a, className: i, children: n });
|
|
1765
|
+
}
|
|
1766
|
+
);
|
|
1767
|
+
pn.displayName = "Accordion";
|
|
1768
|
+
const qr = s.forwardRef(
|
|
1769
|
+
({ className: e, children: t, ...n }, o) => {
|
|
1770
|
+
const r = w([L[`${B}__item`]], e);
|
|
1771
|
+
return /* @__PURE__ */ l(zr, { ...n, ref: o, className: r, children: t });
|
|
1772
|
+
}
|
|
1773
|
+
), _n = s.forwardRef(
|
|
1774
|
+
({ className: e, children: t, ...n }, o) => {
|
|
1775
|
+
const r = w([L[`${B}__header`]], e);
|
|
1776
|
+
return /* @__PURE__ */ l(Vr, { ...n, ref: o, asChild: !0, className: r, children: /* @__PURE__ */ l(re, { variant: "title-100", ...n.asChild ? { asChild: !0 } : { as: "h3" }, children: t }) });
|
|
1777
|
+
}
|
|
1778
|
+
);
|
|
1779
|
+
_n.displayName = "Accordion.Header";
|
|
1780
|
+
const vn = s.forwardRef(
|
|
1781
|
+
({ className: e, children: t, hideIndicator: n, ...o }, r) => {
|
|
1782
|
+
const a = w([L[`${B}__trigger`]], e);
|
|
1783
|
+
return /* @__PURE__ */ Oe(Wr, { ...o, ref: r, className: a, children: [
|
|
1784
|
+
/* @__PURE__ */ l(bt, { children: t }),
|
|
1785
|
+
!n && /* @__PURE__ */ l(Xe, {})
|
|
1786
|
+
] });
|
|
1787
|
+
}
|
|
1788
|
+
);
|
|
1789
|
+
vn.displayName = "Accordion.Trigger";
|
|
1790
|
+
const Xe = s.forwardRef(
|
|
1791
|
+
({ className: e, children: t, ...n }, o) => {
|
|
1792
|
+
const r = w([L[`${B}__indicator`]], e);
|
|
1793
|
+
return /* @__PURE__ */ l(te, { "aria-hidden": !0, name: "chevron-down", ...n, ref: o, className: r, children: t });
|
|
1794
|
+
}
|
|
1795
|
+
);
|
|
1796
|
+
Xe.displayName = "Accordion.Indicator";
|
|
1797
|
+
const $n = s.forwardRef(
|
|
1798
|
+
({ className: e, children: t, ...n }, o) => {
|
|
1799
|
+
const r = w([L[`${B}__content`]], e);
|
|
1800
|
+
return /* @__PURE__ */ l(jr, { ...n, ref: o, className: r, children: t });
|
|
1801
|
+
}
|
|
1802
|
+
);
|
|
1803
|
+
$n.displayName = "Accordion.Content";
|
|
1804
|
+
const gn = s.forwardRef(
|
|
1805
|
+
({ className: e, children: t, variant: n = "title-400", ...o }, r) => {
|
|
1806
|
+
const a = w([L[`${B}__title`]], e);
|
|
1807
|
+
return /* @__PURE__ */ l(re, { ...o, variant: n, ref: r, className: a, children: t });
|
|
1808
|
+
}
|
|
1809
|
+
);
|
|
1810
|
+
gn.displayName = "Accordion.Title";
|
|
1811
|
+
const Aa = Object.assign(pn, {
|
|
1812
|
+
Trigger: vn,
|
|
1813
|
+
Content: $n,
|
|
1814
|
+
Header: _n,
|
|
1815
|
+
Item: qr,
|
|
1816
|
+
Indicator: Xe,
|
|
1817
|
+
Title: gn
|
|
1818
|
+
}), lt = {
|
|
1819
|
+
"teddy-badge": "_teddy-badge_sg6ab_1",
|
|
1820
|
+
"teddy-badge--attention": "_teddy-badge--attention_sg6ab_13",
|
|
1821
|
+
"teddy-badge--special": "_teddy-badge--special_sg6ab_17",
|
|
1822
|
+
"teddy-badge--neutral": "_teddy-badge--neutral_sg6ab_21",
|
|
1823
|
+
"teddy-badge--information": "_teddy-badge--information_sg6ab_25",
|
|
1824
|
+
"teddy-badge--success": "_teddy-badge--success_sg6ab_29",
|
|
1825
|
+
"teddy-badge--warning": "_teddy-badge--warning_sg6ab_33",
|
|
1826
|
+
"teddy-badge--error": "_teddy-badge--error_sg6ab_37"
|
|
1827
|
+
}, ut = "teddy-badge";
|
|
1828
|
+
function Ur(e) {
|
|
1829
|
+
if (e === "success")
|
|
1830
|
+
return "check-circle";
|
|
1831
|
+
if (e === "warning")
|
|
1832
|
+
return "alert";
|
|
1833
|
+
if (e === "error")
|
|
1834
|
+
return "error";
|
|
1835
|
+
}
|
|
1836
|
+
const Gr = s.forwardRef(
|
|
1837
|
+
({ className: e, variant: t, asChild: n, children: o, ...r }, a) => {
|
|
1838
|
+
const i = w([lt[`${ut}`]], [lt[`${ut}--${t}`]], e), c = n ? Me : "span", u = Ur(t);
|
|
1839
|
+
return /* @__PURE__ */ Oe(c, { ...r, ref: a, className: i, children: [
|
|
1840
|
+
!r.hideIcon && u && /* @__PURE__ */ l(te, { name: u }),
|
|
1841
|
+
/* @__PURE__ */ l(bt, { children: o })
|
|
1842
|
+
] });
|
|
1843
|
+
}
|
|
1844
|
+
);
|
|
1845
|
+
Gr.displayName = "Badge";
|
|
1846
|
+
export {
|
|
1847
|
+
Aa as A,
|
|
1848
|
+
Gr as B,
|
|
1849
|
+
br as C,
|
|
1850
|
+
wa as M,
|
|
1851
|
+
xa as N,
|
|
1852
|
+
Ra as T
|
|
1853
|
+
};
|