naria-ui 0.1.37 → 0.1.38

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.
@@ -1,6 +1,6 @@
1
- import * as $ from "react";
2
- import oe, { useState as y, useEffect as S } from "react";
3
- var L = { exports: {} }, C = {};
1
+ import * as z from "react";
2
+ import ie, { useState as N, useEffect as b, useRef as ee } from "react";
3
+ var G = { exports: {} }, H = {};
4
4
  /**
5
5
  * @license React
6
6
  * react-jsx-runtime.production.js
@@ -10,29 +10,29 @@ var L = { exports: {} }, C = {};
10
10
  * This source code is licensed under the MIT license found in the
11
11
  * LICENSE file in the root directory of this source tree.
12
12
  */
13
- var Q;
14
- function ae() {
15
- if (Q) return C;
16
- Q = 1;
13
+ var re;
14
+ function le() {
15
+ if (re) return H;
16
+ re = 1;
17
17
  var t = Symbol.for("react.transitional.element"), s = Symbol.for("react.fragment");
18
- function i(v, c, l) {
19
- var w = null;
20
- if (l !== void 0 && (w = "" + l), c.key !== void 0 && (w = "" + c.key), "key" in c) {
21
- l = {};
22
- for (var f in c)
23
- f !== "key" && (l[f] = c[f]);
24
- } else l = c;
25
- return c = l.ref, {
18
+ function c(g, o, u) {
19
+ var h = null;
20
+ if (u !== void 0 && (h = "" + u), o.key !== void 0 && (h = "" + o.key), "key" in o) {
21
+ u = {};
22
+ for (var d in o)
23
+ d !== "key" && (u[d] = o[d]);
24
+ } else u = o;
25
+ return o = u.ref, {
26
26
  $$typeof: t,
27
- type: v,
28
- key: w,
29
- ref: c !== void 0 ? c : null,
30
- props: l
27
+ type: g,
28
+ key: h,
29
+ ref: o !== void 0 ? o : null,
30
+ props: u
31
31
  };
32
32
  }
33
- return C.Fragment = s, C.jsx = i, C.jsxs = i, C;
33
+ return H.Fragment = s, H.jsx = c, H.jsxs = c, H;
34
34
  }
35
- var N = {};
35
+ var J = {};
36
36
  /**
37
37
  * @license React
38
38
  * react-jsx-runtime.development.js
@@ -42,47 +42,47 @@ var N = {};
42
42
  * This source code is licensed under the MIT license found in the
43
43
  * LICENSE file in the root directory of this source tree.
44
44
  */
45
- var K;
46
- function se() {
47
- return K || (K = 1, process.env.NODE_ENV !== "production" && function() {
45
+ var te;
46
+ function ue() {
47
+ return te || (te = 1, process.env.NODE_ENV !== "production" && function() {
48
48
  function t(e) {
49
49
  if (e == null) return null;
50
50
  if (typeof e == "function")
51
- return e.$$typeof === re ? null : e.displayName || e.name || null;
51
+ return e.$$typeof === v ? null : e.displayName || e.name || null;
52
52
  if (typeof e == "string") return e;
53
53
  switch (e) {
54
- case R:
54
+ case A:
55
55
  return "Fragment";
56
- case k:
56
+ case O:
57
57
  return "Profiler";
58
- case h:
58
+ case C:
59
59
  return "StrictMode";
60
- case I:
60
+ case F:
61
61
  return "Suspense";
62
- case W:
62
+ case S:
63
63
  return "SuspenseList";
64
- case q:
64
+ case k:
65
65
  return "Activity";
66
66
  }
67
67
  if (typeof e == "object")
68
68
  switch (typeof e.tag == "number" && console.error(
69
69
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
70
70
  ), e.$$typeof) {
71
- case Y:
71
+ case L:
72
72
  return "Portal";
73
- case P:
73
+ case Y:
74
74
  return (e.displayName || "Context") + ".Provider";
75
- case T:
75
+ case X:
76
76
  return (e._context.displayName || "Context") + ".Consumer";
77
- case _:
78
- var r = e.render;
79
- return e = e.displayName, e || (e = r.displayName || r.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
80
- case F:
81
- return r = e.displayName || null, r !== null ? r : t(e.type) || "Memo";
82
- case a:
83
- r = e._payload, e = e._init;
77
+ case l:
78
+ var n = e.render;
79
+ return e = e.displayName, e || (e = n.displayName || n.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
80
+ case T:
81
+ return n = e.displayName || null, n !== null ? n : t(e.type) || "Memo";
82
+ case M:
83
+ n = e._payload, e = e._init;
84
84
  try {
85
- return t(e(r));
85
+ return t(e(n));
86
86
  } catch {
87
87
  }
88
88
  }
@@ -91,76 +91,76 @@ function se() {
91
91
  function s(e) {
92
92
  return "" + e;
93
93
  }
94
- function i(e) {
94
+ function c(e) {
95
95
  try {
96
96
  s(e);
97
- var r = !1;
97
+ var n = !1;
98
98
  } catch {
99
- r = !0;
99
+ n = !0;
100
100
  }
101
- if (r) {
102
- r = console;
103
- var o = r.error, u = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
104
- return o.call(
105
- r,
101
+ if (n) {
102
+ n = console;
103
+ var r = n.error, i = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
104
+ return r.call(
105
+ n,
106
106
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
107
- u
107
+ i
108
108
  ), s(e);
109
109
  }
110
110
  }
111
- function v(e) {
112
- if (e === R) return "<>";
113
- if (typeof e == "object" && e !== null && e.$$typeof === a)
111
+ function g(e) {
112
+ if (e === A) return "<>";
113
+ if (typeof e == "object" && e !== null && e.$$typeof === M)
114
114
  return "<...>";
115
115
  try {
116
- var r = t(e);
117
- return r ? "<" + r + ">" : "<...>";
116
+ var n = t(e);
117
+ return n ? "<" + n + ">" : "<...>";
118
118
  } catch {
119
119
  return "<...>";
120
120
  }
121
121
  }
122
- function c() {
123
- var e = z.A;
122
+ function o() {
123
+ var e = P.A;
124
124
  return e === null ? null : e.getOwner();
125
125
  }
126
- function l() {
126
+ function u() {
127
127
  return Error("react-stack-top-frame");
128
128
  }
129
- function w(e) {
130
- if (V.call(e, "key")) {
131
- var r = Object.getOwnPropertyDescriptor(e, "key").get;
132
- if (r && r.isReactWarning) return !1;
129
+ function h(e) {
130
+ if (x.call(e, "key")) {
131
+ var n = Object.getOwnPropertyDescriptor(e, "key").get;
132
+ if (n && n.isReactWarning) return !1;
133
133
  }
134
134
  return e.key !== void 0;
135
135
  }
136
- function f(e, r) {
137
- function o() {
138
- B || (B = !0, console.error(
136
+ function d(e, n) {
137
+ function r() {
138
+ D || (D = !0, console.error(
139
139
  "%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)",
140
- r
140
+ n
141
141
  ));
142
142
  }
143
- o.isReactWarning = !0, Object.defineProperty(e, "key", {
144
- get: o,
143
+ r.isReactWarning = !0, Object.defineProperty(e, "key", {
144
+ get: r,
145
145
  configurable: !0
146
146
  });
147
147
  }
148
- function A() {
148
+ function E() {
149
149
  var e = t(this.type);
150
- return G[e] || (G[e] = !0, console.error(
150
+ return $[e] || ($[e] = !0, console.error(
151
151
  "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."
152
152
  )), e = this.props.ref, e !== void 0 ? e : null;
153
153
  }
154
- function E(e, r, o, u, x, p, M, U) {
155
- return o = p.ref, e = {
156
- $$typeof: O,
154
+ function m(e, n, r, i, p, R, Z, Q) {
155
+ return r = R.ref, e = {
156
+ $$typeof: y,
157
157
  type: e,
158
- key: r,
159
- props: p,
160
- _owner: x
161
- }, (o !== void 0 ? o : null) !== null ? Object.defineProperty(e, "ref", {
158
+ key: n,
159
+ props: R,
160
+ _owner: p
161
+ }, (r !== void 0 ? r : null) !== null ? Object.defineProperty(e, "ref", {
162
162
  enumerable: !1,
163
- get: A
163
+ get: E
164
164
  }) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
165
165
  configurable: !1,
166
166
  enumerable: !1,
@@ -175,167 +175,168 @@ function se() {
175
175
  configurable: !1,
176
176
  enumerable: !1,
177
177
  writable: !0,
178
- value: M
178
+ value: Z
179
179
  }), Object.defineProperty(e, "_debugTask", {
180
180
  configurable: !1,
181
181
  enumerable: !1,
182
182
  writable: !0,
183
- value: U
183
+ value: Q
184
184
  }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
185
185
  }
186
- function g(e, r, o, u, x, p, M, U) {
187
- var d = r.children;
188
- if (d !== void 0)
189
- if (u)
190
- if (te(d)) {
191
- for (u = 0; u < d.length; u++)
192
- b(d[u]);
193
- Object.freeze && Object.freeze(d);
186
+ function W(e, n, r, i, p, R, Z, Q) {
187
+ var f = n.children;
188
+ if (f !== void 0)
189
+ if (i)
190
+ if (q(f)) {
191
+ for (i = 0; i < f.length; i++)
192
+ w(f[i]);
193
+ Object.freeze && Object.freeze(f);
194
194
  } else
195
195
  console.error(
196
196
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
197
197
  );
198
- else b(d);
199
- if (V.call(r, "key")) {
200
- d = t(e);
201
- var j = Object.keys(r).filter(function(ne) {
202
- return ne !== "key";
198
+ else w(f);
199
+ if (x.call(n, "key")) {
200
+ f = t(e);
201
+ var I = Object.keys(n).filter(function(ce) {
202
+ return ce !== "key";
203
203
  });
204
- u = 0 < j.length ? "{key: someKey, " + j.join(": ..., ") + ": ...}" : "{key: someKey}", H[d + u] || (j = 0 < j.length ? "{" + j.join(": ..., ") + ": ...}" : "{}", console.error(
204
+ i = 0 < I.length ? "{key: someKey, " + I.join(": ..., ") + ": ...}" : "{key: someKey}", V[f + i] || (I = 0 < I.length ? "{" + I.join(": ..., ") + ": ...}" : "{}", console.error(
205
205
  `A props object containing a "key" prop is being spread into JSX:
206
206
  let props = %s;
207
207
  <%s {...props} />
208
208
  React keys must be passed directly to JSX without using spread:
209
209
  let props = %s;
210
210
  <%s key={someKey} {...props} />`,
211
- u,
212
- d,
213
- j,
214
- d
215
- ), H[d + u] = !0);
211
+ i,
212
+ f,
213
+ I,
214
+ f
215
+ ), V[f + i] = !0);
216
216
  }
217
- if (d = null, o !== void 0 && (i(o), d = "" + o), w(r) && (i(r.key), d = "" + r.key), "key" in r) {
218
- o = {};
219
- for (var J in r)
220
- J !== "key" && (o[J] = r[J]);
221
- } else o = r;
222
- return d && f(
223
- o,
217
+ if (f = null, r !== void 0 && (c(r), f = "" + r), h(n) && (c(n.key), f = "" + n.key), "key" in n) {
218
+ r = {};
219
+ for (var K in n)
220
+ K !== "key" && (r[K] = n[K]);
221
+ } else r = n;
222
+ return f && d(
223
+ r,
224
224
  typeof e == "function" ? e.displayName || e.name || "Unknown" : e
225
- ), E(
225
+ ), m(
226
226
  e,
227
- d,
227
+ f,
228
+ R,
228
229
  p,
229
- x,
230
- c(),
231
- o,
232
- M,
233
- U
230
+ o(),
231
+ r,
232
+ Z,
233
+ Q
234
234
  );
235
235
  }
236
- function b(e) {
237
- typeof e == "object" && e !== null && e.$$typeof === O && e._store && (e._store.validated = 1);
236
+ function w(e) {
237
+ typeof e == "object" && e !== null && e.$$typeof === y && e._store && (e._store.validated = 1);
238
238
  }
239
- var m = oe, O = Symbol.for("react.transitional.element"), Y = Symbol.for("react.portal"), R = Symbol.for("react.fragment"), h = Symbol.for("react.strict_mode"), k = Symbol.for("react.profiler"), T = Symbol.for("react.consumer"), P = Symbol.for("react.context"), _ = Symbol.for("react.forward_ref"), I = Symbol.for("react.suspense"), W = Symbol.for("react.suspense_list"), F = Symbol.for("react.memo"), a = Symbol.for("react.lazy"), q = Symbol.for("react.activity"), re = Symbol.for("react.client.reference"), z = m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, V = Object.prototype.hasOwnProperty, te = Array.isArray, D = console.createTask ? console.createTask : function() {
239
+ var j = ie, y = Symbol.for("react.transitional.element"), L = Symbol.for("react.portal"), A = Symbol.for("react.fragment"), C = Symbol.for("react.strict_mode"), O = Symbol.for("react.profiler"), X = Symbol.for("react.consumer"), Y = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), F = Symbol.for("react.suspense"), S = Symbol.for("react.suspense_list"), T = Symbol.for("react.memo"), M = Symbol.for("react.lazy"), k = Symbol.for("react.activity"), v = Symbol.for("react.client.reference"), P = j.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, x = Object.prototype.hasOwnProperty, q = Array.isArray, _ = console.createTask ? console.createTask : function() {
240
240
  return null;
241
241
  };
242
- m = {
242
+ j = {
243
243
  "react-stack-bottom-frame": function(e) {
244
244
  return e();
245
245
  }
246
246
  };
247
- var B, G = {}, X = m["react-stack-bottom-frame"].bind(
248
- m,
249
- l
250
- )(), Z = D(v(l)), H = {};
251
- N.Fragment = R, N.jsx = function(e, r, o, u, x) {
252
- var p = 1e4 > z.recentlyCreatedOwnerStacks++;
253
- return g(
247
+ var D, $ = {}, U = j["react-stack-bottom-frame"].bind(
248
+ j,
249
+ u
250
+ )(), B = _(g(u)), V = {};
251
+ J.Fragment = A, J.jsx = function(e, n, r, i, p) {
252
+ var R = 1e4 > P.recentlyCreatedOwnerStacks++;
253
+ return W(
254
254
  e,
255
+ n,
255
256
  r,
256
- o,
257
257
  !1,
258
- u,
259
- x,
260
- p ? Error("react-stack-top-frame") : X,
261
- p ? D(v(e)) : Z
258
+ i,
259
+ p,
260
+ R ? Error("react-stack-top-frame") : U,
261
+ R ? _(g(e)) : B
262
262
  );
263
- }, N.jsxs = function(e, r, o, u, x) {
264
- var p = 1e4 > z.recentlyCreatedOwnerStacks++;
265
- return g(
263
+ }, J.jsxs = function(e, n, r, i, p) {
264
+ var R = 1e4 > P.recentlyCreatedOwnerStacks++;
265
+ return W(
266
266
  e,
267
+ n,
267
268
  r,
268
- o,
269
269
  !0,
270
- u,
271
- x,
272
- p ? Error("react-stack-top-frame") : X,
273
- p ? D(v(e)) : Z
270
+ i,
271
+ p,
272
+ R ? Error("react-stack-top-frame") : U,
273
+ R ? _(g(e)) : B
274
274
  );
275
275
  };
276
- }()), N;
276
+ }()), J;
277
277
  }
278
- var ee;
279
- function ce() {
280
- return ee || (ee = 1, process.env.NODE_ENV === "production" ? L.exports = ae() : L.exports = se()), L.exports;
278
+ var ne;
279
+ function de() {
280
+ return ne || (ne = 1, process.env.NODE_ENV === "production" ? G.exports = le() : G.exports = ue()), G.exports;
281
281
  }
282
- var n = ce();
283
- const ve = ({ type: t = "button", value: s }) => /* @__PURE__ */ n.jsx("button", { type: t, children: s }), we = ({
282
+ var a = de();
283
+ const xe = ({ type: t = "button", value: s }) => /* @__PURE__ */ a.jsx("button", { type: t, children: s }), be = ({
284
284
  type: t = "text",
285
285
  placeholder: s,
286
- wrapperClass: i = "",
287
- labelClass: v = "",
288
- inputClass: c = "",
289
- errorClass: l = "",
290
- label: w,
291
- hasError: f,
292
- register: A,
293
- name: E,
294
- isDisabled: g = !1,
295
- autocomplete: b = !1,
296
- ...m
297
- }) => /* @__PURE__ */ n.jsxs("div", { className: i, children: [
298
- /* @__PURE__ */ n.jsxs(
286
+ wrapperClass: c = "",
287
+ labelClass: g = "",
288
+ inputClass: o = "",
289
+ errorClass: u = "",
290
+ label: h,
291
+ hasError: d,
292
+ register: E,
293
+ name: m,
294
+ isDisabled: W = !1,
295
+ autocomplete: w = !1,
296
+ ...j
297
+ }) => /* @__PURE__ */ a.jsxs("div", { className: c, children: [
298
+ /* @__PURE__ */ a.jsxs(
299
299
  "label",
300
300
  {
301
- htmlFor: E,
302
- className: `${v} ${f && "error"}`,
301
+ htmlFor: m,
302
+ className: `${g} ${d && "error"}`,
303
303
  children: [
304
- w,
305
- /* @__PURE__ */ n.jsx(
304
+ h,
305
+ /* @__PURE__ */ a.jsx(
306
306
  "input",
307
307
  {
308
- disabled: g,
309
- autoComplete: b ? "on" : "off",
310
- id: E,
311
- ...A,
312
- ...m,
308
+ disabled: W,
309
+ autoComplete: w ? "on" : "off",
310
+ id: m,
311
+ ...E,
312
+ ...j,
313
313
  type: t,
314
- name: E,
315
- className: `${c} ${f && "error"} ${l}`,
314
+ name: m,
315
+ className: `${o} ${d && "error"} ${u}`,
316
316
  placeholder: s
317
317
  }
318
318
  )
319
319
  ]
320
320
  }
321
321
  ),
322
- f && /* @__PURE__ */ n.jsx("p", { className: l, children: f })
323
- ] }), le = (t) => /* @__PURE__ */ $.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 448 512", fill: "currentColor", ...t }, /* @__PURE__ */ $.createElement("path", { d: "M241 337c-9.4 9.4-24.6 9.4-33.9 0L47 177c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l143 143L367 143c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9L241 337z" })), ie = (t) => /* @__PURE__ */ $.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 -960 960 960", fill: "currentColor", ...t }, /* @__PURE__ */ $.createElement("path", { d: "M480-424 284-228q-11 11-28 11t-28-11q-11-11-11-28t11-28l196-196-196-196q-11-11-11-28t11-28q11-11 28-11t28 11l196 196 196-196q11-11 28-11t28 11q11 11 11 28t-11 28L536-480l196 196q11 11 11 28t-11 28q-11 11-28 11t-28-11L480-424Z" })), ue = () => {
324
- const [t, s] = y(typeof window < "u" ? window.innerWidth : 0), i = () => s(typeof window < "u" ? window.innerWidth : 0);
325
- return S(() => (window.addEventListener("resize", i), () => window.removeEventListener("resize", i)), [t]), t;
326
- }, de = ({
327
- size: t = "w-10 h-10",
328
- bgColor: s = "text-gray-300",
329
- color: i = "text-primary-100"
330
- }) => /* @__PURE__ */ n.jsxs(
322
+ d && /* @__PURE__ */ a.jsx("p", { className: u, children: d })
323
+ ] }), ae = (t) => /* @__PURE__ */ z.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 384 512", fill: "currentColor", ...t }, /* @__PURE__ */ z.createElement("path", { fill: "currentColor", d: "M209.5 369c-9.4 9.4-24.6 9.4-33.9 0L15.5 209c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l143 143 143-143c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-160 160z" })), fe = (t) => /* @__PURE__ */ z.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 384 512", fill: "currentColor", ...t }, /* @__PURE__ */ z.createElement("path", { fill: "currentColor", d: "M7.5 105c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l151 151 151-151c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-151 151 151 151c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-151-151-151 151c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l151-151-151-151z" })), oe = (t) => /* @__PURE__ */ z.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", fill: "currentColor", ...t }, /* @__PURE__ */ z.createElement("path", { fill: "currentColor", d: "M368 208a160 160 0 1 0 -320 0 160 160 0 1 0 320 0zM337.1 371.1C301.7 399.2 256.8 416 208 416 93.1 416 0 322.9 0 208S93.1 0 208 0 416 93.1 416 208c0 48.8-16.8 93.7-44.9 129.1L505 471c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0L337.1 371.1z" })), ge = () => {
324
+ const [t, s] = N(typeof window < "u" ? window.innerWidth : 0), c = () => s(typeof window < "u" ? window.innerWidth : 0);
325
+ return b(() => (window.addEventListener("resize", c), () => window.removeEventListener("resize", c)), [t]), t;
326
+ }, se = ({
327
+ classNames: t = {
328
+ wrapper: "",
329
+ color: ""
330
+ }
331
+ }) => /* @__PURE__ */ a.jsxs(
331
332
  "svg",
332
333
  {
333
- className: `${t} ${s} animate-spin`,
334
+ className: `nariaLoading ${t.wrapper}`,
334
335
  viewBox: "0 0 64 64",
335
336
  fill: "none",
336
337
  xmlns: "http://www.w3.org/2000/svg",
337
338
  children: [
338
- /* @__PURE__ */ n.jsx(
339
+ /* @__PURE__ */ a.jsx(
339
340
  "path",
340
341
  {
341
342
  d: "M32 3C35.8083 3 39.5794 3.75011 43.0978 5.20749C46.6163 6.66488 49.8132 8.80101 52.5061 11.4939C55.199 14.1868 57.3351 17.3837 58.7925 20.9022C60.2499 24.4206 61 28.1917 61 32C61 35.8083 60.2499 39.5794 58.7925 43.0978C57.3351 46.6163 55.199 49.8132 52.5061 52.5061C49.8132 55.199 46.6163 57.3351 43.0978 58.7925C39.5794 60.2499 35.8083 61 32 61C28.1917 61 24.4206 60.2499 20.9022 58.7925C17.3837 57.3351 14.1868 55.199 11.4939 52.5061C8.801 49.8132 6.66487 46.6163 5.20749 43.0978C3.7501 39.5794 3 35.8083 3 32C3 28.1917 3.75011 24.4206 5.2075 20.9022C6.66489 17.3837 8.80101 14.1868 11.4939 11.4939C14.1868 8.80099 17.3838 6.66487 20.9022 5.20749C24.4206 3.7501 28.1917 3 32 3L32 3Z",
@@ -345,7 +346,7 @@ const ve = ({ type: t = "button", value: s }) => /* @__PURE__ */ n.jsx("button",
345
346
  strokeLinejoin: "round"
346
347
  }
347
348
  ),
348
- /* @__PURE__ */ n.jsx(
349
+ /* @__PURE__ */ a.jsx(
349
350
  "path",
350
351
  {
351
352
  d: "M32 3C36.5778 3 41.0906 4.08374 45.1692 6.16256C49.2477 8.24138 52.7762 11.2562 55.466 14.9605C58.1558 18.6647 59.9304 22.9531 60.6448 27.4748C61.3591 31.9965 60.9928 36.6232 59.5759 40.9762",
@@ -353,76 +354,177 @@ const ve = ({ type: t = "button", value: s }) => /* @__PURE__ */ n.jsx("button",
353
354
  strokeWidth: "6",
354
355
  strokeLinecap: "round",
355
356
  strokeLinejoin: "round",
356
- className: i
357
+ className: t.color
357
358
  }
358
359
  )
359
360
  ]
360
361
  }
361
- ), fe = () => {
362
+ ), me = () => {
362
363
  const t = `${window.location.pathname}${window.location.search}`;
363
364
  window.history.replaceState(null, "", t);
364
- }, me = (t) => {
365
+ }, he = (t) => {
365
366
  window.location.hash = t;
366
- }, be = ({
367
- list: t,
367
+ }, pe = (t) => {
368
+ const [s, c] = N(!1);
369
+ return b(() => {
370
+ const g = (o) => {
371
+ window.location.hash !== t ? c(!0) : c(!1);
372
+ };
373
+ return window.addEventListener("hashchange", g), () => {
374
+ window.removeEventListener("hashchange", g);
375
+ };
376
+ }, []), s;
377
+ }, we = (t, s, c) => {
378
+ b(() => {
379
+ function g(o) {
380
+ s.current && !s.current.contains(o.target) && t?.current && !t?.current.contains(o.target) && c();
381
+ }
382
+ return document.addEventListener("mousedown", g), () => {
383
+ document.removeEventListener("mousedown", g);
384
+ };
385
+ }, [t, c]);
386
+ }, Ee = ({
387
+ options: t,
368
388
  label: s,
369
- hasError: i,
370
- title: v,
371
- value: c,
372
- api: l,
373
- maxHeight: w = "max-h-64",
374
- theme: f = "secondary",
375
- size: A = "md",
376
- onSelectChange: E,
377
- selected: g
389
+ hasError: c,
390
+ title: g,
391
+ value: o,
392
+ api: u,
393
+ selected: h,
394
+ placeholder: d,
395
+ disabled: E = !1,
396
+ pagination: m,
397
+ optionFilterLabel: W,
398
+ hasSearch: w = !1,
399
+ onSelectChange: j
378
400
  }) => {
379
- const b = ue(), [m, O] = y(!1), [Y, R] = y(!0), [h, k] = y(null), [T, P] = y(null);
380
- S(() => {
381
- l && (R(!0), l().then((a) => {
382
- R(!1), P(a?.data?.message ? [] : a.data);
383
- }));
384
- }, [l]), S(() => {
385
- b < 1024 && (m ? (me("select"), document.body.style.overflow = "hidden") : (window.location.hash && !document.referrer.includes("#") && fe(), document.body.style.overflow = "auto"));
386
- }, [m]), S(() => {
387
- s?.length ? k(T?.find((a) => a[s] === g)) : k(g);
388
- }, [g, T]), S(() => {
389
- t?.length && P(t);
401
+ let y = !0;
402
+ const L = ge(), A = pe("#select"), [C, O] = N(!1), [X, Y] = N(!0), [l, F] = N(null), [S, T] = N(null), [M, k] = N(""), [v, P] = N({
403
+ page: 1,
404
+ pageLabel: "page",
405
+ size: 20,
406
+ sizeLabel: "size",
407
+ isLoading: !1
408
+ }), x = ee(void 0), q = ee(void 0), _ = ee(void 0), D = async () => {
409
+ if (x?.current)
410
+ try {
411
+ const r = await fetch(x?.current);
412
+ if (!r.ok)
413
+ throw new Error(`Response status: ${r.status}`);
414
+ return await r.json();
415
+ } catch (r) {
416
+ console.error(r.message);
417
+ }
418
+ };
419
+ b(() => () => {
420
+ y = !1;
421
+ }, []), b(() => {
422
+ if (u?.length) {
423
+ if (x.current = u, x.current.includes(m?.pageLabel || "page")) {
424
+ const r = new URL(u);
425
+ r.searchParams.set(m?.pageLabel || "page", (m?.page || v.page).toString()), r.searchParams.set(m?.sizeLabel || "size", (m?.size || v.size).toString()), x.current = r.href;
426
+ }
427
+ Y(!0), D().then((r) => {
428
+ y && (Y(!1), T(r));
429
+ });
430
+ }
431
+ }, [u, m]), b(() => {
432
+ if (v.isLoading) {
433
+ if (x.current.includes(m?.pageLabel || "page")) {
434
+ const r = new URL(x.current);
435
+ r.searchParams.set(m?.pageLabel || "page", v.page.toString()), x.current = r.href;
436
+ }
437
+ D().then((r) => {
438
+ y && (Y(!1), P({
439
+ ...v,
440
+ isLoading: !1
441
+ }), T([
442
+ ...S,
443
+ ...r
444
+ ]));
445
+ });
446
+ }
447
+ }, [v]), b(() => {
448
+ L < 768 && (C ? (he("select"), document.body.style.overflow = "hidden", _.current?.focus()) : (window.location.hash && !document.referrer.includes("#") && me(), document.body.style.overflow = "auto"));
449
+ }, [C]), b(() => {
450
+ h && t?.length && (t?.find((r) => r[s] === h) ? F(t?.find((r) => r[s] === h)) : F(h));
451
+ }, [h]), b(() => {
452
+ l && w && (o?.length && S?.find((r) => r[s] === l[s]) ? k(S?.find((r) => r[s] === l[s])[o] || "") : k(l));
453
+ }, [l]), b(() => {
454
+ A && O(!1);
455
+ }, [A]), b(() => {
456
+ t?.length && T(t);
390
457
  }, [t]);
391
- const _ = () => {
392
- O((a) => !a);
393
- }, I = (a) => {
394
- a?.target?.className.toString()?.includes("backdrop-select") && _();
395
- }, W = (a) => {
396
- k(a), _(), E(a);
397
- }, F = (a) => {
398
- if (!h)
458
+ const $ = () => {
459
+ w && T(t), O((r) => !r);
460
+ }, U = () => {
461
+ w && (T(t), k(typeof l == "string" ? l : l ? l[o] : "")), O(!1);
462
+ }, B = (r) => {
463
+ w && (o?.length ? k(r[o]) : k(r)), F(r), $(), j && j(r);
464
+ }, V = (r) => {
465
+ if (!l)
399
466
  return "";
400
- if (s?.length && a[s] === h[s] || a === h)
467
+ if (s?.length && r[s] === l[s] || r === l)
401
468
  return "bg-grey-100";
469
+ }, e = (r) => {
470
+ S?.length && !v.isLoading && r.target.offsetHeight + r.target.scrollTop >= r.target.scrollHeight - 100 && P({
471
+ page: v.page + 1,
472
+ isLoading: !0
473
+ });
474
+ }, n = (r) => {
475
+ const i = r?.target?.value?.length ? t.filter((p) => typeof p == "object" ? p[o].includes(r?.target?.value) : p.includes(r?.target?.value)) : t;
476
+ T(i), k(r?.target?.value), C || O(!0);
402
477
  };
403
- return /* @__PURE__ */ n.jsxs("div", { className: "naria-select", children: [
404
- /* @__PURE__ */ n.jsxs(
478
+ return we(q, _, U), /* @__PURE__ */ a.jsxs("div", { className: `nariaSelect ${E ? "nariaSelect-disabled" : ""}`, children: [
479
+ /* @__PURE__ */ a.jsxs(
405
480
  "label",
406
481
  {
407
482
  className: `cursor-pointer
408
- ${i && "!text-danger-100"}`,
483
+ ${c && "!text-danger-100"}`,
409
484
  children: [
410
- /* @__PURE__ */ n.jsx("span", { className: "", children: v }),
411
- /* @__PURE__ */ n.jsxs(
485
+ /* @__PURE__ */ a.jsx("span", { className: "", children: g }),
486
+ w ? /* @__PURE__ */ a.jsxs("div", { className: "nariaSearchInput", children: [
487
+ /* @__PURE__ */ a.jsx(
488
+ "input",
489
+ {
490
+ ref: _,
491
+ placeholder: d?.length ? d : "Select",
492
+ className: `${l ? "text-dark-100" : "text-grey-300"}
493
+ ${c && "!border-danger-100 focus:border-danger-100 outline-danger-100"}`,
494
+ value: M,
495
+ disabled: E,
496
+ type: "text",
497
+ onClick: $,
498
+ onChange: n
499
+ }
500
+ ),
501
+ C ? /* @__PURE__ */ a.jsx(
502
+ oe,
503
+ {
504
+ className: "nariaSearchIcon"
505
+ }
506
+ ) : /* @__PURE__ */ a.jsx(
507
+ ae,
508
+ {
509
+ className: `nariaArrowIcon ${C ? "nariaArrowIcon-rotate-180" : ""}`
510
+ }
511
+ )
512
+ ] }) : /* @__PURE__ */ a.jsxs(
412
513
  "button",
413
514
  {
414
515
  type: "button",
415
- className: `relative z-20 flex items-center mt-1 text-base justify-between gap-2 w-full
416
- ${h ? "text-dark-100" : "text-grey-300"}
417
- ${i && "!border-danger-100 focus:border-danger-100 outline-danger-100"}`,
418
- onClick: _,
516
+ ref: _,
517
+ disabled: E,
518
+ className: `nariaHandler ${l ? "text-dark-100" : "text-grey-300"}
519
+ ${c && "!border-danger-100 focus:border-danger-100 outline-danger-100"}`,
520
+ onClick: $,
419
521
  children: [
420
- h ? c?.length ? h[c] : h : "انتخاب",
522
+ l ? o?.length ? l[o] : l : d?.length ? d : "Select",
421
523
  " ",
422
- /* @__PURE__ */ n.jsx(
423
- le,
524
+ /* @__PURE__ */ a.jsx(
525
+ ae,
424
526
  {
425
- className: `w-4 h-4 transition ease duration-200 ${m ? "rotate-180" : "rotate-0"}`
527
+ className: `nariaArrowIcon ${C ? "nariaArrowIcon-rotate-180" : ""}`
426
528
  }
427
529
  )
428
530
  ]
@@ -431,49 +533,67 @@ const ve = ({ type: t = "button", value: s }) => /* @__PURE__ */ n.jsx("button",
431
533
  ]
432
534
  }
433
535
  ),
434
- m ? /* @__PURE__ */ n.jsxs(
536
+ C ? /* @__PURE__ */ a.jsxs(
435
537
  "div",
436
538
  {
437
- className: `wrapper ${b < 1024 ? "mobile" : ""}`,
539
+ className: `nariaListWrapper ${L < 768 ? "nariaListWrapper-mobile" : ""}`,
540
+ ref: q,
438
541
  children: [
439
- /* @__PURE__ */ n.jsx(
542
+ w && L < 768 ? /* @__PURE__ */ a.jsxs("div", { className: "nariaSearchInput", children: [
543
+ /* @__PURE__ */ a.jsx(
544
+ "input",
545
+ {
546
+ ref: _,
547
+ placeholder: d?.length ? d : "Select",
548
+ className: `${l ? "text-dark-100" : "text-grey-300"}
549
+ ${c && "!border-danger-100 focus:border-danger-100 outline-danger-100"}`,
550
+ value: M,
551
+ disabled: E,
552
+ type: "text",
553
+ onChange: n
554
+ }
555
+ ),
556
+ /* @__PURE__ */ a.jsx(
557
+ oe,
558
+ {
559
+ className: "nariaSearchIcon"
560
+ }
561
+ )
562
+ ] }) : void 0,
563
+ /* @__PURE__ */ a.jsx(
440
564
  "div",
441
565
  {
442
- className: `list ${b < 1024 ? "mobile" : `desktop ${w}`}`,
443
- children: l && Y ? /* @__PURE__ */ n.jsx("div", { className: "py-10 flex justify-center", children: /* @__PURE__ */ n.jsx(de, { size: "w-7 h-7" }) }) : /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
444
- b < 1024 ? /* @__PURE__ */ n.jsx("div", { className: "sticky top-0 text-left", children: /* @__PURE__ */ n.jsx("button", { className: "p-3", onClick: _, children: /* @__PURE__ */ n.jsx(ie, { className: "w-6" }) }) }) : void 0,
445
- T?.map((a, q) => /* @__PURE__ */ n.jsx(
566
+ className: `nariaList ${L < 768 ? "nariaList-mobile" : "nariaList-desktop"}`,
567
+ onScroll: e,
568
+ children: u && X ? /* @__PURE__ */ a.jsx("div", { className: "nariaLoadingWrapper", children: /* @__PURE__ */ a.jsx(se, {}) }) : /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
569
+ L < 768 ? /* @__PURE__ */ a.jsx("div", { className: "sticky top-0 text-left", children: /* @__PURE__ */ a.jsx("button", { className: "p-3", onClick: U, disabled: E, children: /* @__PURE__ */ a.jsx(fe, { className: "w-6" }) }) }) : void 0,
570
+ S?.length ? /* @__PURE__ */ a.jsx(a.Fragment, { children: S?.map((r, i) => /* @__PURE__ */ a.jsx(
446
571
  "button",
447
572
  {
448
573
  type: "button",
449
- onClick: () => W(a),
450
- className: `text-right py-2.5 px-4 text-base hover:bg-grey-100 rounded-lg ${F(a)}`,
451
- children: c?.length ? a[c] : a
574
+ onClick: () => B(r),
575
+ disabled: E,
576
+ className: `text-right py-2.5 px-4 text-base hover:bg-grey-100 rounded-lg ${V(r)}`,
577
+ children: o?.length ? r[o] : r
452
578
  },
453
- q.toString()
454
- ))
579
+ i.toString()
580
+ )) }) : /* @__PURE__ */ a.jsx("div", { children: "No Data" }),
581
+ v.isLoading ? /* @__PURE__ */ a.jsx("div", { className: "nariaLoadingMoreWrapper", children: /* @__PURE__ */ a.jsx(se, {}) }) : void 0
455
582
  ] })
456
583
  }
457
- ),
458
- /* @__PURE__ */ n.jsx(
459
- "div",
460
- {
461
- className: "backdrop-select",
462
- onClick: I
463
- }
464
584
  )
465
585
  ]
466
586
  }
467
587
  ) : void 0,
468
- i && /* @__PURE__ */ n.jsx("p", { className: "text-xs mt-1 text-danger-100", children: i })
588
+ c && /* @__PURE__ */ a.jsx("p", { className: "text-xs mt-1 text-danger-100", children: c })
469
589
  ] });
470
590
  };
471
- function he(t) {
591
+ function Re(t) {
472
592
  return t.charAt(0).toUpperCase() + t.slice(1);
473
593
  }
474
594
  export {
475
- ve as Button,
476
- we as Input,
477
- be as Select,
478
- he as capitalize
595
+ xe as Button,
596
+ be as Input,
597
+ Ee as Select,
598
+ Re as capitalize
479
599
  };