@alixpartners/ui-components 2.4.4 → 2.5.1

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.
Files changed (37) hide show
  1. package/dist/assets/Button.css +1 -1
  2. package/dist/assets/Datepicker.css +1 -0
  3. package/dist/assets/DragAndDrop.css +1 -1
  4. package/dist/assets/FilePicker.css +1 -1
  5. package/dist/assets/Illustration.css +1 -0
  6. package/dist/assets/NavBar.css +1 -1
  7. package/dist/assets/illustrations-map.d.ts +18 -0
  8. package/dist/components/Button/Button.d.ts +3 -1
  9. package/dist/components/Button/Button.js +23 -20
  10. package/dist/components/Button/Button.test.js +60 -54
  11. package/dist/components/Creatable/Creatable.js +1 -1
  12. package/dist/components/Datepicker/Datepicker.d.ts +22 -0
  13. package/dist/components/Datepicker/Datepicker.js +228 -0
  14. package/dist/components/Datepicker/Datepicker.test.d.ts +1 -0
  15. package/dist/components/Datepicker/Datepicker.test.js +40 -0
  16. package/dist/components/DragAndDrop/DragAndDrop.d.ts +2 -1
  17. package/dist/components/DragAndDrop/DragAndDrop.js +80 -76
  18. package/dist/components/Dropdown/Dropdown.js +1 -1
  19. package/dist/components/Illustration/Illustration.d.ts +3 -0
  20. package/dist/components/Illustration/Illustration.js +206 -0
  21. package/dist/components/Illustration/Illustration.test.d.ts +1 -0
  22. package/dist/components/Illustration/Illustration.test.js +40 -0
  23. package/dist/components/Illustration/constants.d.ts +34 -0
  24. package/dist/components/Illustration/types.d.ts +22 -0
  25. package/dist/components/Illustration/utils.d.ts +11 -0
  26. package/dist/components/NavBar/NavBar.js +123 -121
  27. package/dist/components/SplitButton/SplitButton.js +1 -1
  28. package/dist/components/TabNavigation/TabNavigation.d.ts +2 -1
  29. package/dist/components/TabNavigation/TabNavigation.js +4 -3
  30. package/dist/components/TagsFields/TagsFields.js +1 -1
  31. package/dist/components/Tooltip/Tooltip.js +1 -1
  32. package/dist/{index-C-3_YVJ1.js → index-D34Qo5Qx.js} +478 -473
  33. package/dist/{index-C4ffg1vf.js → index-DZ4Gof57.js} +1 -1
  34. package/dist/{index-D_3jWVyV.js → index-DgdVwltD.js} +1 -1
  35. package/dist/main.d.ts +2 -0
  36. package/dist/main.js +47 -43
  37. package/package.json +4 -3
