@oliasoft-open-source/react-ui-library 4.7.6 → 4.7.7
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-CbZ_B_tn.js → index-DCeIsyRy.js} +1 -0
- package/dist/global.css +576 -576
- package/dist/index.html +1 -1
- package/dist/index.js +1259 -1165
- package/dist/index.js.map +1 -1
- package/dist/storybook/assets/Color-KGDBMAHA-B09ajdpG.js +1 -0
- package/dist/storybook/assets/DocsRenderer-PKQXORMH-B1FePHEE.js +1 -0
- package/dist/storybook/assets/{accordion-6ouB0WTt.js → accordion-BiuI_LCA.js} +1 -1
- package/dist/storybook/assets/{accordion.stories-YuQaNHcr.js → accordion.stories-wRr6K6oi.js} +2 -2
- package/dist/storybook/assets/{actions-CZK3mphC.js → actions-CHgr8eL8.js} +1 -1
- package/dist/storybook/assets/{actions.stories-FOK1cLb3.js → actions.stories-CCDxFKFk.js} +1 -1
- package/dist/storybook/assets/{afe.stories-CT81gs6M.js → afe.stories-80-X2oCf.js} +2 -2
- package/dist/storybook/assets/{badge.stories-D30jHm96.js → badge.stories-D5DA-vxC.js} +1 -1
- package/dist/storybook/assets/{blowout.stories-CJrNKpKP.js → blowout.stories-ES-Fuaqn.js} +1 -1
- package/dist/storybook/assets/{button-C1sV-0mR.js → button-VxhoNhrV.js} +1 -1
- package/dist/storybook/assets/{button-group-Ai4DXqNr.js → button-group-CwJdFo2z.js} +1 -1
- package/dist/storybook/assets/{button-group.stories-incmyYJ-.js → button-group.stories-DU5k5qCY.js} +1 -1
- package/dist/storybook/assets/{button.stories-Bcy7mnLs.js → button.stories-DVtec2Eo.js} +2 -2
- package/dist/storybook/assets/{buttons-and-links-CtOaPZlv.js → buttons-and-links-DrDYbdOk.js} +2 -2
- package/dist/storybook/assets/{card.stories-Bn6LpucB.js → card.stories-CsTB0DuM.js} +1 -1
- package/dist/storybook/assets/{casing-loads.stories-DQy8gjj6.js → casing-loads.stories-BXcv0FiI.js} +2 -2
- package/dist/storybook/assets/{cell.stories-ChfAWqCt.js → cell.stories-MhANINNu.js} +2 -2
- package/dist/storybook/assets/{check-box-CaSrhzev.js → check-box-BtCGePRy.js} +1 -1
- package/dist/storybook/assets/{check-box.stories-BAH78tMZ.js → check-box.stories-C_7Z7Ss6.js} +1 -1
- package/dist/storybook/assets/{chunk-HLWAVYOI-CkQdzq8g.js → chunk-HLWAVYOI-3IbBqp3W.js} +1 -1
- package/dist/storybook/assets/color-DqVXeBjc.js +25 -0
- package/dist/storybook/assets/{column.stories-JMvj3_fr.js → column.stories-BxfR9Tla.js} +1 -1
- package/dist/storybook/assets/{dialog-vClt2ahZ.js → dialog-Di8hNunM.js} +1 -1
- package/dist/storybook/assets/{drawer-DSS8yvvp.js → drawer-BhuWxI7V.js} +1 -1
- package/dist/storybook/assets/drawer.stories-B-PsNJJ6.js +113 -0
- package/dist/storybook/assets/{empty.stories-G8jeIfLL.js → empty.stories-BVYXwvpa.js} +1 -1
- package/dist/storybook/assets/{field-C5_fLDpy.js → field-HrLaMLbx.js} +1 -1
- package/dist/storybook/assets/{field.stories-D5Mej0Bt.js → field.stories-B9p9nBgY.js} +1 -1
- package/dist/storybook/assets/{file-button.stories-DePr8MKB.js → file-button.stories-FOaiNPt-.js} +1 -1
- package/dist/storybook/assets/{file-input-BZecnRBy.js → file-input-BpMtsZ2S.js} +1 -1
- package/dist/storybook/assets/{file-input.stories-Br89AkVv.js → file-input.stories-Jrdw5k-s.js} +1 -1
- package/dist/storybook/assets/{flex.stories-sSdg0ChR.js → flex.stories-BEXf0VqI.js} +1 -1
- package/dist/storybook/assets/footer.stories-CGHFDUfT.js +3 -0
- package/dist/storybook/assets/form.stories-C1Qx3M_1.js +49 -0
- package/dist/storybook/assets/formation.stories-BEowxQZ-.js +74 -0
- package/dist/storybook/assets/{heading-NkLgQYoP.js → heading-CRNoBc7q.js} +1 -1
- package/dist/storybook/assets/{heading.stories-nI_cFnAN.js → heading.stories-DahFxeiX.js} +1 -1
- package/dist/storybook/assets/{help-icon-41R-Z9N1.js → help-icon-Buhx5nl6.js} +1 -1
- package/dist/storybook/assets/{help-icon.stories-DBYh0YX7.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-0oHxQxyh.js +2 -0
- package/dist/storybook/assets/{index-Be0hXiyp.js → index-DMAnyMX5.js} +1 -1
- package/dist/storybook/assets/{index-Cf2IDQZ4.js → index-Dx_aqqZM.js} +8 -8
- package/dist/storybook/assets/index-iPmJVpyV.js +1 -0
- 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-group.stories-BmeUtBOK.js → input-group.stories-44quIZTV.js} +2 -2
- package/dist/storybook/assets/{input-validation-U3o9_8IY.js → input-validation-CregAhZZ.js} +2 -2
- package/dist/storybook/assets/{inputs-gP7hGRtM.js → inputs-DZn0C_9Y.js} +2 -2
- package/dist/storybook/assets/{label-hiSz3I8H.js → label-CqmyC9he.js} +1 -1
- package/dist/storybook/assets/{label.stories-Cyv5jBAO.js → label.stories-C0AO5F1a.js} +1 -1
- package/dist/storybook/assets/layout-forms-zjNDNCOQ.js +16 -0
- package/dist/storybook/assets/{layout-general-Bw291PmI.js → layout-general-_85zGG_p.js} +2 -2
- package/dist/storybook/assets/{list-DYNKqvUR.js → list-yVTOdmpX.js} +1 -1
- package/dist/storybook/assets/{list.stories-BX67BegD.js → list.stories-ChqQXY5M.js} +2 -2
- package/dist/storybook/assets/{list.stories-data-D_ZfzaxE.js → list.stories-data-Iq66w9oH.js} +1 -1
- package/dist/storybook/assets/{loader.stories-DjrwwZ15.js → loader.stories-DM7ZJBgz.js} +1 -1
- package/dist/storybook/assets/{menu.stories-QTzp0Z7C.js → menu.stories-mt3LwVCk.js} +2 -2
- package/dist/storybook/assets/{message-B7G1ESkC.js → message-BYzRg8Ae.js} +1 -1
- package/dist/storybook/assets/{message.stories-Czui5Ym7.js → message.stories-K3bQ-5bJ.js} +1 -1
- package/dist/storybook/assets/{meta-content-BE7pulye.js → meta-content-cbHGvPJ7.js} +1 -1
- package/dist/storybook/assets/{modal.stories-DAxDpo0A.js → modal.stories-Cct1SMOP.js} +2 -2
- package/dist/storybook/assets/number-input.stories-C2QTTzzN.js +110 -0
- package/dist/storybook/assets/{option-dropdown.stories-ByLG631x.js → option-dropdown.stories-CoLsSS95.js} +1 -1
- package/dist/storybook/assets/{padding-and-spacing-DLeCWmND.js → padding-and-spacing-CPgb4ZMT.js} +2 -2
- package/dist/storybook/assets/{page.stories-br9ia4zp.js → page.stories-Cse3cMsO.js} +1 -1
- package/dist/storybook/assets/{pagination-BtguPxeR.js → pagination-iSMIbR33.js} +1 -1
- package/dist/storybook/assets/{pagination.stories-CgG4wp8P.js → pagination.stories-BUPaZD5R.js} +2 -2
- package/dist/storybook/assets/{pop-confirm.stories-CZpYmUBz.js → pop-confirm.stories-Dhid1FK8.js} +1 -1
- package/dist/storybook/assets/{popover-DgUpTRMk.js → popover-CzZdWNnB.js} +1 -1
- package/dist/storybook/assets/popover.stories-Duemqiqp.js +10 -0
- package/dist/storybook/assets/{preview-Dml2wSQG.js → preview-Bay6IiqP.js} +2 -2
- package/dist/storybook/assets/preview-DrVrew0c.js +2 -0
- package/dist/storybook/assets/projects.stories-DU-QlBa6.js +47 -0
- package/dist/storybook/assets/{radio-button-C_cV5TWA.js → radio-button-YBwYcMaM.js} +1 -1
- package/dist/storybook/assets/{radio-button.stories-BNE-U9db.js → radio-button.stories-CGJnfCk-.js} +1 -1
- package/dist/storybook/assets/react-router-dom-Ck2Y_Fzc.js +8 -0
- package/dist/storybook/assets/{reservoirs.stories-ux3hZbkX.js → reservoirs.stories-aSZ9r1Pu.js} +2 -2
- package/dist/storybook/assets/{rich-text-input.stories-savcIJ5B.js → rich-text-input.stories-CsFyrKRA.js} +3 -3
- package/dist/storybook/assets/{row.stories-CG6Eipay.js → row.stories-DL2h5FzP.js} +2 -2
- package/dist/storybook/assets/{select-Z-GCZ-pY.js → select-C8iu4-uz.js} +2 -2
- package/dist/storybook/assets/{select.stories-CX_B6BvR.js → select.stories-BZFdXGPs.js} +2 -2
- package/dist/storybook/assets/{side-bar-ChOjPNLR.js → side-bar-CKbHPgIV.js} +1 -1
- package/dist/storybook/assets/{side-bar.stories-BupidZk5.js → side-bar.stories-MUj_dj1F.js} +1 -1
- package/dist/storybook/assets/{site.stories-C1GnbK5P.js → site.stories-Ci4g5W2A.js} +2 -2
- package/dist/storybook/assets/{slider-gZmYlxxz.js → slider-DAramr8j.js} +4 -4
- package/dist/storybook/assets/{slider.stories-CY4GxD4Y.js → slider.stories-Cd0rLfHP.js} +2 -2
- package/dist/storybook/assets/{smart-upload-modal.stories-BrsVuS4a.js → smart-upload-modal.stories-BmrhOtOG.js} +1 -1
- package/dist/storybook/assets/{spacer.stories-D7Q45uBk.js → spacer.stories-CHEZdgDM.js} +1 -1
- package/dist/storybook/assets/{table-CaaSoHex.js → table-BNMxYhsu.js} +1 -1
- package/dist/storybook/assets/{table.stories-BiBivAvh.js → table.stories-YV04PKkU.js} +2 -2
- package/dist/storybook/assets/{table.stories-data-DwfKQW7P.js → table.stories-data-CR9VpXHs.js} +1 -1
- package/dist/storybook/assets/text-link.stories-BQAkVO-W.js +14 -0
- package/dist/storybook/assets/{title.stories-CfdJbgvT.js → title.stories-CuiMnOil.js} +2 -2
- package/dist/storybook/assets/{toaster-DJeREs3e.js → toaster-BNO0suPv.js} +1 -1
- package/dist/storybook/assets/{toaster.stories-QjvljKdT.js → toaster.stories-zcWIPp_X.js} +1 -1
- package/dist/storybook/assets/{toggle-Bo-JPbUP.js → toggle-CBpNgTrm.js} +1 -1
- package/dist/storybook/assets/{toggle.stories-BYrikgrA.js → toggle.stories-mjk0JIle.js} +1 -1
- package/dist/storybook/assets/{tooltip.test-case.stories-C74mKGrI.js → tooltip.test-case.stories-i9YQqba1.js} +1 -1
- package/dist/storybook/assets/{top-bar-DG4ok0uF.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-DzsYUZIx.js → top-bar.testcase.stories-DoPEAMYc.js} +1 -1
- package/dist/storybook/assets/{tree.stories-RtuZpYXn.js → tree.stories-6UHASEZu.js} +1 -1
- package/dist/storybook/assets/unit-input.stories-B3VwXCO8.js +295 -0
- package/dist/storybook/assets/unit-table.stories-DQrTQd6a.js +152 -0
- package/dist/storybook/iframe.html +1 -1
- package/dist/storybook/index.json +1 -1
- package/dist/storybook/project.json +1 -1
- package/package.json +1 -1
- package/dist/storybook/assets/Color-KGDBMAHA-C0EpwEFf.js +0 -1
- package/dist/storybook/assets/DocsRenderer-PKQXORMH-CWe5JIRI.js +0 -1
- package/dist/storybook/assets/color-eaylxLAo.js +0 -25
- package/dist/storybook/assets/drawer.stories-D6FBs1_r.js +0 -113
- package/dist/storybook/assets/extends-CF3RwP-h.js +0 -1
- package/dist/storybook/assets/footer.stories-BM5UBN62.js +0 -3
- package/dist/storybook/assets/form.stories-CYcggA-f.js +0 -49
- package/dist/storybook/assets/formation.stories-NDB_Sbor.js +0 -74
- package/dist/storybook/assets/icon-BP4BO6-k.js +0 -8
- package/dist/storybook/assets/iframe-WLuE3PcW.js +0 -2
- package/dist/storybook/assets/index-CXmS_Aty.js +0 -1
- package/dist/storybook/assets/inheritsLoose-DR8r8Ogv.js +0 -1
- package/dist/storybook/assets/layout-forms-r2wYyx-8.js +0 -16
- package/dist/storybook/assets/number-input.stories-CFTNLnHw.js +0 -105
- package/dist/storybook/assets/popover.stories-CtaFGXR_.js +0 -10
- package/dist/storybook/assets/preview-BjyexbB3.js +0 -2
- package/dist/storybook/assets/projects.stories-BSAMs8RG.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-BI4a_ekv.js +0 -21
- package/dist/storybook/assets/unit-input.stories-BSWm9641.js +0 -290
- package/dist/storybook/assets/unit-table.stories-CgF-UOP3.js +0 -150
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./jsx-runtime-eps93zm2.js";import{r as T}from"./index-DhsZuJvc.js";import{c as l}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 T}from"./index-DhsZuJvc.js";import{c as l}from"./index-Bk2sglWO.js";import{I as o}from"./common-types-Sih75Sav.js";import{I as a}from"./icon-BSFY3vDO.js";const N="_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",q="_heading_s49vk_124",z="_icon_s49vk_131",H="_dismiss_s49vk_139",U="_absolute_s49vk_143",V="_legendToggle_s49vk_155",M="_detailsText_s49vk_165",B="_footer_s49vk_169",n={inputInTable:N,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:q,icon:z,dismiss:H,absolute:U,legendToggle:V,detailsText:M,footer:B};var i=(s=>(s.INFO="Info",s.SUCCESS="Success",s.WARNING="Warning",s.ERROR="Error",s))(i||{}),d=(s=>(s.TOGGLE_DETAILS="TOGGLE_DETAILS",s))(d||{});const g=({type:s,onClose:t,isInToast:r,testId:c})=>e.jsx("div",{className:l(n.dismiss,r?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:t,testId:c})});g.__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:""},testId:{required:!1,tsType:{name:"string"},description:""}}};const J=(s,t)=>{switch(t.type){case d.TOGGLE_DETAILS:return{...s,detailsVisible:!s.detailsVisible};default:return s}},K=({details:s,visible:t,dispatch:r})=>e.jsxs("div",{children:[e.jsx("div",{className:l(n.legendToggle),onClick:r,children:t?"Hide details":"Show details"}),t?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:t,type:r=i.INFO,icon:c,heading:u,content:v,details:_,detailsVisible:h=!1,footer:m,withDismiss:x,onClose:I,width:p,maxHeight:S}=s,f={detailsVisible:h},[k,E]=T.useReducer(J,f);return e.jsx(e.Fragment,{children:t?e.jsxs("div",{className:l(n.container,p?n.block:null,r===i.SUCCESS?n.success:r===i.WARNING?n.warning:r===i.ERROR?n.error:n.info),style:{width:p,maxHeight:S},children:[e.jsx("div",{children:c?e.jsx("div",{className:n.icon,children:e.jsx(P,{type:r})}):null}),e.jsxs("div",{className:n.content,children:[u?e.jsx("div",{className:n.heading,children:u}):null,e.jsx("div",{children:v}),_?e.jsx(K,{details:_,visible:k.detailsVisible,dispatch:()=>E({type:d.TOGGLE_DETAILS})}):null,!!m&&e.jsx("div",{className:n.footer,children:m})]}),x?e.jsx(g,{type:r,onClose:I}):null]}):null})};Q.__docgenInfo={description:"",methods:[],displayName:"Message",props:{message:{required:!0,tsType:{name:"IMessage"},description:""}}};export{g 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-BYzRg8Ae.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 k}from"./index-DhsZuJvc.js";import{w as le,e as j,u as f}from"./index-
|
|
1
|
+
import{j as e}from"./jsx-runtime-eps93zm2.js";import{r as k}from"./index-DhsZuJvc.js";import{w as le,e as j,u as f}from"./index-DMAnyMX5.js";import{T as se}from"./common-types-Sih75Sav.js";import{M as v,D as h}from"./dialog-Di8hNunM.js";import{B as l}from"./button-VxhoNhrV.js";import{P as te}from"./popover-CzZdWNnB.js";import{I as ne}from"./input-BW9trNAW.js";import{I as ae}from"./input-group-BaRSJAEN.js";import{F as S}from"./field-HrLaMLbx.js";import{M as re}from"./actions-CHgr8eL8.js";import{S as ie}from"./select-C8iu4-uz.js";import{S as de}from"./spacer-BWoNR27H.js";import{T as ce}from"./tooltip-1V7clEnw.js";import{M as P}from"./types-BmbYqTX_.js";import"./index-CF7H4eMJ.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:ge}=__STORYBOOK_MODULE_PREVIEW_API__,qe={title:"Modals/Modal",component:v,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(l,{label:"Okay",colored:!0,onClick:()=>{}}),e.jsx(l,{label:"Cancel",onClick:()=>{}})]}),onClose:()=>{}},parameters:{docs:{story:{inline:!1,iframeHeight:400}}}},r=()=>{const[{visible:t,centered:a,...o},n]=ge(),s=()=>{n({visible:!t})};return e.jsxs(e.Fragment,{children:[e.jsx(v,{visible:t,centered:a,children:e.jsx(h,{dialog:{...o,onClose:s}})}),e.jsx(l,{label:"Open Modal",onClick:s})]})},C=r.bind({}),d=r.bind({});d.args={centered:!0};const c=r.bind({});c.args={content:["This is a","new line!"]};const g=r.bind({});g.args={scroll:!0,content:e.jsx("div",{children:"Example modal content goes here lorem ipsum. ".repeat(100)})};const p=r.bind({});p.args={width:"100%",content:e.jsx("div",{children:"Example modal content goes here lorem ipsum. ".repeat(100)})};const m=r.bind({});m.args={contentPadding:0};const u=r.bind({});u.args={content:e.jsxs(e.Fragment,{children:[e.jsx(ce,{text:"Tooltip text",children:"Hover for tooltip"}),e.jsx(de,{}),e.jsx(S,{label:"Custom Select",helpText:"Select an animal",children:e.jsx(ie,{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(S,{label:"Nested Menu",children:e.jsx(re,{maxHeight:"240px",menu:{label:"Menu",trigger:se.DROP_DOWN_BUTTON,sections:[{type:P.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:P.OPTION,label:Math.random().toString(36).substring(7),onClick:()=>{}}))]}})}),e.jsx(te,{content:e.jsxs(ae,{small:!0,children:[e.jsx(ne,{value:"Value",width:"150px",error:"Bad value"}),e.jsx(l,{colored:!0,label:"Save",onClick:()=>{}}),e.jsx(l,{label:"Cancel",onClick:()=>{}})]}),children:e.jsx(l,{colored:!0,label:"Toggle me",onClick:()=>{}})})]})};const b=()=>{const[t,a]=k.useState(!1),o=()=>{a(!0)},n=()=>{a(!1)},s=()=>{console.log("Submit action"),n()};return e.jsxs(e.Fragment,{children:[e.jsx(v,{visible:t,onEnter:()=>{console.log("Enter"),s()},onEscape:()=>{console.log("Escape"),n()},children:e.jsx(h,{dialog:{heading:"Test key handling",content:e.jsx(ne,{}),footer:e.jsxs(e.Fragment,{children:[e.jsx(l,{label:"Done",colored:"red",onClick:s}),e.jsx(l,{label:"Cancel",onClick:n})]}),onClose:n}})}),e.jsx(l,{label:"Open Modal",onClick:o})]})},M=()=>{const[t,a]=k.useState(!1),o=()=>a(!t),[n,s]=k.useState(!1),x=()=>s(!n);return e.jsxs(e.Fragment,{children:[e.jsx(v,{visible:t,children:e.jsx(h,{dialog:{heading:"Modal 1",content:"Lorem ipsum dolor sit amet",footer:e.jsxs(e.Fragment,{children:[e.jsx(l,{label:"Open modal 2",colored:!0,onClick:x}),e.jsx(v,{visible:n,children:e.jsx(h,{dialog:{heading:"Modal 2",content:"Lorem ipsum dolor sit amet",footer:e.jsx(l,{label:"Close",onClick:x}),onClose:x}})}),e.jsx(l,{label:"Close",onClick:o})]}),onClose:o}})}),e.jsx(l,{label:"Open modal 1",onClick:o})]})},i=r.bind({});i.args={testId:"testId"};i.play=async({canvasElement:t,step:a})=>{const o=t.parentElement?le(t.parentElement):null;await j(o).toBeTruthy(),o&&(await a("Modal should appear when triggered",async()=>{const n=o.getByText("Open Modal");await f.click(n);const s=o.getByTestId("testId");await j(s).toBeInTheDocument()}),await a("Modal should disappear when close button pressed",async()=>{const n=o.getByTestId("testId"),s=o.getByTestId("testId-dismiss");await f.click(s),await j(n).not.toBeInTheDocument()}))};b.__docgenInfo={description:"",methods:[],displayName:"KeyHandle"};M.__docgenInfo={description:"",methods:[],displayName:"MultipleModals"};var y,A,B;C.parameters={...C.parameters,docs:{...(y=C.parameters)==null?void 0:y.docs,source:{originalSource:`() => {
|
|
2
2
|
const [{
|
|
3
3
|
visible,
|
|
4
4
|
centered,
|
|
@@ -217,4 +217,4 @@ import{j as e}from"./jsx-runtime-eps93zm2.js";import{r as k}from"./index-DhsZuJv
|
|
|
217
217
|
</Modal>
|
|
218
218
|
<Button label="Open Modal" onClick={toggleModal} />
|
|
219
219
|
</>;
|
|
220
|
-
}`,...(oe=(ee=i.parameters)==null?void 0:ee.docs)==null?void 0:oe.source}}};const
|
|
220
|
+
}`,...(oe=(ee=i.parameters)==null?void 0:ee.docs)==null?void 0:oe.source}}};const ze=["Default","Centered","LineBreak","Scroll","FullWidth","NoContentPadding","WithPopoverLayers","KeyHandle","MultipleModals","Test"];export{d as Centered,C as Default,p as FullWidth,b as KeyHandle,c as LineBreak,M as MultipleModals,m as NoContentPadding,g as Scroll,i as Test,u as WithPopoverLayers,ze as __namedExportsOrder,qe as default};
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import{j as p}from"./jsx-runtime-eps93zm2.js";import{r as de}from"./index-DhsZuJvc.js";import{w as D,u as e,e as u,f as me}from"./index-DMAnyMX5.js";import{d as he}from"./index-CWz-hU-f.js";import{N as A}from"./number-input-uQOVHv2N.js";import{I as ve}from"./input-group-BaRSJAEN.js";import{I as Ie}from"./input-group-addon-D68iUKV2.js";import{S as ye}from"./select-C8iu4-uz.js";import"./index-CF7H4eMJ.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:Ce}=__STORYBOOK_MODULE_PREVIEW_API__,Xe={title:"Forms/NumberInput",component:A,parameters:{canvas:{page:null}},args:{label:"Label"}},s=n=>{const[r,a]=Ce(),o=t=>{a({value:t.target.value})};return p.jsx(A,{onChange:o,value:123,...n})},T=s.bind({}),c=s.bind({});c.args={small:!0};const g=s.bind({});g.args={width:"150px"};const d=s.bind({});d.args={left:!0};const m=s.bind({});m.args={disabled:!0};const h=s.bind({});h.args={allowEmpty:!0,value:""};const v=s.bind({});v.args={warning:"This input number is almost 100!",value:"99"};const I=s.bind({});I.args={error:"This is a error message"};const y=s.bind({});y.args={value:"123test"};const C=s.bind({});C.args={value:"123.123456789",enableDisplayRounding:!0};const w=s.bind({});w.args={value:"123.123456789",enableDisplayRounding:!0,roundDisplayValue:n=>he.roundToFixed(n,4)};const b=()=>p.jsxs(ve,{small:!0,children:[p.jsx(A,{value:123}),p.jsx(Ie,{children:"to"}),p.jsx(A,{value:123}),p.jsx(ye,{options:[{value:"units",label:"units"}],width:"auto",value:"units"})]}),l=s.bind({});l.args={testId:"testId",enableDisplayRounding:!0};l.play=async({canvasElement:n,step:r})=>{const a=D(n);await r("Value should be rounded on blur",async()=>{const o=a.getByTestId("testId");await e.clear(o),await e.type(o,"123.123456789"),await e.click(n),await u(a.getByDisplayValue("123.12")).toBeInTheDocument()}),await r("Full value shown on focus",async()=>{const o=a.getByTestId("testId");await e.click(o),await u(a.getByDisplayValue("123.123456789")).toBeInTheDocument()})};const i=()=>{const[n,r]=de.useState("123");return p.jsx(A,{value:n,onChange:a=>{r(a.target.value)},testId:"testId"})};i.play=async({canvasElement:n,step:r})=>{const a=D(n),o=D(n.ownerDocument.body);await r("Can enter decimal values",async()=>{const t=a.getByTestId("testId");await e.clear(t),await e.type(t,"123.123456789"),await e.click(n),await u(a.getByDisplayValue("123.123456789")).toBeInTheDocument()}),await r("Can enter scientific notation",async()=>{const t=a.getByTestId("testId");await e.clear(t),await e.type(t,"-1.12e3"),await e.click(n),await u(a.getByDisplayValue("-1.12e3")).toBeInTheDocument()}),await r("Can enter comma decimals (converts to dot)",async()=>{const t=a.getByTestId("testId");await e.clear(t),await e.type(t,"123,456"),await e.click(n),await u(a.getByDisplayValue("123.456")).toBeInTheDocument()}),await r("Can enter small numbers",async()=>{const t=a.getByTestId("testId");await e.clear(t),await e.type(t,"0.0000000023"),await e.click(n),await u(a.getByDisplayValue("0.0000000023")).toBeInTheDocument()}),await r("Can enter large numbers",async()=>{const t=a.getByTestId("testId");await e.clear(t),await e.type(t,"999999999999"),await e.click(n),await u(a.getByDisplayValue("999999999999")).toBeInTheDocument()}),await r("Shows validation error for non-numeric input",async()=>{const t=a.getByTestId("testId");await e.clear(t),await e.type(t,"123x45s6"),await e.click(n),await u(a.getByDisplayValue("123x45s6")).toBeInTheDocument(),await me.mouseOver(t),await u(o.getByText("Must be a numerical value")).toBeInTheDocument()})};b.__docgenInfo={description:"",methods:[],displayName:"TestInputGroup"};i.__docgenInfo={description:"",methods:[{name:"play",docblock:null,modifiers:["static"],params:[{name:"{ canvasElement, step }",optional:!1,type:null}],returns:null}],displayName:"TestUserInput"};var E,B,_;T.parameters={...T.parameters,docs:{...(E=T.parameters)==null?void 0:E.docs,source:{originalSource:`args => {
|
|
2
|
+
const [_, updateArgs] = useArgs();
|
|
3
|
+
const handleChange = (evt: ChangeEvent<HTMLInputElement>) => {
|
|
4
|
+
updateArgs({
|
|
5
|
+
value: evt.target.value
|
|
6
|
+
});
|
|
7
|
+
};
|
|
8
|
+
return <NumberInput onChange={handleChange} value={123} {...args} />;
|
|
9
|
+
}`,...(_=(B=T.parameters)==null?void 0:B.docs)==null?void 0:_.source}}};var f,S,N;c.parameters={...c.parameters,docs:{...(f=c.parameters)==null?void 0:f.docs,source:{originalSource:`args => {
|
|
10
|
+
const [_, updateArgs] = useArgs();
|
|
11
|
+
const handleChange = (evt: ChangeEvent<HTMLInputElement>) => {
|
|
12
|
+
updateArgs({
|
|
13
|
+
value: evt.target.value
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
return <NumberInput onChange={handleChange} value={123} {...args} />;
|
|
17
|
+
}`,...(N=(S=c.parameters)==null?void 0:S.docs)==null?void 0:N.source}}};var x,L,M;g.parameters={...g.parameters,docs:{...(x=g.parameters)==null?void 0:x.docs,source:{originalSource:`args => {
|
|
18
|
+
const [_, updateArgs] = useArgs();
|
|
19
|
+
const handleChange = (evt: ChangeEvent<HTMLInputElement>) => {
|
|
20
|
+
updateArgs({
|
|
21
|
+
value: evt.target.value
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
return <NumberInput onChange={handleChange} value={123} {...args} />;
|
|
25
|
+
}`,...(M=(L=g.parameters)==null?void 0:L.docs)==null?void 0:M.source}}};var V,H,R;d.parameters={...d.parameters,docs:{...(V=d.parameters)==null?void 0:V.docs,source:{originalSource:`args => {
|
|
26
|
+
const [_, updateArgs] = useArgs();
|
|
27
|
+
const handleChange = (evt: ChangeEvent<HTMLInputElement>) => {
|
|
28
|
+
updateArgs({
|
|
29
|
+
value: evt.target.value
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
return <NumberInput onChange={handleChange} value={123} {...args} />;
|
|
33
|
+
}`,...(R=(H=d.parameters)==null?void 0:H.docs)==null?void 0:R.source}}};var j,k,G;m.parameters={...m.parameters,docs:{...(j=m.parameters)==null?void 0:j.docs,source:{originalSource:`args => {
|
|
34
|
+
const [_, updateArgs] = useArgs();
|
|
35
|
+
const handleChange = (evt: ChangeEvent<HTMLInputElement>) => {
|
|
36
|
+
updateArgs({
|
|
37
|
+
value: evt.target.value
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
return <NumberInput onChange={handleChange} value={123} {...args} />;
|
|
41
|
+
}`,...(G=(k=m.parameters)==null?void 0:k.docs)==null?void 0:G.source}}};var W,O,U;h.parameters={...h.parameters,docs:{...(W=h.parameters)==null?void 0:W.docs,source:{originalSource:`args => {
|
|
42
|
+
const [_, updateArgs] = useArgs();
|
|
43
|
+
const handleChange = (evt: ChangeEvent<HTMLInputElement>) => {
|
|
44
|
+
updateArgs({
|
|
45
|
+
value: evt.target.value
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
return <NumberInput onChange={handleChange} value={123} {...args} />;
|
|
49
|
+
}`,...(U=(O=h.parameters)==null?void 0:O.docs)==null?void 0:U.source}}};var F,P,K;v.parameters={...v.parameters,docs:{...(F=v.parameters)==null?void 0:F.docs,source:{originalSource:`args => {
|
|
50
|
+
const [_, updateArgs] = useArgs();
|
|
51
|
+
const handleChange = (evt: ChangeEvent<HTMLInputElement>) => {
|
|
52
|
+
updateArgs({
|
|
53
|
+
value: evt.target.value
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
return <NumberInput onChange={handleChange} value={123} {...args} />;
|
|
57
|
+
}`,...(K=(P=v.parameters)==null?void 0:P.docs)==null?void 0:K.source}}};var Y,q,z;I.parameters={...I.parameters,docs:{...(Y=I.parameters)==null?void 0:Y.docs,source:{originalSource:`args => {
|
|
58
|
+
const [_, updateArgs] = useArgs();
|
|
59
|
+
const handleChange = (evt: ChangeEvent<HTMLInputElement>) => {
|
|
60
|
+
updateArgs({
|
|
61
|
+
value: evt.target.value
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
return <NumberInput onChange={handleChange} value={123} {...args} />;
|
|
65
|
+
}`,...(z=(q=I.parameters)==null?void 0:q.docs)==null?void 0:z.source}}};var J,Q,X;y.parameters={...y.parameters,docs:{...(J=y.parameters)==null?void 0:J.docs,source:{originalSource:`args => {
|
|
66
|
+
const [_, updateArgs] = useArgs();
|
|
67
|
+
const handleChange = (evt: ChangeEvent<HTMLInputElement>) => {
|
|
68
|
+
updateArgs({
|
|
69
|
+
value: evt.target.value
|
|
70
|
+
});
|
|
71
|
+
};
|
|
72
|
+
return <NumberInput onChange={handleChange} value={123} {...args} />;
|
|
73
|
+
}`,...(X=(Q=y.parameters)==null?void 0:Q.docs)==null?void 0:X.source}}};var Z,$,ee;C.parameters={...C.parameters,docs:{...(Z=C.parameters)==null?void 0:Z.docs,source:{originalSource:`args => {
|
|
74
|
+
const [_, updateArgs] = useArgs();
|
|
75
|
+
const handleChange = (evt: ChangeEvent<HTMLInputElement>) => {
|
|
76
|
+
updateArgs({
|
|
77
|
+
value: evt.target.value
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
return <NumberInput onChange={handleChange} value={123} {...args} />;
|
|
81
|
+
}`,...(ee=($=C.parameters)==null?void 0:$.docs)==null?void 0:ee.source}}};var ae,te,ne;w.parameters={...w.parameters,docs:{...(ae=w.parameters)==null?void 0:ae.docs,source:{originalSource:`args => {
|
|
82
|
+
const [_, updateArgs] = useArgs();
|
|
83
|
+
const handleChange = (evt: ChangeEvent<HTMLInputElement>) => {
|
|
84
|
+
updateArgs({
|
|
85
|
+
value: evt.target.value
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
return <NumberInput onChange={handleChange} value={123} {...args} />;
|
|
89
|
+
}`,...(ne=(te=w.parameters)==null?void 0:te.docs)==null?void 0:ne.source}}};var re,se,ue;b.parameters={...b.parameters,docs:{...(re=b.parameters)==null?void 0:re.docs,source:{originalSource:`() => <InputGroup small>
|
|
90
|
+
<NumberInput value={123} />
|
|
91
|
+
<InputGroupAddon>to</InputGroupAddon>
|
|
92
|
+
<NumberInput value={123} />
|
|
93
|
+
<Select options={[{
|
|
94
|
+
value: 'units',
|
|
95
|
+
label: 'units'
|
|
96
|
+
}]} width="auto" value="units" />
|
|
97
|
+
</InputGroup>`,...(ue=(se=b.parameters)==null?void 0:se.docs)==null?void 0:ue.source}}};var oe,pe,le;l.parameters={...l.parameters,docs:{...(oe=l.parameters)==null?void 0:oe.docs,source:{originalSource:`args => {
|
|
98
|
+
const [_, updateArgs] = useArgs();
|
|
99
|
+
const handleChange = (evt: ChangeEvent<HTMLInputElement>) => {
|
|
100
|
+
updateArgs({
|
|
101
|
+
value: evt.target.value
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
return <NumberInput onChange={handleChange} value={123} {...args} />;
|
|
105
|
+
}`,...(le=(pe=l.parameters)==null?void 0:pe.docs)==null?void 0:le.source}}};var ie,ce,ge;i.parameters={...i.parameters,docs:{...(ie=i.parameters)==null?void 0:ie.docs,source:{originalSource:`() => {
|
|
106
|
+
const [value, setValue] = useState('123');
|
|
107
|
+
return <NumberInput value={value} onChange={evt => {
|
|
108
|
+
setValue(evt.target.value);
|
|
109
|
+
}} testId="testId" />;
|
|
110
|
+
}`,...(ge=(ce=i.parameters)==null?void 0:ce.docs)==null?void 0:ge.source}}};const Ze=["Default","Small","Width","Left","Disabled","AllowEmpty","Warning","Error","BadInput","WithDisplayRounding","WithCustomDisplayRounding","TestInputGroup","TestDisplayRounding","TestUserInput"];export{h as AllowEmpty,y as BadInput,T as Default,m as Disabled,I as Error,d as Left,c as Small,l as TestDisplayRounding,b as TestInputGroup,i as TestUserInput,v as Warning,g as Width,w as WithCustomDisplayRounding,C as WithDisplayRounding,Ze as __namedExportsOrder,Xe 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-DLeCWmND.js → padding-and-spacing-CPgb4ZMT.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-Dx_aqqZM.js";import"./index-DhsZuJvc.js";import"./iframe-0oHxQxyh.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-C8iu4-uz.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};
|
package/dist/storybook/assets/{pagination.stories-CgG4wp8P.js → pagination.stories-BUPaZD5R.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as p}from"./jsx-runtime-eps93zm2.js";import{r as l}from"./index-DhsZuJvc.js";import{P as g}from"./pagination-
|
|
1
|
+
import{j as p}from"./jsx-runtime-eps93zm2.js";import{r as l}from"./index-DhsZuJvc.js";import{P as g}from"./pagination-iSMIbR33.js";import"./common-types-Sih75Sav.js";import"./select-C8iu4-uz.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
2
|
const [selectedPage, setSelectedPage] = useState(1);
|
|
3
3
|
return <Pagination pagination={{
|
|
4
4
|
rowCount: 500,
|
|
@@ -56,4 +56,4 @@ import{j as p}from"./jsx-runtime-eps93zm2.js";import{r as l}from"./index-DhsZuJv
|
|
|
56
56
|
},
|
|
57
57
|
onSelectPage: evt => setSelectedPage(evt)
|
|
58
58
|
}} />;
|
|
59
|
-
}`,...(b=(w=s.parameters)==null?void 0:w.docs)==null?void 0:b.source}}};const
|
|
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-CZpYmUBz.js → pop-confirm.stories-Dhid1FK8.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-BNO0suPv.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-BYzRg8Ae.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
|
|
@@ -1 +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-
|
|
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-C8iu4-uz.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};
|
|
@@ -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-BYzRg8Ae.js";import{a4 as d,a5 as M}from"./index-Dx_aqqZM.js";import{e as _}from"./index-DRSy5Ssd.js";import"./chunk-HLWAVYOI-3IbBqp3W.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-0oHxQxyh.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,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DocsRenderer-PKQXORMH-B1FePHEE.js","./chunk-HLWAVYOI-3IbBqp3W.js","./iframe-0oHxQxyh.js","./index-DhsZuJvc.js","./react-16-DXAfArL2.js","./index-CUZDtIZe.js","./index-Dx_aqqZM.js","./inheritsLoose-DP0QEDDI.js","./assertThisInitialized-B9jnkVVz.js","./index-D6rZ4wEC.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as a}from"./iframe-0oHxQxyh.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-B1FePHEE.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};
|
|
@@ -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-BNE-U9db.js → radio-button.stories-CGJnfCk-.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as A}from"./jsx-runtime-eps93zm2.js";import{r as F}from"./index-DhsZuJvc.js";import{w as K,u as q,e as m}from"./index-
|
|
1
|
+
import{j as A}from"./jsx-runtime-eps93zm2.js";import{r as F}from"./index-DhsZuJvc.js";import{w as K,u as q,e as m}from"./index-DMAnyMX5.js";import{R as j}from"./radio-button-YBwYcMaM.js";import"./index-CF7H4eMJ.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 s=[{label:"Aardvarks",value:"termites"},{label:"Kangaroos",value:"grass"},{label:"Monkeys",value:"bananas",disabled:!0}],re={title:"Forms/RadioButton",component:j,args:{options:s,inline:!1,noMargin:!1,disabled:!1,small:!1}},a=t=>{const[e,u]=F.useState(s[0]),n=_=>{const $=_.target.value,g=s.find(W=>W.value===$);g&&u(g)};return A.jsx(j,{...t,value:e,onChange:n})},d=a.bind({}),o=a.bind({});o.args={small:!0};const l=a.bind({});l.args={options:s.map((t,e)=>({...t,helpText:`Help text #${e}`}))};const r=a.bind({});r.args={options:s.map((t,e)=>({...t,onClickHelp:()=>console.log(`Help #${e} clicked`)}))};const i=a.bind({});i.args={inline:!0};const c=a.bind({});c.args={options:s.map((t,e)=>({...t,helpText:`Help text #${e}`,disabled:!0}))};const p=a.bind({});p.play=async({canvasElement:t,step:e})=>{const u=K(t);await e("Clicking a radio should activate it",async()=>{const n=u.getByDisplayValue("grass");await q.click(n),await m(n).toBeChecked()}),await e("Clicking a disabled radio shouldn't activate it",async()=>{const n=u.getByDisplayValue("bananas");await n.click(),await m(n).not.toBeChecked()})};var v,h,C;d.parameters={...d.parameters,docs:{...(v=d.parameters)==null?void 0:v.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;
|