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.
- package/dist/lib/components/Select/Select.d.ts +15 -6
- package/dist/lib/utils/navigator.d.ts +1 -1
- package/dist/naria-ui.cjs.js +8 -7
- package/dist/naria-ui.css +1 -1
- package/dist/naria-ui.es.js +372 -252
- package/lib/components/Select/Select.tsx +278 -69
- package/lib/components/Select/select.scss +96 -16
- package/lib/utils/navigator.ts +2 -2
- package/package.json +2 -2
- package/src/App.css +0 -0
- package/src/App.tsx +0 -15
- package/src/assets/icons/angle-down.svg +0 -1
- package/src/assets/icons/angle-left.svg +0 -1
- package/src/assets/icons/angle-right.svg +0 -1
- package/src/assets/icons/angle-up.svg +0 -1
- package/src/assets/icons/close.svg +0 -1
- package/src/assets/styles/index.css +0 -1
- package/src/assets/styles/select.scss +0 -52
- package/src/index.css +0 -0
- package/src/main.tsx +0 -10
- package/src/vite-env.d.ts +0 -1
package/dist/naria-ui.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
3
|
-
var
|
|
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
|
|
14
|
-
function
|
|
15
|
-
if (
|
|
16
|
-
|
|
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
|
|
19
|
-
var
|
|
20
|
-
if (
|
|
21
|
-
|
|
22
|
-
for (var
|
|
23
|
-
|
|
24
|
-
} else
|
|
25
|
-
return
|
|
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:
|
|
28
|
-
key:
|
|
29
|
-
ref:
|
|
30
|
-
props:
|
|
27
|
+
type: g,
|
|
28
|
+
key: h,
|
|
29
|
+
ref: o !== void 0 ? o : null,
|
|
30
|
+
props: u
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
|
-
return
|
|
33
|
+
return H.Fragment = s, H.jsx = c, H.jsxs = c, H;
|
|
34
34
|
}
|
|
35
|
-
var
|
|
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
|
|
46
|
-
function
|
|
47
|
-
return
|
|
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 ===
|
|
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
|
|
54
|
+
case A:
|
|
55
55
|
return "Fragment";
|
|
56
|
-
case
|
|
56
|
+
case O:
|
|
57
57
|
return "Profiler";
|
|
58
|
-
case
|
|
58
|
+
case C:
|
|
59
59
|
return "StrictMode";
|
|
60
|
-
case
|
|
60
|
+
case F:
|
|
61
61
|
return "Suspense";
|
|
62
|
-
case
|
|
62
|
+
case S:
|
|
63
63
|
return "SuspenseList";
|
|
64
|
-
case
|
|
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
|
|
71
|
+
case L:
|
|
72
72
|
return "Portal";
|
|
73
|
-
case
|
|
73
|
+
case Y:
|
|
74
74
|
return (e.displayName || "Context") + ".Provider";
|
|
75
|
-
case
|
|
75
|
+
case X:
|
|
76
76
|
return (e._context.displayName || "Context") + ".Consumer";
|
|
77
|
-
case
|
|
78
|
-
var
|
|
79
|
-
return e = e.displayName, e || (e =
|
|
80
|
-
case
|
|
81
|
-
return
|
|
82
|
-
case
|
|
83
|
-
|
|
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(
|
|
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
|
|
94
|
+
function c(e) {
|
|
95
95
|
try {
|
|
96
96
|
s(e);
|
|
97
|
-
var
|
|
97
|
+
var n = !1;
|
|
98
98
|
} catch {
|
|
99
|
-
|
|
99
|
+
n = !0;
|
|
100
100
|
}
|
|
101
|
-
if (
|
|
102
|
-
|
|
103
|
-
var
|
|
104
|
-
return
|
|
105
|
-
|
|
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
|
-
|
|
107
|
+
i
|
|
108
108
|
), s(e);
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
|
-
function
|
|
112
|
-
if (e ===
|
|
113
|
-
if (typeof e == "object" && e !== null && e.$$typeof ===
|
|
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
|
|
117
|
-
return
|
|
116
|
+
var n = t(e);
|
|
117
|
+
return n ? "<" + n + ">" : "<...>";
|
|
118
118
|
} catch {
|
|
119
119
|
return "<...>";
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
|
-
function
|
|
123
|
-
var e =
|
|
122
|
+
function o() {
|
|
123
|
+
var e = P.A;
|
|
124
124
|
return e === null ? null : e.getOwner();
|
|
125
125
|
}
|
|
126
|
-
function
|
|
126
|
+
function u() {
|
|
127
127
|
return Error("react-stack-top-frame");
|
|
128
128
|
}
|
|
129
|
-
function
|
|
130
|
-
if (
|
|
131
|
-
var
|
|
132
|
-
if (
|
|
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
|
|
137
|
-
function
|
|
138
|
-
|
|
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
|
-
|
|
140
|
+
n
|
|
141
141
|
));
|
|
142
142
|
}
|
|
143
|
-
|
|
144
|
-
get:
|
|
143
|
+
r.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
144
|
+
get: r,
|
|
145
145
|
configurable: !0
|
|
146
146
|
});
|
|
147
147
|
}
|
|
148
|
-
function
|
|
148
|
+
function E() {
|
|
149
149
|
var e = t(this.type);
|
|
150
|
-
return
|
|
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
|
|
155
|
-
return
|
|
156
|
-
$$typeof:
|
|
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:
|
|
159
|
-
props:
|
|
160
|
-
_owner:
|
|
161
|
-
}, (
|
|
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:
|
|
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:
|
|
178
|
+
value: Z
|
|
179
179
|
}), Object.defineProperty(e, "_debugTask", {
|
|
180
180
|
configurable: !1,
|
|
181
181
|
enumerable: !1,
|
|
182
182
|
writable: !0,
|
|
183
|
-
value:
|
|
183
|
+
value: Q
|
|
184
184
|
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
185
185
|
}
|
|
186
|
-
function
|
|
187
|
-
var
|
|
188
|
-
if (
|
|
189
|
-
if (
|
|
190
|
-
if (
|
|
191
|
-
for (
|
|
192
|
-
|
|
193
|
-
Object.freeze && Object.freeze(
|
|
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
|
|
199
|
-
if (
|
|
200
|
-
|
|
201
|
-
var
|
|
202
|
-
return
|
|
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
|
-
|
|
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
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
),
|
|
211
|
+
i,
|
|
212
|
+
f,
|
|
213
|
+
I,
|
|
214
|
+
f
|
|
215
|
+
), V[f + i] = !0);
|
|
216
216
|
}
|
|
217
|
-
if (
|
|
218
|
-
|
|
219
|
-
for (var
|
|
220
|
-
|
|
221
|
-
} else
|
|
222
|
-
return
|
|
223
|
-
|
|
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
|
-
),
|
|
225
|
+
), m(
|
|
226
226
|
e,
|
|
227
|
-
|
|
227
|
+
f,
|
|
228
|
+
R,
|
|
228
229
|
p,
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
U
|
|
230
|
+
o(),
|
|
231
|
+
r,
|
|
232
|
+
Z,
|
|
233
|
+
Q
|
|
234
234
|
);
|
|
235
235
|
}
|
|
236
|
-
function
|
|
237
|
-
typeof e == "object" && e !== null && e.$$typeof ===
|
|
236
|
+
function w(e) {
|
|
237
|
+
typeof e == "object" && e !== null && e.$$typeof === y && e._store && (e._store.validated = 1);
|
|
238
238
|
}
|
|
239
|
-
var
|
|
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
|
-
|
|
242
|
+
j = {
|
|
243
243
|
"react-stack-bottom-frame": function(e) {
|
|
244
244
|
return e();
|
|
245
245
|
}
|
|
246
246
|
};
|
|
247
|
-
var
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
)(),
|
|
251
|
-
|
|
252
|
-
var
|
|
253
|
-
return
|
|
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
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
258
|
+
i,
|
|
259
|
+
p,
|
|
260
|
+
R ? Error("react-stack-top-frame") : U,
|
|
261
|
+
R ? _(g(e)) : B
|
|
262
262
|
);
|
|
263
|
-
},
|
|
264
|
-
var
|
|
265
|
-
return
|
|
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
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
270
|
+
i,
|
|
271
|
+
p,
|
|
272
|
+
R ? Error("react-stack-top-frame") : U,
|
|
273
|
+
R ? _(g(e)) : B
|
|
274
274
|
);
|
|
275
275
|
};
|
|
276
|
-
}()),
|
|
276
|
+
}()), J;
|
|
277
277
|
}
|
|
278
|
-
var
|
|
279
|
-
function
|
|
280
|
-
return
|
|
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
|
|
283
|
-
const
|
|
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:
|
|
287
|
-
labelClass:
|
|
288
|
-
inputClass:
|
|
289
|
-
errorClass:
|
|
290
|
-
label:
|
|
291
|
-
hasError:
|
|
292
|
-
register:
|
|
293
|
-
name:
|
|
294
|
-
isDisabled:
|
|
295
|
-
autocomplete:
|
|
296
|
-
...
|
|
297
|
-
}) => /* @__PURE__ */
|
|
298
|
-
/* @__PURE__ */
|
|
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:
|
|
302
|
-
className: `${
|
|
301
|
+
htmlFor: m,
|
|
302
|
+
className: `${g} ${d && "error"}`,
|
|
303
303
|
children: [
|
|
304
|
-
|
|
305
|
-
/* @__PURE__ */
|
|
304
|
+
h,
|
|
305
|
+
/* @__PURE__ */ a.jsx(
|
|
306
306
|
"input",
|
|
307
307
|
{
|
|
308
|
-
disabled:
|
|
309
|
-
autoComplete:
|
|
310
|
-
id:
|
|
311
|
-
...
|
|
312
|
-
...
|
|
308
|
+
disabled: W,
|
|
309
|
+
autoComplete: w ? "on" : "off",
|
|
310
|
+
id: m,
|
|
311
|
+
...E,
|
|
312
|
+
...j,
|
|
313
313
|
type: t,
|
|
314
|
-
name:
|
|
315
|
-
className: `${
|
|
314
|
+
name: m,
|
|
315
|
+
className: `${o} ${d && "error"} ${u}`,
|
|
316
316
|
placeholder: s
|
|
317
317
|
}
|
|
318
318
|
)
|
|
319
319
|
]
|
|
320
320
|
}
|
|
321
321
|
),
|
|
322
|
-
|
|
323
|
-
] }),
|
|
324
|
-
const [t, s] =
|
|
325
|
-
return
|
|
326
|
-
},
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
}
|
|
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:
|
|
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__ */
|
|
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__ */
|
|
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:
|
|
357
|
+
className: t.color
|
|
357
358
|
}
|
|
358
359
|
)
|
|
359
360
|
]
|
|
360
361
|
}
|
|
361
|
-
),
|
|
362
|
+
), me = () => {
|
|
362
363
|
const t = `${window.location.pathname}${window.location.search}`;
|
|
363
364
|
window.history.replaceState(null, "", t);
|
|
364
|
-
},
|
|
365
|
+
}, he = (t) => {
|
|
365
366
|
window.location.hash = t;
|
|
366
|
-
},
|
|
367
|
-
|
|
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:
|
|
370
|
-
title:
|
|
371
|
-
value:
|
|
372
|
-
api:
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
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
|
-
|
|
380
|
-
S(()
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
},
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
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((
|
|
393
|
-
},
|
|
394
|
-
|
|
395
|
-
},
|
|
396
|
-
k(
|
|
397
|
-
},
|
|
398
|
-
if (!
|
|
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 &&
|
|
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__ */
|
|
404
|
-
/* @__PURE__ */
|
|
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
|
-
${
|
|
483
|
+
${c && "!text-danger-100"}`,
|
|
409
484
|
children: [
|
|
410
|
-
/* @__PURE__ */
|
|
411
|
-
/* @__PURE__ */
|
|
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
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
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
|
-
|
|
522
|
+
l ? o?.length ? l[o] : l : d?.length ? d : "Select",
|
|
421
523
|
" ",
|
|
422
|
-
/* @__PURE__ */
|
|
423
|
-
|
|
524
|
+
/* @__PURE__ */ a.jsx(
|
|
525
|
+
ae,
|
|
424
526
|
{
|
|
425
|
-
className: `
|
|
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
|
-
|
|
536
|
+
C ? /* @__PURE__ */ a.jsxs(
|
|
435
537
|
"div",
|
|
436
538
|
{
|
|
437
|
-
className: `
|
|
539
|
+
className: `nariaListWrapper ${L < 768 ? "nariaListWrapper-mobile" : ""}`,
|
|
540
|
+
ref: q,
|
|
438
541
|
children: [
|
|
439
|
-
/* @__PURE__ */
|
|
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: `
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
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: () =>
|
|
450
|
-
|
|
451
|
-
|
|
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
|
-
|
|
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
|
-
|
|
588
|
+
c && /* @__PURE__ */ a.jsx("p", { className: "text-xs mt-1 text-danger-100", children: c })
|
|
469
589
|
] });
|
|
470
590
|
};
|
|
471
|
-
function
|
|
591
|
+
function Re(t) {
|
|
472
592
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
473
593
|
}
|
|
474
594
|
export {
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
595
|
+
xe as Button,
|
|
596
|
+
be as Input,
|
|
597
|
+
Ee as Select,
|
|
598
|
+
Re as capitalize
|
|
479
599
|
};
|