dishui 0.0.1 → 0.0.2

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/dishui.es.js CHANGED
@@ -1,5 +1,5 @@
1
- import z, { useState as ue, useRef as fe, useEffect as me } from "react";
2
- var Z = { exports: {} }, M = {};
1
+ import H, { useState as U, useRef as oe, useEffect as de } from "react";
2
+ var K = { exports: {} }, Z = {};
3
3
  /**
4
4
  * @license React
5
5
  * react-jsx-runtime.production.js
@@ -9,29 +9,29 @@ var Z = { exports: {} }, M = {};
9
9
  * This source code is licensed under the MIT license found in the
10
10
  * LICENSE file in the root directory of this source tree.
11
11
  */
12
- var te;
13
- function de() {
14
- if (te) return M;
15
- te = 1;
16
- var u = Symbol.for("react.transitional.element"), c = Symbol.for("react.fragment");
17
- function m(n, i, t) {
18
- var E = null;
19
- if (t !== void 0 && (E = "" + t), i.key !== void 0 && (E = "" + i.key), "key" in i) {
12
+ var re;
13
+ function me() {
14
+ if (re) return Z;
15
+ re = 1;
16
+ var f = Symbol.for("react.transitional.element"), c = Symbol.for("react.fragment");
17
+ function p(n, u, t) {
18
+ var C = null;
19
+ if (t !== void 0 && (C = "" + t), u.key !== void 0 && (C = "" + u.key), "key" in u) {
20
20
  t = {};
21
- for (var l in i)
22
- l !== "key" && (t[l] = i[l]);
23
- } else t = i;
24
- return i = t.ref, {
25
- $$typeof: u,
21
+ for (var i in u)
22
+ i !== "key" && (t[i] = u[i]);
23
+ } else t = u;
24
+ return u = t.ref, {
25
+ $$typeof: f,
26
26
  type: n,
27
- key: E,
28
- ref: i !== void 0 ? i : null,
27
+ key: C,
28
+ ref: u !== void 0 ? u : null,
29
29
  props: t
30
30
  };
31
31
  }
32
- return M.Fragment = c, M.jsx = m, M.jsxs = m, M;
32
+ return Z.Fragment = c, Z.jsx = p, Z.jsxs = p, Z;
33
33
  }
34
- var W = {};
34
+ var Q = {};
35
35
  /**
36
36
  * @license React
37
37
  * react-jsx-runtime.development.js
@@ -41,47 +41,47 @@ var W = {};
41
41
  * This source code is licensed under the MIT license found in the
42
42
  * LICENSE file in the root directory of this source tree.
43
43
  */
44
- var re;
45
- function be() {
46
- return re || (re = 1, process.env.NODE_ENV !== "production" && function() {
47
- function u(e) {
44
+ var ne;
45
+ function pe() {
46
+ return ne || (ne = 1, process.env.NODE_ENV !== "production" && function() {
47
+ function f(e) {
48
48
  if (e == null) return null;
49
49
  if (typeof e == "function")
50
- return e.$$typeof === $ ? null : e.displayName || e.name || null;
50
+ return e.$$typeof === T ? null : e.displayName || e.name || null;
51
51
  if (typeof e == "string") return e;
52
52
  switch (e) {
53
- case j:
53
+ case R:
54
54
  return "Fragment";
55
- case w:
55
+ case M:
56
56
  return "Profiler";
57
- case N:
57
+ case P:
58
58
  return "StrictMode";
59
- case G:
59
+ case W:
60
60
  return "Suspense";
61
- case U:
61
+ case y:
62
62
  return "SuspenseList";
63
- case S:
63
+ case F:
64
64
  return "Activity";
65
65
  }
66
66
  if (typeof e == "object")
67
67
  switch (typeof e.tag == "number" && console.error(
68
68
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
69
69
  ), e.$$typeof) {
70
- case r:
70
+ case a:
71
71
  return "Portal";
72
- case O:
72
+ case I:
73
73
  return (e.displayName || "Context") + ".Provider";
74
- case P:
74
+ case $:
75
75
  return (e._context.displayName || "Context") + ".Consumer";
76
- case y:
76
+ case O:
77
77
  var s = e.render;
78
78
  return e = e.displayName, e || (e = s.displayName || s.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
79
- case q:
80
- return s = e.displayName || null, s !== null ? s : u(e.type) || "Memo";
81
- case Y:
79
+ case D:
80
+ return s = e.displayName || null, s !== null ? s : f(e.type) || "Memo";
81
+ case S:
82
82
  s = e._payload, e = e._init;
83
83
  try {
84
- return u(e(s));
84
+ return f(e(s));
85
85
  } catch {
86
86
  }
87
87
  }
@@ -90,7 +90,7 @@ function be() {
90
90
  function c(e) {
91
91
  return "" + e;
92
92
  }
93
- function m(e) {
93
+ function p(e) {
94
94
  try {
95
95
  c(e);
96
96
  var s = !1;
@@ -99,8 +99,8 @@ function be() {
99
99
  }
100
100
  if (s) {
101
101
  s = console;
102
- var o = s.error, b = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
103
- return o.call(
102
+ var l = s.error, b = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
103
+ return l.call(
104
104
  s,
105
105
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
106
106
  b
@@ -108,58 +108,58 @@ function be() {
108
108
  }
109
109
  }
110
110
  function n(e) {
111
- if (e === j) return "<>";
112
- if (typeof e == "object" && e !== null && e.$$typeof === Y)
111
+ if (e === R) return "<>";
112
+ if (typeof e == "object" && e !== null && e.$$typeof === S)
113
113
  return "<...>";
114
114
  try {
115
- var s = u(e);
115
+ var s = f(e);
116
116
  return s ? "<" + s + ">" : "<...>";
117
117
  } catch {
118
118
  return "<...>";
119
119
  }
120
120
  }
121
- function i() {
122
- var e = _.A;
121
+ function u() {
122
+ var e = E.A;
123
123
  return e === null ? null : e.getOwner();
124
124
  }
125
125
  function t() {
126
126
  return Error("react-stack-top-frame");
127
127
  }
128
- function E(e) {
128
+ function C(e) {
129
129
  if (k.call(e, "key")) {
130
130
  var s = Object.getOwnPropertyDescriptor(e, "key").get;
131
131
  if (s && s.isReactWarning) return !1;
132
132
  }
133
133
  return e.key !== void 0;
134
134
  }
135
- function l(e, s) {
136
- function o() {
137
- V || (V = !0, console.error(
135
+ function i(e, s) {
136
+ function l() {
137
+ z || (z = !0, console.error(
138
138
  "%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
139
  s
140
140
  ));
141
141
  }
142
- o.isReactWarning = !0, Object.defineProperty(e, "key", {
143
- get: o,
142
+ l.isReactWarning = !0, Object.defineProperty(e, "key", {
143
+ get: l,
144
144
  configurable: !0
145
145
  });
146
146
  }
147
- function R() {
148
- var e = u(this.type);
149
- return D[e] || (D[e] = !0, console.error(
147
+ function j() {
148
+ var e = f(this.type);
149
+ return Y[e] || (Y[e] = !0, console.error(
150
150
  "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
151
  )), e = this.props.ref, e !== void 0 ? e : null;
152
152
  }
153
- function v(e, s, o, b, g, T, F, B) {
154
- return o = T.ref, e = {
155
- $$typeof: a,
153
+ function v(e, s, l, b, N, h, _, A) {
154
+ return l = h.ref, e = {
155
+ $$typeof: o,
156
156
  type: e,
157
157
  key: s,
158
- props: T,
159
- _owner: g
160
- }, (o !== void 0 ? o : null) !== null ? Object.defineProperty(e, "ref", {
158
+ props: h,
159
+ _owner: N
160
+ }, (l !== void 0 ? l : null) !== null ? Object.defineProperty(e, "ref", {
161
161
  enumerable: !1,
162
- get: R
162
+ get: j
163
163
  }) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
164
164
  configurable: !1,
165
165
  enumerable: !1,
@@ -174,33 +174,33 @@ function be() {
174
174
  configurable: !1,
175
175
  enumerable: !1,
176
176
  writable: !0,
177
- value: F
177
+ value: _
178
178
  }), Object.defineProperty(e, "_debugTask", {
179
179
  configurable: !1,
180
180
  enumerable: !1,
181
181
  writable: !0,
182
- value: B
182
+ value: A
183
183
  }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
184
184
  }
185
- function h(e, s, o, b, g, T, F, B) {
186
- var d = s.children;
187
- if (d !== void 0)
185
+ function g(e, s, l, b, N, h, _, A) {
186
+ var m = s.children;
187
+ if (m !== void 0)
188
188
  if (b)
189
- if (J(d)) {
190
- for (b = 0; b < d.length; b++)
191
- x(d[b]);
192
- Object.freeze && Object.freeze(d);
189
+ if (G(m)) {
190
+ for (b = 0; b < m.length; b++)
191
+ w(m[b]);
192
+ Object.freeze && Object.freeze(m);
193
193
  } else
194
194
  console.error(
195
195
  "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
196
  );
197
- else x(d);
197
+ else w(m);
198
198
  if (k.call(s, "key")) {
199
- d = u(e);
200
- var A = Object.keys(s).filter(function(K) {
201
- return K !== "key";
199
+ m = f(e);
200
+ var B = Object.keys(s).filter(function(ee) {
201
+ return ee !== "key";
202
202
  });
203
- b = 0 < A.length ? "{key: someKey, " + A.join(": ..., ") + ": ...}" : "{key: someKey}", H[d + b] || (A = 0 < A.length ? "{" + A.join(": ..., ") + ": ...}" : "{}", console.error(
203
+ b = 0 < B.length ? "{key: someKey, " + B.join(": ..., ") + ": ...}" : "{key: someKey}", J[m + b] || (B = 0 < B.length ? "{" + B.join(": ..., ") + ": ...}" : "{}", console.error(
204
204
  `A props object containing a "key" prop is being spread into JSX:
205
205
  let props = %s;
206
206
  <%s {...props} />
@@ -208,150 +208,150 @@ React keys must be passed directly to JSX without using spread:
208
208
  let props = %s;
209
209
  <%s key={someKey} {...props} />`,
210
210
  b,
211
- d,
212
- A,
213
- d
214
- ), H[d + b] = !0);
211
+ m,
212
+ B,
213
+ m
214
+ ), J[m + b] = !0);
215
215
  }
216
- if (d = null, o !== void 0 && (m(o), d = "" + o), E(s) && (m(s.key), d = "" + s.key), "key" in s) {
217
- o = {};
218
- for (var L in s)
219
- L !== "key" && (o[L] = s[L]);
220
- } else o = s;
221
- return d && l(
222
- o,
216
+ if (m = null, l !== void 0 && (p(l), m = "" + l), C(s) && (p(s.key), m = "" + s.key), "key" in s) {
217
+ l = {};
218
+ for (var X in s)
219
+ X !== "key" && (l[X] = s[X]);
220
+ } else l = s;
221
+ return m && i(
222
+ l,
223
223
  typeof e == "function" ? e.displayName || e.name || "Unknown" : e
224
224
  ), v(
225
225
  e,
226
- d,
227
- T,
228
- g,
229
- i(),
230
- o,
231
- F,
232
- B
226
+ m,
227
+ h,
228
+ N,
229
+ u(),
230
+ l,
231
+ _,
232
+ A
233
233
  );
234
234
  }
235
- function x(e) {
236
- typeof e == "object" && e !== null && e.$$typeof === a && e._store && (e._store.validated = 1);
235
+ function w(e) {
236
+ typeof e == "object" && e !== null && e.$$typeof === o && e._store && (e._store.validated = 1);
237
237
  }
238
- var f = z, a = Symbol.for("react.transitional.element"), r = Symbol.for("react.portal"), j = Symbol.for("react.fragment"), N = Symbol.for("react.strict_mode"), w = Symbol.for("react.profiler"), P = Symbol.for("react.consumer"), O = Symbol.for("react.context"), y = Symbol.for("react.forward_ref"), G = Symbol.for("react.suspense"), U = Symbol.for("react.suspense_list"), q = Symbol.for("react.memo"), Y = Symbol.for("react.lazy"), S = Symbol.for("react.activity"), $ = Symbol.for("react.client.reference"), _ = f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, k = Object.prototype.hasOwnProperty, J = Array.isArray, I = console.createTask ? console.createTask : function() {
238
+ var d = H, o = Symbol.for("react.transitional.element"), a = Symbol.for("react.portal"), R = Symbol.for("react.fragment"), P = Symbol.for("react.strict_mode"), M = Symbol.for("react.profiler"), $ = Symbol.for("react.consumer"), I = Symbol.for("react.context"), O = Symbol.for("react.forward_ref"), W = Symbol.for("react.suspense"), y = Symbol.for("react.suspense_list"), D = Symbol.for("react.memo"), S = Symbol.for("react.lazy"), F = Symbol.for("react.activity"), T = Symbol.for("react.client.reference"), E = d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, k = Object.prototype.hasOwnProperty, G = Array.isArray, V = console.createTask ? console.createTask : function() {
239
239
  return null;
240
240
  };
241
- f = {
241
+ d = {
242
242
  "react-stack-bottom-frame": function(e) {
243
243
  return e();
244
244
  }
245
245
  };
246
- var V, D = {}, X = f["react-stack-bottom-frame"].bind(
247
- f,
246
+ var z, Y = {}, L = d["react-stack-bottom-frame"].bind(
247
+ d,
248
248
  t
249
- )(), Q = I(n(t)), H = {};
250
- W.Fragment = j, W.jsx = function(e, s, o, b, g) {
251
- var T = 1e4 > _.recentlyCreatedOwnerStacks++;
252
- return h(
249
+ )(), q = V(n(t)), J = {};
250
+ Q.Fragment = R, Q.jsx = function(e, s, l, b, N) {
251
+ var h = 1e4 > E.recentlyCreatedOwnerStacks++;
252
+ return g(
253
253
  e,
254
254
  s,
255
- o,
255
+ l,
256
256
  !1,
257
257
  b,
258
- g,
259
- T ? Error("react-stack-top-frame") : X,
260
- T ? I(n(e)) : Q
258
+ N,
259
+ h ? Error("react-stack-top-frame") : L,
260
+ h ? V(n(e)) : q
261
261
  );
262
- }, W.jsxs = function(e, s, o, b, g) {
263
- var T = 1e4 > _.recentlyCreatedOwnerStacks++;
264
- return h(
262
+ }, Q.jsxs = function(e, s, l, b, N) {
263
+ var h = 1e4 > E.recentlyCreatedOwnerStacks++;
264
+ return g(
265
265
  e,
266
266
  s,
267
- o,
267
+ l,
268
268
  !0,
269
269
  b,
270
- g,
271
- T ? Error("react-stack-top-frame") : X,
272
- T ? I(n(e)) : Q
270
+ N,
271
+ h ? Error("react-stack-top-frame") : L,
272
+ h ? V(n(e)) : q
273
273
  );
274
274
  };
275
- }()), W;
275
+ }()), Q;
276
276
  }
277
- var ne;
278
- function pe() {
279
- return ne || (ne = 1, process.env.NODE_ENV === "production" ? Z.exports = de() : Z.exports = be()), Z.exports;
277
+ var ae;
278
+ function be() {
279
+ return ae || (ae = 1, process.env.NODE_ENV === "production" ? K.exports = me() : K.exports = pe()), K.exports;
280
280
  }
281
- var C = pe();
282
- const Ce = ({
283
- children: u,
281
+ var r = be();
282
+ const he = ({
283
+ children: f,
284
284
  variant: c = "primary",
285
- size: m = "md",
285
+ size: p = "md",
286
286
  outline: n = !1,
287
- dash: i = !1,
287
+ dash: u = !1,
288
288
  soft: t = !1,
289
- active: E = !1,
290
- disabled: l = !1,
291
- wide: R = !1,
289
+ active: C = !1,
290
+ disabled: i = !1,
291
+ wide: j = !1,
292
292
  block: v = !1,
293
- square: h = !1,
294
- circle: x = !1,
295
- leftSection: f,
296
- rightSection: a,
297
- onClick: r,
298
- className: j = ""
293
+ square: g = !1,
294
+ circle: w = !1,
295
+ leftSection: d,
296
+ rightSection: o,
297
+ onClick: a,
298
+ className: R = ""
299
299
  }) => {
300
- const N = "btn", w = c ? `btn-${c}` : "", P = m ? `btn-${m}` : "", _ = [
301
- N,
302
- w,
300
+ const P = "btn", M = c ? `btn-${c}` : "", $ = p ? `btn-${p}` : "", E = [
303
301
  P,
302
+ M,
303
+ $,
304
304
  n ? "btn-outline" : "",
305
- i ? "btn-dash" : "",
305
+ u ? "btn-dash" : "",
306
306
  t ? "btn-soft" : "",
307
- E ? "btn-active" : "",
308
- R ? "btn-wide" : "",
307
+ C ? "btn-active" : "",
308
+ j ? "btn-wide" : "",
309
309
  v ? "btn-block" : "",
310
- h ? "btn-square" : "",
311
- x ? "btn-circle" : "",
312
- j
310
+ g ? "btn-square" : "",
311
+ w ? "btn-circle" : "",
312
+ R
313
313
  ].filter(Boolean).join(" ");
314
- return /* @__PURE__ */ C.jsxs(
314
+ return /* @__PURE__ */ r.jsxs(
315
315
  "button",
316
316
  {
317
- className: _,
318
- disabled: l,
319
- onClick: r,
317
+ className: E,
318
+ disabled: i,
319
+ onClick: a,
320
320
  children: [
321
- f && /* @__PURE__ */ C.jsx("span", { className: "mr-2", children: f }),
322
- u,
323
- a && /* @__PURE__ */ C.jsx("span", { className: "ml-2", children: a })
321
+ d && /* @__PURE__ */ r.jsx("span", { className: "mr-2", children: d }),
322
+ f,
323
+ o && /* @__PURE__ */ r.jsx("span", { className: "ml-2", children: o })
324
324
  ]
325
325
  }
326
326
  );
327
- }, Ee = ({
328
- children: u,
327
+ }, xe = ({
328
+ children: f,
329
329
  vertical: c = !1,
330
- className: m = "",
330
+ className: p = "",
331
331
  rounded: n = "none",
332
- radius: i = "full",
332
+ radius: u = "full",
333
333
  roundedStyle: t
334
334
  }) => {
335
- const E = [
335
+ const C = [
336
336
  "join",
337
337
  c ? "join-vertical" : "join-horizontal",
338
- m
339
- ].filter(Boolean).join(" "), l = n !== "none" ? "full" : i;
340
- return /* @__PURE__ */ C.jsx("div", { className: E, children: z.Children.map(u, (R, v) => {
341
- if (!z.isValidElement(R)) return R;
342
- const h = R, x = h.props.className || "", f = v === 0, a = v === z.Children.count(u) - 1;
343
- let r = "";
344
- t ? c ? n === "left" && f && t.top ? r = t.top : n === "right" && a && t.bottom ? r = t.bottom : n === "both" && (f && t.top && (r = t.top), a && t.bottom && (r = t.bottom)) : n === "left" && f && t.left ? r = t.left : n === "right" && a && t.right ? r = t.right : n === "both" && (f && t.left && (r = t.left), a && t.right && (r = t.right)) : c ? n === "left" && f ? r = `rounded-t-${l}` : n === "right" && a ? r = `rounded-b-${l}` : n === "both" && (f && (r = `rounded-t-${l}`), a && (r = `rounded-b-${l}`)) : n === "left" && f ? r = `rounded-l-${l}` : n === "right" && a ? r = `rounded-r-${l}` : n === "both" && (f && (r = `rounded-l-${l}`), a && (r = `rounded-r-${l}`));
345
- const j = `${x} join-item ${r}`.trim();
346
- return z.cloneElement(h, {
347
- className: j
338
+ p
339
+ ].filter(Boolean).join(" "), i = n !== "none" ? "full" : u;
340
+ return /* @__PURE__ */ r.jsx("div", { className: C, children: H.Children.map(f, (j, v) => {
341
+ if (!H.isValidElement(j)) return j;
342
+ const g = j, w = g.props.className || "", d = v === 0, o = v === H.Children.count(f) - 1;
343
+ let a = "";
344
+ t ? c ? n === "left" && d && t.top ? a = t.top : n === "right" && o && t.bottom ? a = t.bottom : n === "both" && (d && t.top && (a = t.top), o && t.bottom && (a = t.bottom)) : n === "left" && d && t.left ? a = t.left : n === "right" && o && t.right ? a = t.right : n === "both" && (d && t.left && (a = t.left), o && t.right && (a = t.right)) : c ? n === "left" && d ? a = `rounded-t-${i}` : n === "right" && o ? a = `rounded-b-${i}` : n === "both" && (d && (a = `rounded-t-${i}`), o && (a = `rounded-b-${i}`)) : n === "left" && d ? a = `rounded-l-${i}` : n === "right" && o ? a = `rounded-r-${i}` : n === "both" && (d && (a = `rounded-l-${i}`), o && (a = `rounded-r-${i}`));
345
+ const R = `${w} join-item ${a}`.trim();
346
+ return H.cloneElement(g, {
347
+ className: R
348
348
  });
349
349
  }) });
350
- }, ve = ({
351
- children: u,
350
+ }, Ce = ({
351
+ children: f,
352
352
  className: c = ""
353
353
  }) => {
354
- const m = [
354
+ const p = [
355
355
  "join-item",
356
356
  "flex",
357
357
  "items-center",
@@ -361,178 +361,230 @@ const Ce = ({
361
361
  "border-base-300",
362
362
  c
363
363
  ].filter(Boolean).join(" ");
364
- return /* @__PURE__ */ C.jsx("div", { className: m, children: u });
365
- }, ae = Ce;
366
- ae.Group = Ee;
367
- ae.GroupSection = ve;
368
- const he = ({
369
- children: u,
364
+ return /* @__PURE__ */ r.jsx("div", { className: p, children: f });
365
+ }, le = he;
366
+ le.Group = xe;
367
+ le.GroupSection = Ce;
368
+ const Ee = ({
369
+ children: f,
370
370
  variant: c = "primary",
371
- size: m = "md",
371
+ size: p = "md",
372
372
  outline: n = !1,
373
- className: i = ""
373
+ className: u = ""
374
374
  }) => {
375
- const t = "badge", E = c ? `badge-${c}` : "", l = m ? `badge-${m}` : "", v = [
375
+ const t = "badge", C = c ? `badge-${c}` : "", i = p ? `badge-${p}` : "", v = [
376
376
  t,
377
- E,
378
- l,
377
+ C,
378
+ i,
379
379
  n ? "badge-outline" : "",
380
- i
380
+ u
381
381
  ].filter(Boolean).join(" ");
382
- return /* @__PURE__ */ C.jsx("div", { className: v, children: u });
383
- }, xe = ({
384
- placeholder: u,
382
+ return /* @__PURE__ */ r.jsx("div", { className: v, children: f });
383
+ }, je = ({
384
+ placeholder: f,
385
385
  value: c,
386
- onChange: m,
386
+ onChange: p,
387
387
  type: n = "text",
388
- variant: i,
388
+ variant: u,
389
389
  size: t = "md",
390
- disabled: E = !1,
391
- required: l = !1,
392
- label: R,
390
+ disabled: C = !1,
391
+ required: i = !1,
392
+ label: j,
393
393
  leftSection: v,
394
- rightSection: h,
395
- pattern: x,
396
- className: f = "",
397
- validator: a = !1,
398
- validatorHint: r
394
+ rightSection: g,
395
+ pattern: w,
396
+ className: d = "",
397
+ validator: o = !1,
398
+ validatorHint: a,
399
+ validationRules: R = []
399
400
  }) => {
400
- const j = "input", N = i ? `input-${i}` : "", w = t ? `input-${t}` : "", O = [
401
- j,
402
- N,
403
- w,
404
- a ? "validator" : "",
405
- f
406
- ].filter(Boolean).join(" ");
407
- return R || v || h ? /* @__PURE__ */ C.jsxs("div", { children: [
408
- /* @__PURE__ */ C.jsxs("label", { className: O, children: [
409
- v && /* @__PURE__ */ C.jsx("span", { children: v }),
410
- R && /* @__PURE__ */ C.jsx("span", { children: R }),
411
- /* @__PURE__ */ C.jsx(
401
+ const [P, M] = U(!1), [$, I] = U(""), [O, W] = U(null), [y, D] = U(!1), [S, F] = U([]), T = oe(null), E = n === "password" && P ? "text" : n, k = (h) => {
402
+ const _ = h.target.value;
403
+ if (n === "password" && _.length > (c || "").length) {
404
+ const A = _.slice((c || "").length);
405
+ I(A), setTimeout(() => {
406
+ I("");
407
+ }, 1e3);
408
+ }
409
+ o && T.current && G(_), p && p(h);
410
+ }, G = (h) => {
411
+ if (!T.current) return;
412
+ const _ = T.current.checkValidity(), A = [];
413
+ R.length > 0 && R.forEach((m) => {
414
+ m.pattern.test(h) || A.push(m.message);
415
+ }), F(A), W(_ && A.length === 0);
416
+ }, V = () => {
417
+ M(!P);
418
+ }, z = () => {
419
+ o && !O && D(!0);
420
+ }, Y = () => {
421
+ D(!1);
422
+ };
423
+ let L = "";
424
+ o && O !== null && (L = O ? "input-success" : "input-error");
425
+ const q = "input", J = u && !L ? `input-${u}` : "", e = t ? `input-${t}` : "", l = [
426
+ q,
427
+ J,
428
+ e,
429
+ o ? "validator" : "",
430
+ L,
431
+ d
432
+ ].filter(Boolean).join(" "), b = n === "password" && /* @__PURE__ */ r.jsx(
433
+ "span",
434
+ {
435
+ className: "cursor-pointer opacity-70 hover:opacity-100",
436
+ onClick: V,
437
+ children: P ? (
438
+ // 眼睛关闭图标
439
+ /* @__PURE__ */ r.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-5 w-5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
440
+ /* @__PURE__ */ r.jsx("path", { d: "M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94" }),
441
+ /* @__PURE__ */ r.jsx("path", { d: "M14.12 14.12a3 3 0 1 1-4.24-4.24" }),
442
+ /* @__PURE__ */ r.jsx("path", { d: "M1 1l22 22" }),
443
+ /* @__PURE__ */ r.jsx("path", { d: "M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19" })
444
+ ] })
445
+ ) : (
446
+ // 眼睛打开图标
447
+ /* @__PURE__ */ r.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-5 w-5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
448
+ /* @__PURE__ */ r.jsx("path", { d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" }),
449
+ /* @__PURE__ */ r.jsx("circle", { cx: "12", cy: "12", r: "3" })
450
+ ] })
451
+ )
452
+ }
453
+ ), N = /* @__PURE__ */ r.jsx("div", { className: "validation-tooltip", children: S.length > 0 ? /* @__PURE__ */ r.jsx("ul", { className: "text-xs list-disc pl-4 py-1", children: S.map((h, _) => /* @__PURE__ */ r.jsx("li", { children: h }, _)) }) : a ? /* @__PURE__ */ r.jsx("p", { className: "text-xs py-1", children: a }) : null });
454
+ return j || v || g || n === "password" ? /* @__PURE__ */ r.jsxs("div", { className: "relative", onMouseEnter: z, onMouseLeave: Y, children: [
455
+ /* @__PURE__ */ r.jsxs("label", { className: l, children: [
456
+ v && /* @__PURE__ */ r.jsx("span", { children: v }),
457
+ j && /* @__PURE__ */ r.jsx("span", { children: j }),
458
+ /* @__PURE__ */ r.jsx(
412
459
  "input",
413
460
  {
414
- type: n,
415
- placeholder: u,
461
+ ref: T,
462
+ type: E,
463
+ placeholder: f,
416
464
  value: c,
417
- onChange: m,
418
- disabled: E,
419
- required: l,
465
+ onChange: k,
466
+ disabled: C,
467
+ required: i,
420
468
  className: "grow",
421
- pattern: x
469
+ pattern: w
422
470
  }
423
471
  ),
424
- h && /* @__PURE__ */ C.jsx("span", { children: h })
472
+ n === "password" && $ && /* @__PURE__ */ r.jsx("span", { className: "password-recent absolute right-10 font-mono", children: $ }),
473
+ n === "password" ? /* @__PURE__ */ r.jsx("span", { children: b }) : g ? /* @__PURE__ */ r.jsx("span", { children: g }) : null
425
474
  ] }),
426
- a && r && /* @__PURE__ */ C.jsx("p", { className: "validator-hint", children: r })
427
- ] }) : /* @__PURE__ */ C.jsxs("div", { children: [
428
- /* @__PURE__ */ C.jsx(
475
+ o && a && !y && /* @__PURE__ */ r.jsx("p", { className: "validator-hint text-xs mt-1 opacity-70", children: a }),
476
+ y && o && !O && /* @__PURE__ */ r.jsx("div", { className: "absolute z-10 mt-1 bg-base-200 border border-error rounded shadow-lg text-error px-3 py-1", children: N })
477
+ ] }) : /* @__PURE__ */ r.jsxs("div", { className: "relative", onMouseEnter: z, onMouseLeave: Y, children: [
478
+ /* @__PURE__ */ r.jsx(
429
479
  "input",
430
480
  {
431
- type: n,
432
- placeholder: u,
481
+ ref: T,
482
+ type: E,
483
+ placeholder: f,
433
484
  value: c,
434
- onChange: m,
435
- disabled: E,
436
- required: l,
437
- className: O,
438
- pattern: x
485
+ onChange: k,
486
+ disabled: C,
487
+ required: i,
488
+ className: l,
489
+ pattern: w
439
490
  }
440
491
  ),
441
- a && r && /* @__PURE__ */ C.jsx("p", { className: "validator-hint", children: r })
492
+ o && a && !y && /* @__PURE__ */ r.jsx("p", { className: "validator-hint text-xs mt-1 opacity-70", children: a }),
493
+ y && o && !O && /* @__PURE__ */ r.jsx("div", { className: "absolute z-10 mt-1 bg-base-200 border border-error rounded shadow-lg text-error px-3 py-1", children: N })
442
494
  ] });
443
- }, je = ({
444
- children: u,
495
+ }, ge = ({
496
+ children: f,
445
497
  variant: c = "neutral",
446
- size: m = "md",
498
+ size: p = "md",
447
499
  outline: n = !1,
448
- dash: i = !1,
500
+ dash: u = !1,
449
501
  soft: t = !1,
450
- bold: E = !1,
451
- italic: l = !1,
452
- underline: R = !1,
502
+ bold: C = !1,
503
+ italic: i = !1,
504
+ underline: j = !1,
453
505
  ellipsis: v = !1,
454
- maxWidth: h,
455
- stateTimeout: x,
456
- styleConfig: f = {},
506
+ maxWidth: g,
507
+ stateTimeout: w,
508
+ styleConfig: d = {},
457
509
  // 使用用户传入的状态,默认为'default'
458
- state: a,
459
- onStateChange: r,
460
- onClick: j,
461
- onDoubleClick: N,
462
- onMouseEnter: w,
463
- onMouseLeave: P,
464
- onDragStart: O,
465
- onDragEnd: y,
466
- draggable: G = !1,
467
- className: U = "",
468
- style: q = {}
510
+ state: o,
511
+ onStateChange: a,
512
+ onClick: R,
513
+ onDoubleClick: P,
514
+ onMouseEnter: M,
515
+ onMouseLeave: $,
516
+ onDragStart: I,
517
+ onDragEnd: O,
518
+ draggable: W = !1,
519
+ className: y = "",
520
+ style: D = {}
469
521
  }) => {
470
- var ee, se;
471
- const [Y, S] = ue("default"), $ = a !== void 0 ? a : Y, _ = fe(null), k = (p) => {
472
- a === void 0 && S(p), r && r(p), J(p);
473
- }, J = (p = $) => {
474
- _.current && (clearTimeout(_.current), _.current = null), x && p !== "default" && a === void 0 && (_.current = setTimeout(() => {
475
- S("default"), r && r("default");
476
- }, x));
522
+ var se, te;
523
+ const [S, F] = U("default"), T = o !== void 0 ? o : S, E = oe(null), k = (x) => {
524
+ o === void 0 && F(x), a && a(x), G(x);
525
+ }, G = (x = T) => {
526
+ E.current && (clearTimeout(E.current), E.current = null), w && x !== "default" && o === void 0 && (E.current = setTimeout(() => {
527
+ F("default"), a && a("default");
528
+ }, w));
477
529
  };
478
- me(() => (J(), () => {
479
- _.current && clearTimeout(_.current);
480
- }), [$, x, a]);
481
- const I = "label", V = c ? `text-${c}` : "", D = {
530
+ de(() => (G(), () => {
531
+ E.current && clearTimeout(E.current);
532
+ }), [T, w, o]);
533
+ const V = "label", z = c ? `text-${c}` : "", Y = {
482
534
  xs: "text-xs",
483
535
  sm: "text-sm",
484
536
  md: "text-base",
485
537
  lg: "text-lg",
486
538
  xl: "text-xl"
487
- }, X = D[m] || D.md, T = [
488
- I,
539
+ }, L = Y[p] || Y.md, h = [
489
540
  V,
490
- X,
541
+ z,
542
+ L,
491
543
  n ? "border border-current px-2 py-1 rounded" : "",
492
- i ? "border border-dashed border-current px-2 py-1 rounded" : "",
544
+ u ? "border border-dashed border-current px-2 py-1 rounded" : "",
493
545
  t ? "bg-opacity-10 bg-current px-2 py-1 rounded" : "",
494
- E ? "font-bold" : "",
495
- l ? "italic" : "",
496
- R ? "underline" : "",
546
+ C ? "font-bold" : "",
547
+ i ? "italic" : "",
548
+ j ? "underline" : "",
497
549
  v ? "truncate" : "",
498
- U
499
- ].filter(Boolean).join(" "), F = (p) => {
500
- k("clicked"), j && j(p);
501
- }, B = (p) => {
502
- k("doubleClicked"), N && N(p);
503
- }, d = (p) => {
504
- k("hover"), w && w(p);
505
- }, A = (p) => {
506
- k("default"), P && P(p);
507
- }, L = (p) => {
508
- k("dragging"), O && O(p);
509
- }, K = (p) => {
510
- k("default"), y && y(p);
511
- }, oe = ((ee = f[$]) == null ? void 0 : ee.style) || {}, le = ((se = f[$]) == null ? void 0 : se.className) || "", ce = {
512
- ...q,
513
- ...oe,
514
- ...h ? { maxWidth: h } : {},
550
+ y
551
+ ].filter(Boolean).join(" "), _ = (x) => {
552
+ k("clicked"), R && R(x);
553
+ }, A = (x) => {
554
+ k("doubleClicked"), P && P(x);
555
+ }, m = (x) => {
556
+ k("hover"), M && M(x);
557
+ }, B = (x) => {
558
+ k("default"), $ && $(x);
559
+ }, X = (x) => {
560
+ k("dragging"), I && I(x);
561
+ }, ee = (x) => {
562
+ k("default"), O && O(x);
563
+ }, ce = ((se = d[T]) == null ? void 0 : se.style) || {}, ie = ((te = d[T]) == null ? void 0 : te.className) || "", ue = {
564
+ ...D,
565
+ ...ce,
566
+ ...g ? { maxWidth: g } : {},
515
567
  ...v ? { display: "inline-block", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" } : {}
516
- }, ie = `${T} ${le}`.trim();
517
- return /* @__PURE__ */ C.jsx(
568
+ }, fe = `${h} ${ie}`.trim();
569
+ return /* @__PURE__ */ r.jsx(
518
570
  "span",
519
571
  {
520
- className: ie,
521
- style: ce,
522
- onClick: F,
523
- onDoubleClick: B,
524
- onMouseEnter: d,
525
- onMouseLeave: A,
526
- onDragStart: L,
527
- onDragEnd: K,
528
- draggable: G,
529
- children: u
572
+ className: fe,
573
+ style: ue,
574
+ onClick: _,
575
+ onDoubleClick: A,
576
+ onMouseEnter: m,
577
+ onMouseLeave: B,
578
+ onDragStart: X,
579
+ onDragEnd: ee,
580
+ draggable: W,
581
+ children: f
530
582
  }
531
583
  );
532
584
  };
533
585
  export {
534
- he as Badge,
535
- ae as Button,
536
- xe as Input,
537
- je as Label
586
+ Ee as Badge,
587
+ le as Button,
588
+ je as Input,
589
+ ge as Label
538
590
  };