@cagatayfdn/flora-components 0.0.108 → 0.0.110
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/Stepper.css +1 -1
- package/dist/Switch.css +1 -1
- package/dist/components/PermaLink/PermaLink.js +379 -26
- package/dist/components/Stepper/Stepper.js +66 -63
- package/dist/components/Switch/Switch.js +54 -49
- package/dist/index.d.mts +6 -6
- package/dist/index.d.ts +6 -6
- package/package.json +1 -1
- package/dist/index-CPAJmTI5.js +0 -359
package/dist/Stepper.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._container_15acq_1{position:relative;margin-bottom:30px}._container_15acq_1 ul{display:flex;margin:0;padding:0}._container_15acq_1 ul li{position:relative;width:33.33%;list-style:none;padding:0}._container_15acq_1 ul li._complete_15acq_16 a{color:#fff}._container_15acq_1 ul li._complete_15acq_16 a span{color:#4482ff;background-color:#fff}._container_15acq_1 ul li._complete_15acq_16+li:before{background-color:#4482ff}._container_15acq_1 ul li:first-child:before{content:none}._container_15acq_1 ul li:before{content:"";width:100%;height:2px;background-color:#3b404c;position:absolute;left:-50%;top:16px;z-index:1}._container_15acq_1 ul li._active_15acq_39 a{color:#fff}._container_15acq_1 ul li._active_15acq_39 a span{color:#fff;background-color:#71d200}._container_15acq_1 ul li a{display:flex;flex-direction:column;text-decoration:none;text-align:center;position:relative;z-index:2;color:#fff;font-weight:600;line-height:normal}._container_15acq_1 ul li span{width:32px;height:32px;border-radius:100%;color:#3b4768;display:flex;align-items:center;justify-content:center;margin:auto auto 14px;background-color:#fff;font-weight:600;font-family:Jost,sans-serif}._container_15acq_1 ul li span i{line-height:1px}
|
package/dist/Switch.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._switch_5793j_1{position:relative;display:inline-block;width:58px;height:26px;border-radius:24px}._switch_5793j_1 input{opacity:0;width:0;height:0;margin:0}._switch_5793j_1._checked_5793j_14{border-color:transparent}._switch_5793j_1._disabled_5793j_17{opacity:.5}._switch__small_5793j_20{width:58px}._switch__small_5793j_20 input:checked+._slider_5793j_23:before{transform:translate(33px)}._switch__small_5793j_20 ._active_5793j_26{padding-left:7px}._switch__small_5793j_20 ._passive_5793j_29{padding-right:7px}._switch__large_5793j_32{width:82px}._switch__large_5793j_32 input:checked+._slider_5793j_23:before{transform:translate(58px)}._switch__large_5793j_32 ._passive_5793j_29{padding-right:11px}._switch__large_5793j_32 ._active_5793j_26{padding-left:11px}._slider_5793j_23{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#d4d6f0;border-color:2px solid;-webkit-transition:.4s;transition:.4s;border-radius:30px;text-align:inherit!important}._slider_5793j_23 span{font-size:9px;text-transform:uppercase;font-weight:700;padding:0 5px;display:flex!important;justify-content:flex-end;align-items:center;height:100%}._slider_5793j_23:before{position:absolute;content:"";height:22px;width:22px;bottom:2px;background-color:#fff;-webkit-transition:.4s;transition:.4s;border-radius:30px;transform:translate(2px)}input:checked+._slider_5793j_23{background-color:#71d200}input:checked+._slider_5793j_23 span{justify-content:flex-start}input:focus+._slider_5793j_23{box-shadow:0 0 1px #71d200}._slider_5793j_23._round_5793j_95{border-radius:34px}._slider_5793j_23._round_5793j_95:before{border-radius:50%}
|
|
@@ -1,34 +1,387 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { j as Y } from "../../jsx-runtime-BcAkpsdy.js";
|
|
2
|
+
import * as m from "react";
|
|
3
|
+
import "react-dom";
|
|
4
|
+
import { a as D, u as I, D as J, N as P, s as E, i as S, m as M, w as B, b as Q, c as Z, d as ee, e as A, f as te, R as ne, j as re, g as ae } from "../../index-9ZLCCecr.js";
|
|
5
|
+
/**
|
|
6
|
+
* React Router DOM v6.22.0
|
|
7
|
+
*
|
|
8
|
+
* Copyright (c) Remix Software Inc.
|
|
9
|
+
*
|
|
10
|
+
* This source code is licensed under the MIT license found in the
|
|
11
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
12
|
+
*
|
|
13
|
+
* @license MIT
|
|
14
|
+
*/
|
|
15
|
+
function x() {
|
|
16
|
+
return x = Object.assign ? Object.assign.bind() : function(e) {
|
|
17
|
+
for (var n = 1; n < arguments.length; n++) {
|
|
18
|
+
var r = arguments[n];
|
|
19
|
+
for (var a in r)
|
|
20
|
+
Object.prototype.hasOwnProperty.call(r, a) && (e[a] = r[a]);
|
|
21
|
+
}
|
|
22
|
+
return e;
|
|
23
|
+
}, x.apply(this, arguments);
|
|
24
|
+
}
|
|
25
|
+
function K(e, n) {
|
|
26
|
+
if (e == null)
|
|
27
|
+
return {};
|
|
28
|
+
var r = {}, a = Object.keys(e), t, i;
|
|
29
|
+
for (i = 0; i < a.length; i++)
|
|
30
|
+
t = a[i], !(n.indexOf(t) >= 0) && (r[t] = e[t]);
|
|
31
|
+
return r;
|
|
32
|
+
}
|
|
33
|
+
const _ = "get", L = "application/x-www-form-urlencoded";
|
|
34
|
+
function F(e) {
|
|
35
|
+
return e != null && typeof e.tagName == "string";
|
|
36
|
+
}
|
|
37
|
+
function ie(e) {
|
|
38
|
+
return F(e) && e.tagName.toLowerCase() === "button";
|
|
39
|
+
}
|
|
40
|
+
function oe(e) {
|
|
41
|
+
return F(e) && e.tagName.toLowerCase() === "form";
|
|
42
|
+
}
|
|
43
|
+
function le(e) {
|
|
44
|
+
return F(e) && e.tagName.toLowerCase() === "input";
|
|
45
|
+
}
|
|
46
|
+
function se(e) {
|
|
47
|
+
return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey);
|
|
48
|
+
}
|
|
49
|
+
function ue(e, n) {
|
|
50
|
+
return e.button === 0 && // Ignore everything but left clicks
|
|
51
|
+
(!n || n === "_self") && // Let browser handle "target=_blank" etc.
|
|
52
|
+
!se(e);
|
|
53
|
+
}
|
|
54
|
+
let R = null;
|
|
55
|
+
function ce() {
|
|
56
|
+
if (R === null)
|
|
57
|
+
try {
|
|
58
|
+
new FormData(
|
|
59
|
+
document.createElement("form"),
|
|
60
|
+
// @ts-expect-error if FormData supports the submitter parameter, this will throw
|
|
61
|
+
0
|
|
62
|
+
), R = !1;
|
|
63
|
+
} catch {
|
|
64
|
+
R = !0;
|
|
65
|
+
}
|
|
66
|
+
return R;
|
|
67
|
+
}
|
|
68
|
+
const fe = /* @__PURE__ */ new Set(["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"]);
|
|
69
|
+
function U(e) {
|
|
70
|
+
return e != null && !fe.has(e) ? (process.env.NODE_ENV !== "production" && B(!1, '"' + e + '" is not a valid `encType` for `<Form>`/`<fetcher.Form>` ' + ('and will default to "' + L + '"')), null) : e;
|
|
71
|
+
}
|
|
72
|
+
function me(e, n) {
|
|
73
|
+
let r, a, t, i, o;
|
|
74
|
+
if (oe(e)) {
|
|
75
|
+
let s = e.getAttribute("action");
|
|
76
|
+
a = s ? E(s, n) : null, r = e.getAttribute("method") || _, t = U(e.getAttribute("enctype")) || L, i = new FormData(e);
|
|
77
|
+
} else if (ie(e) || le(e) && (e.type === "submit" || e.type === "image")) {
|
|
78
|
+
let s = e.form;
|
|
79
|
+
if (s == null)
|
|
80
|
+
throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');
|
|
81
|
+
let u = e.getAttribute("formaction") || s.getAttribute("action");
|
|
82
|
+
if (a = u ? E(u, n) : null, r = e.getAttribute("formmethod") || s.getAttribute("method") || _, t = U(e.getAttribute("formenctype")) || U(s.getAttribute("enctype")) || L, i = new FormData(s, e), !ce()) {
|
|
83
|
+
let {
|
|
84
|
+
name: l,
|
|
85
|
+
type: d,
|
|
86
|
+
value: h
|
|
87
|
+
} = e;
|
|
88
|
+
if (d === "image") {
|
|
89
|
+
let v = l ? l + "." : "";
|
|
90
|
+
i.append(v + "x", "0"), i.append(v + "y", "0");
|
|
91
|
+
} else
|
|
92
|
+
l && i.append(l, h);
|
|
93
|
+
}
|
|
94
|
+
} else {
|
|
95
|
+
if (F(e))
|
|
96
|
+
throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');
|
|
97
|
+
r = _, a = null, t = L, o = e;
|
|
98
|
+
}
|
|
99
|
+
return i && t === "text/plain" && (o = i, i = void 0), {
|
|
100
|
+
action: a,
|
|
101
|
+
method: r.toLowerCase(),
|
|
102
|
+
encType: t,
|
|
103
|
+
formData: i,
|
|
104
|
+
body: o
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
const de = ["onClick", "relative", "reloadDocument", "replace", "state", "target", "to", "preventScrollReset", "unstable_viewTransition"], pe = ["aria-current", "caseSensitive", "className", "end", "style", "to", "unstable_viewTransition", "children"], he = ["fetcherKey", "navigate", "reloadDocument", "replace", "state", "method", "action", "onSubmit", "relative", "preventScrollReset", "unstable_viewTransition"], ve = "6";
|
|
108
|
+
try {
|
|
109
|
+
window.__reactRouterVersion = ve;
|
|
110
|
+
} catch {
|
|
111
|
+
}
|
|
112
|
+
const z = /* @__PURE__ */ m.createContext({
|
|
113
|
+
isTransitioning: !1
|
|
114
|
+
});
|
|
115
|
+
process.env.NODE_ENV !== "production" && (z.displayName = "ViewTransition");
|
|
116
|
+
const be = /* @__PURE__ */ m.createContext(/* @__PURE__ */ new Map());
|
|
117
|
+
process.env.NODE_ENV !== "production" && (be.displayName = "Fetchers");
|
|
118
|
+
process.env.NODE_ENV;
|
|
119
|
+
const we = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", ye = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, $ = /* @__PURE__ */ m.forwardRef(function(n, r) {
|
|
120
|
+
let {
|
|
121
|
+
onClick: a,
|
|
122
|
+
relative: t,
|
|
123
|
+
reloadDocument: i,
|
|
124
|
+
replace: o,
|
|
125
|
+
state: s,
|
|
126
|
+
target: u,
|
|
127
|
+
to: l,
|
|
128
|
+
preventScrollReset: d,
|
|
129
|
+
unstable_viewTransition: h
|
|
130
|
+
} = n, v = K(n, de), {
|
|
131
|
+
basename: N
|
|
132
|
+
} = m.useContext(P), b, w = !1;
|
|
133
|
+
if (typeof l == "string" && ye.test(l) && (b = l, we))
|
|
134
|
+
try {
|
|
135
|
+
let p = new URL(window.location.href), f = l.startsWith("//") ? new URL(p.protocol + l) : new URL(l), C = E(f.pathname, N);
|
|
136
|
+
f.origin === p.origin && C != null ? l = C + f.search + f.hash : w = !0;
|
|
137
|
+
} catch {
|
|
138
|
+
process.env.NODE_ENV !== "production" && B(!1, '<Link to="' + l + '"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.');
|
|
139
|
+
}
|
|
140
|
+
let y = Q(l, {
|
|
141
|
+
relative: t
|
|
142
|
+
}), g = Se(l, {
|
|
143
|
+
replace: o,
|
|
144
|
+
state: s,
|
|
145
|
+
target: u,
|
|
146
|
+
preventScrollReset: d,
|
|
147
|
+
relative: t,
|
|
148
|
+
unstable_viewTransition: h
|
|
149
|
+
});
|
|
150
|
+
function c(p) {
|
|
151
|
+
a && a(p), p.defaultPrevented || g(p);
|
|
152
|
+
}
|
|
153
|
+
return (
|
|
154
|
+
// eslint-disable-next-line jsx-a11y/anchor-has-content
|
|
155
|
+
/* @__PURE__ */ m.createElement("a", x({}, v, {
|
|
156
|
+
href: b || y,
|
|
157
|
+
onClick: w || i ? a : c,
|
|
158
|
+
ref: r,
|
|
159
|
+
target: u
|
|
160
|
+
}))
|
|
161
|
+
);
|
|
162
|
+
});
|
|
163
|
+
process.env.NODE_ENV !== "production" && ($.displayName = "Link");
|
|
164
|
+
const q = /* @__PURE__ */ m.forwardRef(function(n, r) {
|
|
165
|
+
let {
|
|
166
|
+
"aria-current": a = "page",
|
|
167
|
+
caseSensitive: t = !1,
|
|
168
|
+
className: i = "",
|
|
169
|
+
end: o = !1,
|
|
170
|
+
style: s,
|
|
171
|
+
to: u,
|
|
172
|
+
unstable_viewTransition: l,
|
|
173
|
+
children: d
|
|
174
|
+
} = n, h = K(n, pe), v = D(u, {
|
|
175
|
+
relative: h.relative
|
|
176
|
+
}), N = I(), b = m.useContext(J), {
|
|
177
|
+
navigator: w,
|
|
178
|
+
basename: y
|
|
179
|
+
} = m.useContext(P), g = b != null && // Conditional usage is OK here because the usage of a data router is static
|
|
180
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
181
|
+
Le(v) && l === !0, c = w.encodeLocation ? w.encodeLocation(v).pathname : v.pathname, p = N.pathname, f = b && b.navigation && b.navigation.location ? b.navigation.location.pathname : null;
|
|
182
|
+
t || (p = p.toLowerCase(), f = f ? f.toLowerCase() : null, c = c.toLowerCase()), f && y && (f = E(f, y) || f);
|
|
183
|
+
const C = c !== "/" && c.endsWith("/") ? c.length - 1 : c.length;
|
|
184
|
+
let O = p === c || !o && p.startsWith(c) && p.charAt(C) === "/", j = f != null && (f === c || !o && f.startsWith(c) && f.charAt(c.length) === "/"), k = {
|
|
185
|
+
isActive: O,
|
|
186
|
+
isPending: j,
|
|
187
|
+
isTransitioning: g
|
|
188
|
+
}, H = O ? a : void 0, V;
|
|
189
|
+
typeof i == "function" ? V = i(k) : V = [i, O ? "active" : null, j ? "pending" : null, g ? "transitioning" : null].filter(Boolean).join(" ");
|
|
190
|
+
let X = typeof s == "function" ? s(k) : s;
|
|
191
|
+
return /* @__PURE__ */ m.createElement($, x({}, h, {
|
|
192
|
+
"aria-current": H,
|
|
193
|
+
className: V,
|
|
194
|
+
ref: r,
|
|
195
|
+
style: X,
|
|
196
|
+
to: u,
|
|
197
|
+
unstable_viewTransition: l
|
|
198
|
+
}), typeof d == "function" ? d(k) : d);
|
|
199
|
+
});
|
|
200
|
+
process.env.NODE_ENV !== "production" && (q.displayName = "NavLink");
|
|
201
|
+
const ge = /* @__PURE__ */ m.forwardRef((e, n) => {
|
|
202
|
+
let {
|
|
203
|
+
fetcherKey: r,
|
|
204
|
+
navigate: a,
|
|
205
|
+
reloadDocument: t,
|
|
206
|
+
replace: i,
|
|
207
|
+
state: o,
|
|
208
|
+
method: s = _,
|
|
209
|
+
action: u,
|
|
210
|
+
onSubmit: l,
|
|
211
|
+
relative: d,
|
|
212
|
+
preventScrollReset: h,
|
|
213
|
+
unstable_viewTransition: v
|
|
214
|
+
} = e, N = K(e, he), b = Re(), w = _e(u, {
|
|
215
|
+
relative: d
|
|
216
|
+
}), y = s.toLowerCase() === "get" ? "get" : "post", g = (c) => {
|
|
217
|
+
if (l && l(c), c.defaultPrevented)
|
|
218
|
+
return;
|
|
219
|
+
c.preventDefault();
|
|
220
|
+
let p = c.nativeEvent.submitter, f = (p == null ? void 0 : p.getAttribute("formmethod")) || s;
|
|
221
|
+
b(p || c.currentTarget, {
|
|
222
|
+
fetcherKey: r,
|
|
223
|
+
method: f,
|
|
224
|
+
navigate: a,
|
|
225
|
+
replace: i,
|
|
226
|
+
state: o,
|
|
227
|
+
relative: d,
|
|
228
|
+
preventScrollReset: h,
|
|
229
|
+
unstable_viewTransition: v
|
|
230
|
+
});
|
|
231
|
+
};
|
|
232
|
+
return /* @__PURE__ */ m.createElement("form", x({
|
|
233
|
+
ref: n,
|
|
234
|
+
method: y,
|
|
235
|
+
action: w,
|
|
236
|
+
onSubmit: t ? l : g
|
|
237
|
+
}, N));
|
|
238
|
+
});
|
|
239
|
+
process.env.NODE_ENV !== "production" && (ge.displayName = "Form");
|
|
240
|
+
process.env.NODE_ENV;
|
|
241
|
+
var T;
|
|
242
|
+
(function(e) {
|
|
243
|
+
e.UseScrollRestoration = "useScrollRestoration", e.UseSubmit = "useSubmit", e.UseSubmitFetcher = "useSubmitFetcher", e.UseFetcher = "useFetcher", e.useViewTransitionState = "useViewTransitionState";
|
|
244
|
+
})(T || (T = {}));
|
|
245
|
+
var W;
|
|
246
|
+
(function(e) {
|
|
247
|
+
e.UseFetcher = "useFetcher", e.UseFetchers = "useFetchers", e.UseScrollRestoration = "useScrollRestoration";
|
|
248
|
+
})(W || (W = {}));
|
|
249
|
+
function Ee(e) {
|
|
250
|
+
return e + " must be used within a data router. See https://reactrouter.com/routers/picking-a-router.";
|
|
251
|
+
}
|
|
252
|
+
function G(e) {
|
|
253
|
+
let n = m.useContext(Z);
|
|
254
|
+
return n || (process.env.NODE_ENV !== "production" ? S(!1, Ee(e)) : S(!1)), n;
|
|
255
|
+
}
|
|
256
|
+
function Se(e, n) {
|
|
257
|
+
let {
|
|
258
|
+
target: r,
|
|
259
|
+
replace: a,
|
|
260
|
+
state: t,
|
|
261
|
+
preventScrollReset: i,
|
|
262
|
+
relative: o,
|
|
263
|
+
unstable_viewTransition: s
|
|
264
|
+
} = n === void 0 ? {} : n, u = ee(), l = I(), d = D(e, {
|
|
265
|
+
relative: o
|
|
266
|
+
});
|
|
267
|
+
return m.useCallback((h) => {
|
|
268
|
+
if (ue(h, r)) {
|
|
269
|
+
h.preventDefault();
|
|
270
|
+
let v = a !== void 0 ? a : A(l) === A(d);
|
|
271
|
+
u(e, {
|
|
272
|
+
replace: v,
|
|
273
|
+
state: t,
|
|
274
|
+
preventScrollReset: i,
|
|
275
|
+
relative: o,
|
|
276
|
+
unstable_viewTransition: s
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
}, [l, u, d, a, t, r, e, i, o, s]);
|
|
280
|
+
}
|
|
281
|
+
function xe() {
|
|
282
|
+
if (typeof document > "u")
|
|
283
|
+
throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.");
|
|
284
|
+
}
|
|
285
|
+
let Ne = 0, Ce = () => "__" + String(++Ne) + "__";
|
|
286
|
+
function Re() {
|
|
287
|
+
let {
|
|
288
|
+
router: e
|
|
289
|
+
} = G(T.UseSubmit), {
|
|
290
|
+
basename: n
|
|
291
|
+
} = m.useContext(P), r = te();
|
|
292
|
+
return m.useCallback(function(a, t) {
|
|
293
|
+
t === void 0 && (t = {}), xe();
|
|
294
|
+
let {
|
|
295
|
+
action: i,
|
|
296
|
+
method: o,
|
|
297
|
+
encType: s,
|
|
298
|
+
formData: u,
|
|
299
|
+
body: l
|
|
300
|
+
} = me(a, n);
|
|
301
|
+
if (t.navigate === !1) {
|
|
302
|
+
let d = t.fetcherKey || Ce();
|
|
303
|
+
e.fetch(d, r, t.action || i, {
|
|
304
|
+
preventScrollReset: t.preventScrollReset,
|
|
305
|
+
formData: u,
|
|
306
|
+
body: l,
|
|
307
|
+
formMethod: t.method || o,
|
|
308
|
+
formEncType: t.encType || s,
|
|
309
|
+
unstable_flushSync: t.unstable_flushSync
|
|
310
|
+
});
|
|
311
|
+
} else
|
|
312
|
+
e.navigate(t.action || i, {
|
|
313
|
+
preventScrollReset: t.preventScrollReset,
|
|
314
|
+
formData: u,
|
|
315
|
+
body: l,
|
|
316
|
+
formMethod: t.method || o,
|
|
317
|
+
formEncType: t.encType || s,
|
|
318
|
+
replace: t.replace,
|
|
319
|
+
state: t.state,
|
|
320
|
+
fromRouteId: r,
|
|
321
|
+
unstable_flushSync: t.unstable_flushSync,
|
|
322
|
+
unstable_viewTransition: t.unstable_viewTransition
|
|
323
|
+
});
|
|
324
|
+
}, [e, n, r]);
|
|
325
|
+
}
|
|
326
|
+
function _e(e, n) {
|
|
327
|
+
let {
|
|
328
|
+
relative: r
|
|
329
|
+
} = n === void 0 ? {} : n, {
|
|
330
|
+
basename: a
|
|
331
|
+
} = m.useContext(P), t = m.useContext(ne);
|
|
332
|
+
t || (process.env.NODE_ENV !== "production" ? S(!1, "useFormAction must be used inside a RouteContext") : S(!1));
|
|
333
|
+
let [i] = t.matches.slice(-1), o = x({}, D(e || ".", {
|
|
334
|
+
relative: r
|
|
335
|
+
})), s = I();
|
|
336
|
+
if (e == null) {
|
|
337
|
+
o.search = s.search;
|
|
338
|
+
let u = new URLSearchParams(o.search);
|
|
339
|
+
u.has("index") && u.get("index") === "" && (u.delete("index"), o.search = u.toString() ? "?" + u.toString() : "");
|
|
340
|
+
}
|
|
341
|
+
return (!e || e === ".") && i.route.index && (o.search = o.search ? o.search.replace(/^\?/, "?index&") : "?index"), a !== "/" && (o.pathname = o.pathname === "/" ? a : re([a, o.pathname])), A(o);
|
|
342
|
+
}
|
|
343
|
+
function Le(e, n) {
|
|
344
|
+
n === void 0 && (n = {});
|
|
345
|
+
let r = m.useContext(z);
|
|
346
|
+
r == null && (process.env.NODE_ENV !== "production" ? S(!1, "`unstable_useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?") : S(!1));
|
|
347
|
+
let {
|
|
348
|
+
basename: a
|
|
349
|
+
} = G(T.useViewTransitionState), t = D(e, {
|
|
350
|
+
relative: n.relative
|
|
351
|
+
});
|
|
352
|
+
if (!r.isTransitioning)
|
|
353
|
+
return !1;
|
|
354
|
+
let i = E(r.currentLocation.pathname, a) || r.currentLocation.pathname, o = E(r.nextLocation.pathname, a) || r.nextLocation.pathname;
|
|
355
|
+
return M(t.pathname, o) != null || M(t.pathname, i) != null;
|
|
356
|
+
}
|
|
357
|
+
const Fe = ({
|
|
358
|
+
to: e,
|
|
359
|
+
params: n,
|
|
360
|
+
children: r,
|
|
361
|
+
className: a,
|
|
362
|
+
activeClassName: t,
|
|
363
|
+
style: i,
|
|
364
|
+
onClick: o,
|
|
365
|
+
state: s,
|
|
366
|
+
isDisabled: u
|
|
14
367
|
}) => {
|
|
15
|
-
const
|
|
16
|
-
if (
|
|
17
|
-
return
|
|
18
|
-
|
|
368
|
+
const l = ae(e, n), d = (h) => {
|
|
369
|
+
if (u)
|
|
370
|
+
return h.preventDefault();
|
|
371
|
+
o && o();
|
|
19
372
|
};
|
|
20
|
-
return /* @__PURE__ */
|
|
21
|
-
|
|
373
|
+
return /* @__PURE__ */ Y.jsx(
|
|
374
|
+
q,
|
|
22
375
|
{
|
|
23
|
-
to:
|
|
24
|
-
style:
|
|
25
|
-
state:
|
|
26
|
-
className: ({ isActive:
|
|
27
|
-
onClick:
|
|
28
|
-
children:
|
|
376
|
+
to: s ? { pathname: l } : l,
|
|
377
|
+
style: i,
|
|
378
|
+
state: s,
|
|
379
|
+
className: ({ isActive: h }) => h ? `${a} ${t}` : a,
|
|
380
|
+
onClick: d,
|
|
381
|
+
children: r
|
|
29
382
|
}
|
|
30
383
|
);
|
|
31
384
|
};
|
|
32
385
|
export {
|
|
33
|
-
|
|
386
|
+
Fe as default
|
|
34
387
|
};
|
|
@@ -1,72 +1,75 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import { Icons as
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const x = ({ index: t, title: e, customIndexItem: s }) => /* @__PURE__ */ r.jsxs(
|
|
1
|
+
import { j as t } from "../../jsx-runtime-BcAkpsdy.js";
|
|
2
|
+
import { c as j } from "../../index-BHf7G3IG.js";
|
|
3
|
+
import x from "../Icon/index.js";
|
|
4
|
+
import { Icons as C } from "../../assets/icons/icons.js";
|
|
5
|
+
import '../../Stepper.css';const N = "_container_15acq_1", g = "_complete_15acq_16", A = "_active_15acq_39", i = {
|
|
6
|
+
container: N,
|
|
7
|
+
complete: g,
|
|
8
|
+
active: A
|
|
9
|
+
}, y = (l) => {
|
|
10
|
+
let s = !0;
|
|
11
|
+
const {
|
|
12
|
+
items: _,
|
|
13
|
+
selected: p = 0,
|
|
14
|
+
selectAll: m,
|
|
15
|
+
onChange: d,
|
|
16
|
+
renderItem: f,
|
|
17
|
+
wrapperClass: u
|
|
18
|
+
} = l, v = ({ index: e, title: c, customIndexItem: r }) => /* @__PURE__ */ t.jsxs(
|
|
20
19
|
"a",
|
|
21
20
|
{
|
|
22
|
-
href: `#step-${
|
|
23
|
-
onClick: (
|
|
21
|
+
href: `#step-${e}`,
|
|
22
|
+
onClick: (a) => d && d(e, a),
|
|
24
23
|
children: [
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
r || (p > e ? /* @__PURE__ */ t.jsx("span", { children: /* @__PURE__ */ t.jsx(x, { name: C.Check }) }) : /* @__PURE__ */ t.jsx("span", { children: e + 1 })),
|
|
25
|
+
c
|
|
27
26
|
]
|
|
28
27
|
}
|
|
29
|
-
)
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
28
|
+
);
|
|
29
|
+
return /* @__PURE__ */ t.jsx(
|
|
30
|
+
"div",
|
|
31
|
+
{
|
|
32
|
+
className: j(i.container, u),
|
|
33
|
+
"data-testid": "stepper-container",
|
|
34
|
+
children: /* @__PURE__ */ t.jsx("ul", { "data-testid": "stepper-list", children: _.map(
|
|
35
|
+
({
|
|
36
|
+
title: e,
|
|
37
|
+
customIndexItem: c,
|
|
38
|
+
activeClass: r,
|
|
39
|
+
completeClass: a,
|
|
40
|
+
to: q,
|
|
41
|
+
skip: h
|
|
42
|
+
}, n) => {
|
|
43
|
+
if (h)
|
|
44
|
+
return null;
|
|
45
|
+
m && (s = !0);
|
|
46
|
+
const o = n === p;
|
|
47
|
+
return !m && o && (s = !1), /* @__PURE__ */ t.jsx(
|
|
48
|
+
"li",
|
|
49
|
+
{
|
|
50
|
+
"data-testid": "stepper-list-item",
|
|
51
|
+
className: j({
|
|
52
|
+
[i.active]: o,
|
|
53
|
+
[i.complete]: s,
|
|
54
|
+
[r]: o,
|
|
55
|
+
[a]: s
|
|
56
|
+
}),
|
|
57
|
+
children: f ? f({
|
|
58
|
+
title: e,
|
|
59
|
+
customIndexItem: c,
|
|
60
|
+
activeClass: r,
|
|
61
|
+
completeClass: a,
|
|
62
|
+
to: q,
|
|
63
|
+
skip: h
|
|
64
|
+
}, l) : v({ index: n, title: e, customIndexItem: c })
|
|
65
|
+
},
|
|
66
|
+
`stepper-item-${n}`
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
) })
|
|
67
70
|
}
|
|
68
|
-
)
|
|
71
|
+
);
|
|
69
72
|
};
|
|
70
73
|
export {
|
|
71
|
-
|
|
74
|
+
y as default
|
|
72
75
|
};
|
|
@@ -1,71 +1,76 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import u, { useState as v, useEffect as
|
|
3
|
-
import { c as
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { j as e } from "../../jsx-runtime-BcAkpsdy.js";
|
|
2
|
+
import u, { useState as v, useEffect as j } from "react";
|
|
3
|
+
import { c as d } from "../../index-BHf7G3IG.js";
|
|
4
|
+
import N from "../Label/Label.js";
|
|
5
|
+
import { Size as y } from "../../enums/size.js";
|
|
6
|
+
import { u as b } from "../../useTranslation-CnCPcxVj.js";
|
|
7
|
+
import '../../Switch.css';const S = "_checked_5793j_14", O = "_disabled_5793j_17", R = "_switch__small_5793j_20", g = "_slider_5793j_23", C = "_active_5793j_26", E = "_passive_5793j_29", F = "_switch__large_5793j_32", L = "_round_5793j_95", t = {
|
|
8
|
+
switch: "_switch_5793j_1",
|
|
9
|
+
checked: S,
|
|
10
|
+
disabled: O,
|
|
11
|
+
switch__small: R,
|
|
12
|
+
slider: g,
|
|
13
|
+
active: C,
|
|
14
|
+
passive: E,
|
|
15
|
+
switch__large: F,
|
|
16
|
+
round: L
|
|
17
|
+
}, B = u.forwardRef(
|
|
15
18
|
({
|
|
16
|
-
name:
|
|
19
|
+
name: a,
|
|
17
20
|
label: r,
|
|
18
|
-
className:
|
|
21
|
+
className: p,
|
|
19
22
|
isDisabled: i,
|
|
20
|
-
value:
|
|
23
|
+
value: c,
|
|
21
24
|
onChange: o,
|
|
22
|
-
onLabelClick:
|
|
25
|
+
onLabelClick: n,
|
|
23
26
|
checkedChildren: f,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
h(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
27
|
+
size: l = y.SM,
|
|
28
|
+
unCheckedChildren: w,
|
|
29
|
+
..._
|
|
30
|
+
}, x) => {
|
|
31
|
+
const [s, h] = v(c), { t: m } = b();
|
|
32
|
+
j(() => {
|
|
33
|
+
!_.readOnly && !i && c !== void 0 && o && o(s);
|
|
34
|
+
}, [s, c]), j(() => {
|
|
35
|
+
c && h(c);
|
|
36
|
+
}, [c]);
|
|
37
|
+
const k = () => {
|
|
38
|
+
!i && !_.readOnly && h(!s), !i && n && n(!s);
|
|
35
39
|
};
|
|
36
|
-
return /* @__PURE__ */
|
|
37
|
-
r && /* @__PURE__ */
|
|
38
|
-
/* @__PURE__ */
|
|
40
|
+
return /* @__PURE__ */ e.jsxs("div", { className: d(t.container, p), "data-testid": "switch-container", children: [
|
|
41
|
+
r && /* @__PURE__ */ e.jsx(N, { name: a, children: r }),
|
|
42
|
+
/* @__PURE__ */ e.jsx("div", { className: t.block, children: /* @__PURE__ */ e.jsxs(
|
|
39
43
|
"label",
|
|
40
44
|
{
|
|
41
|
-
className:
|
|
42
|
-
[
|
|
43
|
-
[
|
|
45
|
+
className: d(t.switch, {
|
|
46
|
+
[t.checked]: s,
|
|
47
|
+
[t.disabled]: i,
|
|
48
|
+
[t[`switch__${l}`]]: l
|
|
44
49
|
}),
|
|
45
|
-
htmlFor:
|
|
46
|
-
onClick: () =>
|
|
50
|
+
htmlFor: a,
|
|
51
|
+
onClick: () => k(),
|
|
47
52
|
children: [
|
|
48
|
-
/* @__PURE__ */
|
|
53
|
+
/* @__PURE__ */ e.jsx(
|
|
49
54
|
"input",
|
|
50
55
|
{
|
|
51
56
|
type: "checkbox",
|
|
52
|
-
name:
|
|
53
|
-
value:
|
|
57
|
+
name: a,
|
|
58
|
+
value: c,
|
|
54
59
|
"data-testid": "switch-input",
|
|
55
|
-
ref:
|
|
56
|
-
checked:
|
|
60
|
+
ref: x,
|
|
61
|
+
checked: s,
|
|
57
62
|
readOnly: !0,
|
|
58
|
-
...
|
|
63
|
+
..._
|
|
59
64
|
}
|
|
60
65
|
),
|
|
61
|
-
/* @__PURE__ */
|
|
66
|
+
/* @__PURE__ */ e.jsx("span", { className: t.slider, children: /* @__PURE__ */ e.jsx(
|
|
62
67
|
"span",
|
|
63
68
|
{
|
|
64
|
-
className:
|
|
65
|
-
[
|
|
66
|
-
[
|
|
69
|
+
className: d({
|
|
70
|
+
[t.active]: s,
|
|
71
|
+
[t.passive]: !s
|
|
67
72
|
}),
|
|
68
|
-
children:
|
|
73
|
+
children: s ? f || m("text.active") : w || m("text.passive")
|
|
69
74
|
}
|
|
70
75
|
) })
|
|
71
76
|
]
|
|
@@ -75,5 +80,5 @@ import '../../Switch.css';const N = "_checked_ptgnt_14", y = "_disabled_ptgnt_17
|
|
|
75
80
|
}
|
|
76
81
|
);
|
|
77
82
|
export {
|
|
78
|
-
|
|
83
|
+
B as default
|
|
79
84
|
};
|
package/dist/index.d.mts
CHANGED
|
@@ -13,7 +13,7 @@ import { format } from 'date-fns';
|
|
|
13
13
|
import i18n from 'i18next';
|
|
14
14
|
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
15
15
|
import { LegendItem } from 'chart.js';
|
|
16
|
-
import { LinkProps } from 'react-router-dom';
|
|
16
|
+
import type { LinkProps } from 'react-router-dom';
|
|
17
17
|
import { MouseEvent as MouseEvent_2 } from 'react';
|
|
18
18
|
import NiceModal from '@ebay/nice-modal-react';
|
|
19
19
|
import { NiceModalHocProps } from '@ebay/nice-modal-react';
|
|
@@ -364,10 +364,6 @@ export declare type CustomItemProps = {
|
|
|
364
364
|
item: OptionProps;
|
|
365
365
|
};
|
|
366
366
|
|
|
367
|
-
export declare type CustomLinkProps = {
|
|
368
|
-
to: LinkProps['to'];
|
|
369
|
-
} & AnchorProps;
|
|
370
|
-
|
|
371
367
|
export { CustomLocale }
|
|
372
368
|
|
|
373
369
|
export declare const DateFormats: {
|
|
@@ -1206,11 +1202,12 @@ export declare type StatusTypographyProps = {
|
|
|
1206
1202
|
spinnerLocation?: 'front' | 'back';
|
|
1207
1203
|
};
|
|
1208
1204
|
|
|
1209
|
-
export declare const Stepper: (
|
|
1205
|
+
export declare const Stepper: (props: StepperProps) => JSX.Element;
|
|
1210
1206
|
|
|
1211
1207
|
export declare type StepperItemProps = {
|
|
1212
1208
|
title: string | any;
|
|
1213
1209
|
customIndexItem?: any;
|
|
1210
|
+
skip?: boolean;
|
|
1214
1211
|
activeClass?: any;
|
|
1215
1212
|
completeClass?: any;
|
|
1216
1213
|
to?: LinkProps['to'];
|
|
@@ -1223,6 +1220,7 @@ export declare type StepperProps = {
|
|
|
1223
1220
|
renderAnchor?: boolean;
|
|
1224
1221
|
className?: string;
|
|
1225
1222
|
wrapperClass?: string;
|
|
1223
|
+
renderItem?: (item: StepperItemProps, props: StepperProps) => JSX.Element;
|
|
1226
1224
|
onChange?: (index: number, event?: any) => void;
|
|
1227
1225
|
};
|
|
1228
1226
|
|
|
@@ -1231,6 +1229,7 @@ export declare const Switch: React_2.ForwardRefExoticComponent<{
|
|
|
1231
1229
|
label?: string | undefined;
|
|
1232
1230
|
checked?: boolean | undefined;
|
|
1233
1231
|
className?: string | undefined;
|
|
1232
|
+
size?: Size | undefined;
|
|
1234
1233
|
value?: any;
|
|
1235
1234
|
onChange?: ((value: boolean) => void) | undefined;
|
|
1236
1235
|
onLabelClick?: ((value: boolean) => void) | undefined;
|
|
@@ -1243,6 +1242,7 @@ export declare type SwitchProps = {
|
|
|
1243
1242
|
label?: string;
|
|
1244
1243
|
checked?: boolean;
|
|
1245
1244
|
className?: string;
|
|
1245
|
+
size?: Size;
|
|
1246
1246
|
value?: any;
|
|
1247
1247
|
onChange?: (value: boolean) => void;
|
|
1248
1248
|
onLabelClick?: (value: boolean) => void;
|
package/dist/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ import { format } from 'date-fns';
|
|
|
13
13
|
import i18n from 'i18next';
|
|
14
14
|
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
15
15
|
import { LegendItem } from 'chart.js';
|
|
16
|
-
import { LinkProps } from 'react-router-dom';
|
|
16
|
+
import type { LinkProps } from 'react-router-dom';
|
|
17
17
|
import { MouseEvent as MouseEvent_2 } from 'react';
|
|
18
18
|
import NiceModal from '@ebay/nice-modal-react';
|
|
19
19
|
import { NiceModalHocProps } from '@ebay/nice-modal-react';
|
|
@@ -364,10 +364,6 @@ export declare type CustomItemProps = {
|
|
|
364
364
|
item: OptionProps;
|
|
365
365
|
};
|
|
366
366
|
|
|
367
|
-
export declare type CustomLinkProps = {
|
|
368
|
-
to: LinkProps['to'];
|
|
369
|
-
} & AnchorProps;
|
|
370
|
-
|
|
371
367
|
export { CustomLocale }
|
|
372
368
|
|
|
373
369
|
export declare const DateFormats: {
|
|
@@ -1206,11 +1202,12 @@ export declare type StatusTypographyProps = {
|
|
|
1206
1202
|
spinnerLocation?: 'front' | 'back';
|
|
1207
1203
|
};
|
|
1208
1204
|
|
|
1209
|
-
export declare const Stepper: (
|
|
1205
|
+
export declare const Stepper: (props: StepperProps) => JSX.Element;
|
|
1210
1206
|
|
|
1211
1207
|
export declare type StepperItemProps = {
|
|
1212
1208
|
title: string | any;
|
|
1213
1209
|
customIndexItem?: any;
|
|
1210
|
+
skip?: boolean;
|
|
1214
1211
|
activeClass?: any;
|
|
1215
1212
|
completeClass?: any;
|
|
1216
1213
|
to?: LinkProps['to'];
|
|
@@ -1223,6 +1220,7 @@ export declare type StepperProps = {
|
|
|
1223
1220
|
renderAnchor?: boolean;
|
|
1224
1221
|
className?: string;
|
|
1225
1222
|
wrapperClass?: string;
|
|
1223
|
+
renderItem?: (item: StepperItemProps, props: StepperProps) => JSX.Element;
|
|
1226
1224
|
onChange?: (index: number, event?: any) => void;
|
|
1227
1225
|
};
|
|
1228
1226
|
|
|
@@ -1231,6 +1229,7 @@ export declare const Switch: React_2.ForwardRefExoticComponent<{
|
|
|
1231
1229
|
label?: string | undefined;
|
|
1232
1230
|
checked?: boolean | undefined;
|
|
1233
1231
|
className?: string | undefined;
|
|
1232
|
+
size?: Size | undefined;
|
|
1234
1233
|
value?: any;
|
|
1235
1234
|
onChange?: ((value: boolean) => void) | undefined;
|
|
1236
1235
|
onLabelClick?: ((value: boolean) => void) | undefined;
|
|
@@ -1243,6 +1242,7 @@ export declare type SwitchProps = {
|
|
|
1243
1242
|
label?: string;
|
|
1244
1243
|
checked?: boolean;
|
|
1245
1244
|
className?: string;
|
|
1245
|
+
size?: Size;
|
|
1246
1246
|
value?: any;
|
|
1247
1247
|
onChange?: (value: boolean) => void;
|
|
1248
1248
|
onLabelClick?: (value: boolean) => void;
|
package/package.json
CHANGED
package/dist/index-CPAJmTI5.js
DELETED
|
@@ -1,359 +0,0 @@
|
|
|
1
|
-
import * as m from "react";
|
|
2
|
-
import "react-dom";
|
|
3
|
-
import { a as D, u as I, D as Y, N as F, s as E, i as S, m as W, w as j, b as J, c as Q, d as Z, e as A, f as $, R as ee, j as te } from "./index-9ZLCCecr.js";
|
|
4
|
-
/**
|
|
5
|
-
* React Router DOM v6.22.0
|
|
6
|
-
*
|
|
7
|
-
* Copyright (c) Remix Software Inc.
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the MIT license found in the
|
|
10
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
11
|
-
*
|
|
12
|
-
* @license MIT
|
|
13
|
-
*/
|
|
14
|
-
function N() {
|
|
15
|
-
return N = Object.assign ? Object.assign.bind() : function(e) {
|
|
16
|
-
for (var n = 1; n < arguments.length; n++) {
|
|
17
|
-
var r = arguments[n];
|
|
18
|
-
for (var a in r)
|
|
19
|
-
Object.prototype.hasOwnProperty.call(r, a) && (e[a] = r[a]);
|
|
20
|
-
}
|
|
21
|
-
return e;
|
|
22
|
-
}, N.apply(this, arguments);
|
|
23
|
-
}
|
|
24
|
-
function K(e, n) {
|
|
25
|
-
if (e == null)
|
|
26
|
-
return {};
|
|
27
|
-
var r = {}, a = Object.keys(e), t, i;
|
|
28
|
-
for (i = 0; i < a.length; i++)
|
|
29
|
-
t = a[i], !(n.indexOf(t) >= 0) && (r[t] = e[t]);
|
|
30
|
-
return r;
|
|
31
|
-
}
|
|
32
|
-
const _ = "get", L = "application/x-www-form-urlencoded";
|
|
33
|
-
function P(e) {
|
|
34
|
-
return e != null && typeof e.tagName == "string";
|
|
35
|
-
}
|
|
36
|
-
function ne(e) {
|
|
37
|
-
return P(e) && e.tagName.toLowerCase() === "button";
|
|
38
|
-
}
|
|
39
|
-
function re(e) {
|
|
40
|
-
return P(e) && e.tagName.toLowerCase() === "form";
|
|
41
|
-
}
|
|
42
|
-
function ae(e) {
|
|
43
|
-
return P(e) && e.tagName.toLowerCase() === "input";
|
|
44
|
-
}
|
|
45
|
-
function ie(e) {
|
|
46
|
-
return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey);
|
|
47
|
-
}
|
|
48
|
-
function oe(e, n) {
|
|
49
|
-
return e.button === 0 && // Ignore everything but left clicks
|
|
50
|
-
(!n || n === "_self") && // Let browser handle "target=_blank" etc.
|
|
51
|
-
!ie(e);
|
|
52
|
-
}
|
|
53
|
-
let R = null;
|
|
54
|
-
function le() {
|
|
55
|
-
if (R === null)
|
|
56
|
-
try {
|
|
57
|
-
new FormData(
|
|
58
|
-
document.createElement("form"),
|
|
59
|
-
// @ts-expect-error if FormData supports the submitter parameter, this will throw
|
|
60
|
-
0
|
|
61
|
-
), R = !1;
|
|
62
|
-
} catch {
|
|
63
|
-
R = !0;
|
|
64
|
-
}
|
|
65
|
-
return R;
|
|
66
|
-
}
|
|
67
|
-
const se = /* @__PURE__ */ new Set(["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"]);
|
|
68
|
-
function k(e) {
|
|
69
|
-
return e != null && !se.has(e) ? (process.env.NODE_ENV !== "production" && j(!1, '"' + e + '" is not a valid `encType` for `<Form>`/`<fetcher.Form>` ' + ('and will default to "' + L + '"')), null) : e;
|
|
70
|
-
}
|
|
71
|
-
function ue(e, n) {
|
|
72
|
-
let r, a, t, i, o;
|
|
73
|
-
if (re(e)) {
|
|
74
|
-
let s = e.getAttribute("action");
|
|
75
|
-
a = s ? E(s, n) : null, r = e.getAttribute("method") || _, t = k(e.getAttribute("enctype")) || L, i = new FormData(e);
|
|
76
|
-
} else if (ne(e) || ae(e) && (e.type === "submit" || e.type === "image")) {
|
|
77
|
-
let s = e.form;
|
|
78
|
-
if (s == null)
|
|
79
|
-
throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');
|
|
80
|
-
let u = e.getAttribute("formaction") || s.getAttribute("action");
|
|
81
|
-
if (a = u ? E(u, n) : null, r = e.getAttribute("formmethod") || s.getAttribute("method") || _, t = k(e.getAttribute("formenctype")) || k(s.getAttribute("enctype")) || L, i = new FormData(s, e), !le()) {
|
|
82
|
-
let {
|
|
83
|
-
name: l,
|
|
84
|
-
type: p,
|
|
85
|
-
value: v
|
|
86
|
-
} = e;
|
|
87
|
-
if (p === "image") {
|
|
88
|
-
let h = l ? l + "." : "";
|
|
89
|
-
i.append(h + "x", "0"), i.append(h + "y", "0");
|
|
90
|
-
} else
|
|
91
|
-
l && i.append(l, v);
|
|
92
|
-
}
|
|
93
|
-
} else {
|
|
94
|
-
if (P(e))
|
|
95
|
-
throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');
|
|
96
|
-
r = _, a = null, t = L, o = e;
|
|
97
|
-
}
|
|
98
|
-
return i && t === "text/plain" && (o = i, i = void 0), {
|
|
99
|
-
action: a,
|
|
100
|
-
method: r.toLowerCase(),
|
|
101
|
-
encType: t,
|
|
102
|
-
formData: i,
|
|
103
|
-
body: o
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
const ce = ["onClick", "relative", "reloadDocument", "replace", "state", "target", "to", "preventScrollReset", "unstable_viewTransition"], fe = ["aria-current", "caseSensitive", "className", "end", "style", "to", "unstable_viewTransition", "children"], me = ["fetcherKey", "navigate", "reloadDocument", "replace", "state", "method", "action", "onSubmit", "relative", "preventScrollReset", "unstable_viewTransition"], de = "6";
|
|
107
|
-
try {
|
|
108
|
-
window.__reactRouterVersion = de;
|
|
109
|
-
} catch {
|
|
110
|
-
}
|
|
111
|
-
const z = /* @__PURE__ */ m.createContext({
|
|
112
|
-
isTransitioning: !1
|
|
113
|
-
});
|
|
114
|
-
process.env.NODE_ENV !== "production" && (z.displayName = "ViewTransition");
|
|
115
|
-
const pe = /* @__PURE__ */ m.createContext(/* @__PURE__ */ new Map());
|
|
116
|
-
process.env.NODE_ENV !== "production" && (pe.displayName = "Fetchers");
|
|
117
|
-
process.env.NODE_ENV;
|
|
118
|
-
const he = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", ve = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, q = /* @__PURE__ */ m.forwardRef(function(n, r) {
|
|
119
|
-
let {
|
|
120
|
-
onClick: a,
|
|
121
|
-
relative: t,
|
|
122
|
-
reloadDocument: i,
|
|
123
|
-
replace: o,
|
|
124
|
-
state: s,
|
|
125
|
-
target: u,
|
|
126
|
-
to: l,
|
|
127
|
-
preventScrollReset: p,
|
|
128
|
-
unstable_viewTransition: v
|
|
129
|
-
} = n, h = K(n, ce), {
|
|
130
|
-
basename: x
|
|
131
|
-
} = m.useContext(F), b, w = !1;
|
|
132
|
-
if (typeof l == "string" && ve.test(l) && (b = l, he))
|
|
133
|
-
try {
|
|
134
|
-
let d = new URL(window.location.href), f = l.startsWith("//") ? new URL(d.protocol + l) : new URL(l), C = E(f.pathname, x);
|
|
135
|
-
f.origin === d.origin && C != null ? l = C + f.search + f.hash : w = !0;
|
|
136
|
-
} catch {
|
|
137
|
-
process.env.NODE_ENV !== "production" && j(!1, '<Link to="' + l + '"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.');
|
|
138
|
-
}
|
|
139
|
-
let y = J(l, {
|
|
140
|
-
relative: t
|
|
141
|
-
}), g = ge(l, {
|
|
142
|
-
replace: o,
|
|
143
|
-
state: s,
|
|
144
|
-
target: u,
|
|
145
|
-
preventScrollReset: p,
|
|
146
|
-
relative: t,
|
|
147
|
-
unstable_viewTransition: v
|
|
148
|
-
});
|
|
149
|
-
function c(d) {
|
|
150
|
-
a && a(d), d.defaultPrevented || g(d);
|
|
151
|
-
}
|
|
152
|
-
return (
|
|
153
|
-
// eslint-disable-next-line jsx-a11y/anchor-has-content
|
|
154
|
-
/* @__PURE__ */ m.createElement("a", N({}, h, {
|
|
155
|
-
href: b || y,
|
|
156
|
-
onClick: w || i ? a : c,
|
|
157
|
-
ref: r,
|
|
158
|
-
target: u
|
|
159
|
-
}))
|
|
160
|
-
);
|
|
161
|
-
});
|
|
162
|
-
process.env.NODE_ENV !== "production" && (q.displayName = "Link");
|
|
163
|
-
const be = /* @__PURE__ */ m.forwardRef(function(n, r) {
|
|
164
|
-
let {
|
|
165
|
-
"aria-current": a = "page",
|
|
166
|
-
caseSensitive: t = !1,
|
|
167
|
-
className: i = "",
|
|
168
|
-
end: o = !1,
|
|
169
|
-
style: s,
|
|
170
|
-
to: u,
|
|
171
|
-
unstable_viewTransition: l,
|
|
172
|
-
children: p
|
|
173
|
-
} = n, v = K(n, fe), h = D(u, {
|
|
174
|
-
relative: v.relative
|
|
175
|
-
}), x = I(), b = m.useContext(Y), {
|
|
176
|
-
navigator: w,
|
|
177
|
-
basename: y
|
|
178
|
-
} = m.useContext(F), g = b != null && // Conditional usage is OK here because the usage of a data router is static
|
|
179
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
180
|
-
Re(h) && l === !0, c = w.encodeLocation ? w.encodeLocation(h).pathname : h.pathname, d = x.pathname, f = b && b.navigation && b.navigation.location ? b.navigation.location.pathname : null;
|
|
181
|
-
t || (d = d.toLowerCase(), f = f ? f.toLowerCase() : null, c = c.toLowerCase()), f && y && (f = E(f, y) || f);
|
|
182
|
-
const C = c !== "/" && c.endsWith("/") ? c.length - 1 : c.length;
|
|
183
|
-
let O = d === c || !o && d.startsWith(c) && d.charAt(C) === "/", M = f != null && (f === c || !o && f.startsWith(c) && f.charAt(c.length) === "/"), V = {
|
|
184
|
-
isActive: O,
|
|
185
|
-
isPending: M,
|
|
186
|
-
isTransitioning: g
|
|
187
|
-
}, H = O ? a : void 0, U;
|
|
188
|
-
typeof i == "function" ? U = i(V) : U = [i, O ? "active" : null, M ? "pending" : null, g ? "transitioning" : null].filter(Boolean).join(" ");
|
|
189
|
-
let X = typeof s == "function" ? s(V) : s;
|
|
190
|
-
return /* @__PURE__ */ m.createElement(q, N({}, v, {
|
|
191
|
-
"aria-current": H,
|
|
192
|
-
className: U,
|
|
193
|
-
ref: r,
|
|
194
|
-
style: X,
|
|
195
|
-
to: u,
|
|
196
|
-
unstable_viewTransition: l
|
|
197
|
-
}), typeof p == "function" ? p(V) : p);
|
|
198
|
-
});
|
|
199
|
-
process.env.NODE_ENV !== "production" && (be.displayName = "NavLink");
|
|
200
|
-
const we = /* @__PURE__ */ m.forwardRef((e, n) => {
|
|
201
|
-
let {
|
|
202
|
-
fetcherKey: r,
|
|
203
|
-
navigate: a,
|
|
204
|
-
reloadDocument: t,
|
|
205
|
-
replace: i,
|
|
206
|
-
state: o,
|
|
207
|
-
method: s = _,
|
|
208
|
-
action: u,
|
|
209
|
-
onSubmit: l,
|
|
210
|
-
relative: p,
|
|
211
|
-
preventScrollReset: v,
|
|
212
|
-
unstable_viewTransition: h
|
|
213
|
-
} = e, x = K(e, me), b = xe(), w = Ce(u, {
|
|
214
|
-
relative: p
|
|
215
|
-
}), y = s.toLowerCase() === "get" ? "get" : "post", g = (c) => {
|
|
216
|
-
if (l && l(c), c.defaultPrevented)
|
|
217
|
-
return;
|
|
218
|
-
c.preventDefault();
|
|
219
|
-
let d = c.nativeEvent.submitter, f = (d == null ? void 0 : d.getAttribute("formmethod")) || s;
|
|
220
|
-
b(d || c.currentTarget, {
|
|
221
|
-
fetcherKey: r,
|
|
222
|
-
method: f,
|
|
223
|
-
navigate: a,
|
|
224
|
-
replace: i,
|
|
225
|
-
state: o,
|
|
226
|
-
relative: p,
|
|
227
|
-
preventScrollReset: v,
|
|
228
|
-
unstable_viewTransition: h
|
|
229
|
-
});
|
|
230
|
-
};
|
|
231
|
-
return /* @__PURE__ */ m.createElement("form", N({
|
|
232
|
-
ref: n,
|
|
233
|
-
method: y,
|
|
234
|
-
action: w,
|
|
235
|
-
onSubmit: t ? l : g
|
|
236
|
-
}, x));
|
|
237
|
-
});
|
|
238
|
-
process.env.NODE_ENV !== "production" && (we.displayName = "Form");
|
|
239
|
-
process.env.NODE_ENV;
|
|
240
|
-
var T;
|
|
241
|
-
(function(e) {
|
|
242
|
-
e.UseScrollRestoration = "useScrollRestoration", e.UseSubmit = "useSubmit", e.UseSubmitFetcher = "useSubmitFetcher", e.UseFetcher = "useFetcher", e.useViewTransitionState = "useViewTransitionState";
|
|
243
|
-
})(T || (T = {}));
|
|
244
|
-
var B;
|
|
245
|
-
(function(e) {
|
|
246
|
-
e.UseFetcher = "useFetcher", e.UseFetchers = "useFetchers", e.UseScrollRestoration = "useScrollRestoration";
|
|
247
|
-
})(B || (B = {}));
|
|
248
|
-
function ye(e) {
|
|
249
|
-
return e + " must be used within a data router. See https://reactrouter.com/routers/picking-a-router.";
|
|
250
|
-
}
|
|
251
|
-
function G(e) {
|
|
252
|
-
let n = m.useContext(Q);
|
|
253
|
-
return n || (process.env.NODE_ENV !== "production" ? S(!1, ye(e)) : S(!1)), n;
|
|
254
|
-
}
|
|
255
|
-
function ge(e, n) {
|
|
256
|
-
let {
|
|
257
|
-
target: r,
|
|
258
|
-
replace: a,
|
|
259
|
-
state: t,
|
|
260
|
-
preventScrollReset: i,
|
|
261
|
-
relative: o,
|
|
262
|
-
unstable_viewTransition: s
|
|
263
|
-
} = n === void 0 ? {} : n, u = Z(), l = I(), p = D(e, {
|
|
264
|
-
relative: o
|
|
265
|
-
});
|
|
266
|
-
return m.useCallback((v) => {
|
|
267
|
-
if (oe(v, r)) {
|
|
268
|
-
v.preventDefault();
|
|
269
|
-
let h = a !== void 0 ? a : A(l) === A(p);
|
|
270
|
-
u(e, {
|
|
271
|
-
replace: h,
|
|
272
|
-
state: t,
|
|
273
|
-
preventScrollReset: i,
|
|
274
|
-
relative: o,
|
|
275
|
-
unstable_viewTransition: s
|
|
276
|
-
});
|
|
277
|
-
}
|
|
278
|
-
}, [l, u, p, a, t, r, e, i, o, s]);
|
|
279
|
-
}
|
|
280
|
-
function Ee() {
|
|
281
|
-
if (typeof document > "u")
|
|
282
|
-
throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.");
|
|
283
|
-
}
|
|
284
|
-
let Se = 0, Ne = () => "__" + String(++Se) + "__";
|
|
285
|
-
function xe() {
|
|
286
|
-
let {
|
|
287
|
-
router: e
|
|
288
|
-
} = G(T.UseSubmit), {
|
|
289
|
-
basename: n
|
|
290
|
-
} = m.useContext(F), r = $();
|
|
291
|
-
return m.useCallback(function(a, t) {
|
|
292
|
-
t === void 0 && (t = {}), Ee();
|
|
293
|
-
let {
|
|
294
|
-
action: i,
|
|
295
|
-
method: o,
|
|
296
|
-
encType: s,
|
|
297
|
-
formData: u,
|
|
298
|
-
body: l
|
|
299
|
-
} = ue(a, n);
|
|
300
|
-
if (t.navigate === !1) {
|
|
301
|
-
let p = t.fetcherKey || Ne();
|
|
302
|
-
e.fetch(p, r, t.action || i, {
|
|
303
|
-
preventScrollReset: t.preventScrollReset,
|
|
304
|
-
formData: u,
|
|
305
|
-
body: l,
|
|
306
|
-
formMethod: t.method || o,
|
|
307
|
-
formEncType: t.encType || s,
|
|
308
|
-
unstable_flushSync: t.unstable_flushSync
|
|
309
|
-
});
|
|
310
|
-
} else
|
|
311
|
-
e.navigate(t.action || i, {
|
|
312
|
-
preventScrollReset: t.preventScrollReset,
|
|
313
|
-
formData: u,
|
|
314
|
-
body: l,
|
|
315
|
-
formMethod: t.method || o,
|
|
316
|
-
formEncType: t.encType || s,
|
|
317
|
-
replace: t.replace,
|
|
318
|
-
state: t.state,
|
|
319
|
-
fromRouteId: r,
|
|
320
|
-
unstable_flushSync: t.unstable_flushSync,
|
|
321
|
-
unstable_viewTransition: t.unstable_viewTransition
|
|
322
|
-
});
|
|
323
|
-
}, [e, n, r]);
|
|
324
|
-
}
|
|
325
|
-
function Ce(e, n) {
|
|
326
|
-
let {
|
|
327
|
-
relative: r
|
|
328
|
-
} = n === void 0 ? {} : n, {
|
|
329
|
-
basename: a
|
|
330
|
-
} = m.useContext(F), t = m.useContext(ee);
|
|
331
|
-
t || (process.env.NODE_ENV !== "production" ? S(!1, "useFormAction must be used inside a RouteContext") : S(!1));
|
|
332
|
-
let [i] = t.matches.slice(-1), o = N({}, D(e || ".", {
|
|
333
|
-
relative: r
|
|
334
|
-
})), s = I();
|
|
335
|
-
if (e == null) {
|
|
336
|
-
o.search = s.search;
|
|
337
|
-
let u = new URLSearchParams(o.search);
|
|
338
|
-
u.has("index") && u.get("index") === "" && (u.delete("index"), o.search = u.toString() ? "?" + u.toString() : "");
|
|
339
|
-
}
|
|
340
|
-
return (!e || e === ".") && i.route.index && (o.search = o.search ? o.search.replace(/^\?/, "?index&") : "?index"), a !== "/" && (o.pathname = o.pathname === "/" ? a : te([a, o.pathname])), A(o);
|
|
341
|
-
}
|
|
342
|
-
function Re(e, n) {
|
|
343
|
-
n === void 0 && (n = {});
|
|
344
|
-
let r = m.useContext(z);
|
|
345
|
-
r == null && (process.env.NODE_ENV !== "production" ? S(!1, "`unstable_useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?") : S(!1));
|
|
346
|
-
let {
|
|
347
|
-
basename: a
|
|
348
|
-
} = G(T.useViewTransitionState), t = D(e, {
|
|
349
|
-
relative: n.relative
|
|
350
|
-
});
|
|
351
|
-
if (!r.isTransitioning)
|
|
352
|
-
return !1;
|
|
353
|
-
let i = E(r.currentLocation.pathname, a) || r.currentLocation.pathname, o = E(r.nextLocation.pathname, a) || r.nextLocation.pathname;
|
|
354
|
-
return W(t.pathname, o) != null || W(t.pathname, i) != null;
|
|
355
|
-
}
|
|
356
|
-
export {
|
|
357
|
-
q as L,
|
|
358
|
-
be as N
|
|
359
|
-
};
|