@oliasoft-open-source/react-ui-library 4.7.3 → 4.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/404.html +1 -1
- package/dist/assets/{index-D5kcnHmD.js → index-CbZ_B_tn.js} +54 -19
- package/dist/index.html +1 -1
- package/dist/index.js +65 -31
- package/dist/index.js.map +1 -1
- package/dist/storybook/assets/Color-KGDBMAHA-DHDKE9Re.js +1 -0
- package/dist/storybook/assets/DocsRenderer-PKQXORMH-BmaBzyAH.js +1 -0
- package/dist/storybook/assets/{accordion-6ouB0WTt.js → accordion-BiuI_LCA.js} +1 -1
- package/dist/storybook/assets/{accordion.stories-DlFZNmdv.js → accordion.stories-BWUwZ5cN.js} +2 -2
- package/dist/storybook/assets/{actions-Cu_0szZ4.js → actions-CHgr8eL8.js} +1 -1
- package/dist/storybook/assets/{actions.stories-SCPuAp0T.js → actions.stories-CCDxFKFk.js} +1 -1
- package/dist/storybook/assets/{afe.stories-G3SzS3sg.js → afe.stories-CC785MgO.js} +2 -2
- package/dist/storybook/assets/{badge.stories-DGYA6_1I.js → badge.stories-D5DA-vxC.js} +1 -1
- package/dist/storybook/assets/{blowout.stories-P0LHuXSY.js → blowout.stories-ES-Fuaqn.js} +1 -1
- package/dist/storybook/assets/{button-_0DiND6h.js → button-VxhoNhrV.js} +1 -1
- package/dist/storybook/assets/{button-group-BYiHMljF.js → button-group-CwJdFo2z.js} +1 -1
- package/dist/storybook/assets/{button-group.stories-Bz6NHaeB.js → button-group.stories-DU5k5qCY.js} +1 -1
- package/dist/storybook/assets/{button.stories-vVBGddVf.js → button.stories-DVtec2Eo.js} +2 -2
- package/dist/storybook/assets/{buttons-and-links-B6aQa-f5.js → buttons-and-links-CfkgVoVA.js} +2 -2
- package/dist/storybook/assets/{card.stories-DIlqxO94.js → card.stories-CsTB0DuM.js} +1 -1
- package/dist/storybook/assets/{casing-loads.stories-0T--WlaD.js → casing-loads.stories-BoG7UuIu.js} +2 -2
- package/dist/storybook/assets/{cell.stories-C5Tkxyfr.js → cell.stories-CfiPC1eE.js} +2 -2
- package/dist/storybook/assets/{check-box-DkdQxC5c.js → check-box-BtCGePRy.js} +1 -1
- package/dist/storybook/assets/{check-box.stories-D8C12IQo.js → check-box.stories-L9T_i0RT.js} +1 -1
- package/dist/storybook/assets/{chunk-HLWAVYOI-dB_9CZG8.js → chunk-HLWAVYOI-CuMm7Qpv.js} +1 -1
- package/dist/storybook/assets/color-DJNturFf.js +25 -0
- package/dist/storybook/assets/{column.stories-C1Sxwh4f.js → column.stories-BxfR9Tla.js} +1 -1
- package/dist/storybook/assets/{dialog-CAWCUmp3.js → dialog-IAPGkLet.js} +1 -1
- package/dist/storybook/assets/{drawer-vbDFqa4U.js → drawer-BhuWxI7V.js} +1 -1
- package/dist/storybook/assets/{drawer.stories-CmbGsKmS.js → drawer.stories-B-PsNJJ6.js} +4 -4
- package/dist/storybook/assets/{empty.stories-iHPKKy4z.js → empty.stories-BVYXwvpa.js} +1 -1
- package/dist/storybook/assets/{field-DwLk_uWj.js → field-HrLaMLbx.js} +1 -1
- package/dist/storybook/assets/{field.stories-s-0LQVbp.js → field.stories-B9p9nBgY.js} +1 -1
- package/dist/storybook/assets/{file-button.stories-C90kcfbw.js → file-button.stories-FOaiNPt-.js} +1 -1
- package/dist/storybook/assets/{file-input-C_2w1dKj.js → file-input-BpMtsZ2S.js} +1 -1
- package/dist/storybook/assets/{file-input.stories-BEsZox6U.js → file-input.stories--ZoISXk0.js} +1 -1
- package/dist/storybook/assets/{flex.stories-D-QN0gkk.js → flex.stories-BEXf0VqI.js} +1 -1
- package/dist/storybook/assets/footer.stories-DdUzRiYm.js +3 -0
- package/dist/storybook/assets/form.stories-CDE7hTBL.js +49 -0
- package/dist/storybook/assets/formation.stories-vU3zoZ2c.js +74 -0
- package/dist/storybook/assets/{heading-DkSFysAb.js → heading-CRNoBc7q.js} +1 -1
- package/dist/storybook/assets/{heading.stories-Dtq7LNlB.js → heading.stories-DahFxeiX.js} +1 -1
- package/dist/storybook/assets/{help-icon-LfPZiYla.js → help-icon-Buhx5nl6.js} +1 -1
- package/dist/storybook/assets/{help-icon.stories-Dh2ylnGq.js → help-icon.stories-DbmZ1fgP.js} +1 -1
- package/dist/storybook/assets/icon-BSFY3vDO.js +8 -0
- package/dist/storybook/assets/{icon.stories-B-tKaIKA.js → icon.stories-C1hZXIMX.js} +1 -1
- package/dist/storybook/assets/iframe-CgUc-Ukp.js +2 -0
- package/dist/storybook/assets/index-CQKekHCo.js +1 -0
- package/dist/storybook/assets/{index-DQs5XS8h.js → index-CWz-hU-f.js} +5 -5
- package/dist/storybook/assets/{index-ccPuy0l1.js → index-DCGYYCUT.js} +8 -8
- package/dist/storybook/assets/{index.es-D2piFfFj.js → index.es-DazXb-ul.js} +4 -4
- package/dist/storybook/assets/inheritsLoose-DP0QEDDI.js +1 -0
- package/dist/storybook/assets/{input-D97ganXq.js → input-BW9trNAW.js} +1 -1
- package/dist/storybook/assets/{input-group.stories-BcoORZ9x.js → input-group.stories-BiReS545.js} +2 -2
- package/dist/storybook/assets/{input-validation-CLVu4gtl.js → input-validation-Bd_JP2WL.js} +2 -2
- package/dist/storybook/assets/{input.stories-BHdUwYqV.js → input.stories-BruLeJ44.js} +1 -1
- package/dist/storybook/assets/{inputs-qWlLPYX_.js → inputs-BsGUQTI3.js} +4 -4
- package/dist/storybook/assets/{label-tWjEmTQJ.js → label-CqmyC9he.js} +1 -1
- package/dist/storybook/assets/{label.stories-BTA8N7tD.js → label.stories-C0AO5F1a.js} +1 -1
- package/dist/storybook/assets/layout-forms-BH-i91Wg.js +16 -0
- package/dist/storybook/assets/{layout-general-Dn1nlXYw.js → layout-general-jp5QULaU.js} +2 -2
- package/dist/storybook/assets/{list-BpVed6Pw.js → list-yVTOdmpX.js} +1 -1
- package/dist/storybook/assets/{list.stories-CiT9J_FH.js → list.stories-ChqQXY5M.js} +2 -2
- package/dist/storybook/assets/{list.stories-data-CnVYk3eo.js → list.stories-data-Iq66w9oH.js} +1 -1
- package/dist/storybook/assets/{loader.stories-BKBFctQ1.js → loader.stories-DM7ZJBgz.js} +1 -1
- package/dist/storybook/assets/{menu.stories-Bp8L83xx.js → menu.stories-CSSvL08X.js} +2 -2
- package/dist/storybook/assets/{message-ttrR1AaP.js → message-ZenLdkrf.js} +1 -1
- package/dist/storybook/assets/{message.stories-C8YRT7nL.js → message.stories-Dmk-t8hM.js} +1 -1
- package/dist/storybook/assets/{meta-content-Djgg-tiF.js → meta-content-cbHGvPJ7.js} +1 -1
- package/dist/storybook/assets/{modal.stories-BoVj2EsX.js → modal.stories-BVttWvlZ.js} +2 -2
- package/dist/storybook/assets/{number-input-B-Nmya5O.js → number-input-uQOVHv2N.js} +1 -1
- package/dist/storybook/assets/{number-input.stories-CcNTeD25.js → number-input.stories-CVFfJvjY.js} +2 -2
- package/dist/storybook/assets/{option-dropdown.stories-COGmMWEl.js → option-dropdown.stories-CoLsSS95.js} +1 -1
- package/dist/storybook/assets/{padding-and-spacing-BNiScrzg.js → padding-and-spacing-D7O49YoW.js} +2 -2
- package/dist/storybook/assets/{page.stories-BB3g1zwB.js → page.stories-Cse3cMsO.js} +1 -1
- package/dist/storybook/assets/{pagination-DSQeMPG_.js → pagination-DzpYFhAO.js} +1 -1
- package/dist/storybook/assets/pagination.stories-CJwR-XAD.js +59 -0
- package/dist/storybook/assets/{pop-confirm.stories-Cr_ZBbLn.js → pop-confirm.stories-Hox7vJnl.js} +1 -1
- package/dist/storybook/assets/popover-CzZdWNnB.js +1 -0
- package/dist/storybook/assets/popover.stories-L5z549ww.js +10 -0
- package/dist/storybook/assets/preview-Bq2bLcjv.js +2 -0
- package/dist/storybook/assets/{preview-DhMlVLsE.js → preview-DOYx8RvS.js} +2 -2
- package/dist/storybook/assets/projects.stories-DU-QlBa6.js +47 -0
- package/dist/storybook/assets/{radio-button-BD7pi0ao.js → radio-button-YBwYcMaM.js} +1 -1
- package/dist/storybook/assets/{radio-button.stories-B84Ip3NV.js → radio-button.stories-Bg5JVXpo.js} +1 -1
- package/dist/storybook/assets/react-router-dom-Ck2Y_Fzc.js +8 -0
- package/dist/storybook/assets/{reservoirs.stories-kxVBoa7Y.js → reservoirs.stories-WKT7gCnp.js} +2 -2
- package/dist/storybook/assets/{rich-text-input.stories-C5pcIbSa.js → rich-text-input.stories-RjuY6LDo.js} +3 -3
- package/dist/storybook/assets/{row.stories-ATsrjumb.js → row.stories-B6IcyamO.js} +2 -2
- package/dist/storybook/assets/{select-78sreKsp.js → select-D55JvDou.js} +2 -2
- package/dist/storybook/assets/{select.stories-CZwsHVDB.js → select.stories-2DiOP0OZ.js} +2 -2
- package/dist/storybook/assets/{side-bar-WsK6pkmj.js → side-bar-CKbHPgIV.js} +1 -1
- package/dist/storybook/assets/{side-bar.stories-Bu2q_b_w.js → side-bar.stories-MUj_dj1F.js} +1 -1
- package/dist/storybook/assets/{site.stories-Yh4uNi3Q.js → site.stories-Ci4g5W2A.js} +2 -2
- package/dist/storybook/assets/{slider-CxVlS0fh.js → slider-DAramr8j.js} +4 -4
- package/dist/storybook/assets/{slider.stories-_wS70xsm.js → slider.stories-Cd0rLfHP.js} +2 -2
- package/dist/storybook/assets/{smart-upload-modal.stories-DDlO9y2j.js → smart-upload-modal.stories-OBY4Jc5w.js} +1 -1
- package/dist/storybook/assets/{spacer.stories-B3LrTr7b.js → spacer.stories-CHEZdgDM.js} +1 -1
- package/dist/storybook/assets/{table-DPvzYjoq.js → table-BOVkj1wL.js} +1 -1
- package/dist/storybook/assets/{table.stories-BGQ1O9nw.js → table.stories-CdFHs6Xl.js} +2 -2
- package/dist/storybook/assets/{table.stories-data-2STKbgzG.js → table.stories-data-CR9VpXHs.js} +1 -1
- package/dist/storybook/assets/text-link.stories-BQAkVO-W.js +14 -0
- package/dist/storybook/assets/{textarea-DOJDK8hI.js → textarea-BV7xWEdt.js} +1 -1
- package/dist/storybook/assets/{textarea.stories-CKm5MlQF.js → textarea.stories-aRLEoDHg.js} +1 -1
- package/dist/storybook/assets/{title.stories-CVRTXggL.js → title.stories-DT3HSIHi.js} +2 -2
- package/dist/storybook/assets/{toaster-DPbde9Mi.js → toaster-B8A3xIYu.js} +1 -1
- package/dist/storybook/assets/{toaster.stories-DfbfDavp.js → toaster.stories-B61l_zxQ.js} +1 -1
- package/dist/storybook/assets/{toggle-t1iTuSL7.js → toggle-CBpNgTrm.js} +1 -1
- package/dist/storybook/assets/{toggle.stories-D44S3Nix.js → toggle.stories-D4c4fr5t.js} +1 -1
- package/dist/storybook/assets/{tooltip-C_E_6ym5.js → tooltip-1V7clEnw.js} +1 -1
- package/dist/storybook/assets/{tooltip.stories-C70ADjjJ.js → tooltip.stories-1YexWg6N.js} +1 -1
- package/dist/storybook/assets/{tooltip.test-case.stories-BtrJUImB.js → tooltip.test-case.stories-i9YQqba1.js} +1 -1
- package/dist/storybook/assets/{top-bar-R-CjhJ21.js → top-bar-C_tn2Pc5.js} +1 -1
- package/dist/storybook/assets/top-bar.stories-B2a-RgK-.js +21 -0
- package/dist/storybook/assets/{top-bar.testcase.stories-ZPaSRyIh.js → top-bar.testcase.stories-DoPEAMYc.js} +1 -1
- package/dist/storybook/assets/{tree.stories-Ghxps-dL.js → tree.stories-6UHASEZu.js} +1 -1
- package/dist/storybook/assets/{unit-input.stories-Bqt0CdF7.js → unit-input.stories-DyeptPz2.js} +1 -1
- package/dist/storybook/assets/unit-table.stories-BAVqAbfG.js +150 -0
- package/dist/storybook/iframe.html +1 -1
- package/dist/storybook/project.json +1 -1
- package/package.json +8 -4
- package/dist/storybook/assets/Color-KGDBMAHA-RK4YYQs0.js +0 -1
- package/dist/storybook/assets/DocsRenderer-PKQXORMH-B0ryFlHH.js +0 -1
- package/dist/storybook/assets/color-BSzeqkLx.js +0 -25
- package/dist/storybook/assets/extends-CF3RwP-h.js +0 -1
- package/dist/storybook/assets/footer.stories-U_zMDmxF.js +0 -3
- package/dist/storybook/assets/form.stories-1L75MGpX.js +0 -49
- package/dist/storybook/assets/formation.stories-YHpXrXvC.js +0 -74
- package/dist/storybook/assets/icon-BP4BO6-k.js +0 -8
- package/dist/storybook/assets/iframe-CNFcCVDc.js +0 -2
- package/dist/storybook/assets/index-BIwFZkUc.js +0 -1
- package/dist/storybook/assets/inheritsLoose-DR8r8Ogv.js +0 -1
- package/dist/storybook/assets/layout-forms-p4s8eHw6.js +0 -16
- package/dist/storybook/assets/pagination.stories-DjIohcDx.js +0 -59
- package/dist/storybook/assets/popover-Dq3iC_lM.js +0 -1
- package/dist/storybook/assets/popover.stories-CoWCb2Mn.js +0 -10
- package/dist/storybook/assets/preview-CZPuAPNr.js +0 -2
- package/dist/storybook/assets/projects.stories-BesbPJ8Z.js +0 -47
- package/dist/storybook/assets/react-router-dom-CMITYWBH.js +0 -8
- package/dist/storybook/assets/text-link.stories-BsuVBOWo.js +0 -14
- package/dist/storybook/assets/top-bar.stories-BYN9rcUw.js +0 -21
- package/dist/storybook/assets/unit-table.stories-DXies3fA.js +0 -150
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as r}from"./jsx-runtime-eps93zm2.js";import{r as br}from"./index-DhsZuJvc.js";import{H as xr,L as A,S as Sr,R as B}from"./react-router-dom-
|
|
1
|
+
import{j as r}from"./jsx-runtime-eps93zm2.js";import{r as br}from"./index-DhsZuJvc.js";import{H as xr,L as A,S as Sr,R as B}from"./react-router-dom-Ck2Y_Fzc.js";import{T as F,I as hr}from"./common-types-Sih75Sav.js";import{M as L}from"./actions-CHgr8eL8.js";import{B as _}from"./button-VxhoNhrV.js";import{F as jr}from"./flex-EllkLxgO.js";import{m as s,a as Tr,b as Mr,c as Or,d as Cr,e as Dr,f as Rr,g as fr,h as yr,i as kr}from"./menu.stories-data-DeDnsKpk.js";import{M as W}from"./types-BmbYqTX_.js";import"./inheritsLoose-DP0QEDDI.js";import"./index-CEuq6vkz.js";import"./tiny-invariant-DqLgxztJ.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./index-Bk2sglWO.js";import"./lodash-BHd_uQHh.js";import"./disabled-context-rmpd7YJS.js";import"./tooltip-1V7clEnw.js";import"./index-CUZDtIZe.js";import"./icon-BSFY3vDO.js";import"./types-UmZ4Y_CR.js";import"./badge-CLQ59MDF.js";import"./spinner-AWUe4xwQ.js";const Yr={title:"Basic/Menu",component:L,args:{menu:s}},e=a=>r.jsx(L,{...a}),N=e.bind({}),n=e.bind({});n.args={menu:{...s,colored:!0}};const o=e.bind({});o.args={menu:{...s,label:"Delete",colored:"danger"}};const t=e.bind({});t.args={menu:{...s,trigger:F.TEXT}};const i=e.bind({});i.args={menu:{...s,trigger:F.COMPONENT,component:r.jsx(_,{small:!0,colored:!0,round:!0,icon:hr.SETTINGS})}};const c=e.bind({});c.args={menu:Tr};const p=e.bind({});p.args={menu:Mr};const d=e.bind({});d.args={menu:Or};const l=e.bind({});l.args={menu:Cr};const m=e.bind({});m.args={disabled:!0};const u=e.bind({});u.args={tooltip:"Tooltip goes here"};const g=e.bind({});g.args={error:"Error goes here"};const b=e.bind({});b.args={warning:"Warning goes here"};const x=e.bind({});x.args={loading:!0,disabled:!0};const S=e.bind({});S.args={badgeTitle:"3"};const h=e.bind({});h.args={badgeDot:!0};const j=e.bind({});j.args={menu:Dr};const T=e.bind({});T.args={menu:Rr};const M=e.bind({});M.args={closeOnOptionClick:!1};const O=e.bind({});O.args={contextMenu:!0,menu:{...s,trigger:F.TEXT,label:"Right-click me"}};const C=e.bind({});C.args={width:"100%"};const D=e.bind({});D.args={menu:{...s,small:!0}};const R=e.bind({});R.args={menu:fr};const f=e.bind({});f.args={menu:{...s,sections:r.jsx("div",{children:"Testing"})}};const y=e.bind({});y.args={menu:yr};const k=e.bind({});k.args={menu:kr};const I=()=>{const[a,P]=br.useState(!1);return r.jsxs(jr,{gap:!0,children:[r.jsx(L,{menu:s,open:a,setOpen:P}),r.jsx(_,{label:"Open",onClick:()=>P(!0),disabled:a}),r.jsx(_,{label:"Close",onClick:()=>P(!1),disabled:!a})]})},E=()=>r.jsxs(xr,{children:[r.jsx(L,{menu:{label:"Go to",trigger:F.DROP_DOWN_BUTTON,sections:[{type:W.OPTION,label:"Dashboard",url:"/dashboard",component:A},{type:W.OPTION,label:"Settings",url:"/settings",component:A}]}}),r.jsxs(Sr,{children:[r.jsx(B,{path:"/dashboard",children:"Dashboard"}),r.jsx(B,{path:"/settings",children:"Settings"})]})]});I.__docgenInfo={description:"",methods:[],displayName:"ControlOpenStateFromParent"};E.__docgenInfo={description:"",methods:[],displayName:"AsRouterLink"};var w,X,J;N.parameters={...N.parameters,docs:{...(w=N.parameters)==null?void 0:w.docs,source:{originalSource:`args => <Menu
|
|
2
2
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
3
3
|
{...args} />`,...(J=(X=N.parameters)==null?void 0:X.docs)==null?void 0:J.source}}};var U,H,v;n.parameters={...n.parameters,docs:{...(U=n.parameters)==null?void 0:U.docs,source:{originalSource:`args => <Menu
|
|
4
4
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
@@ -79,4 +79,4 @@ import{j as r}from"./jsx-runtime-eps93zm2.js";import{r as br}from"./index-DhsZuJ
|
|
|
79
79
|
<Route path="/settings">Settings</Route>
|
|
80
80
|
</Switch>
|
|
81
81
|
</HashRouter>;
|
|
82
|
-
}`,...(gr=(ur=E.parameters)==null?void 0:ur.docs)==null?void 0:gr.source}}};const
|
|
82
|
+
}`,...(gr=(ur=E.parameters)==null?void 0:ur.docs)==null?void 0:gr.source}}};const Zr=["Default","PrimaryTrigger","DestructiveTrigger","TextTrigger","CustomTrigger","FileUpload","DescriptionOnRight","Actions","Icons","Disabled","Tooltip","Error","Warning","Loading","Badge","Dot","Empty","Submenus","WithoutCloseOnOptionClick","RightClickContextMenu","FullWidth","Small","JSXItems","JSXContent","ShowAll","Long","ControlOpenStateFromParent","AsRouterLink"];export{d as Actions,E as AsRouterLink,S as Badge,I as ControlOpenStateFromParent,i as CustomTrigger,N as Default,p as DescriptionOnRight,o as DestructiveTrigger,m as Disabled,h as Dot,j as Empty,g as Error,c as FileUpload,C as FullWidth,l as Icons,f as JSXContent,R as JSXItems,x as Loading,k as Long,n as PrimaryTrigger,O as RightClickContextMenu,y as ShowAll,D as Small,T as Submenus,t as TextTrigger,u as Tooltip,b as Warning,M as WithoutCloseOnOptionClick,Zr as __namedExportsOrder,Yr as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./jsx-runtime-eps93zm2.js";import{r as N}from"./index-DhsZuJvc.js";import{c}from"./index-Bk2sglWO.js";import{I as o}from"./common-types-Sih75Sav.js";import{I as a}from"./icon-
|
|
1
|
+
import{j as e}from"./jsx-runtime-eps93zm2.js";import{r as N}from"./index-DhsZuJvc.js";import{c}from"./index-Bk2sglWO.js";import{I as o}from"./common-types-Sih75Sav.js";import{I as a}from"./icon-BSFY3vDO.js";const T="_inputInTable_s49vk_1",b="_inputHover_s49vk_13",j="_inputFocus_s49vk_18",R="_inputError_s49vk_25",y="_inputWarning_s49vk_26",C="_inputDisabled_s49vk_61",w="_hideScrollbars_s49vk_67",O="_container_s49vk_83",D="_block_s49vk_101",G="_info_s49vk_104",W="_success_s49vk_108",A="_warning_s49vk_112",L="_error_s49vk_116",F="_content_s49vk_120",z="_heading_s49vk_124",H="_icon_s49vk_131",U="_dismiss_s49vk_139",q="_absolute_s49vk_143",V="_legendToggle_s49vk_155",M="_detailsText_s49vk_165",B="_footer_s49vk_169",n={inputInTable:T,inputHover:b,inputFocus:j,inputError:R,inputWarning:y,inputDisabled:C,hideScrollbars:w,container:O,block:D,info:G,success:W,warning:A,error:L,content:F,heading:z,icon:H,dismiss:U,absolute:q,legendToggle:V,detailsText:M,footer:B};var i=(s=>(s.INFO="Info",s.SUCCESS="Success",s.WARNING="Warning",s.ERROR="Error",s))(i||{}),l=(s=>(s.TOGGLE_DETAILS="TOGGLE_DETAILS",s))(l||{});const p=({type:s,onClose:r,isInToast:t})=>e.jsx("div",{className:c(n.dismiss,t?n.absolute:"",s===i.INFO?n.info:s===i.SUCCESS?n.success:s===i.WARNING?n.warning:s===i.ERROR?n.error:null),children:e.jsx(a,{icon:o.CLOSE,onClick:r})});p.__docgenInfo={description:"",methods:[],displayName:"Dismiss",props:{type:{required:!0,tsType:{name:"union",raw:"TMessageType | string",elements:[{name:"union",raw:"'Info' | 'Success' | 'Warning' | 'Error'",elements:[{name:"literal",value:"'Info'"},{name:"literal",value:"'Success'"},{name:"literal",value:"'Warning'"},{name:"literal",value:"'Error'"}]},{name:"string"}]},description:""},onClose:{required:!1,tsType:{name:"signature",type:"function",raw:"(...args: any[]) => any",signature:{arguments:[{type:{name:"Array",elements:[{name:"any"}],raw:"any[]"},name:"args",rest:!0}],return:{name:"any"}}},description:""},isInToast:{required:!1,tsType:{name:"boolean"},description:""}}};const J=(s,r)=>{switch(r.type){case l.TOGGLE_DETAILS:return{...s,detailsVisible:!s.detailsVisible};default:return s}},K=({details:s,visible:r,dispatch:t})=>e.jsxs("div",{children:[e.jsx("div",{className:c(n.legendToggle),onClick:t,children:r?"Hide details":"Show details"}),r?e.jsx("div",{className:n.detailsText,children:s}):null]}),P=({type:s})=>{switch(s){case i.SUCCESS:return e.jsx(a,{icon:o.SUCCESS,size:16});case i.WARNING:return e.jsx(a,{icon:o.WARNING,size:16});case i.ERROR:return e.jsx(a,{icon:o.ERROR,size:16});default:return e.jsx(a,{icon:o.INFO,size:16})}},Q=({message:s})=>{const{visible:r,type:t=i.INFO,icon:g,heading:d,content:v,details:u,detailsVisible:h=!1,footer:_,withDismiss:x,onClose:I,width:m,maxHeight:S}=s,k={detailsVisible:h},[E,f]=N.useReducer(J,k);return e.jsx(e.Fragment,{children:r?e.jsxs("div",{className:c(n.container,m?n.block:null,t===i.SUCCESS?n.success:t===i.WARNING?n.warning:t===i.ERROR?n.error:n.info),style:{width:m,maxHeight:S},children:[e.jsx("div",{children:g?e.jsx("div",{className:n.icon,children:e.jsx(P,{type:t})}):null}),e.jsxs("div",{className:n.content,children:[d?e.jsx("div",{className:n.heading,children:d}):null,e.jsx("div",{children:v}),u?e.jsx(K,{details:u,visible:E.detailsVisible,dispatch:()=>f({type:l.TOGGLE_DETAILS})}):null,!!_&&e.jsx("div",{className:n.footer,children:_})]}),x?e.jsx(p,{type:t,onClose:I}):null]}):null})};Q.__docgenInfo={description:"",methods:[],displayName:"Message",props:{message:{required:!0,tsType:{name:"IMessage"},description:""}}};export{p as D,Q as M,i as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as s}from"./jsx-runtime-eps93zm2.js";import{M as a,a as n}from"./message-
|
|
1
|
+
import{j as s}from"./jsx-runtime-eps93zm2.js";import{M as a,a as n}from"./message-ZenLdkrf.js";import{B as M}from"./button-VxhoNhrV.js";import{G as z}from"./grid-B6LFPf51.js";import"./index-DhsZuJvc.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"./spinner-AWUe4xwQ.js";import"./tooltip-1V7clEnw.js";import"./index-CUZDtIZe.js";import"./styled-components.browser.esm-Bf0q9Yjk.js";const{useArgs:J}=__STORYBOOK_MODULE_PREVIEW_API__,Q={visible:!0,heading:void 0,content:"Here is some info",withDismiss:!1,icon:!1,details:void 0,maxHeight:void 0,type:n.INFO},ce={title:"Basic/Message",component:a,args:{...Q},argTypes:{heading:{control:{type:"text"}},details:{control:{type:"text"}}}},e=u=>{const[X,y]=J(),c=()=>{y({visible:!1}),setTimeout(()=>{y({visible:!0})},1e3)};return s.jsxs(z,{gap:!0,children:[s.jsx(a,{message:{...u,onClose:c,type:n.INFO}}),s.jsx(a,{message:{...u,onClose:c,type:n.ERROR}}),s.jsx(a,{message:{...u,onClose:c,type:n.WARNING}}),s.jsx(a,{message:{...u,onClose:c,type:n.SUCCESS}})]})},C=e.bind({}),o=e.bind({});o.args={heading:"Message Heading"};const r=e.bind({});r.args={icon:!0};const t=e.bind({});t.args={details:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque at mi ac quam condimentum blandit at sit amet lectus. Nullam volutpat erat maximus, venenatis nisl sed, aliquam libero."};const g=e.bind({});g.args={details:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque at mi ac quam condimentum blandit at sit amet lectus. Nullam volutpat erat maximus, venenatis nisl sed, aliquam libero.",detailsVisible:!0};const l=e.bind({});l.args={type:n.ERROR,icon:!0,content:"Unable to sync because connection settings are not set.",footer:s.jsxs(s.Fragment,{children:[s.jsx(M,{small:!0,label:"Edit connection settings",colored:"primary"},"edit-settings"),s.jsx(M,{small:!0,label:"Cancel sync"},"cancel-sync"),","]})};const i=e.bind({});i.args={width:"100%"};const p=e.bind({});p.args={width:"300px"};const d=e.bind({});d.args={maxHeight:"100px",content:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. ".repeat(20)};const m=e.bind({});m.args={withDismiss:!0,onClose:()=>{}};var h,T,A;C.parameters={...C.parameters,docs:{...(h=C.parameters)==null?void 0:h.docs,source:{originalSource:`args => {
|
|
2
2
|
const [_, updateArgs] = useArgs();
|
|
3
3
|
const handleClose = () => {
|
|
4
4
|
updateArgs({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e}from"./jsx-runtime-eps93zm2.js";import{r as u}from"./index-DhsZuJvc.js";import{c}from"./index-Bk2sglWO.js";import{I as g}from"./common-types-Sih75Sav.js";import{I as _}from"./icon-
|
|
1
|
+
import{j as e}from"./jsx-runtime-eps93zm2.js";import{r as u}from"./index-DhsZuJvc.js";import{c}from"./index-Bk2sglWO.js";import{I as g}from"./common-types-Sih75Sav.js";import{I as _}from"./icon-BSFY3vDO.js";import{H as h}from"./heading-CRNoBc7q.js";import{A as x}from"./actions-CHgr8eL8.js";import{B as f}from"./badge-CLQ59MDF.js";import{T as N}from"./tooltip-1V7clEnw.js";const b="_inputInTable_tn20e_1",T="_inputHover_tn20e_13",j="_inputFocus_tn20e_18",v="_inputError_tn20e_25",y="_inputWarning_tn20e_26",I="_inputDisabled_tn20e_61",w="_hideScrollbars_tn20e_67",H="_header_tn20e_77",q="_headerTitle_tn20e_77",C="_heading_tn20e_78",k="_itemHeader_tn20e_78",E="_narrow_tn20e_81",S="_stickyHeader_tn20e_85",M="_title_tn20e_96",R="_name_tn20e_102",L="_iconTooltipMargin_tn20e_105",F="_bold_tn20e_108",V="_toggleNarrow_tn20e_117",W="_drag_tn20e_135",B="_list_tn20e_155",D="_bordered_tn20e_159",P="_item_tn20e_78",$="_action_tn20e_192",A="_active_tn20e_195",O="_indented_tn20e_202",z="_disabled_tn20e_215",G="_label_tn20e_226",J="_details_tn20e_237",K="_metadata_tn20e_238",Q="_itemContent_tn20e_246",U="_indentIcon_tn20e_253",X="_expandIcon_tn20e_258",Y="_expanded_tn20e_265",Z="_right_tn20e_268",ee="_actions_tn20e_276",te="_scrollableList_tn20e_281",ne="_infiniteScrollContainer_tn20e_286",ae="_hideScrollbar_tn20e_67",oe="_noPointerEvents_tn20e_303",n={inputInTable:b,inputHover:T,inputFocus:j,inputError:v,inputWarning:y,inputDisabled:I,hideScrollbars:w,header:H,headerTitle:q,heading:C,itemHeader:k,narrow:E,stickyHeader:S,title:M,name:R,iconTooltipMargin:L,bold:F,toggleNarrow:V,drag:W,list:B,bordered:D,item:P,action:$,active:A,indented:O,disabled:z,label:G,details:J,metadata:K,itemContent:Q,indentIcon:U,expandIcon:X,expanded:Y,right:Z,actions:ee,scrollableList:te,infiniteScrollContainer:ne,hideScrollbar:ae,noPointerEvents:oe},p=({toggleNarrow:a,onClickToggleNarrow:t})=>a?e.jsx("a",{className:n.toggleNarrow,onClick:t,children:e.jsx(_,{icon:g.CHEVRON_LEFT})}):null;p.__docgenInfo={description:"",methods:[],displayName:"ToggleNarrow",props:{toggleNarrow:{required:!1,tsType:{name:"boolean"},description:""},onClickToggleNarrow:{required:!1,tsType:{name:"signature",type:"function",raw:"() => void",signature:{arguments:[],return:{name:"void"}}},description:""}}};const ie=u.forwardRef(({name:a,actions:t=[],toggleNarrow:r=!1,onToggleNarrow:o=()=>{},stickyHeader:s},d)=>e.jsxs("div",{ref:d,className:c(n.header,s?n.stickyHeader:""),children:[e.jsx(p,{toggleNarrow:r,onClickToggleNarrow:o}),a&&e.jsx("div",{className:n.headerTitle,children:e.jsx(h,{top:!0,marginBottom:0,children:a})}),e.jsx("div",{className:n.right,children:e.jsx("div",{className:n.actions,children:e.jsx(x,{actions:t})})})]}));ie.__docgenInfo={description:"",methods:[],displayName:"ListHeading",props:{actions:{defaultValue:{value:"[]",computed:!1},required:!1},toggleNarrow:{defaultValue:{value:"false",computed:!1},required:!1},onToggleNarrow:{defaultValue:{value:"() => {}",computed:!1},required:!1}}};const m=({name:a,icon:t,testId:r})=>{const o=t&&e.jsx(_,{icon:t.icon,color:t.color||"#db2828"});return e.jsxs("span",{className:c(n.name,n.bold),"data-testid":r,children:[a,t&&t.tooltip&&t.tooltip.text?e.jsx("span",{className:n.iconTooltipMargin,children:e.jsx(N,{text:t.tooltip.text,maxWidth:"350px",children:o})}):t&&t.icon&&e.jsx("span",{className:n.iconTooltipMargin,children:o})]})};m.__docgenInfo={description:"",methods:[],displayName:"Name",props:{name:{required:!0,tsType:{name:"ReactNode"},description:""},icon:{required:!1,tsType:{name:"signature",type:"object",raw:`{
|
|
2
2
|
icon: ReactNode;
|
|
3
3
|
color?: string;
|
|
4
4
|
tooltip?: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e}from"./jsx-runtime-eps93zm2.js";import{r as h}from"./index-DhsZuJvc.js";import{T as X}from"./common-types-Sih75Sav.js";import{M,D as C}from"./dialog-
|
|
1
|
+
import{j as e}from"./jsx-runtime-eps93zm2.js";import{r as h}from"./index-DhsZuJvc.js";import{T as X}from"./common-types-Sih75Sav.js";import{M,D as C}from"./dialog-IAPGkLet.js";import{B as o}from"./button-VxhoNhrV.js";import{P as Z}from"./popover-CzZdWNnB.js";import{I as Q}from"./input-BW9trNAW.js";import{I as $}from"./input-group-BaRSJAEN.js";import{F as j}from"./field-HrLaMLbx.js";import{M as ee}from"./actions-CHgr8eL8.js";import{S as oe}from"./select-D55JvDou.js";import{S as le}from"./spacer-BWoNR27H.js";import{T as ne}from"./tooltip-1V7clEnw.js";import{M as k}from"./types-BmbYqTX_.js";import"./index-Bk2sglWO.js";import"./portal-GQ0_cLB6.js";import"./index-CUZDtIZe.js";import"./lodash-BHd_uQHh.js";import"./heading-CRNoBc7q.js";import"./help-icon-Buhx5nl6.js";import"./icon-BSFY3vDO.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./inheritsLoose-DP0QEDDI.js";import"./index-CEuq6vkz.js";import"./disabled-context-rmpd7YJS.js";import"./spinner-AWUe4xwQ.js";import"./types-UmZ4Y_CR.js";import"./label-CqmyC9he.js";import"./badge-CLQ59MDF.js";import"./assertThisInitialized-B9jnkVVz.js";import"./memoize-one.esm-CcMeOnPo.js";import"./text-B3-TSWok.js";import"./select.input-DIKP56UZ.js";const{useArgs:se}=__STORYBOOK_MODULE_PREVIEW_API__,Ne={title:"Modals/Modal",component:M,args:{visible:!0,centered:!0,width:"300px",heading:"Are you sure?",content:e.jsx(e.Fragment,{children:"This will complete the transaction"}),footer:e.jsxs(e.Fragment,{children:[e.jsx(o,{label:"Okay",colored:!0,onClick:()=>{}}),e.jsx(o,{label:"Cancel",onClick:()=>{}})]}),onClose:()=>{}},parameters:{docs:{story:{inline:!1,iframeHeight:400}}}},a=()=>{const[{visible:n,centered:r,...s},l]=se(),t=()=>{l({visible:!n})};return e.jsxs(e.Fragment,{children:[e.jsx(M,{visible:n,centered:r,children:e.jsx(C,{dialog:{...s,onClose:t}})}),e.jsx(o,{label:"Open Modal",onClick:t})]})},v=a.bind({}),i=a.bind({});i.args={centered:!0};const d=a.bind({});d.args={content:["This is a","new line!"]};const c=a.bind({});c.args={scroll:!0,content:e.jsx("div",{children:"Example modal content goes here lorem ipsum. ".repeat(100)})};const g=a.bind({});g.args={width:"100%",content:e.jsx("div",{children:"Example modal content goes here lorem ipsum. ".repeat(100)})};const p=a.bind({});p.args={contentPadding:0};const m=a.bind({});m.args={content:e.jsxs(e.Fragment,{children:[e.jsx(ne,{text:"Tooltip text",children:"Hover for tooltip"}),e.jsx(le,{}),e.jsx(j,{label:"Custom Select",helpText:"Select an animal",children:e.jsx(oe,{name:"example",options:["Aardvarks","Kangaroos","Monkeys","Possums","Gorilla","Puma","Patagonian Mara","Tarsier","Koala","Panda","Red Panda","Impala","Tiger","Crocodile","Bat"],onChange:()=>{},value:"Monkeys",error:"Bad value"})}),e.jsx(j,{label:"Nested Menu",children:e.jsx(ee,{maxHeight:"240px",menu:{label:"Menu",trigger:X.DROP_DOWN_BUTTON,sections:[{type:k.MENU,menu:{trigger:"Text",label:"Children",sections:[...Array(100).keys()].map(()=>({type:"Option",label:Math.random().toString(36).substring(7),onClick:()=>{}}))}},...[...Array(100).keys()].map(()=>({type:k.OPTION,label:Math.random().toString(36).substring(7),onClick:()=>{}}))]}})}),e.jsx(Z,{content:e.jsxs($,{small:!0,children:[e.jsx(Q,{value:"Value",width:"150px",error:"Bad value"}),e.jsx(o,{colored:!0,label:"Save",onClick:()=>{}}),e.jsx(o,{label:"Cancel",onClick:()=>{}})]}),children:e.jsx(o,{colored:!0,label:"Toggle me",onClick:()=>{}})})]})};const u=()=>{const[n,r]=h.useState(!1),s=()=>{r(!0)},l=()=>{r(!1)},t=()=>{console.log("Submit action"),l()};return e.jsxs(e.Fragment,{children:[e.jsx(M,{visible:n,onEnter:()=>{console.log("Enter"),t()},onEscape:()=>{console.log("Escape"),l()},children:e.jsx(C,{dialog:{heading:"Test key handling",content:e.jsx(Q,{}),footer:e.jsxs(e.Fragment,{children:[e.jsx(o,{label:"Done",colored:"red",onClick:t}),e.jsx(o,{label:"Cancel",onClick:l})]}),onClose:l}})}),e.jsx(o,{label:"Open Modal",onClick:s})]})},b=()=>{const[n,r]=h.useState(!1),s=()=>r(!n),[l,t]=h.useState(!1),x=()=>t(!l);return e.jsxs(e.Fragment,{children:[e.jsx(M,{visible:n,children:e.jsx(C,{dialog:{heading:"Modal 1",content:"Lorem ipsum dolor sit amet",footer:e.jsxs(e.Fragment,{children:[e.jsx(o,{label:"Open modal 2",colored:!0,onClick:x}),e.jsx(M,{visible:l,children:e.jsx(C,{dialog:{heading:"Modal 2",content:"Lorem ipsum dolor sit amet",footer:e.jsx(o,{label:"Close",onClick:x}),onClose:x}})}),e.jsx(o,{label:"Close",onClick:s})]}),onClose:s}})}),e.jsx(o,{label:"Open modal 1",onClick:s})]})};u.__docgenInfo={description:"",methods:[],displayName:"KeyHandle"};b.__docgenInfo={description:"",methods:[],displayName:"MultipleModals"};var f,S,P;v.parameters={...v.parameters,docs:{...(f=v.parameters)==null?void 0:f.docs,source:{originalSource:`() => {
|
|
2
2
|
const [{
|
|
3
3
|
visible,
|
|
4
4
|
centered,
|
|
@@ -197,4 +197,4 @@ import{j as e}from"./jsx-runtime-eps93zm2.js";import{r as h}from"./index-DhsZuJv
|
|
|
197
197
|
</Modal>
|
|
198
198
|
<Button label="Open modal 1" onClick={toggleVisible1} />
|
|
199
199
|
</>;
|
|
200
|
-
}`,...(J=(z=b.parameters)==null?void 0:z.docs)==null?void 0:J.source}}};const
|
|
200
|
+
}`,...(J=(z=b.parameters)==null?void 0:z.docs)==null?void 0:J.source}}};const He=["Default","Centered","LineBreak","Scroll","FullWidth","NoContentPadding","WithPopoverLayers","KeyHandle","MultipleModals"];export{i as Centered,v as Default,g as FullWidth,u as KeyHandle,d as LineBreak,b as MultipleModals,p as NoContentPadding,c as Scroll,m as WithPopoverLayers,He as __namedExportsOrder,Ne as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as G}from"./jsx-runtime-eps93zm2.js";import{r as s}from"./index-DhsZuJvc.js";import{d as v}from"./index-
|
|
1
|
+
import{j as G}from"./jsx-runtime-eps93zm2.js";import{r as s}from"./index-DhsZuJvc.js";import{d as v}from"./index-CWz-hU-f.js";import{l as J}from"./lodash-BHd_uQHh.js";import{I as K}from"./input-BW9trNAW.js";const P=t=>t?typeof t=="string"?t:J.isArray(t)?t[0]:t.fieldName:"",Q=({name:t,placeholder:N="",disabled:q=!1,error:y=!1,left:V=!1,small:I=!1,width:h="100%",value:u="",onChange:F=()=>{},onFocus:S=()=>{},onBlur:x=()=>{},tabIndex:H=0,testId:L,tooltip:M=null,warning:R=!1,validationCallback:l=()=>{},allowEmpty:j=!1,isInTable:A,groupOrder:B,enableDisplayRounding:T=!1,roundDisplayValue:b})=>{const r=s.useRef(null),[i,f]=s.useState(u),[C,o]=s.useState(null),[c,E]=s.useState(!1),a=P(t),w=e=>{let n=v.validateNumber(e);return j&&e===""||n.valid?{...n,valid:!0,errors:void 0}:n};s.useEffect(()=>{const{valid:e,errors:n}=w(u);if(f(u),e)o(null),l(a,null);else{const m=n&&n.length?n[0]:null;o(m),l(a,m)}},[u,y]);const D=e=>{const n=e.target,{value:m}=n,d=v.cleanNumStr(m.replaceAll(" ","").replaceAll("|","")),{valid:z,errors:g}=w(d);if(z){const p={...e,target:{...e.target,value:d,name:a}};F(p),f(d),o(null),l(a,null)}else{f(d);const p=g&&g.length?g[0]:null;o(p),l(a,p)}};s.useEffect(()=>{if(r&&(r!=null&&r.current)&&T&&c){const e=r.current;e&&setTimeout(()=>{const{length:n}=String(i);e.setSelectionRange(n,n)},0)}},[c]);const O=e=>{E(!0),S(e)},_=e=>{E(!1),x(e)},k=!c&&T?b?b(i):v.roundToFixed(i,2):i;return G.jsx(K,{type:"text",name:a,testId:L,disabled:q,placeholder:N,value:k,onChange:D,onFocus:O,onBlur:_,error:y||C,warning:R,right:!V,small:I,width:h,isInTable:A,groupOrder:B,tabIndex:H,tooltip:M,ref:r},a)};Q.__docgenInfo={description:"",methods:[],displayName:"NumberInput",props:{name:{required:!1,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:!0}}]}}]},description:""},placeholder:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:"''",computed:!1}},disabled:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},error:{required:!1,tsType:{name:"union",raw:"string | boolean",elements:[{name:"string"},{name:"boolean"}]},description:"",defaultValue:{value:"false",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:"union",raw:"string | number",elements:[{name:"string"},{name:"number"}]},description:"",defaultValue:{value:"''",computed:!1}},onChange:{required:!1,tsType:{name:"signature",type:"function",raw:"(evt: ChangeEvent<HTMLInputElement>) => void",signature:{arguments:[{type:{name:"ChangeEvent",elements:[{name:"HTMLInputElement"}],raw:"ChangeEvent<HTMLInputElement>"},name:"evt"}],return:{name:"void"}}},description:"",defaultValue:{value:"() => {}",computed:!1}},onFocus:{required:!1,tsType:{name:"signature",type:"function",raw:"(evt: FocusEvent<HTMLInputElement>) => void",signature:{arguments:[{type:{name:"FocusEvent",elements:[{name:"HTMLInputElement"}],raw:"FocusEvent<HTMLInputElement>"},name:"evt"}],return:{name:"void"}}},description:"",defaultValue:{value:"() => {}",computed:!1}},onBlur:{required:!1,tsType:{name:"signature",type:"function",raw:"(evt: FocusEvent<HTMLInputElement>) => void",signature:{arguments:[{type:{name:"FocusEvent",elements:[{name:"HTMLInputElement"}],raw:"FocusEvent<HTMLInputElement>"},name:"evt"}],return:{name:"void"}}},description:"",defaultValue:{value:"() => {}",computed:!1}},tabIndex:{required:!1,tsType:{name:"number"},description:"",defaultValue:{value:"0",computed:!1}},testId:{required:!1,tsType:{name:"string"},description:""},tooltip:{required:!1,tsType:{name:"union",raw:"TStringOrNumber | React.ReactNode",elements:[{name:"union",raw:"string | number",elements:[{name:"string"},{name:"number"}]},{name:"ReactReactNode",raw:"React.ReactNode"}]},description:"",defaultValue:{value:"null",computed:!1}},warning:{required:!1,tsType:{name:"union",raw:"string | boolean",elements:[{name:"string"},{name:"boolean"}]},description:"",defaultValue:{value:"false",computed:!1}},validationCallback:{required:!1,tsType:{name:"signature",type:"function",raw:`(
|
|
2
2
|
name: string | { fieldName: string },
|
|
3
3
|
error: string | null,
|
|
4
4
|
) => void`,signature:{arguments:[{type:{name:"union",raw:"string | { fieldName: string }",elements:[{name:"string"},{name:"signature",type:"object",raw:"{ fieldName: string }",signature:{properties:[{key:"fieldName",value:{name:"string",required:!0}}]}}]},name:"name"},{type:{name:"union",raw:"string | null",elements:[{name:"string"},{name:"null"}]},name:"error"}],return:{name:"void"}}},description:"",defaultValue:{value:"() => {}",computed:!1}},allowEmpty:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},isInTable:{required:!1,tsType:{name:"boolean"},description:""},groupOrder:{required:!1,tsType:{name:"any"},description:""},enableDisplayRounding:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},roundDisplayValue:{required:!1,tsType:{name:"signature",type:"function",raw:"(args: TStringNumberNull) => TStringNumberNull",signature:{arguments:[{type:{name:"union",raw:"string | number | null",elements:[{name:"string"},{name:"number"},{name:"null"}]},name:"args"}],return:{name:"union",raw:"string | number | null",elements:[{name:"string"},{name:"number"},{name:"null"}]}}},description:""}}};export{Q as N};
|
package/dist/storybook/assets/{number-input.stories-CcNTeD25.js → number-input.stories-CVFfJvjY.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as n}from"./jsx-runtime-eps93zm2.js";import{d as ne}from"./index-
|
|
1
|
+
import{j as n}from"./jsx-runtime-eps93zm2.js";import{d as ne}from"./index-CWz-hU-f.js";import{N as i}from"./number-input-uQOVHv2N.js";import{I as ae}from"./input-group-BaRSJAEN.js";import{I as re}from"./input-group-addon-D68iUKV2.js";import{S as te}from"./select-D55JvDou.js";import"./index-DhsZuJvc.js";import"./index-DRSy5Ssd.js";import"./lodash-BHd_uQHh.js";import"./input-BW9trNAW.js";import"./index-Bk2sglWO.js";import"./disabled-context-rmpd7YJS.js";import"./types-UmZ4Y_CR.js";import"./tooltip-1V7clEnw.js";import"./index-CUZDtIZe.js";import"./common-types-Sih75Sav.js";import"./index-CEuq6vkz.js";import"./inheritsLoose-DP0QEDDI.js";import"./assertThisInitialized-B9jnkVVz.js";import"./memoize-one.esm-CcMeOnPo.js";import"./types-BmbYqTX_.js";import"./text-B3-TSWok.js";import"./actions-CHgr8eL8.js";import"./button-VxhoNhrV.js";import"./spinner-AWUe4xwQ.js";import"./icon-BSFY3vDO.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./badge-CLQ59MDF.js";import"./select.input-DIKP56UZ.js";const{useArgs:se}=__STORYBOOK_MODULE_PREVIEW_API__,je={title:"Forms/NumberInput",component:i,parameters:{canvas:{page:null}},args:{label:"Label"}},e=h=>{const[ue,Z]=se(),$=ee=>{Z({value:ee.target.value})};return n.jsx(i,{onChange:$,value:123,...h})},c=e.bind({}),a=e.bind({});a.args={small:!0};const r=e.bind({});r.args={width:"150px"};const t=e.bind({});t.args={left:!0};const s=e.bind({});s.args={disabled:!0};const u=e.bind({});u.args={allowEmpty:!0,value:""};const o=e.bind({});o.args={warning:"This input number is almost 100!",value:"99"};const p=e.bind({});p.args={error:"This is a error message"};const g=e.bind({});g.args={value:"123test"};const l=e.bind({});l.args={value:"123.123456789",enableDisplayRounding:!0};const m=e.bind({});m.args={value:"123.123456789",enableDisplayRounding:!0,roundDisplayValue:h=>ne.roundToFixed(h,4)};const d=()=>n.jsxs(ae,{small:!0,children:[n.jsx(i,{value:123}),n.jsx(re,{children:"to"}),n.jsx(i,{value:123}),n.jsx(te,{options:[{value:"units",label:"units"}],width:"auto",value:"units"})]});d.__docgenInfo={description:"",methods:[],displayName:"TestInputGroup"};var v,C,I;c.parameters={...c.parameters,docs:{...(v=c.parameters)==null?void 0:v.docs,source:{originalSource:`args => {
|
|
2
2
|
const [_, updateArgs] = useArgs();
|
|
3
3
|
const handleChange = (evt: ChangeEvent<HTMLInputElement>) => {
|
|
4
4
|
updateArgs({
|
|
@@ -94,4 +94,4 @@ import{j as n}from"./jsx-runtime-eps93zm2.js";import{d as ne}from"./index-DQs5XS
|
|
|
94
94
|
value: 'units',
|
|
95
95
|
label: 'units'
|
|
96
96
|
}]} width="auto" value="units" />
|
|
97
|
-
</InputGroup>`,...(X=(Q=d.parameters)==null?void 0:Q.docs)==null?void 0:X.source}}};const
|
|
97
|
+
</InputGroup>`,...(X=(Q=d.parameters)==null?void 0:Q.docs)==null?void 0:X.source}}};const we=["Default","Small","Width","Left","Disabled","AllowEmpty","Warning","Error","BadInput","WithDisplayRounding","WithCustomDisplayRounding","TestInputGroup"];export{u as AllowEmpty,g as BadInput,c as Default,s as Disabled,p as Error,t as Left,a as Small,d as TestInputGroup,o as Warning,r as Width,m as WithCustomDisplayRounding,l as WithDisplayRounding,we as __namedExportsOrder,je as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as n}from"./jsx-runtime-eps93zm2.js";import{T as A}from"./common-types-Sih75Sav.js";import{M as j}from"./actions-
|
|
1
|
+
import{j as n}from"./jsx-runtime-eps93zm2.js";import{T as A}from"./common-types-Sih75Sav.js";import{M as j}from"./actions-CHgr8eL8.js";import{c as C}from"./index-Bk2sglWO.js";import{C as D}from"./check-box-BtCGePRy.js";import{D as y}from"./divider-DY9nJ_7N.js";import"./index-DhsZuJvc.js";import"./lodash-BHd_uQHh.js";import"./disabled-context-rmpd7YJS.js";import"./button-VxhoNhrV.js";import"./spinner-AWUe4xwQ.js";import"./icon-BSFY3vDO.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./inheritsLoose-DP0QEDDI.js";import"./index-CEuq6vkz.js";import"./tooltip-1V7clEnw.js";import"./index-CUZDtIZe.js";import"./types-BmbYqTX_.js";import"./types-UmZ4Y_CR.js";import"./badge-CLQ59MDF.js";import"./help-icon-Buhx5nl6.js";import"./text-B3-TSWok.js";const H="_menu_12x4u_1",q="_header_12x4u_11",M="_item_12x4u_27",k="_heading_12x4u_32",u={menu:H,header:q,item:M,heading:k},x=({option:e,onChange:a})=>{const{key:o,label:i,selected:t}=e;return n.jsx("div",{className:u.item,children:n.jsx(D,{label:i,noMargin:!0,checked:t,onChange:a})},o)};x.__docgenInfo={description:"",methods:[],displayName:"Option",props:{option:{required:!0,tsType:{name:"signature",type:"object",raw:`{
|
|
2
2
|
key?: string;
|
|
3
3
|
label?: string | null;
|
|
4
4
|
selected?: boolean;
|
package/dist/storybook/assets/{padding-and-spacing-BNiScrzg.js → padding-and-spacing-D7O49YoW.js}
RENAMED
|
@@ -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-
|
|
1
|
+
import{j as e}from"./jsx-runtime-eps93zm2.js";import{useMDXComponents as r}from"./index-BcNHZKhG.js";import{Z as t}from"./index-DCGYYCUT.js";import"./index-DhsZuJvc.js";import"./iframe-CgUc-Ukp.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."}),`
|
|
@@ -16,4 +16,4 @@ import{j as e}from"./jsx-runtime-eps93zm2.js";import{useMDXComponents as r}from"
|
|
|
16
16
|
`,e.jsxs(n.li,{children:[e.jsx(n.code,{children:"var(--size)"})," is the default size for buttons & inputs."]}),`
|
|
17
17
|
`,e.jsxs(n.li,{children:[e.jsx(n.code,{children:"var(--size-sm)"})," is for small buttons & inputs."]}),`
|
|
18
18
|
`,e.jsxs(n.li,{children:[e.jsx(n.code,{children:"var(--size-xs)"})," is for checkboxes, toggles & radios."]}),`
|
|
19
|
-
`]})]})}function
|
|
19
|
+
`]})]})}function u(s={}){const{wrapper:n}={...r(),...s.components};return n?e.jsx(n,{...s,children:e.jsx(i,{...s})}):i(s)}export{u as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e}from"./jsx-runtime-eps93zm2.js";import{P as i}from"./page-7SSpdYhb.js";import{T as d}from"./top-bar-
|
|
1
|
+
import{j as e}from"./jsx-runtime-eps93zm2.js";import{P as i}from"./page-7SSpdYhb.js";import{T as d}from"./top-bar-C_tn2Pc5.js";import{S as c}from"./side-bar-CKbHPgIV.js";import{H as s}from"./heading-CRNoBc7q.js";import{L as D}from"./logo-BVP9045W.js";import"./index-DhsZuJvc.js";import"./index-Bk2sglWO.js";import"./icon-BSFY3vDO.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./inheritsLoose-DP0QEDDI.js";import"./index-CEuq6vkz.js";import"./disabled-context-rmpd7YJS.js";import"./common-types-Sih75Sav.js";import"./button-VxhoNhrV.js";import"./spinner-AWUe4xwQ.js";import"./tooltip-1V7clEnw.js";import"./index-CUZDtIZe.js";import"./actions-CHgr8eL8.js";import"./lodash-BHd_uQHh.js";import"./types-BmbYqTX_.js";import"./types-UmZ4Y_CR.js";import"./badge-CLQ59MDF.js";import"./index-BI4_Bp97.js";import"./drawer-BhuWxI7V.js";import"./help-icon-Buhx5nl6.js";const W="_printHeader_o7xxx_1",L={printHeader:W},I=({logo:F,alt:V,logoWidth:C="100px"})=>e.jsx("img",{src:F,alt:V,className:L.printHeader,style:{width:C}});I.__docgenInfo={description:"",methods:[],displayName:"PrintHeader",props:{logo:{required:!0,tsType:{name:"string"},description:""},logoWidth:{required:!1,tsType:{name:"union",raw:"string | number",elements:[{name:"string"},{name:"number"}]},description:"",defaultValue:{value:"'100px'",computed:!1}},alt:{required:!0,tsType:{name:"string"},description:""}}};const t="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum vestibulum velit vitae dolor eleifend, quis cursus tortor tempor. Etiam laoreet tempor turpis ut tristique. In hac habitasse platea dictumst. Ut viverra vestibulum facilisis. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Curabitur commodo egestas magna, at molestie quam euismod ut. Aliquam suscipit at velit vel venenatis. Morbi rhoncus odio neque, volutpat finibus risus hendrerit quis. Sed vitae justo at elit dictum semper. Suspendisse non luctus nulla. Suspendisse condimentum tellus ac elit ornare porttitor. In dignissim libero erat, eget varius nisl tincidunt sed. Duis vel viverra dolor. Mauris nisl lorem, consectetur sed ullamcorper consequat, dictum eu diam. Fusce pretium velit vitae urna tempor, id luctus velit lacinia. Suspendisse lacinia, ante eget egestas mollis, magna magna imperdiet lacus, vitae molestie purus urna et ipsum. Nulla facilisi. Nam augue sapien, dapibus id nunc a, iaculis vulputate urna. Nullam sit amet rutrum tortor. Fusce vel augue vel orci porttitor auctor. Vivamus pulvinar urna quam, non posuere lorem mollis fringilla. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Quisque porta odio quis urna pulvinar hendrerit. Nam eros sapien, cursus at maximus id, suscipit et erat. Praesent semper consectetur lacus eu suscipit. In mi ex, feugiat sagittis facilisis ut, fermentum quis mi. Nunc egestas tempor pharetra. Nulla condimentum massa non facilisis bibendum. Sed at justo eget massa lobortis ultricies sit amet eu ex. Nullam auctor ex ac elit laoreet, vitae convallis sem egestas. Maecenas gravida eros sit amet orci dapibus, rutrum gravida nisl finibus. Pellentesque vitae lorem vulputate, accumsan ligula quis, rhoncus urna. Vestibulum velit ex, venenatis ut sagittis id, malesuada vel diam. Suspendisse et turpis eu metus luctus fermentum at consectetur est. Suspendisse sit amet tincidunt dolor. Curabitur imperdiet congue urna in fringilla. Donec nec accumsan purus. Cras et blandit turpis. Curabitur sed libero nibh. Morbi scelerisque, metus vel cursus dapibus, quam lorem placerat odio, at rhoncus diam diam eget nisi. Nulla sagittis posuere ex, vel scelerisque justo egestas vel. Duis aliquam mollis est id tristique. Ut eros libero, faucibus sed ante sit amet, euismod condimentum dolor. Aenean feugiat augue tortor, id egestas tellus porta eu. Maecenas sed dui vitae erat fringilla lacinia. Etiam nisi felis, rhoncus nec vestibulum vel, mattis eget ligula. Cras sed quam sed nisi mollis eleifend. Nulla commodo, dolor nec bibendum finibus, lorem quam tincidunt lectus, sed volutpat lorem ligula vitae leo. Aliquam efficitur eu felis at dignissim. Fusce auctor eleifend justo, ut varius sapien ullamcorper mattis. Curabitur suscipit pellentesque augue sed bibendum.",le={title:"Layout/Page",component:i,parameters:{layout:"fullscreen",docs:{story:{inline:!1,iframeHeight:400}}},argTypes:{top:{control:"text"},left:{control:"text"},padding:{control:{type:"boolean"}}}},a=()=>e.jsxs(e.Fragment,{children:[e.jsx(d,{}),e.jsx(c,{options:{title:"",sections:[]}}),e.jsxs(i,{children:[e.jsx(s,{top:!0,children:"Heading"}),t]})]}),r=()=>e.jsxs(e.Fragment,{children:[e.jsx(d,{}),e.jsx(c,{options:{title:"",sections:[]}}),e.jsxs(i,{padding:!1,children:[e.jsx(s,{top:!0,children:"Heading"}),t]})]}),o=()=>e.jsxs(e.Fragment,{children:[e.jsx(d,{}),e.jsx(c,{options:{title:"",sections:[]}}),e.jsxs(i,{scroll:!1,children:[e.jsx(s,{top:!0,children:"Heading"}),t]})]}),n=()=>e.jsxs(e.Fragment,{children:[e.jsx(c,{options:{title:"",sections:[]}}),e.jsxs(i,{top:0,children:[e.jsx(s,{top:!0,children:"Heading"}),t]})]}),u=()=>e.jsxs(e.Fragment,{children:[e.jsx(d,{}),e.jsxs(i,{left:0,children:[e.jsx(s,{top:!0,children:"Heading"}),t]})]}),l=()=>e.jsxs(e.Fragment,{children:[e.jsx(I,{logo:D,logoWidth:"60px",alt:"company logo"}),e.jsx(d,{}),e.jsx(c,{options:{title:"",sections:[]}}),e.jsxs(i,{children:[e.jsx(s,{top:!0,children:"Heading"}),t]})]});a.__docgenInfo={description:"",methods:[],displayName:"Default"};r.__docgenInfo={description:"",methods:[],displayName:"NoPadding"};o.__docgenInfo={description:"",methods:[],displayName:"NoScroll"};n.__docgenInfo={description:"",methods:[],displayName:"NoTopBar"};u.__docgenInfo={description:"",methods:[],displayName:"NoSideBar"};l.__docgenInfo={description:"",methods:[],displayName:"WithPrintHeader"};var m,p,g;a.parameters={...a.parameters,docs:{...(m=a.parameters)==null?void 0:m.docs,source:{originalSource:`() => <>
|
|
2
2
|
<TopBar />
|
|
3
3
|
<SideBar options={{
|
|
4
4
|
title: '',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as o}from"./jsx-runtime-eps93zm2.js";import{r as b}from"./index-DhsZuJvc.js";import{I as l}from"./common-types-Sih75Sav.js";import{S as C}from"./select-
|
|
1
|
+
import{j as o}from"./jsx-runtime-eps93zm2.js";import{r as b}from"./index-DhsZuJvc.js";import{I as l}from"./common-types-Sih75Sav.js";import{S as C}from"./select-D55JvDou.js";import{I}from"./input-BW9trNAW.js";import{B as p}from"./button-VxhoNhrV.js";import{I as N}from"./input-group-BaRSJAEN.js";import{I as j}from"./input-group-addon-D68iUKV2.js";const E=(n,i)=>i||n&&n.reduce((e,t)=>t.selected?Number(t.value):e,10)||10,_=(n,i)=>{if(!i||!n)return 10;const{options:e,value:t}=i,a=Number(t);return a===0?1:Math.ceil(n/E(e,a))},S=(n,i,e="Selected page must be a positive whole number between 1 and")=>{const t=`${e} ${i}`,a={valid:!0,error:null};return n===""?a:!n.match(/^\d+$/g)||parseInt(n)<=0||parseInt(n)>i?{valid:!1,error:t}:a},P="_paginationContainer_1tmz4_1",R={paginationContainer:P},T=({pagination:n})=>{const{rowCount:i,selectedPage:e,small:t,onSelectPage:a,rowsPerPage:r,errorMessageTemplate:g,testIds:m}=n,d=Number(r==null?void 0:r.value)===0,u=_(i,r),[f,h]=b.useState(String(e));b.useEffect(()=>{h(String(e))},[e]);const{error:v}=S(f,u,g),c=s=>{const{valid:x}=S(s,u,g);h(s),x&&s!==""&&a&&a(Number(s))};return o.jsxs("div",{className:R.paginationContainer,children:[r&&o.jsx("div",{style:{flexShrink:0},children:o.jsx(C,{onChange:s=>{r.onChange&&r.onChange(s),c(String(1))},options:r.options,native:!!r.options,small:t,width:"auto",value:r.value})}),o.jsx(p,{small:t,round:!0,basic:!0,icon:l.CHEVRON_DOUBLE_LEFT,onClick:()=>c(String(1)),disabled:d||e===1}),o.jsx(p,{small:t,round:!0,basic:!0,icon:l.CHEVRON_LEFT,onClick:()=>c(String(Number(e)-1)),disabled:d||e===1}),o.jsxs(N,{small:t,width:"auto",children:[o.jsx(I,{right:!0,value:f,placeholder:String(e),onChange:s=>c(s.target.value),width:"50px",disabled:d||u<=1,error:v}),o.jsxs(j,{children:["of ",u]})]}),o.jsx(p,{small:t,round:!0,basic:!0,icon:l.CHEVRON_RIGHT,onClick:()=>c(String(Number(e)+1)),disabled:d||e===u}),o.jsx(p,{small:t,round:!0,basic:!0,icon:l.CHEVRON_DOUBLE_RIGHT,onClick:()=>c(String(u)),disabled:d||e===u,testId:m==null?void 0:m.doubleRightBtn})]})};T.__docgenInfo={description:"",methods:[],displayName:"Pagination",props:{pagination:{required:!0,tsType:{name:"IPagination"},description:""}}};export{T as P};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import{j as p}from"./jsx-runtime-eps93zm2.js";import{r as l}from"./index-DhsZuJvc.js";import{P as g}from"./pagination-DzpYFhAO.js";import"./common-types-Sih75Sav.js";import"./select-D55JvDou.js";import"./index-Bk2sglWO.js";import"./disabled-context-rmpd7YJS.js";import"./types-UmZ4Y_CR.js";import"./lodash-BHd_uQHh.js";import"./tooltip-1V7clEnw.js";import"./index-CUZDtIZe.js";import"./index-CEuq6vkz.js";import"./inheritsLoose-DP0QEDDI.js";import"./assertThisInitialized-B9jnkVVz.js";import"./memoize-one.esm-CcMeOnPo.js";import"./types-BmbYqTX_.js";import"./text-B3-TSWok.js";import"./actions-CHgr8eL8.js";import"./button-VxhoNhrV.js";import"./spinner-AWUe4xwQ.js";import"./icon-BSFY3vDO.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./badge-CLQ59MDF.js";import"./select.input-DIKP56UZ.js";import"./input-BW9trNAW.js";import"./input-group-BaRSJAEN.js";import"./input-group-addon-D68iUKV2.js";const h={rowCount:500,selectedPage:1,onSelectPage:()=>{}},V={title:"Basic/Pagination",component:g,args:{pagination:h}},n=()=>{const[a,t]=l.useState(1);return p.jsx(g,{pagination:{rowCount:500,selectedPage:a,onSelectPage:o=>t(o)}})},r=()=>{const[a,t]=l.useState(1),[o,i]=l.useState(20);return p.jsx(g,{pagination:{rowCount:500,selectedPage:a,rowsPerPage:{onChange:e=>i(Number(e.target.value)),options:[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"Show all",value:0}],value:o},onSelectPage:e=>t(e)}})},s=()=>{const[a,t]=l.useState(1),[o,i]=l.useState(20);return p.jsx(g,{pagination:{small:!0,rowCount:500,selectedPage:a,rowsPerPage:{onChange:e=>i(Number(e.target.value)),options:[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"Show all",value:0}],value:o},onSelectPage:e=>t(e)}})};n.__docgenInfo={description:"",methods:[],displayName:"Default"};r.__docgenInfo={description:"",methods:[],displayName:"RowsPerPage"};s.__docgenInfo={description:"",methods:[],displayName:"Small"};var P,c,u;n.parameters={...n.parameters,docs:{...(P=n.parameters)==null?void 0:P.docs,source:{originalSource:`() => {
|
|
2
|
+
const [selectedPage, setSelectedPage] = useState(1);
|
|
3
|
+
return <Pagination pagination={{
|
|
4
|
+
rowCount: 500,
|
|
5
|
+
selectedPage,
|
|
6
|
+
onSelectPage: evt => setSelectedPage(evt)
|
|
7
|
+
}} />;
|
|
8
|
+
}`,...(u=(c=n.parameters)==null?void 0:c.docs)==null?void 0:u.source}}};var m,d,S;r.parameters={...r.parameters,docs:{...(m=r.parameters)==null?void 0:m.docs,source:{originalSource:`() => {
|
|
9
|
+
const [selectedPage, setSelectedPage] = useState(1);
|
|
10
|
+
const [rowsPerPage, setRowsPerPage] = useState(20);
|
|
11
|
+
return <Pagination pagination={{
|
|
12
|
+
rowCount: 500,
|
|
13
|
+
selectedPage,
|
|
14
|
+
rowsPerPage: {
|
|
15
|
+
onChange: evt => setRowsPerPage(Number(evt.target.value)),
|
|
16
|
+
options: [{
|
|
17
|
+
label: '10 / page',
|
|
18
|
+
value: 10
|
|
19
|
+
}, {
|
|
20
|
+
label: '20 / page',
|
|
21
|
+
value: 20
|
|
22
|
+
}, {
|
|
23
|
+
label: '50 / page',
|
|
24
|
+
value: 50
|
|
25
|
+
}, {
|
|
26
|
+
label: 'Show all',
|
|
27
|
+
value: 0
|
|
28
|
+
}],
|
|
29
|
+
value: rowsPerPage
|
|
30
|
+
},
|
|
31
|
+
onSelectPage: evt => setSelectedPage(evt)
|
|
32
|
+
}} />;
|
|
33
|
+
}`,...(S=(d=r.parameters)==null?void 0:d.docs)==null?void 0:S.source}}};var v,w,b;s.parameters={...s.parameters,docs:{...(v=s.parameters)==null?void 0:v.docs,source:{originalSource:`() => {
|
|
34
|
+
const [selectedPage, setSelectedPage] = useState(1);
|
|
35
|
+
const [rowsPerPage, setRowsPerPage] = useState(20);
|
|
36
|
+
return <Pagination pagination={{
|
|
37
|
+
small: true,
|
|
38
|
+
rowCount: 500,
|
|
39
|
+
selectedPage,
|
|
40
|
+
rowsPerPage: {
|
|
41
|
+
onChange: evt => setRowsPerPage(Number(evt.target.value)),
|
|
42
|
+
options: [{
|
|
43
|
+
label: '10 / page',
|
|
44
|
+
value: 10
|
|
45
|
+
}, {
|
|
46
|
+
label: '20 / page',
|
|
47
|
+
value: 20
|
|
48
|
+
}, {
|
|
49
|
+
label: '50 / page',
|
|
50
|
+
value: 50
|
|
51
|
+
}, {
|
|
52
|
+
label: 'Show all',
|
|
53
|
+
value: 0
|
|
54
|
+
}],
|
|
55
|
+
value: rowsPerPage
|
|
56
|
+
},
|
|
57
|
+
onSelectPage: evt => setSelectedPage(evt)
|
|
58
|
+
}} />;
|
|
59
|
+
}`,...(b=(w=s.parameters)==null?void 0:w.docs)==null?void 0:b.source}}};const W=["Default","RowsPerPage","Small"];export{n as Default,r as RowsPerPage,s as Small,W as __namedExportsOrder,V as default};
|
package/dist/storybook/assets/{pop-confirm.stories-Cr_ZBbLn.js → pop-confirm.stories-Hox7vJnl.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as t}from"./jsx-runtime-eps93zm2.js";import{P as S}from"./popover-
|
|
1
|
+
import{j as t}from"./jsx-runtime-eps93zm2.js";import{P as S}from"./popover-CzZdWNnB.js";import{B as u}from"./button-VxhoNhrV.js";import{T as I}from"./text-B3-TSWok.js";import{t as A}from"./toaster-B8A3xIYu.js";import"./index-DhsZuJvc.js";import"./tooltip-1V7clEnw.js";import"./index-CUZDtIZe.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"./inheritsLoose-DP0QEDDI.js";import"./index-CEuq6vkz.js";import"./toaster-7wnI6hqB.js";import"./message-ZenLdkrf.js";const R="_popConfirm_1x6ye_1",$="_content_1x6ye_7",W="_buttons_1x6ye_13",y={popConfirm:R,content:$,buttons:W},O=({title:e,okText:p,onClickOk:d,disableConfirmButton:m,cancelText:f,onClickCancel:g,close:a,testId:o})=>t.jsxs("div",{className:y.popConfirm,children:[e&&t.jsx("div",{className:y.content,children:t.jsx(I,{small:!0,children:e})}),t.jsxs("div",{className:y.buttons,children:[t.jsx(u,{small:!0,colored:!0,label:p,onClick:()=>d(a),disabled:m,testId:`${o}-ok-button`}),t.jsx(u,{small:!0,label:f,onClick:()=>g(a),testId:`${o}-cancel-button`})]})]});O.__docgenInfo={description:"",methods:[],displayName:"Content",props:{title:{required:!1,tsType:{name:"string"},description:""},okText:{required:!0,tsType:{name:"string"},description:""},onClickOk:{required:!0,tsType:{name:"signature",type:"function",raw:"(close?: TEmpty) => void",signature:{arguments:[{type:{name:"signature",type:"function",raw:"() => void",signature:{arguments:[],return:{name:"void"}}},name:"close"}],return:{name:"void"}}},description:""},disableConfirmButton:{required:!1,tsType:{name:"boolean"},description:""},cancelText:{required:!0,tsType:{name:"string"},description:""},onClickCancel:{required:!0,tsType:{name:"signature",type:"function",raw:"(close?: TEmpty) => void",signature:{arguments:[{type:{name:"signature",type:"function",raw:"() => void",signature:{arguments:[],return:{name:"void"}}},name:"close"}],return:{name:"void"}}},description:""},close:{required:!1,tsType:{name:"signature",type:"function",raw:"() => void",signature:{arguments:[],return:{name:"void"}}},description:""},testId:{required:!1,tsType:{name:"string"},description:""}}};const v=({children:e,placement:p="top-center",closeOnOutsideClick:d=!0,fullWidth:m=!1,title:f="",cancelText:g="Cancel",onClickCancel:a=i=>i&&i(),okText:o="Ok",onClickOk:D=()=>{},disableConfirmButton:E=!1,overflowContainer:N=!1,testId:C=void 0})=>{const i=t.jsx(O,{title:f,okText:o,onClickOk:D,disableConfirmButton:E,cancelText:g,onClickCancel:a,testId:C});return t.jsx(S,{content:i,placement:p,closeOnOutsideClick:d,fullWidth:m,overflowContainer:N,testId:C,children:e})};v.__docgenInfo={description:"",methods:[],displayName:"PopConfirm",props:{children:{required:!1,tsType:{name:"ReactNode"},description:""},placement:{required:!1,tsType:{name:"Placement"},description:"",defaultValue:{value:"'top-center'",computed:!1}},closeOnOutsideClick:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"true",computed:!1}},fullWidth:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},title:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:"''",computed:!1}},cancelText:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:"'Cancel'",computed:!1}},onClickCancel:{required:!1,tsType:{name:"signature",type:"function",raw:"(close?: TEmpty) => void",signature:{arguments:[{type:{name:"signature",type:"function",raw:"() => void",signature:{arguments:[],return:{name:"void"}}},name:"close"}],return:{name:"void"}}},description:"",defaultValue:{value:"(close) => close && close()",computed:!1}},disableConfirmButton:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},okText:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:"'Ok'",computed:!1}},onClickOk:{required:!1,tsType:{name:"signature",type:"function",raw:"(close?: TEmpty) => void",signature:{arguments:[{type:{name:"signature",type:"function",raw:"() => void",signature:{arguments:[],return:{name:"void"}}},name:"close"}],return:{name:"void"}}},description:"",defaultValue:{value:"() => {}",computed:!1}},overflowContainer:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},testId:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:"undefined",computed:!0}}}};const Y=e=>{A({message:{type:"Success",content:"success!",details:"You successfully booked your cruise to Bahamas."}}),e()},oe={title:"Basic/PopConfirm",component:v,args:{title:"Do you want a free cruise to Bahamas?",onClickCancel:e=>e(),onClickOk:Y,children:t.jsx(u,{label:"Click me!"}),overflowContainer:!0,placement:"top-center"},decorators:[e=>t.jsx("div",{style:{display:"flex",justifyContent:"center"},children:e()})],parameters:{docs:{source:{excludeDecorators:!0}}}},c=e=>t.jsx(v,{...e}),l=c.bind({}),r=c.bind({});r.args={children:t.jsx(u,{small:!0,round:!0,basic:!0,colored:"muted",icon:"delete"})};const s=c.bind({});s.args={placement:"bottom-end"};const n=c.bind({});n.args={disableConfirmButton:!0};var x,b,T;l.parameters={...l.parameters,docs:{...(x=l.parameters)==null?void 0:x.docs,source:{originalSource:`args => <PopConfirm
|
|
2
2
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
3
3
|
{...args} />`,...(T=(b=l.parameters)==null?void 0:b.docs)==null?void 0:T.source}}};var k,q,j;r.parameters={...r.parameters,docs:{...(k=r.parameters)==null?void 0:k.docs,source:{originalSource:`args => <PopConfirm
|
|
4
4
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./jsx-runtime-eps93zm2.js";import{r as n,R as u}from"./index-DhsZuJvc.js";import{u as _,A as j,i as B}from"./tooltip-1V7clEnw.js";import{c}from"./index-Bk2sglWO.js";import{I as P}from"./common-types-Sih75Sav.js";import{D as V}from"./disabled-context-rmpd7YJS.js";import{B as k}from"./button-VxhoNhrV.js";const E="_toggleBox_lhie5_1",R="_fullWidthStyleFix_lhie5_8",S="_dismiss_lhie5_13",a={toggleBox:E,fullWidthStyleFix:R,dismiss:S},W=({children:f,content:i,placement:p="top-center",closeOnOutsideClick:m=!0,fullWidth:g=!1,showCloseButton:x=!1,testId:y,disabled:s=!1,overflowContainer:v=!1,isOpen:d,onToggle:h})=>{const o=n.useContext(V),[l,t]=d!==void 0?[d,h]:n.useState(!1),r=()=>{!s&&!o&&t&&t(!1)},b=()=>{s||o||t&&t(!l)};n.useEffect(()=>{(s||o)&&r()},[s,o]);const{renderLayer:T,arrowProps:C,layerProps:q,triggerProps:O}=_({isOpen:l,placement:p,auto:!0,triggerOffset:6,onOutsideClick:m?r:void 0,ResizeObserver:B,overflowContainer:v});return e.jsxs(e.Fragment,{children:[e.jsx("div",{ref:O.ref,onClick:b,"data-testid":y,children:f}),l&&T(e.jsxs("div",{className:g?c(a.toggleBox,a.fullWidthStyleFix):c(a.toggleBox),...q,children:[e.jsxs("div",{children:[u.isValidElement(i)?u.cloneElement(i,{close:r}):i,x&&e.jsx("div",{className:a.dismiss,children:e.jsx(k,{small:!0,round:!0,onClick:r,icon:P.CLOSE})})]}),e.jsx(j,{...C,backgroundColor:"var(--color-background-layer)",borderColor:"var(--color-border)",borderWidth:1,size:6})]}))]})};W.__docgenInfo={description:"",methods:[],displayName:"Popover",props:{children:{required:!1,tsType:{name:"ReactNode"},description:""},content:{required:!1,tsType:{name:"ReactNode"},description:""},placement:{required:!1,tsType:{name:"Placement"},description:"",defaultValue:{value:"'top-center'",computed:!1}},closeOnOutsideClick:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"true",computed:!1}},fullWidth:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},showCloseButton:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},testId:{required:!1,tsType:{name:"string"},description:""},disabled:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},overflowContainer:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},isOpen:{required:!1,tsType:{name:"boolean"},description:""},onToggle:{required:!1,tsType:{name:"signature",type:"function",raw:"(isOpen: boolean) => void",signature:{arguments:[{type:{name:"boolean"},name:"isOpen"}],return:{name:"void"}}},description:""}}};export{W as P};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import{j as r}from"./jsx-runtime-eps93zm2.js";import{r as k}from"./index-DhsZuJvc.js";import{S as w}from"./spacer-BWoNR27H.js";import{P as i}from"./popover-CzZdWNnB.js";import{I as c}from"./input-BW9trNAW.js";import{B as l}from"./button-VxhoNhrV.js";import{F as y}from"./flex-EllkLxgO.js";import{S as D}from"./select-D55JvDou.js";import"./tooltip-1V7clEnw.js";import"./index-CUZDtIZe.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"./spinner-AWUe4xwQ.js";import"./icon-BSFY3vDO.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./inheritsLoose-DP0QEDDI.js";import"./index-CEuq6vkz.js";import"./assertThisInitialized-B9jnkVVz.js";import"./memoize-one.esm-CcMeOnPo.js";import"./types-BmbYqTX_.js";import"./text-B3-TSWok.js";import"./actions-CHgr8eL8.js";import"./badge-CLQ59MDF.js";import"./select.input-DIKP56UZ.js";const u=[{label:"Option 1",value:"1"},{label:"Option 2",value:"2"}],_=({close:e})=>r.jsxs(y,{gap:"var(--padding-xs)",children:[r.jsx(c,{value:"Value",width:"150px",small:!0}),r.jsx(D,{options:u,value:u[0],width:"auto",small:!0}),r.jsx(l,{colored:!0,label:"Save",onClick:()=>{},small:!0}),r.jsx(l,{label:"Cancel",onClick:e,small:!0})]}),lr={title:"Basic/Popover",component:i,args:{overflowContainer:!0,content:r.jsx(_,{}),children:r.jsx(l,{label:"Toggle me"})},decorators:[e=>r.jsx("div",{style:{display:"flex"},children:e()})],parameters:{docs:{source:{excludeDecorators:!0}}}},n=e=>r.jsx(i,{...e}),p=n.bind({}),o=n.bind({});o.args={children:r.jsx(c,{value:"Value",width:"100%"})};const s=n.bind({});s.args={closeOnOutsideClick:!1,showCloseButton:!0};const t=n.bind({});t.args={disabled:!0};const a=e=>{const[m,T]=k.useState(!1);return r.jsxs("div",{children:[r.jsx(l,{onClick:()=>T(!m),label:"Toggle Popover Externally"}),r.jsx(w,{}),r.jsx(i,{...e,isOpen:m,children:r.jsx(c,{})})]})};a.__docgenInfo={description:"",methods:[],displayName:"ExternalControl"};var d,g,x;p.parameters={...p.parameters,docs:{...(d=p.parameters)==null?void 0:d.docs,source:{originalSource:"args => <Popover {...args} />",...(x=(g=p.parameters)==null?void 0:g.docs)==null?void 0:x.source}}};var v,f,j;o.parameters={...o.parameters,docs:{...(v=o.parameters)==null?void 0:v.docs,source:{originalSource:"args => <Popover {...args} />",...(j=(f=o.parameters)==null?void 0:f.docs)==null?void 0:j.source}}};var b,S,C;s.parameters={...s.parameters,docs:{...(b=s.parameters)==null?void 0:b.docs,source:{originalSource:"args => <Popover {...args} />",...(C=(S=s.parameters)==null?void 0:S.docs)==null?void 0:C.source}}};var O,h,P;t.parameters={...t.parameters,docs:{...(O=t.parameters)==null?void 0:O.docs,source:{originalSource:"args => <Popover {...args} />",...(P=(h=t.parameters)==null?void 0:h.docs)==null?void 0:P.source}}};var I,E,B;a.parameters={...a.parameters,docs:{...(I=a.parameters)==null?void 0:I.docs,source:{originalSource:`args => {
|
|
2
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
3
|
+
return <div>
|
|
4
|
+
<Button onClick={() => setIsOpen(!isOpen)} label="Toggle Popover Externally" />
|
|
5
|
+
<Spacer />
|
|
6
|
+
<Popover {...args} isOpen={isOpen}>
|
|
7
|
+
<Input />
|
|
8
|
+
</Popover>
|
|
9
|
+
</div>;
|
|
10
|
+
}`,...(B=(E=a.parameters)==null?void 0:E.docs)==null?void 0:B.source}}};const nr=["Default","InputTrigger","CloseButton","Disabled","ExternalControl"];export{s as CloseButton,p as Default,t as Disabled,a as ExternalControl,o as InputTrigger,nr as __namedExportsOrder,lr as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DocsRenderer-PKQXORMH-BmaBzyAH.js","./chunk-HLWAVYOI-CuMm7Qpv.js","./iframe-CgUc-Ukp.js","./index-DhsZuJvc.js","./react-16-DXAfArL2.js","./index-CUZDtIZe.js","./index-DCGYYCUT.js","./inheritsLoose-DP0QEDDI.js","./assertThisInitialized-B9jnkVVz.js","./index-D6rZ4wEC.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as a}from"./iframe-CgUc-Ukp.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-BmaBzyAH.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,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-
|
|
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-DCGYYCUT.js";import{e as _}from"./index-DRSy5Ssd.js";import"./chunk-HLWAVYOI-CuMm7Qpv.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-CgUc-Ukp.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
|
-
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
|
|
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};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import{j as e}from"./jsx-runtime-eps93zm2.js";import"./index-DhsZuJvc.js";import{T as n}from"./top-bar-C_tn2Pc5.js";import{L as r}from"./list-yVTOdmpX.js";import{P as p}from"./page-7SSpdYhb.js";import{R as c,C as o}from"./row-4iAGREkV.js";import{T as d}from"./tabs-CAZ_dHGK.js";import{S as u}from"./spacer-BWoNR27H.js";import"./index-Bk2sglWO.js";import"./icon-BSFY3vDO.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./inheritsLoose-DP0QEDDI.js";import"./index-CEuq6vkz.js";import"./disabled-context-rmpd7YJS.js";import"./common-types-Sih75Sav.js";import"./button-VxhoNhrV.js";import"./spinner-AWUe4xwQ.js";import"./tooltip-1V7clEnw.js";import"./index-CUZDtIZe.js";import"./actions-CHgr8eL8.js";import"./lodash-BHd_uQHh.js";import"./types-BmbYqTX_.js";import"./types-UmZ4Y_CR.js";import"./badge-CLQ59MDF.js";import"./index.es-DazXb-ul.js";import"./redux-tRgGMjwY.js";import"./objectSpread2-DW4nTBoq.js";import"./tiny-invariant-DqLgxztJ.js";import"./memoize-one.esm-CcMeOnPo.js";import"./card-EcjmryU9.js";import"./meta-content-cbHGvPJ7.js";import"./heading-CRNoBc7q.js";import"./help-icon-Buhx5nl6.js";import"./loader-XHoVniao.js";import"./styled-components.browser.esm-Bf0q9Yjk.js";import"./select.input-DIKP56UZ.js";const t=[{label:"Browse",value:"Browse"},{label:"Recent",value:"Recent"},{label:"My Projects",value:"My Projects"}],s=[{id:1,name:"Lorem",active:!0},{id:2,name:"Ipsum"},{id:3,name:"Dolor"},{id:4,name:"Long name goes here lorem ipsum"},{id:5,name:"Lorem"},{id:6,name:"Ipsum"},{id:7,name:"Dolor"},{id:8,name:"Long name goes here lorem ipsum"},{id:9,name:"Lorem"},{id:10,name:"Ipsum"},{id:11,name:"Dolor"},{id:12,name:"Long name goes here lorem ipsum"},{id:13,name:"Lorem"},{id:14,name:"Ipsum"},{id:15,name:"Dolor"},{id:16,name:"Long name goes here lorem ipsum"}],X={title:"Layout/Layout Examples",parameters:{layout:"fullscreen",docs:{story:{inline:!1,iframeHeight:400}}}},l=()=>e.jsxs(e.Fragment,{children:[e.jsx(n,{}),e.jsxs(p,{padding:!1,left:0,scroll:!1,children:[e.jsx(u,{}),e.jsx(d,{margin:!1,padding:!0,options:t,value:t[0]}),e.jsxs(c,{spacing:0,flex:!0,height:"100%",children:[e.jsx(o,{borderRight:!0,scroll:!0,showScrollbar:!1,children:e.jsx(r,{list:{name:"Country",items:s}})}),e.jsx(o,{borderRight:!0,scroll:!0,showScrollbar:!1,children:e.jsx(r,{list:{name:"Field",items:s}})}),e.jsx(o,{borderRight:!0,scroll:!0,showScrollbar:!1,children:e.jsx(r,{list:{name:"Site",items:s}})}),e.jsx(o,{borderRight:!0,scroll:!0,showScrollbar:!1,children:e.jsx(r,{list:{name:"Well",items:s}})}),e.jsx(o,{borderRight:!0,scroll:!0,showScrollbar:!1,children:e.jsx(r,{list:{name:"Wellbore",items:s}})}),e.jsx(o,{scroll:!0,showScrollbar:!1,children:e.jsx(r,{list:{name:"Design",items:s}})})]})]})]});l.__docgenInfo={description:"",methods:[],displayName:"Projects"};var i,m,a;l.parameters={...l.parameters,docs:{...(i=l.parameters)==null?void 0:i.docs,source:{originalSource:`() => {
|
|
2
|
+
return <>
|
|
3
|
+
<TopBar />
|
|
4
|
+
<Page padding={false} left={0} scroll={false}>
|
|
5
|
+
<Spacer />
|
|
6
|
+
<Tabs margin={false} padding options={tabs} value={tabs[0]} />
|
|
7
|
+
<Row spacing={0} flex height="100%">
|
|
8
|
+
<Column borderRight scroll showScrollbar={false}>
|
|
9
|
+
<List list={{
|
|
10
|
+
name: 'Country',
|
|
11
|
+
items
|
|
12
|
+
}} />
|
|
13
|
+
</Column>
|
|
14
|
+
<Column borderRight scroll showScrollbar={false}>
|
|
15
|
+
<List list={{
|
|
16
|
+
name: 'Field',
|
|
17
|
+
items
|
|
18
|
+
}} />
|
|
19
|
+
</Column>
|
|
20
|
+
<Column borderRight scroll showScrollbar={false}>
|
|
21
|
+
<List list={{
|
|
22
|
+
name: 'Site',
|
|
23
|
+
items
|
|
24
|
+
}} />
|
|
25
|
+
</Column>
|
|
26
|
+
<Column borderRight scroll showScrollbar={false}>
|
|
27
|
+
<List list={{
|
|
28
|
+
name: 'Well',
|
|
29
|
+
items
|
|
30
|
+
}} />
|
|
31
|
+
</Column>
|
|
32
|
+
<Column borderRight scroll showScrollbar={false}>
|
|
33
|
+
<List list={{
|
|
34
|
+
name: 'Wellbore',
|
|
35
|
+
items
|
|
36
|
+
}} />
|
|
37
|
+
</Column>
|
|
38
|
+
<Column scroll showScrollbar={false}>
|
|
39
|
+
<List list={{
|
|
40
|
+
name: 'Design',
|
|
41
|
+
items
|
|
42
|
+
}} />
|
|
43
|
+
</Column>
|
|
44
|
+
</Row>
|
|
45
|
+
</Page>
|
|
46
|
+
</>;
|
|
47
|
+
}`,...(a=(m=l.parameters)==null?void 0:m.docs)==null?void 0:a.source}}};const Y=["Projects"];export{l as Projects,Y as __namedExportsOrder,X as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as a}from"./jsx-runtime-eps93zm2.js";import{r as k}from"./index-DhsZuJvc.js";import{c as y}from"./index-Bk2sglWO.js";import{D as R}from"./disabled-context-rmpd7YJS.js";import{s as C}from"./select.input-DIKP56UZ.js";import{b as H}from"./common-types-Sih75Sav.js";import{H as V}from"./help-icon-
|
|
1
|
+
import{j as a}from"./jsx-runtime-eps93zm2.js";import{r as k}from"./index-DhsZuJvc.js";import{c as y}from"./index-Bk2sglWO.js";import{D as R}from"./disabled-context-rmpd7YJS.js";import{s as C}from"./select.input-DIKP56UZ.js";import{b as H}from"./common-types-Sih75Sav.js";import{H as V}from"./help-icon-Buhx5nl6.js";const j="_wrapper_1fbik_1",O="_inline_1fbik_1",B="_radio_1fbik_5",L="_labelMargin_1fbik_8",D="_small_1fbik_27",N="_noMargin_1fbik_32",A="_disabled_1fbik_90",S="_isInTable_1fbik_106",z="_helpIconEnabled_1fbik_111",n={wrapper:j,inline:O,radio:B,labelMargin:L,small:D,noMargin:N,disabled:A,isInTable:S,helpIconEnabled:z},T=({name:m,label:p,value:r,selected:c,disabled:t=!1,small:f=!1,onChange:b,noMargin:g=!1,testId:v,helpText:s,onClickHelp:l})=>{const o=s||l;return a.jsxs("div",{className:y(n.radio,t?n.disabled:null,f?n.small:null,g?n.noMargin:null),onClick:b,"data-testid":v,children:[a.jsx("input",{type:H.RADIO,value:r,checked:c,onChange:()=>{},disabled:t}),a.jsx("label",{"data-name":m,"data-value":r,children:p}),o&&a.jsx("div",{className:n.helpIconEnabled,onClick:l,children:a.jsx(V,{text:s})})]})};T.__docgenInfo={description:"",methods:[],displayName:"RadioInput",props:{name:{required:!0,tsType:{name:"union",raw:"string | number",elements:[{name:"string"},{name:"number"}]},description:""},label:{required:!0,tsType:{name:"union",raw:"string | number",elements:[{name:"string"},{name:"number"}]},description:""},value:{required:!0,tsType:{name:"union",raw:"string | number",elements:[{name:"string"},{name:"number"}]},description:""},selected:{required:!0,tsType:{name:"boolean"},description:""},disabled:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},small:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},onChange:{required:!1,tsType:{name:"signature",type:"function",raw:"(evt: React.MouseEvent<HTMLDivElement, MouseEvent>) => void",signature:{arguments:[{type:{name:"ReactMouseEvent",raw:"React.MouseEvent<HTMLDivElement, MouseEvent>",elements:[{name:"HTMLDivElement"},{name:"MouseEvent"}]},name:"evt"}],return:{name:"void"}}},description:""},noMargin:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},testId:{required:!1,tsType:{name:"string"},description:""},helpText:{required:!1,tsType:{name:"string"},description:""},onClickHelp:{required:!1,tsType:{name:"signature",type:"function",raw:"(event?: any) => void",signature:{arguments:[{type:{name:"any"},name:"event"}],return:{name:"void"}}},description:""}}};const F=({name:m,label:p,options:r,value:c,onChange:t,disabled:f=!1,small:b=!1,noMargin:g=!1,onClick:v=()=>{},inline:s=!1,mainLabel:l="",radioButtonsData:o,classForContainer:I="grouped fields"})=>{const _=k.useContext(R),u=o!==void 0,{simpleInputs:q,options:M,selectedOptions:d}=u?{simpleInputs:!1,options:o,selectedOptions:void 0}:C(r,c),E=u||d===void 0||d===null?void 0:q?d:d.value,h=u?l:p;return a.jsxs("div",{className:y(n.wrapper,s?n.inline:null,I==="inline fields"?n.inline:null),children:[l&&a.jsx("label",{className:y(s&&n.labelMargin),children:h}),M.map((e,w)=>{const x=e.checked||e.value===E||!1;return a.jsx(T,{name:e.name||e.value,label:e.label,value:e.value,selected:x,disabled:f||e.disabled||_,small:b,noMargin:g,onChange:e.disabled?void 0:i=>{u?v(i.target):(i.target.name=m,i.target.value=e.value.toString(),i.target.label=e.label.toString(),t&&t(i))},testId:e.testId,helpText:e.helpText,onClickHelp:e.onClickHelp},w)})]})};F.__docgenInfo={description:"",methods:[],displayName:"RadioButton",props:{name:{required:!1,tsType:{name:"string"},description:""},label:{required:!1,tsType:{name:"union",raw:"string | null",elements:[{name:"string"},{name:"null"}]},description:""},options:{required:!0,tsType:{name:"Array",elements:[{name:"IRadioButtonOption"}],raw:"IRadioButtonOption[]"},description:""},value:{required:!0,tsType:{name:"union",raw:"TStringOrNumber | IRadioButtonOption",elements:[{name:"union",raw:"string | number",elements:[{name:"string"},{name:"number"}]},{name:"IRadioButtonOption"}]},description:""},inline:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},disabled:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},small:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},onChange:{required:!1,tsType:{name:"signature",type:"function",raw:"(evt: ChangeEvent<HTMLInputElement>) => void",signature:{arguments:[{type:{name:"ChangeEvent",elements:[{name:"HTMLInputElement"}],raw:"ChangeEvent<HTMLInputElement>"},name:"evt"}],return:{name:"void"}}},description:""},noMargin:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},mainLabel:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:"''",computed:!1}},onClick:{required:!1,tsType:{name:"signature",type:"function",raw:"(target: HTMLInputElement) => void",signature:{arguments:[{type:{name:"HTMLInputElement"},name:"target"}],return:{name:"void"}}},description:"",defaultValue:{value:"() => {}",computed:!1}},radioButtonsData:{required:!1,tsType:{name:"Array",elements:[{name:"IRadioButtonOption"}],raw:"IRadioButtonOption[]"},description:""},classForContainer:{required:!1,tsType:{name:"union",raw:"'grouped fields' | 'inline fields'",elements:[{name:"literal",value:"'grouped fields'"},{name:"literal",value:"'inline fields'"}]},description:"",defaultValue:{value:"'grouped fields'",computed:!1}}}};export{F as R};
|
package/dist/storybook/assets/{radio-button.stories-B84Ip3NV.js → radio-button.stories-Bg5JVXpo.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j}from"./jsx-runtime-eps93zm2.js";import{r as _}from"./index-DhsZuJvc.js";import{R as I}from"./radio-button-
|
|
1
|
+
import{j}from"./jsx-runtime-eps93zm2.js";import{r as _}from"./index-DhsZuJvc.js";import{R as I}from"./radio-button-YBwYcMaM.js";import"./index-Bk2sglWO.js";import"./disabled-context-rmpd7YJS.js";import"./select.input-DIKP56UZ.js";import"./types-BmbYqTX_.js";import"./common-types-Sih75Sav.js";import"./help-icon-Buhx5nl6.js";import"./tooltip-1V7clEnw.js";import"./index-CUZDtIZe.js";import"./icon-BSFY3vDO.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./inheritsLoose-DP0QEDDI.js";import"./index-CEuq6vkz.js";const n=[{label:"Aardvarks",value:"termites"},{label:"Kangaroos",value:"grass"},{label:"Monkeys",value:"bananas",disabled:!0}],Y={title:"Forms/RadioButton",component:I,args:{options:n,inline:!1,noMargin:!1,disabled:!1,small:!1}},a=e=>{const[t,M]=_.useState(n[0]),y=k=>{const L=k.target.value,i=n.find(D=>D.value===L);i&&M(i)};return j.jsx(I,{...e,value:t,onChange:y})},c=a.bind({}),s=a.bind({});s.args={small:!0};const o=a.bind({});o.args={options:n.map((e,t)=>({...e,helpText:`Help text #${t}`}))};const l=a.bind({});l.args={options:n.map((e,t)=>({...e,onClickHelp:()=>console.log(`Help #${t} clicked`)}))};const r=a.bind({});r.args={inline:!0};const p=a.bind({});p.args={options:n.map((e,t)=>({...e,helpText:`Help text #${t}`,disabled:!0}))};var u,d,g;c.parameters={...c.parameters,docs:{...(u=c.parameters)==null?void 0:u.docs,source:{originalSource:`args => {
|
|
2
2
|
const [value, setValue] = useState<OptionType>(options[0]);
|
|
3
3
|
const handleChange = (evt: React.ChangeEvent<HTMLInputElement>) => {
|
|
4
4
|
const selectedValue = evt.target.value;
|