@onewelcome/react-lib-components 6.2.0 → 6.4.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/dist/cjs/Form/FileUpload/FileItem/FileItem.cjs.js +2 -0
- package/dist/cjs/Form/FileUpload/FileItem/FileItem.cjs.js.map +1 -0
- package/dist/cjs/Form/FileUpload/FileItem/FileItem.modules.cjs.js +2 -0
- package/dist/cjs/Form/FileUpload/FileItem/FileItem.modules.cjs.js.map +1 -0
- package/dist/cjs/Form/FileUpload/FileUpload.cjs.js +2 -0
- package/dist/cjs/Form/FileUpload/FileUpload.cjs.js.map +1 -0
- package/dist/cjs/Form/FileUpload/FileUpload.module.cjs.js +2 -0
- package/dist/cjs/Form/FileUpload/FileUpload.module.cjs.js.map +1 -0
- package/dist/cjs/Notifications/Dialog/Dialog.cjs.js +1 -1
- package/dist/cjs/Notifications/Dialog/Dialog.cjs.js.map +1 -1
- package/dist/cjs/Notifications/Dialog/DialogTitle/DialogTitle.cjs.js +1 -1
- package/dist/cjs/Notifications/Dialog/DialogTitle/DialogTitle.cjs.js.map +1 -1
- package/dist/cjs/Notifications/Dialog/DialogTitle/DialogTitle.module.cjs.js +1 -1
- package/dist/cjs/src/components/Notifications/Dialog/DialogTitle/DialogTitle.d.ts +1 -0
- package/dist/cjs/src/index.cjs.js +1 -1
- package/dist/cjs/src/index.d.ts +2 -0
- package/dist/esm/Form/FileUpload/FileItem/FileItem.esm.js +2 -0
- package/dist/esm/Form/FileUpload/FileItem/FileItem.esm.js.map +1 -0
- package/dist/esm/Form/FileUpload/FileItem/FileItem.modules.esm.js +2 -0
- package/dist/esm/Form/FileUpload/FileItem/FileItem.modules.esm.js.map +1 -0
- package/dist/esm/Form/FileUpload/FileUpload.esm.js +2 -0
- package/dist/esm/Form/FileUpload/FileUpload.esm.js.map +1 -0
- package/dist/esm/Form/FileUpload/FileUpload.module.esm.js +2 -0
- package/dist/esm/Form/FileUpload/FileUpload.module.esm.js.map +1 -0
- package/dist/esm/Notifications/Dialog/Dialog.esm.js +1 -1
- package/dist/esm/Notifications/Dialog/Dialog.esm.js.map +1 -1
- package/dist/esm/Notifications/Dialog/DialogTitle/DialogTitle.esm.js +1 -1
- package/dist/esm/Notifications/Dialog/DialogTitle/DialogTitle.esm.js.map +1 -1
- package/dist/esm/Notifications/Dialog/DialogTitle/DialogTitle.module.esm.js +1 -1
- package/dist/esm/src/components/Notifications/Dialog/DialogTitle/DialogTitle.d.ts +1 -0
- package/dist/esm/src/index.d.ts +2 -0
- package/dist/esm/src/index.esm.js +1 -1
- package/package.json +19 -19
- package/src/components/Notifications/Dialog/Dialog.tsx +7 -4
- package/src/components/Notifications/Dialog/DialogTitle/DialogTitle.module.scss +18 -1
- package/src/components/Notifications/Dialog/DialogTitle/DialogTitle.tsx +33 -20
- package/src/index.ts +2 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});var e=require("react");var t=require("./FileItem.modules.cjs.js");var a=require("../../../Typography/Typography.cjs.js");var n=require("../../../Icon/Icon.cjs.js");var r=require("../../../ProgressBar/ProgressBar.cjs.js");function o(e){return e&&typeof e==="object"&&"default"in e?e:{default:e}}var c=o(e);exports.FILE_ACTION=void 0;(function(e){e["DELETE"]="delete";e["REMOVE"]="remove";e["ABORT"]="abort";e["RETRY"]="retry"})(exports.FILE_ACTION||(exports.FILE_ACTION={}));const s=({name:e,status:o,error:s,progress:l,onRequestedFileAction:i},u)=>{const I=e=>{switch(e){case"completed":return{fileIcon:n.Icons.FileOutline,actionIcon:{type:n.Icons.Trash,action:exports.FILE_ACTION.DELETE}};case"error":return{fileIcon:n.Icons.InfoCircle,actionIcon:{type:n.Icons.Times,action:exports.FILE_ACTION.REMOVE}};case"uploading":return{fileIcon:n.Icons.FileUpload,actionIcon:{type:n.Icons.Times,action:exports.FILE_ACTION.ABORT}};case"retry":return{fileIcon:n.Icons.InfoCircle,actionIcon:{type:n.Icons.Refresh,action:exports.FILE_ACTION.RETRY}};case"readonly":default:return{fileIcon:n.Icons.FileOutline}}};const f=I(o);const d=e=>{const t=e.indexOf(".");return{friendlyName:e.slice(0,t),extension:e.slice(t+1)}};const{friendlyName:p,extension:m}=d(e);return c["default"].createElement("div",{ref:u,className:t["default"]["file-item-wrapper"],"aria-label":`${e}-wrapper`},c["default"].createElement(a.Typography,{variant:"body",title:e,className:`${t["default"]["file-name"]} ${o?t["default"][o]:""}`},c["default"].createElement(n.Icon,{icon:f.fileIcon,className:t["default"]["file-icon"]}),c["default"].createElement("span",{className:t["default"]["friendly-name"]},p),".",c["default"].createElement("span",null,m),f.actionIcon&&c["default"].createElement(n.Icon,{title:f.actionIcon.action,icon:f.actionIcon.type,className:t["default"]["action-icon"],onClick:()=>f.actionIcon&&i&&i(f.actionIcon.action,e)})),s&&c["default"].createElement(a.Typography,{variant:"sub-text",className:`${t["default"]["file-subtitle"]} ${o?t["default"][o]:""}`},s),o==="uploading"?c["default"].createElement(r.ProgressBar,{className:t["default"]["progress-bar"],completed:l}):"")};const l=c["default"].forwardRef(s);exports.FileItem=l;
|
|
2
|
+
//# sourceMappingURL=FileItem.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileItem.cjs.js","sources":["../../../../../../../src/components/Form/FileUpload/FileItem/FileItem.tsx"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { ComponentPropsWithRef, ForwardRefRenderFunction } from \"react\";\nimport classes from \"./FileItem.modules.scss\";\nimport { Typography } from \"../../../Typography/Typography\";\nimport { Icon, Icons } from \"../../../Icon/Icon\";\nimport { ProgressBar } from \"../../../ProgressBar/ProgressBar\";\nimport { FileType } from \"../FileUpload\";\n\nexport type UploadProgress = \"uploading\" | \"completed\" | \"error\" | \"readonly\" | \"retry\";\n\nexport interface Props extends ComponentPropsWithRef<\"div\"> {\n name: string;\n status?: UploadProgress;\n progress?: number;\n error?: string;\n onRequestedFileAction?: (action: FILE_ACTION, name: FileType[\"name\"]) => void;\n}\ninterface FileItemIcons {\n fileIcon: Icons;\n actionIcon?: { type: Icons; action: FILE_ACTION };\n}\n\nexport enum FILE_ACTION {\n DELETE = \"delete\",\n REMOVE = \"remove\",\n ABORT = \"abort\",\n RETRY = \"retry\"\n}\n\nconst FileItemComponent: ForwardRefRenderFunction<HTMLDivElement, Props> = (\n { name, status, error, progress, onRequestedFileAction }: Props,\n ref\n) => {\n const determineIcons = (status?: UploadProgress): FileItemIcons => {\n switch (status) {\n case \"completed\":\n return {\n fileIcon: Icons.FileOutline,\n actionIcon: {\n type: Icons.Trash,\n action: FILE_ACTION.DELETE\n }\n };\n case \"error\":\n return {\n fileIcon: Icons.InfoCircle,\n actionIcon: {\n type: Icons.Times,\n action: FILE_ACTION.REMOVE\n }\n };\n case \"uploading\":\n return {\n fileIcon: Icons.FileUpload,\n actionIcon: {\n type: Icons.Times,\n action: FILE_ACTION.ABORT\n }\n };\n case \"retry\":\n return {\n fileIcon: Icons.InfoCircle,\n actionIcon: {\n type: Icons.Refresh,\n action: FILE_ACTION.RETRY\n }\n };\n case \"readonly\":\n default:\n return { fileIcon: Icons.FileOutline };\n }\n };\n\n const icons = determineIcons(status);\n\n const getFriendlyNameAndExtension = (name: string) => {\n const index = name.indexOf(\".\");\n return { friendlyName: name.slice(0, index), extension: name.slice(index + 1) };\n };\n\n const { friendlyName, extension } = getFriendlyNameAndExtension(name);\n\n return (\n <div ref={ref} className={classes[\"file-item-wrapper\"]} aria-label={`${name}-wrapper`}>\n <Typography\n variant={\"body\"}\n title={name}\n className={`${classes[\"file-name\"]} ${status ? classes[status] : \"\"}`}\n >\n <Icon icon={icons.fileIcon} className={classes[\"file-icon\"]} />\n <span className={classes[\"friendly-name\"]}>{friendlyName}</span>.<span>{extension}</span>\n {icons.actionIcon && (\n <Icon\n title={icons.actionIcon.action}\n icon={icons.actionIcon.type}\n className={classes[\"action-icon\"]}\n onClick={() =>\n icons.actionIcon &&\n onRequestedFileAction &&\n onRequestedFileAction(icons.actionIcon.action, name)\n }\n />\n )}\n </Typography>\n {error && (\n <Typography\n variant={\"sub-text\"}\n className={`${classes[\"file-subtitle\"]} ${status ? classes[status] : \"\"}`}\n >\n {error}\n </Typography>\n )}\n {status === \"uploading\" ? (\n <ProgressBar className={classes[\"progress-bar\"]} completed={progress} />\n ) : (\n \"\"\n )}\n </div>\n );\n};\n\nexport const FileItem = React.forwardRef(FileItemComponent);\n"],"names":["FILE_ACTION","FileItemComponent","name","status","error","progress","onRequestedFileAction","ref","determineIcons","fileIcon","Icons","FileOutline","actionIcon","type","Trash","action","DELETE","InfoCircle","Times","REMOVE","FileUpload","ABORT","Refresh","RETRY","icons","getFriendlyNameAndExtension","index","indexOf","friendlyName","slice","extension","React","createElement","className","classes","Typography","variant","title","Icon","icon","onClick","ProgressBar","completed","FileItem","forwardRef"],"mappings":"uXAqCYA,QAKXA,iBAAA,GALD,SAAYA,GACVA,EAAA,UAAA,SACAA,EAAA,UAAA,SACAA,EAAA,SAAA,QACAA,EAAA,SAAA,OACD,EALD,CAAYA,sBAAAA,QAAAA,YAKX,CAAA,IAED,MAAMC,EAAqE,EACvEC,OAAMC,SAAQC,QAAOC,WAAUC,yBACjCC,KAEA,MAAMC,EAAkBL,IACtB,OAAQA,GACN,IAAK,YACH,MAAO,CACLM,SAAUC,EAAKA,MAACC,YAChBC,WAAY,CACVC,KAAMH,EAAKA,MAACI,MACZC,OAAQf,QAAWA,YAACgB,SAG1B,IAAK,QACH,MAAO,CACLP,SAAUC,EAAKA,MAACO,WAChBL,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,EAAMZ,WAAWG,OAAQb,MAKtDE,GACC2B,EAAAA,WAACC,cAAAG,EAAUA,YACTC,QAAS,WACTH,UAAW,GAAGC,EAAO,WAAC,oBAAoB/B,EAAS+B,aAAQ/B,GAAU,MAEpEC,GAGJD,IAAW,YACV4B,EAAAA,WAACC,cAAAS,EAAAA,YAAY,CAAAR,UAAWC,EAAO,WAAC,gBAAiBQ,UAAWrC,IAE5D,GAGJ,EAGS,MAAAsC,EAAWZ,EAAAA,WAAMa,WAAW3C"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});var e=require("../../../node_modules/style-inject/dist/style-inject.es.cjs.js");var i='/*!\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/*!\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.FileItem-modules_sr-only__OwtI4{clip:rect(0,0,0,0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.FileItem-modules_hidden__w5rVy{display:none}.FileItem-modules_slide-in__g2fUZ{animation:FileItem-modules_slide-in__g2fUZ .5s forwards}@media (prefers-reduced-motion:reduce){.FileItem-modules_slide-in__g2fUZ{animation-duration:.1ms}}.FileItem-modules_slide-out__-dBYM{animation:FileItem-modules_slide-out__-dBYM .5s forwards}@media (prefers-reduced-motion:reduce){.FileItem-modules_slide-out__-dBYM{animation-duration:.1ms}}@keyframes FileItem-modules_slide-in__g2fUZ{0%{transform:translateY(100vh)}to{transform:translateY(0)}}@keyframes FileItem-modules_slide-out__-dBYM{0%{transform:translateY(0)}to{transform:translateY(100vh)}}.FileItem-modules_file-item-wrapper__r4sb5{background-color:var(--input-background-color);border-radius:var(--input-border-radius);padding:.5rem 1.25rem;transition-duration:.2s;transition-property:all;transition-timing-function:ease-in-out}@media (prefers-reduced-motion:reduce){.FileItem-modules_file-item-wrapper__r4sb5{transition-duration:.1ms}}.FileItem-modules_file-item-wrapper__r4sb5 [class*=icon]{font-size:1.25rem}.FileItem-modules_file-item-wrapper__r4sb5 .FileItem-modules_progress-bar__kVAJi{background-color:var(--color-black10)}.FileItem-modules_file-item-wrapper__r4sb5 span[class*=bar--]{border-radius:var(--input-border-radius);height:1rem}.FileItem-modules_file-item-wrapper__r4sb5 .FileItem-modules_file-name__twzQ4{align-items:center;display:flex;margin:0}.FileItem-modules_file-item-wrapper__r4sb5 .FileItem-modules_file-name__twzQ4 .FileItem-modules_friendly-name__p3xgX{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.FileItem-modules_file-item-wrapper__r4sb5 .FileItem-modules_action-icon__ODWUg{color:var(--color-primary);cursor:pointer;margin-left:auto;padding-left:1.25rem}.FileItem-modules_file-item-wrapper__r4sb5 .FileItem-modules_file-icon__TbFi8{margin-right:.5rem}.FileItem-modules_file-item-wrapper__r4sb5 .FileItem-modules_file-subtitle__TmXvr,.FileItem-modules_file-item-wrapper__r4sb5 .FileItem-modules_progress-bar__kVAJi{display:block;margin:.3125rem 1.75rem;padding:0}.FileItem-modules_file-item-wrapper__r4sb5 .FileItem-modules_error__Q1RuV,.FileItem-modules_file-item-wrapper__r4sb5 .FileItem-modules_retry__2Euk8{color:var(--error)}.FileItem-modules_file-item-w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ZW0td3JhcHBlciAuZmlsZS1zdWJ0aXRsZSxcbi5maWxlLWl0ZW0td3JhcHBlciAucHJvZ3Jlc3MtYmFyIHtcbiAgZGlzcGxheTogYmxvY2s7XG4gIG1hcmdpbjogMC4zMTI1cmVtIDEuNzVyZW07XG4gIHBhZGRpbmc6IDA7XG59XG4uZmlsZS1pdGVtLXdyYXBwZXIgLmVycm9yLFxuLmZpbGUtaXRlbS13cmFwcGVyIC5yZXRyeSB7XG4gIGNvbG9yOiB2YXIoLS1lcnJvcik7XG59XG4uZmlsZS1pdGVtLXdyYXBwZXIgLnJlYWRvbmx5IHtcbiAgY29sb3I6IHZhcigtLWdyZXllZC1vdXQpO1xufSJdfQ== */';var l={"sr-only":"FileItem-modules_sr-only__OwtI4",hidden:"FileItem-modules_hidden__w5rVy","slide-in":"FileItem-modules_slide-in__g2fUZ","slide-out":"FileItem-modules_slide-out__-dBYM","file-item-wrapper":"FileItem-modules_file-item-wrapper__r4sb5","progress-bar":"FileItem-modules_progress-bar__kVAJi","file-name":"FileItem-modules_file-name__twzQ4","friendly-name":"FileItem-modules_friendly-name__p3xgX","action-icon":"FileItem-modules_action-icon__ODWUg","file-icon":"FileItem-modules_file-icon__TbFi8","file-subtitle":"FileItem-modules_file-subtitle__TmXvr",error:"FileItem-modules_error__Q1RuV",retry:"FileItem-modules_retry__2Euk8",readonly:"FileItem-modules_readonly__Jxi46"};e["default"](i);exports["default"]=l;
|
|
2
|
+
//# sourceMappingURL=FileItem.modules.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileItem.modules.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});var e=require("react");var t=require("../../Button/Button.cjs.js");var a=require("./FileItem/FileItem.cjs.js");var l=require("../../Typography/Typography.cjs.js");var r=require("./FileUpload.module.cjs.js");var s=require("../../Icon/Icon.cjs.js");var o=require("../../src/hooks/useDetermineStatusIcon.cjs.js");function n(e){return e&&typeof e==="object"&&"default"in e?e:{default:e}}var i=n(e);const u=({name:n,accept:u,error:d,success:c,maxFileSize:f,multiple:p,id:m,title:v,labeledBy:g,disabled:h=false,onChange:y,dragAndDropText:E="Drop file here or",selectButtonText:b="Select file",onDragOver:j,onDragLeave:x,wrapperProps:D,onDrop:T,subText:N,onRequestedFileAction:z,exceedingMaxSizeErrorText:F,fileList:q,...I},S)=>{var B;const P=e.useRef(null);const[w,k]=e.useState(false);const[A,C]=e.useState(false);const L=o.useDetermineStatusIcon({success:c,error:d});let R=[r["default"]["file-dropzone"]];let U=[r["default"]["file-selector-sub-text"]];w&&R.push(r["default"]["drag-active"]);A||d&&R.push(r["default"]["error"])&&U.push(r["default"]["error"]);h&&R.push(r["default"]["disabled"]);c&&!d&&R.push(r["default"]["success"]);const M=e=>{let t=q?[...q]:[];const a=q.map((e=>e.name));(e===null||e===void 0?void 0:e.length)&&Array.from(e).forEach((e=>{if(!a.includes(e.name))t=p?[...t,{...$(e),data:e}]:[{...$(e),data:e}]}));return t};const O=e=>{e.preventDefault();e.stopPropagation();let t=M(e.target.files);t.length&&_(t[t.length-1])&&(y===null||y===void 0?void 0:y(t))};const _=e=>{const t=e.name.split(".").pop();return t&&u.includes(t)};const $=e=>{const t={name:e.name,size:e.size,type:e.type};let a=false;if(f&&e.size&&e.size>=f){const e=(f/(1024*1024)).toFixed(2);t.error=F!==null&&F!==void 0?F:`The maximum allowed file size is ${e}MB. Upload a smaller file.`;t.status="error";a=true}C(a);return t};e.useEffect((()=>{if(q.length){const e=q.map((e=>$(e)));y===null||y===void 0?void 0:y(e)}}),[]);const G=e=>{e.preventDefault();e.stopPropagation();if(!w)k(true);j===null||j===void 0?void 0:j(e)};const H=e=>{e.preventDefault();e.stopPropagation();const t=e.target;if(t===null||t===void 0?void 0:t.classList.contains(r["default"]["file-dropzone"]))k(false);x===null||x===void 0?void 0:x(e)};const J=e=>{var t,a;e.preventDefault();e.stopPropagation();if(((t=e===null||e===void 0?void 0:e.dataTransfer)===null||t===void 0?void 0:t.files)&&e.dataTransfer.files.length){const t=(a=e===null||e===void 0?void 0:e.dataTransfer)===null||a===void 0?void 0:a.files[0].name.split(".").pop();if(t&&u&&!u.includes(t)){k(false);return}const l=M(e.dataTransfer.files);T===null||T===void 0?void 0:T(l)}k(false)};return i["default"].createElement("div",{className:r["default"]["file-upload-wrapper"],...D},i["default"].createElement("div",{className:r["default"]["dropzone-wrapper"]},i["default"].createElement("div",{className:R.join(" "),onDragOver:e=>!h&&G(e),onDragLeave:e=>!h&&H(e),onDrop:e=>!h&&J(e)},i["default"].createElement(l.Typography,{variant:"body-bold",className:r["default"]["file-upload-title"],ref:P},v),i["default"].createElement("div",{className:r["default"]["file-select"]},i["default"].createElement(s.Icon,{className:"drop-file-icon",icon:s.Icons.FileUpload}),i["default"].createElement(l.Typography,{variant:"body",className:"drag-and-drop-text"},E),i["default"].createElement("div",{className:r["default"]["file-upload-btn"]},i["default"].createElement(t.Button,{variant:"outline",disabled:h},b,i["default"].createElement("input",{className:r["default"]["upload-input"],...I,ref:S,"aria-labelledby":g,type:"file",name:n,...p&&{multiple:true},disabled:h,accept:u,onChange:O,spellCheck:(B=I.spellCheck)!==null&&B!==void 0?B:false}))),!h&&L,i["default"].createElement("span",{className:r["default"]["outline"]}))),N&&i["default"].createElement(l.Typography,{variant:"sub-text",className:U.join(" ")},N)),(q===null||q===void 0?void 0:q.length)>0&&i["default"].createElement("ul",{className:r["default"]["file-list"]},q.map((({name:e,status:t,progress:l,error:r})=>i["default"].createElement("li",{key:e,className:t,id:e},i["default"].createElement(a.FileItem,{name:e,status:t,progress:l,error:r,onRequestedFileAction:z}))))))};const d=i["default"].forwardRef(u);exports.FileUpload=d;
|
|
2
|
+
//# sourceMappingURL=FileUpload.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileUpload.cjs.js","sources":["../../../../../../src/components/Form/FileUpload/FileUpload.tsx"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, {\n DragEvent,\n DragEventHandler,\n ForwardRefRenderFunction,\n useEffect,\n useRef,\n useState\n} from \"react\";\nimport { Button } from \"../../Button/Button\";\nimport { FILE_ACTION, FileItem, Props as FileConfig } from \"./FileItem/FileItem\";\nimport { Props as InputProps } from \"../Input/Input\";\nimport { Typography } from \"../../Typography/Typography\";\nimport classes from \"./FileUpload.module.scss\";\nimport { Icon, Icons } from \"../../Icon/Icon\";\nimport { useDetermineStatusIcon } from \"../../../hooks/useDetermineStatusIcon\";\n\ntype FileUploadType = Omit<InputProps, \"onDrop\" | \"type\" | \"onChange\" | \"suffix\" | \"prefix\">;\nexport type FileType = Omit<FileConfig, \"onRequestedFileAction\"> &\n Pick<File, \"size\" | \"type\"> & { data?: any };\n\nexport interface Props extends FileUploadType {\n accept: string;\n title: string;\n multiple: boolean;\n fileList: FileType[];\n exceedingMaxSizeErrorText?: string;\n maxFileSize?: number;\n selectButtonText?: string;\n dragAndDropText?: string;\n subText?: string;\n onDragOver?: DragEventHandler;\n onDragEnter?: DragEventHandler;\n onDragLeave?: DragEventHandler;\n onDrop?: (e: FileType[]) => void;\n onChange?: (e: FileType[]) => void;\n onRequestedFileAction?: (action: FILE_ACTION, name: FileType[\"name\"]) => void;\n}\n\nconst FileUploadComponent: ForwardRefRenderFunction<HTMLInputElement, Props> = (\n {\n name,\n accept,\n error,\n success,\n maxFileSize,\n multiple,\n id,\n title,\n labeledBy,\n disabled = false,\n onChange,\n dragAndDropText = \"Drop file here or\",\n selectButtonText = \"Select file\",\n onDragOver,\n onDragLeave,\n wrapperProps,\n onDrop,\n subText,\n onRequestedFileAction,\n exceedingMaxSizeErrorText,\n fileList,\n ...rest\n }: Props,\n ref\n) => {\n const labelRef = useRef(null);\n const [dragActive, setDragActive] = useState(false);\n const [inputError, setInputError] = useState(false);\n const icon = useDetermineStatusIcon({ success, error });\n let dropzoneClassNames = [classes[\"file-dropzone\"]];\n let subTextClass = [classes[\"file-selector-sub-text\"]];\n dragActive && dropzoneClassNames.push(classes[\"drag-active\"]);\n inputError ||\n (error && dropzoneClassNames.push(classes[\"error\"]) && subTextClass.push(classes[\"error\"]));\n disabled && dropzoneClassNames.push(classes[\"disabled\"]);\n success && !error && dropzoneClassNames.push(classes[\"success\"]);\n\n const getFileList = (files: FileList | null): FileType[] => {\n let savedFiles = fileList ? [...fileList] : [];\n const fileNames = fileList.map(el => el.name);\n files?.length &&\n Array.from(files as ArrayLike<File>).forEach(el => {\n if (!fileNames.includes(el.name)) {\n savedFiles = multiple\n ? [\n ...savedFiles,\n {\n ...validateUpload(el),\n data: el\n }\n ]\n : [\n {\n ...validateUpload(el),\n data: el\n }\n ];\n }\n });\n return savedFiles;\n };\n const onInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n e.preventDefault();\n e.stopPropagation();\n let files = getFileList(e.target.files);\n files.length && verifyExtensionValidity(files[files.length - 1]) && onChange?.(files);\n };\n\n const verifyExtensionValidity = (file: FileType) => {\n const extension = file.name.split(\".\").pop();\n return extension && accept.includes(extension);\n };\n\n const validateUpload = (file: FileType) => {\n const result: FileType = {\n name: file.name,\n size: file.size,\n type: file.type\n };\n\n let err = false;\n if (maxFileSize && file.size && file.size >= maxFileSize) {\n const mb = (maxFileSize / (1024 * 1024)).toFixed(2);\n result.error =\n exceedingMaxSizeErrorText ??\n `The maximum allowed file size is ${mb}MB. Upload a smaller file.`;\n result.status = \"error\";\n err = true;\n }\n setInputError(err);\n return result;\n };\n\n useEffect(() => {\n if (fileList.length) {\n const validatedFiles = fileList.map(file => validateUpload(file));\n onChange?.(validatedFiles);\n }\n }, []);\n\n const handleOnDragOver = (e: DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n e.stopPropagation();\n if (!dragActive) {\n setDragActive(true);\n }\n onDragOver?.(e);\n };\n\n const handleOnDragLeave = (e: DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n e.stopPropagation();\n const target = e.target as HTMLElement;\n if (target?.classList.contains(classes[\"file-dropzone\"])) {\n setDragActive(false);\n }\n onDragLeave?.(e);\n };\n\n const handleOnDrop = (e: DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n e.stopPropagation();\n if (e?.dataTransfer?.files && e.dataTransfer.files.length) {\n const extension = e?.dataTransfer?.files[0].name.split(\".\").pop();\n if (extension && accept && !accept.includes(extension)) {\n setDragActive(false);\n return;\n }\n const validatedFiles = getFileList(e.dataTransfer.files);\n onDrop?.(validatedFiles);\n }\n setDragActive(false);\n };\n\n return (\n <div className={classes[\"file-upload-wrapper\"]} {...wrapperProps}>\n <div className={classes[\"dropzone-wrapper\"]}>\n <div\n className={dropzoneClassNames.join(\" \")}\n onDragOver={e => !disabled && handleOnDragOver(e)}\n onDragLeave={e => !disabled && handleOnDragLeave(e)}\n onDrop={e => !disabled && handleOnDrop(e)}\n >\n <Typography variant=\"body-bold\" className={classes[\"file-upload-title\"]} ref={labelRef}>\n {title}\n </Typography>\n <div className={classes[\"file-select\"]}>\n <Icon className={\"drop-file-icon\"} icon={Icons.FileUpload} />\n <Typography variant=\"body\" className={\"drag-and-drop-text\"}>\n {dragAndDropText}\n </Typography>\n <div className={classes[\"file-upload-btn\"]}>\n <Button variant=\"outline\" disabled={disabled}>\n {selectButtonText}\n <input\n className={classes[\"upload-input\"]}\n {...rest}\n ref={ref}\n aria-labelledby={labeledBy}\n type=\"file\"\n name={name}\n {...(multiple && { multiple: true })}\n disabled={disabled}\n accept={accept}\n onChange={onInputChange}\n spellCheck={rest.spellCheck ?? false}\n />\n </Button>\n </div>\n {!disabled && icon}\n <span className={classes[\"outline\"]}></span>\n </div>\n </div>\n {subText && (\n <Typography variant={\"sub-text\"} className={subTextClass.join(\" \")}>\n {subText}\n </Typography>\n )}\n </div>\n {fileList?.length > 0 && (\n <ul className={classes[\"file-list\"]}>\n {fileList.map(({ name, status, progress, error }) => (\n <li key={name} className={status} id={name}>\n <FileItem\n name={name}\n status={status}\n progress={progress}\n error={error}\n onRequestedFileAction={onRequestedFileAction}\n />\n </li>\n ))}\n </ul>\n )}\n </div>\n );\n};\n\nexport const FileUpload = React.forwardRef(FileUploadComponent);\n"],"names":["FileUploadComponent","name","accept","error","success","maxFileSize","multiple","id","title","labeledBy","disabled","onChange","dragAndDropText","selectButtonText","onDragOver","onDragLeave","wrapperProps","onDrop","subText","onRequestedFileAction","exceedingMaxSizeErrorText","fileList","rest","ref","labelRef","useRef","dragActive","setDragActive","useState","inputError","setInputError","icon","useDetermineStatusIcon","dropzoneClassNames","classes","subTextClass","push","getFileList","files","savedFiles","fileNames","map","el","length","Array","from","forEach","includes","validateUpload","data","onInputChange","e","preventDefault","stopPropagation","target","verifyExtensionValidity","file","extension","split","pop","result","size","type","err","mb","toFixed","status","useEffect","validatedFiles","handleOnDragOver","handleOnDragLeave","classList","contains","handleOnDrop","dataTransfer","_a","_b","React","className","createElement","join","Typography","variant","Icon","Icons","FileUpload","Button","spellCheck","progress","key","FileItem","forwardRef"],"mappings":"gdAsDA,MAAMA,EAAyE,EAE3EC,OACAC,SACAC,QACAC,UACAC,cACAC,WACAC,KACAC,QACAC,YACAC,WAAW,MACXC,WACAC,kBAAkB,oBAClBC,mBAAmB,cACnBC,aACAC,cACAC,eACAC,SACAC,UACAC,wBACAC,4BACAC,cACGC,GAELC,WAEA,MAAMC,EAAWC,SAAO,MACxB,MAAOC,EAAYC,GAAiBC,EAAQA,SAAC,OAC7C,MAAOC,EAAYC,GAAiBF,EAAQA,SAAC,OAC7C,MAAMG,EAAOC,EAAsBA,uBAAC,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E,SAAQsB,WAAUrF,WACvC0E,iCAAIY,IAAKxF,EAAM6E,UAAWZ,EAAQ3D,GAAIN,GACpC4E,EAAA,WAAAE,cAACW,WAAQ,CACPzF,KAAMA,EACNiE,OAAQA,EACRsB,SAAUA,EACVrF,MAAOA,EACPgB,sBAAuBA,QAOnC,EAGS,MAAAkE,EAAaR,EAAAA,WAAMc,WAAW3F"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});var l=require("../../../lib/style-inject.js");var e='/*!\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/*!\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.FileUpload-module_sr-only__Awag4{clip:rect(0,0,0,0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.FileUpload-module_hidden__JayBD{display:none}.FileUpload-module_slide-in__w7j8k{animation:FileUpload-module_slide-in__w7j8k .5s forwards}@media (prefers-reduced-motion:reduce){.FileUpload-module_slide-in__w7j8k{animation-duration:.1ms}}.FileUpload-module_slide-out__tZ-rV{animation:FileUpload-module_slide-out__tZ-rV .5s forwards}@media (prefers-reduced-motion:reduce){.FileUpload-module_slide-out__tZ-rV{animation-duration:.1ms}}@keyframes FileUpload-module_slide-in__w7j8k{0%{transform:translateY(100vh)}to{transform:translateY(0)}}@keyframes FileUpload-module_slide-out__tZ-rV{0%{transform:translateY(0)}to{transform:translateY(100vh)}}.FileUpload-module_file-upload-wrapper__CIx-a{display:flex;flex-direction:column}.FileUpload-module_file-dropzone__O-VP-{background-color:var(--input-background-color);border-radius:var(--input-border-radius);padding:1.25rem;position:relative;transition-duration:.2s;transition-property:all;transition-timing-function:ease-in-out}@media (prefers-reduced-motion:reduce){.FileUpload-module_file-dropzone__O-VP-{transition-duration:.1ms}}.FileUpload-module_file-dropzone__O-VP-.FileUpload-module_drag-active__MRJJR .FileUpload-module_outline__QfJ8U{background-color:var(--drag-background-color);border-color:var(--color-blue-grey500);border-radius:var(--input-border-radius);border-style:var(--drag-border-style);border-width:var(--input-border-width);inset:0;margin:0;padding:0;pointer-events:none;position:absolute;transition-duration:.2s;transition-property:all;transition-timing-function:ease-in-out}@media (prefers-reduced-motion:reduce){.FileUpload-module_file-dropzone__O-VP-.FileUpload-module_drag-active__MRJJR .FileUpload-module_outline__QfJ8U{transition-duration:.1ms}}.FileUpload-module_file-dropzone__O-VP-.FileUpload-module_drag-active__MRJJR:hover .FileUpload-module_outline__QfJ8U{background-color:var(--input-hover-background-color);border-color:var(--default)}.FileUpload-module_file-dropzone__O-VP-.FileUpload-module_drag-active__MRJJR .FileUpload-module_outline__QfJ8U.FileUpload-module_disabled__hvZQb{background-color:var(--input-disabled-background-color);border-color:var(--disabled)}.FileUpload-module_file-dropzone__O-VP-.FileUpload-module_drag-active__MRJJR .FileUpload-module_outline__QfJ8U.FileUpload-module_error__q2B-7{border-color:var(--error)}.FileUpload-module_file-dropzone__O-VP-.FileUpload-module_drag-active__MRJJR .FileUpload-module_outline__QfJ8U.FileUpload-module_focus__E3tFz{border-width:var(--input-border-width-focus)}.FileUpload-module_file-dropzone__O-VP-.FileUpload-module_drag-active__MRJJR .FileUpload-module_outline__QfJ8U.FileUpload-module_focus__E3tFz:not(.FileUpload-module_error__q2B-7){border-color:var(--color-focus)}.FileUpload-module_file-dropzone__O-VP-.FileUpload-module_error__q2B-7 .FileUpload-module_file-upload-title__CEPD-,.FileUpload-module_file-dropzone__O-VP-.FileUpload-module_error__q2B-7 span[data-icon-status]{color:var(--error)}.FileUpload-module_file-dropzone__O-VP-.FileUpload-module_success__GqO-7 span[data-icon-status]{color:var(--success)}.FileUpload-module_file-dropzone__O-VP-.FileUpload-module_disabled__hvZQb{background-color:var(--disabled);color:var(--greyed-out);pointer-events:none}.FileUpload-module_file-dropzone__O-VP- span[data-icon-status]{font-size:1.25rem;position:absolute;right:1.375rem;top:2.74rem}.FileUpload-module_file-selector-sub-text__nCXMq{color:var(--greyed-out);padding:0 1.25rem}.FileUpload-module_file-selector-sub-text__nCXMq.FileUpload-module_error__q2B-7{color:var(--error)}.FileUpload-module_file-select__sW1Pn{align-items:center;display:flex;flex-direction:column}.FileUpload-module_file-select__sW1Pn [class*=file]{font-size:1.25rem}.FileUpload-module_file-select__sW1Pn [class*=typography]{margin-bottom:.625rem}.FileUpload-module_upload-input__wteSl{border:none;bottom:0;cursor:pointer;display:block;left:0;opacity:0;position:absolute;right:0;text-transform:none;top:0;width:100%}.FileUpload-module_upload-input__wteSl:focus{outline:none}.FileUpload-module_file-upload-btn__M2Fg-{position:relative}.FileUpload-module_file-list__GLggq{list-style:none;margin:.75rem 0;padding:0}.FileUpload-module_file-list__GLggq li:not(:last-child){margin-bottom:.5rem}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkZpbGVVcGxvYWQubW9kdWxlLnNjc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7Ozs7Ozs7Ozs7O0VBY0U7QUFDRjs7Ozs7Ozs7Ozs7Ozs7RUFjRSxDQUNGLGtDQU9FLGtCQUFzQixDQUN0QixRQUFTLENBTFQsVUFBVyxDQUVYLFdBQ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yZ2luLWJvdHRvbTogMC42MjVyZW07XG59XG5cbi51cGxvYWQtaW5wdXQge1xuICBkaXNwbGF5OiBibG9jaztcbiAgd2lkdGg6IDEwMCU7XG4gIGJvcmRlcjogbm9uZTtcbiAgdGV4dC10cmFuc2Zvcm06IG5vbmU7XG4gIHBvc2l0aW9uOiBhYnNvbHV0ZTtcbiAgdG9wOiAwO1xuICBsZWZ0OiAwO1xuICByaWdodDogMDtcbiAgYm90dG9tOiAwO1xuICBvcGFjaXR5OiAwO1xuICBjdXJzb3I6IHBvaW50ZXI7XG59XG4udXBsb2FkLWlucHV0OmZvY3VzIHtcbiAgb3V0bGluZTogbm9uZTtcbn1cblxuLmZpbGUtdXBsb2FkLWJ0biB7XG4gIHBvc2l0aW9uOiByZWxhdGl2ZTtcbn1cblxuLmZpbGUtbGlzdCB7XG4gIGxpc3Qtc3R5bGU6IG5vbmU7XG4gIHBhZGRpbmc6IDA7XG4gIG1hcmdpbjogMC43NXJlbSAwO1xufVxuLmZpbGUtbGlzdCBsaTpub3QoOmxhc3QtY2hpbGQpIHtcbiAgbWFyZ2luLWJvdHRvbTogMC41cmVtO1xufSJdfQ== */';var i={"sr-only":"FileUpload-module_sr-only__Awag4",hidden:"FileUpload-module_hidden__JayBD","slide-in":"FileUpload-module_slide-in__w7j8k","slide-out":"FileUpload-module_slide-out__tZ-rV","file-upload-wrapper":"FileUpload-module_file-upload-wrapper__CIx-a","file-dropzone":"FileUpload-module_file-dropzone__O-VP-","drag-active":"FileUpload-module_drag-active__MRJJR",outline:"FileUpload-module_outline__QfJ8U",disabled:"FileUpload-module_disabled__hvZQb",error:"FileUpload-module_error__q2B-7",focus:"FileUpload-module_focus__E3tFz","file-upload-title":"FileUpload-module_file-upload-title__CEPD-",success:"FileUpload-module_success__GqO-7","file-selector-sub-text":"FileUpload-module_file-selector-sub-text__nCXMq","file-select":"FileUpload-module_file-select__sW1Pn","upload-input":"FileUpload-module_upload-input__wteSl","file-upload-btn":"FileUpload-module_file-upload-btn__M2Fg-","file-list":"FileUpload-module_file-list__GLggq"};l["default"](e);exports["default"]=i;
|
|
2
|
+
//# sourceMappingURL=FileUpload.module.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileUpload.module.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});var e=require("react");var t=require("../BaseModal/BaseModal.cjs.js");var a=require("../BaseModal/BaseModalContent/BaseModalContent.cjs.js");var o=require("./DialogActions/DialogActions.cjs.js");var n=require("./Dialog.module.cjs.js");var l=require("./DialogTitle/DialogTitle.cjs.js");var r=require("../../Button/Button.cjs.js");var i=require("../BaseModal/BaseModalContext.cjs.js");var s=require("../../src/util/helper.cjs.js");function c(e){return e&&typeof e==="object"&&"default"in e?e:{default:e}}var u=c(e);const d=({id:c,open:d,children:f,onClose:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});var e=require("react");var t=require("../BaseModal/BaseModal.cjs.js");var a=require("../BaseModal/BaseModalContent/BaseModalContent.cjs.js");var o=require("./DialogActions/DialogActions.cjs.js");var n=require("./Dialog.module.cjs.js");var l=require("./DialogTitle/DialogTitle.cjs.js");var r=require("../../Button/Button.cjs.js");var i=require("../BaseModal/BaseModalContext.cjs.js");var s=require("../../src/util/helper.cjs.js");function c(e){return e&&typeof e==="object"&&"default"in e?e:{default:e}}var u=c(e);const d=({id:c,open:d,children:f,onClose:j,title:p,primaryAction:m,secondaryAction:v,cancelAction:B,zIndex:g,titleIcon:y,caption:D,...M},q)=>{const[C]=e.useState(c!==null&&c!==void 0?c:s.generateID(20));const{label:b,...A}=m;const E=u["default"].createElement(r.Button,{key:"primary",...A},b);const I=v&&function(){const{label:e,...t}=v;return u["default"].createElement(r.Button,{key:"tertiary",variant:"outline",...t},e)}();const h=e=>{if(e.key==="Enter")m.onClick()};return u["default"].createElement(t.BaseModal,{...M,ref:q,id:C,className:n["default"]["dialog"],containerProps:{className:n["default"]["container"]},open:d,onClose:j,zIndex:g},u["default"].createElement(l.DialogTitle,{titleIcon:y,caption:D,id:i.labelId(C),title:p,onClose:j}),u["default"].createElement(a.BaseModalContent,{id:i.descriptionId(C),className:n["default"]["content"],disableAutoFocus:true},f),u["default"].createElement(o.DialogActions,{onClose:j,cancelAction:B},[I,E]),u["default"].createElement("input",{autoFocus:true,"aria-hidden":true,style:{position:"absolute",width:0,height:0,opacity:0},maxLength:0,tabIndex:-1,onKeyDown:h}))};const f=u["default"].forwardRef(d);exports.Dialog=f;
|
|
2
2
|
//# sourceMappingURL=Dialog.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.cjs.js","sources":["../../../../../../src/components/Notifications/Dialog/Dialog.tsx"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { ForwardRefRenderFunction, ComponentPropsWithRef, useState } from \"react\";\nimport { BaseModal } from \"../BaseModal/BaseModal\";\nimport { BaseModalContent } from \"../BaseModal/BaseModalContent/BaseModalContent\";\nimport { DialogActions } from \"./DialogActions/DialogActions\";\nimport classes from \"./Dialog.module.scss\";\nimport { DialogTitle } from \"./DialogTitle/DialogTitle\";\nimport { Button, Props as ButtonProps } from \"../../Button/Button\";\nimport { labelId, descriptionId } from \"../BaseModal/BaseModalContext\";\nimport { generateID } from \"../../../util/helper\";\nimport { CancelAction } from \"../BaseModal/BaseModalActions/BaseModalActions\";\n\nexport interface Props extends ComponentPropsWithRef<\"div\"> {\n id?: string;\n open: boolean;\n children: React.ReactNode;\n onClose: () => void;\n title: string;\n primaryAction: Action;\n secondaryAction?: Action;\n cancelAction?: CancelAction;\n zIndex?: number;\n disableEscapeKeyDown?: boolean;\n titleIcon?: React.ReactNode;\n caption?: string;\n}\n\nexport interface Action extends Omit<ButtonProps, \"variant\" | \"ref\"> {\n label: string;\n onClick: (event?: React.MouseEvent<HTMLButtonElement>) => unknown;\n}\n\nconst DialogComponent: ForwardRefRenderFunction<HTMLDivElement, Props> = (\n {\n id,\n open,\n children,\n onClose,\n title,\n primaryAction,\n secondaryAction,\n cancelAction,\n zIndex,\n
|
|
1
|
+
{"version":3,"file":"Dialog.cjs.js","sources":["../../../../../../src/components/Notifications/Dialog/Dialog.tsx"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { ForwardRefRenderFunction, ComponentPropsWithRef, useState } from \"react\";\nimport { BaseModal } from \"../BaseModal/BaseModal\";\nimport { BaseModalContent } from \"../BaseModal/BaseModalContent/BaseModalContent\";\nimport { DialogActions } from \"./DialogActions/DialogActions\";\nimport classes from \"./Dialog.module.scss\";\nimport { DialogTitle } from \"./DialogTitle/DialogTitle\";\nimport { Button, Props as ButtonProps } from \"../../Button/Button\";\nimport { labelId, descriptionId } from \"../BaseModal/BaseModalContext\";\nimport { generateID } from \"../../../util/helper\";\nimport { CancelAction } from \"../BaseModal/BaseModalActions/BaseModalActions\";\n\nexport interface Props extends ComponentPropsWithRef<\"div\"> {\n id?: string;\n open: boolean;\n children: React.ReactNode;\n onClose: () => void;\n title: string;\n primaryAction: Action;\n secondaryAction?: Action;\n cancelAction?: CancelAction;\n zIndex?: number;\n disableEscapeKeyDown?: boolean;\n titleIcon?: React.ReactNode;\n caption?: string;\n}\n\nexport interface Action extends Omit<ButtonProps, \"variant\" | \"ref\"> {\n label: string;\n onClick: (event?: React.MouseEvent<HTMLButtonElement>) => unknown;\n}\n\nconst DialogComponent: ForwardRefRenderFunction<HTMLDivElement, Props> = (\n {\n id,\n open,\n children,\n onClose,\n title,\n primaryAction,\n secondaryAction,\n cancelAction,\n zIndex,\n titleIcon,\n caption,\n ...rest\n }: Props,\n ref\n) => {\n const [dialogId] = useState(id ?? generateID(20));\n const { label: primaryLabel, ...restOfPrimaryAction } = primaryAction;\n const PrimaryButton = (\n <Button key=\"primary\" {...restOfPrimaryAction}>\n {primaryLabel}\n </Button>\n );\n\n const SecondaryButton =\n secondaryAction &&\n (function () {\n const { label: secondaryLabel, ...restOfSecondaryAction } = secondaryAction;\n return (\n <Button key=\"tertiary\" variant=\"outline\" {...restOfSecondaryAction}>\n {secondaryLabel}\n </Button>\n );\n })();\n\n const onHiddenInputKeyPress = (event: React.KeyboardEvent<HTMLInputElement>) => {\n /** It has to be here because then we will need to check if user doesn't click tab to select action button and want to do another action then primary one? */\n if (event.key === \"Enter\") {\n primaryAction.onClick();\n }\n };\n\n return (\n <BaseModal\n {...rest}\n ref={ref}\n id={dialogId}\n className={classes[\"dialog\"]}\n containerProps={{ className: classes[\"container\"] }}\n open={open}\n onClose={onClose}\n zIndex={zIndex}\n >\n <DialogTitle\n titleIcon={titleIcon}\n caption={caption}\n id={labelId(dialogId)}\n title={title}\n onClose={onClose}\n />\n <BaseModalContent\n id={descriptionId(dialogId)}\n className={classes[\"content\"]}\n disableAutoFocus\n >\n {children}\n </BaseModalContent>\n <DialogActions onClose={onClose} cancelAction={cancelAction}>\n {[SecondaryButton, PrimaryButton]}\n </DialogActions>\n <input\n autoFocus\n aria-hidden={true}\n style={{\n position: \"absolute\",\n width: 0,\n height: 0,\n opacity: 0\n }}\n maxLength={0}\n tabIndex={-1}\n onKeyDown={onHiddenInputKeyPress}\n />\n </BaseModal>\n );\n};\n\nexport const Dialog = React.forwardRef(DialogComponent);\n"],"names":["DialogComponent","id","open","children","onClose","title","primaryAction","secondaryAction","cancelAction","zIndex","titleIcon","caption","rest","ref","dialogId","useState","generateID","label","primaryLabel","restOfPrimaryAction","PrimaryButton","React","createElement","Button","key","SecondaryButton","secondaryLabel","restOfSecondaryAction","variant","onHiddenInputKeyPress","event","onClick","BaseModal","className","classes","containerProps","DialogTitle","labelId","BaseModalContent","descriptionId","disableAutoFocus","DialogActions","autoFocus","style","position","width","height","opacity","maxLength","tabIndex","onKeyDown","Dialog","forwardRef"],"mappings":"ukBA+CA,MAAMA,EAAmE,EAErEC,KACAC,OACAC,WACAC,UACAC,QACAC,gBACAC,kBACAC,eACAC,SACAC,YACAC,aACGC,GAELC,KAEA,MAAOC,GAAYC,EAAQA,SAACd,IAAE,MAAFA,SAAE,EAAFA,EAAMe,aAAW,KAC7C,MAAQC,MAAOC,KAAiBC,GAAwBb,EACxD,MAAMc,EACJC,EAAAA,WAAAC,cAACC,SAAO,CAAAC,IAAI,aAAcL,GACvBD,GAIL,MAAMO,EACJlB,GACA,WACE,MAAQU,MAAOS,KAAmBC,GAA0BpB,EAC5D,OACEc,aAACC,cAAAC,EAAMA,OAAC,CAAAC,IAAI,WAAWI,QAAQ,aAAcD,GAC1CD,EAGN,CAPD,GASF,MAAMG,EAAyBC,IAE7B,GAAIA,EAAMN,MAAQ,QAChBlB,EAAcyB,SACf,EAGH,OACEV,aAACC,cAAAU,EAASA,cACJpB,EACJC,IAAKA,EACLZ,GAAIa,EACJmB,UAAWC,EAAAA,WAAQ,UACnBC,eAAgB,CAAEF,UAAWC,EAAO,WAAC,cACrChC,KAAMA,EACNE,QAASA,EACTK,OAAQA,GAERY,EAAC,WAAAC,cAAAc,EAAWA,YACV,CAAA1B,UAAWA,EACXC,QAASA,EACTV,GAAIoC,EAAOA,QAACvB,GACZT,MAAOA,EACPD,QAASA,IAEXiB,EAAAA,WAAAC,cAACgB,EAAAA,iBACC,CAAArC,GAAIsC,EAAaA,cAACzB,GAClBmB,UAAWC,EAAAA,WAAQ,WACnBM,iBAAgB,MAEfrC,GAEHkB,EAAAA,WAAAC,cAACmB,gBAAa,CAACrC,QAASA,EAASI,aAAcA,GAC5C,CAACiB,EAAiBL,IAErBC,aAAAC,cAAA,QAAA,CACEoB,UAAS,KAAA,cACI,KACbC,MAAO,CACLC,SAAU,WACVC,MAAO,EACPC,OAAQ,EACRC,QAAS,GAEXC,UAAW,EACXC,UAAW,EACXC,UAAWrB,IAGf,EAGS,MAAAsB,EAAS9B,EAAAA,WAAM+B,WAAWpD"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});var e=require("react");var t=require("../../../Typography/Typography.cjs.js");var a=require("./DialogTitle.module.cjs.js");var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});var e=require("react");var t=require("../../../Typography/Typography.cjs.js");var a=require("./DialogTitle.module.cjs.js");var l=require("../../../Icon/Icon.cjs.js");var c=require("../../../Button/IconButton.cjs.js");function r(e){return e&&typeof e==="object"&&"default"in e?e:{default:e}}var n=r(e);const o=({id:e,title:r,titleIcon:o,caption:i,onClose:s,...u},d)=>n["default"].createElement("div",{...u,ref:d,className:a["default"]["header"]},n["default"].createElement("div",{className:`${a["default"]["headline"]} ${i?a["default"]["with-caption"]:a["default"]["no-caption"]}`},o&&n["default"].createElement("div",{className:a["default"]["title-icon"]},typeof o==="boolean"?n["default"].createElement(l.Icon,{icon:l.Icons.InfoCircle}):o),n["default"].createElement("div",{className:a["default"]["title-wrapper"]},n["default"].createElement(t.Typography,{id:e,className:a["default"]["title"],spacing:o&&{marginLeft:2},tag:"h1",variant:"h4"},r),i&&n["default"].createElement(t.Typography,{className:a["default"]["caption"],spacing:{marginLeft:2},variant:"sub-text"},i))),n["default"].createElement(c.IconButton,{onClick:s,className:a["default"]["close-button"],title:"close modal"},n["default"].createElement(l.Icon,{icon:l.Icons.Times})));const i=n["default"].forwardRef(o);exports.DialogTitle=i;
|
|
2
2
|
//# sourceMappingURL=DialogTitle.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DialogTitle.cjs.js","sources":["../../../../../../../src/components/Notifications/Dialog/DialogTitle/DialogTitle.tsx"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { ForwardRefRenderFunction, ComponentPropsWithRef } from \"react\";\nimport { Typography } from \"../../../Typography/Typography\";\nimport classes from \"./DialogTitle.module.scss\";\nimport { Icon, Icons } from \"../../../Icon/Icon\";\n\nexport interface Props extends ComponentPropsWithRef<\"div\"> {\n id: string;\n title: string;\n titleIcon?: React.ReactNode;\n caption?: string;\n}\n\nconst DialogTitleComponent: ForwardRefRenderFunction<HTMLDivElement, Props> = (\n { id, title, titleIcon, caption, ...rest }: Props,\n ref\n) => {\n return (\n <div {...rest} ref={ref} className={classes[\"header\"]}>\n {titleIcon && (\n
|
|
1
|
+
{"version":3,"file":"DialogTitle.cjs.js","sources":["../../../../../../../src/components/Notifications/Dialog/DialogTitle/DialogTitle.tsx"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { ForwardRefRenderFunction, ComponentPropsWithRef } from \"react\";\nimport { Typography } from \"../../../Typography/Typography\";\nimport classes from \"./DialogTitle.module.scss\";\nimport { Icon, Icons } from \"../../../Icon/Icon\";\nimport { IconButton } from \"../../../Button/IconButton\";\n\nexport interface Props extends ComponentPropsWithRef<\"div\"> {\n id: string;\n title: string;\n titleIcon?: React.ReactNode;\n caption?: string;\n onClose?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n}\n\nconst DialogTitleComponent: ForwardRefRenderFunction<HTMLDivElement, Props> = (\n { id, title, titleIcon, caption, onClose, ...rest }: Props,\n ref\n) => {\n return (\n <div {...rest} ref={ref} className={classes[\"header\"]}>\n <div\n className={`${classes[\"headline\"]} ${caption ? classes[\"with-caption\"] : classes[\"no-caption\"]}`}\n >\n {titleIcon && (\n <div className={classes[\"title-icon\"]}>\n {typeof titleIcon === \"boolean\" ? <Icon icon={Icons.InfoCircle} /> : titleIcon}\n </div>\n )}\n <div className={classes[\"title-wrapper\"]}>\n <Typography\n id={id}\n className={classes[\"title\"]}\n spacing={titleIcon && { marginLeft: 2 }}\n tag=\"h1\"\n variant=\"h4\"\n >\n {title}\n </Typography>\n {caption && (\n <Typography\n className={classes[\"caption\"]}\n spacing={{ marginLeft: 2 }}\n variant=\"sub-text\"\n >\n {caption}\n </Typography>\n )}\n </div>\n </div>\n <IconButton onClick={onClose} className={classes[\"close-button\"]} title=\"close modal\">\n <Icon icon={Icons.Times} />\n </IconButton>\n </div>\n );\n};\n\nexport const DialogTitle = React.forwardRef(DialogTitleComponent);\n"],"names":["DialogTitleComponent","id","title","titleIcon","caption","onClose","rest","ref","React","createElement","className","classes","Icon","icon","Icons","InfoCircle","Typography","spacing","marginLeft","tag","variant","IconButton","onClick","Times","DialogTitle","forwardRef"],"mappings":"mXA8BA,MAAMA,EAAwE,EAC1EC,KAAIC,QAAOC,YAAWC,UAASC,aAAYC,GAC7CC,IAGEC,aAAAC,cAAA,MAAA,IAASH,EAAMC,IAAKA,EAAKG,UAAWC,EAAO,WAAC,WAC1CH,EACE,WAAAC,cAAA,MAAA,CAAAC,UAAW,GAAGC,EAAAA,WAAQ,eAAeP,EAAUO,EAAAA,WAAQ,gBAAkBA,EAAAA,WAAQ,iBAEhFR,GACCK,EAAAA,WAAKC,cAAA,MAAA,CAAAC,UAAWC,EAAO,WAAC,sBACdR,IAAc,UAAYK,EAAC,WAAAC,cAAAG,EAAAA,KAAK,CAAAC,KAAMC,EAAAA,MAAMC,aAAiBZ,GAGzEK,EAAA,WAAAC,cAAA,MAAA,CAAKC,UAAWC,EAAAA,WAAQ,kBACtBH,aAAAC,cAACO,EAAAA,WAAU,CACTf,GAAIA,EACJS,UAAWC,aAAQ,SACnBM,QAASd,GAAa,CAAEe,WAAY,GACpCC,IAAI,KACJC,QAAQ,MAEPlB,GAEFE,GACCI,EAAC,WAAAC,cAAAO,EAAAA,WACC,CAAAN,UAAWC,EAAO,WAAC,WACnBM,QAAS,CAAEC,WAAY,GACvBE,QAAQ,YAEPhB,KAKTI,EAAAA,WAAAC,cAACY,aAAU,CAACC,QAASjB,EAASK,UAAWC,aAAQ,gBAAiBT,MAAM,eACtEM,aAACC,cAAAG,EAAAA,KAAK,CAAAC,KAAMC,EAAAA,MAAMS,UAMb,MAAAC,EAAchB,EAAAA,WAAMiB,WAAWzB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});var e=require("../../../../lib/style-inject.js");var i='/*!\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.DialogTitle-module_header__maiky{align-items:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});var e=require("../../../../lib/style-inject.js");var i='/*!\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.DialogTitle-module_header__maiky{align-items:center;display:flex;justify-content:space-between;margin:1rem 1.5rem}.DialogTitle-module_headline__TItnb{display:flex}.DialogTitle-module_headline__TItnb.DialogTitle-module_with-caption__2Bu7z{align-items:flex-start}.DialogTitle-module_headline__TItnb.DialogTitle-module_no-caption__4-QI4{align-items:center}.DialogTitle-module_title__2Date{line-height:1;margin:0}.DialogTitle-module_title-icon__RFCV->[data-icon]{font-size:1.25rem}.DialogTitle-module_caption__08LUu{color:var(--color-blue-grey500)}.DialogTitle-module_close-button__EO320{flex-shrink:0}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkRpYWxvZ1RpdGxlLm1vZHVsZS5zY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7Ozs7Ozs7OztFQWNFLENBQ0Ysa0NBR0Usa0JBQW1CLENBRG5CLFlBQWEsQ0FFYiw2QkFBOEIsQ0FIOUIsa0JBSUYsQ0FFQSxvQ0FDRSxZQUNGLENBQ0EsMkVBQ0Usc0JBQ0YsQ0FDQSx5RUFDRSxrQkFDRixDQUVBLGlDQUVFLGFBQWMsQ0FEZCxRQUVGLENBQ0Esa0RBQ0UsaUJBQ0YsQ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W1zOiBjZW50ZXI7XG4gIGp1c3RpZnktY29udGVudDogc3BhY2UtYmV0d2Vlbjtcbn1cblxuLmhlYWRsaW5lIHtcbiAgZGlzcGxheTogZmxleDtcbn1cbi5oZWFkbGluZS53aXRoLWNhcHRpb24ge1xuICBhbGlnbi1pdGVtczogZmxleC1zdGFydDtcbn1cbi5oZWFkbGluZS5uby1jYXB0aW9uIHtcbiAgYWxpZ24taXRlbXM6IGNlbnRlcjtcbn1cblxuLnRpdGxlIHtcbiAgbWFyZ2luOiAwO1xuICBsaW5lLWhlaWdodDogMTtcbn1cbi50aXRsZS1pY29uID4gW2RhdGEtaWNvbl0ge1xuICBmb250LXNpemU6IDEuMjVyZW07XG59XG5cbi5jYXB0aW9uIHtcbiAgY29sb3I6IHZhcigtLWNvbG9yLWJsdWUtZ3JleTUwMCk7XG59XG5cbi5jbG9zZS1idXR0b24ge1xuICBmbGV4LXNocmluazogMDtcbn0iXX0= */';var l={header:"DialogTitle-module_header__maiky",headline:"DialogTitle-module_headline__TItnb","with-caption":"DialogTitle-module_with-caption__2Bu7z","no-caption":"DialogTitle-module_no-caption__4-QI4",title:"DialogTitle-module_title__2Date","title-icon":"DialogTitle-module_title-icon__RFCV-",caption:"DialogTitle-module_caption__08LUu","close-button":"DialogTitle-module_close-button__EO320"};e["default"](i);exports["default"]=l;
|
|
2
2
|
//# sourceMappingURL=DialogTitle.module.cjs.js.map
|
|
@@ -4,5 +4,6 @@ export interface Props extends ComponentPropsWithRef<"div"> {
|
|
|
4
4
|
title: string;
|
|
5
5
|
titleIcon?: React.ReactNode;
|
|
6
6
|
caption?: string;
|
|
7
|
+
onClose?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
7
8
|
}
|
|
8
9
|
export declare const DialogTitle: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});var e=require("../_BaseStyling_/BaseStyling.cjs.js");var r=require("../Button/Button.cjs.js");var a=require("../Breadcrumbs/Breadcrumbs.cjs.js");var s=require("../ContextMenu/ContextMenu.cjs.js");var o=require("../ContextMenu/ContextMenuItem.cjs.js");var t=require("../Link/Link.cjs.js");var i=require("../Icon/Icon.cjs.js");var p=require("../Button/IconButton.cjs.js");var c=require("../Tabs/Tab.cjs.js");var n=require("../Tabs/Tabs.cjs.js");var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});var e=require("../_BaseStyling_/BaseStyling.cjs.js");var r=require("../Button/Button.cjs.js");var a=require("../Breadcrumbs/Breadcrumbs.cjs.js");var s=require("../ContextMenu/ContextMenu.cjs.js");var o=require("../ContextMenu/ContextMenuItem.cjs.js");var t=require("../Link/Link.cjs.js");var i=require("../Icon/Icon.cjs.js");var p=require("../Button/IconButton.cjs.js");var c=require("../Tabs/Tab.cjs.js");var n=require("../Tabs/Tabs.cjs.js");var l=require("../Tag/Tag.cjs.js");var u=require("../TextEllipsis/TextEllipsis.cjs.js");var j=require("../Tiles/Tile.cjs.js");var d=require("../Tiles/Tiles.cjs.js");var x=require("../Tooltip/Tooltip.cjs.js");var v=require("../Typography/Typography.cjs.js");var q=require("../ProgressBar/ProgressBar.cjs.js");var S=require("../Skeleton/Skeleton.cjs.js");var T=require("../StatusIndicator/StatusIndicator.cjs.js");var B=require("../Stepper/Stepper.cjs.js");var b=require("../Pagination/Pagination.cjs.js");var m=require("./hooks/useRepeater.cjs.js");var F=require("./hooks/usePosition.cjs.js");var M=require("./hooks/useDebouncedCallback.cjs.js");var W=require("./util/helper.cjs.js");var g=require("../Notifications/BaseModal/BaseModal.cjs.js");var C=require("../Notifications/Snackbar/useSnackbar.cjs.js");var k=require("../Notifications/Dialog/Dialog.cjs.js");var I=require("../Notifications/DiscardChangesModal/DiscardChangesModal.cjs.js");var D=require("../Notifications/BaseModal/BaseModalActions/BaseModalActions.cjs.js");var h=require("../Notifications/BaseModal/BaseModalContent/BaseModalContent.cjs.js");var f=require("../Notifications/BaseModal/BaseModalHeader/BaseModalHeader.cjs.js");var P=require("../Notifications/NotificationProvider/NotificationContext.cjs.js");var z=require("../Notifications/SlideInModal/SlideInModal.cjs.js");var G=require("../Notifications/Snackbar/SnackbarProvider/SnackbarProvider.cjs.js");var N=require("../Form/Checkbox/Checkbox.cjs.js");var y=require("../Form/Fieldset/Fieldset.cjs.js");var R=require("../Form/Form.cjs.js");var A=require("../Form/FormControl/FormControl.cjs.js");var H=require("../Form/FormGroup/FormGroup.cjs.js");var L=require("../Form/FormHelperText/FormHelperText.cjs.js");var O=require("../Form/Input/Input.cjs.js");var E=require("../Form/Wrapper/InputWrapper/InputWrapper.cjs.js");var U=require("../Form/Label/Label.cjs.js");var _=require("../Form/Radio/Radio.cjs.js");var w=require("../Form/Wrapper/RadioWrapper/RadioWrapper.cjs.js");var J=require("../Form/Select/SingleSelect/Select.cjs.js");var K=require("../Form/Select/MultiSelect/MultiSelect.cjs.js");var Q=require("../Form/Select/SingleSelect/Option.cjs.js");var V=require("../Form/Select/MultiSelect/MultiOption.cjs.js");var X=require("../Form/Textarea/Textarea.cjs.js");var Y=require("../Form/Toggle/Toggle.cjs.js");var Z=require("../Form/Wrapper/CheckboxWrapper/CheckboxWrapper.cjs.js");var $=require("../Form/Wrapper/TextareaWrapper/TextareaWrapper.cjs.js");var ee=require("../Form/Wrapper/SelectWrapper/SelectWrapper.cjs.js");var re=require("../Form/FileUpload/FileUpload.cjs.js");var ae=require("../Wizard/Wizard.cjs.js");var se=require("../Wizard/WizardActions/WizardActions.cjs.js");var oe=require("../Wizard/WizardSteps/WizardSteps.cjs.js");var te=require("../Wizard/BaseWizardSteps/BaseWizardSteps.cjs.js");var ie=require("../DataGrid/DataGrid.cjs.js");var pe=require("../DataGrid/DataGridBody/DataGridRow.cjs.js");var ce=require("../DataGrid/DataGridBody/DataGridCell.cjs.js");var ne=require("../Notifications/Banner/Banner.cjs.js");exports.BaseStyling=e.BaseStyling;exports.Button=r.Button;exports.Breadcrumbs=a.Breadcrumbs;exports.ContextMenu=s.ContextMenu;exports.ContextMenuItem=o.ContextMenuItem;exports.Link=t.Link;exports.Icon=i.Icon;Object.defineProperty(exports,"Icons",{enumerable:true,get:function(){return i.Icons}});exports.IconButton=p.IconButton;exports.Tab=c.Tab;exports.Tabs=n.Tabs;exports.Tag=l.Tag;exports.TextEllipsis=u.TextEllipsis;exports.Tile=j.Tile;exports.Tiles=d.Tiles;exports.Tooltip=x.Tooltip;exports.Typography=v.Typography;exports.ProgressBar=q.ProgressBar;exports.Skeleton=S.Skeleton;exports.StatusIndicator=T.StatusIndicator;exports.Stepper=B.Stepper;exports.Pagination=b.Pagination;exports.useRepeater=m.useRepeater;exports.usePosition=F.usePosition;exports.useDebouncedCallback=M.useDebouncedCallback;exports.debounce=W.debounce;exports.generateID=W.generateID;exports.throttle=W.throttle;exports.Modal=g.BaseModal;exports.useSnackbar=C.useSnackbar;exports.Dialog=k.Dialog;exports.DiscardChangesModal=I.DiscardChangesModal;exports.ModalActions=D.BaseModalActions;exports.ModalContent=h.BaseModalContent;exports.ModalHeader=f.BaseModalHeader;exports.NotificationProvider=P.NotificationProvider;exports.useNotificationContext=P.useNotificationContext;exports.SlideInModal=z.SlideInModal;exports.SnackbarProvider=G.SnackbarProvider;exports.Checkbox=N.Checkbox;exports.Fieldset=y.Fieldset;exports.Form=R.Form;exports.FormControl=A.FormControl;exports.FormGroup=H.FormGroup;exports.FormHelperText=L.FormHelperText;exports.Input=O.Input;exports.InputWrapper=E.InputWrapper;exports.Label=U.Label;exports.Radio=_.Radio;exports.RadioWrapper=w.RadioWrapper;exports.Select=J.Select;exports.MultiSelect=K.MultiSelect;exports.Option=Q.Option;exports.MultiOption=V.MultiOption;exports.Textarea=X.Textarea;exports.Toggle=Y.Toggle;exports.CheckboxWrapper=Z.CheckboxWrapper;exports.TextareaWrapper=$.TextareaWrapper;exports.SelectWrapper=ee.SelectWrapper;exports.FileUpload=re.FileUpload;exports.Wizard=ae.Wizard;exports.WizardActions=se.WizardActions;exports.WizardSteps=oe.WizardSteps;exports.BaseWizardSteps=te.BaseWizardSteps;exports.DataGrid=ie.DataGrid;exports.DataGridRow=pe.DataGridRow;exports.DataGridCell=ce.DataGridCell;exports.Banner=ne.Banner;
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
package/dist/cjs/src/index.d.ts
CHANGED
|
@@ -104,6 +104,8 @@ export { TextareaWrapper } from "./components/Form/Wrapper/TextareaWrapper/Texta
|
|
|
104
104
|
export type { Props as TextareaWrapperProps } from "./components/Form/Wrapper/TextareaWrapper/TextareaWrapper";
|
|
105
105
|
export { SelectWrapper } from "./components/Form/Wrapper/SelectWrapper/SelectWrapper";
|
|
106
106
|
export type { Props as SelectWrapperProps } from "./components/Form/Wrapper/SelectWrapper/SelectWrapper";
|
|
107
|
+
export { FileUpload } from "./components/Form/FileUpload/FileUpload";
|
|
108
|
+
export type { Props as FileUploadProps } from "./components/Form/FileUpload/FileUpload";
|
|
107
109
|
/** Wizard */
|
|
108
110
|
export { Wizard } from "./components/Wizard/Wizard";
|
|
109
111
|
export type { Props as WizardProps } from "./components/Wizard/Wizard";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import e from"react";import n from"./FileItem.modules.esm.js";import{Typography as t}from"../../../Typography/Typography.esm.js";import{Icon as o,Icons as r}from"../../../Icon/Icon.esm.js";import{ProgressBar as a}from"../../../ProgressBar/ProgressBar.esm.js";var c;(function(e){e["DELETE"]="delete";e["REMOVE"]="remove";e["ABORT"]="abort";e["RETRY"]="retry"})(c||(c={}));const i=({name:i,status:s,error:l,progress:m,onRequestedFileAction:p},f)=>{const E=e=>{switch(e){case"completed":return{fileIcon:r.FileOutline,actionIcon:{type:r.Trash,action:c.DELETE}};case"error":return{fileIcon:r.InfoCircle,actionIcon:{type:r.Times,action:c.REMOVE}};case"uploading":return{fileIcon:r.FileUpload,actionIcon:{type:r.Times,action:c.ABORT}};case"retry":return{fileIcon:r.InfoCircle,actionIcon:{type:r.Refresh,action:c.RETRY}};case"readonly":default:return{fileIcon:r.FileOutline}}};const I=E(s);const u=e=>{const n=e.indexOf(".");return{friendlyName:e.slice(0,n),extension:e.slice(n+1)}};const{friendlyName:d,extension:y}=u(i);return e.createElement("div",{ref:f,className:n["file-item-wrapper"],"aria-label":`${i}-wrapper`},e.createElement(t,{variant:"body",title:i,className:`${n["file-name"]} ${s?n[s]:""}`},e.createElement(o,{icon:I.fileIcon,className:n["file-icon"]}),e.createElement("span",{className:n["friendly-name"]},d),".",e.createElement("span",null,y),I.actionIcon&&e.createElement(o,{title:I.actionIcon.action,icon:I.actionIcon.type,className:n["action-icon"],onClick:()=>I.actionIcon&&p&&p(I.actionIcon.action,i)})),l&&e.createElement(t,{variant:"sub-text",className:`${n["file-subtitle"]} ${s?n[s]:""}`},l),s==="uploading"?e.createElement(a,{className:n["progress-bar"],completed:m}):"")};const s=e.forwardRef(i);export{c as FILE_ACTION,s as FileItem};
|
|
2
|
+
//# sourceMappingURL=FileItem.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileItem.esm.js","sources":["../../../../../../../src/components/Form/FileUpload/FileItem/FileItem.tsx"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { ComponentPropsWithRef, ForwardRefRenderFunction } from \"react\";\nimport classes from \"./FileItem.modules.scss\";\nimport { Typography } from \"../../../Typography/Typography\";\nimport { Icon, Icons } from \"../../../Icon/Icon\";\nimport { ProgressBar } from \"../../../ProgressBar/ProgressBar\";\nimport { FileType } from \"../FileUpload\";\n\nexport type UploadProgress = \"uploading\" | \"completed\" | \"error\" | \"readonly\" | \"retry\";\n\nexport interface Props extends ComponentPropsWithRef<\"div\"> {\n name: string;\n status?: UploadProgress;\n progress?: number;\n error?: string;\n onRequestedFileAction?: (action: FILE_ACTION, name: FileType[\"name\"]) => void;\n}\ninterface FileItemIcons {\n fileIcon: Icons;\n actionIcon?: { type: Icons; action: FILE_ACTION };\n}\n\nexport enum FILE_ACTION {\n DELETE = \"delete\",\n REMOVE = \"remove\",\n ABORT = \"abort\",\n RETRY = \"retry\"\n}\n\nconst FileItemComponent: ForwardRefRenderFunction<HTMLDivElement, Props> = (\n { name, status, error, progress, onRequestedFileAction }: Props,\n ref\n) => {\n const determineIcons = (status?: UploadProgress): FileItemIcons => {\n switch (status) {\n case \"completed\":\n return {\n fileIcon: Icons.FileOutline,\n actionIcon: {\n type: Icons.Trash,\n action: FILE_ACTION.DELETE\n }\n };\n case \"error\":\n return {\n fileIcon: Icons.InfoCircle,\n actionIcon: {\n type: Icons.Times,\n action: FILE_ACTION.REMOVE\n }\n };\n case \"uploading\":\n return {\n fileIcon: Icons.FileUpload,\n actionIcon: {\n type: Icons.Times,\n action: FILE_ACTION.ABORT\n }\n };\n case \"retry\":\n return {\n fileIcon: Icons.InfoCircle,\n actionIcon: {\n type: Icons.Refresh,\n action: FILE_ACTION.RETRY\n }\n };\n case \"readonly\":\n default:\n return { fileIcon: Icons.FileOutline };\n }\n };\n\n const icons = determineIcons(status);\n\n const getFriendlyNameAndExtension = (name: string) => {\n const index = name.indexOf(\".\");\n return { friendlyName: name.slice(0, index), extension: name.slice(index + 1) };\n };\n\n const { friendlyName, extension } = getFriendlyNameAndExtension(name);\n\n return (\n <div ref={ref} className={classes[\"file-item-wrapper\"]} aria-label={`${name}-wrapper`}>\n <Typography\n variant={\"body\"}\n title={name}\n className={`${classes[\"file-name\"]} ${status ? classes[status] : \"\"}`}\n >\n <Icon icon={icons.fileIcon} className={classes[\"file-icon\"]} />\n <span className={classes[\"friendly-name\"]}>{friendlyName}</span>.<span>{extension}</span>\n {icons.actionIcon && (\n <Icon\n title={icons.actionIcon.action}\n icon={icons.actionIcon.type}\n className={classes[\"action-icon\"]}\n onClick={() =>\n icons.actionIcon &&\n onRequestedFileAction &&\n onRequestedFileAction(icons.actionIcon.action, name)\n }\n />\n )}\n </Typography>\n {error && (\n <Typography\n variant={\"sub-text\"}\n className={`${classes[\"file-subtitle\"]} ${status ? classes[status] : \"\"}`}\n >\n {error}\n </Typography>\n )}\n {status === \"uploading\" ? (\n <ProgressBar className={classes[\"progress-bar\"]} completed={progress} />\n ) : (\n \"\"\n )}\n </div>\n );\n};\n\nexport const FileItem = React.forwardRef(FileItemComponent);\n"],"names":["FILE_ACTION","FileItemComponent","name","status","error","progress","onRequestedFileAction","ref","determineIcons","fileIcon","Icons","FileOutline","actionIcon","type","Trash","action","DELETE","InfoCircle","Times","REMOVE","FileUpload","ABORT","Refresh","RETRY","icons","getFriendlyNameAndExtension","index","indexOf","friendlyName","slice","extension","React","createElement","className","classes","Typography","variant","title","Icon","icon","onClick","ProgressBar","completed","FileItem","forwardRef"],"mappings":"uQAqCYA,GAAZ,SAAYA,GACVA,EAAA,UAAA,SACAA,EAAA,UAAA,SACAA,EAAA,SAAA,QACAA,EAAA,SAAA,OACD,EALD,CAAYA,IAAAA,EAKX,CAAA,IAED,MAAMC,EAAqE,EACvEC,OAAMC,SAAQC,QAAOC,WAAUC,yBACjCC,KAEA,MAAMC,EAAkBL,IACtB,OAAQA,GACN,IAAK,YACH,MAAO,CACLM,SAAUC,EAAMC,YAChBC,WAAY,CACVC,KAAMH,EAAMI,MACZC,OAAQf,EAAYgB,SAG1B,IAAK,QACH,MAAO,CACLP,SAAUC,EAAMO,WAChBL,WAAY,CACVC,KAAMH,EAAMQ,MACZH,OAAQf,EAAYmB,SAG1B,IAAK,YACH,MAAO,CACLV,SAAUC,EAAMU,WAChBR,WAAY,CACVC,KAAMH,EAAMQ,MACZH,OA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}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import e from"../../../node_modules/style-inject/dist/style-inject.es.esm.js";var i='/*!\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/*!\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.FileItem-modules_sr-only__OwtI4{clip:rect(0,0,0,0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.FileItem-modules_hidden__w5rVy{display:none}.FileItem-modules_slide-in__g2fUZ{animation:FileItem-modules_slide-in__g2fUZ .5s forwards}@media (prefers-reduced-motion:reduce){.FileItem-modules_slide-in__g2fUZ{animation-duration:.1ms}}.FileItem-modules_slide-out__-dBYM{animation:FileItem-modules_slide-out__-dBYM .5s forwards}@media (prefers-reduced-motion:reduce){.FileItem-modules_slide-out__-dBYM{animation-duration:.1ms}}@keyframes FileItem-modules_slide-in__g2fUZ{0%{transform:translateY(100vh)}to{transform:translateY(0)}}@keyframes FileItem-modules_slide-out__-dBYM{0%{transform:translateY(0)}to{transform:translateY(100vh)}}.FileItem-modules_file-item-wrapper__r4sb5{background-color:var(--input-background-color);border-radius:var(--input-border-radius);padding:.5rem 1.25rem;transition-duration:.2s;transition-property:all;transition-timing-function:ease-in-out}@media (prefers-reduced-motion:reduce){.FileItem-modules_file-item-wrapper__r4sb5{transition-duration:.1ms}}.FileItem-modules_file-item-wrapper__r4sb5 [class*=icon]{font-size:1.25rem}.FileItem-modules_file-item-wrapper__r4sb5 .FileItem-modules_progress-bar__kVAJi{background-color:var(--color-black10)}.FileItem-modules_file-item-wrapper__r4sb5 span[class*=bar--]{border-radius:var(--input-border-radius);height:1rem}.FileItem-modules_file-item-wrapper__r4sb5 .FileItem-modules_file-name__twzQ4{align-items:center;display:flex;margin:0}.FileItem-modules_file-item-wrapper__r4sb5 .FileItem-modules_file-name__twzQ4 .FileItem-modules_friendly-name__p3xgX{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.FileItem-modules_file-item-wrapper__r4sb5 .FileItem-modules_action-icon__ODWUg{color:var(--color-primary);cursor:pointer;margin-left:auto;padding-left:1.25rem}.FileItem-modules_file-item-wrapper__r4sb5 .FileItem-modules_file-icon__TbFi8{margin-right:.5rem}.FileItem-modules_file-item-wrapper__r4sb5 .FileItem-modules_file-subtitle__TmXvr,.FileItem-modules_file-item-wrapper__r4sb5 .FileItem-modules_progress-bar__kVAJi{display:block;margin:.3125rem 1.75rem;padding:0}.FileItem-modules_file-item-wrapper__r4sb5 .FileItem-modules_error__Q1RuV,.FileItem-modules_file-item-wrapper__r4sb5 .FileItem-modules_retry__2Euk8{color:var(--error)}.FileItem-modules_file-item-wrapper__r4sb5 .FileItem-modules_readonly__Jxi46{color:var(--greyed-out)}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkZpbGVJdGVtLm1vZHVsZXMuc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7Ozs7Ozs7Ozs7RUFjRTtBQUNGOzs7Ozs7Ozs7Ozs7OztFQWNFLENBQ0YsaUNBT0Usa0JBQXNCLENBQ3RCLFFBQVMsQ0FMVCxVQUFXLENBRVgsV0FBW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XdyYXBwZXIgLnJlYWRvbmx5IHtcbiAgY29sb3I6IHZhcigtLWdyZXllZC1vdXQpO1xufSJdfQ== */';var l={"sr-only":"FileItem-modules_sr-only__OwtI4",hidden:"FileItem-modules_hidden__w5rVy","slide-in":"FileItem-modules_slide-in__g2fUZ","slide-out":"FileItem-modules_slide-out__-dBYM","file-item-wrapper":"FileItem-modules_file-item-wrapper__r4sb5","progress-bar":"FileItem-modules_progress-bar__kVAJi","file-name":"FileItem-modules_file-name__twzQ4","friendly-name":"FileItem-modules_friendly-name__p3xgX","action-icon":"FileItem-modules_action-icon__ODWUg","file-icon":"FileItem-modules_file-icon__TbFi8","file-subtitle":"FileItem-modules_file-subtitle__TmXvr",error:"FileItem-modules_error__Q1RuV",retry:"FileItem-modules_retry__2Euk8",readonly:"FileItem-modules_readonly__Jxi46"};e(i);export{l as default};
|
|
2
|
+
//# sourceMappingURL=FileItem.modules.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileItem.modules.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import e,{useRef as t,useState as l,useEffect as a}from"react";import{Button as o}from"../../Button/Button.esm.js";import{FileItem as s}from"./FileItem/FileItem.esm.js";import{Typography as r}from"../../Typography/Typography.esm.js";import n from"./FileUpload.module.esm.js";import{Icon as i,Icons as c}from"../../Icon/Icon.esm.js";import{useDetermineStatusIcon as d}from"../../src/hooks/useDetermineStatusIcon.esm.js";const p=({name:p,accept:m,error:u,success:f,maxFileSize:v,multiple:g,id:h,title:E,labeledBy:b,disabled:x=false,onChange:y,dragAndDropText:D="Drop file here or",selectButtonText:N="Select file",onDragOver:T,onDragLeave:z,wrapperProps:j,onDrop:F,subText:w,onRequestedFileAction:B,exceedingMaxSizeErrorText:I,fileList:P,...k},A)=>{var C;const L=t(null);const[S,R]=l(false);const[U,q]=l(false);const M=d({success:f,error:u});let O=[n["file-dropzone"]];let $=[n["file-selector-sub-text"]];S&&O.push(n["drag-active"]);U||u&&O.push(n["error"])&&$.push(n["error"]);x&&O.push(n["disabled"]);f&&!u&&O.push(n["success"]);const G=e=>{let t=P?[...P]:[];const l=P.map((e=>e.name));(e===null||e===void 0?void 0:e.length)&&Array.from(e).forEach((e=>{if(!l.includes(e.name))t=g?[...t,{...K(e),data:e}]:[{...K(e),data:e}]}));return t};const H=e=>{e.preventDefault();e.stopPropagation();let t=G(e.target.files);t.length&&J(t[t.length-1])&&(y===null||y===void 0?void 0:y(t))};const J=e=>{const t=e.name.split(".").pop();return t&&m.includes(t)};const K=e=>{const t={name:e.name,size:e.size,type:e.type};let l=false;if(v&&e.size&&e.size>=v){const e=(v/(1024*1024)).toFixed(2);t.error=I!==null&&I!==void 0?I:`The maximum allowed file size is ${e}MB. Upload a smaller file.`;t.status="error";l=true}q(l);return t};a((()=>{if(P.length){const e=P.map((e=>K(e)));y===null||y===void 0?void 0:y(e)}}),[]);const Q=e=>{e.preventDefault();e.stopPropagation();if(!S)R(true);T===null||T===void 0?void 0:T(e)};const V=e=>{e.preventDefault();e.stopPropagation();const t=e.target;if(t===null||t===void 0?void 0:t.classList.contains(n["file-dropzone"]))R(false);z===null||z===void 0?void 0:z(e)};const W=e=>{var t,l;e.preventDefault();e.stopPropagation();if(((t=e===null||e===void 0?void 0:e.dataTransfer)===null||t===void 0?void 0:t.files)&&e.dataTransfer.files.length){const t=(l=e===null||e===void 0?void 0:e.dataTransfer)===null||l===void 0?void 0:l.files[0].name.split(".").pop();if(t&&m&&!m.includes(t)){R(false);return}const a=G(e.dataTransfer.files);F===null||F===void 0?void 0:F(a)}R(false)};return e.createElement("div",{className:n["file-upload-wrapper"],...j},e.createElement("div",{className:n["dropzone-wrapper"]},e.createElement("div",{className:O.join(" "),onDragOver:e=>!x&&Q(e),onDragLeave:e=>!x&&V(e),onDrop:e=>!x&&W(e)},e.createElement(r,{variant:"body-bold",className:n["file-upload-title"],ref:L},E),e.createElement("div",{className:n["file-select"]},e.createElement(i,{className:"drop-file-icon",icon:c.FileUpload}),e.createElement(r,{variant:"body",className:"drag-and-drop-text"},D),e.createElement("div",{className:n["file-upload-btn"]},e.createElement(o,{variant:"outline",disabled:x},N,e.createElement("input",{className:n["upload-input"],...k,ref:A,"aria-labelledby":b,type:"file",name:p,...g&&{multiple:true},disabled:x,accept:m,onChange:H,spellCheck:(C=k.spellCheck)!==null&&C!==void 0?C:false}))),!x&&M,e.createElement("span",{className:n["outline"]}))),w&&e.createElement(r,{variant:"sub-text",className:$.join(" ")},w)),(P===null||P===void 0?void 0:P.length)>0&&e.createElement("ul",{className:n["file-list"]},P.map((({name:t,status:l,progress:a,error:o})=>e.createElement("li",{key:t,className:l,id:t},e.createElement(s,{name:t,status:l,progress:a,error:o,onRequestedFileAction:B}))))))};const m=e.forwardRef(p);export{m as FileUpload};
|
|
2
|
+
//# sourceMappingURL=FileUpload.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileUpload.esm.js","sources":["../../../../../../src/components/Form/FileUpload/FileUpload.tsx"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, {\n DragEvent,\n DragEventHandler,\n ForwardRefRenderFunction,\n useEffect,\n useRef,\n useState\n} from \"react\";\nimport { Button } from \"../../Button/Button\";\nimport { FILE_ACTION, FileItem, Props as FileConfig } from \"./FileItem/FileItem\";\nimport { Props as InputProps } from \"../Input/Input\";\nimport { Typography } from \"../../Typography/Typography\";\nimport classes from \"./FileUpload.module.scss\";\nimport { Icon, Icons } from \"../../Icon/Icon\";\nimport { useDetermineStatusIcon } from \"../../../hooks/useDetermineStatusIcon\";\n\ntype FileUploadType = Omit<InputProps, \"onDrop\" | \"type\" | \"onChange\" | \"suffix\" | \"prefix\">;\nexport type FileType = Omit<FileConfig, \"onRequestedFileAction\"> &\n Pick<File, \"size\" | \"type\"> & { data?: any };\n\nexport interface Props extends FileUploadType {\n accept: string;\n title: string;\n multiple: boolean;\n fileList: FileType[];\n exceedingMaxSizeErrorText?: string;\n maxFileSize?: number;\n selectButtonText?: string;\n dragAndDropText?: string;\n subText?: string;\n onDragOver?: DragEventHandler;\n onDragEnter?: DragEventHandler;\n onDragLeave?: DragEventHandler;\n onDrop?: (e: FileType[]) => void;\n onChange?: (e: FileType[]) => void;\n onRequestedFileAction?: (action: FILE_ACTION, name: FileType[\"name\"]) => void;\n}\n\nconst FileUploadComponent: ForwardRefRenderFunction<HTMLInputElement, Props> = (\n {\n name,\n accept,\n error,\n success,\n maxFileSize,\n multiple,\n id,\n title,\n labeledBy,\n disabled = false,\n onChange,\n dragAndDropText = \"Drop file here or\",\n selectButtonText = \"Select file\",\n onDragOver,\n onDragLeave,\n wrapperProps,\n onDrop,\n subText,\n onRequestedFileAction,\n exceedingMaxSizeErrorText,\n fileList,\n ...rest\n }: Props,\n ref\n) => {\n const labelRef = useRef(null);\n const [dragActive, setDragActive] = useState(false);\n const [inputError, setInputError] = useState(false);\n const icon = useDetermineStatusIcon({ success, error });\n let dropzoneClassNames = [classes[\"file-dropzone\"]];\n let subTextClass = [classes[\"file-selector-sub-text\"]];\n dragActive && dropzoneClassNames.push(classes[\"drag-active\"]);\n inputError ||\n (error && dropzoneClassNames.push(classes[\"error\"]) && subTextClass.push(classes[\"error\"]));\n disabled && dropzoneClassNames.push(classes[\"disabled\"]);\n success && !error && dropzoneClassNames.push(classes[\"success\"]);\n\n const getFileList = (files: FileList | null): FileType[] => {\n let savedFiles = fileList ? [...fileList] : [];\n const fileNames = fileList.map(el => el.name);\n files?.length &&\n Array.from(files as ArrayLike<File>).forEach(el => {\n if (!fileNames.includes(el.name)) {\n savedFiles = multiple\n ? [\n ...savedFiles,\n {\n ...validateUpload(el),\n data: el\n }\n ]\n : [\n {\n ...validateUpload(el),\n data: el\n }\n ];\n }\n });\n return savedFiles;\n };\n const onInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n e.preventDefault();\n e.stopPropagation();\n let files = getFileList(e.target.files);\n files.length && verifyExtensionValidity(files[files.length - 1]) && onChange?.(files);\n };\n\n const verifyExtensionValidity = (file: FileType) => {\n const extension = file.name.split(\".\").pop();\n return extension && accept.includes(extension);\n };\n\n const validateUpload = (file: FileType) => {\n const result: FileType = {\n name: file.name,\n size: file.size,\n type: file.type\n };\n\n let err = false;\n if (maxFileSize && file.size && file.size >= maxFileSize) {\n const mb = (maxFileSize / (1024 * 1024)).toFixed(2);\n result.error =\n exceedingMaxSizeErrorText ??\n `The maximum allowed file size is ${mb}MB. Upload a smaller file.`;\n result.status = \"error\";\n err = true;\n }\n setInputError(err);\n return result;\n };\n\n useEffect(() => {\n if (fileList.length) {\n const validatedFiles = fileList.map(file => validateUpload(file));\n onChange?.(validatedFiles);\n }\n }, []);\n\n const handleOnDragOver = (e: DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n e.stopPropagation();\n if (!dragActive) {\n setDragActive(true);\n }\n onDragOver?.(e);\n };\n\n const handleOnDragLeave = (e: DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n e.stopPropagation();\n const target = e.target as HTMLElement;\n if (target?.classList.contains(classes[\"file-dropzone\"])) {\n setDragActive(false);\n }\n onDragLeave?.(e);\n };\n\n const handleOnDrop = (e: DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n e.stopPropagation();\n if (e?.dataTransfer?.files && e.dataTransfer.files.length) {\n const extension = e?.dataTransfer?.files[0].name.split(\".\").pop();\n if (extension && accept && !accept.includes(extension)) {\n setDragActive(false);\n return;\n }\n const validatedFiles = getFileList(e.dataTransfer.files);\n onDrop?.(validatedFiles);\n }\n setDragActive(false);\n };\n\n return (\n <div className={classes[\"file-upload-wrapper\"]} {...wrapperProps}>\n <div className={classes[\"dropzone-wrapper\"]}>\n <div\n className={dropzoneClassNames.join(\" \")}\n onDragOver={e => !disabled && handleOnDragOver(e)}\n onDragLeave={e => !disabled && handleOnDragLeave(e)}\n onDrop={e => !disabled && handleOnDrop(e)}\n >\n <Typography variant=\"body-bold\" className={classes[\"file-upload-title\"]} ref={labelRef}>\n {title}\n </Typography>\n <div className={classes[\"file-select\"]}>\n <Icon className={\"drop-file-icon\"} icon={Icons.FileUpload} />\n <Typography variant=\"body\" className={\"drag-and-drop-text\"}>\n {dragAndDropText}\n </Typography>\n <div className={classes[\"file-upload-btn\"]}>\n <Button variant=\"outline\" disabled={disabled}>\n {selectButtonText}\n <input\n className={classes[\"upload-input\"]}\n {...rest}\n ref={ref}\n aria-labelledby={labeledBy}\n type=\"file\"\n name={name}\n {...(multiple && { multiple: true })}\n disabled={disabled}\n accept={accept}\n onChange={onInputChange}\n spellCheck={rest.spellCheck ?? false}\n />\n </Button>\n </div>\n {!disabled && icon}\n <span className={classes[\"outline\"]}></span>\n </div>\n </div>\n {subText && (\n <Typography variant={\"sub-text\"} className={subTextClass.join(\" \")}>\n {subText}\n </Typography>\n )}\n </div>\n {fileList?.length > 0 && (\n <ul className={classes[\"file-list\"]}>\n {fileList.map(({ name, status, progress, error }) => (\n <li key={name} className={status} id={name}>\n <FileItem\n name={name}\n status={status}\n progress={progress}\n error={error}\n onRequestedFileAction={onRequestedFileAction}\n />\n </li>\n ))}\n </ul>\n )}\n </div>\n );\n};\n\nexport const FileUpload = React.forwardRef(FileUploadComponent);\n"],"names":["FileUploadComponent","name","accept","error","success","maxFileSize","multiple","id","title","labeledBy","disabled","onChange","dragAndDropText","selectButtonText","onDragOver","onDragLeave","wrapperProps","onDrop","subText","onRequestedFileAction","exceedingMaxSizeErrorText","fileList","rest","ref","labelRef","useRef","dragActive","setDragActive","useState","inputError","setInputError","icon","useDetermineStatusIcon","dropzoneClassNames","classes","subTextClass","push","getFileList","files","savedFiles","fileNames","map","el","length","Array","from","forEach","includes","validateUpload","data","onInputChange","e","preventDefault","stopPropagation","target","verifyExtensionValidity","file","extension","split","pop","result","size","type","err","mb","toFixed","status","useEffect","validatedFiles","handleOnDragOver","handleOnDragLeave","classList","contains","handleOnDrop","dataTransfer","_a","_b","React","className","createElement","join","Typography","variant","Icon","Icons","FileUpload","Button","spellCheck","progress","key","FileItem","forwardRef"],"mappings":"maAsDA,MAAMA,EAAyE,EAE3EC,OACAC,SACAC,QACAC,UACAC,cACAC,WACAC,KACAC,QACAC,YACAC,WAAW,MACXC,WACAC,kBAAkB,oBAClBC,mBAAmB,cACnBC,aACAC,cACAC,eACAC,SACAC,UACAC,wBACAC,4BACAC,cACGC,GAELC,WAEA,MAAMC,EAAWC,EAAO,MACxB,MAAOC,EAAYC,GAAiBC,EAAS,OAC7C,MAAOC,EAAYC,GAAiBF,EAAS,OAC7C,MAAMG,EAAOC,EAAuB,CAAE5B,UAASD,UAC/C,IAAI8B,EAAqB,CAACC,EAAQ,kBAClC,IAAIC,EAAe,CAACD,EAAQ,2BAC5BR,GAAcO,EAAmBG,KAAKF,EAAQ,gBAC9CL,GACG1B,GAAS8B,EAAmBG,KAAKF,EAAQ,WAAaC,EAAaC,KAAKF,EAAQ,UACnFxB,GAAYuB,EAAmBG,KAAKF,EAAQ,aAC5C9B,IAAYD,GAAS8B,EAAmBG,KAAKF,EAAQ,YAErD,MAAMG,EAAeC,IACnB,IAAIC,EAAalB,EAAW,IAAIA,GAAY,GAC5C,MAAMmB,EAAYnB,EAASoB,KAAIC,GAAMA,EAAGzC,QACxCqC,IAAA,MAAAA,SAAA,OAAA,EAAAA,EAAOK,SACLC,MAAMC,KAAKP,GAA0BQ,SAAQJ,IAC3C,IAAKF,EAAUO,SAASL,EAAGzC,MACzBsC,EAAajC,EACT,IACKiC,EACH,IACKS,EAAeN,GAClBO,KAAMP,IAGV,CACE,IACKM,EAA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C,EAAQ,mBACfZ,EACJC,IAAKA,oBACYd,EACjBqD,KAAK,OACL7D,KAAMA,KACDK,GAAY,CAAEA,SAAU,MAC7BI,SAAUA,EACVR,OAAQA,EACRS,SAAUuC,EACVqC,YAAYZ,EAAArD,EAAKiE,cAAc,MAAAZ,SAAA,EAAAA,EAAA,WAInCjE,GAAYqB,EACd8C,EAAME,cAAA,OAAA,CAAAD,UAAW5C,EAAQ,eAG5BhB,GACC2D,EAACE,cAAAE,GAAWC,QAAS,WAAYJ,UAAW3C,EAAa6C,KAAK,MAC3D9D,KAING,UAAAA,SAAQ,OAAA,EAARA,EAAUsB,QAAS,GAClBkC,sBAAIC,UAAW5C,EAAQ,cACpBb,EAASoB,KAAI,EAAGxC,OAAMiE,SAAQsB,WAAUrF,WACvC0E,sBAAIY,IAAKxF,EAAM6E,UAAWZ,EAAQ3D,GAAIN,GACpC4E,EAAAE,cAACW,EAAQ,CACPzF,KAAMA,EACNiE,OAAQA,EACRsB,SAAUA,EACVrF,MAAOA,EACPgB,sBAAuBA,QAOnC,EAGS,MAAAkE,EAAaR,EAAMc,WAAW3F"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import l from "../../../lib/style-inject.js";var e='/*!\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/*!\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.FileUpload-module_sr-only__Awag4{clip:rect(0,0,0,0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.FileUpload-module_hidden__JayBD{display:none}.FileUpload-module_slide-in__w7j8k{animation:FileUpload-module_slide-in__w7j8k .5s forwards}@media (prefers-reduced-motion:reduce){.FileUpload-module_slide-in__w7j8k{animation-duration:.1ms}}.FileUpload-module_slide-out__tZ-rV{animation:FileUpload-module_slide-out__tZ-rV .5s forwards}@media (prefers-reduced-motion:reduce){.FileUpload-module_slide-out__tZ-rV{animation-duration:.1ms}}@keyframes FileUpload-module_slide-in__w7j8k{0%{transform:translateY(100vh)}to{transform:translateY(0)}}@keyframes FileUpload-module_slide-out__tZ-rV{0%{transform:translateY(0)}to{transform:translateY(100vh)}}.FileUpload-module_file-upload-wrapper__CIx-a{display:flex;flex-direction:column}.FileUpload-module_file-dropzone__O-VP-{background-color:var(--input-background-color);border-radius:var(--input-border-radius);padding:1.25rem;position:relative;transition-duration:.2s;transition-property:all;transition-timing-function:ease-in-out}@media (prefers-reduced-motion:reduce){.FileUpload-module_file-dropzone__O-VP-{transition-duration:.1ms}}.FileUpload-module_file-dropzone__O-VP-.FileUpload-module_drag-active__MRJJR .FileUpload-module_outline__QfJ8U{background-color:var(--drag-background-color);border-color:var(--color-blue-grey500);border-radius:var(--input-border-radius);border-style:var(--drag-border-style);border-width:var(--input-border-width);inset:0;margin:0;padding:0;pointer-events:none;position:absolute;transition-duration:.2s;transition-property:all;transition-timing-function:ease-in-out}@media (prefers-reduced-motion:reduce){.FileUpload-module_file-dropzone__O-VP-.FileUpload-module_drag-active__MRJJR .FileUpload-module_outline__QfJ8U{transition-duration:.1ms}}.FileUpload-module_file-dropzone__O-VP-.FileUpload-module_drag-active__MRJJR:hover .FileUpload-module_outline__QfJ8U{background-color:var(--input-hover-background-color);border-color:var(--default)}.FileUpload-module_file-dropzone__O-VP-.FileUpload-module_drag-active__MRJJR .FileUpload-module_outline__QfJ8U.FileUpload-module_disabled__hvZQb{background-color:var(--input-disabled-background-color);border-color:var(--disabled)}.FileUpload-module_file-dropzone__O-VP-.FileUpload-module_drag-active__MRJJR .FileUpload-module_outline__QfJ8U.FileUpload-module_error__q2B-7{border-color:var(--error)}.FileUpload-module_file-dropzone__O-VP-.FileUpload-module_drag-active__MRJJR .FileUpload-module_outline__QfJ8U.FileUpload-module_focus__E3tFz{border-width:var(--input-border-width-focus)}.FileUpload-module_file-dropzone__O-VP-.FileUpload-module_drag-active__MRJJR .FileUpload-module_outline__QfJ8U.FileUpload-module_focus__E3tFz:not(.FileUpload-module_error__q2B-7){border-color:var(--color-focus)}.FileUpload-module_file-dropzone__O-VP-.FileUpload-module_error__q2B-7 .FileUpload-module_file-upload-title__CEPD-,.FileUpload-module_file-dropzone__O-VP-.FileUpload-module_error__q2B-7 span[data-icon-status]{color:var(--error)}.FileUpload-module_file-dropzone__O-VP-.FileUpload-module_success__GqO-7 span[data-icon-status]{color:var(--success)}.FileUpload-module_file-dropzone__O-VP-.FileUpload-module_disabled__hvZQb{background-color:var(--disabled);color:var(--greyed-out);pointer-events:none}.FileUpload-module_file-dropzone__O-VP- span[data-icon-status]{font-size:1.25rem;position:absolute;right:1.375rem;top:2.74rem}.FileUpload-module_file-selector-sub-text__nCXMq{color:var(--greyed-out);padding:0 1.25rem}.FileUpload-module_file-selector-sub-text__nCXMq.FileUpload-module_error__q2B-7{color:var(--error)}.FileUpload-module_file-select__sW1Pn{align-items:center;display:flex;flex-direction:column}.FileUpload-module_file-select__sW1Pn [class*=file]{font-size:1.25rem}.FileUpload-module_file-select__sW1Pn [class*=typography]{margin-bottom:.625rem}.FileUpload-module_upload-input__wteSl{border:none;bottom:0;cursor:pointer;display:block;left:0;opacity:0;position:absolute;right:0;text-transform:none;top:0;width:100%}.FileUpload-module_upload-input__wteSl:focus{outline:none}.FileUpload-module_file-upload-btn__M2Fg-{position:relative}.FileUpload-module_file-list__GLggq{list-style:none;margin:.75rem 0;padding:0}.FileUpload-module_file-list__GLggq li:not(:last-child){margin-bottom:.5rem}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkZpbGVVcGxvYWQubW9kdWxlLnNjc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7Ozs7Ozs7Ozs7O0VBY0U7QUFDRjs7Ozs7Ozs7Ozs7Ozs7RUFjRSxDQUNGLGtDQU9FLGtCQUFzQixDQUN0QixRQUFTLENBTFQsVUFBVyxDQUVYLFdBQVksQ0FDWixlQUFnQixDQUZoQixTQUFVLENBSFYsaUJBQWtCLENBQ2xCLFNBT0YsQ0FFQSxpQ0FDRSxZQUNGLENBRUEsbUNBQ0Usd0RBQ0YsQ0FFQSx1Q0FDRSxtQ0FDRSx1QkFDRixDQUNGLENBQ0Esb0NBQ0UseURBQ0YsQ0FFQSx1Q0FDRSxvQ0FDRSx1QkFDRixDQUNGLENBQ0EsNkNBQ0UsR0FDRSwyQkFDRixDQUNBLEdBQ0UsdUJBQ0YsQ0FDRixDQUNBLDhDQUNFLEdBQ0UsdUJBQ0YsQ0FDQSxHQUNFLDJCQUNGLENBQ0YsQ0FDQSw4Q0FDRSxZQUFhLENBQ2IscUJBQ0YsQ0FFQSx3Q0FFRSw4Q0FBK0MsQ0FEL0Msd0NBQXlDLENBRXpDLGVBQWdCLENBQ2hCLGlCQUFrQixDQUVsQix1QkFBeUIsQ0FEekIsdUJBQXdCLENBRXhCLHNDQUNGLENBQ0EsdUNBQ0Usd0NBQ0Usd0JBQ0YsQ0FDRixDQUNBLCtHQVVFLDZDQUE4QyxDQUo5QyxzQ0FBdUMsQ0FHdkMsd0NBQXlDLENBRnpDLHFDQUFzQyxDQUN0QyxzQ0FBdUMsQ0FIdkMsT0FBUSxDQUZSLFFBQVMsQ0FDVCxTQUFVLENBSFYsbUJB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RkaW5nOiAwIDEuMjVyZW07XG59XG4uZmlsZS1zZWxlY3Rvci1zdWItdGV4dC5lcnJvciB7XG4gIGNvbG9yOiB2YXIoLS1lcnJvcik7XG59XG5cbi5maWxlLXNlbGVjdCB7XG4gIGRpc3BsYXk6IGZsZXg7XG4gIGFsaWduLWl0ZW1zOiBjZW50ZXI7XG4gIGZsZXgtZGlyZWN0aW9uOiBjb2x1bW47XG59XG4uZmlsZS1zZWxlY3QgW2NsYXNzKj1maWxlXSB7XG4gIGZvbnQtc2l6ZTogMS4yNXJlbTtcbn1cbi5maWxlLXNlbGVjdCBbY2xhc3MqPXR5cG9ncmFwaHldIHtcbiAgbWFyZ2luLWJvdHRvbTogMC42MjVyZW07XG59XG5cbi51cGxvYWQtaW5wdXQge1xuICBkaXNwbGF5OiBibG9jaztcbiAgd2lkdGg6IDEwMCU7XG4gIGJvcmRlcjogbm9uZTtcbiAgdGV4dC10cmFuc2Zvcm06IG5vbmU7XG4gIHBvc2l0aW9uOiBhYnNvbHV0ZTtcbiAgdG9wOiAwO1xuICBsZWZ0OiAwO1xuICByaWdodDogMDtcbiAgYm90dG9tOiAwO1xuICBvcGFjaXR5OiAwO1xuICBjdXJzb3I6IHBvaW50ZXI7XG59XG4udXBsb2FkLWlucHV0OmZvY3VzIHtcbiAgb3V0bGluZTogbm9uZTtcbn1cblxuLmZpbGUtdXBsb2FkLWJ0biB7XG4gIHBvc2l0aW9uOiByZWxhdGl2ZTtcbn1cblxuLmZpbGUtbGlzdCB7XG4gIGxpc3Qtc3R5bGU6IG5vbmU7XG4gIHBhZGRpbmc6IDA7XG4gIG1hcmdpbjogMC43NXJlbSAwO1xufVxuLmZpbGUtbGlzdCBsaTpub3QoOmxhc3QtY2hpbGQpIHtcbiAgbWFyZ2luLWJvdHRvbTogMC41cmVtO1xufSJdfQ== */';var i={"sr-only":"FileUpload-module_sr-only__Awag4",hidden:"FileUpload-module_hidden__JayBD","slide-in":"FileUpload-module_slide-in__w7j8k","slide-out":"FileUpload-module_slide-out__tZ-rV","file-upload-wrapper":"FileUpload-module_file-upload-wrapper__CIx-a","file-dropzone":"FileUpload-module_file-dropzone__O-VP-","drag-active":"FileUpload-module_drag-active__MRJJR",outline:"FileUpload-module_outline__QfJ8U",disabled:"FileUpload-module_disabled__hvZQb",error:"FileUpload-module_error__q2B-7",focus:"FileUpload-module_focus__E3tFz","file-upload-title":"FileUpload-module_file-upload-title__CEPD-",success:"FileUpload-module_success__GqO-7","file-selector-sub-text":"FileUpload-module_file-selector-sub-text__nCXMq","file-select":"FileUpload-module_file-select__sW1Pn","upload-input":"FileUpload-module_upload-input__wteSl","file-upload-btn":"FileUpload-module_file-upload-btn__M2Fg-","file-list":"FileUpload-module_file-list__GLggq"};l(e);export{i as default};
|
|
2
|
+
//# sourceMappingURL=FileUpload.module.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileUpload.module.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e,{useState as t}from"react";import{BaseModal as o}from"../BaseModal/BaseModal.esm.js";import{BaseModalContent as n}from"../BaseModal/BaseModalContent/BaseModalContent.esm.js";import{DialogActions as a}from"./DialogActions/DialogActions.esm.js";import i from"./Dialog.module.esm.js";import{DialogTitle as r}from"./DialogTitle/DialogTitle.esm.js";import{Button as s}from"../../Button/Button.esm.js";import{labelId as l,descriptionId as c}from"../BaseModal/BaseModalContext.esm.js";import{generateID as m}from"../../src/util/helper.esm.js";const d=({id:d,open:p,children:u,onClose:f,title:y,primaryAction:B,secondaryAction:
|
|
1
|
+
import e,{useState as t}from"react";import{BaseModal as o}from"../BaseModal/BaseModal.esm.js";import{BaseModalContent as n}from"../BaseModal/BaseModalContent/BaseModalContent.esm.js";import{DialogActions as a}from"./DialogActions/DialogActions.esm.js";import i from"./Dialog.module.esm.js";import{DialogTitle as r}from"./DialogTitle/DialogTitle.esm.js";import{Button as s}from"../../Button/Button.esm.js";import{labelId as l,descriptionId as c}from"../BaseModal/BaseModalContext.esm.js";import{generateID as m}from"../../src/util/helper.esm.js";const d=({id:d,open:p,children:u,onClose:f,title:y,primaryAction:B,secondaryAction:g,cancelAction:j,zIndex:C,titleIcon:E,caption:h,...A},M)=>{const[x]=t(d!==null&&d!==void 0?d:m(20));const{label:D,...b}=B;const I=e.createElement(s,{key:"primary",...b},D);const k=g&&function(){const{label:t,...o}=g;return e.createElement(s,{key:"tertiary",variant:"outline",...o},t)}();const w=e=>{if(e.key==="Enter")B.onClick()};return e.createElement(o,{...A,ref:M,id:x,className:i["dialog"],containerProps:{className:i["container"]},open:p,onClose:f,zIndex:C},e.createElement(r,{titleIcon:E,caption:h,id:l(x),title:y,onClose:f}),e.createElement(n,{id:c(x),className:i["content"],disableAutoFocus:true},u),e.createElement(a,{onClose:f,cancelAction:j},[k,I]),e.createElement("input",{autoFocus:true,"aria-hidden":true,style:{position:"absolute",width:0,height:0,opacity:0},maxLength:0,tabIndex:-1,onKeyDown:w}))};const p=e.forwardRef(d);export{p as Dialog};
|
|
2
2
|
//# sourceMappingURL=Dialog.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.esm.js","sources":["../../../../../../src/components/Notifications/Dialog/Dialog.tsx"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { ForwardRefRenderFunction, ComponentPropsWithRef, useState } from \"react\";\nimport { BaseModal } from \"../BaseModal/BaseModal\";\nimport { BaseModalContent } from \"../BaseModal/BaseModalContent/BaseModalContent\";\nimport { DialogActions } from \"./DialogActions/DialogActions\";\nimport classes from \"./Dialog.module.scss\";\nimport { DialogTitle } from \"./DialogTitle/DialogTitle\";\nimport { Button, Props as ButtonProps } from \"../../Button/Button\";\nimport { labelId, descriptionId } from \"../BaseModal/BaseModalContext\";\nimport { generateID } from \"../../../util/helper\";\nimport { CancelAction } from \"../BaseModal/BaseModalActions/BaseModalActions\";\n\nexport interface Props extends ComponentPropsWithRef<\"div\"> {\n id?: string;\n open: boolean;\n children: React.ReactNode;\n onClose: () => void;\n title: string;\n primaryAction: Action;\n secondaryAction?: Action;\n cancelAction?: CancelAction;\n zIndex?: number;\n disableEscapeKeyDown?: boolean;\n titleIcon?: React.ReactNode;\n caption?: string;\n}\n\nexport interface Action extends Omit<ButtonProps, \"variant\" | \"ref\"> {\n label: string;\n onClick: (event?: React.MouseEvent<HTMLButtonElement>) => unknown;\n}\n\nconst DialogComponent: ForwardRefRenderFunction<HTMLDivElement, Props> = (\n {\n id,\n open,\n children,\n onClose,\n title,\n primaryAction,\n secondaryAction,\n cancelAction,\n zIndex,\n
|
|
1
|
+
{"version":3,"file":"Dialog.esm.js","sources":["../../../../../../src/components/Notifications/Dialog/Dialog.tsx"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { ForwardRefRenderFunction, ComponentPropsWithRef, useState } from \"react\";\nimport { BaseModal } from \"../BaseModal/BaseModal\";\nimport { BaseModalContent } from \"../BaseModal/BaseModalContent/BaseModalContent\";\nimport { DialogActions } from \"./DialogActions/DialogActions\";\nimport classes from \"./Dialog.module.scss\";\nimport { DialogTitle } from \"./DialogTitle/DialogTitle\";\nimport { Button, Props as ButtonProps } from \"../../Button/Button\";\nimport { labelId, descriptionId } from \"../BaseModal/BaseModalContext\";\nimport { generateID } from \"../../../util/helper\";\nimport { CancelAction } from \"../BaseModal/BaseModalActions/BaseModalActions\";\n\nexport interface Props extends ComponentPropsWithRef<\"div\"> {\n id?: string;\n open: boolean;\n children: React.ReactNode;\n onClose: () => void;\n title: string;\n primaryAction: Action;\n secondaryAction?: Action;\n cancelAction?: CancelAction;\n zIndex?: number;\n disableEscapeKeyDown?: boolean;\n titleIcon?: React.ReactNode;\n caption?: string;\n}\n\nexport interface Action extends Omit<ButtonProps, \"variant\" | \"ref\"> {\n label: string;\n onClick: (event?: React.MouseEvent<HTMLButtonElement>) => unknown;\n}\n\nconst DialogComponent: ForwardRefRenderFunction<HTMLDivElement, Props> = (\n {\n id,\n open,\n children,\n onClose,\n title,\n primaryAction,\n secondaryAction,\n cancelAction,\n zIndex,\n titleIcon,\n caption,\n ...rest\n }: Props,\n ref\n) => {\n const [dialogId] = useState(id ?? generateID(20));\n const { label: primaryLabel, ...restOfPrimaryAction } = primaryAction;\n const PrimaryButton = (\n <Button key=\"primary\" {...restOfPrimaryAction}>\n {primaryLabel}\n </Button>\n );\n\n const SecondaryButton =\n secondaryAction &&\n (function () {\n const { label: secondaryLabel, ...restOfSecondaryAction } = secondaryAction;\n return (\n <Button key=\"tertiary\" variant=\"outline\" {...restOfSecondaryAction}>\n {secondaryLabel}\n </Button>\n );\n })();\n\n const onHiddenInputKeyPress = (event: React.KeyboardEvent<HTMLInputElement>) => {\n /** It has to be here because then we will need to check if user doesn't click tab to select action button and want to do another action then primary one? */\n if (event.key === \"Enter\") {\n primaryAction.onClick();\n }\n };\n\n return (\n <BaseModal\n {...rest}\n ref={ref}\n id={dialogId}\n className={classes[\"dialog\"]}\n containerProps={{ className: classes[\"container\"] }}\n open={open}\n onClose={onClose}\n zIndex={zIndex}\n >\n <DialogTitle\n titleIcon={titleIcon}\n caption={caption}\n id={labelId(dialogId)}\n title={title}\n onClose={onClose}\n />\n <BaseModalContent\n id={descriptionId(dialogId)}\n className={classes[\"content\"]}\n disableAutoFocus\n >\n {children}\n </BaseModalContent>\n <DialogActions onClose={onClose} cancelAction={cancelAction}>\n {[SecondaryButton, PrimaryButton]}\n </DialogActions>\n <input\n autoFocus\n aria-hidden={true}\n style={{\n position: \"absolute\",\n width: 0,\n height: 0,\n opacity: 0\n }}\n maxLength={0}\n tabIndex={-1}\n onKeyDown={onHiddenInputKeyPress}\n />\n </BaseModal>\n );\n};\n\nexport const Dialog = React.forwardRef(DialogComponent);\n"],"names":["DialogComponent","id","open","children","onClose","title","primaryAction","secondaryAction","cancelAction","zIndex","titleIcon","caption","rest","ref","dialogId","useState","generateID","label","primaryLabel","restOfPrimaryAction","PrimaryButton","React","createElement","Button","key","SecondaryButton","secondaryLabel","restOfSecondaryAction","variant","onHiddenInputKeyPress","event","onClick","BaseModal","className","classes","containerProps","DialogTitle","labelId","BaseModalContent","descriptionId","disableAutoFocus","DialogActions","autoFocus","style","position","width","height","opacity","maxLength","tabIndex","onKeyDown","Dialog","forwardRef"],"mappings":"iiBA+CA,MAAMA,EAAmE,EAErEC,KACAC,OACAC,WACAC,UACAC,QACAC,gBACAC,kBACAC,eACAC,SACAC,YACAC,aACGC,GAELC,KAEA,MAAOC,GAAYC,EAASd,IAAE,MAAFA,SAAE,EAAFA,EAAMe,EAAW,KAC7C,MAAQC,MAAOC,KAAiBC,GAAwBb,EACxD,MAAMc,EACJC,EAAAC,cAACC,EAAO,CAAAC,IAAI,aAAcL,GACvBD,GAIL,MAAMO,EACJlB,GACA,WACE,MAAQU,MAAOS,KAAmBC,GAA0BpB,EAC5D,OACEc,EAACC,cAAAC,EAAO,CAAAC,IAAI,WAAWI,QAAQ,aAAcD,GAC1CD,EAGN,CAPD,GASF,MAAMG,EAAyBC,IAE7B,GAAIA,EAAMN,MAAQ,QAChBlB,EAAcyB,SACf,EAGH,OACEV,EAACC,cAAAU,MACKpB,EACJC,IAAKA,EACLZ,GAAIa,EACJmB,UAAWC,EAAQ,UACnBC,eAAgB,CAAEF,UAAWC,EAAQ,cACrChC,KAAMA,EACNE,QAASA,EACTK,OAAQA,GAERY,EAACC,cAAAc,EACC,CAAA1B,UAAWA,EACXC,QAASA,EACTV,GAAIoC,EAAQvB,GACZT,MAAOA,EACPD,QAASA,IAEXiB,EAAAC,cAACgB,EACC,CAAArC,GAAIsC,EAAczB,GAClBmB,UAAWC,EAAQ,WACnBM,iBAAgB,MAEfrC,GAEHkB,EAAAC,cAACmB,EAAa,CAACrC,QAASA,EAASI,aAAcA,GAC5C,CAACiB,EAAiBL,IAErBC,EAAAC,cAAA,QAAA,CACEoB,UAAS,KAAA,cACI,KACbC,MAAO,CACLC,SAAU,WACVC,MAAO,EACPC,OAAQ,EACRC,QAAS,GAEXC,UAAW,EACXC,UAAW,EACXC,UAAWrB,IAGf,EAGS,MAAAsB,EAAS9B,EAAM+B,WAAWpD"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"react";import{Typography as t}from"../../../Typography/Typography.esm.js";import a from"./DialogTitle.module.esm.js";import{Icon as
|
|
1
|
+
import e from"react";import{Typography as t}from"../../../Typography/Typography.esm.js";import a from"./DialogTitle.module.esm.js";import{Icon as o,Icons as i}from"../../../Icon/Icon.esm.js";import{IconButton as n}from"../../../Button/IconButton.esm.js";const c=({id:c,title:m,titleIcon:r,caption:l,onClose:s,...p},f)=>e.createElement("div",{...p,ref:f,className:a["header"]},e.createElement("div",{className:`${a["headline"]} ${l?a["with-caption"]:a["no-caption"]}`},r&&e.createElement("div",{className:a["title-icon"]},typeof r==="boolean"?e.createElement(o,{icon:i.InfoCircle}):r),e.createElement("div",{className:a["title-wrapper"]},e.createElement(t,{id:c,className:a["title"],spacing:r&&{marginLeft:2},tag:"h1",variant:"h4"},m),l&&e.createElement(t,{className:a["caption"],spacing:{marginLeft:2},variant:"sub-text"},l))),e.createElement(n,{onClick:s,className:a["close-button"],title:"close modal"},e.createElement(o,{icon:i.Times})));const m=e.forwardRef(c);export{m as DialogTitle};
|
|
2
2
|
//# sourceMappingURL=DialogTitle.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DialogTitle.esm.js","sources":["../../../../../../../src/components/Notifications/Dialog/DialogTitle/DialogTitle.tsx"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { ForwardRefRenderFunction, ComponentPropsWithRef } from \"react\";\nimport { Typography } from \"../../../Typography/Typography\";\nimport classes from \"./DialogTitle.module.scss\";\nimport { Icon, Icons } from \"../../../Icon/Icon\";\n\nexport interface Props extends ComponentPropsWithRef<\"div\"> {\n id: string;\n title: string;\n titleIcon?: React.ReactNode;\n caption?: string;\n}\n\nconst DialogTitleComponent: ForwardRefRenderFunction<HTMLDivElement, Props> = (\n { id, title, titleIcon, caption, ...rest }: Props,\n ref\n) => {\n return (\n <div {...rest} ref={ref} className={classes[\"header\"]}>\n {titleIcon && (\n
|
|
1
|
+
{"version":3,"file":"DialogTitle.esm.js","sources":["../../../../../../../src/components/Notifications/Dialog/DialogTitle/DialogTitle.tsx"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { ForwardRefRenderFunction, ComponentPropsWithRef } from \"react\";\nimport { Typography } from \"../../../Typography/Typography\";\nimport classes from \"./DialogTitle.module.scss\";\nimport { Icon, Icons } from \"../../../Icon/Icon\";\nimport { IconButton } from \"../../../Button/IconButton\";\n\nexport interface Props extends ComponentPropsWithRef<\"div\"> {\n id: string;\n title: string;\n titleIcon?: React.ReactNode;\n caption?: string;\n onClose?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n}\n\nconst DialogTitleComponent: ForwardRefRenderFunction<HTMLDivElement, Props> = (\n { id, title, titleIcon, caption, onClose, ...rest }: Props,\n ref\n) => {\n return (\n <div {...rest} ref={ref} className={classes[\"header\"]}>\n <div\n className={`${classes[\"headline\"]} ${caption ? classes[\"with-caption\"] : classes[\"no-caption\"]}`}\n >\n {titleIcon && (\n <div className={classes[\"title-icon\"]}>\n {typeof titleIcon === \"boolean\" ? <Icon icon={Icons.InfoCircle} /> : titleIcon}\n </div>\n )}\n <div className={classes[\"title-wrapper\"]}>\n <Typography\n id={id}\n className={classes[\"title\"]}\n spacing={titleIcon && { marginLeft: 2 }}\n tag=\"h1\"\n variant=\"h4\"\n >\n {title}\n </Typography>\n {caption && (\n <Typography\n className={classes[\"caption\"]}\n spacing={{ marginLeft: 2 }}\n variant=\"sub-text\"\n >\n {caption}\n </Typography>\n )}\n </div>\n </div>\n <IconButton onClick={onClose} className={classes[\"close-button\"]} title=\"close modal\">\n <Icon icon={Icons.Times} />\n </IconButton>\n </div>\n );\n};\n\nexport const DialogTitle = React.forwardRef(DialogTitleComponent);\n"],"names":["DialogTitleComponent","id","title","titleIcon","caption","onClose","rest","ref","React","createElement","className","classes","Icon","icon","Icons","InfoCircle","Typography","spacing","marginLeft","tag","variant","IconButton","onClick","Times","DialogTitle","forwardRef"],"mappings":"8PA8BA,MAAMA,EAAwE,EAC1EC,KAAIC,QAAOC,YAAWC,UAASC,aAAYC,GAC7CC,IAGEC,EAAAC,cAAA,MAAA,IAASH,EAAMC,IAAKA,EAAKG,UAAWC,EAAQ,WAC1CH,EACEC,cAAA,MAAA,CAAAC,UAAW,GAAGC,EAAQ,eAAeP,EAAUO,EAAQ,gBAAkBA,EAAQ,iBAEhFR,GACCK,EAAKC,cAAA,MAAA,CAAAC,UAAWC,EAAQ,sBACdR,IAAc,UAAYK,EAACC,cAAAG,EAAK,CAAAC,KAAMC,EAAMC,aAAiBZ,GAGzEK,EAAAC,cAAA,MAAA,CAAKC,UAAWC,EAAQ,kBACtBH,EAAAC,cAACO,EAAU,CACTf,GAAIA,EACJS,UAAWC,EAAQ,SACnBM,QAASd,GAAa,CAAEe,WAAY,GACpCC,IAAI,KACJC,QAAQ,MAEPlB,GAEFE,GACCI,EAACC,cAAAO,EACC,CAAAN,UAAWC,EAAQ,WACnBM,QAAS,CAAEC,WAAY,GACvBE,QAAQ,YAEPhB,KAKTI,EAAAC,cAACY,EAAU,CAACC,QAASjB,EAASK,UAAWC,EAAQ,gBAAiBT,MAAM,eACtEM,EAACC,cAAAG,EAAK,CAAAC,KAAMC,EAAMS,UAMb,MAAAC,EAAchB,EAAMiB,WAAWzB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import i from "../../../../lib/style-inject.js";var
|
|
1
|
+
import i from "../../../../lib/style-inject.js";var e='/*!\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.DialogTitle-module_header__maiky{align-items:center;display:flex;justify-content:space-between;margin:1rem 1.5rem}.DialogTitle-module_headline__TItnb{display:flex}.DialogTitle-module_headline__TItnb.DialogTitle-module_with-caption__2Bu7z{align-items:flex-start}.DialogTitle-module_headline__TItnb.DialogTitle-module_no-caption__4-QI4{align-items:center}.DialogTitle-module_title__2Date{line-height:1;margin:0}.DialogTitle-module_title-icon__RFCV->[data-icon]{font-size:1.25rem}.DialogTitle-module_caption__08LUu{color:var(--color-blue-grey500)}.DialogTitle-module_close-button__EO320{flex-shrink:0}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkRpYWxvZ1RpdGxlLm1vZHVsZS5zY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7Ozs7Ozs7OztFQWNFLENBQ0Ysa0NBR0Usa0JBQW1CLENBRG5CLFlBQWEsQ0FFYiw2QkFBOEIsQ0FIOUIsa0JBSUYsQ0FFQSxvQ0FDRSxZQUNGLENBQ0EsMkVBQ0Usc0JBQ0YsQ0FDQSx5RUFDRSxrQkFDRixDQUVBLGlDQUVFLGFBQWMsQ0FEZCxRQUVGLENBQ0Esa0RBQ0UsaUJBQ0YsQ0FFQSxtQ0FDRSwrQkFDRixDQUVBLHdDQUNFLGFBQ0YiLCJmaWxlIjoiRGlhbG9nVGl0bGUubW9kdWxlLnNjc3MiLCJzb3VyY2VzQ29udGVudCI6WyIvKiFcbiAqIENvcHlyaWdodCAyMDIyIE9uZVdlbGNvbWUgQi5WLlxuICpcbiAqICAgIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSBcIkxpY2Vuc2VcIik7XG4gKiAgICB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuXG4gKiAgICBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXRcbiAqXG4gKiAgICAgICAgaHR0cDovL3d3dy5hcGFjaGU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xuICBmbGV4LXNocmluazogMDtcbn0iXX0= */';var l={header:"DialogTitle-module_header__maiky",headline:"DialogTitle-module_headline__TItnb","with-caption":"DialogTitle-module_with-caption__2Bu7z","no-caption":"DialogTitle-module_no-caption__4-QI4",title:"DialogTitle-module_title__2Date","title-icon":"DialogTitle-module_title-icon__RFCV-",caption:"DialogTitle-module_caption__08LUu","close-button":"DialogTitle-module_close-button__EO320"};i(e);export{l as default};
|
|
2
2
|
//# sourceMappingURL=DialogTitle.module.esm.js.map
|
|
@@ -4,5 +4,6 @@ export interface Props extends ComponentPropsWithRef<"div"> {
|
|
|
4
4
|
title: string;
|
|
5
5
|
titleIcon?: React.ReactNode;
|
|
6
6
|
caption?: string;
|
|
7
|
+
onClose?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
7
8
|
}
|
|
8
9
|
export declare const DialogTitle: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
package/dist/esm/src/index.d.ts
CHANGED
|
@@ -104,6 +104,8 @@ export { TextareaWrapper } from "./components/Form/Wrapper/TextareaWrapper/Texta
|
|
|
104
104
|
export type { Props as TextareaWrapperProps } from "./components/Form/Wrapper/TextareaWrapper/TextareaWrapper";
|
|
105
105
|
export { SelectWrapper } from "./components/Form/Wrapper/SelectWrapper/SelectWrapper";
|
|
106
106
|
export type { Props as SelectWrapperProps } from "./components/Form/Wrapper/SelectWrapper/SelectWrapper";
|
|
107
|
+
export { FileUpload } from "./components/Form/FileUpload/FileUpload";
|
|
108
|
+
export type { Props as FileUploadProps } from "./components/Form/FileUpload/FileUpload";
|
|
107
109
|
/** Wizard */
|
|
108
110
|
export { Wizard } from "./components/Wizard/Wizard";
|
|
109
111
|
export type { Props as WizardProps } from "./components/Wizard/Wizard";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{BaseStyling}from"../_BaseStyling_/BaseStyling.esm.js";export{Button}from"../Button/Button.esm.js";export{Breadcrumbs}from"../Breadcrumbs/Breadcrumbs.esm.js";export{ContextMenu}from"../ContextMenu/ContextMenu.esm.js";export{ContextMenuItem}from"../ContextMenu/ContextMenuItem.esm.js";export{Link}from"../Link/Link.esm.js";export{Icon,Icons}from"../Icon/Icon.esm.js";export{IconButton}from"../Button/IconButton.esm.js";export{Tab}from"../Tabs/Tab.esm.js";export{Tabs}from"../Tabs/Tabs.esm.js";export{Tag}from"../Tag/Tag.esm.js";export{TextEllipsis}from"../TextEllipsis/TextEllipsis.esm.js";export{Tile}from"../Tiles/Tile.esm.js";export{Tiles}from"../Tiles/Tiles.esm.js";export{Tooltip}from"../Tooltip/Tooltip.esm.js";export{Typography}from"../Typography/Typography.esm.js";export{ProgressBar}from"../ProgressBar/ProgressBar.esm.js";export{Skeleton}from"../Skeleton/Skeleton.esm.js";export{StatusIndicator}from"../StatusIndicator/StatusIndicator.esm.js";export{Stepper}from"../Stepper/Stepper.esm.js";export{Pagination}from"../Pagination/Pagination.esm.js";export{useRepeater}from"./hooks/useRepeater.esm.js";export{usePosition}from"./hooks/usePosition.esm.js";export{useDebouncedCallback}from"./hooks/useDebouncedCallback.esm.js";export{debounce,generateID,throttle}from"./util/helper.esm.js";export{BaseModal as Modal}from"../Notifications/BaseModal/BaseModal.esm.js";export{useSnackbar}from"../Notifications/Snackbar/useSnackbar.esm.js";export{Dialog}from"../Notifications/Dialog/Dialog.esm.js";export{DiscardChangesModal}from"../Notifications/DiscardChangesModal/DiscardChangesModal.esm.js";export{BaseModalActions as ModalActions}from"../Notifications/BaseModal/BaseModalActions/BaseModalActions.esm.js";export{BaseModalContent as ModalContent}from"../Notifications/BaseModal/BaseModalContent/BaseModalContent.esm.js";export{BaseModalHeader as ModalHeader}from"../Notifications/BaseModal/BaseModalHeader/BaseModalHeader.esm.js";export{NotificationProvider,useNotificationContext}from"../Notifications/NotificationProvider/NotificationContext.esm.js";export{SlideInModal}from"../Notifications/SlideInModal/SlideInModal.esm.js";export{SnackbarProvider}from"../Notifications/Snackbar/SnackbarProvider/SnackbarProvider.esm.js";export{Checkbox}from"../Form/Checkbox/Checkbox.esm.js";export{Fieldset}from"../Form/Fieldset/Fieldset.esm.js";export{Form}from"../Form/Form.esm.js";export{FormControl}from"../Form/FormControl/FormControl.esm.js";export{FormGroup}from"../Form/FormGroup/FormGroup.esm.js";export{FormHelperText}from"../Form/FormHelperText/FormHelperText.esm.js";export{Input}from"../Form/Input/Input.esm.js";export{InputWrapper}from"../Form/Wrapper/InputWrapper/InputWrapper.esm.js";export{Label}from"../Form/Label/Label.esm.js";export{Radio}from"../Form/Radio/Radio.esm.js";export{RadioWrapper}from"../Form/Wrapper/RadioWrapper/RadioWrapper.esm.js";export{Select}from"../Form/Select/SingleSelect/Select.esm.js";export{MultiSelect}from"../Form/Select/MultiSelect/MultiSelect.esm.js";export{Option}from"../Form/Select/SingleSelect/Option.esm.js";export{MultiOption}from"../Form/Select/MultiSelect/MultiOption.esm.js";export{Textarea}from"../Form/Textarea/Textarea.esm.js";export{Toggle}from"../Form/Toggle/Toggle.esm.js";export{CheckboxWrapper}from"../Form/Wrapper/CheckboxWrapper/CheckboxWrapper.esm.js";export{TextareaWrapper}from"../Form/Wrapper/TextareaWrapper/TextareaWrapper.esm.js";export{SelectWrapper}from"../Form/Wrapper/SelectWrapper/SelectWrapper.esm.js";export{Wizard}from"../Wizard/Wizard.esm.js";export{WizardActions}from"../Wizard/WizardActions/WizardActions.esm.js";export{WizardSteps}from"../Wizard/WizardSteps/WizardSteps.esm.js";export{BaseWizardSteps}from"../Wizard/BaseWizardSteps/BaseWizardSteps.esm.js";export{DataGrid}from"../DataGrid/DataGrid.esm.js";export{DataGridRow}from"../DataGrid/DataGridBody/DataGridRow.esm.js";export{DataGridCell}from"../DataGrid/DataGridBody/DataGridCell.esm.js";export{Banner}from"../Notifications/Banner/Banner.esm.js";
|
|
1
|
+
export{BaseStyling}from"../_BaseStyling_/BaseStyling.esm.js";export{Button}from"../Button/Button.esm.js";export{Breadcrumbs}from"../Breadcrumbs/Breadcrumbs.esm.js";export{ContextMenu}from"../ContextMenu/ContextMenu.esm.js";export{ContextMenuItem}from"../ContextMenu/ContextMenuItem.esm.js";export{Link}from"../Link/Link.esm.js";export{Icon,Icons}from"../Icon/Icon.esm.js";export{IconButton}from"../Button/IconButton.esm.js";export{Tab}from"../Tabs/Tab.esm.js";export{Tabs}from"../Tabs/Tabs.esm.js";export{Tag}from"../Tag/Tag.esm.js";export{TextEllipsis}from"../TextEllipsis/TextEllipsis.esm.js";export{Tile}from"../Tiles/Tile.esm.js";export{Tiles}from"../Tiles/Tiles.esm.js";export{Tooltip}from"../Tooltip/Tooltip.esm.js";export{Typography}from"../Typography/Typography.esm.js";export{ProgressBar}from"../ProgressBar/ProgressBar.esm.js";export{Skeleton}from"../Skeleton/Skeleton.esm.js";export{StatusIndicator}from"../StatusIndicator/StatusIndicator.esm.js";export{Stepper}from"../Stepper/Stepper.esm.js";export{Pagination}from"../Pagination/Pagination.esm.js";export{useRepeater}from"./hooks/useRepeater.esm.js";export{usePosition}from"./hooks/usePosition.esm.js";export{useDebouncedCallback}from"./hooks/useDebouncedCallback.esm.js";export{debounce,generateID,throttle}from"./util/helper.esm.js";export{BaseModal as Modal}from"../Notifications/BaseModal/BaseModal.esm.js";export{useSnackbar}from"../Notifications/Snackbar/useSnackbar.esm.js";export{Dialog}from"../Notifications/Dialog/Dialog.esm.js";export{DiscardChangesModal}from"../Notifications/DiscardChangesModal/DiscardChangesModal.esm.js";export{BaseModalActions as ModalActions}from"../Notifications/BaseModal/BaseModalActions/BaseModalActions.esm.js";export{BaseModalContent as ModalContent}from"../Notifications/BaseModal/BaseModalContent/BaseModalContent.esm.js";export{BaseModalHeader as ModalHeader}from"../Notifications/BaseModal/BaseModalHeader/BaseModalHeader.esm.js";export{NotificationProvider,useNotificationContext}from"../Notifications/NotificationProvider/NotificationContext.esm.js";export{SlideInModal}from"../Notifications/SlideInModal/SlideInModal.esm.js";export{SnackbarProvider}from"../Notifications/Snackbar/SnackbarProvider/SnackbarProvider.esm.js";export{Checkbox}from"../Form/Checkbox/Checkbox.esm.js";export{Fieldset}from"../Form/Fieldset/Fieldset.esm.js";export{Form}from"../Form/Form.esm.js";export{FormControl}from"../Form/FormControl/FormControl.esm.js";export{FormGroup}from"../Form/FormGroup/FormGroup.esm.js";export{FormHelperText}from"../Form/FormHelperText/FormHelperText.esm.js";export{Input}from"../Form/Input/Input.esm.js";export{InputWrapper}from"../Form/Wrapper/InputWrapper/InputWrapper.esm.js";export{Label}from"../Form/Label/Label.esm.js";export{Radio}from"../Form/Radio/Radio.esm.js";export{RadioWrapper}from"../Form/Wrapper/RadioWrapper/RadioWrapper.esm.js";export{Select}from"../Form/Select/SingleSelect/Select.esm.js";export{MultiSelect}from"../Form/Select/MultiSelect/MultiSelect.esm.js";export{Option}from"../Form/Select/SingleSelect/Option.esm.js";export{MultiOption}from"../Form/Select/MultiSelect/MultiOption.esm.js";export{Textarea}from"../Form/Textarea/Textarea.esm.js";export{Toggle}from"../Form/Toggle/Toggle.esm.js";export{CheckboxWrapper}from"../Form/Wrapper/CheckboxWrapper/CheckboxWrapper.esm.js";export{TextareaWrapper}from"../Form/Wrapper/TextareaWrapper/TextareaWrapper.esm.js";export{SelectWrapper}from"../Form/Wrapper/SelectWrapper/SelectWrapper.esm.js";export{FileUpload}from"../Form/FileUpload/FileUpload.esm.js";export{Wizard}from"../Wizard/Wizard.esm.js";export{WizardActions}from"../Wizard/WizardActions/WizardActions.esm.js";export{WizardSteps}from"../Wizard/WizardSteps/WizardSteps.esm.js";export{BaseWizardSteps}from"../Wizard/BaseWizardSteps/BaseWizardSteps.esm.js";export{DataGrid}from"../DataGrid/DataGrid.esm.js";export{DataGridRow}from"../DataGrid/DataGridBody/DataGridRow.esm.js";export{DataGridCell}from"../DataGrid/DataGridBody/DataGridCell.esm.js";export{Banner}from"../Notifications/Banner/Banner.esm.js";
|
|
2
2
|
//# sourceMappingURL=index.esm.js.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"homepage": "http://onewelcome.github.io/react-lib-components",
|
|
3
3
|
"name": "@onewelcome/react-lib-components",
|
|
4
|
-
"version": "6.
|
|
4
|
+
"version": "6.4.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "OneWelcome B.V.",
|
|
7
7
|
"main": "dist/cjs/src/index.cjs.js",
|
|
@@ -58,38 +58,38 @@
|
|
|
58
58
|
"@babel/preset-typescript": "^7.23.3",
|
|
59
59
|
"@mdx-js/react": "^3.0.0",
|
|
60
60
|
"@onewelcome/eslint-config-shared-codestyle": "^9.1.0",
|
|
61
|
-
"@onewelcome/storybook-addon-basestyling": "^1.0.
|
|
61
|
+
"@onewelcome/storybook-addon-basestyling": "^1.0.1",
|
|
62
62
|
"@rollup/plugin-commonjs": "^25.0.7",
|
|
63
63
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
64
64
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
65
|
-
"@storybook/addon-a11y": "^7.6.
|
|
66
|
-
"@storybook/addon-actions": "^7.6.
|
|
67
|
-
"@storybook/addon-docs": "^7.6.
|
|
68
|
-
"@storybook/addon-essentials": "^7.6.
|
|
69
|
-
"@storybook/addon-interactions": "^7.6.
|
|
70
|
-
"@storybook/addon-links": "^7.6.
|
|
71
|
-
"@storybook/blocks": "^7.6.
|
|
72
|
-
"@storybook/components": "^7.6.
|
|
65
|
+
"@storybook/addon-a11y": "^7.6.14",
|
|
66
|
+
"@storybook/addon-actions": "^7.6.14",
|
|
67
|
+
"@storybook/addon-docs": "^7.6.14",
|
|
68
|
+
"@storybook/addon-essentials": "^7.6.14",
|
|
69
|
+
"@storybook/addon-interactions": "^7.6.14",
|
|
70
|
+
"@storybook/addon-links": "^7.6.14",
|
|
71
|
+
"@storybook/blocks": "^7.6.14",
|
|
72
|
+
"@storybook/components": "^7.6.14",
|
|
73
73
|
"@storybook/jest": "^0.2.3",
|
|
74
|
-
"@storybook/manager-api": "^7.6.
|
|
75
|
-
"@storybook/react": "^7.6.
|
|
76
|
-
"@storybook/react-webpack5": "^7.6.
|
|
74
|
+
"@storybook/manager-api": "^7.6.14",
|
|
75
|
+
"@storybook/react": "^7.6.14",
|
|
76
|
+
"@storybook/react-webpack5": "^7.6.14",
|
|
77
77
|
"@storybook/testing-library": "^0.2.2",
|
|
78
|
-
"@storybook/theming": "^7.6.
|
|
78
|
+
"@storybook/theming": "^7.6.14",
|
|
79
79
|
"@testing-library/dom": "^9.3.4",
|
|
80
80
|
"@testing-library/jest-dom": "^6.4.2",
|
|
81
81
|
"@testing-library/react": "^14.2.1",
|
|
82
82
|
"@testing-library/user-event": "^14.5.2",
|
|
83
83
|
"@types/jest": "^29.5.12",
|
|
84
84
|
"@types/mdx": "^2.0.11",
|
|
85
|
-
"@types/react": "^18.2.
|
|
86
|
-
"@types/react-dom": "^18.2.
|
|
85
|
+
"@types/react": "^18.2.55",
|
|
86
|
+
"@types/react-dom": "^18.2.19",
|
|
87
87
|
"@types/react-router": "^5.1.20",
|
|
88
88
|
"@types/react-router-dom": "^5.3.3",
|
|
89
89
|
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
|
90
90
|
"@typescript-eslint/parser": "^6.21.0",
|
|
91
91
|
"babel-loader": "^9.1.3",
|
|
92
|
-
"chromatic": "^10.
|
|
92
|
+
"chromatic": "^10.9.3",
|
|
93
93
|
"css-loader": "^6.10.0",
|
|
94
94
|
"eslint": "^8.56.0",
|
|
95
95
|
"eslint-config-prettier": "^9.1.0",
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
"lint-staged": "^15.2.2",
|
|
111
111
|
"mini-css-extract-plugin": "^2.8.0",
|
|
112
112
|
"npm-run-all": "^4.1.5",
|
|
113
|
-
"postcss": "^8.4.
|
|
113
|
+
"postcss": "^8.4.35",
|
|
114
114
|
"postcss-modules": "^6.0.0",
|
|
115
115
|
"postcss-url": "^10.1.3",
|
|
116
116
|
"prettier": "^3.2.5",
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
"sass": "^1.70.0",
|
|
126
126
|
"sass-loader": "^14.1.0",
|
|
127
127
|
"size-limit": "^11.0.2",
|
|
128
|
-
"storybook": "^7.6.
|
|
128
|
+
"storybook": "^7.6.14",
|
|
129
129
|
"storybook-addon-pseudo-states": "^2.1.2",
|
|
130
130
|
"style-loader": "^3.3.4",
|
|
131
131
|
"ts-jest": "^29.1.2",
|
|
@@ -56,7 +56,6 @@ const DialogComponent: ForwardRefRenderFunction<HTMLDivElement, Props> = (
|
|
|
56
56
|
secondaryAction,
|
|
57
57
|
cancelAction,
|
|
58
58
|
zIndex,
|
|
59
|
-
disableEscapeKeyDown = true,
|
|
60
59
|
titleIcon,
|
|
61
60
|
caption,
|
|
62
61
|
...rest
|
|
@@ -97,12 +96,16 @@ const DialogComponent: ForwardRefRenderFunction<HTMLDivElement, Props> = (
|
|
|
97
96
|
className={classes["dialog"]}
|
|
98
97
|
containerProps={{ className: classes["container"] }}
|
|
99
98
|
open={open}
|
|
100
|
-
disableBackdrop
|
|
101
99
|
onClose={onClose}
|
|
102
100
|
zIndex={zIndex}
|
|
103
|
-
disableEscapeKeyDown={disableEscapeKeyDown}
|
|
104
101
|
>
|
|
105
|
-
<DialogTitle
|
|
102
|
+
<DialogTitle
|
|
103
|
+
titleIcon={titleIcon}
|
|
104
|
+
caption={caption}
|
|
105
|
+
id={labelId(dialogId)}
|
|
106
|
+
title={title}
|
|
107
|
+
onClose={onClose}
|
|
108
|
+
/>
|
|
106
109
|
<BaseModalContent
|
|
107
110
|
id={descriptionId(dialogId)}
|
|
108
111
|
className={classes["content"]}
|
|
@@ -17,7 +17,20 @@
|
|
|
17
17
|
.header {
|
|
18
18
|
margin: 1rem 1.5rem;
|
|
19
19
|
display: flex;
|
|
20
|
-
align-items:
|
|
20
|
+
align-items: center;
|
|
21
|
+
justify-content: space-between;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.headline {
|
|
25
|
+
display: flex;
|
|
26
|
+
|
|
27
|
+
&.with-caption {
|
|
28
|
+
align-items: flex-start;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&.no-caption {
|
|
32
|
+
align-items: center;
|
|
33
|
+
}
|
|
21
34
|
}
|
|
22
35
|
|
|
23
36
|
.title {
|
|
@@ -32,3 +45,7 @@
|
|
|
32
45
|
.caption {
|
|
33
46
|
color: var(--color-blue-grey500);
|
|
34
47
|
}
|
|
48
|
+
|
|
49
|
+
.close-button {
|
|
50
|
+
flex-shrink: 0;
|
|
51
|
+
}
|
|
@@ -18,41 +18,54 @@ import React, { ForwardRefRenderFunction, ComponentPropsWithRef } from "react";
|
|
|
18
18
|
import { Typography } from "../../../Typography/Typography";
|
|
19
19
|
import classes from "./DialogTitle.module.scss";
|
|
20
20
|
import { Icon, Icons } from "../../../Icon/Icon";
|
|
21
|
+
import { IconButton } from "../../../Button/IconButton";
|
|
21
22
|
|
|
22
23
|
export interface Props extends ComponentPropsWithRef<"div"> {
|
|
23
24
|
id: string;
|
|
24
25
|
title: string;
|
|
25
26
|
titleIcon?: React.ReactNode;
|
|
26
27
|
caption?: string;
|
|
28
|
+
onClose?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
const DialogTitleComponent: ForwardRefRenderFunction<HTMLDivElement, Props> = (
|
|
30
|
-
{ id, title, titleIcon, caption, ...rest }: Props,
|
|
32
|
+
{ id, title, titleIcon, caption, onClose, ...rest }: Props,
|
|
31
33
|
ref
|
|
32
34
|
) => {
|
|
33
35
|
return (
|
|
34
36
|
<div {...rest} ref={ref} className={classes["header"]}>
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
id={id}
|
|
43
|
-
className={classes["title"]}
|
|
44
|
-
spacing={titleIcon && { marginLeft: 2 }}
|
|
45
|
-
tag="h1"
|
|
46
|
-
variant="h4"
|
|
47
|
-
>
|
|
48
|
-
{title}
|
|
49
|
-
</Typography>
|
|
50
|
-
{caption && (
|
|
51
|
-
<Typography className={classes["caption"]} spacing={{ marginLeft: 2 }} variant="sub-text">
|
|
52
|
-
{caption}
|
|
53
|
-
</Typography>
|
|
37
|
+
<div
|
|
38
|
+
className={`${classes["headline"]} ${caption ? classes["with-caption"] : classes["no-caption"]}`}
|
|
39
|
+
>
|
|
40
|
+
{titleIcon && (
|
|
41
|
+
<div className={classes["title-icon"]}>
|
|
42
|
+
{typeof titleIcon === "boolean" ? <Icon icon={Icons.InfoCircle} /> : titleIcon}
|
|
43
|
+
</div>
|
|
54
44
|
)}
|
|
45
|
+
<div className={classes["title-wrapper"]}>
|
|
46
|
+
<Typography
|
|
47
|
+
id={id}
|
|
48
|
+
className={classes["title"]}
|
|
49
|
+
spacing={titleIcon && { marginLeft: 2 }}
|
|
50
|
+
tag="h1"
|
|
51
|
+
variant="h4"
|
|
52
|
+
>
|
|
53
|
+
{title}
|
|
54
|
+
</Typography>
|
|
55
|
+
{caption && (
|
|
56
|
+
<Typography
|
|
57
|
+
className={classes["caption"]}
|
|
58
|
+
spacing={{ marginLeft: 2 }}
|
|
59
|
+
variant="sub-text"
|
|
60
|
+
>
|
|
61
|
+
{caption}
|
|
62
|
+
</Typography>
|
|
63
|
+
)}
|
|
64
|
+
</div>
|
|
55
65
|
</div>
|
|
66
|
+
<IconButton onClick={onClose} className={classes["close-button"]} title="close modal">
|
|
67
|
+
<Icon icon={Icons.Times} />
|
|
68
|
+
</IconButton>
|
|
56
69
|
</div>
|
|
57
70
|
);
|
|
58
71
|
};
|
package/src/index.ts
CHANGED
|
@@ -145,6 +145,8 @@ export { TextareaWrapper } from "./components/Form/Wrapper/TextareaWrapper/Texta
|
|
|
145
145
|
export type { Props as TextareaWrapperProps } from "./components/Form/Wrapper/TextareaWrapper/TextareaWrapper";
|
|
146
146
|
export { SelectWrapper } from "./components/Form/Wrapper/SelectWrapper/SelectWrapper";
|
|
147
147
|
export type { Props as SelectWrapperProps } from "./components/Form/Wrapper/SelectWrapper/SelectWrapper";
|
|
148
|
+
export { FileUpload } from "./components/Form/FileUpload/FileUpload";
|
|
149
|
+
export type { Props as FileUploadProps } from "./components/Form/FileUpload/FileUpload";
|
|
148
150
|
|
|
149
151
|
/** Wizard */
|
|
150
152
|
export { Wizard } from "./components/Wizard/Wizard";
|