@takecasper/acuity-design-system 1.14.3 → 1.15.0
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/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +6 -4
- package/dist/index.es.js +106 -111
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./assets/index.css";
|
|
2
2
|
import * as sr from "react";
|
|
3
|
-
import j, {
|
|
3
|
+
import j, { useState as me, useEffect as ne, useLayoutEffect as Vn, useRef as P, createContext as le, useContext as Q, forwardRef as Dn, Fragment as ae, isValidElement as Hn, cloneElement as Bn, createElement as zn, useId as yr, useMemo as oe, useSyncExternalStore as Un, useReducer as Gn, createRef as Yn, useCallback as mr } from "react";
|
|
4
4
|
import { createPortal as Rt } from "react-dom";
|
|
5
5
|
var Wr = { exports: {} }, er = {};
|
|
6
6
|
/**
|
|
@@ -68,10 +68,10 @@ function qn() {
|
|
|
68
68
|
S.unshift("Warning: " + h), Function.prototype.apply.call(console[l], console, S);
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
-
var
|
|
71
|
+
var R = !1, U = !1, we = !1, q = !1, G = !1, K;
|
|
72
72
|
K = Symbol.for("react.module.reference");
|
|
73
|
-
function
|
|
74
|
-
return !!(typeof l == "string" || typeof l == "function" || l === t || l === s || G || l === o || l === f || l === u || q || l === v ||
|
|
73
|
+
function ee(l) {
|
|
74
|
+
return !!(typeof l == "string" || typeof l == "function" || l === t || l === s || G || l === o || l === f || l === u || q || l === v || R || U || we || typeof l == "object" && l !== null && (l.$$typeof === g || l.$$typeof === p || l.$$typeof === a || l.$$typeof === d || l.$$typeof === c || // This needs to include all possible module reference object
|
|
75
75
|
// types supported by any Flight configuration anywhere since
|
|
76
76
|
// we don't know which Flight build this will end up being used
|
|
77
77
|
// with.
|
|
@@ -136,7 +136,7 @@ function qn() {
|
|
|
136
136
|
function Se() {
|
|
137
137
|
}
|
|
138
138
|
Se.__reactDisabledLog = !0;
|
|
139
|
-
function
|
|
139
|
+
function re() {
|
|
140
140
|
{
|
|
141
141
|
if (z === 0) {
|
|
142
142
|
fe = console.log, ve = console.info, pe = console.warn, H = console.error, ke = console.group, he = console.groupCollapsed, J = console.groupEnd;
|
|
@@ -226,7 +226,7 @@ function qn() {
|
|
|
226
226
|
var M = Error.prepareStackTrace;
|
|
227
227
|
Error.prepareStackTrace = void 0;
|
|
228
228
|
var S;
|
|
229
|
-
S = X.current, X.current = null,
|
|
229
|
+
S = X.current, X.current = null, re();
|
|
230
230
|
try {
|
|
231
231
|
if (h) {
|
|
232
232
|
var T = function() {
|
|
@@ -589,7 +589,7 @@ Check the top-level render call using <` + m + ">.");
|
|
|
589
589
|
}
|
|
590
590
|
function ht(l, h, m, k, M, S) {
|
|
591
591
|
{
|
|
592
|
-
var T =
|
|
592
|
+
var T = ee(l);
|
|
593
593
|
if (!T) {
|
|
594
594
|
var L = "";
|
|
595
595
|
(l === void 0 || typeof l == "object" && l !== null && Object.keys(l).length === 0) && (L += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
@@ -2434,7 +2434,7 @@ function gs(e) {
|
|
|
2434
2434
|
return is.test(e);
|
|
2435
2435
|
}
|
|
2436
2436
|
function vs() {
|
|
2437
|
-
const e = N("colors"), r = N("spacing"), n = N("blur"), t = N("brightness"), o = N("borderColor"), s = N("borderRadius"), a = N("borderSpacing"), d = N("borderWidth"), c = N("contrast"), f = N("grayscale"), u = N("hueRotate"), p = N("invert"), g = N("gap"), v = N("gradientColorStops"), C = N("gradientColorStopPositions"), x = N("inset"), b = N("margin"), w = N("opacity"), y = N("padding"), ue = N("saturate"),
|
|
2437
|
+
const e = N("colors"), r = N("spacing"), n = N("blur"), t = N("brightness"), o = N("borderColor"), s = N("borderRadius"), a = N("borderSpacing"), d = N("borderWidth"), c = N("contrast"), f = N("grayscale"), u = N("hueRotate"), p = N("invert"), g = N("gap"), v = N("gradientColorStops"), C = N("gradientColorStopPositions"), x = N("inset"), b = N("margin"), w = N("opacity"), y = N("padding"), ue = N("saturate"), R = N("scale"), U = N("sepia"), we = N("skew"), q = N("space"), G = N("translate"), K = () => ["auto", "contain", "none"], ee = () => ["auto", "hidden", "clip", "visible", "scroll"], se = () => ["auto", E, r], $ = () => [E, r], F = () => ["", Ee, Re], I = () => ["auto", _e, E], z = () => ["bottom", "center", "left", "left-bottom", "left-top", "right", "right-bottom", "right-top", "top"], fe = () => ["solid", "dashed", "dotted", "double", "none"], ve = () => ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity", "plus-lighter"], pe = () => ["start", "end", "center", "between", "around", "evenly", "stretch"], H = () => ["", "0", E], ke = () => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"], he = () => [_e, gr], J = () => [_e, E];
|
|
2438
2438
|
return {
|
|
2439
2439
|
cacheSize: 500,
|
|
2440
2440
|
separator: ":",
|
|
@@ -2564,21 +2564,21 @@ function vs() {
|
|
|
2564
2564
|
* @see https://tailwindcss.com/docs/overflow
|
|
2565
2565
|
*/
|
|
2566
2566
|
overflow: [{
|
|
2567
|
-
overflow:
|
|
2567
|
+
overflow: ee()
|
|
2568
2568
|
}],
|
|
2569
2569
|
/**
|
|
2570
2570
|
* Overflow X
|
|
2571
2571
|
* @see https://tailwindcss.com/docs/overflow
|
|
2572
2572
|
*/
|
|
2573
2573
|
"overflow-x": [{
|
|
2574
|
-
"overflow-x":
|
|
2574
|
+
"overflow-x": ee()
|
|
2575
2575
|
}],
|
|
2576
2576
|
/**
|
|
2577
2577
|
* Overflow Y
|
|
2578
2578
|
* @see https://tailwindcss.com/docs/overflow
|
|
2579
2579
|
*/
|
|
2580
2580
|
"overflow-y": [{
|
|
2581
|
-
"overflow-y":
|
|
2581
|
+
"overflow-y": ee()
|
|
2582
2582
|
}],
|
|
2583
2583
|
/**
|
|
2584
2584
|
* Overscroll Behavior
|
|
@@ -4058,21 +4058,21 @@ function vs() {
|
|
|
4058
4058
|
* @see https://tailwindcss.com/docs/scale
|
|
4059
4059
|
*/
|
|
4060
4060
|
scale: [{
|
|
4061
|
-
scale: [
|
|
4061
|
+
scale: [R]
|
|
4062
4062
|
}],
|
|
4063
4063
|
/**
|
|
4064
4064
|
* Scale X
|
|
4065
4065
|
* @see https://tailwindcss.com/docs/scale
|
|
4066
4066
|
*/
|
|
4067
4067
|
"scale-x": [{
|
|
4068
|
-
"scale-x": [
|
|
4068
|
+
"scale-x": [R]
|
|
4069
4069
|
}],
|
|
4070
4070
|
/**
|
|
4071
4071
|
* Scale Y
|
|
4072
4072
|
* @see https://tailwindcss.com/docs/scale
|
|
4073
4073
|
*/
|
|
4074
4074
|
"scale-y": [{
|
|
4075
|
-
"scale-y": [
|
|
4075
|
+
"scale-y": [R]
|
|
4076
4076
|
}],
|
|
4077
4077
|
/**
|
|
4078
4078
|
* Rotate
|
|
@@ -4873,10 +4873,10 @@ const yt = (...e) => Me(Es(...e)), Nr = [
|
|
|
4873
4873
|
] })
|
|
4874
4874
|
}
|
|
4875
4875
|
) }), $s = Ls, Ts = ({
|
|
4876
|
-
|
|
4876
|
+
content: e = void 0,
|
|
4877
4877
|
iconName: r = void 0,
|
|
4878
4878
|
title: n = "",
|
|
4879
|
-
|
|
4879
|
+
footer: t = void 0,
|
|
4880
4880
|
className: o = ""
|
|
4881
4881
|
}) => /* @__PURE__ */ i.jsxs(
|
|
4882
4882
|
"div",
|
|
@@ -4942,34 +4942,29 @@ const yt = (...e) => Me(Es(...e)), Nr = [
|
|
|
4942
4942
|
}
|
|
4943
4943
|
}
|
|
4944
4944
|
), Zt = (e) => Me(Ss(e)), Rs = ({
|
|
4945
|
-
id: e
|
|
4945
|
+
id: e,
|
|
4946
4946
|
label: r = "",
|
|
4947
4947
|
name: n = "",
|
|
4948
4948
|
checked: t = !1,
|
|
4949
4949
|
disabled: o = !1,
|
|
4950
4950
|
indeterminate: s = !1,
|
|
4951
4951
|
...a
|
|
4952
|
-
}) => {
|
|
4953
|
-
|
|
4954
|
-
|
|
4955
|
-
|
|
4956
|
-
|
|
4957
|
-
|
|
4958
|
-
|
|
4959
|
-
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
|
|
4963
|
-
|
|
4964
|
-
|
|
4965
|
-
|
|
4966
|
-
|
|
4967
|
-
|
|
4968
|
-
}
|
|
4969
|
-
),
|
|
4970
|
-
/* @__PURE__ */ i.jsx("label", { htmlFor: e, className: Zt({ disabled: o }), children: r })
|
|
4971
|
-
] });
|
|
4972
|
-
}, Pa = Rs, De = "large", Ye = "medium", Ze = "small", qe = "extra-large", Lt = "h1", Ps = "h2", Ns = "h3", As = "div";
|
|
4952
|
+
}) => /* @__PURE__ */ i.jsxs("div", { className: "ds-flex ds-h-4 ds-items-center", children: [
|
|
4953
|
+
/* @__PURE__ */ i.jsx(
|
|
4954
|
+
"input",
|
|
4955
|
+
{
|
|
4956
|
+
id: e,
|
|
4957
|
+
name: n,
|
|
4958
|
+
disabled: o,
|
|
4959
|
+
type: "checkbox",
|
|
4960
|
+
className: `ds-form-checkbox ${Yt({ disabled: o })} ds-rounded`,
|
|
4961
|
+
checked: t,
|
|
4962
|
+
ref: (d) => d && (d.indeterminate = s),
|
|
4963
|
+
...a
|
|
4964
|
+
}
|
|
4965
|
+
),
|
|
4966
|
+
/* @__PURE__ */ i.jsx("label", { htmlFor: e, className: Zt({ disabled: o }), children: r })
|
|
4967
|
+
] }), Pa = Rs, De = "large", Ye = "medium", Ze = "small", qe = "extra-large", Lt = "h1", Ps = "h2", Ns = "h3", As = "div";
|
|
4973
4968
|
function Fs(e) {
|
|
4974
4969
|
return {
|
|
4975
4970
|
[De]: Lt,
|
|
@@ -5181,13 +5176,13 @@ function Oe() {
|
|
|
5181
5176
|
}
|
|
5182
5177
|
function Kr() {
|
|
5183
5178
|
let [e] = me(Oe);
|
|
5184
|
-
return
|
|
5179
|
+
return ne(() => () => e.dispose(), [e]), e;
|
|
5185
5180
|
}
|
|
5186
5181
|
let Z = (e, r) => {
|
|
5187
|
-
Ve.isServer ?
|
|
5182
|
+
Ve.isServer ? ne(e, r) : Vn(e, r);
|
|
5188
5183
|
};
|
|
5189
5184
|
function Ce(e) {
|
|
5190
|
-
let r =
|
|
5185
|
+
let r = P(e);
|
|
5191
5186
|
return Z(() => {
|
|
5192
5187
|
r.current = e;
|
|
5193
5188
|
}, [e]), r;
|
|
@@ -5197,7 +5192,7 @@ let A = function(e) {
|
|
|
5197
5192
|
return j.useCallback((...n) => r.current(...n), [r]);
|
|
5198
5193
|
}, Ys = le(void 0);
|
|
5199
5194
|
function Zs() {
|
|
5200
|
-
return
|
|
5195
|
+
return Q(Ys);
|
|
5201
5196
|
}
|
|
5202
5197
|
function ir(...e) {
|
|
5203
5198
|
return Array.from(new Set(e.flatMap((r) => typeof r == "string" ? r.split(" ") : []))).filter(Boolean).join(" ");
|
|
@@ -5318,7 +5313,7 @@ function Js(e, r) {
|
|
|
5318
5313
|
}
|
|
5319
5314
|
let Vr = ce(Js), Xs = le(null);
|
|
5320
5315
|
function Qs({ children: e }) {
|
|
5321
|
-
let r =
|
|
5316
|
+
let r = Q(Xs);
|
|
5322
5317
|
if (!r)
|
|
5323
5318
|
return j.createElement(j.Fragment, null, e);
|
|
5324
5319
|
let { target: n } = r;
|
|
@@ -5329,8 +5324,8 @@ function ei(e, r = !0) {
|
|
|
5329
5324
|
return Object.assign(e, { [Jt]: r });
|
|
5330
5325
|
}
|
|
5331
5326
|
function xe(...e) {
|
|
5332
|
-
let r =
|
|
5333
|
-
|
|
5327
|
+
let r = P(e);
|
|
5328
|
+
ne(() => {
|
|
5334
5329
|
r.current = e;
|
|
5335
5330
|
}, [e]);
|
|
5336
5331
|
let n = A((t) => {
|
|
@@ -5342,7 +5337,7 @@ function xe(...e) {
|
|
|
5342
5337
|
let Jr = le(null);
|
|
5343
5338
|
Jr.displayName = "DescriptionContext";
|
|
5344
5339
|
function Xt() {
|
|
5345
|
-
let e =
|
|
5340
|
+
let e = Q(Jr);
|
|
5346
5341
|
if (e === null) {
|
|
5347
5342
|
let r = new Error("You used a <Description /> component, but it is not inside a relevant parent.");
|
|
5348
5343
|
throw Error.captureStackTrace && Error.captureStackTrace(r, Xt), r;
|
|
@@ -5417,7 +5412,7 @@ function en(e, r, n = !0) {
|
|
|
5417
5412
|
let s = o.getBoundingClientRect();
|
|
5418
5413
|
s.x === 0 && s.y === 0 && s.width === 0 && s.height === 0 && r();
|
|
5419
5414
|
});
|
|
5420
|
-
|
|
5415
|
+
ne(() => {
|
|
5421
5416
|
if (!n)
|
|
5422
5417
|
return;
|
|
5423
5418
|
let o = e === null ? null : e instanceof HTMLElement ? e : e.current;
|
|
@@ -5528,7 +5523,7 @@ function Ci() {
|
|
|
5528
5523
|
}
|
|
5529
5524
|
function Cr(e, r, n) {
|
|
5530
5525
|
let t = Ce(r);
|
|
5531
|
-
|
|
5526
|
+
ne(() => {
|
|
5532
5527
|
function o(s) {
|
|
5533
5528
|
t.current(s);
|
|
5534
5529
|
}
|
|
@@ -5537,7 +5532,7 @@ function Cr(e, r, n) {
|
|
|
5537
5532
|
}
|
|
5538
5533
|
function nn(e, r, n) {
|
|
5539
5534
|
let t = Ce(r);
|
|
5540
|
-
|
|
5535
|
+
ne(() => {
|
|
5541
5536
|
function o(s) {
|
|
5542
5537
|
t.current(s);
|
|
5543
5538
|
}
|
|
@@ -5545,8 +5540,8 @@ function nn(e, r, n) {
|
|
|
5545
5540
|
}, [e, n]);
|
|
5546
5541
|
}
|
|
5547
5542
|
function xi(e, r, n = !0) {
|
|
5548
|
-
let t =
|
|
5549
|
-
|
|
5543
|
+
let t = P(!1);
|
|
5544
|
+
ne(() => {
|
|
5550
5545
|
requestAnimationFrame(() => {
|
|
5551
5546
|
t.current = n;
|
|
5552
5547
|
});
|
|
@@ -5569,7 +5564,7 @@ function xi(e, r, n = !0) {
|
|
|
5569
5564
|
}
|
|
5570
5565
|
return !pi(c, rn.Loose) && c.tabIndex !== -1 && a.preventDefault(), r(a, c);
|
|
5571
5566
|
}
|
|
5572
|
-
let s =
|
|
5567
|
+
let s = P(null);
|
|
5573
5568
|
Cr("pointerdown", (a) => {
|
|
5574
5569
|
var d, c;
|
|
5575
5570
|
t.current && (s.current = ((c = (d = a.composedPath) == null ? void 0 : d.call(a)) == null ? void 0 : c[0]) || a.target);
|
|
@@ -5585,7 +5580,7 @@ function dr(...e) {
|
|
|
5585
5580
|
}
|
|
5586
5581
|
function on(e, r, n, t) {
|
|
5587
5582
|
let o = Ce(n);
|
|
5588
|
-
|
|
5583
|
+
ne(() => {
|
|
5589
5584
|
e = e != null ? e : window;
|
|
5590
5585
|
function s(a) {
|
|
5591
5586
|
o.current(a);
|
|
@@ -5718,8 +5713,8 @@ function Ti(e, r, n = () => [document.body]) {
|
|
|
5718
5713
|
});
|
|
5719
5714
|
}
|
|
5720
5715
|
function Xr(e, r) {
|
|
5721
|
-
let n =
|
|
5722
|
-
|
|
5716
|
+
let n = P([]), t = A(e);
|
|
5717
|
+
ne(() => {
|
|
5723
5718
|
let o = [...n.current];
|
|
5724
5719
|
for (let [s, a] of r.entries())
|
|
5725
5720
|
if (n.current[s] !== a) {
|
|
@@ -5730,9 +5725,9 @@ function Xr(e, r) {
|
|
|
5730
5725
|
}
|
|
5731
5726
|
let Qr = le(null);
|
|
5732
5727
|
Qr.displayName = "OpenClosedContext";
|
|
5733
|
-
var
|
|
5728
|
+
var te = ((e) => (e[e.Open = 1] = "Open", e[e.Closed = 2] = "Closed", e[e.Closing = 4] = "Closing", e[e.Opening = 8] = "Opening", e))(te || {});
|
|
5734
5729
|
function et() {
|
|
5735
|
-
return
|
|
5730
|
+
return Q(Qr);
|
|
5736
5731
|
}
|
|
5737
5732
|
function Mi({ value: e, children: r }) {
|
|
5738
5733
|
return j.createElement(Qr.Provider, { value: e }, r);
|
|
@@ -5751,8 +5746,8 @@ Si(() => {
|
|
|
5751
5746
|
window.addEventListener("click", e, { capture: !0 }), window.addEventListener("mousedown", e, { capture: !0 }), window.addEventListener("focus", e, { capture: !0 }), document.body.addEventListener("click", e, { capture: !0 }), document.body.addEventListener("mousedown", e, { capture: !0 }), document.body.addEventListener("focus", e, { capture: !0 });
|
|
5752
5747
|
});
|
|
5753
5748
|
function sn(e) {
|
|
5754
|
-
let r = A(e), n =
|
|
5755
|
-
|
|
5749
|
+
let r = A(e), n = P(!1);
|
|
5750
|
+
ne(() => (n.current = !1, () => {
|
|
5756
5751
|
n.current = !0, jr(() => {
|
|
5757
5752
|
n.current && r();
|
|
5758
5753
|
});
|
|
@@ -5771,13 +5766,13 @@ function cr() {
|
|
|
5771
5766
|
}
|
|
5772
5767
|
let an = le(!1);
|
|
5773
5768
|
function Pi() {
|
|
5774
|
-
return
|
|
5769
|
+
return Q(an);
|
|
5775
5770
|
}
|
|
5776
5771
|
function Mt(e) {
|
|
5777
5772
|
return j.createElement(an.Provider, { value: e.force }, e.children);
|
|
5778
5773
|
}
|
|
5779
5774
|
function Ni(e) {
|
|
5780
|
-
let r = Pi(), n =
|
|
5775
|
+
let r = Pi(), n = Q(dn), t = dr(e), [o, s] = me(() => {
|
|
5781
5776
|
var a;
|
|
5782
5777
|
if (!r && n !== null)
|
|
5783
5778
|
return (a = n.current) != null ? a : null;
|
|
@@ -5791,19 +5786,19 @@ function Ni(e) {
|
|
|
5791
5786
|
let c = t.createElement("div");
|
|
5792
5787
|
return c.setAttribute("id", "headlessui-portal-root"), t.body.appendChild(c);
|
|
5793
5788
|
});
|
|
5794
|
-
return
|
|
5789
|
+
return ne(() => {
|
|
5795
5790
|
o !== null && (t != null && t.body.contains(o) || t == null || t.body.appendChild(o));
|
|
5796
|
-
}, [o, t]),
|
|
5791
|
+
}, [o, t]), ne(() => {
|
|
5797
5792
|
r || n !== null && s(n.current);
|
|
5798
5793
|
}, [n, s, r]), o;
|
|
5799
5794
|
}
|
|
5800
5795
|
let ln = ae, Ai = ce(function(e, r) {
|
|
5801
|
-
let n = e, t =
|
|
5796
|
+
let n = e, t = P(null), o = xe(ei((u) => {
|
|
5802
5797
|
t.current = u;
|
|
5803
5798
|
}), r), s = dr(t), a = Ni(t), [d] = me(() => {
|
|
5804
5799
|
var u;
|
|
5805
5800
|
return Ve.isServer ? null : (u = s == null ? void 0 : s.createElement("div")) != null ? u : null;
|
|
5806
|
-
}), c =
|
|
5801
|
+
}), c = Q(zr), f = cr();
|
|
5807
5802
|
return Z(() => {
|
|
5808
5803
|
!a || !d || a.contains(d) || (d.setAttribute("data-headlessui-portal", ""), a.appendChild(d));
|
|
5809
5804
|
}, [a, d]), Z(() => {
|
|
@@ -5825,7 +5820,7 @@ function _i(e, r) {
|
|
|
5825
5820
|
}
|
|
5826
5821
|
let zr = le(null);
|
|
5827
5822
|
function Wi() {
|
|
5828
|
-
let e =
|
|
5823
|
+
let e = Q(zr), r = P([]), n = A((s) => (r.current.push(s), e && e.register(s), () => t(s))), t = A((s) => {
|
|
5829
5824
|
let a = r.current.indexOf(s);
|
|
5830
5825
|
a !== -1 && r.current.splice(a, 1), e && e.unregister(s);
|
|
5831
5826
|
}), o = oe(() => ({ register: n, unregister: t, portals: r }), [n, t, r]);
|
|
@@ -5848,7 +5843,7 @@ function Di() {
|
|
|
5848
5843
|
}
|
|
5849
5844
|
function Hi({ defaultContainers: e = [], portals: r, mainTreeNodeRef: n } = {}) {
|
|
5850
5845
|
var t;
|
|
5851
|
-
let o =
|
|
5846
|
+
let o = P((t = n == null ? void 0 : n.current) != null ? t : null), s = dr(o), a = A(() => {
|
|
5852
5847
|
var d, c, f;
|
|
5853
5848
|
let u = [];
|
|
5854
5849
|
for (let p of e)
|
|
@@ -5869,7 +5864,7 @@ let rt = le(() => {
|
|
|
5869
5864
|
rt.displayName = "StackContext";
|
|
5870
5865
|
var Ur = ((e) => (e[e.Add = 0] = "Add", e[e.Remove = 1] = "Remove", e))(Ur || {});
|
|
5871
5866
|
function Bi() {
|
|
5872
|
-
return
|
|
5867
|
+
return Q(rt);
|
|
5873
5868
|
}
|
|
5874
5869
|
function zi({ children: e, onUpdate: r, type: n, element: t, enabled: o }) {
|
|
5875
5870
|
let s = Bi(), a = A((...d) => {
|
|
@@ -5883,14 +5878,14 @@ function zi({ children: e, onUpdate: r, type: n, element: t, enabled: o }) {
|
|
|
5883
5878
|
}, [a, n, t, o]), j.createElement(rt.Provider, { value: a }, e);
|
|
5884
5879
|
}
|
|
5885
5880
|
function ur() {
|
|
5886
|
-
let e =
|
|
5881
|
+
let e = P(!1);
|
|
5887
5882
|
return Z(() => (e.current = !0, () => {
|
|
5888
5883
|
e.current = !1;
|
|
5889
5884
|
}), []), e;
|
|
5890
5885
|
}
|
|
5891
5886
|
var or = ((e) => (e[e.Forwards = 0] = "Forwards", e[e.Backwards = 1] = "Backwards", e))(or || {});
|
|
5892
5887
|
function Ui() {
|
|
5893
|
-
let e =
|
|
5888
|
+
let e = P(0);
|
|
5894
5889
|
return nn("keydown", (r) => {
|
|
5895
5890
|
r.key === "Tab" && (e.current = r.shiftKey ? 1 : 0);
|
|
5896
5891
|
}, !0), e;
|
|
@@ -5908,7 +5903,7 @@ function cn(e) {
|
|
|
5908
5903
|
let Gi = "div";
|
|
5909
5904
|
var Le = ((e) => (e[e.None = 1] = "None", e[e.InitialFocus = 2] = "InitialFocus", e[e.TabLock = 4] = "TabLock", e[e.FocusLock = 8] = "FocusLock", e[e.RestoreFocus = 16] = "RestoreFocus", e[e.AutoFocus = 32] = "AutoFocus", e[e.All = 30] = "All", e))(Le || {});
|
|
5910
5905
|
function Yi(e, r) {
|
|
5911
|
-
let n =
|
|
5906
|
+
let n = P(null), t = xe(n, r), { initialFocus: o, initialFocusFallback: s, containers: a, features: d = 30, ...c } = e;
|
|
5912
5907
|
cr() || (d = 1);
|
|
5913
5908
|
let f = dr(n);
|
|
5914
5909
|
Ji({ ownerDocument: f }, !!(d & 16));
|
|
@@ -5923,7 +5918,7 @@ function Yi(e, r) {
|
|
|
5923
5918
|
lr(w, $e.Last, { skipElements: [b.relatedTarget, s] });
|
|
5924
5919
|
} });
|
|
5925
5920
|
});
|
|
5926
|
-
}), v = Kr(), C =
|
|
5921
|
+
}), v = Kr(), C = P(!1), x = { ref: t, onKeyDown(b) {
|
|
5927
5922
|
b.key == "Tab" && (C.current = !0, v.requestAnimationFrame(() => {
|
|
5928
5923
|
C.current = !1;
|
|
5929
5924
|
}));
|
|
@@ -5939,7 +5934,7 @@ function Yi(e, r) {
|
|
|
5939
5934
|
}
|
|
5940
5935
|
let Zi = ce(Yi), qi = Object.assign(Zi, { features: Le });
|
|
5941
5936
|
function Ki(e = !0) {
|
|
5942
|
-
let r =
|
|
5937
|
+
let r = P(Ae.slice());
|
|
5943
5938
|
return Xr(([n], [t]) => {
|
|
5944
5939
|
t === !0 && n === !1 && jr(() => {
|
|
5945
5940
|
r.current.splice(0);
|
|
@@ -5958,7 +5953,7 @@ function Ji({ ownerDocument: e }, r) {
|
|
|
5958
5953
|
});
|
|
5959
5954
|
}
|
|
5960
5955
|
function Xi({ ownerDocument: e, container: r, initialFocus: n, initialFocusFallback: t }, o) {
|
|
5961
|
-
let s = !!(o & 2), a =
|
|
5956
|
+
let s = !!(o & 2), a = P(null), d = ur();
|
|
5962
5957
|
return Xr(() => {
|
|
5963
5958
|
if (!s) {
|
|
5964
5959
|
t != null && t.current && Te(t.current);
|
|
@@ -6020,7 +6015,7 @@ let ta = { 0(e, r) {
|
|
|
6020
6015
|
} }, kr = le(null);
|
|
6021
6016
|
kr.displayName = "DialogContext";
|
|
6022
6017
|
function tt(e) {
|
|
6023
|
-
let r =
|
|
6018
|
+
let r = Q(kr);
|
|
6024
6019
|
if (r === null) {
|
|
6025
6020
|
let n = new Error(`<${e} /> is missing a parent <Dialog /> component.`);
|
|
6026
6021
|
throw Error.captureStackTrace && Error.captureStackTrace(n, tt), n;
|
|
@@ -6032,13 +6027,13 @@ function na(e, r) {
|
|
|
6032
6027
|
}
|
|
6033
6028
|
let oa = "div", sa = xr.RenderStrategy | xr.Static;
|
|
6034
6029
|
function ia(e, r) {
|
|
6035
|
-
let n = yr(), { id: t = `headlessui-dialog-${n}`, open: o, onClose: s, initialFocus: a, role: d = "dialog", autoFocus: c = !0, __demoMode: f = !1, ...u } = e, [p, g] = me(0), v =
|
|
6030
|
+
let n = yr(), { id: t = `headlessui-dialog-${n}`, open: o, onClose: s, initialFocus: a, role: d = "dialog", autoFocus: c = !0, __demoMode: f = !1, ...u } = e, [p, g] = me(0), v = P(!1);
|
|
6036
6031
|
d = function() {
|
|
6037
6032
|
return d === "dialog" || d === "alertdialog" ? d : (v.current || (v.current = !0, console.warn(`Invalid role [${d}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)), "dialog");
|
|
6038
6033
|
}();
|
|
6039
6034
|
let C = et();
|
|
6040
|
-
o === void 0 && C !== null && (o = (C &
|
|
6041
|
-
let x =
|
|
6035
|
+
o === void 0 && C !== null && (o = (C & te.Open) === te.Open);
|
|
6036
|
+
let x = P(null), b = xe(x, r), w = dr(x), y = e.hasOwnProperty("open") || C !== null, ue = e.hasOwnProperty("onClose");
|
|
6042
6037
|
if (!y && !ue)
|
|
6043
6038
|
throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");
|
|
6044
6039
|
if (!y)
|
|
@@ -6049,10 +6044,10 @@ function ia(e, r) {
|
|
|
6049
6044
|
throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${o}`);
|
|
6050
6045
|
if (typeof s != "function")
|
|
6051
6046
|
throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${s}`);
|
|
6052
|
-
let
|
|
6047
|
+
let R = o ? 0 : 1, [U, we] = Gn(na, { titleId: null, descriptionId: null, panelRef: Yn() }), q = A(() => s(!1)), G = A((O) => we({ type: 0, id: O })), K = cr() ? R === 0 : !1, ee = p > 1, se = Q(kr) !== null, [$, F] = Wi(), I = { get current() {
|
|
6053
6048
|
var O;
|
|
6054
6049
|
return (O = U.panelRef.current) != null ? O : x.current;
|
|
6055
|
-
} }, { resolveContainers: z, mainTreeNodeRef: fe, MainTreeNode: ve } = Hi({ portals: $, defaultContainers: [I] }), pe =
|
|
6050
|
+
} }, { resolveContainers: z, mainTreeNodeRef: fe, MainTreeNode: ve } = Hi({ portals: $, defaultContainers: [I] }), pe = ee ? "parent" : "leaf", H = C !== null ? (C & te.Closing) === te.Closing : !1, ke = ee || H ? !1 : K;
|
|
6056
6051
|
li({ allowed: A(() => {
|
|
6057
6052
|
var O, be;
|
|
6058
6053
|
return [(be = (O = x.current) == null ? void 0 : O.closest("[data-headlessui-portal]")) != null ? be : null];
|
|
@@ -6061,15 +6056,15 @@ function ia(e, r) {
|
|
|
6061
6056
|
return [(be = (O = fe.current) == null ? void 0 : O.closest("body > *:not(#headlessui-portal-root)")) != null ? be : null];
|
|
6062
6057
|
}) }, f ? !1 : ke), xi(z, (O) => {
|
|
6063
6058
|
O.preventDefault(), q();
|
|
6064
|
-
}, !(!K ||
|
|
6065
|
-
let J = !(
|
|
6059
|
+
}, !(!K || ee));
|
|
6060
|
+
let J = !(ee || R !== 0);
|
|
6066
6061
|
on(w == null ? void 0 : w.defaultView, "keydown", (O) => {
|
|
6067
6062
|
J && (O.defaultPrevented || O.key === Qt.Escape && (O.preventDefault(), O.stopPropagation(), q()));
|
|
6068
|
-
}), Ti(w, f ? !1 : !(H ||
|
|
6069
|
-
let [
|
|
6070
|
-
return c && (ye |= Le.AutoFocus), Je || (ye &= ~Le.InitialFocus), f && (ye = Le.None), j.createElement(zi, { type: "Dialog", enabled:
|
|
6063
|
+
}), Ti(w, f ? !1 : !(H || R !== 0 || se), z), en(x, q, R === 0);
|
|
6064
|
+
let [re, Ke] = ri(), X = oe(() => [{ dialogState: R, close: q, setTitleId: G }, U], [R, U, q, G]), V = oe(() => ({ open: R === 0 }), [R]), D = { ref: b, id: t, role: d, tabIndex: -1, "aria-modal": R === 0 ? !0 : void 0, "aria-labelledby": U.titleId, "aria-describedby": re }, Je = !Di(), ye = K ? B(pe, { parent: Le.RestoreFocus, leaf: Le.All & ~Le.FocusLock }) : Le.None;
|
|
6065
|
+
return c && (ye |= Le.AutoFocus), Je || (ye &= ~Le.InitialFocus), f && (ye = Le.None), j.createElement(zi, { type: "Dialog", enabled: R === 0, element: x, onUpdate: A((O, be) => {
|
|
6071
6066
|
be === "Dialog" && B(O, { [Ur.Add]: () => g((Xe) => Xe + 1), [Ur.Remove]: () => g((Xe) => Xe - 1) });
|
|
6072
|
-
}) }, j.createElement(Mt, { force: !0 }, j.createElement(St, null, j.createElement(kr.Provider, { value: X }, j.createElement(St.Group, { target: x }, j.createElement(Mt, { force: !1 }, j.createElement(Ke, { slot: V, name: "Dialog.Description" }, j.createElement(F, null, j.createElement(qi, { initialFocus: a, initialFocusFallback: x, containers: z, features: ye }, j.createElement(ai, { value: q }, ge({ ourProps: D, theirProps: u, slot: V, defaultTag: oa, features: sa, visible:
|
|
6067
|
+
}) }, j.createElement(Mt, { force: !0 }, j.createElement(St, null, j.createElement(kr.Provider, { value: X }, j.createElement(St.Group, { target: x }, j.createElement(Mt, { force: !1 }, j.createElement(Ke, { slot: V, name: "Dialog.Description" }, j.createElement(F, null, j.createElement(qi, { initialFocus: a, initialFocusFallback: x, containers: z, features: ye }, j.createElement(ai, { value: q }, ge({ ourProps: D, theirProps: u, slot: V, defaultTag: oa, features: sa, visible: R === 0, name: "Dialog" })))))))))), j.createElement(Qs, null, j.createElement(ve, null)));
|
|
6073
6068
|
}
|
|
6074
6069
|
let aa = "div";
|
|
6075
6070
|
function la(e, r) {
|
|
@@ -6081,7 +6076,7 @@ function la(e, r) {
|
|
|
6081
6076
|
let da = "h2";
|
|
6082
6077
|
function ca(e, r) {
|
|
6083
6078
|
let n = yr(), { id: t = `headlessui-dialog-title-${n}`, ...o } = e, [{ dialogState: s, setTitleId: a }] = tt("Dialog.Title"), d = xe(r);
|
|
6084
|
-
|
|
6079
|
+
ne(() => (a(t), () => a(null)), [t, a]);
|
|
6085
6080
|
let c = oe(() => ({ open: s === 0 }), [s]);
|
|
6086
6081
|
return ge({ ourProps: { ref: d, id: t }, theirProps: o, slot: c, defaultTag: da, name: "Dialog.Title" });
|
|
6087
6082
|
}
|
|
@@ -6155,7 +6150,7 @@ function va(e, { inFlight: r, prepare: n }) {
|
|
|
6155
6150
|
e.style.transition = "none", n(), e.offsetHeight, e.style.transition = t;
|
|
6156
6151
|
}
|
|
6157
6152
|
function ba({ container: e, direction: r, classes: n, onStart: t, onStop: o }) {
|
|
6158
|
-
let s = ur(), a = Kr(), d =
|
|
6153
|
+
let s = ur(), a = Kr(), d = P(!1);
|
|
6159
6154
|
Z(() => {
|
|
6160
6155
|
if (r === "idle" || !s.current)
|
|
6161
6156
|
return;
|
|
@@ -6177,13 +6172,13 @@ let Er = le(null);
|
|
|
6177
6172
|
Er.displayName = "TransitionContext";
|
|
6178
6173
|
var Ca = ((e) => (e.Visible = "visible", e.Hidden = "hidden", e))(Ca || {});
|
|
6179
6174
|
function xa() {
|
|
6180
|
-
let e =
|
|
6175
|
+
let e = Q(Er);
|
|
6181
6176
|
if (e === null)
|
|
6182
6177
|
throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");
|
|
6183
6178
|
return e;
|
|
6184
6179
|
}
|
|
6185
6180
|
function wa() {
|
|
6186
|
-
let e =
|
|
6181
|
+
let e = Q(Lr);
|
|
6187
6182
|
if (e === null)
|
|
6188
6183
|
throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");
|
|
6189
6184
|
return e;
|
|
@@ -6194,7 +6189,7 @@ function $r(e) {
|
|
|
6194
6189
|
return "children" in e ? $r(e.children) : e.current.filter(({ el: r }) => r.current !== null).filter(({ state: r }) => r === "visible").length > 0;
|
|
6195
6190
|
}
|
|
6196
6191
|
function mn(e, r) {
|
|
6197
|
-
let n = Ce(e), t =
|
|
6192
|
+
let n = Ce(e), t = P([]), o = ur(), s = Kr(), a = A((v, C = Fe.Hidden) => {
|
|
6198
6193
|
let x = t.current.findIndex(({ el: b }) => b === v);
|
|
6199
6194
|
x !== -1 && (B(C, { [Fe.Unmount]() {
|
|
6200
6195
|
t.current.splice(x, 1);
|
|
@@ -6207,7 +6202,7 @@ function mn(e, r) {
|
|
|
6207
6202
|
}), d = A((v) => {
|
|
6208
6203
|
let C = t.current.find(({ el: x }) => x === v);
|
|
6209
6204
|
return C ? C.state !== "visible" && (C.state = "visible") : t.current.push({ el: v, state: "visible" }), () => a(v, Fe.Unmount);
|
|
6210
|
-
}), c =
|
|
6205
|
+
}), c = P([]), f = P(Promise.resolve()), u = P({ enter: [], leave: [], idle: [] }), p = A((v, C, x) => {
|
|
6211
6206
|
c.current.splice(0), r && (r.chains.current[C] = r.chains.current[C].filter(([b]) => b !== v)), r == null || r.chains.current[C].push([v, new Promise((b) => {
|
|
6212
6207
|
c.current.push(b);
|
|
6213
6208
|
})]), r == null || r.chains.current[C].push([v, new Promise((b) => {
|
|
@@ -6224,16 +6219,16 @@ function mn(e, r) {
|
|
|
6224
6219
|
let gn = ae, vn = xr.RenderStrategy;
|
|
6225
6220
|
function ka(e, r) {
|
|
6226
6221
|
var n, t, o;
|
|
6227
|
-
let { beforeEnter: s, afterEnter: a, beforeLeave: d, afterLeave: c, enter: f, enterFrom: u, enterTo: p, entered: g, leave: v, leaveFrom: C, leaveTo: x, ...b } = e, w =
|
|
6222
|
+
let { beforeEnter: s, afterEnter: a, beforeLeave: d, afterLeave: c, enter: f, enterFrom: u, enterTo: p, entered: g, leave: v, leaveFrom: C, leaveTo: x, ...b } = e, w = P(null), y = hn(e), ue = xe(...y ? [w, r] : r === null ? [] : [r]), R = (n = b.unmount) == null || n ? Fe.Unmount : Fe.Hidden, { show: U, appear: we, initial: q } = xa(), [G, K] = me(U ? "visible" : "hidden"), ee = wa(), { register: se, unregister: $ } = ee;
|
|
6228
6223
|
Z(() => se(w), [se, w]), Z(() => {
|
|
6229
|
-
if (
|
|
6224
|
+
if (R === Fe.Hidden && w.current) {
|
|
6230
6225
|
if (U && G !== "visible") {
|
|
6231
6226
|
K("visible");
|
|
6232
6227
|
return;
|
|
6233
6228
|
}
|
|
6234
6229
|
return B(G, { hidden: () => $(w), visible: () => se(w) });
|
|
6235
6230
|
}
|
|
6236
|
-
}, [G, w, se, $, U,
|
|
6231
|
+
}, [G, w, se, $, U, R]);
|
|
6237
6232
|
let F = Ce({ base: Ne(b.className), enter: Ne(f), enterFrom: Ne(u), enterTo: Ne(p), entered: Ne(g), leave: Ne(v), leaveFrom: Ne(C), leaveTo: Ne(x) }), I = Ce({ beforeEnter: s, afterEnter: a, beforeLeave: d, afterLeave: c }), z = cr();
|
|
6238
6233
|
Z(() => {
|
|
6239
6234
|
if (y && z && G === "visible" && w.current === null)
|
|
@@ -6241,38 +6236,38 @@ function ka(e, r) {
|
|
|
6241
6236
|
}, [w, G, z, y]);
|
|
6242
6237
|
let fe = q && !we, ve = we && U && q, pe = ve ? "enter" : !z || fe ? "idle" : U ? "enter" : "leave", H = ha(0), ke = A((X) => B(X, { enter: () => {
|
|
6243
6238
|
var V, D;
|
|
6244
|
-
H.addFlag(
|
|
6239
|
+
H.addFlag(te.Opening), (D = (V = I.current).beforeEnter) == null || D.call(V);
|
|
6245
6240
|
}, leave: () => {
|
|
6246
6241
|
var V, D;
|
|
6247
|
-
H.addFlag(
|
|
6242
|
+
H.addFlag(te.Closing), (D = (V = I.current).beforeLeave) == null || D.call(V);
|
|
6248
6243
|
}, idle: () => {
|
|
6249
6244
|
} })), he = A((X) => B(X, { enter: () => {
|
|
6250
6245
|
var V, D;
|
|
6251
|
-
H.removeFlag(
|
|
6246
|
+
H.removeFlag(te.Opening), (D = (V = I.current).afterEnter) == null || D.call(V);
|
|
6252
6247
|
}, leave: () => {
|
|
6253
6248
|
var V, D;
|
|
6254
|
-
H.removeFlag(
|
|
6249
|
+
H.removeFlag(te.Closing), (D = (V = I.current).afterLeave) == null || D.call(V);
|
|
6255
6250
|
}, idle: () => {
|
|
6256
|
-
} })), J =
|
|
6251
|
+
} })), J = P(!1), Se = mn(() => {
|
|
6257
6252
|
J.current || (K("hidden"), $(w));
|
|
6258
|
-
},
|
|
6253
|
+
}, ee);
|
|
6259
6254
|
ba({ container: w, classes: F, direction: pe, onStart: Ce((X) => {
|
|
6260
6255
|
J.current = !0, Se.onStart(w, X, ke);
|
|
6261
6256
|
}), onStop: Ce((X) => {
|
|
6262
6257
|
J.current = !1, Se.onStop(w, X, he), X === "leave" && !$r(Se) && (K("hidden"), $(w));
|
|
6263
6258
|
}) });
|
|
6264
|
-
let
|
|
6265
|
-
return ve ?
|
|
6259
|
+
let re = b, Ke = { ref: ue };
|
|
6260
|
+
return ve ? re = { ...re, className: ir(b.className, ...F.current.enter, ...F.current.enterFrom) } : J.current ? (re.className = ir(b.className, (t = w.current) == null ? void 0 : t.className), re.className === "" && delete re.className) : (re.className = ir(b.className, (o = w.current) == null ? void 0 : o.className, ...B(pe, { enter: [...F.current.enterTo, ...F.current.entered], leave: F.current.leaveTo, idle: [] })), re.className === "" && delete re.className), j.createElement(Lr.Provider, { value: Se }, j.createElement(Mi, { value: B(G, { visible: te.Open, hidden: te.Closed }) | H.flags }, ge({ ourProps: Ke, theirProps: re, defaultTag: gn, features: vn, visible: G === "visible", name: "Transition.Child" })));
|
|
6266
6261
|
}
|
|
6267
6262
|
function ya(e, r) {
|
|
6268
|
-
let { show: n, appear: t = !1, unmount: o = !0, ...s } = e, a =
|
|
6263
|
+
let { show: n, appear: t = !1, unmount: o = !0, ...s } = e, a = P(null), d = hn(e), c = xe(...d ? [a, r] : r === null ? [] : [r]);
|
|
6269
6264
|
cr();
|
|
6270
6265
|
let f = et();
|
|
6271
|
-
if (n === void 0 && f !== null && (n = (f &
|
|
6266
|
+
if (n === void 0 && f !== null && (n = (f & te.Open) === te.Open), n === void 0)
|
|
6272
6267
|
throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");
|
|
6273
6268
|
let [u, p] = me(n ? "visible" : "hidden"), g = mn(() => {
|
|
6274
6269
|
n || p("hidden");
|
|
6275
|
-
}), [v, C] = me(!0), x =
|
|
6270
|
+
}), [v, C] = me(!0), x = P([n]);
|
|
6276
6271
|
Z(() => {
|
|
6277
6272
|
v !== !1 && x.current[x.current.length - 1] !== n && (x.current.push(n), C(!1));
|
|
6278
6273
|
}, [x, n]);
|
|
@@ -6281,16 +6276,16 @@ function ya(e, r) {
|
|
|
6281
6276
|
n ? p("visible") : !$r(g) && a.current !== null && p("hidden");
|
|
6282
6277
|
}, [n, g]);
|
|
6283
6278
|
let w = { unmount: o }, y = A(() => {
|
|
6284
|
-
var
|
|
6285
|
-
v && C(!1), (
|
|
6279
|
+
var R;
|
|
6280
|
+
v && C(!1), (R = e.beforeEnter) == null || R.call(e);
|
|
6286
6281
|
}), ue = A(() => {
|
|
6287
|
-
var
|
|
6288
|
-
v && C(!1), (
|
|
6282
|
+
var R;
|
|
6283
|
+
v && C(!1), (R = e.beforeLeave) == null || R.call(e);
|
|
6289
6284
|
});
|
|
6290
6285
|
return j.createElement(Lr.Provider, { value: g }, j.createElement(Er.Provider, { value: b }, ge({ ourProps: { ...w, as: ae, children: j.createElement(bn, { ref: c, ...w, ...s, beforeEnter: y, beforeLeave: ue }) }, theirProps: {}, defaultTag: ae, features: vn, visible: u === "visible", name: "Transition" })));
|
|
6291
6286
|
}
|
|
6292
6287
|
function ja(e, r) {
|
|
6293
|
-
let n =
|
|
6288
|
+
let n = Q(Er) !== null, t = et() !== null;
|
|
6294
6289
|
return j.createElement(j.Fragment, null, !n && t ? j.createElement(Gr, { ref: r, ...e }) : j.createElement(bn, { ref: r, ...e }));
|
|
6295
6290
|
}
|
|
6296
6291
|
let Gr = ce(ya), bn = ce(ka), Yr = ce(ja), Ea = Object.assign(Gr, { Child: Yr, Root: Gr });
|