@oliasoft-open-source/react-ui-library 4.8.0-beta-2 → 4.8.0-beta-4
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/assets/{index-Csdt18_R.js → index-GTFdS-JF.js} +1008 -862
- package/dist/index.d.ts +8 -10
- package/dist/index.html +1 -1
- package/dist/index.js +1014 -899
- package/dist/index.js.map +1 -1
- package/dist/storybook/assets/{Color-KGDBMAHA-BS-rAnbo.js → Color-KGDBMAHA-BGErnsA6.js} +1 -1
- package/dist/storybook/assets/{DocsRenderer-PKQXORMH-DZ7r3cmw.js → DocsRenderer-PKQXORMH-D7WH90Ux.js} +1 -1
- package/dist/storybook/assets/{accordion.stories-CKrpJWRn.js → accordion.stories-YV-J9E1H.js} +1 -1
- package/dist/storybook/assets/{afe.stories-80-X2oCf.js → afe.stories-BnD7J0sn.js} +1 -1
- package/dist/storybook/assets/{blowout.stories-ES-Fuaqn.js → blowout.stories-BlyKeeED.js} +1 -1
- package/dist/storybook/assets/{buttons-and-links-sTGnmj6h.js → buttons-and-links-BCjRj0sv.js} +2 -2
- package/dist/storybook/assets/{casing-loads.stories-Do3mZuX2.js → casing-loads.stories-CEKi9p48.js} +1 -1
- package/dist/storybook/assets/{cell.stories-B0YsumDa.js → cell.stories-B0IK4EXk.js} +1 -1
- package/dist/storybook/assets/{check-box.stories-B6vW-2Fd.js → check-box.stories-C_7Z7Ss6.js} +1 -1
- package/dist/storybook/assets/{chunk-HLWAVYOI-BqK-R5cR.js → chunk-HLWAVYOI-D7npaoui.js} +1 -1
- package/dist/storybook/assets/{color-Cvx86PKp.js → color-DCR_IQPE.js} +2 -2
- package/dist/storybook/assets/{column.stories-BxfR9Tla.js → column.stories-DDTHFELF.js} +1 -1
- package/dist/storybook/assets/{footer.stories-CMN_mVki.js → footer.stories-Bl3gEVhY.js} +1 -1
- package/dist/storybook/assets/{form.stories-C1Qx3M_1.js → form.stories-JRw9Y_sV.js} +1 -1
- package/dist/storybook/assets/{formation.stories-CCJYaUpG.js → formation.stories-DNNvbCAo.js} +1 -1
- package/dist/storybook/assets/{grid-B6LFPf51.js → grid-DRkC-bt8.js} +1 -1
- package/dist/storybook/assets/{grid.stories-BhjMGl59.js → grid.stories-DqjhHHwX.js} +1 -1
- package/dist/storybook/assets/{icon.stories-C1hZXIMX.js → icon.stories-fnZUR-LK.js} +1 -1
- package/dist/storybook/assets/iframe-DNtoVJNq.js +2 -0
- package/dist/storybook/assets/index-C0x1JmaP.js +14 -0
- package/dist/storybook/assets/{index-B8zF6D3V.js → index-CEjEvyl9.js} +95 -95
- package/dist/storybook/assets/{index-omjWi7I7.js → index-C_B8BHJN.js} +1 -1
- package/dist/storybook/assets/{index-Be0hXiyp.js → index-DMAnyMX5.js} +1 -1
- package/dist/storybook/assets/{input-group.stories-44quIZTV.js → input-group.stories-D7nvlp0S.js} +1 -1
- package/dist/storybook/assets/{input-validation-BREYBXzB.js → input-validation-Cpjs6Oco.js} +1 -1
- package/dist/storybook/assets/{inputs-DkxT6vDD.js → inputs-B0fHrXlB.js} +2 -2
- package/dist/storybook/assets/{layout-forms-Y0Chz5wF.js → layout-forms-Ck78vgFh.js} +1 -1
- package/dist/storybook/assets/{layout-general-CRJUCd3s.js → layout-general-BV8ErZlY.js} +1 -1
- package/dist/storybook/assets/{menu.stories-Dozt6Npk.js → menu.stories-mt3LwVCk.js} +1 -1
- package/dist/storybook/assets/{message.stories-K3bQ-5bJ.js → message.stories-DEMcK-wa.js} +1 -1
- package/dist/storybook/assets/{modal.stories-BX49dKIM.js → modal.stories-Benu2pYo.js} +1 -1
- package/dist/storybook/assets/number-input-FjN2w5Zq.js +4 -0
- package/dist/storybook/assets/number-input.stories-CjeUb5EQ.js +166 -0
- package/dist/storybook/assets/{padding-and-spacing-DYx_u7EA.js → padding-and-spacing-Tv64UDVi.js} +1 -1
- package/dist/storybook/assets/{pagination-iSMIbR33.js → pagination-DXnrsBZs.js} +1 -1
- package/dist/storybook/assets/{pagination.stories-BUPaZD5R.js → pagination.stories-DKSBeVH-.js} +1 -1
- package/dist/storybook/assets/{popover.stories-Duemqiqp.js → popover.stories-BKImRt9k.js} +1 -1
- package/dist/storybook/assets/{preview-kt6m1zZo.js → preview-C4UROPMn.js} +2 -2
- package/dist/storybook/assets/{preview-B2Xzz4-3.js → preview-DV63XeY-.js} +1 -1
- package/dist/storybook/assets/{projects.stories-DU-QlBa6.js → projects.stories-BfMSNrkX.js} +1 -1
- package/dist/storybook/assets/{radio-button.stories-8QEKlNvO.js → radio-button.stories-CGJnfCk-.js} +1 -1
- package/dist/storybook/assets/{reservoirs.stories-aSZ9r1Pu.js → reservoirs.stories-CZme5ZCc.js} +1 -1
- package/dist/storybook/assets/rich-text-input.stories-a2GSF6vM.js +256 -0
- package/dist/storybook/assets/{row-4iAGREkV.js → row-Bmiy2Lh0.js} +1 -1
- package/dist/storybook/assets/{row.stories-ZCrMoTuY.js → row.stories-UAENUT5Q.js} +1 -1
- package/dist/storybook/assets/{select-C8iu4-uz.js → select-Br1k0mOD.js} +1 -1
- package/dist/storybook/assets/{select.stories-DbgjgsiX.js → select.stories-Bj6BwvfZ.js} +1 -1
- package/dist/storybook/assets/{site.stories-Ci4g5W2A.js → site.stories-CRc-gQlK.js} +1 -1
- package/dist/storybook/assets/{smart-upload-modal.stories-DgnJ79fa.js → smart-upload-modal.stories-BStZdEeo.js} +1 -1
- package/dist/storybook/assets/styled-components.browser.esm-BQ9GQzDc.js +2 -0
- package/dist/storybook/assets/{table-ZQD4ELIM.js → table-DMsE4ks-.js} +1 -1
- package/dist/storybook/assets/{table.stories-DGedoAir.js → table.stories-CvFBGBd6.js} +1 -1
- package/dist/storybook/assets/{title.stories-jQBBSflc.js → title.stories-DvTVQphz.js} +1 -1
- package/dist/storybook/assets/{toaster.stories-CAqrDYpd.js → toaster.stories-Dxg5K32_.js} +1 -1
- package/dist/storybook/assets/{toggle.stories-t0T4HV1D.js → toggle.stories-mjk0JIle.js} +1 -1
- package/dist/storybook/assets/unit-input-5P4Cogho.css +1 -0
- package/dist/storybook/assets/unit-input.stories-s45csxB3.js +353 -0
- package/dist/storybook/assets/unit-table.stories-DtWOiSyD.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/dist/storybook/sb-addons/interactions-2/manager-bundle.js +1 -0
- package/dist/storybook/sb-manager/globals-runtime.js +1 -1
- package/dist/storybook/sb-manager/globals.js +48 -0
- package/dist/storybook/sb-preview/runtime.js +1 -0
- package/package.json +8 -4
- package/dist/storybook/assets/iframe-CUVhB5TR.js +0 -2
- package/dist/storybook/assets/index-DQs5XS8h.js +0 -14
- package/dist/storybook/assets/number-input-CD-fbjVQ.js +0 -4
- package/dist/storybook/assets/number-input.stories-h1PlFB_G.js +0 -105
- package/dist/storybook/assets/rich-text-input.stories-CsFyrKRA.js +0 -256
- package/dist/storybook/assets/styled-components.browser.esm-Bf0q9Yjk.js +0 -2
- package/dist/storybook/assets/unit-input-CoFS2qhN.css +0 -1
- package/dist/storybook/assets/unit-input.stories-C7XlUSaC.js +0 -290
- package/dist/storybook/assets/unit-table.stories-BJbxGp7Y.js +0 -150
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{s as n,i as T,A as l,u as c,F as H,w as L,D as B,y as b,T as S,J as u,N as C,a as h,x as d,C as g,E as y,S as F,R as I,b as k,c as x,d as A,k as P,e as R,q as W,f,g as D,L as E,B as N,I as q,z as v,v as w,_ as O,M as U,h as j,$ as z,j as G,r as J,l as K,m as M,n as Q,o as V,p as X,H as Z,t as _,G as $,K as Y,O as aa,P as sa,Q as oa,U as ta,V as ra,W as ea,X as ia}from"./index-CEjEvyl9.js";import"./iframe-DNtoVJNq.js";import"../sb-preview/runtime.js";import"./index-DhsZuJvc.js";import"./index-CUZDtIZe.js";import"./inheritsLoose-DP0QEDDI.js";import"./assertThisInitialized-B9jnkVVz.js";import"./index-D6rZ4wEC.js";export{n as A,T as ActionBar,l as Bar,c as Blockquote,H as Button,L as Code,B as DL,b as Div,S as EmptyTabContent,u as ErrorFormatter,C as FlexBar,h as Form,d as H1,g as H2,y as H3,F as H4,I as H5,k as H6,x as HR,A as IconButton,P as Img,R as LI,W as Link,f as ListItem,D as Loader,E as OL,N as P,q as Pre,v as ResetWrapper,w as ScrollArea,O as Separator,U as Span,j as SyntaxHighlighter,z as TT,G as TabBar,J as TabButton,K as Table,M as Tabs,Q as TabsState,V as TooltipLinkList,X as TooltipNote,Z as UL,_ as WithTooltip,$ as WithTooltipPure,Y as Zoom,aa as codeCommon,sa as components,oa as createCopyToClipboardFunction,ta as getStoryHref,ra as icons,ea as nameSpaceClassNames,ia as withReset};
|
|
@@ -176,4 +176,4 @@ Unable to find an `+(n===!1?"accessible ":"")+'element with the role "'+t+'"'+i+
|
|
|
176
176
|
`)),o+=c+n[i+1]}),o}var q0=R0,Ho=Vo({...tu},{intercept:(e,t)=>t[0]==="fireEvent"||e.startsWith("find")||e.startsWith("waitFor")});Ho.screen=new Proxy(Ho.screen,{get(e,t,r){return cd.warn(q0`
|
|
177
177
|
You are using Testing Library's \`screen\` object. Use \`within(canvasElement)\` instead.
|
|
178
178
|
More info: https://storybook.js.org/docs/react/essentials/interactions
|
|
179
|
-
`),Reflect.get(e,t,r)}});var{buildQueries:T0,configure:j0,createEvent:A0,fireEvent:M0,findAllByAltText:N0,findAllByDisplayValue:I0,findAllByLabelText:k0,findAllByPlaceholderText:B0,findAllByRole:D0,findAllByTestId:L0,findAllByText:$0,findAllByTitle:F0,findByAltText:H0,findByDisplayValue:U0,findByLabelText:V0,findByPlaceholderText:z0,findByRole:W0,findByTestId:G0,findByText:K0,findByTitle:Y0,getAllByAltText:J0,getAllByDisplayValue:X0,getAllByLabelText:Q0,getAllByPlaceholderText:Z0,getAllByRole:eO,getAllByTestId:tO,getAllByText:rO,getAllByTitle:nO,getByAltText:oO,getByDisplayValue:aO,getByLabelText:lO,getByPlaceholderText:iO,getByRole:sO,getByTestId:uO,getByText:cO,getByTitle:dO,getConfig:fO,getDefaultNormalizer:pO,getElementError:mO,getNodeText:bO,getQueriesForElement:hO,getRoles:yO,getSuggestedQuery:gO,isInaccessible:vO,logDOM:_O,logRoles:wO,prettyDOM:RO,queries:qO,queryAllByAltText:EO,queryAllByAttribute:CO,queryAllByDisplayValue:PO,queryAllByLabelText:OO,queryAllByPlaceholderText:SO,queryAllByRole:xO,queryAllByTestId:TO,queryAllByText:jO,queryAllByTitle:AO,queryByAltText:MO,queryByAttribute:NO,queryByDisplayValue:IO,queryByLabelText:kO,queryByPlaceholderText:BO,queryByRole:DO,queryByTestId:LO,queryByText:$O,queryByTitle:FO,queryHelpers:HO,screen:UO,waitFor:VO,waitForElementToBeRemoved:zO,within:E0,prettyFormat:WO}=Ho,{userEvent:GO}=Vo({userEvent:w0},{intercept:!0}),{expect:KO}=Vo({expect:eu},{getKeys:(e,t)=>{let r=["assert","__methods","__flags","_obj"];if(e.constructor===zv.Assertion){let n=Object.keys(Object.getPrototypeOf(e)).filter(a=>!r.includes(a));return t>2?n:[...n,"not"]}return Object.keys(e)},intercept:e=>e!=="expect"}),C0=({parameters:e})=>{var t,r,n;((t=e==null?void 0:e.test)==null?void 0:t.mockReset)===!0?KR():((r=e==null?void 0:e.test)==null?void 0:r.clearMocks)===!0?GR():((n=e==null?void 0:e.test)==null?void 0:n.restoreMocks)!==!1&&YR()},Uo=(e,t=0,r)=>{var n;if(t>5||e==null)return e;if(Zi(e))return r&&e.mockName(r),e;if(typeof e=="function"&&"isAction"in e&&e.isAction&&!("implicit"in e&&e.implicit)){let a=zR(e);return r&&a.mockName(r),a}if(Array.isArray(e))return t++,e.map(a=>Uo(a,t));if(typeof e=="object"&&e.constructor===Object){t++;for(let[a,u]of Object.entries(e))(n=Object.getOwnPropertyDescriptor(e,a))!=null&&n.writable&&(e[a]=Uo(u,t,a));return e}return e},P0=({initialArgs:e})=>{Uo(e)},O0=e=>{globalThis.HTMLElement&&e.canvasElement instanceof globalThis.HTMLElement&&(e.canvas=E0(e.canvasElement))};Li.__STORYBOOK_TEST_LOADERS__=[C0,P0,O0];Li.__STORYBOOK_TEST_ON_MOCK_CALL__=VR;export{VO as a,KO as e,GO as u,E0 as w};
|
|
179
|
+
`),Reflect.get(e,t,r)}});var{buildQueries:T0,configure:j0,createEvent:A0,fireEvent:M0,findAllByAltText:N0,findAllByDisplayValue:I0,findAllByLabelText:k0,findAllByPlaceholderText:B0,findAllByRole:D0,findAllByTestId:L0,findAllByText:$0,findAllByTitle:F0,findByAltText:H0,findByDisplayValue:U0,findByLabelText:V0,findByPlaceholderText:z0,findByRole:W0,findByTestId:G0,findByText:K0,findByTitle:Y0,getAllByAltText:J0,getAllByDisplayValue:X0,getAllByLabelText:Q0,getAllByPlaceholderText:Z0,getAllByRole:eO,getAllByTestId:tO,getAllByText:rO,getAllByTitle:nO,getByAltText:oO,getByDisplayValue:aO,getByLabelText:lO,getByPlaceholderText:iO,getByRole:sO,getByTestId:uO,getByText:cO,getByTitle:dO,getConfig:fO,getDefaultNormalizer:pO,getElementError:mO,getNodeText:bO,getQueriesForElement:hO,getRoles:yO,getSuggestedQuery:gO,isInaccessible:vO,logDOM:_O,logRoles:wO,prettyDOM:RO,queries:qO,queryAllByAltText:EO,queryAllByAttribute:CO,queryAllByDisplayValue:PO,queryAllByLabelText:OO,queryAllByPlaceholderText:SO,queryAllByRole:xO,queryAllByTestId:TO,queryAllByText:jO,queryAllByTitle:AO,queryByAltText:MO,queryByAttribute:NO,queryByDisplayValue:IO,queryByLabelText:kO,queryByPlaceholderText:BO,queryByRole:DO,queryByTestId:LO,queryByText:$O,queryByTitle:FO,queryHelpers:HO,screen:UO,waitFor:VO,waitForElementToBeRemoved:zO,within:E0,prettyFormat:WO}=Ho,{userEvent:GO}=Vo({userEvent:w0},{intercept:!0}),{expect:KO}=Vo({expect:eu},{getKeys:(e,t)=>{let r=["assert","__methods","__flags","_obj"];if(e.constructor===zv.Assertion){let n=Object.keys(Object.getPrototypeOf(e)).filter(a=>!r.includes(a));return t>2?n:[...n,"not"]}return Object.keys(e)},intercept:e=>e!=="expect"}),C0=({parameters:e})=>{var t,r,n;((t=e==null?void 0:e.test)==null?void 0:t.mockReset)===!0?KR():((r=e==null?void 0:e.test)==null?void 0:r.clearMocks)===!0?GR():((n=e==null?void 0:e.test)==null?void 0:n.restoreMocks)!==!1&&YR()},Uo=(e,t=0,r)=>{var n;if(t>5||e==null)return e;if(Zi(e))return r&&e.mockName(r),e;if(typeof e=="function"&&"isAction"in e&&e.isAction&&!("implicit"in e&&e.implicit)){let a=zR(e);return r&&a.mockName(r),a}if(Array.isArray(e))return t++,e.map(a=>Uo(a,t));if(typeof e=="object"&&e.constructor===Object){t++;for(let[a,u]of Object.entries(e))(n=Object.getOwnPropertyDescriptor(e,a))!=null&&n.writable&&(e[a]=Uo(u,t,a));return e}return e},P0=({initialArgs:e})=>{Uo(e)},O0=e=>{globalThis.HTMLElement&&e.canvasElement instanceof globalThis.HTMLElement&&(e.canvas=E0(e.canvasElement))};Li.__STORYBOOK_TEST_LOADERS__=[C0,P0,O0];Li.__STORYBOOK_TEST_ON_MOCK_CALL__=VR;export{VO as a,KO as e,M0 as f,GO as u,E0 as w};
|
package/dist/storybook/assets/{input-group.stories-44quIZTV.js → input-group.stories-D7nvlp0S.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e}from"./jsx-runtime-eps93zm2.js";import{T as x}from"./common-types-Sih75Sav.js";import{I as t}from"./input-group-BaRSJAEN.js";import{I as h}from"./input-group-addon-D68iUKV2.js";import{I as M}from"./input-BW9trNAW.js";import{B as C}from"./button-VxhoNhrV.js";import{M as f}from"./actions-CHgr8eL8.js";import{S as I}from"./select-
|
|
1
|
+
import{j as e}from"./jsx-runtime-eps93zm2.js";import{T as x}from"./common-types-Sih75Sav.js";import{I as t}from"./input-group-BaRSJAEN.js";import{I as h}from"./input-group-addon-D68iUKV2.js";import{I as M}from"./input-BW9trNAW.js";import{B as C}from"./button-VxhoNhrV.js";import{M as f}from"./actions-CHgr8eL8.js";import{S as I}from"./select-Br1k0mOD.js";import{T as P}from"./tooltip-1V7clEnw.js";import{M as r}from"./types-BmbYqTX_.js";import"./index-DhsZuJvc.js";import"./index-Bk2sglWO.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"./badge-CLQ59MDF.js";import"./assertThisInitialized-B9jnkVVz.js";import"./memoize-one.esm-CcMeOnPo.js";import"./text-B3-TSWok.js";import"./select.input-DIKP56UZ.js";import"./index-CUZDtIZe.js";const ee={title:"Forms/InputGroup",component:t,args:{}},s=i=>e.jsxs(t,{...i,children:[e.jsx(h,{children:"$"}),e.jsx(M,{width:"100%",name:"example",value:"123",onChange:()=>{}}),e.jsx(I,{options:[{label:"Aardvarks",value:"termites"},{label:"Kangaroos",value:"grass"},{label:"Monkeys",value:"bananas"},{label:"Possums",value:"slugs"}],onChange:()=>{},value:{label:"Monkeys",value:"bananas"},width:"auto",native:!0}),e.jsx(f,{menu:{label:"E-06/degC",trigger:x.DROP_DOWN_BUTTON,small:i.small,sections:[{type:r.OPTION,label:"403.5433",description:"ft",inline:!0,onClick:()=>{}},{type:r.OPTION,label:"0.123",description:"km",inline:!0,onClick:()=>{}},{type:r.OPTION,label:"4842.4608",description:"in",inline:!0,onClick:()=>{}}]}}),e.jsx(C,{name:"example",label:"Confirm",colored:!0,onClick:()=>{}})]}),o=s.bind({}),a=s.bind({});a.args={width:"480px"};const l=s.bind({});l.args={small:!0};const n=()=>e.jsxs(t,{children:[e.jsx(I,{options:[{label:"Aardvarks",value:"termites"},{label:"Kangaroos",value:"grass"},{label:"Monkeys",value:"bananas"},{label:"Possums",value:"slugs"}],onChange:()=>{},value:{label:"Monkeys",value:"bananas"}}),e.jsx(P,{text:"This is a tooltip",children:e.jsx(C,{name:"example",label:"Confirm",colored:!0,onClick:()=>{},groupOrder:"last"})})]});n.__docgenInfo={description:"",methods:[],displayName:"SelectWithButton"};var u,p,m;o.parameters={...o.parameters,docs:{...(u=o.parameters)==null?void 0:u.docs,source:{originalSource:`args => {
|
|
2
2
|
return <InputGroup
|
|
3
3
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
4
4
|
{...args}>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e}from"./jsx-runtime-eps93zm2.js";import{useMDXComponents as r}from"./index-BcNHZKhG.js";import{
|
|
1
|
+
import{j as e}from"./jsx-runtime-eps93zm2.js";import{useMDXComponents as r}from"./index-BcNHZKhG.js";import{Y as s,Z as n}from"./index-CEjEvyl9.js";import{NonExistentValue as a,Error as l}from"./select.stories-Bj6BwvfZ.js";import"./index-DhsZuJvc.js";import"./iframe-DNtoVJNq.js";import"../sb-preview/runtime.js";import"./index-CUZDtIZe.js";import"./inheritsLoose-DP0QEDDI.js";import"./assertThisInitialized-B9jnkVVz.js";import"./index-D6rZ4wEC.js";import"./index-DMAnyMX5.js";import"./index-CF7H4eMJ.js";import"./select-Br1k0mOD.js";import"./index-Bk2sglWO.js";import"./common-types-Sih75Sav.js";import"./disabled-context-rmpd7YJS.js";import"./types-UmZ4Y_CR.js";import"./lodash-BHd_uQHh.js";import"./tooltip-1V7clEnw.js";import"./index-CEuq6vkz.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"./spacer-BWoNR27H.js";function o(t){const i={code:"code",h1:"h1",h2:"h2",h3:"h3",p:"p",strong:"strong",...r(),...t.components};return e.jsxs(e.Fragment,{children:[e.jsx(s,{title:"Input Validation"}),`
|
|
2
2
|
`,e.jsx(i.h1,{id:"input-validation",children:"Input Validation"}),`
|
|
3
3
|
`,e.jsx(i.h2,{id:"select",children:"Select"}),`
|
|
4
4
|
`,e.jsx(i.h3,{id:"invalid-states",children:"Invalid states"}),`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e}from"./jsx-runtime-eps93zm2.js";import{useMDXComponents as s}from"./index-BcNHZKhG.js";import{
|
|
1
|
+
import{j as e}from"./jsx-runtime-eps93zm2.js";import{useMDXComponents as s}from"./index-BcNHZKhG.js";import{Y as r,Z as o}from"./index-CEjEvyl9.js";import{Default as l}from"./button.stories-DVtec2Eo.js";import{Default as a}from"./check-box.stories-C_7Z7Ss6.js";import{Default as c}from"./file-input.stories-Jrdw5k-s.js";import{Default as d,Date as p}from"./input.stories-BruLeJ44.js";import{Default as h}from"./number-input.stories-CjeUb5EQ.js";import{Default as m}from"./option-dropdown.stories-CoLsSS95.js";import{Default as u}from"./radio-button.stories-CGJnfCk-.js";import{Native as f,Default as x}from"./select.stories-Bj6BwvfZ.js";import{Default as j}from"./slider.stories-Cd0rLfHP.js";import{Default as b}from"./textarea.stories-aRLEoDHg.js";import{Default as g}from"./toggle.stories-mjk0JIle.js";import"./index-DhsZuJvc.js";import"./iframe-DNtoVJNq.js";import"../sb-preview/runtime.js";import"./index-CUZDtIZe.js";import"./inheritsLoose-DP0QEDDI.js";import"./assertThisInitialized-B9jnkVVz.js";import"./index-D6rZ4wEC.js";import"./react-router-dom-Ck2Y_Fzc.js";import"./index-CEuq6vkz.js";import"./tiny-invariant-DqLgxztJ.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./flex-EllkLxgO.js";import"./button-VxhoNhrV.js";import"./index-Bk2sglWO.js";import"./common-types-Sih75Sav.js";import"./disabled-context-rmpd7YJS.js";import"./spinner-AWUe4xwQ.js";import"./icon-BSFY3vDO.js";import"./tooltip-1V7clEnw.js";import"./index-DMAnyMX5.js";import"./index-CF7H4eMJ.js";import"./check-box-BtCGePRy.js";import"./help-icon-Buhx5nl6.js";import"./file-input-BpMtsZ2S.js";import"./input-group-BaRSJAEN.js";import"./input-BW9trNAW.js";import"./types-UmZ4Y_CR.js";import"./lodash-BHd_uQHh.js";import"./spacer-BWoNR27H.js";import"./message-BYzRg8Ae.js";import"./textarea-BV7xWEdt.js";import"./index-C0x1JmaP.js";import"./index-DRSy5Ssd.js";import"./grid-DRkC-bt8.js";import"./styled-components.browser.esm-BQ9GQzDc.js";import"./field-HrLaMLbx.js";import"./label-CqmyC9he.js";import"./toggle-CBpNgTrm.js";import"./input-group-addon-D68iUKV2.js";import"./select-Br1k0mOD.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";import"./card-EcjmryU9.js";import"./heading-CRNoBc7q.js";import"./number-input-FjN2w5Zq.js";import"./divider-DY9nJ_7N.js";import"./radio-button-YBwYcMaM.js";import"./slider-DAramr8j.js";import"./objectSpread2-DW4nTBoq.js";import"./index-BI4_Bp97.js";function i(n){const t={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",strong:"strong",ul:"ul",...s(),...n.components};return e.jsxs(e.Fragment,{children:[e.jsx(r,{title:"Inputs"}),`
|
|
2
2
|
`,e.jsx(t.h1,{id:"inputs",children:"Inputs"}),`
|
|
3
3
|
`,e.jsx(t.p,{children:"React UI Library provides a comprehensive set of user input components."}),`
|
|
4
4
|
`,e.jsx(t.h2,{id:"button",children:"Button"}),`
|
|
@@ -59,4 +59,4 @@ particularly on touch devices.`]}),`
|
|
|
59
59
|
`,e.jsx(o,{of:j}),`
|
|
60
60
|
`,e.jsx(t.h2,{id:"file-input",children:"File Input"}),`
|
|
61
61
|
`,e.jsxs(t.p,{children:["Use a ",e.jsx(t.code,{children:"FileInput"})," when a user needs to upload a file. The ",e.jsx(t.code,{children:"accept"})," prop allows you to restrict the accepted file types."]}),`
|
|
62
|
-
`,e.jsx(o,{of:c})]})}function
|
|
62
|
+
`,e.jsx(o,{of:c})]})}function Re(n={}){const{wrapper:t}={...s(),...n.components};return t?e.jsx(t,{...n,children:e.jsx(i,{...n})}):i(n)}export{Re as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as t}from"./jsx-runtime-eps93zm2.js";import{useMDXComponents as n}from"./index-BcNHZKhG.js";import{
|
|
1
|
+
import{j as t}from"./jsx-runtime-eps93zm2.js";import{useMDXComponents as n}from"./index-BcNHZKhG.js";import{Y as s,Z as o}from"./index-CEjEvyl9.js";import{Default as l,LabelOnLeft as p}from"./field.stories-B9p9nBgY.js";import{Default as m,LabelsOnLeft as a,Row as h}from"./form.stories-JRw9Y_sV.js";import"./index-DhsZuJvc.js";import"./iframe-DNtoVJNq.js";import"../sb-preview/runtime.js";import"./index-CUZDtIZe.js";import"./inheritsLoose-DP0QEDDI.js";import"./assertThisInitialized-B9jnkVVz.js";import"./index-D6rZ4wEC.js";import"./field-HrLaMLbx.js";import"./index-Bk2sglWO.js";import"./label-CqmyC9he.js";import"./common-types-Sih75Sav.js";import"./help-icon-Buhx5nl6.js";import"./tooltip-1V7clEnw.js";import"./icon-BSFY3vDO.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./index-CEuq6vkz.js";import"./disabled-context-rmpd7YJS.js";import"./input-BW9trNAW.js";import"./types-UmZ4Y_CR.js";import"./lodash-BHd_uQHh.js";import"./text-B3-TSWok.js";import"./select-Br1k0mOD.js";import"./memoize-one.esm-CcMeOnPo.js";import"./types-BmbYqTX_.js";import"./actions-CHgr8eL8.js";import"./button-VxhoNhrV.js";import"./spinner-AWUe4xwQ.js";import"./badge-CLQ59MDF.js";import"./select.input-DIKP56UZ.js";import"./check-box-BtCGePRy.js";import"./button-group-CwJdFo2z.js";import"./toggle-CBpNgTrm.js";import"./input-group-BaRSJAEN.js";import"./input-group-addon-D68iUKV2.js";import"./slider-DAramr8j.js";import"./objectSpread2-DW4nTBoq.js";import"./index-BI4_Bp97.js";import"./textarea-BV7xWEdt.js";import"./radio-button-YBwYcMaM.js";import"./form-row-CM112EYF.js";function r(i){const e={code:"code",h1:"h1",h2:"h2",p:"p",...n(),...i.components};return t.jsxs(t.Fragment,{children:[t.jsx(s,{title:"Layout (Forms)"}),`
|
|
2
2
|
`,t.jsx(e.h1,{id:"layout-forms",children:"Layout (Forms)"}),`
|
|
3
3
|
`,t.jsx(e.h2,{id:"field",children:"Field"}),`
|
|
4
4
|
`,t.jsxs(e.p,{children:["This is a wrapper for any form element with default bottom margin, and props like ",t.jsx(e.code,{children:"label"})," for other default styling."]}),`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e}from"./jsx-runtime-eps93zm2.js";import{useMDXComponents as s}from"./index-BcNHZKhG.js";import{
|
|
1
|
+
import{j as e}from"./jsx-runtime-eps93zm2.js";import{useMDXComponents as s}from"./index-BcNHZKhG.js";import{Y as r,Z as n}from"./index-CEjEvyl9.js";import{Center as d,SpaceBetween as l,JustifyEnd as a,Column as c}from"./flex.stories-BEXf0VqI.js";import{Default as h,CustomColumnWidth as p,DefaultGap as x,CustomGap as m,Responsive as u}from"./grid.stories-DqjhHHwX.js";import{Default as j,FixedWidth as f,NoPadding as w,ResponsiveWidth as g}from"./column.stories-DDTHFELF.js";import"./index-DhsZuJvc.js";import"./iframe-DNtoVJNq.js";import"../sb-preview/runtime.js";import"./index-CUZDtIZe.js";import"./inheritsLoose-DP0QEDDI.js";import"./assertThisInitialized-B9jnkVVz.js";import"./index-D6rZ4wEC.js";import"./flex-EllkLxgO.js";import"./button-VxhoNhrV.js";import"./index-Bk2sglWO.js";import"./common-types-Sih75Sav.js";import"./disabled-context-rmpd7YJS.js";import"./spinner-AWUe4xwQ.js";import"./icon-BSFY3vDO.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./index-CEuq6vkz.js";import"./tooltip-1V7clEnw.js";import"./text-B3-TSWok.js";import"./grid-DRkC-bt8.js";import"./styled-components.browser.esm-BQ9GQzDc.js";import"./card-EcjmryU9.js";import"./row-Bmiy2Lh0.js";import"./heading-CRNoBc7q.js";import"./help-icon-Buhx5nl6.js";function t(i){const o={code:"code",h1:"h1",h2:"h2",h3:"h3",p:"p",...s(),...i.components};return e.jsxs(e.Fragment,{children:[e.jsx(r,{title:"Layout (General)"}),`
|
|
2
2
|
`,e.jsx(o.h1,{id:"layout-general",children:"Layout (General)"}),`
|
|
3
3
|
`,e.jsx(o.h2,{id:"flex",children:"Flex"}),`
|
|
4
4
|
`,e.jsxs(o.p,{children:["The ",e.jsx(o.code,{children:"Flex"})," component is a basic flexbox wrapper with optional props for ",e.jsx(o.code,{children:"alignItems"}),", ",e.jsx(o.code,{children:"justifyContent"})," and ",e.jsx(o.code,{children:"flexDirection"}),". This is a conveninent way to center items vertically and/or horizontally, to align them to opposite edges, or align them to the far side."]}),`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as r}from"./jsx-runtime-eps93zm2.js";import{r as Ir}from"./index-DhsZuJvc.js";import{H as Cr,L as J,S as Dr,R as U}from"./react-router-dom-Ck2Y_Fzc.js";import{T as A,I as fr}from"./common-types-Sih75Sav.js";import{w as kr,e as P,u as v}from"./index-
|
|
1
|
+
import{j as r}from"./jsx-runtime-eps93zm2.js";import{r as Ir}from"./index-DhsZuJvc.js";import{H as Cr,L as J,S as Dr,R as U}from"./react-router-dom-Ck2Y_Fzc.js";import{T as A,I as fr}from"./common-types-Sih75Sav.js";import{w as kr,e as P,u as v}from"./index-DMAnyMX5.js";import{M as W}from"./actions-CHgr8eL8.js";import{B as X}from"./button-VxhoNhrV.js";import{F as Rr}from"./flex-EllkLxgO.js";import{m as s,a as wr,b as Br,c as Er,d as Nr,e as Fr,f as Lr,g as Pr,h as _r,i as Ar}from"./menu.stories-data-DeDnsKpk.js";import{M as H}from"./types-BmbYqTX_.js";import"./inheritsLoose-DP0QEDDI.js";import"./index-CEuq6vkz.js";import"./tiny-invariant-DqLgxztJ.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./index-CF7H4eMJ.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 ps={title:"Basic/Menu",component:W,args:{menu:s}},e=a=>r.jsx(W,{...a}),_=e.bind({}),c=e.bind({});c.args={menu:{...s,colored:!0}};const p=e.bind({});p.args={menu:{...s,label:"Delete",colored:"danger"}};const d=e.bind({});d.args={menu:{...s,trigger:A.TEXT}};const l=e.bind({});l.args={menu:{...s,trigger:A.COMPONENT,component:r.jsx(X,{small:!0,colored:!0,round:!0,icon:fr.SETTINGS})}};const m=e.bind({});m.args={menu:wr};const u=e.bind({});u.args={menu:Br};const g=e.bind({});g.args={menu:Er};const b=e.bind({});b.args={menu:Nr};const x=e.bind({});x.args={disabled:!0};const S=e.bind({});S.args={tooltip:"Tooltip goes here"};const h=e.bind({});h.args={error:"Error goes here"};const T=e.bind({});T.args={warning:"Warning goes here"};const j=e.bind({});j.args={loading:!0,disabled:!0};const M=e.bind({});M.args={badgeTitle:"3"};const y=e.bind({});y.args={badgeDot:!0};const O=e.bind({});O.args={menu:Fr};const I=e.bind({});I.args={menu:Lr};const C=e.bind({});C.args={closeOnOptionClick:!1};const D=e.bind({});D.args={contextMenu:!0,menu:{...s,trigger:A.TEXT,label:"Right-click me"}};const f=e.bind({});f.args={width:"100%"};const k=e.bind({});k.args={menu:{...s,small:!0}};const R=e.bind({});R.args={menu:Pr};const w=e.bind({});w.args={menu:{...s,sections:r.jsx("div",{children:"Testing"})}};const B=e.bind({});B.args={menu:_r};const E=e.bind({});E.args={menu:Ar};const N=()=>{const[a,t]=Ir.useState(!1);return r.jsxs(Rr,{gap:!0,children:[r.jsx(W,{menu:s,open:a,setOpen:t}),r.jsx(X,{label:"Open",onClick:()=>t(!0),disabled:a}),r.jsx(X,{label:"Close",onClick:()=>t(!1),disabled:!a})]})},F=()=>r.jsxs(Cr,{children:[r.jsx(W,{menu:{label:"Go to",trigger:A.DROP_DOWN_BUTTON,sections:[{type:H.OPTION,label:"Dashboard",url:"/dashboard",component:J},{type:H.OPTION,label:"Settings",url:"/settings",component:J}]}}),r.jsxs(Dr,{children:[r.jsx(U,{path:"/dashboard",children:"Dashboard"}),r.jsx(U,{path:"/settings",children:"Settings"})]})]}),o=e.bind({});o.args={testId:"testId"};o.play=async({canvasElement:a,step:t})=>{const n=a.parentElement?kr(a.parentElement):null;await P(n).toBeTruthy(),n&&(await t("Clicking trigger should open menu",async()=>{const L=n.getByTestId("testId");await v.click(L);const i=n.getByTestId("testId-layer");await P(i).toBeInTheDocument()}),await t("Clicking disabled item should do nothing",async()=>{await n.getByText("Knight").click();const i=n.getByTestId("testId-layer");await P(i).toBeInTheDocument()}),await t("Clicking item should close menu",async()=>{const L=n.getByText("King");await v.click(L);const i=n.queryByTestId("testId-layer");await P(i).not.toBeInTheDocument()}))};N.__docgenInfo={description:"",methods:[],displayName:"ControlOpenStateFromParent"};F.__docgenInfo={description:"",methods:[],displayName:"AsRouterLink"};var G,K,q;_.parameters={..._.parameters,docs:{...(G=_.parameters)==null?void 0:G.docs,source:{originalSource:`args => <Menu
|
|
2
2
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
3
3
|
{...args} />`,...(q=(K=_.parameters)==null?void 0:K.docs)==null?void 0:q.source}}};var z,Q,V;c.parameters={...c.parameters,docs:{...(z=c.parameters)==null?void 0:z.docs,source:{originalSource:`args => <Menu
|
|
4
4
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
@@ -1,4 +1,4 @@
|
|
|
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-
|
|
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-DRkC-bt8.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-BQ9GQzDc.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 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-Br1k0mOD.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,
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{j as w}from"./jsx-runtime-eps93zm2.js";import{r as a}from"./index-DhsZuJvc.js";import{d as r}from"./index-C0x1JmaP.js";import{K as Q,E as X}from"./select-Br1k0mOD.js";import{l as Y}from"./lodash-BHd_uQHh.js";import{I as $}from"./input-BW9trNAW.js";const ee=14,ne=n=>r.isScientificStringNum(n)?n:r.roundToPrecision(n,ee),d=n=>String(r.toString(n)),te=n=>n?typeof n=="string"?n:Y.isArray(n)?n[0]:n.fieldName:"",ae=({name:n,placeholder:g="",disabled:h=!1,error:y=!1,left:S=!1,small:R=!1,width:C="100%",value:p="",onChange:F=()=>{},onFocus:x=()=>{},onBlur:L=()=>{},tabIndex:M=0,testId:H,tooltip:O=null,warning:j=!1,validationCallback:v=()=>{},allowEmpty:_=!1,isInTable:K,groupOrder:A,enableCosmeticRounding:T=!0,enableDisplayRounding:f=!1,roundDisplayValue:E,disableInternalErrorValidationMessages:k=!1})=>{const s=a.useRef(null),[u,b]=a.useState(d(p)),[l,N]=a.useState(!1),[B,I]=a.useState(!0),o=te(n),D=e=>{const t=r.validateNumber(e);return _&&e===""||t.valid?{...t,valid:!0,errors:void 0}:t},{valid:m,errors:c}=D(u),V=c&&c.length&&!k?c[0]:null;a.useEffect(()=>{b(d(p)),I(!0)},[p,T,f]),a.useEffect(()=>{!l&&!m?v(o,V):v(o,null)},[l,m,y]);const q=e=>{if(m&&!B){const t={...e,target:{...e.target,value:r.stripLeadingZeros(d(u)),name:o}};F(t)}},P=e=>{const t=e.target,{value:z}=t,J=r.cleanNumStr(z.replaceAll(" ","").replaceAll("|",""));b(J),I(!1)};a.useEffect(()=>{if(s&&(s!=null&&s.current)&&f&&l){const e=s.current;e&&setTimeout(()=>{const{length:t}=d(u);e.setSelectionRange(t,t)},0)}},[l]);const U=e=>{N(!0),x(e)},W=e=>{N(!1),q(e),L(e)},i=f&&!l&&m?E?d(E(u)):r.roundToFixed(u,2):u,Z=!!(i!=null&&i.endsWith("0")),G=T&&i&&!Z&&m?ne(i):i;return w.jsx(Q,{handleKeys:[X.ENTER],onKeyEvent:(e,t)=>q(t),children:w.jsx($,{type:"text",name:o,testId:H,disabled:h,placeholder:g,value:G,onChange:P,onFocus:U,onBlur:W,error:!l&&(V||y),warning:j,right:!S,small:R,width:C,isInTable:K,groupOrder:A,tabIndex:M,tooltip:O,ref:s},o)})};ae.__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
|
+
name: string | { fieldName: string },
|
|
3
|
+
error: string | null,
|
|
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:""},enableCosmeticRounding:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"true",computed:!1}},enableDisplayRounding:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},roundDisplayValue:{required:!1,tsType:{name:"signature",type:"function",raw:"(args: TStringOrNumber) => TStringOrNumber",signature:{arguments:[{type:{name:"union",raw:"string | number",elements:[{name:"string"},{name:"number"}]},name:"args"}],return:{name:"union",raw:"string | number",elements:[{name:"string"},{name:"number"}]}}},description:""},disableInternalErrorValidationMessages:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}}}};export{ae as N,ne as r};
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import{j as n}from"./jsx-runtime-eps93zm2.js";import{r as d}from"./index-DhsZuJvc.js";import{w as E,u as a,e as o,f as Re}from"./index-DMAnyMX5.js";import{d as _e}from"./index-C0x1JmaP.js";import{S as V}from"./spacer-BWoNR27H.js";import{G as Ve}from"./grid-DRkC-bt8.js";import{F as M}from"./field-HrLaMLbx.js";import{T as _}from"./toggle-CBpNgTrm.js";import{I as He}from"./input-group-BaRSJAEN.js";import{I as Fe}from"./input-group-addon-D68iUKV2.js";import{S as Le}from"./select-Br1k0mOD.js";import{C as g}from"./card-EcjmryU9.js";import{B as je}from"./button-VxhoNhrV.js";import{H as p}from"./heading-CRNoBc7q.js";import{T as Ge}from"./text-B3-TSWok.js";import{M as We}from"./message-BYzRg8Ae.js";import{N as l}from"./number-input-FjN2w5Zq.js";import"./index-CF7H4eMJ.js";import"./index-DRSy5Ssd.js";import"./styled-components.browser.esm-BQ9GQzDc.js";import"./index-Bk2sglWO.js";import"./label-CqmyC9he.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";import"./disabled-context-rmpd7YJS.js";import"./types-UmZ4Y_CR.js";import"./lodash-BHd_uQHh.js";import"./assertThisInitialized-B9jnkVVz.js";import"./memoize-one.esm-CcMeOnPo.js";import"./types-BmbYqTX_.js";import"./actions-CHgr8eL8.js";import"./badge-CLQ59MDF.js";import"./select.input-DIKP56UZ.js";import"./spinner-AWUe4xwQ.js";import"./input-BW9trNAW.js";const{useArgs:Oe}=__STORYBOOK_MODULE_PREVIEW_API__,ka={title:"Forms/NumberInput",component:l,parameters:{canvas:{page:null}},args:{label:"Label"}},i=r=>{const[s,t]=Oe(),u=e=>{t({value:e.target.value})};return n.jsx(l,{onChange:u,value:123,...r})},k=i.bind({}),I=i.bind({});I.args={small:!0};const C=i.bind({});C.args={width:"150px"};const b=i.bind({});b.args={left:!0};const y=i.bind({});y.args={disabled:!0};const w=i.bind({});w.args={allowEmpty:!0,value:""};const T=i.bind({});T.args={warning:"This input number is almost 100!",value:"99"};const f=i.bind({});f.args={error:"This is a error message"};const x=i.bind({});x.args={value:"123test"};const B=i.bind({});B.args={value:"123.123456789",enableDisplayRounding:!0};const D=i.bind({});D.args={value:"123.123456789",enableDisplayRounding:!0,roundDisplayValue:r=>_e.roundToFixed(r,4)};const S=()=>n.jsxs(He,{small:!0,children:[n.jsx(l,{value:123}),n.jsx(Fe,{children:"to"}),n.jsx(l,{value:123}),n.jsx(Le,{options:[{value:"units",label:"units"}],width:"auto",value:"units"})]}),m=i.bind({});m.args={testId:"testId",enableDisplayRounding:!0};m.play=async({canvasElement:r,step:s})=>{const t=E(r);await s("Value should be rounded on blur",async()=>{const u=t.getByTestId("testId");await a.clear(u),await a.type(u,"123.123456789"),await a.click(r),await o(t.getByDisplayValue("123.12")).toBeInTheDocument()}),await s("Full value shown on focus",async()=>{const u=t.getByTestId("testId");await a.click(u),await o(t.getByDisplayValue("123.123456789")).toBeInTheDocument()})};const A=()=>{const[r,s]=d.useState("123");return n.jsxs(Ve,{columns:"1fr 1fr",gap:!0,children:[n.jsxs(g,{heading:n.jsx(p,{children:"Storage State (Redux)"}),children:[r,n.jsx(V,{}),n.jsx(je,{label:"Change value",onClick:()=>s(String(Math.floor(Math.random()*100)))})]}),n.jsx(g,{heading:n.jsx(p,{children:"NumberInput"}),children:n.jsx(l,{value:r,onChange:t=>{s(t.target.value)},error:Number(r)>=0?"":"Value must be positive"})})]})},h=()=>{const[r,s]=d.useState(!1),[t,u]=d.useState(!0),[e,j]=d.useState("0.6889763779527558"),[N,Ne]=d.useState(""),Me=Number(e)*.3048;return n.jsxs(Ve,{columns:"1fr 1fr",gap:!0,children:[n.jsxs(g,{heading:n.jsx(p,{children:"Settings"}),children:[n.jsx(M,{label:"Enable display rounding:",labelLeft:!0,labelWidth:200,children:n.jsx(_,{checked:r,onChange:c=>s(c.target.checked)})}),n.jsx(M,{label:"Enable cosmetic rounding:",labelLeft:!0,labelWidth:200,children:n.jsx(_,{checked:t,onChange:c=>u(c.target.checked)})})]}),n.jsxs(g,{heading:n.jsx(p,{children:"NumberInput (displayed in Meters)"}),children:[n.jsx(Ge,{faint:!0,children:"Cosmetic Rounding Test Cases: type 0.21 then return (compare with enableCosmeticRounding on and off)"}),n.jsx(V,{}),n.jsx(l,{name:"Example",value:Me,onChange:c=>{const R=String(Number(c.target.value)/.3048);j(R)},enableDisplayRounding:r,enableCosmeticRounding:t,error:Number(e)>=0?"":"Value must be positive",validationCallback:(c,R)=>{Ne(R??"")},testId:"testId"})]}),n.jsxs(g,{heading:n.jsx(p,{children:"Storage State / Redux (stored in Feet)"}),children:[e,n.jsx(V,{}),n.jsx(je,{label:"Change value",onClick:()=>j(String(Math.floor(Math.random()*100)))})]}),n.jsx(g,{heading:n.jsx(p,{children:"Test Validation Callback"}),children:N&&n.jsx(We,{message:{content:N,icon:!0,type:"Error",visible:!0}})})]})};h.play=async({canvasElement:r,step:s})=>{const t=E(r),u=E(r.ownerDocument.body);await s("Can enter decimal values",async()=>{const e=t.getByTestId("testId");await a.clear(e),await a.type(e,"123.123456789"),await a.click(r),await o(t.getByDisplayValue("123.123456789")).toBeInTheDocument()}),await s("Cannot enter scientific notation when storage unit is different (expected)",async()=>{const e=t.getByTestId("testId");await a.clear(e),await a.type(e,"-1.12e3"),await a.click(r),await o(t.getByDisplayValue("-1120")).toBeInTheDocument()}),await s("Can enter comma decimals (converts to dot)",async()=>{const e=t.getByTestId("testId");await a.clear(e),await a.type(e,"123,456"),await a.click(r),await o(t.getByDisplayValue("123.456")).toBeInTheDocument()}),await s("Can enter small numbers",async()=>{const e=t.getByTestId("testId");await a.clear(e),await a.type(e,"0.0000000023"),await a.click(r),await o(t.getByDisplayValue("0.0000000023")).toBeInTheDocument()}),await s("Can enter large numbers",async()=>{const e=t.getByTestId("testId");await a.clear(e),await a.type(e,"999999999999"),await a.click(r),await o(t.getByDisplayValue("999999999999")).toBeInTheDocument()}),await s("Shows validation error for non-numeric input",async()=>{const e=t.getByTestId("testId");await a.clear(e),await a.type(e,"123x45s6"),await a.click(r),await o(t.getByDisplayValue("123x45s6")).toBeInTheDocument(),await Re.mouseOver(e),console.log("got here",u.getAllByText("Must be a numerical value")),await o(u.getAllByText("Must be a numerical value").length).toEqual(2)})};const v=()=>{const[r,s]=d.useState("123");return n.jsx(l,{value:r,onChange:t=>{s(t.target.value)},testId:"testId"})};v.play=async({canvasElement:r,step:s})=>{const t=E(r),u=E(r.ownerDocument.body);await s("Can enter decimal values",async()=>{const e=t.getByTestId("testId");await a.clear(e),await a.type(e,"123.123456789"),await a.click(r),await o(t.getByDisplayValue("123.123456789")).toBeInTheDocument()}),await s("Can enter scientific notation",async()=>{const e=t.getByTestId("testId");await a.clear(e),await a.type(e,"-1.12e3"),await a.click(r),await o(t.getByDisplayValue("-1.12e3")).toBeInTheDocument()}),await s("Can enter comma decimals (converts to dot)",async()=>{const e=t.getByTestId("testId");await a.clear(e),await a.type(e,"123,456"),await a.click(r),await o(t.getByDisplayValue("123.456")).toBeInTheDocument()}),await s("Can enter small numbers",async()=>{const e=t.getByTestId("testId");await a.clear(e),await a.type(e,"0.0000000023"),await a.click(r),await o(t.getByDisplayValue("0.0000000023")).toBeInTheDocument()}),await s("Can enter large numbers",async()=>{const e=t.getByTestId("testId");await a.clear(e),await a.type(e,"999999999999"),await a.click(r),await o(t.getByDisplayValue("999999999999")).toBeInTheDocument()}),await s("Shows validation error for non-numeric input",async()=>{const e=t.getByTestId("testId");await a.clear(e),await a.type(e,"123x45s6"),await a.click(r),await o(t.getByDisplayValue("123x45s6")).toBeInTheDocument(),await Re.mouseOver(e),await o(u.getByText("Must be a numerical value")).toBeInTheDocument()})};S.__docgenInfo={description:"",methods:[],displayName:"TestInputGroup"};A.__docgenInfo={description:"",methods:[],displayName:"ManagedTestCase"};h.__docgenInfo={description:"",methods:[{name:"play",docblock:null,modifiers:["static"],params:[{name:"{ canvasElement, step }",optional:!1,type:null}],returns:null}],displayName:"DemoCosmeticRounding"};v.__docgenInfo={description:"",methods:[{name:"play",docblock:null,modifiers:["static"],params:[{name:"{ canvasElement, step }",optional:!1,type:null}],returns:null}],displayName:"TestUserInput"};var H,F,L;k.parameters={...k.parameters,docs:{...(H=k.parameters)==null?void 0:H.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
|
+
}`,...(L=(F=k.parameters)==null?void 0:F.docs)==null?void 0:L.source}}};var G,W,O;I.parameters={...I.parameters,docs:{...(G=I.parameters)==null?void 0:G.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
|
+
}`,...(O=(W=I.parameters)==null?void 0:W.docs)==null?void 0:O.source}}};var U,P,q;C.parameters={...C.parameters,docs:{...(U=C.parameters)==null?void 0:U.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
|
+
}`,...(q=(P=C.parameters)==null?void 0:P.docs)==null?void 0:q.source}}};var K,Y,z;b.parameters={...b.parameters,docs:{...(K=b.parameters)==null?void 0:K.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
|
+
}`,...(z=(Y=b.parameters)==null?void 0:Y.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 => {
|
|
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
|
+
}`,...(X=(Q=y.parameters)==null?void 0:Q.docs)==null?void 0:X.source}}};var Z,$,ee;w.parameters={...w.parameters,docs:{...(Z=w.parameters)==null?void 0:Z.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
|
+
}`,...(ee=($=w.parameters)==null?void 0:$.docs)==null?void 0:ee.source}}};var ae,te,ne;T.parameters={...T.parameters,docs:{...(ae=T.parameters)==null?void 0:ae.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
|
+
}`,...(ne=(te=T.parameters)==null?void 0:te.docs)==null?void 0:ne.source}}};var re,se,oe;f.parameters={...f.parameters,docs:{...(re=f.parameters)==null?void 0:re.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
|
+
}`,...(oe=(se=f.parameters)==null?void 0:se.docs)==null?void 0:oe.source}}};var ue,ie,le;x.parameters={...x.parameters,docs:{...(ue=x.parameters)==null?void 0:ue.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
|
+
}`,...(le=(ie=x.parameters)==null?void 0:ie.docs)==null?void 0:le.source}}};var ce,de,ge;B.parameters={...B.parameters,docs:{...(ce=B.parameters)==null?void 0:ce.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
|
+
}`,...(ge=(de=B.parameters)==null?void 0:de.docs)==null?void 0:ge.source}}};var pe,me,he;D.parameters={...D.parameters,docs:{...(pe=D.parameters)==null?void 0:pe.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
|
+
}`,...(he=(me=D.parameters)==null?void 0:me.docs)==null?void 0:he.source}}};var ve,Ie,Ce;S.parameters={...S.parameters,docs:{...(ve=S.parameters)==null?void 0:ve.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>`,...(Ce=(Ie=S.parameters)==null?void 0:Ie.docs)==null?void 0:Ce.source}}};var be,ye,we;m.parameters={...m.parameters,docs:{...(be=m.parameters)==null?void 0:be.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
|
+
}`,...(we=(ye=m.parameters)==null?void 0:ye.docs)==null?void 0:we.source}}};var Te,fe,xe;A.parameters={...A.parameters,docs:{...(Te=A.parameters)==null?void 0:Te.docs,source:{originalSource:`() => {
|
|
106
|
+
const [value, setValue] = useState('123');
|
|
107
|
+
return <Grid columns="1fr 1fr" gap>
|
|
108
|
+
<Card heading={<Heading>Storage State (Redux)</Heading>}>
|
|
109
|
+
{value}
|
|
110
|
+
<Spacer />
|
|
111
|
+
<Button label="Change value" onClick={() => setValue(String(Math.floor(Math.random() * 100)))} />
|
|
112
|
+
</Card>
|
|
113
|
+
<Card heading={<Heading>NumberInput</Heading>}>
|
|
114
|
+
<NumberInput value={value} onChange={evt => {
|
|
115
|
+
setValue(evt.target.value);
|
|
116
|
+
}} error={Number(value) >= 0 ? '' : 'Value must be positive'} />
|
|
117
|
+
</Card>
|
|
118
|
+
</Grid>;
|
|
119
|
+
}`,...(xe=(fe=A.parameters)==null?void 0:fe.docs)==null?void 0:xe.source}}};var Be,De,Se;h.parameters={...h.parameters,docs:{...(Be=h.parameters)==null?void 0:Be.docs,source:{originalSource:`() => {
|
|
120
|
+
const [enableDisplayRounding, setEnableDisplayRounding] = useState(false);
|
|
121
|
+
const [enableCosmeticRounding, setEnableCosmeticRounding] = useState(true);
|
|
122
|
+
const [valueInFeet, setValueInFeet] = useState('0.6889763779527558');
|
|
123
|
+
const [callBackError, setCallBackError] = useState('');
|
|
124
|
+
const valueInMeters = Number(valueInFeet) * 0.3048;
|
|
125
|
+
return <Grid columns="1fr 1fr" gap>
|
|
126
|
+
<Card heading={<Heading>Settings</Heading>}>
|
|
127
|
+
<Field label="Enable display rounding:" labelLeft labelWidth={200}>
|
|
128
|
+
<Toggle checked={enableDisplayRounding} onChange={evt => setEnableDisplayRounding(evt.target.checked)} />
|
|
129
|
+
</Field>
|
|
130
|
+
<Field label="Enable cosmetic rounding:" labelLeft labelWidth={200}>
|
|
131
|
+
<Toggle checked={enableCosmeticRounding} onChange={evt => setEnableCosmeticRounding(evt.target.checked)} />
|
|
132
|
+
</Field>
|
|
133
|
+
</Card>
|
|
134
|
+
<Card heading={<Heading>NumberInput (displayed in Meters)</Heading>}>
|
|
135
|
+
<Text faint>
|
|
136
|
+
Cosmetic Rounding Test Cases: type 0.21 then return (compare with
|
|
137
|
+
enableCosmeticRounding on and off)
|
|
138
|
+
</Text>
|
|
139
|
+
<Spacer />
|
|
140
|
+
<NumberInput name="Example" value={valueInMeters} onChange={evt => {
|
|
141
|
+
const nextValueInFeet = String(Number(evt.target.value) / 0.3048);
|
|
142
|
+
setValueInFeet(nextValueInFeet); // convert back to ft
|
|
143
|
+
}} enableDisplayRounding={enableDisplayRounding} enableCosmeticRounding={enableCosmeticRounding} error={Number(valueInFeet) >= 0 ? '' : 'Value must be positive'} validationCallback={(name, error) => {
|
|
144
|
+
setCallBackError(error ?? '');
|
|
145
|
+
}} testId="testId" />
|
|
146
|
+
</Card>
|
|
147
|
+
<Card heading={<Heading>Storage State / Redux (stored in Feet)</Heading>}>
|
|
148
|
+
{valueInFeet}
|
|
149
|
+
<Spacer />
|
|
150
|
+
<Button label="Change value" onClick={() => setValueInFeet(String(Math.floor(Math.random() * 100)))} />
|
|
151
|
+
</Card>
|
|
152
|
+
<Card heading={<Heading>Test Validation Callback</Heading>}>
|
|
153
|
+
{callBackError && <Message message={{
|
|
154
|
+
content: callBackError,
|
|
155
|
+
icon: true,
|
|
156
|
+
type: 'Error',
|
|
157
|
+
visible: true
|
|
158
|
+
}} />}
|
|
159
|
+
</Card>
|
|
160
|
+
</Grid>;
|
|
161
|
+
}`,...(Se=(De=h.parameters)==null?void 0:De.docs)==null?void 0:Se.source}}};var Ae,Ee,ke;v.parameters={...v.parameters,docs:{...(Ae=v.parameters)==null?void 0:Ae.docs,source:{originalSource:`() => {
|
|
162
|
+
const [value, setValue] = useState('123');
|
|
163
|
+
return <NumberInput value={value} onChange={evt => {
|
|
164
|
+
setValue(evt.target.value);
|
|
165
|
+
}} testId="testId" />;
|
|
166
|
+
}`,...(ke=(Ee=v.parameters)==null?void 0:Ee.docs)==null?void 0:ke.source}}};const Ra=["Default","Small","Width","Left","Disabled","AllowEmpty","Warning","Error","BadInput","WithDisplayRounding","WithCustomDisplayRounding","TestInputGroup","TestDisplayRounding","ManagedTestCase","DemoCosmeticRounding","TestUserInput"];export{w as AllowEmpty,x as BadInput,k as Default,h as DemoCosmeticRounding,y as Disabled,f as Error,b as Left,A as ManagedTestCase,I as Small,m as TestDisplayRounding,S as TestInputGroup,v as TestUserInput,T as Warning,C as Width,D as WithCustomDisplayRounding,B as WithDisplayRounding,Ra as __namedExportsOrder,ka as default};
|
package/dist/storybook/assets/{padding-and-spacing-DYx_u7EA.js → padding-and-spacing-Tv64UDVi.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{
|
|
1
|
+
import{j as e}from"./jsx-runtime-eps93zm2.js";import{useMDXComponents as r}from"./index-BcNHZKhG.js";import{Y as t}from"./index-CEjEvyl9.js";import"./index-DhsZuJvc.js";import"./iframe-DNtoVJNq.js";import"../sb-preview/runtime.js";import"./index-CUZDtIZe.js";import"./inheritsLoose-DP0QEDDI.js";import"./assertThisInitialized-B9jnkVVz.js";import"./index-D6rZ4wEC.js";function i(s){const n={code:"code",h1:"h1",h2:"h2",li:"li",p:"p",strong:"strong",ul:"ul",...r(),...s.components};return e.jsxs(e.Fragment,{children:[e.jsx(t,{title:"Padding, Margin & Size"}),`
|
|
2
2
|
`,e.jsx(n.h1,{id:"padding-margin--size",children:"Padding, Margin & Size"}),`
|
|
3
3
|
`,e.jsx(n.h2,{id:"padding--margin",children:"Padding & Margin"}),`
|
|
4
4
|
`,e.jsx(n.p,{children:"There are standard CSS spacing variables for padding and margin."}),`
|
|
@@ -1 +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-Br1k0mOD.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-BUPaZD5R.js → pagination.stories-DKSBeVH-.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-DXnrsBZs.js";import"./common-types-Sih75Sav.js";import"./select-Br1k0mOD.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,
|
|
@@ -1,4 +1,4 @@
|
|
|
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-
|
|
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-Br1k0mOD.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
2
|
const [isOpen, setIsOpen] = useState(false);
|
|
3
3
|
return <div>
|
|
4
4
|
<Button onClick={() => setIsOpen(!isOpen)} label="Toggle Popover Externally" />
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DocsRenderer-PKQXORMH-
|
|
2
|
-
import{_ as a}from"./iframe-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DocsRenderer-PKQXORMH-D7WH90Ux.js","./chunk-HLWAVYOI-D7npaoui.js","./iframe-DNtoVJNq.js","./index-DhsZuJvc.js","./react-16-DXAfArL2.js","./index-CUZDtIZe.js","./index-CEjEvyl9.js","./inheritsLoose-DP0QEDDI.js","./assertThisInitialized-B9jnkVVz.js","./index-D6rZ4wEC.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as a}from"./iframe-DNtoVJNq.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-D7WH90Ux.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-BYzRg8Ae.js";import{a4 as d,a5 as M}from"./index-
|
|
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-CEjEvyl9.js";import{e as _}from"./index-DRSy5Ssd.js";import"./chunk-HLWAVYOI-D7npaoui.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-DNtoVJNq.js";import"../sb-preview/runtime.js";import"./assertThisInitialized-B9jnkVVz.js";import"./index-D6rZ4wEC.js";import"./react-16-DXAfArL2.js";var v="DARK_MODE";function f(r){"@babel/helpers - typeof";return f=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f(r)}var b;function k(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),e.push.apply(e,n)}return e}function A(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?k(Object(e),!0).forEach(function(n){R(r,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):k(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}function R(r,t,e){return t=x(t),t in r?Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[t]=e,r}function x(r){var t=K(r,"string");return f(t)==="symbol"?t:String(t)}function K(r,t){if(f(r)!=="object"||r===null)return r;var e=r[Symbol.toPrimitive];if(e!==void 0){var n=e.call(r,t||"default");if(f(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(r)}function p(r){return B(r)||U(r)||N(r)||L()}function L(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function N(r,t){if(r){if(typeof r=="string")return h(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return h(r,t)}}function U(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function B(r){if(Array.isArray(r))return h(r)}function h(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}const{global:Y}=__STORYBOOK_MODULE_GLOBAL__;__STORYBOOK_MODULE_CORE_EVENTS__;var T=Y,$=T.document,g=T.window,j="sb-addon-themes-3";(b=g.matchMedia)===null||b===void 0||b.call(g,"(prefers-color-scheme: dark)");var O={classTarget:"body",dark:d.dark,darkClass:["dark"],light:d.light,lightClass:["light"],stylePreview:!1,userHasExplicitlySetTheTheme:!1},E=function(t){g.localStorage.setItem(j,JSON.stringify(t))},H=function(t,e){var n=e.current,a=e.darkClass,l=a===void 0?O.darkClass:a,o=e.lightClass,i=o===void 0?O.lightClass:o;if(n==="dark"){var u,c;(u=t.classList).remove.apply(u,p(y(i))),(c=t.classList).add.apply(c,p(y(l)))}else{var m,S;(m=t.classList).remove.apply(m,p(y(l))),(S=t.classList).add.apply(S,p(y(i)))}},y=function(t){var e=[];return e.concat(t).map(function(n){return n})},V=function(t){var e=$.querySelector(t.classTarget);e&&H(e,t)},D=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=g.localStorage.getItem(j);if(typeof e=="string"){var n=JSON.parse(e);return t&&(t.dark&&!_(n.dark,t.dark)&&(n.dark=t.dark,E(n)),t.light&&!_(n.light,t.light)&&(n.light=t.light,E(n))),n}return A(A({},O),t)};V(D());function W(r,t){return F(r)||J(r,t)||G(r,t)||q()}function q(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
3
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function G(r,t){if(r){if(typeof r=="string")return w(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return w(r,t)}}function w(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function J(r,t){var e=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(e!=null){var n,a,l,o,i=[],u=!0,c=!1;try{if(l=(e=e.call(r)).next,t!==0)for(;!(u=(n=l.call(e)).done)&&(i.push(n.value),i.length!==t);u=!0);}catch(m){c=!0,a=m}finally{try{if(!u&&e.return!=null&&(o=e.return(),Object(o)!==o))return}finally{if(c)throw a}}return i}}function F(r){if(Array.isArray(r))return r}const{addons:z,useState:Q,useEffect:X}=__STORYBOOK_MODULE_PREVIEW_API__;function Z(){var r=Q(D().current==="dark"),t=W(r,2),e=t[0],n=t[1];return X(function(){var a=z.getChannel();return a.on(v,n),function(){return a.off(v,n)}},[]),e}const Or=[r=>s.jsxs(s.Fragment,{children:[s.jsx(r,{}),s.jsx(I,{})]}),r=>{const t=Z();return P.useEffect(()=>document.documentElement.dataset.theme=t?"dark":"default",[t]),s.jsx(r,{})}],Sr={docs:{container:r=>{const[t,e]=C.useState(!1);r.context.channel.on(v,a=>e(a));const n={...r};return n.theme=t?d.dark:d.light,s.jsx(M,{...n})}},darkMode:{current:"light",stylePreview:!0}},_r=["autodocs"];export{Or as decorators,Sr as parameters,_r as tags};
|
|
@@ -1,4 +1,4 @@
|
|
|
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-
|
|
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-Bmiy2Lh0.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-BQ9GQzDc.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
2
|
return <>
|
|
3
3
|
<TopBar />
|
|
4
4
|
<Page padding={false} left={0} scroll={false}>
|
package/dist/storybook/assets/{radio-button.stories-8QEKlNvO.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;
|