@apple-pie/slice 0.0.5 → 0.0.6
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/chunks/{FileList-DWIm4o46.js → FileList-BHMne9Mr.js} +3 -3
- package/dist/cjs/chunks/{Label-DZJ_YDtD.js → Label-s1aCv2Y1.js} +1 -1
- package/dist/cjs/chunks/{PromptInput-DmO8a3oX.js → PromptInput-CfzofBTJ.js} +1 -1
- package/dist/cjs/chunks/UploadArea-DunGYE1_.js +155 -0
- package/dist/cjs/index.js +11 -3
- package/dist/cjs/uikit/FileList.js +1 -1
- package/dist/cjs/uikit/Label.js +1 -1
- package/dist/cjs/uikit/PromptInput.js +2 -2
- package/dist/cjs/uikit/UploadArea.js +31 -0
- package/dist/esm/chunks/{FileList-yo_u1Kvw.js → FileList-CdUgbpYF.js} +3 -3
- package/dist/esm/chunks/{Label-CgntsR3g.js → Label-BRon-ejm.js} +1 -1
- package/dist/esm/chunks/{PromptInput-C_qj6kGp.js → PromptInput-DodTBG82.js} +1 -1
- package/dist/esm/chunks/UploadArea-C0YHy4Z9.js +147 -0
- package/dist/esm/index.js +4 -3
- package/dist/esm/uikit/FileList.js +1 -1
- package/dist/esm/uikit/Label.js +1 -1
- package/dist/esm/uikit/PromptInput.js +2 -2
- package/dist/esm/uikit/UploadArea.js +19 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/uikit/FileList/_types.d.ts +1 -0
- package/dist/types/uikit/UploadArea/UploadArea.d.ts +54 -0
- package/dist/types/uikit/UploadArea/_types.d.ts +46 -0
- package/dist/types/uikit/UploadArea/index.d.ts +3 -0
- package/dist/types/util/utils.d.ts +4 -0
- package/package.json +1 -1
|
@@ -58,7 +58,7 @@ function fileIconName(extension) {
|
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
var css_248z = ".flexBox-module_row__PWxbe {\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowBetween__27lKK {\n\tdisplay: flex;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowStart__nJZnW {\n\tdisplay: flex;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowEnd__dHcOU {\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_column__MP2Xd {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStart__Kg8cV {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: flex-start;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStartCenter__zcmtk {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnBetween__157yI {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnEnd__u2nwI {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-end;\n\talign-items: flex-end;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.type-module_body-xs-regular__QWEzl {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-medium__FxEAv {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-bold__rf7AV {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.25px;\n}.type-module_body-s-regular__8-FO- {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-medium__qyYq- {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-bold__7GQ5Z {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-m-regular__Qtp5G {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-medium__Ieh9K {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-bold__0lZ3I {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-l-regular__Ar4d3 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-medium__6tV1n {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-bold__I8Q1v {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-xl-regular__zDf-z {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-xl-medium__R5GpK {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-xl-bold__SI-hC {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_heading-s-medium__jGIb2 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-s-bold__QFgN8 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-bold__tdBSi {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-medium__-7Uyu {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-medium__8hGYF {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 30px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-bold__Cryjg {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 30px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-xl-medium__PUi44 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 36px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-xl-bold__1B6fk {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 36px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}\n\n.FileList-module_wrapper__vsmK5 {\n\twidth: 100%;\n\toverflow: hidden;\n\tflex-wrap: var(--file-wrap);\n\tflex-direction: var(--file-direction) !important;\n\talign-items: flex-start !important;\n\tgap: var(--file-gap);\n\tuser-select: none;\n\t-webkit-user-select: none;\n}\n\n.FileList-module_file__TTDb9 {\n\tposition: relative;\n\tpadding: var(--file-padding) !important;\n\tborder: 1px solid var(--file-border-color);\n\tborder-radius: 4px;\n\toverflow:
|
|
61
|
+
var css_248z = ".flexBox-module_row__PWxbe {\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowBetween__27lKK {\n\tdisplay: flex;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowStart__nJZnW {\n\tdisplay: flex;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowEnd__dHcOU {\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_column__MP2Xd {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStart__Kg8cV {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: flex-start;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStartCenter__zcmtk {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnBetween__157yI {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnEnd__u2nwI {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-end;\n\talign-items: flex-end;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.type-module_body-xs-regular__QWEzl {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-medium__FxEAv {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-bold__rf7AV {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.25px;\n}.type-module_body-s-regular__8-FO- {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-medium__qyYq- {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-bold__7GQ5Z {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-m-regular__Qtp5G {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-medium__Ieh9K {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-bold__0lZ3I {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-l-regular__Ar4d3 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-medium__6tV1n {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-bold__I8Q1v {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-xl-regular__zDf-z {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-xl-medium__R5GpK {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-xl-bold__SI-hC {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_heading-s-medium__jGIb2 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-s-bold__QFgN8 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-bold__tdBSi {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-medium__-7Uyu {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-medium__8hGYF {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 30px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-bold__Cryjg {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 30px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-xl-medium__PUi44 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 36px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-xl-bold__1B6fk {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 36px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}\n\n.FileList-module_wrapper__vsmK5 {\n\twidth: 100%;\n\toverflow: hidden;\n\tflex-wrap: var(--file-wrap);\n\tflex-direction: var(--file-direction) !important;\n\talign-items: flex-start !important;\n\tgap: var(--file-gap);\n\tuser-select: none;\n\t-webkit-user-select: none;\n}\n\n.FileList-module_file__TTDb9 {\n\tposition: relative;\n\tpadding: var(--file-padding) !important;\n\tborder: 1px solid var(--file-border-color);\n\tborder-radius: 4px;\n\toverflow: hidden;\n\tmin-height: max-content;\n\tmax-width: var(--file-max-width);\n\tmin-width: var(--file-min-width);\n\tcolor: var(--core-text-primary);\n\tbackground: transparent;\n\tgap: 4px;\n}\n\n/* file progress bar */\n.FileList-module_file__TTDb9::before {\n\tcontent: \"\";\n\tposition: absolute;\n\tbackground: var(--file-bg-color);\n\ttop: 0;\n\tbottom: 0;\n\tleft: 0;\n\twidth: var(--file-progress);\n\ttransition: width 1s ease-in-out 0s;\n\tz-index: 1;\n}\n\n.FileList-module_fileName__qFumz {\n\twidth: 100%;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n\tword-break: break-all;\n\tdisplay: -webkit-box !important;\n\t-webkit-line-clamp: 1;\n\t-webkit-box-orient: vertical;\n\tz-index: 2;\n}\n\n.FileList-module_meta__cEeZM {\n\tflex: 1;\n\tmin-width: 0;\n\tgap: 2px;\n\tz-index: 2;\n}\n\n.FileList-module_status__gOq0Z {\n\tcolor: var(--core-text-secondary);\n\tline-height: 1.2;\n}\n\n.FileList-module_error__lwFza {\n\tcolor: var(--feedback-warning);\n}\n\n.FileList-module_fileIcon__a-lhL {\n\tmin-width: var(--file-icon-size);\n\tmin-height: var(--file-icon-size);\n\tmax-width: var(--file-icon-size);\n\tmax-height: var(--file-icon-size);\n\tz-index: 2;\n}\n\n.FileList-module_icon__IqQtu {\n\tmargin-left: 4px !important;\n\tmin-width: 20px;\n\tmin-height: 20px;\n\tmax-width: 20px;\n\tmax-height: 20px;\n\tcursor: pointer;\n\tz-index: 2;\n}\n\n.FileList-module_xs__E8BbI {\n}\n\n.FileList-module_s__hk4A- {\n}\n\n.FileList-module_m__3Fc4x {\n}\n\n.FileList-module_l__pS2TK {\n}\n\n.FileList-module_xl__NbbC5 {\n}\n";
|
|
62
62
|
var css = {"wrapper":"FileList-module_wrapper__vsmK5 flexBox-module_rowStart__nJZnW","file":"FileList-module_file__TTDb9 flexBox-module_rowStart__nJZnW","fileName":"FileList-module_fileName__qFumz flexBox-module_row__PWxbe","meta":"FileList-module_meta__cEeZM flexBox-module_columnStart__Kg8cV","status":"FileList-module_status__gOq0Z type-module_body-xs-regular__QWEzl","error":"FileList-module_error__lwFza","fileIcon":"FileList-module_fileIcon__a-lhL flexBox-module_row__PWxbe","icon":"FileList-module_icon__IqQtu flexBox-module_row__PWxbe","xs":"FileList-module_xs__E8BbI type-module_body-xs-regular__QWEzl","s":"FileList-module_s__hk4A- type-module_body-s-regular__8-FO-","m":"FileList-module_m__3Fc4x type-module_body-m-regular__Qtp5G","l":"FileList-module_l__pS2TK type-module_body-l-regular__Ar4d3","xl":"FileList-module_xl__NbbC5 type-module_body-xl-regular__zDf-z"};
|
|
63
63
|
styleInject_es.styleInject(css_248z);
|
|
64
64
|
|
|
@@ -96,7 +96,7 @@ function displayClose(uploading) {
|
|
|
96
96
|
return { display: 'none' };
|
|
97
97
|
}
|
|
98
98
|
const FileList = React.memo((props) => {
|
|
99
|
-
const { files = [], onChange, onToolTip, maxWidth, minWidth, direction = 'row', padding, gap = 10, size = 's', iconSize = 24, bgColor } = props, divAttributes = tslib_es6.__rest(props, ["files", "onChange", "onToolTip", "maxWidth", "minWidth", "direction", "padding", "gap", "size", "iconSize", "bgColor"]);
|
|
99
|
+
const { files = [], onChange, onToolTip, maxWidth, minWidth, direction = 'row', padding, gap = 10, size = 's', iconSize = 24, bgColor, canRemove = true } = props, divAttributes = tslib_es6.__rest(props, ["files", "onChange", "onToolTip", "maxWidth", "minWidth", "direction", "padding", "gap", "size", "iconSize", "bgColor", "canRemove"]);
|
|
100
100
|
// div attributes to add
|
|
101
101
|
const { id: divId, className, style } = divAttributes, rest = tslib_es6.__rest(divAttributes, ["id", "className", "style"]);
|
|
102
102
|
const divStyle = style !== null && style !== void 0 ? style : {};
|
|
@@ -157,7 +157,7 @@ const FileList = React.memo((props) => {
|
|
|
157
157
|
: 'var(--core-outline-primary)',
|
|
158
158
|
};
|
|
159
159
|
}, []);
|
|
160
|
-
return (jsxRuntime.jsx("div", Object.assign({ className: `${css.wrapper}${divClass}`, style: Object.assign(Object.assign({}, divStyle), cssVars), id: divId }, rest, { children: displayList.map((i) => (jsxRuntime.jsxs("div", { className: `${css.file} ${css[size]}`, style: fileCSSVars(i.progress, i.error), children: [jsxRuntime.jsx("div", { className: css.fileIcon, children: jsxRuntime.jsx(FileIcon.FileIcon, { name: i.icon, size: iconSize }) }), jsxRuntime.jsxs("div", { className: css.meta, children: [jsxRuntime.jsx("div", { className: css.fileName, children: i.name }), i.error && (jsxRuntime.jsx("div", { className: `${css.status} ${i.error ? css.error : ''}`, children: i.error }))] }), jsxRuntime.jsx("div", { className: css.icon, style: displayProgress(i.uploading), children: jsxRuntime.jsx(ProgressIndicator.ProgressIndicator, { inline: true, size: 20, show: i.uploading }) }), jsxRuntime.jsx("div", { className: css.icon, style: displayClose(i.uploading), role: 'button', "aria-label": 'remove file', onMouseOver: handleMouseOver, onMouseOut: handleMouseOut, onFocus: handleMouseOver, onBlur: handleMouseOut, onClick: () => handleRemove(i.index), onKeyDown: (e) => utils.accessibleKeyDown(e, () => handleRemove(i.index)), tabIndex: 0, children: jsxRuntime.jsx(_types.Icon, { name: 'x', style: { pointerEvents: 'none' } }) })] }, i.key))) })));
|
|
160
|
+
return (jsxRuntime.jsx("div", Object.assign({ className: `${css.wrapper}${divClass}`, style: Object.assign(Object.assign({}, divStyle), cssVars), id: divId }, rest, { children: displayList.map((i) => (jsxRuntime.jsxs("div", { className: `${css.file} ${css[size]}`, style: fileCSSVars(i.progress, i.error), children: [jsxRuntime.jsx("div", { className: css.fileIcon, children: jsxRuntime.jsx(FileIcon.FileIcon, { name: i.icon, size: iconSize }) }), jsxRuntime.jsxs("div", { className: css.meta, children: [jsxRuntime.jsx("div", { className: css.fileName, children: i.name }), i.error && (jsxRuntime.jsx("div", { className: `${css.status} ${i.error ? css.error : ''}`, children: i.error }))] }), jsxRuntime.jsx("div", { className: css.icon, style: displayProgress(i.uploading), children: jsxRuntime.jsx(ProgressIndicator.ProgressIndicator, { inline: true, size: 20, show: i.uploading }) }), canRemove && (jsxRuntime.jsx("div", { className: css.icon, style: displayClose(i.uploading), role: 'button', "aria-label": 'remove file', onMouseOver: handleMouseOver, onMouseOut: handleMouseOut, onFocus: handleMouseOver, onBlur: handleMouseOut, onClick: () => handleRemove(i.index), onKeyDown: (e) => utils.accessibleKeyDown(e, () => handleRemove(i.index)), tabIndex: 0, children: jsxRuntime.jsx(_types.Icon, { name: 'x', style: { pointerEvents: 'none' } }) }))] }, i.key))) })));
|
|
161
161
|
});
|
|
162
162
|
|
|
163
163
|
exports.FileList = FileList;
|
|
@@ -15,7 +15,7 @@ styleInject_es.styleInject(css_248z);
|
|
|
15
15
|
|
|
16
16
|
function Label(props) {
|
|
17
17
|
const theme = hooks_useTheme.useTheme();
|
|
18
|
-
const { children, state, noFill = false, button = false, round = false, border = 1, padding, color, inline =
|
|
18
|
+
const { children, state, noFill = false, button = false, round = false, border = 1, padding, color, inline = true, size = 'm', onClick = () => null } = props, divAttributes = tslib_es6.__rest(props, ["children", "state", "noFill", "button", "round", "border", "padding", "color", "inline", "size", "onClick"]);
|
|
19
19
|
const { id: divId, className, style } = divAttributes, rest = tslib_es6.__rest(divAttributes, ["id", "className", "style"]);
|
|
20
20
|
const divStyle = style !== null && style !== void 0 ? style : {};
|
|
21
21
|
const divClass = className ? ` ${className}` : '';
|
|
@@ -6,7 +6,7 @@ var hooks_useTheme = require('../hooks/useTheme.js');
|
|
|
6
6
|
require('../theme/colors.js');
|
|
7
7
|
require('../hooks/useWindow.js');
|
|
8
8
|
var Button = require('./Button-BNXqiA13.js');
|
|
9
|
-
var FileList = require('./FileList-
|
|
9
|
+
var FileList = require('./FileList-BHMne9Mr.js');
|
|
10
10
|
var styleInject_es = require('./style-inject.es-XZHJH68X.js');
|
|
11
11
|
|
|
12
12
|
var css_248z = ".flexBox-module_row__PWxbe {\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowBetween__27lKK {\n\tdisplay: flex;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowStart__nJZnW {\n\tdisplay: flex;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowEnd__dHcOU {\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_column__MP2Xd {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStart__Kg8cV {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: flex-start;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStartCenter__zcmtk {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnBetween__157yI {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnEnd__u2nwI {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-end;\n\talign-items: flex-end;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.type-module_body-xs-regular__QWEzl {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-medium__FxEAv {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-bold__rf7AV {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.25px;\n}.type-module_body-s-regular__8-FO- {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-medium__qyYq- {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-bold__7GQ5Z {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-m-regular__Qtp5G {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-medium__Ieh9K {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-bold__0lZ3I {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-l-regular__Ar4d3 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-medium__6tV1n {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-bold__I8Q1v {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-xl-regular__zDf-z {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-xl-medium__R5GpK {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-xl-bold__SI-hC {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_heading-s-medium__jGIb2 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-s-bold__QFgN8 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-bold__tdBSi {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-medium__-7Uyu {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-medium__8hGYF {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 30px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-bold__Cryjg {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 30px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-xl-medium__PUi44 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 36px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-xl-bold__1B6fk {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 36px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}\n\n.PromptInput-module_wrapperBg__9QWdq {\n\tposition: relative;\n\t--border-angle: 0turn;\n\t--conic-gradient-dark: conic-gradient(\n\t\tfrom var(--border-angle),\n\t\tvar(--core-text-special) 0deg,\n\t\tvar(--core-text-special) 45deg,\n\t\tvar(--core-text-special) 90deg,\n\t\tvar(--array-magenta-label) 135deg,\n\t\tvar(--array-magenta-label) 180deg,\n\t\tvar(--array-magenta-label) 225deg,\n\t\tvar(--array-land) 270deg,\n\t\tvar(--array-land) 315deg,\n\t\tvar(--array-land) 360deg\n\t);\n\t--conic-gradient-light: conic-gradient(\n\t\tfrom var(--border-angle),\n\t\tvar(--core-text-special) 0deg,\n\t\tvar(--core-text-special) 45deg,\n\t\tvar(--core-text-special) 90deg,\n\t\tvar(--array-magenta-label) 135deg,\n\t\tvar(--array-magenta-label) 180deg,\n\t\tvar(--array-magenta-label) 225deg,\n\t\tvar(--array-land-label) 270deg,\n\t\tvar(--array-land-label) 315deg,\n\t\tvar(--array-land-label) 360deg\n\t);\n\tz-index: 0;\n\theight: auto;\n\tmax-height: var(--prompt-max-height);\n\twidth: 100%;\n\tborder-radius: var(--prompt-border-radius);\n\toverflow: hidden;\n\tpadding: var(--prompt-border-width) !important;\n\tbackground: var(--prompt-border-color);\n\tanimation: PromptInput-module_bgRotate__xvvtD 3s linear infinite;\n\tanimation-play-state: var(--prompt-state);\n\ttransition: background 0.25s ease-in-out 0s;\n}\n\n@property --border-angle {\n\tsyntax: \"<angle>\";\n\tinherits: false;\n\tinitial-value: 0turn;\n}\n\n@keyframes PromptInput-module_bgRotate__xvvtD {\n\t100% {\n\t\t--border-angle: 1turn;\n\t}\n}\n\n.PromptInput-module_textareaWrapper__4hWyM {\n\talign-items: flex-start;\n\twidth: 100%;\n\theight: min-content;\n\tmax-height: 400px;\n\toverflow: hidden;\n\toverflow-y: auto;\n\tborder-radius: var(--prompt-inner-border-radius);\n\tbackground: var(--core-surface-secondary);\n}\n\n.PromptInput-module_attachments__R0egZ {\n\tpadding: 16px 16px 0 16px !important;\n\twidth: 100%;\n}\n\n.PromptInput-module_clear__tjFZ- {\n\tpadding: 12px 8px 0 0 !important;\n\tdisplay: var(--prompt-clear) !important;\n}\n\n.PromptInput-module_buttonBar__9Ol9O {\n\tpadding: 8px 16px 16px 16px !important;\n\twidth: 100%;\n\tcursor: text;\n}\n\n.PromptInput-module_toolBar__CmIf- {\n\tflex: 1;\n\tgap: 8px;\n}\n\n.PromptInput-module_textarea__ZuzrC {\n\tpadding: 16px !important;\n\tbox-sizing: border-box;\n\tfield-sizing: content;\n\twidth: 100%;\n\tresize: none;\n\tborder: 0;\n\toutline: none;\n\tcolor: var(--core-text-primary);\n\tbackground: transparent;\n\tborder-radius: var(--prompt-border-radius);\n\t&::placeholder {\n\t\tcolor: var(--core-text-disabled);\n\t}\n}\n\n.PromptInput-module_s__Z684A {\n}\n\n.PromptInput-module_m__NxLh6 {\n}\n\n.PromptInput-module_l__BaGnx {\n}\n";
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var utils = require('./utils-BwNacfBU.js');
|
|
6
|
+
var FileList = require('./FileList-BHMne9Mr.js');
|
|
7
|
+
var _types = require('./_types-BNlHsGMQ.js');
|
|
8
|
+
var ProgressIndicator = require('./ProgressIndicator-BAwAaw58.js');
|
|
9
|
+
var styleInject_es = require('./style-inject.es-XZHJH68X.js');
|
|
10
|
+
|
|
11
|
+
var css_248z = ".flexBox-module_row__PWxbe {\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowBetween__27lKK {\n\tdisplay: flex;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowStart__nJZnW {\n\tdisplay: flex;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowEnd__dHcOU {\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_column__MP2Xd {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStart__Kg8cV {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: flex-start;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStartCenter__zcmtk {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnBetween__157yI {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnEnd__u2nwI {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-end;\n\talign-items: flex-end;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.type-module_body-xs-regular__QWEzl {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-medium__FxEAv {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-bold__rf7AV {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.25px;\n}.type-module_body-s-regular__8-FO- {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-medium__qyYq- {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-bold__7GQ5Z {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-m-regular__Qtp5G {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-medium__Ieh9K {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-bold__0lZ3I {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-l-regular__Ar4d3 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-medium__6tV1n {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-bold__I8Q1v {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-xl-regular__zDf-z {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-xl-medium__R5GpK {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-xl-bold__SI-hC {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_heading-s-medium__jGIb2 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-s-bold__QFgN8 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-bold__tdBSi {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-medium__-7Uyu {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-medium__8hGYF {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 30px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-bold__Cryjg {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 30px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-xl-medium__PUi44 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 36px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-xl-bold__1B6fk {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 36px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}\n\n.UploadArea-module_wrapper__CRGxX {\n\tpadding: var(--ua-padding) !important;\n\tborder: var(--ua-border) var(--ua-border-style) var(--ua-border-color);\n\tborder-radius: var(--ua-radius);\n\tbackground: var(--ua-bg-color);\n\tgap: 8px;\n\tcursor: var(--ua-cursor);\n\twidth: var(--ua-width);\n\theight: var(--ua-height);\n\tuser-select: none;\n\t-webkit-user-select: none;\n}\n\n.UploadArea-module_icon__BorsB {\n\tmin-height: var(--ua-icon-size);\n\theight: var(--ua-icon-size);\n\tmin-width: var(--ua-icon-size);\n\twidth: var(--ua-icon-size);\n\tpointer-events: none;\n}\n\n.UploadArea-module_title__cHPKW {\n\tpointer-events: none;\n}\n\n.UploadArea-module_message__cnoa7 {\n\tcolor: var(--core-text-tertiary);\n\tpointer-events: none;\n\tgap: 8px;\n}\n\n.UploadArea-module_files__hIz4K {\n\tmargin-top: 16px !important;\n\twidth: 100%;\n}\n\n.UploadArea-module_xs__MTB7z {\n}\n\n.UploadArea-module_s__w0unZ {\n}\n\n.UploadArea-module_m__N4PzX {\n}\n\n.UploadArea-module_l__2GkSv {\n}\n";
|
|
12
|
+
var css = {"wrapper":"UploadArea-module_wrapper__CRGxX flexBox-module_column__MP2Xd","icon":"UploadArea-module_icon__BorsB flexBox-module_row__PWxbe","title":"UploadArea-module_title__cHPKW type-module_body-l-bold__I8Q1v","message":"UploadArea-module_message__cnoa7 flexBox-module_row__PWxbe","files":"UploadArea-module_files__hIz4K flexBox-module_column__MP2Xd","xs":"UploadArea-module_xs__MTB7z type-module_body-xs-regular__QWEzl","s":"UploadArea-module_s__w0unZ type-module_body-s-regular__8-FO-","m":"UploadArea-module_m__N4PzX type-module_body-m-regular__Qtp5G","l":"UploadArea-module_l__2GkSv type-module_body-l-regular__Ar4d3"};
|
|
13
|
+
styleInject_es.styleInject(css_248z);
|
|
14
|
+
|
|
15
|
+
const imageTypes = ['png', 'jpg', 'jpeg', 'gif', 'svg', 'heic', 'heif'];
|
|
16
|
+
const videoTypes = ['mp4', 'avi', 'mov', 'wmv', 'flv'];
|
|
17
|
+
const documentTypes = [
|
|
18
|
+
'pdf',
|
|
19
|
+
'doc',
|
|
20
|
+
'docx',
|
|
21
|
+
'xls',
|
|
22
|
+
'xlsx',
|
|
23
|
+
'ppt',
|
|
24
|
+
'pptx',
|
|
25
|
+
];
|
|
26
|
+
const audioTypes = ['mp3', 'wav', 'ogg', 'aac', 'flac'];
|
|
27
|
+
const textTypes = ['txt', 'rtf', 'md', 'csv', 'json', 'xml'];
|
|
28
|
+
const allTypes = [
|
|
29
|
+
...imageTypes,
|
|
30
|
+
...videoTypes,
|
|
31
|
+
...documentTypes,
|
|
32
|
+
...audioTypes,
|
|
33
|
+
...textTypes,
|
|
34
|
+
];
|
|
35
|
+
var FileTypes;
|
|
36
|
+
(function (FileTypes) {
|
|
37
|
+
FileTypes["images"] = "images";
|
|
38
|
+
FileTypes["videos"] = "videos";
|
|
39
|
+
FileTypes["documents"] = "documents";
|
|
40
|
+
FileTypes["audio"] = "audio";
|
|
41
|
+
FileTypes["text"] = "text";
|
|
42
|
+
FileTypes["all"] = "all";
|
|
43
|
+
FileTypes["custom"] = "custom";
|
|
44
|
+
})(FileTypes || (FileTypes = {}));
|
|
45
|
+
|
|
46
|
+
const UploadAreaBase = React.forwardRef((props, ref) => {
|
|
47
|
+
const { icon = 'upload', iconColor = 'var(--core-text-primary)', iconColorHover = 'var(--core-text-special)', title = 'Upload Files', width = '100%', height = 'auto', message = 'Drag and drop files here or click to upload', busyMessage = 'Uploading in progress', iconSize = 24, textSize = 'm', border = 1, borderStyle = 'dashed', borderColor = 'var(--core-outline-primary)', borderColorHover = 'var(--core-outline-special)', radius = 8, padding = 32, bgColor = 'var(--core-surface-secondary)', bgColorHover = 'var(--core-surface-special)', acceptedTypes = allTypes, multiple = true, busy = false, canRemove = true, showProgress = true, files = [], onUpload, } = props;
|
|
48
|
+
const [hovered, setHovered] = React.useState(false);
|
|
49
|
+
const inputRef = React.useRef(null);
|
|
50
|
+
const dragDepth = React.useRef(0);
|
|
51
|
+
// set uploading files
|
|
52
|
+
// *** select files
|
|
53
|
+
// callback to trigger click
|
|
54
|
+
const handleClickUpload = React.useCallback(() => {
|
|
55
|
+
var _a;
|
|
56
|
+
if (busy)
|
|
57
|
+
return;
|
|
58
|
+
if (!(inputRef === null || inputRef === void 0 ? void 0 : inputRef.current))
|
|
59
|
+
return;
|
|
60
|
+
inputRef.current.value = '';
|
|
61
|
+
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.click();
|
|
62
|
+
}, [busy]);
|
|
63
|
+
// call back on file change
|
|
64
|
+
const handleFileInputChange = React.useCallback((e) => {
|
|
65
|
+
if (busy)
|
|
66
|
+
return;
|
|
67
|
+
if (!e.target.files)
|
|
68
|
+
return;
|
|
69
|
+
onUpload === null || onUpload === void 0 ? void 0 : onUpload(Array.from(e.target.files));
|
|
70
|
+
}, [busy, onUpload]);
|
|
71
|
+
// *** drag/drop
|
|
72
|
+
// check for files to light up hover
|
|
73
|
+
const hasFilesInDrag = React.useCallback((e) => {
|
|
74
|
+
var _a, _b;
|
|
75
|
+
return Array.from((_b = (_a = e.dataTransfer) === null || _a === void 0 ? void 0 : _a.types) !== null && _b !== void 0 ? _b : []).includes('Files');
|
|
76
|
+
}, []);
|
|
77
|
+
// use counters for responsive feedback
|
|
78
|
+
const handleDragEnter = React.useCallback((e) => {
|
|
79
|
+
e.preventDefault();
|
|
80
|
+
if (busy || !hasFilesInDrag(e))
|
|
81
|
+
return;
|
|
82
|
+
dragDepth.current += 1;
|
|
83
|
+
if (dragDepth.current === 1)
|
|
84
|
+
setHovered(true);
|
|
85
|
+
}, [busy, hasFilesInDrag]);
|
|
86
|
+
// prevent default since "drop" happens when "over"
|
|
87
|
+
const handleDragOver = (e) => {
|
|
88
|
+
e.preventDefault();
|
|
89
|
+
};
|
|
90
|
+
// at 0 hover is over
|
|
91
|
+
const handleDragLeave = React.useCallback((e) => {
|
|
92
|
+
e.preventDefault();
|
|
93
|
+
if (busy)
|
|
94
|
+
return;
|
|
95
|
+
dragDepth.current = Math.max(0, dragDepth.current - 1);
|
|
96
|
+
if (dragDepth.current === 0)
|
|
97
|
+
setHovered(false);
|
|
98
|
+
}, [busy]);
|
|
99
|
+
// handle drop
|
|
100
|
+
const handleDrop = React.useCallback((e) => {
|
|
101
|
+
var _a;
|
|
102
|
+
e.preventDefault();
|
|
103
|
+
if (busy)
|
|
104
|
+
return;
|
|
105
|
+
dragDepth.current = 0;
|
|
106
|
+
setHovered(false);
|
|
107
|
+
const files = Array.from((_a = e.dataTransfer.files) !== null && _a !== void 0 ? _a : []);
|
|
108
|
+
onUpload === null || onUpload === void 0 ? void 0 : onUpload(files);
|
|
109
|
+
}, [busy, onUpload]);
|
|
110
|
+
// icon color
|
|
111
|
+
const iconStrokeColor = React.useMemo(() => {
|
|
112
|
+
if (hovered)
|
|
113
|
+
return iconColorHover;
|
|
114
|
+
return iconColor;
|
|
115
|
+
}, [hovered, iconColor, iconColorHover]);
|
|
116
|
+
const cssVars = React.useMemo(() => {
|
|
117
|
+
return {
|
|
118
|
+
'--ua-border': `${border}px`,
|
|
119
|
+
'--ua-border-style': borderStyle,
|
|
120
|
+
'--ua-border-color': hovered || busy ? borderColorHover : borderColor,
|
|
121
|
+
'--ua-radius': `${radius}px`,
|
|
122
|
+
'--ua-padding': utils.setStyle(padding),
|
|
123
|
+
'--ua-bg-color': hovered ? bgColorHover : bgColor,
|
|
124
|
+
'--ua-icon-size': `${iconSize}px`,
|
|
125
|
+
'--ua-cursor': busy ? 'default' : 'pointer',
|
|
126
|
+
'--ua-width': utils.setStyle(width),
|
|
127
|
+
'--ua-height': utils.setStyle(height),
|
|
128
|
+
};
|
|
129
|
+
}, [
|
|
130
|
+
border,
|
|
131
|
+
borderStyle,
|
|
132
|
+
borderColor,
|
|
133
|
+
borderColorHover,
|
|
134
|
+
radius,
|
|
135
|
+
padding,
|
|
136
|
+
bgColor,
|
|
137
|
+
bgColorHover,
|
|
138
|
+
iconSize,
|
|
139
|
+
busy,
|
|
140
|
+
hovered,
|
|
141
|
+
height,
|
|
142
|
+
width,
|
|
143
|
+
]);
|
|
144
|
+
return (jsxRuntime.jsxs("div", { className: css.wrapper, style: cssVars, ref: ref, role: 'button', "aria-label": 'Click to upload files', tabIndex: 0, onClick: handleClickUpload, onKeyDown: (e) => utils.accessibleKeyDown(e, () => handleClickUpload()), onDragEnter: handleDragEnter, onDragOver: handleDragOver, onDragLeave: handleDragLeave, onDrop: handleDrop, children: [jsxRuntime.jsx("div", { className: css.icon, children: jsxRuntime.jsx(_types.Icon, { size: iconSize, name: icon, strokeColor: iconStrokeColor, pointer: false }) }), jsxRuntime.jsx("div", { className: css.title, children: title }), jsxRuntime.jsxs("div", { className: `${css.message} ${css[textSize]}`, children: [busy && showProgress && (jsxRuntime.jsx(ProgressIndicator.ProgressIndicator, { show: true, size: 20, inline: true, color: iconStrokeColor })), busy ? busyMessage : message] }), files.length > 0 && (jsxRuntime.jsx("div", { className: css.files, children: jsxRuntime.jsx(FileList.FileList, { files: files, bgColor: 'var(--core-surface-primary)', size: 'm', direction: 'column', gap: 8, iconSize: 24, padding: '10px', canRemove: canRemove }) })), jsxRuntime.jsx("input", { ref: inputRef, type: "file", hidden: true, disabled: busy, multiple: multiple, accept: acceptedTypes ? acceptedTypes.join(', ') : undefined, onChange: handleFileInputChange })] }));
|
|
145
|
+
});
|
|
146
|
+
UploadAreaBase.displayName = 'UploadArea';
|
|
147
|
+
const UploadArea = React.memo(UploadAreaBase);
|
|
148
|
+
|
|
149
|
+
exports.UploadArea = UploadArea;
|
|
150
|
+
exports.allTypes = allTypes;
|
|
151
|
+
exports.audioTypes = audioTypes;
|
|
152
|
+
exports.documentTypes = documentTypes;
|
|
153
|
+
exports.imageTypes = imageTypes;
|
|
154
|
+
exports.textTypes = textTypes;
|
|
155
|
+
exports.videoTypes = videoTypes;
|
package/dist/cjs/index.js
CHANGED
|
@@ -29,7 +29,7 @@ var Logos = require('./chunks/Logos-DSlAUz8l.js');
|
|
|
29
29
|
var Overlay = require('./chunks/Overlay-DV3C5NDO.js');
|
|
30
30
|
var FlexDiv = require('./chunks/FlexDiv-BHl29ywz.js');
|
|
31
31
|
var Pager = require('./chunks/Pager-CRjpl1FZ.js');
|
|
32
|
-
var PromptInput = require('./chunks/PromptInput-
|
|
32
|
+
var PromptInput = require('./chunks/PromptInput-CfzofBTJ.js');
|
|
33
33
|
var ProgressIndicator = require('./chunks/ProgressIndicator-BAwAaw58.js');
|
|
34
34
|
var RadioButton = require('./chunks/RadioButton-DA9YUGEF.js');
|
|
35
35
|
var RadioButtonList = require('./chunks/RadioButtonList-BtsT7GJc.js');
|
|
@@ -48,7 +48,8 @@ var FileIcon = require('./chunks/FileIcon-CEMQK_Je.js');
|
|
|
48
48
|
var _types = require('./chunks/_types-BNlHsGMQ.js');
|
|
49
49
|
var ButtonBar = require('./chunks/ButtonBar-CeDdAOlH.js');
|
|
50
50
|
var Card = require('./chunks/Card-Cc_c-S7i.js');
|
|
51
|
-
var Label = require('./chunks/Label-
|
|
51
|
+
var Label = require('./chunks/Label-s1aCv2Y1.js');
|
|
52
|
+
var UploadArea = require('./chunks/UploadArea-DunGYE1_.js');
|
|
52
53
|
require('./theme/corners.js');
|
|
53
54
|
require('./theme/type.js');
|
|
54
55
|
require('react');
|
|
@@ -57,7 +58,7 @@ require('react/jsx-runtime');
|
|
|
57
58
|
require('./chunks/style-inject.es-XZHJH68X.js');
|
|
58
59
|
require('motion/react');
|
|
59
60
|
require('./chunks/utils-BwNacfBU.js');
|
|
60
|
-
require('./chunks/FileList-
|
|
61
|
+
require('./chunks/FileList-BHMne9Mr.js');
|
|
61
62
|
|
|
62
63
|
|
|
63
64
|
|
|
@@ -129,3 +130,10 @@ Object.defineProperty(exports, "IconNames", {
|
|
|
129
130
|
exports.ButtonBar = ButtonBar.ButtonBar;
|
|
130
131
|
exports.Card = Card.Card;
|
|
131
132
|
exports.Label = Label.Label;
|
|
133
|
+
exports.UploadArea = UploadArea.UploadArea;
|
|
134
|
+
exports.allTypes = UploadArea.allTypes;
|
|
135
|
+
exports.audioTypes = UploadArea.audioTypes;
|
|
136
|
+
exports.documentTypes = UploadArea.documentTypes;
|
|
137
|
+
exports.imageTypes = UploadArea.imageTypes;
|
|
138
|
+
exports.textTypes = UploadArea.textTypes;
|
|
139
|
+
exports.videoTypes = UploadArea.videoTypes;
|
package/dist/cjs/uikit/Label.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var PromptInput = require('../chunks/PromptInput-
|
|
3
|
+
var PromptInput = require('../chunks/PromptInput-CfzofBTJ.js');
|
|
4
4
|
require('react/jsx-runtime');
|
|
5
5
|
require('react');
|
|
6
6
|
require('../hooks/useTheme.js');
|
|
@@ -21,7 +21,7 @@ require('../chunks/_types-BNlHsGMQ.js');
|
|
|
21
21
|
require('../chunks/utils-BwNacfBU.js');
|
|
22
22
|
require('../chunks/ProgressIndicator-BAwAaw58.js');
|
|
23
23
|
require('../chunks/sharedTypes-BvTjh6M5.js');
|
|
24
|
-
require('../chunks/FileList-
|
|
24
|
+
require('../chunks/FileList-BHMne9Mr.js');
|
|
25
25
|
require('../chunks/FileIcon-CEMQK_Je.js');
|
|
26
26
|
|
|
27
27
|
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var UploadArea = require('../chunks/UploadArea-DunGYE1_.js');
|
|
4
|
+
require('react/jsx-runtime');
|
|
5
|
+
require('react');
|
|
6
|
+
require('../chunks/utils-BwNacfBU.js');
|
|
7
|
+
require('../chunks/tslib.es6-4H29ixHs.js');
|
|
8
|
+
require('../chunks/FileList-BHMne9Mr.js');
|
|
9
|
+
require('../chunks/FileIcon-CEMQK_Je.js');
|
|
10
|
+
require('../hooks/useTheme.js');
|
|
11
|
+
require('../theme/themes.js');
|
|
12
|
+
require('../theme/colors.js');
|
|
13
|
+
require('../theme/corners.js');
|
|
14
|
+
require('../theme/elevations.js');
|
|
15
|
+
require('../theme/type.js');
|
|
16
|
+
require('../hooks/useObserveTheme.js');
|
|
17
|
+
require('../hooks/useWindow.js');
|
|
18
|
+
require('../chunks/_types-BNlHsGMQ.js');
|
|
19
|
+
require('../chunks/ProgressIndicator-BAwAaw58.js');
|
|
20
|
+
require('motion/react');
|
|
21
|
+
require('../chunks/style-inject.es-XZHJH68X.js');
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
exports.UploadArea = UploadArea.UploadArea;
|
|
26
|
+
exports.allTypes = UploadArea.allTypes;
|
|
27
|
+
exports.audioTypes = UploadArea.audioTypes;
|
|
28
|
+
exports.documentTypes = UploadArea.documentTypes;
|
|
29
|
+
exports.imageTypes = UploadArea.imageTypes;
|
|
30
|
+
exports.textTypes = UploadArea.textTypes;
|
|
31
|
+
exports.videoTypes = UploadArea.videoTypes;
|
|
@@ -56,7 +56,7 @@ function fileIconName(extension) {
|
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
var css_248z = ".flexBox-module_row__PWxbe {\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowBetween__27lKK {\n\tdisplay: flex;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowStart__nJZnW {\n\tdisplay: flex;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowEnd__dHcOU {\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_column__MP2Xd {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStart__Kg8cV {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: flex-start;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStartCenter__zcmtk {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnBetween__157yI {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnEnd__u2nwI {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-end;\n\talign-items: flex-end;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.type-module_body-xs-regular__QWEzl {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-medium__FxEAv {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-bold__rf7AV {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.25px;\n}.type-module_body-s-regular__8-FO- {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-medium__qyYq- {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-bold__7GQ5Z {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-m-regular__Qtp5G {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-medium__Ieh9K {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-bold__0lZ3I {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-l-regular__Ar4d3 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-medium__6tV1n {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-bold__I8Q1v {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-xl-regular__zDf-z {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-xl-medium__R5GpK {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-xl-bold__SI-hC {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_heading-s-medium__jGIb2 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-s-bold__QFgN8 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-bold__tdBSi {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-medium__-7Uyu {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-medium__8hGYF {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 30px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-bold__Cryjg {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 30px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-xl-medium__PUi44 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 36px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-xl-bold__1B6fk {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 36px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}\n\n.FileList-module_wrapper__vsmK5 {\n\twidth: 100%;\n\toverflow: hidden;\n\tflex-wrap: var(--file-wrap);\n\tflex-direction: var(--file-direction) !important;\n\talign-items: flex-start !important;\n\tgap: var(--file-gap);\n\tuser-select: none;\n\t-webkit-user-select: none;\n}\n\n.FileList-module_file__TTDb9 {\n\tposition: relative;\n\tpadding: var(--file-padding) !important;\n\tborder: 1px solid var(--file-border-color);\n\tborder-radius: 4px;\n\toverflow:
|
|
59
|
+
var css_248z = ".flexBox-module_row__PWxbe {\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowBetween__27lKK {\n\tdisplay: flex;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowStart__nJZnW {\n\tdisplay: flex;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowEnd__dHcOU {\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_column__MP2Xd {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStart__Kg8cV {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: flex-start;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStartCenter__zcmtk {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnBetween__157yI {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnEnd__u2nwI {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-end;\n\talign-items: flex-end;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.type-module_body-xs-regular__QWEzl {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-medium__FxEAv {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-bold__rf7AV {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.25px;\n}.type-module_body-s-regular__8-FO- {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-medium__qyYq- {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-bold__7GQ5Z {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-m-regular__Qtp5G {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-medium__Ieh9K {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-bold__0lZ3I {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-l-regular__Ar4d3 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-medium__6tV1n {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-bold__I8Q1v {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-xl-regular__zDf-z {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-xl-medium__R5GpK {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-xl-bold__SI-hC {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_heading-s-medium__jGIb2 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-s-bold__QFgN8 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-bold__tdBSi {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-medium__-7Uyu {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-medium__8hGYF {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 30px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-bold__Cryjg {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 30px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-xl-medium__PUi44 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 36px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-xl-bold__1B6fk {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 36px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}\n\n.FileList-module_wrapper__vsmK5 {\n\twidth: 100%;\n\toverflow: hidden;\n\tflex-wrap: var(--file-wrap);\n\tflex-direction: var(--file-direction) !important;\n\talign-items: flex-start !important;\n\tgap: var(--file-gap);\n\tuser-select: none;\n\t-webkit-user-select: none;\n}\n\n.FileList-module_file__TTDb9 {\n\tposition: relative;\n\tpadding: var(--file-padding) !important;\n\tborder: 1px solid var(--file-border-color);\n\tborder-radius: 4px;\n\toverflow: hidden;\n\tmin-height: max-content;\n\tmax-width: var(--file-max-width);\n\tmin-width: var(--file-min-width);\n\tcolor: var(--core-text-primary);\n\tbackground: transparent;\n\tgap: 4px;\n}\n\n/* file progress bar */\n.FileList-module_file__TTDb9::before {\n\tcontent: \"\";\n\tposition: absolute;\n\tbackground: var(--file-bg-color);\n\ttop: 0;\n\tbottom: 0;\n\tleft: 0;\n\twidth: var(--file-progress);\n\ttransition: width 1s ease-in-out 0s;\n\tz-index: 1;\n}\n\n.FileList-module_fileName__qFumz {\n\twidth: 100%;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n\tword-break: break-all;\n\tdisplay: -webkit-box !important;\n\t-webkit-line-clamp: 1;\n\t-webkit-box-orient: vertical;\n\tz-index: 2;\n}\n\n.FileList-module_meta__cEeZM {\n\tflex: 1;\n\tmin-width: 0;\n\tgap: 2px;\n\tz-index: 2;\n}\n\n.FileList-module_status__gOq0Z {\n\tcolor: var(--core-text-secondary);\n\tline-height: 1.2;\n}\n\n.FileList-module_error__lwFza {\n\tcolor: var(--feedback-warning);\n}\n\n.FileList-module_fileIcon__a-lhL {\n\tmin-width: var(--file-icon-size);\n\tmin-height: var(--file-icon-size);\n\tmax-width: var(--file-icon-size);\n\tmax-height: var(--file-icon-size);\n\tz-index: 2;\n}\n\n.FileList-module_icon__IqQtu {\n\tmargin-left: 4px !important;\n\tmin-width: 20px;\n\tmin-height: 20px;\n\tmax-width: 20px;\n\tmax-height: 20px;\n\tcursor: pointer;\n\tz-index: 2;\n}\n\n.FileList-module_xs__E8BbI {\n}\n\n.FileList-module_s__hk4A- {\n}\n\n.FileList-module_m__3Fc4x {\n}\n\n.FileList-module_l__pS2TK {\n}\n\n.FileList-module_xl__NbbC5 {\n}\n";
|
|
60
60
|
var css = {"wrapper":"FileList-module_wrapper__vsmK5 flexBox-module_rowStart__nJZnW","file":"FileList-module_file__TTDb9 flexBox-module_rowStart__nJZnW","fileName":"FileList-module_fileName__qFumz flexBox-module_row__PWxbe","meta":"FileList-module_meta__cEeZM flexBox-module_columnStart__Kg8cV","status":"FileList-module_status__gOq0Z type-module_body-xs-regular__QWEzl","error":"FileList-module_error__lwFza","fileIcon":"FileList-module_fileIcon__a-lhL flexBox-module_row__PWxbe","icon":"FileList-module_icon__IqQtu flexBox-module_row__PWxbe","xs":"FileList-module_xs__E8BbI type-module_body-xs-regular__QWEzl","s":"FileList-module_s__hk4A- type-module_body-s-regular__8-FO-","m":"FileList-module_m__3Fc4x type-module_body-m-regular__Qtp5G","l":"FileList-module_l__pS2TK type-module_body-l-regular__Ar4d3","xl":"FileList-module_xl__NbbC5 type-module_body-xl-regular__zDf-z"};
|
|
61
61
|
styleInject(css_248z);
|
|
62
62
|
|
|
@@ -94,7 +94,7 @@ function displayClose(uploading) {
|
|
|
94
94
|
return { display: 'none' };
|
|
95
95
|
}
|
|
96
96
|
const FileList = React.memo((props) => {
|
|
97
|
-
const { files = [], onChange, onToolTip, maxWidth, minWidth, direction = 'row', padding, gap = 10, size = 's', iconSize = 24, bgColor } = props, divAttributes = __rest(props, ["files", "onChange", "onToolTip", "maxWidth", "minWidth", "direction", "padding", "gap", "size", "iconSize", "bgColor"]);
|
|
97
|
+
const { files = [], onChange, onToolTip, maxWidth, minWidth, direction = 'row', padding, gap = 10, size = 's', iconSize = 24, bgColor, canRemove = true } = props, divAttributes = __rest(props, ["files", "onChange", "onToolTip", "maxWidth", "minWidth", "direction", "padding", "gap", "size", "iconSize", "bgColor", "canRemove"]);
|
|
98
98
|
// div attributes to add
|
|
99
99
|
const { id: divId, className, style } = divAttributes, rest = __rest(divAttributes, ["id", "className", "style"]);
|
|
100
100
|
const divStyle = style !== null && style !== void 0 ? style : {};
|
|
@@ -155,7 +155,7 @@ const FileList = React.memo((props) => {
|
|
|
155
155
|
: 'var(--core-outline-primary)',
|
|
156
156
|
};
|
|
157
157
|
}, []);
|
|
158
|
-
return (jsx("div", Object.assign({ className: `${css.wrapper}${divClass}`, style: Object.assign(Object.assign({}, divStyle), cssVars), id: divId }, rest, { children: displayList.map((i) => (jsxs("div", { className: `${css.file} ${css[size]}`, style: fileCSSVars(i.progress, i.error), children: [jsx("div", { className: css.fileIcon, children: jsx(FileIcon, { name: i.icon, size: iconSize }) }), jsxs("div", { className: css.meta, children: [jsx("div", { className: css.fileName, children: i.name }), i.error && (jsx("div", { className: `${css.status} ${i.error ? css.error : ''}`, children: i.error }))] }), jsx("div", { className: css.icon, style: displayProgress(i.uploading), children: jsx(ProgressIndicator, { inline: true, size: 20, show: i.uploading }) }), jsx("div", { className: css.icon, style: displayClose(i.uploading), role: 'button', "aria-label": 'remove file', onMouseOver: handleMouseOver, onMouseOut: handleMouseOut, onFocus: handleMouseOver, onBlur: handleMouseOut, onClick: () => handleRemove(i.index), onKeyDown: (e) => accessibleKeyDown(e, () => handleRemove(i.index)), tabIndex: 0, children: jsx(Icon, { name: 'x', style: { pointerEvents: 'none' } }) })] }, i.key))) })));
|
|
158
|
+
return (jsx("div", Object.assign({ className: `${css.wrapper}${divClass}`, style: Object.assign(Object.assign({}, divStyle), cssVars), id: divId }, rest, { children: displayList.map((i) => (jsxs("div", { className: `${css.file} ${css[size]}`, style: fileCSSVars(i.progress, i.error), children: [jsx("div", { className: css.fileIcon, children: jsx(FileIcon, { name: i.icon, size: iconSize }) }), jsxs("div", { className: css.meta, children: [jsx("div", { className: css.fileName, children: i.name }), i.error && (jsx("div", { className: `${css.status} ${i.error ? css.error : ''}`, children: i.error }))] }), jsx("div", { className: css.icon, style: displayProgress(i.uploading), children: jsx(ProgressIndicator, { inline: true, size: 20, show: i.uploading }) }), canRemove && (jsx("div", { className: css.icon, style: displayClose(i.uploading), role: 'button', "aria-label": 'remove file', onMouseOver: handleMouseOver, onMouseOut: handleMouseOut, onFocus: handleMouseOver, onBlur: handleMouseOut, onClick: () => handleRemove(i.index), onKeyDown: (e) => accessibleKeyDown(e, () => handleRemove(i.index)), tabIndex: 0, children: jsx(Icon, { name: 'x', style: { pointerEvents: 'none' } }) }))] }, i.key))) })));
|
|
159
159
|
});
|
|
160
160
|
|
|
161
161
|
export { FileList as F };
|
|
@@ -13,7 +13,7 @@ styleInject(css_248z);
|
|
|
13
13
|
|
|
14
14
|
function Label(props) {
|
|
15
15
|
const theme = useTheme();
|
|
16
|
-
const { children, state, noFill = false, button = false, round = false, border = 1, padding, color, inline =
|
|
16
|
+
const { children, state, noFill = false, button = false, round = false, border = 1, padding, color, inline = true, size = 'm', onClick = () => null } = props, divAttributes = __rest(props, ["children", "state", "noFill", "button", "round", "border", "padding", "color", "inline", "size", "onClick"]);
|
|
17
17
|
const { id: divId, className, style } = divAttributes, rest = __rest(divAttributes, ["id", "className", "style"]);
|
|
18
18
|
const divStyle = style !== null && style !== void 0 ? style : {};
|
|
19
19
|
const divClass = className ? ` ${className}` : '';
|
|
@@ -4,7 +4,7 @@ import { useTheme } from '../hooks/useTheme.js';
|
|
|
4
4
|
import '../theme/colors.js';
|
|
5
5
|
import '../hooks/useWindow.js';
|
|
6
6
|
import { B as Button } from './Button-BUJkJqdO.js';
|
|
7
|
-
import { F as FileList } from './FileList-
|
|
7
|
+
import { F as FileList } from './FileList-CdUgbpYF.js';
|
|
8
8
|
import { s as styleInject } from './style-inject.es-tgCJW-Cu.js';
|
|
9
9
|
|
|
10
10
|
var css_248z = ".flexBox-module_row__PWxbe {\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowBetween__27lKK {\n\tdisplay: flex;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowStart__nJZnW {\n\tdisplay: flex;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowEnd__dHcOU {\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_column__MP2Xd {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStart__Kg8cV {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: flex-start;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStartCenter__zcmtk {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnBetween__157yI {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnEnd__u2nwI {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-end;\n\talign-items: flex-end;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.type-module_body-xs-regular__QWEzl {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-medium__FxEAv {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-bold__rf7AV {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.25px;\n}.type-module_body-s-regular__8-FO- {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-medium__qyYq- {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-bold__7GQ5Z {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-m-regular__Qtp5G {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-medium__Ieh9K {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-bold__0lZ3I {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-l-regular__Ar4d3 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-medium__6tV1n {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-bold__I8Q1v {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-xl-regular__zDf-z {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-xl-medium__R5GpK {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-xl-bold__SI-hC {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_heading-s-medium__jGIb2 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-s-bold__QFgN8 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-bold__tdBSi {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-medium__-7Uyu {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-medium__8hGYF {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 30px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-bold__Cryjg {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 30px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-xl-medium__PUi44 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 36px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-xl-bold__1B6fk {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 36px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}\n\n.PromptInput-module_wrapperBg__9QWdq {\n\tposition: relative;\n\t--border-angle: 0turn;\n\t--conic-gradient-dark: conic-gradient(\n\t\tfrom var(--border-angle),\n\t\tvar(--core-text-special) 0deg,\n\t\tvar(--core-text-special) 45deg,\n\t\tvar(--core-text-special) 90deg,\n\t\tvar(--array-magenta-label) 135deg,\n\t\tvar(--array-magenta-label) 180deg,\n\t\tvar(--array-magenta-label) 225deg,\n\t\tvar(--array-land) 270deg,\n\t\tvar(--array-land) 315deg,\n\t\tvar(--array-land) 360deg\n\t);\n\t--conic-gradient-light: conic-gradient(\n\t\tfrom var(--border-angle),\n\t\tvar(--core-text-special) 0deg,\n\t\tvar(--core-text-special) 45deg,\n\t\tvar(--core-text-special) 90deg,\n\t\tvar(--array-magenta-label) 135deg,\n\t\tvar(--array-magenta-label) 180deg,\n\t\tvar(--array-magenta-label) 225deg,\n\t\tvar(--array-land-label) 270deg,\n\t\tvar(--array-land-label) 315deg,\n\t\tvar(--array-land-label) 360deg\n\t);\n\tz-index: 0;\n\theight: auto;\n\tmax-height: var(--prompt-max-height);\n\twidth: 100%;\n\tborder-radius: var(--prompt-border-radius);\n\toverflow: hidden;\n\tpadding: var(--prompt-border-width) !important;\n\tbackground: var(--prompt-border-color);\n\tanimation: PromptInput-module_bgRotate__xvvtD 3s linear infinite;\n\tanimation-play-state: var(--prompt-state);\n\ttransition: background 0.25s ease-in-out 0s;\n}\n\n@property --border-angle {\n\tsyntax: \"<angle>\";\n\tinherits: false;\n\tinitial-value: 0turn;\n}\n\n@keyframes PromptInput-module_bgRotate__xvvtD {\n\t100% {\n\t\t--border-angle: 1turn;\n\t}\n}\n\n.PromptInput-module_textareaWrapper__4hWyM {\n\talign-items: flex-start;\n\twidth: 100%;\n\theight: min-content;\n\tmax-height: 400px;\n\toverflow: hidden;\n\toverflow-y: auto;\n\tborder-radius: var(--prompt-inner-border-radius);\n\tbackground: var(--core-surface-secondary);\n}\n\n.PromptInput-module_attachments__R0egZ {\n\tpadding: 16px 16px 0 16px !important;\n\twidth: 100%;\n}\n\n.PromptInput-module_clear__tjFZ- {\n\tpadding: 12px 8px 0 0 !important;\n\tdisplay: var(--prompt-clear) !important;\n}\n\n.PromptInput-module_buttonBar__9Ol9O {\n\tpadding: 8px 16px 16px 16px !important;\n\twidth: 100%;\n\tcursor: text;\n}\n\n.PromptInput-module_toolBar__CmIf- {\n\tflex: 1;\n\tgap: 8px;\n}\n\n.PromptInput-module_textarea__ZuzrC {\n\tpadding: 16px !important;\n\tbox-sizing: border-box;\n\tfield-sizing: content;\n\twidth: 100%;\n\tresize: none;\n\tborder: 0;\n\toutline: none;\n\tcolor: var(--core-text-primary);\n\tbackground: transparent;\n\tborder-radius: var(--prompt-border-radius);\n\t&::placeholder {\n\t\tcolor: var(--core-text-disabled);\n\t}\n}\n\n.PromptInput-module_s__Z684A {\n}\n\n.PromptInput-module_m__NxLh6 {\n}\n\n.PromptInput-module_l__BaGnx {\n}\n";
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import React, { useState, useRef, useCallback, useMemo } from 'react';
|
|
3
|
+
import { s as setStyle, a as accessibleKeyDown } from './utils-CZ1LWeN6.js';
|
|
4
|
+
import { F as FileList } from './FileList-CdUgbpYF.js';
|
|
5
|
+
import { I as Icon } from './_types-RJ7q8S0B.js';
|
|
6
|
+
import { P as ProgressIndicator } from './ProgressIndicator-uI9BZwBB.js';
|
|
7
|
+
import { s as styleInject } from './style-inject.es-tgCJW-Cu.js';
|
|
8
|
+
|
|
9
|
+
var css_248z = ".flexBox-module_row__PWxbe {\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowBetween__27lKK {\n\tdisplay: flex;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowStart__nJZnW {\n\tdisplay: flex;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowEnd__dHcOU {\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_column__MP2Xd {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStart__Kg8cV {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: flex-start;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStartCenter__zcmtk {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnBetween__157yI {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnEnd__u2nwI {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-end;\n\talign-items: flex-end;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.type-module_body-xs-regular__QWEzl {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-medium__FxEAv {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-bold__rf7AV {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.25px;\n}.type-module_body-s-regular__8-FO- {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-medium__qyYq- {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-bold__7GQ5Z {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-m-regular__Qtp5G {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-medium__Ieh9K {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-bold__0lZ3I {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-l-regular__Ar4d3 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-medium__6tV1n {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-bold__I8Q1v {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-xl-regular__zDf-z {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-xl-medium__R5GpK {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-xl-bold__SI-hC {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_heading-s-medium__jGIb2 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-s-bold__QFgN8 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-bold__tdBSi {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-medium__-7Uyu {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-medium__8hGYF {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 30px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-bold__Cryjg {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 30px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-xl-medium__PUi44 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 36px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-xl-bold__1B6fk {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 36px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}\n\n.UploadArea-module_wrapper__CRGxX {\n\tpadding: var(--ua-padding) !important;\n\tborder: var(--ua-border) var(--ua-border-style) var(--ua-border-color);\n\tborder-radius: var(--ua-radius);\n\tbackground: var(--ua-bg-color);\n\tgap: 8px;\n\tcursor: var(--ua-cursor);\n\twidth: var(--ua-width);\n\theight: var(--ua-height);\n\tuser-select: none;\n\t-webkit-user-select: none;\n}\n\n.UploadArea-module_icon__BorsB {\n\tmin-height: var(--ua-icon-size);\n\theight: var(--ua-icon-size);\n\tmin-width: var(--ua-icon-size);\n\twidth: var(--ua-icon-size);\n\tpointer-events: none;\n}\n\n.UploadArea-module_title__cHPKW {\n\tpointer-events: none;\n}\n\n.UploadArea-module_message__cnoa7 {\n\tcolor: var(--core-text-tertiary);\n\tpointer-events: none;\n\tgap: 8px;\n}\n\n.UploadArea-module_files__hIz4K {\n\tmargin-top: 16px !important;\n\twidth: 100%;\n}\n\n.UploadArea-module_xs__MTB7z {\n}\n\n.UploadArea-module_s__w0unZ {\n}\n\n.UploadArea-module_m__N4PzX {\n}\n\n.UploadArea-module_l__2GkSv {\n}\n";
|
|
10
|
+
var css = {"wrapper":"UploadArea-module_wrapper__CRGxX flexBox-module_column__MP2Xd","icon":"UploadArea-module_icon__BorsB flexBox-module_row__PWxbe","title":"UploadArea-module_title__cHPKW type-module_body-l-bold__I8Q1v","message":"UploadArea-module_message__cnoa7 flexBox-module_row__PWxbe","files":"UploadArea-module_files__hIz4K flexBox-module_column__MP2Xd","xs":"UploadArea-module_xs__MTB7z type-module_body-xs-regular__QWEzl","s":"UploadArea-module_s__w0unZ type-module_body-s-regular__8-FO-","m":"UploadArea-module_m__N4PzX type-module_body-m-regular__Qtp5G","l":"UploadArea-module_l__2GkSv type-module_body-l-regular__Ar4d3"};
|
|
11
|
+
styleInject(css_248z);
|
|
12
|
+
|
|
13
|
+
const imageTypes = ['png', 'jpg', 'jpeg', 'gif', 'svg', 'heic', 'heif'];
|
|
14
|
+
const videoTypes = ['mp4', 'avi', 'mov', 'wmv', 'flv'];
|
|
15
|
+
const documentTypes = [
|
|
16
|
+
'pdf',
|
|
17
|
+
'doc',
|
|
18
|
+
'docx',
|
|
19
|
+
'xls',
|
|
20
|
+
'xlsx',
|
|
21
|
+
'ppt',
|
|
22
|
+
'pptx',
|
|
23
|
+
];
|
|
24
|
+
const audioTypes = ['mp3', 'wav', 'ogg', 'aac', 'flac'];
|
|
25
|
+
const textTypes = ['txt', 'rtf', 'md', 'csv', 'json', 'xml'];
|
|
26
|
+
const allTypes = [
|
|
27
|
+
...imageTypes,
|
|
28
|
+
...videoTypes,
|
|
29
|
+
...documentTypes,
|
|
30
|
+
...audioTypes,
|
|
31
|
+
...textTypes,
|
|
32
|
+
];
|
|
33
|
+
var FileTypes;
|
|
34
|
+
(function (FileTypes) {
|
|
35
|
+
FileTypes["images"] = "images";
|
|
36
|
+
FileTypes["videos"] = "videos";
|
|
37
|
+
FileTypes["documents"] = "documents";
|
|
38
|
+
FileTypes["audio"] = "audio";
|
|
39
|
+
FileTypes["text"] = "text";
|
|
40
|
+
FileTypes["all"] = "all";
|
|
41
|
+
FileTypes["custom"] = "custom";
|
|
42
|
+
})(FileTypes || (FileTypes = {}));
|
|
43
|
+
|
|
44
|
+
const UploadAreaBase = React.forwardRef((props, ref) => {
|
|
45
|
+
const { icon = 'upload', iconColor = 'var(--core-text-primary)', iconColorHover = 'var(--core-text-special)', title = 'Upload Files', width = '100%', height = 'auto', message = 'Drag and drop files here or click to upload', busyMessage = 'Uploading in progress', iconSize = 24, textSize = 'm', border = 1, borderStyle = 'dashed', borderColor = 'var(--core-outline-primary)', borderColorHover = 'var(--core-outline-special)', radius = 8, padding = 32, bgColor = 'var(--core-surface-secondary)', bgColorHover = 'var(--core-surface-special)', acceptedTypes = allTypes, multiple = true, busy = false, canRemove = true, showProgress = true, files = [], onUpload, } = props;
|
|
46
|
+
const [hovered, setHovered] = useState(false);
|
|
47
|
+
const inputRef = useRef(null);
|
|
48
|
+
const dragDepth = useRef(0);
|
|
49
|
+
// set uploading files
|
|
50
|
+
// *** select files
|
|
51
|
+
// callback to trigger click
|
|
52
|
+
const handleClickUpload = useCallback(() => {
|
|
53
|
+
var _a;
|
|
54
|
+
if (busy)
|
|
55
|
+
return;
|
|
56
|
+
if (!(inputRef === null || inputRef === void 0 ? void 0 : inputRef.current))
|
|
57
|
+
return;
|
|
58
|
+
inputRef.current.value = '';
|
|
59
|
+
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.click();
|
|
60
|
+
}, [busy]);
|
|
61
|
+
// call back on file change
|
|
62
|
+
const handleFileInputChange = useCallback((e) => {
|
|
63
|
+
if (busy)
|
|
64
|
+
return;
|
|
65
|
+
if (!e.target.files)
|
|
66
|
+
return;
|
|
67
|
+
onUpload === null || onUpload === void 0 ? void 0 : onUpload(Array.from(e.target.files));
|
|
68
|
+
}, [busy, onUpload]);
|
|
69
|
+
// *** drag/drop
|
|
70
|
+
// check for files to light up hover
|
|
71
|
+
const hasFilesInDrag = useCallback((e) => {
|
|
72
|
+
var _a, _b;
|
|
73
|
+
return Array.from((_b = (_a = e.dataTransfer) === null || _a === void 0 ? void 0 : _a.types) !== null && _b !== void 0 ? _b : []).includes('Files');
|
|
74
|
+
}, []);
|
|
75
|
+
// use counters for responsive feedback
|
|
76
|
+
const handleDragEnter = useCallback((e) => {
|
|
77
|
+
e.preventDefault();
|
|
78
|
+
if (busy || !hasFilesInDrag(e))
|
|
79
|
+
return;
|
|
80
|
+
dragDepth.current += 1;
|
|
81
|
+
if (dragDepth.current === 1)
|
|
82
|
+
setHovered(true);
|
|
83
|
+
}, [busy, hasFilesInDrag]);
|
|
84
|
+
// prevent default since "drop" happens when "over"
|
|
85
|
+
const handleDragOver = (e) => {
|
|
86
|
+
e.preventDefault();
|
|
87
|
+
};
|
|
88
|
+
// at 0 hover is over
|
|
89
|
+
const handleDragLeave = useCallback((e) => {
|
|
90
|
+
e.preventDefault();
|
|
91
|
+
if (busy)
|
|
92
|
+
return;
|
|
93
|
+
dragDepth.current = Math.max(0, dragDepth.current - 1);
|
|
94
|
+
if (dragDepth.current === 0)
|
|
95
|
+
setHovered(false);
|
|
96
|
+
}, [busy]);
|
|
97
|
+
// handle drop
|
|
98
|
+
const handleDrop = useCallback((e) => {
|
|
99
|
+
var _a;
|
|
100
|
+
e.preventDefault();
|
|
101
|
+
if (busy)
|
|
102
|
+
return;
|
|
103
|
+
dragDepth.current = 0;
|
|
104
|
+
setHovered(false);
|
|
105
|
+
const files = Array.from((_a = e.dataTransfer.files) !== null && _a !== void 0 ? _a : []);
|
|
106
|
+
onUpload === null || onUpload === void 0 ? void 0 : onUpload(files);
|
|
107
|
+
}, [busy, onUpload]);
|
|
108
|
+
// icon color
|
|
109
|
+
const iconStrokeColor = useMemo(() => {
|
|
110
|
+
if (hovered)
|
|
111
|
+
return iconColorHover;
|
|
112
|
+
return iconColor;
|
|
113
|
+
}, [hovered, iconColor, iconColorHover]);
|
|
114
|
+
const cssVars = useMemo(() => {
|
|
115
|
+
return {
|
|
116
|
+
'--ua-border': `${border}px`,
|
|
117
|
+
'--ua-border-style': borderStyle,
|
|
118
|
+
'--ua-border-color': hovered || busy ? borderColorHover : borderColor,
|
|
119
|
+
'--ua-radius': `${radius}px`,
|
|
120
|
+
'--ua-padding': setStyle(padding),
|
|
121
|
+
'--ua-bg-color': hovered ? bgColorHover : bgColor,
|
|
122
|
+
'--ua-icon-size': `${iconSize}px`,
|
|
123
|
+
'--ua-cursor': busy ? 'default' : 'pointer',
|
|
124
|
+
'--ua-width': setStyle(width),
|
|
125
|
+
'--ua-height': setStyle(height),
|
|
126
|
+
};
|
|
127
|
+
}, [
|
|
128
|
+
border,
|
|
129
|
+
borderStyle,
|
|
130
|
+
borderColor,
|
|
131
|
+
borderColorHover,
|
|
132
|
+
radius,
|
|
133
|
+
padding,
|
|
134
|
+
bgColor,
|
|
135
|
+
bgColorHover,
|
|
136
|
+
iconSize,
|
|
137
|
+
busy,
|
|
138
|
+
hovered,
|
|
139
|
+
height,
|
|
140
|
+
width,
|
|
141
|
+
]);
|
|
142
|
+
return (jsxs("div", { className: css.wrapper, style: cssVars, ref: ref, role: 'button', "aria-label": 'Click to upload files', tabIndex: 0, onClick: handleClickUpload, onKeyDown: (e) => accessibleKeyDown(e, () => handleClickUpload()), onDragEnter: handleDragEnter, onDragOver: handleDragOver, onDragLeave: handleDragLeave, onDrop: handleDrop, children: [jsx("div", { className: css.icon, children: jsx(Icon, { size: iconSize, name: icon, strokeColor: iconStrokeColor, pointer: false }) }), jsx("div", { className: css.title, children: title }), jsxs("div", { className: `${css.message} ${css[textSize]}`, children: [busy && showProgress && (jsx(ProgressIndicator, { show: true, size: 20, inline: true, color: iconStrokeColor })), busy ? busyMessage : message] }), files.length > 0 && (jsx("div", { className: css.files, children: jsx(FileList, { files: files, bgColor: 'var(--core-surface-primary)', size: 'm', direction: 'column', gap: 8, iconSize: 24, padding: '10px', canRemove: canRemove }) })), jsx("input", { ref: inputRef, type: "file", hidden: true, disabled: busy, multiple: multiple, accept: acceptedTypes ? acceptedTypes.join(', ') : undefined, onChange: handleFileInputChange })] }));
|
|
143
|
+
});
|
|
144
|
+
UploadAreaBase.displayName = 'UploadArea';
|
|
145
|
+
const UploadArea = React.memo(UploadAreaBase);
|
|
146
|
+
|
|
147
|
+
export { UploadArea as U, allTypes as a, audioTypes as b, documentTypes as d, imageTypes as i, textTypes as t, videoTypes as v };
|
package/dist/esm/index.js
CHANGED
|
@@ -27,7 +27,7 @@ export { L as Logos } from './chunks/Logos-DwZP-TR2.js';
|
|
|
27
27
|
export { O as Overlay } from './chunks/Overlay-BolsHW9S.js';
|
|
28
28
|
export { F as FlexDiv } from './chunks/FlexDiv-CFyndG99.js';
|
|
29
29
|
export { P as Pager } from './chunks/Pager-BHLyXq9p.js';
|
|
30
|
-
export { P as PromptInput } from './chunks/PromptInput-
|
|
30
|
+
export { P as PromptInput } from './chunks/PromptInput-DodTBG82.js';
|
|
31
31
|
export { D as DoneCheck, P as ProgressIndicator } from './chunks/ProgressIndicator-uI9BZwBB.js';
|
|
32
32
|
export { R as RadioButton } from './chunks/RadioButton-D8otD_Jj.js';
|
|
33
33
|
export { R as RadioButtonList } from './chunks/RadioButtonList-CtX1j7rO.js';
|
|
@@ -46,7 +46,8 @@ export { F as FileIcon, a as FileIconNames } from './chunks/FileIcon-Cxh-QsYb.js
|
|
|
46
46
|
export { I as Icon, a as IconNames } from './chunks/_types-RJ7q8S0B.js';
|
|
47
47
|
export { B as ButtonBar } from './chunks/ButtonBar-Bl0oCxd8.js';
|
|
48
48
|
export { C as Card } from './chunks/Card-Bjk0kgQh.js';
|
|
49
|
-
export { L as Label } from './chunks/Label-
|
|
49
|
+
export { L as Label } from './chunks/Label-BRon-ejm.js';
|
|
50
|
+
export { U as UploadArea, a as allTypes, b as audioTypes, d as documentTypes, i as imageTypes, t as textTypes, v as videoTypes } from './chunks/UploadArea-C0YHy4Z9.js';
|
|
50
51
|
import './theme/corners.js';
|
|
51
52
|
import './theme/type.js';
|
|
52
53
|
import 'react';
|
|
@@ -55,4 +56,4 @@ import 'react/jsx-runtime';
|
|
|
55
56
|
import './chunks/style-inject.es-tgCJW-Cu.js';
|
|
56
57
|
import 'motion/react';
|
|
57
58
|
import './chunks/utils-CZ1LWeN6.js';
|
|
58
|
-
import './chunks/FileList-
|
|
59
|
+
import './chunks/FileList-CdUgbpYF.js';
|
package/dist/esm/uikit/Label.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { P as PromptInput } from '../chunks/PromptInput-
|
|
1
|
+
export { P as PromptInput } from '../chunks/PromptInput-DodTBG82.js';
|
|
2
2
|
import 'react/jsx-runtime';
|
|
3
3
|
import 'react';
|
|
4
4
|
import '../hooks/useTheme.js';
|
|
@@ -19,5 +19,5 @@ import '../chunks/_types-RJ7q8S0B.js';
|
|
|
19
19
|
import '../chunks/utils-CZ1LWeN6.js';
|
|
20
20
|
import '../chunks/ProgressIndicator-uI9BZwBB.js';
|
|
21
21
|
import '../chunks/sharedTypes-BfZzG1KX.js';
|
|
22
|
-
import '../chunks/FileList-
|
|
22
|
+
import '../chunks/FileList-CdUgbpYF.js';
|
|
23
23
|
import '../chunks/FileIcon-Cxh-QsYb.js';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export { U as UploadArea, a as allTypes, b as audioTypes, d as documentTypes, i as imageTypes, t as textTypes, v as videoTypes } from '../chunks/UploadArea-C0YHy4Z9.js';
|
|
2
|
+
import 'react/jsx-runtime';
|
|
3
|
+
import 'react';
|
|
4
|
+
import '../chunks/utils-CZ1LWeN6.js';
|
|
5
|
+
import '../chunks/tslib.es6-0pkUdtrF.js';
|
|
6
|
+
import '../chunks/FileList-CdUgbpYF.js';
|
|
7
|
+
import '../chunks/FileIcon-Cxh-QsYb.js';
|
|
8
|
+
import '../hooks/useTheme.js';
|
|
9
|
+
import '../theme/themes.js';
|
|
10
|
+
import '../theme/colors.js';
|
|
11
|
+
import '../theme/corners.js';
|
|
12
|
+
import '../theme/elevations.js';
|
|
13
|
+
import '../theme/type.js';
|
|
14
|
+
import '../hooks/useObserveTheme.js';
|
|
15
|
+
import '../hooks/useWindow.js';
|
|
16
|
+
import '../chunks/_types-RJ7q8S0B.js';
|
|
17
|
+
import '../chunks/ProgressIndicator-uI9BZwBB.js';
|
|
18
|
+
import 'motion/react';
|
|
19
|
+
import '../chunks/style-inject.es-tgCJW-Cu.js';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -73,3 +73,6 @@ export { Card } from './uikit/Card';
|
|
|
73
73
|
export type { CardProps } from './uikit/Card/_types';
|
|
74
74
|
export { Label } from './uikit/Label';
|
|
75
75
|
export type { LabelProps } from './uikit/Label';
|
|
76
|
+
export { UploadArea } from './uikit/UploadArea';
|
|
77
|
+
export type { UploadAreaProps } from './uikit/UploadArea/_types';
|
|
78
|
+
export { imageTypes, videoTypes, documentTypes, audioTypes, textTypes, allTypes, } from './uikit/UploadArea/_types';
|
|
@@ -17,6 +17,7 @@ type FileListBaseProps = {
|
|
|
17
17
|
iconSize?: number;
|
|
18
18
|
onChange?: (files: FileItem[]) => void;
|
|
19
19
|
bgColor?: string;
|
|
20
|
+
canRemove?: boolean;
|
|
20
21
|
onToolTip?: (tip: ToolTip | null) => void;
|
|
21
22
|
};
|
|
22
23
|
export type FileListProps = Omit<React.HTMLAttributes<HTMLDivElement>, keyof FileListBaseProps> & FileListBaseProps;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const UploadArea: React.NamedExoticComponent<Omit<React.HTMLAttributes<HTMLDivElement>, keyof {
|
|
3
|
+
icon?: string;
|
|
4
|
+
iconSize?: number;
|
|
5
|
+
iconColor?: string;
|
|
6
|
+
iconColorHover?: string;
|
|
7
|
+
width?: number | string;
|
|
8
|
+
height?: number | string;
|
|
9
|
+
title?: string;
|
|
10
|
+
message?: string;
|
|
11
|
+
busyMessage?: string;
|
|
12
|
+
bgColor?: string;
|
|
13
|
+
bgColorHover?: string;
|
|
14
|
+
border?: number;
|
|
15
|
+
borderColor?: string | null;
|
|
16
|
+
borderColorHover?: string | null;
|
|
17
|
+
borderStyle?: string;
|
|
18
|
+
textSize?: "s" | "m" | "l";
|
|
19
|
+
padding?: number | string;
|
|
20
|
+
radius?: number | string;
|
|
21
|
+
acceptedTypes?: string[];
|
|
22
|
+
multiple?: boolean;
|
|
23
|
+
busy?: boolean;
|
|
24
|
+
showProgress?: boolean;
|
|
25
|
+
files?: import("../FileList").FileItem[];
|
|
26
|
+
canRemove?: boolean;
|
|
27
|
+
onUpload?: (files: File[]) => void;
|
|
28
|
+
}> & {
|
|
29
|
+
icon?: string;
|
|
30
|
+
iconSize?: number;
|
|
31
|
+
iconColor?: string;
|
|
32
|
+
iconColorHover?: string;
|
|
33
|
+
width?: number | string;
|
|
34
|
+
height?: number | string;
|
|
35
|
+
title?: string;
|
|
36
|
+
message?: string;
|
|
37
|
+
busyMessage?: string;
|
|
38
|
+
bgColor?: string;
|
|
39
|
+
bgColorHover?: string;
|
|
40
|
+
border?: number;
|
|
41
|
+
borderColor?: string | null;
|
|
42
|
+
borderColorHover?: string | null;
|
|
43
|
+
borderStyle?: string;
|
|
44
|
+
textSize?: "s" | "m" | "l";
|
|
45
|
+
padding?: number | string;
|
|
46
|
+
radius?: number | string;
|
|
47
|
+
acceptedTypes?: string[];
|
|
48
|
+
multiple?: boolean;
|
|
49
|
+
busy?: boolean;
|
|
50
|
+
showProgress?: boolean;
|
|
51
|
+
files?: import("../FileList").FileItem[];
|
|
52
|
+
canRemove?: boolean;
|
|
53
|
+
onUpload?: (files: File[]) => void;
|
|
54
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { FileItem } from '../FileList';
|
|
3
|
+
export declare const imageTypes: string[];
|
|
4
|
+
export declare const videoTypes: string[];
|
|
5
|
+
export declare const documentTypes: string[];
|
|
6
|
+
export declare const audioTypes: string[];
|
|
7
|
+
export declare const textTypes: string[];
|
|
8
|
+
export declare const allTypes: string[];
|
|
9
|
+
export declare enum FileTypes {
|
|
10
|
+
images = "images",
|
|
11
|
+
videos = "videos",
|
|
12
|
+
documents = "documents",
|
|
13
|
+
audio = "audio",
|
|
14
|
+
text = "text",
|
|
15
|
+
all = "all",
|
|
16
|
+
custom = "custom"
|
|
17
|
+
}
|
|
18
|
+
type UploadAreaBaseProps = {
|
|
19
|
+
icon?: string;
|
|
20
|
+
iconSize?: number;
|
|
21
|
+
iconColor?: string;
|
|
22
|
+
iconColorHover?: string;
|
|
23
|
+
width?: number | string;
|
|
24
|
+
height?: number | string;
|
|
25
|
+
title?: string;
|
|
26
|
+
message?: string;
|
|
27
|
+
busyMessage?: string;
|
|
28
|
+
bgColor?: string;
|
|
29
|
+
bgColorHover?: string;
|
|
30
|
+
border?: number;
|
|
31
|
+
borderColor?: string | null;
|
|
32
|
+
borderColorHover?: string | null;
|
|
33
|
+
borderStyle?: string;
|
|
34
|
+
textSize?: 's' | 'm' | 'l';
|
|
35
|
+
padding?: number | string;
|
|
36
|
+
radius?: number | string;
|
|
37
|
+
acceptedTypes?: string[];
|
|
38
|
+
multiple?: boolean;
|
|
39
|
+
busy?: boolean;
|
|
40
|
+
showProgress?: boolean;
|
|
41
|
+
files?: FileItem[];
|
|
42
|
+
canRemove?: boolean;
|
|
43
|
+
onUpload?: (files: File[]) => void;
|
|
44
|
+
};
|
|
45
|
+
export type UploadAreaProps = Omit<React.HTMLAttributes<HTMLDivElement>, keyof UploadAreaBaseProps> & UploadAreaBaseProps;
|
|
46
|
+
export {};
|
|
@@ -47,3 +47,7 @@ export declare function setStyle(value: string | number | undefined, defaultVal?
|
|
|
47
47
|
* Copy to clipboard
|
|
48
48
|
*/
|
|
49
49
|
export declare const copyToClipboard: (rawContent: string) => Promise<boolean>;
|
|
50
|
+
/**
|
|
51
|
+
* Create a tint value from a hex color
|
|
52
|
+
*/
|
|
53
|
+
export declare const tintFromColor: (hex: string, percent: number) => string;
|