@oliasoft-open-source/react-ui-library 4.7.2 → 4.7.3-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 (79) hide show
  1. package/dist/index.d.ts +5 -1
  2. package/dist/index.js +34 -4
  3. package/dist/index.js.map +1 -1
  4. package/dist/storybook/assets/{Color-KGDBMAHA-q-P5APaO.js → Color-KGDBMAHA-BDaGFyls.js} +1 -1
  5. package/dist/storybook/assets/{DocsRenderer-PKQXORMH-D3Cy2r_Z.js → DocsRenderer-PKQXORMH-DeAerz72.js} +1 -1
  6. package/dist/storybook/assets/{accordion.stories-sb-Y7MMb.js → accordion.stories-Beb4y7rL.js} +1 -1
  7. package/dist/storybook/assets/{afe.stories--E_j7kET.js → afe.stories-WJoC6FVV.js} +1 -1
  8. package/dist/storybook/assets/{buttons-and-links-caWZb4X6.js → buttons-and-links-GWWpybLw.js} +1 -1
  9. package/dist/storybook/assets/{casing-loads.stories-EZlP6XsN.js → casing-loads.stories-DeIAdq5K.js} +1 -1
  10. package/dist/storybook/assets/{cell.stories-D9KrTmCA.js → cell.stories-DZKcKOIi.js} +1 -1
  11. package/dist/storybook/assets/check-box.stories-Dqopb7XV.js +126 -0
  12. package/dist/storybook/assets/{chunk-HLWAVYOI-PihY4p8L.js → chunk-HLWAVYOI-rY5YQOb2.js} +1 -1
  13. package/dist/storybook/assets/{color-DVJ4PKqw.js → color-lBkUm7cb.js} +1 -1
  14. package/dist/storybook/assets/dialog-dXhT3sJF.js +1 -0
  15. package/dist/storybook/assets/{file-input.stories-aiTQE5UN.js → file-input.stories-CJLU_nqW.js} +1 -1
  16. package/dist/storybook/assets/{footer.stories-B5zvZawz.js → footer.stories-BlfgJYnF.js} +1 -1
  17. package/dist/storybook/assets/{form.stories-D58sdhOk.js → form.stories-RD2lXS5Q.js} +1 -1
  18. package/dist/storybook/assets/{formation.stories-OtA8Hcp6.js → formation.stories-BC2p8tEp.js} +1 -1
  19. package/dist/storybook/assets/iframe-D9Shj_Nm.js +2 -0
  20. package/dist/storybook/assets/{index-W0dVTpIv.js → index-4gO9mIeA.js} +4 -4
  21. package/dist/storybook/assets/index-Be0hXiyp.js +179 -0
  22. package/dist/storybook/assets/index-CF7H4eMJ.js +28 -0
  23. package/dist/storybook/assets/{index-Br4CWgtc.js → index-NK2Pj-Tv.js} +1 -1
  24. package/dist/storybook/assets/{input-group.stories-hHCmTbtu.js → input-group.stories-Dtak6Me2.js} +1 -1
  25. package/dist/storybook/assets/{input-validation-CbAszrvQ.js → input-validation-wltu7rhx.js} +2 -2
  26. package/dist/storybook/assets/{inputs-BcVLXteo.js → inputs-Bsfja93s.js} +4 -4
  27. package/dist/storybook/assets/{layout-forms-l-XDMkfI.js → layout-forms-Bf7y_Hym.js} +1 -1
  28. package/dist/storybook/assets/{layout-general-DL0Q90Ai.js → layout-general-DJOJ7Xv5.js} +1 -1
  29. package/dist/storybook/assets/menu.stories-BD7P2iMQ.js +84 -0
  30. package/dist/storybook/assets/message-BYzRg8Ae.js +1 -0
  31. package/dist/storybook/assets/{message.stories-CXOrrAOR.js → message.stories-B02RIMXw.js} +1 -1
  32. package/dist/storybook/assets/modal.stories-l76yG1FY.js +228 -0
  33. package/dist/storybook/assets/number-input.stories-CmgIvuEY.js +105 -0
  34. package/dist/storybook/assets/{padding-and-spacing-B2-WaM9r.js → padding-and-spacing-BnOF4Ueu.js} +1 -1
  35. package/dist/storybook/assets/{pagination-0wY_w1xz.js → pagination-DRdJ9LGH.js} +1 -1
  36. package/dist/storybook/assets/{pagination.stories-BagAIIz3.js → pagination.stories-C_4kzgcf.js} +1 -1
  37. package/dist/storybook/assets/{pop-confirm.stories-D4L3erpj.js → pop-confirm.stories-Dlm0BaMY.js} +1 -1
  38. package/dist/storybook/assets/{popover.stories-ChwzGOlc.js → popover.stories-D6_Ulo0d.js} +1 -1
  39. package/dist/storybook/assets/preview-DLBQXbKW.js +1 -0
  40. package/dist/storybook/assets/{preview-Duk5kU8o.js → preview-DtaSOELl.js} +1 -1
  41. package/dist/storybook/assets/{preview-Eh31roT5.js → preview-Dyti8xUp.js} +2 -2
  42. package/dist/storybook/assets/radio-button.stories-Ds-DfLlj.js +71 -0
  43. package/dist/storybook/assets/{reservoirs.stories-DywuU8EY.js → reservoirs.stories-BUs7WSxB.js} +1 -1
  44. package/dist/storybook/assets/{rich-text-input.stories-Cw_6EJx8.js → rich-text-input.stories-BP79IJ53.js} +1 -1
  45. package/dist/storybook/assets/{row.stories-D7V0fxhq.js → row.stories-CIJowbkv.js} +1 -1
  46. package/dist/storybook/assets/select-BeEJzL_0.js +40 -0
  47. package/dist/storybook/assets/select.stories-DgC9Agq6.js +579 -0
  48. package/dist/storybook/assets/{smart-upload-modal.stories-Cot88l9r.js → smart-upload-modal.stories-PeStvjoa.js} +1 -1
  49. package/dist/storybook/assets/{table-DmwpXp_Q.js → table-B7Ro6zGB.js} +1 -1
  50. package/dist/storybook/assets/{table.stories-DKcZk5JR.js → table.stories-1mHu1R2T.js} +1 -1
  51. package/dist/storybook/assets/{title.stories-CKbl0CB2.js → title.stories-CcK2ZS1r.js} +1 -1
  52. package/dist/storybook/assets/toaster-BNO0suPv.js +1 -0
  53. package/dist/storybook/assets/toaster.stories-DYw4Syxn.js +89 -0
  54. package/dist/storybook/assets/toggle.stories-DKENe2T9.js +141 -0
  55. package/dist/storybook/assets/{unit-input.stories-RF3UHFxA.js → unit-input.stories-BdhJ50Pr.js} +1 -1
  56. package/dist/storybook/assets/{unit-table.stories-BoNWlaAe.js → unit-table.stories-_Z6tTx-x.js} +1 -1
  57. package/dist/storybook/iframe.html +1 -1
  58. package/dist/storybook/index.html +6 -2
  59. package/dist/storybook/index.json +1 -1
  60. package/dist/storybook/project.json +1 -1
  61. package/dist/storybook/sb-addons/interactions-2/manager-bundle.js +233 -0
  62. package/dist/storybook/sb-addons/storybook-dark-mode-esm-preset-3/manager-bundle.js.LEGAL.txt +0 -0
  63. package/package.json +1 -1
  64. package/dist/404.html +0 -1
  65. package/dist/storybook/assets/check-box.stories-Do-GOmLf.js +0 -102
  66. package/dist/storybook/assets/dialog-B-R6eAnf.js +0 -1
  67. package/dist/storybook/assets/iframe-MGOUznuN.js +0 -2
  68. package/dist/storybook/assets/menu.stories-Bc2kf356.js +0 -82
  69. package/dist/storybook/assets/message-ZenLdkrf.js +0 -1
  70. package/dist/storybook/assets/modal.stories-ChRLG9ud.js +0 -200
  71. package/dist/storybook/assets/number-input.stories-COWyMRAs.js +0 -97
  72. package/dist/storybook/assets/radio-button.stories-BFp_qyyE.js +0 -61
  73. package/dist/storybook/assets/select-yqiMF9-4.js +0 -40
  74. package/dist/storybook/assets/select.stories-VMcOn7Ri.js +0 -914
  75. package/dist/storybook/assets/toaster-B8A3xIYu.js +0 -1
  76. package/dist/storybook/assets/toaster.stories-DuE6vvV6.js +0 -86
  77. package/dist/storybook/assets/toggle.stories-Cre2gnIB.js +0 -117
  78. /package/dist/storybook/sb-addons/{storybook-dark-mode-esm-preset-2 → interactions-2}/manager-bundle.js.LEGAL.txt +0 -0
  79. /package/dist/storybook/sb-addons/{storybook-dark-mode-esm-preset-2 → storybook-dark-mode-esm-preset-3}/manager-bundle.js +0 -0
