@nxgt/material 3.95.0 → 3.95.1
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 +8 -0
- package/dist/{calculator-DGxClOmW.js → calculator-BfIBMiFX.js} +2 -2
- package/dist/calculator-field.js +2 -2
- package/dist/calculator.js +1 -1
- package/dist/{components-5n6qa3vr.js → components-DXCfO95n.js} +4 -4
- package/dist/components.js +5 -5
- package/dist/{conversion-variant-BjIJep32.js → conversion-variant-Ciii9Rbh.js} +1 -1
- package/dist/{currency-field-DzLtJtDI.js → currency-field-DipsI0Bv.js} +1 -1
- package/dist/editor.js +2 -2
- package/dist/{financial-variant-CniddOSL.js → financial-variant-CTXTLbE_.js} +2 -2
- package/dist/lib/components/ui/fields/text-field/text-field-units.d.ts +4 -2
- package/dist/main.js +5 -5
- package/dist/map.js +1 -1
- package/dist/material.css +1 -1
- package/dist/{percent-field-CeDpzUTS.js → percent-field-Cjc_3pP0.js} +1 -1
- package/dist/{text-field-DxKSPY0T.js → text-field-DOndWDT5.js} +76 -61
- package/dist/{use-chat-composer-yTODkjut.js → use-chat-composer-DEd6GM2N.js} +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as e } from "./utils-BLfntITJ.js";
|
|
2
2
|
import { a as t, i as n, n as r } from "./field-blur-context-BLGgf_3z.js";
|
|
3
3
|
import { t as i } from "./use-material-translation-BW5HZMwt.js";
|
|
4
|
-
import { a, r as o } from "./currency-field-
|
|
4
|
+
import { a, r as o } from "./currency-field-DipsI0Bv.js";
|
|
5
5
|
import { useId as s } from "react";
|
|
6
6
|
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
7
7
|
import { LockIcon as u } from "lucide-react";
|
|
@@ -2,20 +2,21 @@ import { t as e } from "./utils-BLfntITJ.js";
|
|
|
2
2
|
import { a as t, i as n, n as r } from "./field-blur-context-BLGgf_3z.js";
|
|
3
3
|
import { t as i } from "./dist-DkQbkF9T.js";
|
|
4
4
|
import { t as a } from "./icon-button-BG438okX.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
5
|
+
import { t as o } from "./compose-refs-G4J4kaUA.js";
|
|
6
|
+
import { a as s, o as c, t as l } from "./input-CC2joTjB.js";
|
|
7
|
+
import { isValidElement as u, useEffect as d, useId as f, useMemo as p, useRef as m, useState as h } from "react";
|
|
8
|
+
import { jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
9
|
+
import { describedBy as v } from "@nxgt/material-core/described-by";
|
|
9
10
|
//#region lib/components/ui/primitives/input-group/input-group.tsx
|
|
10
|
-
function
|
|
11
|
-
return /* @__PURE__ */
|
|
11
|
+
function y({ className: t, ...n }) {
|
|
12
|
+
return /* @__PURE__ */ g("div", {
|
|
12
13
|
"data-slot": "input-group",
|
|
13
14
|
role: "group",
|
|
14
|
-
className: e(
|
|
15
|
+
className: e(c, "group/input-group relative flex w-full items-center outline-none", "h-11 max-h-full min-w-0 has-[>textarea]:h-auto", "has-[>[data-align=inline-start]]:[&>input]:ps-2", "has-[>[data-align=inline-end]]:[&>input]:pe-2", "has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3", "has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3", t),
|
|
15
16
|
...n
|
|
16
17
|
});
|
|
17
18
|
}
|
|
18
|
-
var
|
|
19
|
+
var b = i("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none [&>kbd]:rounded-field-inner [&>svg:not([class*='size-'])]:size-4", {
|
|
19
20
|
variants: { align: {
|
|
20
21
|
"inline-start": "order-first ps-3 has-[>button]:ps-[0.3rem] has-[>kbd]:ps-[0.4rem]",
|
|
21
22
|
"inline-end": "order-last pe-3 has-[>button]:pe-[0.3rem] has-[>kbd]:pe-[0.4rem]",
|
|
@@ -24,125 +25,139 @@ var v = i("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text
|
|
|
24
25
|
} },
|
|
25
26
|
defaultVariants: { align: "inline-start" }
|
|
26
27
|
});
|
|
27
|
-
function
|
|
28
|
-
return /* @__PURE__ */
|
|
28
|
+
function x({ className: t, align: n = "inline-start", ...r }) {
|
|
29
|
+
return /* @__PURE__ */ g("div", {
|
|
29
30
|
role: "group",
|
|
30
31
|
"data-slot": "input-group-addon",
|
|
31
32
|
"data-align": n,
|
|
32
|
-
className: e(
|
|
33
|
+
className: e(b({ align: n }), t),
|
|
33
34
|
onClick: (e) => {
|
|
34
35
|
e.target.closest("button") || e.currentTarget.parentElement?.querySelector("input")?.focus();
|
|
35
36
|
},
|
|
36
37
|
...r
|
|
37
38
|
});
|
|
38
39
|
}
|
|
39
|
-
function
|
|
40
|
-
return /* @__PURE__ */
|
|
40
|
+
function S({ className: t, type: n = "button", variant: r = "ghost", ...i }) {
|
|
41
|
+
return /* @__PURE__ */ g(a, {
|
|
41
42
|
type: n,
|
|
42
43
|
variant: r,
|
|
43
44
|
className: e("size-8", t),
|
|
44
45
|
...i
|
|
45
46
|
});
|
|
46
47
|
}
|
|
47
|
-
function
|
|
48
|
-
return /* @__PURE__ */
|
|
48
|
+
function C({ className: t, ...n }) {
|
|
49
|
+
return /* @__PURE__ */ g("span", {
|
|
49
50
|
className: e("flex items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4", t),
|
|
50
51
|
...n
|
|
51
52
|
});
|
|
52
53
|
}
|
|
53
|
-
function
|
|
54
|
-
return /* @__PURE__ */
|
|
54
|
+
function w({ className: t, type: n = "text", ...r }) {
|
|
55
|
+
return /* @__PURE__ */ g("input", {
|
|
55
56
|
type: n,
|
|
56
57
|
"data-slot": "input-group-control",
|
|
57
58
|
"data-pw": r.name ?? "input",
|
|
58
59
|
className: e("h-full w-full min-w-0 flex-1 bg-transparent px-2 py-1 text-base outline-none md:text-sm", "pointer-coarse:-my-px pointer-coarse:h-[calc(100%+2px)]", "placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground disabled:pointer-events-none", t),
|
|
59
60
|
...r,
|
|
60
|
-
placeholder:
|
|
61
|
+
placeholder: s(r.placeholder, n)
|
|
61
62
|
});
|
|
62
63
|
}
|
|
63
|
-
function
|
|
64
|
-
return /* @__PURE__ */
|
|
64
|
+
function T({ className: t, ...n }) {
|
|
65
|
+
return /* @__PURE__ */ g("textarea", {
|
|
65
66
|
"data-slot": "input-group-control",
|
|
66
67
|
"data-pw": n.name ?? "textarea",
|
|
67
68
|
className: e("field-sizing-content min-h-16 w-full min-w-[min(280px,100%)] flex-1 resize-none bg-transparent px-3 py-3 text-base outline-none md:text-sm", "placeholder:text-muted-foreground disabled:pointer-events-none", t),
|
|
68
69
|
...n,
|
|
69
|
-
placeholder:
|
|
70
|
+
placeholder: s(n.placeholder, "text")
|
|
70
71
|
});
|
|
71
72
|
}
|
|
72
73
|
//#endregion
|
|
73
74
|
//#region lib/components/ui/fields/text-field/text-field-units.tsx
|
|
74
|
-
function
|
|
75
|
+
function E(e, t, n) {
|
|
75
76
|
return e === "password" && t ? "•".repeat(t.length) : t || n || " ";
|
|
76
77
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
return e.addEventListener("reset", t), () => e.removeEventListener("reset", t);
|
|
84
|
-
}, [i]);
|
|
85
|
-
let c = i ? String(r.value ?? "") : a ?? String(r.defaultValue ?? ""), d = w(r.type, c, r.placeholder), g = !!n, v = (t, n) => n ? /* @__PURE__ */ m(y, {
|
|
78
|
+
var D = "button, a, input, select, textarea, label, [role=button], [role=menuitem]";
|
|
79
|
+
function O(e, t) {
|
|
80
|
+
e.defaultPrevented || e.target.closest(D) || t?.focus();
|
|
81
|
+
}
|
|
82
|
+
function k({ align: t, node: n }) {
|
|
83
|
+
return n ? /* @__PURE__ */ g(x, {
|
|
86
84
|
align: t,
|
|
87
85
|
"data-slot": t === "inline-start" ? "text-field-leading" : "text-field-trailing",
|
|
88
|
-
className: e("flex-none py-1 text-base md:text-sm font-normal whitespace-nowrap tabular-nums",
|
|
86
|
+
className: e("flex-none py-1 text-base md:text-sm font-normal whitespace-nowrap tabular-nums", u(n) && "[&>*]:size-8 pointer-coarse:[&>*]:size-11"),
|
|
89
87
|
children: n
|
|
90
88
|
}) : null;
|
|
91
|
-
|
|
89
|
+
}
|
|
90
|
+
function A({ leading: t, trailing: n, ref: r, ...i }) {
|
|
91
|
+
let a = i.value !== void 0, [s, c] = h(null), l = m(null), u = p(() => o(l, r), [r]);
|
|
92
|
+
d(() => {
|
|
93
|
+
let e = l.current?.form;
|
|
94
|
+
if (!e || a) return;
|
|
95
|
+
let t = () => c(null);
|
|
96
|
+
return e.addEventListener("reset", t), () => e.removeEventListener("reset", t);
|
|
97
|
+
}, [a]);
|
|
98
|
+
let f = a ? String(i.value ?? "") : s ?? String(i.defaultValue ?? ""), v = E(i.type, f, i.placeholder);
|
|
99
|
+
return /* @__PURE__ */ _(y, {
|
|
92
100
|
className: "gap-1",
|
|
101
|
+
onClick: (e) => O(e, l.current),
|
|
93
102
|
children: [
|
|
94
|
-
|
|
95
|
-
|
|
103
|
+
/* @__PURE__ */ g(k, {
|
|
104
|
+
align: "inline-start",
|
|
105
|
+
node: t
|
|
106
|
+
}),
|
|
107
|
+
/* @__PURE__ */ g("span", {
|
|
96
108
|
"data-slot": "text-field-value",
|
|
97
|
-
"data-value":
|
|
98
|
-
className: e("inline-grid h-full max-w-full min-w-4 items-center text-base md:text-sm", "after:invisible after:col-start-1 after:row-start-1 after:whitespace-pre after:content-[attr(data-value)]",
|
|
99
|
-
children: /* @__PURE__ */
|
|
100
|
-
...
|
|
101
|
-
ref:
|
|
109
|
+
"data-value": v,
|
|
110
|
+
className: e("inline-grid h-full max-w-full min-w-4 items-center text-base md:text-sm", "after:invisible after:col-start-1 after:row-start-1 after:whitespace-pre after:content-[attr(data-value)]", n ? "flex-none shrink" : "flex-1", t ? "pointer-coarse:min-w-11" : "ps-3 pointer-coarse:min-w-14", !n && "pe-3"),
|
|
111
|
+
children: /* @__PURE__ */ g(w, {
|
|
112
|
+
...i,
|
|
113
|
+
ref: u,
|
|
102
114
|
className: "col-start-1 row-start-1 w-0 min-w-full px-0 md:pb-1.5 [font:inherit] [font-variant-numeric:inherit] [letter-spacing:inherit]",
|
|
103
115
|
onChange: (e) => {
|
|
104
|
-
|
|
116
|
+
a || c(e.target.value), i.onChange?.(e);
|
|
105
117
|
}
|
|
106
118
|
})
|
|
107
119
|
}),
|
|
108
|
-
|
|
120
|
+
/* @__PURE__ */ g(k, {
|
|
121
|
+
align: "inline-end",
|
|
122
|
+
node: n
|
|
123
|
+
})
|
|
109
124
|
]
|
|
110
125
|
});
|
|
111
126
|
}
|
|
112
127
|
//#endregion
|
|
113
128
|
//#region lib/components/ui/fields/text-field/text-field.tsx
|
|
114
|
-
function
|
|
115
|
-
let
|
|
129
|
+
function j({ error: i, helperText: a, label: o, className: s, leading: c, trailing: d, ...p }) {
|
|
130
|
+
let m = r(), h = f(), y = f(), b = v(p["aria-describedby"], !!a && y), x = !!c && !u(c), S = !!d && !u(d), C = {
|
|
116
131
|
"aria-invalid": i,
|
|
117
132
|
...p,
|
|
118
|
-
id: p.id ??
|
|
133
|
+
id: p.id ?? h,
|
|
119
134
|
"aria-describedby": b
|
|
120
|
-
}, w = x || S ? /* @__PURE__ */
|
|
135
|
+
}, w = x || S ? /* @__PURE__ */ g(A, {
|
|
121
136
|
...C,
|
|
122
|
-
leading:
|
|
123
|
-
trailing:
|
|
124
|
-
}) : /* @__PURE__ */
|
|
137
|
+
leading: c,
|
|
138
|
+
trailing: d
|
|
139
|
+
}) : /* @__PURE__ */ _("div", {
|
|
125
140
|
className: e("relative", {
|
|
126
|
-
"*:first:size-8 *:first:absolute *:first:top-[calc(50%-16px)] *:first:left-1.5 [&_input]:pl-10 *:first:text-muted-foreground": !!
|
|
127
|
-
"*:last:size-8 *:last:absolute *:last:top-[calc(50%-16px)] *:last:right-1.5 *:last:pointer-coarse:size-11 *:last:pointer-coarse:top-[calc(50%-22px)] *:last:pointer-coarse:right-0 [&_input]:pr-.5 *:last:text-muted-foreground": !!
|
|
141
|
+
"*:first:size-8 *:first:absolute *:first:top-[calc(50%-16px)] *:first:left-1.5 [&_input]:pl-10 *:first:text-muted-foreground": !!c,
|
|
142
|
+
"*:last:size-8 *:last:absolute *:last:top-[calc(50%-16px)] *:last:right-1.5 *:last:pointer-coarse:size-11 *:last:pointer-coarse:top-[calc(50%-22px)] *:last:pointer-coarse:right-0 [&_input]:pr-.5 *:last:text-muted-foreground": !!d
|
|
128
143
|
}),
|
|
129
144
|
children: [
|
|
130
|
-
|
|
131
|
-
/* @__PURE__ */
|
|
132
|
-
|
|
145
|
+
c,
|
|
146
|
+
/* @__PURE__ */ g(l, { ...C }),
|
|
147
|
+
d
|
|
133
148
|
]
|
|
134
149
|
});
|
|
135
|
-
return /* @__PURE__ */
|
|
136
|
-
ref:
|
|
150
|
+
return /* @__PURE__ */ _("div", {
|
|
151
|
+
ref: m,
|
|
137
152
|
"data-slot": "text-field",
|
|
138
153
|
className: e("grid w-full content-start gap-1.5", s),
|
|
139
|
-
children: [/* @__PURE__ */
|
|
154
|
+
children: [/* @__PURE__ */ g(n, {
|
|
140
155
|
withAsterisk: p.required,
|
|
141
|
-
htmlFor: p.id ??
|
|
156
|
+
htmlFor: p.id ?? h,
|
|
142
157
|
children: o
|
|
143
|
-
}), /* @__PURE__ */
|
|
158
|
+
}), /* @__PURE__ */ _("div", {
|
|
144
159
|
className: "flex flex-col gap-0.5",
|
|
145
|
-
children: [w, a ? /* @__PURE__ */
|
|
160
|
+
children: [w, a ? /* @__PURE__ */ g(t, {
|
|
146
161
|
id: y,
|
|
147
162
|
error: i,
|
|
148
163
|
children: a
|
|
@@ -151,4 +166,4 @@ function E({ error: i, helperText: a, label: o, className: s, leading: u, traili
|
|
|
151
166
|
});
|
|
152
167
|
}
|
|
153
168
|
//#endregion
|
|
154
|
-
export {
|
|
169
|
+
export { w as a, S as i, y as n, C as o, x as r, T as s, j as t };
|
|
@@ -38,7 +38,7 @@ import { t as Ht } from "./browser-only-DQ94lWF8.js";
|
|
|
38
38
|
import { t as Ut } from "./compose-refs-G4J4kaUA.js";
|
|
39
39
|
import { n as Wt, r as Gt, t as Kt } from "./chip-Bb9SM3Ly.js";
|
|
40
40
|
import { c as qt, o as Jt, r as Yt, s as Xt, t as Zt } from "./input-CC2joTjB.js";
|
|
41
|
-
import { a as Qt, n as $t, r as en, t as tn } from "./text-field-
|
|
41
|
+
import { a as Qt, n as $t, r as en, t as tn } from "./text-field-DOndWDT5.js";
|
|
42
42
|
import { r as nn } from "./use-csp-nonce-ZKs9k-ov.js";
|
|
43
43
|
import { t as rn } from "./empty-state-n2zb23YG.js";
|
|
44
44
|
import { t as an } from "./skeleton-DSdtr2qc.js";
|