@@ -0,0 +1,228 @@
1
+ import { jsxs as m, jsx as o, Fragment as re } from "react/jsx-runtime";
2
+ import { c as T } from "../../clsx-OuTLNxxd.js";
3
+ import { useState as b, useEffect as ce, useMemo as H } from "react";
4
+ import J from "../Button/Button.js";
5
+ import W from "../Icon/Icon.js";
6
+ import le from "../Tooltip/Tooltip.js";
7
+ import { R as de, T as se, P as ie, C as _e } from "../../index-DZ4Gof57.js";
8
+ import '../../assets/Datepicker.css';const ue = "Datepicker-module__datepicker___SxV3q", pe = "Datepicker-module__label___uPuKe", De = "Datepicker-module__labelText___BAflA", me = "Datepicker-module__required___cAVa1", he = "Datepicker-module__labelTooltipIcon___n2IvH", ye = "Datepicker-module__inputWrapper___aKtHi", ge = "Datepicker-module__inputIcon___OUb8V", fe = "Datepicker-module__inputText___rwYA-", ke = "Datepicker-module__placeholder___UVl-W", Me = "Datepicker-module__error___C5WX8", Ne = "Datepicker-module__calendarContainer___Bjfa8", Se = "Datepicker-module__calendarHeader___a7I0V", Te = "Datepicker-module__calendarDivider___DRk4M", Ae = "Datepicker-module__headerActions___AP324", be = "Datepicker-module__headerAction___nyMJF", Fe = "Datepicker-module__headerActionIcon___J8RC-", Ye = "Datepicker-module__headerLabel___IPAo-", we = "Datepicker-module__calendarBody___yaLJA", Oe = "Datepicker-module__weekdays___noAbQ", Ee = "Datepicker-module__weekday___0hrfJ", Ie = "Datepicker-module__grid___lJEHW", Ce = "Datepicker-module__gridMonths___n1wAM", Re = "Datepicker-module__gridYears___cI0YR", ze = "Datepicker-module__day___3XU9S", ve = "Datepicker-module__date___G2cRK", xe = "Datepicker-module__month___VKvm3", Pe = "Datepicker-module__year___9OzXM", Ve = "Datepicker-module__daySelected___DkZ5T", Be = "Datepicker-module__dayOutside___CXb-b", Le = "Datepicker-module__dayTodayCurrent___ocAqU", $e = "Datepicker-module__dayTodayDot___ZyD-l", He = "Datepicker-module__calendarFooter___sLvNP", Je = "Datepicker-module__calendarFooterSpacer___3IXgI", We = "Datepicker-module__todayButton___zl9VO", Xe = "Datepicker-module__helperRow___IKmCq", Ue = "Datepicker-module__helpText___g7zEx", qe = "Datepicker-module__errorText___7o5Rs", Ke = "Datepicker-module__disabled___Hlnlo", e = {
9
+ datepicker: ue,
10
+ label: pe,
11
+ labelText: De,
12
+ required: me,
13
+ labelTooltipIcon: he,
14
+ inputWrapper: ye,
15
+ inputIcon: ge,
16
+ inputText: fe,
17
+ placeholder: ke,
18
+ error: Me,
19
+ calendarContainer: Ne,
20
+ calendarHeader: Se,
21
+ calendarDivider: Te,
22
+ headerActions: Ae,
23
+ headerAction: be,
24
+ headerActionIcon: Fe,
25
+ headerLabel: Ye,
26
+ calendarBody: we,
27
+ weekdays: Oe,
28
+ weekday: Ee,
29
+ grid: Ie,
30
+ gridMonths: Ce,
31
+ gridYears: Re,
32
+ day: ze,
33
+ date: ve,
34
+ month: xe,
35
+ year: Pe,
36
+ daySelected: Ve,
37
+ dayOutside: Be,
38
+ dayTodayCurrent: Le,
39
+ dayTodayDot: $e,
40
+ calendarFooter: He,
41
+ calendarFooterSpacer: Je,
42
+ todayButton: We,
43
+ helperRow: Xe,
44
+ helpText: Ue,
45
+ errorText: qe,
46
+ disabled: Ke
47
+ }, Ge = 7, je = 6, Ze = Ge * je, g = 12, Qe = 1, et = 1, q = 1, I = 1, tt = 1, at = 1, f = 1, nt = 6, ot = "Label", rt = "Today", ct = "ap-icon-date", lt = "ap-icon-info", dt = "ap-icon-expand-more", st = "ap-icon-expand-less", it = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], v = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], _t = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], ut = (t) => {
48
+ if (t instanceof Date)
49
+ return Number.isNaN(t.getTime()) ? null : t;
50
+ if (typeof t == "string" || typeof t == "number") {
51
+ const a = new Date(t);
52
+ return Number.isNaN(a.getTime()) ? null : a;
53
+ }
54
+ return null;
55
+ }, i = (t) => {
56
+ const a = ut(t);
57
+ return a ? new Date(a.getFullYear(), a.getMonth(), a.getDate()) : null;
58
+ }, X = (t, a) => t.getFullYear() === a.getFullYear() && t.getMonth() === a.getMonth() && t.getDate() === a.getDate(), U = (t) => String(t).padStart(2, "0"), pt = (t, a) => {
59
+ const _ = U(t.getMonth() + 1), r = U(t.getDate()), s = t.getFullYear();
60
+ return a === "Mon DD, YYYY" ? `${v[t.getMonth()]} ${r}, ${s}` : a === "YYYY/MM/DD" ? `${s}/${_}/${r}` : `${_}/${r}/${s}`;
61
+ }, Dt = (t, a) => {
62
+ const r = new Date(t, a, f).getDay(), s = new Date(t, a + I, 0).getDate(), D = new Date(t, a, 0).getDate(), c = [];
63
+ for (let l = r - Qe; l >= 0; l -= 1)
64
+ c.push({
65
+ date: new Date(t, a - q, D - l),
66
+ inCurrentMonth: !1
67
+ });
68
+ for (let l = f; l <= s; l += 1)
69
+ c.push({
70
+ date: new Date(t, a, l),
71
+ inCurrentMonth: !0
72
+ });
73
+ for (; c.length < Ze; ) {
74
+ const l = c.length - (r + s) + et;
75
+ c.push({
76
+ date: new Date(t, a + I, l),
77
+ inCurrentMonth: !1
78
+ });
79
+ }
80
+ return c;
81
+ };
82
+ function mt({
83
+ day: t,
84
+ selectedDate: a,
85
+ currentMonth: _,
86
+ minDate: r,
87
+ maxDate: s,
88
+ onSelect: D
89
+ }) {
90
+ const c = i(t.date);
91
+ if (!c) return null;
92
+ const l = r ? i(r) : null, k = s ? i(s) : null, u = !!(l && c < l || k && c > k), h = i(a), M = h ? X(c, h) : !1, y = i(/* @__PURE__ */ new Date()), F = y ? X(c, y) : !1;
93
+ return /* @__PURE__ */ m("button", { type: "button", className: T(e.day, e.date, !t.inCurrentMonth && e.dayOutside, t.date.getMonth() !== _ && e.dayOutside, u && e.dayOutside, F && !M && e.dayTodayCurrent, M && e.daySelected), onClick: () => D(c), disabled: u, children: [
94
+ t.date.getDate(),
95
+ F && !M && /* @__PURE__ */ o("span", { className: e.dayTodayDot })
96
+ ] });
97
+ }
98
+ function ht({
99
+ monthIndex: t,
100
+ activeMonth: a,
101
+ year: _,
102
+ minDate: r,
103
+ maxDate: s,
104
+ onSelect: D
105
+ }) {
106
+ const c = r ? i(r) : null, l = s ? i(s) : null, k = new Date(_, t, f), u = new Date(_, t + I, 0), h = !!(c && u < c || l && k > l);
107
+ return /* @__PURE__ */ o("button", { type: "button", className: T(e.day, e.month, h && e.dayOutside, t === a && e.daySelected), onClick: () => D(t), disabled: h, children: v[t] });
108
+ }
109
+ function yt({
110
+ year: t,
111
+ activeYear: a,
112
+ minDate: _,
113
+ maxDate: r,
114
+ onSelect: s
115
+ }) {
116
+ const D = _ ? i(_) : null, c = r ? i(r) : null, l = new Date(t, 0, f), k = new Date(t, 11, 31), u = !!(D && k < D || c && l > c);
117
+ return /* @__PURE__ */ o("button", { type: "button", className: T(e.day, e.year, u && e.dayOutside, t === a && e.daySelected), onClick: () => s(t), disabled: u, children: t });
118
+ }
119
+ function At({
120
+ className: t,
121
+ label: a = ot,
122
+ placeholder: _ = "",
123
+ value: r,
124
+ defaultValue: s = /* @__PURE__ */ new Date(),
125
+ disabled: D = !1,
126
+ required: c = !1,
127
+ errorMessage: l,
128
+ helpText: k,
129
+ minDate: u,
130
+ maxDate: h,
131
+ onChange: M,
132
+ labelTooltip: y,
133
+ dateFormat: F = "MM/DD/YYYY"
134
+ }) {
135
+ const C = r !== void 0 && !!M, R = i(r), z = i(s), x = i(/* @__PURE__ */ new Date()) ?? /* @__PURE__ */ new Date(), [K, P] = b(!1), [Y, V] = b(() => r === null ? null : R ?? z), [p, S] = b("date"), [d, N] = b(() => r === null ? x : R || z || x), [w, O] = b(Math.floor(d.getFullYear() / g) * g);
136
+ ce(() => {
137
+ if (!C) return;
138
+ const n = i(r);
139
+ V(n), n && (N(n), O(Math.floor(n.getFullYear() / g) * g));
140
+ }, [C, r]);
141
+ const G = Y ? pt(Y, F) : _, E = i(/* @__PURE__ */ new Date()) ?? /* @__PURE__ */ new Date(), B = u ? i(u) : null, L = h ? i(h) : null, j = !!(B && E < B || L && E > L), Z = H(() => Dt(d.getFullYear(), d.getMonth()), [d]), Q = H(() => Array.from({
142
+ length: g
143
+ }, (n, A) => w + A), [w]), ee = (n) => {
144
+ C || V(n), M == null || M(n);
145
+ }, te = () => {
146
+ if (p === "date") {
147
+ S("month");
148
+ return;
149
+ }
150
+ if (p === "month") {
151
+ S("year");
152
+ return;
153
+ }
154
+ }, ae = () => {
155
+ if (p === "date") {
156
+ N(new Date(d.getFullYear(), d.getMonth() - q, f));
157
+ return;
158
+ }
159
+ if (p === "month") {
160
+ N(new Date(d.getFullYear() - tt, d.getMonth(), f));
161
+ return;
162
+ }
163
+ O((n) => n - g);
164
+ }, ne = () => {
165
+ if (p === "date") {
166
+ N(new Date(d.getFullYear(), d.getMonth() + I, f));
167
+ return;
168
+ }
169
+ if (p === "month") {
170
+ N(new Date(d.getFullYear() + at, d.getMonth(), f));
171
+ return;
172
+ }
173
+ O((n) => n + g);
174
+ }, $ = (n) => {
175
+ ee(n), N(n), P(!1), S("date");
176
+ };
177
+ return /* @__PURE__ */ m("div", { className: T(e.datepicker, t, D && e.disabled), children: [
178
+ a && /* @__PURE__ */ m("label", { className: e.label, children: [
179
+ /* @__PURE__ */ o("span", { className: e.labelText, children: a }),
180
+ c && /* @__PURE__ */ o("span", { className: e.required, children: "*" }),
181
+ y && /* @__PURE__ */ o(le, { content: y.content, size: y.size, theme: y.theme, tipSide: y.tipSide, tipAlignment: y.tipAlignment, startVisible: y.startVisible, children: /* @__PURE__ */ o(W, { icon: lt, className: e.labelTooltipIcon }) })
182
+ ] }),
183
+ /* @__PURE__ */ m(de, { open: K, onOpenChange: (n) => {
184
+ D || (P(n), n || S("date"));
185
+ }, children: [
186
+ /* @__PURE__ */ m(se, { className: T(e.inputWrapper, l && e.error), disabled: D, children: [
187
+ /* @__PURE__ */ o(W, { icon: ct, className: e.inputIcon }),
188
+ /* @__PURE__ */ o("span", { className: T(e.inputText, !Y && e.placeholder), children: G })
189
+ ] }),
190
+ /* @__PURE__ */ o(ie, { children: /* @__PURE__ */ m(_e, { side: "bottom", align: "start", sideOffset: nt, className: e.calendarContainer, children: [
191
+ /* @__PURE__ */ m("div", { className: e.calendarHeader, children: [
192
+ /* @__PURE__ */ m("button", { type: "button", className: e.headerLabel, onClick: te, disabled: p === "year", children: [
193
+ p === "date" && `${_t[d.getMonth()]} ${d.getFullYear()}`,
194
+ p === "month" && `${d.getFullYear()}`,
195
+ p === "year" && `${w} - ${w + g - 1}`
196
+ ] }),
197
+ /* @__PURE__ */ m("div", { className: e.headerActions, children: [
198
+ /* @__PURE__ */ o(J, { size: "md", type: "tertiary", className: e.headerAction, icon: st, iconClassName: e.headerActionIcon, onClick: ae }),
199
+ /* @__PURE__ */ o(J, { size: "md", type: "tertiary", className: e.headerAction, icon: dt, iconClassName: e.headerActionIcon, onClick: ne })
200
+ ] })
201
+ ] }),
202
+ /* @__PURE__ */ o("div", { className: e.calendarDivider }),
203
+ /* @__PURE__ */ m("div", { className: e.calendarBody, children: [
204
+ p === "date" && /* @__PURE__ */ m(re, { children: [
205
+ /* @__PURE__ */ o("div", { className: e.weekdays, children: it.map((n) => /* @__PURE__ */ o("span", { className: e.weekday, children: n }, n)) }),
206
+ /* @__PURE__ */ o("div", { className: e.grid, children: Z.map((n) => /* @__PURE__ */ o(mt, { day: n, selectedDate: Y, currentMonth: d.getMonth(), minDate: u, maxDate: h, onSelect: $ }, n.date.toISOString())) })
207
+ ] }),
208
+ p === "month" && /* @__PURE__ */ o("div", { className: e.gridMonths, children: v.map((n, A) => /* @__PURE__ */ o(ht, { monthIndex: A, activeMonth: d.getMonth(), year: d.getFullYear(), minDate: u, maxDate: h, onSelect: (oe) => {
209
+ N(new Date(d.getFullYear(), oe, f)), S("date");
210
+ } }, n)) }),
211
+ p === "year" && /* @__PURE__ */ o("div", { className: e.gridYears, children: Q.map((n) => /* @__PURE__ */ o(yt, { year: n, activeYear: d.getFullYear(), minDate: u, maxDate: h, onSelect: (A) => {
212
+ N(new Date(A, d.getMonth(), f)), S("month");
213
+ } }, n)) })
214
+ ] }),
215
+ /* @__PURE__ */ m("div", { className: e.calendarFooter, children: [
216
+ /* @__PURE__ */ o("div", { className: e.calendarFooterSpacer }),
217
+ /* @__PURE__ */ o("button", { type: "button", className: e.todayButton, disabled: j, onClick: () => {
218
+ $(E), O(Math.floor(E.getFullYear() / g) * g);
219
+ }, children: rt })
220
+ ] })
221
+ ] }) })
222
+ ] }),
223
+ /* @__PURE__ */ o("div", { className: e.helperRow, children: l ? /* @__PURE__ */ o("span", { className: e.errorText, children: l }) : k && /* @__PURE__ */ o("span", { className: e.helpText, children: k }) })
224
+ ] });
225
+ }
226
+ export {
227
+ At as default
228
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,40 @@
1
+ import { jsx as l } from "react/jsx-runtime";
2
+ import { d as u, i as c, r as B, g as e, s as d, f as D, v as m } from "../../vi.bdSIJ99Y-017e_Pkz.js";
3
+ import g from "./Datepicker.js";
4
+ u("Datepicker", () => {
5
+ c("should render datepicker container", () => {
6
+ B(/* @__PURE__ */ l(g, {})), e(d.getByTestId("datepicker")).toBeInTheDocument();
7
+ }), c("should render required marker when required is true", () => {
8
+ B(/* @__PURE__ */ l(g, { label: "Start date", required: !0 })), e(d.getByTestId("datepicker-label")).toHaveTextContent("*");
9
+ }), c("should keep calendar closed and trigger disabled when disabled is true", () => {
10
+ B(/* @__PURE__ */ l(g, { disabled: !0 }));
11
+ const t = d.getByTestId("datepicker-trigger");
12
+ e(t).toBeDisabled(), D.click(t), e(d.queryByTestId("datepicker-calendar")).not.toBeInTheDocument();
13
+ }), c("should disable days outside minDate and maxDate", () => {
14
+ B(/* @__PURE__ */ l(g, { defaultValue: new Date(2025, 0, 15), minDate: new Date(2025, 0, 10), maxDate: new Date(2025, 0, 20) })), D.click(d.getByTestId("datepicker-trigger"));
15
+ const t = d.getAllByTestId("datepicker-day"), r = t.find((i) => {
16
+ var a;
17
+ return ((a = i.textContent) == null ? void 0 : a.trim()) === "9";
18
+ }), n = t.find((i) => {
19
+ var a;
20
+ return ((a = i.textContent) == null ? void 0 : a.trim()) === "10";
21
+ }), o = t.find((i) => {
22
+ var a;
23
+ return ((a = i.textContent) == null ? void 0 : a.trim()) === "20";
24
+ }), s = t.find((i) => {
25
+ var a;
26
+ return ((a = i.textContent) == null ? void 0 : a.trim()) === "21";
27
+ });
28
+ e(r).toBeDefined(), e(n).toBeDefined(), e(o).toBeDefined(), e(s).toBeDefined(), e(r).toBeDisabled(), e(n).not.toBeDisabled(), e(o).not.toBeDisabled(), e(s).toBeDisabled();
29
+ }), c("should call onChange with selected date", () => {
30
+ const t = m.fn();
31
+ B(/* @__PURE__ */ l(g, { defaultValue: new Date(2025, 0, 15), onChange: t })), D.click(d.getByTestId("datepicker-trigger"));
32
+ const r = d.getAllByTestId("datepicker-day").find((o) => {
33
+ var s;
34
+ return !o.className.includes("dayOutside") && ((s = o.textContent) == null ? void 0 : s.trim()) === "16";
35
+ });
36
+ e(r).toBeDefined(), D.click(r), e(t).toHaveBeenCalledTimes(1);
37
+ const n = t.mock.calls[0][0];
38
+ e(n).toBeInstanceOf(Date), e(n.getFullYear()).toBe(2025), e(n.getMonth()).toBe(0), e(n.getDate()).toBe(16);
39
+ });
40
+ });
@@ -38,6 +38,7 @@ type DragAndDropProps = {
38
38
  disabled?: boolean;
39
39
  label?: string;
40
40
  required?: boolean;
41
+ errorMessage?: string;
41
42
  fileExtensionsAllowed: string[];
42
43
  maxSize?: number;
43
44
  maxFiles?: number;
@@ -93,5 +94,5 @@ type DragAndDropProps = {
93
94
  * @param {boolean} [props.queueFiles] - When true, newly selected files are appended to the existing list
94
95
  * @returns {JSX.Element} The rendered DragAndDrop component
95
96
  */
96
- export default function DragAndDrop({ label, type, disabled, required, fileExtensionsAllowed, maxSize, maxFiles, value, onUpload, onRemoveFile, queueFiles, className, maxSizeErrorMessage, fileExtensionInvalidErrorMessage, texts, fileIcon, errorIcon, deleteIcon, browseButtonIcon, renderFileItem, fileSizeFormatter, browseButtonProps, validator, errors: externalErrors, ...props }: DragAndDropProps): import("react/jsx-runtime").JSX.Element;
97
+ export default function DragAndDrop({ label, type, disabled, required, errorMessage, fileExtensionsAllowed, maxSize, maxFiles, value, onUpload, onRemoveFile, queueFiles, className, maxSizeErrorMessage, fileExtensionInvalidErrorMessage, texts, fileIcon, errorIcon, deleteIcon, browseButtonIcon, renderFileItem, fileSizeFormatter, browseButtonProps, validator, errors: externalErrors, ...props }: DragAndDropProps): import("react/jsx-runtime").JSX.Element;
97
98
  export {};
@@ -1,17 +1,19 @@
1
1
  import { jsxs as _, jsx as t } from "react/jsx-runtime";
2
- import { useId as vr, useRef as Lr, useState as J, useCallback as g, useMemo as A } from "react";
3
- import K from "../Button/Button.js";
4
- import { c as U } from "../../clsx-OuTLNxxd.js";
5
- import x from "../Icon/Icon.js";
6
- import '../../assets/DragAndDrop.css';const Cr = "DragAndDrop-module__disabled___h47do", br = "DragAndDrop-module__required___z3cHB", Or = "DragAndDrop-module__active___ZMuEx", d = {
2
+ import { useId as Cr, useRef as Or, useState as U, useCallback as g, useMemo as A } from "react";
3
+ import x from "../Button/Button.js";
4
+ import { c as rr } from "../../clsx-OuTLNxxd.js";
5
+ import er from "../Icon/Icon.js";
6
+ import '../../assets/DragAndDrop.css';const br = "DragAndDrop-module__disabled___h47do", Br = "DragAndDrop-module__required___z3cHB", Sr = "DragAndDrop-module__active___ZMuEx", wr = "DragAndDrop-module__error___zw69d", d = {
7
7
  "drag-and-drop-container": "DragAndDrop-module__drag-and-drop-container___WHqGh",
8
- disabled: Cr,
9
- required: br,
8
+ disabled: br,
9
+ required: Br,
10
10
  "drag-and-drop-space-text-message": "DragAndDrop-module__drag-and-drop-space-text-message___fL-Ac",
11
11
  "drag-and-drop-space-text-constraints": "DragAndDrop-module__drag-and-drop-space-text-constraints___YrL7J",
12
12
  "drag-and-drop-space": "DragAndDrop-module__drag-and-drop-space___09a0I",
13
- active: Or,
13
+ active: Sr,
14
+ error: wr,
14
15
  "drag-and-drop-space-text": "DragAndDrop-module__drag-and-drop-space-text___-8rqC",
16
+ "error-message": "DragAndDrop-module__error-message___om0Oy",
15
17
  "drag-and-drop-files-list": "DragAndDrop-module__drag-and-drop-files-list___7WNCk",
16
18
  "drag-and-drop-files-list-item": "DragAndDrop-module__drag-and-drop-files-list-item___vQO6M",
17
19
  "drag-and-drop-files-list-item-content": "DragAndDrop-module__drag-and-drop-files-list-item-content___lx7-M",
@@ -24,12 +26,13 @@ import '../../assets/DragAndDrop.css';const Cr = "DragAndDrop-module__disabled__
24
26
  "drag-and-drop-files-list-item-error": "DragAndDrop-module__drag-and-drop-files-list-item-error___yR0DY",
25
27
  "drag-and-drop-files-list-item-icon-error": "DragAndDrop-module__drag-and-drop-files-list-item-icon-error___17EE-",
26
28
  "drag-and-drop-files-list-item-icon-delete": "DragAndDrop-module__drag-and-drop-files-list-item-icon-delete___Z1l-B"
27
- }, Br = (u) => `File size is too large. Must be up to ${u}MB.`, Sr = (u) => `The file format is incorrect. Please make sure it is one of the extensions: ${u}.`;
28
- function Rr({
29
+ }, Er = (u) => `File size is too large. Must be up to ${u}MB.`, $r = (u) => `The file format is incorrect. Please make sure it is one of the extensions: ${u}.`;
30
+ function Pr({
29
31
  label: u,
30
- type: i = "single",
31
- disabled: q,
32
- required: rr,
32
+ type: o = "single",
33
+ disabled: y,
34
+ required: ar,
35
+ errorMessage: b,
33
36
  fileExtensionsAllowed: c,
34
37
  maxSize: p = Number.POSITIVE_INFINITY,
35
38
  maxFiles: l = Number.POSITIVE_INFINITY,
@@ -37,22 +40,22 @@ function Rr({
37
40
  onUpload: m,
38
41
  onRemoveFile: I,
39
42
  queueFiles: P,
40
- className: er,
43
+ className: nr,
41
44
  maxSizeErrorMessage: T,
42
45
  fileExtensionInvalidErrorMessage: v,
43
46
  texts: a,
44
- fileIcon: ar = "ap-icon-document",
45
- errorIcon: nr = "ap-icon-alert",
46
- deleteIcon: dr = "ap-icon-delete",
47
- browseButtonIcon: ir,
47
+ fileIcon: dr = "ap-icon-document",
48
+ errorIcon: or = "ap-icon-alert",
49
+ deleteIcon: ir = "ap-icon-delete",
50
+ browseButtonIcon: sr,
48
51
  renderFileItem: V,
49
- fileSizeFormatter: O,
50
- browseButtonProps: or,
51
- validator: B,
52
+ fileSizeFormatter: B,
53
+ browseButtonProps: tr,
54
+ validator: S,
52
55
  errors: L,
53
- ...sr
56
+ ...lr
54
57
  }) {
55
- const j = vr(), y = Lr(null), [C, Y] = J([]), [G, S] = J(!1), h = D !== void 0, M = c.join(", "), X = p ? `up to ${p}MB` : "", tr = c.map((r) => `.${r.replace(/^\./, "")}`).join(","), Z = g((r, e) => {
58
+ const j = Cr(), Y = Or(null), [C, G] = U([]), [X, w] = U(!1), h = D !== void 0, Z = c.join(", "), H = p ? `up to ${p}MB` : "", cr = c.map((r) => `.${r.replace(/^\./, "")}`).join(","), M = g((r, e) => {
56
59
  if (!r) return r || "";
57
60
  if (a != null && a.errors && e) {
58
61
  if (e === "SIZE_TOO_LARGE" && a.errors.sizeTooLarge)
@@ -61,51 +64,51 @@ function Rr({
61
64
  return typeof a.errors.invalidExtension == "function" ? a.errors.invalidExtension(c) : a.errors.invalidExtension;
62
65
  }
63
66
  return r;
64
- }, [a, p, c]), lr = g(() => a != null && a.browse ? typeof a.browse == "function" ? a.browse(i) : a.browse : i === "single" ? "Browse file" : "Browse files", [a, i]), cr = g(() => a != null && a.drag ? typeof a.drag == "function" ? a.drag(i) : a.drag : i === "single" ? "or drag your file" : "or drag multiple files", [a, i]), _r = g(() => a != null && a.constraints ? a.constraints({
67
+ }, [a, p, c]), _r = g(() => a != null && a.browse ? typeof a.browse == "function" ? a.browse(o) : a.browse : o === "single" ? "Browse file" : "Browse files", [a, o]), gr = g(() => a != null && a.drag ? typeof a.drag == "function" ? a.drag(o) : a.drag : o === "single" ? "or drag your file" : "or drag multiple files", [a, o]), pr = g(() => a != null && a.constraints ? a.constraints({
65
68
  extensions: c,
66
69
  maxSize: p,
67
- type: i
68
- }) : `${M} ${i === "single" ? "file" : "files"} ${X}`, [a, c, M, p, X, i]), gr = () => {
70
+ type: o
71
+ }) : `${Z} ${o === "single" ? "file" : "files"} ${H}`, [a, c, Z, p, H, o]), mr = () => {
69
72
  var r;
70
- N || (r = y.current) == null || r.click();
71
- }, $ = A(() => new Set(c.map((r) => r.toLowerCase().replace(/^\./, ""))), [c]), H = g((r, e) => {
72
- const s = e.maxSize ? e.maxSize * 1024 * 1024 : Number.POSITIVE_INFINITY, o = e.fileExtensionsAllowed.join(", "), f = (T == null ? void 0 : T.replace(/\{maxSize\}/g, String(e.maxSize))) ?? Br(e.maxSize), Nr = (v == null ? void 0 : v.replace(/\{fileExtensionsAllowed\}/g, o)) ?? Sr(o), Ar = r.size <= s, Q = r.name.toLowerCase(), Ir = Q.includes(".") ? Q.split(".").pop() ?? "" : "", Tr = $.size === 0 || $.has(Ir);
73
- return Ar ? Tr ? {
73
+ N || (r = Y.current) == null || r.click();
74
+ }, E = A(() => new Set(c.map((r) => r.toLowerCase().replace(/^\./, ""))), [c]), W = g((r, e) => {
75
+ const s = e.maxSize ? e.maxSize * 1024 * 1024 : Number.POSITIVE_INFINITY, i = e.fileExtensionsAllowed.join(", "), f = (T == null ? void 0 : T.replace(/\{maxSize\}/g, String(e.maxSize))) ?? Er(e.maxSize), Ir = (v == null ? void 0 : v.replace(/\{fileExtensionsAllowed\}/g, i)) ?? $r(i), Tr = r.size <= s, K = r.name.toLowerCase(), vr = K.includes(".") ? K.split(".").pop() ?? "" : "", Lr = E.size === 0 || E.has(vr);
76
+ return Tr ? Lr ? {
74
77
  file: r
75
78
  } : {
76
79
  file: r,
77
- error: Nr,
80
+ error: Ir,
78
81
  errorCode: "INVALID_EXTENSION"
79
82
  } : {
80
83
  file: r,
81
84
  error: f,
82
85
  errorCode: "SIZE_TOO_LARGE"
83
86
  };
84
- }, [$, T, v]), k = A(() => ({
87
+ }, [E, T, v]), $ = A(() => ({
85
88
  maxSize: p,
86
89
  fileExtensionsAllowed: c,
87
- type: i,
90
+ type: o,
88
91
  maxFiles: l
89
- }), [p, c, i, l]), b = g((r) => {
92
+ }), [p, c, o, l]), O = g((r) => {
90
93
  let e;
91
- B ? e = r.map((o) => B(o, k)) : e = r.map((o) => H(o, k));
92
- let s = e.map((o) => {
93
- const f = o.error ? Z(o.error, o.errorCode) : void 0;
94
+ S ? e = r.map((i) => S(i, $)) : e = r.map((i) => W(i, $));
95
+ let s = e.map((i) => {
96
+ const f = i.error ? M(i.error, i.errorCode) : void 0;
94
97
  return {
95
- file: o.file,
98
+ file: i.file,
96
99
  // Don't merge external errors here - that happens in files useMemo
97
100
  error: f
98
101
  };
99
102
  });
100
- return i === "single" && s.length > 1 ? s.slice(0, 1) : (l && l > 0 && s.length > l && (s = s.map((o, f) => f < l ? o : {
101
- ...o,
102
- error: o.error ?? `Maximum ${l} file${l === 1 ? "" : "s"} allowed.`
103
+ return o === "single" && s.length > 1 ? s.slice(0, 1) : (l && l > 0 && s.length > l && (s = s.map((i, f) => f < l ? i : {
104
+ ...i,
105
+ error: i.error ?? `Maximum ${l} file${l === 1 ? "" : "s"} allowed.`
103
106
  })), s);
104
- }, [i, l, B, k, Z, H]), n = A(() => {
107
+ }, [o, l, S, $, M, W]), n = A(() => {
105
108
  let r;
106
109
  if (h) {
107
110
  const e = Array.isArray(D) ? D : D ? [D] : [];
108
- r = b(e);
111
+ r = O(e);
109
112
  } else
110
113
  r = C;
111
114
  return r.map((e) => ({
@@ -113,71 +116,72 @@ function Rr({
113
116
  // Validator errors take precedence over external errors
114
117
  error: e.error ?? (L == null ? void 0 : L[e.file.name])
115
118
  }));
116
- }, [h, D, b, C, L]), pr = g((r) => O ? O(r) : (r / 1024).toFixed(2) + " KB", [O]), N = A(() => q || (n == null ? void 0 : n.length) >= l || i === "single" && (n == null ? void 0 : n.length) > 0, [q, n, l, i]), W = g((r) => {
117
- const e = b(r);
119
+ }, [h, D, O, C, L]), fr = g((r) => B ? B(r) : (r / 1024).toFixed(2) + " KB", [B]), N = A(() => y || (n == null ? void 0 : n.length) >= l || o === "single" && (n == null ? void 0 : n.length) > 0, [y, n, l, o]), F = !!b, Q = g((r) => {
120
+ const e = O(r);
118
121
  if (h)
119
122
  m == null || m(e);
120
123
  else {
121
124
  const s = P ? [...C, ...e] : e;
122
- Y(s), m == null || m(s);
125
+ G(s), m == null || m(s);
123
126
  }
124
- }, [b, h, P, C, m]), mr = (r) => {
127
+ }, [O, h, P, C, m]), ur = (r) => {
125
128
  if (!r.target.files) return;
126
129
  const e = Array.from(r.target.files);
127
- W(e), r.target.value = "";
128
- }, w = g((r) => {
130
+ Q(e), r.target.value = "";
131
+ }, k = g((r) => {
129
132
  if (!(n != null && n.length) || r < 0 || r >= n.length) return;
130
- const e = n[r], s = n.filter((o, f) => f !== r);
131
- h || Y(s), I == null || I(e.file, s);
132
- }, [h, n, I]), F = A(() => new Map(n.map((r, e) => [e, () => w(e)])), [n, w]), {
133
- onDragOver: E,
134
- onDragLeave: z,
135
- onDrop: R,
136
- ...fr
137
- } = sr, ur = (r) => {
138
- N || (r.preventDefault(), G || S(!0), E == null || E(r));
139
- }, Dr = (r) => {
140
- r.preventDefault(), S(!1), z == null || z(r);
141
- }, hr = (r) => {
133
+ const e = n[r], s = n.filter((i, f) => f !== r);
134
+ h || G(s), I == null || I(e.file, s);
135
+ }, [h, n, I]), J = A(() => new Map(n.map((r, e) => [e, () => k(e)])), [n, k]), {
136
+ onDragOver: z,
137
+ onDragLeave: R,
138
+ onDrop: q,
139
+ ...Dr
140
+ } = lr, hr = (r) => {
141
+ N || (r.preventDefault(), X || w(!0), z == null || z(r));
142
+ }, Nr = (r) => {
143
+ r.preventDefault(), w(!1), R == null || R(r);
144
+ }, Ar = (r) => {
142
145
  if (N) return;
143
146
  r.preventDefault();
144
147
  const e = Array.from(r.dataTransfer.files);
145
- W(e), r.dataTransfer.clearData(), S(!1), R == null || R(r);
148
+ Q(e), r.dataTransfer.clearData(), w(!1), q == null || q(r);
146
149
  };
147
- return /* @__PURE__ */ _("div", { className: U(d["drag-and-drop-container"], N && d.disabled, er), ...fr, children: [
150
+ return /* @__PURE__ */ _("div", { className: rr(d["drag-and-drop-container"], N && d.disabled, nr), ...Dr, children: [
148
151
  u && /* @__PURE__ */ _("label", { htmlFor: j, children: [
149
152
  u,
150
- rr && /* @__PURE__ */ t("span", { "aria-hidden": "true", className: d.required, children: "*" })
153
+ ar && /* @__PURE__ */ t("span", { "aria-hidden": "true", className: d.required, children: "*" })
151
154
  ] }),
152
- /* @__PURE__ */ _("div", { className: U(d["drag-and-drop-space"], G && d.active), onDragOver: ur, onDragLeave: Dr, onDrop: hr, children: [
153
- /* @__PURE__ */ t(K, { type: "secondary", variant: "default", size: "sm", ...or, disabled: N, onClick: gr, icon: ir, children: lr() }),
154
- /* @__PURE__ */ t("input", { id: j, ref: y, type: "file", style: {
155
+ /* @__PURE__ */ _("div", { className: rr(d["drag-and-drop-space"], X && d.active, F && d.error), onDragOver: hr, onDragLeave: Nr, onDrop: Ar, children: [
156
+ /* @__PURE__ */ t(x, { type: "secondary", variant: "default", size: "sm", ...tr, disabled: N, onClick: mr, icon: sr, children: _r() }),
157
+ /* @__PURE__ */ t("input", { id: j, ref: Y, type: "file", style: {
155
158
  display: "none"
156
- }, multiple: i === "multiple", accept: tr, onChange: mr }),
159
+ }, multiple: o === "multiple", accept: cr, onChange: ur }),
157
160
  /* @__PURE__ */ _("div", { className: d["drag-and-drop-space-text"], children: [
158
- /* @__PURE__ */ t("span", { className: d["drag-and-drop-space-text-message"], children: cr() }),
161
+ /* @__PURE__ */ t("span", { className: d["drag-and-drop-space-text-message"], children: gr() }),
159
162
  /* @__PURE__ */ _("span", { className: d["drag-and-drop-space-text-constraints"], children: [
160
163
  " ",
161
- _r()
164
+ pr()
162
165
  ] })
163
166
  ] })
164
167
  ] }),
165
- (n == null ? void 0 : n.length) > 0 && /* @__PURE__ */ t("ul", { className: d["drag-and-drop-files-list"], children: n == null ? void 0 : n.map((r, e) => V ? /* @__PURE__ */ t("li", { children: V(r, e, F.get(e) ?? (() => w(e))) }, e) : /* @__PURE__ */ t("li", { className: d["drag-and-drop-files-list-item"], children: /* @__PURE__ */ _("div", { className: d["drag-and-drop-files-list-item-content"], children: [
166
- /* @__PURE__ */ t("span", { className: d["drag-and-drop-files-list-item-icon-container"], children: /* @__PURE__ */ t(x, { icon: ar, className: d["drag-and-drop-files-list-item-icon"] }) }),
168
+ F && /* @__PURE__ */ t("span", { title: b, className: d["error-message"], children: b }),
169
+ (n == null ? void 0 : n.length) > 0 && /* @__PURE__ */ t("ul", { className: d["drag-and-drop-files-list"], children: n == null ? void 0 : n.map((r, e) => V ? /* @__PURE__ */ t("li", { children: V(r, e, J.get(e) ?? (() => k(e))) }, e) : /* @__PURE__ */ t("li", { className: d["drag-and-drop-files-list-item"], children: /* @__PURE__ */ _("div", { className: d["drag-and-drop-files-list-item-content"], children: [
170
+ /* @__PURE__ */ t("span", { className: d["drag-and-drop-files-list-item-icon-container"], children: /* @__PURE__ */ t(er, { icon: dr, className: d["drag-and-drop-files-list-item-icon"] }) }),
167
171
  /* @__PURE__ */ _("div", { className: d["drag-and-drop-files-list-item-content-data"], children: [
168
172
  /* @__PURE__ */ _("div", { className: d["drag-and-drop-files-list-item-text"], children: [
169
173
  /* @__PURE__ */ t("span", { className: d["drag-and-drop-files-list-item-name"], children: r.file.name }),
170
- /* @__PURE__ */ t("span", { className: d["drag-and-drop-files-list-item-size"], children: pr(r.file.size) }),
174
+ /* @__PURE__ */ t("span", { className: d["drag-and-drop-files-list-item-size"], children: fr(r.file.size) }),
171
175
  r.error && /* @__PURE__ */ _("span", { className: d["drag-and-drop-files-list-item-error"], children: [
172
- /* @__PURE__ */ t(x, { icon: nr, className: d["drag-and-drop-files-list-item-icon-error"] }),
176
+ /* @__PURE__ */ t(er, { icon: or, className: d["drag-and-drop-files-list-item-icon-error"] }),
173
177
  r.error
174
178
  ] })
175
179
  ] }),
176
- /* @__PURE__ */ t(K, { type: "tertiary", variant: "default", size: "sm", onClick: F.get(e), icon: dr, iconClassName: d["drag-and-drop-files-list-item-icon-delete"], "aria-label": `Remove ${r.file.name}` })
180
+ /* @__PURE__ */ t(x, { type: "tertiary", variant: "default", size: "sm", onClick: J.get(e), icon: ir, iconClassName: d["drag-and-drop-files-list-item-icon-delete"], "aria-label": `Remove ${r.file.name}` })
177
181
  ] })
178
182
  ] }) }, e)) })
179
183
  ] });
180
184
  }
181
185
  export {
182
- Rr as default
186
+ Pr as default
183
187
  };
@@ -7,7 +7,7 @@ import ne from "../Button/Button.js";
7
7
  import re from "../Ghost/Ghost.js";
8
8
  import Me from "../Search/Search.js";
9
9
  import Se from "../Tooltip/Tooltip.js";
10
- import { R as Ve, T as Re, P as Ee, C as Fe } from "../../index-C4ffg1vf.js";
10
+ import { R as Ve, T as Re, P as Ee, C as Fe } from "../../index-DZ4Gof57.js";
11
11
  import '../../assets/Dropdown.css';const We = "Dropdown-module__dropdownContainer___beNhQ", qe = "Dropdown-module__dropdownLabel___T9FmB", Je = "Dropdown-module__dropdownLabelDisabled___SLRmM", ze = "Dropdown-module__required___ChI1m", Ge = "Dropdown-module__dropdownWrapper___AUuWD", Be = "Dropdown-module__dropdownTrigger___Rue93", Ue = "Dropdown-module__dropdownTriggerDisabled___63wkd", je = "Dropdown-module__dropdownTriggerOpen___cbm8V", Pe = "Dropdown-module__placeholder___fWdch", Ye = "Dropdown-module__selectedOptionLabel___7Zdh3", $e = "Dropdown-module__dropdownSelectedItems___iXnpQ", Ze = "Dropdown-module__dropdownTriggerError___Uu02x", Qe = "Dropdown-module__dropdownContent___zLMhL", Ke = "Dropdown-module__dropdownActions___d55Fa", Xe = "Dropdown-module__dropdownArrow___dLbrb", He = "Dropdown-module__dropdownArrowOpen___Z4Nh1", eo = "Dropdown-module__dropdownMenu___toYcy", oo = "Dropdown-module__dropdownMenuToolbar___gFne0", no = "Dropdown-module__searchContainer___4kUvD", ro = "Dropdown-module__search___JmgDx", to = "Dropdown-module__optionsList___rk2hi", lo = "Dropdown-module__categoryGroup___Np2bP", so = "Dropdown-module__categoryDivider___Gh6F0", io = "Dropdown-module__categoryLabel___B9IDR", co = "Dropdown-module__optionItem___7pi10", ao = "Dropdown-module__optionItemDisabled___aepUD", po = "Dropdown-module__optionItemFocused___u2781", _o = "Dropdown-module__optionContent___nf1VC", uo = "Dropdown-module__optionLabel___sJerM", mo = "Dropdown-module__tickIcon___hYdCr", wo = "Dropdown-module__noOptions___8vmhM", fo = "Dropdown-module__helpers___s4ulA", ho = "Dropdown-module__helpText___YooJE", Do = "Dropdown-module__helpTextDisabled___Ct4qq", bo = "Dropdown-module__helpLink___-Zwpq", go = "Dropdown-module__helpLinkDisabled___r-opC", No = "Dropdown-module__errorMessage___3Mopi", vo = "Dropdown-module__selectAllContainer___Dlk3J", Lo = "Dropdown-module__actionButtons___-2nvr", o = {
12
12
  dropdownContainer: We,
13
13
  dropdownLabel: qe,
@@ -0,0 +1,3 @@
1
+ import { IllustrationCategory, IllustrationLevel, IllustrationName, IllustrationProps } from './types';
2
+ export default function Illustration(props: IllustrationProps): import("react/jsx-runtime").JSX.Element | null;
3
+ export type { IllustrationCategory, IllustrationLevel, IllustrationName, IllustrationProps };