@cagatayfdn/flora-components 0.0.109 → 0.0.111

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,34 +1,387 @@
1
- import { j as l } from "../../jsx-runtime-BcAkpsdy.js";
2
- import { N as x } from "../../index-CPAJmTI5.js";
3
- import { g as c } from "../../index-9ZLCCecr.js";
4
- const v = ({
5
- to: o,
6
- params: i,
7
- children: m,
8
- className: r,
9
- activeClassName: s,
10
- style: p,
11
- onClick: a,
12
- state: e,
13
- isDisabled: f
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 n = c(o, i), u = (t) => {
16
- if (f)
17
- return t.preventDefault();
18
- a && a();
368
+ const l = ae(e, n), d = (h) => {
369
+ if (u)
370
+ return h.preventDefault();
371
+ o && o();
19
372
  };
20
- return /* @__PURE__ */ l.jsx(
21
- x,
373
+ return /* @__PURE__ */ Y.jsx(
374
+ q,
22
375
  {
23
- to: e ? { pathname: n } : n,
24
- style: p,
25
- state: e,
26
- className: ({ isActive: t }) => t ? `${r} ${s}` : r,
27
- onClick: u,
28
- children: m
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
- v as default
386
+ Fe as default
34
387
  };
@@ -1,72 +1,75 @@
1
- import { j as r } from "../../jsx-runtime-BcAkpsdy.js";
2
- import { L as w } from "../../index-CPAJmTI5.js";
3
- import { c as f } from "../../index-BHf7G3IG.js";
4
- import { Icons as h } from "../../assets/icons/icons.js";
5
- import _ from "../Icon/index.js";
6
- import '../../Stepper.css';const L = "_container_12lwx_1", N = "_complete_12lwx_16", C = "_active_12lwx_39", m = {
7
- container: L,
8
- complete: N,
9
- active: C
10
- }, T = ({
11
- items: d,
12
- selected: o = 0,
13
- selectAll: j,
14
- renderAnchor: u = !0,
15
- onChange: a,
16
- wrapperClass: k
17
- }) => {
18
- let i = !0;
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-${t}`,
23
- onClick: (c) => a && a(t, c),
21
+ href: `#step-${e}`,
22
+ onClick: (a) => d && d(e, a),
24
23
  children: [
25
- s || (o > t ? /* @__PURE__ */ r.jsx("span", { children: /* @__PURE__ */ r.jsx(_, { name: h.Check }) }) : /* @__PURE__ */ r.jsx("span", { children: t + 1 })),
26
- e
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
- ), v = ({
30
- index: t,
31
- title: e,
32
- customIndexItem: s,
33
- to: c
34
- }) => /* @__PURE__ */ r.jsxs(w, { to: c, onClick: (p) => a && a(t, p), children: [
35
- s || (o > t ? /* @__PURE__ */ r.jsx("span", { children: /* @__PURE__ */ r.jsx(_, { name: h.Check }) }) : /* @__PURE__ */ r.jsx("span", { children: t + 1 })),
36
- e
37
- ] });
38
- return /* @__PURE__ */ r.jsx("div", { className: f(m.container, k), "data-testid": "stepper-container", children: /* @__PURE__ */ r.jsx("ul", { "data-testid": "stepper-list", children: d.map(
39
- ({
40
- title: t,
41
- customIndexItem: e,
42
- activeClass: s,
43
- completeClass: c,
44
- to: p
45
- }, n) => {
46
- j && (i = !0);
47
- const l = n === o;
48
- return !j && l && (i = !1), /* @__PURE__ */ r.jsx(
49
- "li",
50
- {
51
- "data-testid": "stepper-list-item",
52
- className: f({
53
- [m.active]: l,
54
- [m.complete]: i,
55
- [s]: l,
56
- [c]: i
57
- }),
58
- children: u ? x({ index: n, title: t, customIndexItem: e }) : v({
59
- index: n,
60
- title: t,
61
- customIndexItem: e,
62
- to: p
63
- })
64
- },
65
- `stepper-item-${n}`
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
- T as default
74
+ y as default
72
75
  };