@oliasoft-open-source/react-ui-library 4.7.3 → 4.7.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/404.html +1 -1
- package/dist/assets/{index-D5kcnHmD.js → index-CbZ_B_tn.js} +54 -19
- package/dist/index.html +1 -1
- package/dist/storybook/assets/{Color-KGDBMAHA-RK4YYQs0.js → Color-KGDBMAHA-fBkbFrxl.js} +1 -1
- package/dist/storybook/assets/{DocsRenderer-PKQXORMH-B0ryFlHH.js → DocsRenderer-PKQXORMH-BCXpse5g.js} +1 -1
- package/dist/storybook/assets/{accordion.stories-DlFZNmdv.js → accordion.stories-MGPZF2zs.js} +1 -1
- package/dist/storybook/assets/{actions-Cu_0szZ4.js → actions-CZK3mphC.js} +1 -1
- package/dist/storybook/assets/{actions.stories-SCPuAp0T.js → actions.stories-FOK1cLb3.js} +1 -1
- package/dist/storybook/assets/{afe.stories-G3SzS3sg.js → afe.stories-Zs5w8AL0.js} +1 -1
- package/dist/storybook/assets/{badge.stories-DGYA6_1I.js → badge.stories-D30jHm96.js} +1 -1
- package/dist/storybook/assets/{blowout.stories-P0LHuXSY.js → blowout.stories-CJrNKpKP.js} +1 -1
- package/dist/storybook/assets/{button-_0DiND6h.js → button-C1sV-0mR.js} +1 -1
- package/dist/storybook/assets/{button-group-BYiHMljF.js → button-group-Ai4DXqNr.js} +1 -1
- package/dist/storybook/assets/{button-group.stories-Bz6NHaeB.js → button-group.stories-incmyYJ-.js} +1 -1
- package/dist/storybook/assets/{button.stories-vVBGddVf.js → button.stories-Bcy7mnLs.js} +1 -1
- package/dist/storybook/assets/{buttons-and-links-B6aQa-f5.js → buttons-and-links-DGEwyzdQ.js} +1 -1
- package/dist/storybook/assets/{card.stories-DIlqxO94.js → card.stories-Bn6LpucB.js} +1 -1
- package/dist/storybook/assets/{casing-loads.stories-0T--WlaD.js → casing-loads.stories-BZZ4ps89.js} +1 -1
- package/dist/storybook/assets/{cell.stories-C5Tkxyfr.js → cell.stories-DtPT5vsK.js} +1 -1
- package/dist/storybook/assets/{check-box-DkdQxC5c.js → check-box-CaSrhzev.js} +1 -1
- package/dist/storybook/assets/{check-box.stories-D8C12IQo.js → check-box.stories-J1keUUs0.js} +1 -1
- package/dist/storybook/assets/{chunk-HLWAVYOI-dB_9CZG8.js → chunk-HLWAVYOI-B_e8hbrU.js} +1 -1
- package/dist/storybook/assets/{color-BSzeqkLx.js → color-BWuYLPlh.js} +1 -1
- package/dist/storybook/assets/{column.stories-C1Sxwh4f.js → column.stories-JMvj3_fr.js} +1 -1
- package/dist/storybook/assets/{dialog-CAWCUmp3.js → dialog-lhPZkAI2.js} +1 -1
- package/dist/storybook/assets/{drawer-vbDFqa4U.js → drawer-DSS8yvvp.js} +1 -1
- package/dist/storybook/assets/{drawer.stories-CmbGsKmS.js → drawer.stories-D6FBs1_r.js} +1 -1
- package/dist/storybook/assets/{empty.stories-iHPKKy4z.js → empty.stories-G8jeIfLL.js} +1 -1
- package/dist/storybook/assets/{field-DwLk_uWj.js → field-C5_fLDpy.js} +1 -1
- package/dist/storybook/assets/{field.stories-s-0LQVbp.js → field.stories-D5Mej0Bt.js} +1 -1
- package/dist/storybook/assets/{file-button.stories-C90kcfbw.js → file-button.stories-DePr8MKB.js} +1 -1
- package/dist/storybook/assets/{file-input-C_2w1dKj.js → file-input-BZecnRBy.js} +1 -1
- package/dist/storybook/assets/{file-input.stories-BEsZox6U.js → file-input.stories-BH_glmEk.js} +1 -1
- package/dist/storybook/assets/{flex.stories-D-QN0gkk.js → flex.stories-sSdg0ChR.js} +1 -1
- package/dist/storybook/assets/{footer.stories-U_zMDmxF.js → footer.stories-CsvsDr1-.js} +1 -1
- package/dist/storybook/assets/{form.stories-1L75MGpX.js → form.stories-BwzDZgen.js} +1 -1
- package/dist/storybook/assets/{formation.stories-YHpXrXvC.js → formation.stories-2ZjWA25v.js} +1 -1
- package/dist/storybook/assets/{heading-DkSFysAb.js → heading-NkLgQYoP.js} +1 -1
- package/dist/storybook/assets/{heading.stories-Dtq7LNlB.js → heading.stories-nI_cFnAN.js} +1 -1
- package/dist/storybook/assets/{help-icon-LfPZiYla.js → help-icon-41R-Z9N1.js} +1 -1
- package/dist/storybook/assets/{help-icon.stories-Dh2ylnGq.js → help-icon.stories-DBYh0YX7.js} +1 -1
- package/dist/storybook/assets/{iframe-CNFcCVDc.js → iframe-DLWAAiXM.js} +2 -2
- package/dist/storybook/assets/{index-BIwFZkUc.js → index-BrCAgVdx.js} +1 -1
- package/dist/storybook/assets/{index-DQs5XS8h.js → index-CWz-hU-f.js} +5 -5
- package/dist/storybook/assets/{index-ccPuy0l1.js → index-tzHbUYOM.js} +4 -4
- package/dist/storybook/assets/{input-D97ganXq.js → input-BW9trNAW.js} +1 -1
- package/dist/storybook/assets/{input-group.stories-BcoORZ9x.js → input-group.stories-D1i3gaZ1.js} +1 -1
- package/dist/storybook/assets/{input-validation-CLVu4gtl.js → input-validation-BcgNUeij.js} +1 -1
- package/dist/storybook/assets/{input.stories-BHdUwYqV.js → input.stories-BruLeJ44.js} +1 -1
- package/dist/storybook/assets/{inputs-qWlLPYX_.js → inputs-gN3bum_f.js} +1 -1
- package/dist/storybook/assets/{label-tWjEmTQJ.js → label-hiSz3I8H.js} +1 -1
- package/dist/storybook/assets/{label.stories-BTA8N7tD.js → label.stories-Cyv5jBAO.js} +1 -1
- package/dist/storybook/assets/{layout-forms-p4s8eHw6.js → layout-forms-DXG6Da8u.js} +1 -1
- package/dist/storybook/assets/{layout-general-Dn1nlXYw.js → layout-general-CEpJsTnH.js} +1 -1
- package/dist/storybook/assets/{list-BpVed6Pw.js → list-DYNKqvUR.js} +1 -1
- package/dist/storybook/assets/{list.stories-CiT9J_FH.js → list.stories-BX67BegD.js} +1 -1
- package/dist/storybook/assets/{list.stories-data-CnVYk3eo.js → list.stories-data-D_ZfzaxE.js} +1 -1
- package/dist/storybook/assets/{loader.stories-BKBFctQ1.js → loader.stories-DjrwwZ15.js} +1 -1
- package/dist/storybook/assets/{menu.stories-Bp8L83xx.js → menu.stories-BE0AzXUY.js} +1 -1
- package/dist/storybook/assets/{message.stories-C8YRT7nL.js → message.stories-o5jcKCK_.js} +1 -1
- package/dist/storybook/assets/{meta-content-Djgg-tiF.js → meta-content-BE7pulye.js} +1 -1
- package/dist/storybook/assets/{modal.stories-BoVj2EsX.js → modal.stories-Ns1ikKLR.js} +1 -1
- package/dist/storybook/assets/{number-input-B-Nmya5O.js → number-input-uQOVHv2N.js} +1 -1
- package/dist/storybook/assets/{number-input.stories-CcNTeD25.js → number-input.stories-BfRW8wgL.js} +1 -1
- package/dist/storybook/assets/{option-dropdown.stories-COGmMWEl.js → option-dropdown.stories-ByLG631x.js} +1 -1
- package/dist/storybook/assets/{padding-and-spacing-BNiScrzg.js → padding-and-spacing-By28ROLj.js} +1 -1
- package/dist/storybook/assets/{page.stories-BB3g1zwB.js → page.stories-br9ia4zp.js} +1 -1
- package/dist/storybook/assets/{pagination-DSQeMPG_.js → pagination-CqvxiZHR.js} +1 -1
- package/dist/storybook/assets/{pagination.stories-DjIohcDx.js → pagination.stories-BzMlcLsN.js} +1 -1
- package/dist/storybook/assets/{pop-confirm.stories-Cr_ZBbLn.js → pop-confirm.stories-MFDc3UAq.js} +1 -1
- package/dist/storybook/assets/popover-DgUpTRMk.js +1 -0
- package/dist/storybook/assets/{popover.stories-CoWCb2Mn.js → popover.stories-CPW_LGAh.js} +1 -1
- package/dist/storybook/assets/{preview-DhMlVLsE.js → preview-CO5-Yrmk.js} +1 -1
- package/dist/storybook/assets/{preview-CZPuAPNr.js → preview-eMMARKcW.js} +2 -2
- package/dist/storybook/assets/{projects.stories-BesbPJ8Z.js → projects.stories-BSAMs8RG.js} +1 -1
- package/dist/storybook/assets/{radio-button-BD7pi0ao.js → radio-button-C_cV5TWA.js} +1 -1
- package/dist/storybook/assets/{radio-button.stories-B84Ip3NV.js → radio-button.stories-D7uvMLbK.js} +1 -1
- package/dist/storybook/assets/{reservoirs.stories-kxVBoa7Y.js → reservoirs.stories-Cql_9W4F.js} +1 -1
- package/dist/storybook/assets/{rich-text-input.stories-C5pcIbSa.js → rich-text-input.stories-BuDUgUsz.js} +1 -1
- package/dist/storybook/assets/{row.stories-ATsrjumb.js → row.stories-C-bEP9pE.js} +1 -1
- package/dist/storybook/assets/{select-78sreKsp.js → select-tIEV7vnw.js} +1 -1
- package/dist/storybook/assets/{select.stories-CZwsHVDB.js → select.stories-BuW6SmRZ.js} +1 -1
- package/dist/storybook/assets/{side-bar-WsK6pkmj.js → side-bar-ChOjPNLR.js} +1 -1
- package/dist/storybook/assets/{side-bar.stories-Bu2q_b_w.js → side-bar.stories-BupidZk5.js} +1 -1
- package/dist/storybook/assets/{site.stories-Yh4uNi3Q.js → site.stories-C1GnbK5P.js} +1 -1
- package/dist/storybook/assets/{slider-CxVlS0fh.js → slider-gZmYlxxz.js} +1 -1
- package/dist/storybook/assets/{slider.stories-_wS70xsm.js → slider.stories-CY4GxD4Y.js} +1 -1
- package/dist/storybook/assets/{smart-upload-modal.stories-DDlO9y2j.js → smart-upload-modal.stories-DGIErcSu.js} +1 -1
- package/dist/storybook/assets/{spacer.stories-B3LrTr7b.js → spacer.stories-D7Q45uBk.js} +1 -1
- package/dist/storybook/assets/{table-DPvzYjoq.js → table-CXUwJOBt.js} +1 -1
- package/dist/storybook/assets/{table.stories-BGQ1O9nw.js → table.stories-Cp0UIPUQ.js} +1 -1
- package/dist/storybook/assets/{table.stories-data-2STKbgzG.js → table.stories-data-DwfKQW7P.js} +1 -1
- package/dist/storybook/assets/{textarea-DOJDK8hI.js → textarea-BV7xWEdt.js} +1 -1
- package/dist/storybook/assets/{textarea.stories-CKm5MlQF.js → textarea.stories-aRLEoDHg.js} +1 -1
- package/dist/storybook/assets/{title.stories-CVRTXggL.js → title.stories-hn5F8-2J.js} +1 -1
- package/dist/storybook/assets/{toaster.stories-DfbfDavp.js → toaster.stories-DtRx7MDa.js} +1 -1
- package/dist/storybook/assets/{toggle-t1iTuSL7.js → toggle-Bo-JPbUP.js} +1 -1
- package/dist/storybook/assets/{toggle.stories-D44S3Nix.js → toggle.stories-CBkCAQh6.js} +1 -1
- package/dist/storybook/assets/{tooltip-C_E_6ym5.js → tooltip-1V7clEnw.js} +1 -1
- package/dist/storybook/assets/{tooltip.stories-C70ADjjJ.js → tooltip.stories-1YexWg6N.js} +1 -1
- package/dist/storybook/assets/{tooltip.test-case.stories-BtrJUImB.js → tooltip.test-case.stories-C74mKGrI.js} +1 -1
- package/dist/storybook/assets/{top-bar-R-CjhJ21.js → top-bar-DG4ok0uF.js} +1 -1
- package/dist/storybook/assets/{top-bar.stories-BYN9rcUw.js → top-bar.stories-BI4a_ekv.js} +1 -1
- package/dist/storybook/assets/{top-bar.testcase.stories-ZPaSRyIh.js → top-bar.testcase.stories-DzsYUZIx.js} +1 -1
- package/dist/storybook/assets/{tree.stories-Ghxps-dL.js → tree.stories-RtuZpYXn.js} +1 -1
- package/dist/storybook/assets/{unit-input.stories-Bqt0CdF7.js → unit-input.stories-DGvDLll8.js} +1 -1
- package/dist/storybook/assets/{unit-table.stories-DXies3fA.js → unit-table.stories-D0q58B-1.js} +1 -1
- package/dist/storybook/iframe.html +1 -1
- package/dist/storybook/project.json +1 -1
- package/package.json +3 -3
- package/dist/storybook/assets/popover-Dq3iC_lM.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t}from"./jsx-runtime-eps93zm2.js";import{r as o}from"./index-DhsZuJvc.js";import{c as C}from"./index-Bk2sglWO.js";import{D}from"./disabled-context-rmpd7YJS.js";import{i as r}from"./types-UmZ4Y_CR.js";import{T as E}from"./tooltip-
|
|
1
|
+
import{j as t}from"./jsx-runtime-eps93zm2.js";import{r as o}from"./index-DhsZuJvc.js";import{c as C}from"./index-Bk2sglWO.js";import{D}from"./disabled-context-rmpd7YJS.js";import{i as r}from"./types-UmZ4Y_CR.js";import{T as E}from"./tooltip-1V7clEnw.js";const N="_inputInTable_jnwnh_1",W="_inputHover_jnwnh_13",L="_inputFocus_jnwnh_18",M="_inputError_jnwnh_25",S="_inputWarning_jnwnh_26",H="_inputDisabled_jnwnh_61",P="_hideScrollbars_jnwnh_67",R="_input_jnwnh_1",k="_isInTable_jnwnh_100",z="_small_jnwnh_124",B="_error_jnwnh_130",K="_warning_jnwnh_147",A="_right_jnwnh_170",G="_groupOrderFirst_jnwnh_173",J="_groupOrderMiddle_jnwnh_174",Q="_groupOrderLast_jnwnh_175",e={inputInTable:N,inputHover:W,inputFocus:L,inputError:M,inputWarning:S,inputDisabled:H,hideScrollbars:P,input:R,isInTable:k,small:z,error:B,warning:K,right:A,groupOrderFirst:G,groupOrderMiddle:J,groupOrderLast:Q},U=o.forwardRef(({error:l=null,tooltip:a=null,isInTable:i,width:f=void 0,small:p=!1,onChange:c=()=>{},placeholder:m="",value:_="",onKeyPress:h=()=>{},onFocus:v=()=>{},onBlur:g=()=>{},onPaste:w=()=>{},name:b=void 0,type:j="text",tabIndex:q=0,disabled:V=!1,right:x=!1,warning:u=null,groupOrder:n=null,maxTooltipWidth:I=void 0,testId:O=void 0,size:s=null},T)=>{const y=o.useContext(D),F=(()=>{if(n)switch(n){case"first":return e.groupOrderFirst;case"last":return e.groupOrderLast;default:return e.groupOrderMiddle}return""})(),d=f||(s?"auto":"100%");return t.jsx("div",{style:{width:d},className:F,children:t.jsx(E,{error:!!l,warning:!!u,text:a||l||u,enabled:a&&r(a)||l&&r(l)||u&&r(u)||!1,maxWidth:I,display:"block",placement:"bottom-center",children:t.jsx("input",{ref:T,type:j||"text",size:s||20,placeholder:m??"",value:_??"",onChange:c,onKeyPress:h,onFocus:v,onBlur:g,onPaste:w,name:b,tabIndex:q,autoComplete:"off",disabled:V||y,className:C(e.input,l?e.error:u?e.warning:"",x?e.right:"",p?e.small:"",i?e.isInTable:""),style:{width:d},"data-testid":O})})})});U.__docgenInfo={description:"",methods:[],displayName:"Input",props:{error:{defaultValue:{value:"null",computed:!1},required:!1},tooltip:{defaultValue:{value:"null",computed:!1},required:!1},width:{defaultValue:{value:"undefined",computed:!0},required:!1},small:{defaultValue:{value:"false",computed:!1},required:!1},onChange:{defaultValue:{value:"() => {}",computed:!1},required:!1},placeholder:{defaultValue:{value:"''",computed:!1},required:!1},value:{defaultValue:{value:"''",computed:!1},required:!1},onKeyPress:{defaultValue:{value:"() => {}",computed:!1},required:!1},onFocus:{defaultValue:{value:"() => {}",computed:!1},required:!1},onBlur:{defaultValue:{value:"() => {}",computed:!1},required:!1},onPaste:{defaultValue:{value:"() => {}",computed:!1},required:!1},name:{defaultValue:{value:"undefined",computed:!0},required:!1},type:{defaultValue:{value:"'text'",computed:!1},required:!1},tabIndex:{defaultValue:{value:"0",computed:!1},required:!1},disabled:{defaultValue:{value:"false",computed:!1},required:!1},right:{defaultValue:{value:"false",computed:!1},required:!1},warning:{defaultValue:{value:"null",computed:!1},required:!1},groupOrder:{defaultValue:{value:"null",computed:!1},required:!1},maxTooltipWidth:{defaultValue:{value:"undefined",computed:!0},required:!1},testId:{defaultValue:{value:"undefined",computed:!0},required:!1},size:{defaultValue:{value:"null",computed:!1},required:!1}}};export{U as I};
|
package/dist/storybook/assets/{input-group.stories-BcoORZ9x.js → input-group.stories-D1i3gaZ1.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-
|
|
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-C1sV-0mR.js";import{M as f}from"./actions-CZK3mphC.js";import{S as I}from"./select-tIEV7vnw.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-BP4BO6-k.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./inheritsLoose-DR8r8Ogv.js";import"./index-CEuq6vkz.js";import"./badge-CLQ59MDF.js";import"./extends-CF3RwP-h.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 ae={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{Z as s,$ as n}from"./index-
|
|
1
|
+
import{j as e}from"./jsx-runtime-eps93zm2.js";import{useMDXComponents as r}from"./index-BcNHZKhG.js";import{Z as s,$ as n}from"./index-tzHbUYOM.js";import{NonExistentValue as a,Error as l}from"./select.stories-BuW6SmRZ.js";import"./index-DhsZuJvc.js";import"./iframe-DLWAAiXM.js";import"../sb-preview/runtime.js";import"./index-CUZDtIZe.js";import"./extends-CF3RwP-h.js";import"./assertThisInitialized-B9jnkVVz.js";import"./inheritsLoose-DR8r8Ogv.js";import"./index-D6rZ4wEC.js";import"./select-tIEV7vnw.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-CZK3mphC.js";import"./button-C1sV-0mR.js";import"./spinner-AWUe4xwQ.js";import"./icon-BP4BO6-k.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 L}from"./jsx-runtime-eps93zm2.js";import{I}from"./input-
|
|
1
|
+
import{j as L}from"./jsx-runtime-eps93zm2.js";import{I}from"./input-BW9trNAW.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"./tooltip-1V7clEnw.js";import"./index-CUZDtIZe.js";const{useArgs:M}=__STORYBOOK_MODULE_PREVIEW_API__,B={title:"Forms/Input",component:I,args:{disabled:!1,small:!1,placeholder:"Placeholder"}},t=S=>{const[x,f]=M(),T=b=>{f({value:b.target.value})};return L.jsx(I,{...S,onChange:T})},s=t.bind({}),e=t.bind({});e.args={small:!0};const n=t.bind({});n.args={error:"Error goes here"};const r=t.bind({});r.args={warning:"Warning goes here"};const a=t.bind({});a.args={type:"date",value:"2020-01-01"};var o,g,u;s.parameters={...s.parameters,docs:{...(o=s.parameters)==null?void 0:o.docs,source:{originalSource:`args => {
|
|
2
2
|
const [_, updateArgs] = useArgs();
|
|
3
3
|
const handleChange = (evt: ChangeEvent<HTMLInputElement>) => {
|
|
4
4
|
updateArgs({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e}from"./jsx-runtime-eps93zm2.js";import{useMDXComponents as s}from"./index-BcNHZKhG.js";import{Z as r,$ as o}from"./index-
|
|
1
|
+
import{j as e}from"./jsx-runtime-eps93zm2.js";import{useMDXComponents as s}from"./index-BcNHZKhG.js";import{Z as r,$ as o}from"./index-tzHbUYOM.js";import{Default as l}from"./button.stories-Bcy7mnLs.js";import{Default as a}from"./check-box.stories-J1keUUs0.js";import{Default as c}from"./file-input.stories-BH_glmEk.js";import{Default as d,Date as p}from"./input.stories-BruLeJ44.js";import{Default as h}from"./number-input.stories-BfRW8wgL.js";import{Default as m}from"./option-dropdown.stories-ByLG631x.js";import{Default as u}from"./radio-button.stories-D7uvMLbK.js";import{Native as f,Default as x}from"./select.stories-BuW6SmRZ.js";import{Default as j}from"./slider.stories-CY4GxD4Y.js";import{Default as b}from"./textarea.stories-aRLEoDHg.js";import{Default as g}from"./toggle.stories-CBkCAQh6.js";import"./index-DhsZuJvc.js";import"./iframe-DLWAAiXM.js";import"../sb-preview/runtime.js";import"./index-CUZDtIZe.js";import"./extends-CF3RwP-h.js";import"./assertThisInitialized-B9jnkVVz.js";import"./inheritsLoose-DR8r8Ogv.js";import"./index-D6rZ4wEC.js";import"./react-router-dom-CMITYWBH.js";import"./index-CEuq6vkz.js";import"./tiny-invariant-DqLgxztJ.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./flex-EllkLxgO.js";import"./button-C1sV-0mR.js";import"./index-Bk2sglWO.js";import"./common-types-Sih75Sav.js";import"./disabled-context-rmpd7YJS.js";import"./spinner-AWUe4xwQ.js";import"./icon-BP4BO6-k.js";import"./tooltip-1V7clEnw.js";import"./check-box-CaSrhzev.js";import"./help-icon-41R-Z9N1.js";import"./file-input-BZecnRBy.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-ttrR1AaP.js";import"./textarea-BV7xWEdt.js";import"./index-CWz-hU-f.js";import"./index-DRSy5Ssd.js";import"./number-input-uQOVHv2N.js";import"./input-group-addon-D68iUKV2.js";import"./select-tIEV7vnw.js";import"./memoize-one.esm-CcMeOnPo.js";import"./types-BmbYqTX_.js";import"./text-B3-TSWok.js";import"./actions-CZK3mphC.js";import"./badge-CLQ59MDF.js";import"./select.input-DIKP56UZ.js";import"./divider-DY9nJ_7N.js";import"./radio-button-C_cV5TWA.js";import"./slider-gZmYlxxz.js";import"./objectSpread2-DW4nTBoq.js";import"./index-BI4_Bp97.js";import"./toggle-Bo-JPbUP.js";function i(n){const t={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",strong:"strong",ul:"ul",...s(),...n.components};return e.jsxs(e.Fragment,{children:[e.jsx(r,{title:"Inputs"}),`
|
|
2
2
|
`,e.jsx(t.h1,{id:"inputs",children:"Inputs"}),`
|
|
3
3
|
`,e.jsx(t.p,{children:"React UI Library provides a comprehensive set of user input components."}),`
|
|
4
4
|
`,e.jsx(t.h2,{id:"button",children:"Button"}),`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as n}from"./jsx-runtime-eps93zm2.js";import{c as p}from"./index-Bk2sglWO.js";import{I as a}from"./common-types-Sih75Sav.js";import{H as s}from"./help-icon-
|
|
1
|
+
import{j as n}from"./jsx-runtime-eps93zm2.js";import{c as p}from"./index-Bk2sglWO.js";import{I as a}from"./common-types-Sih75Sav.js";import{H as s}from"./help-icon-41R-Z9N1.js";const f="_label_18pfe_1",v="_labelLeft_18pfe_5",b="_icons_18pfe_13",l={label:f,labelLeft:v,icons:b},x=({label:r=null,width:m="auto",helpText:i="",helpTextMaxWidth:d="300px",onClickHelp:o=void 0,lock:e={visible:!1,active:!1,onClick:()=>{},tooltip:"",testId:void 0},info:u,libraryIcon:t,labelLeft:c=!1})=>n.jsx("div",{className:p(l.label,c?l.labelLeft:""),children:n.jsxs("label",{style:{width:m||""},children:[r,n.jsxs("div",{className:l.icons,children:[(i||o)&&n.jsx(s,{text:i,onClick:o,maxWidth:d}),u&&n.jsx(s,{text:u,icon:a.INFO}),e&&e.visible&&e.onClick&&n.jsx(s,{onClick:e.onClick,icon:e.active?a.LOCK:a.UNLOCK,active:e.active,testId:e.testId}),t&&n.jsx(s,{text:(t==null?void 0:t.tooltip)??"",onClick:t.onClick,icon:a.LIBRARY})]})]})});x.__docgenInfo={description:"",methods:[],displayName:"Label",props:{label:{required:!1,tsType:{name:"union",raw:"TStringNumberNull | ReactNode",elements:[{name:"union",raw:"string | number | null",elements:[{name:"string"},{name:"number"},{name:"null"}]},{name:"ReactNode"}]},description:"",defaultValue:{value:"null",computed:!1}},helpText:{required:!1,tsType:{name:"union",raw:"TStringOrNumber | ReactNode",elements:[{name:"union",raw:"string | number",elements:[{name:"string"},{name:"number"}]},{name:"ReactNode"}]},description:"",defaultValue:{value:"''",computed:!1}},helpTextMaxWidth:{required:!1,tsType:{name:"union",raw:"string | number",elements:[{name:"string"},{name:"number"}]},description:"",defaultValue:{value:"'300px'",computed:!1}},width:{required:!1,tsType:{name:"union",raw:"string | number",elements:[{name:"string"},{name:"number"}]},description:"",defaultValue:{value:"'auto'",computed:!1}},info:{required:!1,tsType:{name:"string"},description:""},onClickHelp:{required:!1,tsType:{name:"signature",type:"function",raw:"(event?: MouseEvent<HTMLDivElement>) => void",signature:{arguments:[{type:{name:"MouseEvent",elements:[{name:"HTMLDivElement"}],raw:"MouseEvent<HTMLDivElement>"},name:"event"}],return:{name:"void"}}},description:"",defaultValue:{value:"undefined",computed:!0}},lock:{required:!1,tsType:{name:"ILabelLockProps"},description:"",defaultValue:{value:`{
|
|
2
2
|
visible: false,
|
|
3
3
|
active: false,
|
|
4
4
|
onClick: () => {},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as P}from"./jsx-runtime-eps93zm2.js";import{r as v}from"./index-DhsZuJvc.js";import{L as p}from"./label-
|
|
1
|
+
import{j as P}from"./jsx-runtime-eps93zm2.js";import{r as v}from"./index-DhsZuJvc.js";import{L as p}from"./label-hiSz3I8H.js";import"./index-Bk2sglWO.js";import"./common-types-Sih75Sav.js";import"./help-icon-41R-Z9N1.js";import"./tooltip-1V7clEnw.js";import"./index-CUZDtIZe.js";import"./icon-BP4BO6-k.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./inheritsLoose-DR8r8Ogv.js";import"./index-CEuq6vkz.js";import"./disabled-context-rmpd7YJS.js";const G={title:"Forms/Label",component:p,args:{label:"Label"}},c=e=>P.jsx(p,{...e}),l=c.bind({}),o=c.bind({});o.args={helpText:"Tooltip goes here"};const r=c.bind({});r.args={onClickHelp:()=>{}};const s=c.bind({});s.args={info:"Info goes here"};const a=()=>{const[e,_]=v.useState(!1),j=()=>_(!e);return P.jsx(p,{label:"Label",lock:{visible:!0,active:e,onClick:j,tooltip:e?"Unlock":"Lock",testId:"testId"}})},t=c.bind({});t.args={libraryIcon:{onClick:()=>{},tooltip:"View in library"}};a.__docgenInfo={description:"",methods:[],displayName:"LockIcon"};var i,n,m;l.parameters={...l.parameters,docs:{...(i=l.parameters)==null?void 0:i.docs,source:{originalSource:"(args: ILabelProps) => <Label {...args} />",...(m=(n=l.parameters)==null?void 0:n.docs)==null?void 0:m.source}}};var d,b,g;o.parameters={...o.parameters,docs:{...(d=o.parameters)==null?void 0:d.docs,source:{originalSource:"(args: ILabelProps) => <Label {...args} />",...(g=(b=o.parameters)==null?void 0:b.docs)==null?void 0:g.source}}};var L,u,k;r.parameters={...r.parameters,docs:{...(L=r.parameters)==null?void 0:L.docs,source:{originalSource:"(args: ILabelProps) => <Label {...args} />",...(k=(u=r.parameters)==null?void 0:u.docs)==null?void 0:k.source}}};var I,f,x;s.parameters={...s.parameters,docs:{...(I=s.parameters)==null?void 0:I.docs,source:{originalSource:"(args: ILabelProps) => <Label {...args} />",...(x=(f=s.parameters)==null?void 0:f.docs)==null?void 0:x.source}}};var S,T,h;a.parameters={...a.parameters,docs:{...(S=a.parameters)==null?void 0:S.docs,source:{originalSource:`() => {
|
|
2
2
|
const [locked, setLocked] = useState(false);
|
|
3
3
|
const handleToggleLock = () => setLocked(!locked);
|
|
4
4
|
return <Label label="Label" lock={{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as t}from"./jsx-runtime-eps93zm2.js";import{useMDXComponents as n}from"./index-BcNHZKhG.js";import{Z as s,$ as o}from"./index-
|
|
1
|
+
import{j as t}from"./jsx-runtime-eps93zm2.js";import{useMDXComponents as n}from"./index-BcNHZKhG.js";import{Z as s,$ as o}from"./index-tzHbUYOM.js";import{Default as p,LabelOnLeft as l}from"./field.stories-D5Mej0Bt.js";import{Default as m,LabelsOnLeft as a,Row as h}from"./form.stories-BwzDZgen.js";import"./index-DhsZuJvc.js";import"./iframe-DLWAAiXM.js";import"../sb-preview/runtime.js";import"./index-CUZDtIZe.js";import"./extends-CF3RwP-h.js";import"./assertThisInitialized-B9jnkVVz.js";import"./inheritsLoose-DR8r8Ogv.js";import"./index-D6rZ4wEC.js";import"./field-C5_fLDpy.js";import"./index-Bk2sglWO.js";import"./label-hiSz3I8H.js";import"./common-types-Sih75Sav.js";import"./help-icon-41R-Z9N1.js";import"./tooltip-1V7clEnw.js";import"./icon-BP4BO6-k.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-tIEV7vnw.js";import"./memoize-one.esm-CcMeOnPo.js";import"./types-BmbYqTX_.js";import"./actions-CZK3mphC.js";import"./button-C1sV-0mR.js";import"./spinner-AWUe4xwQ.js";import"./badge-CLQ59MDF.js";import"./select.input-DIKP56UZ.js";import"./check-box-CaSrhzev.js";import"./button-group-Ai4DXqNr.js";import"./toggle-Bo-JPbUP.js";import"./input-group-BaRSJAEN.js";import"./input-group-addon-D68iUKV2.js";import"./slider-gZmYlxxz.js";import"./objectSpread2-DW4nTBoq.js";import"./index-BI4_Bp97.js";import"./textarea-BV7xWEdt.js";import"./radio-button-C_cV5TWA.js";import"./form-row-CM112EYF.js";function r(i){const e={code:"code",h1:"h1",h2:"h2",p:"p",...n(),...i.components};return t.jsxs(t.Fragment,{children:[t.jsx(s,{title:"Layout (Forms)"}),`
|
|
2
2
|
`,t.jsx(e.h1,{id:"layout-forms",children:"Layout (Forms)"}),`
|
|
3
3
|
`,t.jsx(e.h2,{id:"field",children:"Field"}),`
|
|
4
4
|
`,t.jsxs(e.p,{children:["This is a wrapper for any form element with default bottom margin, and props like ",t.jsx(e.code,{children:"label"})," for other default styling."]}),`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e}from"./jsx-runtime-eps93zm2.js";import{useMDXComponents as s}from"./index-BcNHZKhG.js";import{Z as r,$ as n}from"./index-
|
|
1
|
+
import{j as e}from"./jsx-runtime-eps93zm2.js";import{useMDXComponents as s}from"./index-BcNHZKhG.js";import{Z as r,$ as n}from"./index-tzHbUYOM.js";import{Center as d,SpaceBetween as l,JustifyEnd as a,Column as c}from"./flex.stories-sSdg0ChR.js";import{Default as h,CustomColumnWidth as p,DefaultGap as x,CustomGap as m,Responsive as u}from"./grid.stories-BhjMGl59.js";import{Default as j,FixedWidth as f,NoPadding as w,ResponsiveWidth as g}from"./column.stories-JMvj3_fr.js";import"./index-DhsZuJvc.js";import"./iframe-DLWAAiXM.js";import"../sb-preview/runtime.js";import"./index-CUZDtIZe.js";import"./extends-CF3RwP-h.js";import"./assertThisInitialized-B9jnkVVz.js";import"./inheritsLoose-DR8r8Ogv.js";import"./index-D6rZ4wEC.js";import"./flex-EllkLxgO.js";import"./button-C1sV-0mR.js";import"./index-Bk2sglWO.js";import"./common-types-Sih75Sav.js";import"./disabled-context-rmpd7YJS.js";import"./spinner-AWUe4xwQ.js";import"./icon-BP4BO6-k.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./index-CEuq6vkz.js";import"./tooltip-1V7clEnw.js";import"./text-B3-TSWok.js";import"./grid-B6LFPf51.js";import"./styled-components.browser.esm-Bf0q9Yjk.js";import"./card-EcjmryU9.js";import"./row-4iAGREkV.js";import"./heading-NkLgQYoP.js";import"./help-icon-41R-Z9N1.js";function t(i){const o={code:"code",h1:"h1",h2:"h2",h3:"h3",p:"p",...s(),...i.components};return e.jsxs(e.Fragment,{children:[e.jsx(r,{title:"Layout (General)"}),`
|
|
2
2
|
`,e.jsx(o.h1,{id:"layout-general",children:"Layout (General)"}),`
|
|
3
3
|
`,e.jsx(o.h2,{id:"flex",children:"Flex"}),`
|
|
4
4
|
`,e.jsxs(o.p,{children:["The ",e.jsx(o.code,{children:"Flex"})," component is a basic flexbox wrapper with optional props for ",e.jsx(o.code,{children:"alignItems"}),", ",e.jsx(o.code,{children:"justifyContent"})," and ",e.jsx(o.code,{children:"flexDirection"}),". This is a conveninent way to center items vertically and/or horizontally, to align them to opposite edges, or align them to the far side."]}),`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e}from"./jsx-runtime-eps93zm2.js";import{r as i}from"./index-DhsZuJvc.js";import{c as S}from"./index-Bk2sglWO.js";import{P as ee,D as ne,C as ae,I as te}from"./index.es-D2piFfFj.js";import{C as re}from"./card-EcjmryU9.js";import{l as t,N as se,M as le,L as oe}from"./meta-content-
|
|
1
|
+
import{j as e}from"./jsx-runtime-eps93zm2.js";import{r as i}from"./index-DhsZuJvc.js";import{c as S}from"./index-Bk2sglWO.js";import{P as ee,D as ne,C as ae,I as te}from"./index.es-D2piFfFj.js";import{C as re}from"./card-EcjmryU9.js";import{l as t,N as se,M as le,L as oe}from"./meta-content-BE7pulye.js";import{I as _}from"./common-types-Sih75Sav.js";import{D as M}from"./disabled-context-rmpd7YJS.js";import{A as R}from"./actions-CZK3mphC.js";import{B as O}from"./badge-CLQ59MDF.js";import{I as w}from"./icon-BP4BO6-k.js";import{L as ie}from"./loader-XHoVniao.js";const P=({label:n})=>n?e.jsx("span",{className:t.label,children:e.jsx(O,{color:n.color,title:n.value,small:n.small})}):null;P.__docgenInfo={description:"",methods:[],displayName:"Label",props:{label:{required:!1,tsType:{name:"ILabel"},description:""}}};const k=({item:n})=>n.metaCount!==void 0?e.jsx(O,{color:"rgba(0,0,0,0.25)",title:n.metaCount}):null;k.__docgenInfo={description:"",methods:[],displayName:"MetaCount",props:{item:{required:!0,tsType:{name:"signature",type:"object",raw:`{
|
|
2
2
|
metaCount?: number;
|
|
3
3
|
}`,signature:{properties:[{key:"metaCount",value:{name:"number",required:!1}}]}},description:""}}};const B=({item:n,expanding:o})=>{const c=d=>{d.preventDefault(),d.stopPropagation()};return o&&n.active&&n.content?e.jsx("div",{className:t.itemContent,onClick:c,children:n.content}):null};B.__docgenInfo={description:"",methods:[],displayName:"ItemContent",props:{item:{required:!0,tsType:{name:"signature",type:"object",raw:`{
|
|
4
4
|
active?: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as r}from"./jsx-runtime-eps93zm2.js";import{r as W}from"./index-DhsZuJvc.js";import{f}from"./immer.esm-BwVl9PS2.js";import{H as on,S as dn,R as z,L as G}from"./react-router-dom-CMITYWBH.js";import{L as y,a as P}from"./list-
|
|
1
|
+
import{j as r}from"./jsx-runtime-eps93zm2.js";import{r as W}from"./index-DhsZuJvc.js";import{f}from"./immer.esm-BwVl9PS2.js";import{H as on,S as dn,R as z,L as G}from"./react-router-dom-CMITYWBH.js";import{L as y,a as P}from"./list-DYNKqvUR.js";import{L as mn}from"./meta-content-BE7pulye.js";import{F as ln}from"./flex-EllkLxgO.js";import{a as cn,b as pn,c as un,d as gn,e as hn,f as yn,g as bn,h as kn,i as fn,j as xn,k as Sn,m as In,n as Cn,o as sn}from"./list.stories-data-D_ZfzaxE.js";import"./inheritsLoose-DR8r8Ogv.js";import"./index-CEuq6vkz.js";import"./extends-CF3RwP-h.js";import"./tiny-invariant-DqLgxztJ.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./index-Bk2sglWO.js";import"./index.es-D2piFfFj.js";import"./redux-tRgGMjwY.js";import"./objectSpread2-DW4nTBoq.js";import"./index-CUZDtIZe.js";import"./memoize-one.esm-CcMeOnPo.js";import"./card-EcjmryU9.js";import"./common-types-Sih75Sav.js";import"./disabled-context-rmpd7YJS.js";import"./actions-CZK3mphC.js";import"./lodash-BHd_uQHh.js";import"./button-C1sV-0mR.js";import"./spinner-AWUe4xwQ.js";import"./icon-BP4BO6-k.js";import"./tooltip-1V7clEnw.js";import"./types-BmbYqTX_.js";import"./types-UmZ4Y_CR.js";import"./badge-CLQ59MDF.js";import"./loader-XHoVniao.js";import"./heading-NkLgQYoP.js";import"./help-icon-41R-Z9N1.js";const sa={title:"Basic/List",component:y,args:{list:cn,noHeader:!0},parameters:{layout:"fullscreen"}},o=d=>r.jsx(y,{...d}),q=o.bind({}),L=o.bind({});L.args={list:pn};const D=o.bind({});D.args={list:un};const v=o.bind({});v.args={list:gn};const K=o.bind({});K.args={list:hn,expanding:!0};const H=o.bind({});H.args={list:yn,noHeader:!1};const M=o.bind({});M.args={list:bn};const R=o.bind({});R.args={list:kn};const j=o.bind({});j.args={list:fn};const T=o.bind({});T.args={list:xn};const N=o.bind({});N.args={list:Sn,noHeader:!1};const E=o.bind({});E.args={bordered:!0};const w=o.bind({});w.args={list:In};const _=o.bind({});_.args={list:Cn};const S=o.bind({});S.args={list:sn,noHeader:!1,stickyHeader:!0};S.parameters={docs:{story:{inline:!1,iframeHeight:200}}};const x=o.bind({});x.args={list:sn,scrollDetails:{scrollable:!0}};x.parameters={docs:{description:{story:"Adds an internal scrollbar to the `List`, which will fill its parent height unless a `height` is set. The scrollbar can be toggled using `hideScrollbar`."}}};x.decorators=[d=>r.jsx("div",{style:{height:200,overflow:"hidden"},children:d()})];const $=()=>{const[d,b]=W.useState(0),k={name:"Animals",items:[...Array(50)].map((m,l)=>({id:l,name:`Aardvark #${l+1}`,active:l===d,onClick:()=>b(l)}))};return r.jsx("div",{style:{height:200,overflow:"auto"},children:r.jsx(y,{list:k,scrollDetails:{infiniteScroll:!0,scrollable:!0,limit:10}})})},B=()=>{const d=(e,a)=>{switch(a.type){case"headingClicked":{const{headingKey:t}=a.payload;return f(e,s=>{const i=s[t];i.expanded=!i.expanded})}case"itemClicked":{const{headingKey:t,itemIndex:s}=a.payload;return f(e,i=>{Object.keys(i).forEach(h=>{i[h].items.forEach((A,rn)=>{A.active=h===t&&rn===s})})})}case"addClicked":{const{headingKey:t}=a.payload;return f(e,s=>{const i=s[t];i.expanded=!0,i.items.push({name:`${i.label} #${i.items.length+1}`})})}case"deleteClicked":{const{headingKey:t,itemIndex:s}=a.payload;return f(e,i=>{let{items:h}=i[t];delete h[s],i[t].items=h.filter(A=>A)})}default:return e}},b=()=>({mammals:{draggable:!0,name:"Mammals",key:"mammals",label:"Mammals",expanded:!0,items:[{name:"Click item to scroll",type:"Heading"},{name:"Mammal #1",active:!0},{name:"Mammal #2"},{name:"Mammal #3"},{name:"Mammal #4"},{name:"Mammal #5"},{name:"Mammal #6"},{name:"Mammal #7"},{name:"Mammal #8"},{name:"Mammal #9"},{name:"Mammal #10"}]},amphibians:{name:"Amphibians (sticky header)",key:"amphibians",label:"Amphibians",expanded:!0,items:[{name:"Click item to scroll",type:"Heading"},{name:"Amphibian #1",active:!0},{name:"Amphibian #2"},{name:"Amphibian #3"},{name:"Amphibian #4"},{name:"Amphibian #5"},{name:"Amphibian #6"},{name:"Amphibian #7"},{name:"Amphibian #8"},{name:"Amphibian #9"},{name:"Amphibian #10"}]}}),[k,m]=W.useReducer(d,{},()=>b()),[l,u]=W.useState(!1),c=(e,a)=>{u(!0),m({type:"itemClicked",payload:{headingKey:e,itemIndex:a}}),setTimeout(()=>u(!1),0)},p=e=>{m({type:"addClicked",payload:{headingKey:e}})},g=(e,a)=>m({type:"deleteClicked",payload:{headingKey:e,itemIndex:a}}),{mammals:I,amphibians:X}=k,C=e=>({...e,actions:[{label:"Add",primary:!0,icon:"add",onClick:()=>p(e.key)}],items:e.items.map((a,t)=>a.type=="Heading"?{...a,id:t}:{...a,id:t,onClick:()=>c(e.key,t),actions:[{label:"Delete",icon:"delete",onClick:()=>g(e.key,t)}]})}),n=300;return r.jsxs(ln,{gap:!0,children:[r.jsx(y,{list:C(I),bordered:!0,height:n,scrollDetails:{scrollable:!0,hideScrollbar:!1,triggerScrollToActiveItem:l}}),r.jsx(y,{list:C(X),bordered:!0,stickyHeader:!0,height:n,scrollDetails:{scrollable:!0,hideScrollbar:!1,triggerScrollToActiveItem:l}})]})},F=()=>{const d=(n,e)=>{switch(e.type){case"headingClicked":{const{headingKey:a}=e.payload;return f(n,t=>{const s=t[a];s.expanded=!s.expanded})}case"itemClicked":{const{headingKey:a,itemIndex:t}=e.payload;return f(n,s=>{Object.keys(s).forEach(i=>{s[i].items.forEach((h,A)=>{h.active=i===a&&A===t})})})}case"addClicked":{const{headingKey:a}=e.payload;return f(n,t=>{const s=t[a];s.expanded=!0,s.items.push({name:`${s.label} #${s.items.length+1}`})})}case"deleteClicked":{const{headingKey:a,itemIndex:t}=e.payload;return f(n,s=>{let{items:i}=s[a];delete i[t],s[a].items=i.filter(h=>h)})}default:return n}},b=()=>({mammals:{key:"mammals",label:"Mammals",expanded:!0,items:[{name:"Aardvark",active:!0},{name:"Kangaroo"}]},amphibians:{key:"amphibians",label:"Amphibians",expanded:!0,items:[{name:"Frog"}]}}),[k,m]=W.useReducer(d,b()),l=n=>m({type:"headingClicked",payload:{headingKey:n}}),u=(n,e)=>m({type:"itemClicked",payload:{headingKey:n,itemIndex:e}}),c=n=>m({type:"addClicked",payload:{headingKey:n}}),p=(n,e)=>m({type:"deleteClicked",payload:{headingKey:n,itemIndex:e}}),{mammals:g,amphibians:I}=k,X=n=>({name:n.label,metaCount:n.items.length,expanded:n.expanded,onClick:()=>l(n.key),actions:[{label:"Add",primary:!0,icon:"add",onClick:()=>c(n.key)}]}),C=n=>({...n,items:n.items.map((e,a)=>({...e,id:a,onClick:()=>u(n.key,a),actions:[{label:"Delete",icon:"delete",onClick:()=>p(n.key,a)}]}))});return r.jsxs(r.Fragment,{children:[r.jsx(mn,{name:"Animals"}),r.jsx(P,{item:X(g)}),g.expanded&&r.jsx(y,{noHeader:!0,list:C(g)}),r.jsx(P,{item:X(I)}),I.expanded&&r.jsx(y,{noHeader:!0,list:C(I)})]})},O=()=>{const d=(u,c,p)=>{if(c&&isNaN(c)||p&&isNaN(p)||c===p)return u;const g=[...u];return typeof p=="number"&&typeof c=="number"&&g.splice(p,0,g.splice(c,1)[0]),g},b={name:"List Name",draggable:!0,items:[{id:1,name:"element 1",actions:[{label:"Delete",icon:"delete",onClick:()=>{}}]},{id:2,name:"Long element name goes here lorem ipsum dolor lorem ipsum dolor",actions:[{label:"Delete",icon:"delete",onClick:()=>{}}]},{id:3,name:"element 3"},{id:4,name:"element 4",actions:[{label:"Delete",icon:"delete",onClick:()=>{}}]},{id:5,name:"element 5",actions:[{label:"Delete",icon:"delete",onClick:()=>{}}]}]},[k,m]=W.useState(b.items),l=u=>{const{to:c,from:p}=u;m(d(k,p,c))};return r.jsx(y,{list:{...b,items:k},draggable:!0,onListReorder:l})},J=()=>{const d={items:[{id:1,name:"Dashboard",component:G,url:"/dashboard"},{id:2,name:"Settings",component:G,url:"/settings"}]};return r.jsxs(on,{children:[r.jsx(y,{list:d,noHeader:!0}),r.jsxs(dn,{children:[r.jsx(z,{path:"/dashboard",children:"Dashboard"}),r.jsx(z,{path:"/settings",children:"Settings"})]})]})};$.__docgenInfo={description:"",methods:[],displayName:"InfiniteScroll"};B.__docgenInfo={description:"",methods:[],displayName:"ScrollToActiveItem"};F.__docgenInfo={description:"",methods:[],displayName:"HeadingsManaged"};O.__docgenInfo={description:"",methods:[],displayName:"ManagedDragAndDrop"};J.__docgenInfo={description:"",methods:[],displayName:"AsRouterLink"};var Q,U,V;q.parameters={...q.parameters,docs:{...(Q=q.parameters)==null?void 0:Q.docs,source:{originalSource:`args => {
|
|
2
2
|
return <List {...args} />;
|
|
3
3
|
}`,...(V=(U=q.parameters)==null?void 0:U.docs)==null?void 0:V.source}}};var Y,Z,ee;L.parameters={...L.parameters,docs:{...(Y=L.parameters)==null?void 0:Y.docs,source:{originalSource:`args => {
|
|
4
4
|
return <List {...args} />;
|
package/dist/storybook/assets/{list.stories-data-CnVYk3eo.js → list.stories-data-D_ZfzaxE.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t}from"./jsx-runtime-eps93zm2.js";import{I as i,T as c}from"./common-types-Sih75Sav.js";import{F as o}from"./flex-EllkLxgO.js";import{M as d}from"./actions-
|
|
1
|
+
import{j as t}from"./jsx-runtime-eps93zm2.js";import{I as i,T as c}from"./common-types-Sih75Sav.js";import{F as o}from"./flex-EllkLxgO.js";import{M as d}from"./actions-CZK3mphC.js";import{I as n}from"./icon-BP4BO6-k.js";import{M as l}from"./types-BmbYqTX_.js";const a=[{id:1,name:"Aardvark"},{id:2,name:"Kangaroo",active:!0},{id:3,name:"Jaguar",disabled:!0}],p=[{id:1,name:"Marsupials",type:"Heading",metaCount:1},{id:2,name:"Aardvark"},{id:3,name:"Kangaroo",active:!0},{id:4,name:"Mammals",type:"Heading",metaCount:1},{id:5,name:"Jaguar"}],g=[{id:1,name:"Aardvark"},{id:2,name:"Kangaroo",active:!0},{id:3,name:"Grey",level:1},{id:4,name:"Eastern",level:2},{id:5,name:"Macropus giganteus giganteus",title:"Macropus giganteus giganteus",level:3},{id:6,name:"Macropus giganteus tasmaniensis",title:"Macropus giganteus tasmaniensis",level:3},{id:7,name:"Western",level:2},{id:8,name:"Red",level:1},{id:9,name:"Jaguar"}],h={items:a},r={name:"Animals",actions:[{label:"More",subActions:[{label:"Item",icon:"up",onClick:()=>{}},{label:"Item",icon:"down",onClick:()=>{}}]},{label:"Add",primary:!0,icon:"add",onClick:()=>{}}],items:a},m={...r,items:p},A={...r,name:t.jsxs(o,{gap:"var(--padding-xs)",alignItems:"center",children:["Animals",t.jsx(n,{icon:i.STAR})]}),items:a.map(e=>({...e,name:t.jsxs(o,{gap:"var(--padding-xs)",alignItems:"center",children:[e.name,t.jsx(n,{icon:i.STAR})]})}))};a.map(e=>({...e,actions:[{childComponent:t.jsx(d,{menu:{trigger:c.COMPONENT,component:t.jsx(n,{icon:i.MENU}),placement:"bottom-end",sections:[{type:l.OPTION,label:"Item",onClick:()=>{}},{type:l.OPTION,label:"Item",onClick:()=>{}}]}})}]}));const C={items:a.map(e=>({...e,actions:[{label:"More",subActions:[{label:"Move Up",icon:"up",onClick:()=>{}},{label:"Move Down",icon:"down",onClick:()=>{}}]}]}))},k={items:a.map((e,s)=>({...e,label:{value:String(s+1),color:"var(--color-text-info)"}}))},j={items:a.map(e=>({...e,label:{value:t.jsx(t.Fragment,{children:" "}),color:"var(--color-text-info)",small:!0}}))},T={...m,items:m.items.map((e,s)=>({...e,label:{value:String(s+1),color:"var(--color-text-info)"}}))},f={items:a.map(e=>({...e,actions:[{label:"Delete",icon:"delete",onClick:()=>{}}]}))},y={items:a.map((e,s)=>({...e,details:"Description goes here",metadata:"2019-05-03 09:03:51",testId:`story-list-item-${s}`}))},S={items:a.map(e=>({...e,content:t.jsx("div",{children:"Example content element (for show/hide)."})}))},N={items:g},E={items:[...a,{id:4,name:"Dodo",invalid:!0}]},O={items:a.map(e=>({...e,icon:{icon:"success",color:"var(--color-text-success)",tooltip:{text:t.jsx(t.Fragment,{children:"Tooltip goes here"})}}}))},D={items:a.map(e=>({...e,metaCount:3}))},w={name:"Animals",items:[...Array(50)].map((e,s)=>({id:s,name:`Aardvark #${s+1}`}))};export{h as a,f as b,C as c,y as d,S as e,r as f,k as g,j as h,N as i,E as j,A as k,T as l,O as m,D as n,w as o};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e}from"./jsx-runtime-eps93zm2.js";import{r as G}from"./index-DhsZuJvc.js";import{a as l}from"./common-types-Sih75Sav.js";import{L as g}from"./loader-XHoVniao.js";import{P as M}from"./progress-bar-C_kV6r0Q.js";import{S as x}from"./spinner-AWUe4xwQ.js";import{S as m}from"./spacer-BWoNR27H.js";import{B as L}from"./button-
|
|
1
|
+
import{j as e}from"./jsx-runtime-eps93zm2.js";import{r as G}from"./index-DhsZuJvc.js";import{a as l}from"./common-types-Sih75Sav.js";import{L as g}from"./loader-XHoVniao.js";import{P as M}from"./progress-bar-C_kV6r0Q.js";import{S as x}from"./spinner-AWUe4xwQ.js";import{S as m}from"./spacer-BWoNR27H.js";import{B as L}from"./button-C1sV-0mR.js";import{C as q}from"./card-EcjmryU9.js";import"./index-Bk2sglWO.js";import"./disabled-context-rmpd7YJS.js";import"./icon-BP4BO6-k.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./inheritsLoose-DR8r8Ogv.js";import"./index-CEuq6vkz.js";import"./tooltip-1V7clEnw.js";import"./index-CUZDtIZe.js";const le={title:"Progress/Loader",component:g,argTypes:{theme:{control:{type:"inline-radio"},options:["white","light","dark"]}},args:{theme:"white",text:"Loading...",width:"100%",height:"100%",fullViewPortSize:!1},decorators:[r=>e.jsx("div",{style:{height:"200px",position:"relative"},children:r()})],parameters:{docs:{source:{excludeDecorators:!0}}}},S=r=>{const{theme:t}=r;return e.jsx(g,{...r,children:e.jsx(x,{dark:t!=="dark"})})},h=r=>{const{theme:t}=r;return e.jsx(g,{...r,children:e.jsx(M,{width:"300px",inverted:t==="dark",percentage:40})})},o=S.bind({});o.args={testId:"story-default-spinner"};const u=h.bind({}),i=S.bind({});i.args={theme:l.LIGHT};const n=S.bind({});n.args={theme:l.DARK,fullViewPortSize:!0};const d=h.bind({});d.args={theme:l.DARK,fullViewPortSize:!0};const c=h.bind({});c.args={details:"Some extra info"};const p=h.bind({});p.args={text:"",details:e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{opacity:.5},children:"Step 1: Lorem ipsum...DONE"}),e.jsx(m,{height:"var(--padding-xs)"}),e.jsx("div",{children:"Step 2: Dolor est"}),e.jsx(m,{height:"var(--padding-xs)"}),e.jsx("div",{style:{opacity:.5},children:"Step 3: Compendum"}),e.jsx(m,{height:"var(--padding-xs)"}),e.jsx(L,{label:"Cancel",onClick:()=>{}})]})};const a=()=>{const[r,t]=G.useState(!0);return e.jsxs(e.Fragment,{children:[e.jsx(L,{label:"Toggle loading",onClick:()=>t(!r)}),e.jsx(m,{}),e.jsx(q,{children:e.jsxs("div",{style:{position:"relative"},children:[r&&e.jsx(g,{cover:!0,theme:l.WHITE,children:e.jsx(x,{dark:!0})}),"Lorem ipsum dolor sit amet, consectetur adipiscing elit. ".repeat(20)]})})]})};a.parameters={docs:{story:{inline:!1,iframeHeight:400}}};const s=()=>{const[r,t]=G.useState(!0);return e.jsxs(e.Fragment,{children:[e.jsx(L,{label:"Toggle loading",onClick:()=>t(!r)}),e.jsx(m,{}),e.jsx(q,{children:e.jsx("div",{style:{position:"relative"},children:r?e.jsx(g,{theme:l.WHITE,height:"200px",children:e.jsx(x,{dark:!0})}):e.jsx("div",{children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. ".repeat(20)})})})]})};s.parameters={docs:{story:{inline:!1,iframeHeight:400}}};a.__docgenInfo={description:"",methods:[],displayName:"CoversCardContent"};s.__docgenInfo={description:"",methods:[],displayName:"ReplacesCardContent"};var v,j,C;o.parameters={...o.parameters,docs:{...(v=o.parameters)==null?void 0:v.docs,source:{originalSource:`(args: ILoaderProps) => {
|
|
2
2
|
const {
|
|
3
3
|
theme
|
|
4
4
|
} = args;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as r}from"./jsx-runtime-eps93zm2.js";import{r as br}from"./index-DhsZuJvc.js";import{H as xr,L as A,S as Sr,R as B}from"./react-router-dom-CMITYWBH.js";import{T as F,I as hr}from"./common-types-Sih75Sav.js";import{M as L}from"./actions-
|
|
1
|
+
import{j as r}from"./jsx-runtime-eps93zm2.js";import{r as br}from"./index-DhsZuJvc.js";import{H as xr,L as A,S as Sr,R as B}from"./react-router-dom-CMITYWBH.js";import{T as F,I as hr}from"./common-types-Sih75Sav.js";import{M as L}from"./actions-CZK3mphC.js";import{B as _}from"./button-C1sV-0mR.js";import{F as jr}from"./flex-EllkLxgO.js";import{m as s,a as Tr,b as Mr,c as Or,d as Cr,e as Dr,f as Rr,g as fr,h as yr,i as kr}from"./menu.stories-data-DeDnsKpk.js";import{M as W}from"./types-BmbYqTX_.js";import"./inheritsLoose-DR8r8Ogv.js";import"./index-CEuq6vkz.js";import"./extends-CF3RwP-h.js";import"./tiny-invariant-DqLgxztJ.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./index-Bk2sglWO.js";import"./lodash-BHd_uQHh.js";import"./disabled-context-rmpd7YJS.js";import"./tooltip-1V7clEnw.js";import"./index-CUZDtIZe.js";import"./icon-BP4BO6-k.js";import"./types-UmZ4Y_CR.js";import"./badge-CLQ59MDF.js";import"./spinner-AWUe4xwQ.js";const Zr={title:"Basic/Menu",component:L,args:{menu:s}},e=a=>r.jsx(L,{...a}),N=e.bind({}),n=e.bind({});n.args={menu:{...s,colored:!0}};const o=e.bind({});o.args={menu:{...s,label:"Delete",colored:"danger"}};const t=e.bind({});t.args={menu:{...s,trigger:F.TEXT}};const i=e.bind({});i.args={menu:{...s,trigger:F.COMPONENT,component:r.jsx(_,{small:!0,colored:!0,round:!0,icon:hr.SETTINGS})}};const c=e.bind({});c.args={menu:Tr};const p=e.bind({});p.args={menu:Mr};const d=e.bind({});d.args={menu:Or};const l=e.bind({});l.args={menu:Cr};const m=e.bind({});m.args={disabled:!0};const u=e.bind({});u.args={tooltip:"Tooltip goes here"};const g=e.bind({});g.args={error:"Error goes here"};const b=e.bind({});b.args={warning:"Warning goes here"};const x=e.bind({});x.args={loading:!0,disabled:!0};const S=e.bind({});S.args={badgeTitle:"3"};const h=e.bind({});h.args={badgeDot:!0};const j=e.bind({});j.args={menu:Dr};const T=e.bind({});T.args={menu:Rr};const M=e.bind({});M.args={closeOnOptionClick:!1};const O=e.bind({});O.args={contextMenu:!0,menu:{...s,trigger:F.TEXT,label:"Right-click me"}};const C=e.bind({});C.args={width:"100%"};const D=e.bind({});D.args={menu:{...s,small:!0}};const R=e.bind({});R.args={menu:fr};const f=e.bind({});f.args={menu:{...s,sections:r.jsx("div",{children:"Testing"})}};const y=e.bind({});y.args={menu:yr};const k=e.bind({});k.args={menu:kr};const I=()=>{const[a,P]=br.useState(!1);return r.jsxs(jr,{gap:!0,children:[r.jsx(L,{menu:s,open:a,setOpen:P}),r.jsx(_,{label:"Open",onClick:()=>P(!0),disabled:a}),r.jsx(_,{label:"Close",onClick:()=>P(!1),disabled:!a})]})},E=()=>r.jsxs(xr,{children:[r.jsx(L,{menu:{label:"Go to",trigger:F.DROP_DOWN_BUTTON,sections:[{type:W.OPTION,label:"Dashboard",url:"/dashboard",component:A},{type:W.OPTION,label:"Settings",url:"/settings",component:A}]}}),r.jsxs(Sr,{children:[r.jsx(B,{path:"/dashboard",children:"Dashboard"}),r.jsx(B,{path:"/settings",children:"Settings"})]})]});I.__docgenInfo={description:"",methods:[],displayName:"ControlOpenStateFromParent"};E.__docgenInfo={description:"",methods:[],displayName:"AsRouterLink"};var w,X,J;N.parameters={...N.parameters,docs:{...(w=N.parameters)==null?void 0:w.docs,source:{originalSource:`args => <Menu
|
|
2
2
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
3
3
|
{...args} />`,...(J=(X=N.parameters)==null?void 0:X.docs)==null?void 0:J.source}}};var U,H,v;n.parameters={...n.parameters,docs:{...(U=n.parameters)==null?void 0:U.docs,source:{originalSource:`args => <Menu
|
|
4
4
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as s}from"./jsx-runtime-eps93zm2.js";import{M as a,a as n}from"./message-ttrR1AaP.js";import{B as M}from"./button-
|
|
1
|
+
import{j as s}from"./jsx-runtime-eps93zm2.js";import{M as a,a as n}from"./message-ttrR1AaP.js";import{B as M}from"./button-C1sV-0mR.js";import{G as z}from"./grid-B6LFPf51.js";import"./index-DhsZuJvc.js";import"./index-Bk2sglWO.js";import"./common-types-Sih75Sav.js";import"./icon-BP4BO6-k.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./inheritsLoose-DR8r8Ogv.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-BP4BO6-k.js";import{H as h}from"./heading-
|
|
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-BP4BO6-k.js";import{H as h}from"./heading-NkLgQYoP.js";import{A as x}from"./actions-CZK3mphC.js";import{B as f}from"./badge-CLQ59MDF.js";import{T as N}from"./tooltip-1V7clEnw.js";const b="_inputInTable_tn20e_1",T="_inputHover_tn20e_13",j="_inputFocus_tn20e_18",v="_inputError_tn20e_25",y="_inputWarning_tn20e_26",I="_inputDisabled_tn20e_61",w="_hideScrollbars_tn20e_67",H="_header_tn20e_77",q="_headerTitle_tn20e_77",C="_heading_tn20e_78",k="_itemHeader_tn20e_78",E="_narrow_tn20e_81",S="_stickyHeader_tn20e_85",M="_title_tn20e_96",R="_name_tn20e_102",L="_iconTooltipMargin_tn20e_105",F="_bold_tn20e_108",V="_toggleNarrow_tn20e_117",W="_drag_tn20e_135",B="_list_tn20e_155",D="_bordered_tn20e_159",P="_item_tn20e_78",$="_action_tn20e_192",A="_active_tn20e_195",O="_indented_tn20e_202",z="_disabled_tn20e_215",G="_label_tn20e_226",J="_details_tn20e_237",K="_metadata_tn20e_238",Q="_itemContent_tn20e_246",U="_indentIcon_tn20e_253",X="_expandIcon_tn20e_258",Y="_expanded_tn20e_265",Z="_right_tn20e_268",ee="_actions_tn20e_276",te="_scrollableList_tn20e_281",ne="_infiniteScrollContainer_tn20e_286",ae="_hideScrollbar_tn20e_67",oe="_noPointerEvents_tn20e_303",n={inputInTable:b,inputHover:T,inputFocus:j,inputError:v,inputWarning:y,inputDisabled:I,hideScrollbars:w,header:H,headerTitle:q,heading:C,itemHeader:k,narrow:E,stickyHeader:S,title:M,name:R,iconTooltipMargin:L,bold:F,toggleNarrow:V,drag:W,list:B,bordered:D,item:P,action:$,active:A,indented:O,disabled:z,label:G,details:J,metadata:K,itemContent:Q,indentIcon:U,expandIcon:X,expanded:Y,right:Z,actions:ee,scrollableList:te,infiniteScrollContainer:ne,hideScrollbar:ae,noPointerEvents:oe},p=({toggleNarrow:a,onClickToggleNarrow:t})=>a?e.jsx("a",{className:n.toggleNarrow,onClick:t,children:e.jsx(_,{icon:g.CHEVRON_LEFT})}):null;p.__docgenInfo={description:"",methods:[],displayName:"ToggleNarrow",props:{toggleNarrow:{required:!1,tsType:{name:"boolean"},description:""},onClickToggleNarrow:{required:!1,tsType:{name:"signature",type:"function",raw:"() => void",signature:{arguments:[],return:{name:"void"}}},description:""}}};const ie=u.forwardRef(({name:a,actions:t=[],toggleNarrow:r=!1,onToggleNarrow:o=()=>{},stickyHeader:s},d)=>e.jsxs("div",{ref:d,className:c(n.header,s?n.stickyHeader:""),children:[e.jsx(p,{toggleNarrow:r,onClickToggleNarrow:o}),a&&e.jsx("div",{className:n.headerTitle,children:e.jsx(h,{top:!0,marginBottom:0,children:a})}),e.jsx("div",{className:n.right,children:e.jsx("div",{className:n.actions,children:e.jsx(x,{actions:t})})})]}));ie.__docgenInfo={description:"",methods:[],displayName:"ListHeading",props:{actions:{defaultValue:{value:"[]",computed:!1},required:!1},toggleNarrow:{defaultValue:{value:"false",computed:!1},required:!1},onToggleNarrow:{defaultValue:{value:"() => {}",computed:!1},required:!1}}};const m=({name:a,icon:t,testId:r})=>{const o=t&&e.jsx(_,{icon:t.icon,color:t.color||"#db2828"});return e.jsxs("span",{className:c(n.name,n.bold),"data-testid":r,children:[a,t&&t.tooltip&&t.tooltip.text?e.jsx("span",{className:n.iconTooltipMargin,children:e.jsx(N,{text:t.tooltip.text,maxWidth:"350px",children:o})}):t&&t.icon&&e.jsx("span",{className:n.iconTooltipMargin,children:o})]})};m.__docgenInfo={description:"",methods:[],displayName:"Name",props:{name:{required:!0,tsType:{name:"ReactNode"},description:""},icon:{required:!1,tsType:{name:"signature",type:"object",raw:`{
|
|
2
2
|
icon: ReactNode;
|
|
3
3
|
color?: string;
|
|
4
4
|
tooltip?: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e}from"./jsx-runtime-eps93zm2.js";import{r as h}from"./index-DhsZuJvc.js";import{T as X}from"./common-types-Sih75Sav.js";import{M,D as C}from"./dialog-
|
|
1
|
+
import{j as e}from"./jsx-runtime-eps93zm2.js";import{r as h}from"./index-DhsZuJvc.js";import{T as X}from"./common-types-Sih75Sav.js";import{M,D as C}from"./dialog-lhPZkAI2.js";import{B as o}from"./button-C1sV-0mR.js";import{P as Z}from"./popover-DgUpTRMk.js";import{I as Q}from"./input-BW9trNAW.js";import{I as $}from"./input-group-BaRSJAEN.js";import{F as j}from"./field-C5_fLDpy.js";import{M as ee}from"./actions-CZK3mphC.js";import{S as oe}from"./select-tIEV7vnw.js";import{S as le}from"./spacer-BWoNR27H.js";import{T as ne}from"./tooltip-1V7clEnw.js";import{M as k}from"./types-BmbYqTX_.js";import"./index-Bk2sglWO.js";import"./portal-GQ0_cLB6.js";import"./index-CUZDtIZe.js";import"./lodash-BHd_uQHh.js";import"./heading-NkLgQYoP.js";import"./help-icon-41R-Z9N1.js";import"./icon-BP4BO6-k.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./inheritsLoose-DR8r8Ogv.js";import"./index-CEuq6vkz.js";import"./disabled-context-rmpd7YJS.js";import"./spinner-AWUe4xwQ.js";import"./types-UmZ4Y_CR.js";import"./label-hiSz3I8H.js";import"./badge-CLQ59MDF.js";import"./extends-CF3RwP-h.js";import"./assertThisInitialized-B9jnkVVz.js";import"./memoize-one.esm-CcMeOnPo.js";import"./text-B3-TSWok.js";import"./select.input-DIKP56UZ.js";const{useArgs:se}=__STORYBOOK_MODULE_PREVIEW_API__,He={title:"Modals/Modal",component:M,args:{visible:!0,centered:!0,width:"300px",heading:"Are you sure?",content:e.jsx(e.Fragment,{children:"This will complete the transaction"}),footer:e.jsxs(e.Fragment,{children:[e.jsx(o,{label:"Okay",colored:!0,onClick:()=>{}}),e.jsx(o,{label:"Cancel",onClick:()=>{}})]}),onClose:()=>{}},parameters:{docs:{story:{inline:!1,iframeHeight:400}}}},a=()=>{const[{visible:n,centered:r,...s},l]=se(),t=()=>{l({visible:!n})};return e.jsxs(e.Fragment,{children:[e.jsx(M,{visible:n,centered:r,children:e.jsx(C,{dialog:{...s,onClose:t}})}),e.jsx(o,{label:"Open Modal",onClick:t})]})},v=a.bind({}),i=a.bind({});i.args={centered:!0};const d=a.bind({});d.args={content:["This is a","new line!"]};const c=a.bind({});c.args={scroll:!0,content:e.jsx("div",{children:"Example modal content goes here lorem ipsum. ".repeat(100)})};const g=a.bind({});g.args={width:"100%",content:e.jsx("div",{children:"Example modal content goes here lorem ipsum. ".repeat(100)})};const p=a.bind({});p.args={contentPadding:0};const m=a.bind({});m.args={content:e.jsxs(e.Fragment,{children:[e.jsx(ne,{text:"Tooltip text",children:"Hover for tooltip"}),e.jsx(le,{}),e.jsx(j,{label:"Custom Select",helpText:"Select an animal",children:e.jsx(oe,{name:"example",options:["Aardvarks","Kangaroos","Monkeys","Possums","Gorilla","Puma","Patagonian Mara","Tarsier","Koala","Panda","Red Panda","Impala","Tiger","Crocodile","Bat"],onChange:()=>{},value:"Monkeys",error:"Bad value"})}),e.jsx(j,{label:"Nested Menu",children:e.jsx(ee,{maxHeight:"240px",menu:{label:"Menu",trigger:X.DROP_DOWN_BUTTON,sections:[{type:k.MENU,menu:{trigger:"Text",label:"Children",sections:[...Array(100).keys()].map(()=>({type:"Option",label:Math.random().toString(36).substring(7),onClick:()=>{}}))}},...[...Array(100).keys()].map(()=>({type:k.OPTION,label:Math.random().toString(36).substring(7),onClick:()=>{}}))]}})}),e.jsx(Z,{content:e.jsxs($,{small:!0,children:[e.jsx(Q,{value:"Value",width:"150px",error:"Bad value"}),e.jsx(o,{colored:!0,label:"Save",onClick:()=>{}}),e.jsx(o,{label:"Cancel",onClick:()=>{}})]}),children:e.jsx(o,{colored:!0,label:"Toggle me",onClick:()=>{}})})]})};const u=()=>{const[n,r]=h.useState(!1),s=()=>{r(!0)},l=()=>{r(!1)},t=()=>{console.log("Submit action"),l()};return e.jsxs(e.Fragment,{children:[e.jsx(M,{visible:n,onEnter:()=>{console.log("Enter"),t()},onEscape:()=>{console.log("Escape"),l()},children:e.jsx(C,{dialog:{heading:"Test key handling",content:e.jsx(Q,{}),footer:e.jsxs(e.Fragment,{children:[e.jsx(o,{label:"Done",colored:"red",onClick:t}),e.jsx(o,{label:"Cancel",onClick:l})]}),onClose:l}})}),e.jsx(o,{label:"Open Modal",onClick:s})]})},b=()=>{const[n,r]=h.useState(!1),s=()=>r(!n),[l,t]=h.useState(!1),x=()=>t(!l);return e.jsxs(e.Fragment,{children:[e.jsx(M,{visible:n,children:e.jsx(C,{dialog:{heading:"Modal 1",content:"Lorem ipsum dolor sit amet",footer:e.jsxs(e.Fragment,{children:[e.jsx(o,{label:"Open modal 2",colored:!0,onClick:x}),e.jsx(M,{visible:l,children:e.jsx(C,{dialog:{heading:"Modal 2",content:"Lorem ipsum dolor sit amet",footer:e.jsx(o,{label:"Close",onClick:x}),onClose:x}})}),e.jsx(o,{label:"Close",onClick:s})]}),onClose:s}})}),e.jsx(o,{label:"Open modal 1",onClick:s})]})};u.__docgenInfo={description:"",methods:[],displayName:"KeyHandle"};b.__docgenInfo={description:"",methods:[],displayName:"MultipleModals"};var f,S,P;v.parameters={...v.parameters,docs:{...(f=v.parameters)==null?void 0:f.docs,source:{originalSource:`() => {
|
|
2
2
|
const [{
|
|
3
3
|
visible,
|
|
4
4
|
centered,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as G}from"./jsx-runtime-eps93zm2.js";import{r as s}from"./index-DhsZuJvc.js";import{d as v}from"./index-
|
|
1
|
+
import{j as G}from"./jsx-runtime-eps93zm2.js";import{r as s}from"./index-DhsZuJvc.js";import{d as v}from"./index-CWz-hU-f.js";import{l as J}from"./lodash-BHd_uQHh.js";import{I as K}from"./input-BW9trNAW.js";const P=t=>t?typeof t=="string"?t:J.isArray(t)?t[0]:t.fieldName:"",Q=({name:t,placeholder:N="",disabled:q=!1,error:y=!1,left:V=!1,small:I=!1,width:h="100%",value:u="",onChange:F=()=>{},onFocus:S=()=>{},onBlur:x=()=>{},tabIndex:H=0,testId:L,tooltip:M=null,warning:R=!1,validationCallback:l=()=>{},allowEmpty:j=!1,isInTable:A,groupOrder:B,enableDisplayRounding:T=!1,roundDisplayValue:b})=>{const r=s.useRef(null),[i,f]=s.useState(u),[C,o]=s.useState(null),[c,E]=s.useState(!1),a=P(t),w=e=>{let n=v.validateNumber(e);return j&&e===""||n.valid?{...n,valid:!0,errors:void 0}:n};s.useEffect(()=>{const{valid:e,errors:n}=w(u);if(f(u),e)o(null),l(a,null);else{const m=n&&n.length?n[0]:null;o(m),l(a,m)}},[u,y]);const D=e=>{const n=e.target,{value:m}=n,d=v.cleanNumStr(m.replaceAll(" ","").replaceAll("|","")),{valid:z,errors:g}=w(d);if(z){const p={...e,target:{...e.target,value:d,name:a}};F(p),f(d),o(null),l(a,null)}else{f(d);const p=g&&g.length?g[0]:null;o(p),l(a,p)}};s.useEffect(()=>{if(r&&(r!=null&&r.current)&&T&&c){const e=r.current;e&&setTimeout(()=>{const{length:n}=String(i);e.setSelectionRange(n,n)},0)}},[c]);const O=e=>{E(!0),S(e)},_=e=>{E(!1),x(e)},k=!c&&T?b?b(i):v.roundToFixed(i,2):i;return G.jsx(K,{type:"text",name:a,testId:L,disabled:q,placeholder:N,value:k,onChange:D,onFocus:O,onBlur:_,error:y||C,warning:R,right:!V,small:I,width:h,isInTable:A,groupOrder:B,tabIndex:H,tooltip:M,ref:r},a)};Q.__docgenInfo={description:"",methods:[],displayName:"NumberInput",props:{name:{required:!1,tsType:{name:"union",raw:"string | { fieldName: string }",elements:[{name:"string"},{name:"signature",type:"object",raw:"{ fieldName: string }",signature:{properties:[{key:"fieldName",value:{name:"string",required:!0}}]}}]},description:""},placeholder:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:"''",computed:!1}},disabled:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},error:{required:!1,tsType:{name:"union",raw:"string | boolean",elements:[{name:"string"},{name:"boolean"}]},description:"",defaultValue:{value:"false",computed:!1}},left:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},small:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},width:{required:!1,tsType:{name:"union",raw:"string | number",elements:[{name:"string"},{name:"number"}]},description:"",defaultValue:{value:"'100%'",computed:!1}},value:{required:!1,tsType:{name:"union",raw:"string | number",elements:[{name:"string"},{name:"number"}]},description:"",defaultValue:{value:"''",computed:!1}},onChange:{required:!1,tsType:{name:"signature",type:"function",raw:"(evt: ChangeEvent<HTMLInputElement>) => void",signature:{arguments:[{type:{name:"ChangeEvent",elements:[{name:"HTMLInputElement"}],raw:"ChangeEvent<HTMLInputElement>"},name:"evt"}],return:{name:"void"}}},description:"",defaultValue:{value:"() => {}",computed:!1}},onFocus:{required:!1,tsType:{name:"signature",type:"function",raw:"(evt: FocusEvent<HTMLInputElement>) => void",signature:{arguments:[{type:{name:"FocusEvent",elements:[{name:"HTMLInputElement"}],raw:"FocusEvent<HTMLInputElement>"},name:"evt"}],return:{name:"void"}}},description:"",defaultValue:{value:"() => {}",computed:!1}},onBlur:{required:!1,tsType:{name:"signature",type:"function",raw:"(evt: FocusEvent<HTMLInputElement>) => void",signature:{arguments:[{type:{name:"FocusEvent",elements:[{name:"HTMLInputElement"}],raw:"FocusEvent<HTMLInputElement>"},name:"evt"}],return:{name:"void"}}},description:"",defaultValue:{value:"() => {}",computed:!1}},tabIndex:{required:!1,tsType:{name:"number"},description:"",defaultValue:{value:"0",computed:!1}},testId:{required:!1,tsType:{name:"string"},description:""},tooltip:{required:!1,tsType:{name:"union",raw:"TStringOrNumber | React.ReactNode",elements:[{name:"union",raw:"string | number",elements:[{name:"string"},{name:"number"}]},{name:"ReactReactNode",raw:"React.ReactNode"}]},description:"",defaultValue:{value:"null",computed:!1}},warning:{required:!1,tsType:{name:"union",raw:"string | boolean",elements:[{name:"string"},{name:"boolean"}]},description:"",defaultValue:{value:"false",computed:!1}},validationCallback:{required:!1,tsType:{name:"signature",type:"function",raw:`(
|
|
2
2
|
name: string | { fieldName: string },
|
|
3
3
|
error: string | null,
|
|
4
4
|
) => void`,signature:{arguments:[{type:{name:"union",raw:"string | { fieldName: string }",elements:[{name:"string"},{name:"signature",type:"object",raw:"{ fieldName: string }",signature:{properties:[{key:"fieldName",value:{name:"string",required:!0}}]}}]},name:"name"},{type:{name:"union",raw:"string | null",elements:[{name:"string"},{name:"null"}]},name:"error"}],return:{name:"void"}}},description:"",defaultValue:{value:"() => {}",computed:!1}},allowEmpty:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},isInTable:{required:!1,tsType:{name:"boolean"},description:""},groupOrder:{required:!1,tsType:{name:"any"},description:""},enableDisplayRounding:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},roundDisplayValue:{required:!1,tsType:{name:"signature",type:"function",raw:"(args: TStringNumberNull) => TStringNumberNull",signature:{arguments:[{type:{name:"union",raw:"string | number | null",elements:[{name:"string"},{name:"number"},{name:"null"}]},name:"args"}],return:{name:"union",raw:"string | number | null",elements:[{name:"string"},{name:"number"},{name:"null"}]}}},description:""}}};export{Q as N};
|
package/dist/storybook/assets/{number-input.stories-CcNTeD25.js → number-input.stories-BfRW8wgL.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as n}from"./jsx-runtime-eps93zm2.js";import{d as ne}from"./index-
|
|
1
|
+
import{j as n}from"./jsx-runtime-eps93zm2.js";import{d as ne}from"./index-CWz-hU-f.js";import{N as i}from"./number-input-uQOVHv2N.js";import{I as ae}from"./input-group-BaRSJAEN.js";import{I as re}from"./input-group-addon-D68iUKV2.js";import{S as te}from"./select-tIEV7vnw.js";import"./index-DhsZuJvc.js";import"./index-DRSy5Ssd.js";import"./lodash-BHd_uQHh.js";import"./input-BW9trNAW.js";import"./index-Bk2sglWO.js";import"./disabled-context-rmpd7YJS.js";import"./types-UmZ4Y_CR.js";import"./tooltip-1V7clEnw.js";import"./index-CUZDtIZe.js";import"./common-types-Sih75Sav.js";import"./index-CEuq6vkz.js";import"./extends-CF3RwP-h.js";import"./assertThisInitialized-B9jnkVVz.js";import"./inheritsLoose-DR8r8Ogv.js";import"./memoize-one.esm-CcMeOnPo.js";import"./types-BmbYqTX_.js";import"./text-B3-TSWok.js";import"./actions-CZK3mphC.js";import"./button-C1sV-0mR.js";import"./spinner-AWUe4xwQ.js";import"./icon-BP4BO6-k.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./badge-CLQ59MDF.js";import"./select.input-DIKP56UZ.js";const{useArgs:se}=__STORYBOOK_MODULE_PREVIEW_API__,we={title:"Forms/NumberInput",component:i,parameters:{canvas:{page:null}},args:{label:"Label"}},e=h=>{const[ue,Z]=se(),$=ee=>{Z({value:ee.target.value})};return n.jsx(i,{onChange:$,value:123,...h})},c=e.bind({}),a=e.bind({});a.args={small:!0};const r=e.bind({});r.args={width:"150px"};const t=e.bind({});t.args={left:!0};const s=e.bind({});s.args={disabled:!0};const u=e.bind({});u.args={allowEmpty:!0,value:""};const o=e.bind({});o.args={warning:"This input number is almost 100!",value:"99"};const p=e.bind({});p.args={error:"This is a error message"};const g=e.bind({});g.args={value:"123test"};const l=e.bind({});l.args={value:"123.123456789",enableDisplayRounding:!0};const m=e.bind({});m.args={value:"123.123456789",enableDisplayRounding:!0,roundDisplayValue:h=>ne.roundToFixed(h,4)};const d=()=>n.jsxs(ae,{small:!0,children:[n.jsx(i,{value:123}),n.jsx(re,{children:"to"}),n.jsx(i,{value:123}),n.jsx(te,{options:[{value:"units",label:"units"}],width:"auto",value:"units"})]});d.__docgenInfo={description:"",methods:[],displayName:"TestInputGroup"};var v,C,I;c.parameters={...c.parameters,docs:{...(v=c.parameters)==null?void 0:v.docs,source:{originalSource:`args => {
|
|
2
2
|
const [_, updateArgs] = useArgs();
|
|
3
3
|
const handleChange = (evt: ChangeEvent<HTMLInputElement>) => {
|
|
4
4
|
updateArgs({
|
|
@@ -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-CZK3mphC.js";import{c as C}from"./index-Bk2sglWO.js";import{C as D}from"./check-box-CaSrhzev.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-C1sV-0mR.js";import"./spinner-AWUe4xwQ.js";import"./icon-BP4BO6-k.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./inheritsLoose-DR8r8Ogv.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-41R-Z9N1.js";import"./text-B3-TSWok.js";const H="_menu_12x4u_1",q="_header_12x4u_11",M="_item_12x4u_27",k="_heading_12x4u_32",u={menu:H,header:q,item:M,heading:k},x=({option:e,onChange:a})=>{const{key:o,label:i,selected:t}=e;return n.jsx("div",{className:u.item,children:n.jsx(D,{label:i,noMargin:!0,checked:t,onChange:a})},o)};x.__docgenInfo={description:"",methods:[],displayName:"Option",props:{option:{required:!0,tsType:{name:"signature",type:"object",raw:`{
|
|
2
2
|
key?: string;
|
|
3
3
|
label?: string | null;
|
|
4
4
|
selected?: boolean;
|
package/dist/storybook/assets/{padding-and-spacing-BNiScrzg.js → padding-and-spacing-By28ROLj.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-tzHbUYOM.js";import"./index-DhsZuJvc.js";import"./iframe-DLWAAiXM.js";import"../sb-preview/runtime.js";import"./index-CUZDtIZe.js";import"./extends-CF3RwP-h.js";import"./assertThisInitialized-B9jnkVVz.js";import"./inheritsLoose-DR8r8Ogv.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,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-DG4ok0uF.js";import{S as c}from"./side-bar-ChOjPNLR.js";import{H as s}from"./heading-NkLgQYoP.js";import{L as D}from"./logo-BVP9045W.js";import"./index-DhsZuJvc.js";import"./index-Bk2sglWO.js";import"./icon-BP4BO6-k.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./inheritsLoose-DR8r8Ogv.js";import"./index-CEuq6vkz.js";import"./disabled-context-rmpd7YJS.js";import"./common-types-Sih75Sav.js";import"./button-C1sV-0mR.js";import"./spinner-AWUe4xwQ.js";import"./tooltip-1V7clEnw.js";import"./index-CUZDtIZe.js";import"./actions-CZK3mphC.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-DSS8yvvp.js";import"./help-icon-41R-Z9N1.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-tIEV7vnw.js";import{I}from"./input-BW9trNAW.js";import{B as p}from"./button-C1sV-0mR.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-DjIohcDx.js → pagination.stories-BzMlcLsN.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-CqvxiZHR.js";import"./common-types-Sih75Sav.js";import"./select-tIEV7vnw.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"./extends-CF3RwP-h.js";import"./assertThisInitialized-B9jnkVVz.js";import"./inheritsLoose-DR8r8Ogv.js";import"./memoize-one.esm-CcMeOnPo.js";import"./types-BmbYqTX_.js";import"./text-B3-TSWok.js";import"./actions-CZK3mphC.js";import"./button-C1sV-0mR.js";import"./spinner-AWUe4xwQ.js";import"./icon-BP4BO6-k.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:()=>{}},W={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,
|
package/dist/storybook/assets/{pop-confirm.stories-Cr_ZBbLn.js → pop-confirm.stories-MFDc3UAq.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-DgUpTRMk.js";import{B as u}from"./button-C1sV-0mR.js";import{T as I}from"./text-B3-TSWok.js";import{t as A}from"./toaster-DPbde9Mi.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-BP4BO6-k.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./inheritsLoose-DR8r8Ogv.js";import"./index-CEuq6vkz.js";import"./toaster-7wnI6hqB.js";import"./message-ttrR1AaP.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
|