@oliasoft-open-source/react-ui-library 4.6.4-beta-1 → 4.6.4-beta-2

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.
Files changed (134) hide show
  1. package/dist/index.d.ts +21 -0
  2. package/dist/index.js +100 -0
  3. package/dist/index.js.map +1 -1
  4. package/dist/storybook/assets/Color-6VNJS4EI-iy5uGJ7u.js +1 -0
  5. package/dist/storybook/assets/DocsRenderer-NNNQARDV-AhEJPUwR.js +1 -0
  6. package/dist/storybook/assets/WithTooltip-V3YHNWJZ-YFfE9e35.js +1 -0
  7. package/dist/storybook/assets/{accordion-MRdNs3mQ.js → accordion-M-sY23Hd.js} +1 -1
  8. package/dist/storybook/assets/{accordion.stories-eynVvKyf.js → accordion.stories-nYKTmoeA.js} +2 -2
  9. package/dist/storybook/assets/{actions-fDogfeOj.js → actions-mOcj9IlF.js} +1 -1
  10. package/dist/storybook/assets/{actions.stories-Ij02T6Zm.js → actions.stories-ER0_rAT3.js} +1 -1
  11. package/dist/storybook/assets/{afe.stories-NSXn2FsI.js → afe.stories-yjkRmCqu.js} +2 -2
  12. package/dist/storybook/assets/{badge.stories-1SnkCuWB.js → badge.stories-QAHZ0hGs.js} +1 -1
  13. package/dist/storybook/assets/{blowout.stories-tBfQWj53.js → blowout.stories-fjMitjld.js} +1 -1
  14. package/dist/storybook/assets/{button-group-7WkfMawh.js → button-group-mNQThLQb.js} +1 -1
  15. package/dist/storybook/assets/{button-group.stories-WF6kt2QA.js → button-group.stories-hEWUnlpm.js} +1 -1
  16. package/dist/storybook/assets/{button-pzaoiJWP.js → button-shH4xakS.js} +1 -1
  17. package/dist/storybook/assets/{button.stories-aFz_oQmk.js → button.stories-5xHwBO1P.js} +6 -6
  18. package/dist/storybook/assets/{buttons-and-links-m2DMfQ6d.js → buttons-and-links-wdNf59Lc.js} +2 -2
  19. package/dist/storybook/assets/{card.stories-Ic_vrrzC.js → card.stories-52XKdWMP.js} +1 -1
  20. package/dist/storybook/assets/{casing-loads.stories-wpC25p9s.js → casing-loads.stories-Ilvo3kc-.js} +2 -2
  21. package/dist/storybook/assets/{cell.stories-qZxVnuW0.js → cell.stories-dk65sciA.js} +2 -2
  22. package/dist/storybook/assets/{check-box-NJDiZVo7.js → check-box-2gxosI3y.js} +1 -1
  23. package/dist/storybook/assets/{check-box.stories-kKAtDTQt.js → check-box.stories-dct4BaKG.js} +1 -1
  24. package/dist/storybook/assets/{chunk-HLWAVYOI-YFYPw14x.js → chunk-HLWAVYOI-5KO74sPP.js} +1 -1
  25. package/dist/storybook/assets/color-TbXmV_Ph.js +25 -0
  26. package/dist/storybook/assets/{column.stories-ALyFOZ14.js → column.stories-1Qq8awo0.js} +1 -1
  27. package/dist/storybook/assets/{dialog-ufJfp3xq.js → dialog-roJ8Yns6.js} +1 -1
  28. package/dist/storybook/assets/{drawer-gMi20QKY.js → drawer-GdbVQdWk.js} +1 -1
  29. package/dist/storybook/assets/{drawer.stories-Kh1oW2kc.js → drawer.stories-XWMoCncm.js} +2 -2
  30. package/dist/storybook/assets/{empty.stories-hiT2fx9j.js → empty.stories-XVXKuuiT.js} +1 -1
  31. package/dist/storybook/assets/{field-7aita7RD.js → field-FZX0Z7IB.js} +1 -1
  32. package/dist/storybook/assets/{field.stories-_h7pNWxV.js → field.stories-Quu0snQm.js} +1 -1
  33. package/dist/storybook/assets/{file-input.stories-qSazOSxT.js → file-input.stories-8w1taUk6.js} +1 -1
  34. package/dist/storybook/assets/{flex.stories-rW-o5Rcj.js → flex.stories-8HJIYv6E.js} +1 -1
  35. package/dist/storybook/assets/footer.stories-tB9ZiuYm.js +3 -0
  36. package/dist/storybook/assets/form.stories-b8fSf1KV.js +49 -0
  37. package/dist/storybook/assets/formation.stories-4zFgtvwa.js +74 -0
  38. package/dist/storybook/assets/{formatter-SWP5E3XI-OqIRNiai.js → formatter-SWP5E3XI-wfu1opC9.js} +2 -2
  39. package/dist/storybook/assets/{heading-3kLSpr0S.js → heading-jZsIIJF0.js} +1 -1
  40. package/dist/storybook/assets/{heading.stories-NFtxisSU.js → heading.stories-lW_q2VjY.js} +1 -1
  41. package/dist/storybook/assets/{help-icon-3XYXeKEh.js → help-icon-SKky6KLV.js} +1 -1
  42. package/dist/storybook/assets/{help-icon.stories-0K6YtLSE.js → help-icon.stories-i7tX8eBl.js} +1 -1
  43. package/dist/storybook/assets/icon-8EQazuuW.js +8 -0
  44. package/dist/storybook/assets/{icon.stories-2aZia1VV.js → icon.stories-j-b_Exev.js} +1 -1
  45. package/dist/storybook/assets/iframe-TnxAEFPL.js +7 -0
  46. package/dist/storybook/assets/{index-yLQnu5kb.js → index-q9WFXtCQ.js} +5 -5
  47. package/dist/storybook/assets/{index.es-HG2GUH9i.js → index.es-VXFRDikp.js} +4 -4
  48. package/dist/storybook/assets/inheritsLoose-8sb_A2v4.js +1 -0
  49. package/dist/storybook/assets/{input-group.stories-QyCAcNnA.js → input-group.stories-gJFYuvVb.js} +2 -2
  50. package/dist/storybook/assets/{input-validation-MVQxPrsh.js → input-validation-wvL0mORs.js} +2 -2
  51. package/dist/storybook/assets/{inputs-ApG_ovoh.js → inputs-nNUbso5i.js} +2 -2
  52. package/dist/storybook/assets/{label-6FmD_czQ.js → label-uCFEME1p.js} +1 -1
  53. package/dist/storybook/assets/{label.stories-HbYjo9Is.js → label.stories-LhXr4NuA.js} +1 -1
  54. package/dist/storybook/assets/layout-forms-yYtEuB-g.js +16 -0
  55. package/dist/storybook/assets/{layout-general-yr3HbuRt.js → layout-general-YHJfkzS0.js} +2 -2
  56. package/dist/storybook/assets/{list-TQiJNWcB.js → list-PShi-3TE.js} +1 -1
  57. package/dist/storybook/assets/{list.stories-xon0V98M.js → list.stories-TLnvjaYU.js} +2 -2
  58. package/dist/storybook/assets/{list.stories-data-mlf0RWWz.js → list.stories-data-Qc3oehAh.js} +1 -1
  59. package/dist/storybook/assets/{loader.stories-T7uh7_nk.js → loader.stories-xsnhGOV_.js} +1 -1
  60. package/dist/storybook/assets/{menu.stories-5yE1hCk6.js → menu.stories-ppWN2JgO.js} +6 -6
  61. package/dist/storybook/assets/{message-bbAE2zjv.js → message-CRKuTfOl.js} +1 -1
  62. package/dist/storybook/assets/{message.stories---WPc4fI.js → message.stories-N8ZGvhv2.js} +1 -1
  63. package/dist/storybook/assets/{meta-content-TSXRt1fk.js → meta-content-lUynpOsR.js} +1 -1
  64. package/dist/storybook/assets/{modal.stories-v18Wihad.js → modal.stories-dirXv4n_.js} +2 -2
  65. package/dist/storybook/assets/{number-input.stories-Ikw3ATFj.js → number-input.stories-AU1jlL6D.js} +5 -5
  66. package/dist/storybook/assets/{option-dropdown.stories-XAe4RN6O.js → option-dropdown.stories-n7CDZevX.js} +1 -1
  67. package/dist/storybook/assets/{padding-and-spacing-TCI6vSfo.js → padding-and-spacing-r_ZtBCv6.js} +2 -2
  68. package/dist/storybook/assets/{page.stories-_1ucgilf.js → page.stories-UQlnuZid.js} +1 -1
  69. package/dist/storybook/assets/{pagination-wPvEVEri.js → pagination-tnyyuMkB.js} +1 -1
  70. package/dist/storybook/assets/{pagination.stories-xcjXgU_A.js → pagination.stories-c7jbEB_j.js} +2 -2
  71. package/dist/storybook/assets/{pop-confirm.stories-4KINgWQv.js → pop-confirm.stories-kZScSFuk.js} +1 -1
  72. package/dist/storybook/assets/{popover-N2COrkjb.js → popover-cad2llTa.js} +1 -1
  73. package/dist/storybook/assets/popover.stories-1JvlWYFM.js +1 -0
  74. package/dist/storybook/assets/{preview-F50tyXZc.js → preview-0937QeI9.js} +3 -3
  75. package/dist/storybook/assets/preview-1QmXPv7x.js +7 -0
  76. package/dist/storybook/assets/projects.stories-epAPUAg1.js +47 -0
  77. package/dist/storybook/assets/{radio-button-EerSOxRw.js → radio-button-5n_38sFk.js} +1 -1
  78. package/dist/storybook/assets/{radio-button.stories-etd-hnJG.js → radio-button.stories-Z_B_oHnZ.js} +1 -1
  79. package/dist/storybook/assets/react-router-dom-EZH1n7K1.js +8 -0
  80. package/dist/storybook/assets/{reservoirs.stories-StUPBedn.js → reservoirs.stories-TKohSiCU.js} +2 -2
  81. package/dist/storybook/assets/{rich-text-input.stories-dT7BoCuX.js → rich-text-input.stories-EbjoMb2s.js} +3 -3
  82. package/dist/storybook/assets/{row.stories-hGv3oFfy.js → row.stories-p0ssjvtr.js} +2 -2
  83. package/dist/storybook/assets/select-DZdWUrCW.js +1 -0
  84. package/dist/storybook/assets/{select.stories-b4nKRzxr.js → select.stories-QOxuHSmz.js} +2 -2
  85. package/dist/storybook/assets/{side-bar-Xx8ZAqZq.js → side-bar-dRjlh2Za.js} +1 -1
  86. package/dist/storybook/assets/{side-bar.stories-SJrdRBeI.js → side-bar.stories-aKMnuHiZ.js} +1 -1
  87. package/dist/storybook/assets/{site.stories--DF2p88j.js → site.stories-Qfujz1ST.js} +2 -2
  88. package/dist/storybook/assets/slider-MN9iDCsS.js +7 -0
  89. package/dist/storybook/assets/{slider.stories-D8pQfYVa.js → slider.stories-hVrt3K9M.js} +4 -4
  90. package/dist/storybook/assets/{spacer.stories-UdEBpD2c.js → spacer.stories-Tc3LfeOH.js} +1 -1
  91. package/dist/storybook/assets/syntaxhighlighter-B5GMVT5T-TuCuVbvB.js +1 -0
  92. package/dist/storybook/assets/{table-EpoS--Q9.js → table-033R9jUC.js} +1 -1
  93. package/dist/storybook/assets/{table.stories-data-sKNV6OwY.js → table.stories-data-NfE_v-gH.js} +1 -1
  94. package/dist/storybook/assets/{table.stories-fNxSJxw4.js → table.stories-wdVWlpz1.js} +2 -2
  95. package/dist/storybook/assets/text-link.stories-Mx9ojcOC.js +14 -0
  96. package/dist/storybook/assets/{textarea-ygEac3d2.js → textarea-gwm6gdQO.js} +1 -1
  97. package/dist/storybook/assets/{textarea.stories-vr_I38NI.js → textarea.stories-eOTtHmL4.js} +1 -1
  98. package/dist/storybook/assets/{title.stories-7Dcc2YOf.js → title.stories-9QWP9XVr.js} +3 -3
  99. package/dist/storybook/assets/{toaster-IL_npIpU.js → toaster-yPcd4ELJ.js} +1 -1
  100. package/dist/storybook/assets/{toaster.stories-6e51I0Du.js → toaster.stories-D_1FY8OT.js} +1 -1
  101. package/dist/storybook/assets/{toggle-Eh66Nfd8.js → toggle-M_66MP8X.js} +1 -1
  102. package/dist/storybook/assets/{toggle.stories-Oq6meHwx.js → toggle.stories-VfPLoUW1.js} +1 -1
  103. package/dist/storybook/assets/{tooltip.test-case.stories-b7Y7bdNN.js → tooltip.test-case.stories-g9fe1-Ut.js} +1 -1
  104. package/dist/storybook/assets/{top-bar-9ZpEs04T.js → top-bar-ywJJBf-H.js} +1 -1
  105. package/dist/storybook/assets/top-bar.stories-KkBPu_h3.js +21 -0
  106. package/dist/storybook/assets/{top-bar.testcase.stories-3nLi_qFY.js → top-bar.testcase.stories-RJkl6c8Z.js} +1 -1
  107. package/dist/storybook/assets/{tree.stories-fMDywk_b.js → tree.stories-UiERA8eJ.js} +1 -1
  108. package/dist/storybook/assets/{unit-input.stories-cxQ7uyAF.js → unit-input.stories-NxlXJaPc.js} +1 -1
  109. package/dist/storybook/assets/unit-table.stories-lZ4MjpDy.js +108 -0
  110. package/dist/storybook/iframe.html +1 -1
  111. package/dist/storybook/project.json +1 -1
  112. package/package.json +1 -1
  113. package/dist/storybook/assets/Color-6VNJS4EI-WZ_HKCgl.js +0 -1
  114. package/dist/storybook/assets/DocsRenderer-NNNQARDV-rqsuPIAO.js +0 -1
  115. package/dist/storybook/assets/WithTooltip-V3YHNWJZ-utzAQypy.js +0 -1
  116. package/dist/storybook/assets/color-r6CJ7pH9.js +0 -25
  117. package/dist/storybook/assets/extends-dGVwEr9R.js +0 -1
  118. package/dist/storybook/assets/footer.stories-FVGMsLNB.js +0 -3
  119. package/dist/storybook/assets/form.stories-z-fXsPFv.js +0 -49
  120. package/dist/storybook/assets/formation.stories-roJBHiB1.js +0 -74
  121. package/dist/storybook/assets/icon-_m67DAr0.js +0 -8
  122. package/dist/storybook/assets/iframe-Ay-EsUFI.js +0 -7
  123. package/dist/storybook/assets/inheritsLoose-Y9jOMJLd.js +0 -1
  124. package/dist/storybook/assets/layout-forms-Dw8El9Nm.js +0 -16
  125. package/dist/storybook/assets/popover.stories--H0KsGLL.js +0 -1
  126. package/dist/storybook/assets/preview-VfTY8dMN.js +0 -7
  127. package/dist/storybook/assets/projects.stories-hNrjUb-q.js +0 -47
  128. package/dist/storybook/assets/react-router-dom-4Z66xYqZ.js +0 -8
  129. package/dist/storybook/assets/select-dsCIcV9L.js +0 -1
  130. package/dist/storybook/assets/slider-t3xH-fl7.js +0 -7
  131. package/dist/storybook/assets/syntaxhighlighter-B5GMVT5T-cORwPp89.js +0 -1
  132. package/dist/storybook/assets/text-link.stories-Plmiu8NV.js +0 -14
  133. package/dist/storybook/assets/top-bar.stories-R_1_eyqR.js +0 -21
  134. package/dist/storybook/assets/unit-table.stories-lFLBZ-2X.js +0 -108