package/dist/index.d.ts CHANGED
@@ -866,6 +866,8 @@ export declare interface INativeSelectProps {
866
866
  maxTooltipWidth?: TStringOrNumber;
867
867
  }
868
868
 
869
+ export declare const initializeContext: (value: UnitContextType) => void;
870
+
869
871
  export declare const Input: default_2.ForwardRefExoticComponent<IInputProps & default_2.RefAttributes<HTMLInputElement>>;
870
872
 
871
873
  export declare const InputGroup: ({ children, small, width, }: IInputGroupProps) => ReactElement;
@@ -1852,7 +1854,9 @@ export declare type TTriggerType = 'Text' | 'Button' | 'DropDownButton' | 'Compo
1852
1854
 
1853
1855
  declare type TUnitTableCellShape = TCellShape | IUnitTableStaticCell | IUnitTableInputCell | IUnitTableNumberInputCell;
1854
1856
 
1855
- export declare const UnitInput: ({ name, placeholder, disabled, disabledUnit, error, left, small, width, value, unitkey, initUnit, noConversion, onChange, onClick, onFocus, onSwitchUnit, unitTemplate, doNotConvertValue, testId, warning, predefinedOptions, initialPredefinedOption, shouldLinkAutomaticly, selectedPredefinedOptionKey, validationCallback, disabledValidation, allowEmpty, autoValue, }: IUnitInputProps) => JSX_2.Element;
1857
+ declare type UnitContextType = any;
1858
+
1859
+ export declare const UnitInput: default_2.FC<IUnitInputProps>;
1856
1860
 
