@oliasoft-open-source/react-ui-library 4.7.2-beta-7 → 4.7.2-beta-9

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 (25) hide show
  1. package/dist/assets/{index-zmbFJmOv.js → index-D5kcnHmD.js} +182 -702
  2. package/dist/assets/{index-gESxyZjr.css → index-Oe0PlEED.css} +0 -35
  3. package/dist/index.d.ts +1 -5
  4. package/dist/index.html +1 -1
  5. package/dist/index.js +3 -26
  6. package/dist/index.js.map +1 -1
  7. package/dist/storybook/assets/{Color-KGDBMAHA-Cvq3XQg3.js → Color-KGDBMAHA-q-P5APaO.js} +1 -1
  8. package/dist/storybook/assets/{DocsRenderer-PKQXORMH-Copxu6Si.js → DocsRenderer-PKQXORMH-D3Cy2r_Z.js} +1 -1
  9. package/dist/storybook/assets/{buttons-and-links-BHLN948A.js → buttons-and-links-caWZb4X6.js} +1 -1
  10. package/dist/storybook/assets/{chunk-HLWAVYOI-C3Nc_Hl_.js → chunk-HLWAVYOI-PihY4p8L.js} +1 -1
  11. package/dist/storybook/assets/{color-ClG_lSfj.js → color-DVJ4PKqw.js} +1 -1
  12. package/dist/storybook/assets/{iframe-ud1XJtGn.js → iframe-MGOUznuN.js} +2 -2
  13. package/dist/storybook/assets/{index-q5GJvRDd.js → index-Br4CWgtc.js} +1 -1
  14. package/dist/storybook/assets/{index-BwF95xBr.js → index-W0dVTpIv.js} +4 -4
  15. package/dist/storybook/assets/{input-validation-CvKyplhN.js → input-validation-CbAszrvQ.js} +1 -1
  16. package/dist/storybook/assets/{inputs-DhUf5Lzj.js → inputs-BcVLXteo.js} +1 -1
  17. package/dist/storybook/assets/{layout-forms-NapA4Ibs.js → layout-forms-l-XDMkfI.js} +1 -1
  18. package/dist/storybook/assets/{layout-general-CnLft8nK.js → layout-general-DL0Q90Ai.js} +1 -1
  19. package/dist/storybook/assets/{padding-and-spacing-J82LpJ4b.js → padding-and-spacing-B2-WaM9r.js} +1 -1
  20. package/dist/storybook/assets/{preview-CM5CE7B2.js → preview-Duk5kU8o.js} +1 -1
  21. package/dist/storybook/assets/{preview-CJK2YTz-.js → preview-Eh31roT5.js} +2 -2
  22. package/dist/storybook/assets/{unit-input.stories-BzMia-WR.js → unit-input.stories-RF3UHFxA.js} +31 -31
  23. package/dist/storybook/iframe.html +1 -1
  24. package/dist/storybook/project.json +1 -1
  25. package/package.json +4 -1
