welcome-ui 1.0.0-beta.6 → 1.0.0-beta.8
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/{AXB53BZF-KWM2jKTz.js → AXB53BZF-CAQ85RSy.js} +1 -1
- package/dist/{AXB53BZF-BxNazDnS.mjs → AXB53BZF-DCqNWRx3.mjs} +2 -2
- package/dist/Accordion.js +1 -1
- package/dist/Accordion.mjs +2 -2
- package/dist/{BYC7LY2E-BkAEL2VD.js → BYC7LY2E-BE1a2svb.js} +1 -1
- package/dist/{BYC7LY2E-BAjGN7k_.mjs → BYC7LY2E-BNqcw1O8.mjs} +2 -2
- package/dist/Breadcrumb.js +1 -1
- package/dist/Breadcrumb.mjs +4 -3
- package/dist/CustomInput-CHhz-wtr.js +1064 -0
- package/dist/CustomInput-DsJYqH0X.mjs +1272 -0
- package/dist/DatePicker.js +1 -1
- package/dist/DatePicker.mjs +1 -1
- package/dist/DateTimePicker.js +1 -1
- package/dist/DateTimePicker.mjs +1 -1
- package/dist/DateTimePickerCommon.js +1 -1
- package/dist/DateTimePickerCommon.mjs +1 -1
- package/dist/Drawer.js +1 -1
- package/dist/Drawer.mjs +3 -3
- package/dist/DropdownMenu.js +1 -1
- package/dist/DropdownMenu.mjs +5 -5
- package/dist/FileDrop.js +1 -1
- package/dist/FileDrop.mjs +4 -3
- package/dist/{JC64G2H7-CQsqXPS_.mjs → JC64G2H7-HxATiU-t.mjs} +2 -2
- package/dist/{JC64G2H7-YkBMNrtl.js → JC64G2H7-VmOGyhc1.js} +1 -1
- package/dist/{MTZPJQMC-DZ3zg4be.mjs → MTZPJQMC-C9lHSyrL.mjs} +1 -1
- package/dist/{MTZPJQMC-5Xg78Uyy.js → MTZPJQMC-D0pYOjc_.js} +1 -1
- package/dist/Modal.js +1 -1
- package/dist/Modal.mjs +3 -3
- package/dist/{P4IRICAX-DF0_vmod.mjs → P4IRICAX-C0oIr4wI.mjs} +1 -1
- package/dist/{P4IRICAX-nhgZ26A1.js → P4IRICAX-t3xfwWga.js} +1 -1
- package/dist/Popover.js +1 -1
- package/dist/Popover.mjs +1 -1
- package/dist/{QYJ6MIDR-CRK3satR.js → QYJ6MIDR-T-fJ_t8N.js} +1 -1
- package/dist/{QYJ6MIDR-Cy39pEs2.mjs → QYJ6MIDR-YegHsExc.mjs} +2 -2
- package/dist/{SYRFVSLH-BpAfr7UE.js → SYRFVSLH-Babm193P.js} +1 -1
- package/dist/{SYRFVSLH-DyepaZf7.mjs → SYRFVSLH-DXZgEwus.mjs} +1 -1
- package/dist/Search.js +7 -7
- package/dist/Search.mjs +36 -36
- package/dist/Select.js +1 -1
- package/dist/Select.mjs +5 -4
- package/dist/Tabs.js +8 -8
- package/dist/Tabs.mjs +168 -173
- package/dist/TimePicker.js +1 -1
- package/dist/TimePicker.mjs +1 -1
- package/dist/Toast.js +1 -1
- package/dist/Toast.mjs +1 -1
- package/dist/Tooltip.js +1 -1
- package/dist/Tooltip.mjs +2 -2
- package/dist/{VEVQD5MH-mN1wMozH.js → VEVQD5MH-Cal9SWXl.js} +1 -1
- package/dist/{VEVQD5MH-De4r89YE.mjs → VEVQD5MH-DOp_qaPw.mjs} +1 -1
- package/dist/{VGCJ63VH-fv0YLRh8.mjs → VGCJ63VH-BqPfqkK_.mjs} +1 -1
- package/dist/{VGCJ63VH-BNLwLOaC.js → VGCJ63VH-Cuf7P3qW.js} +1 -1
- package/dist/WelcomeLoader.js +1 -11
- package/dist/WelcomeLoader.mjs +25 -5086
- package/dist/{index-BPNky7_R.js → index-B8roHPE-.js} +1 -1
- package/dist/index-BFQbRuqA.mjs +165 -0
- package/dist/{index-BYdkhqH4.mjs → index-BZmKn5VO.mjs} +11 -14
- package/dist/index-BjGfAqCk.mjs +209 -0
- package/dist/{index-BHi0wohR.js → index-CQyLvMJP.js} +23 -23
- package/dist/{index-DG4lwZUW.mjs → index-Cjf3wLkx.mjs} +3 -3
- package/dist/index-CmBs24Im.mjs +413 -0
- package/dist/index-DG7ovxHW.js +117 -0
- package/dist/index-DSZG0Sqy.js +54 -0
- package/dist/index-DhF591OM.js +42 -0
- package/dist/index.js +7 -7
- package/dist/index.mjs +2154 -2216
- package/dist/{usePopover-Bbhh3p_j.mjs → usePopover-AbS2gpZq.mjs} +2 -2
- package/dist/{usePopover-PCWsuJNF.js → usePopover-CzPtX0h_.js} +1 -1
- package/package.json +1 -1
- package/dist/CustomInput-DUq7mNvC.mjs +0 -7826
- package/dist/CustomInput-NV_j0IWq.js +0 -1070
- package/dist/downshift.esm-DAo-GJwH.js +0 -1
- package/dist/downshift.esm-K4YLLQXl.mjs +0 -1085
- package/dist/index-BLom3M2B.js +0 -2
- package/dist/index-BZq8PyIk.js +0 -46
- package/dist/index-CGZVoNIN.mjs +0 -1077
- package/dist/index-DPMCsVtB.js +0 -54
- package/dist/index-R0G4mc9j.mjs +0 -2347
- package/dist/index-SbQUT2mU.mjs +0 -639
- package/dist/index-_oF_K5ZN.js +0 -122
- package/dist/index-mPb8TbpM.mjs +0 -447
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use client";"use strict";const t=require("react"),i=require("./System.js"),o=require("@xstyled/styled-components"),c=require("./Box.js"),b=require("./CloseButton.js"),$=require("./SYRFVSLH-
|
|
1
|
+
"use client";"use strict";const t=require("react"),i=require("./System.js"),o=require("@xstyled/styled-components"),c=require("./Box.js"),b=require("./CloseButton.js"),$=require("./SYRFVSLH-Babm193P.js"),u=require("./Text.js"),D=require("./Icon.js"),k=require("./Button.js"),f=require("./JC64G2H7-VmOGyhc1.js"),C=require("./AXB53BZF-CAQ85RSy.js"),v=15,I=15,q='<path fill="currentColor" fill-rule="evenodd" d="M84.496 42.08 26.17 48.79l19.538-21.976a4.112 4.112 0 0 0-.307-5.768 4.02 4.02 0 0 0-5.715.31L13.03 51.338c-.027.03-.044.066-.07.098-.089.105-.166.219-.244.333-.07.105-.144.209-.205.32-.066.119-.116.243-.17.368-.05.118-.104.234-.142.357-.043.129-.067.261-.095.395-.029.129-.058.256-.073.388-.015.128-.014.26-.016.393-.003.104-.02.206-.014.31.003.04.015.078.019.118.003.037-.003.073.001.111.011.108.045.207.065.312.022.115.04.229.07.34.043.157.104.304.165.453.037.088.067.18.109.265.082.166.182.318.285.47.043.06.075.125.12.184.156.208.331.4.524.572l26.658 23.848a4.02 4.02 0 0 0 5.71-.349 4.114 4.114 0 0 0-.345-5.767L25.518 57.088l59.895-6.89c2.219-.256 3.814-2.28 3.56-4.52-.252-2.242-2.253-3.859-4.477-3.597Z" clip-rule="evenodd"/>',S={width:v,height:I,block:q},h=e=>t.createElement(D.Icon,{alt:"ArrowLeft",content:S,...e}),T=e=>{switch(e){case"top":return{top:"0 !important",right:0,left:0,transform:"translateY(-100%)"};case"right":return{top:"0 !important",right:0,bottom:0,transform:"translateX(100%)"};case"bottom":return{right:0,bottom:0,left:0,transform:"translateY(100%)"};case"left":return{top:"0 !important",bottom:0,left:0,transform:"translateX(-100%)"}}},m=["sm","md","lg"],R=(e,r)=>{switch(r){case"top":case"bottom":return m.includes(e)?o.th(`drawers.sizes.vertical.${e}`):{height:e};case"right":case"left":return m.includes(e)?o.th(`drawers.sizes.horizontal.${e}`):{width:e}}},F=o.divBox(({placement:e,size:r})=>o.css`
|
|
2
2
|
${o.th("cards.default")};
|
|
3
3
|
${o.th("drawers.default")};
|
|
4
4
|
${T(e)}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import i, { useRef as B, useState as G, Children as H, cloneElement as V, useCallback as L, useMemo as j, useEffect as O } from "react";
|
|
3
|
+
import { ResizeObserver as N } from "@juggle/resize-observer";
|
|
4
|
+
import "./Icon.mjs";
|
|
5
|
+
import { R as q } from "./index-BRDOakbf.mjs";
|
|
6
|
+
import { forwardRef as x } from "./System.mjs";
|
|
7
|
+
import { t as D } from "./throttle-BDBzFeFj.mjs";
|
|
8
|
+
import { Box as J } from "./Box.mjs";
|
|
9
|
+
import f, { th as d, css as A } from "@xstyled/styled-components";
|
|
10
|
+
const K = (t, e, o) => Math.min(Math.max(t, e), o), P = f.aBox`
|
|
11
|
+
${d("breadcrumbs.item.default")};
|
|
12
|
+
align-items: center;
|
|
13
|
+
transition: medium;
|
|
14
|
+
direction: initial;
|
|
15
|
+
|
|
16
|
+
&:hover {
|
|
17
|
+
${d("breadcrumbs.item.hover")};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&[aria-current='page'] {
|
|
21
|
+
${d("breadcrumbs.item.active")};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&[aria-disabled='true'] {
|
|
25
|
+
pointer-events: none;
|
|
26
|
+
cursor: default;
|
|
27
|
+
}
|
|
28
|
+
`, Q = f.spanBox`
|
|
29
|
+
${d("breadcrumbs.separator")};
|
|
30
|
+
display: flex;
|
|
31
|
+
align-items: center;
|
|
32
|
+
`, U = x(
|
|
33
|
+
({ children: t, dataTestId: e, isActive: o, separator: a, ...n }, b) => {
|
|
34
|
+
const m = n.href || n.to;
|
|
35
|
+
return /* @__PURE__ */ i.createElement(
|
|
36
|
+
J,
|
|
37
|
+
{
|
|
38
|
+
"aria-label": "breadcrumb",
|
|
39
|
+
as: "li",
|
|
40
|
+
"data-testid": e,
|
|
41
|
+
display: "inline-flex",
|
|
42
|
+
flex: "0 0 auto",
|
|
43
|
+
lineHeight: "normal"
|
|
44
|
+
},
|
|
45
|
+
a && /* @__PURE__ */ i.createElement(Q, { role: "presentation" }, a),
|
|
46
|
+
/* @__PURE__ */ i.createElement(
|
|
47
|
+
P,
|
|
48
|
+
{
|
|
49
|
+
"aria-current": o ? "page" : void 0,
|
|
50
|
+
"aria-disabled": !m,
|
|
51
|
+
...n,
|
|
52
|
+
ref: b
|
|
53
|
+
},
|
|
54
|
+
t
|
|
55
|
+
)
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
), R = (t, e, o) => parseInt(t.substring(e, o), 16), X = (t) => /(^[0-9a-fA-F]{6}$)|(^[0-9a-fA-F]{3}$)/.test(t), Y = (t) => {
|
|
59
|
+
if (!t || (t = t.replace("#", ""), !X(t)))
|
|
60
|
+
return;
|
|
61
|
+
t.length === 3 && (t = `${t[0]}${t[0]}${t[1]}${t[1]}${t[2]}${t[2]}`);
|
|
62
|
+
const e = (n) => R(n, 0, 2), o = (n) => R(n, 2, 4), a = (n) => R(n, 4, 6);
|
|
63
|
+
return `${e(t)}, ${o(t)}, ${a(t)}`;
|
|
64
|
+
}, Z = (t, e = 1) => t ? t.startsWith("#") ? `rgba(${Y(t)}, ${e})` : t : void 0, C = f.spanBox(
|
|
65
|
+
({ gradientBackground: t, theme: e }) => A`
|
|
66
|
+
left: 0;
|
|
67
|
+
background-image: ${S(e, t)};
|
|
68
|
+
transform-origin: left;
|
|
69
|
+
`
|
|
70
|
+
), I = f.spanBox(
|
|
71
|
+
({ gradientBackground: t, theme: e }) => A`
|
|
72
|
+
right: 0;
|
|
73
|
+
background-image: ${S(e, t, "left")};
|
|
74
|
+
transform-origin: right;
|
|
75
|
+
`
|
|
76
|
+
), tt = f.divBox`
|
|
77
|
+
${d("breadcrumbs.list")};
|
|
78
|
+
height: 100%;
|
|
79
|
+
position: relative;
|
|
80
|
+
overflow-x: hidden;
|
|
81
|
+
|
|
82
|
+
${C},
|
|
83
|
+
${I} {
|
|
84
|
+
position: absolute;
|
|
85
|
+
bottom: 0;
|
|
86
|
+
top: 0;
|
|
87
|
+
width: 30;
|
|
88
|
+
}
|
|
89
|
+
`, et = f.olBox`
|
|
90
|
+
display: inline-flex;
|
|
91
|
+
align-items: center;
|
|
92
|
+
max-width: 100%;
|
|
93
|
+
height: 100%;
|
|
94
|
+
overflow-x: auto;
|
|
95
|
+
margin: 0;
|
|
96
|
+
padding: 0;
|
|
97
|
+
list-style: none;
|
|
98
|
+
white-space: nowrap;
|
|
99
|
+
`, S = (t, e, o = "right") => {
|
|
100
|
+
const a = d(`colors.${e}`)({ theme: t }), n = Z(a, 0);
|
|
101
|
+
return `linear-gradient(to ${o}, ${a}, ${n} 100%)`;
|
|
102
|
+
}, T = x(
|
|
103
|
+
({
|
|
104
|
+
children: t,
|
|
105
|
+
gradientBackground: e = "neutral-10",
|
|
106
|
+
lastChildNotClickable: o = !0,
|
|
107
|
+
separator: a = /* @__PURE__ */ i.createElement(q, { size: "xs" }),
|
|
108
|
+
...n
|
|
109
|
+
}, b) => {
|
|
110
|
+
const m = B(null), g = B(), $ = B(), [h, W] = G(!1), [u, k] = G(0), E = H.toArray(t).filter(Boolean), w = E.length, z = E.map((r, s) => {
|
|
111
|
+
const c = w === 1 || w === s + 1, l = c && o;
|
|
112
|
+
return V(r, {
|
|
113
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
114
|
+
key: `breadcrumb-${s}`,
|
|
115
|
+
separator: c ? void 0 : a,
|
|
116
|
+
isActive: l,
|
|
117
|
+
...r.props
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
function y(r, s) {
|
|
121
|
+
r && (r.style.transform = `scale3d(${s}, 1, 1)`);
|
|
122
|
+
}
|
|
123
|
+
const p = L((r) => {
|
|
124
|
+
const s = 1 - r;
|
|
125
|
+
y(g.current, s), y($.current, r);
|
|
126
|
+
}, []), M = L(() => {
|
|
127
|
+
const {
|
|
128
|
+
current: { offsetWidth: r, scrollLeft: s, scrollWidth: c }
|
|
129
|
+
} = m, l = c - r, F = K(Math.abs(s - u), 0, l) / l;
|
|
130
|
+
p(F);
|
|
131
|
+
}, [u, p]), _ = j(
|
|
132
|
+
() => D(
|
|
133
|
+
(r) => {
|
|
134
|
+
const [
|
|
135
|
+
{
|
|
136
|
+
// Is offsetWidth really needed ?
|
|
137
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
138
|
+
// @ts-ignore
|
|
139
|
+
target: { offsetWidth: s, scrollLeft: c, scrollWidth: l }
|
|
140
|
+
}
|
|
141
|
+
] = r, v = l - s;
|
|
142
|
+
u || k(c === 0 ? 0 : v), W(v > 0);
|
|
143
|
+
},
|
|
144
|
+
300,
|
|
145
|
+
!1
|
|
146
|
+
),
|
|
147
|
+
[u]
|
|
148
|
+
);
|
|
149
|
+
return O(() => {
|
|
150
|
+
const r = new N(_);
|
|
151
|
+
return r.observe(m.current), () => r.disconnect();
|
|
152
|
+
}, []), O(() => {
|
|
153
|
+
g.current && $.current && p(0);
|
|
154
|
+
}, [h, p]), /* @__PURE__ */ i.createElement(tt, { as: "nav", ref: b, ...n }, h && /* @__PURE__ */ i.createElement(C, { gradientBackground: e, ref: g }), /* @__PURE__ */ i.createElement(et, { dir: "rtl", onScroll: M, ref: m }, z.reverse()), h && /* @__PURE__ */ i.createElement(I, { gradientBackground: e, ref: $ }));
|
|
155
|
+
}
|
|
156
|
+
);
|
|
157
|
+
T.displayName = "Breadcrumb";
|
|
158
|
+
const dt = Object.assign(T, {
|
|
159
|
+
Item: U
|
|
160
|
+
});
|
|
161
|
+
export {
|
|
162
|
+
T as B,
|
|
163
|
+
dt as a,
|
|
164
|
+
Z as h
|
|
165
|
+
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { g as Nk } from "./_commonjsHelpers-CXJ7dpIk.mjs";
|
|
2
1
|
import $T from "react";
|
|
3
2
|
var rC = { exports: {} }, Qr = {}, wm = { exports: {} }, tC = {}, VT;
|
|
4
|
-
function
|
|
3
|
+
function Nk() {
|
|
5
4
|
return VT || (VT = 1, function(le) {
|
|
6
5
|
"use client";
|
|
7
6
|
function Ae(P, ve) {
|
|
@@ -202,7 +201,7 @@ function zk() {
|
|
|
202
201
|
}(tC)), tC;
|
|
203
202
|
}
|
|
204
203
|
var nC = {}, jT;
|
|
205
|
-
function
|
|
204
|
+
function zk() {
|
|
206
205
|
return jT || (jT = 1, function(le) {
|
|
207
206
|
"use client";
|
|
208
207
|
process.env.NODE_ENV !== "production" && function() {
|
|
@@ -468,10 +467,10 @@ function Uk() {
|
|
|
468
467
|
}
|
|
469
468
|
var BT;
|
|
470
469
|
function QT() {
|
|
471
|
-
return BT || (BT = 1, process.env.NODE_ENV === "production" ? wm.exports =
|
|
470
|
+
return BT || (BT = 1, process.env.NODE_ENV === "production" ? wm.exports = Nk() : wm.exports = zk()), wm.exports;
|
|
472
471
|
}
|
|
473
472
|
var PT;
|
|
474
|
-
function
|
|
473
|
+
function Uk() {
|
|
475
474
|
if (PT) return Qr;
|
|
476
475
|
PT = 1;
|
|
477
476
|
var le = $T, Ae = QT();
|
|
@@ -5627,7 +5626,7 @@ Error generating stack: ` + d.message + `
|
|
|
5627
5626
|
}, Qr.version = "18.3.1-next-f1338f8080-20240426", Qr;
|
|
5628
5627
|
}
|
|
5629
5628
|
var Ir = {}, YT;
|
|
5630
|
-
function
|
|
5629
|
+
function Ak() {
|
|
5631
5630
|
return YT || (YT = 1, process.env.NODE_ENV !== "production" && function() {
|
|
5632
5631
|
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
|
5633
5632
|
var le = $T, Ae = QT(), N = le.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, ur = !1;
|
|
@@ -11010,7 +11009,7 @@ Check the render method of \`` + e + "`." : "";
|
|
|
11010
11009
|
};
|
|
11011
11010
|
}
|
|
11012
11011
|
}
|
|
11013
|
-
function
|
|
11012
|
+
function Hk(e) {
|
|
11014
11013
|
return e;
|
|
11015
11014
|
}
|
|
11016
11015
|
function U1(e) {
|
|
@@ -13240,9 +13239,9 @@ Incoming: %s`, z, "[" + t.join(", ") + "]", "[" + e.join(", ") + "]");
|
|
|
13240
13239
|
}
|
|
13241
13240
|
return [p, s];
|
|
13242
13241
|
}
|
|
13243
|
-
function
|
|
13242
|
+
function Fk(e, t, a) {
|
|
13244
13243
|
}
|
|
13245
|
-
function
|
|
13244
|
+
function Vk(e, t, a) {
|
|
13246
13245
|
}
|
|
13247
13246
|
function Eg(e, t, a) {
|
|
13248
13247
|
var i = Ze, u = Ui(), s, f = Ln();
|
|
@@ -19019,10 +19018,8 @@ function IT() {
|
|
|
19019
19018
|
}
|
|
19020
19019
|
}
|
|
19021
19020
|
}
|
|
19022
|
-
process.env.NODE_ENV === "production" ? (IT(), rC.exports =
|
|
19023
|
-
var
|
|
19024
|
-
const $k = /* @__PURE__ */ Nk(Fk);
|
|
19021
|
+
process.env.NODE_ENV === "production" ? (IT(), rC.exports = Uk()) : rC.exports = Ak();
|
|
19022
|
+
var Bk = rC.exports;
|
|
19025
19023
|
export {
|
|
19026
|
-
|
|
19027
|
-
Fk as r
|
|
19024
|
+
Bk as r
|
|
19028
19025
|
};
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import t, { useState as z, useEffect as j } from "react";
|
|
3
|
+
import * as C from "react-dropzone";
|
|
4
|
+
import { Icon as I } from "./Icon.mjs";
|
|
5
|
+
import { Button as $ } from "./Button.mjs";
|
|
6
|
+
import { shouldForwardProp as n1, forwardRef as r1 } from "./System.mjs";
|
|
7
|
+
import { c as N } from "./create-event-rXDe5aCQ.mjs";
|
|
8
|
+
import D, { css as k, th as a, system as c1 } from "@xstyled/styled-components";
|
|
9
|
+
import { Text as w } from "./Text.mjs";
|
|
10
|
+
import { E as o1 } from "./index-DqBUFsqP.mjs";
|
|
11
|
+
import { g as l1, b as a1, a as T } from "./index-Bn9aiaUQ.mjs";
|
|
12
|
+
const i1 = 15, s1 = 15, m1 = '<path fill="currentColor" fill-rule="evenodd" d="M66.13 15.65a2.4 2.4 0 0 1 3.342-.19l13.363 11.675c.164.143.297.312.414.49.19.092.374.2.541.346 2.365 2.064 3.77 4.98 3.955 8.214.212 3.638-1.16 7.364-3.762 10.22L64.78 67.496a2.383 2.383 0 0 1-1.769.777 2.385 2.385 0 0 1-1.585-.6 2.317 2.317 0 0 1-.182-3.306l19.202-21.089c1.763-1.935 2.696-4.423 2.556-6.825a7.173 7.173 0 0 0-1.627-4.187L33.58 84.755c-.006.008-.015.014-.02.022l-.046.05c-.02.024-.048.039-.07.061a2.214 2.214 0 0 1-.271.241c-.047.036-.1.066-.15.096-.063.04-.119.085-.185.12L10.465 96.738a2.393 2.393 0 0 1-2.675-.336 2.32 2.32 0 0 1-.631-2.585l9.01-23.068.04-.077c.029-.063.061-.123.095-.184.07-.13.154-.252.245-.365.027-.03.04-.068.066-.098L66.13 15.65ZM21.852 73.931h-1.835L13.838 89.75l15.342-7.814-.242-1.857c-.457-3.503-3.503-6.147-7.086-6.147ZM73.724 7.308c4.556-5 12.05-5.76 16.708-1.69 2.12 1.852 3.38 4.468 3.549 7.367.189 3.25-1.036 6.575-3.358 9.125a2.378 2.378 0 0 1-1.767.777c-.56 0-1.123-.194-1.575-.589L73.918 10.625a2.321 2.321 0 0 1-.194-3.317Z" clip-rule="evenodd"/>', u1 = {
|
|
13
|
+
width: i1,
|
|
14
|
+
height: s1,
|
|
15
|
+
block: m1
|
|
16
|
+
}, d1 = (e) => /* @__PURE__ */ t.createElement(I, { alt: "Edit", content: u1, ...e }), p1 = 15, f1 = 15, h1 = '<path fill="currentColor" fill-rule="evenodd" d="M70.885 70.969a4.139 4.139 0 0 1-5.568-1.74c-2.784-5.301-8.464-8.146-14.849-7.424-6.595.746-12.761 5.284-15.706 11.559a4.128 4.128 0 0 1-3.742 2.368 4.117 4.117 0 0 1-1.742-.385 4.089 4.089 0 0 1-1.996-5.45c4.196-8.94 12.722-15.163 22.25-16.242 9.706-1.1 18.77 3.525 23.105 11.78a4.09 4.09 0 0 1-1.752 5.534zM34.541 31.95c1.566-.179 3.055.276 4.18 1.275 1.118.993 1.734 2.395 1.734 3.945 0 3.093-2.433 5.791-5.54 6.144a6.041 6.041 0 0 1-.662.038c-1.32 0-2.548-.456-3.516-1.314-1.12-.993-1.736-2.394-1.736-3.946 0-3.092 2.435-5.79 5.54-6.142zm30.542-3.458c1.575-.17 3.052.276 4.18 1.273 1.117.994 1.735 2.395 1.735 3.947 0 3.092-2.434 5.791-5.54 6.142a6.04 6.04 0 0 1-.662.038c-1.32 0-2.549-.455-3.516-1.313-1.12-.994-1.737-2.393-1.737-3.943 0-3.094 2.435-5.793 5.54-6.144zM81.798 14.98c-8.589-7.617-20-11.059-32.126-9.682C25.041 8.086 5 30.28 5 54.769c0 11.957 4.69 22.7 13.202 30.254C25.552 91.542 34.968 95 45.135 95a46.38 46.38 0 0 0 5.193-.295C74.96 91.915 95 69.722 95 45.233c0-11.958-4.688-22.701-13.202-30.254z" clip-rule="evenodd"/>', g1 = {
|
|
17
|
+
width: p1,
|
|
18
|
+
height: f1,
|
|
19
|
+
block: h1
|
|
20
|
+
}, E1 = (e) => /* @__PURE__ */ t.createElement(I, { alt: "Negative", content: g1, ...e }), v1 = 15, $1 = 15, w1 = '<path fill="currentColor" fill-rule="evenodd" d="M72.716 58.953c-4.194 8.94-12.719 15.163-22.25 16.243-.947.107-1.89.16-2.82.16-8.607 0-16.372-4.493-20.284-11.94a4.09 4.09 0 0 1 1.751-5.534c2.022-1.046 4.513-.269 5.568 1.74 2.785 5.301 8.483 8.15 14.851 7.424 6.596-.746 12.76-5.284 15.705-11.559.962-2.052 3.418-2.941 5.483-1.983a4.09 4.09 0 0 1 1.996 5.45ZM34.54 31.951c1.564-.177 3.055.276 4.177 1.275 1.121.992 1.737 2.393 1.737 3.945 0 3.09-2.435 5.79-5.54 6.142a6.048 6.048 0 0 1-.663.038c-1.32 0-2.549-.455-3.516-1.313-1.12-.994-1.735-2.395-1.735-3.945 0-3.094 2.433-5.791 5.54-6.142Zm30.542-3.458c1.575-.176 3.052.274 4.178 1.273 1.12.992 1.737 2.393 1.737 3.945 0 3.094-2.435 5.793-5.54 6.144a6.046 6.046 0 0 1-.664.038c-1.32 0-2.548-.455-3.516-1.313-1.119-.994-1.735-2.393-1.735-3.945 0-3.092 2.434-5.791 5.54-6.142Zm16.715-13.514c-8.589-7.617-20-11.057-32.126-9.683C25.04 8.086 5 30.28 5 54.77c0 11.957 4.688 22.7 13.202 30.253C25.552 91.542 34.968 95 45.135 95c1.711 0 3.445-.098 5.193-.297C74.959 91.914 95 69.72 95 45.231c0-11.956-4.69-22.701-13.202-30.253Z" clip-rule="evenodd"/>', I1 = {
|
|
21
|
+
width: v1,
|
|
22
|
+
height: $1,
|
|
23
|
+
block: w1
|
|
24
|
+
}, D1 = (e) => /* @__PURE__ */ t.createElement(I, { alt: "Positive", content: I1, ...e }), R1 = 15, b1 = 15, y1 = '<path fill="currentColor" d="M83.765 11.723c6.352 4.338 6.538 8.858 6.083 11.165a1.37 1.37 0 0 1-.028.109c-.01.033-.019.066-.026.1-.105.914-.933 8.113-2.097 14.758-.08.464-.296.895-.618 1.24-1.16 1.242-2.661 2.383-4.436 3.43-3.078 17.568-7.563 43.031-7.905 44.252-1.125 4.018-5.68 7.078-12.827 8.616-3.491.751-7.257 1.107-10.996 1.107-8.5 0-16.875-1.844-21.654-5.108-2.321-1.586-3.661-3.453-4.096-5.712-.401-2.092-4.849-27.317-7.817-44.175l-.035-.021c-.369-.226-.738-.451-1.083-.687a19.024 19.024 0 0 1-3.33-2.858 2.443 2.443 0 0 1-.6-1.217c-1.267-7.198-2.151-15.002-2.16-15.08a.137.137 0 0 1 0-.029v-.024a8.318 8.318 0 0 1 .007-3.083c1.16-5.89 8.538-10.713 20.242-13.229 18.424-3.965 42.37-1.072 53.376 6.446ZM68.58 31.361c11.274-2.426 15.925-6.585 16.482-9.411.493-2.508-1.931-4.76-4.053-6.21-6.84-4.671-19.828-7.361-32.814-7.361-5.774 0-11.545.531-16.778 1.656-11.274 2.424-15.924 6.584-16.481 9.41-.494 2.507 1.93 4.762 4.053 6.21 9.88 6.749 32.59 9.36 49.59 5.706Zm0 11.126c6.585-1.418 11.67-3.612 14.44-6.22.327-1.916.622-3.854.88-5.652-3.468 2.326-8.31 4.217-14.291 5.503-5.603 1.205-11.718 1.776-17.822 1.776-13.97 0-27.895-2.991-35.556-8.223a1.83 1.83 0 0 1-.064-.047l-.064-.046c.259 1.779.553 3.685.878 5.573a14.852 14.852 0 0 0 2.006 1.63c9.883 6.747 32.591 9.36 49.593 5.706ZM45.093 13.495h9.81c4.564 0 8.277 3.704 8.277 8.256a2.436 2.436 0 0 1-2.44 2.434 2.436 2.436 0 0 1-2.439-2.434 3.398 3.398 0 0 0-3.398-3.389h-9.81a3.398 3.398 0 0 0-3.399 3.39 2.436 2.436 0 0 1-2.44 2.433 2.437 2.437 0 0 1-2.44-2.434c0-4.552 3.715-8.257 8.28-8.257Z"/>', F1 = {
|
|
25
|
+
width: R1,
|
|
26
|
+
height: b1,
|
|
27
|
+
block: y1
|
|
28
|
+
}, L1 = (e) => /* @__PURE__ */ t.createElement(I, { alt: "Trash", content: F1, ...e }), k1 = D("div").withConfig({ shouldForwardProp: n1 })(
|
|
29
|
+
({ disabled: e, isDragAccept: n, isDragReject: r }) => k`
|
|
30
|
+
${a("defaultFields.default")};
|
|
31
|
+
${a("fileDrops.default")};
|
|
32
|
+
${n && a("fileDrops.dragAccept")};
|
|
33
|
+
${r && k`
|
|
34
|
+
border-color: ${a("defaultFields.variants.danger.borderColor")};
|
|
35
|
+
${a("fileDrops.dragReject")}
|
|
36
|
+
`};
|
|
37
|
+
position: relative;
|
|
38
|
+
display: flex;
|
|
39
|
+
justify-content: center;
|
|
40
|
+
align-items: center;
|
|
41
|
+
padding: md;
|
|
42
|
+
transition: medium;
|
|
43
|
+
${c1};
|
|
44
|
+
|
|
45
|
+
&:focus {
|
|
46
|
+
${a("defaultFields.focused.default")};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
${e && k`
|
|
50
|
+
${a("defaultFields.disabled")};
|
|
51
|
+
${a("fileDrops.disabled")};
|
|
52
|
+
`};
|
|
53
|
+
`
|
|
54
|
+
), P1 = D.div`
|
|
55
|
+
width: 100%;
|
|
56
|
+
height: 100%;
|
|
57
|
+
display: flex;
|
|
58
|
+
flex-direction: column;
|
|
59
|
+
align-items: center;
|
|
60
|
+
justify-content: center;
|
|
61
|
+
`, S = D.imgBox`
|
|
62
|
+
max-height: 100%;
|
|
63
|
+
max-width: 100%;
|
|
64
|
+
object-fit: contain;
|
|
65
|
+
`, _1 = D.div`
|
|
66
|
+
position: absolute;
|
|
67
|
+
top: ${a.space("md")};
|
|
68
|
+
right: ${a.space("md")};
|
|
69
|
+
display: flex;
|
|
70
|
+
gap: xs;
|
|
71
|
+
`, U = ({
|
|
72
|
+
disabled: e,
|
|
73
|
+
fileButtonText: n = "Browse file",
|
|
74
|
+
hint: r = "Drag & drop a file here or",
|
|
75
|
+
openFile: c,
|
|
76
|
+
title: o = "Add file"
|
|
77
|
+
}) => /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(w, { color: "neutral-90", m: "0", variant: "h4" }, o), /* @__PURE__ */ t.createElement(w, { color: "beige-70", m: "0", mt: "xs", variant: "sm" }, r), /* @__PURE__ */ t.createElement($, { disabled: e, mt: "lg", onClick: c, type: "button" }, n)), A1 = ({
|
|
78
|
+
file: e,
|
|
79
|
+
fileName: n,
|
|
80
|
+
forceFileType: r,
|
|
81
|
+
previewButtonText: c = "Preview"
|
|
82
|
+
}) => {
|
|
83
|
+
const o = typeof e == "string", d = l1(e, r), p = e instanceof File ? a1(e) : null, m = o && n ? n : T(e);
|
|
84
|
+
return /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(d, { color: "neutral-90", h: 50, mb: "lg", w: 50 }), /* @__PURE__ */ t.createElement(w, { color: "neutral-90", lines: 1, m: 0, maxWidth: 600, variant: "h4" }, m), !o && /* @__PURE__ */ t.createElement(w, { color: "beige-70", fontWeight: "medium", lines: 1, m: 0, variant: "sm" }, p), o && /* @__PURE__ */ t.createElement($, { as: "a", href: e, mt: "md", rel: "noopener", size: "sm", target: "_blank" }, /* @__PURE__ */ t.createElement("span", null, c), /* @__PURE__ */ t.createElement(o1, null)));
|
|
85
|
+
}, M1 = ({
|
|
86
|
+
disabled: e,
|
|
87
|
+
error: n,
|
|
88
|
+
file: r,
|
|
89
|
+
fileName: c,
|
|
90
|
+
fileUrl: o,
|
|
91
|
+
forceFileType: d,
|
|
92
|
+
isAnImage: p,
|
|
93
|
+
isHoverAccept: m,
|
|
94
|
+
isHoverReject: g,
|
|
95
|
+
openFile: f,
|
|
96
|
+
wordings: E
|
|
97
|
+
}) => m ? /* @__PURE__ */ t.createElement(D1, null) : g ? /* @__PURE__ */ t.createElement(E1, null) : n ? /* @__PURE__ */ t.createElement(U, { openFile: f, ...E }) : o ? p ? /* @__PURE__ */ t.createElement(S, { src: o }) : /* @__PURE__ */ t.createElement(A1, { file: r, fileName: c, forceFileType: d, ...E }) : /* @__PURE__ */ t.createElement(U, { disabled: e, openFile: f, ...E }), O = /\.(jpeg|jpg|gif|png|webp)$/, Z1 = (e) => e ? typeof e == "string" ? !!T(e).match(O) : e.name ? !!e.name.match(O) : !1 : !1, x1 = (e) => {
|
|
98
|
+
let n;
|
|
99
|
+
if (e instanceof File ? n = e.preview : n = e, typeof n != "string" || n.startsWith("blob:"))
|
|
100
|
+
return n;
|
|
101
|
+
if (typeof window < "u")
|
|
102
|
+
try {
|
|
103
|
+
return new URL(n);
|
|
104
|
+
} catch {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
}, z1 = C.useDropzone || C.default.useDropzone, j1 = 2e6, C1 = "ERROR_INVALID_TYPE", N1 = "ERROR_INVALID_SIZE", U1 = r1(
|
|
108
|
+
({
|
|
109
|
+
accept: e = {
|
|
110
|
+
"image/*": []
|
|
111
|
+
},
|
|
112
|
+
children: n = M1,
|
|
113
|
+
dataTestId: r,
|
|
114
|
+
disabled: c,
|
|
115
|
+
fileName: o,
|
|
116
|
+
forceFileType: d,
|
|
117
|
+
handleAddFile: p,
|
|
118
|
+
handleRemoveFile: m,
|
|
119
|
+
isClearable: g,
|
|
120
|
+
isEditable: f,
|
|
121
|
+
maxSize: E = j1,
|
|
122
|
+
multiple: P,
|
|
123
|
+
name: R,
|
|
124
|
+
onBlur: _,
|
|
125
|
+
onChange: h,
|
|
126
|
+
onError: b,
|
|
127
|
+
value: y,
|
|
128
|
+
wordings: V,
|
|
129
|
+
...W
|
|
130
|
+
}, B) => {
|
|
131
|
+
const [i, v] = z(y), [F, L] = z(void 0);
|
|
132
|
+
j(() => {
|
|
133
|
+
v(y);
|
|
134
|
+
}, [y]), j(() => () => i && i instanceof File && URL.revokeObjectURL(i.preview), [i]);
|
|
135
|
+
const H = (u) => {
|
|
136
|
+
const [l] = u;
|
|
137
|
+
l instanceof File && (l.preview = URL.createObjectURL(l)), v(l), L(null);
|
|
138
|
+
const s = N({ name: R, value: l });
|
|
139
|
+
h && h(s), p && p(s);
|
|
140
|
+
}, Y = (u, l) => {
|
|
141
|
+
let s;
|
|
142
|
+
u.map(({ errors: Q }) => {
|
|
143
|
+
Q.map((e1) => {
|
|
144
|
+
const { code: x, message: t1 } = e1;
|
|
145
|
+
x === "file-invalid-type" ? s = C1 : x === "file-too-large" ? s = N1 : s = t1;
|
|
146
|
+
});
|
|
147
|
+
}), v(null), L(s), b && b(s), h && h(l), _ && _();
|
|
148
|
+
}, X = (u) => {
|
|
149
|
+
u.preventDefault(), v(null), L(null);
|
|
150
|
+
const l = N({ name: R, value: null });
|
|
151
|
+
h && h(l), m && m(l);
|
|
152
|
+
}, { getInputProps: q, getRootProps: G, isDragAccept: A, isDragActive: J, isDragReject: M, open: Z } = z1({
|
|
153
|
+
accept: e,
|
|
154
|
+
disabled: c,
|
|
155
|
+
maxSize: E,
|
|
156
|
+
multiple: P,
|
|
157
|
+
noClick: !0,
|
|
158
|
+
onDropAccepted: H,
|
|
159
|
+
onDropRejected: Y
|
|
160
|
+
}), K = (u) => b(u);
|
|
161
|
+
return /* @__PURE__ */ t.createElement(
|
|
162
|
+
k1,
|
|
163
|
+
{
|
|
164
|
+
...G({
|
|
165
|
+
"data-testid": r,
|
|
166
|
+
handleRemoveFile: m,
|
|
167
|
+
isEditable: f,
|
|
168
|
+
isDragActive: J,
|
|
169
|
+
isDragAccept: A,
|
|
170
|
+
isDragReject: M,
|
|
171
|
+
isClearable: g,
|
|
172
|
+
disabled: c,
|
|
173
|
+
ref: B
|
|
174
|
+
}),
|
|
175
|
+
...W
|
|
176
|
+
},
|
|
177
|
+
/* @__PURE__ */ t.createElement(
|
|
178
|
+
"input",
|
|
179
|
+
{
|
|
180
|
+
...q({ disabled: c, multiple: P, name: R, onError: K }),
|
|
181
|
+
style: { display: "block", opacity: 0, height: 0, width: 0 }
|
|
182
|
+
}
|
|
183
|
+
),
|
|
184
|
+
/* @__PURE__ */ t.createElement(P1, null, n({
|
|
185
|
+
disabled: c,
|
|
186
|
+
error: F,
|
|
187
|
+
file: i,
|
|
188
|
+
fileName: o,
|
|
189
|
+
fileUrl: i && x1(i),
|
|
190
|
+
forceFileType: d,
|
|
191
|
+
isAnImage: d === "image" || Z1(i),
|
|
192
|
+
isHoverAccept: A,
|
|
193
|
+
isHoverReject: M,
|
|
194
|
+
openFile: Z,
|
|
195
|
+
wordings: V
|
|
196
|
+
}), !!i && (F || f || g) && /* @__PURE__ */ t.createElement(_1, null, (F || f) && /* @__PURE__ */ t.createElement($, { onClick: Z, shape: "circle", size: "sm", type: "button", variant: "tertiary" }, /* @__PURE__ */ t.createElement(d1, null)), g && /* @__PURE__ */ t.createElement($, { danger: !0, onClick: X, shape: "circle", size: "sm", type: "button" }, /* @__PURE__ */ t.createElement(L1, null))))
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
);
|
|
200
|
+
U1.displayName = "FileDrop";
|
|
201
|
+
const q1 = S;
|
|
202
|
+
export {
|
|
203
|
+
d1 as E,
|
|
204
|
+
U1 as F,
|
|
205
|
+
q1 as I,
|
|
206
|
+
E1 as N,
|
|
207
|
+
D1 as P,
|
|
208
|
+
L1 as T
|
|
209
|
+
};
|