@alixpartners/ui-components 2.4.2 → 2.4.3

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,243 +1,251 @@
1
- import { jsxs as a, jsx as i, Fragment as ne } from "react/jsx-runtime";
2
- import { createContext as se, useId as re, useRef as oe, useState as M, useCallback as F, useEffect as ce, useContext as ae } from "react";
3
- import ue from "../Tooltip/Tooltip.js";
4
- import D from "../Icon/Icon.js";
5
- import x from "../Button/Button.js";
6
- import { c as C } from "../../clsx-OuTLNxxd.js";
7
- import '../../assets/FilePicker.css';const pe = "FilePicker-module__container___knCCi", me = "FilePicker-module__containerMultiple___Psi5u", de = "FilePicker-module__label___al7Xe", _e = "FilePicker-module__required___41Vjd", Fe = "FilePicker-module__labelTooltipIcon___Cc1QF", Ie = "FilePicker-module__helpers___79-g5", he = "FilePicker-module__helperText___ja9Rr", Le = "FilePicker-module__errorMessage___TvHrL", ge = "FilePicker-module__singleFileHelpLinkContainer___mpjUf", ke = "FilePicker-module__singleFileHelpLinkReservedSpace___r8j2b", fe = "FilePicker-module__helpLink___uu45D", Pe = "FilePicker-module__input___cL1Hs", Ne = "FilePicker-module__singleFileContainer___OFSDt", xe = "FilePicker-module__singleFileInputContainer___MOkES", Ce = "FilePicker-module__inputFileName___sMs7R", Te = "FilePicker-module__inputFileNamePlaceholder___-mkDD", be = "FilePicker-module__inputButton___ghLlD", ye = "FilePicker-module__multipleHelpText___5tnnn", De = "FilePicker-module__multipleInputButton___WCJp9", Be = "FilePicker-module__multipleFilesList___Kim0I", Se = "FilePicker-module__multipleFilesListItem___01PDS", He = "FilePicker-module__multipleFilesListItemContent___pKbho", Me = "FilePicker-module__multipleFilesListItemContentData___5GC-C", ve = "FilePicker-module__multipleFilesListItemIconContainer___7sUL5", we = "FilePicker-module__multipleFilesListItemIcon___nfMX9", Ee = "FilePicker-module__multipleFilesListItemText___nPqrL", ze = "FilePicker-module__multipleFilesListItemName___NjHhX", Re = "FilePicker-module__multipleFilesListItemSize___wc8LJ", je = "FilePicker-module__multipleFilesListItemError___x9qkT", Ke = "FilePicker-module__multipleFilesListItemIconError___0RO46", Ve = "FilePicker-module__multipleFilesListItemIconDelete___9Z9Dl", qe = "FilePicker-module__disabled___szMiq", t = {
8
- container: pe,
9
- containerMultiple: me,
10
- label: de,
11
- required: _e,
12
- labelTooltipIcon: Fe,
13
- helpers: Ie,
14
- helperText: he,
15
- errorMessage: Le,
16
- singleFileHelpLinkContainer: ge,
17
- singleFileHelpLinkReservedSpace: ke,
18
- helpLink: fe,
19
- input: Pe,
20
- singleFileContainer: Ne,
21
- singleFileInputContainer: xe,
22
- inputFileName: Ce,
23
- inputFileNamePlaceholder: Te,
24
- inputButton: be,
25
- multipleHelpText: ye,
26
- multipleInputButton: De,
27
- multipleFilesList: Be,
28
- multipleFilesListItem: Se,
29
- multipleFilesListItemContent: He,
30
- multipleFilesListItemContentData: Me,
31
- multipleFilesListItemIconContainer: ve,
32
- multipleFilesListItemIcon: we,
33
- multipleFilesListItemText: Ee,
34
- multipleFilesListItemName: ze,
35
- multipleFilesListItemSize: Re,
36
- multipleFilesListItemError: je,
37
- multipleFilesListItemIconError: Ke,
38
- multipleFilesListItemIconDelete: Ve,
39
- disabled: qe
40
- }, v = se(null);
41
- function u() {
42
- const e = ae(v);
1
+ import { jsxs as c, jsx as t, Fragment as ce } from "react/jsx-runtime";
2
+ import { createContext as ae, useId as pe, useRef as ue, useState as M, useCallback as _, useEffect as me, useContext as de } from "react";
3
+ import _e from "../Tooltip/Tooltip.js";
4
+ import B from "../Icon/Icon.js";
5
+ import y from "../Button/Button.js";
6
+ import { c as D } from "../../clsx-OuTLNxxd.js";
7
+ import '../../assets/FilePicker.css';const Fe = "FilePicker-module__container___knCCi", Ie = "FilePicker-module__containerMultiple___Psi5u", Le = "FilePicker-module__label___al7Xe", he = "FilePicker-module__required___41Vjd", ke = "FilePicker-module__labelTooltipIcon___Cc1QF", ge = "FilePicker-module__helpers___79-g5", fe = "FilePicker-module__helperText___ja9Rr", Ne = "FilePicker-module__errorMessage___TvHrL", Pe = "FilePicker-module__singleFileHelpLinkContainer___mpjUf", Ce = "FilePicker-module__singleFileHelpLinkReservedSpace___r8j2b", Te = "FilePicker-module__helpLink___uu45D", be = "FilePicker-module__input___cL1Hs", xe = "FilePicker-module__singleFileContainer___OFSDt", ye = "FilePicker-module__singleFileInputContainer___MOkES", De = "FilePicker-module__inputFileName___sMs7R", Se = "FilePicker-module__inputFileNamePlaceholder___-mkDD", we = "FilePicker-module__inputButton___ghLlD", Be = "FilePicker-module__multipleHelpText___5tnnn", Re = "FilePicker-module__multipleInputButton___WCJp9", He = "FilePicker-module__multipleFilesList___Kim0I", ve = "FilePicker-module__multipleFilesListItem___01PDS", Me = "FilePicker-module__multipleFilesListItemContent___pKbho", Ae = "FilePicker-module__multipleFilesListItemContentData___5GC-C", Ee = "FilePicker-module__multipleFilesListItemIconContainer___7sUL5", ze = "FilePicker-module__multipleFilesListItemIcon___nfMX9", je = "FilePicker-module__multipleFilesListItemText___nPqrL", Oe = "FilePicker-module__multipleFilesListItemName___NjHhX", Ve = "FilePicker-module__multipleFilesListItemSize___wc8LJ", Ke = "FilePicker-module__multipleFilesListItemError___x9qkT", qe = "FilePicker-module__multipleFilesListItemIconError___0RO46", Xe = "FilePicker-module__multipleFilesListItemAppendedRow___nzls7", $e = "FilePicker-module__multipleFilesListItemIconDelete___9Z9Dl", Ye = "FilePicker-module__disabled___szMiq", i = {
8
+ container: Fe,
9
+ containerMultiple: Ie,
10
+ label: Le,
11
+ required: he,
12
+ labelTooltipIcon: ke,
13
+ helpers: ge,
14
+ helperText: fe,
15
+ errorMessage: Ne,
16
+ singleFileHelpLinkContainer: Pe,
17
+ singleFileHelpLinkReservedSpace: Ce,
18
+ helpLink: Te,
19
+ input: be,
20
+ singleFileContainer: xe,
21
+ singleFileInputContainer: ye,
22
+ inputFileName: De,
23
+ inputFileNamePlaceholder: Se,
24
+ inputButton: we,
25
+ multipleHelpText: Be,
26
+ multipleInputButton: Re,
27
+ multipleFilesList: He,
28
+ multipleFilesListItem: ve,
29
+ multipleFilesListItemContent: Me,
30
+ multipleFilesListItemContentData: Ae,
31
+ multipleFilesListItemIconContainer: Ee,
32
+ multipleFilesListItemIcon: ze,
33
+ multipleFilesListItemText: je,
34
+ multipleFilesListItemName: Oe,
35
+ multipleFilesListItemSize: Ve,
36
+ multipleFilesListItemError: Ke,
37
+ multipleFilesListItemIconError: qe,
38
+ multipleFilesListItemAppendedRow: Xe,
39
+ multipleFilesListItemIconDelete: $e,
40
+ disabled: Ye
41
+ }, A = ae(null);
42
+ function p() {
43
+ const e = de(A);
43
44
  if (!e)
44
45
  throw new Error("FilePicker compound components must be used within a FilePicker.");
45
46
  return e;
46
47
  }
47
- function $e(e) {
48
+ const Ge = (e) => `File size is too large. Must be up to ${e}MB.`, Je = (e) => `The file format is incorrect. Please make sure it is one of the extensions: ${e}.`;
49
+ function Ze(e) {
48
50
  const l = e.name.toLowerCase();
49
51
  return l.includes(".") ? l.split(".").pop() ?? "" : "";
50
52
  }
51
- function Oe({
53
+ function Qe({
52
54
  type: e = "single",
53
- maxFiles: l = 1,
55
+ maxFiles: l = Number.POSITIVE_INFINITY,
54
56
  fileExtensionsAllowed: s,
55
- maxSize: r,
56
- queueFiles: h = !1,
57
- disabled: c = !1,
58
- isUploadDisabled: E = !1,
59
- value: L,
60
- label: z,
61
- required: R = !1,
62
- placeholder: j,
57
+ maxSize: o = Number.POSITIVE_INFINITY,
58
+ queueFiles: I = !1,
59
+ disabled: a = !1,
60
+ isUploadDisabled: z = !1,
61
+ value: h,
62
+ label: j,
63
+ required: O = !1,
64
+ placeholder: V,
63
65
  errorMessage: K,
64
- helpText: V,
65
- helpLink: q,
66
+ maxSizeErrorMessage: k,
67
+ fileExtensionInvalidErrorMessage: g,
68
+ helpText: q,
69
+ helpLink: X,
66
70
  helpLinkText: $,
67
- multipleHelpText: O,
68
- multipleButtonHelpText: A,
69
- labelTooltip: X,
70
- onUpload: _,
71
- onRemoveFile: g,
72
- children: k
71
+ multipleHelpText: Y,
72
+ multipleButtonHelpText: G,
73
+ labelTooltip: J,
74
+ uploadedFileAppendedRow: Z,
75
+ onUpload: d,
76
+ onRemoveFile: f,
77
+ children: N
73
78
  }) {
74
- const B = re(), f = oe(null), [p, P] = M(L ? L.map((n) => ({
79
+ const R = pe(), P = ue(null), [u, C] = M(h ? h.map((n) => ({
75
80
  file: n
76
- })) : []), [J, T] = M(!1), b = s.join(", "), S = s.map((n) => `.${n.replace(/^\./, "")}`).join(","), N = F((n) => {
77
- const o = r ? r * 1024 * 1024 : Number.POSITIVE_INFINITY, m = new Set(s.map((d) => d.toLowerCase().replace(/^\./, "")));
78
- return n.map((d) => {
79
- const le = d.size <= o, ie = m.size === 0 || m.has($e(d));
80
- let y;
81
- const te = r ? `up to ${r}MB` : "";
82
- return le || (y = `File size is too large. Must be ${te}.`), ie || (y = `The file format is incorrect. Please make sure it is one of the extensions: ${b}.`), {
83
- file: d,
84
- error: y
81
+ })) : []), [Q, S] = M(!1), T = s.join(", "), H = s.map((n) => `.${n.replace(/^\./, "")}`).join(","), b = _((n) => {
82
+ const r = o ? o * 1024 * 1024 : Number.POSITIVE_INFINITY, m = new Set(s.map((L) => L.toLowerCase().replace(/^\./, ""))), x = (k == null ? void 0 : k.replace(/\{maxSize\}/g, String(o))) ?? Ge(o), se = (g == null ? void 0 : g.replace(/\{fileExtensionsAllowed\}/g, T)) ?? Je(T);
83
+ return n.map((L) => {
84
+ const oe = L.size <= r, re = m.size === 0 || m.has(Ze(L));
85
+ let w;
86
+ return oe || (w = x), re || (w = se), {
87
+ file: L,
88
+ error: w
85
89
  };
86
90
  });
87
- }, [s, b, r]), H = F((n) => {
88
- const o = p.length;
89
- return T(o + n.length > l), N(n);
90
- }, [l, p.length, N]);
91
- ce(() => {
92
- const n = N(L ?? []);
93
- P(n), T(n.length > l);
94
- }, [L, l, N]);
95
- const Y = F((n) => (n / 1024).toFixed(2) + " KB", []), G = F(() => {
91
+ }, [s, T, o, k, g]), v = _((n) => {
92
+ const r = u.length;
93
+ return S(r + n.length > l), b(n);
94
+ }, [l, u.length, b]);
95
+ me(() => {
96
+ const n = b(h ?? []);
97
+ C(n), S(n.length > l);
98
+ }, [h, l, b]);
99
+ const U = _((n) => (n / 1024).toFixed(2) + " KB", []), W = _(() => {
96
100
  var n;
97
- c || (n = f.current) == null || n.click();
98
- }, [c]), Q = F((n) => {
99
- var o;
100
- c || n.key === "Enter" && ((o = f.current) == null || o.click());
101
- }, [c]), W = F((n) => {
102
- if (c) return;
103
- const o = n.target.files, m = H(Array.from(o ?? []));
104
- if (e === "multiple" && h) {
105
- const d = [...p, ...m];
106
- P(d), _ == null || _(d);
101
+ a || (n = P.current) == null || n.click();
102
+ }, [a]), ee = _((n) => {
103
+ var r;
104
+ a || n.key === "Enter" && ((r = P.current) == null || r.click());
105
+ }, [a]), le = _((n) => {
106
+ if (a) return;
107
+ const r = n.target.files, m = v(Array.from(r ?? []));
108
+ if (e === "multiple" && I) {
109
+ const x = [...u, ...m];
110
+ C(x), d == null || d(x);
107
111
  } else
108
- P(m), _ == null || _(m);
112
+ C(m), d == null || d(m);
109
113
  n.target.value = "";
110
- }, [c, e, h, p, H, _]), Z = F((n) => {
111
- if (c || !p) return;
112
- const o = p.filter((m) => m.file.name !== n);
113
- T(o.length > l), P(o), g == null || g(n);
114
- }, [c, p, l, g]), U = {
115
- id: B,
114
+ }, [a, e, I, u, v, d]), ie = _((n) => {
115
+ if (a || !u) return;
116
+ const r = u.filter((m) => m.file.name !== n);
117
+ S(r.length > l), C(r), f == null || f(n);
118
+ }, [a, u, l, f]), te = {
119
+ id: R,
116
120
  type: e,
117
121
  maxFiles: l,
118
122
  fileExtensionsAllowed: s,
119
- fileExtensionsAllowedText: b,
120
- maxSize: r,
121
- queueFiles: h,
122
- disabled: c,
123
- isUploadDisabled: E,
124
- uploadedFiles: p,
125
- isMaxFilesExceeded: J,
126
- label: z,
127
- required: R,
128
- placeholder: j,
123
+ fileExtensionsAllowedText: T,
124
+ maxSize: o,
125
+ queueFiles: I,
126
+ disabled: a,
127
+ isUploadDisabled: z,
128
+ uploadedFiles: u,
129
+ isMaxFilesExceeded: Q,
130
+ label: j,
131
+ required: O,
132
+ placeholder: V,
129
133
  errorMessage: K,
130
- helpText: V,
131
- helpLink: q,
134
+ helpText: q,
135
+ helpLink: X,
132
136
  helpLinkText: $,
133
- multipleHelpText: O,
134
- multipleButtonHelpText: A,
135
- labelTooltip: X,
136
- accept: S,
137
- inputRef: f,
138
- triggerInput: G,
139
- handleKeyDown: Q,
140
- handleRemoveFile: Z,
141
- displayFileSize: Y
142
- }, ee = k != null && (Array.isArray(k) ? k.length > 0 : !0);
143
- return /* @__PURE__ */ a(v.Provider, { value: U, children: [
144
- /* @__PURE__ */ i("input", { accept: S, multiple: e === "multiple", ref: f, type: "file", id: B, className: t.input, onChange: W }),
145
- /* @__PURE__ */ i("div", { className: C(t.container, e === "multiple" && t.containerMultiple, c && t.disabled), children: ee ? k : /* @__PURE__ */ i(Ae, {}) })
137
+ multipleHelpText: Y,
138
+ multipleButtonHelpText: G,
139
+ labelTooltip: J,
140
+ accept: H,
141
+ inputRef: P,
142
+ triggerInput: W,
143
+ handleKeyDown: ee,
144
+ handleRemoveFile: ie,
145
+ displayFileSize: U,
146
+ uploadedFileAppendedRow: Z
147
+ }, ne = N != null && (Array.isArray(N) ? N.length > 0 : !0);
148
+ return /* @__PURE__ */ c(A.Provider, { value: te, children: [
149
+ /* @__PURE__ */ t("input", { accept: H, multiple: e === "multiple", ref: P, type: "file", id: R, className: i.input, onChange: le }),
150
+ /* @__PURE__ */ t("div", { className: D(i.container, e === "multiple" && i.containerMultiple, a && i.disabled), children: ne ? N : /* @__PURE__ */ t(Ue, {}) })
146
151
  ] });
147
152
  }
148
- function Ae() {
149
- const e = u();
150
- return /* @__PURE__ */ a(ne, { children: [
151
- /* @__PURE__ */ i(I.Label, {}),
152
- e.type === "single" && /* @__PURE__ */ i(I.SingleFileRow, { children: /* @__PURE__ */ i(I.BrowseButton, {}) }),
153
- e.type === "single" && e.uploadedFiles.length > 0 && /* @__PURE__ */ i("span", { className: t.singleFileHelpLinkReservedSpace, children: /* @__PURE__ */ i(I.SingleFileDeleteButton, {}) }),
154
- e.type === "multiple" && /* @__PURE__ */ i(I.BrowseButton, {}),
155
- /* @__PURE__ */ i(I.HelpText, {}),
156
- /* @__PURE__ */ i(I.UploadedFilesList, {})
153
+ function Ue() {
154
+ const e = p();
155
+ return /* @__PURE__ */ c(ce, { children: [
156
+ /* @__PURE__ */ t(F.Label, {}),
157
+ e.type === "single" && /* @__PURE__ */ t(F.SingleFileRow, { children: /* @__PURE__ */ t(F.BrowseButton, {}) }),
158
+ e.type === "single" && e.uploadedFiles.length > 0 && /* @__PURE__ */ t("span", { className: i.singleFileHelpLinkReservedSpace, children: /* @__PURE__ */ t(F.SingleFileDeleteButton, {}) }),
159
+ e.type === "multiple" && /* @__PURE__ */ t(F.BrowseButton, {}),
160
+ /* @__PURE__ */ t(F.HelpText, {}),
161
+ /* @__PURE__ */ t(F.UploadedFilesList, {})
157
162
  ] });
158
163
  }
159
- function Xe({
164
+ function We({
160
165
  children: e
161
166
  }) {
162
- const l = u(), s = e ?? l.label;
163
- return /* @__PURE__ */ a("label", { htmlFor: l.id, onClick: (r) => r.preventDefault(), className: C(t.label, l.type === "multiple" && t.labelMultiple), children: [
164
- /* @__PURE__ */ i("span", { title: l.label, className: t.labelText, children: s }),
165
- l.required && /* @__PURE__ */ i("span", { "aria-hidden": "true", className: t.required, children: "*" }),
166
- l.labelTooltip && /* @__PURE__ */ i(ue, { content: l.labelTooltip.content, size: l.labelTooltip.size, theme: l.labelTooltip.theme, tipSide: l.labelTooltip.tipSide, tipAlignment: l.labelTooltip.tipAlignment, startVisible: l.labelTooltip.startVisible, children: /* @__PURE__ */ i(D, { icon: "ap-icon-info", className: t.labelTooltipIcon }) }),
167
- l.type === "multiple" && l.multipleHelpText && /* @__PURE__ */ i("span", { className: t.multipleHelpText, children: l.multipleHelpText })
167
+ const l = p(), s = e ?? l.label;
168
+ return /* @__PURE__ */ c("label", { htmlFor: l.id, onClick: (o) => o.preventDefault(), className: D(i.label, l.type === "multiple" && i.labelMultiple), children: [
169
+ /* @__PURE__ */ t("span", { title: l.label, className: i.labelText, children: s }),
170
+ l.required && /* @__PURE__ */ t("span", { "aria-hidden": "true", className: i.required, children: "*" }),
171
+ l.labelTooltip && /* @__PURE__ */ t(_e, { content: l.labelTooltip.content, size: l.labelTooltip.size, theme: l.labelTooltip.theme, tipSide: l.labelTooltip.tipSide, tipAlignment: l.labelTooltip.tipAlignment, startVisible: l.labelTooltip.startVisible, children: /* @__PURE__ */ t(B, { icon: "ap-icon-info", className: i.labelTooltipIcon }) }),
172
+ l.type === "multiple" && l.multipleHelpText && /* @__PURE__ */ t("span", { className: i.multipleHelpText, children: l.multipleHelpText })
168
173
  ] });
169
174
  }
170
- function Je({
175
+ function el({
171
176
  children: e,
172
177
  className: l
173
178
  }) {
174
- const s = u();
175
- return s.type === "multiple" ? /* @__PURE__ */ i(x, { type: "secondary", variant: "default", size: "md", icon: "ap-icon-upload", className: C(t.multipleInputButton, l), onClick: s.triggerInput, onKeyDown: s.handleKeyDown, disabled: s.disabled || s.isUploadDisabled, children: /* @__PURE__ */ i("span", { children: e ?? `Browse files ${s.multipleButtonHelpText ?? ""}` }) }) : /* @__PURE__ */ i(x, { type: "tertiary", variant: "default", size: "md", icon: "ap-icon-upload", className: C(t.inputButton, l), tabIndex: -1, disabled: s.disabled || s.isUploadDisabled, onClick: (r) => {
176
- r.preventDefault(), r.stopPropagation(), s.triggerInput();
177
- }, children: /* @__PURE__ */ i("span", { children: e ?? "Browse file" }) });
179
+ const s = p();
180
+ return s.type === "multiple" ? /* @__PURE__ */ t(y, { type: "secondary", variant: "default", size: "md", icon: "ap-icon-upload", className: D(i.multipleInputButton, l), onClick: s.triggerInput, onKeyDown: s.handleKeyDown, disabled: s.disabled || s.isUploadDisabled, children: /* @__PURE__ */ t("span", { children: e ?? `Browse files ${s.multipleButtonHelpText ?? ""}` }) }) : /* @__PURE__ */ t(y, { type: "tertiary", variant: "default", size: "md", icon: "ap-icon-upload", className: D(i.inputButton, l), tabIndex: -1, disabled: s.disabled || s.isUploadDisabled, onClick: (o) => {
181
+ o.preventDefault(), o.stopPropagation(), s.triggerInput();
182
+ }, children: /* @__PURE__ */ t("span", { children: e ?? "Browse file" }) });
178
183
  }
179
- function Ye({
184
+ function ll({
180
185
  children: e
181
186
  }) {
182
- return u().type !== "single" ? null : /* @__PURE__ */ i("div", { className: t.singleFileContainer, children: e });
187
+ return p().type !== "single" ? null : /* @__PURE__ */ t("div", { className: i.singleFileContainer, children: e });
183
188
  }
184
- function Ge({
189
+ function il({
185
190
  children: e
186
191
  }) {
187
- const l = u();
188
- return l.type !== "single" ? null : /* @__PURE__ */ a("div", { tabIndex: l.disabled ? -1 : 0, onClick: l.triggerInput, onKeyDown: l.handleKeyDown, className: t.singleFileInputContainer, children: [
189
- /* @__PURE__ */ i("span", { className: t.inputFileName, children: l.uploadedFiles.length > 0 ? /* @__PURE__ */ i("span", { className: t.inputFileNameText, children: l.uploadedFiles[0].file.name }) : /* @__PURE__ */ i("span", { className: t.inputFileNamePlaceholder, children: l.placeholder }) }),
192
+ const l = p();
193
+ return l.type !== "single" ? null : /* @__PURE__ */ c("div", { tabIndex: l.disabled ? -1 : 0, onClick: l.triggerInput, onKeyDown: l.handleKeyDown, className: i.singleFileInputContainer, children: [
194
+ /* @__PURE__ */ t("span", { className: i.inputFileName, children: l.uploadedFiles.length > 0 ? /* @__PURE__ */ t("span", { className: i.inputFileNameText, children: l.uploadedFiles[0].file.name }) : /* @__PURE__ */ t("span", { className: i.inputFileNamePlaceholder, children: l.placeholder }) }),
190
195
  e
191
196
  ] });
192
197
  }
193
- function Qe() {
194
- return u().type !== "single" ? null : /* @__PURE__ */ i("span", { className: t.singleFileHelpLinkReservedSpace, children: /* @__PURE__ */ i(w, {}) });
198
+ function tl() {
199
+ return p().type !== "single" ? null : /* @__PURE__ */ t("span", { className: i.singleFileHelpLinkReservedSpace, children: /* @__PURE__ */ t(E, {}) });
195
200
  }
196
- function w() {
197
- const e = u();
201
+ function E() {
202
+ const e = p();
198
203
  if (e.type !== "single" || e.uploadedFiles.length === 0) return null;
199
204
  const l = e.uploadedFiles[0].file.name;
200
- return /* @__PURE__ */ i(x, { type: "tertiary", variant: "default", size: "md", icon: "ap-icon-delete", className: t.singleFileDeleteButton, onClick: () => e.handleRemoveFile(l), disabled: e.disabled });
205
+ return /* @__PURE__ */ t(y, { type: "tertiary", variant: "default", size: "md", icon: "ap-icon-delete", className: i.singleFileDeleteButton, onClick: () => e.handleRemoveFile(l), disabled: e.disabled });
201
206
  }
202
- function We() {
203
- var r, h;
204
- const e = u(), l = e.errorMessage || e.isMaxFilesExceeded || e.type === "single" && ((r = e.uploadedFiles[0]) == null ? void 0 : r.error), s = e.type === "single" ? e.errorMessage || ((h = e.uploadedFiles[0]) == null ? void 0 : h.error) : e.errorMessage || (e.isMaxFilesExceeded ? `You can only upload up to ${e.maxFiles} files.` : "");
205
- return e.type === "multiple" && !s ? null : /* @__PURE__ */ a("div", { className: t.helpers, children: [
206
- l ? /* @__PURE__ */ i("span", { title: e.errorMessage, className: t.errorMessage, children: s }) : e.helpText && e.type === "single" && /* @__PURE__ */ i("span", { title: e.helpText, className: t.helperText, children: e.helpText }),
207
- e.type === "single" && e.helpLink && e.helpLinkText && /* @__PURE__ */ a("span", { className: t.singleFileHelpLinkContainer, children: [
208
- /* @__PURE__ */ i("a", { href: e.helpLink, className: t.helpLink, target: "_blank", rel: "noopener noreferrer", tabIndex: e.disabled ? -1 : 0, children: e.helpLinkText }),
209
- /* @__PURE__ */ i("span", { className: t.singleFileHelpLinkReservedSpace })
207
+ function nl() {
208
+ var o, I;
209
+ const e = p(), l = e.errorMessage || e.isMaxFilesExceeded || e.type === "single" && ((o = e.uploadedFiles[0]) == null ? void 0 : o.error), s = e.type === "single" ? e.errorMessage || ((I = e.uploadedFiles[0]) == null ? void 0 : I.error) : e.errorMessage || (e.isMaxFilesExceeded ? `You can only upload up to ${e.maxFiles} files.` : "");
210
+ return e.type === "multiple" && !s ? null : /* @__PURE__ */ c("div", { className: i.helpers, children: [
211
+ l ? /* @__PURE__ */ t("span", { title: e.errorMessage, className: i.errorMessage, children: s }) : e.helpText && e.type === "single" && /* @__PURE__ */ t("span", { title: e.helpText, className: i.helperText, children: e.helpText }),
212
+ e.type === "single" && e.helpLink && e.helpLinkText && /* @__PURE__ */ c("span", { className: i.singleFileHelpLinkContainer, children: [
213
+ /* @__PURE__ */ t("a", { href: e.helpLink, className: i.helpLink, target: "_blank", rel: "noopener noreferrer", tabIndex: e.disabled ? -1 : 0, children: e.helpLinkText }),
214
+ /* @__PURE__ */ t("span", { className: i.singleFileHelpLinkReservedSpace })
210
215
  ] })
211
216
  ] });
212
217
  }
213
- function Ze() {
214
- const e = u();
215
- return e.type !== "multiple" || !e.uploadedFiles.length ? null : /* @__PURE__ */ i("ul", { className: t.multipleFilesList, children: e.uploadedFiles.map((l, s) => /* @__PURE__ */ i("li", { className: t.multipleFilesListItem, children: /* @__PURE__ */ a("div", { className: t.multipleFilesListItemContent, children: [
216
- /* @__PURE__ */ i("span", { className: t.multipleFilesListItemIconContainer, children: /* @__PURE__ */ i(D, { icon: "ap-icon-document", className: t.multipleFilesListItemIcon }) }),
217
- /* @__PURE__ */ a("div", { className: t.multipleFilesListItemContentData, children: [
218
- /* @__PURE__ */ a("div", { className: t.multipleFilesListItemText, children: [
219
- /* @__PURE__ */ i("span", { className: t.multipleFilesListItemName, children: l.file.name }),
220
- /* @__PURE__ */ i("span", { className: t.multipleFilesListItemSize, children: e.displayFileSize(l.file.size) }),
221
- l.error && /* @__PURE__ */ a("span", { className: t.multipleFilesListItemError, children: [
222
- /* @__PURE__ */ i(D, { icon: "ap-icon-alert", className: t.multipleFilesListItemIconError }),
223
- l.error
224
- ] })
225
- ] }),
226
- /* @__PURE__ */ i(x, { type: "tertiary", variant: "default", size: "sm", onClick: () => e.handleRemoveFile(l.file.name), icon: "ap-icon-delete", iconClassName: t.multipleFilesListItemIconDelete, disabled: e.disabled })
227
- ] })
228
- ] }) }, s)) });
218
+ function sl() {
219
+ const e = p();
220
+ return e.type !== "multiple" || !e.uploadedFiles.length ? null : /* @__PURE__ */ t("ul", { className: i.multipleFilesList, children: e.uploadedFiles.map((l, s) => /* @__PURE__ */ c("li", { className: i.multipleFilesListItem, children: [
221
+ /* @__PURE__ */ c("div", { className: i.multipleFilesListItemContent, children: [
222
+ /* @__PURE__ */ t("span", { className: i.multipleFilesListItemIconContainer, children: /* @__PURE__ */ t(B, { icon: "ap-icon-document", className: i.multipleFilesListItemIcon }) }),
223
+ /* @__PURE__ */ c("div", { className: i.multipleFilesListItemContentData, children: [
224
+ /* @__PURE__ */ c("div", { className: i.multipleFilesListItemText, children: [
225
+ /* @__PURE__ */ t("span", { className: i.multipleFilesListItemName, children: l.file.name }),
226
+ /* @__PURE__ */ t("span", { className: i.multipleFilesListItemSize, children: e.displayFileSize(l.file.size) }),
227
+ l.error && /* @__PURE__ */ c("span", { className: i.multipleFilesListItemError, children: [
228
+ /* @__PURE__ */ t(B, { icon: "ap-icon-alert", className: i.multipleFilesListItemIconError }),
229
+ l.error
230
+ ] })
231
+ ] }),
232
+ /* @__PURE__ */ t(y, { type: "tertiary", variant: "default", size: "sm", onClick: () => e.handleRemoveFile(l.file.name), icon: "ap-icon-delete", iconClassName: i.multipleFilesListItemIconDelete, disabled: e.disabled })
233
+ ] })
234
+ ] }),
235
+ e.uploadedFileAppendedRow && /* @__PURE__ */ t("div", { className: i.multipleFilesListItemAppendedRow, children: e.uploadedFileAppendedRow(l, s) })
236
+ ] }, s)) });
229
237
  }
230
- const I = Object.assign(Oe, {
231
- Label: Xe,
232
- BrowseButton: Je,
233
- HelpText: We,
234
- UploadedFilesList: Ze,
235
- SingleFileContainer: Ye,
236
- SingleFileRow: Ge,
237
- SingleFileActions: Qe,
238
- SingleFileDeleteButton: w
238
+ const F = Object.assign(Qe, {
239
+ Label: We,
240
+ BrowseButton: el,
241
+ HelpText: nl,
242
+ UploadedFilesList: sl,
243
+ SingleFileContainer: ll,
244
+ SingleFileRow: il,
245
+ SingleFileActions: tl,
246
+ SingleFileDeleteButton: E
239
247
  });
240
248
  export {
241
- I as default,
242
- u as useFilePickerContext
249
+ F as default,
250
+ p as useFilePickerContext
243
251
  };
@@ -1,5 +1,5 @@
1
1
  import { jsx as i, jsxs as a } from "react/jsx-runtime";
2
- import '../../assets/IconsGallery.css';const c = ["ap-icon-add", "ap-icon-add-bold", "ap-icon-add-filled", "ap-icon-add-outlined", "ap-icon-aggregation", "ap-icon-agreements", "ap-icon-ai", "ap-icon-alert", "ap-icon-alert-filled", "ap-icon-alixpartners", "ap-icon-approved", "ap-icon-ascendant", "ap-icon-at", "ap-icon-attach", "ap-icon-bar", "ap-icon-bold", "ap-icon-book", "ap-icon-bookmark", "ap-icon-bookmark-list", "ap-icon-bookmark-saved", "ap-icon-bottom", "ap-icon-box-collapse", "ap-icon-box-expand", "ap-icon-box-list", "ap-icon-branch", "ap-icon-check", "ap-icon-clock", "ap-icon-clock-filled", "ap-icon-close", "ap-icon-close-bold", "ap-icon-collapse-all", "ap-icon-collapse-filled", "ap-icon-collapse-outlined", "ap-icon-color", "ap-icon-columns", "ap-icon-comment", "ap-icon-copy", "ap-icon-date", "ap-icon-delete", "ap-icon-descendant", "ap-icon-deselect-branch", "ap-icon-deselect-individual", "ap-icon-direction", "ap-icon-document", "ap-icon-document-rpm", "ap-icon-dot", "ap-icon-dot-filled", "ap-icon-down", "ap-icon-download", "ap-icon-drag", "ap-icon-drilldown", "ap-icon-edit", "ap-icon-edit-filled", "ap-icon-expand-all", "ap-icon-expand-filled", "ap-icon-expand-less", "ap-icon-expand-more", "ap-icon-expand-outlined", "ap-icon-expand-section", "ap-icon-export", "ap-icon-filter", "ap-icon-filter-advanced", "ap-icon-financial", "ap-icon-financial-filled", "ap-icon-fit", "ap-icon-flag-filled", "ap-icon-folder", "ap-icon-font-size", "ap-icon-fullscreen", "ap-icon-function", "ap-icon-gantt", "ap-icon-grid", "ap-icon-help", "ap-icon-help-filled", "ap-icon-hide", "ap-icon-hide-source", "ap-icon-history", "ap-icon-idea", "ap-icon-import", "ap-icon-in-progress-filled", "ap-icon-info", "ap-icon-info-filled", "ap-icon-italic", "ap-icon-job", "ap-icon-left", "ap-icon-line", "ap-icon-link", "ap-icon-list", "ap-icon-list-numbered", "ap-icon-location", "ap-icon-logout", "ap-icon-mail", "ap-icon-milestone-filled", "ap-icon-more", "ap-icon-more-horizontal", "ap-icon-new", "ap-icon-new-filled", "ap-icon-next", "ap-icon-notification-filled", "ap-icon-notification-warning", "ap-icon-person", "ap-icon-person-actions", "ap-icon-person-add", "ap-icon-person-add-filled", "ap-icon-person-check", "ap-icon-person-check-filled", "ap-icon-person-filled", "ap-icon-person-group", "ap-icon-person-group-checked", "ap-icon-person-group-checked-filled", "ap-icon-person-group-dashed", "ap-icon-person-group-dashed-filled", "ap-icon-person-group-filled", "ap-icon-person-group-filled-wide", "ap-icon-person-move", "ap-icon-person-move-filled", "ap-icon-person-remove", "ap-icon-person-remove-filled", "ap-icon-phone", "ap-icon-pin", "ap-icon-pin-filled", "ap-icon-present", "ap-icon-previous", "ap-icon-projects", "ap-icon-quote", "ap-icon-radial", "ap-icon-remove", "ap-icon-remove-filled", "ap-icon-remove-outlined", "ap-icon-reply", "ap-icon-reset", "ap-icon-resize", "ap-icon-right", "ap-icon-rotate-left", "ap-icon-rotate-right", "ap-icon-row-height", "ap-icon-screenshot", "ap-icon-search", "ap-icon-select-branch", "ap-icon-select-individual", "ap-icon-send", "ap-icon-settings", "ap-icon-show", "ap-icon-show-filled", "ap-icon-sign", "ap-icon-star", "ap-icon-star-dashed", "ap-icon-star-filled", "ap-icon-strikethrough", "ap-icon-success", "ap-icon-summary", "ap-icon-sync", "ap-icon-table", "ap-icon-top", "ap-icon-tree", "ap-icon-underline", "ap-icon-unpin", "ap-icon-unpin-filled", "ap-icon-up", "ap-icon-upload", "ap-icon-web", "ap-icon-zoom-in", "ap-icon-zoom-out"], p = "IconsGallery-module__grid___oQqfO", e = "IconsGallery-module__icon___7ZdqB", n = {
2
+ import '../../assets/IconsGallery.css';const c = ["ap-icon-add", "ap-icon-add-bold", "ap-icon-add-filled", "ap-icon-add-outlined", "ap-icon-aggregation", "ap-icon-agreements", "ap-icon-ai", "ap-icon-alert", "ap-icon-alert-filled", "ap-icon-alixpartners", "ap-icon-approved", "ap-icon-ascendant", "ap-icon-at", "ap-icon-attach", "ap-icon-bar", "ap-icon-bold", "ap-icon-book", "ap-icon-bookmark", "ap-icon-bookmark-list", "ap-icon-bookmark-saved", "ap-icon-box-collapse", "ap-icon-box-expand", "ap-icon-box-list", "ap-icon-branch", "ap-icon-chapter11", "ap-icon-check", "ap-icon-clock", "ap-icon-clock-filled", "ap-icon-close", "ap-icon-close-bold", "ap-icon-collapse-all", "ap-icon-collapse-filled", "ap-icon-collapse-outlined", "ap-icon-color", "ap-icon-columns", "ap-icon-comment", "ap-icon-copy", "ap-icon-copy-file", "ap-icon-date", "ap-icon-deedi", "ap-icon-delete", "ap-icon-descendant", "ap-icon-deselect-branch", "ap-icon-deselect-individual", "ap-icon-direction", "ap-icon-document", "ap-icon-document-rpm", "ap-icon-dot", "ap-icon-dot-filled", "ap-icon-down", "ap-icon-download", "ap-icon-drag", "ap-icon-drilldown", "ap-icon-edit", "ap-icon-edit-filled", "ap-icon-elevation", "ap-icon-expand-all", "ap-icon-expand-filled", "ap-icon-expand-less", "ap-icon-expand-more", "ap-icon-expand-outlined", "ap-icon-expand-section", "ap-icon-export", "ap-icon-external", "ap-icon-file-csv", "ap-icon-file-docx", "ap-icon-file-pdf", "ap-icon-file-ppt", "ap-icon-file-xls", "ap-icon-filter", "ap-icon-filter-advanced", "ap-icon-financial", "ap-icon-financial-filled", "ap-icon-fit", "ap-icon-flag-filled", "ap-icon-folder", "ap-icon-font-size", "ap-icon-fullscreen", "ap-icon-function", "ap-icon-gantt", "ap-icon-grid", "ap-icon-gto", "ap-icon-help", "ap-icon-help-filled", "ap-icon-hide", "ap-icon-hide-source", "ap-icon-history", "ap-icon-idea", "ap-icon-image", "ap-icon-import", "ap-icon-in-progress-filled", "ap-icon-industry", "ap-icon-info", "ap-icon-info-filled", "ap-icon-italic", "ap-icon-job", "ap-icon-key", "ap-icon-layers", "ap-icon-left", "ap-icon-line", "ap-icon-link", "ap-icon-list", "ap-icon-list-numbered", "ap-icon-location", "ap-icon-lock", "ap-icon-logout", "ap-icon-mail", "ap-icon-milestone-filled", "ap-icon-more", "ap-icon-more-horizontal", "ap-icon-move", "ap-icon-new", "ap-icon-new-filled", "ap-icon-next", "ap-icon-notification-filled", "ap-icon-notification-warning", "ap-icon-person", "ap-icon-person-actions", "ap-icon-person-add", "ap-icon-person-add-filled", "ap-icon-person-check", "ap-icon-person-check-filled", "ap-icon-person-discard", "ap-icon-person-filled", "ap-icon-person-group", "ap-icon-person-group-checked", "ap-icon-person-group-checked-filled", "ap-icon-person-group-dashed", "ap-icon-person-group-dashed-filled", "ap-icon-person-group-filled", "ap-icon-person-group-filled-wide", "ap-icon-person-move", "ap-icon-person-move-filled", "ap-icon-person-remove", "ap-icon-person-remove-filled", "ap-icon-phone", "ap-icon-pin", "ap-icon-pin-filled", "ap-icon-platforms", "ap-icon-present", "ap-icon-previous", "ap-icon-projects", "ap-icon-quote", "ap-icon-radial", "ap-icon-remove", "ap-icon-remove-filled", "ap-icon-remove-outlined", "ap-icon-reply", "ap-icon-reset", "ap-icon-resize", "ap-icon-right", "ap-icon-rotate-left", "ap-icon-rotate-right", "ap-icon-row-height", "ap-icon-rpms", "ap-icon-screenshot", "ap-icon-search", "ap-icon-select-branch", "ap-icon-select-individual", "ap-icon-send", "ap-icon-settings", "ap-icon-settings-filled", "ap-icon-show", "ap-icon-show-filled", "ap-icon-sign", "ap-icon-smart-factory", "ap-icon-star", "ap-icon-star-dashed", "ap-icon-star-filled", "ap-icon-strikethrough", "ap-icon-success", "ap-icon-summary", "ap-icon-sxr", "ap-icon-sync", "ap-icon-table", "ap-icon-tip-bottom", "ap-icon-tip-left", "ap-icon-tip-right", "ap-icon-tip-top", "ap-icon-tree", "ap-icon-underline", "ap-icon-unpin", "ap-icon-unpin-filled", "ap-icon-up", "ap-icon-upload", "ap-icon-web", "ap-icon-working-capital", "ap-icon-zip", "ap-icon-zoom-in", "ap-icon-zoom-out"], p = "IconsGallery-module__grid___oQqfO", e = "IconsGallery-module__icon___7ZdqB", n = {
3
3
  grid: p,
4
4
  icon: e
5
5
  };