package/dist/index.d.ts CHANGED
@@ -1665,6 +1665,8 @@ 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, onComplete, onError, onUpload, width, heading, dialogText, fileInputText, fileInputPlaceholder, uploadText, cancelText, testId, }: TSmartUploadModalProps) => JSX_2.Element;
1669
+
1668
1670
  export declare const Spacer: ({ height, width, flex, }: ISpacerProps) => JSX_2.Element;
1669
1671
 
1670
1672
  export declare const Spinner: ({ small, colored, dark, tiny, }: ISpinnerProps) => JSX_2.Element;
@@ -1800,6 +1802,25 @@ declare type TSliderMark = {
1800
1802
  tooltip?: number | string | ReactNode;
1801
1803
  };
1802
1804
 
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
+ onError?: (error: any) => void;
1814
+ width?: number;
1815
+ heading?: string;
1816
+ dialogText?: string;
1817
+ fileInputText?: string;
1818
+ fileInputPlaceholder?: string;
1819
+ uploadText?: string;
1820
+ cancelText?: string;
1821
+ testId?: string;
1822
+ };
1823
+
1803
1824
  declare type TStringNumberNull = string | number | null;
1804
1825
 
1805
1826
  declare type TStringOrNumber = string | number;
package/dist/index.js CHANGED
@@ -70842,6 +70842,105 @@ const UnitTable = ({
70842
70842
  }
70843
70843
  );
