laif-ds 0.1.58 → 0.1.60
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/_virtual/index.js +5 -2
- package/dist/_virtual/index3.js +2 -5
- package/dist/_virtual/index4.js +2 -5
- package/dist/_virtual/index5.js +5 -5
- package/dist/_virtual/index6.js +5 -2
- package/dist/_virtual/index7.js +5 -2
- package/dist/_virtual/index8.js +2 -5
- package/dist/components/ui/date-picker.js +44 -32
- package/dist/components/ui/gantt/components/Chart/Chart.js +1 -1
- package/dist/node_modules/@radix-ui/react-slot/dist/index.js +29 -29
- package/dist/node_modules/@radix-ui/react-use-is-hydrated/dist/index.js +1 -1
- package/dist/node_modules/cmdk/dist/index.js +2 -2
- package/dist/node_modules/cmdk/node_modules/@radix-ui/react-dialog/dist/index.js +259 -0
- package/dist/node_modules/cmdk/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +128 -0
- package/dist/node_modules/cmdk/node_modules/@radix-ui/react-focus-scope/dist/index.js +138 -0
- package/dist/node_modules/cmdk/node_modules/@radix-ui/react-portal/dist/index.js +17 -0
- package/dist/node_modules/cmdk/node_modules/@radix-ui/react-primitive/dist/index.js +37 -0
- package/dist/node_modules/cmdk/node_modules/@radix-ui/react-slot/dist/index.js +51 -0
- package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.js +1 -1
- package/dist/node_modules/react-is/index.js +1 -1
- package/dist/node_modules/recharts/es6/util/ReactUtils.js +1 -1
- package/dist/node_modules/style-to-object/cjs/index.js +1 -1
- package/dist/node_modules/unified/lib/index.js +1 -1
- package/dist/node_modules/use-sync-external-store/shim/index.js +1 -1
- package/dist/node_modules/vaul/dist/index.js +1 -1
- package/dist/node_modules/vaul/node_modules/@radix-ui/react-dialog/dist/index.js +262 -0
- package/dist/node_modules/vaul/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +128 -0
- package/dist/node_modules/vaul/node_modules/@radix-ui/react-focus-scope/dist/index.js +138 -0
- package/dist/node_modules/vaul/node_modules/@radix-ui/react-portal/dist/index.js +17 -0
- package/dist/node_modules/vaul/node_modules/@radix-ui/react-primitive/dist/index.js +37 -0
- package/dist/node_modules/vaul/node_modules/@radix-ui/react-slot/dist/index.js +51 -0
- package/package.json +28 -28
package/dist/_virtual/index.js
CHANGED
package/dist/_virtual/index3.js
CHANGED
package/dist/_virtual/index4.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
import { __require as e } from "../node_modules/style-to-js/cjs/index.js";
|
|
4
|
-
var t = e();
|
|
5
|
-
const a = /* @__PURE__ */ r(t);
|
|
2
|
+
var e = { exports: {} };
|
|
6
3
|
export {
|
|
7
|
-
|
|
4
|
+
e as __module
|
|
8
5
|
};
|
package/dist/_virtual/index5.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { getDefaultExportFromCjs as
|
|
3
|
-
import { __require as
|
|
4
|
-
var t =
|
|
5
|
-
const
|
|
2
|
+
import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
|
|
3
|
+
import { __require as e } from "../node_modules/style-to-js/cjs/index.js";
|
|
4
|
+
var t = e();
|
|
5
|
+
const a = /* @__PURE__ */ r(t);
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
a as default
|
|
8
8
|
};
|
package/dist/_virtual/index6.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
2
|
+
import { getDefaultExportFromCjs as e } from "./_commonjsHelpers.js";
|
|
3
|
+
import { __require as r } from "../node_modules/extend/index.js";
|
|
4
|
+
var t = r();
|
|
5
|
+
const x = /* @__PURE__ */ e(t);
|
|
3
6
|
export {
|
|
4
|
-
|
|
7
|
+
x as default
|
|
5
8
|
};
|
package/dist/_virtual/index7.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
2
|
+
import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
|
|
3
|
+
import { __require as e } from "../node_modules/classnames/index.js";
|
|
4
|
+
var s = e();
|
|
5
|
+
const o = /* @__PURE__ */ r(s);
|
|
3
6
|
export {
|
|
4
|
-
|
|
7
|
+
o as default
|
|
5
8
|
};
|
package/dist/_virtual/index8.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
import { __require as e } from "../node_modules/classnames/index.js";
|
|
4
|
-
var s = e();
|
|
5
|
-
const o = /* @__PURE__ */ r(s);
|
|
2
|
+
var e = {};
|
|
6
3
|
export {
|
|
7
|
-
|
|
4
|
+
e as __exports
|
|
8
5
|
};
|
|
@@ -1,53 +1,65 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import * as
|
|
2
|
+
import { jsxs as c, jsx as e } from "react/jsx-runtime";
|
|
3
|
+
import * as d from "react";
|
|
4
4
|
import { cn as g } from "../../lib/utils.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
import { buttonVariants as x } from "./button.js";
|
|
6
|
+
import { Icon as h } from "./icon.js";
|
|
7
|
+
import { Calendar as v } from "./calendar.js";
|
|
8
|
+
import { Popover as w, PopoverTrigger as P, PopoverContent as b } from "./popover.js";
|
|
9
|
+
import { formatDate as C } from "../../node_modules/date-fns/format.js";
|
|
10
|
+
function E({
|
|
11
|
+
value: n,
|
|
11
12
|
onChange: a,
|
|
12
|
-
placeholder:
|
|
13
|
-
dateFormat:
|
|
13
|
+
placeholder: l = "Seleziona data",
|
|
14
|
+
dateFormat: m = "PPP",
|
|
14
15
|
className: f,
|
|
15
|
-
buttonVariant:
|
|
16
|
+
buttonVariant: u = "default",
|
|
16
17
|
disabled: t = !1,
|
|
17
|
-
size:
|
|
18
|
+
size: r = "default"
|
|
18
19
|
}) {
|
|
19
|
-
const [o,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}, [
|
|
23
|
-
const
|
|
24
|
-
|
|
20
|
+
const [o, i] = d.useState(n);
|
|
21
|
+
d.useEffect(() => {
|
|
22
|
+
i(n);
|
|
23
|
+
}, [n]);
|
|
24
|
+
const p = (s) => {
|
|
25
|
+
i(s), a && a(s);
|
|
25
26
|
};
|
|
26
|
-
return /* @__PURE__ */
|
|
27
|
-
/* @__PURE__ */ e(
|
|
28
|
-
|
|
27
|
+
return /* @__PURE__ */ c(w, { open: t ? !1 : void 0, children: [
|
|
28
|
+
/* @__PURE__ */ e(P, { asChild: !0, children: /* @__PURE__ */ e(
|
|
29
|
+
"div",
|
|
29
30
|
{
|
|
30
|
-
variant: m,
|
|
31
|
-
size: n,
|
|
32
31
|
className: g(
|
|
33
|
-
|
|
32
|
+
x({ variant: u, size: r }),
|
|
33
|
+
"border-d-input text-d-foreground hover:bg-d-accent bg-d-transparent ring-offset-background data-[placeholder]:text-d-muted-foreground focus:ring-ring flex items-center justify-between border px-3 py-2 font-normal whitespace-nowrap shadow-sm focus:ring-1 focus:outline-none [&>span]:line-clamp-1",
|
|
34
34
|
!o && "text-d-muted-foreground",
|
|
35
35
|
t && "cursor-not-allowed opacity-50",
|
|
36
36
|
f,
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
r === "sm" && "text-xs",
|
|
38
|
+
r === "lg" && "text-lg"
|
|
39
39
|
),
|
|
40
|
-
disabled: t,
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
"aria-disabled": t,
|
|
41
|
+
role: "button",
|
|
42
|
+
tabIndex: t ? -1 : 0,
|
|
43
|
+
onClick: t ? void 0 : () => {
|
|
44
|
+
},
|
|
45
|
+
children: /* @__PURE__ */ c("div", { className: "flex w-full items-center justify-between gap-2", children: [
|
|
46
|
+
/* @__PURE__ */ e(
|
|
47
|
+
h,
|
|
48
|
+
{
|
|
49
|
+
name: "Calendar",
|
|
50
|
+
size: r === "default" ? "md" : r === "sm" ? "xs" : "sm"
|
|
51
|
+
}
|
|
52
|
+
),
|
|
53
|
+
o ? /* @__PURE__ */ e("span", { children: C(o, m) }) : /* @__PURE__ */ e("span", { className: "text-d-muted-foreground", children: l })
|
|
54
|
+
] })
|
|
43
55
|
}
|
|
44
56
|
) }),
|
|
45
57
|
/* @__PURE__ */ e(b, { className: "w-auto p-0", children: /* @__PURE__ */ e(
|
|
46
|
-
|
|
58
|
+
v,
|
|
47
59
|
{
|
|
48
60
|
mode: "single",
|
|
49
61
|
selected: o,
|
|
50
|
-
onSelect:
|
|
62
|
+
onSelect: p,
|
|
51
63
|
initialFocus: !0,
|
|
52
64
|
disabled: t
|
|
53
65
|
}
|
|
@@ -55,5 +67,5 @@ function k({
|
|
|
55
67
|
] });
|
|
56
68
|
}
|
|
57
69
|
export {
|
|
58
|
-
|
|
70
|
+
E as DatePicker
|
|
59
71
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as o, jsxs as M, Fragment as N } from "react/jsx-runtime";
|
|
3
3
|
import { useContext as R, useRef as a, useState as s, useCallback as k, useMemo as y, useEffect as u } from "react";
|
|
4
|
-
import A from "../../../../../_virtual/
|
|
4
|
+
import A from "../../../../../_virtual/index7.js";
|
|
5
5
|
import B from "../../../../../_virtual/debounce.js";
|
|
6
6
|
import { GanttContext as F } from "../Gantt/GanttContext.js";
|
|
7
7
|
import { transformData as O } from "../../utils/transformData.js";
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import * as l from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { composeRefs as y } from "../../react-compose-refs/dist/index.js";
|
|
4
4
|
import { jsx as p, Fragment as S } from "react/jsx-runtime";
|
|
5
5
|
// @__NO_SIDE_EFFECTS__
|
|
6
6
|
function g(e) {
|
|
7
|
-
const t = /* @__PURE__ */ E(e),
|
|
8
|
-
const { children: i, ...
|
|
9
|
-
if (
|
|
10
|
-
const f =
|
|
11
|
-
return /* @__PURE__ */ p(t, { ...
|
|
7
|
+
const t = /* @__PURE__ */ E(e), o = l.forwardRef((n, r) => {
|
|
8
|
+
const { children: i, ...a } = n, s = l.Children.toArray(i), c = s.find(C);
|
|
9
|
+
if (c) {
|
|
10
|
+
const f = c.props.children, m = s.map((u) => u === c ? l.Children.count(f) > 1 ? l.Children.only(null) : l.isValidElement(f) ? f.props.children : null : u);
|
|
11
|
+
return /* @__PURE__ */ p(t, { ...a, ref: r, children: l.isValidElement(f) ? l.cloneElement(f, void 0, m) : null });
|
|
12
12
|
}
|
|
13
|
-
return /* @__PURE__ */ p(t, { ...
|
|
13
|
+
return /* @__PURE__ */ p(t, { ...a, ref: r, children: i });
|
|
14
14
|
});
|
|
15
|
-
return
|
|
15
|
+
return o.displayName = `${e}.Slot`, o;
|
|
16
16
|
}
|
|
17
|
-
var
|
|
17
|
+
var x = /* @__PURE__ */ g("Slot");
|
|
18
18
|
// @__NO_SIDE_EFFECTS__
|
|
19
19
|
function E(e) {
|
|
20
|
-
const t = l.forwardRef((
|
|
21
|
-
const { children: r, ...i } =
|
|
20
|
+
const t = l.forwardRef((o, n) => {
|
|
21
|
+
const { children: r, ...i } = o;
|
|
22
22
|
if (l.isValidElement(r)) {
|
|
23
|
-
const s = R(i, r.props);
|
|
24
|
-
return r.type !== l.Fragment && (s.ref = a), l.cloneElement(r, s);
|
|
23
|
+
const a = b(r), s = R(i, r.props);
|
|
24
|
+
return r.type !== l.Fragment && (s.ref = n ? y(n, a) : a), l.cloneElement(r, s);
|
|
25
25
|
}
|
|
26
26
|
return l.Children.count(r) > 1 ? l.Children.only(null) : null;
|
|
27
27
|
});
|
|
@@ -29,32 +29,32 @@ function E(e) {
|
|
|
29
29
|
}
|
|
30
30
|
var d = Symbol("radix.slottable");
|
|
31
31
|
// @__NO_SIDE_EFFECTS__
|
|
32
|
-
function
|
|
33
|
-
const t = ({ children:
|
|
32
|
+
function I(e) {
|
|
33
|
+
const t = ({ children: o }) => /* @__PURE__ */ p(S, { children: o });
|
|
34
34
|
return t.displayName = `${e}.Slottable`, t.__radixId = d, t;
|
|
35
35
|
}
|
|
36
36
|
function C(e) {
|
|
37
37
|
return l.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === d;
|
|
38
38
|
}
|
|
39
39
|
function R(e, t) {
|
|
40
|
-
const
|
|
41
|
-
for (const
|
|
42
|
-
const r = e[
|
|
43
|
-
/^on[A-Z]/.test(
|
|
44
|
-
const
|
|
45
|
-
return r(...
|
|
46
|
-
} : r && (n
|
|
40
|
+
const o = { ...t };
|
|
41
|
+
for (const n in t) {
|
|
42
|
+
const r = e[n], i = t[n];
|
|
43
|
+
/^on[A-Z]/.test(n) ? r && i ? o[n] = (...s) => {
|
|
44
|
+
const c = i(...s);
|
|
45
|
+
return r(...s), c;
|
|
46
|
+
} : r && (o[n] = r) : n === "style" ? o[n] = { ...r, ...i } : n === "className" && (o[n] = [r, i].filter(Boolean).join(" "));
|
|
47
47
|
}
|
|
48
|
-
return { ...e, ...
|
|
48
|
+
return { ...e, ...o };
|
|
49
49
|
}
|
|
50
50
|
function b(e) {
|
|
51
|
-
var
|
|
52
|
-
let t = (
|
|
53
|
-
return
|
|
51
|
+
var n, r;
|
|
52
|
+
let t = (n = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : n.get, o = t && "isReactWarning" in t && t.isReactWarning;
|
|
53
|
+
return o ? e.ref : (t = (r = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : r.get, o = t && "isReactWarning" in t && t.isReactWarning, o ? e.props.ref : e.props.ref || e.ref);
|
|
54
54
|
}
|
|
55
55
|
export {
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
x as Root,
|
|
57
|
+
x as Slot,
|
|
58
58
|
g as createSlot,
|
|
59
|
-
|
|
59
|
+
I as createSlottable
|
|
60
60
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { a as pe } from "./chunk-NZJY6EH4.js";
|
|
3
|
-
import { Root as ge, Portal as he, Overlay as be, Content as Ee } from "
|
|
3
|
+
import { Root as ge, Portal as he, Overlay as be, Content as Ee } from "../node_modules/@radix-ui/react-dialog/dist/index.js";
|
|
4
4
|
import * as n from "react";
|
|
5
|
-
import { Primitive as I } from "
|
|
5
|
+
import { Primitive as I } from "../node_modules/@radix-ui/react-primitive/dist/index.js";
|
|
6
6
|
import { useId as K } from "../../@radix-ui/react-id/dist/index.js";
|
|
7
7
|
import { composeRefs as q } from "../../@radix-ui/react-compose-refs/dist/index.js";
|
|
8
8
|
var $ = '[cmdk-group=""]', X = '[cmdk-group-items=""]', ye = '[cmdk-group-heading=""]', oe = '[cmdk-item=""]', ie = `${oe}:not([aria-disabled="true"])`, Y = "cmdk-item-select", D = "data-value", Ce = (t, a, r) => pe(t, a, r), ce = n.createContext(void 0), O = () => n.useContext(ce), de = n.createContext(void 0), Z = () => n.useContext(de), se = n.createContext(void 0), fe = n.forwardRef((t, a) => {
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as s from "react";
|
|
3
|
+
import { composeEventHandlers as p } from "../../../../../@radix-ui/primitive/dist/index.js";
|
|
4
|
+
import { useComposedRefs as _ } from "../../../../../@radix-ui/react-compose-refs/dist/index.js";
|
|
5
|
+
import { createContextScope as $, createContext as B } from "../../../../../@radix-ui/react-context/dist/index.js";
|
|
6
|
+
import { useId as R } from "../../../../../@radix-ui/react-id/dist/index.js";
|
|
7
|
+
import { useControllableState as j } from "../../../../../@radix-ui/react-use-controllable-state/dist/index.js";
|
|
8
|
+
import { DismissableLayer as H } from "../../react-dismissable-layer/dist/index.js";
|
|
9
|
+
import { FocusScope as V } from "../../react-focus-scope/dist/index.js";
|
|
10
|
+
import { Portal as q } from "../../react-portal/dist/index.js";
|
|
11
|
+
import { Presence as h } from "../../../../../@radix-ui/react-presence/dist/index.js";
|
|
12
|
+
import { Primitive as m } from "../../react-primitive/dist/index.js";
|
|
13
|
+
import { useFocusGuards as K } from "../../../../../@radix-ui/react-focus-guards/dist/index.js";
|
|
14
|
+
import U from "../../../../../react-remove-scroll/dist/es2015/Combination.js";
|
|
15
|
+
import { hideOthers as Y } from "../../../../../aria-hidden/dist/es2015/index.js";
|
|
16
|
+
import { createSlot as Z } from "../../react-slot/dist/index.js";
|
|
17
|
+
import { jsx as i, jsxs as P, Fragment as O } from "react/jsx-runtime";
|
|
18
|
+
var v = "Dialog", [I, Ne] = $(v), [z, u] = I(v), x = (e) => {
|
|
19
|
+
const {
|
|
20
|
+
__scopeDialog: o,
|
|
21
|
+
children: n,
|
|
22
|
+
open: a,
|
|
23
|
+
defaultOpen: r,
|
|
24
|
+
onOpenChange: t,
|
|
25
|
+
modal: c = !0
|
|
26
|
+
} = e, l = s.useRef(null), d = s.useRef(null), [g, C] = j({
|
|
27
|
+
prop: a,
|
|
28
|
+
defaultProp: r ?? !1,
|
|
29
|
+
onChange: t,
|
|
30
|
+
caller: v
|
|
31
|
+
});
|
|
32
|
+
return /* @__PURE__ */ i(
|
|
33
|
+
z,
|
|
34
|
+
{
|
|
35
|
+
scope: o,
|
|
36
|
+
triggerRef: l,
|
|
37
|
+
contentRef: d,
|
|
38
|
+
contentId: R(),
|
|
39
|
+
titleId: R(),
|
|
40
|
+
descriptionId: R(),
|
|
41
|
+
open: g,
|
|
42
|
+
onOpenChange: C,
|
|
43
|
+
onOpenToggle: s.useCallback(() => C((L) => !L), [C]),
|
|
44
|
+
modal: c,
|
|
45
|
+
children: n
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
};
|
|
49
|
+
x.displayName = v;
|
|
50
|
+
var A = "DialogTrigger", J = s.forwardRef(
|
|
51
|
+
(e, o) => {
|
|
52
|
+
const { __scopeDialog: n, ...a } = e, r = u(A, n), t = _(o, r.triggerRef);
|
|
53
|
+
return /* @__PURE__ */ i(
|
|
54
|
+
m.button,
|
|
55
|
+
{
|
|
56
|
+
type: "button",
|
|
57
|
+
"aria-haspopup": "dialog",
|
|
58
|
+
"aria-expanded": r.open,
|
|
59
|
+
"aria-controls": r.contentId,
|
|
60
|
+
"data-state": N(r.open),
|
|
61
|
+
...a,
|
|
62
|
+
ref: t,
|
|
63
|
+
onClick: p(e.onClick, r.onOpenToggle)
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
J.displayName = A;
|
|
69
|
+
var E = "DialogPortal", [Q, b] = I(E, {
|
|
70
|
+
forceMount: void 0
|
|
71
|
+
}), T = (e) => {
|
|
72
|
+
const { __scopeDialog: o, forceMount: n, children: a, container: r } = e, t = u(E, o);
|
|
73
|
+
return /* @__PURE__ */ i(Q, { scope: o, forceMount: n, children: s.Children.map(a, (c) => /* @__PURE__ */ i(h, { present: n || t.open, children: /* @__PURE__ */ i(q, { asChild: !0, container: r, children: c }) })) });
|
|
74
|
+
};
|
|
75
|
+
T.displayName = E;
|
|
76
|
+
var D = "DialogOverlay", M = s.forwardRef(
|
|
77
|
+
(e, o) => {
|
|
78
|
+
const n = b(D, e.__scopeDialog), { forceMount: a = n.forceMount, ...r } = e, t = u(D, e.__scopeDialog);
|
|
79
|
+
return t.modal ? /* @__PURE__ */ i(h, { present: a || t.open, children: /* @__PURE__ */ i(ee, { ...r, ref: o }) }) : null;
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
M.displayName = D;
|
|
83
|
+
var X = Z("DialogOverlay.RemoveScroll"), ee = s.forwardRef(
|
|
84
|
+
(e, o) => {
|
|
85
|
+
const { __scopeDialog: n, ...a } = e, r = u(D, n);
|
|
86
|
+
return (
|
|
87
|
+
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
88
|
+
// ie. when `Overlay` and `Content` are siblings
|
|
89
|
+
/* @__PURE__ */ i(U, { as: X, allowPinchZoom: !0, shards: [r.contentRef], children: /* @__PURE__ */ i(
|
|
90
|
+
m.div,
|
|
91
|
+
{
|
|
92
|
+
"data-state": N(r.open),
|
|
93
|
+
...a,
|
|
94
|
+
ref: o,
|
|
95
|
+
style: { pointerEvents: "auto", ...a.style }
|
|
96
|
+
}
|
|
97
|
+
) })
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
), f = "DialogContent", w = s.forwardRef(
|
|
101
|
+
(e, o) => {
|
|
102
|
+
const n = b(f, e.__scopeDialog), { forceMount: a = n.forceMount, ...r } = e, t = u(f, e.__scopeDialog);
|
|
103
|
+
return /* @__PURE__ */ i(h, { present: a || t.open, children: t.modal ? /* @__PURE__ */ i(te, { ...r, ref: o }) : /* @__PURE__ */ i(oe, { ...r, ref: o }) });
|
|
104
|
+
}
|
|
105
|
+
);
|
|
106
|
+
w.displayName = f;
|
|
107
|
+
var te = s.forwardRef(
|
|
108
|
+
(e, o) => {
|
|
109
|
+
const n = u(f, e.__scopeDialog), a = s.useRef(null), r = _(o, n.contentRef, a);
|
|
110
|
+
return s.useEffect(() => {
|
|
111
|
+
const t = a.current;
|
|
112
|
+
if (t) return Y(t);
|
|
113
|
+
}, []), /* @__PURE__ */ i(
|
|
114
|
+
S,
|
|
115
|
+
{
|
|
116
|
+
...e,
|
|
117
|
+
ref: r,
|
|
118
|
+
trapFocus: n.open,
|
|
119
|
+
disableOutsidePointerEvents: !0,
|
|
120
|
+
onCloseAutoFocus: p(e.onCloseAutoFocus, (t) => {
|
|
121
|
+
var c;
|
|
122
|
+
t.preventDefault(), (c = n.triggerRef.current) == null || c.focus();
|
|
123
|
+
}),
|
|
124
|
+
onPointerDownOutside: p(e.onPointerDownOutside, (t) => {
|
|
125
|
+
const c = t.detail.originalEvent, l = c.button === 0 && c.ctrlKey === !0;
|
|
126
|
+
(c.button === 2 || l) && t.preventDefault();
|
|
127
|
+
}),
|
|
128
|
+
onFocusOutside: p(
|
|
129
|
+
e.onFocusOutside,
|
|
130
|
+
(t) => t.preventDefault()
|
|
131
|
+
)
|
|
132
|
+
}
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
), oe = s.forwardRef(
|
|
136
|
+
(e, o) => {
|
|
137
|
+
const n = u(f, e.__scopeDialog), a = s.useRef(!1), r = s.useRef(!1);
|
|
138
|
+
return /* @__PURE__ */ i(
|
|
139
|
+
S,
|
|
140
|
+
{
|
|
141
|
+
...e,
|
|
142
|
+
ref: o,
|
|
143
|
+
trapFocus: !1,
|
|
144
|
+
disableOutsidePointerEvents: !1,
|
|
145
|
+
onCloseAutoFocus: (t) => {
|
|
146
|
+
var c, l;
|
|
147
|
+
(c = e.onCloseAutoFocus) == null || c.call(e, t), t.defaultPrevented || (a.current || (l = n.triggerRef.current) == null || l.focus(), t.preventDefault()), a.current = !1, r.current = !1;
|
|
148
|
+
},
|
|
149
|
+
onInteractOutside: (t) => {
|
|
150
|
+
var d, g;
|
|
151
|
+
(d = e.onInteractOutside) == null || d.call(e, t), t.defaultPrevented || (a.current = !0, t.detail.originalEvent.type === "pointerdown" && (r.current = !0));
|
|
152
|
+
const c = t.target;
|
|
153
|
+
((g = n.triggerRef.current) == null ? void 0 : g.contains(c)) && t.preventDefault(), t.detail.originalEvent.type === "focusin" && r.current && t.preventDefault();
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
), S = s.forwardRef(
|
|
159
|
+
(e, o) => {
|
|
160
|
+
const { __scopeDialog: n, trapFocus: a, onOpenAutoFocus: r, onCloseAutoFocus: t, ...c } = e, l = u(f, n), d = s.useRef(null), g = _(o, d);
|
|
161
|
+
return K(), /* @__PURE__ */ P(O, { children: [
|
|
162
|
+
/* @__PURE__ */ i(
|
|
163
|
+
V,
|
|
164
|
+
{
|
|
165
|
+
asChild: !0,
|
|
166
|
+
loop: !0,
|
|
167
|
+
trapped: a,
|
|
168
|
+
onMountAutoFocus: r,
|
|
169
|
+
onUnmountAutoFocus: t,
|
|
170
|
+
children: /* @__PURE__ */ i(
|
|
171
|
+
H,
|
|
172
|
+
{
|
|
173
|
+
role: "dialog",
|
|
174
|
+
id: l.contentId,
|
|
175
|
+
"aria-describedby": l.descriptionId,
|
|
176
|
+
"aria-labelledby": l.titleId,
|
|
177
|
+
"data-state": N(l.open),
|
|
178
|
+
...c,
|
|
179
|
+
ref: g,
|
|
180
|
+
onDismiss: () => l.onOpenChange(!1)
|
|
181
|
+
}
|
|
182
|
+
)
|
|
183
|
+
}
|
|
184
|
+
),
|
|
185
|
+
/* @__PURE__ */ P(O, { children: [
|
|
186
|
+
/* @__PURE__ */ i(ie, { titleId: l.titleId }),
|
|
187
|
+
/* @__PURE__ */ i(ce, { contentRef: d, descriptionId: l.descriptionId })
|
|
188
|
+
] })
|
|
189
|
+
] });
|
|
190
|
+
}
|
|
191
|
+
), y = "DialogTitle", re = s.forwardRef(
|
|
192
|
+
(e, o) => {
|
|
193
|
+
const { __scopeDialog: n, ...a } = e, r = u(y, n);
|
|
194
|
+
return /* @__PURE__ */ i(m.h2, { id: r.titleId, ...a, ref: o });
|
|
195
|
+
}
|
|
196
|
+
);
|
|
197
|
+
re.displayName = y;
|
|
198
|
+
var F = "DialogDescription", ne = s.forwardRef(
|
|
199
|
+
(e, o) => {
|
|
200
|
+
const { __scopeDialog: n, ...a } = e, r = u(F, n);
|
|
201
|
+
return /* @__PURE__ */ i(m.p, { id: r.descriptionId, ...a, ref: o });
|
|
202
|
+
}
|
|
203
|
+
);
|
|
204
|
+
ne.displayName = F;
|
|
205
|
+
var W = "DialogClose", ae = s.forwardRef(
|
|
206
|
+
(e, o) => {
|
|
207
|
+
const { __scopeDialog: n, ...a } = e, r = u(W, n);
|
|
208
|
+
return /* @__PURE__ */ i(
|
|
209
|
+
m.button,
|
|
210
|
+
{
|
|
211
|
+
type: "button",
|
|
212
|
+
...a,
|
|
213
|
+
ref: o,
|
|
214
|
+
onClick: p(e.onClick, () => r.onOpenChange(!1))
|
|
215
|
+
}
|
|
216
|
+
);
|
|
217
|
+
}
|
|
218
|
+
);
|
|
219
|
+
ae.displayName = W;
|
|
220
|
+
function N(e) {
|
|
221
|
+
return e ? "open" : "closed";
|
|
222
|
+
}
|
|
223
|
+
var k = "DialogTitleWarning", [Pe, G] = B(k, {
|
|
224
|
+
contentName: f,
|
|
225
|
+
titleName: y,
|
|
226
|
+
docsSlug: "dialog"
|
|
227
|
+
}), ie = ({ titleId: e }) => {
|
|
228
|
+
const o = G(k), n = `\`${o.contentName}\` requires a \`${o.titleName}\` for the component to be accessible for screen reader users.
|
|
229
|
+
|
|
230
|
+
If you want to hide the \`${o.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
231
|
+
|
|
232
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${o.docsSlug}`;
|
|
233
|
+
return s.useEffect(() => {
|
|
234
|
+
e && (document.getElementById(e) || console.error(n));
|
|
235
|
+
}, [n, e]), null;
|
|
236
|
+
}, se = "DialogDescriptionWarning", ce = ({ contentRef: e, descriptionId: o }) => {
|
|
237
|
+
const a = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${G(se).contentName}}.`;
|
|
238
|
+
return s.useEffect(() => {
|
|
239
|
+
var t;
|
|
240
|
+
const r = (t = e.current) == null ? void 0 : t.getAttribute("aria-describedby");
|
|
241
|
+
o && r && (document.getElementById(o) || console.warn(a));
|
|
242
|
+
}, [a, e, o]), null;
|
|
243
|
+
}, Oe = x, Ie = T, xe = M, Ae = w;
|
|
244
|
+
export {
|
|
245
|
+
Ae as Content,
|
|
246
|
+
x as Dialog,
|
|
247
|
+
ae as DialogClose,
|
|
248
|
+
w as DialogContent,
|
|
249
|
+
ne as DialogDescription,
|
|
250
|
+
M as DialogOverlay,
|
|
251
|
+
T as DialogPortal,
|
|
252
|
+
re as DialogTitle,
|
|
253
|
+
J as DialogTrigger,
|
|
254
|
+
xe as Overlay,
|
|
255
|
+
Ie as Portal,
|
|
256
|
+
Oe as Root,
|
|
257
|
+
Pe as WarningProvider,
|
|
258
|
+
Ne as createDialogScope
|
|
259
|
+
};
|