@sps-woodland/file-upload 8.13.1 → 8.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/FileUpload.css.d.ts +18 -0
- package/lib/FileUpload.d.ts +2 -1
- package/lib/index.cjs.js +27 -10
- package/lib/index.es.js +145 -111
- package/lib/style.css +1 -1
- package/package.json +12 -12
package/lib/FileUpload.css.d.ts
CHANGED
|
@@ -25,6 +25,12 @@ export declare const fileUpload: import("@vanilla-extract/recipes/dist/declarati
|
|
|
25
25
|
display: "none";
|
|
26
26
|
};
|
|
27
27
|
};
|
|
28
|
+
disabled: {
|
|
29
|
+
true: {
|
|
30
|
+
borderColor: string;
|
|
31
|
+
};
|
|
32
|
+
false: {};
|
|
33
|
+
};
|
|
28
34
|
}>;
|
|
29
35
|
export declare const fileUploadContent: import("@vanilla-extract/recipes/dist/declarations/src/types").RuntimeFn<{
|
|
30
36
|
constrainContentWidth: {
|
|
@@ -33,6 +39,12 @@ export declare const fileUploadContent: import("@vanilla-extract/recipes/dist/de
|
|
|
33
39
|
};
|
|
34
40
|
false: {};
|
|
35
41
|
};
|
|
42
|
+
disabled: {
|
|
43
|
+
true: {
|
|
44
|
+
color: string;
|
|
45
|
+
};
|
|
46
|
+
false: {};
|
|
47
|
+
};
|
|
36
48
|
}>;
|
|
37
49
|
export declare const fileUploadInstructions: string;
|
|
38
50
|
export declare const fileUploadIcon: import("@vanilla-extract/recipes/dist/declarations/src/types").RuntimeFn<{
|
|
@@ -52,6 +64,12 @@ export declare const fileUploadIcon: import("@vanilla-extract/recipes/dist/decla
|
|
|
52
64
|
};
|
|
53
65
|
false: {};
|
|
54
66
|
};
|
|
67
|
+
disabled: {
|
|
68
|
+
true: {
|
|
69
|
+
opacity: number;
|
|
70
|
+
};
|
|
71
|
+
false: {};
|
|
72
|
+
};
|
|
55
73
|
}>;
|
|
56
74
|
export declare const fileUploadTitle: import("@vanilla-extract/recipes/dist/declarations/src/types").RuntimeFn<{
|
|
57
75
|
mini: {
|
package/lib/FileUpload.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { ComponentProps } from "@sps-woodland/core";
|
|
3
|
-
export declare function FileUpload({ constrainContentWidth, description, multiple, dismissable, processing, mini, downloadLabel, acceptExtensions, maxSize, customRequirement, onSelection, onDismiss, download, shown, className, children, ...rest }: ComponentProps<{
|
|
3
|
+
export declare function FileUpload({ constrainContentWidth, description, multiple, dismissable, processing, mini, downloadLabel, acceptExtensions, maxSize, customRequirement, onSelection, onDismiss, download, shown, className, disabled, children, ...rest }: ComponentProps<{
|
|
4
4
|
constrainContentWidth?: boolean;
|
|
5
5
|
description?: string;
|
|
6
6
|
multiple?: boolean;
|
|
@@ -15,4 +15,5 @@ export declare function FileUpload({ constrainContentWidth, description, multipl
|
|
|
15
15
|
onSelection: (files: File[]) => void;
|
|
16
16
|
onDismiss?: () => void;
|
|
17
17
|
download?: () => void;
|
|
18
|
+
disabled?: boolean;
|
|
18
19
|
}>): React.ReactElement;
|
package/lib/index.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const fe=require("react"),g=require("@sps-woodland/core"),c=require("@spscommerce/utils"),z=require("@sps-woodland/buttons");function ue(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const l in t)if(l!=="default"){const a=Object.getOwnPropertyDescriptor(t,l);Object.defineProperty(o,l,a.get?a:{enumerable:!0,get:()=>t[l]})}}return o.default=t,Object.freeze(o)}const e=ue(fe),L={"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 me(t,o,l){return o in t?Object.defineProperty(t,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):t[o]=l,t}function R(t,o){var l=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);o&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),l.push.apply(l,a)}return l}function W(t){for(var o=1;o<arguments.length;o++){var l=arguments[o]!=null?arguments[o]:{};o%2?R(Object(l),!0).forEach(function(a){me(t,a,l[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(l)):R(Object(l)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(l,a))})}return t}var he=(t,o,l)=>{for(var a of Object.keys(t)){var n;if(t[a]!==((n=o[a])!==null&&n!==void 0?n:l[a]))return!1}return!0},O=t=>o=>{var l=t.defaultClassName,a=W(W({},t.defaultVariants),o);for(var n in a){var w,F=(w=a[n])!==null&&w!==void 0?w:t.defaultVariants[n];if(F!=null){var p=F;typeof p=="boolean"&&(p=p===!0?"true":"false");var f=t.variantClassNames[n][p];f&&(l+=" "+f)}}for(var[b,D]of t.compoundVariants)he(b,a,t.defaultVariants)&&(l+=" "+D);return l},ve="rh07jws",k="rh07jwt",we="rh07jwr",ge=O({defaultClassName:"rh07jw0",variantClassNames:{active:{true:"rh07jw1",false:"rh07jw2"},mini:{true:"rh07jw3",false:"rh07jw4"},error:{true:"rh07jw5",false:"rh07jw6"},shown:{true:"rh07jw7",false:"rh07jw8"},disabled:{true:"rh07jw9",false:"rh07jwa"}},defaultVariants:{active:!1,mini:!1,error:!1,shown:!0,disabled:!1},compoundVariants:[]}),Fe="rh07jww",xe=O({defaultClassName:"rh07jwb",variantClassNames:{constrainContentWidth:{true:"rh07jwc",false:"rh07jwd"},disabled:{true:"rh07jwe",false:"rh07jwf"}},defaultVariants:{constrainContentWidth:!1,disabled:!1},compoundVariants:[]}),be="rh07jwv",ye="rh07jwx",Se=O({defaultClassName:"rh07jwh",variantClassNames:{mini:{true:"rh07jwi",false:"rh07jwj"},error:{true:"rh07jwk",false:"rh07jwl"},disabled:{true:"rh07jwm",false:"rh07jwn"}},defaultVariants:{mini:!1,error:!1,disabled:!1},compoundVariants:[]}),X="rh07jwg",Ee="rh07jwu",Ue=O({defaultClassName:"rh07jwo",variantClassNames:{mini:{true:"rh07jwp",false:"rh07jwq"}},defaultVariants:{mini:!1},compoundVariants:[]});function P({constrainContentWidth:t,description:o,multiple:l=!1,dismissable:a,processing:n,mini:w,downloadLabel:F,acceptExtensions:p,maxSize:f,customRequirement:b,onSelection:D,onDismiss:M,download:A,shown:y,className:G,disabled:d,children:Oe,...q}){const S=e.useRef(new Set),[Z,B]=e.useState(y),[De,H]=e.useState([]),[J,K]=e.useState(""),[I,_]=e.useState(),[Y,E]=e.useState(!1),[x,U]=e.useState(!1),[T,V]=e.useState([]),[Q,$]=e.useState(""),{t:v}=e.useContext(g.I18nContext),j=v(l?"design-system:fileUpload.instructions_plural":"design-system:fileUpload.instructions").split("|"),ee=o||(l?"Files":"File"),u=e.useRef(null);e.useEffect(()=>{y&&B(y)},[y]),e.useEffect(()=>{f&&ie(f)},[f]),e.useEffect(()=>{p&&le(p)},[p]);function te(){a&&(B(!1),M&&M())}function ie(i){try{_(c.parseFileSize(i))}catch{throw new Error(`Could not parse "${i}" as a file size.`)}}function le(i){const m=(Array.isArray(i)?i:i.trim().split(/\s?,\s?/)).map(h=>h.replace(/^\./,"")),r=m.map(h=>`.${h}`.toLowerCase());$(r.map((h,C)=>C>0&&C===r.length-1?`or ${h}`:h).join(r.length>2?", ":" ")),S.current.clear();for(const h of m){const C=Object.keys(L).includes(h.toUpperCase())?L[h.toUpperCase()]:[];for(const de of C)S.current.add(de)}K(r.concat(Array.from(S.current)).join(","))}function N(i){V([]);let s=[];const m=Array.from(i);for(const r of m)r===null?s.push("Not a file"):(p&&!S.current.has(r.type)&&s.push(r.name),f&&I&&r.size>I&&s.indexOf(r.name)===-1&&s.push(r.name));s.length?(U(!0),u.current&&u.current.value&&(u.current.value="")):(H(m),D(m)),V(s)}function ae(i){i.preventDefault(),U(!1),u.current&&u.current.click()}function oe(){A&&A()}function ne(i){i.stopPropagation(),N(i.target.files||[]),u.current&&u.current.value&&(u.current.value="")}function se(i){i.preventDefault(),i.stopPropagation(),E(!0),U(!1)}function re(i){i.preventDefault(),E(!0),U(!1)}function ce(i){i.preventDefault(),E(!1)}function pe(i){i.preventDefault(),i.stopPropagation(),E(!1),i.dataTransfer.items?N(Array.from(i.dataTransfer.items).map(s=>s.getAsFile())):N(i.dataTransfer.files)}return e.createElement("div",{onDrop:d?()=>{}:pe,onDragOver:d?()=>{}:se,onDragLeave:d?()=>{}:ce,onDragEnter:d?()=>{}:re,className:g.cl(ge({active:Y,mini:w,error:x,shown:Z,disabled:d}),G),...q},e.createElement("div",{className:g.cl(xe({constrainContentWidth:t,disabled:d}))},n?e.createElement("div",null,e.createElement(g.Spinner,{size:"md","aria-hidden":"true"}),e.createElement("div",{className:X},v("design-system:fileUpload.processing"))):e.createElement("div",null,e.createElement(g.Icon,{className:Se({mini:w,error:x,disabled:d}),icon:x?"exclamation-circle":"upload-cloud","aria-hidden":"true"}),e.createElement("div",{className:Ue({mini:w})},x?e.createElement("div",null,v(T.length>1?"design-system:fileUpload.cancelled_plural":"design-system:fileUpload.cancelled")):e.createElement("div",null,v("design-system:fileUpload.title",{description:ee}))),x?e.createElement("div",{className:we},new Set(T.map((i,s)=>{const m=Math.floor(i.length/2);return e.createElement("div",{className:ve,key:i},e.createElement("span",{className:k},i.substr(0,m)),e.createElement("div",{className:k},e.createElement("span",null,i.substr(m))),s<T.length-1?",":"")}))):e.createElement("span",null),e.createElement("div",{className:X},e.createElement("div",null,e.createElement("span",null,j[0]),d?e.createElement("u",null,j[1]):e.createElement("a",{href:"",onClick:ae},j[1]),e.createElement("span",null,j[2]))),e.createElement("div",{className:Ee},p?e.createElement("span",null,"("," ",v("design-system:fileUpload.acceptedTypes",{fileTypes:Q})," ",")"):"",f?e.createElement("span",null,"( ",v("design-system:fileUpload.maximumSize",{size:f})," )"):"",b?e.createElement("span",null," ",b," "):""),F&&e.createElement("div",{className:be},e.createElement(z.Button,{disabled:d,kind:"link",icon:"download-cloud",onClick:oe},F)))),a&&!n&&e.createElement("div",{className:Fe},e.createElement(z.Button,{disabled:d,kind:"icon",icon:"x",title:v("design-system:fileUpload.close"),onClick:te})),e.createElement("form",{className:ye},e.createElement("input",{ref:u,type:"file",accept:J||"*/*",multiple:l||void 0,onChange:ne})))}g.Metadata.set(P,{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 je={components:[P],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:c.code`
|
|
2
2
|
import { FileUpload } from "@sps-woodland/file-upload";
|
|
3
3
|
|
|
4
4
|
function Component() {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
<FileUpload onSelection={selectFile} />
|
|
11
11
|
)
|
|
12
12
|
}
|
|
13
|
-
`},multiple:{description:"Multiple file upload",react:
|
|
13
|
+
`},multiple:{description:"Multiple file upload",react:c.code`
|
|
14
14
|
import { FileUpload } from "@sps-woodland/file-upload";
|
|
15
15
|
|
|
16
16
|
function Component() {
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
<FileUpload onSelection={selectFile} multiple />
|
|
23
23
|
)
|
|
24
24
|
}
|
|
25
|
-
`}}},restrictions:{label:"Restrictions",description:"You can place restrictions on what files will be accepted with an extension whitelist and/or a maximum size.",examples:{maxSize:{description:"Maximum size",react:
|
|
25
|
+
`}}},restrictions:{label:"Restrictions",description:"You can place restrictions on what files will be accepted with an extension whitelist and/or a maximum size.",examples:{maxSize:{description:"Maximum size",react:c.code`
|
|
26
26
|
import { FileUpload } from "@sps-woodland/file-upload";
|
|
27
27
|
|
|
28
28
|
function Component() {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
<FileUpload onSelection={selectFile} maxSize="100KB" />
|
|
35
35
|
)
|
|
36
36
|
}
|
|
37
|
-
`},fileWhitelist:{description:"File type whitelist",react:
|
|
37
|
+
`},fileWhitelist:{description:"File type whitelist",react:c.code`
|
|
38
38
|
import { FileUpload } from "@sps-woodland/file-upload";
|
|
39
39
|
|
|
40
40
|
function Component() {
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
/>
|
|
52
52
|
)
|
|
53
53
|
}
|
|
54
|
-
`},bothRestrictions:{description:"Both restrictions",react:
|
|
54
|
+
`},bothRestrictions:{description:"Both restrictions",react:c.code`
|
|
55
55
|
import { FileUpload } from "@sps-woodland/file-upload";
|
|
56
56
|
|
|
57
57
|
function Component() {
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
/>
|
|
70
70
|
)
|
|
71
71
|
}
|
|
72
|
-
`}}},dismissable:{label:"Dismissable",description:"With this option, the file upload component can be dismissed by the user. If the user does dismiss it, you can show it again programmatically if you need to.",examples:{basic:{react:
|
|
72
|
+
`}}},dismissable:{label:"Dismissable",description:"With this option, the file upload component can be dismissed by the user. If the user does dismiss it, you can show it again programmatically if you need to.",examples:{basic:{react:c.code`
|
|
73
73
|
import { FileUpload } from "@sps-woodland/file-upload";
|
|
74
74
|
import { Button } from "@sps-woodland/buttons";
|
|
75
75
|
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
</>
|
|
100
100
|
)
|
|
101
101
|
}
|
|
102
|
-
`}}},download:{label:"Download Button",description:"You can optionally provide a button to download a file. Typically this will be a template for whatever the user is expected to upload. They can then fill out the template, save it, and upload it.",examples:{basic:{react:
|
|
102
|
+
`}}},download:{label:"Download Button",description:"You can optionally provide a button to download a file. Typically this will be a template for whatever the user is expected to upload. They can then fill out the template, save it, and upload it.",examples:{basic:{react:c.code`
|
|
103
103
|
import { FileUpload } from "@sps-woodland/file-upload";
|
|
104
104
|
|
|
105
105
|
function Component() {
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
/>
|
|
122
122
|
)
|
|
123
123
|
}
|
|
124
|
-
`}}},mini:{label:"Mini File Upload",description:"When the file upload component is to be placed in a small container, it should be marked as a mini file upload so that everything fits.",examples:{basic:{react:
|
|
124
|
+
`}}},mini:{label:"Mini File Upload",description:"When the file upload component is to be placed in a small container, it should be marked as a mini file upload so that everything fits.",examples:{basic:{react:c.code`
|
|
125
125
|
import { FileUpload } from "@sps-woodland/file-upload";
|
|
126
126
|
|
|
127
127
|
function Component() {
|
|
@@ -137,7 +137,7 @@
|
|
|
137
137
|
</div>
|
|
138
138
|
)
|
|
139
139
|
}
|
|
140
|
-
`}}},constrainContentWidth:{label:"Constrain Content Width",description:"If this prop is provided, the content will be restricted to 50% of the overall width of the component. Consult your product designer if you're not sure whether to use this variant.",examples:{basic:{react:
|
|
140
|
+
`}}},constrainContentWidth:{label:"Constrain Content Width",description:"If this prop is provided, the content will be restricted to 50% of the overall width of the component. Consult your product designer if you're not sure whether to use this variant.",examples:{basic:{react:c.code`
|
|
141
141
|
import { FileUpload } from "@sps-woodland/file-upload";
|
|
142
142
|
|
|
143
143
|
function Component() {
|
|
@@ -153,4 +153,21 @@
|
|
|
153
153
|
</div>
|
|
154
154
|
)
|
|
155
155
|
}
|
|
156
|
-
`}}}
|
|
156
|
+
`}}},disabled:{label:"Disabled State",description:"File Upload have a disabled style for each possible state.",examples:{basic:{description:"Disabled File Upload",react:c.code`
|
|
157
|
+
import { FileUpload } from "@sps-woodland/file-upload";
|
|
158
|
+
|
|
159
|
+
function Component() {
|
|
160
|
+
function selectFile(file) {
|
|
161
|
+
console.log(file);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
return (
|
|
165
|
+
<FileUpload
|
|
166
|
+
disabled
|
|
167
|
+
downloadLabel="Download Excel Template" download={() => {}}
|
|
168
|
+
dismissable onDismiss={() => {}}
|
|
169
|
+
acceptExtensions="XLS, xlsx, .csv" maxSize="100KB"
|
|
170
|
+
onSelection={selectFile} />
|
|
171
|
+
)
|
|
172
|
+
}
|
|
173
|
+
`}}}}},Ce={"File Upload":je};exports.FileUpload=P;exports.MANIFEST=Ce;
|
package/lib/index.es.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as e from "react";
|
|
2
|
-
import { Metadata as
|
|
3
|
-
import { parseFileSize as
|
|
4
|
-
import { Button as
|
|
5
|
-
const
|
|
2
|
+
import { Metadata as fe, I18nContext as ue, cl as I, Spinner as me, Icon as he } from "@sps-woodland/core";
|
|
3
|
+
import { parseFileSize as ve, code as d } from "@spscommerce/utils";
|
|
4
|
+
import { Button as V } from "@sps-woodland/buttons";
|
|
5
|
+
const z = {
|
|
6
6
|
"7Z": ["application/x-7z-compressed"],
|
|
7
7
|
AAC: ["audio/aac"],
|
|
8
8
|
ABW: ["application/x-abiword"],
|
|
@@ -79,7 +79,7 @@ const V = {
|
|
|
79
79
|
XUL: ["application/vnd.mozilla.xul+xml"],
|
|
80
80
|
ZIP: ["application/zip"]
|
|
81
81
|
};
|
|
82
|
-
function
|
|
82
|
+
function we(i, o, a) {
|
|
83
83
|
return o in i ? Object.defineProperty(i, o, {
|
|
84
84
|
value: a,
|
|
85
85
|
enumerable: !0,
|
|
@@ -87,7 +87,7 @@ function ve(i, o, a) {
|
|
|
87
87
|
writable: !0
|
|
88
88
|
}) : i[o] = a, i;
|
|
89
89
|
}
|
|
90
|
-
function
|
|
90
|
+
function L(i, o) {
|
|
91
91
|
var a = Object.keys(i);
|
|
92
92
|
if (Object.getOwnPropertySymbols) {
|
|
93
93
|
var l = Object.getOwnPropertySymbols(i);
|
|
@@ -97,173 +97,179 @@ function W(i, o) {
|
|
|
97
97
|
}
|
|
98
98
|
return a;
|
|
99
99
|
}
|
|
100
|
-
function
|
|
100
|
+
function W(i) {
|
|
101
101
|
for (var o = 1; o < arguments.length; o++) {
|
|
102
102
|
var a = arguments[o] != null ? arguments[o] : {};
|
|
103
|
-
o % 2 ?
|
|
104
|
-
|
|
105
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(i, Object.getOwnPropertyDescriptors(a)) :
|
|
103
|
+
o % 2 ? L(Object(a), !0).forEach(function(l) {
|
|
104
|
+
we(i, l, a[l]);
|
|
105
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(i, Object.getOwnPropertyDescriptors(a)) : L(Object(a)).forEach(function(l) {
|
|
106
106
|
Object.defineProperty(i, l, Object.getOwnPropertyDescriptor(a, l));
|
|
107
107
|
});
|
|
108
108
|
}
|
|
109
109
|
return i;
|
|
110
110
|
}
|
|
111
|
-
var
|
|
111
|
+
var ge = (i, o, a) => {
|
|
112
112
|
for (var l of Object.keys(i)) {
|
|
113
113
|
var n;
|
|
114
114
|
if (i[l] !== ((n = o[l]) !== null && n !== void 0 ? n : a[l]))
|
|
115
115
|
return !1;
|
|
116
116
|
}
|
|
117
117
|
return !0;
|
|
118
|
-
},
|
|
119
|
-
var a = i.defaultClassName, l =
|
|
118
|
+
}, C = (i) => (o) => {
|
|
119
|
+
var a = i.defaultClassName, l = W(W({}, i.defaultVariants), o);
|
|
120
120
|
for (var n in l) {
|
|
121
|
-
var
|
|
122
|
-
if (
|
|
123
|
-
var p =
|
|
121
|
+
var w, g = (w = l[n]) !== null && w !== void 0 ? w : i.defaultVariants[n];
|
|
122
|
+
if (g != null) {
|
|
123
|
+
var p = g;
|
|
124
124
|
typeof p == "boolean" && (p = p === !0 ? "true" : "false");
|
|
125
|
-
var
|
|
125
|
+
var f = (
|
|
126
126
|
// @ts-expect-error
|
|
127
127
|
i.variantClassNames[n][p]
|
|
128
128
|
);
|
|
129
|
-
|
|
129
|
+
f && (a += " " + f);
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
|
-
for (var [
|
|
133
|
-
|
|
132
|
+
for (var [x, D] of i.compoundVariants)
|
|
133
|
+
ge(x, l, i.defaultVariants) && (a += " " + D);
|
|
134
134
|
return a;
|
|
135
|
-
},
|
|
136
|
-
function
|
|
135
|
+
}, Fe = "rh07jws", R = "rh07jwt", xe = "rh07jwr", be = C({ defaultClassName: "rh07jw0", variantClassNames: { active: { true: "rh07jw1", false: "rh07jw2" }, mini: { true: "rh07jw3", false: "rh07jw4" }, error: { true: "rh07jw5", false: "rh07jw6" }, shown: { true: "rh07jw7", false: "rh07jw8" }, disabled: { true: "rh07jw9", false: "rh07jwa" } }, defaultVariants: { active: !1, mini: !1, error: !1, shown: !0, disabled: !1 }, compoundVariants: [] }), ye = "rh07jww", Ee = C({ defaultClassName: "rh07jwb", variantClassNames: { constrainContentWidth: { true: "rh07jwc", false: "rh07jwd" }, disabled: { true: "rh07jwe", false: "rh07jwf" } }, defaultVariants: { constrainContentWidth: !1, disabled: !1 }, compoundVariants: [] }), Se = "rh07jwv", Ue = "rh07jwx", je = C({ defaultClassName: "rh07jwh", variantClassNames: { mini: { true: "rh07jwi", false: "rh07jwj" }, error: { true: "rh07jwk", false: "rh07jwl" }, disabled: { true: "rh07jwm", false: "rh07jwn" } }, defaultVariants: { mini: !1, error: !1, disabled: !1 }, compoundVariants: [] }), k = "rh07jwg", Ce = "rh07jwu", De = C({ defaultClassName: "rh07jwo", variantClassNames: { mini: { true: "rh07jwp", false: "rh07jwq" } }, defaultVariants: { mini: !1 }, compoundVariants: [] });
|
|
136
|
+
function X({
|
|
137
137
|
constrainContentWidth: i,
|
|
138
138
|
description: o,
|
|
139
139
|
multiple: a = !1,
|
|
140
140
|
dismissable: l,
|
|
141
141
|
processing: n,
|
|
142
|
-
mini:
|
|
143
|
-
downloadLabel:
|
|
142
|
+
mini: w,
|
|
143
|
+
downloadLabel: g,
|
|
144
144
|
acceptExtensions: p,
|
|
145
|
-
maxSize:
|
|
146
|
-
customRequirement:
|
|
147
|
-
onSelection:
|
|
148
|
-
onDismiss:
|
|
149
|
-
download:
|
|
150
|
-
shown:
|
|
151
|
-
className:
|
|
152
|
-
|
|
153
|
-
|
|
145
|
+
maxSize: f,
|
|
146
|
+
customRequirement: x,
|
|
147
|
+
onSelection: D,
|
|
148
|
+
onDismiss: N,
|
|
149
|
+
download: P,
|
|
150
|
+
shown: b,
|
|
151
|
+
className: G,
|
|
152
|
+
disabled: c,
|
|
153
|
+
children: Te,
|
|
154
|
+
...Z
|
|
154
155
|
}) {
|
|
155
|
-
const y = e.useRef(/* @__PURE__ */ new Set()), [
|
|
156
|
+
const y = e.useRef(/* @__PURE__ */ new Set()), [q, M] = e.useState(b), [Ne, H] = e.useState([]), [J, K] = e.useState(""), [A, Y] = e.useState(), [Q, E] = e.useState(!1), [F, S] = e.useState(!1), [O, B] = e.useState([]), [_, $] = e.useState(""), { t: v } = e.useContext(ue), U = v(a ? "design-system:fileUpload.instructions_plural" : "design-system:fileUpload.instructions").split("|"), ee = o || (a ? "Files" : "File"), u = e.useRef(null);
|
|
156
157
|
e.useEffect(() => {
|
|
157
|
-
|
|
158
|
-
}, [
|
|
159
|
-
|
|
160
|
-
}, [
|
|
161
|
-
p &&
|
|
158
|
+
b && M(b);
|
|
159
|
+
}, [b]), e.useEffect(() => {
|
|
160
|
+
f && ie(f);
|
|
161
|
+
}, [f]), e.useEffect(() => {
|
|
162
|
+
p && ae(p);
|
|
162
163
|
}, [p]);
|
|
163
|
-
function
|
|
164
|
-
l && (
|
|
164
|
+
function te() {
|
|
165
|
+
l && (M(!1), N && N());
|
|
165
166
|
}
|
|
166
|
-
function
|
|
167
|
+
function ie(t) {
|
|
167
168
|
try {
|
|
168
|
-
|
|
169
|
+
Y(ve(t));
|
|
169
170
|
} catch {
|
|
170
171
|
throw new Error(`Could not parse "${t}" as a file size.`);
|
|
171
172
|
}
|
|
172
173
|
}
|
|
173
|
-
function
|
|
174
|
-
const
|
|
175
|
-
|
|
176
|
-
r.map((
|
|
174
|
+
function ae(t) {
|
|
175
|
+
const m = (Array.isArray(t) ? t : t.trim().split(/\s?,\s?/)).map((h) => h.replace(/^\./, "")), r = m.map((h) => `.${h}`.toLowerCase());
|
|
176
|
+
$(
|
|
177
|
+
r.map((h, j) => j > 0 && j === r.length - 1 ? `or ${h}` : h).join(r.length > 2 ? ", " : " ")
|
|
177
178
|
), y.current.clear();
|
|
178
|
-
for (const
|
|
179
|
-
const
|
|
180
|
-
for (const
|
|
181
|
-
y.current.add(
|
|
179
|
+
for (const h of m) {
|
|
180
|
+
const j = Object.keys(z).includes(h.toUpperCase()) ? z[h.toUpperCase()] : [];
|
|
181
|
+
for (const de of j)
|
|
182
|
+
y.current.add(de);
|
|
182
183
|
}
|
|
183
|
-
|
|
184
|
+
K(r.concat(Array.from(y.current)).join(","));
|
|
184
185
|
}
|
|
185
|
-
function
|
|
186
|
-
|
|
186
|
+
function T(t) {
|
|
187
|
+
B([]);
|
|
187
188
|
let s = [];
|
|
188
|
-
const
|
|
189
|
-
for (const r of
|
|
190
|
-
r === null ? s.push("Not a file") : (p && !y.current.has(r.type) && s.push(r.name),
|
|
191
|
-
s.length ? (
|
|
189
|
+
const m = Array.from(t);
|
|
190
|
+
for (const r of m)
|
|
191
|
+
r === null ? s.push("Not a file") : (p && !y.current.has(r.type) && s.push(r.name), f && A && r.size > A && s.indexOf(r.name) === -1 && s.push(r.name));
|
|
192
|
+
s.length ? (S(!0), u.current && u.current.value && (u.current.value = "")) : (H(m), D(m)), B(s);
|
|
192
193
|
}
|
|
193
|
-
function
|
|
194
|
-
t.preventDefault(),
|
|
195
|
-
}
|
|
196
|
-
function le() {
|
|
197
|
-
N && N();
|
|
194
|
+
function le(t) {
|
|
195
|
+
t.preventDefault(), S(!1), u.current && u.current.click();
|
|
198
196
|
}
|
|
199
|
-
function oe(
|
|
200
|
-
|
|
197
|
+
function oe() {
|
|
198
|
+
P && P();
|
|
201
199
|
}
|
|
202
200
|
function ne(t) {
|
|
203
|
-
t.
|
|
201
|
+
t.stopPropagation(), T(t.target.files || []), u.current && u.current.value && (u.current.value = "");
|
|
204
202
|
}
|
|
205
203
|
function se(t) {
|
|
206
|
-
t.preventDefault(),
|
|
204
|
+
t.preventDefault(), t.stopPropagation(), E(!0), S(!1);
|
|
207
205
|
}
|
|
208
206
|
function re(t) {
|
|
209
|
-
t.preventDefault(),
|
|
207
|
+
t.preventDefault(), E(!0), S(!1);
|
|
210
208
|
}
|
|
211
209
|
function pe(t) {
|
|
212
|
-
t.preventDefault(),
|
|
210
|
+
t.preventDefault(), E(!1);
|
|
211
|
+
}
|
|
212
|
+
function ce(t) {
|
|
213
|
+
t.preventDefault(), t.stopPropagation(), E(!1), t.dataTransfer.items ? T(
|
|
213
214
|
Array.from(t.dataTransfer.items).map(
|
|
214
215
|
(s) => s.getAsFile()
|
|
215
216
|
)
|
|
216
|
-
) :
|
|
217
|
+
) : T(t.dataTransfer.files);
|
|
217
218
|
}
|
|
218
219
|
return /* @__PURE__ */ e.createElement(
|
|
219
220
|
"div",
|
|
220
221
|
{
|
|
221
|
-
onDrop:
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
222
|
+
onDrop: c ? () => {
|
|
223
|
+
} : ce,
|
|
224
|
+
onDragOver: c ? () => {
|
|
225
|
+
} : se,
|
|
226
|
+
onDragLeave: c ? () => {
|
|
227
|
+
} : pe,
|
|
228
|
+
onDragEnter: c ? () => {
|
|
229
|
+
} : re,
|
|
230
|
+
className: I(be({ active: Q, mini: w, error: F, shown: q, disabled: c }), G),
|
|
231
|
+
...Z
|
|
227
232
|
},
|
|
228
|
-
/* @__PURE__ */ e.createElement("div", { className:
|
|
229
|
-
|
|
233
|
+
/* @__PURE__ */ e.createElement("div", { className: I(Ee({ constrainContentWidth: i, disabled: c })) }, n ? /* @__PURE__ */ e.createElement("div", null, /* @__PURE__ */ e.createElement(me, { size: "md", "aria-hidden": "true" }), /* @__PURE__ */ e.createElement("div", { className: k }, v("design-system:fileUpload.processing"))) : /* @__PURE__ */ e.createElement("div", null, /* @__PURE__ */ e.createElement(
|
|
234
|
+
he,
|
|
230
235
|
{
|
|
231
|
-
className:
|
|
232
|
-
icon:
|
|
236
|
+
className: je({ mini: w, error: F, disabled: c }),
|
|
237
|
+
icon: F ? "exclamation-circle" : "upload-cloud",
|
|
233
238
|
"aria-hidden": "true"
|
|
234
239
|
}
|
|
235
|
-
), /* @__PURE__ */ e.createElement("div", { className:
|
|
236
|
-
|
|
237
|
-
)) : /* @__PURE__ */ e.createElement("div", null,
|
|
238
|
-
|
|
239
|
-
const
|
|
240
|
-
return /* @__PURE__ */ e.createElement("div", { className:
|
|
240
|
+
), /* @__PURE__ */ e.createElement("div", { className: De({ mini: w }) }, F ? /* @__PURE__ */ e.createElement("div", null, v(
|
|
241
|
+
O.length > 1 ? "design-system:fileUpload.cancelled_plural" : "design-system:fileUpload.cancelled"
|
|
242
|
+
)) : /* @__PURE__ */ e.createElement("div", null, v("design-system:fileUpload.title", { description: ee }))), F ? /* @__PURE__ */ e.createElement("div", { className: xe }, new Set(
|
|
243
|
+
O.map((t, s) => {
|
|
244
|
+
const m = Math.floor(t.length / 2);
|
|
245
|
+
return /* @__PURE__ */ e.createElement("div", { className: Fe, key: t }, /* @__PURE__ */ e.createElement("span", { className: R }, t.substr(0, m)), /* @__PURE__ */ e.createElement("div", { className: R }, /* @__PURE__ */ e.createElement("span", null, t.substr(m))), s < O.length - 1 ? "," : "");
|
|
241
246
|
})
|
|
242
|
-
)) : /* @__PURE__ */ e.createElement("span", null), /* @__PURE__ */ e.createElement("div", { className:
|
|
243
|
-
fileTypes:
|
|
244
|
-
}), " ", ")") : "",
|
|
247
|
+
)) : /* @__PURE__ */ e.createElement("span", null), /* @__PURE__ */ e.createElement("div", { className: k }, /* @__PURE__ */ e.createElement("div", null, /* @__PURE__ */ e.createElement("span", null, U[0]), c ? /* @__PURE__ */ e.createElement("u", null, U[1]) : /* @__PURE__ */ e.createElement("a", { href: "", onClick: le }, U[1]), /* @__PURE__ */ e.createElement("span", null, U[2]))), /* @__PURE__ */ e.createElement("div", { className: Ce }, p ? /* @__PURE__ */ e.createElement("span", null, "(", " ", v("design-system:fileUpload.acceptedTypes", {
|
|
248
|
+
fileTypes: _
|
|
249
|
+
}), " ", ")") : "", f ? /* @__PURE__ */ e.createElement("span", null, "( ", v("design-system:fileUpload.maximumSize", { size: f }), " )") : "", x ? /* @__PURE__ */ e.createElement("span", null, " ", x, " ") : ""), g && /* @__PURE__ */ e.createElement("div", { className: Se }, /* @__PURE__ */ e.createElement(V, { disabled: c, kind: "link", icon: "download-cloud", onClick: oe }, g)))),
|
|
245
250
|
l && !n && /* @__PURE__ */ e.createElement("div", { className: ye }, /* @__PURE__ */ e.createElement(
|
|
246
|
-
|
|
251
|
+
V,
|
|
247
252
|
{
|
|
253
|
+
disabled: c,
|
|
248
254
|
kind: "icon",
|
|
249
255
|
icon: "x",
|
|
250
|
-
title:
|
|
251
|
-
onClick:
|
|
256
|
+
title: v("design-system:fileUpload.close"),
|
|
257
|
+
onClick: te
|
|
252
258
|
}
|
|
253
259
|
)),
|
|
254
|
-
/* @__PURE__ */ e.createElement("form", { className:
|
|
260
|
+
/* @__PURE__ */ e.createElement("form", { className: Ue }, /* @__PURE__ */ e.createElement(
|
|
255
261
|
"input",
|
|
256
262
|
{
|
|
257
|
-
ref:
|
|
263
|
+
ref: u,
|
|
258
264
|
type: "file",
|
|
259
|
-
accept:
|
|
265
|
+
accept: J || "*/*",
|
|
260
266
|
multiple: a || void 0,
|
|
261
|
-
onChange:
|
|
267
|
+
onChange: ne
|
|
262
268
|
}
|
|
263
269
|
))
|
|
264
270
|
);
|
|
265
271
|
}
|
|
266
|
-
|
|
272
|
+
fe.set(X, {
|
|
267
273
|
name: "FileUpload",
|
|
268
274
|
props: {
|
|
269
275
|
constrainContentWidth: { type: "boolean" },
|
|
@@ -277,11 +283,12 @@ de.set(k, {
|
|
|
277
283
|
customRequirement: { type: "string" },
|
|
278
284
|
onSelection: { type: "(files: File[]) => void", required: !0 },
|
|
279
285
|
dismissal: { type: "() => void" },
|
|
280
|
-
download: { type: "() => void" }
|
|
286
|
+
download: { type: "() => void" },
|
|
287
|
+
disabled: { type: "boolean" }
|
|
281
288
|
}
|
|
282
289
|
});
|
|
283
290
|
const Oe = {
|
|
284
|
-
components: [
|
|
291
|
+
components: [X],
|
|
285
292
|
examples: {
|
|
286
293
|
basic: {
|
|
287
294
|
label: "Basic File Upload",
|
|
@@ -289,7 +296,7 @@ const Oe = {
|
|
|
289
296
|
examples: {
|
|
290
297
|
basic: {
|
|
291
298
|
description: "Single file upload",
|
|
292
|
-
react:
|
|
299
|
+
react: d`
|
|
293
300
|
import { FileUpload } from "@sps-woodland/file-upload";
|
|
294
301
|
|
|
295
302
|
function Component() {
|
|
@@ -305,7 +312,7 @@ const Oe = {
|
|
|
305
312
|
},
|
|
306
313
|
multiple: {
|
|
307
314
|
description: "Multiple file upload",
|
|
308
|
-
react:
|
|
315
|
+
react: d`
|
|
309
316
|
import { FileUpload } from "@sps-woodland/file-upload";
|
|
310
317
|
|
|
311
318
|
function Component() {
|
|
@@ -327,7 +334,7 @@ const Oe = {
|
|
|
327
334
|
examples: {
|
|
328
335
|
maxSize: {
|
|
329
336
|
description: "Maximum size",
|
|
330
|
-
react:
|
|
337
|
+
react: d`
|
|
331
338
|
import { FileUpload } from "@sps-woodland/file-upload";
|
|
332
339
|
|
|
333
340
|
function Component() {
|
|
@@ -343,7 +350,7 @@ const Oe = {
|
|
|
343
350
|
},
|
|
344
351
|
fileWhitelist: {
|
|
345
352
|
description: "File type whitelist",
|
|
346
|
-
react:
|
|
353
|
+
react: d`
|
|
347
354
|
import { FileUpload } from "@sps-woodland/file-upload";
|
|
348
355
|
|
|
349
356
|
function Component() {
|
|
@@ -364,7 +371,7 @@ const Oe = {
|
|
|
364
371
|
},
|
|
365
372
|
bothRestrictions: {
|
|
366
373
|
description: "Both restrictions",
|
|
367
|
-
react:
|
|
374
|
+
react: d`
|
|
368
375
|
import { FileUpload } from "@sps-woodland/file-upload";
|
|
369
376
|
|
|
370
377
|
function Component() {
|
|
@@ -391,7 +398,7 @@ const Oe = {
|
|
|
391
398
|
description: "With this option, the file upload component can be dismissed by the user. If the user does dismiss it, you can show it again programmatically if you need to.",
|
|
392
399
|
examples: {
|
|
393
400
|
basic: {
|
|
394
|
-
react:
|
|
401
|
+
react: d`
|
|
395
402
|
import { FileUpload } from "@sps-woodland/file-upload";
|
|
396
403
|
import { Button } from "@sps-woodland/buttons";
|
|
397
404
|
|
|
@@ -430,7 +437,7 @@ const Oe = {
|
|
|
430
437
|
description: "You can optionally provide a button to download a file. Typically this will be a template for whatever the user is expected to upload. They can then fill out the template, save it, and upload it.",
|
|
431
438
|
examples: {
|
|
432
439
|
basic: {
|
|
433
|
-
react:
|
|
440
|
+
react: d`
|
|
434
441
|
import { FileUpload } from "@sps-woodland/file-upload";
|
|
435
442
|
|
|
436
443
|
function Component() {
|
|
@@ -461,7 +468,7 @@ const Oe = {
|
|
|
461
468
|
description: "When the file upload component is to be placed in a small container, it should be marked as a mini file upload so that everything fits.",
|
|
462
469
|
examples: {
|
|
463
470
|
basic: {
|
|
464
|
-
react:
|
|
471
|
+
react: d`
|
|
465
472
|
import { FileUpload } from "@sps-woodland/file-upload";
|
|
466
473
|
|
|
467
474
|
function Component() {
|
|
@@ -486,7 +493,7 @@ const Oe = {
|
|
|
486
493
|
description: "If this prop is provided, the content will be restricted to 50% of the overall width of the component. Consult your product designer if you're not sure whether to use this variant.",
|
|
487
494
|
examples: {
|
|
488
495
|
basic: {
|
|
489
|
-
react:
|
|
496
|
+
react: d`
|
|
490
497
|
import { FileUpload } from "@sps-woodland/file-upload";
|
|
491
498
|
|
|
492
499
|
function Component() {
|
|
@@ -505,12 +512,39 @@ const Oe = {
|
|
|
505
512
|
`
|
|
506
513
|
}
|
|
507
514
|
}
|
|
515
|
+
},
|
|
516
|
+
disabled: {
|
|
517
|
+
label: "Disabled State",
|
|
518
|
+
description: "File Upload have a disabled style for each possible state.",
|
|
519
|
+
examples: {
|
|
520
|
+
basic: {
|
|
521
|
+
description: "Disabled File Upload",
|
|
522
|
+
react: d`
|
|
523
|
+
import { FileUpload } from "@sps-woodland/file-upload";
|
|
524
|
+
|
|
525
|
+
function Component() {
|
|
526
|
+
function selectFile(file) {
|
|
527
|
+
console.log(file);
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
return (
|
|
531
|
+
<FileUpload
|
|
532
|
+
disabled
|
|
533
|
+
downloadLabel="Download Excel Template" download={() => {}}
|
|
534
|
+
dismissable onDismiss={() => {}}
|
|
535
|
+
acceptExtensions="XLS, xlsx, .csv" maxSize="100KB"
|
|
536
|
+
onSelection={selectFile} />
|
|
537
|
+
)
|
|
538
|
+
}
|
|
539
|
+
`
|
|
540
|
+
}
|
|
541
|
+
}
|
|
508
542
|
}
|
|
509
543
|
}
|
|
510
|
-
},
|
|
544
|
+
}, Be = {
|
|
511
545
|
"File Upload": Oe
|
|
512
546
|
};
|
|
513
547
|
export {
|
|
514
|
-
|
|
515
|
-
|
|
548
|
+
X as FileUpload,
|
|
549
|
+
Be as MANIFEST
|
|
516
550
|
};
|
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:#f4ecf2;border-color:#91467f;border-style:solid}.rh07jw3{padding:1rem}.rh07jw5{border-color:#de012e}.rh07jw8{display:none}.rh07jw9{color:#4b5356;margin:0 auto;text-align:center}.
|
|
1
|
+
.rh07jw0{border-width:.0625rem;border-style:dashed;border-radius:.25rem;display:block;padding:1rem;position:relative}.rh07jw1{background-color:#f4ecf2;border-color:#91467f;border-style:solid}.rh07jw3{padding:1rem}.rh07jw5{border-color:#de012e}.rh07jw8{display:none}.rh07jw9{border-color:#d2d4d4}.rh07jwb{color:#4b5356;margin:0 auto;text-align:center}.rh07jwc{width:50%}.rh07jwe{color:#717779}.rh07jwg{font-size:.75rem;line-height:1.25rem}.rh07jwh{color:#717779;display:block;margin-bottom:.25rem}.rh07jwi{font-size:1.5rem;line-height:1.5rem}.rh07jwj{font-size:3rem;line-height:3rem}.rh07jwk{color:#de012e}.rh07jwm{opacity:.5}.rh07jwo{font-weight:600;margin-bottom:.25rem}.rh07jwp{font-size:1rem;line-height:1.25rem}.rh07jwq{font-size:1.125rem;line-height:1.25rem}.rh07jwr{font-size:.875rem;font-weight:600;line-height:1.25rem}.rh07jws{display:flex;justify-content:center;white-space:nowrap}.rh07jwt{max-width:50%;overflow:hidden}.rh07jwt:first-child{text-overflow:ellipsis}.rh07jwt:last-child{float:right}.rh07jwu{font-size:.75rem;line-height:1.125rem;margin-top:.25rem}.rh07jwu>span+span{margin-left:.125rem}.rh07jwv{margin-top:1rem}.rh07jww{position:absolute;right:.5rem;top:.5rem}.rh07jwx{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.14.1",
|
|
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/utils": "^7.0.0",
|
|
31
31
|
"react": "^16.14.0",
|
|
32
32
|
"react-dom": "^16.14.0",
|
|
33
|
-
"@sps-woodland/buttons": "8.
|
|
34
|
-
"@sps-woodland/core": "8.
|
|
35
|
-
"@sps-woodland/tokens": "8.
|
|
36
|
-
"@spscommerce/ds-react": "8.
|
|
37
|
-
"@spscommerce/ds-shared": "8.
|
|
33
|
+
"@sps-woodland/buttons": "8.14.1",
|
|
34
|
+
"@sps-woodland/core": "8.14.1",
|
|
35
|
+
"@sps-woodland/tokens": "8.14.1",
|
|
36
|
+
"@spscommerce/ds-react": "8.14.1",
|
|
37
|
+
"@spscommerce/ds-shared": "8.14.1"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@spscommerce/ds-illustrations": "^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/buttons": "8.
|
|
47
|
-
"@sps-woodland/core": "8.
|
|
48
|
-
"@sps-woodland/tokens": "8.
|
|
49
|
-
"@spscommerce/ds-colors": "8.
|
|
50
|
-
"@spscommerce/ds-react": "8.
|
|
51
|
-
"@spscommerce/ds-shared": "8.
|
|
46
|
+
"@sps-woodland/buttons": "8.14.1",
|
|
47
|
+
"@sps-woodland/core": "8.14.1",
|
|
48
|
+
"@sps-woodland/tokens": "8.14.1",
|
|
49
|
+
"@spscommerce/ds-colors": "8.14.1",
|
|
50
|
+
"@spscommerce/ds-react": "8.14.1",
|
|
51
|
+
"@spscommerce/ds-shared": "8.14.1"
|
|
52
52
|
},
|
|
53
53
|
"scripts": {
|
|
54
54
|
"build": "pnpm run build:js && pnpm run build:types",
|