@oliasoft-open-source/react-ui-library 4.6.4-beta-3 → 4.6.4-beta-5
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 +0 -22
- package/dist/index.js +13 -109
- package/dist/index.js.map +1 -1
- package/dist/storybook/assets/{Color-6VNJS4EI-7EJWBn2n.js → Color-6VNJS4EI-HO1Asy5-.js} +1 -1
- package/dist/storybook/assets/{DocsRenderer-NNNQARDV-27_v5hoK.js → DocsRenderer-NNNQARDV-vRAi_FKc.js} +1 -1
- package/dist/storybook/assets/{WithTooltip-V3YHNWJZ-6sbHf1Os.js → WithTooltip-V3YHNWJZ-mPffEZCE.js} +1 -1
- package/dist/storybook/assets/{buttons-and-links-dYrnUCBl.js → buttons-and-links-DO2-co7o.js} +1 -1
- package/dist/storybook/assets/{casing-loads.stories-Ilvo3kc-.js → casing-loads.stories-oh3l5Q7X.js} +1 -1
- package/dist/storybook/assets/{chunk-HLWAVYOI-3MTK5A9a.js → chunk-HLWAVYOI-YeFXPQnD.js} +1 -1
- package/dist/storybook/assets/{color-yUbRwZdG.js → color-B2uvL4Ic.js} +1 -1
- package/dist/storybook/assets/dialog-JbUIdbsX.js +1 -0
- package/dist/storybook/assets/{file-input.stories-0vixHxSj.js → file-input.stories-wyxnLg33.js} +1 -1
- package/dist/storybook/assets/{form.stories-xo3CugfR.js → form.stories-0lkQdf32.js} +1 -1
- package/dist/storybook/assets/{formatter-SWP5E3XI-qqJfB2JF.js → formatter-SWP5E3XI-SR8hv_3z.js} +1 -1
- package/dist/storybook/assets/{iframe-zKP8LwdF.js → iframe-_wKvslme.js} +2 -2
- package/dist/storybook/assets/{index-_Cqj7ZZf.js → index-WC-d15Tp.js} +5 -5
- package/dist/storybook/assets/{input-validation-F3k_L_V-.js → input-validation-qULDcPd2.js} +1 -1
- package/dist/storybook/assets/{inputs-it9JeY9A.js → inputs-1jcj95Nt.js} +1 -1
- package/dist/storybook/assets/{layout-forms-aoSd8nYT.js → layout-forms-1Qs33sNe.js} +1 -1
- package/dist/storybook/assets/{layout-general-VkqLpK9N.js → layout-general-NX25o6Iu.js} +1 -1
- package/dist/storybook/assets/modal.stories-DDey1uF7.js +200 -0
- package/dist/storybook/assets/{padding-and-spacing-NsXmbV4A.js → padding-and-spacing-2soccpsa.js} +1 -1
- package/dist/storybook/assets/{preview-uQoi467g.js → preview--Oj7lXeP.js} +1 -1
- package/dist/storybook/assets/{preview-MFdzaKPJ.js → preview-WU__fZ5Y.js} +2 -2
- package/dist/storybook/assets/{syntaxhighlighter-B5GMVT5T-iOeaOhyu.js → syntaxhighlighter-B5GMVT5T-FkUWpfWd.js} +1 -1
- package/dist/storybook/assets/{textarea-Frf9uK4H.js → textarea-Z5OlrRfT.js} +1 -1
- package/dist/storybook/assets/{textarea.stories-1JfGlfHS.js → textarea.stories-RbhU6pN4.js} +1 -1
- 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/dialog-roJ8Yns6.js +0 -1
- package/dist/storybook/assets/modal.stories-dirXv4n_.js +0 -173
package/dist/index.d.ts
CHANGED
|
@@ -1665,8 +1665,6 @@ export declare const SideBar: React_2.MemoExoticComponent<({ options, startOpen,
|
|
|
1665
1665
|
|
|
1666
1666
|
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;
|
|
1667
1667
|
|
|
1668
|
-
export declare const SmartUploadModal: ({ visible, prompt, onCloseModal, onUpload, onComplete, onFailed, onError, width, heading, dialogText, fileInputText, fileInputPlaceholder, uploadText, cancelText, testId, }: TSmartUploadModalProps) => JSX_2.Element;
|
|
1669
|
-
|
|
1670
1668
|
export declare const Spacer: ({ height, width, flex, }: ISpacerProps) => JSX_2.Element;
|
|
1671
1669
|
|
|
1672
1670
|
export declare const Spinner: ({ small, colored, dark, tiny, }: ISpinnerProps) => JSX_2.Element;
|
|
@@ -1802,26 +1800,6 @@ declare type TSliderMark = {
|
|
|
1802
1800
|
tooltip?: number | string | ReactNode;
|
|
1803
1801
|
};
|
|
1804
1802
|
|
|
1805
|
-
export declare type TSmartUploadModalProps = {
|
|
1806
|
-
visible: boolean;
|
|
1807
|
-
prompt: string;
|
|
1808
|
-
onCloseModal: () => void;
|
|
1809
|
-
onUpload: (prompt: string, file: File) => any;
|
|
1810
|
-
onComplete: (data: {
|
|
1811
|
-
[key: string]: string;
|
|
1812
|
-
}[]) => void;
|
|
1813
|
-
onFailed?: () => void;
|
|
1814
|
-
onError?: (error: any) => void;
|
|
1815
|
-
width?: number;
|
|
1816
|
-
heading?: string;
|
|
1817
|
-
dialogText?: string;
|
|
1818
|
-
fileInputText?: string;
|
|
1819
|
-
fileInputPlaceholder?: string;
|
|
1820
|
-
uploadText?: string;
|
|
1821
|
-
cancelText?: string;
|
|
1822
|
-
testId?: string;
|
|
1823
|
-
};
|
|
1824
|
-
|
|
1825
1803
|
declare type TStringNumberNull = string | number | null;
|
|
1826
1804
|
|
|
1827
1805
|
declare type TStringOrNumber = string | number;
|
package/dist/index.js
CHANGED
|
@@ -19534,6 +19534,18 @@ const Modal = ({
|
|
|
19534
19534
|
onEnter,
|
|
19535
19535
|
onEscape
|
|
19536
19536
|
}) => {
|
|
19537
|
+
const MODAL_CONTAINER_ID = "modalContainer";
|
|
19538
|
+
useEffect(() => {
|
|
19539
|
+
if (document.getElementById(MODAL_CONTAINER_ID)) {
|
|
19540
|
+
return;
|
|
19541
|
+
}
|
|
19542
|
+
const container2 = document.createElement("div");
|
|
19543
|
+
container2.id = MODAL_CONTAINER_ID;
|
|
19544
|
+
document.body.appendChild(container2);
|
|
19545
|
+
return () => {
|
|
19546
|
+
document.body.removeChild(container2);
|
|
19547
|
+
};
|
|
19548
|
+
}, []);
|
|
19537
19549
|
useKeyboardEvent(
|
|
19538
19550
|
"Enter",
|
|
19539
19551
|
() => {
|
|
@@ -19552,10 +19564,7 @@ const Modal = ({
|
|
|
19552
19564
|
},
|
|
19553
19565
|
[visible, onEscape]
|
|
19554
19566
|
);
|
|
19555
|
-
return /* @__PURE__ */
|
|
19556
|
-
/* @__PURE__ */ jsx(Portal, { id: "modalContainer", children: visible ? /* @__PURE__ */ jsx(Wrapper, { children: /* @__PURE__ */ jsx(Content$2, { width: width2, centered: centered2, children }) }) : null }),
|
|
19557
|
-
/* @__PURE__ */ jsx("div", { id: "modalContainer" })
|
|
19558
|
-
] });
|
|
19567
|
+
return /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsx(Portal, { id: MODAL_CONTAINER_ID, children: visible ? /* @__PURE__ */ jsx(Wrapper, { children: /* @__PURE__ */ jsx(Content$2, { width: width2, centered: centered2, children }) }) : null }) });
|
|
19559
19568
|
};
|
|
19560
19569
|
const menu$1 = "_menu_12x4u_1";
|
|
19561
19570
|
const header = "_header_12x4u_11";
|
|
@@ -70842,110 +70851,6 @@ const UnitTable = ({
|
|
|
70842
70851
|
}
|
|
70843
70852
|
);
|
|
70844
70853
|
};
|
|
70845
|
-
const SmartUploadModal = ({
|
|
70846
|
-
visible,
|
|
70847
|
-
prompt,
|
|
70848
|
-
onCloseModal,
|
|
70849
|
-
onUpload,
|
|
70850
|
-
onComplete,
|
|
70851
|
-
onFailed,
|
|
70852
|
-
onError: onError3,
|
|
70853
|
-
width: width2,
|
|
70854
|
-
heading: heading2,
|
|
70855
|
-
dialogText,
|
|
70856
|
-
fileInputText,
|
|
70857
|
-
fileInputPlaceholder,
|
|
70858
|
-
uploadText,
|
|
70859
|
-
cancelText,
|
|
70860
|
-
testId
|
|
70861
|
-
}) => {
|
|
70862
|
-
const [file, setFile] = useState(void 0);
|
|
70863
|
-
const [isFetching, setFetching] = useState(false);
|
|
70864
|
-
useEffect(() => {
|
|
70865
|
-
setFile(void 0);
|
|
70866
|
-
}, [visible]);
|
|
70867
|
-
const handleFileChange = (event) => {
|
|
70868
|
-
if (!event.target.value)
|
|
70869
|
-
return;
|
|
70870
|
-
setFile(event.target.value);
|
|
70871
|
-
};
|
|
70872
|
-
const handleUpload = async () => {
|
|
70873
|
-
try {
|
|
70874
|
-
if (!file)
|
|
70875
|
-
return;
|
|
70876
|
-
setFetching(true);
|
|
70877
|
-
const data = await onUpload(prompt, file);
|
|
70878
|
-
setFetching(false);
|
|
70879
|
-
if (data) {
|
|
70880
|
-
onComplete(data);
|
|
70881
|
-
} else {
|
|
70882
|
-
onFailed == null ? void 0 : onFailed();
|
|
70883
|
-
}
|
|
70884
|
-
} catch (error2) {
|
|
70885
|
-
setFetching(false);
|
|
70886
|
-
onError3 == null ? void 0 : onError3(error2);
|
|
70887
|
-
}
|
|
70888
|
-
};
|
|
70889
|
-
const onConfirm = () => {
|
|
70890
|
-
handleUpload();
|
|
70891
|
-
};
|
|
70892
|
-
const onClose = () => {
|
|
70893
|
-
onCloseModal();
|
|
70894
|
-
};
|
|
70895
|
-
const content2 = /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
70896
|
-
/* @__PURE__ */ jsx(Text, { children: dialogText || "Upload file and extract data using a LLM" }),
|
|
70897
|
-
/* @__PURE__ */ jsx(Spacer, {}),
|
|
70898
|
-
/* @__PURE__ */ jsxs(Flex, { gap: "var(--padding-sm)", children: [
|
|
70899
|
-
/* @__PURE__ */ jsx(
|
|
70900
|
-
FileInput,
|
|
70901
|
-
{
|
|
70902
|
-
placeholder: fileInputPlaceholder || "No file",
|
|
70903
|
-
label: fileInputText || "Select",
|
|
70904
|
-
file: file || void 0,
|
|
70905
|
-
onChange: handleFileChange,
|
|
70906
|
-
testId: `${testId}-file-input`,
|
|
70907
|
-
accept: "image/*"
|
|
70908
|
-
}
|
|
70909
|
-
),
|
|
70910
|
-
isFetching && /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsx(Spinner$1, { dark: true }) })
|
|
70911
|
-
] })
|
|
70912
|
-
] });
|
|
70913
|
-
const footer2 = /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
70914
|
-
/* @__PURE__ */ jsx(
|
|
70915
|
-
Button$1,
|
|
70916
|
-
{
|
|
70917
|
-
label: uploadText || "Upload",
|
|
70918
|
-
colored: true,
|
|
70919
|
-
onClick: onConfirm,
|
|
70920
|
-
disabled: !file || isFetching,
|
|
70921
|
-
testId: `${testId}-button-upload`
|
|
70922
|
-
}
|
|
70923
|
-
),
|
|
70924
|
-
/* @__PURE__ */ jsx(
|
|
70925
|
-
Button$1,
|
|
70926
|
-
{
|
|
70927
|
-
label: cancelText || "Cancel",
|
|
70928
|
-
onClick: onClose,
|
|
70929
|
-
testId: `${testId}-button-cancel`
|
|
70930
|
-
}
|
|
70931
|
-
)
|
|
70932
|
-
] });
|
|
70933
|
-
useKeyboardEvent("Escape", () => onClose());
|
|
70934
|
-
return /* @__PURE__ */ jsx(Modal, { visible, centered: true, children: /* @__PURE__ */ jsx(
|
|
70935
|
-
Dialog,
|
|
70936
|
-
{
|
|
70937
|
-
dialog: {
|
|
70938
|
-
scroll: true,
|
|
70939
|
-
heading: heading2 || "Smart Upload",
|
|
70940
|
-
content: content2,
|
|
70941
|
-
footer: footer2,
|
|
70942
|
-
onClose,
|
|
70943
|
-
width: width2 || 350,
|
|
70944
|
-
testId
|
|
70945
|
-
}
|
|
70946
|
-
}
|
|
70947
|
-
) });
|
|
70948
|
-
};
|
|
70949
70854
|
export {
|
|
70950
70855
|
Accordion,
|
|
70951
70856
|
AccordionWithDefaultToggle,
|
|
@@ -71010,7 +70915,6 @@ export {
|
|
|
71010
70915
|
Select,
|
|
71011
70916
|
SideBar,
|
|
71012
70917
|
Slider,
|
|
71013
|
-
SmartUploadModal,
|
|
71014
70918
|
Spacer,
|
|
71015
70919
|
Spinner$1 as Spinner,
|
|
71016
70920
|
Table,
|