@dimasbaguspm/versaur 0.0.60 → 0.0.62
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/js/forms/index.js +1 -1
- package/dist/js/{image-rectangle-CCvXv24a.js → image-rectangle-BwT5taeR.js} +694 -634
- package/dist/js/index.js +63 -61
- package/dist/js/layouts/index.js +1 -1
- package/dist/js/navigation/index.js +1 -1
- package/dist/js/overlays/index.js +2 -2
- package/dist/js/primitive/index.js +27 -25
- package/dist/js/{tabs-BQs53hHL.js → tabs-FDdFo4WV.js} +1 -1
- package/dist/js/{time-picker-input-Disd231b.js → time-picker-input-DMNSwm-p.js} +854 -642
- package/dist/js/tooltip-BGJUYNL0.js +625 -0
- package/dist/js/{top-bar-DMBbEIlR.js → top-bar-ChNgZEQx.js} +157 -187
- package/dist/types/forms/textarea-input/index.d.ts +1 -1
- package/dist/types/forms/textarea-input/textarea-input.atoms.d.ts +53 -0
- package/dist/types/forms/textarea-input/textarea-input.d.ts +1 -0
- package/dist/types/forms/textarea-input/types.d.ts +28 -0
- package/dist/types/forms/textarea-input/use-textarea-formatting.d.ts +21 -0
- package/dist/types/overlays/drawer/drawer.atoms.d.ts +2 -7
- package/dist/types/overlays/drawer/drawer.d.ts +1 -1
- package/dist/types/overlays/drawer/types.d.ts +1 -11
- package/dist/types/overlays/modal/modal.atoms.d.ts +1 -5
- package/dist/types/overlays/modal/types.d.ts +1 -2
- package/dist/types/primitive/formatted-text/formatted-text.d.ts +10 -0
- package/dist/types/primitive/formatted-text/index.d.ts +3 -0
- package/dist/types/primitive/formatted-text/types.d.ts +19 -0
- package/dist/types/primitive/heading/types.d.ts +9 -12
- package/dist/types/primitive/index.d.ts +1 -0
- package/dist/types/primitive/text/text.d.ts +6 -3
- package/dist/types/primitive/text/types.d.ts +10 -18
- package/dist/types/primitive/tile/tile.d.ts +7 -1
- package/dist/types/primitive/tile/types.d.ts +6 -1
- package/dist/utils/enforce-subpath-import.js +2 -0
- package/package.json +2 -1
- package/dist/js/tooltip-Dpx3TpR6.js +0 -693
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import
|
|
3
|
-
import { c as
|
|
4
|
-
import { I as
|
|
5
|
-
import { Calendar as
|
|
1
|
+
import { j as t } from "./jsx-runtime-C5mzlN2N.js";
|
|
2
|
+
import p, { createContext as M, useContext as A, useId as T, forwardRef as $, useRef as G, useEffect as _, useState as K } from "react";
|
|
3
|
+
import { c as N, a as x } from "./index-BDtz_hQY.js";
|
|
4
|
+
import { I as P, l as xe, n as ye } from "./image-rectangle-BwT5taeR.js";
|
|
5
|
+
import { Calendar as we, MailIcon as ke, Banknote as ve, SearchIcon as je, ChevronDown as Ie, BoldIcon as Ce, ItalicIcon as Ne, UnderlineIcon as Se, StrikethroughIcon as Ve, Heading1Icon as Re, Heading2Icon as De, Heading3Icon as Le, ListOrderedIcon as Oe, ListIcon as ze, LinkIcon as $e, Clock as Ee } from "lucide-react";
|
|
6
6
|
import "./snackbar-CTq4MLir.js";
|
|
7
|
-
const
|
|
7
|
+
const Pe = N("space-y-2", {
|
|
8
8
|
variants: {
|
|
9
9
|
direction: {
|
|
10
10
|
vertical: "space-y-2 space-x-0",
|
|
@@ -14,9 +14,9 @@ const fe = C("space-y-2", {
|
|
|
14
14
|
defaultVariants: {
|
|
15
15
|
direction: "vertical"
|
|
16
16
|
}
|
|
17
|
-
}),
|
|
17
|
+
}), Fe = N(
|
|
18
18
|
"relative h-4 w-4 rounded border cursor-pointer transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed appearance-none bg-white border-primary/40 checked:bg-primary checked:border-primary focus:ring-primary/20"
|
|
19
|
-
),
|
|
19
|
+
), Be = N(
|
|
20
20
|
"text-sm text-foreground cursor-pointer select-none",
|
|
21
21
|
{
|
|
22
22
|
variants: {
|
|
@@ -29,45 +29,45 @@ const fe = C("space-y-2", {
|
|
|
29
29
|
disabled: !1
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
),
|
|
33
|
-
const
|
|
34
|
-
if (!
|
|
32
|
+
), J = M(null), Me = () => {
|
|
33
|
+
const e = A(J);
|
|
34
|
+
if (!e)
|
|
35
35
|
throw new Error("CheckboxOption must be used within CheckboxInput");
|
|
36
|
-
return
|
|
37
|
-
},
|
|
38
|
-
const l =
|
|
39
|
-
return /* @__PURE__ */
|
|
40
|
-
/* @__PURE__ */
|
|
36
|
+
return e;
|
|
37
|
+
}, Q = p.forwardRef(({ children: e, description: r, className: n, disabled: s, id: a, ...i }, d) => {
|
|
38
|
+
const l = Me(), c = p.useId(), o = a || c, u = s || l.disabled;
|
|
39
|
+
return /* @__PURE__ */ t.jsxs("div", { className: "flex items-start gap-2", children: [
|
|
40
|
+
/* @__PURE__ */ t.jsx("div", { className: "relative flex items-center mt-0.5", children: /* @__PURE__ */ t.jsx(
|
|
41
41
|
"input",
|
|
42
42
|
{
|
|
43
43
|
ref: d,
|
|
44
44
|
type: "checkbox",
|
|
45
|
-
id:
|
|
45
|
+
id: o,
|
|
46
46
|
disabled: u,
|
|
47
47
|
className: x(
|
|
48
|
-
|
|
48
|
+
Fe(),
|
|
49
49
|
// Custom checkmark styling using ::after - centered positioning
|
|
50
50
|
'after:content-[""] after:absolute after:left-1/2 after:top-[45%] after:-translate-x-1/2 after:-translate-y-1/2 after:border-b-2 after:border-r-2 after:border-white after:rotate-45 after:opacity-0 after:transition-opacity after:duration-200',
|
|
51
51
|
// Checkmark dimensions for md size (default)
|
|
52
52
|
"after:w-[4px] after:h-[8px]",
|
|
53
53
|
"checked:after:opacity-100",
|
|
54
|
-
|
|
54
|
+
n
|
|
55
55
|
),
|
|
56
|
-
...
|
|
56
|
+
...i
|
|
57
57
|
}
|
|
58
58
|
) }),
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
-
/* @__PURE__ */
|
|
59
|
+
/* @__PURE__ */ t.jsxs("div", { className: "flex flex-col", children: [
|
|
60
|
+
/* @__PURE__ */ t.jsx(
|
|
61
61
|
"label",
|
|
62
62
|
{
|
|
63
|
-
htmlFor:
|
|
64
|
-
className:
|
|
63
|
+
htmlFor: o,
|
|
64
|
+
className: Be({
|
|
65
65
|
disabled: u
|
|
66
66
|
}),
|
|
67
|
-
children:
|
|
67
|
+
children: e
|
|
68
68
|
}
|
|
69
69
|
),
|
|
70
|
-
r && /* @__PURE__ */
|
|
70
|
+
r && /* @__PURE__ */ t.jsx(
|
|
71
71
|
"div",
|
|
72
72
|
{
|
|
73
73
|
className: x(
|
|
@@ -80,53 +80,53 @@ const fe = C("space-y-2", {
|
|
|
80
80
|
] })
|
|
81
81
|
] });
|
|
82
82
|
});
|
|
83
|
-
|
|
84
|
-
const
|
|
83
|
+
Q.displayName = "CheckboxOption";
|
|
84
|
+
const X = p.forwardRef(
|
|
85
85
|
({
|
|
86
|
-
label:
|
|
86
|
+
label: e,
|
|
87
87
|
helperText: r,
|
|
88
|
-
error:
|
|
88
|
+
error: n,
|
|
89
89
|
direction: s = "vertical",
|
|
90
|
-
className:
|
|
91
|
-
disabled:
|
|
90
|
+
className: a,
|
|
91
|
+
disabled: i,
|
|
92
92
|
required: d,
|
|
93
93
|
children: l,
|
|
94
94
|
...c
|
|
95
|
-
},
|
|
96
|
-
const u = !!
|
|
97
|
-
disabled:
|
|
95
|
+
}, o) => {
|
|
96
|
+
const u = !!n, m = {
|
|
97
|
+
disabled: i
|
|
98
98
|
};
|
|
99
|
-
return /* @__PURE__ */
|
|
99
|
+
return /* @__PURE__ */ t.jsx(J.Provider, { value: m, children: /* @__PURE__ */ t.jsxs(
|
|
100
100
|
"fieldset",
|
|
101
101
|
{
|
|
102
|
-
ref:
|
|
103
|
-
disabled:
|
|
104
|
-
className: x("w-full border-0 p-0 m-0",
|
|
102
|
+
ref: o,
|
|
103
|
+
disabled: i,
|
|
104
|
+
className: x("w-full border-0 p-0 m-0", a),
|
|
105
105
|
...c,
|
|
106
106
|
children: [
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
d && /* @__PURE__ */
|
|
107
|
+
e && /* @__PURE__ */ t.jsxs("legend", { className: "block text-sm font-medium text-foreground mb-3", children: [
|
|
108
|
+
e,
|
|
109
|
+
d && /* @__PURE__ */ t.jsx("span", { className: "text-danger ml-1", "aria-label": "required", children: "*" })
|
|
110
110
|
] }),
|
|
111
|
-
/* @__PURE__ */
|
|
112
|
-
u && /* @__PURE__ */
|
|
113
|
-
!u && r && /* @__PURE__ */
|
|
111
|
+
/* @__PURE__ */ t.jsx("div", { className: Pe({ direction: s }), children: l }),
|
|
112
|
+
u && /* @__PURE__ */ t.jsx("div", { className: "mt-2 text-sm text-danger", role: "alert", children: n }),
|
|
113
|
+
!u && r && /* @__PURE__ */ t.jsx("div", { className: "mt-2 text-sm text-gray-600", children: r })
|
|
114
114
|
]
|
|
115
115
|
}
|
|
116
116
|
) });
|
|
117
117
|
}
|
|
118
118
|
);
|
|
119
|
-
|
|
120
|
-
const
|
|
121
|
-
Option:
|
|
122
|
-
}),
|
|
123
|
-
const
|
|
124
|
-
if (!
|
|
119
|
+
X.displayName = "CheckboxInput";
|
|
120
|
+
const Ft = Object.assign(X, {
|
|
121
|
+
Option: Q
|
|
122
|
+
}), Y = M(null), Ae = () => {
|
|
123
|
+
const e = A(Y);
|
|
124
|
+
if (!e)
|
|
125
125
|
throw new Error(
|
|
126
126
|
"useChipSingleInputContext must be used within ChipSingleInputContext"
|
|
127
127
|
);
|
|
128
|
-
return
|
|
129
|
-
},
|
|
128
|
+
return e;
|
|
129
|
+
}, Te = N(
|
|
130
130
|
"inline-flex items-center justify-center rounded-full bg-white transition-colors duration-200 cursor-pointer border border-border hover:bg-primary-soft hover:border-primary-bold focus:border-primary-light data-[selected=true]:bg-primary data-[selected=true]:border-primary data-[selected=true]:text-white",
|
|
131
131
|
{
|
|
132
132
|
variants: {
|
|
@@ -140,35 +140,35 @@ const dt = Object.assign(K, {
|
|
|
140
140
|
size: "md"
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
|
-
),
|
|
144
|
-
const { size: l = "md", maxWidth: c, ...
|
|
145
|
-
!f && !h &&
|
|
143
|
+
), qe = p.forwardRef(({ children: e, className: r, disabled: n, id: s, value: a, ...i }, d) => {
|
|
144
|
+
const { size: l = "md", maxWidth: c, ...o } = Ae(), u = T(), m = s || u, f = n || o.disabled, h = o.readOnly, b = o.value === a, w = (g) => {
|
|
145
|
+
!f && !h && o.onChange?.(a), i.onChange?.(g);
|
|
146
146
|
};
|
|
147
|
-
return /* @__PURE__ */
|
|
148
|
-
/* @__PURE__ */
|
|
147
|
+
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
148
|
+
/* @__PURE__ */ t.jsx(
|
|
149
149
|
"input",
|
|
150
150
|
{
|
|
151
151
|
ref: d,
|
|
152
152
|
type: "radio",
|
|
153
|
-
id:
|
|
154
|
-
name:
|
|
155
|
-
value:
|
|
153
|
+
id: m,
|
|
154
|
+
name: o.name,
|
|
155
|
+
value: a,
|
|
156
156
|
checked: b,
|
|
157
157
|
disabled: f,
|
|
158
158
|
readOnly: h,
|
|
159
159
|
onChange: w,
|
|
160
160
|
className: "sr-only",
|
|
161
|
-
...
|
|
161
|
+
...i
|
|
162
162
|
}
|
|
163
163
|
),
|
|
164
|
-
/* @__PURE__ */
|
|
164
|
+
/* @__PURE__ */ t.jsx(
|
|
165
165
|
"label",
|
|
166
166
|
{
|
|
167
|
-
htmlFor:
|
|
167
|
+
htmlFor: m,
|
|
168
168
|
"data-selected": b,
|
|
169
169
|
style: c ? { maxWidth: c } : void 0,
|
|
170
170
|
className: x(
|
|
171
|
-
|
|
171
|
+
Te({
|
|
172
172
|
size: l
|
|
173
173
|
}),
|
|
174
174
|
f && "opacity-50 cursor-not-allowed pointer-events-none",
|
|
@@ -176,75 +176,75 @@ const dt = Object.assign(K, {
|
|
|
176
176
|
c && "overflow-hidden",
|
|
177
177
|
r
|
|
178
178
|
),
|
|
179
|
-
children: /* @__PURE__ */
|
|
179
|
+
children: /* @__PURE__ */ t.jsx(
|
|
180
180
|
"span",
|
|
181
181
|
{
|
|
182
182
|
className: x(
|
|
183
183
|
"flex items-center gap-2",
|
|
184
184
|
c && "truncate min-w-0"
|
|
185
185
|
),
|
|
186
|
-
children:
|
|
186
|
+
children: e
|
|
187
187
|
}
|
|
188
188
|
)
|
|
189
189
|
}
|
|
190
190
|
)
|
|
191
191
|
] });
|
|
192
|
-
}),
|
|
192
|
+
}), He = $(
|
|
193
193
|
({
|
|
194
|
-
size:
|
|
194
|
+
size: e = "md",
|
|
195
195
|
label: r,
|
|
196
|
-
required:
|
|
196
|
+
required: n,
|
|
197
197
|
helperText: s,
|
|
198
|
-
error:
|
|
199
|
-
className:
|
|
198
|
+
error: a,
|
|
199
|
+
className: i,
|
|
200
200
|
disabled: d,
|
|
201
201
|
readOnly: l,
|
|
202
202
|
maxWidth: c,
|
|
203
|
-
name:
|
|
203
|
+
name: o,
|
|
204
204
|
value: u,
|
|
205
|
-
onChange:
|
|
205
|
+
onChange: m,
|
|
206
206
|
children: f,
|
|
207
207
|
...h
|
|
208
208
|
}, b) => {
|
|
209
|
-
const w = !!
|
|
210
|
-
size:
|
|
209
|
+
const w = !!a, g = {
|
|
210
|
+
size: e,
|
|
211
211
|
disabled: d,
|
|
212
212
|
readOnly: l,
|
|
213
213
|
error: w,
|
|
214
|
-
name:
|
|
214
|
+
name: o,
|
|
215
215
|
value: u,
|
|
216
216
|
maxWidth: c,
|
|
217
|
-
onChange:
|
|
217
|
+
onChange: m
|
|
218
218
|
};
|
|
219
|
-
return /* @__PURE__ */
|
|
219
|
+
return /* @__PURE__ */ t.jsx(Y.Provider, { value: g, children: /* @__PURE__ */ t.jsxs(
|
|
220
220
|
"fieldset",
|
|
221
221
|
{
|
|
222
222
|
ref: b,
|
|
223
|
-
className: x("w-full border-0 p-0 m-0",
|
|
223
|
+
className: x("w-full border-0 p-0 m-0", i),
|
|
224
224
|
disabled: d,
|
|
225
225
|
...h,
|
|
226
226
|
children: [
|
|
227
|
-
r && /* @__PURE__ */
|
|
227
|
+
r && /* @__PURE__ */ t.jsxs("legend", { className: "block text-sm font-medium text-foreground mb-3 float-none w-auto", children: [
|
|
228
228
|
r,
|
|
229
|
-
|
|
229
|
+
n && /* @__PURE__ */ t.jsx("span", { className: "text-danger ml-1", "aria-label": "required", children: "*" })
|
|
230
230
|
] }),
|
|
231
|
-
/* @__PURE__ */
|
|
232
|
-
w && /* @__PURE__ */
|
|
233
|
-
!w && s && /* @__PURE__ */
|
|
231
|
+
/* @__PURE__ */ t.jsx("div", { className: "flex flex-wrap gap-2", children: f }),
|
|
232
|
+
w && /* @__PURE__ */ t.jsx("div", { className: "mt-2 text-sm text-danger", role: "alert", children: a }),
|
|
233
|
+
!w && s && /* @__PURE__ */ t.jsx("div", { className: "mt-2 text-sm text-gray-600", children: s })
|
|
234
234
|
]
|
|
235
235
|
}
|
|
236
236
|
) });
|
|
237
237
|
}
|
|
238
|
-
),
|
|
239
|
-
Option:
|
|
240
|
-
}),
|
|
241
|
-
const
|
|
242
|
-
if (!
|
|
238
|
+
), Bt = Object.assign(He, {
|
|
239
|
+
Option: qe
|
|
240
|
+
}), Z = M(null), We = () => {
|
|
241
|
+
const e = A(Z);
|
|
242
|
+
if (!e)
|
|
243
243
|
throw new Error(
|
|
244
244
|
"useChipMultipleInputContext must be used within ChipMultipleInputContext"
|
|
245
245
|
);
|
|
246
|
-
return
|
|
247
|
-
},
|
|
246
|
+
return e;
|
|
247
|
+
}, Ue = N(
|
|
248
248
|
"inline-flex items-center justify-center rounded-full bg-white transition-colors duration-200 cursor-pointer border border-border hover:bg-primary-soft hover:border-primary-bold focus:border-primary-light data-[selected=true]:bg-primary data-[selected=true]:border-primary data-[selected=true]:text-white",
|
|
249
249
|
{
|
|
250
250
|
variants: {
|
|
@@ -258,40 +258,40 @@ const dt = Object.assign(K, {
|
|
|
258
258
|
size: "md"
|
|
259
259
|
}
|
|
260
260
|
}
|
|
261
|
-
),
|
|
262
|
-
const { size: l = "md", maxWidth: c, ...
|
|
261
|
+
), Ge = p.forwardRef(({ children: e, className: r, disabled: n, id: s, value: a, ...i }, d) => {
|
|
262
|
+
const { size: l = "md", maxWidth: c, ...o } = We(), u = T(), m = s || u, f = n || o.disabled, h = o.readOnly, b = o.value?.includes(a) ?? !1, w = (g) => {
|
|
263
263
|
if (!f && !h) {
|
|
264
|
-
const
|
|
265
|
-
let
|
|
266
|
-
b ?
|
|
264
|
+
const y = o.value || [];
|
|
265
|
+
let k;
|
|
266
|
+
b ? k = y.filter((C) => C !== a) : k = [...y, a], o.onChange?.(k);
|
|
267
267
|
}
|
|
268
|
-
|
|
268
|
+
i.onChange?.(g);
|
|
269
269
|
};
|
|
270
|
-
return /* @__PURE__ */
|
|
271
|
-
/* @__PURE__ */
|
|
270
|
+
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
271
|
+
/* @__PURE__ */ t.jsx(
|
|
272
272
|
"input",
|
|
273
273
|
{
|
|
274
274
|
ref: d,
|
|
275
275
|
type: "checkbox",
|
|
276
|
-
id:
|
|
277
|
-
name: `${
|
|
278
|
-
value:
|
|
276
|
+
id: m,
|
|
277
|
+
name: `${o.name}[]`,
|
|
278
|
+
value: a,
|
|
279
279
|
checked: b,
|
|
280
280
|
disabled: f,
|
|
281
281
|
readOnly: h,
|
|
282
282
|
onChange: w,
|
|
283
283
|
className: "sr-only",
|
|
284
|
-
...
|
|
284
|
+
...i
|
|
285
285
|
}
|
|
286
286
|
),
|
|
287
|
-
/* @__PURE__ */
|
|
287
|
+
/* @__PURE__ */ t.jsx(
|
|
288
288
|
"label",
|
|
289
289
|
{
|
|
290
|
-
htmlFor:
|
|
290
|
+
htmlFor: m,
|
|
291
291
|
"data-selected": b,
|
|
292
292
|
style: c ? { maxWidth: c } : void 0,
|
|
293
293
|
className: x(
|
|
294
|
-
|
|
294
|
+
Ue({
|
|
295
295
|
size: l
|
|
296
296
|
}),
|
|
297
297
|
f && "opacity-50 cursor-not-allowed pointer-events-none",
|
|
@@ -299,68 +299,68 @@ const dt = Object.assign(K, {
|
|
|
299
299
|
c && "overflow-hidden",
|
|
300
300
|
r
|
|
301
301
|
),
|
|
302
|
-
children: /* @__PURE__ */
|
|
302
|
+
children: /* @__PURE__ */ t.jsx(
|
|
303
303
|
"span",
|
|
304
304
|
{
|
|
305
305
|
className: x(
|
|
306
306
|
"flex items-center gap-2",
|
|
307
307
|
c && "truncate min-w-0"
|
|
308
308
|
),
|
|
309
|
-
children:
|
|
309
|
+
children: e
|
|
310
310
|
}
|
|
311
311
|
)
|
|
312
312
|
}
|
|
313
313
|
)
|
|
314
314
|
] });
|
|
315
|
-
}),
|
|
315
|
+
}), _e = $(
|
|
316
316
|
({
|
|
317
|
-
size:
|
|
317
|
+
size: e = "md",
|
|
318
318
|
label: r,
|
|
319
|
-
required:
|
|
319
|
+
required: n,
|
|
320
320
|
helperText: s,
|
|
321
|
-
error:
|
|
322
|
-
className:
|
|
321
|
+
error: a,
|
|
322
|
+
className: i,
|
|
323
323
|
disabled: d,
|
|
324
324
|
readOnly: l,
|
|
325
325
|
maxWidth: c,
|
|
326
|
-
name:
|
|
326
|
+
name: o,
|
|
327
327
|
value: u = [],
|
|
328
|
-
onChange:
|
|
328
|
+
onChange: m,
|
|
329
329
|
children: f,
|
|
330
330
|
...h
|
|
331
331
|
}, b) => {
|
|
332
|
-
const w = !!
|
|
333
|
-
size:
|
|
332
|
+
const w = !!a, g = {
|
|
333
|
+
size: e,
|
|
334
334
|
disabled: d,
|
|
335
335
|
readOnly: l,
|
|
336
336
|
error: w,
|
|
337
|
-
name:
|
|
337
|
+
name: o,
|
|
338
338
|
value: u,
|
|
339
339
|
maxWidth: c,
|
|
340
|
-
onChange:
|
|
340
|
+
onChange: m
|
|
341
341
|
};
|
|
342
|
-
return /* @__PURE__ */
|
|
342
|
+
return /* @__PURE__ */ t.jsx(Z.Provider, { value: g, children: /* @__PURE__ */ t.jsxs(
|
|
343
343
|
"fieldset",
|
|
344
344
|
{
|
|
345
345
|
ref: b,
|
|
346
|
-
className: x("w-full border-0 p-0 m-0",
|
|
346
|
+
className: x("w-full border-0 p-0 m-0", i),
|
|
347
347
|
disabled: d,
|
|
348
348
|
...h,
|
|
349
349
|
children: [
|
|
350
|
-
r && /* @__PURE__ */
|
|
350
|
+
r && /* @__PURE__ */ t.jsxs("legend", { className: "block text-sm font-medium text-foreground mb-3 float-none w-auto", children: [
|
|
351
351
|
r,
|
|
352
|
-
|
|
352
|
+
n && /* @__PURE__ */ t.jsx("span", { className: "text-danger ml-1", "aria-label": "required", children: "*" })
|
|
353
353
|
] }),
|
|
354
|
-
/* @__PURE__ */
|
|
355
|
-
w && /* @__PURE__ */
|
|
356
|
-
!w && s && /* @__PURE__ */
|
|
354
|
+
/* @__PURE__ */ t.jsx("div", { className: "flex flex-wrap gap-2", children: f }),
|
|
355
|
+
w && /* @__PURE__ */ t.jsx("div", { className: "mt-2 text-sm text-danger", role: "alert", children: a }),
|
|
356
|
+
!w && s && /* @__PURE__ */ t.jsx("div", { className: "mt-2 text-sm text-gray-600", children: s })
|
|
357
357
|
]
|
|
358
358
|
}
|
|
359
359
|
) });
|
|
360
360
|
}
|
|
361
|
-
),
|
|
362
|
-
Option:
|
|
363
|
-
}),
|
|
361
|
+
), Mt = Object.assign(_e, {
|
|
362
|
+
Option: Ge
|
|
363
|
+
}), Ke = N(
|
|
364
364
|
"block w-full rounded-md border bg-white transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:pointer-events-none disabled:bg-gray-50 text-left",
|
|
365
365
|
{
|
|
366
366
|
variants: {
|
|
@@ -374,41 +374,41 @@ const dt = Object.assign(K, {
|
|
|
374
374
|
state: "default"
|
|
375
375
|
}
|
|
376
376
|
}
|
|
377
|
-
),
|
|
377
|
+
), ee = p.forwardRef(
|
|
378
378
|
({
|
|
379
|
-
label:
|
|
379
|
+
label: e,
|
|
380
380
|
leftContent: r,
|
|
381
|
-
rightContent:
|
|
381
|
+
rightContent: n,
|
|
382
382
|
helperText: s,
|
|
383
|
-
error:
|
|
384
|
-
className:
|
|
383
|
+
error: a,
|
|
384
|
+
className: i,
|
|
385
385
|
disabled: d,
|
|
386
386
|
id: l,
|
|
387
387
|
required: c,
|
|
388
|
-
value:
|
|
388
|
+
value: o,
|
|
389
389
|
displayValue: u,
|
|
390
|
-
placeholder:
|
|
390
|
+
placeholder: m = "",
|
|
391
391
|
name: f,
|
|
392
392
|
...h
|
|
393
393
|
}, b) => {
|
|
394
|
-
const w =
|
|
395
|
-
const
|
|
396
|
-
return
|
|
397
|
-
}, [
|
|
398
|
-
return /* @__PURE__ */
|
|
399
|
-
|
|
394
|
+
const w = p.useId(), g = l || w, y = `${g}-helper`, k = `${g}-error`, C = !!a, S = p.useMemo(() => u && u !== "" ? u : m, [u, m]), D = p.useMemo(() => o == null ? "" : typeof o == "string" || typeof o == "number" || typeof o == "boolean" ? String(o) : Array.isArray(o) || typeof o == "object" ? JSON.stringify(o) : String(o), [o]), E = u !== void 0 && u !== "", z = p.useMemo(() => {
|
|
395
|
+
const V = [];
|
|
396
|
+
return C ? V.push(k) : s && V.push(y), V.length > 0 ? V.join(" ") : void 0;
|
|
397
|
+
}, [C, s, k, y]);
|
|
398
|
+
return /* @__PURE__ */ t.jsxs("div", { className: x("w-full", i), children: [
|
|
399
|
+
e && /* @__PURE__ */ t.jsxs(
|
|
400
400
|
"label",
|
|
401
401
|
{
|
|
402
402
|
htmlFor: g,
|
|
403
403
|
className: "block text-sm font-medium text-foreground mb-2",
|
|
404
404
|
children: [
|
|
405
|
-
|
|
406
|
-
c && /* @__PURE__ */
|
|
405
|
+
e,
|
|
406
|
+
c && /* @__PURE__ */ t.jsx("span", { className: "text-danger ml-1", "aria-label": "required", children: "*" })
|
|
407
407
|
]
|
|
408
408
|
}
|
|
409
409
|
),
|
|
410
|
-
/* @__PURE__ */
|
|
411
|
-
r && /* @__PURE__ */
|
|
410
|
+
/* @__PURE__ */ t.jsxs("div", { className: "relative w-full", children: [
|
|
411
|
+
r && /* @__PURE__ */ t.jsx(
|
|
412
412
|
"span",
|
|
413
413
|
{
|
|
414
414
|
className: "absolute left-2.5 top-0 bottom-0 pointer-events-none text-gray-500 flex items-center justify-center w-5 z-10",
|
|
@@ -417,103 +417,103 @@ const dt = Object.assign(K, {
|
|
|
417
417
|
children: r
|
|
418
418
|
}
|
|
419
419
|
),
|
|
420
|
-
/* @__PURE__ */
|
|
420
|
+
/* @__PURE__ */ t.jsx(
|
|
421
421
|
"button",
|
|
422
422
|
{
|
|
423
423
|
ref: b,
|
|
424
424
|
id: g,
|
|
425
425
|
type: "button",
|
|
426
426
|
disabled: d,
|
|
427
|
-
"aria-invalid":
|
|
428
|
-
"aria-describedby":
|
|
429
|
-
"aria-errormessage":
|
|
427
|
+
"aria-invalid": C || void 0,
|
|
428
|
+
"aria-describedby": z,
|
|
429
|
+
"aria-errormessage": C ? k : void 0,
|
|
430
430
|
"aria-required": c || void 0,
|
|
431
431
|
className: x(
|
|
432
|
-
|
|
433
|
-
state:
|
|
432
|
+
Ke({
|
|
433
|
+
state: C ? "error" : "default"
|
|
434
434
|
}),
|
|
435
435
|
r ? "pl-9" : "pl-3",
|
|
436
|
-
|
|
436
|
+
n ? "pr-9" : "pr-3",
|
|
437
437
|
"h-9",
|
|
438
|
-
!
|
|
438
|
+
!E && "text-gray-400"
|
|
439
439
|
),
|
|
440
440
|
...h,
|
|
441
|
-
children:
|
|
441
|
+
children: S
|
|
442
442
|
}
|
|
443
443
|
),
|
|
444
|
-
|
|
444
|
+
n && /* @__PURE__ */ t.jsx(
|
|
445
445
|
"span",
|
|
446
446
|
{
|
|
447
447
|
className: "absolute right-2.5 top-0 bottom-0 pointer-events-none text-gray-500 flex items-center justify-center w-5 z-10",
|
|
448
448
|
"aria-hidden": "true",
|
|
449
449
|
"data-testid": "right-content",
|
|
450
|
-
children:
|
|
450
|
+
children: n
|
|
451
451
|
}
|
|
452
452
|
),
|
|
453
|
-
f && /* @__PURE__ */
|
|
453
|
+
f && /* @__PURE__ */ t.jsx(
|
|
454
454
|
"input",
|
|
455
455
|
{
|
|
456
456
|
type: "hidden",
|
|
457
457
|
name: f,
|
|
458
|
-
value:
|
|
458
|
+
value: D,
|
|
459
459
|
readOnly: !0,
|
|
460
460
|
"data-testid": "hidden-input"
|
|
461
461
|
}
|
|
462
462
|
)
|
|
463
463
|
] }),
|
|
464
|
-
|
|
464
|
+
C && /* @__PURE__ */ t.jsx(
|
|
465
465
|
"div",
|
|
466
466
|
{
|
|
467
|
-
id:
|
|
467
|
+
id: k,
|
|
468
468
|
className: "mt-1 text-sm text-danger",
|
|
469
469
|
role: "alert",
|
|
470
470
|
"aria-live": "polite",
|
|
471
|
-
children:
|
|
471
|
+
children: a
|
|
472
472
|
}
|
|
473
473
|
),
|
|
474
|
-
!
|
|
474
|
+
!C && s && /* @__PURE__ */ t.jsx("div", { id: y, className: "mt-1 text-sm text-gray-600", children: s })
|
|
475
475
|
] });
|
|
476
476
|
}
|
|
477
477
|
);
|
|
478
|
-
|
|
479
|
-
function
|
|
480
|
-
if (!
|
|
481
|
-
const r = new Date(
|
|
482
|
-
return isNaN(r.getTime()) ?
|
|
478
|
+
ee.displayName = "TextInputAsButton";
|
|
479
|
+
function Je(e) {
|
|
480
|
+
if (!e) return "";
|
|
481
|
+
const r = new Date(e);
|
|
482
|
+
return isNaN(r.getTime()) ? e : r.toLocaleDateString(void 0, {
|
|
483
483
|
year: "numeric",
|
|
484
484
|
month: "short",
|
|
485
485
|
day: "numeric"
|
|
486
486
|
});
|
|
487
487
|
}
|
|
488
|
-
const
|
|
489
|
-
const
|
|
490
|
-
|
|
491
|
-
},
|
|
492
|
-
|
|
488
|
+
const At = p.forwardRef(function({ value: r = "", onChange: n, label: s, formatter: a, min: i, max: d, ...l }, c) {
|
|
489
|
+
const o = G(null), u = (b) => {
|
|
490
|
+
o.current = b, typeof c == "function" ? c(b) : c && typeof c == "object" && (c.current = b);
|
|
491
|
+
}, m = () => {
|
|
492
|
+
o.current && (typeof o.current.showPicker == "function" ? o.current.showPicker() : o.current.focus());
|
|
493
493
|
}, f = (b) => {
|
|
494
|
-
|
|
495
|
-
}, h = (
|
|
496
|
-
return /* @__PURE__ */
|
|
497
|
-
/* @__PURE__ */
|
|
498
|
-
|
|
494
|
+
n(b.target.value);
|
|
495
|
+
}, h = (a ?? Je)(r);
|
|
496
|
+
return /* @__PURE__ */ t.jsxs("div", { className: "relative", children: [
|
|
497
|
+
/* @__PURE__ */ t.jsx(
|
|
498
|
+
ee,
|
|
499
499
|
{
|
|
500
|
-
onClick:
|
|
500
|
+
onClick: m,
|
|
501
501
|
value: r,
|
|
502
502
|
displayValue: h,
|
|
503
503
|
label: s,
|
|
504
|
-
leftContent: /* @__PURE__ */
|
|
504
|
+
leftContent: /* @__PURE__ */ t.jsx(P, { as: we, color: "inherit", size: "sm" }),
|
|
505
505
|
"data-testid": "date-single-picker-visible-input",
|
|
506
506
|
...l
|
|
507
507
|
}
|
|
508
508
|
),
|
|
509
|
-
/* @__PURE__ */
|
|
509
|
+
/* @__PURE__ */ t.jsx(
|
|
510
510
|
"input",
|
|
511
511
|
{
|
|
512
512
|
ref: u,
|
|
513
513
|
type: "date",
|
|
514
514
|
value: r,
|
|
515
515
|
onChange: f,
|
|
516
|
-
min:
|
|
516
|
+
min: i,
|
|
517
517
|
max: d,
|
|
518
518
|
className: "sr-only absolute opacity-0 h-0 w-0 pointer-events-none",
|
|
519
519
|
tabIndex: -1,
|
|
@@ -521,7 +521,7 @@ const pt = m.forwardRef(function({ value: r = "", onChange: a, label: s, formatt
|
|
|
521
521
|
}
|
|
522
522
|
)
|
|
523
523
|
] });
|
|
524
|
-
}),
|
|
524
|
+
}), Qe = N(
|
|
525
525
|
"block w-full rounded-md border bg-white transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:pointer-events-none disabled:bg-gray-50",
|
|
526
526
|
{
|
|
527
527
|
variants: {
|
|
@@ -535,38 +535,38 @@ const pt = m.forwardRef(function({ value: r = "", onChange: a, label: s, formatt
|
|
|
535
535
|
state: "default"
|
|
536
536
|
}
|
|
537
537
|
}
|
|
538
|
-
),
|
|
538
|
+
), F = p.forwardRef(
|
|
539
539
|
({
|
|
540
|
-
label:
|
|
540
|
+
label: e,
|
|
541
541
|
leftContent: r,
|
|
542
|
-
rightContent:
|
|
542
|
+
rightContent: n,
|
|
543
543
|
helperText: s,
|
|
544
|
-
error:
|
|
545
|
-
className:
|
|
544
|
+
error: a,
|
|
545
|
+
className: i,
|
|
546
546
|
disabled: d,
|
|
547
547
|
readOnly: l,
|
|
548
548
|
id: c,
|
|
549
|
-
required:
|
|
549
|
+
required: o,
|
|
550
550
|
...u
|
|
551
|
-
},
|
|
552
|
-
const f =
|
|
553
|
-
const
|
|
554
|
-
return g ?
|
|
551
|
+
}, m) => {
|
|
552
|
+
const f = p.useId(), h = c || f, b = `${h}-helper`, w = `${h}-error`, g = !!a, y = p.useMemo(() => {
|
|
553
|
+
const k = [];
|
|
554
|
+
return g ? k.push(w) : s && k.push(b), k.length > 0 ? k.join(" ") : void 0;
|
|
555
555
|
}, [g, s, w, b]);
|
|
556
|
-
return /* @__PURE__ */
|
|
557
|
-
|
|
556
|
+
return /* @__PURE__ */ t.jsxs("div", { className: x("w-full", i), children: [
|
|
557
|
+
e && /* @__PURE__ */ t.jsxs(
|
|
558
558
|
"label",
|
|
559
559
|
{
|
|
560
560
|
htmlFor: h,
|
|
561
561
|
className: "block text-sm font-medium text-foreground mb-2",
|
|
562
562
|
children: [
|
|
563
|
-
|
|
564
|
-
|
|
563
|
+
e,
|
|
564
|
+
o && /* @__PURE__ */ t.jsx("span", { className: "text-danger ml-1", "aria-label": "required", children: "*" })
|
|
565
565
|
]
|
|
566
566
|
}
|
|
567
567
|
),
|
|
568
|
-
/* @__PURE__ */
|
|
569
|
-
r && /* @__PURE__ */
|
|
568
|
+
/* @__PURE__ */ t.jsxs("div", { className: "relative w-full", children: [
|
|
569
|
+
r && /* @__PURE__ */ t.jsx(
|
|
570
570
|
"span",
|
|
571
571
|
{
|
|
572
572
|
className: "absolute left-2.5 top-0 bottom-0 pointer-events-none text-gray-500 flex items-center justify-center w-5",
|
|
@@ -575,79 +575,79 @@ const pt = m.forwardRef(function({ value: r = "", onChange: a, label: s, formatt
|
|
|
575
575
|
children: r
|
|
576
576
|
}
|
|
577
577
|
),
|
|
578
|
-
/* @__PURE__ */
|
|
578
|
+
/* @__PURE__ */ t.jsx(
|
|
579
579
|
"input",
|
|
580
580
|
{
|
|
581
|
-
ref:
|
|
581
|
+
ref: m,
|
|
582
582
|
id: h,
|
|
583
|
-
required:
|
|
583
|
+
required: o,
|
|
584
584
|
disabled: d,
|
|
585
585
|
readOnly: l,
|
|
586
586
|
"aria-invalid": g,
|
|
587
|
-
"aria-describedby":
|
|
587
|
+
"aria-describedby": y,
|
|
588
588
|
"aria-errormessage": g ? w : void 0,
|
|
589
589
|
className: x(
|
|
590
|
-
|
|
590
|
+
Qe({
|
|
591
591
|
state: g ? "error" : l ? "readOnly" : "default"
|
|
592
592
|
}),
|
|
593
593
|
r ? "pl-9" : "pl-3",
|
|
594
|
-
|
|
594
|
+
n ? "pr-9" : "pr-3",
|
|
595
595
|
"h-9"
|
|
596
596
|
),
|
|
597
597
|
...u
|
|
598
598
|
}
|
|
599
599
|
),
|
|
600
|
-
|
|
600
|
+
n && /* @__PURE__ */ t.jsx(
|
|
601
601
|
"span",
|
|
602
602
|
{
|
|
603
603
|
className: "absolute right-2.5 top-0 bottom-0 pointer-events-none text-gray-500 flex items-center justify-center w-5",
|
|
604
604
|
"aria-hidden": "true",
|
|
605
605
|
"data-testid": "right-content",
|
|
606
|
-
children:
|
|
606
|
+
children: n
|
|
607
607
|
}
|
|
608
608
|
)
|
|
609
609
|
] }),
|
|
610
|
-
g && /* @__PURE__ */
|
|
610
|
+
g && /* @__PURE__ */ t.jsx(
|
|
611
611
|
"div",
|
|
612
612
|
{
|
|
613
613
|
id: w,
|
|
614
614
|
className: "mt-1 text-sm text-danger",
|
|
615
615
|
role: "alert",
|
|
616
616
|
"aria-live": "polite",
|
|
617
|
-
children:
|
|
617
|
+
children: a
|
|
618
618
|
}
|
|
619
619
|
),
|
|
620
|
-
!g && s && /* @__PURE__ */
|
|
620
|
+
!g && s && /* @__PURE__ */ t.jsx("div", { id: b, className: "mt-1 text-sm text-gray-600", children: s })
|
|
621
621
|
] });
|
|
622
622
|
}
|
|
623
623
|
);
|
|
624
|
-
|
|
625
|
-
const
|
|
626
|
-
(
|
|
627
|
-
|
|
624
|
+
F.displayName = "TextInput";
|
|
625
|
+
const Tt = $(
|
|
626
|
+
(e, r) => /* @__PURE__ */ t.jsx(
|
|
627
|
+
F,
|
|
628
628
|
{
|
|
629
|
-
...
|
|
629
|
+
...e,
|
|
630
630
|
ref: r,
|
|
631
631
|
type: "email",
|
|
632
632
|
autoComplete: "email",
|
|
633
633
|
inputMode: "email",
|
|
634
|
-
leftContent: /* @__PURE__ */
|
|
634
|
+
leftContent: /* @__PURE__ */ t.jsx(P, { as: ke, color: "inherit", size: "sm" })
|
|
635
635
|
}
|
|
636
636
|
)
|
|
637
|
-
),
|
|
637
|
+
), Xe = "w-9 h-9 text-center border border-primary/30 rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary disabled:opacity-50 disabled:pointer-events-none disabled:bg-gray-50 text-sm font-semibold text-foreground", Ye = "w-9 h-9 text-center border border-danger rounded-md bg-danger/5 transition-colors focus:outline-none focus:ring-2 focus:ring-danger/20 focus:border-danger disabled:opacity-50 disabled:pointer-events-none disabled:bg-gray-50 text-sm font-semibold text-foreground", Ze = (e) => /^\d$/.test(e), q = (e, r) => e?.replace(/\D/g, "").slice(0, r) || "", te = p.forwardRef(
|
|
638
638
|
({
|
|
639
|
-
value:
|
|
639
|
+
value: e,
|
|
640
640
|
onChange: r,
|
|
641
|
-
onKeyDown:
|
|
641
|
+
onKeyDown: n,
|
|
642
642
|
onFocus: s,
|
|
643
|
-
onPaste:
|
|
644
|
-
disabled:
|
|
643
|
+
onPaste: a,
|
|
644
|
+
disabled: i,
|
|
645
645
|
error: d,
|
|
646
646
|
secure: l,
|
|
647
647
|
inputRef: c,
|
|
648
|
-
index:
|
|
648
|
+
index: o,
|
|
649
649
|
id: u
|
|
650
|
-
},
|
|
650
|
+
}, m) => /* @__PURE__ */ t.jsx(
|
|
651
651
|
"input",
|
|
652
652
|
{
|
|
653
653
|
ref: c,
|
|
@@ -656,228 +656,228 @@ const mt = O(
|
|
|
656
656
|
inputMode: "numeric",
|
|
657
657
|
pattern: l ? void 0 : "[0-9]*",
|
|
658
658
|
maxLength: 1,
|
|
659
|
-
value: l ?
|
|
659
|
+
value: l ? e ? "•" : "" : e,
|
|
660
660
|
onChange: (f) => {
|
|
661
661
|
const h = f.target.value;
|
|
662
|
-
(h === "" ||
|
|
662
|
+
(h === "" || Ze(h)) && r(h);
|
|
663
663
|
},
|
|
664
|
-
onKeyDown:
|
|
664
|
+
onKeyDown: n,
|
|
665
665
|
onFocus: s,
|
|
666
|
-
onPaste:
|
|
667
|
-
disabled:
|
|
666
|
+
onPaste: a,
|
|
667
|
+
disabled: i,
|
|
668
668
|
"aria-invalid": d,
|
|
669
|
-
"aria-disabled":
|
|
670
|
-
className: d ?
|
|
669
|
+
"aria-disabled": i,
|
|
670
|
+
className: d ? Ye : Xe,
|
|
671
671
|
autoComplete: "one-time-code",
|
|
672
|
-
"data-testid": `pin-input-${
|
|
672
|
+
"data-testid": `pin-input-${o}`
|
|
673
673
|
}
|
|
674
674
|
)
|
|
675
675
|
);
|
|
676
|
-
|
|
677
|
-
const
|
|
676
|
+
te.displayName = "PinInput";
|
|
677
|
+
const et = p.forwardRef(
|
|
678
678
|
({
|
|
679
|
-
label:
|
|
679
|
+
label: e,
|
|
680
680
|
helperText: r,
|
|
681
|
-
error:
|
|
681
|
+
error: n,
|
|
682
682
|
disabled: s,
|
|
683
|
-
value:
|
|
684
|
-
onChange:
|
|
683
|
+
value: a,
|
|
684
|
+
onChange: i,
|
|
685
685
|
onComplete: d,
|
|
686
686
|
digits: l = 6,
|
|
687
687
|
className: c,
|
|
688
|
-
id:
|
|
688
|
+
id: o,
|
|
689
689
|
name: u,
|
|
690
|
-
required:
|
|
690
|
+
required: m,
|
|
691
691
|
secure: f = !1,
|
|
692
692
|
...h
|
|
693
693
|
}, b) => {
|
|
694
|
-
const w =
|
|
695
|
-
(
|
|
696
|
-
const
|
|
697
|
-
|
|
694
|
+
const w = p.useId(), g = o || w, y = !!n, k = p.useRef([]), C = q(a, l), S = C.split("").concat(Array(l - C.length).fill("")), D = p.useCallback(
|
|
695
|
+
(I) => {
|
|
696
|
+
const v = q(I, l);
|
|
697
|
+
i(v), v.length === l && d?.(v);
|
|
698
698
|
},
|
|
699
|
-
[
|
|
700
|
-
),
|
|
701
|
-
(
|
|
702
|
-
const
|
|
703
|
-
I
|
|
704
|
-
const
|
|
705
|
-
|
|
699
|
+
[i, d, l]
|
|
700
|
+
), E = p.useCallback(
|
|
701
|
+
(I, v) => {
|
|
702
|
+
const j = [...S];
|
|
703
|
+
j[I] = v;
|
|
704
|
+
const L = j.join("").replace(/\s+$/, "");
|
|
705
|
+
D(L), v && I < l - 1 && k.current[I + 1]?.focus();
|
|
706
706
|
},
|
|
707
|
-
[
|
|
708
|
-
),
|
|
709
|
-
(
|
|
710
|
-
if (
|
|
711
|
-
if (!
|
|
712
|
-
|
|
713
|
-
const
|
|
714
|
-
I
|
|
715
|
-
const
|
|
716
|
-
|
|
717
|
-
} else if (
|
|
718
|
-
|
|
719
|
-
const
|
|
720
|
-
I
|
|
721
|
-
const
|
|
722
|
-
|
|
707
|
+
[S, D, l]
|
|
708
|
+
), z = p.useCallback(
|
|
709
|
+
(I, v) => {
|
|
710
|
+
if (v.key === "Backspace") {
|
|
711
|
+
if (!S[I] && I > 0) {
|
|
712
|
+
v.preventDefault();
|
|
713
|
+
const j = [...S];
|
|
714
|
+
j[I - 1] = "";
|
|
715
|
+
const L = j.join("").replace(/\s+$/, "");
|
|
716
|
+
D(L), k.current[I - 1]?.focus();
|
|
717
|
+
} else if (S[I]) {
|
|
718
|
+
v.preventDefault();
|
|
719
|
+
const j = [...S];
|
|
720
|
+
j[I] = "";
|
|
721
|
+
const L = j.join("").replace(/\s+$/, "");
|
|
722
|
+
D(L);
|
|
723
723
|
}
|
|
724
|
-
} else
|
|
724
|
+
} else v.key === "ArrowLeft" && I > 0 ? (v.preventDefault(), k.current[I - 1]?.focus()) : v.key === "ArrowRight" && I < l - 1 && (v.preventDefault(), k.current[I + 1]?.focus());
|
|
725
725
|
},
|
|
726
|
-
[
|
|
727
|
-
),
|
|
728
|
-
(
|
|
729
|
-
|
|
730
|
-
const
|
|
731
|
-
if (
|
|
732
|
-
|
|
733
|
-
const
|
|
734
|
-
|
|
726
|
+
[S, D, l]
|
|
727
|
+
), V = p.useCallback(
|
|
728
|
+
(I) => {
|
|
729
|
+
I.preventDefault();
|
|
730
|
+
const v = I.clipboardData.getData("text"), j = q(v, l);
|
|
731
|
+
if (j.length > 0) {
|
|
732
|
+
D(j);
|
|
733
|
+
const L = Math.min(j.length, l - 1);
|
|
734
|
+
k.current[L]?.focus();
|
|
735
735
|
}
|
|
736
736
|
},
|
|
737
|
-
[
|
|
737
|
+
[D, l]
|
|
738
738
|
);
|
|
739
|
-
return /* @__PURE__ */
|
|
740
|
-
|
|
739
|
+
return /* @__PURE__ */ t.jsxs("div", { ref: b, className: x("w-full", c), ...h, children: [
|
|
740
|
+
e && /* @__PURE__ */ t.jsxs(
|
|
741
741
|
"label",
|
|
742
742
|
{
|
|
743
743
|
htmlFor: `${g}-0`,
|
|
744
744
|
className: "block text-sm font-medium text-foreground mb-2",
|
|
745
745
|
children: [
|
|
746
|
-
|
|
747
|
-
|
|
746
|
+
e,
|
|
747
|
+
m && /* @__PURE__ */ t.jsx("span", { className: "text-danger ml-1", "aria-label": "required", children: "*" })
|
|
748
748
|
]
|
|
749
749
|
}
|
|
750
750
|
),
|
|
751
|
-
/* @__PURE__ */
|
|
751
|
+
/* @__PURE__ */ t.jsx(
|
|
752
752
|
"div",
|
|
753
753
|
{
|
|
754
754
|
className: "flex gap-2 justify-center",
|
|
755
755
|
role: "group",
|
|
756
|
-
"aria-labelledby":
|
|
757
|
-
"aria-describedby":
|
|
758
|
-
children:
|
|
759
|
-
|
|
756
|
+
"aria-labelledby": e ? `${g}-label` : void 0,
|
|
757
|
+
"aria-describedby": y ? `${g}-error` : r ? `${g}-helper` : void 0,
|
|
758
|
+
children: S.map((I, v) => /* @__PURE__ */ t.jsx(
|
|
759
|
+
te,
|
|
760
760
|
{
|
|
761
|
-
value:
|
|
762
|
-
onChange: (
|
|
763
|
-
onKeyDown: (
|
|
761
|
+
value: I,
|
|
762
|
+
onChange: (j) => E(v, j),
|
|
763
|
+
onKeyDown: (j) => z(v, j),
|
|
764
764
|
onFocus: () => {
|
|
765
|
-
const
|
|
766
|
-
|
|
765
|
+
const j = k.current[v];
|
|
766
|
+
j && j.select();
|
|
767
767
|
},
|
|
768
|
-
onPaste:
|
|
768
|
+
onPaste: V,
|
|
769
769
|
disabled: s,
|
|
770
|
-
error:
|
|
770
|
+
error: y,
|
|
771
771
|
secure: f,
|
|
772
|
-
inputRef: (
|
|
773
|
-
|
|
772
|
+
inputRef: (j) => {
|
|
773
|
+
k.current[v] = j;
|
|
774
774
|
},
|
|
775
|
-
index:
|
|
776
|
-
id: `${g}-${
|
|
775
|
+
index: v,
|
|
776
|
+
id: `${g}-${v}`
|
|
777
777
|
},
|
|
778
|
-
|
|
778
|
+
v
|
|
779
779
|
))
|
|
780
780
|
}
|
|
781
781
|
),
|
|
782
|
-
u && /* @__PURE__ */
|
|
782
|
+
u && /* @__PURE__ */ t.jsx(
|
|
783
783
|
"input",
|
|
784
784
|
{
|
|
785
785
|
type: "hidden",
|
|
786
786
|
name: u,
|
|
787
|
-
value:
|
|
788
|
-
required:
|
|
787
|
+
value: C,
|
|
788
|
+
required: m
|
|
789
789
|
}
|
|
790
790
|
),
|
|
791
|
-
|
|
791
|
+
y && /* @__PURE__ */ t.jsx(
|
|
792
792
|
"div",
|
|
793
793
|
{
|
|
794
794
|
id: `${g}-error`,
|
|
795
795
|
className: "mt-2 text-sm text-danger",
|
|
796
796
|
role: "alert",
|
|
797
|
-
children:
|
|
797
|
+
children: n
|
|
798
798
|
}
|
|
799
799
|
),
|
|
800
|
-
!
|
|
800
|
+
!y && r && /* @__PURE__ */ t.jsx("div", { id: `${g}-helper`, className: "mt-2 text-sm text-gray-600", children: r })
|
|
801
801
|
] });
|
|
802
802
|
}
|
|
803
803
|
);
|
|
804
|
-
|
|
805
|
-
function
|
|
806
|
-
|
|
807
|
-
typeof
|
|
808
|
-
}, [
|
|
804
|
+
et.displayName = "PinField";
|
|
805
|
+
function tt(e, r) {
|
|
806
|
+
_(() => {
|
|
807
|
+
typeof e == "number" && !isNaN(e) ? r(`${e}`) : e === "" || e === null || e === void 0 ? r("") : typeof e == "string" && r(e);
|
|
808
|
+
}, [e, r]);
|
|
809
809
|
}
|
|
810
|
-
function
|
|
811
|
-
if (
|
|
812
|
-
const
|
|
813
|
-
if (r &&
|
|
814
|
-
if (
|
|
815
|
-
const s =
|
|
810
|
+
function rt(e, r = !1) {
|
|
811
|
+
if (e === "" || e === "-" && r) return !0;
|
|
812
|
+
const n = r && e.startsWith("-") ? e.slice(1) : e;
|
|
813
|
+
if (r && e.startsWith("-") && n === "") return !0;
|
|
814
|
+
if (n.startsWith(".") || n.startsWith(",") || !/^[\d.,]+$/.test(n)) return !1;
|
|
815
|
+
const s = n.split(",");
|
|
816
816
|
if (s.length > 2) return !1;
|
|
817
|
-
const
|
|
818
|
-
return !(
|
|
817
|
+
const a = s[0], i = s[1];
|
|
818
|
+
return !(a === "" || !nt(a) || i !== void 0 && i !== "" && !at(i));
|
|
819
819
|
}
|
|
820
|
-
function
|
|
821
|
-
if (
|
|
822
|
-
if (!
|
|
823
|
-
return /^\d+$/.test(
|
|
824
|
-
const r =
|
|
820
|
+
function nt(e) {
|
|
821
|
+
if (e === "") return !1;
|
|
822
|
+
if (!e.includes("."))
|
|
823
|
+
return /^\d+$/.test(e);
|
|
824
|
+
const r = e.split(".");
|
|
825
825
|
if (r[0] === "" || !/^\d{1,3}$/.test(r[0])) return !1;
|
|
826
|
-
for (let
|
|
827
|
-
const s = r[
|
|
828
|
-
if (
|
|
826
|
+
for (let n = 1; n < r.length; n++) {
|
|
827
|
+
const s = r[n];
|
|
828
|
+
if (n === r.length - 1) {
|
|
829
829
|
if (s !== "" && !/^\d{1,3}$/.test(s)) return !1;
|
|
830
830
|
} else if (!/^\d{3}$/.test(s)) return !1;
|
|
831
831
|
}
|
|
832
832
|
return !0;
|
|
833
833
|
}
|
|
834
|
-
function
|
|
835
|
-
return /^\d{1,2}$/.test(
|
|
834
|
+
function at(e) {
|
|
835
|
+
return /^\d{1,2}$/.test(e);
|
|
836
836
|
}
|
|
837
|
-
function
|
|
838
|
-
if (
|
|
839
|
-
const
|
|
840
|
-
if (
|
|
841
|
-
return
|
|
842
|
-
if (
|
|
843
|
-
let
|
|
844
|
-
const
|
|
845
|
-
if (
|
|
846
|
-
const d =
|
|
847
|
-
|
|
837
|
+
function re(e, r = !1) {
|
|
838
|
+
if (e === "") return "";
|
|
839
|
+
const n = e.startsWith("-");
|
|
840
|
+
if (n && !r)
|
|
841
|
+
return re(e.slice(1), !1);
|
|
842
|
+
if (n && e.length === 1) return "-";
|
|
843
|
+
let a = (n ? e.slice(1) : e).replace(/[^\d.,]/g, "");
|
|
844
|
+
const i = a.lastIndexOf(",");
|
|
845
|
+
if (i !== -1) {
|
|
846
|
+
const d = a.slice(0, i).replace(/,/g, ""), l = a.slice(i + 1).replace(/,/g, "");
|
|
847
|
+
a = d + "," + l;
|
|
848
848
|
}
|
|
849
|
-
return
|
|
849
|
+
return a = a.replace(/\.{2,}/g, "."), (n ? "-" : "") + a;
|
|
850
850
|
}
|
|
851
|
-
const
|
|
852
|
-
value:
|
|
851
|
+
const qt = ({
|
|
852
|
+
value: e,
|
|
853
853
|
onChange: r,
|
|
854
|
-
allowNegative:
|
|
854
|
+
allowNegative: n = !1,
|
|
855
855
|
inputProps: s,
|
|
856
|
-
label:
|
|
857
|
-
helperText:
|
|
856
|
+
label: a,
|
|
857
|
+
helperText: i,
|
|
858
858
|
error: d,
|
|
859
859
|
...l
|
|
860
860
|
}) => {
|
|
861
|
-
const c =
|
|
862
|
-
|
|
861
|
+
const c = G(null), [o, u] = K(
|
|
862
|
+
e === "" ? "" : String(e)
|
|
863
863
|
);
|
|
864
|
-
|
|
865
|
-
const
|
|
866
|
-
const h = f.target.value, b =
|
|
867
|
-
|
|
864
|
+
tt(e, u);
|
|
865
|
+
const m = (f) => {
|
|
866
|
+
const h = f.target.value, b = re(h, n);
|
|
867
|
+
rt(b, n) ? (u(b), r(b)) : f.preventDefault();
|
|
868
868
|
};
|
|
869
|
-
return /* @__PURE__ */
|
|
870
|
-
|
|
869
|
+
return /* @__PURE__ */ t.jsx(
|
|
870
|
+
F,
|
|
871
871
|
{
|
|
872
872
|
ref: c,
|
|
873
873
|
type: "text",
|
|
874
|
-
label:
|
|
875
|
-
value:
|
|
876
|
-
onChange:
|
|
874
|
+
label: a,
|
|
875
|
+
value: o,
|
|
876
|
+
onChange: m,
|
|
877
877
|
error: d,
|
|
878
|
-
helperText:
|
|
878
|
+
helperText: i,
|
|
879
879
|
placeholder: l.placeholder,
|
|
880
|
-
leftContent: /* @__PURE__ */
|
|
880
|
+
leftContent: /* @__PURE__ */ t.jsx(P, { as: ve, color: "inherit", size: "sm" }),
|
|
881
881
|
inputMode: "numeric",
|
|
882
882
|
autoComplete: "off",
|
|
883
883
|
pattern: "[0-9.,-]*",
|
|
@@ -885,7 +885,7 @@ const ht = ({
|
|
|
885
885
|
...l
|
|
886
886
|
}
|
|
887
887
|
);
|
|
888
|
-
},
|
|
888
|
+
}, st = N("space-y-2", {
|
|
889
889
|
variants: {
|
|
890
890
|
direction: {
|
|
891
891
|
vertical: "space-y-2 space-x-0",
|
|
@@ -895,7 +895,7 @@ const ht = ({
|
|
|
895
895
|
defaultVariants: {
|
|
896
896
|
direction: "vertical"
|
|
897
897
|
}
|
|
898
|
-
}),
|
|
898
|
+
}), ot = N(
|
|
899
899
|
"relative h-4 w-4 rounded-full border cursor-pointer transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed appearance-none bg-white",
|
|
900
900
|
{
|
|
901
901
|
variants: {
|
|
@@ -933,7 +933,7 @@ const ht = ({
|
|
|
933
933
|
size: "md"
|
|
934
934
|
}
|
|
935
935
|
}
|
|
936
|
-
),
|
|
936
|
+
), it = N(
|
|
937
937
|
"text-foreground cursor-pointer select-none",
|
|
938
938
|
{
|
|
939
939
|
variants: {
|
|
@@ -952,30 +952,30 @@ const ht = ({
|
|
|
952
952
|
disabled: !1
|
|
953
953
|
}
|
|
954
954
|
}
|
|
955
|
-
),
|
|
955
|
+
), ne = M(
|
|
956
956
|
null
|
|
957
|
-
),
|
|
958
|
-
const
|
|
959
|
-
if (!
|
|
957
|
+
), ct = () => {
|
|
958
|
+
const e = A(ne);
|
|
959
|
+
if (!e)
|
|
960
960
|
throw new Error(
|
|
961
961
|
"useRadioInputContext must be used within RadioInputContext"
|
|
962
962
|
);
|
|
963
|
-
return
|
|
964
|
-
},
|
|
965
|
-
({ children:
|
|
966
|
-
const c =
|
|
967
|
-
return /* @__PURE__ */
|
|
968
|
-
/* @__PURE__ */
|
|
963
|
+
return e;
|
|
964
|
+
}, lt = p.forwardRef(
|
|
965
|
+
({ children: e, description: r, className: n, disabled: s, id: a, value: i, ...d }, l) => {
|
|
966
|
+
const c = ct(), o = p.useId(), u = a || o, m = s || c.disabled, f = c.error ? "danger" : c.variant || "primary";
|
|
967
|
+
return /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
968
|
+
/* @__PURE__ */ t.jsx("div", { className: "relative flex items-center", children: /* @__PURE__ */ t.jsx(
|
|
969
969
|
"input",
|
|
970
970
|
{
|
|
971
971
|
ref: l,
|
|
972
972
|
type: "radio",
|
|
973
973
|
id: u,
|
|
974
974
|
name: c.name,
|
|
975
|
-
value:
|
|
976
|
-
disabled:
|
|
975
|
+
value: i,
|
|
976
|
+
disabled: m,
|
|
977
977
|
className: x(
|
|
978
|
-
|
|
978
|
+
ot({
|
|
979
979
|
variant: f,
|
|
980
980
|
size: c.size
|
|
981
981
|
}),
|
|
@@ -988,24 +988,24 @@ const ht = ({
|
|
|
988
988
|
"checked:before:opacity-100",
|
|
989
989
|
// Outline variants use colored radio dot
|
|
990
990
|
f?.includes("outline") && "checked:before:bg-current",
|
|
991
|
-
|
|
991
|
+
n
|
|
992
992
|
),
|
|
993
993
|
...d
|
|
994
994
|
}
|
|
995
995
|
) }),
|
|
996
|
-
/* @__PURE__ */
|
|
997
|
-
/* @__PURE__ */
|
|
996
|
+
/* @__PURE__ */ t.jsxs("div", { className: "flex-1", children: [
|
|
997
|
+
/* @__PURE__ */ t.jsx(
|
|
998
998
|
"label",
|
|
999
999
|
{
|
|
1000
1000
|
htmlFor: u,
|
|
1001
|
-
className:
|
|
1001
|
+
className: it({
|
|
1002
1002
|
size: c.size,
|
|
1003
|
-
disabled:
|
|
1003
|
+
disabled: m
|
|
1004
1004
|
}),
|
|
1005
|
-
children:
|
|
1005
|
+
children: e
|
|
1006
1006
|
}
|
|
1007
1007
|
),
|
|
1008
|
-
r && /* @__PURE__ */
|
|
1008
|
+
r && /* @__PURE__ */ t.jsx(
|
|
1009
1009
|
"div",
|
|
1010
1010
|
{
|
|
1011
1011
|
className: x(
|
|
@@ -1013,7 +1013,7 @@ const ht = ({
|
|
|
1013
1013
|
c.size === "sm" && "text-xs",
|
|
1014
1014
|
c.size === "md" && "text-xs",
|
|
1015
1015
|
c.size === "lg" && "text-sm",
|
|
1016
|
-
|
|
1016
|
+
m && "opacity-50"
|
|
1017
1017
|
),
|
|
1018
1018
|
children: r
|
|
1019
1019
|
}
|
|
@@ -1021,64 +1021,64 @@ const ht = ({
|
|
|
1021
1021
|
] })
|
|
1022
1022
|
] });
|
|
1023
1023
|
}
|
|
1024
|
-
),
|
|
1024
|
+
), dt = p.forwardRef(
|
|
1025
1025
|
({
|
|
1026
|
-
variant:
|
|
1026
|
+
variant: e = "primary",
|
|
1027
1027
|
size: r = "md",
|
|
1028
|
-
label:
|
|
1028
|
+
label: n,
|
|
1029
1029
|
helperText: s,
|
|
1030
|
-
error:
|
|
1031
|
-
direction:
|
|
1030
|
+
error: a,
|
|
1031
|
+
direction: i = "vertical",
|
|
1032
1032
|
className: d,
|
|
1033
1033
|
disabled: l,
|
|
1034
1034
|
name: c,
|
|
1035
|
-
children:
|
|
1035
|
+
children: o,
|
|
1036
1036
|
...u
|
|
1037
|
-
},
|
|
1038
|
-
const f = !!
|
|
1039
|
-
variant:
|
|
1037
|
+
}, m) => {
|
|
1038
|
+
const f = !!a, h = {
|
|
1039
|
+
variant: e,
|
|
1040
1040
|
size: r,
|
|
1041
1041
|
disabled: l,
|
|
1042
1042
|
error: f,
|
|
1043
1043
|
name: c
|
|
1044
1044
|
};
|
|
1045
|
-
return /* @__PURE__ */
|
|
1046
|
-
|
|
1047
|
-
/* @__PURE__ */
|
|
1048
|
-
f && /* @__PURE__ */
|
|
1049
|
-
!f && s && /* @__PURE__ */
|
|
1045
|
+
return /* @__PURE__ */ t.jsx(ne.Provider, { value: h, children: /* @__PURE__ */ t.jsxs("div", { ref: m, className: x("w-full", d), ...u, children: [
|
|
1046
|
+
n && /* @__PURE__ */ t.jsx("div", { className: "block text-sm font-medium text-foreground mb-3", children: n }),
|
|
1047
|
+
/* @__PURE__ */ t.jsx("div", { className: st({ direction: i }), children: o }),
|
|
1048
|
+
f && /* @__PURE__ */ t.jsx("div", { className: "mt-2 text-sm text-danger", role: "alert", children: a }),
|
|
1049
|
+
!f && s && /* @__PURE__ */ t.jsx("div", { className: "mt-2 text-sm text-gray-600", children: s })
|
|
1050
1050
|
] }) });
|
|
1051
1051
|
}
|
|
1052
|
-
),
|
|
1053
|
-
Option:
|
|
1054
|
-
}),
|
|
1052
|
+
), Ht = Object.assign(dt, {
|
|
1053
|
+
Option: lt
|
|
1054
|
+
}), Wt = $(
|
|
1055
1055
|
({
|
|
1056
|
-
autoComplete:
|
|
1056
|
+
autoComplete: e = "off",
|
|
1057
1057
|
spellCheck: r = !1,
|
|
1058
|
-
inputMode:
|
|
1058
|
+
inputMode: n = "search",
|
|
1059
1059
|
placeholder: s = "Search...",
|
|
1060
|
-
maxLength:
|
|
1061
|
-
enterKeyHint:
|
|
1060
|
+
maxLength: a = 256,
|
|
1061
|
+
enterKeyHint: i = "search",
|
|
1062
1062
|
"aria-label": d = "Search",
|
|
1063
1063
|
// internal default, not in props
|
|
1064
1064
|
...l
|
|
1065
|
-
}, c) => /* @__PURE__ */
|
|
1066
|
-
|
|
1065
|
+
}, c) => /* @__PURE__ */ t.jsx(
|
|
1066
|
+
F,
|
|
1067
1067
|
{
|
|
1068
1068
|
ref: c,
|
|
1069
1069
|
type: "search",
|
|
1070
|
-
inputMode:
|
|
1071
|
-
autoComplete:
|
|
1070
|
+
inputMode: n,
|
|
1071
|
+
autoComplete: e,
|
|
1072
1072
|
spellCheck: r,
|
|
1073
1073
|
placeholder: s,
|
|
1074
|
-
maxLength:
|
|
1075
|
-
enterKeyHint:
|
|
1074
|
+
maxLength: a,
|
|
1075
|
+
enterKeyHint: i,
|
|
1076
1076
|
"aria-label": d,
|
|
1077
|
-
leftContent: /* @__PURE__ */
|
|
1077
|
+
leftContent: /* @__PURE__ */ t.jsx(P, { as: je, color: "inherit", size: "sm" }),
|
|
1078
1078
|
...l
|
|
1079
1079
|
}
|
|
1080
1080
|
)
|
|
1081
|
-
),
|
|
1081
|
+
), ut = N(
|
|
1082
1082
|
"block w-full rounded-md border bg-white transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:pointer-events-none disabled:bg-gray-50 appearance-none bg-no-repeat bg-right pr-10",
|
|
1083
1083
|
{
|
|
1084
1084
|
variants: {
|
|
@@ -1092,95 +1092,95 @@ const ht = ({
|
|
|
1092
1092
|
state: "default"
|
|
1093
1093
|
}
|
|
1094
1094
|
}
|
|
1095
|
-
),
|
|
1096
|
-
|
|
1097
|
-
const
|
|
1098
|
-
|
|
1099
|
-
const
|
|
1095
|
+
), ae = p.forwardRef(({ value: e, children: r, ...n }, s) => /* @__PURE__ */ t.jsx("option", { ref: s, value: e, ...n, children: r }));
|
|
1096
|
+
ae.displayName = "SelectOption";
|
|
1097
|
+
const se = p.forwardRef(({ label: e, children: r, ...n }, s) => /* @__PURE__ */ t.jsx("optgroup", { ref: s, label: e, ...n, children: r }));
|
|
1098
|
+
se.displayName = "SelectOptionGroup";
|
|
1099
|
+
const oe = p.forwardRef(
|
|
1100
1100
|
({
|
|
1101
|
-
label:
|
|
1101
|
+
label: e,
|
|
1102
1102
|
helperText: r,
|
|
1103
|
-
error:
|
|
1103
|
+
error: n,
|
|
1104
1104
|
className: s,
|
|
1105
|
-
disabled:
|
|
1106
|
-
readOnly:
|
|
1105
|
+
disabled: a,
|
|
1106
|
+
readOnly: i,
|
|
1107
1107
|
id: d,
|
|
1108
1108
|
required: l,
|
|
1109
1109
|
placeholder: c,
|
|
1110
|
-
children:
|
|
1110
|
+
children: o,
|
|
1111
1111
|
onChange: u,
|
|
1112
|
-
...
|
|
1112
|
+
...m
|
|
1113
1113
|
}, f) => {
|
|
1114
|
-
const h =
|
|
1115
|
-
const
|
|
1116
|
-
return
|
|
1117
|
-
}, [
|
|
1118
|
-
return /* @__PURE__ */
|
|
1119
|
-
|
|
1114
|
+
const h = p.useId(), b = d || h, w = `${b}-helper`, g = `${b}-error`, y = !!n, k = p.useMemo(() => {
|
|
1115
|
+
const C = [];
|
|
1116
|
+
return y ? C.push(g) : r && C.push(w), C.length > 0 ? C.join(" ") : void 0;
|
|
1117
|
+
}, [y, r, g, w]);
|
|
1118
|
+
return /* @__PURE__ */ t.jsxs("div", { className: x("w-full", s), children: [
|
|
1119
|
+
e && /* @__PURE__ */ t.jsxs(
|
|
1120
1120
|
"label",
|
|
1121
1121
|
{
|
|
1122
1122
|
htmlFor: b,
|
|
1123
1123
|
className: "block text-sm font-medium text-foreground mb-2",
|
|
1124
1124
|
children: [
|
|
1125
|
-
|
|
1126
|
-
l && /* @__PURE__ */
|
|
1125
|
+
e,
|
|
1126
|
+
l && /* @__PURE__ */ t.jsx("span", { className: "text-danger ml-1", "aria-label": "required", children: "*" })
|
|
1127
1127
|
]
|
|
1128
1128
|
}
|
|
1129
1129
|
),
|
|
1130
|
-
/* @__PURE__ */
|
|
1131
|
-
/* @__PURE__ */
|
|
1130
|
+
/* @__PURE__ */ t.jsxs("div", { className: "relative w-full", children: [
|
|
1131
|
+
/* @__PURE__ */ t.jsxs(
|
|
1132
1132
|
"select",
|
|
1133
1133
|
{
|
|
1134
1134
|
ref: f,
|
|
1135
1135
|
id: b,
|
|
1136
1136
|
required: l,
|
|
1137
|
-
disabled:
|
|
1138
|
-
"aria-invalid":
|
|
1139
|
-
"aria-describedby":
|
|
1140
|
-
"aria-errormessage":
|
|
1137
|
+
disabled: a || i,
|
|
1138
|
+
"aria-invalid": y,
|
|
1139
|
+
"aria-describedby": k,
|
|
1140
|
+
"aria-errormessage": y ? g : void 0,
|
|
1141
1141
|
onChange: u,
|
|
1142
1142
|
className: x(
|
|
1143
|
-
|
|
1144
|
-
state:
|
|
1143
|
+
ut({
|
|
1144
|
+
state: y ? "error" : i ? "readOnly" : "default"
|
|
1145
1145
|
}),
|
|
1146
1146
|
"h-9 pl-3"
|
|
1147
1147
|
),
|
|
1148
|
-
...
|
|
1148
|
+
...m,
|
|
1149
1149
|
children: [
|
|
1150
|
-
c && /* @__PURE__ */
|
|
1151
|
-
|
|
1150
|
+
c && /* @__PURE__ */ t.jsx("option", { value: "", disabled: !0, hidden: !0, children: c }),
|
|
1151
|
+
o
|
|
1152
1152
|
]
|
|
1153
1153
|
}
|
|
1154
1154
|
),
|
|
1155
|
-
/* @__PURE__ */
|
|
1155
|
+
/* @__PURE__ */ t.jsx(
|
|
1156
1156
|
"div",
|
|
1157
1157
|
{
|
|
1158
1158
|
className: x(
|
|
1159
1159
|
"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none transition-transform duration-200"
|
|
1160
1160
|
),
|
|
1161
|
-
children: /* @__PURE__ */
|
|
1161
|
+
children: /* @__PURE__ */ t.jsx(P, { as: Ie, size: "sm", color: "gray", "aria-hidden": "true" })
|
|
1162
1162
|
}
|
|
1163
1163
|
)
|
|
1164
1164
|
] }),
|
|
1165
|
-
|
|
1165
|
+
y && /* @__PURE__ */ t.jsx(
|
|
1166
1166
|
"div",
|
|
1167
1167
|
{
|
|
1168
1168
|
id: g,
|
|
1169
1169
|
className: "mt-1 text-sm text-danger",
|
|
1170
1170
|
role: "alert",
|
|
1171
1171
|
"aria-live": "polite",
|
|
1172
|
-
children:
|
|
1172
|
+
children: n
|
|
1173
1173
|
}
|
|
1174
1174
|
),
|
|
1175
|
-
!
|
|
1175
|
+
!y && r && /* @__PURE__ */ t.jsx("div", { id: w, className: "mt-1 text-sm text-gray-600", children: r })
|
|
1176
1176
|
] });
|
|
1177
1177
|
}
|
|
1178
1178
|
);
|
|
1179
|
-
|
|
1180
|
-
const
|
|
1181
|
-
Option:
|
|
1182
|
-
OptionGroup:
|
|
1183
|
-
}),
|
|
1179
|
+
oe.displayName = "SelectInput";
|
|
1180
|
+
const Ut = Object.assign(oe, {
|
|
1181
|
+
Option: ae,
|
|
1182
|
+
OptionGroup: se
|
|
1183
|
+
}), ft = N(
|
|
1184
1184
|
"flex gap-3 cursor-pointer border-b border-border select-none transition-colors",
|
|
1185
1185
|
{
|
|
1186
1186
|
variants: {
|
|
@@ -1209,7 +1209,7 @@ const xt = Object.assign(ee, {
|
|
|
1209
1209
|
hideCheckbox: !1
|
|
1210
1210
|
}
|
|
1211
1211
|
}
|
|
1212
|
-
),
|
|
1212
|
+
), mt = N(
|
|
1213
1213
|
"relative h-6 w-6 rounded border cursor-pointer transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 appearance-none bg-white border-primary/40 checked:bg-primary checked:border-primary focus:ring-primary/20",
|
|
1214
1214
|
{
|
|
1215
1215
|
variants: {
|
|
@@ -1227,77 +1227,77 @@ const xt = Object.assign(ee, {
|
|
|
1227
1227
|
disabled: !1
|
|
1228
1228
|
}
|
|
1229
1229
|
}
|
|
1230
|
-
),
|
|
1230
|
+
), pt = $(
|
|
1231
1231
|
({
|
|
1232
|
-
value:
|
|
1232
|
+
value: e,
|
|
1233
1233
|
children: r,
|
|
1234
|
-
checked:
|
|
1234
|
+
checked: n,
|
|
1235
1235
|
id: s,
|
|
1236
|
-
className:
|
|
1237
|
-
disabled:
|
|
1236
|
+
className: a,
|
|
1237
|
+
disabled: i,
|
|
1238
1238
|
checkboxPlacement: d = "center",
|
|
1239
1239
|
hideCheckbox: l = !1,
|
|
1240
1240
|
...c
|
|
1241
|
-
},
|
|
1242
|
-
const u =
|
|
1243
|
-
return /* @__PURE__ */
|
|
1241
|
+
}, o) => {
|
|
1242
|
+
const u = T(), m = s || u, f = typeof r == "function" ? r(n) : r;
|
|
1243
|
+
return /* @__PURE__ */ t.jsxs(
|
|
1244
1244
|
"label",
|
|
1245
1245
|
{
|
|
1246
|
-
htmlFor:
|
|
1246
|
+
htmlFor: m,
|
|
1247
1247
|
className: x(
|
|
1248
|
-
|
|
1249
|
-
checked: !!
|
|
1250
|
-
disabled: !!
|
|
1248
|
+
ft({
|
|
1249
|
+
checked: !!n,
|
|
1250
|
+
disabled: !!i,
|
|
1251
1251
|
checkboxPlacement: d,
|
|
1252
1252
|
hideCheckbox: l
|
|
1253
1253
|
}),
|
|
1254
|
-
|
|
1254
|
+
a
|
|
1255
1255
|
),
|
|
1256
|
-
"aria-checked":
|
|
1256
|
+
"aria-checked": n,
|
|
1257
1257
|
role: "radio",
|
|
1258
|
-
"aria-label": `Select ${
|
|
1259
|
-
tabIndex:
|
|
1258
|
+
"aria-label": `Select ${e}`,
|
|
1259
|
+
tabIndex: i ? -1 : 0,
|
|
1260
1260
|
children: [
|
|
1261
|
-
/* @__PURE__ */
|
|
1261
|
+
/* @__PURE__ */ t.jsx(
|
|
1262
1262
|
"input",
|
|
1263
1263
|
{
|
|
1264
|
-
ref:
|
|
1265
|
-
id:
|
|
1264
|
+
ref: o,
|
|
1265
|
+
id: m,
|
|
1266
1266
|
type: "radio",
|
|
1267
|
-
value:
|
|
1268
|
-
checked:
|
|
1269
|
-
disabled:
|
|
1267
|
+
value: e,
|
|
1268
|
+
checked: n,
|
|
1269
|
+
disabled: i,
|
|
1270
1270
|
className: "sr-only",
|
|
1271
1271
|
"aria-hidden": !0,
|
|
1272
|
-
"aria-checked":
|
|
1272
|
+
"aria-checked": n,
|
|
1273
1273
|
...c
|
|
1274
1274
|
}
|
|
1275
1275
|
),
|
|
1276
|
-
!l && /* @__PURE__ */
|
|
1276
|
+
!l && /* @__PURE__ */ t.jsx(
|
|
1277
1277
|
"span",
|
|
1278
1278
|
{
|
|
1279
1279
|
className: x(
|
|
1280
|
-
|
|
1281
|
-
checked: !!
|
|
1282
|
-
disabled: !!
|
|
1280
|
+
mt({
|
|
1281
|
+
checked: !!n,
|
|
1282
|
+
disabled: !!i
|
|
1283
1283
|
}),
|
|
1284
1284
|
// Custom checkmark styling using ::after - centered positioning
|
|
1285
1285
|
'after:content-[""] after:absolute after:left-1/2 after:top-[45%] after:-translate-x-1/2 after:-translate-y-1/2 after:border-b-2 after:border-r-2 after:border-white after:rotate-45 after:opacity-0 after:transition-opacity after:duration-200',
|
|
1286
1286
|
// Checkmark dimensions scaled up for h-6 w-6 size
|
|
1287
1287
|
"after:w-[6px] after:h-[12px]",
|
|
1288
|
-
|
|
1288
|
+
n && "after:opacity-100"
|
|
1289
1289
|
),
|
|
1290
1290
|
"aria-hidden": "true"
|
|
1291
1291
|
}
|
|
1292
1292
|
),
|
|
1293
|
-
/* @__PURE__ */
|
|
1293
|
+
/* @__PURE__ */ t.jsx("span", { className: "flex-1 min-w-0 text-base text-foreground", children: f })
|
|
1294
1294
|
]
|
|
1295
1295
|
}
|
|
1296
1296
|
);
|
|
1297
1297
|
}
|
|
1298
1298
|
);
|
|
1299
|
-
|
|
1300
|
-
const
|
|
1299
|
+
pt.displayName = "SelectableSingleInput";
|
|
1300
|
+
const ht = N(
|
|
1301
1301
|
"flex gap-3 cursor-pointer border-b border-border select-none transition-colors",
|
|
1302
1302
|
{
|
|
1303
1303
|
variants: {
|
|
@@ -1326,7 +1326,7 @@ const Ke = C(
|
|
|
1326
1326
|
hideCheckbox: !1
|
|
1327
1327
|
}
|
|
1328
1328
|
}
|
|
1329
|
-
),
|
|
1329
|
+
), bt = N(
|
|
1330
1330
|
"relative h-6 w-6 rounded border cursor-pointer transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 appearance-none bg-white border-primary/40 checked:bg-primary checked:border-primary focus:ring-primary/20",
|
|
1331
1331
|
{
|
|
1332
1332
|
variants: {
|
|
@@ -1344,77 +1344,77 @@ const Ke = C(
|
|
|
1344
1344
|
disabled: !1
|
|
1345
1345
|
}
|
|
1346
1346
|
}
|
|
1347
|
-
),
|
|
1347
|
+
), gt = $(
|
|
1348
1348
|
({
|
|
1349
|
-
value:
|
|
1349
|
+
value: e,
|
|
1350
1350
|
children: r,
|
|
1351
|
-
checked:
|
|
1351
|
+
checked: n,
|
|
1352
1352
|
id: s,
|
|
1353
|
-
className:
|
|
1354
|
-
disabled:
|
|
1353
|
+
className: a,
|
|
1354
|
+
disabled: i,
|
|
1355
1355
|
checkboxPlacement: d = "center",
|
|
1356
1356
|
hideCheckbox: l = !1,
|
|
1357
1357
|
...c
|
|
1358
|
-
},
|
|
1359
|
-
const u =
|
|
1360
|
-
return /* @__PURE__ */
|
|
1358
|
+
}, o) => {
|
|
1359
|
+
const u = T(), m = s || u, f = typeof r == "function" ? r(n) : r;
|
|
1360
|
+
return /* @__PURE__ */ t.jsxs(
|
|
1361
1361
|
"label",
|
|
1362
1362
|
{
|
|
1363
|
-
htmlFor:
|
|
1363
|
+
htmlFor: m,
|
|
1364
1364
|
className: x(
|
|
1365
|
-
|
|
1366
|
-
checked: !!
|
|
1367
|
-
disabled: !!
|
|
1365
|
+
ht({
|
|
1366
|
+
checked: !!n,
|
|
1367
|
+
disabled: !!i,
|
|
1368
1368
|
checkboxPlacement: d,
|
|
1369
1369
|
hideCheckbox: l
|
|
1370
1370
|
}),
|
|
1371
|
-
|
|
1371
|
+
a
|
|
1372
1372
|
),
|
|
1373
|
-
"aria-checked":
|
|
1373
|
+
"aria-checked": n,
|
|
1374
1374
|
role: "checkbox",
|
|
1375
|
-
"aria-label": `Select ${
|
|
1376
|
-
tabIndex:
|
|
1375
|
+
"aria-label": `Select ${e}`,
|
|
1376
|
+
tabIndex: i ? -1 : 0,
|
|
1377
1377
|
children: [
|
|
1378
|
-
/* @__PURE__ */
|
|
1378
|
+
/* @__PURE__ */ t.jsx(
|
|
1379
1379
|
"input",
|
|
1380
1380
|
{
|
|
1381
|
-
ref:
|
|
1382
|
-
id:
|
|
1381
|
+
ref: o,
|
|
1382
|
+
id: m,
|
|
1383
1383
|
type: "checkbox",
|
|
1384
|
-
value:
|
|
1385
|
-
checked:
|
|
1386
|
-
disabled:
|
|
1384
|
+
value: e,
|
|
1385
|
+
checked: n,
|
|
1386
|
+
disabled: i,
|
|
1387
1387
|
className: "sr-only",
|
|
1388
1388
|
"aria-hidden": !0,
|
|
1389
|
-
"aria-checked":
|
|
1389
|
+
"aria-checked": n,
|
|
1390
1390
|
...c
|
|
1391
1391
|
}
|
|
1392
1392
|
),
|
|
1393
|
-
!l && /* @__PURE__ */
|
|
1393
|
+
!l && /* @__PURE__ */ t.jsx(
|
|
1394
1394
|
"span",
|
|
1395
1395
|
{
|
|
1396
1396
|
className: x(
|
|
1397
|
-
|
|
1398
|
-
checked: !!
|
|
1399
|
-
disabled: !!
|
|
1397
|
+
bt({
|
|
1398
|
+
checked: !!n,
|
|
1399
|
+
disabled: !!i
|
|
1400
1400
|
}),
|
|
1401
1401
|
// Custom checkmark styling using ::after - centered positioning
|
|
1402
1402
|
'after:content-[""] after:absolute after:left-1/2 after:top-[45%] after:-translate-x-1/2 after:-translate-y-1/2 after:border-b-2 after:border-r-2 after:border-white after:rotate-45 after:opacity-0 after:transition-opacity after:duration-200',
|
|
1403
1403
|
// Checkmark dimensions scaled up for h-6 w-6 size
|
|
1404
1404
|
"after:w-[6px] after:h-[12px]",
|
|
1405
|
-
|
|
1405
|
+
n && "after:opacity-100"
|
|
1406
1406
|
),
|
|
1407
1407
|
"aria-hidden": "true"
|
|
1408
1408
|
}
|
|
1409
1409
|
),
|
|
1410
|
-
/* @__PURE__ */
|
|
1410
|
+
/* @__PURE__ */ t.jsx("span", { className: "flex-1 min-w-0 text-base text-foreground", children: f })
|
|
1411
1411
|
]
|
|
1412
1412
|
}
|
|
1413
1413
|
);
|
|
1414
1414
|
}
|
|
1415
1415
|
);
|
|
1416
|
-
|
|
1417
|
-
const
|
|
1416
|
+
gt.displayName = "SelectableMultipleInput";
|
|
1417
|
+
const xt = N(
|
|
1418
1418
|
"relative inline-flex items-center h-5 w-10 rounded-full transition-colors duration-200 border border-transparent",
|
|
1419
1419
|
{
|
|
1420
1420
|
variants: {
|
|
@@ -1432,7 +1432,7 @@ const Je = C(
|
|
|
1432
1432
|
checked: !1
|
|
1433
1433
|
}
|
|
1434
1434
|
}
|
|
1435
|
-
),
|
|
1435
|
+
), yt = N(
|
|
1436
1436
|
"absolute h-4 w-4 rounded-full transition-transform duration-200",
|
|
1437
1437
|
{
|
|
1438
1438
|
variants: {
|
|
@@ -1445,80 +1445,80 @@ const Je = C(
|
|
|
1445
1445
|
checked: !1
|
|
1446
1446
|
}
|
|
1447
1447
|
}
|
|
1448
|
-
),
|
|
1448
|
+
), wt = ({ disabled: e = !1, checked: r = !1, className: n }) => /* @__PURE__ */ t.jsx(
|
|
1449
1449
|
"span",
|
|
1450
1450
|
{
|
|
1451
1451
|
className: x(
|
|
1452
|
-
|
|
1452
|
+
xt({ disabled: e, checked: r }),
|
|
1453
1453
|
"pointer-events-none",
|
|
1454
|
-
|
|
1454
|
+
n
|
|
1455
1455
|
),
|
|
1456
1456
|
"aria-hidden": "true"
|
|
1457
1457
|
}
|
|
1458
|
-
),
|
|
1458
|
+
), kt = ({ checked: e = !1 }) => /* @__PURE__ */ t.jsx("span", { className: x(yt({ checked: e })), "aria-hidden": "true" }), vt = ({ label: e, htmlFor: r, disabled: n = !1, required: s = !1 }) => e ? /* @__PURE__ */ t.jsxs(
|
|
1459
1459
|
"label",
|
|
1460
1460
|
{
|
|
1461
1461
|
htmlFor: r,
|
|
1462
1462
|
className: x(
|
|
1463
1463
|
"text-sm select-none font-medium text-foreground",
|
|
1464
|
-
|
|
1464
|
+
n && "opacity-50 cursor-not-allowed"
|
|
1465
1465
|
),
|
|
1466
1466
|
children: [
|
|
1467
|
-
|
|
1468
|
-
s && /* @__PURE__ */
|
|
1467
|
+
e,
|
|
1468
|
+
s && /* @__PURE__ */ t.jsx("span", { className: "text-danger ml-1", "aria-label": "required", children: "*" })
|
|
1469
1469
|
]
|
|
1470
1470
|
}
|
|
1471
|
-
) : null,
|
|
1471
|
+
) : null, jt = p.forwardRef(
|
|
1472
1472
|
({
|
|
1473
|
-
value:
|
|
1473
|
+
value: e,
|
|
1474
1474
|
onChange: r,
|
|
1475
|
-
label:
|
|
1475
|
+
label: n,
|
|
1476
1476
|
disabled: s = !1,
|
|
1477
|
-
required:
|
|
1478
|
-
className:
|
|
1477
|
+
required: a = !1,
|
|
1478
|
+
className: i,
|
|
1479
1479
|
id: d,
|
|
1480
1480
|
ariaLabel: l,
|
|
1481
1481
|
...c
|
|
1482
|
-
},
|
|
1483
|
-
const u =
|
|
1482
|
+
}, o) => {
|
|
1483
|
+
const u = p.useId(), m = d || u, f = e ?? !1, h = (b) => {
|
|
1484
1484
|
r?.(b.target.checked);
|
|
1485
1485
|
};
|
|
1486
|
-
return /* @__PURE__ */
|
|
1487
|
-
/* @__PURE__ */
|
|
1488
|
-
/* @__PURE__ */
|
|
1486
|
+
return /* @__PURE__ */ t.jsxs("div", { className: x("inline-flex items-center gap-2", i), children: [
|
|
1487
|
+
/* @__PURE__ */ t.jsxs("span", { className: "relative inline-flex items-center", children: [
|
|
1488
|
+
/* @__PURE__ */ t.jsx(
|
|
1489
1489
|
"input",
|
|
1490
1490
|
{
|
|
1491
|
-
ref:
|
|
1491
|
+
ref: o,
|
|
1492
1492
|
type: "checkbox",
|
|
1493
1493
|
role: "switch",
|
|
1494
|
-
id:
|
|
1495
|
-
"aria-label": l ||
|
|
1494
|
+
id: m,
|
|
1495
|
+
"aria-label": l || n,
|
|
1496
1496
|
"aria-checked": f,
|
|
1497
1497
|
checked: f,
|
|
1498
1498
|
disabled: s,
|
|
1499
|
-
required:
|
|
1499
|
+
required: a,
|
|
1500
1500
|
onChange: h,
|
|
1501
1501
|
className: "absolute inset-0 w-full h-full opacity-0 cursor-pointer z-10 disabled:cursor-not-allowed",
|
|
1502
1502
|
...c
|
|
1503
1503
|
}
|
|
1504
1504
|
),
|
|
1505
|
-
/* @__PURE__ */
|
|
1506
|
-
/* @__PURE__ */
|
|
1505
|
+
/* @__PURE__ */ t.jsx(wt, { disabled: s, checked: f }),
|
|
1506
|
+
/* @__PURE__ */ t.jsx(kt, { checked: f })
|
|
1507
1507
|
] }),
|
|
1508
|
-
/* @__PURE__ */
|
|
1509
|
-
|
|
1508
|
+
/* @__PURE__ */ t.jsx(
|
|
1509
|
+
vt,
|
|
1510
1510
|
{
|
|
1511
|
-
label:
|
|
1512
|
-
htmlFor:
|
|
1511
|
+
label: n,
|
|
1512
|
+
htmlFor: m,
|
|
1513
1513
|
disabled: s,
|
|
1514
|
-
required:
|
|
1514
|
+
required: a
|
|
1515
1515
|
}
|
|
1516
1516
|
)
|
|
1517
1517
|
] });
|
|
1518
1518
|
}
|
|
1519
1519
|
);
|
|
1520
|
-
|
|
1521
|
-
const
|
|
1520
|
+
jt.displayName = "SwitchInput";
|
|
1521
|
+
const It = N(
|
|
1522
1522
|
"block w-full rounded-md border bg-white transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:pointer-events-none disabled:bg-gray-50 overflow-y-auto whitespace-pre-wrap break-words",
|
|
1523
1523
|
{
|
|
1524
1524
|
variants: {
|
|
@@ -1532,138 +1532,350 @@ const et = C(
|
|
|
1532
1532
|
state: "default"
|
|
1533
1533
|
}
|
|
1534
1534
|
}
|
|
1535
|
-
),
|
|
1536
|
-
if (
|
|
1537
|
-
|
|
1535
|
+
), Ct = (e, r) => e ? "readOnly" : r ? "error" : "default", Nt = (e, r, n) => {
|
|
1536
|
+
if (!e) return;
|
|
1537
|
+
(n ? e.innerHTML : e.textContent) !== r && (n ? e.innerHTML = r : e.textContent = r);
|
|
1538
|
+
}, St = (e, r) => r ? e.innerHTML : e.textContent || "", Vt = (e, r, n) => {
|
|
1539
|
+
if (r || n) {
|
|
1540
|
+
e.preventDefault();
|
|
1538
1541
|
return;
|
|
1539
1542
|
}
|
|
1540
|
-
|
|
1541
|
-
const s =
|
|
1542
|
-
if (!
|
|
1543
|
-
|
|
1544
|
-
const
|
|
1545
|
-
|
|
1543
|
+
e.preventDefault();
|
|
1544
|
+
const s = e.clipboardData.getData("text/plain"), a = window.getSelection();
|
|
1545
|
+
if (!a || !a.rangeCount) return;
|
|
1546
|
+
a.deleteFromDocument();
|
|
1547
|
+
const i = a.getRangeAt(0), d = document.createTextNode(s);
|
|
1548
|
+
i.insertNode(d), i.setStartAfter(d), i.setEndAfter(d), a.removeAllRanges(), a.addRange(i);
|
|
1546
1549
|
const l = new Event("input", { bubbles: !0 });
|
|
1547
|
-
|
|
1548
|
-
},
|
|
1550
|
+
e.currentTarget.dispatchEvent(l);
|
|
1551
|
+
}, H = (e, r) => {
|
|
1552
|
+
switch (e) {
|
|
1553
|
+
case "bold":
|
|
1554
|
+
document.execCommand("bold", !1);
|
|
1555
|
+
break;
|
|
1556
|
+
case "italic":
|
|
1557
|
+
document.execCommand("italic", !1);
|
|
1558
|
+
break;
|
|
1559
|
+
case "underline":
|
|
1560
|
+
document.execCommand("underline", !1);
|
|
1561
|
+
break;
|
|
1562
|
+
case "strikethrough":
|
|
1563
|
+
document.execCommand("strikeThrough", !1);
|
|
1564
|
+
break;
|
|
1565
|
+
case "h1":
|
|
1566
|
+
document.execCommand("formatBlock", !1, "<h1>");
|
|
1567
|
+
break;
|
|
1568
|
+
case "h2":
|
|
1569
|
+
document.execCommand("formatBlock", !1, "<h2>");
|
|
1570
|
+
break;
|
|
1571
|
+
case "h3":
|
|
1572
|
+
document.execCommand("formatBlock", !1, "<h3>");
|
|
1573
|
+
break;
|
|
1574
|
+
case "orderedList":
|
|
1575
|
+
document.execCommand("insertOrderedList", !1);
|
|
1576
|
+
break;
|
|
1577
|
+
case "unorderedList":
|
|
1578
|
+
document.execCommand("insertUnorderedList", !1);
|
|
1579
|
+
break;
|
|
1580
|
+
case "link":
|
|
1581
|
+
if (r) {
|
|
1582
|
+
const n = window.getSelection();
|
|
1583
|
+
if (!!n && n.toString().length > 0)
|
|
1584
|
+
document.execCommand("createLink", !1, r);
|
|
1585
|
+
else {
|
|
1586
|
+
const a = r.replace(/"/g, "%22");
|
|
1587
|
+
document.execCommand(
|
|
1588
|
+
"insertHTML",
|
|
1589
|
+
!1,
|
|
1590
|
+
`<a href="${a}" target="_blank" rel="noopener noreferrer">${r}</a>`
|
|
1591
|
+
);
|
|
1592
|
+
}
|
|
1593
|
+
} else
|
|
1594
|
+
document.execCommand("unlink", !1);
|
|
1595
|
+
break;
|
|
1596
|
+
}
|
|
1597
|
+
}, O = (e) => {
|
|
1598
|
+
switch (e) {
|
|
1599
|
+
case "bold":
|
|
1600
|
+
return document.queryCommandState("bold");
|
|
1601
|
+
case "italic":
|
|
1602
|
+
return document.queryCommandState("italic");
|
|
1603
|
+
case "underline":
|
|
1604
|
+
return document.queryCommandState("underline");
|
|
1605
|
+
case "strikethrough":
|
|
1606
|
+
return document.queryCommandState("strikeThrough");
|
|
1607
|
+
case "h1": {
|
|
1608
|
+
const r = document.queryCommandValue("formatBlock") || "";
|
|
1609
|
+
return String(r).replace(/<|>|\//g, "").toLowerCase() === "h1";
|
|
1610
|
+
}
|
|
1611
|
+
case "h2": {
|
|
1612
|
+
const r = document.queryCommandValue("formatBlock") || "";
|
|
1613
|
+
return String(r).replace(/<|>|\//g, "").toLowerCase() === "h2";
|
|
1614
|
+
}
|
|
1615
|
+
case "h3": {
|
|
1616
|
+
const r = document.queryCommandValue("formatBlock") || "";
|
|
1617
|
+
return String(r).replace(/<|>|\//g, "").toLowerCase() === "h3";
|
|
1618
|
+
}
|
|
1619
|
+
case "orderedList":
|
|
1620
|
+
return document.queryCommandState("insertOrderedList");
|
|
1621
|
+
case "unorderedList":
|
|
1622
|
+
return document.queryCommandState("insertUnorderedList");
|
|
1623
|
+
case "link":
|
|
1624
|
+
return document.queryCommandState("createLink");
|
|
1625
|
+
default:
|
|
1626
|
+
return !1;
|
|
1627
|
+
}
|
|
1628
|
+
}, U = () => ({
|
|
1629
|
+
bold: O("bold"),
|
|
1630
|
+
italic: O("italic"),
|
|
1631
|
+
underline: O("underline"),
|
|
1632
|
+
strikethrough: O("strikethrough"),
|
|
1633
|
+
h1: O("h1"),
|
|
1634
|
+
h2: O("h2"),
|
|
1635
|
+
h3: O("h3"),
|
|
1636
|
+
orderedList: O("orderedList"),
|
|
1637
|
+
unorderedList: O("unorderedList"),
|
|
1638
|
+
link: O("link")
|
|
1639
|
+
}), ie = p.forwardRef(({ format: e, isActive: r, icon: n, label: s, disabled: a, onClick: i }, d) => {
|
|
1640
|
+
const l = (c) => {
|
|
1641
|
+
c.preventDefault(), i(e);
|
|
1642
|
+
};
|
|
1643
|
+
return /* @__PURE__ */ t.jsx(
|
|
1644
|
+
xe,
|
|
1645
|
+
{
|
|
1646
|
+
ref: d,
|
|
1647
|
+
as: n,
|
|
1648
|
+
"aria-label": s,
|
|
1649
|
+
"aria-pressed": r,
|
|
1650
|
+
variant: r ? "primary" : "ghost",
|
|
1651
|
+
size: "sm",
|
|
1652
|
+
shape: "rounded",
|
|
1653
|
+
disabled: a,
|
|
1654
|
+
onClick: l,
|
|
1655
|
+
onMouseDown: (c) => c.preventDefault(),
|
|
1656
|
+
className: x(
|
|
1657
|
+
"transition-all w-8 h-8 flex items-center justify-center",
|
|
1658
|
+
r && "bg-primary text-white",
|
|
1659
|
+
!r && "hover:bg-ghost-soft"
|
|
1660
|
+
)
|
|
1661
|
+
}
|
|
1662
|
+
);
|
|
1663
|
+
});
|
|
1664
|
+
ie.displayName = "TextAreaInputToolbarButton";
|
|
1665
|
+
const ce = p.forwardRef(({ children: e, className: r }, n) => /* @__PURE__ */ t.jsx(
|
|
1666
|
+
"div",
|
|
1667
|
+
{
|
|
1668
|
+
ref: n,
|
|
1669
|
+
role: "toolbar",
|
|
1670
|
+
"aria-label": "Text formatting toolbar",
|
|
1671
|
+
className: x(
|
|
1672
|
+
// allow wrapping on small screens, consistent gaps and padding
|
|
1673
|
+
"flex flex-wrap items-center gap-2 p-2 border-b border-border bg-neutral-soft rounded-t-md",
|
|
1674
|
+
r
|
|
1675
|
+
),
|
|
1676
|
+
children: e
|
|
1677
|
+
}
|
|
1678
|
+
));
|
|
1679
|
+
ce.displayName = "TextAreaInputToolbar";
|
|
1680
|
+
const Rt = (e, r) => {
|
|
1681
|
+
const [n, s] = K(U()), a = () => {
|
|
1682
|
+
const o = U();
|
|
1683
|
+
s(o);
|
|
1684
|
+
}, i = (o) => {
|
|
1685
|
+
r.current?.focus(), o === "link" ? d() : H(o), a(), l();
|
|
1686
|
+
}, d = () => {
|
|
1687
|
+
const o = window.prompt("Enter URL:");
|
|
1688
|
+
if (!o) {
|
|
1689
|
+
H("link");
|
|
1690
|
+
return;
|
|
1691
|
+
}
|
|
1692
|
+
const u = window.getSelection();
|
|
1693
|
+
if (!!u && u.toString().length > 0)
|
|
1694
|
+
H("link", o);
|
|
1695
|
+
else {
|
|
1696
|
+
const f = window.prompt("Enter link text (optional):") || o, h = o.replace(/"/g, "%22");
|
|
1697
|
+
document.execCommand(
|
|
1698
|
+
"insertHTML",
|
|
1699
|
+
!1,
|
|
1700
|
+
`<a href="${h}" target="_blank" rel="noopener noreferrer">${f}</a>`
|
|
1701
|
+
);
|
|
1702
|
+
}
|
|
1703
|
+
}, l = () => {
|
|
1704
|
+
if (r.current) {
|
|
1705
|
+
const o = new Event("input", { bubbles: !0 });
|
|
1706
|
+
r.current.dispatchEvent(o);
|
|
1707
|
+
}
|
|
1708
|
+
}, c = () => {
|
|
1709
|
+
e && r.current?.contains(document.activeElement) && a();
|
|
1710
|
+
};
|
|
1711
|
+
return _(() => {
|
|
1712
|
+
if (e)
|
|
1713
|
+
return document.addEventListener("selectionchange", c), () => {
|
|
1714
|
+
document.removeEventListener("selectionchange", c);
|
|
1715
|
+
};
|
|
1716
|
+
}, [e]), {
|
|
1717
|
+
formatState: n,
|
|
1718
|
+
handleFormatClick: i
|
|
1719
|
+
};
|
|
1720
|
+
}, Dt = p.forwardRef(
|
|
1549
1721
|
({
|
|
1550
|
-
label:
|
|
1722
|
+
label: e,
|
|
1551
1723
|
helperText: r,
|
|
1552
|
-
error:
|
|
1724
|
+
error: n,
|
|
1553
1725
|
className: s,
|
|
1554
|
-
disabled:
|
|
1555
|
-
readOnly:
|
|
1726
|
+
disabled: a,
|
|
1727
|
+
readOnly: i,
|
|
1556
1728
|
id: d,
|
|
1557
1729
|
value: l,
|
|
1558
1730
|
defaultValue: c,
|
|
1559
|
-
onChange:
|
|
1731
|
+
onChange: o,
|
|
1560
1732
|
placeholder: u,
|
|
1561
|
-
name:
|
|
1733
|
+
name: m,
|
|
1562
1734
|
row: f = 3,
|
|
1563
1735
|
required: h,
|
|
1564
1736
|
onBlur: b,
|
|
1565
1737
|
onFocus: w,
|
|
1566
1738
|
onKeyDown: g,
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1739
|
+
showToolbar: y = !1,
|
|
1740
|
+
allowedFormats: k,
|
|
1741
|
+
...C
|
|
1742
|
+
}, S) => {
|
|
1743
|
+
const D = p.useId(), E = d || D, z = !!n, V = p.useRef(null), [I, v] = p.useState(c || ""), j = l !== void 0, L = j ? l : I, { formatState: le, handleFormatClick: de } = Rt(
|
|
1744
|
+
y,
|
|
1745
|
+
V
|
|
1746
|
+
);
|
|
1747
|
+
p.useImperativeHandle(S, () => V.current), p.useEffect(() => {
|
|
1748
|
+
Nt(V.current, L, y);
|
|
1749
|
+
}, [L, y]);
|
|
1750
|
+
const ue = Ct(i, z), fe = !L && u, me = (R) => {
|
|
1751
|
+
const B = St(R.currentTarget, y);
|
|
1752
|
+
j || v(B), o?.(B);
|
|
1753
|
+
}, pe = (R) => {
|
|
1754
|
+
if (a || i) {
|
|
1755
|
+
R.preventDefault();
|
|
1579
1756
|
return;
|
|
1580
1757
|
}
|
|
1581
|
-
g?.(
|
|
1582
|
-
},
|
|
1583
|
-
|
|
1584
|
-
}
|
|
1585
|
-
|
|
1586
|
-
|
|
1758
|
+
g?.(R);
|
|
1759
|
+
}, he = () => {
|
|
1760
|
+
V.current?.focus();
|
|
1761
|
+
}, W = [
|
|
1762
|
+
{ format: "bold", icon: Ce, label: "Bold" },
|
|
1763
|
+
{ format: "italic", icon: Ne, label: "Italic" },
|
|
1764
|
+
{ format: "underline", icon: Se, label: "Underline" },
|
|
1765
|
+
{
|
|
1766
|
+
format: "strikethrough",
|
|
1767
|
+
icon: Ve,
|
|
1768
|
+
label: "Strikethrough"
|
|
1769
|
+
},
|
|
1770
|
+
{ format: "h1", icon: Re, label: "Heading 1" },
|
|
1771
|
+
{ format: "h2", icon: De, label: "Heading 2" },
|
|
1772
|
+
{ format: "h3", icon: Le, label: "Heading 3" },
|
|
1773
|
+
{ format: "orderedList", icon: Oe, label: "Ordered List" },
|
|
1774
|
+
{ format: "unorderedList", icon: ze, label: "Unordered List" },
|
|
1775
|
+
{ format: "link", icon: $e, label: "Link" }
|
|
1776
|
+
], be = k ? W.filter((R) => k.includes(R.format)) : W;
|
|
1777
|
+
return /* @__PURE__ */ t.jsxs("div", { children: [
|
|
1778
|
+
e && /* @__PURE__ */ t.jsxs(
|
|
1587
1779
|
"label",
|
|
1588
1780
|
{
|
|
1589
|
-
htmlFor:
|
|
1781
|
+
htmlFor: E,
|
|
1590
1782
|
className: "block text-sm font-medium text-foreground mb-2 cursor-pointer",
|
|
1591
|
-
onClick:
|
|
1783
|
+
onClick: he,
|
|
1592
1784
|
children: [
|
|
1593
|
-
|
|
1594
|
-
h && /* @__PURE__ */
|
|
1785
|
+
e,
|
|
1786
|
+
h && /* @__PURE__ */ t.jsx("span", { className: "text-danger ml-1", "aria-label": "required", children: "*" })
|
|
1595
1787
|
]
|
|
1596
1788
|
}
|
|
1597
1789
|
),
|
|
1598
|
-
/* @__PURE__ */
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
"
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1790
|
+
/* @__PURE__ */ t.jsxs("div", { className: x("relative w-full", s), children: [
|
|
1791
|
+
y && /* @__PURE__ */ t.jsx(ce, { children: be.map(({ format: R, icon: B, label: ge }) => /* @__PURE__ */ t.jsx(
|
|
1792
|
+
ie,
|
|
1793
|
+
{
|
|
1794
|
+
format: R,
|
|
1795
|
+
icon: B,
|
|
1796
|
+
label: ge,
|
|
1797
|
+
isActive: le[R],
|
|
1798
|
+
disabled: a || i,
|
|
1799
|
+
onClick: de
|
|
1800
|
+
},
|
|
1801
|
+
R
|
|
1802
|
+
)) }),
|
|
1803
|
+
/* @__PURE__ */ t.jsx(
|
|
1804
|
+
"div",
|
|
1805
|
+
{
|
|
1806
|
+
ref: V,
|
|
1807
|
+
id: E,
|
|
1808
|
+
role: "textbox",
|
|
1809
|
+
"aria-multiline": "true",
|
|
1810
|
+
"aria-invalid": z,
|
|
1811
|
+
"aria-disabled": a,
|
|
1812
|
+
"aria-readonly": i,
|
|
1813
|
+
"aria-required": h,
|
|
1814
|
+
"aria-label": typeof e == "string" ? e : void 0,
|
|
1815
|
+
contentEditable: !a && !i,
|
|
1816
|
+
"data-name": m,
|
|
1817
|
+
onInput: me,
|
|
1818
|
+
onKeyDown: pe,
|
|
1819
|
+
onPaste: (R) => !y && Vt(R, a, i),
|
|
1820
|
+
onBlur: b,
|
|
1821
|
+
onFocus: w,
|
|
1822
|
+
suppressContentEditableWarning: !0,
|
|
1823
|
+
style: {
|
|
1824
|
+
minHeight: `${f * 1.5 + 1}rem`,
|
|
1825
|
+
maxHeight: `${f * 1.5 + 1}rem`
|
|
1826
|
+
},
|
|
1827
|
+
className: x(
|
|
1828
|
+
It({ state: ue }),
|
|
1829
|
+
"px-3 py-2",
|
|
1830
|
+
y && "rounded-t-none",
|
|
1831
|
+
fe && "empty:before:content-[attr(data-placeholder)] empty:before:text-gray-400",
|
|
1832
|
+
// Apply shared formatting styles when toolbar is enabled
|
|
1833
|
+
y && ye
|
|
1834
|
+
),
|
|
1835
|
+
"data-placeholder": u,
|
|
1836
|
+
...C
|
|
1837
|
+
}
|
|
1838
|
+
)
|
|
1839
|
+
] }),
|
|
1840
|
+
z && /* @__PURE__ */ t.jsx("div", { className: "mt-1 text-sm text-danger", role: "alert", children: n }),
|
|
1841
|
+
!z && r && /* @__PURE__ */ t.jsx("div", { className: "mt-1 text-sm text-gray-600", children: r })
|
|
1630
1842
|
] });
|
|
1631
1843
|
}
|
|
1632
1844
|
);
|
|
1633
|
-
|
|
1634
|
-
const
|
|
1635
|
-
const s = (
|
|
1636
|
-
r?.onChange?.(
|
|
1845
|
+
Dt.displayName = "TextAreaInput";
|
|
1846
|
+
const Gt = $(function(r, n) {
|
|
1847
|
+
const s = (a) => {
|
|
1848
|
+
r?.onChange?.(a.target.value);
|
|
1637
1849
|
};
|
|
1638
|
-
return /* @__PURE__ */
|
|
1639
|
-
|
|
1850
|
+
return /* @__PURE__ */ t.jsx(
|
|
1851
|
+
F,
|
|
1640
1852
|
{
|
|
1641
1853
|
type: "time",
|
|
1642
1854
|
tabIndex: 0,
|
|
1643
1855
|
"aria-hidden": "true",
|
|
1644
|
-
leftContent: /* @__PURE__ */
|
|
1645
|
-
ref:
|
|
1856
|
+
leftContent: /* @__PURE__ */ t.jsx(P, { as: Ee, color: "inherit", size: "sm" }),
|
|
1857
|
+
ref: n,
|
|
1646
1858
|
...r,
|
|
1647
1859
|
onChange: s
|
|
1648
1860
|
}
|
|
1649
1861
|
);
|
|
1650
1862
|
});
|
|
1651
1863
|
export {
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1864
|
+
Ft as C,
|
|
1865
|
+
At as D,
|
|
1866
|
+
Tt as E,
|
|
1867
|
+
et as P,
|
|
1868
|
+
Ht as R,
|
|
1869
|
+
Wt as S,
|
|
1870
|
+
F as T,
|
|
1871
|
+
Bt as a,
|
|
1872
|
+
Mt as b,
|
|
1873
|
+
qt as c,
|
|
1874
|
+
Ut as d,
|
|
1875
|
+
pt as e,
|
|
1876
|
+
gt as f,
|
|
1877
|
+
jt as g,
|
|
1878
|
+
ee as h,
|
|
1879
|
+
Dt as i,
|
|
1880
|
+
Gt as j
|
|
1669
1881
|
};
|