@sakura-ui/forms 0.4.0-beta.0 → 0.4.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/LICENSE +21 -0
- package/dist/index.cjs.js +25 -43
- package/dist/index.es.js +214 -232
- package/dist/types/components/Checkbox.d.ts +2 -2
- package/dist/types/components/Checkbox.d.ts.map +1 -1
- package/dist/types/components/FieldsetControl.d.ts +2 -2
- package/dist/types/components/FieldsetControl.d.ts.map +1 -1
- package/dist/types/components/FileInput.d.ts +2 -2
- package/dist/types/components/FileInput.d.ts.map +1 -1
- package/dist/types/components/Input.d.ts +2 -2
- package/dist/types/components/Input.d.ts.map +1 -1
- package/dist/types/components/LabelControl.d.ts +2 -2
- package/dist/types/components/LabelControl.d.ts.map +1 -1
- package/dist/types/components/Radio.d.ts +2 -2
- package/dist/types/components/Radio.d.ts.map +1 -1
- package/dist/types/components/Select.d.ts +2 -2
- package/dist/types/components/Select.d.ts.map +1 -1
- package/dist/types/components/Textarea.d.ts +2 -2
- package/dist/types/components/Textarea.d.ts.map +1 -1
- package/dist/types/components/controlled/CheckboxGroup.d.ts +1 -1
- package/dist/types/components/controlled/RadioGroup.d.ts +1 -1
- package/dist/types/components/inputStyle.d.ts +1 -1
- package/dist/types/components/inputStyle.d.ts.map +1 -1
- package/package.json +26 -25
package/dist/index.es.js
CHANGED
|
@@ -1,19 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the MIT license found in the
|
|
10
|
-
* LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/
|
|
12
|
-
var B;
|
|
13
|
-
function pe() {
|
|
14
|
-
if (B) return I;
|
|
15
|
-
B = 1;
|
|
16
|
-
var r = Symbol.for("react.transitional.element"), i = Symbol.for("react.fragment");
|
|
1
|
+
import R from "react";
|
|
2
|
+
var I = { exports: {} }, E = {};
|
|
3
|
+
var W;
|
|
4
|
+
function fe() {
|
|
5
|
+
if (W) return E;
|
|
6
|
+
W = 1;
|
|
7
|
+
var r = /* @__PURE__ */ Symbol.for("react.transitional.element"), i = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
17
8
|
function c(n, a, s) {
|
|
18
9
|
var o = null;
|
|
19
10
|
if (s !== void 0 && (o = "" + s), a.key !== void 0 && (o = "" + a.key), "key" in a) {
|
|
@@ -29,56 +20,47 @@ function pe() {
|
|
|
29
20
|
props: s
|
|
30
21
|
};
|
|
31
22
|
}
|
|
32
|
-
return
|
|
23
|
+
return E.Fragment = i, E.jsx = c, E.jsxs = c, E;
|
|
33
24
|
}
|
|
34
25
|
var _ = {};
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
*
|
|
39
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
40
|
-
*
|
|
41
|
-
* This source code is licensed under the MIT license found in the
|
|
42
|
-
* LICENSE file in the root directory of this source tree.
|
|
43
|
-
*/
|
|
44
|
-
var U;
|
|
45
|
-
function be() {
|
|
46
|
-
return U || (U = 1, process.env.NODE_ENV !== "production" && function() {
|
|
26
|
+
var B;
|
|
27
|
+
function pe() {
|
|
28
|
+
return B || (B = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
47
29
|
function r(e) {
|
|
48
30
|
if (e == null) return null;
|
|
49
31
|
if (typeof e == "function")
|
|
50
|
-
return e.$$typeof ===
|
|
32
|
+
return e.$$typeof === de ? null : e.displayName || e.name || null;
|
|
51
33
|
if (typeof e == "string") return e;
|
|
52
34
|
switch (e) {
|
|
53
|
-
case
|
|
35
|
+
case k:
|
|
54
36
|
return "Fragment";
|
|
55
|
-
case se:
|
|
56
|
-
return "Profiler";
|
|
57
37
|
case re:
|
|
38
|
+
return "Profiler";
|
|
39
|
+
case ee:
|
|
58
40
|
return "StrictMode";
|
|
59
|
-
case
|
|
41
|
+
case ae:
|
|
60
42
|
return "Suspense";
|
|
61
|
-
case
|
|
43
|
+
case oe:
|
|
62
44
|
return "SuspenseList";
|
|
63
|
-
case
|
|
45
|
+
case ne:
|
|
64
46
|
return "Activity";
|
|
65
47
|
}
|
|
66
48
|
if (typeof e == "object")
|
|
67
49
|
switch (typeof e.tag == "number" && console.error(
|
|
68
50
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
69
51
|
), e.$$typeof) {
|
|
70
|
-
case
|
|
52
|
+
case K:
|
|
71
53
|
return "Portal";
|
|
72
|
-
case le:
|
|
73
|
-
return (e.displayName || "Context") + ".Provider";
|
|
74
54
|
case te:
|
|
55
|
+
return e.displayName || "Context";
|
|
56
|
+
case se:
|
|
75
57
|
return (e._context.displayName || "Context") + ".Consumer";
|
|
76
|
-
case
|
|
58
|
+
case le:
|
|
77
59
|
var l = e.render;
|
|
78
60
|
return e = e.displayName, e || (e = l.displayName || l.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
79
|
-
case
|
|
61
|
+
case ie:
|
|
80
62
|
return l = e.displayName || null, l !== null ? l : r(e.type) || "Memo";
|
|
81
|
-
case
|
|
63
|
+
case P:
|
|
82
64
|
l = e._payload, e = e._init;
|
|
83
65
|
try {
|
|
84
66
|
return r(e(l));
|
|
@@ -99,17 +81,17 @@ function be() {
|
|
|
99
81
|
}
|
|
100
82
|
if (l) {
|
|
101
83
|
l = console;
|
|
102
|
-
var p = l.error,
|
|
84
|
+
var p = l.error, b = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
103
85
|
return p.call(
|
|
104
86
|
l,
|
|
105
87
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
106
|
-
|
|
88
|
+
b
|
|
107
89
|
), i(e);
|
|
108
90
|
}
|
|
109
91
|
}
|
|
110
92
|
function n(e) {
|
|
111
|
-
if (e ===
|
|
112
|
-
if (typeof e == "object" && e !== null && e.$$typeof ===
|
|
93
|
+
if (e === k) return "<>";
|
|
94
|
+
if (typeof e == "object" && e !== null && e.$$typeof === P)
|
|
113
95
|
return "<...>";
|
|
114
96
|
try {
|
|
115
97
|
var l = r(e);
|
|
@@ -126,7 +108,7 @@ function be() {
|
|
|
126
108
|
return Error("react-stack-top-frame");
|
|
127
109
|
}
|
|
128
110
|
function o(e) {
|
|
129
|
-
if (
|
|
111
|
+
if (M.call(e, "key")) {
|
|
130
112
|
var l = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
131
113
|
if (l && l.isReactWarning) return !1;
|
|
132
114
|
}
|
|
@@ -134,7 +116,7 @@ function be() {
|
|
|
134
116
|
}
|
|
135
117
|
function u(e, l) {
|
|
136
118
|
function p() {
|
|
137
|
-
|
|
119
|
+
F || (F = !0, console.error(
|
|
138
120
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
139
121
|
l
|
|
140
122
|
));
|
|
@@ -146,18 +128,19 @@ function be() {
|
|
|
146
128
|
}
|
|
147
129
|
function d() {
|
|
148
130
|
var e = r(this.type);
|
|
149
|
-
return
|
|
131
|
+
return Y[e] || (Y[e] = !0, console.error(
|
|
150
132
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
151
133
|
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
152
134
|
}
|
|
153
|
-
function
|
|
154
|
-
|
|
155
|
-
|
|
135
|
+
function x(e, l, p, b, w, A) {
|
|
136
|
+
var m = p.ref;
|
|
137
|
+
return e = {
|
|
138
|
+
$$typeof: q,
|
|
156
139
|
type: e,
|
|
157
140
|
key: l,
|
|
158
|
-
props:
|
|
159
|
-
_owner:
|
|
160
|
-
}, (
|
|
141
|
+
props: p,
|
|
142
|
+
_owner: b
|
|
143
|
+
}, (m !== void 0 ? m : null) !== null ? Object.defineProperty(e, "ref", {
|
|
161
144
|
enumerable: !1,
|
|
162
145
|
get: d
|
|
163
146
|
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
@@ -174,113 +157,110 @@ function be() {
|
|
|
174
157
|
configurable: !1,
|
|
175
158
|
enumerable: !1,
|
|
176
159
|
writable: !0,
|
|
177
|
-
value:
|
|
160
|
+
value: w
|
|
178
161
|
}), Object.defineProperty(e, "_debugTask", {
|
|
179
162
|
configurable: !1,
|
|
180
163
|
enumerable: !1,
|
|
181
164
|
writable: !0,
|
|
182
|
-
value:
|
|
165
|
+
value: A
|
|
183
166
|
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
184
167
|
}
|
|
185
|
-
function f(e, l, p,
|
|
186
|
-
var
|
|
187
|
-
if (
|
|
188
|
-
if (
|
|
189
|
-
if (
|
|
190
|
-
for (
|
|
191
|
-
|
|
192
|
-
Object.freeze && Object.freeze(
|
|
168
|
+
function f(e, l, p, b, w, A) {
|
|
169
|
+
var m = l.children;
|
|
170
|
+
if (m !== void 0)
|
|
171
|
+
if (b)
|
|
172
|
+
if (ce(m)) {
|
|
173
|
+
for (b = 0; b < m.length; b++)
|
|
174
|
+
g(m[b]);
|
|
175
|
+
Object.freeze && Object.freeze(m);
|
|
193
176
|
} else
|
|
194
177
|
console.error(
|
|
195
178
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
196
179
|
);
|
|
197
|
-
else
|
|
198
|
-
if (
|
|
199
|
-
|
|
200
|
-
var
|
|
201
|
-
return
|
|
180
|
+
else g(m);
|
|
181
|
+
if (M.call(l, "key")) {
|
|
182
|
+
m = r(e);
|
|
183
|
+
var j = Object.keys(l).filter(function(ue) {
|
|
184
|
+
return ue !== "key";
|
|
202
185
|
});
|
|
203
|
-
|
|
186
|
+
b = 0 < j.length ? "{key: someKey, " + j.join(": ..., ") + ": ...}" : "{key: someKey}", L[m + b] || (j = 0 < j.length ? "{" + j.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
204
187
|
`A props object containing a "key" prop is being spread into JSX:
|
|
205
188
|
let props = %s;
|
|
206
189
|
<%s {...props} />
|
|
207
190
|
React keys must be passed directly to JSX without using spread:
|
|
208
191
|
let props = %s;
|
|
209
192
|
<%s key={someKey} {...props} />`,
|
|
193
|
+
b,
|
|
210
194
|
m,
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
), W[g + m] = !0);
|
|
195
|
+
j,
|
|
196
|
+
m
|
|
197
|
+
), L[m + b] = !0);
|
|
215
198
|
}
|
|
216
|
-
if (
|
|
199
|
+
if (m = null, p !== void 0 && (c(p), m = "" + p), o(l) && (c(l.key), m = "" + l.key), "key" in l) {
|
|
217
200
|
p = {};
|
|
218
|
-
for (var
|
|
219
|
-
|
|
201
|
+
for (var O in l)
|
|
202
|
+
O !== "key" && (p[O] = l[O]);
|
|
220
203
|
} else p = l;
|
|
221
|
-
return
|
|
204
|
+
return m && u(
|
|
222
205
|
p,
|
|
223
206
|
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
224
|
-
),
|
|
207
|
+
), x(
|
|
225
208
|
e,
|
|
226
|
-
|
|
227
|
-
N,
|
|
228
|
-
j,
|
|
229
|
-
a(),
|
|
209
|
+
m,
|
|
230
210
|
p,
|
|
231
|
-
|
|
232
|
-
|
|
211
|
+
a(),
|
|
212
|
+
w,
|
|
213
|
+
A
|
|
233
214
|
);
|
|
234
215
|
}
|
|
216
|
+
function g(e) {
|
|
217
|
+
h(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === P && (e._payload.status === "fulfilled" ? h(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
|
|
218
|
+
}
|
|
235
219
|
function h(e) {
|
|
236
|
-
typeof e == "object" && e !== null && e.$$typeof ===
|
|
220
|
+
return typeof e == "object" && e !== null && e.$$typeof === q;
|
|
237
221
|
}
|
|
238
|
-
var
|
|
222
|
+
var v = R, q = /* @__PURE__ */ Symbol.for("react.transitional.element"), K = /* @__PURE__ */ Symbol.for("react.portal"), k = /* @__PURE__ */ Symbol.for("react.fragment"), ee = /* @__PURE__ */ Symbol.for("react.strict_mode"), re = /* @__PURE__ */ Symbol.for("react.profiler"), se = /* @__PURE__ */ Symbol.for("react.consumer"), te = /* @__PURE__ */ Symbol.for("react.context"), le = /* @__PURE__ */ Symbol.for("react.forward_ref"), ae = /* @__PURE__ */ Symbol.for("react.suspense"), oe = /* @__PURE__ */ Symbol.for("react.suspense_list"), ie = /* @__PURE__ */ Symbol.for("react.memo"), P = /* @__PURE__ */ Symbol.for("react.lazy"), ne = /* @__PURE__ */ Symbol.for("react.activity"), de = /* @__PURE__ */ Symbol.for("react.client.reference"), C = v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, M = Object.prototype.hasOwnProperty, ce = Array.isArray, S = console.createTask ? console.createTask : function() {
|
|
239
223
|
return null;
|
|
240
224
|
};
|
|
241
|
-
|
|
225
|
+
v = {
|
|
242
226
|
react_stack_bottom_frame: function(e) {
|
|
243
227
|
return e();
|
|
244
228
|
}
|
|
245
229
|
};
|
|
246
|
-
var
|
|
247
|
-
|
|
230
|
+
var F, Y = {}, z = v.react_stack_bottom_frame.bind(
|
|
231
|
+
v,
|
|
248
232
|
s
|
|
249
|
-
)(),
|
|
250
|
-
_.Fragment =
|
|
251
|
-
var
|
|
233
|
+
)(), D = S(n(s)), L = {};
|
|
234
|
+
_.Fragment = k, _.jsx = function(e, l, p) {
|
|
235
|
+
var b = 1e4 > C.recentlyCreatedOwnerStacks++;
|
|
252
236
|
return f(
|
|
253
237
|
e,
|
|
254
238
|
l,
|
|
255
239
|
p,
|
|
256
240
|
!1,
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
N ? Error("react-stack-top-frame") : D,
|
|
260
|
-
N ? S(n(e)) : L
|
|
241
|
+
b ? Error("react-stack-top-frame") : z,
|
|
242
|
+
b ? S(n(e)) : D
|
|
261
243
|
);
|
|
262
|
-
}, _.jsxs = function(e, l, p
|
|
263
|
-
var
|
|
244
|
+
}, _.jsxs = function(e, l, p) {
|
|
245
|
+
var b = 1e4 > C.recentlyCreatedOwnerStacks++;
|
|
264
246
|
return f(
|
|
265
247
|
e,
|
|
266
248
|
l,
|
|
267
249
|
p,
|
|
268
250
|
!0,
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
N ? Error("react-stack-top-frame") : D,
|
|
272
|
-
N ? S(n(e)) : L
|
|
251
|
+
b ? Error("react-stack-top-frame") : z,
|
|
252
|
+
b ? S(n(e)) : D
|
|
273
253
|
);
|
|
274
254
|
};
|
|
275
|
-
}()), _;
|
|
255
|
+
})()), _;
|
|
276
256
|
}
|
|
277
|
-
var
|
|
278
|
-
function
|
|
279
|
-
return
|
|
257
|
+
var U;
|
|
258
|
+
function be() {
|
|
259
|
+
return U || (U = 1, process.env.NODE_ENV === "production" ? I.exports = fe() : I.exports = pe()), I.exports;
|
|
280
260
|
}
|
|
281
|
-
var t =
|
|
282
|
-
const
|
|
283
|
-
var
|
|
261
|
+
var t = be();
|
|
262
|
+
const y = (...r) => r.filter(Boolean).join(" ");
|
|
263
|
+
var N;
|
|
284
264
|
((r) => {
|
|
285
265
|
r.clickable = `
|
|
286
266
|
px-2
|
|
@@ -294,7 +274,6 @@ var T;
|
|
|
294
274
|
bg-yellow-50
|
|
295
275
|
`;
|
|
296
276
|
const i = `
|
|
297
|
-
focus-visible:outline
|
|
298
277
|
focus-visible:outline-4
|
|
299
278
|
focus-visible:outline-black
|
|
300
279
|
focus-visible:ring-yellow-300
|
|
@@ -313,7 +292,7 @@ var T;
|
|
|
313
292
|
focus-visible:ring-[calc(2/16*1rem)]
|
|
314
293
|
`, r.focusRounded = `
|
|
315
294
|
${r.focusRect}
|
|
316
|
-
focus-visible:rounded
|
|
295
|
+
focus-visible:rounded-sm
|
|
317
296
|
`, r.focusCard = `
|
|
318
297
|
${r.focusRect}
|
|
319
298
|
focus-visible:rounded-2xl
|
|
@@ -323,7 +302,7 @@ var T;
|
|
|
323
302
|
focus-visible:bg-yellow-300
|
|
324
303
|
`, r.focusRoundedWithBg = `
|
|
325
304
|
${r.focusRectWithBg}
|
|
326
|
-
focus-visible:rounded
|
|
305
|
+
focus-visible:rounded-sm
|
|
327
306
|
`, r.hoverUnderline = `
|
|
328
307
|
hover:underline
|
|
329
308
|
hover:underline-offset-[calc(3/16*1rem)]
|
|
@@ -354,7 +333,6 @@ var T;
|
|
|
354
333
|
left-0
|
|
355
334
|
`, ((c) => {
|
|
356
335
|
c.focus = `
|
|
357
|
-
peer-focus-visible:outline
|
|
358
336
|
peer-focus-visible:outline-4
|
|
359
337
|
peer-focus-visible:outline-black
|
|
360
338
|
peer-focus-visible:ring-yellow-300
|
|
@@ -364,13 +342,13 @@ var T;
|
|
|
364
342
|
peer-focus-visible:ring-[calc(2/16*1rem)]
|
|
365
343
|
`;
|
|
366
344
|
})(r.Peer || (r.Peer = {}));
|
|
367
|
-
})(
|
|
368
|
-
const
|
|
345
|
+
})(N || (N = {}));
|
|
346
|
+
const T = R.createContext({
|
|
369
347
|
helperTextId: "",
|
|
370
348
|
errorMessageId: "",
|
|
371
349
|
isInvalid: !1,
|
|
372
350
|
isRequired: !1
|
|
373
|
-
}),
|
|
351
|
+
}), G = `
|
|
374
352
|
bg-white
|
|
375
353
|
border
|
|
376
354
|
border-solid
|
|
@@ -379,7 +357,7 @@ const E = y.createContext({
|
|
|
379
357
|
disabled:text-solid-gray-500
|
|
380
358
|
disabled:border-solid-gray-500
|
|
381
359
|
aria-invalid:border-red-800
|
|
382
|
-
${
|
|
360
|
+
${N.focusRect}
|
|
383
361
|
`, V = {
|
|
384
362
|
// 16(p-4) * 2 + 22(text-label * leading-snug) + boader * 2 = 56px
|
|
385
363
|
lg: `
|
|
@@ -404,13 +382,13 @@ const E = y.createContext({
|
|
|
404
382
|
rounded-md
|
|
405
383
|
leading-snug
|
|
406
384
|
`
|
|
407
|
-
},
|
|
385
|
+
}, J = `
|
|
408
386
|
inline-block
|
|
409
387
|
cursor-pointer
|
|
410
388
|
border
|
|
411
389
|
border-solid
|
|
412
390
|
border-transparent
|
|
413
|
-
`,
|
|
391
|
+
`, H = {
|
|
414
392
|
// 16(p-4) * 2 + 22(text-label * leading-snug) + boader(transparent) * 2 = 56px
|
|
415
393
|
lg: `
|
|
416
394
|
pr-8
|
|
@@ -432,21 +410,21 @@ const E = y.createContext({
|
|
|
432
410
|
text-label
|
|
433
411
|
leading-snug
|
|
434
412
|
`
|
|
435
|
-
},
|
|
413
|
+
}, X = {
|
|
436
414
|
lg: "w-[22px] h-[22px] mr-2",
|
|
437
415
|
md: "w-[18px] h-[18px] mr-1.5",
|
|
438
416
|
sm: "w-[18px] h-[18px] mr-1"
|
|
439
|
-
},
|
|
440
|
-
const { id: i, className: c, size: n = "lg", children: a, ...s } = r, o =
|
|
417
|
+
}, Z = (r) => {
|
|
418
|
+
const { id: i, className: c, size: n = "lg", children: a, ...s } = r, o = R.useId(), u = i || o, d = R.useContext(T);
|
|
441
419
|
d.isRequired && (s.required = !0), d.groupName && (s.name = d.groupName);
|
|
442
|
-
const
|
|
420
|
+
const x = {
|
|
443
421
|
lg: 22 / 24,
|
|
444
422
|
md: 18 / 24,
|
|
445
423
|
sm: 18 / 24
|
|
446
424
|
}, f = `
|
|
447
425
|
peer
|
|
448
426
|
sr-only
|
|
449
|
-
`,
|
|
427
|
+
`, g = `
|
|
450
428
|
bg-clip-content
|
|
451
429
|
rounded-sm
|
|
452
430
|
border
|
|
@@ -457,15 +435,15 @@ const E = y.createContext({
|
|
|
457
435
|
peer-checked:bg-blue-600
|
|
458
436
|
peer-checked:border-none
|
|
459
437
|
peer-disabled:border-solid-gray-500
|
|
460
|
-
${
|
|
438
|
+
${N.Peer.focusRect}
|
|
461
439
|
`;
|
|
462
440
|
return /* @__PURE__ */ t.jsx(
|
|
463
441
|
"label",
|
|
464
442
|
{
|
|
465
443
|
htmlFor: u,
|
|
466
|
-
className:
|
|
467
|
-
|
|
468
|
-
|
|
444
|
+
className: y(
|
|
445
|
+
J,
|
|
446
|
+
H[n],
|
|
469
447
|
c
|
|
470
448
|
),
|
|
471
449
|
children: /* @__PURE__ */ t.jsxs("span", { className: "flex items-center", children: [
|
|
@@ -482,7 +460,7 @@ const E = y.createContext({
|
|
|
482
460
|
...s
|
|
483
461
|
}
|
|
484
462
|
),
|
|
485
|
-
/* @__PURE__ */ t.jsx("span", { className:
|
|
463
|
+
/* @__PURE__ */ t.jsx("span", { className: y(g, X[n]), children: /* @__PURE__ */ t.jsx(
|
|
486
464
|
"svg",
|
|
487
465
|
{
|
|
488
466
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -490,7 +468,7 @@ const E = y.createContext({
|
|
|
490
468
|
width: "24",
|
|
491
469
|
height: "24",
|
|
492
470
|
viewBox: "0 0 24 24",
|
|
493
|
-
children: /* @__PURE__ */ t.jsx("g", { transform: `scale(${
|
|
471
|
+
children: /* @__PURE__ */ t.jsx("g", { transform: `scale(${x[n]} ${x[n]})`, children: /* @__PURE__ */ t.jsx("path", { d: "m9.55 17.65-5.325-5.325 1.05-1.075 4.275 4.275 9.175-9.175 1.05 1.075Z" }) })
|
|
494
472
|
}
|
|
495
473
|
) }),
|
|
496
474
|
/* @__PURE__ */ t.jsx("span", { className: "peer-disabled:text-solid-gray-500", children: a })
|
|
@@ -498,11 +476,11 @@ const E = y.createContext({
|
|
|
498
476
|
}
|
|
499
477
|
);
|
|
500
478
|
};
|
|
501
|
-
|
|
502
|
-
const
|
|
503
|
-
const { id: i, className: c, size: n = "lg", children: a, ...s } = r, o =
|
|
479
|
+
Z.displayName = "Checkbox";
|
|
480
|
+
const Q = (r) => {
|
|
481
|
+
const { id: i, className: c, size: n = "lg", children: a, ...s } = r, o = R.useId(), u = i || o, d = R.useContext(T);
|
|
504
482
|
d.isRequired && (s.required = !0), d.groupName && (s.name = d.groupName);
|
|
505
|
-
const
|
|
483
|
+
const x = `
|
|
506
484
|
peer
|
|
507
485
|
sr-only
|
|
508
486
|
`, f = `
|
|
@@ -514,8 +492,8 @@ const K = (r) => {
|
|
|
514
492
|
peer-checked:bg-blue-600
|
|
515
493
|
peer-checked:border-blue-600
|
|
516
494
|
peer-disabled:border-solid-gray-500
|
|
517
|
-
${
|
|
518
|
-
`,
|
|
495
|
+
${N.Peer.focusRect}
|
|
496
|
+
`, g = {
|
|
519
497
|
lg: "p-1",
|
|
520
498
|
md: "p-[3px]",
|
|
521
499
|
sm: "p-[3px]"
|
|
@@ -524,9 +502,9 @@ const K = (r) => {
|
|
|
524
502
|
"label",
|
|
525
503
|
{
|
|
526
504
|
htmlFor: u,
|
|
527
|
-
className:
|
|
528
|
-
|
|
529
|
-
|
|
505
|
+
className: y(
|
|
506
|
+
J,
|
|
507
|
+
H[n],
|
|
530
508
|
c
|
|
531
509
|
),
|
|
532
510
|
children: /* @__PURE__ */ t.jsxs("span", { className: "flex items-center", children: [
|
|
@@ -534,7 +512,7 @@ const K = (r) => {
|
|
|
534
512
|
"input",
|
|
535
513
|
{
|
|
536
514
|
id: u,
|
|
537
|
-
className:
|
|
515
|
+
className: x,
|
|
538
516
|
type: "radio",
|
|
539
517
|
"aria-describedby": d.helperTextId,
|
|
540
518
|
"aria-errormessage": d.errorMessageId,
|
|
@@ -547,7 +525,7 @@ const K = (r) => {
|
|
|
547
525
|
"span",
|
|
548
526
|
{
|
|
549
527
|
"aria-hidden": !0,
|
|
550
|
-
className:
|
|
528
|
+
className: y(f, g[n], X[n])
|
|
551
529
|
}
|
|
552
530
|
),
|
|
553
531
|
/* @__PURE__ */ t.jsx("span", { className: "peer-disabled:text-solid-gray-500", children: a })
|
|
@@ -555,22 +533,22 @@ const K = (r) => {
|
|
|
555
533
|
}
|
|
556
534
|
);
|
|
557
535
|
};
|
|
558
|
-
|
|
536
|
+
Q.displayName = "Radio";
|
|
559
537
|
const me = (r) => {
|
|
560
|
-
const { id: i, className: c, size: n = "lg", children: a, ...s } = r, o =
|
|
538
|
+
const { id: i, className: c, size: n = "lg", children: a, ...s } = r, o = R.useContext(T);
|
|
561
539
|
return o.isRequired && (s.required = !0), /* @__PURE__ */ t.jsxs("div", { className: "inline-block relative", children: [
|
|
562
540
|
/* @__PURE__ */ t.jsx(
|
|
563
541
|
"select",
|
|
564
542
|
{
|
|
565
543
|
id: i || o.id,
|
|
566
|
-
className:
|
|
544
|
+
className: y(
|
|
567
545
|
`
|
|
568
546
|
!pr-8
|
|
569
547
|
peer
|
|
570
548
|
cursor-pointer
|
|
571
549
|
appearance-none
|
|
572
550
|
`,
|
|
573
|
-
|
|
551
|
+
G,
|
|
574
552
|
V[n],
|
|
575
553
|
c
|
|
576
554
|
),
|
|
@@ -615,8 +593,8 @@ const me = (r) => {
|
|
|
615
593
|
] });
|
|
616
594
|
};
|
|
617
595
|
me.displayName = "Select";
|
|
618
|
-
const
|
|
619
|
-
const { id: i, className: c, size: n = "lg", ...a } = r, s =
|
|
596
|
+
const xe = (r) => {
|
|
597
|
+
const { id: i, className: c, size: n = "lg", ...a } = r, s = R.useContext(T);
|
|
620
598
|
s.isRequired && (a.required = !0);
|
|
621
599
|
const o = `
|
|
622
600
|
file:mr-2
|
|
@@ -649,9 +627,9 @@ const ge = (r) => {
|
|
|
649
627
|
rounded-lg
|
|
650
628
|
outline-offset-2
|
|
651
629
|
aria-invalid:text-red-800
|
|
652
|
-
${
|
|
653
|
-
${
|
|
654
|
-
`,
|
|
630
|
+
${N.hoverUnderline}
|
|
631
|
+
${N.focusRounded}
|
|
632
|
+
`, x = {
|
|
655
633
|
// 16(p-4) * 2 + 22(text-button * leading-snug) + boader * 2 = 56px
|
|
656
634
|
lg: `
|
|
657
635
|
file:p-4
|
|
@@ -676,32 +654,36 @@ const ge = (r) => {
|
|
|
676
654
|
file:leading-snug
|
|
677
655
|
`
|
|
678
656
|
};
|
|
679
|
-
return
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
657
|
+
return (
|
|
658
|
+
// biome-ignore lint/a11y/useAriaPropsSupportedByRole: see the TODO above
|
|
659
|
+
// biome-ignore lint/a11y/useSemanticElements: see the TODO above
|
|
660
|
+
/* @__PURE__ */ t.jsx(
|
|
661
|
+
"input",
|
|
662
|
+
{
|
|
663
|
+
type: "file",
|
|
664
|
+
id: i || s.id,
|
|
665
|
+
className: y(o, u, x[n], d, c),
|
|
666
|
+
"aria-describedby": s.helperTextId,
|
|
667
|
+
"aria-errormessage": s.errorMessageId,
|
|
668
|
+
"aria-invalid": s.isInvalid ?? !1,
|
|
669
|
+
"aria-required": s.isRequired ?? !1,
|
|
670
|
+
role: "button",
|
|
671
|
+
"aria-label": "File Upload",
|
|
672
|
+
...a
|
|
673
|
+
}
|
|
674
|
+
)
|
|
693
675
|
);
|
|
694
676
|
};
|
|
695
|
-
|
|
696
|
-
const
|
|
697
|
-
const { id: i, className: c, size: n = "lg", ...a } = r, s =
|
|
677
|
+
xe.displayName = "FileInput";
|
|
678
|
+
const ge = (r) => {
|
|
679
|
+
const { id: i, className: c, size: n = "lg", ...a } = r, s = R.useContext(T);
|
|
698
680
|
return s.isRequired && (a.required = !0), /* @__PURE__ */ t.jsx(
|
|
699
681
|
"input",
|
|
700
682
|
{
|
|
701
683
|
type: "text",
|
|
702
684
|
id: i || s.id,
|
|
703
|
-
className:
|
|
704
|
-
|
|
685
|
+
className: y(
|
|
686
|
+
G,
|
|
705
687
|
V[n],
|
|
706
688
|
c
|
|
707
689
|
),
|
|
@@ -713,13 +695,13 @@ const he = (r) => {
|
|
|
713
695
|
}
|
|
714
696
|
);
|
|
715
697
|
};
|
|
716
|
-
|
|
717
|
-
const
|
|
718
|
-
const { id: i, className: c, children: n, onChange: a, maxLength: s, ...o } = r, [u, d] =
|
|
719
|
-
a && a(
|
|
720
|
-
}, f =
|
|
698
|
+
ge.displayName = "Input";
|
|
699
|
+
const he = (r) => {
|
|
700
|
+
const { id: i, className: c, children: n, onChange: a, maxLength: s, ...o } = r, [u, d] = R.useState(0), x = (v) => {
|
|
701
|
+
a && a(v), d(v.target.value.length);
|
|
702
|
+
}, f = R.useContext(T);
|
|
721
703
|
f.isRequired && (o.required = !0);
|
|
722
|
-
const
|
|
704
|
+
const g = u > (s || 0) ? "text-red-800" : "text-solid-gray-700", h = `
|
|
723
705
|
p-4
|
|
724
706
|
text-label
|
|
725
707
|
rounded-lg
|
|
@@ -730,33 +712,33 @@ const ve = (r) => {
|
|
|
730
712
|
disabled:text-solid-gray-500
|
|
731
713
|
disabled:border-solid-gray-500
|
|
732
714
|
aria-invalid:border-red-800
|
|
733
|
-
${
|
|
715
|
+
${N.focusRect}
|
|
734
716
|
`;
|
|
735
717
|
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
736
718
|
/* @__PURE__ */ t.jsx(
|
|
737
719
|
"textarea",
|
|
738
720
|
{
|
|
739
721
|
id: i || f.id,
|
|
740
|
-
className:
|
|
722
|
+
className: y(h, c),
|
|
741
723
|
"aria-describedby": f.helperTextId,
|
|
742
724
|
"aria-errormessage": f.errorMessageId,
|
|
743
725
|
"aria-invalid": f.isInvalid ?? !1,
|
|
744
726
|
"aria-required": f.isRequired ?? !1,
|
|
745
|
-
onChange:
|
|
727
|
+
onChange: x,
|
|
746
728
|
...o,
|
|
747
729
|
children: n
|
|
748
730
|
}
|
|
749
731
|
),
|
|
750
732
|
s ? /* @__PURE__ */ t.jsxs("p", { className: "text-label text-solid-gray-700", children: [
|
|
751
|
-
/* @__PURE__ */ t.jsx("span", { className:
|
|
733
|
+
/* @__PURE__ */ t.jsx("span", { className: g, children: u }),
|
|
752
734
|
"/",
|
|
753
735
|
/* @__PURE__ */ t.jsx("span", { children: s })
|
|
754
736
|
] }) : ""
|
|
755
737
|
] });
|
|
756
738
|
};
|
|
757
|
-
|
|
758
|
-
const
|
|
759
|
-
const i =
|
|
739
|
+
he.displayName = "Textarea";
|
|
740
|
+
const ve = (r) => {
|
|
741
|
+
const i = R.useId(), {
|
|
760
742
|
labelText: c,
|
|
761
743
|
className: n,
|
|
762
744
|
helperText: a,
|
|
@@ -764,7 +746,7 @@ const ye = (r) => {
|
|
|
764
746
|
isInvalid: o,
|
|
765
747
|
isRequired: u,
|
|
766
748
|
children: d,
|
|
767
|
-
...
|
|
749
|
+
...x
|
|
768
750
|
} = r, f = {
|
|
769
751
|
id: r.htmlFor ?? `input-${i}`,
|
|
770
752
|
helperTextId: `helper-text-${i}`,
|
|
@@ -772,13 +754,13 @@ const ye = (r) => {
|
|
|
772
754
|
isInvalid: o ?? !1,
|
|
773
755
|
isRequired: u ?? !1
|
|
774
756
|
};
|
|
775
|
-
return /* @__PURE__ */ t.jsx(
|
|
757
|
+
return /* @__PURE__ */ t.jsx(T.Provider, { value: f, children: /* @__PURE__ */ t.jsxs("div", { className: y("flex flex-col items-start gap-2", n), children: [
|
|
776
758
|
/* @__PURE__ */ t.jsxs(
|
|
777
759
|
"label",
|
|
778
760
|
{
|
|
779
|
-
className:
|
|
761
|
+
className: y("block text-label", o && "text-red-800"),
|
|
780
762
|
htmlFor: f.id,
|
|
781
|
-
...
|
|
763
|
+
...x,
|
|
782
764
|
children: [
|
|
783
765
|
c,
|
|
784
766
|
u && /* @__PURE__ */ t.jsx("span", { className: "text-label text-red-800", children: " *" })
|
|
@@ -794,9 +776,9 @@ const ye = (r) => {
|
|
|
794
776
|
`, children: s })
|
|
795
777
|
] }) });
|
|
796
778
|
};
|
|
797
|
-
|
|
798
|
-
const
|
|
799
|
-
const i =
|
|
779
|
+
ve.displayName = "LabelControl";
|
|
780
|
+
const $ = (r) => {
|
|
781
|
+
const i = R.useId(), {
|
|
800
782
|
labelText: c,
|
|
801
783
|
className: n,
|
|
802
784
|
helperText: a,
|
|
@@ -804,34 +786,34 @@ const q = (r) => {
|
|
|
804
786
|
isInvalid: o,
|
|
805
787
|
isRequired: u,
|
|
806
788
|
direction: d,
|
|
807
|
-
children:
|
|
789
|
+
children: x,
|
|
808
790
|
...f
|
|
809
|
-
} = r,
|
|
791
|
+
} = r, h = {
|
|
810
792
|
groupName: f.name ?? `group-${i}`,
|
|
811
793
|
helperTextId: `helper-text-${i}`,
|
|
812
794
|
errorMessageId: `error-message-${i}`,
|
|
813
795
|
isInvalid: o ?? !1,
|
|
814
796
|
isRequired: u ?? !1
|
|
815
|
-
},
|
|
816
|
-
return /* @__PURE__ */ t.jsx(
|
|
797
|
+
}, v = d ?? "flex-col";
|
|
798
|
+
return /* @__PURE__ */ t.jsx(T.Provider, { value: h, children: /* @__PURE__ */ t.jsxs(
|
|
817
799
|
"fieldset",
|
|
818
800
|
{
|
|
819
|
-
className:
|
|
801
|
+
className: y("flex flex-col items-start gap-2", n),
|
|
820
802
|
...f,
|
|
821
803
|
children: [
|
|
822
|
-
/* @__PURE__ */ t.jsx("legend", { children: /* @__PURE__ */ t.jsxs("p", { className:
|
|
804
|
+
/* @__PURE__ */ t.jsx("legend", { children: /* @__PURE__ */ t.jsxs("p", { className: y("block text-label", o && "text-red-800"), children: [
|
|
823
805
|
c,
|
|
824
806
|
u && /* @__PURE__ */ t.jsx("span", { className: "text-red-800", children: " *" })
|
|
825
807
|
] }) }),
|
|
826
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
827
|
-
a && /* @__PURE__ */ t.jsx("p", { id:
|
|
828
|
-
o && /* @__PURE__ */ t.jsx("p", { id:
|
|
808
|
+
/* @__PURE__ */ t.jsx("div", { className: y("inline-flex", v), children: x }),
|
|
809
|
+
a && /* @__PURE__ */ t.jsx("p", { id: h.helperTextId, className: "text-sup text-solid-gray-700", children: a }),
|
|
810
|
+
o && /* @__PURE__ */ t.jsx("p", { id: h.errorMessageId, className: "text-label text-red-800", children: s })
|
|
829
811
|
]
|
|
830
812
|
}
|
|
831
813
|
) });
|
|
832
814
|
};
|
|
833
|
-
|
|
834
|
-
const
|
|
815
|
+
$.displayName = "FieldsetControl";
|
|
816
|
+
const ye = (r) => {
|
|
835
817
|
const {
|
|
836
818
|
items: i,
|
|
837
819
|
onChange: c,
|
|
@@ -841,11 +823,11 @@ const Re = (r) => {
|
|
|
841
823
|
errorMessage: o,
|
|
842
824
|
isInvalid: u,
|
|
843
825
|
isRequired: d,
|
|
844
|
-
size:
|
|
826
|
+
size: x,
|
|
845
827
|
...f
|
|
846
828
|
} = r;
|
|
847
829
|
return /* @__PURE__ */ t.jsx(
|
|
848
|
-
|
|
830
|
+
$,
|
|
849
831
|
{
|
|
850
832
|
className: n,
|
|
851
833
|
labelText: a,
|
|
@@ -854,21 +836,21 @@ const Re = (r) => {
|
|
|
854
836
|
isInvalid: u,
|
|
855
837
|
isRequired: d,
|
|
856
838
|
...f,
|
|
857
|
-
children: i.map(({ label:
|
|
858
|
-
|
|
839
|
+
children: i.map(({ label: g, value: h }) => /* @__PURE__ */ t.jsx(
|
|
840
|
+
Z,
|
|
859
841
|
{
|
|
860
|
-
size:
|
|
861
|
-
value:
|
|
842
|
+
size: x,
|
|
843
|
+
value: h,
|
|
862
844
|
onChange: c,
|
|
863
|
-
children:
|
|
845
|
+
children: g
|
|
864
846
|
},
|
|
865
|
-
`${
|
|
847
|
+
`${g}-${h}`
|
|
866
848
|
))
|
|
867
849
|
}
|
|
868
850
|
);
|
|
869
851
|
};
|
|
870
|
-
|
|
871
|
-
const
|
|
852
|
+
ye.displayName = "CheckboxGroup";
|
|
853
|
+
const Re = (r) => {
|
|
872
854
|
const {
|
|
873
855
|
items: i,
|
|
874
856
|
onChange: c,
|
|
@@ -878,12 +860,12 @@ const Ne = (r) => {
|
|
|
878
860
|
errorMessage: o,
|
|
879
861
|
isInvalid: u,
|
|
880
862
|
isRequired: d,
|
|
881
|
-
defaultValue:
|
|
863
|
+
defaultValue: x,
|
|
882
864
|
size: f,
|
|
883
|
-
...
|
|
865
|
+
...g
|
|
884
866
|
} = r;
|
|
885
867
|
return /* @__PURE__ */ t.jsx(
|
|
886
|
-
|
|
868
|
+
$,
|
|
887
869
|
{
|
|
888
870
|
className: n,
|
|
889
871
|
labelText: a,
|
|
@@ -891,31 +873,31 @@ const Ne = (r) => {
|
|
|
891
873
|
errorMessage: o,
|
|
892
874
|
isInvalid: u,
|
|
893
875
|
isRequired: d,
|
|
894
|
-
...
|
|
895
|
-
children: i.map(({ label:
|
|
896
|
-
|
|
876
|
+
...g,
|
|
877
|
+
children: i.map(({ label: h, value: v }) => /* @__PURE__ */ t.jsx(
|
|
878
|
+
Q,
|
|
897
879
|
{
|
|
898
880
|
size: f,
|
|
899
|
-
value:
|
|
881
|
+
value: v,
|
|
900
882
|
onChange: c,
|
|
901
|
-
defaultChecked:
|
|
902
|
-
children:
|
|
883
|
+
defaultChecked: x === v,
|
|
884
|
+
children: h
|
|
903
885
|
},
|
|
904
|
-
`${
|
|
886
|
+
`${h}-${v}`
|
|
905
887
|
))
|
|
906
888
|
}
|
|
907
889
|
);
|
|
908
890
|
};
|
|
909
|
-
|
|
891
|
+
Re.displayName = "RadioGroup";
|
|
910
892
|
export {
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
893
|
+
Z as Checkbox,
|
|
894
|
+
ye as CheckboxGroup,
|
|
895
|
+
$ as FieldsetControl,
|
|
896
|
+
xe as FileInput,
|
|
897
|
+
ge as Input,
|
|
898
|
+
ve as LabelControl,
|
|
899
|
+
Q as Radio,
|
|
900
|
+
Re as RadioGroup,
|
|
919
901
|
me as Select,
|
|
920
|
-
|
|
902
|
+
he as Textarea
|
|
921
903
|
};
|