@@ -1,4 +1,4 @@
1
- import{j as e}from"./jsx-runtime-eps93zm2.js";import{useMDXComponents as r}from"./index-BcNHZKhG.js";import{Z as s,$ as n}from"./index-BwF95xBr.js";import{NonExistentValue as a,Error as l}from"./select.stories-VMcOn7Ri.js";import"./index-DhsZuJvc.js";import"./iframe-ud1XJtGn.js";import"../sb-preview/runtime.js";import"./index-CUZDtIZe.js";import"./inheritsLoose-DP0QEDDI.js";import"./assertThisInitialized-B9jnkVVz.js";import"./index-D6rZ4wEC.js";import"./select-yqiMF9-4.js";import"./index-Bk2sglWO.js";import"./common-types-Sih75Sav.js";import"./disabled-context-rmpd7YJS.js";import"./types-UmZ4Y_CR.js";import"./lodash-BHd_uQHh.js";import"./tooltip-C_E_6ym5.js";import"./index-CEuq6vkz.js";import"./memoize-one.esm-CcMeOnPo.js";import"./types-BmbYqTX_.js";import"./text-B3-TSWok.js";import"./actions-4w-EOz3m.js";import"./button-CdEIDAx8.js";import"./spinner-AWUe4xwQ.js";import"./icon-BSFY3vDO.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./badge-CLQ59MDF.js";import"./select.input-DIKP56UZ.js";import"./spacer-BWoNR27H.js";function o(t){const i={code:"code",h1:"h1",h2:"h2",h3:"h3",p:"p",strong:"strong",...r(),...t.components};return e.jsxs(e.Fragment,{children:[e.jsx(s,{title:"Input Validation"}),`
1
+ import{j as e}from"./jsx-runtime-eps93zm2.js";import{useMDXComponents as r}from"./index-BcNHZKhG.js";import{Z as s,$ as n}from"./index-W0dVTpIv.js";import{NonExistentValue as a,Error as l}from"./select.stories-VMcOn7Ri.js";import"./index-DhsZuJvc.js";import"./iframe-MGOUznuN.js";import"../sb-preview/runtime.js";import"./index-CUZDtIZe.js";import"./inheritsLoose-DP0QEDDI.js";import"./assertThisInitialized-B9jnkVVz.js";import"./index-D6rZ4wEC.js";import"./select-yqiMF9-4.js";import"./index-Bk2sglWO.js";import"./common-types-Sih75Sav.js";import"./disabled-context-rmpd7YJS.js";import"./types-UmZ4Y_CR.js";import"./lodash-BHd_uQHh.js";import"./tooltip-C_E_6ym5.js";import"./index-CEuq6vkz.js";import"./memoize-one.esm-CcMeOnPo.js";import"./types-BmbYqTX_.js";import"./text-B3-TSWok.js";import"./actions-4w-EOz3m.js";import"./button-CdEIDAx8.js";import"./spinner-AWUe4xwQ.js";import"./icon-BSFY3vDO.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./badge-CLQ59MDF.js";import"./select.input-DIKP56UZ.js";import"./spacer-BWoNR27H.js";function o(t){const i={code:"code",h1:"h1",h2:"h2",h3:"h3",p:"p",strong:"strong",...r(),...t.components};return e.jsxs(e.Fragment,{children:[e.jsx(s,{title:"Input Validation"}),`
2
2
  `,e.jsx(i.h1,{id:"input-validation",children:"Input Validation"}),`
3
3
  `,e.jsx(i.h2,{id:"select",children:"Select"}),`
4
4
  `,e.jsx(i.h3,{id:"invalid-states",children:"Invalid states"}),`
@@ -1,4 +1,4 @@
1
- import{j as e}from"./jsx-runtime-eps93zm2.js";import{useMDXComponents as s}from"./index-BcNHZKhG.js";import{Z as r,$ as o}from"./index-BwF95xBr.js";import{Default as l}from"./button.stories-CHt71NKu.js";import{Default as a}from"./check-box.stories-Do-GOmLf.js";import{Default as c}from"./file-input.stories-aiTQE5UN.js";import{Default as d,Date as p}from"./input.stories-BHdUwYqV.js";import{Default as h}from"./number-input.stories-COWyMRAs.js";import{Default as u}from"./option-dropdown.stories-DvgAgTHQ.js";import{Default as m}from"./radio-button.stories-BFp_qyyE.js";import{Native as f,Default as x}from"./select.stories-VMcOn7Ri.js";import{Default as j}from"./slider.stories-DdVxUAfH.js";import{Default as b}from"./textarea.stories-CKm5MlQF.js";import{Default as g}from"./toggle.stories-Cre2gnIB.js";import"./index-DhsZuJvc.js";import"./iframe-ud1XJtGn.js";import"../sb-preview/runtime.js";import"./index-CUZDtIZe.js";import"./inheritsLoose-DP0QEDDI.js";import"./assertThisInitialized-B9jnkVVz.js";import"./index-D6rZ4wEC.js";import"./react-router-dom-Ck2Y_Fzc.js";import"./index-CEuq6vkz.js";import"./tiny-invariant-DqLgxztJ.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./flex-EllkLxgO.js";import"./button-CdEIDAx8.js";import"./index-Bk2sglWO.js";import"./common-types-Sih75Sav.js";import"./disabled-context-rmpd7YJS.js";import"./spinner-AWUe4xwQ.js";import"./icon-BSFY3vDO.js";import"./tooltip-C_E_6ym5.js";import"./check-box-2fHPdAZG.js";import"./help-icon-CfV3_Ais.js";import"./file-input-Amcc9o5I.js";import"./input-group-BaRSJAEN.js";import"./input-D97ganXq.js";import"./types-UmZ4Y_CR.js";import"./lodash-BHd_uQHh.js";import"./spacer-BWoNR27H.js";import"./message-ZenLdkrf.js";import"./textarea-DOJDK8hI.js";import"./index-DQs5XS8h.js";import"./index-DRSy5Ssd.js";import"./number-input-B-Nmya5O.js";import"./input-group-addon-D68iUKV2.js";import"./select-yqiMF9-4.js";import"./memoize-one.esm-CcMeOnPo.js";import"./types-BmbYqTX_.js";import"./text-B3-TSWok.js";import"./actions-4w-EOz3m.js";import"./badge-CLQ59MDF.js";import"./select.input-DIKP56UZ.js";import"./divider-DY9nJ_7N.js";import"./radio-button-J4oEQdxt.js";import"./slider-BLU39INk.js";import"./objectSpread2-DW4nTBoq.js";import"./index-BI4_Bp97.js";import"./toggle-D0yzyALV.js";function i(n){const t={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",strong:"strong",ul:"ul",...s(),...n.components};return e.jsxs(e.Fragment,{children:[e.jsx(r,{title:"Inputs"}),`
1
+ import{j as e}from"./jsx-runtime-eps93zm2.js";import{useMDXComponents as s}from"./index-BcNHZKhG.js";import{Z as r,$ as o}from"./index-W0dVTpIv.js";import{Default as l}from"./button.stories-CHt71NKu.js";import{Default as a}from"./check-box.stories-Do-GOmLf.js";import{Default as c}from"./file-input.stories-aiTQE5UN.js";import{Default as d,Date as p}from"./input.stories-BHdUwYqV.js";import{Default as h}from"./number-input.stories-COWyMRAs.js";import{Default as u}from"./option-dropdown.stories-DvgAgTHQ.js";import{Default as m}from"./radio-button.stories-BFp_qyyE.js";import{Native as f,Default as x}from"./select.stories-VMcOn7Ri.js";import{Default as j}from"./slider.stories-DdVxUAfH.js";import{Default as b}from"./textarea.stories-CKm5MlQF.js";import{Default as g}from"./toggle.stories-Cre2gnIB.js";import"./index-DhsZuJvc.js";import"./iframe-MGOUznuN.js";import"../sb-preview/runtime.js";import"./index-CUZDtIZe.js";import"./inheritsLoose-DP0QEDDI.js";import"./assertThisInitialized-B9jnkVVz.js";import"./index-D6rZ4wEC.js";import"./react-router-dom-Ck2Y_Fzc.js";import"./index-CEuq6vkz.js";import"./tiny-invariant-DqLgxztJ.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./flex-EllkLxgO.js";import"./button-CdEIDAx8.js";import"./index-Bk2sglWO.js";import"./common-types-Sih75Sav.js";import"./disabled-context-rmpd7YJS.js";import"./spinner-AWUe4xwQ.js";import"./icon-BSFY3vDO.js";import"./tooltip-C_E_6ym5.js";import"./check-box-2fHPdAZG.js";import"./help-icon-CfV3_Ais.js";import"./file-input-Amcc9o5I.js";import"./input-group-BaRSJAEN.js";import"./input-D97ganXq.js";import"./types-UmZ4Y_CR.js";import"./lodash-BHd_uQHh.js";import"./spacer-BWoNR27H.js";import"./message-ZenLdkrf.js";import"./textarea-DOJDK8hI.js";import"./index-DQs5XS8h.js";import"./index-DRSy5Ssd.js";import"./number-input-B-Nmya5O.js";import"./input-group-addon-D68iUKV2.js";import"./select-yqiMF9-4.js";import"./memoize-one.esm-CcMeOnPo.js";import"./types-BmbYqTX_.js";import"./text-B3-TSWok.js";import"./actions-4w-EOz3m.js";import"./badge-CLQ59MDF.js";import"./select.input-DIKP56UZ.js";import"./divider-DY9nJ_7N.js";import"./radio-button-J4oEQdxt.js";import"./slider-BLU39INk.js";import"./objectSpread2-DW4nTBoq.js";import"./index-BI4_Bp97.js";import"./toggle-D0yzyALV.js";function i(n){const t={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",strong:"strong",ul:"ul",...s(),...n.components};return e.jsxs(e.Fragment,{children:[e.jsx(r,{title:"Inputs"}),`
2
2
  `,e.jsx(t.h1,{id:"inputs",children:"Inputs"}),`
3
3
  `,e.jsx(t.p,{children:"React UI Library provides a comprehensive set of user input components."}),`
4
4
  `,e.jsx(t.h2,{id:"button",children:"Button"}),`
@@ -1,4 +1,4 @@
1
- import{j as t}from"./jsx-runtime-eps93zm2.js";import{useMDXComponents as n}from"./index-BcNHZKhG.js";import{Z as s,$ as o}from"./index-BwF95xBr.js";import{Default as l,LabelOnLeft as p}from"./field.stories-eRSYmEtA.js";import{Default as m,LabelsOnLeft as a,Row as h}from"./form.stories-D58sdhOk.js";import"./index-DhsZuJvc.js";import"./iframe-ud1XJtGn.js";import"../sb-preview/runtime.js";import"./index-CUZDtIZe.js";import"./inheritsLoose-DP0QEDDI.js";import"./assertThisInitialized-B9jnkVVz.js";import"./index-D6rZ4wEC.js";import"./field-nInV3MuR.js";import"./index-Bk2sglWO.js";import"./label-Cz6TT90s.js";import"./common-types-Sih75Sav.js";import"./help-icon-CfV3_Ais.js";import"./tooltip-C_E_6ym5.js";import"./icon-BSFY3vDO.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./index-CEuq6vkz.js";import"./disabled-context-rmpd7YJS.js";import"./input-D97ganXq.js";import"./types-UmZ4Y_CR.js";import"./lodash-BHd_uQHh.js";import"./text-B3-TSWok.js";import"./select-yqiMF9-4.js";import"./memoize-one.esm-CcMeOnPo.js";import"./types-BmbYqTX_.js";import"./actions-4w-EOz3m.js";import"./button-CdEIDAx8.js";import"./spinner-AWUe4xwQ.js";import"./badge-CLQ59MDF.js";import"./select.input-DIKP56UZ.js";import"./check-box-2fHPdAZG.js";import"./button-group-BIUVa0X9.js";import"./toggle-D0yzyALV.js";import"./input-group-BaRSJAEN.js";import"./input-group-addon-D68iUKV2.js";import"./slider-BLU39INk.js";import"./objectSpread2-DW4nTBoq.js";import"./index-BI4_Bp97.js";import"./textarea-DOJDK8hI.js";import"./radio-button-J4oEQdxt.js";import"./form-row-CM112EYF.js";function r(i){const e={code:"code",h1:"h1",h2:"h2",p:"p",...n(),...i.components};return t.jsxs(t.Fragment,{children:[t.jsx(s,{title:"Layout (Forms)"}),`
1
+ import{j as t}from"./jsx-runtime-eps93zm2.js";import{useMDXComponents as n}from"./index-BcNHZKhG.js";import{Z as s,$ as o}from"./index-W0dVTpIv.js";import{Default as l,LabelOnLeft as p}from"./field.stories-eRSYmEtA.js";import{Default as m,LabelsOnLeft as a,Row as h}from"./form.stories-D58sdhOk.js";import"./index-DhsZuJvc.js";import"./iframe-MGOUznuN.js";import"../sb-preview/runtime.js";import"./index-CUZDtIZe.js";import"./inheritsLoose-DP0QEDDI.js";import"./assertThisInitialized-B9jnkVVz.js";import"./index-D6rZ4wEC.js";import"./field-nInV3MuR.js";import"./index-Bk2sglWO.js";import"./label-Cz6TT90s.js";import"./common-types-Sih75Sav.js";import"./help-icon-CfV3_Ais.js";import"./tooltip-C_E_6ym5.js";import"./icon-BSFY3vDO.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./index-CEuq6vkz.js";import"./disabled-context-rmpd7YJS.js";import"./input-D97ganXq.js";import"./types-UmZ4Y_CR.js";import"./lodash-BHd_uQHh.js";import"./text-B3-TSWok.js";import"./select-yqiMF9-4.js";import"./memoize-one.esm-CcMeOnPo.js";import"./types-BmbYqTX_.js";import"./actions-4w-EOz3m.js";import"./button-CdEIDAx8.js";import"./spinner-AWUe4xwQ.js";import"./badge-CLQ59MDF.js";import"./select.input-DIKP56UZ.js";import"./check-box-2fHPdAZG.js";import"./button-group-BIUVa0X9.js";import"./toggle-D0yzyALV.js";import"./input-group-BaRSJAEN.js";import"./input-group-addon-D68iUKV2.js";import"./slider-BLU39INk.js";import"./objectSpread2-DW4nTBoq.js";import"./index-BI4_Bp97.js";import"./textarea-DOJDK8hI.js";import"./radio-button-J4oEQdxt.js";import"./form-row-CM112EYF.js";function r(i){const e={code:"code",h1:"h1",h2:"h2",p:"p",...n(),...i.components};return t.jsxs(t.Fragment,{children:[t.jsx(s,{title:"Layout (Forms)"}),`
2
2
  `,t.jsx(e.h1,{id:"layout-forms",children:"Layout (Forms)"}),`
3
3
  `,t.jsx(e.h2,{id:"field",children:"Field"}),`
4
4
  `,t.jsxs(e.p,{children:["This is a wrapper for any form element with default bottom margin, and props like ",t.jsx(e.code,{children:"label"})," for other default styling."]}),`
@@ -1,4 +1,4 @@
1
- import{j as e}from"./jsx-runtime-eps93zm2.js";import{useMDXComponents as s}from"./index-BcNHZKhG.js";import{Z as r,$ as n}from"./index-BwF95xBr.js";import{Center as d,SpaceBetween as l,JustifyEnd as a,Column as c}from"./flex.stories-CT6o2gii.js";import{Default as h,CustomColumnWidth as p,DefaultGap as x,CustomGap as m,Responsive as u}from"./grid.stories-BhjMGl59.js";import{Default as j,FixedWidth as f,NoPadding as w,ResponsiveWidth as g}from"./column.stories-rKyxUTAG.js";import"./index-DhsZuJvc.js";import"./iframe-ud1XJtGn.js";import"../sb-preview/runtime.js";import"./index-CUZDtIZe.js";import"./inheritsLoose-DP0QEDDI.js";import"./assertThisInitialized-B9jnkVVz.js";import"./index-D6rZ4wEC.js";import"./flex-EllkLxgO.js";import"./button-CdEIDAx8.js";import"./index-Bk2sglWO.js";import"./common-types-Sih75Sav.js";import"./disabled-context-rmpd7YJS.js";import"./spinner-AWUe4xwQ.js";import"./icon-BSFY3vDO.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./index-CEuq6vkz.js";import"./tooltip-C_E_6ym5.js";import"./text-B3-TSWok.js";import"./grid-B6LFPf51.js";import"./styled-components.browser.esm-Bf0q9Yjk.js";import"./card-EcjmryU9.js";import"./row-4iAGREkV.js";import"./heading-EzI5s4VN.js";import"./help-icon-CfV3_Ais.js";function t(i){const o={code:"code",h1:"h1",h2:"h2",h3:"h3",p:"p",...s(),...i.components};return e.jsxs(e.Fragment,{children:[e.jsx(r,{title:"Layout (General)"}),`
1
+ import{j as e}from"./jsx-runtime-eps93zm2.js";import{useMDXComponents as s}from"./index-BcNHZKhG.js";import{Z as r,$ as n}from"./index-W0dVTpIv.js";import{Center as d,SpaceBetween as l,JustifyEnd as a,Column as c}from"./flex.stories-CT6o2gii.js";import{Default as h,CustomColumnWidth as p,DefaultGap as x,CustomGap as m,Responsive as u}from"./grid.stories-BhjMGl59.js";import{Default as j,FixedWidth as f,NoPadding as w,ResponsiveWidth as g}from"./column.stories-rKyxUTAG.js";import"./index-DhsZuJvc.js";import"./iframe-MGOUznuN.js";import"../sb-preview/runtime.js";import"./index-CUZDtIZe.js";import"./inheritsLoose-DP0QEDDI.js";import"./assertThisInitialized-B9jnkVVz.js";import"./index-D6rZ4wEC.js";import"./flex-EllkLxgO.js";import"./button-CdEIDAx8.js";import"./index-Bk2sglWO.js";import"./common-types-Sih75Sav.js";import"./disabled-context-rmpd7YJS.js";import"./spinner-AWUe4xwQ.js";import"./icon-BSFY3vDO.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./index-CEuq6vkz.js";import"./tooltip-C_E_6ym5.js";import"./text-B3-TSWok.js";import"./grid-B6LFPf51.js";import"./styled-components.browser.esm-Bf0q9Yjk.js";import"./card-EcjmryU9.js";import"./row-4iAGREkV.js";import"./heading-EzI5s4VN.js";import"./help-icon-CfV3_Ais.js";function t(i){const o={code:"code",h1:"h1",h2:"h2",h3:"h3",p:"p",...s(),...i.components};return e.jsxs(e.Fragment,{children:[e.jsx(r,{title:"Layout (General)"}),`
2
2
  `,e.jsx(o.h1,{id:"layout-general",children:"Layout (General)"}),`
3
3
  `,e.jsx(o.h2,{id:"flex",children:"Flex"}),`
4
4
  `,e.jsxs(o.p,{children:["The ",e.jsx(o.code,{children:"Flex"})," component is a basic flexbox wrapper with optional props for ",e.jsx(o.code,{children:"alignItems"}),", ",e.jsx(o.code,{children:"justifyContent"})," and ",e.jsx(o.code,{children:"flexDirection"}),". This is a conveninent way to center items vertically and/or horizontally, to align them to opposite edges, or align them to the far side."]}),`
@@ -1,4 +1,4 @@
1
- import{j as e}from"./jsx-runtime-eps93zm2.js";import{useMDXComponents as r}from"./index-BcNHZKhG.js";import{Z as t}from"./index-BwF95xBr.js";import"./index-DhsZuJvc.js";import"./iframe-ud1XJtGn.js";import"../sb-preview/runtime.js";import"./index-CUZDtIZe.js";import"./inheritsLoose-DP0QEDDI.js";import"./assertThisInitialized-B9jnkVVz.js";import"./index-D6rZ4wEC.js";function i(s){const n={code:"code",h1:"h1",h2:"h2",li:"li",p:"p",strong:"strong",ul:"ul",...r(),...s.components};return e.jsxs(e.Fragment,{children:[e.jsx(t,{title:"Padding, Margin & Size"}),`
1
+ import{j as e}from"./jsx-runtime-eps93zm2.js";import{useMDXComponents as r}from"./index-BcNHZKhG.js";import{Z as t}from"./index-W0dVTpIv.js";import"./index-DhsZuJvc.js";import"./iframe-MGOUznuN.js";import"../sb-preview/runtime.js";import"./index-CUZDtIZe.js";import"./inheritsLoose-DP0QEDDI.js";import"./assertThisInitialized-B9jnkVVz.js";import"./index-D6rZ4wEC.js";function i(s){const n={code:"code",h1:"h1",h2:"h2",li:"li",p:"p",strong:"strong",ul:"ul",...r(),...s.components};return e.jsxs(e.Fragment,{children:[e.jsx(t,{title:"Padding, Margin & Size"}),`
2
2
  `,e.jsx(n.h1,{id:"padding-margin--size",children:"Padding, Margin & Size"}),`
3
3
  `,e.jsx(n.h2,{id:"padding--margin",children:"Padding & Margin"}),`
4
4
  `,e.jsx(n.p,{children:"There are standard CSS spacing variables for padding and margin."}),`
@@ -1,3 +1,3 @@
1
- import{j as s}from"./jsx-runtime-eps93zm2.js";import{r as P,R as C}from"./index-DhsZuJvc.js";import{T as I}from"./toaster-7wnI6hqB.js";import"./message-ZenLdkrf.js";import{a4 as d,a5 as M}from"./index-BwF95xBr.js";import{e as _}from"./index-DRSy5Ssd.js";import"./chunk-HLWAVYOI-C3Nc_Hl_.js";import"./index-CUZDtIZe.js";import"./index-Bk2sglWO.js";import"./common-types-Sih75Sav.js";import"./icon-BSFY3vDO.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./inheritsLoose-DP0QEDDI.js";import"./index-CEuq6vkz.js";import"./disabled-context-rmpd7YJS.js";import"./iframe-ud1XJtGn.js";import"../sb-preview/runtime.js";import"./assertThisInitialized-B9jnkVVz.js";import"./index-D6rZ4wEC.js";import"./react-16-DXAfArL2.js";var v="DARK_MODE";function f(r){"@babel/helpers - typeof";return f=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f(r)}var b;function k(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),e.push.apply(e,n)}return e}function A(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?k(Object(e),!0).forEach(function(n){R(r,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):k(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}function R(r,t,e){return t=x(t),t in r?Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[t]=e,r}function x(r){var t=K(r,"string");return f(t)==="symbol"?t:String(t)}function K(r,t){if(f(r)!=="object"||r===null)return r;var e=r[Symbol.toPrimitive];if(e!==void 0){var n=e.call(r,t||"default");if(f(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(r)}function p(r){return B(r)||U(r)||N(r)||L()}function L(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1
+ import{j as s}from"./jsx-runtime-eps93zm2.js";import{r as P,R as C}from"./index-DhsZuJvc.js";import{T as I}from"./toaster-7wnI6hqB.js";import"./message-ZenLdkrf.js";import{a4 as d,a5 as M}from"./index-W0dVTpIv.js";import{e as _}from"./index-DRSy5Ssd.js";import"./chunk-HLWAVYOI-PihY4p8L.js";import"./index-CUZDtIZe.js";import"./index-Bk2sglWO.js";import"./common-types-Sih75Sav.js";import"./icon-BSFY3vDO.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./inheritsLoose-DP0QEDDI.js";import"./index-CEuq6vkz.js";import"./disabled-context-rmpd7YJS.js";import"./iframe-MGOUznuN.js";import"../sb-preview/runtime.js";import"./assertThisInitialized-B9jnkVVz.js";import"./index-D6rZ4wEC.js";import"./react-16-DXAfArL2.js";var v="DARK_MODE";function f(r){"@babel/helpers - typeof";return f=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f(r)}var b;function k(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),e.push.apply(e,n)}return e}function A(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?k(Object(e),!0).forEach(function(n){R(r,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):k(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}function R(r,t,e){return t=x(t),t in r?Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[t]=e,r}function x(r){var t=K(r,"string");return f(t)==="symbol"?t:String(t)}function K(r,t){if(f(r)!=="object"||r===null)return r;var e=r[Symbol.toPrimitive];if(e!==void 0){var n=e.call(r,t||"default");if(f(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(r)}function p(r){return B(r)||U(r)||N(r)||L()}function L(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function N(r,t){if(r){if(typeof r=="string")return h(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return h(r,t)}}function U(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function B(r){if(Array.isArray(r))return h(r)}function h(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}const{global:Y}=__STORYBOOK_MODULE_GLOBAL__;__STORYBOOK_MODULE_CORE_EVENTS__;var T=Y,$=T.document,g=T.window,j="sb-addon-themes-3";(b=g.matchMedia)===null||b===void 0||b.call(g,"(prefers-color-scheme: dark)");var O={classTarget:"body",dark:d.dark,darkClass:["dark"],light:d.light,lightClass:["light"],stylePreview:!1,userHasExplicitlySetTheTheme:!1},E=function(t){g.localStorage.setItem(j,JSON.stringify(t))},H=function(t,e){var n=e.current,a=e.darkClass,l=a===void 0?O.darkClass:a,o=e.lightClass,i=o===void 0?O.lightClass:o;if(n==="dark"){var u,c;(u=t.classList).remove.apply(u,p(y(i))),(c=t.classList).add.apply(c,p(y(l)))}else{var m,S;(m=t.classList).remove.apply(m,p(y(l))),(S=t.classList).add.apply(S,p(y(i)))}},y=function(t){var e=[];return e.concat(t).map(function(n){return n})},V=function(t){var e=$.querySelector(t.classTarget);e&&H(e,t)},D=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=g.localStorage.getItem(j);if(typeof e=="string"){var n=JSON.parse(e);return t&&(t.dark&&!_(n.dark,t.dark)&&(n.dark=t.dark,E(n)),t.light&&!_(n.light,t.light)&&(n.light=t.light,E(n))),n}return A(A({},O),t)};V(D());function W(r,t){return F(r)||J(r,t)||G(r,t)||q()}function q(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
3
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function G(r,t){if(r){if(typeof r=="string")return w(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return w(r,t)}}function w(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function J(r,t){var e=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(e!=null){var n,a,l,o,i=[],u=!0,c=!1;try{if(l=(e=e.call(r)).next,t!==0)for(;!(u=(n=l.call(e)).done)&&(i.push(n.value),i.length!==t);u=!0);}catch(m){c=!0,a=m}finally{try{if(!u&&e.return!=null&&(o=e.return(),Object(o)!==o))return}finally{if(c)throw a}}return i}}function F(r){if(Array.isArray(r))return r}const{addons:z,useState:Q,useEffect:X}=__STORYBOOK_MODULE_PREVIEW_API__;function Z(){var r=Q(D().current==="dark"),t=W(r,2),e=t[0],n=t[1];return X(function(){var a=z.getChannel();return a.on(v,n),function(){return a.off(v,n)}},[]),e}const Or=[r=>s.jsxs(s.Fragment,{children:[s.jsx(r,{}),s.jsx(I,{})]}),r=>{const t=Z();return P.useEffect(()=>document.documentElement.dataset.theme=t?"dark":"default",[t]),s.jsx(r,{})}],Sr={docs:{container:r=>{const[t,e]=C.useState(!1);r.context.channel.on(v,a=>e(a));const n={...r};return n.theme=t?d.dark:d.light,s.jsx(M,{...n})}},darkMode:{current:"light",stylePreview:!0}},_r=["autodocs"];export{Or as decorators,Sr as parameters,_r as tags};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DocsRenderer-PKQXORMH-Copxu6Si.js","./chunk-HLWAVYOI-C3Nc_Hl_.js","./iframe-ud1XJtGn.js","./index-DhsZuJvc.js","./react-16-DXAfArL2.js","./index-CUZDtIZe.js","./index-BwF95xBr.js","./inheritsLoose-DP0QEDDI.js","./assertThisInitialized-B9jnkVVz.js","./index-D6rZ4wEC.js"])))=>i.map(i=>d[i]);
2
- import{_ as a}from"./iframe-ud1XJtGn.js";import"../sb-preview/runtime.js";const{global:s}=__STORYBOOK_MODULE_GLOBAL__;var _=Object.entries(s.TAGS_OPTIONS??{}).reduce((e,r)=>{let[t,o]=r;return o.excludeFromDocsStories&&(e[t]=!0),e},{}),d={docs:{renderer:async()=>{let{DocsRenderer:e}=await a(()=>import("./DocsRenderer-PKQXORMH-Copxu6Si.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url);return new e},stories:{filter:e=>{var r;return(e.tags||[]).filter(t=>_[t]).length===0&&!((r=e.parameters.docs)!=null&&r.disable)}}}};export{d as parameters};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DocsRenderer-PKQXORMH-D3Cy2r_Z.js","./chunk-HLWAVYOI-PihY4p8L.js","./iframe-MGOUznuN.js","./index-DhsZuJvc.js","./react-16-DXAfArL2.js","./index-CUZDtIZe.js","./index-W0dVTpIv.js","./inheritsLoose-DP0QEDDI.js","./assertThisInitialized-B9jnkVVz.js","./index-D6rZ4wEC.js"])))=>i.map(i=>d[i]);
2
+ import{_ as a}from"./iframe-MGOUznuN.js";import"../sb-preview/runtime.js";const{global:s}=__STORYBOOK_MODULE_GLOBAL__;var _=Object.entries(s.TAGS_OPTIONS??{}).reduce((e,r)=>{let[t,o]=r;return o.excludeFromDocsStories&&(e[t]=!0),e},{}),d={docs:{renderer:async()=>{let{DocsRenderer:e}=await a(()=>import("./DocsRenderer-PKQXORMH-D3Cy2r_Z.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url);return new e},stories:{filter:e=>{var r;return(e.tags||[]).filter(t=>_[t]).length===0&&!((r=e.parameters.docs)!=null&&r.disable)}}}};export{d as parameters};
@@ -1,10 +1,10 @@
1
- import{j as e}from"./jsx-runtime-eps93zm2.js";import{r as d}from"./index-DhsZuJvc.js";import{d as r,r as gt}from"./index-DQs5XS8h.js";import{c as ht}from"./index-Bk2sglWO.js";import{u as vt}from"./use-previous-D775JrO6.js";import{M as Te}from"./actions-4w-EOz3m.js";import{I as ft}from"./input-group-addon-D68iUKV2.js";import{B as m}from"./button-CdEIDAx8.js";import{T as Ct}from"./tooltip-C_E_6ym5.js";import{I as yt}from"./input-group-BaRSJAEN.js";import{S as V}from"./spacer-BWoNR27H.js";import{T as Ln}from"./text-B3-TSWok.js";import{I as bt}from"./input-D97ganXq.js";import{M as Se}from"./types-BmbYqTX_.js";import{l as T}from"./lodash-BHd_uQHh.js";import{D as Ut}from"./divider-DY9nJ_7N.js";import{R as Kn,C as ge}from"./row-4iAGREkV.js";import{F as w}from"./field-nInV3MuR.js";import{M as he}from"./message-ZenLdkrf.js";import"./index-DRSy5Ssd.js";import"./common-types-Sih75Sav.js";import"./disabled-context-rmpd7YJS.js";import"./icon-BSFY3vDO.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./inheritsLoose-DP0QEDDI.js";import"./index-CEuq6vkz.js";import"./types-UmZ4Y_CR.js";import"./badge-CLQ59MDF.js";import"./spinner-AWUe4xwQ.js";import"./index-CUZDtIZe.js";import"./styled-components.browser.esm-Bf0q9Yjk.js";import"./label-Cz6TT90s.js";import"./help-icon-CfV3_Ais.js";const xt=()=>{const n=d.useRef(null);return d.useLayoutEffect(()=>{n.current&&(n.current(),n.current=null)}),t=>{n.current=t}},It=(n,a)=>{const t=a==null?void 0:a[n];return t||(console.log(`Warning: 'unitTemplate' missing for '${n}'. Using initial unit, value unit, or default.`),r.unitFromQuantity(n)??"")};var y=(n=>(n.CUSTOM="custom",n.PREDEFINED="predefined",n))(y||{});const zn=n=>n==="undefined"||n===void 0||n===""||n==="null"||n===null||n==="NaN"||isNaN(n),$n=(n="",a,t="",l=!1)=>{if(l)return n;if(a&&!zn(n))try{const o=r.isValueWithUnit(n)?n:r.withUnit(n,t),c=r.convertSamePrecision(o,a);return r.getValue(c)}catch{}return n},wt=n=>n?!!r.getUnit(n):!1,D=(n="",a,t,l)=>{if(l)return n;const o=wt(n)||r.isValueWithUnit(n),c=r.getValue(n);return zn(c)?c:o?$n(c,a,t,l):n},Ne=n=>T.isObject(n)&&!T.isArray(n)&&!T.isFunction(n)?T.get(n,"fieldName",""):typeof n=="string"?n:"",Vt=n=>T.isObjectLike(n)&&T.has(n,"message"),Et=n=>typeof n=="string"?n:Vt(n)?n.message:null;var jt=gt();const kt=n=>n.search(RegExp(/(^0{2}\.)|(^0+[1-9])/g))===0,Ae=(n,a)=>{var E;const{allowEmpty:t=!1,autoValue:l,placeholder:o,disabledValidation:c=!1}=a||{},i=String(n);if(c||l||o)return null;const g=jt.isValueWithUnit(i)?r.getValue(i):i;if(t&&g==="")return null;if(kt(g))return"Invalid number format due to leading zeroes";const h=r.validateNumber(g);if(!h.valid){const ie=((E=h==null?void 0:h.errors)==null?void 0:E[0])??null;return Et(ie)}return null},qe=(n="")=>{var a;return(a=r.KNOWN_UNITS)==null?void 0:a.includes(n)},Tt=(n,a)=>{const t=r.getUnit(n||"");return qe(a)&&qe(t)},St=d.createContext(null),Gn=({children:n})=>(console.log("Context not initialized. Call initializeContext first."),n);Gn.__docgenInfo={description:"",methods:[],displayName:"WithUnitContext"};const Nt="_predefinedMenuActive_1yvt4_1",At={predefinedMenuActive:Nt},Jn=({name:n,placeholder:a="",disabled:t=!1,disabledUnit:l=!1,error:o=null,left:c=!1,small:i=!1,width:g="100%",value:h,unitkey:E="",initUnit:ie,noConversion:Yn=!1,onChange:le=()=>{},onClick:Pt=()=>{},onFocus:Zn=()=>{},onSwitchUnit:ve=()=>{},unitTemplate:fe,doNotConvertValue:q=!1,testId:k,warning:Qn=null,predefinedOptions:x,initialPredefinedOption:Xn=!1,shouldLinkAutomaticly:Ce=!0,selectedPredefinedOptionKey:ye,validationCallback:be=()=>({name:"",error:null}),disabledValidation:Ue=!1,allowEmpty:xe=!1,autoValue:I})=>{typeof h=="number"&&(h=`${h}`);const et=d.useContext(St);console.log("context in component ->>>>",et);const nt=xt(),[ue="",P=""]=h!==void 0?r.split(h):[],Ie=I?r.getUnit(I):"",we=d.useMemo(()=>It(E,fe),[E,fe]),tt=Tt(h,we),U=ie||P||we,at=vt(U),Ve=D(h,U,P,q),Ee=D(I,U,Ie,q),rt=Ve!==""?{value:Ve,unit:U}:Ee!==""?{value:Ee,unit:U}:{value:ue,unit:P},[v,ne]=d.useState(rt),[st,oe]=d.useState(null),[j,de]=d.useState(Xn?y.PREDEFINED:y.CUSTOM),ce=ue===""&&I,M=x&&x.find(s=>{if(!(s!=null&&s.value))return;if(ye)return ye===s.valueKey;const u=r.isValueWithUnit(s.value)?r.getUnit(s.value):"";return r.withUnit($n(h,u),u)===s.value}),it=()=>{if(E)try{const s=ce?I:h??"";let u=r.altUnitsList(s,E);return r.getValue(s)===""?u.map(f=>["",f[1]]):u}catch{return null}},lt=s=>{const u=Ne(n),f=s.target,{value:b,selectionStart:_}=f,ke=r.cleanNumStr(b.replaceAll(" ","").replaceAll("|","")),me=r.withUnit(ke,(v==null?void 0:v.unit)||""),ct=r.getValue(me),pe=Ae(ct,{allowEmpty:xe,autoValue:I,placeholder:a,disabledValidation:Ue});if(pe===null){le({target:{value:me,name:u}});const[mt,pt]=r.split(me);ne({value:mt,unit:pt}),oe(null),be(u,null)}else ne({value:ke,unit:v.unit}),oe(pe),be(u,pe);nt(()=>{f.selectionStart=_,f.selectionEnd=_})},ut=(s,u)=>{u===v.unit||isNaN(Number(s))||(ne({value:s,unit:u}),ve&&ve(u))};d.useEffect(()=>{if(U){let f,b="";at!==U?(f=D(h,U,P,q),b=U):r.withUnit(v.value,v.unit)!==h&&(f=D(h,v.unit,P,q),b=v.unit),f!==void 0&&ne({value:f,unit:b}),x&&de(M&&Ce?y.PREDEFINED:y.CUSTOM)}const s=r.checkAndCleanDecimalComma(ue),u=Ae(s,{allowEmpty:xe,autoValue:I,placeholder:a,disabledValidation:Ue});oe(u)},[U,h,o,Ce]);const te=it(),ae=r.label(v.unit)||v.unit||"",ot=Yn||!te||te&&te.length===1,je=Ne(n);let re;const dt=s=>{const u=s!=null&&s.value?s.value:"",[f="",b=""]=r.isValueWithUnit(u)?r.split(u):[u];return{type:Se.OPTION,inline:!0,onClick:()=>{r.validateNumber(f).valid&&!t&&(de(y.PREDEFINED),le({target:{value:u,name:typeof n=="string"?n:(n==null?void 0:n.fieldName)||"",predefinedSelected:!0,predefinedOption:s}}))},label:e.jsxs(e.Fragment,{children:[e.jsx(Ln,{children:s.label}),e.jsx(V,{width:"20px",height:"0"})]}),description:r.isValueWithUnit(u)?`${f} ${b}`:u,selected:M===s&&j===y.PREDEFINED}};if(re=[{type:Se.OPTION,inline:!0,onClick:()=>{j!==y.CUSTOM&&!t&&le({target:{value:r.withUnit(v.value,v.unit),name:typeof n=="string"?n:(n==null?void 0:n.fieldName)||""}})},label:"Custom",selected:j===y.CUSTOM}],x!=null&&x.length){const s=x.map(dt);re=[...re,...s]}return e.jsx("div",{className:j===y.PREDEFINED?ht(At.predefinedMenuActive):"",children:e.jsxs(yt,{small:i,width:g,children:[x&&e.jsx(Ct,{text:j===y.PREDEFINED?M==null?void 0:M.label:"",children:e.jsx(Te,{maxHeight:380,groupOrder:"first",testId:k&&`${k}-predefined-menu`,disabled:t,menu:{colored:!0,trigger:"Component",component:e.jsx(m,{groupOrder:"first",active:j===y.PREDEFINED,icon:j===y.PREDEFINED?"link":"unlink"}),small:i,sections:re}})}),e.jsx(bt,{type:"text",name:je,testId:k,disabled:t,placeholder:ce?D(I,v.unit,Ie,q):a,value:v.value,onChange:lt,onFocus:Zn,error:o||st,warning:Qn,right:!c},je),ae&&(ot||!tt?e.jsx(ft,{groupOrder:"last",children:ae}):e.jsx(Te,{maxHeight:380,groupOrder:"last",disabled:l,testId:k&&`${k}-menu`,menu:{label:ae,trigger:"DropDownButton",small:i,sections:te.map(([s,u,f])=>{const b=f||u||"";return{type:"Option",label:isNaN(Number(s))?"":s,inline:!0,onClick:_=>{_.stopPropagation(),ut(ce?"":s,u)},description:b,selected:b===ae,testId:`${k}-unit-${b}`}})}}))]})})},p=Gn(Jn);Jn.__docgenInfo={description:"",methods:[],displayName:"UnitInputComponent",props:{name:{required:!0,tsType:{name:"union",raw:"string | { fieldName?: string }",elements:[{name:"string"},{name:"signature",type:"object",raw:"{ fieldName?: string }",signature:{properties:[{key:"fieldName",value:{name:"string",required:!1}}]}}]},description:""},placeholder:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:"''",computed:!1}},disabled:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},disabledUnit:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},error:{required:!1,tsType:{name:"union",raw:"string | null | boolean",elements:[{name:"string"},{name:"null"},{name:"boolean"}]},description:"",defaultValue:{value:"null",computed:!1}},left:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},small:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},width:{required:!1,tsType:{name:"union",raw:"string | number",elements:[{name:"string"},{name:"number"}]},description:"",defaultValue:{value:"'100%'",computed:!1}},value:{required:!1,tsType:{name:"string"},description:""},unitkey:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:"''",computed:!1}},initUnit:{required:!1,tsType:{name:"string"},description:""},noConversion:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},doNotConvertValue:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},testId:{required:!1,tsType:{name:"string"},description:""},warning:{required:!1,tsType:{name:"union",raw:"string | boolean | null",elements:[{name:"string"},{name:"boolean"},{name:"null"}]},description:"",defaultValue:{value:"null",computed:!1}},predefinedOptions:{required:!1,tsType:{name:"union",raw:"IPredefinedOption[] | null",elements:[{name:"Array",elements:[{name:"IPredefinedOption"}],raw:"IPredefinedOption[]"},{name:"null"}]},description:""},initialPredefinedOption:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},shouldLinkAutomaticly:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"true",computed:!1}},selectedPredefinedOptionKey:{required:!1,tsType:{name:"string"},description:""},validationCallback:{required:!1,tsType:{name:"signature",type:"function",raw:`(
1
+ import{j as e}from"./jsx-runtime-eps93zm2.js";import{r as m}from"./index-DhsZuJvc.js";import{d as r,r as ct}from"./index-DQs5XS8h.js";import{c as mt}from"./index-Bk2sglWO.js";import{u as pt}from"./use-previous-D775JrO6.js";import{M as Te}from"./actions-4w-EOz3m.js";import{I as gt}from"./input-group-addon-D68iUKV2.js";import{B as c}from"./button-CdEIDAx8.js";import{T as ht}from"./tooltip-C_E_6ym5.js";import{I as vt}from"./input-group-BaRSJAEN.js";import{S as V}from"./spacer-BWoNR27H.js";import{T as Ln}from"./text-B3-TSWok.js";import{I as ft}from"./input-D97ganXq.js";import{M as Se}from"./types-BmbYqTX_.js";import{l as T}from"./lodash-BHd_uQHh.js";import{D as yt}from"./divider-DY9nJ_7N.js";import{R as Kn,C as ge}from"./row-4iAGREkV.js";import{F as w}from"./field-nInV3MuR.js";import{M as he}from"./message-ZenLdkrf.js";import"./index-DRSy5Ssd.js";import"./common-types-Sih75Sav.js";import"./disabled-context-rmpd7YJS.js";import"./icon-BSFY3vDO.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./inheritsLoose-DP0QEDDI.js";import"./index-CEuq6vkz.js";import"./types-UmZ4Y_CR.js";import"./badge-CLQ59MDF.js";import"./spinner-AWUe4xwQ.js";import"./index-CUZDtIZe.js";import"./styled-components.browser.esm-Bf0q9Yjk.js";import"./label-Cz6TT90s.js";import"./help-icon-CfV3_Ais.js";const Ct=()=>{const n=m.useRef(null);return m.useLayoutEffect(()=>{n.current&&(n.current(),n.current=null)}),t=>{n.current=t}},bt=(n,a)=>{const t=a==null?void 0:a[n];return t||(console.log(`Warning: 'unitTemplate' does not define a preferred unit for '${n}'. Defaulting to standard unit.`),r.unitFromQuantity(n)??"")};var C=(n=>(n.CUSTOM="custom",n.PREDEFINED="predefined",n))(C||{});const $n=n=>n==="undefined"||n===void 0||n===""||n==="null"||n===null||n==="NaN"||isNaN(n),zn=(n="",a,t="",l=!1)=>{if(l)return n;if(a&&!$n(n))try{const o=r.isValueWithUnit(n)?n:r.withUnit(n,t),d=r.convertSamePrecision(o,a);return r.getValue(d)}catch{}return n},Ut=n=>n?!!r.getUnit(n):!1,_=(n="",a,t,l)=>{if(l)return n;const o=Ut(n)||r.isValueWithUnit(n),d=r.getValue(n);return $n(d)?d:o?zn(d,a,t,l):n},Ne=n=>T.isObject(n)&&!T.isArray(n)&&!T.isFunction(n)?T.get(n,"fieldName",""):typeof n=="string"?n:"",xt=n=>T.isObjectLike(n)&&T.has(n,"message"),It=n=>typeof n=="string"?n:xt(n)?n.message:null;var wt=ct();const Vt=n=>n.search(RegExp(/(^0{2}\.)|(^0+[1-9])/g))===0,Ae=(n,a)=>{var j;const{allowEmpty:t=!1,autoValue:l,placeholder:o,disabledValidation:d=!1}=a||{},i=String(n);if(d||l||o)return null;const g=wt.isValueWithUnit(i)?r.getValue(i):i;if(t&&g==="")return null;if(Vt(g))return"Invalid number format due to leading zeroes";const h=r.validateNumber(g);if(!h.valid){const ie=((j=h==null?void 0:h.errors)==null?void 0:j[0])??null;return It(ie)}return null},qe=(n="")=>{var a;return(a=r.KNOWN_UNITS)==null?void 0:a.includes(n)},jt=(n,a)=>{const t=r.getUnit(n||"");return qe(a)&&qe(t)},Et="_predefinedMenuActive_1yvt4_1",kt={predefinedMenuActive:Et},p=({name:n,placeholder:a="",disabled:t=!1,disabledUnit:l=!1,error:o=null,left:d=!1,small:i=!1,width:g="100%",value:h,unitkey:j="",initUnit:ie,noConversion:Gn=!1,onChange:le=()=>{},onClick:St=()=>{},onFocus:Jn=()=>{},onSwitchUnit:ve=()=>{},unitTemplate:fe,doNotConvertValue:q=!1,testId:k,warning:Yn=null,predefinedOptions:x,initialPredefinedOption:Zn=!1,shouldLinkAutomaticly:ye=!0,selectedPredefinedOptionKey:Ce,validationCallback:be=()=>({name:"",error:null}),disabledValidation:Ue=!1,allowEmpty:xe=!1,autoValue:I})=>{typeof h=="number"&&(h=`${h}`);const Qn=Ct(),[ue="",P=""]=h!==void 0?r.split(h):[],Ie=I?r.getUnit(I):"",we=m.useMemo(()=>bt(j,fe),[j,fe]),Xn=jt(h,we),U=ie||we||P,et=pt(U),Ve=_(h,U,P,q),je=_(I,U,Ie,q),nt=Ve!==""?{value:Ve,unit:U}:je!==""?{value:je,unit:U}:{value:ue,unit:P},[v,ne]=m.useState(nt),[tt,oe]=m.useState(null),[E,de]=m.useState(Zn?C.PREDEFINED:C.CUSTOM),ce=ue===""&&I,M=x&&x.find(s=>{if(!(s!=null&&s.value))return;if(Ce)return Ce===s.valueKey;const u=r.isValueWithUnit(s.value)?r.getUnit(s.value):"";return r.withUnit(zn(h,u),u)===s.value}),at=()=>{if(j)try{const s=ce?I:h??"";let u=r.altUnitsList(s,j);return r.getValue(s)===""?u.map(f=>["",f[1]]):u}catch{return null}},rt=s=>{const u=Ne(n),f=s.target,{value:b,selectionStart:D}=f,ke=r.cleanNumStr(b.replaceAll(" ","").replaceAll("|","")),me=r.withUnit(ke,(v==null?void 0:v.unit)||""),ut=r.getValue(me),pe=Ae(ut,{allowEmpty:xe,autoValue:I,placeholder:a,disabledValidation:Ue});if(pe===null){le({target:{value:me,name:u}});const[ot,dt]=r.split(me);ne({value:ot,unit:dt}),oe(null),be(u,null)}else ne({value:ke,unit:v.unit}),oe(pe),be(u,pe);Qn(()=>{f.selectionStart=D,f.selectionEnd=D})},st=(s,u)=>{u===v.unit||isNaN(Number(s))||(ne({value:s,unit:u}),ve&&ve(u))};m.useEffect(()=>{if(U){let f,b="";et!==U?(f=_(h,U,P,q),b=U):r.withUnit(v.value,v.unit)!==h&&(f=_(h,v.unit,P,q),b=v.unit),f!==void 0&&ne({value:f,unit:b}),x&&de(M&&ye?C.PREDEFINED:C.CUSTOM)}const s=r.checkAndCleanDecimalComma(ue),u=Ae(s,{allowEmpty:xe,autoValue:I,placeholder:a,disabledValidation:Ue});oe(u)},[U,h,o,ye]);const te=at(),ae=r.label(v.unit)||v.unit||"",it=Gn||!te||te&&te.length===1,Ee=Ne(n);let re;const lt=s=>{const u=s!=null&&s.value?s.value:"",[f="",b=""]=r.isValueWithUnit(u)?r.split(u):[u];return{type:Se.OPTION,inline:!0,onClick:()=>{r.validateNumber(f).valid&&!t&&(de(C.PREDEFINED),le({target:{value:u,name:typeof n=="string"?n:(n==null?void 0:n.fieldName)||"",predefinedSelected:!0,predefinedOption:s}}))},label:e.jsxs(e.Fragment,{children:[e.jsx(Ln,{children:s.label}),e.jsx(V,{width:"20px",height:"0"})]}),description:r.isValueWithUnit(u)?`${f} ${b}`:u,selected:M===s&&E===C.PREDEFINED}};if(re=[{type:Se.OPTION,inline:!0,onClick:()=>{E!==C.CUSTOM&&!t&&le({target:{value:r.withUnit(v.value,v.unit),name:typeof n=="string"?n:(n==null?void 0:n.fieldName)||""}})},label:"Custom",selected:E===C.CUSTOM}],x!=null&&x.length){const s=x.map(lt);re=[...re,...s]}return e.jsx("div",{className:E===C.PREDEFINED?mt(kt.predefinedMenuActive):"",children:e.jsxs(vt,{small:i,width:g,children:[x&&e.jsx(ht,{text:E===C.PREDEFINED?M==null?void 0:M.label:"",children:e.jsx(Te,{maxHeight:380,groupOrder:"first",testId:k&&`${k}-predefined-menu`,disabled:t,menu:{colored:!0,trigger:"Component",component:e.jsx(c,{groupOrder:"first",active:E===C.PREDEFINED,icon:E===C.PREDEFINED?"link":"unlink"}),small:i,sections:re}})}),e.jsx(ft,{type:"text",name:Ee,testId:k,disabled:t,placeholder:ce?_(I,v.unit,Ie,q):a,value:v.value,onChange:rt,onFocus:Jn,error:o||tt,warning:Yn,right:!d},Ee),ae&&(it||!Xn?e.jsx(gt,{groupOrder:"last",children:ae}):e.jsx(Te,{maxHeight:380,groupOrder:"last",disabled:l,testId:k&&`${k}-menu`,menu:{label:ae,trigger:"DropDownButton",small:i,sections:te.map(([s,u,f])=>{const b=f||u||"";return{type:"Option",label:isNaN(Number(s))?"":s,inline:!0,onClick:D=>{D.stopPropagation(),st(ce?"":s,u)},description:b,selected:b===ae,testId:`${k}-unit-${b}`}})}}))]})})};p.__docgenInfo={description:"",methods:[],displayName:"UnitInput",props:{name:{required:!0,tsType:{name:"union",raw:"string | { fieldName?: string }",elements:[{name:"string"},{name:"signature",type:"object",raw:"{ fieldName?: string }",signature:{properties:[{key:"fieldName",value:{name:"string",required:!1}}]}}]},description:""},placeholder:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:"''",computed:!1}},disabled:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},disabledUnit:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},error:{required:!1,tsType:{name:"union",raw:"string | null | boolean",elements:[{name:"string"},{name:"null"},{name:"boolean"}]},description:"",defaultValue:{value:"null",computed:!1}},left:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},small:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},width:{required:!1,tsType:{name:"union",raw:"string | number",elements:[{name:"string"},{name:"number"}]},description:"",defaultValue:{value:"'100%'",computed:!1}},value:{required:!1,tsType:{name:"string"},description:""},unitkey:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:"''",computed:!1}},initUnit:{required:!1,tsType:{name:"string"},description:""},noConversion:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},doNotConvertValue:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},testId:{required:!1,tsType:{name:"string"},description:""},warning:{required:!1,tsType:{name:"union",raw:"string | boolean | null",elements:[{name:"string"},{name:"boolean"},{name:"null"}]},description:"",defaultValue:{value:"null",computed:!1}},predefinedOptions:{required:!1,tsType:{name:"union",raw:"IPredefinedOption[] | null",elements:[{name:"Array",elements:[{name:"IPredefinedOption"}],raw:"IPredefinedOption[]"},{name:"null"}]},description:""},initialPredefinedOption:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},shouldLinkAutomaticly:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"true",computed:!1}},selectedPredefinedOptionKey:{required:!1,tsType:{name:"string"},description:""},validationCallback:{required:!1,tsType:{name:"signature",type:"function",raw:`(
2
2
  name: string,
3
3
  message: string | null,
4
- ) => { name: string; error: string | null }`,signature:{arguments:[{type:{name:"string"},name:"name"},{type:{name:"union",raw:"string | null",elements:[{name:"string"},{name:"null"}]},name:"message"}],return:{name:"signature",type:"object",raw:"{ name: string; error: string | null }",signature:{properties:[{key:"name",value:{name:"string",required:!0}},{key:"error",value:{name:"union",raw:"string | null",elements:[{name:"string"},{name:"null"}],required:!0}}]}}}},description:"",defaultValue:{value:"() => ({ name: '', error: null })",computed:!1}},disabledValidation:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},allowEmpty:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},autoValue:{required:!1,tsType:{name:"string"},description:""},onChange:{required:!1,tsType:{name:"signature",type:"function",raw:"(event: ChangeEvent<HTMLInputElement> | ICustomChangeEvent) => void",signature:{arguments:[{type:{name:"union",raw:"ChangeEvent<HTMLInputElement> | ICustomChangeEvent",elements:[{name:"ChangeEvent",elements:[{name:"HTMLInputElement"}],raw:"ChangeEvent<HTMLInputElement>"},{name:"ICustomChangeEvent"}]},name:"event"}],return:{name:"void"}}},description:"",defaultValue:{value:"() => {}",computed:!1}},onSwitchUnit:{required:!1,tsType:{name:"signature",type:"function",raw:"(unit: string) => void",signature:{arguments:[{type:{name:"string"},name:"unit"}],return:{name:"void"}}},description:"",defaultValue:{value:"() => {}",computed:!1}},onClick:{required:!1,tsType:{name:"MouseEventHandler",elements:[{name:"HTMLInputElement"}],raw:"MouseEventHandler<HTMLInputElement>"},description:"",defaultValue:{value:"() => {}",computed:!1}},onFocus:{required:!1,tsType:{name:"FocusEventHandler",elements:[{name:"HTMLInputElement"}],raw:"FocusEventHandler<HTMLInputElement>"},description:"",defaultValue:{value:"() => {}",computed:!1}},unitTemplate:{required:!1,tsType:{name:"Record",elements:[{name:"string"},{name:"any"}],raw:"Record<string, any>"},description:""}}};const{useArgs:qt}=__STORYBOOK_MODULE_PREVIEW_API__,ga={title:"Basic/UnitInput",component:p,args:{name:"example",unitkey:"length",value:"123|m"}},C=n=>{const[a,t]=qt(),l=o=>{t({value:o.target.value})};return e.jsx(p,{...n,onChange:l})},se=C.bind({}),F=C.bind({});F.args={initUnit:"ft",unitTemplate:{length:"ft"}};const O=C.bind({});O.args={value:'123|"',unitkey:'"'};const W=C.bind({});W.args={width:"180px"};const B=C.bind({});B.args={noConversion:!0};const R=C.bind({});R.args={small:!0};const H=C.bind({});H.args={error:"Error message goes here"};const L=C.bind({});L.args={value:"asas123asd|%"};const S=C.bind({});S.args={disabled:!0,disabledUnit:!0};S.parameters={docs:{description:{story:"Each part of UnitInput can be disabled separately. `disabled` disables only the main text input, `disabledUnit` disables only the unit menu. **Needs review (comes from Reservoir input requirements)**"}}};const K=C.bind({});K.args={disabled:!0,disabledUnit:!0,noConversion:!0};const z=C.bind({});z.args={disabledUnit:!0,unitkey:void 0};const $=C.bind({});$.args={disabledUnit:!0,unitkey:"length"};const G=C.bind({});G.args={disabledUnit:!1,disabled:!0};const N=n=>{const[a,t]=d.useState("123|m"),[l,o]=d.useState("223|m"),[c,i]=d.useState("ft");return e.jsxs(e.Fragment,{children:[e.jsx(m,{label:"Change initUnit",onClick:()=>i(c==="m"?"ft":"m")}),e.jsx(V,{}),e.jsx(m,{label:"Change value",onClick:()=>t(a==="123|m"?"456|m":"123|m")}),e.jsx(V,{}),e.jsx(p,{name:"example",onChange:g=>{t(g.target.value)},unitkey:"length",value:a,initUnit:c,onSwitchUnit:i}),e.jsx(V,{}),e.jsx(p,{name:"example2",onChange:g=>{o(g.target.value)},unitkey:"length",value:l,initUnit:c,onSwitchUnit:i}),e.jsx(Ut,{}),e.jsx("h4",{children:"Without initUnit property (taken from the redux store)"}),e.jsx(p,{name:"example",onChange:g=>{t(g.target.value)},unitkey:"length",value:a,onSwitchUnit:i}),e.jsx(p,{name:"example2",onChange:g=>{o(g.target.value)},unitkey:"length",value:l,onSwitchUnit:i})]})};N.parameters={docs:{description:{story:"[OW-4380](https://oliasoft.atlassian.net/browse/OW-4380?atlOrigin=eyJpIjoiMmM1N2RkNWU3Mjk5NDYxY2E0YzhkMzk5ZTVmZTJhMjciLCJwIjoiaiJ9)"}}};const J=C.bind({});J.args={predefinedOptions:[{label:"bottom of casing",value:"12|km"},{label:"mud weight at shoe depth",value:"8|mm"}]};const A=()=>{const n="500px",[a,t]=d.useState(void 0);return e.jsxs(e.Fragment,{children:[e.jsx("h4",{children:"Different edge cases such as +/- infinity, undefined, NaN, null:"}),e.jsxs(Kn,{children:[e.jsxs(ge,{width:"25%",children:[e.jsx(m,{label:"Change value infinity",onClick:()=>t(1/0)}),e.jsx("br",{}),e.jsx(m,{label:"Change value -infinity",onClick:()=>t(-1/0)}),e.jsx("br",{}),e.jsx(m,{label:"Change value null",onClick:()=>t(null)}),e.jsx("br",{}),e.jsx(m,{label:"Change value - undefined",onClick:()=>t(void 0)}),e.jsx("br",{}),e.jsx(m,{label:"Change value - NaN",onClick:()=>t(NaN)}),e.jsx("br",{}),e.jsx(m,{label:"Change value - nothing (empty)",onClick:()=>t(void 0)}),e.jsx("br",{}),e.jsx(m,{label:"Change value - empty string",onClick:()=>t("")})]}),e.jsxs(ge,{width:"25%",children:[e.jsx(m,{label:"Change value infinity|m",onClick:()=>t("Infinity|m")}),e.jsx("br",{}),e.jsx(m,{label:"Change value -infinity|m",onClick:()=>t("-Infinity|m")}),e.jsx("br",{}),e.jsx(m,{label:"Change value null|m",onClick:()=>t("null|m")}),e.jsx("br",{}),e.jsx(m,{label:"Change value - undefined|m",onClick:()=>t("undefined|m")}),e.jsx("br",{}),e.jsx(m,{label:"Change value - NaN|m",onClick:()=>t("NaN|m")}),e.jsx("br",{}),e.jsx(m,{label:"Change value - nothing (empty)|m",onClick:()=>t("|m")})]})]}),e.jsx("br",{}),e.jsx(w,{label:"Normal PUI",children:e.jsx(p,{name:"example1",onChange:l=>t(l.target.value),value:a,unitkey:"length",width:n,placeholder:"value|unit"})}),e.jsx(w,{label:"Disabled validation",children:e.jsx(p,{name:"example2",onChange:l=>t(l.target.value),value:a,unitkey:"length",disabledValidation:!0,width:n})}),e.jsx(w,{label:"Disabled validation and manual error",children:e.jsx(p,{name:"example3",onChange:l=>t(l.target.value),value:a,unitkey:"length",error:"test",disabledValidation:!0,width:n})}),e.jsx(he,{message:{heading:"Current value inside PUI: "+a,visible:!0}})]})},Y=()=>{const n="500px",[a,t]=d.useState("1|m"),[l,o]=d.useState("|m"),c="123|km";return e.jsxs(e.Fragment,{children:[e.jsx("h4",{children:"Different cases for automatic (placeholder) values:"}),e.jsx(Kn,{children:e.jsxs(ge,{width:"25%",children:[e.jsx(m,{label:"Change value to ''",onClick:()=>t("")}),e.jsx("br",{}),e.jsx(m,{label:"Change value to 1",onClick:()=>t("1")}),e.jsx("br",{}),e.jsx(m,{label:"Change value to 1|m",onClick:()=>t("1|m")}),e.jsx("br",{}),e.jsx(m,{label:"Change value to |m - empty value",onClick:()=>t("|m")})]})}),e.jsx("br",{}),e.jsx(w,{label:"Normal PUI (placeholder + auto)",children:e.jsx(p,{name:"example1",onChange:i=>t(i.target.value),value:a,unitkey:"length",width:n,placeholder:"value|unit",autoValue:c})}),e.jsx(w,{label:"Normal PUI (only auto)",children:e.jsx(p,{name:"example1",onChange:i=>t(i.target.value),value:a,unitkey:"length",width:n,autoValue:c})}),e.jsx(w,{label:"Empty PUI with autoValue",children:e.jsx(p,{name:"example1",onChange:i=>o(i.target.value),value:l,unitkey:"length",width:n,autoValue:c})}),e.jsx(w,{label:"Normal PUI (only placeholder)",children:e.jsx(p,{name:"example1",onChange:i=>t(i.target.value),value:a,unitkey:"length",width:n,placeholder:"Placeholder test"})}),e.jsx(w,{label:"Normal PUI (placeholder + allowEmpty)",children:e.jsx(p,{name:"example1",onChange:i=>t(i.target.value),value:a,unitkey:"length",width:n,placeholder:"Placeholder test",allowEmpty:!0})}),e.jsx(he,{message:{heading:"Current value inside PUI: "+a,visible:!0}})]})};A.parameters={docs:{description:{story:"[OW-8884](https://oliasoft.atlassian.net/browse/OW-8884)"}}};const Z=()=>{const[n,a]=d.useState("123|%"),[t,l]=d.useState(null),o="This should be visible when an error appears",c=(i,g)=>(l(g),{name:i,error:g});return e.jsxs(e.Fragment,{children:[e.jsx("h4",{children:"3rd party validation message when inputting invalid value:"}),e.jsx(p,{name:"example",onChange:i=>a(i.target.value),error:!t||o,validationCallback:c,value:n}),e.jsx("br",{}),e.jsx(V,{}),e.jsx("h4",{children:"Original validation message: "}),e.jsx(he,{message:{heading:t,visible:!0}})]})},Q=()=>{const[n,a]=d.useState("123|m"),[t,l]=d.useState(""),[o,c]=d.useState("km"),i=()=>{c("ft"),l("placeholder"),a("|m")};return e.jsxs(e.Fragment,{children:[e.jsx("h4",{children:"Empty value case:"}),e.jsx(p,{name:"example",onChange:g=>a(g.target.value),value:n,allowEmpty:!0,placeholder:t,initUnit:o,unitkey:"length"}),e.jsx("br",{}),e.jsx(V,{}),e.jsx(m,{label:"Change value |m and unit ft",onClick:()=>i()})]})},X=()=>{const[n,a]=d.useState("123|m"),[t,l]=d.useState("m");return e.jsxs(e.Fragment,{children:[e.jsx(p,{name:"example",onChange:o=>a(o.target.value),value:n,initUnit:t,unitkey:"length",onSwitchUnit:l}),e.jsx(V,{}),e.jsx(p,{name:"example",onChange:o=>a(o.target.value),value:n,initUnit:t,unitkey:"length",onSwitchUnit:l})]})},ee=()=>e.jsxs(e.Fragment,{children:[e.jsx(Ln,{faint:!0,children:"Reproduce OW-10614 rounding noise bug when storing values in a different unit to the display unit"}),e.jsx(V,{}),e.jsx(p,{name:"example",onChange:()=>{},value:r.withUnit(r.convertAndGetValue("9750|psi","bar"),"bar"),initUnit:"psi",unitkey:"pressure",unitTemplate:{pressure:"psi"}})]});N.__docgenInfo={description:"",methods:[],displayName:"TestExternalStateChangeWithSynchronizedUnits",props:{name:{required:!0,tsType:{name:"union",raw:"string | { fieldName?: string }",elements:[{name:"string"},{name:"signature",type:"object",raw:"{ fieldName?: string }",signature:{properties:[{key:"fieldName",value:{name:"string",required:!1}}]}}]},description:""},placeholder:{required:!1,tsType:{name:"string"},description:""},disabled:{required:!1,tsType:{name:"boolean"},description:""},disabledUnit:{required:!1,tsType:{name:"boolean"},description:""},error:{required:!1,tsType:{name:"union",raw:"string | null | boolean",elements:[{name:"string"},{name:"null"},{name:"boolean"}]},description:""},left:{required:!1,tsType:{name:"boolean"},description:""},small:{required:!1,tsType:{name:"boolean"},description:""},width:{required:!1,tsType:{name:"union",raw:"string | number",elements:[{name:"string"},{name:"number"}]},description:""},value:{required:!1,tsType:{name:"string"},description:""},unitkey:{required:!1,tsType:{name:"string"},description:""},initUnit:{required:!1,tsType:{name:"string"},description:""},noConversion:{required:!1,tsType:{name:"boolean"},description:""},doNotConvertValue:{required:!1,tsType:{name:"boolean"},description:""},testId:{required:!1,tsType:{name:"string"},description:""},warning:{required:!1,tsType:{name:"union",raw:"string | boolean | null",elements:[{name:"string"},{name:"boolean"},{name:"null"}]},description:""},predefinedOptions:{required:!1,tsType:{name:"union",raw:"IPredefinedOption[] | null",elements:[{name:"Array",elements:[{name:"IPredefinedOption"}],raw:"IPredefinedOption[]"},{name:"null"}]},description:""},initialPredefinedOption:{required:!1,tsType:{name:"boolean"},description:""},shouldLinkAutomaticly:{required:!1,tsType:{name:"boolean"},description:""},selectedPredefinedOptionKey:{required:!1,tsType:{name:"string"},description:""},validationCallback:{required:!1,tsType:{name:"signature",type:"function",raw:`(
4
+ ) => { name: string; error: string | null }`,signature:{arguments:[{type:{name:"string"},name:"name"},{type:{name:"union",raw:"string | null",elements:[{name:"string"},{name:"null"}]},name:"message"}],return:{name:"signature",type:"object",raw:"{ name: string; error: string | null }",signature:{properties:[{key:"name",value:{name:"string",required:!0}},{key:"error",value:{name:"union",raw:"string | null",elements:[{name:"string"},{name:"null"}],required:!0}}]}}}},description:"",defaultValue:{value:"() => ({ name: '', error: null })",computed:!1}},disabledValidation:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},allowEmpty:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},autoValue:{required:!1,tsType:{name:"string"},description:""},onChange:{required:!1,tsType:{name:"signature",type:"function",raw:"(event: ChangeEvent<HTMLInputElement> | ICustomChangeEvent) => void",signature:{arguments:[{type:{name:"union",raw:"ChangeEvent<HTMLInputElement> | ICustomChangeEvent",elements:[{name:"ChangeEvent",elements:[{name:"HTMLInputElement"}],raw:"ChangeEvent<HTMLInputElement>"},{name:"ICustomChangeEvent"}]},name:"event"}],return:{name:"void"}}},description:"",defaultValue:{value:"() => {}",computed:!1}},onSwitchUnit:{required:!1,tsType:{name:"signature",type:"function",raw:"(unit: string) => void",signature:{arguments:[{type:{name:"string"},name:"unit"}],return:{name:"void"}}},description:"",defaultValue:{value:"() => {}",computed:!1}},onClick:{required:!1,tsType:{name:"MouseEventHandler",elements:[{name:"HTMLInputElement"}],raw:"MouseEventHandler<HTMLInputElement>"},description:"",defaultValue:{value:"() => {}",computed:!1}},onFocus:{required:!1,tsType:{name:"FocusEventHandler",elements:[{name:"HTMLInputElement"}],raw:"FocusEventHandler<HTMLInputElement>"},description:"",defaultValue:{value:"() => {}",computed:!1}},unitTemplate:{required:!1,tsType:{name:"Record",elements:[{name:"string"},{name:"any"}],raw:"Record<string, any>"},description:""}}};const{useArgs:Tt}=__STORYBOOK_MODULE_PREVIEW_API__,da={title:"Basic/UnitInput",component:p,args:{name:"example",unitkey:"length",value:"123|m"}},y=n=>{const[a,t]=Tt(),l=o=>{t({value:o.target.value})};return e.jsx(p,{...n,onChange:l})},se=y.bind({}),F=y.bind({});F.args={initUnit:"ft",unitTemplate:{length:"ft"}};const O=y.bind({});O.args={value:'123|"',unitkey:'"'};const W=y.bind({});W.args={width:"180px"};const B=y.bind({});B.args={noConversion:!0};const R=y.bind({});R.args={small:!0};const H=y.bind({});H.args={error:"Error message goes here"};const L=y.bind({});L.args={value:"asas123asd|%"};const S=y.bind({});S.args={disabled:!0,disabledUnit:!0};S.parameters={docs:{description:{story:"Each part of UnitInput can be disabled separately. `disabled` disables only the main text input, `disabledUnit` disables only the unit menu. **Needs review (comes from Reservoir input requirements)**"}}};const K=y.bind({});K.args={disabled:!0,disabledUnit:!0,noConversion:!0};const $=y.bind({});$.args={disabledUnit:!0,unitkey:void 0};const z=y.bind({});z.args={disabledUnit:!0,unitkey:"length"};const G=y.bind({});G.args={disabledUnit:!1,disabled:!0};const N=n=>{const[a,t]=m.useState("123|m"),[l,o]=m.useState("223|m"),[d,i]=m.useState("ft");return e.jsxs(e.Fragment,{children:[e.jsx(c,{label:"Change initUnit",onClick:()=>i(d==="m"?"ft":"m")}),e.jsx(V,{}),e.jsx(c,{label:"Change value",onClick:()=>t(a==="123|m"?"456|m":"123|m")}),e.jsx(V,{}),e.jsx(p,{name:"example",onChange:g=>{t(g.target.value)},unitkey:"length",value:a,initUnit:d,onSwitchUnit:i}),e.jsx(V,{}),e.jsx(p,{name:"example2",onChange:g=>{o(g.target.value)},unitkey:"length",value:l,initUnit:d,onSwitchUnit:i}),e.jsx(yt,{}),e.jsx("h4",{children:"Without initUnit property (taken from the redux store)"}),e.jsx(p,{name:"example",onChange:g=>{t(g.target.value)},unitkey:"length",value:a,onSwitchUnit:i}),e.jsx(p,{name:"example2",onChange:g=>{o(g.target.value)},unitkey:"length",value:l,onSwitchUnit:i})]})};N.parameters={docs:{description:{story:"[OW-4380](https://oliasoft.atlassian.net/browse/OW-4380?atlOrigin=eyJpIjoiMmM1N2RkNWU3Mjk5NDYxY2E0YzhkMzk5ZTVmZTJhMjciLCJwIjoiaiJ9)"}}};const J=y.bind({});J.args={predefinedOptions:[{label:"bottom of casing",value:"12|km"},{label:"mud weight at shoe depth",value:"8|mm"}]};const A=()=>{const n="500px",[a,t]=m.useState(void 0);return e.jsxs(e.Fragment,{children:[e.jsx("h4",{children:"Different edge cases such as +/- infinity, undefined, NaN, null:"}),e.jsxs(Kn,{children:[e.jsxs(ge,{width:"25%",children:[e.jsx(c,{label:"Change value infinity",onClick:()=>t(1/0)}),e.jsx("br",{}),e.jsx(c,{label:"Change value -infinity",onClick:()=>t(-1/0)}),e.jsx("br",{}),e.jsx(c,{label:"Change value null",onClick:()=>t(null)}),e.jsx("br",{}),e.jsx(c,{label:"Change value - undefined",onClick:()=>t(void 0)}),e.jsx("br",{}),e.jsx(c,{label:"Change value - NaN",onClick:()=>t(NaN)}),e.jsx("br",{}),e.jsx(c,{label:"Change value - nothing (empty)",onClick:()=>t(void 0)}),e.jsx("br",{}),e.jsx(c,{label:"Change value - empty string",onClick:()=>t("")})]}),e.jsxs(ge,{width:"25%",children:[e.jsx(c,{label:"Change value infinity|m",onClick:()=>t("Infinity|m")}),e.jsx("br",{}),e.jsx(c,{label:"Change value -infinity|m",onClick:()=>t("-Infinity|m")}),e.jsx("br",{}),e.jsx(c,{label:"Change value null|m",onClick:()=>t("null|m")}),e.jsx("br",{}),e.jsx(c,{label:"Change value - undefined|m",onClick:()=>t("undefined|m")}),e.jsx("br",{}),e.jsx(c,{label:"Change value - NaN|m",onClick:()=>t("NaN|m")}),e.jsx("br",{}),e.jsx(c,{label:"Change value - nothing (empty)|m",onClick:()=>t("|m")})]})]}),e.jsx("br",{}),e.jsx(w,{label:"Normal PUI",children:e.jsx(p,{name:"example1",onChange:l=>t(l.target.value),value:a,unitkey:"length",width:n,placeholder:"value|unit"})}),e.jsx(w,{label:"Disabled validation",children:e.jsx(p,{name:"example2",onChange:l=>t(l.target.value),value:a,unitkey:"length",disabledValidation:!0,width:n})}),e.jsx(w,{label:"Disabled validation and manual error",children:e.jsx(p,{name:"example3",onChange:l=>t(l.target.value),value:a,unitkey:"length",error:"test",disabledValidation:!0,width:n})}),e.jsx(he,{message:{heading:"Current value inside PUI: "+a,visible:!0}})]})},Y=()=>{const n="500px",[a,t]=m.useState("1|m"),[l,o]=m.useState("|m"),d="123|km";return e.jsxs(e.Fragment,{children:[e.jsx("h4",{children:"Different cases for automatic (placeholder) values:"}),e.jsx(Kn,{children:e.jsxs(ge,{width:"25%",children:[e.jsx(c,{label:"Change value to ''",onClick:()=>t("")}),e.jsx("br",{}),e.jsx(c,{label:"Change value to 1",onClick:()=>t("1")}),e.jsx("br",{}),e.jsx(c,{label:"Change value to 1|m",onClick:()=>t("1|m")}),e.jsx("br",{}),e.jsx(c,{label:"Change value to |m - empty value",onClick:()=>t("|m")})]})}),e.jsx("br",{}),e.jsx(w,{label:"Normal PUI (placeholder + auto)",children:e.jsx(p,{name:"example1",onChange:i=>t(i.target.value),value:a,unitkey:"length",width:n,placeholder:"value|unit",autoValue:d})}),e.jsx(w,{label:"Normal PUI (only auto)",children:e.jsx(p,{name:"example1",onChange:i=>t(i.target.value),value:a,unitkey:"length",width:n,autoValue:d})}),e.jsx(w,{label:"Empty PUI with autoValue",children:e.jsx(p,{name:"example1",onChange:i=>o(i.target.value),value:l,unitkey:"length",width:n,autoValue:d})}),e.jsx(w,{label:"Normal PUI (only placeholder)",children:e.jsx(p,{name:"example1",onChange:i=>t(i.target.value),value:a,unitkey:"length",width:n,placeholder:"Placeholder test"})}),e.jsx(w,{label:"Normal PUI (placeholder + allowEmpty)",children:e.jsx(p,{name:"example1",onChange:i=>t(i.target.value),value:a,unitkey:"length",width:n,placeholder:"Placeholder test",allowEmpty:!0})}),e.jsx(he,{message:{heading:"Current value inside PUI: "+a,visible:!0}})]})};A.parameters={docs:{description:{story:"[OW-8884](https://oliasoft.atlassian.net/browse/OW-8884)"}}};const Z=()=>{const[n,a]=m.useState("123|%"),[t,l]=m.useState(null),o="This should be visible when an error appears",d=(i,g)=>(l(g),{name:i,error:g});return e.jsxs(e.Fragment,{children:[e.jsx("h4",{children:"3rd party validation message when inputting invalid value:"}),e.jsx(p,{name:"example",onChange:i=>a(i.target.value),error:!t||o,validationCallback:d,value:n}),e.jsx("br",{}),e.jsx(V,{}),e.jsx("h4",{children:"Original validation message: "}),e.jsx(he,{message:{heading:t,visible:!0}})]})},Q=()=>{const[n,a]=m.useState("123|m"),[t,l]=m.useState(""),[o,d]=m.useState("km"),i=()=>{d("ft"),l("placeholder"),a("|m")};return e.jsxs(e.Fragment,{children:[e.jsx("h4",{children:"Empty value case:"}),e.jsx(p,{name:"example",onChange:g=>a(g.target.value),value:n,allowEmpty:!0,placeholder:t,initUnit:o,unitkey:"length"}),e.jsx("br",{}),e.jsx(V,{}),e.jsx(c,{label:"Change value |m and unit ft",onClick:()=>i()})]})},X=()=>{const[n,a]=m.useState("123|m"),[t,l]=m.useState("m");return e.jsxs(e.Fragment,{children:[e.jsx(p,{name:"example",onChange:o=>a(o.target.value),value:n,initUnit:t,unitkey:"length",onSwitchUnit:l}),e.jsx(V,{}),e.jsx(p,{name:"example",onChange:o=>a(o.target.value),value:n,initUnit:t,unitkey:"length",onSwitchUnit:l})]})},ee=()=>e.jsxs(e.Fragment,{children:[e.jsx(Ln,{faint:!0,children:"Reproduce OW-10614 rounding noise bug when storing values in a different unit to the display unit"}),e.jsx(V,{}),e.jsx(p,{name:"example",onChange:()=>{},value:r.withUnit(r.convertAndGetValue("9750|psi","bar"),"bar"),initUnit:"psi",unitkey:"pressure",unitTemplate:{pressure:"psi"}})]});N.__docgenInfo={description:"",methods:[],displayName:"TestExternalStateChangeWithSynchronizedUnits",props:{name:{required:!0,tsType:{name:"union",raw:"string | { fieldName?: string }",elements:[{name:"string"},{name:"signature",type:"object",raw:"{ fieldName?: string }",signature:{properties:[{key:"fieldName",value:{name:"string",required:!1}}]}}]},description:""},placeholder:{required:!1,tsType:{name:"string"},description:""},disabled:{required:!1,tsType:{name:"boolean"},description:""},disabledUnit:{required:!1,tsType:{name:"boolean"},description:""},error:{required:!1,tsType:{name:"union",raw:"string | null | boolean",elements:[{name:"string"},{name:"null"},{name:"boolean"}]},description:""},left:{required:!1,tsType:{name:"boolean"},description:""},small:{required:!1,tsType:{name:"boolean"},description:""},width:{required:!1,tsType:{name:"union",raw:"string | number",elements:[{name:"string"},{name:"number"}]},description:""},value:{required:!1,tsType:{name:"string"},description:""},unitkey:{required:!1,tsType:{name:"string"},description:""},initUnit:{required:!1,tsType:{name:"string"},description:""},noConversion:{required:!1,tsType:{name:"boolean"},description:""},doNotConvertValue:{required:!1,tsType:{name:"boolean"},description:""},testId:{required:!1,tsType:{name:"string"},description:""},warning:{required:!1,tsType:{name:"union",raw:"string | boolean | null",elements:[{name:"string"},{name:"boolean"},{name:"null"}]},description:""},predefinedOptions:{required:!1,tsType:{name:"union",raw:"IPredefinedOption[] | null",elements:[{name:"Array",elements:[{name:"IPredefinedOption"}],raw:"IPredefinedOption[]"},{name:"null"}]},description:""},initialPredefinedOption:{required:!1,tsType:{name:"boolean"},description:""},shouldLinkAutomaticly:{required:!1,tsType:{name:"boolean"},description:""},selectedPredefinedOptionKey:{required:!1,tsType:{name:"string"},description:""},validationCallback:{required:!1,tsType:{name:"signature",type:"function",raw:`(
5
5
  name: string,
6
6
  message: string | null,
7
- ) => { name: string; error: string | null }`,signature:{arguments:[{type:{name:"string"},name:"name"},{type:{name:"union",raw:"string | null",elements:[{name:"string"},{name:"null"}]},name:"message"}],return:{name:"signature",type:"object",raw:"{ name: string; error: string | null }",signature:{properties:[{key:"name",value:{name:"string",required:!0}},{key:"error",value:{name:"union",raw:"string | null",elements:[{name:"string"},{name:"null"}],required:!0}}]}}}},description:""},disabledValidation:{required:!1,tsType:{name:"boolean"},description:""},allowEmpty:{required:!1,tsType:{name:"boolean"},description:""},autoValue:{required:!1,tsType:{name:"string"},description:""},onChange:{required:!0,tsType:{name:"signature",type:"function",raw:"(event: ChangeEvent<HTMLInputElement> | ICustomChangeEvent) => void",signature:{arguments:[{type:{name:"union",raw:"ChangeEvent<HTMLInputElement> | ICustomChangeEvent",elements:[{name:"ChangeEvent",elements:[{name:"HTMLInputElement"}],raw:"ChangeEvent<HTMLInputElement>"},{name:"ICustomChangeEvent"}]},name:"event"}],return:{name:"void"}}},description:""},onSwitchUnit:{required:!1,tsType:{name:"signature",type:"function",raw:"(unit: string) => void",signature:{arguments:[{type:{name:"string"},name:"unit"}],return:{name:"void"}}},description:""},onClick:{required:!1,tsType:{name:"MouseEventHandler",elements:[{name:"HTMLInputElement"}],raw:"MouseEventHandler<HTMLInputElement>"},description:""},onFocus:{required:!1,tsType:{name:"FocusEventHandler",elements:[{name:"HTMLInputElement"}],raw:"FocusEventHandler<HTMLInputElement>"},description:""},unitTemplate:{required:!1,tsType:{name:"Record",elements:[{name:"string"},{name:"any"}],raw:"Record<string, any>"},description:""}}};A.__docgenInfo={description:"",methods:[],displayName:"TestEdgeCases"};Y.__docgenInfo={description:"",methods:[],displayName:"AutomaticValues"};Z.__docgenInfo={description:"",methods:[],displayName:"ValidationCallback"};Q.__docgenInfo={description:"",methods:[],displayName:"AllowEmptyPUI"};X.__docgenInfo={description:"",methods:[],displayName:"onSwitchUnit"};ee.__docgenInfo={description:"",methods:[],displayName:"OW_10614TestCase"};var Pe,Me,_e;se.parameters={...se.parameters,docs:{...(Pe=se.parameters)==null?void 0:Pe.docs,source:{originalSource:`args => {
7
+ ) => { name: string; error: string | null }`,signature:{arguments:[{type:{name:"string"},name:"name"},{type:{name:"union",raw:"string | null",elements:[{name:"string"},{name:"null"}]},name:"message"}],return:{name:"signature",type:"object",raw:"{ name: string; error: string | null }",signature:{properties:[{key:"name",value:{name:"string",required:!0}},{key:"error",value:{name:"union",raw:"string | null",elements:[{name:"string"},{name:"null"}],required:!0}}]}}}},description:""},disabledValidation:{required:!1,tsType:{name:"boolean"},description:""},allowEmpty:{required:!1,tsType:{name:"boolean"},description:""},autoValue:{required:!1,tsType:{name:"string"},description:""},onChange:{required:!0,tsType:{name:"signature",type:"function",raw:"(event: ChangeEvent<HTMLInputElement> | ICustomChangeEvent) => void",signature:{arguments:[{type:{name:"union",raw:"ChangeEvent<HTMLInputElement> | ICustomChangeEvent",elements:[{name:"ChangeEvent",elements:[{name:"HTMLInputElement"}],raw:"ChangeEvent<HTMLInputElement>"},{name:"ICustomChangeEvent"}]},name:"event"}],return:{name:"void"}}},description:""},onSwitchUnit:{required:!1,tsType:{name:"signature",type:"function",raw:"(unit: string) => void",signature:{arguments:[{type:{name:"string"},name:"unit"}],return:{name:"void"}}},description:""},onClick:{required:!1,tsType:{name:"MouseEventHandler",elements:[{name:"HTMLInputElement"}],raw:"MouseEventHandler<HTMLInputElement>"},description:""},onFocus:{required:!1,tsType:{name:"FocusEventHandler",elements:[{name:"HTMLInputElement"}],raw:"FocusEventHandler<HTMLInputElement>"},description:""},unitTemplate:{required:!1,tsType:{name:"Record",elements:[{name:"string"},{name:"any"}],raw:"Record<string, any>"},description:""}}};A.__docgenInfo={description:"",methods:[],displayName:"TestEdgeCases"};Y.__docgenInfo={description:"",methods:[],displayName:"AutomaticValues"};Z.__docgenInfo={description:"",methods:[],displayName:"ValidationCallback"};Q.__docgenInfo={description:"",methods:[],displayName:"AllowEmptyPUI"};X.__docgenInfo={description:"",methods:[],displayName:"onSwitchUnit"};ee.__docgenInfo={description:"",methods:[],displayName:"OW_10614TestCase"};var Pe,Me,De;se.parameters={...se.parameters,docs:{...(Pe=se.parameters)==null?void 0:Pe.docs,source:{originalSource:`args => {
8
8
  const [_, updateArgs] = useArgs();
9
9
  const handleChange = (evt: any) => {
10
10
  updateArgs({
@@ -12,7 +12,7 @@ import{j as e}from"./jsx-runtime-eps93zm2.js";import{r as d}from"./index-DhsZuJv
12
12
  });
13
13
  };
14
14
  return <UnitInput {...args} onChange={handleChange} />;
15
- }`,...(_e=(Me=se.parameters)==null?void 0:Me.docs)==null?void 0:_e.source}}};var De,Fe,Oe;F.parameters={...F.parameters,docs:{...(De=F.parameters)==null?void 0:De.docs,source:{originalSource:`args => {
15
+ }`,...(De=(Me=se.parameters)==null?void 0:Me.docs)==null?void 0:De.source}}};var _e,Fe,Oe;F.parameters={...F.parameters,docs:{...(_e=F.parameters)==null?void 0:_e.docs,source:{originalSource:`args => {
16
16
  const [_, updateArgs] = useArgs();
17
17
  const handleChange = (evt: any) => {
18
18
  updateArgs({
@@ -36,7 +36,7 @@ import{j as e}from"./jsx-runtime-eps93zm2.js";import{r as d}from"./index-DhsZuJv
36
36
  });
37
37
  };
38
38
  return <UnitInput {...args} onChange={handleChange} />;
39
- }`,...(Ke=(Le=W.parameters)==null?void 0:Le.docs)==null?void 0:Ke.source}}};var ze,$e,Ge;B.parameters={...B.parameters,docs:{...(ze=B.parameters)==null?void 0:ze.docs,source:{originalSource:`args => {
39
+ }`,...(Ke=(Le=W.parameters)==null?void 0:Le.docs)==null?void 0:Ke.source}}};var $e,ze,Ge;B.parameters={...B.parameters,docs:{...($e=B.parameters)==null?void 0:$e.docs,source:{originalSource:`args => {
40
40
  const [_, updateArgs] = useArgs();
41
41
  const handleChange = (evt: any) => {
42
42
  updateArgs({
@@ -44,7 +44,7 @@ import{j as e}from"./jsx-runtime-eps93zm2.js";import{r as d}from"./index-DhsZuJv
44
44
  });
45
45
  };
46
46
  return <UnitInput {...args} onChange={handleChange} />;
47
- }`,...(Ge=($e=B.parameters)==null?void 0:$e.docs)==null?void 0:Ge.source}}};var Je,Ye,Ze;R.parameters={...R.parameters,docs:{...(Je=R.parameters)==null?void 0:Je.docs,source:{originalSource:`args => {
47
+ }`,...(Ge=(ze=B.parameters)==null?void 0:ze.docs)==null?void 0:Ge.source}}};var Je,Ye,Ze;R.parameters={...R.parameters,docs:{...(Je=R.parameters)==null?void 0:Je.docs,source:{originalSource:`args => {
48
48
  const [_, updateArgs] = useArgs();
49
49
  const handleChange = (evt: any) => {
50
50
  updateArgs({
@@ -84,7 +84,7 @@ import{j as e}from"./jsx-runtime-eps93zm2.js";import{r as d}from"./index-DhsZuJv
84
84
  });
85
85
  };
86
86
  return <UnitInput {...args} onChange={handleChange} />;
87
- }`,...(dn=(on=K.parameters)==null?void 0:on.docs)==null?void 0:dn.source}}};var cn,mn,pn;z.parameters={...z.parameters,docs:{...(cn=z.parameters)==null?void 0:cn.docs,source:{originalSource:`args => {
87
+ }`,...(dn=(on=K.parameters)==null?void 0:on.docs)==null?void 0:dn.source}}};var cn,mn,pn;$.parameters={...$.parameters,docs:{...(cn=$.parameters)==null?void 0:cn.docs,source:{originalSource:`args => {
88
88
  const [_, updateArgs] = useArgs();
89
89
  const handleChange = (evt: any) => {
90
90
  updateArgs({
@@ -92,7 +92,7 @@ import{j as e}from"./jsx-runtime-eps93zm2.js";import{r as d}from"./index-DhsZuJv
92
92
  });
93
93
  };
94
94
  return <UnitInput {...args} onChange={handleChange} />;
95
- }`,...(pn=(mn=z.parameters)==null?void 0:mn.docs)==null?void 0:pn.source}}};var gn,hn,vn;$.parameters={...$.parameters,docs:{...(gn=$.parameters)==null?void 0:gn.docs,source:{originalSource:`args => {
95
+ }`,...(pn=(mn=$.parameters)==null?void 0:mn.docs)==null?void 0:pn.source}}};var gn,hn,vn;z.parameters={...z.parameters,docs:{...(gn=z.parameters)==null?void 0:gn.docs,source:{originalSource:`args => {
96
96
  const [_, updateArgs] = useArgs();
97
97
  const handleChange = (evt: any) => {
98
98
  updateArgs({
@@ -100,7 +100,7 @@ import{j as e}from"./jsx-runtime-eps93zm2.js";import{r as d}from"./index-DhsZuJv
100
100
  });
101
101
  };
102
102
  return <UnitInput {...args} onChange={handleChange} />;
103
- }`,...(vn=(hn=$.parameters)==null?void 0:hn.docs)==null?void 0:vn.source}}};var fn,Cn,yn;G.parameters={...G.parameters,docs:{...(fn=G.parameters)==null?void 0:fn.docs,source:{originalSource:`args => {
103
+ }`,...(vn=(hn=z.parameters)==null?void 0:hn.docs)==null?void 0:vn.source}}};var fn,yn,Cn;G.parameters={...G.parameters,docs:{...(fn=G.parameters)==null?void 0:fn.docs,source:{originalSource:`args => {
104
104
  const [_, updateArgs] = useArgs();
105
105
  const handleChange = (evt: any) => {
106
106
  updateArgs({
@@ -108,7 +108,7 @@ import{j as e}from"./jsx-runtime-eps93zm2.js";import{r as d}from"./index-DhsZuJv
108
108
  });
109
109
  };
110
110
  return <UnitInput {...args} onChange={handleChange} />;
111
- }`,...(yn=(Cn=G.parameters)==null?void 0:Cn.docs)==null?void 0:yn.source}}};var bn,Un,xn;N.parameters={...N.parameters,docs:{...(bn=N.parameters)==null?void 0:bn.docs,source:{originalSource:`(args: IUnitInputProps) => {
111
+ }`,...(Cn=(yn=G.parameters)==null?void 0:yn.docs)==null?void 0:Cn.source}}};var bn,Un,xn;N.parameters={...N.parameters,docs:{...(bn=N.parameters)==null?void 0:bn.docs,source:{originalSource:`(args: IUnitInputProps) => {
112
112
  const [value, setValue] = useState('123|m');
113
113
  const [value2, setValue2] = useState('223|m');
114
114
  const [initUnit, setInitUnit] = useState('ft');
@@ -117,19 +117,19 @@ import{j as e}from"./jsx-runtime-eps93zm2.js";import{r as d}from"./index-DhsZuJv
117
117
  <Spacer />
118
118
  <Button label="Change value" onClick={() => setValue(value === '123|m' ? '456|m' : '123|m')} />
119
119
  <Spacer />
120
- <UnitInput name="example" onChange={(evt: ChangeEvent | any) => {
120
+ <UnitInput name="example" onChange={evt => {
121
121
  setValue(evt.target.value);
122
122
  }} unitkey="length" value={value} initUnit={initUnit} onSwitchUnit={setInitUnit} />
123
123
  <Spacer />
124
- <UnitInput name="example2" onChange={(evt: ChangeEvent | any) => {
124
+ <UnitInput name="example2" onChange={evt => {
125
125
  setValue2(evt.target.value);
126
126
  }} unitkey="length" value={value2} initUnit={initUnit} onSwitchUnit={setInitUnit} />
127
127
  <Divider />
128
128
  <h4>Without initUnit property (taken from the redux store)</h4>
129
- <UnitInput name="example" onChange={(evt: ChangeEvent | any) => {
129
+ <UnitInput name="example" onChange={evt => {
130
130
  setValue(evt.target.value);
131
131
  }} unitkey="length" value={value} onSwitchUnit={setInitUnit} />
132
- <UnitInput name="example2" onChange={(evt: ChangeEvent | any) => {
132
+ <UnitInput name="example2" onChange={evt => {
133
133
  setValue2(evt.target.value);
134
134
  }} unitkey="length" value={value2} onSwitchUnit={setInitUnit} />
135
135
  </>;
@@ -141,7 +141,7 @@ import{j as e}from"./jsx-runtime-eps93zm2.js";import{r as d}from"./index-DhsZuJv
141
141
  });
142
142
  };
143
143
  return <UnitInput {...args} onChange={handleChange} />;
144
- }`,...(Vn=(wn=J.parameters)==null?void 0:wn.docs)==null?void 0:Vn.source}}};var En,jn,kn;A.parameters={...A.parameters,docs:{...(En=A.parameters)==null?void 0:En.docs,source:{originalSource:`() => {
144
+ }`,...(Vn=(wn=J.parameters)==null?void 0:wn.docs)==null?void 0:Vn.source}}};var jn,En,kn;A.parameters={...A.parameters,docs:{...(jn=A.parameters)==null?void 0:jn.docs,source:{originalSource:`() => {
145
145
  const width = '500px';
146
146
  const [value, setValue] = useState<any>(undefined);
147
147
  return <>
@@ -178,20 +178,20 @@ import{j as e}from"./jsx-runtime-eps93zm2.js";import{r as d}from"./index-DhsZuJv
178
178
  </Row>
179
179
  <br />
180
180
  <Field label="Normal PUI">
181
- <UnitInput name="example1" onChange={(evt: ChangeEvent | any) => setValue(evt.target.value)} value={value} unitkey="length" width={width} placeholder="value|unit" />
181
+ <UnitInput name="example1" onChange={evt => setValue(evt.target.value)} value={value} unitkey="length" width={width} placeholder="value|unit" />
182
182
  </Field>
183
183
  <Field label="Disabled validation">
184
- <UnitInput name="example2" onChange={(evt: ChangeEvent | any) => setValue(evt.target.value)} value={value} unitkey="length" disabledValidation width={width} />
184
+ <UnitInput name="example2" onChange={evt => setValue(evt.target.value)} value={value} unitkey="length" disabledValidation width={width} />
185
185
  </Field>
186
186
  <Field label="Disabled validation and manual error">
187
- <UnitInput name="example3" onChange={(evt: ChangeEvent | any) => setValue(evt.target.value)} value={value} unitkey="length" error="test" disabledValidation width={width} />
187
+ <UnitInput name="example3" onChange={evt => setValue(evt.target.value)} value={value} unitkey="length" error="test" disabledValidation width={width} />
188
188
  </Field>
189
189
  <Message message={{
190
190
  heading: 'Current value inside PUI: ' + value,
191
191
  visible: true
192
192
  }} />
193
193
  </>;
194
- }`,...(kn=(jn=A.parameters)==null?void 0:jn.docs)==null?void 0:kn.source}}};var Tn,Sn,Nn;Y.parameters={...Y.parameters,docs:{...(Tn=Y.parameters)==null?void 0:Tn.docs,source:{originalSource:`() => {
194
+ }`,...(kn=(En=A.parameters)==null?void 0:En.docs)==null?void 0:kn.source}}};var Tn,Sn,Nn;Y.parameters={...Y.parameters,docs:{...(Tn=Y.parameters)==null?void 0:Tn.docs,source:{originalSource:`() => {
195
195
  const width = '500px';
196
196
  const [value, setValue] = useState<string>('1|m');
197
197
  const [valueB, setValueB] = useState('|m');
@@ -211,19 +211,19 @@ import{j as e}from"./jsx-runtime-eps93zm2.js";import{r as d}from"./index-DhsZuJv
211
211
  </Row>
212
212
  <br />
213
213
  <Field label="Normal PUI (placeholder + auto)">
214
- <UnitInput name="example1" onChange={(evt: ChangeEvent | any) => setValue(evt.target.value)} value={value} unitkey="length" width={width} placeholder="value|unit" autoValue={automaticValue} />
214
+ <UnitInput name="example1" onChange={evt => setValue(evt.target.value)} value={value} unitkey="length" width={width} placeholder="value|unit" autoValue={automaticValue} />
215
215
  </Field>
216
216
  <Field label="Normal PUI (only auto)">
217
- <UnitInput name="example1" onChange={(evt: ChangeEvent | any) => setValue(evt.target.value)} value={value} unitkey="length" width={width} autoValue={automaticValue} />
217
+ <UnitInput name="example1" onChange={evt => setValue(evt.target.value)} value={value} unitkey="length" width={width} autoValue={automaticValue} />
218
218
  </Field>
219
219
  <Field label="Empty PUI with autoValue">
220
- <UnitInput name="example1" onChange={(evt: ChangeEvent | any) => setValueB(evt.target.value)} value={valueB} unitkey="length" width={width} autoValue={automaticValue} />
220
+ <UnitInput name="example1" onChange={evt => setValueB(evt.target.value)} value={valueB} unitkey="length" width={width} autoValue={automaticValue} />
221
221
  </Field>
222
222
  <Field label="Normal PUI (only placeholder)">
223
- <UnitInput name="example1" onChange={(evt: ChangeEvent | any) => setValue(evt.target.value)} value={value} unitkey="length" width={width} placeholder="Placeholder test" />
223
+ <UnitInput name="example1" onChange={evt => setValue(evt.target.value)} value={value} unitkey="length" width={width} placeholder="Placeholder test" />
224
224
  </Field>
225
225
  <Field label="Normal PUI (placeholder + allowEmpty)">
226
- <UnitInput name="example1" onChange={(evt: ChangeEvent | any) => setValue(evt.target.value)} value={value} unitkey="length" width={width} placeholder="Placeholder test" allowEmpty />
226
+ <UnitInput name="example1" onChange={evt => setValue(evt.target.value)} value={value} unitkey="length" width={width} placeholder="Placeholder test" allowEmpty />
227
227
  </Field>
228
228
  <Message message={{
229
229
  heading: 'Current value inside PUI: ' + value,
@@ -243,7 +243,7 @@ import{j as e}from"./jsx-runtime-eps93zm2.js";import{r as d}from"./index-DhsZuJv
243
243
  };
244
244
  return <>
245
245
  <h4>3rd party validation message when inputting invalid value:</h4>
246
- <UnitInput name="example" onChange={(evt: ChangeEvent | any) => setValue(evt.target.value)} error={!validation || predictedMessage} validationCallback={handleValidation} value={value} />
246
+ <UnitInput name="example" onChange={evt => setValue(evt.target.value)} error={!validation || predictedMessage} validationCallback={handleValidation} value={value} />
247
247
  <br />
248
248
  <Spacer />
249
249
  <h4>Original validation message: </h4>
@@ -252,7 +252,7 @@ import{j as e}from"./jsx-runtime-eps93zm2.js";import{r as d}from"./index-DhsZuJv
252
252
  visible: true
253
253
  }} />
254
254
  </>;
255
- }`,...(Pn=(qn=Z.parameters)==null?void 0:qn.docs)==null?void 0:Pn.source}}};var Mn,_n,Dn;Q.parameters={...Q.parameters,docs:{...(Mn=Q.parameters)==null?void 0:Mn.docs,source:{originalSource:`() => {
255
+ }`,...(Pn=(qn=Z.parameters)==null?void 0:qn.docs)==null?void 0:Pn.source}}};var Mn,Dn,_n;Q.parameters={...Q.parameters,docs:{...(Mn=Q.parameters)==null?void 0:Mn.docs,source:{originalSource:`() => {
256
256
  const [value, setValue] = useState('123|m');
257
257
  const [placeholder, setPlaceholder] = useState('');
258
258
  const [initUnit, setInitUnit] = useState('km');
@@ -263,18 +263,18 @@ import{j as e}from"./jsx-runtime-eps93zm2.js";import{r as d}from"./index-DhsZuJv
263
263
  };
264
264
  return <>
265
265
  <h4>Empty value case:</h4>
266
- <UnitInput name="example" onChange={(evt: ChangeEvent | any) => setValue(evt.target.value)} value={value} allowEmpty placeholder={placeholder} initUnit={initUnit} unitkey="length" />
266
+ <UnitInput name="example" onChange={evt => setValue(evt.target.value)} value={value} allowEmpty placeholder={placeholder} initUnit={initUnit} unitkey="length" />
267
267
  <br />
268
268
  <Spacer />
269
269
  <Button label="Change value |m and unit ft" onClick={() => setPlaceholderValue()} />
270
270
  </>;
271
- }`,...(Dn=(_n=Q.parameters)==null?void 0:_n.docs)==null?void 0:Dn.source}}};var Fn,On,Wn;X.parameters={...X.parameters,docs:{...(Fn=X.parameters)==null?void 0:Fn.docs,source:{originalSource:`() => {
271
+ }`,...(_n=(Dn=Q.parameters)==null?void 0:Dn.docs)==null?void 0:_n.source}}};var Fn,On,Wn;X.parameters={...X.parameters,docs:{...(Fn=X.parameters)==null?void 0:Fn.docs,source:{originalSource:`() => {
272
272
  const [value, setValue] = useState('123|m');
273
273
  const [unit, setUnit] = useState('m');
274
274
  return <>
275
- <UnitInput name="example" onChange={(evt: ChangeEvent | any) => setValue(evt.target.value)} value={value} initUnit={unit} unitkey="length" onSwitchUnit={setUnit} />
275
+ <UnitInput name="example" onChange={evt => setValue(evt.target.value)} value={value} initUnit={unit} unitkey="length" onSwitchUnit={setUnit} />
276
276
  <Spacer />
277
- <UnitInput name="example" onChange={(evt: ChangeEvent | any) => setValue(evt.target.value)} value={value} initUnit={unit} unitkey="length" onSwitchUnit={setUnit} />
277
+ <UnitInput name="example" onChange={evt => setValue(evt.target.value)} value={value} initUnit={unit} unitkey="length" onSwitchUnit={setUnit} />
278
278
  </>;
279
279
  }`,...(Wn=(On=X.parameters)==null?void 0:On.docs)==null?void 0:Wn.source}}};var Bn,Rn,Hn;ee.parameters={...ee.parameters,docs:{...(Bn=ee.parameters)==null?void 0:Bn.docs,source:{originalSource:`() => {
280
280
  return <>
@@ -287,4 +287,4 @@ import{j as e}from"./jsx-runtime-eps93zm2.js";import{r as d}from"./index-DhsZuJv
287
287
  pressure: 'psi'
288
288
  }} />
289
289
  </>;
290
- }`,...(Hn=(Rn=ee.parameters)==null?void 0:Rn.docs)==null?void 0:Hn.source}}};const ha=["Default","InitUnit","notKnownUnit","Width","NoConversion","Small","Error","InternalValidationError","Disabled","DisabledNoConversion","DisabledUnitWithoutUnitKey","DisabledUnitWithUnitKey","DisabledWithEnabledUnitMenu","TestExternalStateChangeWithSynchronizedUnits","PredefinedOptionsMenu","TestEdgeCases","AutomaticValues","ValidationCallback","AllowEmptyPUI","onSwitchUnit","OW_10614TestCase"];export{Q as AllowEmptyPUI,Y as AutomaticValues,se as Default,S as Disabled,K as DisabledNoConversion,$ as DisabledUnitWithUnitKey,z as DisabledUnitWithoutUnitKey,G as DisabledWithEnabledUnitMenu,H as Error,F as InitUnit,L as InternalValidationError,B as NoConversion,ee as OW_10614TestCase,J as PredefinedOptionsMenu,R as Small,A as TestEdgeCases,N as TestExternalStateChangeWithSynchronizedUnits,Z as ValidationCallback,W as Width,ha as __namedExportsOrder,ga as default,O as notKnownUnit,X as onSwitchUnit};
290
+ }`,...(Hn=(Rn=ee.parameters)==null?void 0:Rn.docs)==null?void 0:Hn.source}}};const ca=["Default","InitUnit","notKnownUnit","Width","NoConversion","Small","Error","InternalValidationError","Disabled","DisabledNoConversion","DisabledUnitWithoutUnitKey","DisabledUnitWithUnitKey","DisabledWithEnabledUnitMenu","TestExternalStateChangeWithSynchronizedUnits","PredefinedOptionsMenu","TestEdgeCases","AutomaticValues","ValidationCallback","AllowEmptyPUI","onSwitchUnit","OW_10614TestCase"];export{Q as AllowEmptyPUI,Y as AutomaticValues,se as Default,S as Disabled,K as DisabledNoConversion,z as DisabledUnitWithUnitKey,$ as DisabledUnitWithoutUnitKey,G as DisabledWithEnabledUnitMenu,H as Error,F as InitUnit,L as InternalValidationError,B as NoConversion,ee as OW_10614TestCase,J as PredefinedOptionsMenu,R as Small,A as TestEdgeCases,N as TestExternalStateChangeWithSynchronizedUnits,Z as ValidationCallback,W as Width,ca as __namedExportsOrder,da as default,O as notKnownUnit,X as onSwitchUnit};
@@ -509,7 +509,7 @@
509
509
  }
510
510
  </script>
511
511
 
512
- <script type="module" crossorigin src="./assets/iframe-ud1XJtGn.js"></script>
512
+ <script type="module" crossorigin src="./assets/iframe-MGOUznuN.js"></script>
513
513
  </head>
514
514
 
515
515
  <body>
@@ -1 +1 @@
1
- {"generatedAt":1721652427583,"hasCustomBabel":false,"hasCustomWebpack":false,"hasStaticDirs":false,"hasStorybookEslint":true,"refCount":0,"testPackages":{"@types/jest":"29.5.12","@vitest/coverage-c8":"0.31.4","eslint-plugin-vitest":null,"eslint-plugin-vitest-globals":"1.5.0","vitest":"1.6.0"},"packageManager":{"type":"yarn","version":"1.22.19"},"typescriptOptions":{"reactDocgen":"react-docgen"},"preview":{"usesGlobals":false},"framework":{"name":"@storybook/react-vite","options":{}},"builder":"@storybook/builder-vite","renderer":"@storybook/react","storybookVersion":"8.2.4","storybookVersionSpecifier":"^8.2.4","language":"typescript","storybookPackages":{"@storybook/addon-essentials":{"version":"8.2.4"},"@storybook/addon-links":{"version":"8.2.4"},"@storybook/preview-api":{"version":"8.2.4"},"@storybook/react":{"version":"8.2.4"},"@storybook/react-vite":{"version":"8.2.4"},"eslint-plugin-storybook":{"version":"0.6.15"},"storybook":{"version":"8.2.4"}},"addons":{"@storybook/addon-actions":{"version":"8.2.4"},"@storybook/addon-docs":{"version":"8.2.4"},"storybook-dark-mode":{"version":"4.0.2"}}}
1
+ {"generatedAt":1721656015404,"hasCustomBabel":false,"hasCustomWebpack":false,"hasStaticDirs":false,"hasStorybookEslint":true,"refCount":0,"testPackages":{"@types/jest":"29.5.12","@vitest/coverage-c8":"0.31.4","eslint-plugin-vitest":null,"eslint-plugin-vitest-globals":"1.5.0","vitest":"1.6.0"},"packageManager":{"type":"yarn","version":"1.22.19"},"typescriptOptions":{"reactDocgen":"react-docgen"},"preview":{"usesGlobals":false},"framework":{"name":"@storybook/react-vite","options":{}},"builder":"@storybook/builder-vite","renderer":"@storybook/react","storybookVersion":"8.2.4","storybookVersionSpecifier":"^8.2.4","language":"typescript","storybookPackages":{"@storybook/addon-essentials":{"version":"8.2.4"},"@storybook/addon-links":{"version":"8.2.4"},"@storybook/preview-api":{"version":"8.2.4"},"@storybook/react":{"version":"8.2.4"},"@storybook/react-vite":{"version":"8.2.4"},"eslint-plugin-storybook":{"version":"0.6.15"},"storybook":{"version":"8.2.4"}},"addons":{"@storybook/addon-actions":{"version":"8.2.4"},"@storybook/addon-docs":{"version":"8.2.4"},"storybook-dark-mode":{"version":"4.0.2"}}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oliasoft-open-source/react-ui-library",
3
- "version": "4.7.2-beta-7",
3
+ "version": "4.7.2-beta-9",
4
4
  "description": "Reusable UI components for React projects",
5
5
  "homepage": "https://oliasoft-open-source.gitlab.io/react-ui-library",
6
6
  "bugs": {
@@ -137,6 +137,9 @@
137
137
  },
138
138
  "peerDependencies": {
139
139
  "@oliasoft-open-source/units": "^3.12.0",
140
+ "ajv": "^8.12.0",
141
+ "ajv-errors": "^3.0.0",
142
+ "ajv-keywords": "^5.1.0",
140
143
  "immer": "^9",
141
144
  "lodash": "^4",
142
145
  "prop-types": "^15",