@sps-woodland/file-upload 8.2.1 → 8.3.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.es.js +47 -67
- package/lib/style.css +1 -1
- package/package.json +12 -12
package/lib/index.es.js
CHANGED
|
@@ -211,73 +211,53 @@ function k({
|
|
|
211
211
|
)
|
|
212
212
|
) : D(t.dataTransfer.files);
|
|
213
213
|
}
|
|
214
|
-
return /* @__PURE__ */ e.createElement(
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
size: "md",
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
"
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
}, /* @__PURE__ */ e.createElement(I, {
|
|
262
|
-
kind: "link",
|
|
263
|
-
icon: "download-cloud",
|
|
264
|
-
onClick: le
|
|
265
|
-
}, w)))), l && !n && /* @__PURE__ */ e.createElement("div", {
|
|
266
|
-
className: ye
|
|
267
|
-
}, /* @__PURE__ */ e.createElement(I, {
|
|
268
|
-
kind: "icon",
|
|
269
|
-
icon: "x",
|
|
270
|
-
title: h("design-system:fileUpload.close"),
|
|
271
|
-
onClick: ee
|
|
272
|
-
})), /* @__PURE__ */ e.createElement("form", {
|
|
273
|
-
className: Se
|
|
274
|
-
}, /* @__PURE__ */ e.createElement("input", {
|
|
275
|
-
ref: d,
|
|
276
|
-
type: "file",
|
|
277
|
-
accept: H || "*/*",
|
|
278
|
-
multiple: a || void 0,
|
|
279
|
-
onChange: oe
|
|
280
|
-
})));
|
|
214
|
+
return /* @__PURE__ */ e.createElement(
|
|
215
|
+
"div",
|
|
216
|
+
{
|
|
217
|
+
onDrop: pe,
|
|
218
|
+
onDragOver: ne,
|
|
219
|
+
onDragLeave: re,
|
|
220
|
+
onDragEnter: se,
|
|
221
|
+
className: B(xe({ active: _, mini: v, error: g, shown: Z }), X),
|
|
222
|
+
...G
|
|
223
|
+
},
|
|
224
|
+
/* @__PURE__ */ e.createElement("div", { className: B(be({ constrainContentWidth: i })) }, n ? /* @__PURE__ */ e.createElement("div", null, /* @__PURE__ */ e.createElement(ue, { size: "md", "aria-hidden": "true" }), /* @__PURE__ */ e.createElement("div", { className: L }, h("design-system:fileUpload.processing"))) : /* @__PURE__ */ e.createElement("div", null, /* @__PURE__ */ e.createElement(
|
|
225
|
+
me,
|
|
226
|
+
{
|
|
227
|
+
className: Ue({ mini: v, error: g }),
|
|
228
|
+
icon: g ? "exclamation-circle" : "upload-cloud",
|
|
229
|
+
"aria-hidden": "true"
|
|
230
|
+
}
|
|
231
|
+
), /* @__PURE__ */ e.createElement("div", { className: je({ mini: v }) }, g ? /* @__PURE__ */ e.createElement("div", null, h(
|
|
232
|
+
j.length > 1 ? "design-system:fileUpload.cancelled_plural" : "design-system:fileUpload.cancelled"
|
|
233
|
+
)) : /* @__PURE__ */ e.createElement("div", null, h("design-system:fileUpload.title", { description: $ }))), g ? /* @__PURE__ */ e.createElement("div", { className: Fe }, new Set(
|
|
234
|
+
j.map((t, s) => {
|
|
235
|
+
const f = Math.floor(t.length / 2);
|
|
236
|
+
return /* @__PURE__ */ e.createElement("div", { className: ge, key: t }, /* @__PURE__ */ e.createElement("span", { className: R }, t.substr(0, f)), /* @__PURE__ */ e.createElement("div", { className: R }, /* @__PURE__ */ e.createElement("span", null, t.substr(f))), s < j.length - 1 ? "," : "");
|
|
237
|
+
})
|
|
238
|
+
)) : /* @__PURE__ */ e.createElement("span", null), /* @__PURE__ */ e.createElement("div", { className: L }, /* @__PURE__ */ e.createElement("div", null, /* @__PURE__ */ e.createElement("span", null, O[0]), /* @__PURE__ */ e.createElement("a", { href: "", onClick: ae }, O[1]), /* @__PURE__ */ e.createElement("span", null, O[2]))), /* @__PURE__ */ e.createElement("div", { className: Ce }, p ? /* @__PURE__ */ e.createElement("span", null, "(", " ", h("design-system:fileUpload.acceptedTypes", {
|
|
239
|
+
fileTypes: Y
|
|
240
|
+
}), " ", ")") : "", c ? /* @__PURE__ */ e.createElement("span", null, "( ", h("design-system:fileUpload.maximumSize", { size: c }), " )") : "", F ? /* @__PURE__ */ e.createElement("span", null, " ", F, " ") : ""), w && /* @__PURE__ */ e.createElement("div", { className: Ee }, /* @__PURE__ */ e.createElement(I, { kind: "link", icon: "download-cloud", onClick: le }, w)))),
|
|
241
|
+
l && !n && /* @__PURE__ */ e.createElement("div", { className: ye }, /* @__PURE__ */ e.createElement(
|
|
242
|
+
I,
|
|
243
|
+
{
|
|
244
|
+
kind: "icon",
|
|
245
|
+
icon: "x",
|
|
246
|
+
title: h("design-system:fileUpload.close"),
|
|
247
|
+
onClick: ee
|
|
248
|
+
}
|
|
249
|
+
)),
|
|
250
|
+
/* @__PURE__ */ e.createElement("form", { className: Se }, /* @__PURE__ */ e.createElement(
|
|
251
|
+
"input",
|
|
252
|
+
{
|
|
253
|
+
ref: d,
|
|
254
|
+
type: "file",
|
|
255
|
+
accept: H || "*/*",
|
|
256
|
+
multiple: a || void 0,
|
|
257
|
+
onChange: oe
|
|
258
|
+
}
|
|
259
|
+
))
|
|
260
|
+
);
|
|
281
261
|
}
|
|
282
262
|
de.set(k, {
|
|
283
263
|
name: "FileUpload",
|
package/lib/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.rh07jw0{border-width:.0625rem;border-style:dashed;border-radius:.25rem;display:block;padding:1rem;position:relative}.rh07jw1{background-color
|
|
1
|
+
.rh07jw0{border-width:.0625rem;border-style:dashed;border-radius:.25rem;display:block;padding:1rem;position:relative}.rh07jw1{background-color:oklch(95.1% .012 334.08);border-color:oklch(50.83% .125 337.21);border-style:solid}.rh07jw3{padding:1rem}.rh07jw5{border-color:oklch(56.83% .229 22.94)}.rh07jw8{display:none}.rh07jw9{color:oklch(43.62% .011 222.24);margin:0 auto;text-align:center}.rh07jwa{width:50%}.rh07jwc{font-size:.75rem;line-height:1.25rem}.rh07jwd{color:oklch(56.48% .008 219.62);display:block;margin-bottom:.25rem}.rh07jwe{font-size:1.5rem;line-height:1.5rem}.rh07jwf{font-size:3rem;line-height:3rem}.rh07jwg{color:oklch(56.83% .229 22.94)}.rh07jwi{font-weight:600;margin-bottom:.25rem}.rh07jwj{font-size:1rem;line-height:1.25rem}.rh07jwk{font-size:1.125rem;line-height:1.25rem}.rh07jwl{font-size:.875rem;font-weight:600;line-height:1.25rem}.rh07jwm{display:flex;justify-content:center;white-space:nowrap}.rh07jwn{max-width:50%;overflow:hidden}.rh07jwn:first-child{text-overflow:ellipsis}.rh07jwn:last-child{float:right}.rh07jwo{font-size:.75rem;line-height:1.125rem;margin-top:.25rem}.rh07jwo>span+span{margin-left:.125rem}.rh07jwp{margin-top:1rem}.rh07jwq{position:absolute;right:.5rem;top:.5rem}.rh07jwr{display:none}
|
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.
|
|
4
|
+
"version": "8.3.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,11 +30,11 @@
|
|
|
30
30
|
"@spscommerce/ds-illustrations": "^6.12.1",
|
|
31
31
|
"react": "^16.14.0",
|
|
32
32
|
"react-dom": "^16.14.0",
|
|
33
|
-
"@sps-woodland/core": "8.
|
|
34
|
-
"@sps-woodland/tokens": "8.
|
|
35
|
-
"@sps-woodland/buttons": "8.
|
|
36
|
-
"@spscommerce/ds-react": "8.
|
|
37
|
-
"@spscommerce/ds-shared": "8.
|
|
33
|
+
"@sps-woodland/core": "8.3.0",
|
|
34
|
+
"@sps-woodland/tokens": "8.3.0",
|
|
35
|
+
"@sps-woodland/buttons": "8.3.0",
|
|
36
|
+
"@spscommerce/ds-react": "8.3.0",
|
|
37
|
+
"@spscommerce/ds-shared": "8.3.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@spscommerce/utils": "^6.12.1",
|
|
@@ -43,12 +43,12 @@
|
|
|
43
43
|
"@vanilla-extract/recipes": "^0.2.5",
|
|
44
44
|
"react": "^16.14.0",
|
|
45
45
|
"react-dom": "^16.14.0",
|
|
46
|
-
"@sps-woodland/core": "8.
|
|
47
|
-
"@sps-woodland/tokens": "8.
|
|
48
|
-
"@sps-woodland/buttons": "8.
|
|
49
|
-
"@spscommerce/ds-react": "8.
|
|
50
|
-
"@spscommerce/ds-shared": "8.
|
|
51
|
-
"@spscommerce/ds-colors": "8.
|
|
46
|
+
"@sps-woodland/core": "8.3.0",
|
|
47
|
+
"@sps-woodland/tokens": "8.3.0",
|
|
48
|
+
"@sps-woodland/buttons": "8.3.0",
|
|
49
|
+
"@spscommerce/ds-react": "8.3.0",
|
|
50
|
+
"@spscommerce/ds-shared": "8.3.0",
|
|
51
|
+
"@spscommerce/ds-colors": "8.3.0"
|
|
52
52
|
},
|
|
53
53
|
"scripts": {
|
|
54
54
|
"build": "pnpm run build:js && pnpm run build:types",
|