@nxgt/material 3.6.0 → 3.7.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/CHANGELOG.md +20 -0
- package/README.md +46 -1
- package/dist/components/components.css +2 -0
- package/dist/components/theme-tokens.css +9 -4
- package/dist/components/ui/widgets/drawing/drawing-animate.css +123 -0
- package/dist/components/ui/widgets/drawing/drawing.css +459 -0
- package/dist/{components-BCYZgeoV.js → components-BX4icy-g.js} +733 -733
- package/dist/components.js +16 -16
- package/dist/{dialog-JQT6iETD.js → dialog-DdJ1C4BR.js} +168 -168
- package/dist/dnd.js +1 -1
- package/dist/draw-animate.js +106 -0
- package/dist/draw-png.js +2 -0
- package/dist/draw-sketch.js +38 -0
- package/dist/draw.js +65 -0
- package/dist/drawing-B8VuG7nx.js +390 -0
- package/dist/drawing-context-CeKeZE6b.js +10 -0
- package/dist/editor.js +110 -110
- package/dist/{icon-badge-C30yKsAM.js → icon-badge-Bb5-73XP.js} +18 -18
- package/dist/{icon-button-BXlI3DJ_.js → icon-button-5A6Mrj6w.js} +60 -90
- package/dist/lib/components/ui/display/shape/use-shape-morph.d.ts +1 -0
- package/dist/lib/components/ui/widgets/drawing/drawing-a11y.d.ts +20 -0
- package/dist/lib/components/ui/widgets/drawing/drawing-context.d.ts +23 -0
- package/dist/lib/components/ui/widgets/drawing/drawing-types.d.ts +63 -0
- package/dist/lib/components/ui/widgets/drawing/drawing.d.ts +17 -0
- package/dist/lib/components/ui/widgets/drawing/index.d.ts +5 -0
- package/dist/lib/components/ui/widgets/drawing/partials/drawing-root.d.ts +17 -0
- package/dist/lib/components/ui/widgets/drawing/partials/interactive-node.d.ts +22 -0
- package/dist/lib/components/ui/widgets/drawing/partials/primitives/content.d.ts +20 -0
- package/dist/lib/components/ui/widgets/drawing/partials/primitives/path.d.ts +29 -0
- package/dist/lib/components/ui/widgets/drawing/partials/primitives/primitive.d.ts +19 -0
- package/dist/lib/components/ui/widgets/drawing/partials/primitives/shapes.d.ts +18 -0
- package/dist/lib/components/ui/widgets/drawing/partials/react-attrs.d.ts +5 -0
- package/dist/lib/components/ui/widgets/drawing/partials/ring.d.ts +9 -0
- package/dist/lib/components/ui/widgets/drawing/partials/svg-tree.d.ts +29 -0
- package/dist/lib/components/ui/widgets/drawing/use-exact-text.d.ts +16 -0
- package/dist/lib/draw/index.d.ts +32 -0
- package/dist/lib/draw-animate/index.d.ts +19 -0
- package/dist/lib/draw-animate/morph-drawing.d.ts +32 -0
- package/dist/lib/draw-animate/reduced-motion.d.ts +2 -0
- package/dist/lib/draw-animate/use-drawing-controls.d.ts +27 -0
- package/dist/lib/draw-animate/use-scene-morph.d.ts +15 -0
- package/dist/lib/draw-png/index.d.ts +11 -0
- package/dist/lib/draw-sketch/index.d.ts +17 -0
- package/dist/lib/draw-sketch/sketch.d.ts +19 -0
- package/dist/lib/print/components/print-drawing.d.ts +16 -0
- package/dist/lib/print/index.d.ts +2 -1
- package/dist/main.js +21 -21
- package/dist/map.js +63 -63
- package/dist/material.css +1 -1
- package/dist/pdf-reader.js +1 -1
- package/dist/print.js +123 -115
- package/dist/{public-Cde8_SN8.js → public-CBlV2XuA.js} +742 -742
- package/dist/{sortable-provider-DYlpq8lP.js → sortable-provider-BvD98s8Y.js} +19 -19
- package/dist/{use-chat-composer-BwpSgP_D.js → use-chat-composer-BhdPNmYm.js} +912 -911
- package/dist/use-shape-morph-BKA_R5P5.js +35 -0
- package/docs/README.md +1 -0
- package/docs/components/rich-widgets.md +196 -0
- package/docs/guides/drawing.md +499 -0
- package/docs/guides/printing.md +47 -0
- package/docs/guides/theming.md +2 -2
- package/docs/previews/rich-widgets-drawing.webp +0 -0
- package/docs/roadmap.md +17 -0
- package/docs/troubleshooting.md +136 -1
- package/lib/components/components.css +2 -0
- package/lib/components/theme-tokens.css +9 -4
- package/lib/components/ui/widgets/drawing/drawing-animate.css +123 -0
- package/lib/components/ui/widgets/drawing/drawing.css +459 -0
- package/package.json +22 -2
|
@@ -1,127 +1,127 @@
|
|
|
1
1
|
import { t as e } from "./utils-Bcd2Z3ea.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { r as
|
|
7
|
-
import { X as
|
|
8
|
-
import * as
|
|
9
|
-
import { useCallback as
|
|
10
|
-
import { Fragment as
|
|
11
|
-
import { forwardEscape as
|
|
2
|
+
import { A as t, C as n, D as r, E as i, I as a, M as o, O as s, R as c, S as l, T as u, k as d, o as f, x as p } from "./tooltip-tmFoTU_d.js";
|
|
3
|
+
import { c as m, i as h, l as g, o as ee, r as _, s as te, t as ne } from "./in-dialog-AiwTD3DK.js";
|
|
4
|
+
import { t as v } from "./use-material-translation-hLQzOjF0.js";
|
|
5
|
+
import { n as re } from "./icon-button-5A6Mrj6w.js";
|
|
6
|
+
import { r as ie } from "./escape-owner-B8k7DvFa.js";
|
|
7
|
+
import { X as ae } from "lucide-react";
|
|
8
|
+
import * as y from "react";
|
|
9
|
+
import { useCallback as oe, useContext as se, useRef as b } from "react";
|
|
10
|
+
import { Fragment as ce, jsx as x, jsxs as le } from "react/jsx-runtime";
|
|
11
|
+
import { forwardEscape as ue, keepListEscape as de } from "@nxgt/material-core/escape-forward";
|
|
12
12
|
//#region ../../node_modules/@radix-ui/react-dialog/dist/index.mjs
|
|
13
|
-
var
|
|
13
|
+
var fe = Object.defineProperty, S = (e, t) => fe(e, "name", {
|
|
14
14
|
value: t,
|
|
15
15
|
configurable: !0
|
|
16
|
-
}),
|
|
17
|
-
let { __scopeDialog: t, children: n, open:
|
|
18
|
-
prop:
|
|
16
|
+
}), C = "Dialog", [w, pe] = t(C), [me, T] = w(C), E = /* @__PURE__ */ S((e) => {
|
|
17
|
+
let { __scopeDialog: t, children: n, open: i, defaultOpen: a, onOpenChange: o, modal: s = !0 } = e, c = y.useRef(null), l = y.useRef(null), [d, f] = r({
|
|
18
|
+
prop: i,
|
|
19
19
|
defaultProp: a ?? !1,
|
|
20
20
|
onChange: o,
|
|
21
|
-
caller:
|
|
22
|
-
}), [p, m] =
|
|
23
|
-
return /* @__PURE__ */
|
|
21
|
+
caller: C
|
|
22
|
+
}), [p, m] = y.useState(0), [h, g] = y.useState(0);
|
|
23
|
+
return /* @__PURE__ */ x(me, {
|
|
24
24
|
scope: t,
|
|
25
25
|
triggerRef: c,
|
|
26
26
|
contentRef: l,
|
|
27
|
-
contentId:
|
|
28
|
-
titleId:
|
|
29
|
-
descriptionId:
|
|
27
|
+
contentId: u(),
|
|
28
|
+
titleId: u(),
|
|
29
|
+
descriptionId: u(),
|
|
30
30
|
titlePresent: p > 0,
|
|
31
31
|
descriptionPresent: h > 0,
|
|
32
32
|
setTitleCount: m,
|
|
33
33
|
setDescriptionCount: g,
|
|
34
|
-
open:
|
|
34
|
+
open: d,
|
|
35
35
|
onOpenChange: f,
|
|
36
|
-
onOpenToggle:
|
|
36
|
+
onOpenToggle: y.useCallback(() => f((e) => !e), [f]),
|
|
37
37
|
modal: s,
|
|
38
38
|
children: n
|
|
39
39
|
});
|
|
40
|
-
}, "Dialog"),
|
|
41
|
-
let { __scopeDialog: n, ...r } = e, i =
|
|
42
|
-
return /* @__PURE__ */
|
|
40
|
+
}, "Dialog"), he = "DialogTrigger", D = /* @__PURE__ */ y.forwardRef(/* @__PURE__ */ S(function(e, t) {
|
|
41
|
+
let { __scopeDialog: n, ...r } = e, i = T(he, n), a = c(t, i.triggerRef);
|
|
42
|
+
return /* @__PURE__ */ x(o.button, {
|
|
43
43
|
type: "button",
|
|
44
44
|
"aria-haspopup": "dialog",
|
|
45
45
|
"aria-expanded": i.open,
|
|
46
46
|
"aria-controls": i.open ? i.contentId : void 0,
|
|
47
|
-
"data-state":
|
|
47
|
+
"data-state": z(i.open),
|
|
48
48
|
...r,
|
|
49
49
|
ref: a,
|
|
50
|
-
onClick:
|
|
50
|
+
onClick: d(e.onClick, i.onOpenToggle)
|
|
51
51
|
});
|
|
52
|
-
}, "DialogTrigger")),
|
|
53
|
-
let { __scopeDialog: t, forceMount: n, children: r, container:
|
|
54
|
-
return /* @__PURE__ */
|
|
52
|
+
}, "DialogTrigger")), O = "DialogPortal", [ge, k] = w(O, { forceMount: void 0 }), A = /* @__PURE__ */ S((e) => {
|
|
53
|
+
let { __scopeDialog: t, forceMount: n, children: r, container: a } = e, o = T(O, t);
|
|
54
|
+
return /* @__PURE__ */ x(ge, {
|
|
55
55
|
scope: t,
|
|
56
56
|
forceMount: n,
|
|
57
|
-
children:
|
|
57
|
+
children: y.Children.map(r, (e) => /* @__PURE__ */ x(i, {
|
|
58
58
|
present: n || o.open,
|
|
59
|
-
children: /* @__PURE__ */
|
|
59
|
+
children: /* @__PURE__ */ x(p, {
|
|
60
60
|
asChild: !0,
|
|
61
|
-
container:
|
|
61
|
+
container: a,
|
|
62
62
|
children: e
|
|
63
63
|
})
|
|
64
64
|
}))
|
|
65
65
|
});
|
|
66
|
-
}, "DialogPortal"),
|
|
67
|
-
let n =
|
|
68
|
-
return o.modal ? /* @__PURE__ */
|
|
66
|
+
}, "DialogPortal"), j = "DialogOverlay", M = /* @__PURE__ */ y.forwardRef(/* @__PURE__ */ S(function(e, t) {
|
|
67
|
+
let n = k(j, e.__scopeDialog), { forceMount: r = n.forceMount, ...a } = e, o = T(j, e.__scopeDialog);
|
|
68
|
+
return o.modal ? /* @__PURE__ */ x(i, {
|
|
69
69
|
present: r || o.open,
|
|
70
|
-
children: /* @__PURE__ */
|
|
71
|
-
...
|
|
70
|
+
children: /* @__PURE__ */ x(ve, {
|
|
71
|
+
...a,
|
|
72
72
|
ref: t
|
|
73
73
|
})
|
|
74
74
|
}) : null;
|
|
75
|
-
}, "DialogOverlay")),
|
|
76
|
-
let { __scopeDialog:
|
|
77
|
-
return /* @__PURE__ */
|
|
78
|
-
as:
|
|
75
|
+
}, "DialogOverlay")), _e = a("DialogOverlay.RemoveScroll"), ve = /* @__PURE__ */ y.forwardRef(/* @__PURE__ */ S(function(e, t) {
|
|
76
|
+
let { __scopeDialog: r, ...i } = e, a = T(j, r), s = c(t, n());
|
|
77
|
+
return /* @__PURE__ */ x(te, {
|
|
78
|
+
as: _e,
|
|
79
79
|
allowPinchZoom: !0,
|
|
80
80
|
shards: [a.contentRef],
|
|
81
|
-
children: /* @__PURE__ */
|
|
82
|
-
"data-state":
|
|
81
|
+
children: /* @__PURE__ */ x(o.div, {
|
|
82
|
+
"data-state": z(a.open),
|
|
83
83
|
...i,
|
|
84
|
-
ref:
|
|
84
|
+
ref: s,
|
|
85
85
|
style: {
|
|
86
86
|
pointerEvents: "auto",
|
|
87
87
|
...i.style
|
|
88
88
|
}
|
|
89
89
|
})
|
|
90
90
|
});
|
|
91
|
-
}, "DialogOverlayImpl")),
|
|
92
|
-
let n =
|
|
93
|
-
return /* @__PURE__ */
|
|
91
|
+
}, "DialogOverlayImpl")), N = "DialogContent", P = /* @__PURE__ */ y.forwardRef(/* @__PURE__ */ S(function(e, t) {
|
|
92
|
+
let n = k(N, e.__scopeDialog), { forceMount: r = n.forceMount, ...a } = e, o = T(N, e.__scopeDialog);
|
|
93
|
+
return /* @__PURE__ */ x(i, {
|
|
94
94
|
present: r || o.open,
|
|
95
|
-
children: o.modal ? /* @__PURE__ */
|
|
96
|
-
...
|
|
95
|
+
children: o.modal ? /* @__PURE__ */ x(ye, {
|
|
96
|
+
...a,
|
|
97
97
|
ref: t
|
|
98
|
-
}) : /* @__PURE__ */
|
|
99
|
-
...
|
|
98
|
+
}) : /* @__PURE__ */ x(be, {
|
|
99
|
+
...a,
|
|
100
100
|
ref: t
|
|
101
101
|
})
|
|
102
102
|
});
|
|
103
|
-
}, "DialogContent")),
|
|
104
|
-
let n =
|
|
105
|
-
return
|
|
103
|
+
}, "DialogContent")), ye = /* @__PURE__ */ y.forwardRef(/* @__PURE__ */ S(function(e, t) {
|
|
104
|
+
let n = T(N, e.__scopeDialog), r = y.useRef(null), i = c(t, n.contentRef, r);
|
|
105
|
+
return y.useEffect(() => {
|
|
106
106
|
let e = r.current;
|
|
107
|
-
if (e) return
|
|
108
|
-
}, []), /* @__PURE__ */
|
|
107
|
+
if (e) return ee(e);
|
|
108
|
+
}, []), /* @__PURE__ */ x(F, {
|
|
109
109
|
...e,
|
|
110
110
|
ref: i,
|
|
111
111
|
trapFocus: n.open,
|
|
112
112
|
disableOutsidePointerEvents: n.open,
|
|
113
|
-
onCloseAutoFocus:
|
|
113
|
+
onCloseAutoFocus: d(e.onCloseAutoFocus, (e) => {
|
|
114
114
|
e.preventDefault(), n.triggerRef.current?.focus();
|
|
115
115
|
}),
|
|
116
|
-
onPointerDownOutside:
|
|
116
|
+
onPointerDownOutside: d(e.onPointerDownOutside, (e) => {
|
|
117
117
|
let t = e.detail.originalEvent, n = t.button === 0 && t.ctrlKey === !0;
|
|
118
118
|
(t.button === 2 || n) && e.preventDefault();
|
|
119
119
|
}),
|
|
120
|
-
onFocusOutside:
|
|
120
|
+
onFocusOutside: d(e.onFocusOutside, (e) => e.preventDefault())
|
|
121
121
|
});
|
|
122
|
-
}, "DialogContentModal")),
|
|
123
|
-
let n =
|
|
124
|
-
return /* @__PURE__ */
|
|
122
|
+
}, "DialogContentModal")), be = /* @__PURE__ */ y.forwardRef(/* @__PURE__ */ S(function(e, t) {
|
|
123
|
+
let n = T(N, e.__scopeDialog), r = y.useRef(!1), i = y.useRef(!1);
|
|
124
|
+
return /* @__PURE__ */ x(F, {
|
|
125
125
|
...e,
|
|
126
126
|
ref: t,
|
|
127
127
|
trapFocus: !1,
|
|
@@ -135,69 +135,69 @@ var pe = Object.defineProperty, x = (e, t) => pe(e, "name", {
|
|
|
135
135
|
n.triggerRef.current?.contains(a) && t.preventDefault(), t.detail.originalEvent.type === "focusin" && i.current && t.preventDefault();
|
|
136
136
|
}
|
|
137
137
|
});
|
|
138
|
-
}, "DialogContentNonModal")),
|
|
139
|
-
let { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: i, onCloseAutoFocus: a, ...o } = e, s =
|
|
140
|
-
return
|
|
138
|
+
}, "DialogContentNonModal")), F = /* @__PURE__ */ y.forwardRef(/* @__PURE__ */ S(function(e, t) {
|
|
139
|
+
let { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: i, onCloseAutoFocus: a, ...o } = e, s = T(N, n);
|
|
140
|
+
return m(), /* @__PURE__ */ x(ce, { children: /* @__PURE__ */ x(g, {
|
|
141
141
|
asChild: !0,
|
|
142
142
|
loop: !0,
|
|
143
143
|
trapped: r,
|
|
144
144
|
onMountAutoFocus: i,
|
|
145
145
|
onUnmountAutoFocus: a,
|
|
146
|
-
children: /* @__PURE__ */
|
|
146
|
+
children: /* @__PURE__ */ x(l, {
|
|
147
147
|
role: "dialog",
|
|
148
148
|
id: s.contentId,
|
|
149
149
|
"aria-describedby": s.descriptionPresent ? s.descriptionId : void 0,
|
|
150
150
|
"aria-labelledby": s.titlePresent ? s.titleId : void 0,
|
|
151
|
-
"data-state":
|
|
151
|
+
"data-state": z(s.open),
|
|
152
152
|
...o,
|
|
153
153
|
ref: t,
|
|
154
154
|
deferPointerDownOutside: !0,
|
|
155
155
|
onDismiss: () => s.onOpenChange(!1)
|
|
156
156
|
})
|
|
157
157
|
}) });
|
|
158
|
-
}, "DialogContentImpl")),
|
|
159
|
-
let { __scopeDialog: n, ...r } = e, i =
|
|
160
|
-
return
|
|
158
|
+
}, "DialogContentImpl")), xe = "DialogTitle", I = /* @__PURE__ */ y.forwardRef(/* @__PURE__ */ S(function(e, t) {
|
|
159
|
+
let { __scopeDialog: n, ...r } = e, i = T(xe, n), { setTitleCount: a } = i;
|
|
160
|
+
return s(() => (a((e) => e + 1), () => a((e) => e - 1)), [a]), /* @__PURE__ */ x(o.h2, {
|
|
161
161
|
id: i.titleId,
|
|
162
162
|
...r,
|
|
163
163
|
ref: t
|
|
164
164
|
});
|
|
165
|
-
}, "DialogTitle")),
|
|
166
|
-
let { __scopeDialog: n, ...r } = e, i =
|
|
167
|
-
return
|
|
165
|
+
}, "DialogTitle")), Se = "DialogDescription", L = /* @__PURE__ */ y.forwardRef(/* @__PURE__ */ S(function(e, t) {
|
|
166
|
+
let { __scopeDialog: n, ...r } = e, i = T(Se, n), { setDescriptionCount: a } = i;
|
|
167
|
+
return s(() => (a((e) => e + 1), () => a((e) => e - 1)), [a]), /* @__PURE__ */ x(o.p, {
|
|
168
168
|
id: i.descriptionId,
|
|
169
169
|
...r,
|
|
170
170
|
ref: t
|
|
171
171
|
});
|
|
172
|
-
}, "DialogDescription")),
|
|
173
|
-
let { __scopeDialog: n, ...r } = e, i =
|
|
174
|
-
return /* @__PURE__ */
|
|
172
|
+
}, "DialogDescription")), Ce = "DialogClose", R = /* @__PURE__ */ y.forwardRef(/* @__PURE__ */ S(function(e, t) {
|
|
173
|
+
let { __scopeDialog: n, ...r } = e, i = T(Ce, n);
|
|
174
|
+
return /* @__PURE__ */ x(o.button, {
|
|
175
175
|
type: "button",
|
|
176
176
|
...r,
|
|
177
177
|
ref: t,
|
|
178
|
-
onClick:
|
|
178
|
+
onClick: d(e.onClick, () => i.onOpenChange(!1))
|
|
179
179
|
});
|
|
180
180
|
}, "DialogClose"));
|
|
181
|
-
function
|
|
181
|
+
function z(e) {
|
|
182
182
|
return e ? "open" : "closed";
|
|
183
183
|
}
|
|
184
|
-
|
|
184
|
+
S(z, "getState");
|
|
185
185
|
//#endregion
|
|
186
186
|
//#region lib/components/ui/primitives/field-box/field-box.ts
|
|
187
|
-
var
|
|
188
|
-
function
|
|
187
|
+
var B = "nxgt-field-box", we = "nxgt-field-list", V = (e) => e ? "" : void 0;
|
|
188
|
+
function Te(e) {
|
|
189
189
|
return {
|
|
190
190
|
"data-size": e.size,
|
|
191
|
-
"data-filled":
|
|
192
|
-
"data-open":
|
|
191
|
+
"data-filled": V(e.filled),
|
|
192
|
+
"data-open": V(e.list?.open),
|
|
193
193
|
"data-list-side": e.list?.open ? e.list.side : void 0,
|
|
194
|
-
"data-focused":
|
|
195
|
-
"data-invalid":
|
|
196
|
-
"data-disabled":
|
|
197
|
-
"data-readonly":
|
|
194
|
+
"data-focused": V(e.focused),
|
|
195
|
+
"data-invalid": V(e.invalid),
|
|
196
|
+
"data-disabled": V(e.disabled),
|
|
197
|
+
"data-readonly": V(e.readOnly)
|
|
198
198
|
};
|
|
199
199
|
}
|
|
200
|
-
var
|
|
200
|
+
var Ee = /* @__PURE__ */ new Set([
|
|
201
201
|
"checkbox",
|
|
202
202
|
"radio",
|
|
203
203
|
"file",
|
|
@@ -209,48 +209,48 @@ var De = /* @__PURE__ */ new Set([
|
|
|
209
209
|
"reset",
|
|
210
210
|
"image"
|
|
211
211
|
]);
|
|
212
|
-
function
|
|
213
|
-
return e || (
|
|
212
|
+
function H(e, t = "text") {
|
|
213
|
+
return e || (Ee.has(t) ? void 0 : " ");
|
|
214
214
|
}
|
|
215
215
|
//#endregion
|
|
216
216
|
//#region lib/components/ui/overlays/dialog/use-escape-forward.ts
|
|
217
|
-
function
|
|
218
|
-
let n =
|
|
217
|
+
function De(e, t) {
|
|
218
|
+
let n = b(null);
|
|
219
219
|
return {
|
|
220
|
-
ref:
|
|
220
|
+
ref: c(n, t),
|
|
221
221
|
onEscapeKeyDown(t) {
|
|
222
|
-
|
|
222
|
+
de(t), ie(t, n.current), e?.(t), ue(n.current, t);
|
|
223
223
|
}
|
|
224
224
|
};
|
|
225
225
|
}
|
|
226
226
|
//#endregion
|
|
227
227
|
//#region lib/components/ui/overlays/dialog/use-overlay-order.ts
|
|
228
|
-
function
|
|
229
|
-
let t =
|
|
228
|
+
function Oe(e) {
|
|
229
|
+
let t = b(null);
|
|
230
230
|
return {
|
|
231
|
-
overlayRef:
|
|
231
|
+
overlayRef: oe((e) => {
|
|
232
232
|
let n = t.current;
|
|
233
233
|
!e || !n?.isConnected || n.parentNode === e.parentNode && n.compareDocumentPosition(e) & Node.DOCUMENT_POSITION_FOLLOWING && n.before(e);
|
|
234
234
|
}, []),
|
|
235
|
-
contentRef:
|
|
235
|
+
contentRef: c(t, e)
|
|
236
236
|
};
|
|
237
237
|
}
|
|
238
238
|
//#endregion
|
|
239
239
|
//#region lib/components/ui/overlays/dialog/use-modal-content.ts
|
|
240
|
-
function
|
|
241
|
-
let i =
|
|
240
|
+
function U({ ref: e, onEscapeKeyDown: t, ...n }, r) {
|
|
241
|
+
let i = se(_) ?? !0, a = De(t, h(r ?? i, e)), o = Oe(a.ref);
|
|
242
242
|
return {
|
|
243
243
|
ref: o.contentRef,
|
|
244
244
|
overlayRef: o.overlayRef,
|
|
245
245
|
onEscapeKeyDown: a.onEscapeKeyDown,
|
|
246
246
|
outside: {
|
|
247
|
-
onPointerDownOutside:
|
|
248
|
-
onFocusOutside:
|
|
249
|
-
onInteractOutside:
|
|
247
|
+
onPointerDownOutside: W(n.onPointerDownOutside),
|
|
248
|
+
onFocusOutside: W(n.onFocusOutside),
|
|
249
|
+
onInteractOutside: W(n.onInteractOutside)
|
|
250
250
|
}
|
|
251
251
|
};
|
|
252
252
|
}
|
|
253
|
-
function
|
|
253
|
+
function W(e) {
|
|
254
254
|
return (t) => {
|
|
255
255
|
e?.(t);
|
|
256
256
|
let n = t.target;
|
|
@@ -259,33 +259,33 @@ function U(e) {
|
|
|
259
259
|
}
|
|
260
260
|
//#endregion
|
|
261
261
|
//#region lib/components/ui/overlays/dialog/menu-trigger.ts
|
|
262
|
-
var
|
|
263
|
-
function
|
|
264
|
-
let t = null, n = e?.closest(
|
|
265
|
-
for (let e = 0; n && e <
|
|
262
|
+
var G = "[role=\"menu\"]", ke = 8;
|
|
263
|
+
function Ae(e) {
|
|
264
|
+
let t = null, n = e?.closest(G) ?? null;
|
|
265
|
+
for (let e = 0; n && e < ke; e++) {
|
|
266
266
|
let e = n.getAttribute("data-return-focus"), r = e ? n.ownerDocument.getElementById(e) : null;
|
|
267
267
|
if (r) return r;
|
|
268
268
|
let [i] = (n.getAttribute("aria-labelledby") ?? "").split(/\s+/), a = i ? n.ownerDocument.getElementById(i) : null;
|
|
269
269
|
if (!a) break;
|
|
270
|
-
t = a, n = a.closest(
|
|
270
|
+
t = a, n = a.closest(G);
|
|
271
271
|
}
|
|
272
272
|
return t;
|
|
273
273
|
}
|
|
274
274
|
//#endregion
|
|
275
275
|
//#region lib/components/ui/overlays/dialog/use-return-focus.ts
|
|
276
|
-
var
|
|
277
|
-
function
|
|
278
|
-
([...e.querySelectorAll(
|
|
276
|
+
var je = "button:not([disabled]), input:not([disabled]):not([type=\"hidden\"]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"]), [contenteditable=\"true\"]";
|
|
277
|
+
function Me(e) {
|
|
278
|
+
([...e.querySelectorAll(je)].find((e) => e.tabIndex >= 0 && e.getClientRects().length > 0) ?? e).focus({ preventScroll: !0 });
|
|
279
279
|
}
|
|
280
|
-
function
|
|
281
|
-
let n =
|
|
280
|
+
function K(e, { focusFallback: t = !1 } = {}) {
|
|
281
|
+
let n = b(null), r = b(null);
|
|
282
282
|
return {
|
|
283
283
|
onOpenAutoFocus(i) {
|
|
284
284
|
let a = document.activeElement;
|
|
285
|
-
n.current = a instanceof HTMLElement && a !== document.body ? a : null, r.current =
|
|
285
|
+
n.current = a instanceof HTMLElement && a !== document.body ? a : null, r.current = Ae(n.current), e.onOpenAutoFocus?.(i);
|
|
286
286
|
let o = i.target;
|
|
287
287
|
!t || i.defaultPrevented || !(o instanceof HTMLElement) || queueMicrotask(() => {
|
|
288
|
-
o.isConnected && !o.contains(document.activeElement) &&
|
|
288
|
+
o.isConnected && !o.contains(document.activeElement) && Me(o);
|
|
289
289
|
});
|
|
290
290
|
},
|
|
291
291
|
onCloseAutoFocus(t) {
|
|
@@ -299,49 +299,49 @@ function G(e, { focusFallback: t = !1 } = {}) {
|
|
|
299
299
|
}
|
|
300
300
|
//#endregion
|
|
301
301
|
//#region lib/components/ui/primitives/input/input-box.ts
|
|
302
|
-
var
|
|
302
|
+
var Ne = "selection:bg-primary selection:text-primary-foreground", q = [
|
|
303
303
|
"inline-flex gap-2 items-center h-11 max-h-full w-full min-w-0",
|
|
304
304
|
"px-2 py-1 text-base md:text-sm outline-none",
|
|
305
305
|
"placeholder:text-muted-foreground",
|
|
306
306
|
"file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-muted-foreground",
|
|
307
307
|
"disabled:pointer-events-none"
|
|
308
|
-
],
|
|
309
|
-
...
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
],
|
|
313
|
-
function
|
|
314
|
-
return /* @__PURE__ */
|
|
308
|
+
], J = [
|
|
309
|
+
...q,
|
|
310
|
+
Ne,
|
|
311
|
+
B
|
|
312
|
+
], Pe = [...q, B], Y = J;
|
|
313
|
+
function Fe({ className: t, type: n = "text", ...r }) {
|
|
314
|
+
return /* @__PURE__ */ x("input", {
|
|
315
315
|
type: n,
|
|
316
316
|
"data-slot": "input",
|
|
317
|
-
className: e(
|
|
317
|
+
className: e(Y, t),
|
|
318
318
|
"data-pw": r.name ?? "input",
|
|
319
319
|
...r,
|
|
320
|
-
placeholder:
|
|
320
|
+
placeholder: H(r.placeholder, n)
|
|
321
321
|
});
|
|
322
322
|
}
|
|
323
323
|
//#endregion
|
|
324
324
|
//#region lib/components/ui/overlays/dialog/dialog-outside.ts
|
|
325
|
-
function
|
|
325
|
+
function Ie(e) {
|
|
326
326
|
let t = e.target;
|
|
327
327
|
t instanceof Element && t.closest("[data-slot=\"combobox-content\"]") && e.preventDefault();
|
|
328
328
|
}
|
|
329
|
-
function
|
|
329
|
+
function X(e) {
|
|
330
330
|
return (t) => {
|
|
331
|
-
|
|
331
|
+
Ie(t), e?.(t);
|
|
332
332
|
};
|
|
333
333
|
}
|
|
334
|
-
function
|
|
334
|
+
function Z(e) {
|
|
335
335
|
return {
|
|
336
336
|
...e,
|
|
337
|
-
onPointerDownOutside:
|
|
338
|
-
onFocusOutside:
|
|
339
|
-
onInteractOutside:
|
|
337
|
+
onPointerDownOutside: X(e.onPointerDownOutside),
|
|
338
|
+
onFocusOutside: X(e.onFocusOutside),
|
|
339
|
+
onInteractOutside: X(e.onInteractOutside)
|
|
340
340
|
};
|
|
341
341
|
}
|
|
342
342
|
//#endregion
|
|
343
343
|
//#region lib/components/ui/overlays/dialog/dialog-variants.ts
|
|
344
|
-
var
|
|
344
|
+
var Le = f("nxgt-dialog fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 p-6 max-h-[calc(100dvh-2rem)] supports-[not(height:100dvh)]:max-h-[calc(100vh-2rem)] overflow-y-auto", {
|
|
345
345
|
variants: {
|
|
346
346
|
size: {
|
|
347
347
|
sm: "sm:max-w-sm",
|
|
@@ -363,29 +363,29 @@ var Re = p("nxgt-dialog fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(
|
|
|
363
363
|
});
|
|
364
364
|
//#endregion
|
|
365
365
|
//#region lib/components/ui/overlays/dialog/dialog-parts.tsx
|
|
366
|
-
function
|
|
367
|
-
return /* @__PURE__ */
|
|
366
|
+
function Re({ className: t, ...n }) {
|
|
367
|
+
return /* @__PURE__ */ x("div", {
|
|
368
368
|
"data-slot": "dialog-header",
|
|
369
369
|
className: e("flex flex-col gap-2 text-center sm:text-left", t),
|
|
370
370
|
...n
|
|
371
371
|
});
|
|
372
372
|
}
|
|
373
|
-
function
|
|
374
|
-
return /* @__PURE__ */
|
|
373
|
+
function ze({ className: t, ...n }) {
|
|
374
|
+
return /* @__PURE__ */ x("div", {
|
|
375
375
|
"data-slot": "dialog-footer",
|
|
376
376
|
className: e("flex flex-col-reverse gap-2 pt-2 max-sm:*:w-full sm:flex-row sm:justify-end", t),
|
|
377
377
|
...n
|
|
378
378
|
});
|
|
379
379
|
}
|
|
380
|
-
function
|
|
381
|
-
return /* @__PURE__ */
|
|
380
|
+
function Be({ className: t, ...n }) {
|
|
381
|
+
return /* @__PURE__ */ x(I, {
|
|
382
382
|
"data-slot": "dialog-title",
|
|
383
383
|
className: e("text-2xl/8 font-medium tracking-tight text-foreground", t),
|
|
384
384
|
...n
|
|
385
385
|
});
|
|
386
386
|
}
|
|
387
|
-
function
|
|
388
|
-
return /* @__PURE__ */
|
|
387
|
+
function Ve({ className: t, ...n }) {
|
|
388
|
+
return /* @__PURE__ */ x(L, {
|
|
389
389
|
"data-slot": "dialog-description",
|
|
390
390
|
className: e("text-muted-foreground text-sm/6", t),
|
|
391
391
|
...n
|
|
@@ -393,45 +393,45 @@ function He({ className: t, ...n }) {
|
|
|
393
393
|
}
|
|
394
394
|
//#endregion
|
|
395
395
|
//#region lib/components/ui/overlays/dialog/dialog.tsx
|
|
396
|
-
function
|
|
397
|
-
return /* @__PURE__ */
|
|
396
|
+
function He({ ...e }) {
|
|
397
|
+
return /* @__PURE__ */ x(_, {
|
|
398
398
|
value: e.modal ?? !0,
|
|
399
|
-
children: /* @__PURE__ */
|
|
399
|
+
children: /* @__PURE__ */ x(E, {
|
|
400
400
|
"data-slot": "dialog",
|
|
401
401
|
...e
|
|
402
402
|
})
|
|
403
403
|
});
|
|
404
404
|
}
|
|
405
405
|
function Ue({ asChild: e = !0, ...t }) {
|
|
406
|
-
return /* @__PURE__ */
|
|
406
|
+
return /* @__PURE__ */ x(D, {
|
|
407
407
|
"data-slot": "dialog-trigger",
|
|
408
408
|
...t,
|
|
409
409
|
asChild: e
|
|
410
410
|
});
|
|
411
411
|
}
|
|
412
412
|
function Q({ ...e }) {
|
|
413
|
-
return /* @__PURE__ */
|
|
413
|
+
return /* @__PURE__ */ x(A, {
|
|
414
414
|
"data-slot": "dialog-portal",
|
|
415
415
|
...e
|
|
416
416
|
});
|
|
417
417
|
}
|
|
418
|
-
function We({ className:
|
|
419
|
-
let { t:
|
|
420
|
-
return /* @__PURE__ */
|
|
421
|
-
"aria-label":
|
|
422
|
-
...
|
|
423
|
-
type:
|
|
424
|
-
className: e("absolute top-4 right-4",
|
|
425
|
-
variant:
|
|
426
|
-
color:
|
|
427
|
-
className:
|
|
418
|
+
function We({ className: t, color: n, children: r, type: i = "button", variant: a = "ghost", ...o }) {
|
|
419
|
+
let { t: s } = v();
|
|
420
|
+
return /* @__PURE__ */ x(R, {
|
|
421
|
+
"aria-label": r ? void 0 : s("material.buttons.close", "Close"),
|
|
422
|
+
...o,
|
|
423
|
+
type: i,
|
|
424
|
+
className: e("absolute top-4 right-4", re({
|
|
425
|
+
variant: a,
|
|
426
|
+
color: n,
|
|
427
|
+
className: t
|
|
428
428
|
})),
|
|
429
429
|
"data-slot": "dialog-close",
|
|
430
|
-
children:
|
|
430
|
+
children: r || /* @__PURE__ */ x(ae, { className: "size-4" })
|
|
431
431
|
});
|
|
432
432
|
}
|
|
433
433
|
function $({ className: t, scrim: n = "dim", ...r }) {
|
|
434
|
-
return /* @__PURE__ */
|
|
434
|
+
return /* @__PURE__ */ x(M, {
|
|
435
435
|
"data-slot": "dialog-overlay",
|
|
436
436
|
"data-scrim": n,
|
|
437
437
|
className: e("nxgt-scrim fixed inset-0 z-50", t),
|
|
@@ -439,29 +439,29 @@ function $({ className: t, scrim: n = "dim", ...r }) {
|
|
|
439
439
|
});
|
|
440
440
|
}
|
|
441
441
|
function Ge({ className: t, children: n, onInteractOutside: r, onPointerDownOutside: i, onFocusOutside: a, onOpenAutoFocus: o, onCloseAutoFocus: s, onEscapeKeyDown: c, size: l, mobilePresentation: u, scrim: d, container: f, ref: p, ...m }) {
|
|
442
|
-
let h =
|
|
442
|
+
let h = K({
|
|
443
443
|
onOpenAutoFocus: o,
|
|
444
444
|
onCloseAutoFocus: s
|
|
445
|
-
}), g =
|
|
445
|
+
}), g = U(Z({
|
|
446
446
|
ref: p,
|
|
447
447
|
onEscapeKeyDown: c,
|
|
448
448
|
onInteractOutside: r,
|
|
449
449
|
onPointerDownOutside: i,
|
|
450
450
|
onFocusOutside: a
|
|
451
451
|
}));
|
|
452
|
-
return /* @__PURE__ */
|
|
452
|
+
return /* @__PURE__ */ x(ne, {
|
|
453
453
|
value: !0,
|
|
454
|
-
children: /* @__PURE__ */
|
|
454
|
+
children: /* @__PURE__ */ le(Q, {
|
|
455
455
|
"data-slot": "dialog-portal",
|
|
456
456
|
container: f,
|
|
457
|
-
children: [/* @__PURE__ */
|
|
457
|
+
children: [/* @__PURE__ */ x($, {
|
|
458
458
|
ref: g.overlayRef,
|
|
459
459
|
scrim: d
|
|
460
|
-
}), /* @__PURE__ */
|
|
460
|
+
}), /* @__PURE__ */ x(P, {
|
|
461
461
|
ref: g.ref,
|
|
462
462
|
"data-slot": "dialog-content",
|
|
463
463
|
"data-presentation": u ?? void 0,
|
|
464
|
-
className: e(
|
|
464
|
+
className: e(Le({
|
|
465
465
|
size: l,
|
|
466
466
|
mobilePresentation: u
|
|
467
467
|
}), t),
|
|
@@ -476,4 +476,4 @@ function Ge({ className: t, children: n, onInteractOutside: r, onPointerDownOuts
|
|
|
476
476
|
});
|
|
477
477
|
}
|
|
478
478
|
//#endregion
|
|
479
|
-
export {
|
|
479
|
+
export { pe as A, R as C, A as D, M as E, I as O, E as S, L as T, U as _, Q as a, we as b, ze as c, Z as d, Fe as f, K as g, Pe as h, $ as i, D as k, Re as l, J as m, We as n, Ue as o, Y as p, Ge as r, Ve as s, He as t, Be as u, H as v, P as w, Te as x, B as y };
|
package/dist/dnd.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { t as e } from "./compose-refs-DZ0iIVF-.js";
|
|
2
|
-
import { _ as t, a as n, b as r, c as i, d as a, f as o, g as s, h as c, i as l, l as u, m as d, n as f, o as p, p as m, r as h, s as g, t as _, u as v } from "./sortable-provider-
|
|
2
|
+
import { _ as t, a as n, b as r, c as i, d as a, f as o, g as s, h as c, i as l, l as u, m as d, n as f, o as p, p as m, r as h, s as g, t as _, u as v } from "./sortable-provider-BvD98s8Y.js";
|
|
3
3
|
export { r as CSS, u as DndOverlay, i as DndProvider, g as DragHandle, p as Draggable, n as DraggableDroppable, l as Droppable, f as Sortable, _ as SortableProvider, o as arrayMove, c as closestCenter, e as composeRefs, m as horizontalListSortingStrategy, h as insertIds, s as pointerWithin, t as rectIntersection, v as useDndActiveId, a as useDndItem, d as verticalListSortingStrategy };
|