@sps-woodland/file-upload 8.33.9 → 8.34.0

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/lib/index.js CHANGED
@@ -1,8 +1,9 @@
1
1
  import * as e from "react";
2
- import { Metadata as _e, I18nContext as fe, cl as B, Spinner as ue } from "@sps-woodland/core";
3
- import { parseFileSize as me, code as _ } from "@spscommerce/utils";
4
- import { Button as I } from "@sps-woodland/buttons";
5
- import { GENERAL_ERROR_LARGE as he, UPLOAD_LARGE as ve } from "@sps-woodland/illustrations";
2
+ import { Metadata as _e, cl as B, Spinner as fe } from "@sps-woodland/core";
3
+ import { parseFileSize as ue, code as _ } from "@spscommerce/utils";
4
+ import { Button as L } from "@sps-woodland/buttons";
5
+ import { GENERAL_ERROR_LARGE as me, UPLOAD_LARGE as he } from "@sps-woodland/illustrations";
6
+ import { useWoodlandLanguage as ve } from "@spscommerce/i18n";
6
7
  const R = {
7
8
  "7Z": ["application/x-7z-compressed"],
8
9
  AAC: ["audio/aac"],
@@ -88,7 +89,7 @@ function we(a, i, l) {
88
89
  writable: !0
89
90
  }) : a[i] = l, a;
90
91
  }