70844
70844
  };
70845
+ const SmartUploadModal = ({
70846
+ visible,
70847
+ prompt,
70848
+ onCloseModal,
70849
+ onComplete,
70850
+ onError: onError3,
70851
+ onUpload,
70852
+ width: width2,
70853
+ heading: heading2,
70854
+ dialogText,
70855
+ fileInputText,
70856
+ fileInputPlaceholder,
70857
+ uploadText,
70858
+ cancelText,
70859
+ testId
70860
+ }) => {
70861
+ const [file, setFile] = useState(void 0);
70862
+ const [isFetching, setFetching] = useState(false);
70863
+ useEffect(() => {
70864
+ setFile(void 0);
70865
+ }, [visible]);
70866
+ const handleFileChange = (event) => {
70867
+ setFile(event.target.value);
70868
+ };
70869
+ const handleUpload = async () => {
70870
+ try {
70871
+ if (!file)
70872
+ return;
70873
+ setFetching(true);
70874
+ const data = await onUpload(prompt, file);
70875
+ setFetching(false);
70876
+ if (data) {
70877
+ onComplete(data);
70878
+ }
70879
+ } catch (error2) {
70880
+ setFetching(false);
70881
+ onError3 == null ? void 0 : onError3(error2);
70882
+ }
70883
+ };
70884
+ const onConfirm = () => {
70885
+ handleUpload();
70886
+ };
70887
+ const onClose = () => {
70888
+ onCloseModal();
70889
+ };
70890
+ const content2 = /* @__PURE__ */ jsxs(Fragment$1, { children: [
70891
+ /* @__PURE__ */ jsx(Text, { children: dialogText || "Upload file and extract data using a LLM" }),
70892
+ /* @__PURE__ */ jsx(Spacer, {}),
70893
+ /* @__PURE__ */ jsxs(Flex, { gap: "var(--padding-sm)", children: [
70894
+ /* @__PURE__ */ jsx(
70895
+ FileInput,
70896
+ {
70897
+ placeholder: fileInputPlaceholder || "No file",
70898
+ label: fileInputText || "Select",
70899
+ file: file || void 0,
70900
+ onChange: handleFileChange,
70901
+ testId: `${testId}-file-input`,
70902
+ accept: "image/*"
70903
+ }
70904
+ ),
70905
+ isFetching && /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsx(Spinner$1, { dark: true }) })
70906
+ ] })
70907
+ ] });
70908
+ const footer2 = /* @__PURE__ */ jsxs(Fragment$1, { children: [
70909
+ /* @__PURE__ */ jsx(
70910
+ Button$1,
70911
+ {
70912
+ label: uploadText || "Upload",
70913
+ colored: true,
70914
+ onClick: onConfirm,
70915
+ disabled: !file || isFetching,
70916
+ testId: `${testId}-button-upload`
70917
+ }
70918
+ ),
70919
+ /* @__PURE__ */ jsx(
70920
+ Button$1,
70921
+ {
70922
+ label: cancelText || "Cancel",
70923
+ onClick: onClose,
70924
+ testId: `${testId}-button-cancel`
70925
+ }
70926
+ )
70927
+ ] });
70928
+ useKeyboardEvent("Escape", () => onClose());
70929
+ return /* @__PURE__ */ jsx(Modal, { visible, centered: true, children: /* @__PURE__ */ jsx(
70930
+ Dialog,
70931
+ {
70932
+ dialog: {
70933
+ scroll: true,
70934
+ heading: heading2 || "Smart Upload",
70935
+ content: content2,
70936
+ footer: footer2,
70937
+ onClose,
70938
+ width: width2 || 350,
70939
+ testId
70940
+ }
70941
+ }
70942
+ ) });
70943
+ };
70845
70944
  export {
70846
70945
  Accordion,
70847
70946
  AccordionWithDefaultToggle,
@@ -70906,6 +71005,7 @@ export {
70906
71005
  Select,
70907
71006
  SideBar,
70908
71007
  Slider,
71008
+ SmartUploadModal,
70909
71009
  Spacer,
70910
71010
  Spinner$1 as Spinner,
70911
71011
  Table,