1857
1861
  export declare const UnitTable: ({ table, unitConfig, convertBackToStorageUnit, enableCosmeticRounding, enableDisplayRounding, }: IUnitTableProps) => JSX_2.Element;
1858
1862
 
package/dist/index.js CHANGED
@@ -70024,12 +70024,15 @@ const usePrevious = (value) => {
70024
70024
  };
70025
70025
  const getPreferredUnit = (unitkey, unitTemplate) => {
70026
70026
  const preferredUnit = unitTemplate == null ? void 0 : unitTemplate[unitkey];
70027
+ console.log(unitTemplate, unitTemplate);
70028
+ console.log("unitTemplate?.[unitkey]", unitTemplate == null ? void 0 : unitTemplate[unitkey]);
70027
70029
  if (!preferredUnit) {
70028
70030
  console.log(
70029
- `Warning: 'unitTemplate' does not define a preferred unit for '${unitkey}'. Defaulting to standard unit.`
70031
+ `Warning: 'unitTemplate' missing for '${unitkey}'. Using initial unit, value unit, or default.`
70030
70032
  );
70031
70033
  return unitFromQuantity(unitkey) ?? "";
70032
70034
  }
70035
+ console.log("preferredUnit", preferredUnit);
70033
70036
  return preferredUnit;
70034
70037
  };
