@oliasoft-open-source/react-ui-library 4.6.11 → 4.6.13
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/index.d.ts +22 -0
- package/dist/index.js +150 -1
- package/dist/index.js.map +1 -1
- package/dist/storybook/assets/Color-6VNJS4EI-0Es0Y_hf.js +1 -0
- package/dist/storybook/assets/DocsRenderer-NNNQARDV-8Agqr_1z.js +1 -0
- package/dist/storybook/assets/WithTooltip-V3YHNWJZ-VkPCPx4O.js +1 -0
- package/dist/storybook/assets/{accordion-M-sY23Hd.js → accordion-MRdNs3mQ.js} +1 -1
- package/dist/storybook/assets/{accordion.stories-Ckfdc3yE.js → accordion.stories-fQEMJlxQ.js} +2 -2
- package/dist/storybook/assets/{actions-eW7plDvv.js → actions-0lKGEXVi.js} +1 -1
- package/dist/storybook/assets/{actions.stories-v91cA8Aa.js → actions.stories-1G9apUqW.js} +1 -1
- package/dist/storybook/assets/{afe.stories-O_jbxAft.js → afe.stories-YtbvNBzx.js} +2 -2
- package/dist/storybook/assets/{badge.stories-AQYzIvli.js → badge.stories-YE5hHtSe.js} +1 -1
- package/dist/storybook/assets/{blowout.stories-Vff9htu-.js → blowout.stories-xSwBWe5T.js} +1 -1
- package/dist/storybook/assets/{button-group-rkjreZ1T.js → button-group-0RTzcUIP.js} +1 -1
- package/dist/storybook/assets/{button-group.stories-HnVY5ZDT.js → button-group.stories-eQ5h-50o.js} +1 -1
- package/dist/storybook/assets/{button-yLYf8aC9.js → button-pSDG6Ka2.js} +1 -1
- package/dist/storybook/assets/{button.stories-sp9SbrbR.js → button.stories-QDP0P6s7.js} +6 -6
- package/dist/storybook/assets/{buttons-and-links-05g5wWR_.js → buttons-and-links-dSpYF4I_.js} +2 -2
- package/dist/storybook/assets/{card.stories--XA-NPtn.js → card.stories-nEB15GEp.js} +1 -1
- package/dist/storybook/assets/{casing-loads.stories-qq7nVcz2.js → casing-loads.stories-uu-yK01O.js} +2 -2
- package/dist/storybook/assets/{cell.stories-7M24NqPM.js → cell.stories-jU_N8b9E.js} +2 -2
- package/dist/storybook/assets/{check-box-TRAFDvOc.js → check-box--ih7cmR1.js} +1 -1
- package/dist/storybook/assets/{check-box.stories-xj8y4pvN.js → check-box.stories-WFbOF7kK.js} +1 -1
- package/dist/storybook/assets/{chunk-HLWAVYOI-4ciTSFM-.js → chunk-HLWAVYOI-TfoHKvis.js} +1 -1
- package/dist/storybook/assets/color-LJZaNnUB.js +25 -0
- package/dist/storybook/assets/{column.stories-wGhSlroa.js → column.stories-uR7F6GLZ.js} +1 -1
- package/dist/storybook/assets/dialog-kardLd1s.js +1 -0
- package/dist/storybook/assets/{drawer-NuViVQqw.js → drawer-fq99yzU7.js} +1 -1
- package/dist/storybook/assets/{drawer.stories-mIhzICjZ.js → drawer.stories-zos7-Jef.js} +2 -2
- package/dist/storybook/assets/{empty.stories-3hs4gUgZ.js → empty.stories-V5nX7JMj.js} +1 -1
- package/dist/storybook/assets/extends-dGVwEr9R.js +1 -0
- package/dist/storybook/assets/{field-UZtORY6D.js → field-V2qkm8ON.js} +1 -1
- package/dist/storybook/assets/{field.stories-DPmPvDCm.js → field.stories-oQ-oKw9H.js} +1 -1
- package/dist/storybook/assets/file-input-ASEHnODl.js +1 -0
- package/dist/storybook/assets/file-input.stories-K1-X4A2h.js +66 -0
- package/dist/storybook/assets/{flex.stories-7GcqtV92.js → flex.stories-rUC8irnS.js} +1 -1
- package/dist/storybook/assets/footer.stories-6IYhl3Y9.js +3 -0
- package/dist/storybook/assets/form.stories-TfCufaed.js +49 -0
- package/dist/storybook/assets/formation.stories-arormd_z.js +74 -0
- package/dist/storybook/assets/{formatter-SWP5E3XI-zMN0v4F6.js → formatter-SWP5E3XI-E_AUyOmB.js} +2 -2
- package/dist/storybook/assets/{heading-AvGkZ8ae.js → heading-OSdaYHYE.js} +1 -1
- package/dist/storybook/assets/{heading.stories-aJs549tG.js → heading.stories-YhoAJ5xD.js} +1 -1
- package/dist/storybook/assets/{help-icon-4sFVvBkZ.js → help-icon-jdxRTcvs.js} +1 -1
- package/dist/storybook/assets/{help-icon.stories-9Apwwl_z.js → help-icon.stories-NKBYmv_o.js} +1 -1
- package/dist/storybook/assets/icon-_m67DAr0.js +8 -0
- package/dist/storybook/assets/{icon.stories-j-b_Exev.js → icon.stories-2aZia1VV.js} +1 -1
- package/dist/storybook/assets/iframe-XBWdLgXl.js +7 -0
- package/dist/storybook/assets/{index-ozIFb807.js → index-g34udPZo.js} +5 -5
- package/dist/storybook/assets/{index.es-VXFRDikp.js → index.es-HG2GUH9i.js} +4 -4
- package/dist/storybook/assets/inheritsLoose-Y9jOMJLd.js +1 -0
- package/dist/storybook/assets/{input-group.stories-wQfcKDtd.js → input-group.stories-HXoMZkHB.js} +2 -2
- package/dist/storybook/assets/{input-validation-K4-DmgHM.js → input-validation-EHlvLdps.js} +2 -2
- package/dist/storybook/assets/{inputs-erHcgGCK.js → inputs-UqnSQlzK.js} +2 -2
- package/dist/storybook/assets/{label-am612zWx.js → label-KLaw_y6R.js} +1 -1
- package/dist/storybook/assets/{label.stories-QPyTvO7T.js → label.stories-8KngvJd3.js} +1 -1
- package/dist/storybook/assets/layout-forms-n0KRZ2JT.js +16 -0
- package/dist/storybook/assets/{layout-general-nk8z6z9i.js → layout-general-4Z_dYwOs.js} +2 -2
- package/dist/storybook/assets/{list-LWmKQq1G.js → list-HBgplEUa.js} +1 -1
- package/dist/storybook/assets/{list.stories-fgw3Kx3W.js → list.stories-AC7IBnuA.js} +2 -2
- package/dist/storybook/assets/{list.stories-data-IWB082tu.js → list.stories-data-YuaX7eYb.js} +1 -1
- package/dist/storybook/assets/{loader.stories-NaDVDl7Z.js → loader.stories-A0lEe-_I.js} +1 -1
- package/dist/storybook/assets/{menu.stories-K4nBhFj_.js → menu.stories-wWr6qpLS.js} +6 -6
- package/dist/storybook/assets/{message-CRKuTfOl.js → message-bbAE2zjv.js} +1 -1
- package/dist/storybook/assets/{message.stories-CSw6ElMp.js → message.stories-rANJfalB.js} +1 -1
- package/dist/storybook/assets/{meta-content-70Z_mWPh.js → meta-content-xcMHnFul.js} +1 -1
- package/dist/storybook/assets/{modal.stories-10-XQKON.js → modal.stories-GY64tFtP.js} +2 -2
- package/dist/storybook/assets/{number-input.stories-59JRvVcf.js → number-input.stories-oaHrqqEo.js} +5 -5
- package/dist/storybook/assets/{option-dropdown.stories-ZCnTHpeT.js → option-dropdown.stories-IIXgJvpF.js} +1 -1
- package/dist/storybook/assets/{padding-and-spacing-uyBZRJ5c.js → padding-and-spacing-6Wmzdt8V.js} +2 -2
- package/dist/storybook/assets/{page.stories-GrhPKgmq.js → page.stories-jmoBCw29.js} +1 -1
- package/dist/storybook/assets/{pagination-yFWOmymz.js → pagination-LajpPl1E.js} +1 -1
- package/dist/storybook/assets/{pagination.stories-IahSsrYh.js → pagination.stories-QNaX-nfT.js} +2 -2
- package/dist/storybook/assets/{pop-confirm.stories-StkaY9mZ.js → pop-confirm.stories-qL_Z99O8.js} +1 -1
- package/dist/storybook/assets/{popover-YDVuwgEX.js → popover-dGHzPDyA.js} +1 -1
- package/dist/storybook/assets/popover.stories-4yXf4qke.js +1 -0
- package/dist/storybook/assets/{preview-mNdmFu2O.js → preview-izL99lIf.js} +3 -3
- package/dist/storybook/assets/preview-sTJNaY8B.js +7 -0
- package/dist/storybook/assets/projects.stories-gJiQXNLT.js +47 -0
- package/dist/storybook/assets/{radio-button-g10vtbgR.js → radio-button-YSXmxvG2.js} +1 -1
- package/dist/storybook/assets/{radio-button.stories-Lm3AgSPw.js → radio-button.stories-kcqjIFI9.js} +1 -1
- package/dist/storybook/assets/react-router-dom-4Z66xYqZ.js +8 -0
- package/dist/storybook/assets/{reservoirs.stories-UloVc7w8.js → reservoirs.stories-SK2d9Fio.js} +2 -2
- package/dist/storybook/assets/{rich-text-input.stories-g_yH3vr8.js → rich-text-input.stories-zaKtuZiu.js} +3 -3
- package/dist/storybook/assets/{row.stories-c7qJDc3O.js → row.stories-U-yrdTYI.js} +2 -2
- package/dist/storybook/assets/select-7lyQEtzA.js +1 -0
- package/dist/storybook/assets/{select.stories-XhlzQ7cL.js → select.stories-xDbB-kMM.js} +2 -2
- package/dist/storybook/assets/{side-bar-hJdv8LbH.js → side-bar-5P37lMUr.js} +1 -1
- package/dist/storybook/assets/{side-bar.stories-Yhz9jXs2.js → side-bar.stories-JTyeqg4a.js} +1 -1
- package/dist/storybook/assets/{site.stories-KJRfCDdv.js → site.stories-h1X4It52.js} +2 -2
- package/dist/storybook/assets/slider-bFd0qknB.js +7 -0
- package/dist/storybook/assets/{slider.stories-R5xGydpl.js → slider.stories-EBNa8dCL.js} +2 -2
- package/dist/storybook/assets/smart-upload-modal.stories--J7j_ykg.js +25 -0
- package/dist/storybook/assets/{spacer.stories-9tR72ZgH.js → spacer.stories-Bp11g7WY.js} +1 -1
- package/dist/storybook/assets/syntaxhighlighter-B5GMVT5T-ACJ3LFR3.js +1 -0
- package/dist/storybook/assets/{table-plX5wbPy.js → table-YO72eq6-.js} +1 -1
- package/dist/storybook/assets/{table.stories-w4weqjQS.js → table.stories-87uvXmuW.js} +2 -2
- package/dist/storybook/assets/{table.stories-data-9T_1BLo6.js → table.stories-data-hDQBe08f.js} +1 -1
- package/dist/storybook/assets/text-link.stories-Plmiu8NV.js +14 -0
- package/dist/storybook/assets/{textarea-dAYYNVTs.js → textarea-XY_iUfzV.js} +1 -1
- package/dist/storybook/assets/{textarea.stories-tvP01BwE.js → textarea.stories-tpIT4O3R.js} +1 -1
- package/dist/storybook/assets/{title.stories-o7fCo4X-.js → title.stories-mhWM-m41.js} +3 -3
- package/dist/storybook/assets/{toaster-yPcd4ELJ.js → toaster-IL_npIpU.js} +1 -1
- package/dist/storybook/assets/{toaster.stories-4aAkEVaa.js → toaster.stories-2399ErHt.js} +1 -1
- package/dist/storybook/assets/{toggle-m3EwNS6z.js → toggle-KddTHsTd.js} +1 -1
- package/dist/storybook/assets/{toggle.stories-jaduywRN.js → toggle.stories-ZPLKo1CO.js} +1 -1
- package/dist/storybook/assets/{tooltip.test-case.stories-Sq5qLreq.js → tooltip.test-case.stories-e7KXJ1zz.js} +1 -1
- package/dist/storybook/assets/{top-bar-8ASbRXqr.js → top-bar-xIrfLvE9.js} +1 -1
- package/dist/storybook/assets/top-bar.stories-OWyuBUT6.js +21 -0
- package/dist/storybook/assets/{top-bar.testcase.stories-Yjz8R3nX.js → top-bar.testcase.stories-uu_mJjq3.js} +1 -1
- package/dist/storybook/assets/{tree.stories-VhgtyM-i.js → tree.stories-KFifRduQ.js} +1 -1
- package/dist/storybook/assets/{unit-input.stories--JK_4hwn.js → unit-input.stories-EPjs0Jo3.js} +1 -1
- package/dist/storybook/assets/unit-table.stories-KSzMk2ae.js +142 -0
- package/dist/storybook/iframe.html +1 -1
- package/dist/storybook/index.json +1 -1
- package/dist/storybook/project.json +1 -1
- package/dist/storybook/stories.json +1 -1
- package/package.json +1 -1
- package/dist/storybook/assets/Color-6VNJS4EI-GQwgd_ld.js +0 -1
- package/dist/storybook/assets/DocsRenderer-NNNQARDV-A0C5N1_E.js +0 -1
- package/dist/storybook/assets/WithTooltip-V3YHNWJZ-_ZdSUz6-.js +0 -1
- package/dist/storybook/assets/color-Sklm1A7t.js +0 -25
- package/dist/storybook/assets/dialog--p0h3TPY.js +0 -1
- package/dist/storybook/assets/file-input.stories-Mcb6uqW7.js +0 -66
- package/dist/storybook/assets/footer.stories-rwoGk_OR.js +0 -3
- package/dist/storybook/assets/form.stories-56ONaO3q.js +0 -49
- package/dist/storybook/assets/formation.stories-DzFYQPb4.js +0 -74
- package/dist/storybook/assets/icon-8EQazuuW.js +0 -8
- package/dist/storybook/assets/iframe-SOjg2hBS.js +0 -7
- package/dist/storybook/assets/inheritsLoose-8sb_A2v4.js +0 -1
- package/dist/storybook/assets/layout-forms-Zo8OvCqi.js +0 -16
- package/dist/storybook/assets/popover.stories-QeTPelqE.js +0 -1
- package/dist/storybook/assets/preview-HCxJn5W4.js +0 -7
- package/dist/storybook/assets/projects.stories-HDwAJ2lH.js +0 -47
- package/dist/storybook/assets/react-router-dom-EZH1n7K1.js +0 -8
- package/dist/storybook/assets/select-xiPCWaz8.js +0 -1
- package/dist/storybook/assets/slider-at3_DXQg.js +0 -7
- package/dist/storybook/assets/syntaxhighlighter-B5GMVT5T-bjqZHg5d.js +0 -1
- package/dist/storybook/assets/text-link.stories-Mx9ojcOC.js +0 -14
- package/dist/storybook/assets/top-bar.stories-9LS979MG.js +0 -21
- package/dist/storybook/assets/unit-table.stories-fbIAsylx.js +0 -142
package/dist/index.d.ts
CHANGED
|
@@ -1234,6 +1234,26 @@ export declare interface ISliderProps {
|
|
|
1234
1234
|
}) => void;
|
|
1235
1235
|
}
|
|
1236
1236
|
|
|
1237
|
+
export declare type ISmartUploadModalProps = {
|
|
1238
|
+
visible: boolean;
|
|
1239
|
+
prompt: string;
|
|
1240
|
+
onCloseModal: () => void;
|
|
1241
|
+
onUpload: (prompt: string, file: File) => any;
|
|
1242
|
+
onComplete: (data: {
|
|
1243
|
+
[key: string]: string;
|
|
1244
|
+
}[]) => void;
|
|
1245
|
+
onFailed?: () => void;
|
|
1246
|
+
onError?: (error: any) => void;
|
|
1247
|
+
width?: number;
|
|
1248
|
+
heading?: string;
|
|
1249
|
+
dialogText?: string;
|
|
1250
|
+
fileInputText?: string;
|
|
1251
|
+
fileInputPlaceholder?: string;
|
|
1252
|
+
uploadText?: string;
|
|
1253
|
+
cancelText?: string;
|
|
1254
|
+
testId?: string;
|
|
1255
|
+
};
|
|
1256
|
+
|
|
1237
1257
|
declare interface ISortCell extends TCommonCell {
|
|
1238
1258
|
type: TCellType;
|
|
1239
1259
|
hasSort?: boolean;
|
|
@@ -1666,6 +1686,8 @@ export declare const SideBar: React_2.MemoExoticComponent<({ options, startOpen,
|
|
|
1666
1686
|
|
|
1667
1687
|
export declare const Slider: ({ name, label, width, labelWidth, value, min, max, step, marks, showArrows, showTooltip, tooltipFormatter, disabled, range, small, vertical, onChange, }: ISliderProps) => JSX_2.Element;
|
|
1668
1688
|
|
|
1689
|
+
export declare const SmartUploadModal: ({ visible, prompt, onCloseModal, onUpload, onComplete, onFailed, onError, width, heading, dialogText, fileInputText, fileInputPlaceholder, uploadText, cancelText, testId, }: ISmartUploadModalProps) => JSX_2.Element;
|
|
1690
|
+
|
|
1669
1691
|
export declare const Spacer: ({ height, width, flex, }: ISpacerProps) => JSX_2.Element;
|
|
1670
1692
|
|
|
1671
1693
|
export declare const Spinner: ({ small, colored, dark, tiny, }: ISpinnerProps) => JSX_2.Element;
|
package/dist/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import * as PropTypes from "prop-types";
|
|
|
11
11
|
import PropTypes__default from "prop-types";
|
|
12
12
|
import ReactDOM, { createPortal, unstable_batchedUpdates, render } from "react-dom";
|
|
13
13
|
import _$1, { set, get as get$2, isString as isString$3, isNumber as isNumber$1, isBoolean as isBoolean$2, isFunction as isFunction$3, isEmpty, isArray as isArray$1, toNumber, debounce as debounce$2, isObject as isObject$5, isObjectLike, has as has$1, isEqual as isEqual$4 } from "lodash";
|
|
14
|
-
import { roundToFixed, validateNumber, cleanNumStr, unitFromQuantity, isValueWithUnit, withUnit, convertSamePrecision, getValue as getValue$1, getUnit, KNOWN_UNITS, split as split$1, checkAndCleanDecimalComma, label as label$b, altUnitsList, getUnitsForQuantity, convertAndGetValue, isScientificStringNum, roundToPrecision } from "@oliasoft-open-source/units";
|
|
14
|
+
import { roundToFixed, validateNumber, cleanNumStr, unitFromQuantity, isValueWithUnit, withUnit, convertSamePrecision, getValue as getValue$1, getUnit, KNOWN_UNITS, split as split$1, checkAndCleanDecimalComma, label as label$b, altUnitsList, getUnitsForQuantity, convertAndGetValue, isScientificStringNum, roundToPrecision, roundByMagnitudeToFixed } from "@oliasoft-open-source/units";
|
|
15
15
|
import { isValueWithUnit as isValueWithUnit$1 } from "@oliasoft-open-source/units/dist/units";
|
|
16
16
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
17
17
|
function getDefaultExportFromCjs(x2) {
|
|
@@ -70839,6 +70839,154 @@ const UnitTable = ({
|
|
|
70839
70839
|
}
|
|
70840
70840
|
);
|
|
70841
70841
|
};
|
|
70842
|
+
const INTERVAL_TIME = 250;
|
|
70843
|
+
const REQUEST_TIME = 4e4;
|
|
70844
|
+
const FINISH_INTERVALS = 20;
|
|
70845
|
+
const FINISH_TIME = 500;
|
|
70846
|
+
const SmartUploadModal = ({
|
|
70847
|
+
visible,
|
|
70848
|
+
prompt,
|
|
70849
|
+
onCloseModal,
|
|
70850
|
+
onUpload,
|
|
70851
|
+
onComplete,
|
|
70852
|
+
onFailed,
|
|
70853
|
+
onError: onError3,
|
|
70854
|
+
width: width2,
|
|
70855
|
+
heading: heading2,
|
|
70856
|
+
dialogText,
|
|
70857
|
+
fileInputText,
|
|
70858
|
+
fileInputPlaceholder,
|
|
70859
|
+
uploadText,
|
|
70860
|
+
cancelText,
|
|
70861
|
+
testId
|
|
70862
|
+
}) => {
|
|
70863
|
+
const [file, setFile] = useState(null);
|
|
70864
|
+
const [isFetching, setFetching] = useState(false);
|
|
70865
|
+
const [requestTimer, setRequestTimer] = useState(0);
|
|
70866
|
+
let timer = 0;
|
|
70867
|
+
const updateTimer = () => {
|
|
70868
|
+
const newTime = timer + INTERVAL_TIME;
|
|
70869
|
+
timer = newTime;
|
|
70870
|
+
setRequestTimer(timer);
|
|
70871
|
+
};
|
|
70872
|
+
const finishTimer = (deltaTime) => {
|
|
70873
|
+
let newTime = timer + deltaTime;
|
|
70874
|
+
if (newTime >= 0.99 * REQUEST_TIME) {
|
|
70875
|
+
newTime = REQUEST_TIME;
|
|
70876
|
+
}
|
|
70877
|
+
timer = newTime;
|
|
70878
|
+
setRequestTimer(timer);
|
|
70879
|
+
};
|
|
70880
|
+
useEffect(() => {
|
|
70881
|
+
setFile(null);
|
|
70882
|
+
}, [visible]);
|
|
70883
|
+
const handleFileChange = (event) => {
|
|
70884
|
+
if (!event.target.value)
|
|
70885
|
+
return;
|
|
70886
|
+
setFile(event.target.value);
|
|
70887
|
+
};
|
|
70888
|
+
const handleUpload = async () => {
|
|
70889
|
+
setRequestTimer(0);
|
|
70890
|
+
const id2 = setInterval(updateTimer, INTERVAL_TIME);
|
|
70891
|
+
try {
|
|
70892
|
+
if (!file)
|
|
70893
|
+
return;
|
|
70894
|
+
setFetching(true);
|
|
70895
|
+
const data = await onUpload(prompt, file);
|
|
70896
|
+
if (!visible)
|
|
70897
|
+
return;
|
|
70898
|
+
if (data) {
|
|
70899
|
+
clearInterval(id2);
|
|
70900
|
+
const id22 = setInterval(
|
|
70901
|
+
finishTimer,
|
|
70902
|
+
FINISH_TIME / FINISH_INTERVALS,
|
|
70903
|
+
(REQUEST_TIME - timer) / (FINISH_INTERVALS - 1)
|
|
70904
|
+
);
|
|
70905
|
+
setTimeout(() => {
|
|
70906
|
+
onComplete(data);
|
|
70907
|
+
clearInterval(id22);
|
|
70908
|
+
setFetching(false);
|
|
70909
|
+
}, FINISH_TIME);
|
|
70910
|
+
} else {
|
|
70911
|
+
onFailed == null ? void 0 : onFailed();
|
|
70912
|
+
setFetching(false);
|
|
70913
|
+
}
|
|
70914
|
+
} catch (error2) {
|
|
70915
|
+
onError3 == null ? void 0 : onError3(error2);
|
|
70916
|
+
setFetching(false);
|
|
70917
|
+
} finally {
|
|
70918
|
+
clearInterval(id2);
|
|
70919
|
+
}
|
|
70920
|
+
};
|
|
70921
|
+
const onConfirm = () => {
|
|
70922
|
+
handleUpload();
|
|
70923
|
+
};
|
|
70924
|
+
const onClose = () => {
|
|
70925
|
+
onCloseModal();
|
|
70926
|
+
};
|
|
70927
|
+
const content2 = /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
70928
|
+
/* @__PURE__ */ jsx(Text, { children: dialogText || "Upload file and extract data using a LLM" }),
|
|
70929
|
+
/* @__PURE__ */ jsx(Spacer, {}),
|
|
70930
|
+
/* @__PURE__ */ jsx(
|
|
70931
|
+
FileInput,
|
|
70932
|
+
{
|
|
70933
|
+
placeholder: fileInputPlaceholder || "No file",
|
|
70934
|
+
label: fileInputText || "Select",
|
|
70935
|
+
file: file || void 0,
|
|
70936
|
+
onChange: handleFileChange,
|
|
70937
|
+
testId: `${testId}-file-input`,
|
|
70938
|
+
accept: "image/*"
|
|
70939
|
+
}
|
|
70940
|
+
),
|
|
70941
|
+
isFetching && /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
70942
|
+
/* @__PURE__ */ jsx(Spacer, {}),
|
|
70943
|
+
/* @__PURE__ */ jsx(
|
|
70944
|
+
ProgressBar$1,
|
|
70945
|
+
{
|
|
70946
|
+
percentage: roundByMagnitudeToFixed(
|
|
70947
|
+
100 * requestTimer / REQUEST_TIME,
|
|
70948
|
+
3
|
|
70949
|
+
)
|
|
70950
|
+
}
|
|
70951
|
+
)
|
|
70952
|
+
] })
|
|
70953
|
+
] });
|
|
70954
|
+
const footer2 = /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
70955
|
+
/* @__PURE__ */ jsx(
|
|
70956
|
+
Button$1,
|
|
70957
|
+
{
|
|
70958
|
+
label: uploadText || "Upload",
|
|
70959
|
+
colored: true,
|
|
70960
|
+
onClick: onConfirm,
|
|
70961
|
+
disabled: !file || isFetching,
|
|
70962
|
+
testId: `${testId}-button-upload`
|
|
70963
|
+
}
|
|
70964
|
+
),
|
|
70965
|
+
/* @__PURE__ */ jsx(
|
|
70966
|
+
Button$1,
|
|
70967
|
+
{
|
|
70968
|
+
label: cancelText || "Cancel",
|
|
70969
|
+
onClick: onClose,
|
|
70970
|
+
testId: `${testId}-button-cancel`
|
|
70971
|
+
}
|
|
70972
|
+
)
|
|
70973
|
+
] });
|
|
70974
|
+
useKeyboardEvent("Escape", () => onClose());
|
|
70975
|
+
return /* @__PURE__ */ jsx(Modal, { visible, centered: true, children: /* @__PURE__ */ jsx(
|
|
70976
|
+
Dialog,
|
|
70977
|
+
{
|
|
70978
|
+
dialog: {
|
|
70979
|
+
scroll: true,
|
|
70980
|
+
heading: heading2 || "Smart Upload",
|
|
70981
|
+
content: content2,
|
|
70982
|
+
footer: footer2,
|
|
70983
|
+
onClose,
|
|
70984
|
+
width: width2 || 350,
|
|
70985
|
+
testId
|
|
70986
|
+
}
|
|
70987
|
+
}
|
|
70988
|
+
) });
|
|
70989
|
+
};
|
|
70842
70990
|
export {
|
|
70843
70991
|
Accordion,
|
|
70844
70992
|
AccordionWithDefaultToggle,
|
|
@@ -70903,6 +71051,7 @@ export {
|
|
|
70903
71051
|
Select,
|
|
70904
71052
|
SideBar,
|
|
70905
71053
|
Slider,
|
|
71054
|
+
SmartUploadModal,
|
|
70906
71055
|
Spacer,
|
|
70907
71056
|
Spinner$1 as Spinner,
|
|
70908
71057
|
Table,
|