91
- function L(a, i) {
92
+ function I(a, i) {
92
93
  var l = Object.keys(a);
93
94
  if (Object.getOwnPropertySymbols) {
94
95
  var t = Object.getOwnPropertySymbols(a);
@@ -101,9 +102,9 @@ function L(a, i) {
101
102
  function W(a) {
102
103
  for (var i = 1; i < arguments.length; i++) {
103
104
  var l = arguments[i] != null ? arguments[i] : {};
104
- i % 2 ? L(Object(l), !0).forEach(function(t) {
105
+ i % 2 ? I(Object(l), !0).forEach(function(t) {
105
106
  we(a, t, l[t]);
106
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(l)) : L(Object(l)).forEach(function(t) {
107
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(l)) : I(Object(l)).forEach(function(t) {
107
108
  Object.defineProperty(a, t, Object.getOwnPropertyDescriptor(l, t));
108
109
  });
109
110
  }
@@ -133,7 +134,7 @@ var ge = (a, i, l) => {
133
134
  for (var [F, k] of a.compoundVariants)
134
135
  ge(F, t, a.defaultVariants) && (l += " " + k);
135
136
  return l;
136
- }, Fe = C({ defaultClassName: "pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jw0", variantClassNames: { active: { true: "pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jw1", false: "pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jw2" }, mini: { true: "pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jw3", false: "pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jw4" }, error: { true: "pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jw5", false: "pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jw6" }, shown: { true: "pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jw7", false: "pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jw8" }, disabled: { true: "pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jw9", false: "pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwa" } }, defaultVariants: { active: !1, mini: !1, error: !1, shown: !0, disabled: !1 }, compoundVariants: [] }), xe = C({ defaultClassName: "pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwb", variantClassNames: { constrainContentWidth: { true: "pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwc", false: "pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwd" }, disabled: { true: "pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwe", false: "pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwf" } }, defaultVariants: { constrainContentWidth: !1, disabled: !1 }, compoundVariants: [] }), z = "pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwg", be = C({ defaultClassName: "pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwh", variantClassNames: { mini: { true: "pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwi", false: "pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwj" }, error: { true: "pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwk", false: "pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwl" }, disabled: { true: "pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwm", false: "pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwn" } }, defaultVariants: { mini: !1, error: !1, disabled: !1 }, compoundVariants: [] }), ye = C({ defaultClassName: "pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwo", variantClassNames: { mini: { true: "pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwp", false: "pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwq" } }, defaultVariants: { mini: !1 }, compoundVariants: [] }), Ee = "pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwr", Ue = "pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jws", G = "pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwt", Se = "pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwu", je = "pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwv", Ce = "pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jww", ke = "pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwx", De = "pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwy";
137
+ }, Fe = C({ defaultClassName: "pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jw0", variantClassNames: { active: { true: "pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jw1", false: "pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jw2" }, mini: { true: "pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jw3", false: "pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jw4" }, error: { true: "pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jw5", false: "pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jw6" }, shown: { true: "pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jw7", false: "pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jw8" }, disabled: { true: "pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jw9", false: "pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwa" } }, defaultVariants: { active: !1, mini: !1, error: !1, shown: !0, disabled: !1 }, compoundVariants: [] }), xe = C({ defaultClassName: "pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwb", variantClassNames: { constrainContentWidth: { true: "pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwc", false: "pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwd" }, disabled: { true: "pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwe", false: "pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwf" } }, defaultVariants: { constrainContentWidth: !1, disabled: !1 }, compoundVariants: [] }), z = "pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwg", be = C({ defaultClassName: "pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwh", variantClassNames: { mini: { true: "pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwi", false: "pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwj" }, error: { true: "pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwk", false: "pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwl" }, disabled: { true: "pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwm", false: "pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwn" } }, defaultVariants: { mini: !1, error: !1, disabled: !1 }, compoundVariants: [] }), Ee = C({ defaultClassName: "pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwo", variantClassNames: { mini: { true: "pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwp", false: "pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwq" } }, defaultVariants: { mini: !1 }, compoundVariants: [] }), Ue = "pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwr", ye = "pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jws", G = "pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwt", Se = "pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwu", je = "pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwv", Ce = "pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jww", ke = "pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwx", De = "pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwy";
137
138
  function X({
138
139
  constrainContentWidth: a,
139
140
  description: i,
@@ -154,7 +155,7 @@ function X({
154
155
  children: Ne,
155
156
  ...q
156
157
  }) {
157
- const b = e.useRef(/* @__PURE__ */ new Set()), [H, T] = e.useState(x), [Te, J] = e.useState([]), [K, Y] = e.useState(""), [P, $] = e.useState(), [Q, y] = e.useState(!1), [g, E] = e.useState(!1), [U, A] = e.useState([]), [V, ee] = e.useState(""), { t: h } = e.useContext(fe), S = (l ? h("design-system:fileUpload.instructions_plural", { defaultValue: "Drag and drop your files here or |browse for files| on your desktop." }) : h("design-system:fileUpload.instructions", { defaultValue: "Drag and drop your file here or |browse for a file| on your desktop." })).split("|"), M = i || (l ? "Files" : "File"), f = e.useRef(null);
158
+ const b = e.useRef(/* @__PURE__ */ new Set()), [H, T] = e.useState(x), [Te, J] = e.useState([]), [K, Y] = e.useState(""), [P, $] = e.useState(), [Q, E] = e.useState(!1), [g, U] = e.useState(!1), [y, A] = e.useState([]), [V, ee] = e.useState(""), { t: h } = ve(), S = (l ? h("fileUpload.instructions.other", { defaultValue: "Drag and drop your files here or |browse for files| on your desktop." }) : h("fileUpload.instructions.one", { defaultValue: "Drag and drop your file here or |browse for a file| on your desktop." })).split("|"), M = i || (l ? "Files" : "File"), f = e.useRef(null);
158
159
  e.useEffect(() => {
159
160
  x && T(x);
160
161
  }, [x]), e.useEffect(() => {
@@ -167,7 +168,7 @@ function X({
167
168
  }
168
169
  function ae(o) {
169
170
  try {
170
- $(me(o));
171
+ $(ue(o));
171
172
  } catch {
172
173
  throw new Error(`Could not parse "${o}" as a file size.`);
173
174
  }
@@ -190,10 +191,10 @@ function X({
190
191
  const u = Array.from(o);
191
192
  for (const r of u)
192
193
  r === null ? s.push("Not a file") : (p && !b.current.has(r.type) && s.push(r.name), d && P && r.size > P && s.indexOf(r.name) === -1 && s.push(r.name));
193
- s.length ? (E(!0), f.current && f.current.value && (f.current.value = "")) : (J(u), k(u)), A(s);
194
+ s.length ? (U(!0), f.current && f.current.value && (f.current.value = "")) : (J(u), k(u)), A(s);
194
195
  }
195
196
  function te(o) {
196
- o.preventDefault(), E(!1), f.current && f.current.click();
197
+ o.preventDefault(), U(!1), f.current && f.current.click();
197
198
  }
198
199
  function ie() {
199
200
  N && N();
@@ -202,16 +203,16 @@ function X({
202
203
  o.stopPropagation(), D(o.target.files || []), f.current && f.current.value && (f.current.value = "");
203
204
  }
204
205
  function se(o) {
205
- o.preventDefault(), o.stopPropagation(), y(!0), E(!1);
206
+ o.preventDefault(), o.stopPropagation(), E(!0), U(!1);
206
207
  }
207
208
  function re(o) {
208
- o.preventDefault(), y(!0), E(!1);
209
+ o.preventDefault(), E(!0), U(!1);
209
210
  }
210
211
  function pe(o) {
211
- o.preventDefault(), y(!1);
212
+ o.preventDefault(), E(!1);
212
213
  }
213
214
  function de(o) {
214
- o.preventDefault(), o.stopPropagation(), y(!1), o.dataTransfer.items ? D(
215
+ o.preventDefault(), o.stopPropagation(), E(!1), o.dataTransfer.items ? D(
215
216
  Array.from(o.dataTransfer.items).map(
216
217
  (s) => s.getAsFile()
217
218
  )
@@ -231,26 +232,26 @@ function X({
231
232
  className: B(Fe({ active: Q, mini: v, error: g, shown: H, disabled: c }), Z),
232
233
  ...q
233
234
  },
234
- /* @__PURE__ */ e.createElement("div", { className: B(xe({ constrainContentWidth: a, disabled: c })) }, n ? /* @__PURE__ */ e.createElement("div", null, /* @__PURE__ */ e.createElement(ue, { size: "md", "aria-hidden": "true" }), /* @__PURE__ */ e.createElement("div", { className: z }, h("design-system:fileUpload.processing", { defaultValue: "Processing Upload..." }))) : /* @__PURE__ */ e.createElement("div", null, /* @__PURE__ */ e.createElement("div", { className: be({ mini: v, error: g, disabled: c }), "aria-hidden": "true" }, /* @__PURE__ */ e.createElement(
235
+ /* @__PURE__ */ e.createElement("div", { className: B(xe({ constrainContentWidth: a, disabled: c })) }, n ? /* @__PURE__ */ e.createElement("div", null, /* @__PURE__ */ e.createElement(fe, { size: "md", "aria-hidden": "true" }), /* @__PURE__ */ e.createElement("div", { className: z }, h("fileUpload.processing", { defaultValue: "Processing Upload..." }))) : /* @__PURE__ */ e.createElement("div", null, /* @__PURE__ */ e.createElement("div", { className: be({ mini: v, error: g, disabled: c }), "aria-hidden": "true" }, /* @__PURE__ */ e.createElement(
235
236
  "img",
236
237
  {
237
238
  className: De,
238
- src: g ? he : ve,
239
+ src: g ? me : he,
239
240
  alt: "Upload Icon"
240
241
  }
241
- )), /* @__PURE__ */ e.createElement("div", { className: ye({ mini: v }) }, g ? /* @__PURE__ */ e.createElement("div", null, h(
242
- U.length > 1 ? "design-system:fileUpload.cancelled_plural" : "design-system:fileUpload.cancelled",
243
- { defaultValue: U.length > 1 ? "File Upload(s) Failed" : "File Upload Failed" }
244
- )) : /* @__PURE__ */ e.createElement("div", null, h("design-system:fileUpload.title", { description: M, defaultValue: `Upload your ${M}` }))), g ? /* @__PURE__ */ e.createElement("div", { className: Ee }, new Set(
245
- U.map((o, s) => {
242
+ )), /* @__PURE__ */ e.createElement("div", { className: Ee({ mini: v }) }, g ? /* @__PURE__ */ e.createElement("div", null, h(
243
+ y.length > 1 ? "fileUpload.cancelled.other" : "fileUpload.cancelled.one",
244
+ { defaultValue: y.length > 1 ? "File Upload(s) Failed" : "File Upload Failed" }
245
+ )) : /* @__PURE__ */ e.createElement("div", null, h("fileUpload.title", { description: M, defaultValue: `Upload your ${M}` }))), g ? /* @__PURE__ */ e.createElement("div", { className: Ue }, new Set(
246
+ y.map((o, s) => {
246
247
  const u = Math.floor(o.length / 2);
247
- return /* @__PURE__ */ e.createElement("div", { className: Ue, key: o }, /* @__PURE__ */ e.createElement("span", { className: G }, o.substr(0, u)), /* @__PURE__ */ e.createElement("div", { className: G }, /* @__PURE__ */ e.createElement("span", null, o.substr(u))), s < U.length - 1 ? "," : "");
248
+ return /* @__PURE__ */ e.createElement("div", { className: ye, key: o }, /* @__PURE__ */ e.createElement("span", { className: G }, o.substr(0, u)), /* @__PURE__ */ e.createElement("div", { className: G }, /* @__PURE__ */ e.createElement("span", null, o.substr(u))), s < y.length - 1 ? "," : "");
248
249
  })
249
- )) : /* @__PURE__ */ e.createElement("span", null), /* @__PURE__ */ e.createElement("div", { className: z }, /* @__PURE__ */ e.createElement("div", null, /* @__PURE__ */ e.createElement("span", null, S[0]), c ? /* @__PURE__ */ e.createElement("u", null, S[1]) : /* @__PURE__ */ e.createElement("a", { href: "", onClick: te }, S[1]), /* @__PURE__ */ e.createElement("span", null, S[2]))), /* @__PURE__ */ e.createElement("div", { className: Se }, p ? /* @__PURE__ */ e.createElement("span", null, "(", " ", h("design-system:fileUpload.acceptedTypes", {
250
+ )) : /* @__PURE__ */ e.createElement("span", null), /* @__PURE__ */ e.createElement("div", { className: z }, /* @__PURE__ */ e.createElement("div", null, /* @__PURE__ */ e.createElement("span", null, S[0]), c ? /* @__PURE__ */ e.createElement("u", null, S[1]) : /* @__PURE__ */ e.createElement("a", { href: "", onClick: te }, S[1]), /* @__PURE__ */ e.createElement("span", null, S[2]))), /* @__PURE__ */ e.createElement("div", { className: Se }, p ? /* @__PURE__ */ e.createElement("span", null, "(", " ", h("fileUpload.acceptedTypes", {
250
251
  fileTypes: V,
251
252
  defaultValue: `${V} format accepted`
252
- }), " ", ")") : "", d ? /* @__PURE__ */ e.createElement("span", null, "( ", h("design-system:fileUpload.maximumSize", { size: d, defaultValue: `${d} maximum` }), " )") : "", F ? /* @__PURE__ */ e.createElement("span", null, " ", F, " ") : ""), w && /* @__PURE__ */ e.createElement("div", { className: je }, /* @__PURE__ */ e.createElement(
253
- I,
253
+ }), " ", ")") : "", d ? /* @__PURE__ */ e.createElement("span", null, "( ", h("fileUpload.maximumSize", { size: d, defaultValue: `${d} maximum` }), " )") : "", F ? /* @__PURE__ */ e.createElement("span", null, " ", F, " ") : ""), w && /* @__PURE__ */ e.createElement("div", { className: je }, /* @__PURE__ */ e.createElement(
254
+ L,
254
255
  {
255
256
  disabled: c,
256
257
  kind: "link",
@@ -260,12 +261,12 @@ function X({
260
261
  w
261
262
  )))),
262
263
  t && !n && /* @__PURE__ */ e.createElement("div", { className: Ce }, /* @__PURE__ */ e.createElement(
263
- I,
264
+ L,
264
265
  {
265
266
  disabled: c,
266
267
  kind: "icon",
267
268
  icon: "x",
268
- title: h("design-system:fileUpload.close", { defaultValue: "Close" }),
269
+ title: h("fileUpload.close", { defaultValue: "Close" }),
269
270
  onClick: oe
270
271
  }
271
272
  )),
@@ -553,10 +554,10 @@ const Oe = {
553
554
  }
554
555
  }
555
556
  }
556
- }, Be = {
557
+ }, Le = {
557
558
  "File Upload": Oe
558
559
  };
559
560
  export {
560
561
  X as FileUpload,
561
- Be as MANIFEST
562
+ Le as MANIFEST
562
563
  };
package/lib/index.umd.cjs CHANGED
@@ -1,4 +1,4 @@
1
- (function(n,g){typeof exports=="object"&&typeof module<"u"?g(exports,require("react"),require("@sps-woodland/core"),require("@spscommerce/utils"),require("@sps-woodland/buttons"),require("@sps-woodland/illustrations")):typeof define=="function"&&define.amd?define(["exports","react","@sps-woodland/core","@spscommerce/utils","@sps-woodland/buttons","@sps-woodland/illustrations"],g):(n=typeof globalThis<"u"?globalThis:n||self,g(n.FileUpload={},n.React,n.core,n.utils,n.buttons,n.illustrations))})(this,function(n,g,F,p,A,M){"use strict";function J(o){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const l in o)if(l!=="default"){const t=Object.getOwnPropertyDescriptor(o,l);Object.defineProperty(i,l,t.get?t:{enumerable:!0,get:()=>o[l]})}}return i.default=o,Object.freeze(i)}const e=J(g),V={"7Z":["application/x-7z-compressed"],AAC:["audio/aac"],ABW:["application/x-abiword"],ARC:["application/octet-stream"],AVI:["video/x-msvideo"],AZW:["application/vnd.amazon.ebook"],BIN:["application/octet-stream"],BMP:["image/bmp"],BZ:["application/x-bzip"],BZ2:["application/x-bzip2"],CER:["application/pkix-cert","application/x-x509-ca-cert"],CSH:["application/x-csh"],CSS:["text/css"],CSV:["text/csv","application/vnd.ms-excel"],DOC:["application/msword"],DOCX:["application/vnd.openxmlformats-officedocument.wordprocessingml.document"],EML:["application/octet-stream","message/rfc822","multipart/mixed","message/rfc5322","message/rfc6532"],EOT:["application/vnd.ms-fontobject"],EPUB:["application/epub+zip"],ES:["application/ecmascript"],FLV:["video/x-flv"],GIF:["image/gif"],GZ:["application/x-gzip"],HTM:["text/html"],HTML:["text/html"],ICO:["image/x-icon"],ICS:["text/calendar"],JAR:["application/java-archive"],JPEG:["image/jpeg"],JPG:["image/jpeg"],JS:["application/javascript"],JSON:["application/json"],M3U:["audio/x-mpequrl"],MID:["audio/midi"],MIDI:["audio/midi"],MOV:["video/quicktime"],MP3:["audio/mpeg3"],MP4:["video/mp4"],MPEG:["video/mpeg"],MPKG:["application/vnd.apple.installer+xml"],ODP:["application/vnd.oasis.opendocument.presentation"],ODS:["application/vnd.oasis.opendocument.spreadsheet"],ODT:["application/vnd.oasis.opendocument.text"],OGA:["audio/ogg"],OGV:["video/ogg"],OGX:["application/ogg"],OTF:["font/otf"],PNG:["image/png"],PDF:["application/pdf"],PPT:["application/vnd.ms-powerpoint"],PPTX:["application/vnd.openxmlformats-officedocument.presentationml.presentation"],RAR:["application/x-rar-compressed"],RTF:["application/rtf"],SH:["application/x-sh"],SVG:["image/svg+xml"],SWF:["application/x-shockwave-flash"],TAR:["application/x-tar"],TIF:["image/tiff"],TIFF:["image/tiff"],TS:["application/typescript"],TTF:["font/ttf"],TXT:["text/plain"],VSD:["application/vnd.visio"],WAV:["audio/wav"],WEBA:["audio/webm"],WEBM:["video/webm"],WEBP:["image/webp"],WOFF:["font/woff"],WOFF2:["font/woff2"],XHTML:["application/xhtml+xml"],XLS:["application/vnd.ms-excel"],XLSX:["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],XML:["application/xml"],XUL:["application/vnd.mozilla.xul+xml"],ZIP:["application/zip"]};function K(o,i,l){return i in o?Object.defineProperty(o,i,{value:l,enumerable:!0,configurable:!0,writable:!0}):o[i]=l,o}function B(o,i){var l=Object.keys(o);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(o);i&&(t=t.filter(function(s){return Object.getOwnPropertyDescriptor(o,s).enumerable})),l.push.apply(l,t)}return l}function I(o){for(var i=1;i<arguments.length;i++){var l=arguments[i]!=null?arguments[i]:{};i%2?B(Object(l),!0).forEach(function(t){K(o,t,l[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(l)):B(Object(l)).forEach(function(t){Object.defineProperty(o,t,Object.getOwnPropertyDescriptor(l,t))})}return o}var Y=(o,i,l)=>{for(var t of Object.keys(o)){var s;if(o[t]!==((s=i[t])!==null&&s!==void 0?s:l[t]))return!1}return!0},b=o=>i=>{var l=o.defaultClassName,t=I(I({},o.defaultVariants),i);for(var s in t){var v,x=(v=t[s])!==null&&v!==void 0?v:o.defaultVariants[s];if(x!=null){var c=x;typeof c=="boolean"&&(c=c===!0?"true":"false");var _=o.variantClassNames[s][c];_&&(l+=" "+_)}}for(var[E,N]of o.compoundVariants)Y(E,t,o.defaultVariants)&&(l+=" "+N);return l},$=b({defaultClassName:"pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jw0",variantClassNames:{active:{true:"pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jw1",false:"pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jw2"},mini:{true:"pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jw3",false:"pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jw4"},error:{true:"pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jw5",false:"pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jw6"},shown:{true:"pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jw7",false:"pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jw8"},disabled:{true:"pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jw9",false:"pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwa"}},defaultVariants:{active:!1,mini:!1,error:!1,shown:!0,disabled:!1},compoundVariants:[]}),Q=b({defaultClassName:"pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwb",variantClassNames:{constrainContentWidth:{true:"pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwc",false:"pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwd"},disabled:{true:"pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwe",false:"pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwf"}},defaultVariants:{constrainContentWidth:!1,disabled:!1},compoundVariants:[]}),R="pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwg",ee=b({defaultClassName:"pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwh",variantClassNames:{mini:{true:"pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwi",false:"pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwj"},error:{true:"pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwk",false:"pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwl"},disabled:{true:"pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwm",false:"pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwn"}},defaultVariants:{mini:!1,error:!1,disabled:!1},compoundVariants:[]}),oe=b({defaultClassName:"pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwo",variantClassNames:{mini:{true:"pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwp",false:"pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwq"}},defaultVariants:{mini:!1},compoundVariants:[]}),ae="pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwr",le="pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jws",L="pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwt",te="pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwu",ie="pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwv",ne="pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jww",se="pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwx",re="pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwy";function T({constrainContentWidth:o,description:i,multiple:l=!1,dismissable:t,processing:s,mini:v,downloadLabel:x,acceptExtensions:c,maxSize:_,customRequirement:E,onSelection:N,onDismiss:z,download:W,shown:U,className:de,disabled:f,children:De,...ce}){const S=e.useRef(new Set),[_e,G]=e.useState(U),[Te,fe]=e.useState([]),[ue,me]=e.useState(""),[X,he]=e.useState(),[we,j]=e.useState(!1),[y,C]=e.useState(!1),[k,q]=e.useState([]),[Z,ve]=e.useState(""),{t:w}=e.useContext(F.I18nContext),O=(l?w("design-system:fileUpload.instructions_plural",{defaultValue:"Drag and drop your files here or |browse for files| on your desktop."}):w("design-system:fileUpload.instructions",{defaultValue:"Drag and drop your file here or |browse for a file| on your desktop."})).split("|"),H=i||(l?"Files":"File"),u=e.useRef(null);e.useEffect(()=>{U&&G(U)},[U]),e.useEffect(()=>{_&&Fe(_)},[_]),e.useEffect(()=>{c&&xe(c)},[c]);function ge(){t&&(G(!1),z&&z())}function Fe(a){try{he(p.parseFileSize(a))}catch{throw new Error(`Could not parse "${a}" as a file size.`)}}function xe(a){const m=(Array.isArray(a)?a:a.trim().split(/\s?,\s?/)).map(h=>h.replace(/^\./,"")),d=m.map(h=>`.${h}`.toLowerCase());ve(d.map((h,D)=>D>0&&D===d.length-1?`or ${h}`:h).join(d.length>2?", ":" ")),S.current.clear();for(const h of m){const D=Object.keys(V).includes(h.toUpperCase())?V[h.toUpperCase()]:[];for(const ke of D)S.current.add(ke)}me(d.concat(Array.from(S.current)).join(","))}function P(a){q([]);let r=[];const m=Array.from(a);for(const d of m)d===null?r.push("Not a file"):(c&&!S.current.has(d.type)&&r.push(d.name),_&&X&&d.size>X&&r.indexOf(d.name)===-1&&r.push(d.name));r.length?(C(!0),u.current&&u.current.value&&(u.current.value="")):(fe(m),N(m)),q(r)}function ye(a){a.preventDefault(),C(!1),u.current&&u.current.click()}function be(){W&&W()}function Ee(a){a.stopPropagation(),P(a.target.files||[]),u.current&&u.current.value&&(u.current.value="")}function Ue(a){a.preventDefault(),a.stopPropagation(),j(!0),C(!1)}function Se(a){a.preventDefault(),j(!0),C(!1)}function je(a){a.preventDefault(),j(!1)}function Ce(a){a.preventDefault(),a.stopPropagation(),j(!1),a.dataTransfer.items?P(Array.from(a.dataTransfer.items).map(r=>r.getAsFile())):P(a.dataTransfer.files)}return e.createElement("div",{onDrop:f?()=>{}:Ce,onDragOver:f?()=>{}:Ue,onDragLeave:f?()=>{}:je,onDragEnter:f?()=>{}:Se,className:F.cl($({active:we,mini:v,error:y,shown:_e,disabled:f}),de),...ce},e.createElement("div",{className:F.cl(Q({constrainContentWidth:o,disabled:f}))},s?e.createElement("div",null,e.createElement(F.Spinner,{size:"md","aria-hidden":"true"}),e.createElement("div",{className:R},w("design-system:fileUpload.processing",{defaultValue:"Processing Upload..."}))):e.createElement("div",null,e.createElement("div",{className:ee({mini:v,error:y,disabled:f}),"aria-hidden":"true"},e.createElement("img",{className:re,src:y?M.GENERAL_ERROR_LARGE:M.UPLOAD_LARGE,alt:"Upload Icon"})),e.createElement("div",{className:oe({mini:v})},y?e.createElement("div",null,w(k.length>1?"design-system:fileUpload.cancelled_plural":"design-system:fileUpload.cancelled",{defaultValue:k.length>1?"File Upload(s) Failed":"File Upload Failed"})):e.createElement("div",null,w("design-system:fileUpload.title",{description:H,defaultValue:`Upload your ${H}`}))),y?e.createElement("div",{className:ae},new Set(k.map((a,r)=>{const m=Math.floor(a.length/2);return e.createElement("div",{className:le,key:a},e.createElement("span",{className:L},a.substr(0,m)),e.createElement("div",{className:L},e.createElement("span",null,a.substr(m))),r<k.length-1?",":"")}))):e.createElement("span",null),e.createElement("div",{className:R},e.createElement("div",null,e.createElement("span",null,O[0]),f?e.createElement("u",null,O[1]):e.createElement("a",{href:"",onClick:ye},O[1]),e.createElement("span",null,O[2]))),e.createElement("div",{className:te},c?e.createElement("span",null,"("," ",w("design-system:fileUpload.acceptedTypes",{fileTypes:Z,defaultValue:`${Z} format accepted`})," ",")"):"",_?e.createElement("span",null,"( ",w("design-system:fileUpload.maximumSize",{size:_,defaultValue:`${_} maximum`})," )"):"",E?e.createElement("span",null," ",E," "):""),x&&e.createElement("div",{className:ie},e.createElement(A.Button,{disabled:f,kind:"link",icon:"download-cloud",onClick:be},x)))),t&&!s&&e.createElement("div",{className:ne},e.createElement(A.Button,{disabled:f,kind:"icon",icon:"x",title:w("design-system:fileUpload.close",{defaultValue:"Close"}),onClick:ge})),e.createElement("form",{className:se},e.createElement("input",{ref:u,type:"file",accept:ue||"*/*",multiple:l||void 0,onChange:Ee})))}F.Metadata.set(T,{name:"FileUpload",props:{constrainContentWidth:{type:"boolean"},description:{type:"string"},multiple:{type:"boolean"},dismissable:{type:"boolean"},mini:{type:"boolean"},downloadLabel:{type:"string"},acceptExtensions:{type:"string[] | string"},maxSize:{type:"string"},customRequirement:{type:"string"},onSelection:{type:"(files: File[]) => void",required:!0},dismissal:{type:"() => void"},download:{type:"() => void"},disabled:{type:"boolean"}}});const pe={"File Upload":{components:[T],examples:{basic:{label:"Basic File Upload",description:"Simply allow the user to drag-and-drop or select a single file or multiple files at once.",examples:{basic:{description:"Single file upload",react:p.code`
1
+ (function(n,g){typeof exports=="object"&&typeof module<"u"?g(exports,require("react"),require("@sps-woodland/core"),require("@spscommerce/utils"),require("@sps-woodland/buttons"),require("@sps-woodland/illustrations"),require("@spscommerce/i18n")):typeof define=="function"&&define.amd?define(["exports","react","@sps-woodland/core","@spscommerce/utils","@sps-woodland/buttons","@sps-woodland/illustrations","@spscommerce/i18n"],g):(n=typeof globalThis<"u"?globalThis:n||self,g(n.FileUpload={},n.React,n.core,n.utils,n.buttons,n.illustrations,n.i18n))})(this,function(n,g,b,p,A,M,J){"use strict";function K(o){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const l in o)if(l!=="default"){const t=Object.getOwnPropertyDescriptor(o,l);Object.defineProperty(i,l,t.get?t:{enumerable:!0,get:()=>o[l]})}}return i.default=o,Object.freeze(i)}const e=K(g),V={"7Z":["application/x-7z-compressed"],AAC:["audio/aac"],ABW:["application/x-abiword"],ARC:["application/octet-stream"],AVI:["video/x-msvideo"],AZW:["application/vnd.amazon.ebook"],BIN:["application/octet-stream"],BMP:["image/bmp"],BZ:["application/x-bzip"],BZ2:["application/x-bzip2"],CER:["application/pkix-cert","application/x-x509-ca-cert"],CSH:["application/x-csh"],CSS:["text/css"],CSV:["text/csv","application/vnd.ms-excel"],DOC:["application/msword"],DOCX:["application/vnd.openxmlformats-officedocument.wordprocessingml.document"],EML:["application/octet-stream","message/rfc822","multipart/mixed","message/rfc5322","message/rfc6532"],EOT:["application/vnd.ms-fontobject"],EPUB:["application/epub+zip"],ES:["application/ecmascript"],FLV:["video/x-flv"],GIF:["image/gif"],GZ:["application/x-gzip"],HTM:["text/html"],HTML:["text/html"],ICO:["image/x-icon"],ICS:["text/calendar"],JAR:["application/java-archive"],JPEG:["image/jpeg"],JPG:["image/jpeg"],JS:["application/javascript"],JSON:["application/json"],M3U:["audio/x-mpequrl"],MID:["audio/midi"],MIDI:["audio/midi"],MOV:["video/quicktime"],MP3:["audio/mpeg3"],MP4:["video/mp4"],MPEG:["video/mpeg"],MPKG:["application/vnd.apple.installer+xml"],ODP:["application/vnd.oasis.opendocument.presentation"],ODS:["application/vnd.oasis.opendocument.spreadsheet"],ODT:["application/vnd.oasis.opendocument.text"],OGA:["audio/ogg"],OGV:["video/ogg"],OGX:["application/ogg"],OTF:["font/otf"],PNG:["image/png"],PDF:["application/pdf"],PPT:["application/vnd.ms-powerpoint"],PPTX:["application/vnd.openxmlformats-officedocument.presentationml.presentation"],RAR:["application/x-rar-compressed"],RTF:["application/rtf"],SH:["application/x-sh"],SVG:["image/svg+xml"],SWF:["application/x-shockwave-flash"],TAR:["application/x-tar"],TIF:["image/tiff"],TIFF:["image/tiff"],TS:["application/typescript"],TTF:["font/ttf"],TXT:["text/plain"],VSD:["application/vnd.visio"],WAV:["audio/wav"],WEBA:["audio/webm"],WEBM:["video/webm"],WEBP:["image/webp"],WOFF:["font/woff"],WOFF2:["font/woff2"],XHTML:["application/xhtml+xml"],XLS:["application/vnd.ms-excel"],XLSX:["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],XML:["application/xml"],XUL:["application/vnd.mozilla.xul+xml"],ZIP:["application/zip"]};function Y(o,i,l){return i in o?Object.defineProperty(o,i,{value:l,enumerable:!0,configurable:!0,writable:!0}):o[i]=l,o}function B(o,i){var l=Object.keys(o);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(o);i&&(t=t.filter(function(s){return Object.getOwnPropertyDescriptor(o,s).enumerable})),l.push.apply(l,t)}return l}function R(o){for(var i=1;i<arguments.length;i++){var l=arguments[i]!=null?arguments[i]:{};i%2?B(Object(l),!0).forEach(function(t){Y(o,t,l[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(l)):B(Object(l)).forEach(function(t){Object.defineProperty(o,t,Object.getOwnPropertyDescriptor(l,t))})}return o}var $=(o,i,l)=>{for(var t of Object.keys(o)){var s;if(o[t]!==((s=i[t])!==null&&s!==void 0?s:l[t]))return!1}return!0},E=o=>i=>{var l=o.defaultClassName,t=R(R({},o.defaultVariants),i);for(var s in t){var v,F=(v=t[s])!==null&&v!==void 0?v:o.defaultVariants[s];if(F!=null){var c=F;typeof c=="boolean"&&(c=c===!0?"true":"false");var _=o.variantClassNames[s][c];_&&(l+=" "+_)}}for(var[U,N]of o.compoundVariants)$(U,t,o.defaultVariants)&&(l+=" "+N);return l},Q=E({defaultClassName:"pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jw0",variantClassNames:{active:{true:"pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jw1",false:"pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jw2"},mini:{true:"pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jw3",false:"pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jw4"},error:{true:"pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jw5",false:"pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jw6"},shown:{true:"pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jw7",false:"pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jw8"},disabled:{true:"pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jw9",false:"pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwa"}},defaultVariants:{active:!1,mini:!1,error:!1,shown:!0,disabled:!1},compoundVariants:[]}),ee=E({defaultClassName:"pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwb",variantClassNames:{constrainContentWidth:{true:"pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwc",false:"pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwd"},disabled:{true:"pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwe",false:"pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwf"}},defaultVariants:{constrainContentWidth:!1,disabled:!1},compoundVariants:[]}),I="pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwg",oe=E({defaultClassName:"pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwh",variantClassNames:{mini:{true:"pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwi",false:"pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwj"},error:{true:"pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwk",false:"pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwl"},disabled:{true:"pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwm",false:"pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwn"}},defaultVariants:{mini:!1,error:!1,disabled:!1},compoundVariants:[]}),ae=E({defaultClassName:"pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwo",variantClassNames:{mini:{true:"pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwp",false:"pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwq"}},defaultVariants:{mini:!1},compoundVariants:[]}),le="pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwr",te="pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jws",L="pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwt",ie="pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwu",ne="pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwv",se="pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jww",re="pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwx",pe="pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwy";function T({constrainContentWidth:o,description:i,multiple:l=!1,dismissable:t,processing:s,mini:v,downloadLabel:F,acceptExtensions:c,maxSize:_,customRequirement:U,onSelection:N,onDismiss:W,download:z,shown:y,className:ce,disabled:f,children:Te,..._e}){const S=e.useRef(new Set),[fe,G]=e.useState(y),[Ne,ue]=e.useState([]),[me,he]=e.useState(""),[X,we]=e.useState(),[ve,j]=e.useState(!1),[x,k]=e.useState(!1),[C,q]=e.useState([]),[Z,ge]=e.useState(""),{t:w}=J.useWoodlandLanguage(),O=(l?w("fileUpload.instructions.other",{defaultValue:"Drag and drop your files here or |browse for files| on your desktop."}):w("fileUpload.instructions.one",{defaultValue:"Drag and drop your file here or |browse for a file| on your desktop."})).split("|"),H=i||(l?"Files":"File"),u=e.useRef(null);e.useEffect(()=>{y&&G(y)},[y]),e.useEffect(()=>{_&&xe(_)},[_]),e.useEffect(()=>{c&&be(c)},[c]);function Fe(){t&&(G(!1),W&&W())}function xe(a){try{we(p.parseFileSize(a))}catch{throw new Error(`Could not parse "${a}" as a file size.`)}}function be(a){const m=(Array.isArray(a)?a:a.trim().split(/\s?,\s?/)).map(h=>h.replace(/^\./,"")),d=m.map(h=>`.${h}`.toLowerCase());ge(d.map((h,D)=>D>0&&D===d.length-1?`or ${h}`:h).join(d.length>2?", ":" ")),S.current.clear();for(const h of m){const D=Object.keys(V).includes(h.toUpperCase())?V[h.toUpperCase()]:[];for(const Oe of D)S.current.add(Oe)}he(d.concat(Array.from(S.current)).join(","))}function P(a){q([]);let r=[];const m=Array.from(a);for(const d of m)d===null?r.push("Not a file"):(c&&!S.current.has(d.type)&&r.push(d.name),_&&X&&d.size>X&&r.indexOf(d.name)===-1&&r.push(d.name));r.length?(k(!0),u.current&&u.current.value&&(u.current.value="")):(ue(m),N(m)),q(r)}function Ee(a){a.preventDefault(),k(!1),u.current&&u.current.click()}function Ue(){z&&z()}function ye(a){a.stopPropagation(),P(a.target.files||[]),u.current&&u.current.value&&(u.current.value="")}function Se(a){a.preventDefault(),a.stopPropagation(),j(!0),k(!1)}function je(a){a.preventDefault(),j(!0),k(!1)}function ke(a){a.preventDefault(),j(!1)}function Ce(a){a.preventDefault(),a.stopPropagation(),j(!1),a.dataTransfer.items?P(Array.from(a.dataTransfer.items).map(r=>r.getAsFile())):P(a.dataTransfer.files)}return e.createElement("div",{onDrop:f?()=>{}:Ce,onDragOver:f?()=>{}:Se,onDragLeave:f?()=>{}:ke,onDragEnter:f?()=>{}:je,className:b.cl(Q({active:ve,mini:v,error:x,shown:fe,disabled:f}),ce),..._e},e.createElement("div",{className:b.cl(ee({constrainContentWidth:o,disabled:f}))},s?e.createElement("div",null,e.createElement(b.Spinner,{size:"md","aria-hidden":"true"}),e.createElement("div",{className:I},w("fileUpload.processing",{defaultValue:"Processing Upload..."}))):e.createElement("div",null,e.createElement("div",{className:oe({mini:v,error:x,disabled:f}),"aria-hidden":"true"},e.createElement("img",{className:pe,src:x?M.GENERAL_ERROR_LARGE:M.UPLOAD_LARGE,alt:"Upload Icon"})),e.createElement("div",{className:ae({mini:v})},x?e.createElement("div",null,w(C.length>1?"fileUpload.cancelled.other":"fileUpload.cancelled.one",{defaultValue:C.length>1?"File Upload(s) Failed":"File Upload Failed"})):e.createElement("div",null,w("fileUpload.title",{description:H,defaultValue:`Upload your ${H}`}))),x?e.createElement("div",{className:le},new Set(C.map((a,r)=>{const m=Math.floor(a.length/2);return e.createElement("div",{className:te,key:a},e.createElement("span",{className:L},a.substr(0,m)),e.createElement("div",{className:L},e.createElement("span",null,a.substr(m))),r<C.length-1?",":"")}))):e.createElement("span",null),e.createElement("div",{className:I},e.createElement("div",null,e.createElement("span",null,O[0]),f?e.createElement("u",null,O[1]):e.createElement("a",{href:"",onClick:Ee},O[1]),e.createElement("span",null,O[2]))),e.createElement("div",{className:ie},c?e.createElement("span",null,"("," ",w("fileUpload.acceptedTypes",{fileTypes:Z,defaultValue:`${Z} format accepted`})," ",")"):"",_?e.createElement("span",null,"( ",w("fileUpload.maximumSize",{size:_,defaultValue:`${_} maximum`})," )"):"",U?e.createElement("span",null," ",U," "):""),F&&e.createElement("div",{className:ne},e.createElement(A.Button,{disabled:f,kind:"link",icon:"download-cloud",onClick:Ue},F)))),t&&!s&&e.createElement("div",{className:se},e.createElement(A.Button,{disabled:f,kind:"icon",icon:"x",title:w("fileUpload.close",{defaultValue:"Close"}),onClick:Fe})),e.createElement("form",{className:re},e.createElement("input",{ref:u,type:"file",accept:me||"*/*",multiple:l||void 0,onChange:ye})))}b.Metadata.set(T,{name:"FileUpload",props:{constrainContentWidth:{type:"boolean"},description:{type:"string"},multiple:{type:"boolean"},dismissable:{type:"boolean"},mini:{type:"boolean"},downloadLabel:{type:"string"},acceptExtensions:{type:"string[] | string"},maxSize:{type:"string"},customRequirement:{type:"string"},onSelection:{type:"(files: File[]) => void",required:!0},dismissal:{type:"() => void"},download:{type:"() => void"},disabled:{type:"boolean"}}});const de={"File Upload":{components:[T],examples:{basic:{label:"Basic File Upload",description:"Simply allow the user to drag-and-drop or select a single file or multiple files at once.",examples:{basic:{description:"Single file upload",react:p.code`
2
2
  import { FileUpload } from "@sps-woodland/file-upload";
3
3
 
4
4
  function Component() {
@@ -170,4 +170,4 @@
170
170
  onSelection={selectFile} />
171
171
  )
172
172
  }
173
- `}}}}}};n.FileUpload=T,n.MANIFEST=pe,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})});
173
+ `}}}}}};n.FileUpload=T,n.MANIFEST=de,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})});
package/lib/style.css CHANGED
@@ -1 +1 @@
1
- .pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jw0{border-width:.0625rem;border-style:dashed;border-radius:.25rem;display:block;padding:1rem;position:relative}.pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jw1{background-color:#f4ecf2;border-color:#91467f;border-style:solid}.pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jw3{padding:1rem}.pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jw5{border-color:#de002e}.pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jw8{display:none}.pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jw9{border-color:#d2d4d4}.pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwb{color:#4b5356;margin:0 auto;text-align:center}.pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwc{width:50%}.pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwe{color:#717779}.pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwg{font-size:.75rem;line-height:1.25rem}.pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwh{color:#717779;display:block;margin-bottom:1rem}.pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwi{font-size:1.5rem;line-height:1.5rem}.pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwj{font-size:3rem;line-height:3rem}.pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwk{color:#de002e}.pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwm{opacity:.5}.pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwo{font-weight:600;margin-bottom:.25rem}.pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwp{font-size:1rem;line-height:1.25rem}.pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwq{font-size:1.125rem;line-height:1.25rem}.pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwr{font-size:.875rem;font-weight:600;line-height:1.25rem}.pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jws{display:flex;justify-content:center;white-space:nowrap}.pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwt{max-width:50%;overflow:hidden}.pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwt:first-child{text-overflow:ellipsis}.pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwt:last-child{float:right}.pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwu{font-size:.75rem;line-height:1.125rem;margin-top:.25rem}.pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwu>span+span{margin-left:.125rem}.pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwv{margin-top:1rem}.pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jww{position:absolute;right:.5rem;top:.5rem}.pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwx{display:none}.pkg_sps-woodland_file-upload__version_8_33_9__hash_rh07jwy{height:3rem}
1
+ .pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jw0{border-width:.0625rem;border-style:dashed;border-radius:.25rem;display:block;padding:1rem;position:relative}.pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jw1{background-color:#f4ecf2;border-color:#91467f;border-style:solid}.pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jw3{padding:1rem}.pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jw5{border-color:#de002e}.pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jw8{display:none}.pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jw9{border-color:#d2d4d4}.pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwb{color:#4b5356;margin:0 auto;text-align:center}.pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwc{width:50%}.pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwe{color:#717779}.pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwg{font-size:.75rem;line-height:1.25rem}.pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwh{color:#717779;display:block;margin-bottom:1rem}.pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwi{font-size:1.5rem;line-height:1.5rem}.pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwj{font-size:3rem;line-height:3rem}.pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwk{color:#de002e}.pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwm{opacity:.5}.pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwo{font-weight:600;margin-bottom:.25rem}.pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwp{font-size:1rem;line-height:1.25rem}.pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwq{font-size:1.125rem;line-height:1.25rem}.pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwr{font-size:.875rem;font-weight:600;line-height:1.25rem}.pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jws{display:flex;justify-content:center;white-space:nowrap}.pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwt{max-width:50%;overflow:hidden}.pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwt:first-child{text-overflow:ellipsis}.pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwt:last-child{float:right}.pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwu{font-size:.75rem;line-height:1.125rem;margin-top:.25rem}.pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwu>span+span{margin-left:.125rem}.pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwv{margin-top:1rem}.pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jww{position:absolute;right:.5rem;top:.5rem}.pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwx{display:none}.pkg_sps-woodland_file-upload__version_8_34_0__hash_rh07jwy{height:3rem}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sps-woodland/file-upload",
3
3
  "description": "SPS Woodland Design System file upload component",
4
- "version": "8.33.9",
4
+ "version": "8.34.0",
5
5
  "author": "SPS Commerce",
6
6
  "license": "UNLICENSED",
7
7
  "repository": "https://github.com/SPSCommerce/woodland/tree/main/packages/@sps-woodland/file-upload",
@@ -30,12 +30,13 @@
30
30
  "@spscommerce/utils": "^7.0.0",
31
31
  "react": "^16.14.0",
32
32
  "react-dom": "^16.14.0",
33
- "@sps-woodland/buttons": "8.33.9",
34
- "@sps-woodland/core": "8.33.9",
35
- "@sps-woodland/tokens": "8.33.9",
36
- "@sps-woodland/illustrations": "8.33.9",
37
- "@spscommerce/ds-react": "8.33.9",
38
- "@spscommerce/ds-shared": "8.33.9"
33
+ "@sps-woodland/buttons": "8.34.0",
34
+ "@sps-woodland/core": "8.34.0",
35
+ "@sps-woodland/tokens": "8.34.0",
36
+ "@sps-woodland/illustrations": "8.34.0",
37
+ "@spscommerce/ds-react": "8.34.0",
38
+ "@spscommerce/ds-shared": "8.34.0",
39
+ "@spscommerce/i18n": "8.34.0"
39
40
  },
40
41
  "devDependencies": {
41
42
  "@spscommerce/ds-illustrations": "^6.12.1",
@@ -44,13 +45,14 @@
44
45
  "@vanilla-extract/recipes": "^0.2.5",
45
46
  "react": "^16.14.0",
46
47
  "react-dom": "^16.14.0",
47
- "@sps-woodland/buttons": "8.33.9",
48
- "@sps-woodland/core": "8.33.9",
49
- "@sps-woodland/tokens": "8.33.9",
50
- "@spscommerce/ds-colors": "8.33.9",
51
- "@sps-woodland/illustrations": "8.33.9",
52
- "@spscommerce/ds-react": "8.33.9",
53
- "@spscommerce/ds-shared": "8.33.9"
48
+ "@sps-woodland/buttons": "8.34.0",
49
+ "@sps-woodland/core": "8.34.0",
50
+ "@sps-woodland/tokens": "8.34.0",
51
+ "@spscommerce/ds-colors": "8.34.0",
52
+ "@sps-woodland/illustrations": "8.34.0",
53
+ "@spscommerce/ds-react": "8.34.0",
54
+ "@spscommerce/ds-shared": "8.34.0",
55
+ "@spscommerce/i18n": "8.34.0"
54
56
  },
55
57
  "scripts": {
56
58
  "build": "pnpm run build:js && pnpm run build:types",