70035
70038
  var PredefinedOptionsMenuState = /* @__PURE__ */ ((PredefinedOptionsMenuState2) => {
@@ -70124,11 +70127,33 @@ const isKnownUnit = (valueWithUnit, defaultUnit) => {
70124
70127
  const unitFromValue = getUnit(valueWithUnit || "");
70125
70128
  return isUnitKnown(defaultUnit) && isUnitKnown(unitFromValue);
70126
70129
  };
70130
+ const UnitContext = createContext(null);
70131
+ const UnitContextProvider = ({ children, value }) => {
70132
+ return /* @__PURE__ */ jsx(UnitContext.Provider, { value, children });
70133
+ };
70134
+ const useUnitContext = () => {
70135
+ return useContext(UnitContext);
70136
+ };
70137
+ let isInitialized = false;
70138
+ let providedValue = null;
70139
+ const initializeContext = (value) => {
70140
+ if (!isInitialized) {
70141
+ providedValue = value;
70142
+ isInitialized = true;
70143
+ }
70144
+ };
70145
+ const WithUnitContext = (Component2) => (props) => {
70146
+ if (!isInitialized) {
70147
+ console.log("Context not initialized. Call initializeContext first.");
70148
+ return /* @__PURE__ */ jsx(Component2, { ...props });
70149
+ }
70150
+ return /* @__PURE__ */ jsx(UnitContextProvider, { value: providedValue, children: /* @__PURE__ */ jsx(Component2, { ...props }) });
70151
+ };
70127
70152
  const predefinedMenuActive = "_predefinedMenuActive_1yvt4_1";
70128
70153
  const styles = {
70129
70154
  predefinedMenuActive
70130
70155
  };
70131
- const UnitInput = ({
70156
+ const UnitInputComponent = ({
70132
70157
  name: name2,
70133
70158
  placeholder: placeholder3 = "",
70134
70159
  disabled: disabled2 = false,
@@ -70149,7 +70174,7 @@ const UnitInput = ({
70149
70174
  },
70150
70175
  onSwitchUnit = () => {
70151
70176
  },
70152
- unitTemplate,
70177
+ unitTemplate: externalUnitTemplate,
70153
70178
  doNotConvertValue = false,
70154
70179
  testId,
70155
70180
  warning: warning2 = null,
@@ -70162,6 +70187,9 @@ const UnitInput = ({
70162
70187
  allowEmpty = false,
70163
70188
  autoValue
70164
70189
  }) => {
70190
+ const context2 = useUnitContext();
70191
+ const unitTemplate = externalUnitTemplate ?? (context2 == null ? void 0 : context2.unitTemplate);
70192
+ console.log("context in component ->>>>", context2);
70165
70193
  if (typeof value === "number") {
70166
70194
  value = `${value}`;
70167
70195
  }
@@ -70173,7 +70201,7 @@ const UnitInput = ({
70173
70201
  [unitkey, unitTemplate]
70174
70202
  );
70175
70203
  const knownUnit = isKnownUnit(value, defaultUnit);
70176
- const initDisplayUnit = initUnit || defaultUnit || propUnit;
70204
+ const initDisplayUnit = initUnit || propUnit || defaultUnit;
70177
70205
  const previousInitUnit = usePrevious(initDisplayUnit);
70178
70206
  const convertedValue = safeConvertValue(
70179
70207
  value,
@@ -70448,6 +70476,7 @@ const UnitInput = ({
70448
70476
  }
70449
70477
  );
70450
70478
  };
70479
+ const UnitInput = WithUnitContext(UnitInputComponent);
70451
70480
  const normalizeUnits = (unitConfig) => unitConfig.reduce(
70452
70481
  ({ preferredUnits, storageUnits }, { unitKey, preferredUnit, storageUnit }) => {
70453
70482
  preferredUnits[unitKey] = preferredUnit;
@@ -70842,6 +70871,7 @@ export {
70842
70871
  UnitInput,
70843
70872
  UnitTable,
70844
70873
  dismissToast,
70874
+ initializeContext,
70845
70875
  readFile,
70846
70876
  toast,
70847
70877
  useFocus,