@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.
Files changed (111) hide show
  1. package/dist/404.html +1 -1
  2. package/dist/assets/{index-D5kcnHmD.js → index-CbZ_B_tn.js} +54 -19
  3. package/dist/index.html +1 -1
  4. package/dist/storybook/assets/{Color-KGDBMAHA-RK4YYQs0.js → Color-KGDBMAHA-fBkbFrxl.js} +1 -1
  5. package/dist/storybook/assets/{DocsRenderer-PKQXORMH-B0ryFlHH.js → DocsRenderer-PKQXORMH-BCXpse5g.js} +1 -1
  6. package/dist/storybook/assets/{accordion.stories-DlFZNmdv.js → accordion.stories-MGPZF2zs.js} +1 -1
  7. package/dist/storybook/assets/{actions-Cu_0szZ4.js → actions-CZK3mphC.js} +1 -1
  8. package/dist/storybook/assets/{actions.stories-SCPuAp0T.js → actions.stories-FOK1cLb3.js} +1 -1
  9. package/dist/storybook/assets/{afe.stories-G3SzS3sg.js → afe.stories-Zs5w8AL0.js} +1 -1
  10. package/dist/storybook/assets/{badge.stories-DGYA6_1I.js → badge.stories-D30jHm96.js} +1 -1
  11. package/dist/storybook/assets/{blowout.stories-P0LHuXSY.js → blowout.stories-CJrNKpKP.js} +1 -1
  12. package/dist/storybook/assets/{button-_0DiND6h.js → button-C1sV-0mR.js} +1 -1
  13. package/dist/storybook/assets/{button-group-BYiHMljF.js → button-group-Ai4DXqNr.js} +1 -1
  14. package/dist/storybook/assets/{button-group.stories-Bz6NHaeB.js → button-group.stories-incmyYJ-.js} +1 -1
  15. package/dist/storybook/assets/{button.stories-vVBGddVf.js → button.stories-Bcy7mnLs.js} +1 -1
  16. package/dist/storybook/assets/{buttons-and-links-B6aQa-f5.js → buttons-and-links-DGEwyzdQ.js} +1 -1
  17. package/dist/storybook/assets/{card.stories-DIlqxO94.js → card.stories-Bn6LpucB.js} +1 -1
  18. package/dist/storybook/assets/{casing-loads.stories-0T--WlaD.js → casing-loads.stories-BZZ4ps89.js} +1 -1
  19. package/dist/storybook/assets/{cell.stories-C5Tkxyfr.js → cell.stories-DtPT5vsK.js} +1 -1
  20. package/dist/storybook/assets/{check-box-DkdQxC5c.js → check-box-CaSrhzev.js} +1 -1
  21. package/dist/storybook/assets/{check-box.stories-D8C12IQo.js → check-box.stories-J1keUUs0.js} +1 -1
  22. package/dist/storybook/assets/{chunk-HLWAVYOI-dB_9CZG8.js → chunk-HLWAVYOI-B_e8hbrU.js} +1 -1
  23. package/dist/storybook/assets/{color-BSzeqkLx.js → color-BWuYLPlh.js} +1 -1
  24. package/dist/storybook/assets/{column.stories-C1Sxwh4f.js → column.stories-JMvj3_fr.js} +1 -1
  25. package/dist/storybook/assets/{dialog-CAWCUmp3.js → dialog-lhPZkAI2.js} +1 -1
  26. package/dist/storybook/assets/{drawer-vbDFqa4U.js → drawer-DSS8yvvp.js} +1 -1
  27. package/dist/storybook/assets/{drawer.stories-CmbGsKmS.js → drawer.stories-D6FBs1_r.js} +1 -1
  28. package/dist/storybook/assets/{empty.stories-iHPKKy4z.js → empty.stories-G8jeIfLL.js} +1 -1
  29. package/dist/storybook/assets/{field-DwLk_uWj.js → field-C5_fLDpy.js} +1 -1
  30. package/dist/storybook/assets/{field.stories-s-0LQVbp.js → field.stories-D5Mej0Bt.js} +1 -1
  31. package/dist/storybook/assets/{file-button.stories-C90kcfbw.js → file-button.stories-DePr8MKB.js} +1 -1
  32. package/dist/storybook/assets/{file-input-C_2w1dKj.js → file-input-BZecnRBy.js} +1 -1
  33. package/dist/storybook/assets/{file-input.stories-BEsZox6U.js → file-input.stories-BH_glmEk.js} +1 -1
  34. package/dist/storybook/assets/{flex.stories-D-QN0gkk.js → flex.stories-sSdg0ChR.js} +1 -1
  35. package/dist/storybook/assets/{footer.stories-U_zMDmxF.js → footer.stories-CsvsDr1-.js} +1 -1
  36. package/dist/storybook/assets/{form.stories-1L75MGpX.js → form.stories-BwzDZgen.js} +1 -1
  37. package/dist/storybook/assets/{formation.stories-YHpXrXvC.js → formation.stories-2ZjWA25v.js} +1 -1
  38. package/dist/storybook/assets/{heading-DkSFysAb.js → heading-NkLgQYoP.js} +1 -1
  39. package/dist/storybook/assets/{heading.stories-Dtq7LNlB.js → heading.stories-nI_cFnAN.js} +1 -1
  40. package/dist/storybook/assets/{help-icon-LfPZiYla.js → help-icon-41R-Z9N1.js} +1 -1
  41. package/dist/storybook/assets/{help-icon.stories-Dh2ylnGq.js → help-icon.stories-DBYh0YX7.js} +1 -1
  42. package/dist/storybook/assets/{iframe-CNFcCVDc.js → iframe-DLWAAiXM.js} +2 -2
  43. package/dist/storybook/assets/{index-BIwFZkUc.js → index-BrCAgVdx.js} +1 -1
  44. package/dist/storybook/assets/{index-DQs5XS8h.js → index-CWz-hU-f.js} +5 -5
  45. package/dist/storybook/assets/{index-ccPuy0l1.js → index-tzHbUYOM.js} +4 -4
  46. package/dist/storybook/assets/{input-D97ganXq.js → input-BW9trNAW.js} +1 -1
  47. package/dist/storybook/assets/{input-group.stories-BcoORZ9x.js → input-group.stories-D1i3gaZ1.js} +1 -1
  48. package/dist/storybook/assets/{input-validation-CLVu4gtl.js → input-validation-BcgNUeij.js} +1 -1
  49. package/dist/storybook/assets/{input.stories-BHdUwYqV.js → input.stories-BruLeJ44.js} +1 -1
  50. package/dist/storybook/assets/{inputs-qWlLPYX_.js → inputs-gN3bum_f.js} +1 -1
  51. package/dist/storybook/assets/{label-tWjEmTQJ.js → label-hiSz3I8H.js} +1 -1
  52. package/dist/storybook/assets/{label.stories-BTA8N7tD.js → label.stories-Cyv5jBAO.js} +1 -1
  53. package/dist/storybook/assets/{layout-forms-p4s8eHw6.js → layout-forms-DXG6Da8u.js} +1 -1
  54. package/dist/storybook/assets/{layout-general-Dn1nlXYw.js → layout-general-CEpJsTnH.js} +1 -1
  55. package/dist/storybook/assets/{list-BpVed6Pw.js → list-DYNKqvUR.js} +1 -1
  56. package/dist/storybook/assets/{list.stories-CiT9J_FH.js → list.stories-BX67BegD.js} +1 -1
  57. package/dist/storybook/assets/{list.stories-data-CnVYk3eo.js → list.stories-data-D_ZfzaxE.js} +1 -1
  58. package/dist/storybook/assets/{loader.stories-BKBFctQ1.js → loader.stories-DjrwwZ15.js} +1 -1
  59. package/dist/storybook/assets/{menu.stories-Bp8L83xx.js → menu.stories-BE0AzXUY.js} +1 -1
  60. package/dist/storybook/assets/{message.stories-C8YRT7nL.js → message.stories-o5jcKCK_.js} +1 -1
  61. package/dist/storybook/assets/{meta-content-Djgg-tiF.js → meta-content-BE7pulye.js} +1 -1
  62. package/dist/storybook/assets/{modal.stories-BoVj2EsX.js → modal.stories-Ns1ikKLR.js} +1 -1
  63. package/dist/storybook/assets/{number-input-B-Nmya5O.js → number-input-uQOVHv2N.js} +1 -1
  64. package/dist/storybook/assets/{number-input.stories-CcNTeD25.js → number-input.stories-BfRW8wgL.js} +1 -1
  65. package/dist/storybook/assets/{option-dropdown.stories-COGmMWEl.js → option-dropdown.stories-ByLG631x.js} +1 -1
  66. package/dist/storybook/assets/{padding-and-spacing-BNiScrzg.js → padding-and-spacing-By28ROLj.js} +1 -1
  67. package/dist/storybook/assets/{page.stories-BB3g1zwB.js → page.stories-br9ia4zp.js} +1 -1
  68. package/dist/storybook/assets/{pagination-DSQeMPG_.js → pagination-CqvxiZHR.js} +1 -1
  69. package/dist/storybook/assets/{pagination.stories-DjIohcDx.js → pagination.stories-BzMlcLsN.js} +1 -1
  70. package/dist/storybook/assets/{pop-confirm.stories-Cr_ZBbLn.js → pop-confirm.stories-MFDc3UAq.js} +1 -1
  71. package/dist/storybook/assets/popover-DgUpTRMk.js +1 -0
  72. package/dist/storybook/assets/{popover.stories-CoWCb2Mn.js → popover.stories-CPW_LGAh.js} +1 -1
  73. package/dist/storybook/assets/{preview-DhMlVLsE.js → preview-CO5-Yrmk.js} +1 -1
  74. package/dist/storybook/assets/{preview-CZPuAPNr.js → preview-eMMARKcW.js} +2 -2
  75. package/dist/storybook/assets/{projects.stories-BesbPJ8Z.js → projects.stories-BSAMs8RG.js} +1 -1
  76. package/dist/storybook/assets/{radio-button-BD7pi0ao.js → radio-button-C_cV5TWA.js} +1 -1
  77. package/dist/storybook/assets/{radio-button.stories-B84Ip3NV.js → radio-button.stories-D7uvMLbK.js} +1 -1
  78. package/dist/storybook/assets/{reservoirs.stories-kxVBoa7Y.js → reservoirs.stories-Cql_9W4F.js} +1 -1
  79. package/dist/storybook/assets/{rich-text-input.stories-C5pcIbSa.js → rich-text-input.stories-BuDUgUsz.js} +1 -1
  80. package/dist/storybook/assets/{row.stories-ATsrjumb.js → row.stories-C-bEP9pE.js} +1 -1
  81. package/dist/storybook/assets/{select-78sreKsp.js → select-tIEV7vnw.js} +1 -1
  82. package/dist/storybook/assets/{select.stories-CZwsHVDB.js → select.stories-BuW6SmRZ.js} +1 -1
  83. package/dist/storybook/assets/{side-bar-WsK6pkmj.js → side-bar-ChOjPNLR.js} +1 -1
  84. package/dist/storybook/assets/{side-bar.stories-Bu2q_b_w.js → side-bar.stories-BupidZk5.js} +1 -1
  85. package/dist/storybook/assets/{site.stories-Yh4uNi3Q.js → site.stories-C1GnbK5P.js} +1 -1
  86. package/dist/storybook/assets/{slider-CxVlS0fh.js → slider-gZmYlxxz.js} +1 -1
  87. package/dist/storybook/assets/{slider.stories-_wS70xsm.js → slider.stories-CY4GxD4Y.js} +1 -1
  88. package/dist/storybook/assets/{smart-upload-modal.stories-DDlO9y2j.js → smart-upload-modal.stories-DGIErcSu.js} +1 -1
  89. package/dist/storybook/assets/{spacer.stories-B3LrTr7b.js → spacer.stories-D7Q45uBk.js} +1 -1
  90. package/dist/storybook/assets/{table-DPvzYjoq.js → table-CXUwJOBt.js} +1 -1
  91. package/dist/storybook/assets/{table.stories-BGQ1O9nw.js → table.stories-Cp0UIPUQ.js} +1 -1
  92. package/dist/storybook/assets/{table.stories-data-2STKbgzG.js → table.stories-data-DwfKQW7P.js} +1 -1
  93. package/dist/storybook/assets/{textarea-DOJDK8hI.js → textarea-BV7xWEdt.js} +1 -1
  94. package/dist/storybook/assets/{textarea.stories-CKm5MlQF.js → textarea.stories-aRLEoDHg.js} +1 -1
  95. package/dist/storybook/assets/{title.stories-CVRTXggL.js → title.stories-hn5F8-2J.js} +1 -1
  96. package/dist/storybook/assets/{toaster.stories-DfbfDavp.js → toaster.stories-DtRx7MDa.js} +1 -1
  97. package/dist/storybook/assets/{toggle-t1iTuSL7.js → toggle-Bo-JPbUP.js} +1 -1
  98. package/dist/storybook/assets/{toggle.stories-D44S3Nix.js → toggle.stories-CBkCAQh6.js} +1 -1
  99. package/dist/storybook/assets/{tooltip-C_E_6ym5.js → tooltip-1V7clEnw.js} +1 -1
  100. package/dist/storybook/assets/{tooltip.stories-C70ADjjJ.js → tooltip.stories-1YexWg6N.js} +1 -1
  101. package/dist/storybook/assets/{tooltip.test-case.stories-BtrJUImB.js → tooltip.test-case.stories-C74mKGrI.js} +1 -1
  102. package/dist/storybook/assets/{top-bar-R-CjhJ21.js → top-bar-DG4ok0uF.js} +1 -1
  103. package/dist/storybook/assets/{top-bar.stories-BYN9rcUw.js → top-bar.stories-BI4a_ekv.js} +1 -1
  104. package/dist/storybook/assets/{top-bar.testcase.stories-ZPaSRyIh.js → top-bar.testcase.stories-DzsYUZIx.js} +1 -1
  105. package/dist/storybook/assets/{tree.stories-Ghxps-dL.js → tree.stories-RtuZpYXn.js} +1 -1
  106. package/dist/storybook/assets/{unit-input.stories-Bqt0CdF7.js → unit-input.stories-DGvDLll8.js} +1 -1
  107. package/dist/storybook/assets/{unit-table.stories-DXies3fA.js → unit-table.stories-D0q58B-1.js} +1 -1
  108. package/dist/storybook/iframe.html +1 -1
  109. package/dist/storybook/project.json +1 -1
  110. package/package.json +3 -3
  111. package/dist/storybook/assets/popover-Dq3iC_lM.js +0 -1
@@ -1,4 +1,4 @@
1
- import{j as e}from"./jsx-runtime-eps93zm2.js";import{r as i}from"./index-DhsZuJvc.js";import{B as h}from"./button-_0DiND6h.js";import{u as Q,M as z,D as G}from"./dialog-CAWCUmp3.js";import{F as J}from"./file-input-C_2w1dKj.js";import{S}from"./spacer-BWoNR27H.js";import{T as W}from"./text-B3-TSWok.js";import{P as X}from"./progress-bar-C_kV6r0Q.js";import{d as Y}from"./index-DQs5XS8h.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"./tooltip-C_E_6ym5.js";import"./index-CUZDtIZe.js";import"./portal-GQ0_cLB6.js";import"./lodash-BHd_uQHh.js";import"./heading-DkSFysAb.js";import"./help-icon-LfPZiYla.js";import"./input-group-BaRSJAEN.js";import"./input-D97ganXq.js";import"./types-UmZ4Y_CR.js";import"./index-DRSy5Ssd.js";const U=250,g=4e4,b=20,I=500,M=({visible:s,prompt:p,onCloseModal:f,onUpload:m,onComplete:y,onFailed:n,onError:a,width:F,heading:_,dialogText:E,fileInputText:k,fileInputPlaceholder:N,uploadText:V,cancelText:B,testId:d})=>{const[c,v]=i.useState(null),[C,u]=i.useState(!1),[P,T]=i.useState(0);let o=0;const R=()=>{o=o+U,T(o)},A=t=>{let r=o+t;r>=.99*g&&(r=g),o=r,T(o)};i.useEffect(()=>{v(null)},[s]);const L=t=>{t.target.value&&v(t.target.value)},H=async()=>{T(0);const t=setInterval(R,U);try{if(!c)return;u(!0);const r=await m(p,c);if(!s)return;if(r){clearInterval(t);const K=setInterval(A,I/b,(g-o)/(b-1));setTimeout(()=>{y(r),clearInterval(K),u(!1)},I)}else n==null||n(),u(!1)}catch(r){a==null||a(r),u(!1)}finally{clearInterval(t)}},O=()=>{H()},x=()=>{f()},$=e.jsxs(e.Fragment,{children:[e.jsx(W,{children:E||"Upload file and extract data using a LLM"}),e.jsx(S,{}),e.jsx(J,{placeholder:N||"No file",label:k||"Select",file:c||void 0,onChange:L,testId:`${d}-file-input`,accept:"image/*"}),C&&e.jsxs(e.Fragment,{children:[e.jsx(S,{}),e.jsx(X,{percentage:Y.roundByMagnitudeToFixed(100*P/g,3)})]})]}),D=e.jsxs(e.Fragment,{children:[e.jsx(h,{label:V||"Upload",colored:!0,onClick:O,disabled:!c||C,testId:`${d}-button-upload`}),e.jsx(h,{label:B||"Cancel",onClick:x,testId:`${d}-button-cancel`})]});return Q("Escape",()=>x()),e.jsx(z,{visible:s,centered:!0,children:e.jsx(G,{dialog:{scroll:!0,heading:_||"Smart Upload",content:$,footer:D,onClose:x,width:F||350,testId:d}})})};M.__docgenInfo={description:"",methods:[],displayName:"SmartUploadModal",props:{visible:{required:!0,tsType:{name:"boolean"},description:""},prompt:{required:!0,tsType:{name:"string"},description:""},onCloseModal:{required:!0,tsType:{name:"signature",type:"function",raw:"() => void",signature:{arguments:[],return:{name:"void"}}},description:""},onUpload:{required:!0,tsType:{name:"signature",type:"function",raw:"(prompt: string, file: File) => any",signature:{arguments:[{type:{name:"string"},name:"prompt"},{type:{name:"File"},name:"file"}],return:{name:"any"}}},description:""},onComplete:{required:!0,tsType:{name:"signature",type:"function",raw:"(data: { [key: string]: string }[]) => void",signature:{arguments:[{type:{name:"Array",elements:[{name:"signature",type:"object",raw:"{ [key: string]: string }",signature:{properties:[{key:{name:"string"},value:{name:"string",required:!0}}]}}],raw:"{ [key: string]: string }[]"},name:"data"}],return:{name:"void"}}},description:""},onFailed:{required:!1,tsType:{name:"signature",type:"function",raw:"() => void",signature:{arguments:[],return:{name:"void"}}},description:""},onError:{required:!1,tsType:{name:"signature",type:"function",raw:"(error: any) => void",signature:{arguments:[{type:{name:"any"},name:"error"}],return:{name:"void"}}},description:""},width:{required:!1,tsType:{name:"number"},description:""},heading:{required:!1,tsType:{name:"string"},description:""},dialogText:{required:!1,tsType:{name:"string"},description:""},fileInputText:{required:!1,tsType:{name:"string"},description:""},fileInputPlaceholder:{required:!1,tsType:{name:"string"},description:""},uploadText:{required:!1,tsType:{name:"string"},description:""},cancelText:{required:!1,tsType:{name:"string"},description:""},testId:{required:!1,tsType:{name:"string"},description:""}}};const Ie={title:"Ai/SmartUploadModal",component:M,args:{visible:!0,prompt:"This is a prompt",onCloseModal:()=>{},onUpload:()=>{},onComplete:()=>{}},parameters:{docs:{story:{inline:!1,iframeHeight:400}}}},l=()=>{const[s,p]=i.useState(!0),f=()=>{p(!0)},m=()=>{p(!1)},y=()=>(console.log("Uploading"),new Promise(a=>{setTimeout(()=>{a([])},4e3)})),n=()=>{console.log("Completed"),m()};return e.jsxs(e.Fragment,{children:[e.jsx(M,{visible:s,prompt:"This is a prompt",onCloseModal:m,onUpload:y,onComplete:n}),e.jsx(h,{label:"Open Modal",onClick:f})]})};l.__docgenInfo={description:"",methods:[],displayName:"SmartUpload"};var j,q,w;l.parameters={...l.parameters,docs:{...(j=l.parameters)==null?void 0:j.docs,source:{originalSource:`() => {
1
+ import{j as e}from"./jsx-runtime-eps93zm2.js";import{r as i}from"./index-DhsZuJvc.js";import{B as h}from"./button-C1sV-0mR.js";import{u as Q,M as z,D as G}from"./dialog-lhPZkAI2.js";import{F as J}from"./file-input-BZecnRBy.js";import{S}from"./spacer-BWoNR27H.js";import{T as W}from"./text-B3-TSWok.js";import{P as X}from"./progress-bar-C_kV6r0Q.js";import{d as Y}from"./index-CWz-hU-f.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"./tooltip-1V7clEnw.js";import"./index-CUZDtIZe.js";import"./portal-GQ0_cLB6.js";import"./lodash-BHd_uQHh.js";import"./heading-NkLgQYoP.js";import"./help-icon-41R-Z9N1.js";import"./input-group-BaRSJAEN.js";import"./input-BW9trNAW.js";import"./types-UmZ4Y_CR.js";import"./index-DRSy5Ssd.js";const U=250,g=4e4,b=20,I=500,M=({visible:s,prompt:p,onCloseModal:f,onUpload:m,onComplete:y,onFailed:n,onError:a,width:F,heading:_,dialogText:E,fileInputText:k,fileInputPlaceholder:N,uploadText:V,cancelText:B,testId:d})=>{const[c,v]=i.useState(null),[C,u]=i.useState(!1),[P,T]=i.useState(0);let o=0;const R=()=>{o=o+U,T(o)},A=t=>{let r=o+t;r>=.99*g&&(r=g),o=r,T(o)};i.useEffect(()=>{v(null)},[s]);const L=t=>{t.target.value&&v(t.target.value)},H=async()=>{T(0);const t=setInterval(R,U);try{if(!c)return;u(!0);const r=await m(p,c);if(!s)return;if(r){clearInterval(t);const K=setInterval(A,I/b,(g-o)/(b-1));setTimeout(()=>{y(r),clearInterval(K),u(!1)},I)}else n==null||n(),u(!1)}catch(r){a==null||a(r),u(!1)}finally{clearInterval(t)}},O=()=>{H()},x=()=>{f()},$=e.jsxs(e.Fragment,{children:[e.jsx(W,{children:E||"Upload file and extract data using a LLM"}),e.jsx(S,{}),e.jsx(J,{placeholder:N||"No file",label:k||"Select",file:c||void 0,onChange:L,testId:`${d}-file-input`,accept:"image/*"}),C&&e.jsxs(e.Fragment,{children:[e.jsx(S,{}),e.jsx(X,{percentage:Y.roundByMagnitudeToFixed(100*P/g,3)})]})]}),D=e.jsxs(e.Fragment,{children:[e.jsx(h,{label:V||"Upload",colored:!0,onClick:O,disabled:!c||C,testId:`${d}-button-upload`}),e.jsx(h,{label:B||"Cancel",onClick:x,testId:`${d}-button-cancel`})]});return Q("Escape",()=>x()),e.jsx(z,{visible:s,centered:!0,children:e.jsx(G,{dialog:{scroll:!0,heading:_||"Smart Upload",content:$,footer:D,onClose:x,width:F||350,testId:d}})})};M.__docgenInfo={description:"",methods:[],displayName:"SmartUploadModal",props:{visible:{required:!0,tsType:{name:"boolean"},description:""},prompt:{required:!0,tsType:{name:"string"},description:""},onCloseModal:{required:!0,tsType:{name:"signature",type:"function",raw:"() => void",signature:{arguments:[],return:{name:"void"}}},description:""},onUpload:{required:!0,tsType:{name:"signature",type:"function",raw:"(prompt: string, file: File) => any",signature:{arguments:[{type:{name:"string"},name:"prompt"},{type:{name:"File"},name:"file"}],return:{name:"any"}}},description:""},onComplete:{required:!0,tsType:{name:"signature",type:"function",raw:"(data: { [key: string]: string }[]) => void",signature:{arguments:[{type:{name:"Array",elements:[{name:"signature",type:"object",raw:"{ [key: string]: string }",signature:{properties:[{key:{name:"string"},value:{name:"string",required:!0}}]}}],raw:"{ [key: string]: string }[]"},name:"data"}],return:{name:"void"}}},description:""},onFailed:{required:!1,tsType:{name:"signature",type:"function",raw:"() => void",signature:{arguments:[],return:{name:"void"}}},description:""},onError:{required:!1,tsType:{name:"signature",type:"function",raw:"(error: any) => void",signature:{arguments:[{type:{name:"any"},name:"error"}],return:{name:"void"}}},description:""},width:{required:!1,tsType:{name:"number"},description:""},heading:{required:!1,tsType:{name:"string"},description:""},dialogText:{required:!1,tsType:{name:"string"},description:""},fileInputText:{required:!1,tsType:{name:"string"},description:""},fileInputPlaceholder:{required:!1,tsType:{name:"string"},description:""},uploadText:{required:!1,tsType:{name:"string"},description:""},cancelText:{required:!1,tsType:{name:"string"},description:""},testId:{required:!1,tsType:{name:"string"},description:""}}};const Ie={title:"Ai/SmartUploadModal",component:M,args:{visible:!0,prompt:"This is a prompt",onCloseModal:()=>{},onUpload:()=>{},onComplete:()=>{}},parameters:{docs:{story:{inline:!1,iframeHeight:400}}}},l=()=>{const[s,p]=i.useState(!0),f=()=>{p(!0)},m=()=>{p(!1)},y=()=>(console.log("Uploading"),new Promise(a=>{setTimeout(()=>{a([])},4e3)})),n=()=>{console.log("Completed"),m()};return e.jsxs(e.Fragment,{children:[e.jsx(M,{visible:s,prompt:"This is a prompt",onCloseModal:m,onUpload:y,onComplete:n}),e.jsx(h,{label:"Open Modal",onClick:f})]})};l.__docgenInfo={description:"",methods:[],displayName:"SmartUpload"};var j,q,w;l.parameters={...l.parameters,docs:{...(j=l.parameters)==null?void 0:j.docs,source:{originalSource:`() => {
2
2
  const [visible, setVisible] = useState(true);
3
3
  const openModal = () => {
4
4
  setVisible(true);
@@ -1 +1 @@
1
- import{j as r}from"./jsx-runtime-eps93zm2.js";import{S as h}from"./spacer-BWoNR27H.js";import{F as j}from"./flex-EllkLxgO.js";import{B as s}from"./button-_0DiND6h.js";import"./index-DhsZuJvc.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"./tooltip-C_E_6ym5.js";import"./index-CUZDtIZe.js";const W={title:"Layout/Spacer",component:h,argTypes:{width:{control:"text"},height:{control:"text"}}},p=t=>r.jsx(h,{...t}),a=p.bind({});a.decorators=[t=>r.jsxs(r.Fragment,{children:[r.jsx(s,{label:"Button"}),t(),r.jsx(s,{label:"Button"})]})];const e=p.bind({});e.args={height:"var(--padding-xxs)"};e.decorators=[t=>r.jsxs(r.Fragment,{children:[r.jsx(s,{label:"Button"}),t(),r.jsx(s,{label:"Button"})]})];const o=p.bind({});o.args={width:"var(--padding)"};o.decorators=[t=>r.jsxs(j,{children:[r.jsx(s,{label:"Button"}),t(),r.jsx(s,{label:"Button"})]})];var c,i,m;a.parameters={...a.parameters,docs:{...(c=a.parameters)==null?void 0:c.docs,source:{originalSource:"(args: ISpacerProps) => <Spacer {...args} />",...(m=(i=a.parameters)==null?void 0:i.docs)==null?void 0:m.source}}};var n,d,l;e.parameters={...e.parameters,docs:{...(n=e.parameters)==null?void 0:n.docs,source:{originalSource:"(args: ISpacerProps) => <Spacer {...args} />",...(l=(d=e.parameters)==null?void 0:d.docs)==null?void 0:l.source}}};var u,g,x;o.parameters={...o.parameters,docs:{...(u=o.parameters)==null?void 0:u.docs,source:{originalSource:"(args: ISpacerProps) => <Spacer {...args} />",...(x=(g=o.parameters)==null?void 0:g.docs)==null?void 0:x.source}}};const L=["Default","Height","Width"];export{a as Default,e as Height,o as Width,L as __namedExportsOrder,W as default};
1
+ import{j as r}from"./jsx-runtime-eps93zm2.js";import{S as h}from"./spacer-BWoNR27H.js";import{F as j}from"./flex-EllkLxgO.js";import{B as s}from"./button-C1sV-0mR.js";import"./index-DhsZuJvc.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"./tooltip-1V7clEnw.js";import"./index-CUZDtIZe.js";const W={title:"Layout/Spacer",component:h,argTypes:{width:{control:"text"},height:{control:"text"}}},p=t=>r.jsx(h,{...t}),a=p.bind({});a.decorators=[t=>r.jsxs(r.Fragment,{children:[r.jsx(s,{label:"Button"}),t(),r.jsx(s,{label:"Button"})]})];const e=p.bind({});e.args={height:"var(--padding-xxs)"};e.decorators=[t=>r.jsxs(r.Fragment,{children:[r.jsx(s,{label:"Button"}),t(),r.jsx(s,{label:"Button"})]})];const o=p.bind({});o.args={width:"var(--padding)"};o.decorators=[t=>r.jsxs(j,{children:[r.jsx(s,{label:"Button"}),t(),r.jsx(s,{label:"Button"})]})];var c,i,m;a.parameters={...a.parameters,docs:{...(c=a.parameters)==null?void 0:c.docs,source:{originalSource:"(args: ISpacerProps) => <Spacer {...args} />",...(m=(i=a.parameters)==null?void 0:i.docs)==null?void 0:m.source}}};var n,d,l;e.parameters={...e.parameters,docs:{...(n=e.parameters)==null?void 0:n.docs,source:{originalSource:"(args: ISpacerProps) => <Spacer {...args} />",...(l=(d=e.parameters)==null?void 0:d.docs)==null?void 0:l.source}}};var u,g,x;o.parameters={...o.parameters,docs:{...(u=o.parameters)==null?void 0:u.docs,source:{originalSource:"(args: ISpacerProps) => <Spacer {...args} />",...(x=(g=o.parameters)==null?void 0:g.docs)==null?void 0:x.source}}};const L=["Default","Height","Width"];export{a as Default,e as Height,o as Width,L as __namedExportsOrder,W as default};
@@ -1,4 +1,4 @@
1
- import{j as n}from"./jsx-runtime-eps93zm2.js";import{r as S}from"./index-DhsZuJvc.js";import{c as v}from"./index-Bk2sglWO.js";import{I as Le,D as We,C as Fe,P as Pe}from"./index.es-D2piFfFj.js";import{l as De}from"./lodash-BHd_uQHh.js";import{A as ae}from"./actions-Cu_0szZ4.js";import{H as Oe}from"./heading-DkSFysAb.js";import{P as Be}from"./pagination-DSQeMPG_.js";import{A as f,I as $}from"./common-types-Sih75Sav.js";import{I as $e}from"./input-D97ganXq.js";import{N as Me}from"./number-input-B-Nmya5O.js";import{S as Ge}from"./select-78sreKsp.js";import{D as Ve}from"./disabled-context-rmpd7YJS.js";import{i as M}from"./types-UmZ4Y_CR.js";import{T as oe}from"./tooltip-C_E_6ym5.js";import{C as Ue}from"./check-box-DkdQxC5c.js";import{S as ze}from"./slider-CxVlS0fh.js";import{I as G}from"./icon-BP4BO6-k.js";import{P as Ke}from"./popover-Dq3iC_lM.js";import{H as fe}from"./help-icon-LfPZiYla.js";import{T as Y}from"./text-B3-TSWok.js";const Xe="_inputInTable_y9car_1",Ye="_inputHover_y9car_13",Je="_inputFocus_y9car_18",Qe="_inputError_y9car_25",Ze="_inputWarning_y9car_26",en="_inputDisabled_y9car_61",nn="_hideScrollbars_y9car_67",tn="_wrapper_y9car_85",rn="_bordered_y9car_93",an="_scroll_y9car_98",on="_table_y9car_108",sn="_striped_y9car_188",L={inputInTable:Xe,inputHover:Ye,inputFocus:Je,inputError:Qe,inputWarning:Ze,inputDisabled:en,hideScrollbars:nn,wrapper:tn,bordered:rn,scroll:an,table:on,striped:sn},ln="_title_zn5s7_1",dn={title:ln},Q=({name:e=null,actions:t=null,actionsRight:r=!1,testId:o})=>{const a=e!==null,i=t!==null;if(!a&&!i)return null;const l=()=>{if(!i)return null;const c=n.jsx(ae,{actions:t});return r?c:n.jsx("div",{children:c})};return n.jsxs("div",{className:dn.title,children:[a?n.jsx(Oe,{children:n.jsx("span",{"data-testid":o,children:e})}):null,l()]})};Q.__docgenInfo={description:"",methods:[],displayName:"Title",props:{name:{required:!1,tsType:{name:"union",raw:"TStringOrNumber | ReactNode",elements:[{name:"union",raw:"string | number",elements:[{name:"string"},{name:"number"}]},{name:"ReactNode"}]},description:"",defaultValue:{value:"null",computed:!1}},actions:{required:!1,tsType:{name:"any"},description:"",defaultValue:{value:"null",computed:!1}},actionsRight:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},testId:{required:!1,tsType:{name:"string"},description:""}}};const un="_footer_4sumy_1",cn="_section_4sumy_7",J={footer:un,section:cn},Z=({colSpan:e,pagination:t,actions:r,content:o})=>{const a=r&&r.length,i=o!=null,l=()=>{var d,p;if(t){const{rowCount:u,rowsPerPage:I}=t,y=Number((p=(d=I==null?void 0:I.options)==null?void 0:d[0])==null?void 0:p.value);return u>y}return!1};return a||i||l()?n.jsxs("div",{className:J.footer,children:[i?n.jsx("div",{className:J.section,children:n.jsx("div",{children:o})}):null,a||l()?n.jsxs("div",{className:J.section,children:[l()?n.jsx(Be,{pagination:t}):n.jsx("div",{}),a&&n.jsx("div",{children:n.jsx(ae,{actions:r})})]}):null]}):null};Z.__docgenInfo={description:"",methods:[],displayName:"Footer",props:{colSpan:{required:!1,tsType:{name:"number"},description:""},pagination:{required:!0,tsType:{name:"IPagination"},description:""},actions:{required:!1,tsType:{name:"Array",elements:[{name:"IAction"}],raw:"IAction[]"},description:""},content:{required:!1,tsType:{name:"ReactNode"},description:""}}};const Ce=e=>{const t=Math.max(...e.reduce((r,o)=>{const a=o.cells.map(i=>i.colSpan?i.colSpan:1).reduce((i,l)=>i+l,0);return r.concat(a)},[]));return isNaN(t)?0:t},pn=(e,t)=>{const r=[Ce(t),Ce(e)];return Math.max(...r)},be=e=>e.reduce((t,r)=>r.actions&&r.actions.length>0?1:t,0),mn=(e,t)=>be(t)>0||be(e)>0,ee=({table:e,children:t})=>{const{rows:r,infiniteScroll:o}=e,a=Math.ceil(window.innerHeight/30),[i,l]=o?S.useState(a):[r.length,null],[c,d]=o?S.useState(i<r.length):[!1,null],p=()=>{if(i>=r.length&&d){d(!1);return}l&&l(i+a)};return n.jsx("div",{id:"scrollWrapper",className:L.scroll,children:o?n.jsx(Le,{dataLength:Math.min(r.length,i+a),next:p,hasMore:c,scrollableTarget:"scrollWrapper",style:{overflow:"initial"},loader:null,children:t({visibleRows:i})}):t({visibleRows:i})})};ee.__docgenInfo={description:"",methods:[],displayName:"TableScrollWrapper",props:{table:{required:!0,tsType:{name:"ITableProps"},description:""},children:{required:!0,tsType:{name:"signature",type:"function",raw:"(props: { visibleRows: number }) => ReactNode",signature:{arguments:[{type:{name:"signature",type:"object",raw:"{ visibleRows: number }",signature:{properties:[{key:"visibleRows",value:{name:"number",required:!0}}]}},name:"props"}],return:{name:"ReactNode"}}},description:""}}};const gn="_clickableRow_1ki29_1",yn="_hoverableRow_1ki29_4",In="_rowActive_1ki29_4",Cn="_expandableRow_1ki29_8",bn="_flush_1ki29_8",hn="_errorRow_1ki29_12",fn="_warningRow_1ki29_15",_n="_dragIconCell_1ki29_34",xn="_dragIcon_1ki29_34",h={clickableRow:gn,hoverableRow:yn,rowActive:In,expandableRow:Cn,flush:bn,errorRow:hn,warningRow:fn,dragIconCell:_n,dragIcon:xn},ne=({colSpan:e,children:t,flush:r})=>n.jsx("tr",{children:n.jsx("td",{colSpan:e,className:v(h.expandableRow,r?h.flush:""),children:t})});ne.__docgenInfo={description:"",methods:[],displayName:"ExpandedContentRow",props:{colSpan:{required:!0,tsType:{name:"number"},description:""},children:{required:!0,tsType:{name:"ReactNode"},description:""},flush:{required:!1,tsType:{name:"boolean"},description:""}}};const he=(e,t={leftAligned:"",rightAligned:"",centerAligned:""},r=!1)=>{if(!e)return null;const{bodyAlignment:o,headerAlignment:a,isHeader:i}=e;switch(i&&a?a:o){case f.LEFT:return r?f.LEFT:t.leftAligned;case f.RIGHT:return r?f.RIGHT:t.rightAligned;case f.CENTER:return r?f.CENTER:t.centerAligned;default:return r?f.LEFT:t.leftAligned}},wn=(e,t=!1,r=0)=>{if(!e||e.length===0)return[];const o=e.every(i=>Array.isArray(i)),a=e.every(i=>typeof i=="string");return o&&t?e[r]||[]:a?e:(console.warn("getHeaderAlignment: alignments array contains a mix of strings and arrays, returning an empty array."),[])},Tn="_inputInTable_u3xdj_1",vn="_inputHover_u3xdj_13",jn="_inputFocus_u3xdj_18",An="_inputError_u3xdj_25",Rn="_inputWarning_u3xdj_26",kn="_inputDisabled_u3xdj_61",qn="_hideScrollbars_u3xdj_67",Nn="_cell_u3xdj_77",Sn="_disabledLink_u3xdj_87",En="_inputWrapper_u3xdj_91",Hn="_breakWord_u3xdj_106",Ln="_inputCell_u3xdj_109",Wn="_sliderCell_u3xdj_112",Fn="_staticCell_u3xdj_116",Pn="_staticCellContent_u3xdj_119",Dn="_error_u3xdj_131",On="_warning_u3xdj_132",Bn="_unit_u3xdj_141",$n="_sortingCell_u3xdj_144",Mn="_sortingCellIcon_u3xdj_155",Gn="_icon_u3xdj_166",Vn="_checkBoxCell_u3xdj_170",Un="_iconCellWrapper_u3xdj_174",zn="_actionsCell_u3xdj_178",Kn="_rightAligned_u3xdj_186",Xn="_centerAligned_u3xdj_192",Yn="_leftAligned_u3xdj_198",Jn="_popover_u3xdj_201",Qn="_disabledPointerEvents_u3xdj_204",s={inputInTable:Tn,inputHover:vn,inputFocus:jn,inputError:An,inputWarning:Rn,inputDisabled:kn,hideScrollbars:qn,cell:Nn,disabledLink:Sn,inputWrapper:En,breakWord:Hn,inputCell:Ln,sliderCell:Wn,staticCell:Fn,staticCellContent:Pn,error:Dn,warning:On,unit:Bn,sortingCell:$n,sortingCellIcon:Mn,icon:Gn,checkBoxCell:Vn,iconCellWrapper:Un,actionsCell:zn,rightAligned:Kn,centerAligned:Xn,leftAligned:Yn,popover:Jn,disabledPointerEvents:Qn},te=({cell:e,columnAlignment:t,testId:r,type:o})=>n.jsx($e,{name:e.name,value:e.value,onChange:a=>{var i;return(i=e.onChange)==null?void 0:i.call(e,a)},onFocus:e.onFocus,onBlur:e.onBlur,onPaste:a=>{var i;return(i=e.onPaste)==null?void 0:i.call(e,a)},placeholder:e.placeholder,error:e.error,warning:e.warning,disabled:e.disabled,isInTable:!0,maxTooltipWidth:e.maxTooltipWidth,right:t===f.RIGHT,testId:r,tabIndex:e.disabled?-1:0,tooltip:e.tooltip,type:o});te.__docgenInfo={description:"",methods:[],displayName:"InputCell",props:{cell:{required:!0,tsType:{name:"IInputCell"},description:""},columnAlignment:{required:!1,tsType:{name:"union",raw:"Align.LEFT | Align.RIGHT | string",elements:[{name:"Align.LEFT"},{name:"Align.RIGHT"},{name:"string"}]},description:""},testId:{required:!1,tsType:{name:"string"},description:""},type:{required:!1,tsType:{name:"union",raw:"'text' | 'date'",elements:[{name:"literal",value:"'text'"},{name:"literal",value:"'date'"}]},description:""}}};const _e=({cell:e,testId:t})=>n.jsx(Me,{name:e.name,value:e.value,onChange:r=>{var o;return(o=e.onChange)==null?void 0:o.call(e,r)},onFocus:e.onFocus,onBlur:e.onBlur,placeholder:e.placeholder,error:e.error,warning:e.warning,disabled:e.disabled,isInTable:!0,left:e.left,tabIndex:e.disabled?-1:0,testId:t,tooltip:e.tooltip,validationCallback:e.validationCallback,allowEmpty:e.allowEmpty,enableDisplayRounding:e.enableDisplayRounding,roundDisplayValue:e.roundDisplayValue});_e.__docgenInfo={description:"",methods:[],displayName:"NumberInputCell",props:{cell:{required:!0,tsType:{name:"INumberInputCell"},description:""},testId:{required:!1,tsType:{name:"string"},description:""}}};const xe=({cell:e,columnAlignment:t,testId:r})=>n.jsx(Ge,{name:e.name,borderRadius:0,options:e.options,onChange:o=>{var a;return(a=e.onChange)==null?void 0:a.call(e,o)},onCreate:e.onCreate?o=>e.onCreate&&e.onCreate(o):void 0,error:e.error,warning:e.warning,disabled:e.disabled,placeholder:e.placeholder,isInTable:!0,value:e.value,native:e.native,clearable:e.clearable,searchable:e.searchable,deprecatedEventHandler:e.deprecatedEventHandler,maxTooltipWidth:e.maxTooltipWidth,width:"100%",autoLayerWidth:e.autoLayerWidth,multi:e.multi,right:t===f.RIGHT,testId:r,tabIndex:e.disabled?-1:0});xe.__docgenInfo={description:"",methods:[],displayName:"SelectCell",props:{cell:{required:!0,tsType:{name:"ISelectCell"},description:""},columnAlignment:{required:!1,tsType:{name:"union",raw:"Align.LEFT | Align.RIGHT | string",elements:[{name:"Align.LEFT"},{name:"Align.RIGHT"},{name:"string"}]},description:""},testId:{required:!1,tsType:{name:"string"},description:""}}};const we=({cell:e,columnAlignment:t,testId:r})=>n.jsx("div",{className:s.inputWrapper,children:e.type==="Input"?n.jsx(te,{cell:e,columnAlignment:t,testId:r}):e.type==="NumberInput"?n.jsx(_e,{cell:e,testId:r}):e.type==="DateInput"?n.jsx(te,{cell:e,testId:r,type:"date"}):e.type==="Select"?n.jsx(xe,{cell:e,columnAlignment:t,testId:r}):null});we.__docgenInfo={description:"",methods:[],displayName:"InputCellWrapper",props:{cell:{required:!0,tsType:{name:"any"},description:""},columnAlignment:{required:!0,tsType:{name:"union",raw:"Align.LEFT | Align.RIGHT | string",elements:[{name:"Align.LEFT"},{name:"Align.RIGHT"},{name:"string"}]},description:""},testId:{required:!1,tsType:{name:"string"},description:""}}};const Te=({cell:e,testId:t})=>{const r=S.useContext(Ve),{error:o,warning:a,tooltip:i,maxTooltipWidth:l}=e,c=d=>M(d);return n.jsx("div",{className:s.inputWrapper,children:n.jsx(oe,{error:!!o,warning:!!a,text:i||o||a,enabled:c(i)||c(o)||c(a)||!1,maxWidth:l,placement:"bottom-center",children:n.jsx("div",{className:v(s.staticCellContent,o?s.error:a?s.warning:""),children:n.jsx("a",{className:v((e.disabled||r)&&s.disabledLink),onClick:e.disabled||r?void 0:d=>{var p;d.stopPropagation(),(p=e.onClick)==null||p.call(e,d)},"data-testid":t,children:e.value})})})})};Te.__docgenInfo={description:"",methods:[],displayName:"LinkCell",props:{cell:{required:!0,tsType:{name:"ILinkCell"},description:""},testId:{required:!1,tsType:{name:"string"},description:""}}};const ve=({cell:e,testId:t})=>n.jsx(Ue,{label:e.label,checked:e.checked,isInTable:!0,disabled:e.disabled,onChange:r=>e.onChange(r),testId:t,tabIndex:e.disabled?-1:0});ve.__docgenInfo={description:"",methods:[],displayName:"CheckBoxCell",props:{cell:{required:!0,tsType:{name:"ICheckBoxCell"},description:""},testId:{required:!1,tsType:{name:"string"},description:""}}};const je=({cell:e})=>n.jsx("div",{className:s.inputWrapper,children:n.jsx(ze,{label:e.label,value:e.value,min:e.min,max:e.max,step:e.step,marks:e.marks,onChange:t=>e.onChange(t),showArrows:e.showArrows,showTooltip:e.showTooltip,tooltipFormatter:e.tooltipFormatter,disabled:e.disabled})});je.__docgenInfo={description:"",methods:[],displayName:"SliderCell",props:{cell:{required:!0,tsType:{name:"ISliderCell"},description:""}}};const Ae=({cell:e})=>{const{tooltip:t,icon:r}=e;return n.jsx("div",{className:s.iconCellWrapper,children:n.jsx(oe,{text:t,enabled:!!t&&M(t),display:"flex",placement:"top-center",children:n.jsx(G,{icon:r})})})};Ae.__docgenInfo={description:"",methods:[],displayName:"IconCell",props:{cell:{required:!0,tsType:{name:"IIconCell"},description:""}}};const Re=({cell:e})=>n.jsx(ae,{actions:e.actions});Re.__docgenInfo={description:"",methods:[],displayName:"ActionsCell",props:{cell:{required:!0,tsType:{name:"IActionCell"},description:""}}};const ke=({cell:e})=>{const{helpIcon:t}=e;return t?n.jsx("div",{className:s.icon,children:n.jsx(fe,{onClick:t.onClick,text:t.tooltip})}):null};ke.__docgenInfo={description:"",methods:[],displayName:"CellHelpIcon",props:{cell:{required:!0,tsType:{name:"IHelpIconCell"},description:""}}};const qe=({cell:e})=>{const{libraryIcon:t}=e;return t?n.jsx("div",{className:s.icon,children:n.jsx(fe,{onClick:t.onClick,text:t.tooltip,icon:$.LIBRARY})}):null};qe.__docgenInfo={description:"",methods:[],displayName:"CellLibraryIcon",props:{cell:{required:!0,tsType:{name:"ILibraryIconCell"},description:""}}};const Ne=({cell:e})=>{const{hasSort:t,sort:r,sortPriority:o}=e;return t?n.jsxs("span",{className:s.sortingCellIcon,children:[r==="down"?n.jsx(Y,{link:!0,children:n.jsx(G,{icon:$.SORT_ASCENDING})}):r==="up"?n.jsx(Y,{link:!0,children:n.jsx(G,{icon:$.SORT_DESCENDING})}):n.jsx(Y,{faint:!0,children:n.jsx(G,{icon:$.SORT_DESCENDING})}),o&&r?n.jsx("sup",{children:o}):null]}):null};Ne.__docgenInfo={description:"",methods:[],displayName:"Sort",props:{cell:{required:!0,tsType:{name:"ISortCell"},description:""}}};const ie=({cell:e,isHeader:t,testId:r})=>{const{error:o,warning:a,tooltip:i,maxTooltipWidth:l,hasSort:c,onSort:d,type:p}=e,u=n.jsxs("div",{className:v(s.staticCellContent,p==="Unit"?s.unit:"",o?s.error:a?s.warning:""),onClick:c?I=>d&&d(I):()=>{},"data-testid":r,children:[e.value,t?n.jsxs(n.Fragment,{children:[n.jsx(ke,{cell:e}),n.jsx(qe,{cell:e}),n.jsx(Ne,{cell:e})]}):null]});return n.jsx("div",{className:s.inputWrapper,children:n.jsx(oe,{error:!!o,warning:!!a,text:i||o||a,enabled:i&&M(i)||o&&M(o)||a&&M(a)||!1,maxWidth:l,display:"block",placement:"bottom-center",children:u})})};ie.__docgenInfo={description:"",methods:[],displayName:"StaticCell",props:{cell:{required:!0,tsType:{name:"IStaticCell"},description:""},isHeader:{required:!1,tsType:{name:"boolean"},description:""},testId:{required:!1,tsType:{name:"string"},description:""}}};const Se=({cell:e,testId:t})=>{const{content:r,fullWidth:o,closeOnOutsideClick:a,disabled:i}=e;return n.jsx(Ke,{content:r,fullWidth:o,closeOnOutsideClick:a,disabled:i,children:n.jsx("div",{className:s.popover,children:n.jsx(ie,{cell:e,testId:t})})})};Se.__docgenInfo={description:"",methods:[],displayName:"PopoverCell",props:{cell:{required:!0,tsType:{name:"IPopoverCell"},description:""},testId:{required:!1,tsType:{name:"string"},description:""}}};const Ee=({cell:e,isHeader:t,columnAlignment:r,testId:o})=>{if(!e)return null;switch(e.type){case"Input":case"NumberInput":case"DateInput":case"Select":return n.jsx(we,{cell:e,columnAlignment:r,testId:o});case"Link":return n.jsx(Te,{cell:e,testId:o});case"CheckBox":return n.jsx(ve,{cell:e,testId:o});case"Slider":return n.jsx(je,{cell:e});case"Icon":return n.jsx(Ae,{cell:e});case"Actions":return n.jsx(Re,{cell:e});case"Popover":return n.jsx(Se,{cell:e});default:return n.jsx(ie,{cell:e,isHeader:t,testId:o})}};Ee.__docgenInfo={description:"",methods:[],displayName:"CellWrapper",props:{cell:{required:!0,tsType:{name:"any"},description:""},isHeader:{required:!0,tsType:{name:"boolean"},description:""},columnAlignment:{required:!0,tsType:{name:"union",raw:"Align.LEFT | Align.RIGHT | string",elements:[{name:"Align.LEFT"},{name:"Align.RIGHT"},{name:"string"}]},description:""},testId:{required:!1,tsType:{name:"string"},description:""}}};var R=(e=>(e.INPUT="Input",e.NUMBER_INPUT="NumberInput",e.SELECT="Select",e.POPOVER="Popover",e.SLIDER="Slider",e.CHECKBOX="CheckBox",e.ACTIONS="Actions",e.AUTO_UNIT="AutoUnit",e))(R||{});const re=({cell:e,isHeader:t,columnHeaderAlignment:r,columnAlignment:o=f.LEFT,width:a,snapshot:i,testId:l})=>{if(!e)return null;const{style:c,colSpan:d,rowSpan:p,width:u}=e,I=S.useRef(null),y={bodyAlignment:o,headerAlignment:r,isHeader:t},W=he(y,s),_=he(y,s,!0),F=e.type===R.INPUT||e.type===R.NUMBER_INPUT||e.type===R.SELECT||e.type===R.POPOVER?s.inputCell:e.type===R.SLIDER?s.sliderCell:e.type===R.CHECKBOX?s.checkBoxCell:e.type===R.ACTIONS?s.actionsCell:s.staticCell,j=v(s.cell,F,e.hasSort?s.sortingCell:null,W,e.breakWord?s.breakWord:""),E=u??a??((i==null?void 0:i.isDragging)&&I.current&&I.current.offsetWidth)??void 0,x={width:E,minWidth:E,...c},A=t?"th":"td";return n.jsx(A,{ref:I,className:j,style:x,colSpan:d,rowSpan:p,children:n.jsx(Ee,{cell:e,columnAlignment:_??f.RIGHT,isHeader:t,testId:l})})};re.__docgenInfo={description:"",methods:[],displayName:"Cell",props:{cell:{required:!1,tsType:{name:"union",raw:`| IPopoverCell
1
+ import{j as n}from"./jsx-runtime-eps93zm2.js";import{r as S}from"./index-DhsZuJvc.js";import{c as v}from"./index-Bk2sglWO.js";import{I as Le,D as We,C as Fe,P as Pe}from"./index.es-D2piFfFj.js";import{l as De}from"./lodash-BHd_uQHh.js";import{A as ae}from"./actions-CZK3mphC.js";import{H as Oe}from"./heading-NkLgQYoP.js";import{P as Be}from"./pagination-CqvxiZHR.js";import{A as f,I as $}from"./common-types-Sih75Sav.js";import{I as $e}from"./input-BW9trNAW.js";import{N as Me}from"./number-input-uQOVHv2N.js";import{S as Ge}from"./select-tIEV7vnw.js";import{D as Ve}from"./disabled-context-rmpd7YJS.js";import{i as M}from"./types-UmZ4Y_CR.js";import{T as oe}from"./tooltip-1V7clEnw.js";import{C as Ue}from"./check-box-CaSrhzev.js";import{S as ze}from"./slider-gZmYlxxz.js";import{I as G}from"./icon-BP4BO6-k.js";import{P as Ke}from"./popover-DgUpTRMk.js";import{H as fe}from"./help-icon-41R-Z9N1.js";import{T as Y}from"./text-B3-TSWok.js";const Xe="_inputInTable_y9car_1",Ye="_inputHover_y9car_13",Je="_inputFocus_y9car_18",Qe="_inputError_y9car_25",Ze="_inputWarning_y9car_26",en="_inputDisabled_y9car_61",nn="_hideScrollbars_y9car_67",tn="_wrapper_y9car_85",rn="_bordered_y9car_93",an="_scroll_y9car_98",on="_table_y9car_108",sn="_striped_y9car_188",L={inputInTable:Xe,inputHover:Ye,inputFocus:Je,inputError:Qe,inputWarning:Ze,inputDisabled:en,hideScrollbars:nn,wrapper:tn,bordered:rn,scroll:an,table:on,striped:sn},ln="_title_zn5s7_1",dn={title:ln},Q=({name:e=null,actions:t=null,actionsRight:r=!1,testId:o})=>{const a=e!==null,i=t!==null;if(!a&&!i)return null;const l=()=>{if(!i)return null;const c=n.jsx(ae,{actions:t});return r?c:n.jsx("div",{children:c})};return n.jsxs("div",{className:dn.title,children:[a?n.jsx(Oe,{children:n.jsx("span",{"data-testid":o,children:e})}):null,l()]})};Q.__docgenInfo={description:"",methods:[],displayName:"Title",props:{name:{required:!1,tsType:{name:"union",raw:"TStringOrNumber | ReactNode",elements:[{name:"union",raw:"string | number",elements:[{name:"string"},{name:"number"}]},{name:"ReactNode"}]},description:"",defaultValue:{value:"null",computed:!1}},actions:{required:!1,tsType:{name:"any"},description:"",defaultValue:{value:"null",computed:!1}},actionsRight:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},testId:{required:!1,tsType:{name:"string"},description:""}}};const un="_footer_4sumy_1",cn="_section_4sumy_7",J={footer:un,section:cn},Z=({colSpan:e,pagination:t,actions:r,content:o})=>{const a=r&&r.length,i=o!=null,l=()=>{var d,p;if(t){const{rowCount:u,rowsPerPage:I}=t,y=Number((p=(d=I==null?void 0:I.options)==null?void 0:d[0])==null?void 0:p.value);return u>y}return!1};return a||i||l()?n.jsxs("div",{className:J.footer,children:[i?n.jsx("div",{className:J.section,children:n.jsx("div",{children:o})}):null,a||l()?n.jsxs("div",{className:J.section,children:[l()?n.jsx(Be,{pagination:t}):n.jsx("div",{}),a&&n.jsx("div",{children:n.jsx(ae,{actions:r})})]}):null]}):null};Z.__docgenInfo={description:"",methods:[],displayName:"Footer",props:{colSpan:{required:!1,tsType:{name:"number"},description:""},pagination:{required:!0,tsType:{name:"IPagination"},description:""},actions:{required:!1,tsType:{name:"Array",elements:[{name:"IAction"}],raw:"IAction[]"},description:""},content:{required:!1,tsType:{name:"ReactNode"},description:""}}};const Ce=e=>{const t=Math.max(...e.reduce((r,o)=>{const a=o.cells.map(i=>i.colSpan?i.colSpan:1).reduce((i,l)=>i+l,0);return r.concat(a)},[]));return isNaN(t)?0:t},pn=(e,t)=>{const r=[Ce(t),Ce(e)];return Math.max(...r)},be=e=>e.reduce((t,r)=>r.actions&&r.actions.length>0?1:t,0),mn=(e,t)=>be(t)>0||be(e)>0,ee=({table:e,children:t})=>{const{rows:r,infiniteScroll:o}=e,a=Math.ceil(window.innerHeight/30),[i,l]=o?S.useState(a):[r.length,null],[c,d]=o?S.useState(i<r.length):[!1,null],p=()=>{if(i>=r.length&&d){d(!1);return}l&&l(i+a)};return n.jsx("div",{id:"scrollWrapper",className:L.scroll,children:o?n.jsx(Le,{dataLength:Math.min(r.length,i+a),next:p,hasMore:c,scrollableTarget:"scrollWrapper",style:{overflow:"initial"},loader:null,children:t({visibleRows:i})}):t({visibleRows:i})})};ee.__docgenInfo={description:"",methods:[],displayName:"TableScrollWrapper",props:{table:{required:!0,tsType:{name:"ITableProps"},description:""},children:{required:!0,tsType:{name:"signature",type:"function",raw:"(props: { visibleRows: number }) => ReactNode",signature:{arguments:[{type:{name:"signature",type:"object",raw:"{ visibleRows: number }",signature:{properties:[{key:"visibleRows",value:{name:"number",required:!0}}]}},name:"props"}],return:{name:"ReactNode"}}},description:""}}};const gn="_clickableRow_1ki29_1",yn="_hoverableRow_1ki29_4",In="_rowActive_1ki29_4",Cn="_expandableRow_1ki29_8",bn="_flush_1ki29_8",hn="_errorRow_1ki29_12",fn="_warningRow_1ki29_15",_n="_dragIconCell_1ki29_34",xn="_dragIcon_1ki29_34",h={clickableRow:gn,hoverableRow:yn,rowActive:In,expandableRow:Cn,flush:bn,errorRow:hn,warningRow:fn,dragIconCell:_n,dragIcon:xn},ne=({colSpan:e,children:t,flush:r})=>n.jsx("tr",{children:n.jsx("td",{colSpan:e,className:v(h.expandableRow,r?h.flush:""),children:t})});ne.__docgenInfo={description:"",methods:[],displayName:"ExpandedContentRow",props:{colSpan:{required:!0,tsType:{name:"number"},description:""},children:{required:!0,tsType:{name:"ReactNode"},description:""},flush:{required:!1,tsType:{name:"boolean"},description:""}}};const he=(e,t={leftAligned:"",rightAligned:"",centerAligned:""},r=!1)=>{if(!e)return null;const{bodyAlignment:o,headerAlignment:a,isHeader:i}=e;switch(i&&a?a:o){case f.LEFT:return r?f.LEFT:t.leftAligned;case f.RIGHT:return r?f.RIGHT:t.rightAligned;case f.CENTER:return r?f.CENTER:t.centerAligned;default:return r?f.LEFT:t.leftAligned}},wn=(e,t=!1,r=0)=>{if(!e||e.length===0)return[];const o=e.every(i=>Array.isArray(i)),a=e.every(i=>typeof i=="string");return o&&t?e[r]||[]:a?e:(console.warn("getHeaderAlignment: alignments array contains a mix of strings and arrays, returning an empty array."),[])},Tn="_inputInTable_u3xdj_1",vn="_inputHover_u3xdj_13",jn="_inputFocus_u3xdj_18",An="_inputError_u3xdj_25",Rn="_inputWarning_u3xdj_26",kn="_inputDisabled_u3xdj_61",qn="_hideScrollbars_u3xdj_67",Nn="_cell_u3xdj_77",Sn="_disabledLink_u3xdj_87",En="_inputWrapper_u3xdj_91",Hn="_breakWord_u3xdj_106",Ln="_inputCell_u3xdj_109",Wn="_sliderCell_u3xdj_112",Fn="_staticCell_u3xdj_116",Pn="_staticCellContent_u3xdj_119",Dn="_error_u3xdj_131",On="_warning_u3xdj_132",Bn="_unit_u3xdj_141",$n="_sortingCell_u3xdj_144",Mn="_sortingCellIcon_u3xdj_155",Gn="_icon_u3xdj_166",Vn="_checkBoxCell_u3xdj_170",Un="_iconCellWrapper_u3xdj_174",zn="_actionsCell_u3xdj_178",Kn="_rightAligned_u3xdj_186",Xn="_centerAligned_u3xdj_192",Yn="_leftAligned_u3xdj_198",Jn="_popover_u3xdj_201",Qn="_disabledPointerEvents_u3xdj_204",s={inputInTable:Tn,inputHover:vn,inputFocus:jn,inputError:An,inputWarning:Rn,inputDisabled:kn,hideScrollbars:qn,cell:Nn,disabledLink:Sn,inputWrapper:En,breakWord:Hn,inputCell:Ln,sliderCell:Wn,staticCell:Fn,staticCellContent:Pn,error:Dn,warning:On,unit:Bn,sortingCell:$n,sortingCellIcon:Mn,icon:Gn,checkBoxCell:Vn,iconCellWrapper:Un,actionsCell:zn,rightAligned:Kn,centerAligned:Xn,leftAligned:Yn,popover:Jn,disabledPointerEvents:Qn},te=({cell:e,columnAlignment:t,testId:r,type:o})=>n.jsx($e,{name:e.name,value:e.value,onChange:a=>{var i;return(i=e.onChange)==null?void 0:i.call(e,a)},onFocus:e.onFocus,onBlur:e.onBlur,onPaste:a=>{var i;return(i=e.onPaste)==null?void 0:i.call(e,a)},placeholder:e.placeholder,error:e.error,warning:e.warning,disabled:e.disabled,isInTable:!0,maxTooltipWidth:e.maxTooltipWidth,right:t===f.RIGHT,testId:r,tabIndex:e.disabled?-1:0,tooltip:e.tooltip,type:o});te.__docgenInfo={description:"",methods:[],displayName:"InputCell",props:{cell:{required:!0,tsType:{name:"IInputCell"},description:""},columnAlignment:{required:!1,tsType:{name:"union",raw:"Align.LEFT | Align.RIGHT | string",elements:[{name:"Align.LEFT"},{name:"Align.RIGHT"},{name:"string"}]},description:""},testId:{required:!1,tsType:{name:"string"},description:""},type:{required:!1,tsType:{name:"union",raw:"'text' | 'date'",elements:[{name:"literal",value:"'text'"},{name:"literal",value:"'date'"}]},description:""}}};const _e=({cell:e,testId:t})=>n.jsx(Me,{name:e.name,value:e.value,onChange:r=>{var o;return(o=e.onChange)==null?void 0:o.call(e,r)},onFocus:e.onFocus,onBlur:e.onBlur,placeholder:e.placeholder,error:e.error,warning:e.warning,disabled:e.disabled,isInTable:!0,left:e.left,tabIndex:e.disabled?-1:0,testId:t,tooltip:e.tooltip,validationCallback:e.validationCallback,allowEmpty:e.allowEmpty,enableDisplayRounding:e.enableDisplayRounding,roundDisplayValue:e.roundDisplayValue});_e.__docgenInfo={description:"",methods:[],displayName:"NumberInputCell",props:{cell:{required:!0,tsType:{name:"INumberInputCell"},description:""},testId:{required:!1,tsType:{name:"string"},description:""}}};const xe=({cell:e,columnAlignment:t,testId:r})=>n.jsx(Ge,{name:e.name,borderRadius:0,options:e.options,onChange:o=>{var a;return(a=e.onChange)==null?void 0:a.call(e,o)},onCreate:e.onCreate?o=>e.onCreate&&e.onCreate(o):void 0,error:e.error,warning:e.warning,disabled:e.disabled,placeholder:e.placeholder,isInTable:!0,value:e.value,native:e.native,clearable:e.clearable,searchable:e.searchable,deprecatedEventHandler:e.deprecatedEventHandler,maxTooltipWidth:e.maxTooltipWidth,width:"100%",autoLayerWidth:e.autoLayerWidth,multi:e.multi,right:t===f.RIGHT,testId:r,tabIndex:e.disabled?-1:0});xe.__docgenInfo={description:"",methods:[],displayName:"SelectCell",props:{cell:{required:!0,tsType:{name:"ISelectCell"},description:""},columnAlignment:{required:!1,tsType:{name:"union",raw:"Align.LEFT | Align.RIGHT | string",elements:[{name:"Align.LEFT"},{name:"Align.RIGHT"},{name:"string"}]},description:""},testId:{required:!1,tsType:{name:"string"},description:""}}};const we=({cell:e,columnAlignment:t,testId:r})=>n.jsx("div",{className:s.inputWrapper,children:e.type==="Input"?n.jsx(te,{cell:e,columnAlignment:t,testId:r}):e.type==="NumberInput"?n.jsx(_e,{cell:e,testId:r}):e.type==="DateInput"?n.jsx(te,{cell:e,testId:r,type:"date"}):e.type==="Select"?n.jsx(xe,{cell:e,columnAlignment:t,testId:r}):null});we.__docgenInfo={description:"",methods:[],displayName:"InputCellWrapper",props:{cell:{required:!0,tsType:{name:"any"},description:""},columnAlignment:{required:!0,tsType:{name:"union",raw:"Align.LEFT | Align.RIGHT | string",elements:[{name:"Align.LEFT"},{name:"Align.RIGHT"},{name:"string"}]},description:""},testId:{required:!1,tsType:{name:"string"},description:""}}};const Te=({cell:e,testId:t})=>{const r=S.useContext(Ve),{error:o,warning:a,tooltip:i,maxTooltipWidth:l}=e,c=d=>M(d);return n.jsx("div",{className:s.inputWrapper,children:n.jsx(oe,{error:!!o,warning:!!a,text:i||o||a,enabled:c(i)||c(o)||c(a)||!1,maxWidth:l,placement:"bottom-center",children:n.jsx("div",{className:v(s.staticCellContent,o?s.error:a?s.warning:""),children:n.jsx("a",{className:v((e.disabled||r)&&s.disabledLink),onClick:e.disabled||r?void 0:d=>{var p;d.stopPropagation(),(p=e.onClick)==null||p.call(e,d)},"data-testid":t,children:e.value})})})})};Te.__docgenInfo={description:"",methods:[],displayName:"LinkCell",props:{cell:{required:!0,tsType:{name:"ILinkCell"},description:""},testId:{required:!1,tsType:{name:"string"},description:""}}};const ve=({cell:e,testId:t})=>n.jsx(Ue,{label:e.label,checked:e.checked,isInTable:!0,disabled:e.disabled,onChange:r=>e.onChange(r),testId:t,tabIndex:e.disabled?-1:0});ve.__docgenInfo={description:"",methods:[],displayName:"CheckBoxCell",props:{cell:{required:!0,tsType:{name:"ICheckBoxCell"},description:""},testId:{required:!1,tsType:{name:"string"},description:""}}};const je=({cell:e})=>n.jsx("div",{className:s.inputWrapper,children:n.jsx(ze,{label:e.label,value:e.value,min:e.min,max:e.max,step:e.step,marks:e.marks,onChange:t=>e.onChange(t),showArrows:e.showArrows,showTooltip:e.showTooltip,tooltipFormatter:e.tooltipFormatter,disabled:e.disabled})});je.__docgenInfo={description:"",methods:[],displayName:"SliderCell",props:{cell:{required:!0,tsType:{name:"ISliderCell"},description:""}}};const Ae=({cell:e})=>{const{tooltip:t,icon:r}=e;return n.jsx("div",{className:s.iconCellWrapper,children:n.jsx(oe,{text:t,enabled:!!t&&M(t),display:"flex",placement:"top-center",children:n.jsx(G,{icon:r})})})};Ae.__docgenInfo={description:"",methods:[],displayName:"IconCell",props:{cell:{required:!0,tsType:{name:"IIconCell"},description:""}}};const Re=({cell:e})=>n.jsx(ae,{actions:e.actions});Re.__docgenInfo={description:"",methods:[],displayName:"ActionsCell",props:{cell:{required:!0,tsType:{name:"IActionCell"},description:""}}};const ke=({cell:e})=>{const{helpIcon:t}=e;return t?n.jsx("div",{className:s.icon,children:n.jsx(fe,{onClick:t.onClick,text:t.tooltip})}):null};ke.__docgenInfo={description:"",methods:[],displayName:"CellHelpIcon",props:{cell:{required:!0,tsType:{name:"IHelpIconCell"},description:""}}};const qe=({cell:e})=>{const{libraryIcon:t}=e;return t?n.jsx("div",{className:s.icon,children:n.jsx(fe,{onClick:t.onClick,text:t.tooltip,icon:$.LIBRARY})}):null};qe.__docgenInfo={description:"",methods:[],displayName:"CellLibraryIcon",props:{cell:{required:!0,tsType:{name:"ILibraryIconCell"},description:""}}};const Ne=({cell:e})=>{const{hasSort:t,sort:r,sortPriority:o}=e;return t?n.jsxs("span",{className:s.sortingCellIcon,children:[r==="down"?n.jsx(Y,{link:!0,children:n.jsx(G,{icon:$.SORT_ASCENDING})}):r==="up"?n.jsx(Y,{link:!0,children:n.jsx(G,{icon:$.SORT_DESCENDING})}):n.jsx(Y,{faint:!0,children:n.jsx(G,{icon:$.SORT_DESCENDING})}),o&&r?n.jsx("sup",{children:o}):null]}):null};Ne.__docgenInfo={description:"",methods:[],displayName:"Sort",props:{cell:{required:!0,tsType:{name:"ISortCell"},description:""}}};const ie=({cell:e,isHeader:t,testId:r})=>{const{error:o,warning:a,tooltip:i,maxTooltipWidth:l,hasSort:c,onSort:d,type:p}=e,u=n.jsxs("div",{className:v(s.staticCellContent,p==="Unit"?s.unit:"",o?s.error:a?s.warning:""),onClick:c?I=>d&&d(I):()=>{},"data-testid":r,children:[e.value,t?n.jsxs(n.Fragment,{children:[n.jsx(ke,{cell:e}),n.jsx(qe,{cell:e}),n.jsx(Ne,{cell:e})]}):null]});return n.jsx("div",{className:s.inputWrapper,children:n.jsx(oe,{error:!!o,warning:!!a,text:i||o||a,enabled:i&&M(i)||o&&M(o)||a&&M(a)||!1,maxWidth:l,display:"block",placement:"bottom-center",children:u})})};ie.__docgenInfo={description:"",methods:[],displayName:"StaticCell",props:{cell:{required:!0,tsType:{name:"IStaticCell"},description:""},isHeader:{required:!1,tsType:{name:"boolean"},description:""},testId:{required:!1,tsType:{name:"string"},description:""}}};const Se=({cell:e,testId:t})=>{const{content:r,fullWidth:o,closeOnOutsideClick:a,disabled:i}=e;return n.jsx(Ke,{content:r,fullWidth:o,closeOnOutsideClick:a,disabled:i,children:n.jsx("div",{className:s.popover,children:n.jsx(ie,{cell:e,testId:t})})})};Se.__docgenInfo={description:"",methods:[],displayName:"PopoverCell",props:{cell:{required:!0,tsType:{name:"IPopoverCell"},description:""},testId:{required:!1,tsType:{name:"string"},description:""}}};const Ee=({cell:e,isHeader:t,columnAlignment:r,testId:o})=>{if(!e)return null;switch(e.type){case"Input":case"NumberInput":case"DateInput":case"Select":return n.jsx(we,{cell:e,columnAlignment:r,testId:o});case"Link":return n.jsx(Te,{cell:e,testId:o});case"CheckBox":return n.jsx(ve,{cell:e,testId:o});case"Slider":return n.jsx(je,{cell:e});case"Icon":return n.jsx(Ae,{cell:e});case"Actions":return n.jsx(Re,{cell:e});case"Popover":return n.jsx(Se,{cell:e});default:return n.jsx(ie,{cell:e,isHeader:t,testId:o})}};Ee.__docgenInfo={description:"",methods:[],displayName:"CellWrapper",props:{cell:{required:!0,tsType:{name:"any"},description:""},isHeader:{required:!0,tsType:{name:"boolean"},description:""},columnAlignment:{required:!0,tsType:{name:"union",raw:"Align.LEFT | Align.RIGHT | string",elements:[{name:"Align.LEFT"},{name:"Align.RIGHT"},{name:"string"}]},description:""},testId:{required:!1,tsType:{name:"string"},description:""}}};var R=(e=>(e.INPUT="Input",e.NUMBER_INPUT="NumberInput",e.SELECT="Select",e.POPOVER="Popover",e.SLIDER="Slider",e.CHECKBOX="CheckBox",e.ACTIONS="Actions",e.AUTO_UNIT="AutoUnit",e))(R||{});const re=({cell:e,isHeader:t,columnHeaderAlignment:r,columnAlignment:o=f.LEFT,width:a,snapshot:i,testId:l})=>{if(!e)return null;const{style:c,colSpan:d,rowSpan:p,width:u}=e,I=S.useRef(null),y={bodyAlignment:o,headerAlignment:r,isHeader:t},W=he(y,s),_=he(y,s,!0),F=e.type===R.INPUT||e.type===R.NUMBER_INPUT||e.type===R.SELECT||e.type===R.POPOVER?s.inputCell:e.type===R.SLIDER?s.sliderCell:e.type===R.CHECKBOX?s.checkBoxCell:e.type===R.ACTIONS?s.actionsCell:s.staticCell,j=v(s.cell,F,e.hasSort?s.sortingCell:null,W,e.breakWord?s.breakWord:""),E=u??a??((i==null?void 0:i.isDragging)&&I.current&&I.current.offsetWidth)??void 0,x={width:E,minWidth:E,...c},A=t?"th":"td";return n.jsx(A,{ref:I,className:j,style:x,colSpan:d,rowSpan:p,children:n.jsx(Ee,{cell:e,columnAlignment:_??f.RIGHT,isHeader:t,testId:l})})};re.__docgenInfo={description:"",methods:[],displayName:"Cell",props:{cell:{required:!1,tsType:{name:"union",raw:`| IPopoverCell
2
2
  | IStaticCell
3
3
  | ISelectCell
4
4
  | IHelpIconCell
@@ -1,4 +1,4 @@
1
- import{j as n}from"./jsx-runtime-eps93zm2.js";import{r as S}from"./index-DhsZuJvc.js";import{f as ne}from"./immer.esm-BwVl9PS2.js";import{l as Z}from"./lodash-BHd_uQHh.js";import{G as le}from"./grid-B6LFPf51.js";import{T as W}from"./text-B3-TSWok.js";import{T as D}from"./table-DPvzYjoq.js";import{C as dn}from"./card-EcjmryU9.js";import{I as se}from"./input-D97ganXq.js";import{F as oe}from"./field-DwLk_uWj.js";import{H as un}from"./heading-DkSFysAb.js";import{t as ae,x as pn,y as mn,z as gn,A as bn,B as hn,C as wn,D as yn}from"./table.stories-data-2STKbgzG.js";import"./styled-components.browser.esm-Bf0q9Yjk.js";import"./index-Bk2sglWO.js";import"./index.es-D2piFfFj.js";import"./inheritsLoose-DR8r8Ogv.js";import"./extends-CF3RwP-h.js";import"./redux-tRgGMjwY.js";import"./objectSpread2-DW4nTBoq.js";import"./tiny-invariant-DqLgxztJ.js";import"./index-CUZDtIZe.js";import"./memoize-one.esm-CcMeOnPo.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./actions-Cu_0szZ4.js";import"./common-types-Sih75Sav.js";import"./disabled-context-rmpd7YJS.js";import"./button-_0DiND6h.js";import"./spinner-AWUe4xwQ.js";import"./icon-BP4BO6-k.js";import"./index-CEuq6vkz.js";import"./tooltip-C_E_6ym5.js";import"./types-BmbYqTX_.js";import"./types-UmZ4Y_CR.js";import"./badge-CLQ59MDF.js";import"./pagination-DSQeMPG_.js";import"./select-78sreKsp.js";import"./assertThisInitialized-B9jnkVVz.js";import"./select.input-DIKP56UZ.js";import"./input-group-BaRSJAEN.js";import"./input-group-addon-D68iUKV2.js";import"./number-input-B-Nmya5O.js";import"./index-DQs5XS8h.js";import"./index-DRSy5Ssd.js";import"./check-box-DkdQxC5c.js";import"./help-icon-LfPZiYla.js";import"./slider-CxVlS0fh.js";import"./index-BI4_Bp97.js";import"./popover-Dq3iC_lM.js";import"./label-tWjEmTQJ.js";import"./flex-EllkLxgO.js";const bt={title:"Basic/Table",component:D,args:{table:{...ae}}},A=h=>n.jsx(D,{...h}),te=A.bind({}),E=A.bind({});E.args={table:{...ae,fixedWidth:"400px"}};const L=A.bind({});L.args={table:{...ae,fixedWidth:"auto"}};const _=A.bind({});_.args={table:pn};_.parameters={docs:{description:{story:"Use sparingly when certain columns cannot be below a certain width. Unless the Table is auto width, set one column to `auto` to use remaining space."}}};const Q=A.bind({});Q.args={table:mn};const O=A.bind({});O.args={table:gn};O.parameters={docs:{description:{story:"This is only required when you need to override `columnAlignment` in header cells (i.e. they have different alignment)"}}};const G=A.bind({});G.args={table:bn};const N=A.bind({});N.args={table:hn};N.decorators=[h=>n.jsx("div",{style:{position:"absolute",inset:0,padding:"var(--padding)"},children:n.jsx(h,{})})];const U=A.bind({});U.args={table:wn};U.parameters={docs:{description:{story:"If a `maxHeight` is set, the table should only fill that height if it needs to."}}};const $=A.bind({});$.args={table:yn};const M=()=>n.jsx(dn,{heading:n.jsx(un,{children:"Card heading"}),padding:!1,children:n.jsx(D,{table:{...ae,bordered:!1}})});M.parameters={docs:{source:{type:"dynamic"}}};const q=()=>{const h=["Section","Width","Height"];let g=["","m","m"],o=[...Array(175).keys()].map((l,t)=>[t,t*2,t*2]);const x=(l,t,r)=>l==="m"&&t==="ft"?r*3.28084:l==="ft"&&t==="m"?r/3.28084:r,i=(l,t,r,c)=>{o[t][r]=l.target.value,c()},R=l=>{o=o.concat([["","",""]]),l()},k=(l,t)=>{o=o.filter((r,c)=>c!==l),t()},p=(l,t,r)=>{const c=g[t],b=l.target.value;g=g.map((y,s)=>s===t?b:y),o=o.map(y=>y.map((s,u)=>u===t?x(c,b,s):s)),r()},w=()=>{const l=[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"Show all",value:0}],[t,r]=S.useState(10),[c,b]=S.useState(1),[y,s]=S.useState(!1),u=()=>{s(!y)},j=()=>{const e=Math.ceil(o.length/t);b(e)},T=(c-1)*t,a=t===0?o.length-1:T+t,m={headers:[{cells:h.map(e=>({value:e})),actions:[{primary:!0,label:"Add",icon:"add",onClick:()=>{R(u),j()}}]},{cells:[{},{options:[{label:"m",value:"m"},{label:"ft",value:"ft"}],value:g[1],type:"Select",native:!0,onChange:e=>p(e,1,u)},{options:[{label:"m",value:"m"},{label:"ft",value:"ft"}],value:g[2],type:"Select",native:!0,onChange:e=>p(e,2,u)}]}],rows:o.slice(T,a).map((e,d)=>{const I=T+d;return{cells:[...Array(3).keys()].map((P,v)=>({value:e[v],type:"Input",onChange:C=>i(C,I,v,u)})),actions:[{label:"Delete",icon:"minus",onClick:()=>k(I,u)}]}}),footer:{pagination:{rowCount:o.length,selectedPage:c,rowsPerPage:{onChange:e=>{const{value:d}=e.target;r(Number(d))},options:l,value:t},onSelectPage:e=>b(e),small:!0}}};return n.jsx(D,{table:m})};return n.jsx(w,{})},K=()=>{const h=["Section","Width","Height"];let g=[...Array(20).keys()].map((x,i)=>({Section:Z.random(0,100),Width:Z.random(0,100),Height:Z.random(0,100)}));const o=()=>{const[x,i]=S.useState({Section:"up"}),R=(r,c)=>r.sort((b,y)=>Object.entries(c).map(([s,u])=>{switch(u){case"up":return b[s]-y[s];case"down":return y[s]-b[s];default:return 0}}).reduce((s,u)=>s||u,0)),k=(r,c,b)=>({dataSortCells:r.map(s=>{const u=Object.keys(c).includes(s)?c[s]:"",j=`${s[0].toUpperCase()}${s.slice(1)}`;return{key:s,value:j,hasSort:!0,sort:u,onSort:()=>{const T=u==="up"?"down":"up";b({[s]:T})}}})}),{dataSortCells:p}=k(h,x,i),l=[...R(g,x).map(r=>({cells:Object.entries(r).map(([b,y])=>({key:b,value:y,type:"Input",disabled:!0}))}))],t={headers:[{cells:p}],rows:l};return n.jsx(D,{table:t})};return n.jsx(o,{})},B=()=>{const h=["Section","Width","Height"];let g=[...Array(175).keys()].map((x,i)=>({Section:i,Width:i*2,Height:i*2}));const o=()=>{const x=[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"Show all",value:0}],[i,R]=S.useState(10),[k,p]=S.useState(1),[w,l]=S.useState({}),[t,r]=S.useState({});S.useEffect(()=>{p(1)},[w,t]);const c=(k-1)*i,b=i===0?g.length-1:c+i,y=(e,d,I)=>e.filter(P=>Object.keys(d).every(v=>d[v]===""?!0:P[v].toString().includes(d[v]))).sort((P,v)=>Object.entries(I).map(([C,H])=>{switch(H){case"up":return P[C]-v[C];case"down":return v[C]-P[C];default:return 0}}).reduce((C,H)=>C||H,0)),s=(e,d,I,P,v)=>{const C=e.map(f=>{const V=Object.keys(P).includes(f)?P[f]:"",F=`${f[0].toUpperCase()}${f.slice(1)}`;return{key:f,value:F,hasSort:!0,sort:V,onSort:()=>{const ee=V===""?"up":V==="up"?"down":"";v({...P,[f]:ee})}}}),H=e.map(f=>{const V=Object.keys(d).includes(f)?d[f]:"";return{key:f,value:V,type:"Input",placeholder:"Filter",onChange:F=>I({...d,[f]:F.target.value})}});return{dataSortCells:C,dataFilterCells:H}},{dataSortCells:u,dataFilterCells:j}=s(h,w,l,t,r),T=y(g,w,t),a=[...T.slice(c,b).map(e=>({cells:Object.entries(e).map(([I,P])=>({key:I,value:P,type:"Input",disabled:!0}))}))],m={headers:[{cells:u},{cells:j}],rows:a,footer:{pagination:{rowCount:T.length,selectedPage:k,rowsPerPage:{onChange:e=>{const{value:d}=e.target;R(Number(d))},options:x,value:i},onSelectPage:e=>p(e),small:!0}}};return n.jsx(D,{table:m})};return n.jsx(o,{})},z=()=>{const h={tea:3.6,coffee:3.2,orange:4.1},g=[{label:"Tea",value:"tea"},{label:"Coffee",value:"coffee"},{label:"Orange juice",value:"orange"}],o={cells:[{type:"Select",options:g,value:{value:"tea"}},{type:"Input"},{type:"Static"}]},x=[...Array(15).keys()].map((a,m)=>({cells:[{type:"Select",options:g,value:{value:"tea"}},{type:"Input",value:m+1},{type:"Static"}]})),[i,R]=S.useState(x),k=[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"Show all",value:0}],[p,w]=S.useState(10),[l,t]=S.useState(1),r=(l-1)*p,c=p===0?i.length-1:r+p,b=({newRow:a}={})=>{const m=ne(i,e=>{e.push(a??o)});R(m)},y=({rowIndex:a})=>{const m=ne(i,e=>{delete e[a]}).filter(e=>e);R(m)},s=({rowIndex:a,value:m})=>{const e=ne(i,d=>{d[a].cells[0].value.value=m});R(e)},u=({rowIndex:a,value:m})=>{const e=ne(i,d=>{d[a].cells[1].value=m});R(e)},j=({value:a})=>{const m=Number(a);return!Z.isNaN(m)&&Z.isInteger(m)&&m>0},T=i.slice(r,c).map((a,m)=>{const e=r+m;return i.length-1,{...a,cells:a==null?void 0:a.cells.map((d,I)=>{var f,V,F,ee,ie;const P=(F=(V=(f=a==null?void 0:a.cells)==null?void 0:f[0])==null?void 0:V.value)==null?void 0:F.value,v=Number((ie=(ee=a==null?void 0:a.cells)==null?void 0:ee[1])==null?void 0:ie.value),C=h==null?void 0:h[P],H=C&&j({value:v})?(C*v).toFixed(2):null;if(I===0)return{...d,onChange:re=>s({rowIndex:e,value:re.target.value})};if(I===1)return{...d,onChange:re=>u({rowIndex:e,value:re.target.value}),error:j({value:d.value})?null:"Must be valid whole number"};if(I===2)return{...d,value:H}}),actions:[{label:"Delete",icon:"minus",onClick:()=>y({rowIndex:e})}]}});return n.jsx(D,{table:{defaultEmptyRow:o,onAddRow:b,columnAlignment:["left","right","right"],headers:[{cells:[{value:"Drink"},{value:"Quantity"},{value:"Total Price (£)"}],actions:[{primary:!0,icon:"plus",label:"Add",onClick:()=>b()}]}],rows:T,footer:{pagination:{rowCount:i.length,selectedPage:l,rowsPerPage:{onChange:a=>{const{value:m}=a.target;w(Number(m))},options:k,value:p},onSelectPage:a=>t(a),small:!0}}}})},J=()=>{const h=["Section","Width","Height"];let g=Array.from(Array(10),(p,w)=>[w,w*2,w*2]);const[o,x]=S.useState({pastedValues:"",rowIndex:0,cellIndex:0}),i=(p,w,l,t)=>{g[w][l]=Number(p.target.value),t()},R=(p,w,l,t)=>{var c;let r=((c=p==null?void 0:p.clipboardData)==null?void 0:c.getData("text"))??"";return x({rowIndex:w,cellIndex:l,pastedValues:r}),t(),{pastedData:o}},k=()=>{const[p,w]=S.useState(!1),l=()=>{w(!p)},t={headers:[{cells:h.map(r=>({value:r}))}],rows:g.map((r,c)=>{const b=c;return{cells:[...Array(3).keys()].map((y,s)=>({value:r[s],type:"Input",onChange:u=>i(u,b,s,l),onPaste:u=>R(u,b,s,l)}))}})};return n.jsxs(n.Fragment,{children:[n.jsx(D,{table:t}),n.jsx(oe,{label:"Pasted Data",children:n.jsx(se,{value:o.pastedValues})}),n.jsx(oe,{label:"At Row",children:n.jsx(se,{value:o.rowIndex})}),n.jsx(oe,{label:"At Cell Index",children:n.jsx(se,{value:o.cellIndex})})]})};return n.jsx(k,{})},X=()=>{const h={fixedWidth:"auto",name:"Table title",actions:[{icon:"download",tooltip:"Download"}],columnAlignment:[...Array(10)].map((g,o)=>"right"),headers:[{cells:[...Array(10)].map((g,o)=>({value:"Heading"}))},{cells:[...Array(10)].map((g,o)=>({options:[{label:"m",value:"m"},{label:"ft",value:"ft"}],type:"Select",searchable:!1,value:{label:"m",value:"m"},autoLayerWidth:!0}))}],rows:[...Array(10)].map((g,o)=>({cells:[...Array(10)].map((x,i)=>({value:123.45})),actions:[{icon:"help",tooltip:n.jsxs(le,{children:[n.jsx(W,{bold:!0,children:"Title goes here lorem ipsum"}),n.jsx(W,{children:"Label: 123.45m"}),n.jsx(W,{children:"Another label: 123.45m"}),n.jsx(W,{children:"Label: 123.45m"})]})}]}))};return n.jsx(D,{table:h})},Y=()=>{const h={fixedWidth:"auto",name:"Table title",actions:[{icon:"download",tooltip:"Download"}],headers:[{cells:[{value:"Label"},{value:"Value",colSpan:2}]}],rows:[{cells:[{value:"Country",style:{fontWeight:"bold"},width:"120px"},{value:"Norway",colSpan:2}],actions:[{icon:"help",tooltip:n.jsxs(le,{children:[n.jsx(W,{bold:!0,children:"Title goes here"}),n.jsx(W,{children:"Details go here"})]})}]},{cells:[{value:"Depth",style:{fontWeight:"bold"}},{value:123,width:"80px"},{options:[{label:"m",value:"m"},{label:"ft",value:"ft"}],value:{label:"m",value:"m"},type:"Select",width:"80px"}],actions:[{icon:"help",tooltip:n.jsxs(le,{children:[n.jsx(W,{bold:!0,children:"Title goes here"}),n.jsx(W,{children:"Details go here"})]})}]}]};return n.jsx(D,{table:h})};M.__docgenInfo={description:"",methods:[],displayName:"InCard"};q.__docgenInfo={description:"",methods:[],displayName:"Managed"};K.__docgenInfo={description:"",methods:[],displayName:"ManagedWithSort"};B.__docgenInfo={description:"",methods:[],displayName:"ManagedWithFilterAndMultipleSort"};z.__docgenInfo={description:"",methods:[],displayName:"AutoAddNewRow"};J.__docgenInfo={description:"",methods:[],displayName:"OnPasteCallback"};X.__docgenInfo={description:"",methods:[],displayName:"ExampleTableWithInfoTooltips"};Y.__docgenInfo={description:"",methods:[],displayName:"ExampleTableWithInlineUnits"};var ce,de,ue;te.parameters={...te.parameters,docs:{...(ce=te.parameters)==null?void 0:ce.docs,source:{originalSource:`args => {
1
+ import{j as n}from"./jsx-runtime-eps93zm2.js";import{r as S}from"./index-DhsZuJvc.js";import{f as ne}from"./immer.esm-BwVl9PS2.js";import{l as Z}from"./lodash-BHd_uQHh.js";import{G as le}from"./grid-B6LFPf51.js";import{T as W}from"./text-B3-TSWok.js";import{T as D}from"./table-CXUwJOBt.js";import{C as dn}from"./card-EcjmryU9.js";import{I as se}from"./input-BW9trNAW.js";import{F as oe}from"./field-C5_fLDpy.js";import{H as un}from"./heading-NkLgQYoP.js";import{t as ae,x as pn,y as mn,z as gn,A as bn,B as hn,C as wn,D as yn}from"./table.stories-data-DwfKQW7P.js";import"./styled-components.browser.esm-Bf0q9Yjk.js";import"./index-Bk2sglWO.js";import"./index.es-D2piFfFj.js";import"./inheritsLoose-DR8r8Ogv.js";import"./extends-CF3RwP-h.js";import"./redux-tRgGMjwY.js";import"./objectSpread2-DW4nTBoq.js";import"./tiny-invariant-DqLgxztJ.js";import"./index-CUZDtIZe.js";import"./memoize-one.esm-CcMeOnPo.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./actions-CZK3mphC.js";import"./common-types-Sih75Sav.js";import"./disabled-context-rmpd7YJS.js";import"./button-C1sV-0mR.js";import"./spinner-AWUe4xwQ.js";import"./icon-BP4BO6-k.js";import"./index-CEuq6vkz.js";import"./tooltip-1V7clEnw.js";import"./types-BmbYqTX_.js";import"./types-UmZ4Y_CR.js";import"./badge-CLQ59MDF.js";import"./pagination-CqvxiZHR.js";import"./select-tIEV7vnw.js";import"./assertThisInitialized-B9jnkVVz.js";import"./select.input-DIKP56UZ.js";import"./input-group-BaRSJAEN.js";import"./input-group-addon-D68iUKV2.js";import"./number-input-uQOVHv2N.js";import"./index-CWz-hU-f.js";import"./index-DRSy5Ssd.js";import"./check-box-CaSrhzev.js";import"./help-icon-41R-Z9N1.js";import"./slider-gZmYlxxz.js";import"./index-BI4_Bp97.js";import"./popover-DgUpTRMk.js";import"./label-hiSz3I8H.js";import"./flex-EllkLxgO.js";const bt={title:"Basic/Table",component:D,args:{table:{...ae}}},A=h=>n.jsx(D,{...h}),te=A.bind({}),E=A.bind({});E.args={table:{...ae,fixedWidth:"400px"}};const L=A.bind({});L.args={table:{...ae,fixedWidth:"auto"}};const _=A.bind({});_.args={table:pn};_.parameters={docs:{description:{story:"Use sparingly when certain columns cannot be below a certain width. Unless the Table is auto width, set one column to `auto` to use remaining space."}}};const Q=A.bind({});Q.args={table:mn};const O=A.bind({});O.args={table:gn};O.parameters={docs:{description:{story:"This is only required when you need to override `columnAlignment` in header cells (i.e. they have different alignment)"}}};const G=A.bind({});G.args={table:bn};const N=A.bind({});N.args={table:hn};N.decorators=[h=>n.jsx("div",{style:{position:"absolute",inset:0,padding:"var(--padding)"},children:n.jsx(h,{})})];const U=A.bind({});U.args={table:wn};U.parameters={docs:{description:{story:"If a `maxHeight` is set, the table should only fill that height if it needs to."}}};const $=A.bind({});$.args={table:yn};const M=()=>n.jsx(dn,{heading:n.jsx(un,{children:"Card heading"}),padding:!1,children:n.jsx(D,{table:{...ae,bordered:!1}})});M.parameters={docs:{source:{type:"dynamic"}}};const q=()=>{const h=["Section","Width","Height"];let g=["","m","m"],o=[...Array(175).keys()].map((l,t)=>[t,t*2,t*2]);const x=(l,t,r)=>l==="m"&&t==="ft"?r*3.28084:l==="ft"&&t==="m"?r/3.28084:r,i=(l,t,r,c)=>{o[t][r]=l.target.value,c()},R=l=>{o=o.concat([["","",""]]),l()},k=(l,t)=>{o=o.filter((r,c)=>c!==l),t()},p=(l,t,r)=>{const c=g[t],b=l.target.value;g=g.map((y,s)=>s===t?b:y),o=o.map(y=>y.map((s,u)=>u===t?x(c,b,s):s)),r()},w=()=>{const l=[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"Show all",value:0}],[t,r]=S.useState(10),[c,b]=S.useState(1),[y,s]=S.useState(!1),u=()=>{s(!y)},j=()=>{const e=Math.ceil(o.length/t);b(e)},T=(c-1)*t,a=t===0?o.length-1:T+t,m={headers:[{cells:h.map(e=>({value:e})),actions:[{primary:!0,label:"Add",icon:"add",onClick:()=>{R(u),j()}}]},{cells:[{},{options:[{label:"m",value:"m"},{label:"ft",value:"ft"}],value:g[1],type:"Select",native:!0,onChange:e=>p(e,1,u)},{options:[{label:"m",value:"m"},{label:"ft",value:"ft"}],value:g[2],type:"Select",native:!0,onChange:e=>p(e,2,u)}]}],rows:o.slice(T,a).map((e,d)=>{const I=T+d;return{cells:[...Array(3).keys()].map((P,v)=>({value:e[v],type:"Input",onChange:C=>i(C,I,v,u)})),actions:[{label:"Delete",icon:"minus",onClick:()=>k(I,u)}]}}),footer:{pagination:{rowCount:o.length,selectedPage:c,rowsPerPage:{onChange:e=>{const{value:d}=e.target;r(Number(d))},options:l,value:t},onSelectPage:e=>b(e),small:!0}}};return n.jsx(D,{table:m})};return n.jsx(w,{})},K=()=>{const h=["Section","Width","Height"];let g=[...Array(20).keys()].map((x,i)=>({Section:Z.random(0,100),Width:Z.random(0,100),Height:Z.random(0,100)}));const o=()=>{const[x,i]=S.useState({Section:"up"}),R=(r,c)=>r.sort((b,y)=>Object.entries(c).map(([s,u])=>{switch(u){case"up":return b[s]-y[s];case"down":return y[s]-b[s];default:return 0}}).reduce((s,u)=>s||u,0)),k=(r,c,b)=>({dataSortCells:r.map(s=>{const u=Object.keys(c).includes(s)?c[s]:"",j=`${s[0].toUpperCase()}${s.slice(1)}`;return{key:s,value:j,hasSort:!0,sort:u,onSort:()=>{const T=u==="up"?"down":"up";b({[s]:T})}}})}),{dataSortCells:p}=k(h,x,i),l=[...R(g,x).map(r=>({cells:Object.entries(r).map(([b,y])=>({key:b,value:y,type:"Input",disabled:!0}))}))],t={headers:[{cells:p}],rows:l};return n.jsx(D,{table:t})};return n.jsx(o,{})},B=()=>{const h=["Section","Width","Height"];let g=[...Array(175).keys()].map((x,i)=>({Section:i,Width:i*2,Height:i*2}));const o=()=>{const x=[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"Show all",value:0}],[i,R]=S.useState(10),[k,p]=S.useState(1),[w,l]=S.useState({}),[t,r]=S.useState({});S.useEffect(()=>{p(1)},[w,t]);const c=(k-1)*i,b=i===0?g.length-1:c+i,y=(e,d,I)=>e.filter(P=>Object.keys(d).every(v=>d[v]===""?!0:P[v].toString().includes(d[v]))).sort((P,v)=>Object.entries(I).map(([C,H])=>{switch(H){case"up":return P[C]-v[C];case"down":return v[C]-P[C];default:return 0}}).reduce((C,H)=>C||H,0)),s=(e,d,I,P,v)=>{const C=e.map(f=>{const V=Object.keys(P).includes(f)?P[f]:"",F=`${f[0].toUpperCase()}${f.slice(1)}`;return{key:f,value:F,hasSort:!0,sort:V,onSort:()=>{const ee=V===""?"up":V==="up"?"down":"";v({...P,[f]:ee})}}}),H=e.map(f=>{const V=Object.keys(d).includes(f)?d[f]:"";return{key:f,value:V,type:"Input",placeholder:"Filter",onChange:F=>I({...d,[f]:F.target.value})}});return{dataSortCells:C,dataFilterCells:H}},{dataSortCells:u,dataFilterCells:j}=s(h,w,l,t,r),T=y(g,w,t),a=[...T.slice(c,b).map(e=>({cells:Object.entries(e).map(([I,P])=>({key:I,value:P,type:"Input",disabled:!0}))}))],m={headers:[{cells:u},{cells:j}],rows:a,footer:{pagination:{rowCount:T.length,selectedPage:k,rowsPerPage:{onChange:e=>{const{value:d}=e.target;R(Number(d))},options:x,value:i},onSelectPage:e=>p(e),small:!0}}};return n.jsx(D,{table:m})};return n.jsx(o,{})},z=()=>{const h={tea:3.6,coffee:3.2,orange:4.1},g=[{label:"Tea",value:"tea"},{label:"Coffee",value:"coffee"},{label:"Orange juice",value:"orange"}],o={cells:[{type:"Select",options:g,value:{value:"tea"}},{type:"Input"},{type:"Static"}]},x=[...Array(15).keys()].map((a,m)=>({cells:[{type:"Select",options:g,value:{value:"tea"}},{type:"Input",value:m+1},{type:"Static"}]})),[i,R]=S.useState(x),k=[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"Show all",value:0}],[p,w]=S.useState(10),[l,t]=S.useState(1),r=(l-1)*p,c=p===0?i.length-1:r+p,b=({newRow:a}={})=>{const m=ne(i,e=>{e.push(a??o)});R(m)},y=({rowIndex:a})=>{const m=ne(i,e=>{delete e[a]}).filter(e=>e);R(m)},s=({rowIndex:a,value:m})=>{const e=ne(i,d=>{d[a].cells[0].value.value=m});R(e)},u=({rowIndex:a,value:m})=>{const e=ne(i,d=>{d[a].cells[1].value=m});R(e)},j=({value:a})=>{const m=Number(a);return!Z.isNaN(m)&&Z.isInteger(m)&&m>0},T=i.slice(r,c).map((a,m)=>{const e=r+m;return i.length-1,{...a,cells:a==null?void 0:a.cells.map((d,I)=>{var f,V,F,ee,ie;const P=(F=(V=(f=a==null?void 0:a.cells)==null?void 0:f[0])==null?void 0:V.value)==null?void 0:F.value,v=Number((ie=(ee=a==null?void 0:a.cells)==null?void 0:ee[1])==null?void 0:ie.value),C=h==null?void 0:h[P],H=C&&j({value:v})?(C*v).toFixed(2):null;if(I===0)return{...d,onChange:re=>s({rowIndex:e,value:re.target.value})};if(I===1)return{...d,onChange:re=>u({rowIndex:e,value:re.target.value}),error:j({value:d.value})?null:"Must be valid whole number"};if(I===2)return{...d,value:H}}),actions:[{label:"Delete",icon:"minus",onClick:()=>y({rowIndex:e})}]}});return n.jsx(D,{table:{defaultEmptyRow:o,onAddRow:b,columnAlignment:["left","right","right"],headers:[{cells:[{value:"Drink"},{value:"Quantity"},{value:"Total Price (£)"}],actions:[{primary:!0,icon:"plus",label:"Add",onClick:()=>b()}]}],rows:T,footer:{pagination:{rowCount:i.length,selectedPage:l,rowsPerPage:{onChange:a=>{const{value:m}=a.target;w(Number(m))},options:k,value:p},onSelectPage:a=>t(a),small:!0}}}})},J=()=>{const h=["Section","Width","Height"];let g=Array.from(Array(10),(p,w)=>[w,w*2,w*2]);const[o,x]=S.useState({pastedValues:"",rowIndex:0,cellIndex:0}),i=(p,w,l,t)=>{g[w][l]=Number(p.target.value),t()},R=(p,w,l,t)=>{var c;let r=((c=p==null?void 0:p.clipboardData)==null?void 0:c.getData("text"))??"";return x({rowIndex:w,cellIndex:l,pastedValues:r}),t(),{pastedData:o}},k=()=>{const[p,w]=S.useState(!1),l=()=>{w(!p)},t={headers:[{cells:h.map(r=>({value:r}))}],rows:g.map((r,c)=>{const b=c;return{cells:[...Array(3).keys()].map((y,s)=>({value:r[s],type:"Input",onChange:u=>i(u,b,s,l),onPaste:u=>R(u,b,s,l)}))}})};return n.jsxs(n.Fragment,{children:[n.jsx(D,{table:t}),n.jsx(oe,{label:"Pasted Data",children:n.jsx(se,{value:o.pastedValues})}),n.jsx(oe,{label:"At Row",children:n.jsx(se,{value:o.rowIndex})}),n.jsx(oe,{label:"At Cell Index",children:n.jsx(se,{value:o.cellIndex})})]})};return n.jsx(k,{})},X=()=>{const h={fixedWidth:"auto",name:"Table title",actions:[{icon:"download",tooltip:"Download"}],columnAlignment:[...Array(10)].map((g,o)=>"right"),headers:[{cells:[...Array(10)].map((g,o)=>({value:"Heading"}))},{cells:[...Array(10)].map((g,o)=>({options:[{label:"m",value:"m"},{label:"ft",value:"ft"}],type:"Select",searchable:!1,value:{label:"m",value:"m"},autoLayerWidth:!0}))}],rows:[...Array(10)].map((g,o)=>({cells:[...Array(10)].map((x,i)=>({value:123.45})),actions:[{icon:"help",tooltip:n.jsxs(le,{children:[n.jsx(W,{bold:!0,children:"Title goes here lorem ipsum"}),n.jsx(W,{children:"Label: 123.45m"}),n.jsx(W,{children:"Another label: 123.45m"}),n.jsx(W,{children:"Label: 123.45m"})]})}]}))};return n.jsx(D,{table:h})},Y=()=>{const h={fixedWidth:"auto",name:"Table title",actions:[{icon:"download",tooltip:"Download"}],headers:[{cells:[{value:"Label"},{value:"Value",colSpan:2}]}],rows:[{cells:[{value:"Country",style:{fontWeight:"bold"},width:"120px"},{value:"Norway",colSpan:2}],actions:[{icon:"help",tooltip:n.jsxs(le,{children:[n.jsx(W,{bold:!0,children:"Title goes here"}),n.jsx(W,{children:"Details go here"})]})}]},{cells:[{value:"Depth",style:{fontWeight:"bold"}},{value:123,width:"80px"},{options:[{label:"m",value:"m"},{label:"ft",value:"ft"}],value:{label:"m",value:"m"},type:"Select",width:"80px"}],actions:[{icon:"help",tooltip:n.jsxs(le,{children:[n.jsx(W,{bold:!0,children:"Title goes here"}),n.jsx(W,{children:"Details go here"})]})}]}]};return n.jsx(D,{table:h})};M.__docgenInfo={description:"",methods:[],displayName:"InCard"};q.__docgenInfo={description:"",methods:[],displayName:"Managed"};K.__docgenInfo={description:"",methods:[],displayName:"ManagedWithSort"};B.__docgenInfo={description:"",methods:[],displayName:"ManagedWithFilterAndMultipleSort"};z.__docgenInfo={description:"",methods:[],displayName:"AutoAddNewRow"};J.__docgenInfo={description:"",methods:[],displayName:"OnPasteCallback"};X.__docgenInfo={description:"",methods:[],displayName:"ExampleTableWithInfoTooltips"};Y.__docgenInfo={description:"",methods:[],displayName:"ExampleTableWithInlineUnits"};var ce,de,ue;te.parameters={...te.parameters,docs:{...(ce=te.parameters)==null?void 0:ce.docs,source:{originalSource:`args => {
2
2
  return <Table
3
3
  // eslint-disable-next-line react/jsx-props-no-spreading
4
4
  {...args} />;
@@ -1 +1 @@
1
- import{j as t}from"./jsx-runtime-eps93zm2.js";import{I as o,T as c}from"./common-types-Sih75Sav.js";import{F as v}from"./flex-EllkLxgO.js";import{M as p}from"./actions-Cu_0szZ4.js";import{T as d}from"./text-B3-TSWok.js";import{I as n}from"./icon-BP4BO6-k.js";import{M as r}from"./types-BmbYqTX_.js";const e={headers:[{cells:[{value:"Name"},{value:"Weight"},{value:"Energy"},{value:"Origin"}]}],rows:[{cells:[{value:"Brown rice",testId:"table-tbody-cell-brown-rice"},{value:100,testId:"table-tbody-cell-100"},{value:361,testId:"table-tbody-cell-361"},{value:"Vietnam",testId:"table-tbody-cell-vietnam"}]},{cells:[{value:"Buckwheat",testId:"table-tbody-cell-buckwheat"},{value:50,testId:"table-tbody-cell-50"},{value:358,testId:"table-tbody-cell-358"},{value:"Poland",testId:"table-tbody-cell-poland"}]},{cells:[{value:"Couscous",testId:"table-tbody-cell-couscous"},{value:10,testId:"table-tbody-cell-10"},{value:368,testId:"table-tbody-cell-368"},{value:"France",testId:"table-tbody-cell-france"}]}]},S={...e,columnWidths:["200px","20%","100px","auto"]},x={...e,rows:e.rows.map(l=>({...l,cells:l.cells.map(a=>({...a,tooltip:"Tooltip"}))}))},f={...e,rows:e.rows.map(l=>({...l,cells:l.cells.map(a=>({...a,width:"200px"}))}))},W={...e,rows:e.rows.map(l=>({...l,cells:l.cells.map(a=>({...a,style:{width:"200px",background:"var(--color-background-table-header)",fontWeight:"bold"}}))}))},F={...e,rows:[{cells:[{breakWord:!0,value:"LoremipsumdolorsitametconsecteturadipiscingelitseddoeiusmodtemporincididuntutlaboreetdoloremagnaaliquaUtenimadminimveniamquisnostrudexercitationullamcolaborisnisiutaliquipexeacommodoconsequatDuisauteiruredolorinreprehenderitinvoluptatevelitessecillumdoloreeullamcolaborisnisiutaliquipexeacommodoconsequatDuisauteiruredolorinreprehenderitinvoluptatevelitessecillumdoloreeufugiatnullapariaturufugiatnullapariatur"},{value:100},{value:361},{value:"Vietnam"}]},...e.rows]},D={...e,headers:[...e.headers,{cells:[{},{options:[{label:"kg",value:"kg"},{label:"tonnes",value:"tonnes"}],type:"Select",searchable:!1,value:{label:"kg",value:"kg"},onChange:()=>{}},{type:"Unit",value:"kcal / 100g"},{}]}]},L={...e,rows:e.rows.map((l,a)=>({...l,active:a===0,onRowClick:()=>{}}))},E={...e,rows:e.rows.map((l,a)=>({...l,error:a===1}))},A={...e,rows:e.rows.map((l,a)=>({...l,warning:a===1}))},P={...e,name:"Food"},V={...e,name:t.jsxs(v,{gap:"var(--padding-xs)",alignItems:"center",children:["Food",t.jsx(n,{icon:o.STAR})]})},u=[{childComponent:t.jsx(p,{menu:{label:"Import food",trigger:c.DROP_DOWN_BUTTON,sections:[{type:r.HEADING,label:"Import options"},{type:r.OPTION,label:"Import from csv"},{type:r.OPTION,label:"Import from library"}],small:!0}})}],B={...e,name:"Food",actions:u,testId:"table-child-component"},N={...e,actions:u,actionsRight:!0},i={...e,headers:[...e.headers,{cells:[{},{options:[{label:"kg",value:"kg"},{label:"tonnes",value:"tonnes"}],type:"Select",native:!0,value:{label:"kg",value:"kg"},onChange:()=>{}},{type:"Unit",value:"kcal / 100g"},{}]}],bordered:!0,infiniteScroll:!0,maxHeight:"500px",stickyHeaders:!0,rows:Array.from({length:100},(l,a)=>({cells:[{type:"Input",value:`Strawberry Letter ${a+1}`},{type:"Input",value:100},{type:"Input",value:361},{type:"Input",value:"Vietnam"}]})),footer:{content:t.jsxs(t.Fragment,{children:[t.jsx("strong",{children:"Footer content:"})," goes here"]})}},O={...i,maxHeight:"100%"},j={...i,rows:Array.from({length:1},(l,a)=>({cells:[{type:"Input",value:`Strawberry Letter ${a+1}`},{type:"Input",value:100},{type:"Input",value:361},{type:"Input",value:"Vietnam"}]}))},T={...i,draggable:!0},H={...e,rows:e.rows.map(l=>({...l,onRowFocus:()=>{}}))},b=()=>t.jsxs("ul",{children:[t.jsx("li",{children:"Carrots"}),t.jsx("li",{children:"Chocolate"}),t.jsx("li",{children:"Chorizo"})]}),R={headers:[{cells:[{value:"Name"},{value:"Content"}]}],rows:[{cells:[{value:"Sub-component"},{value:b()}]},{cells:[{value:"JSX"},{value:t.jsxs("div",{children:["Some ",t.jsx(d,{bold:!0,children:"bold content"})]})}]}]},m={...e,headers:[{cells:[{value:""},{value:"Stats",colSpan:2},{value:""}]},...e.headers],rows:[...e.rows,{cells:[{value:"Total",colSpan:4}]}]},q={...e,headers:[{cells:[{value:"Name",colSpan:2},{value:"Origin",rowSpan:2}]},{cells:[{value:"English"},{value:"Chinese"}]}],rows:[{cells:[{type:"Input",value:"Brown rice"},{type:"Input",value:"糙米"},{type:"Select",options:[{label:"China",value:"China"},{label:"France",value:"France"},{label:"Poland",value:"Poland"}],value:{label:"China",value:"China"},rowSpan:2}]},{cells:[{type:"Input",value:"White rice"},{type:"Input",value:"白米"}]}]},M={...e,columnWidths:["auto","120px","120px","auto"],headers:[{cells:[{value:"Header"},{value:"Header",colSpan:2},{value:"Header"}]}]},U={...e,columnAlignment:["left","right","right","left"]},J={...m,columnAlignment:["left","right","right","left","right"],columnHeaderAlignments:[["","center",""],["","right","right",""]]},s={fixedWidth:"auto",headers:[{cells:[{value:"Input",testId:"with-editable-cells-cell-name",width:"140px"},{value:"Select (native)",width:"140px"},{value:"Number Input",width:"140px"},{value:"Select (custom)",width:"140px"},{value:"Slider",width:"140px"},{value:"Static"}]}],rows:[{cells:[{value:"Buckwheat",type:"Input",onChange:()=>{},testId:"table-tbody-cell-buckwheat"},{type:"Select",native:!0,options:[{label:50,value:50},{label:100,value:100}],value:{label:100,value:100},onChange:()=>{}},{value:361,type:"NumberInput",onChange:()=>{}},{type:"Select",options:[{label:"France",value:"France"},{label:"Poland",value:"Poland"},{label:"Vietnam",value:"Vietnam"}],value:{label:"Poland",value:"Poland"},onChange:()=>{}},{type:"Slider",value:50,min:0,max:100,onChange:()=>{}},{value:361}]},{cells:[{value:"Arborio rice",type:"Input",onChange:()=>{},testId:"table-tbody-cell-arborio",error:"Error"},{type:"Select",native:!0,options:[{label:50,value:50},{label:100,value:100}],value:{label:100,value:100},onChange:()=>{},error:"Error"},{value:361,type:"NumberInput",onChange:()=>{},error:"Error"},{type:"Select",options:[{label:"France",value:"France"},{label:"Italy",value:"Italy"},{label:"Vietnam",value:"Vietnam"}],value:{label:"Italy",value:"Italy"},onChange:()=>{},error:"Error"},{type:"Slider",value:50,min:0,max:100,onChange:()=>{},error:"Error"},{value:361,error:"Error"}]},{cells:[{value:"Couscous",type:"Input",onChange:()=>{},testId:"table-tbody-cell-couscous",warning:"Warning"},{type:"Select",native:!0,options:[{label:50,value:50},{label:100,value:100}],value:{label:100,value:100},onChange:()=>{},warning:"Warning"},{value:361,type:"NumberInput",onChange:()=>{},warning:"Warning"},{type:"Select",options:[{label:"France",value:"France"},{label:"Poland",value:"Poland"},{label:"Vietnam",value:"Vietnam"}],value:{label:"France",value:"France"},onChange:()=>{},warning:"Warning"},{type:"Slider",value:50,min:0,max:100,onChange:()=>{},warning:"Warning"},{value:361,warning:"Warning"}]}]},z={...e,headers:e.headers.map(l=>({...l,cells:[{type:"CheckBox",onChange:()=>{}},...l.cells]})),rows:e.rows.map(l=>({...l,cells:[{type:"CheckBox",onChange:()=>{}},...l.cells]}))},_={...s,rows:s.rows.map(l=>({...l,cells:l.cells.map(a=>({...a,disabled:!0}))}))},G={...e,headers:[...e.headers,{cells:[{value:"",type:"Input",placeholder:"Search",onChange:()=>{}},{value:"",type:"Input",placeholder:"Search",onChange:()=>{}},{value:"",type:"Input",placeholder:"Search",onChange:()=>{}},{value:"",type:"Input",placeholder:"Search",onChange:()=>{}}]}]},$={headers:[{cells:[{value:"Name"},{value:"Weight (kg)",hasSort:!0,sort:"up",sortPriority:1,onSort:()=>{}},{value:"Energy (kcal / 100g)",hasSort:!0,sort:"down",sortPriority:2,onSort:()=>{}},{value:"Origin",hasSort:!0,sort:"",sortPriority:1,onSort:()=>{}}]}],rows:[{cells:[{value:"Brown rice"},{value:100},{value:361},{value:"Vietnam"}]},{cells:[{value:"Buckwheat"},{value:50},{value:358},{value:"Poland"}]},{cells:[{value:"Couscous"},{value:10},{value:368},{value:"France"}]}]},K={headers:[{cells:[{},{value:"Name"},{value:"Weight (kg)"},{value:"Energy (kcal / 100g)"},{value:"Origin"}]}],rows:[{cells:[{type:"Icon",icon:t.jsx(n,{icon:o.SUCCESS,color:"var(--color-text-success)"}),tooltip:"Success tooltip here",width:"var(--size)"},{value:"Brown rice"},{value:100},{value:361},{value:"Vietnam"}]},{cells:[{type:"Icon",icon:t.jsx(n,{icon:o.WARNING,color:"var(--color-text-warning)"}),tooltip:"Warning tooltip here",width:"var(--size)"},{value:"Buckwheat"},{value:50},{value:358},{value:"Poland"}]},{cells:[{type:"Icon",icon:t.jsx(n,{icon:o.ERROR,color:"var(--color-text-error)"}),tooltip:"Error tooltip here",width:"var(--size)"},{value:"Couscous"},{value:10},{value:368},{value:"France"}]}]},X={headers:[{cells:[{value:"Lorem"},{value:"Ipsum"}]}],rows:[{cells:[{type:"Link",value:"Link text",onClick:()=>console.log("Link clicked")},{type:"Link",value:"Disabled link text",disabled:!0,onClick:()=>console.log("Link clicked")}]},{cells:[{type:"Link",value:"Static warning link",warning:"Warning message",onClick:()=>console.log("Link clicked")},{type:"Link",value:"Static error link",error:"Error message",onClick:()=>console.log("Link clicked")}]}]},Q={headers:[{cells:[{value:"Name"},{value:"Weight (kg)"},{value:"Energy (kcal / 100g)"},{value:"Origin"},{value:"Lorem"},{value:"Ipsum"},{value:"Dolor"}],actions:[{primary:!0,label:"Add",icon:"add",onClick:()=>{}}]}],rows:[{cells:[{value:"Brown rice"},{value:100},{value:361},{value:"Vietnam"},{value:"Lorem"},{value:"Ipsum"},{value:"Dolor"}],actions:[{label:"Delete",icon:"minus",onClick:()=>{}}]},{cells:[{value:"Buckwheat"},{value:50},{value:358},{value:"Poland"},{value:"Lorem"},{value:"Ipsum"},{value:"Dolor"}],actions:[{label:"Delete",icon:"minus",onClick:()=>{}}]},{cells:[{value:"Couscous"},{value:10},{value:368},{value:"France"},{value:"Lorem"},{value:"Ipsum"},{value:"Dolor"}],actions:[{label:"test",icon:"minus",onClick:()=>{},hidden:!0}]}]},Y={headers:[{cells:[{value:"Name"},{value:"Weight (kg)"},{value:"Energy (kcal / 100g)"},{value:"Origin"}],actions:[{primary:!0,label:"Add",icon:"add",onClick:()=>{}}]}],rows:[{cells:[{value:"Brown rice"},{value:100},{value:361},{value:"Vietnam"}],actions:[{label:"More",subActions:[{label:"Move Up",icon:"up",onClick:()=>{}},{label:"Move Down",icon:"down",onClick:()=>{}}]},{label:"Delete",icon:"minus",onClick:()=>{}}]},{cells:[{value:"Buckwheat"},{value:50},{value:358},{value:"Poland"}],actions:[{label:"More",subActions:[{label:"Move Up",icon:"up",onClick:()=>{}},{label:"Move Down",icon:"down",onClick:()=>{}}]},{label:"Delete",icon:"minus",onClick:()=>{}}]},{cells:[{value:"Couscous"},{value:10},{value:368},{value:"France"}],actions:[{label:"More",subActions:[{label:"Move Up",icon:"up",onClick:()=>{}},{label:"Move Down",icon:"down",onClick:()=>{}}]},{label:"Delete",icon:"minus",onClick:()=>{}}]}]},Z={...e,footer:{content:t.jsxs(t.Fragment,{children:[t.jsx("strong",{children:"Footer content:"})," goes here"]}),pagination:{rowCount:500,selectedPage:10,rowsPerPage:{onChange:()=>{},options:[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"Show all",value:0}],value:20},goTo:{onChange:()=>{}},onSelectPage:()=>{},small:!0},actions:[{label:"Star",icon:"star",onClick:()=>{}}]}},ee={...e,headers:e.headers.map(l=>({...l,cells:l.cells.map(a=>({...a,helpIcon:{onClick:()=>console.log("Help clicked"),tooltip:"Help text goes here"},libraryIcon:{onClick:()=>console.log("Library clicked"),tooltip:"Edit in library"}}))}))},le={columnWidths:[void 0,"100px","100px","100px",void 0],columnAlignment:["left","right","left","left","left","right"],columnHeaderAlignments:[["left","right","left","left","left","right"]],headers:[{cells:[{value:"Lorem ipsum dolor sit amet consectetur adipiscing elit sed doeius mod tempor incididunt laboreet dolore magna aliqua"},{value:"Weight (kg)"},{value:"Energy (kcal / 100g)"},{value:"Origin"},{value:"Static"},{value:"Static Right"}]}],rows:[{cells:[{breakWord:!0,value:"LoremipsumdolorsitametconsecteturadipiscingelitseddoeiusmodtemporincididuntutlaboreetdoloremagnaaliquaUtenimadminimveniamquisnostrudexercitationullamcolaborisnisiutaliquipexeacommodoconsequatDuisauteiruredolorinreprehenderitinvoluptatevelitessecillumdoloreeullamcolaborisnisiutaliquipexeacommodoconsequatDuisauteiruredolorinreprehenderitinvoluptatevelitessecillumdoloreeufugiatnullapariaturufugiatnullapariatur"},{type:"Select",native:!0,options:[{label:50,value:50},{label:100,value:100}],value:{label:100,value:100},onChange:()=>{},disabled:!0},{type:"Select",options:[{label:"Vietnam",value:"Vietnam"},{label:"Other",value:"Other"}],value:{label:"Vietnam",value:"Vietnam"},onChange:()=>{},error:"Error"},{value:"Brown rice",type:"Input",onChange:()=>{},testId:"table-tbody-cell-brown-rice",warning:"Warning message"},{value:"Static warning",warning:"Warning message"},{value:"100"}]},{cells:[{value:"Buckwheat"},{type:"Select",native:!0,options:[{label:50,value:50},{label:100,value:100}],value:{label:100,value:100},onChange:()=>{}},{type:"Select",options:[{label:"Vietnam",value:"Vietnam"},{label:"Other",value:"Other"}],value:{label:"Vietnam",value:"Vietnam"},onChange:()=>{}},{value:"Brown rice",type:"Input",onChange:()=>{},testId:"table-tbody-cell-brown-rice"},{type:"Link",value:"Static error link",error:"Error message"},{value:"100"}]}]},ae={fixedWidth:"auto",headers:[{cells:[{value:"Name"},{value:"Date of birth"}]}],rows:[{cells:[{value:"John Smith",width:"140px"},{value:"1980-05-05",type:"DateInput",width:"110px"}]},{cells:[{value:"Jane Doe",width:"140px"},{value:"1984-12-12",type:"DateInput",width:"110px"}]}]};export{i as A,O as B,j as C,T as D,D as E,P as F,V as G,B as H,G as I,$ as J,N as K,ee as L,s as a,_ as b,ae as c,m as d,M as e,f,W as g,q as h,z as i,K as j,X as k,Q as l,Y as m,R as n,x as o,F as p,le as q,Z as r,L as s,e as t,E as u,A as v,H as w,S as x,U as y,J as z};
1
+ import{j as t}from"./jsx-runtime-eps93zm2.js";import{I as o,T as c}from"./common-types-Sih75Sav.js";import{F as v}from"./flex-EllkLxgO.js";import{M as p}from"./actions-CZK3mphC.js";import{T as d}from"./text-B3-TSWok.js";import{I as n}from"./icon-BP4BO6-k.js";import{M as r}from"./types-BmbYqTX_.js";const e={headers:[{cells:[{value:"Name"},{value:"Weight"},{value:"Energy"},{value:"Origin"}]}],rows:[{cells:[{value:"Brown rice",testId:"table-tbody-cell-brown-rice"},{value:100,testId:"table-tbody-cell-100"},{value:361,testId:"table-tbody-cell-361"},{value:"Vietnam",testId:"table-tbody-cell-vietnam"}]},{cells:[{value:"Buckwheat",testId:"table-tbody-cell-buckwheat"},{value:50,testId:"table-tbody-cell-50"},{value:358,testId:"table-tbody-cell-358"},{value:"Poland",testId:"table-tbody-cell-poland"}]},{cells:[{value:"Couscous",testId:"table-tbody-cell-couscous"},{value:10,testId:"table-tbody-cell-10"},{value:368,testId:"table-tbody-cell-368"},{value:"France",testId:"table-tbody-cell-france"}]}]},S={...e,columnWidths:["200px","20%","100px","auto"]},x={...e,rows:e.rows.map(l=>({...l,cells:l.cells.map(a=>({...a,tooltip:"Tooltip"}))}))},f={...e,rows:e.rows.map(l=>({...l,cells:l.cells.map(a=>({...a,width:"200px"}))}))},W={...e,rows:e.rows.map(l=>({...l,cells:l.cells.map(a=>({...a,style:{width:"200px",background:"var(--color-background-table-header)",fontWeight:"bold"}}))}))},F={...e,rows:[{cells:[{breakWord:!0,value:"LoremipsumdolorsitametconsecteturadipiscingelitseddoeiusmodtemporincididuntutlaboreetdoloremagnaaliquaUtenimadminimveniamquisnostrudexercitationullamcolaborisnisiutaliquipexeacommodoconsequatDuisauteiruredolorinreprehenderitinvoluptatevelitessecillumdoloreeullamcolaborisnisiutaliquipexeacommodoconsequatDuisauteiruredolorinreprehenderitinvoluptatevelitessecillumdoloreeufugiatnullapariaturufugiatnullapariatur"},{value:100},{value:361},{value:"Vietnam"}]},...e.rows]},D={...e,headers:[...e.headers,{cells:[{},{options:[{label:"kg",value:"kg"},{label:"tonnes",value:"tonnes"}],type:"Select",searchable:!1,value:{label:"kg",value:"kg"},onChange:()=>{}},{type:"Unit",value:"kcal / 100g"},{}]}]},L={...e,rows:e.rows.map((l,a)=>({...l,active:a===0,onRowClick:()=>{}}))},E={...e,rows:e.rows.map((l,a)=>({...l,error:a===1}))},A={...e,rows:e.rows.map((l,a)=>({...l,warning:a===1}))},P={...e,name:"Food"},V={...e,name:t.jsxs(v,{gap:"var(--padding-xs)",alignItems:"center",children:["Food",t.jsx(n,{icon:o.STAR})]})},u=[{childComponent:t.jsx(p,{menu:{label:"Import food",trigger:c.DROP_DOWN_BUTTON,sections:[{type:r.HEADING,label:"Import options"},{type:r.OPTION,label:"Import from csv"},{type:r.OPTION,label:"Import from library"}],small:!0}})}],B={...e,name:"Food",actions:u,testId:"table-child-component"},N={...e,actions:u,actionsRight:!0},i={...e,headers:[...e.headers,{cells:[{},{options:[{label:"kg",value:"kg"},{label:"tonnes",value:"tonnes"}],type:"Select",native:!0,value:{label:"kg",value:"kg"},onChange:()=>{}},{type:"Unit",value:"kcal / 100g"},{}]}],bordered:!0,infiniteScroll:!0,maxHeight:"500px",stickyHeaders:!0,rows:Array.from({length:100},(l,a)=>({cells:[{type:"Input",value:`Strawberry Letter ${a+1}`},{type:"Input",value:100},{type:"Input",value:361},{type:"Input",value:"Vietnam"}]})),footer:{content:t.jsxs(t.Fragment,{children:[t.jsx("strong",{children:"Footer content:"})," goes here"]})}},O={...i,maxHeight:"100%"},j={...i,rows:Array.from({length:1},(l,a)=>({cells:[{type:"Input",value:`Strawberry Letter ${a+1}`},{type:"Input",value:100},{type:"Input",value:361},{type:"Input",value:"Vietnam"}]}))},T={...i,draggable:!0},H={...e,rows:e.rows.map(l=>({...l,onRowFocus:()=>{}}))},b=()=>t.jsxs("ul",{children:[t.jsx("li",{children:"Carrots"}),t.jsx("li",{children:"Chocolate"}),t.jsx("li",{children:"Chorizo"})]}),R={headers:[{cells:[{value:"Name"},{value:"Content"}]}],rows:[{cells:[{value:"Sub-component"},{value:b()}]},{cells:[{value:"JSX"},{value:t.jsxs("div",{children:["Some ",t.jsx(d,{bold:!0,children:"bold content"})]})}]}]},m={...e,headers:[{cells:[{value:""},{value:"Stats",colSpan:2},{value:""}]},...e.headers],rows:[...e.rows,{cells:[{value:"Total",colSpan:4}]}]},q={...e,headers:[{cells:[{value:"Name",colSpan:2},{value:"Origin",rowSpan:2}]},{cells:[{value:"English"},{value:"Chinese"}]}],rows:[{cells:[{type:"Input",value:"Brown rice"},{type:"Input",value:"糙米"},{type:"Select",options:[{label:"China",value:"China"},{label:"France",value:"France"},{label:"Poland",value:"Poland"}],value:{label:"China",value:"China"},rowSpan:2}]},{cells:[{type:"Input",value:"White rice"},{type:"Input",value:"白米"}]}]},M={...e,columnWidths:["auto","120px","120px","auto"],headers:[{cells:[{value:"Header"},{value:"Header",colSpan:2},{value:"Header"}]}]},U={...e,columnAlignment:["left","right","right","left"]},J={...m,columnAlignment:["left","right","right","left","right"],columnHeaderAlignments:[["","center",""],["","right","right",""]]},s={fixedWidth:"auto",headers:[{cells:[{value:"Input",testId:"with-editable-cells-cell-name",width:"140px"},{value:"Select (native)",width:"140px"},{value:"Number Input",width:"140px"},{value:"Select (custom)",width:"140px"},{value:"Slider",width:"140px"},{value:"Static"}]}],rows:[{cells:[{value:"Buckwheat",type:"Input",onChange:()=>{},testId:"table-tbody-cell-buckwheat"},{type:"Select",native:!0,options:[{label:50,value:50},{label:100,value:100}],value:{label:100,value:100},onChange:()=>{}},{value:361,type:"NumberInput",onChange:()=>{}},{type:"Select",options:[{label:"France",value:"France"},{label:"Poland",value:"Poland"},{label:"Vietnam",value:"Vietnam"}],value:{label:"Poland",value:"Poland"},onChange:()=>{}},{type:"Slider",value:50,min:0,max:100,onChange:()=>{}},{value:361}]},{cells:[{value:"Arborio rice",type:"Input",onChange:()=>{},testId:"table-tbody-cell-arborio",error:"Error"},{type:"Select",native:!0,options:[{label:50,value:50},{label:100,value:100}],value:{label:100,value:100},onChange:()=>{},error:"Error"},{value:361,type:"NumberInput",onChange:()=>{},error:"Error"},{type:"Select",options:[{label:"France",value:"France"},{label:"Italy",value:"Italy"},{label:"Vietnam",value:"Vietnam"}],value:{label:"Italy",value:"Italy"},onChange:()=>{},error:"Error"},{type:"Slider",value:50,min:0,max:100,onChange:()=>{},error:"Error"},{value:361,error:"Error"}]},{cells:[{value:"Couscous",type:"Input",onChange:()=>{},testId:"table-tbody-cell-couscous",warning:"Warning"},{type:"Select",native:!0,options:[{label:50,value:50},{label:100,value:100}],value:{label:100,value:100},onChange:()=>{},warning:"Warning"},{value:361,type:"NumberInput",onChange:()=>{},warning:"Warning"},{type:"Select",options:[{label:"France",value:"France"},{label:"Poland",value:"Poland"},{label:"Vietnam",value:"Vietnam"}],value:{label:"France",value:"France"},onChange:()=>{},warning:"Warning"},{type:"Slider",value:50,min:0,max:100,onChange:()=>{},warning:"Warning"},{value:361,warning:"Warning"}]}]},z={...e,headers:e.headers.map(l=>({...l,cells:[{type:"CheckBox",onChange:()=>{}},...l.cells]})),rows:e.rows.map(l=>({...l,cells:[{type:"CheckBox",onChange:()=>{}},...l.cells]}))},_={...s,rows:s.rows.map(l=>({...l,cells:l.cells.map(a=>({...a,disabled:!0}))}))},G={...e,headers:[...e.headers,{cells:[{value:"",type:"Input",placeholder:"Search",onChange:()=>{}},{value:"",type:"Input",placeholder:"Search",onChange:()=>{}},{value:"",type:"Input",placeholder:"Search",onChange:()=>{}},{value:"",type:"Input",placeholder:"Search",onChange:()=>{}}]}]},$={headers:[{cells:[{value:"Name"},{value:"Weight (kg)",hasSort:!0,sort:"up",sortPriority:1,onSort:()=>{}},{value:"Energy (kcal / 100g)",hasSort:!0,sort:"down",sortPriority:2,onSort:()=>{}},{value:"Origin",hasSort:!0,sort:"",sortPriority:1,onSort:()=>{}}]}],rows:[{cells:[{value:"Brown rice"},{value:100},{value:361},{value:"Vietnam"}]},{cells:[{value:"Buckwheat"},{value:50},{value:358},{value:"Poland"}]},{cells:[{value:"Couscous"},{value:10},{value:368},{value:"France"}]}]},K={headers:[{cells:[{},{value:"Name"},{value:"Weight (kg)"},{value:"Energy (kcal / 100g)"},{value:"Origin"}]}],rows:[{cells:[{type:"Icon",icon:t.jsx(n,{icon:o.SUCCESS,color:"var(--color-text-success)"}),tooltip:"Success tooltip here",width:"var(--size)"},{value:"Brown rice"},{value:100},{value:361},{value:"Vietnam"}]},{cells:[{type:"Icon",icon:t.jsx(n,{icon:o.WARNING,color:"var(--color-text-warning)"}),tooltip:"Warning tooltip here",width:"var(--size)"},{value:"Buckwheat"},{value:50},{value:358},{value:"Poland"}]},{cells:[{type:"Icon",icon:t.jsx(n,{icon:o.ERROR,color:"var(--color-text-error)"}),tooltip:"Error tooltip here",width:"var(--size)"},{value:"Couscous"},{value:10},{value:368},{value:"France"}]}]},X={headers:[{cells:[{value:"Lorem"},{value:"Ipsum"}]}],rows:[{cells:[{type:"Link",value:"Link text",onClick:()=>console.log("Link clicked")},{type:"Link",value:"Disabled link text",disabled:!0,onClick:()=>console.log("Link clicked")}]},{cells:[{type:"Link",value:"Static warning link",warning:"Warning message",onClick:()=>console.log("Link clicked")},{type:"Link",value:"Static error link",error:"Error message",onClick:()=>console.log("Link clicked")}]}]},Q={headers:[{cells:[{value:"Name"},{value:"Weight (kg)"},{value:"Energy (kcal / 100g)"},{value:"Origin"},{value:"Lorem"},{value:"Ipsum"},{value:"Dolor"}],actions:[{primary:!0,label:"Add",icon:"add",onClick:()=>{}}]}],rows:[{cells:[{value:"Brown rice"},{value:100},{value:361},{value:"Vietnam"},{value:"Lorem"},{value:"Ipsum"},{value:"Dolor"}],actions:[{label:"Delete",icon:"minus",onClick:()=>{}}]},{cells:[{value:"Buckwheat"},{value:50},{value:358},{value:"Poland"},{value:"Lorem"},{value:"Ipsum"},{value:"Dolor"}],actions:[{label:"Delete",icon:"minus",onClick:()=>{}}]},{cells:[{value:"Couscous"},{value:10},{value:368},{value:"France"},{value:"Lorem"},{value:"Ipsum"},{value:"Dolor"}],actions:[{label:"test",icon:"minus",onClick:()=>{},hidden:!0}]}]},Y={headers:[{cells:[{value:"Name"},{value:"Weight (kg)"},{value:"Energy (kcal / 100g)"},{value:"Origin"}],actions:[{primary:!0,label:"Add",icon:"add",onClick:()=>{}}]}],rows:[{cells:[{value:"Brown rice"},{value:100},{value:361},{value:"Vietnam"}],actions:[{label:"More",subActions:[{label:"Move Up",icon:"up",onClick:()=>{}},{label:"Move Down",icon:"down",onClick:()=>{}}]},{label:"Delete",icon:"minus",onClick:()=>{}}]},{cells:[{value:"Buckwheat"},{value:50},{value:358},{value:"Poland"}],actions:[{label:"More",subActions:[{label:"Move Up",icon:"up",onClick:()=>{}},{label:"Move Down",icon:"down",onClick:()=>{}}]},{label:"Delete",icon:"minus",onClick:()=>{}}]},{cells:[{value:"Couscous"},{value:10},{value:368},{value:"France"}],actions:[{label:"More",subActions:[{label:"Move Up",icon:"up",onClick:()=>{}},{label:"Move Down",icon:"down",onClick:()=>{}}]},{label:"Delete",icon:"minus",onClick:()=>{}}]}]},Z={...e,footer:{content:t.jsxs(t.Fragment,{children:[t.jsx("strong",{children:"Footer content:"})," goes here"]}),pagination:{rowCount:500,selectedPage:10,rowsPerPage:{onChange:()=>{},options:[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"Show all",value:0}],value:20},goTo:{onChange:()=>{}},onSelectPage:()=>{},small:!0},actions:[{label:"Star",icon:"star",onClick:()=>{}}]}},ee={...e,headers:e.headers.map(l=>({...l,cells:l.cells.map(a=>({...a,helpIcon:{onClick:()=>console.log("Help clicked"),tooltip:"Help text goes here"},libraryIcon:{onClick:()=>console.log("Library clicked"),tooltip:"Edit in library"}}))}))},le={columnWidths:[void 0,"100px","100px","100px",void 0],columnAlignment:["left","right","left","left","left","right"],columnHeaderAlignments:[["left","right","left","left","left","right"]],headers:[{cells:[{value:"Lorem ipsum dolor sit amet consectetur adipiscing elit sed doeius mod tempor incididunt laboreet dolore magna aliqua"},{value:"Weight (kg)"},{value:"Energy (kcal / 100g)"},{value:"Origin"},{value:"Static"},{value:"Static Right"}]}],rows:[{cells:[{breakWord:!0,value:"LoremipsumdolorsitametconsecteturadipiscingelitseddoeiusmodtemporincididuntutlaboreetdoloremagnaaliquaUtenimadminimveniamquisnostrudexercitationullamcolaborisnisiutaliquipexeacommodoconsequatDuisauteiruredolorinreprehenderitinvoluptatevelitessecillumdoloreeullamcolaborisnisiutaliquipexeacommodoconsequatDuisauteiruredolorinreprehenderitinvoluptatevelitessecillumdoloreeufugiatnullapariaturufugiatnullapariatur"},{type:"Select",native:!0,options:[{label:50,value:50},{label:100,value:100}],value:{label:100,value:100},onChange:()=>{},disabled:!0},{type:"Select",options:[{label:"Vietnam",value:"Vietnam"},{label:"Other",value:"Other"}],value:{label:"Vietnam",value:"Vietnam"},onChange:()=>{},error:"Error"},{value:"Brown rice",type:"Input",onChange:()=>{},testId:"table-tbody-cell-brown-rice",warning:"Warning message"},{value:"Static warning",warning:"Warning message"},{value:"100"}]},{cells:[{value:"Buckwheat"},{type:"Select",native:!0,options:[{label:50,value:50},{label:100,value:100}],value:{label:100,value:100},onChange:()=>{}},{type:"Select",options:[{label:"Vietnam",value:"Vietnam"},{label:"Other",value:"Other"}],value:{label:"Vietnam",value:"Vietnam"},onChange:()=>{}},{value:"Brown rice",type:"Input",onChange:()=>{},testId:"table-tbody-cell-brown-rice"},{type:"Link",value:"Static error link",error:"Error message"},{value:"100"}]}]},ae={fixedWidth:"auto",headers:[{cells:[{value:"Name"},{value:"Date of birth"}]}],rows:[{cells:[{value:"John Smith",width:"140px"},{value:"1980-05-05",type:"DateInput",width:"110px"}]},{cells:[{value:"Jane Doe",width:"140px"},{value:"1984-12-12",type:"DateInput",width:"110px"}]}]};export{i as A,O as B,j as C,T as D,D as E,P as F,V as G,B as H,G as I,$ as J,N as K,ee as L,s as a,_ as b,ae as c,m as d,M as e,f,W as g,q as h,z as i,K as j,X as k,Q as l,Y as m,R as n,x as o,F as p,le as q,Z as r,L as s,e as t,E as u,A as v,H as w,S as x,U as y,J as z};
@@ -1 +1 @@
1
- import{j as s}from"./jsx-runtime-eps93zm2.js";import{r as w}from"./index-DhsZuJvc.js";import{c as R}from"./index-Bk2sglWO.js";import{i as r}from"./types-UmZ4Y_CR.js";import{D as q}from"./disabled-context-rmpd7YJS.js";import{T as N}from"./tooltip-C_E_6ym5.js";const H="_inputInTable_66zck_1",z="_inputHover_66zck_13",A="_inputFocus_66zck_18",h="_inputError_66zck_25",k="_inputWarning_66zck_26",L="_inputDisabled_66zck_61",M="_hideScrollbars_66zck_67",V="_textarea_66zck_77",F="_small_66zck_116",C="_error_66zck_121",S="_warning_66zck_138",I="_monospace_66zck_155",n={inputInTable:H,inputHover:z,inputFocus:A,inputError:h,inputWarning:k,inputDisabled:L,hideScrollbars:M,textarea:V,small:F,error:C,warning:S,monospace:I},D=({name:i,value:u="",placeholder:o="",cols:l,rows:m,disabled:c=!1,onChange:d=()=>{},onKeyPress:p=()=>{},onFocus:f=()=>{},onBlur:T=()=>{},tabIndex:v=0,error:e=null,warning:t=null,tooltip:a=null,maxTooltipWidth:g,resize:b,monospace:_=!1,testId:x})=>{const y=w.useContext(q),E=s.jsx("textarea",{className:R(n.textarea,e?n.error:"",t?n.warning:"",_?n.monospace:""),name:i,value:u,placeholder:o,cols:l,rows:m,onChange:d,disabled:c||y,onKeyPress:p,onFocus:f,onBlur:T,tabIndex:v,style:{resize:b},"data-testid":x});return s.jsx(N,{error:!!e,warning:!!t,text:a||e||t,enabled:a&&r(a)||e&&r(e)||t&&r(t)||!1,maxWidth:g,placement:"bottom-center",children:E})};D.__docgenInfo={description:"",methods:[],displayName:"TextArea",props:{name:{required:!1,tsType:{name:"string"},description:""},value:{required:!1,tsType:{name:"union",raw:"string | number",elements:[{name:"string"},{name:"number"}]},description:"",defaultValue:{value:"''",computed:!1}},placeholder:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:"''",computed:!1}},cols:{required:!1,tsType:{name:"number"},description:""},rows:{required:!1,tsType:{name:"number"},description:""},disabled:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},onChange:{required:!1,tsType:{name:"signature",type:"function",raw:"(evt: ChangeEvent<HTMLTextAreaElement>) => void",signature:{arguments:[{type:{name:"ChangeEvent",elements:[{name:"HTMLTextAreaElement"}],raw:"ChangeEvent<HTMLTextAreaElement>"},name:"evt"}],return:{name:"void"}}},description:"",defaultValue:{value:"() => {}",computed:!1}},onKeyPress:{required:!1,tsType:{name:"signature",type:"function",raw:"(evt: KeyboardEvent<HTMLTextAreaElement>) => void",signature:{arguments:[{type:{name:"KeyboardEvent",elements:[{name:"HTMLTextAreaElement"}],raw:"KeyboardEvent<HTMLTextAreaElement>"},name:"evt"}],return:{name:"void"}}},description:"",defaultValue:{value:"() => {}",computed:!1}},onFocus:{required:!1,tsType:{name:"signature",type:"function",raw:"(evt: FocusEvent<HTMLTextAreaElement>) => void",signature:{arguments:[{type:{name:"FocusEvent",elements:[{name:"HTMLTextAreaElement"}],raw:"FocusEvent<HTMLTextAreaElement>"},name:"evt"}],return:{name:"void"}}},description:"",defaultValue:{value:"() => {}",computed:!1}},onBlur:{required:!1,tsType:{name:"signature",type:"function",raw:"(evt: FocusEvent<HTMLTextAreaElement>) => void",signature:{arguments:[{type:{name:"FocusEvent",elements:[{name:"HTMLTextAreaElement"}],raw:"FocusEvent<HTMLTextAreaElement>"},name:"evt"}],return:{name:"void"}}},description:"",defaultValue:{value:"() => {}",computed:!1}},tabIndex:{required:!1,tsType:{name:"number"},description:"",defaultValue:{value:"0",computed:!1}},error:{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:"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}},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}},maxTooltipWidth:{required:!1,tsType:{name:"union",raw:"string | number",elements:[{name:"string"},{name:"number"}]},description:""},resize:{required:!1,tsType:{name:"Property.Resize"},description:""},monospace:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},testId:{required:!1,tsType:{name:"string"},description:""}}};export{D as T};
1
+ import{j as s}from"./jsx-runtime-eps93zm2.js";import{r as w}from"./index-DhsZuJvc.js";import{c as R}from"./index-Bk2sglWO.js";import{i as r}from"./types-UmZ4Y_CR.js";import{D as q}from"./disabled-context-rmpd7YJS.js";import{T as N}from"./tooltip-1V7clEnw.js";const H="_inputInTable_66zck_1",z="_inputHover_66zck_13",A="_inputFocus_66zck_18",h="_inputError_66zck_25",k="_inputWarning_66zck_26",L="_inputDisabled_66zck_61",M="_hideScrollbars_66zck_67",V="_textarea_66zck_77",F="_small_66zck_116",C="_error_66zck_121",S="_warning_66zck_138",I="_monospace_66zck_155",n={inputInTable:H,inputHover:z,inputFocus:A,inputError:h,inputWarning:k,inputDisabled:L,hideScrollbars:M,textarea:V,small:F,error:C,warning:S,monospace:I},D=({name:i,value:u="",placeholder:o="",cols:l,rows:m,disabled:c=!1,onChange:d=()=>{},onKeyPress:p=()=>{},onFocus:f=()=>{},onBlur:T=()=>{},tabIndex:v=0,error:e=null,warning:t=null,tooltip:a=null,maxTooltipWidth:g,resize:b,monospace:_=!1,testId:x})=>{const y=w.useContext(q),E=s.jsx("textarea",{className:R(n.textarea,e?n.error:"",t?n.warning:"",_?n.monospace:""),name:i,value:u,placeholder:o,cols:l,rows:m,onChange:d,disabled:c||y,onKeyPress:p,onFocus:f,onBlur:T,tabIndex:v,style:{resize:b},"data-testid":x});return s.jsx(N,{error:!!e,warning:!!t,text:a||e||t,enabled:a&&r(a)||e&&r(e)||t&&r(t)||!1,maxWidth:g,placement:"bottom-center",children:E})};D.__docgenInfo={description:"",methods:[],displayName:"TextArea",props:{name:{required:!1,tsType:{name:"string"},description:""},value:{required:!1,tsType:{name:"union",raw:"string | number",elements:[{name:"string"},{name:"number"}]},description:"",defaultValue:{value:"''",computed:!1}},placeholder:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:"''",computed:!1}},cols:{required:!1,tsType:{name:"number"},description:""},rows:{required:!1,tsType:{name:"number"},description:""},disabled:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},onChange:{required:!1,tsType:{name:"signature",type:"function",raw:"(evt: ChangeEvent<HTMLTextAreaElement>) => void",signature:{arguments:[{type:{name:"ChangeEvent",elements:[{name:"HTMLTextAreaElement"}],raw:"ChangeEvent<HTMLTextAreaElement>"},name:"evt"}],return:{name:"void"}}},description:"",defaultValue:{value:"() => {}",computed:!1}},onKeyPress:{required:!1,tsType:{name:"signature",type:"function",raw:"(evt: KeyboardEvent<HTMLTextAreaElement>) => void",signature:{arguments:[{type:{name:"KeyboardEvent",elements:[{name:"HTMLTextAreaElement"}],raw:"KeyboardEvent<HTMLTextAreaElement>"},name:"evt"}],return:{name:"void"}}},description:"",defaultValue:{value:"() => {}",computed:!1}},onFocus:{required:!1,tsType:{name:"signature",type:"function",raw:"(evt: FocusEvent<HTMLTextAreaElement>) => void",signature:{arguments:[{type:{name:"FocusEvent",elements:[{name:"HTMLTextAreaElement"}],raw:"FocusEvent<HTMLTextAreaElement>"},name:"evt"}],return:{name:"void"}}},description:"",defaultValue:{value:"() => {}",computed:!1}},onBlur:{required:!1,tsType:{name:"signature",type:"function",raw:"(evt: FocusEvent<HTMLTextAreaElement>) => void",signature:{arguments:[{type:{name:"FocusEvent",elements:[{name:"HTMLTextAreaElement"}],raw:"FocusEvent<HTMLTextAreaElement>"},name:"evt"}],return:{name:"void"}}},description:"",defaultValue:{value:"() => {}",computed:!1}},tabIndex:{required:!1,tsType:{name:"number"},description:"",defaultValue:{value:"0",computed:!1}},error:{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:"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}},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}},maxTooltipWidth:{required:!1,tsType:{name:"union",raw:"string | number",elements:[{name:"string"},{name:"number"}]},description:""},resize:{required:!1,tsType:{name:"Property.Resize"},description:""},monospace:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},testId:{required:!1,tsType:{name:"string"},description:""}}};export{D as T};
@@ -1,4 +1,4 @@
1
- import{j as u}from"./jsx-runtime-eps93zm2.js";import{T as s}from"./textarea-DOJDK8hI.js";import"./index-DhsZuJvc.js";import"./index-Bk2sglWO.js";import"./types-UmZ4Y_CR.js";import"./lodash-BHd_uQHh.js";import"./disabled-context-rmpd7YJS.js";import"./tooltip-C_E_6ym5.js";import"./index-CUZDtIZe.js";const{useArgs:g}=__STORYBOOK_MODULE_PREVIEW_API__,f={title:"Forms/TextArea",component:s,args:{disabled:!1}},c=n=>{const[i,o]=g(),m=p=>{o({value:p.target.value})};return u.jsx(s,{...n,onChange:m})},e=c.bind({});var t,r,a;e.parameters={...e.parameters,docs:{...(t=e.parameters)==null?void 0:t.docs,source:{originalSource:`args => {
1
+ import{j as u}from"./jsx-runtime-eps93zm2.js";import{T as s}from"./textarea-BV7xWEdt.js";import"./index-DhsZuJvc.js";import"./index-Bk2sglWO.js";import"./types-UmZ4Y_CR.js";import"./lodash-BHd_uQHh.js";import"./disabled-context-rmpd7YJS.js";import"./tooltip-1V7clEnw.js";import"./index-CUZDtIZe.js";const{useArgs:g}=__STORYBOOK_MODULE_PREVIEW_API__,f={title:"Forms/TextArea",component:s,args:{disabled:!1}},c=n=>{const[i,o]=g(),m=p=>{o({value:p.target.value})};return u.jsx(s,{...n,onChange:m})},e=c.bind({});var t,r,a;e.parameters={...e.parameters,docs:{...(t=e.parameters)==null?void 0:t.docs,source:{originalSource:`args => {
2
2
  const [_, updateArgs] = useArgs();
3
3
  const handleChange = (evt: ChangeEvent<HTMLTextAreaElement>) => {
4
4
  updateArgs({
@@ -1,4 +1,4 @@
1
- import{j as G}from"./jsx-runtime-eps93zm2.js";import{T as X}from"./table-DPvzYjoq.js";import{t as K,E as O,s as W,F as k,G as q,H as z,I as D,J as M,K as P,L as Q}from"./table.stories-data-2STKbgzG.js";import"./index-DhsZuJvc.js";import"./index-Bk2sglWO.js";import"./index.es-D2piFfFj.js";import"./inheritsLoose-DR8r8Ogv.js";import"./extends-CF3RwP-h.js";import"./redux-tRgGMjwY.js";import"./objectSpread2-DW4nTBoq.js";import"./tiny-invariant-DqLgxztJ.js";import"./index-CUZDtIZe.js";import"./memoize-one.esm-CcMeOnPo.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./lodash-BHd_uQHh.js";import"./actions-Cu_0szZ4.js";import"./common-types-Sih75Sav.js";import"./disabled-context-rmpd7YJS.js";import"./button-_0DiND6h.js";import"./spinner-AWUe4xwQ.js";import"./icon-BP4BO6-k.js";import"./index-CEuq6vkz.js";import"./tooltip-C_E_6ym5.js";import"./types-BmbYqTX_.js";import"./types-UmZ4Y_CR.js";import"./badge-CLQ59MDF.js";import"./heading-DkSFysAb.js";import"./help-icon-LfPZiYla.js";import"./pagination-DSQeMPG_.js";import"./select-78sreKsp.js";import"./assertThisInitialized-B9jnkVVz.js";import"./text-B3-TSWok.js";import"./select.input-DIKP56UZ.js";import"./input-D97ganXq.js";import"./input-group-BaRSJAEN.js";import"./input-group-addon-D68iUKV2.js";import"./number-input-B-Nmya5O.js";import"./index-DQs5XS8h.js";import"./index-DRSy5Ssd.js";import"./check-box-DkdQxC5c.js";import"./slider-CxVlS0fh.js";import"./index-BI4_Bp97.js";import"./popover-Dq3iC_lM.js";import"./flex-EllkLxgO.js";const Kr={title:"Basic/Table/Title & Header",component:X,args:{table:{...K}}},r=B=>G.jsx(X,{...B}),e=r.bind({});e.args={table:O};const s=r.bind({});s.args={table:W};const a=r.bind({});a.args={table:k};const t=r.bind({});t.args={table:q};const o=r.bind({});o.args={table:z};const n=r.bind({});n.args={table:D};const i=r.bind({});i.args={table:M};const p=r.bind({});p.args={table:P};const l=r.bind({});l.args={table:Q};var m,c,d;e.parameters={...e.parameters,docs:{...(m=e.parameters)==null?void 0:m.docs,source:{originalSource:`args => {
1
+ import{j as G}from"./jsx-runtime-eps93zm2.js";import{T as X}from"./table-CXUwJOBt.js";import{t as K,E as O,s as W,F as k,G as q,H as z,I as D,J as M,K as P,L as Q}from"./table.stories-data-DwfKQW7P.js";import"./index-DhsZuJvc.js";import"./index-Bk2sglWO.js";import"./index.es-D2piFfFj.js";import"./inheritsLoose-DR8r8Ogv.js";import"./extends-CF3RwP-h.js";import"./redux-tRgGMjwY.js";import"./objectSpread2-DW4nTBoq.js";import"./tiny-invariant-DqLgxztJ.js";import"./index-CUZDtIZe.js";import"./memoize-one.esm-CcMeOnPo.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./lodash-BHd_uQHh.js";import"./actions-CZK3mphC.js";import"./common-types-Sih75Sav.js";import"./disabled-context-rmpd7YJS.js";import"./button-C1sV-0mR.js";import"./spinner-AWUe4xwQ.js";import"./icon-BP4BO6-k.js";import"./index-CEuq6vkz.js";import"./tooltip-1V7clEnw.js";import"./types-BmbYqTX_.js";import"./types-UmZ4Y_CR.js";import"./badge-CLQ59MDF.js";import"./heading-NkLgQYoP.js";import"./help-icon-41R-Z9N1.js";import"./pagination-CqvxiZHR.js";import"./select-tIEV7vnw.js";import"./assertThisInitialized-B9jnkVVz.js";import"./text-B3-TSWok.js";import"./select.input-DIKP56UZ.js";import"./input-BW9trNAW.js";import"./input-group-BaRSJAEN.js";import"./input-group-addon-D68iUKV2.js";import"./number-input-uQOVHv2N.js";import"./index-CWz-hU-f.js";import"./index-DRSy5Ssd.js";import"./check-box-CaSrhzev.js";import"./slider-gZmYlxxz.js";import"./index-BI4_Bp97.js";import"./popover-DgUpTRMk.js";import"./flex-EllkLxgO.js";const Kr={title:"Basic/Table/Title & Header",component:X,args:{table:{...K}}},r=B=>G.jsx(X,{...B}),e=r.bind({});e.args={table:O};const s=r.bind({});s.args={table:W};const a=r.bind({});a.args={table:k};const t=r.bind({});t.args={table:q};const o=r.bind({});o.args={table:z};const n=r.bind({});n.args={table:D};const i=r.bind({});i.args={table:M};const p=r.bind({});p.args={table:P};const l=r.bind({});l.args={table:Q};var m,c,d;e.parameters={...e.parameters,docs:{...(m=e.parameters)==null?void 0:m.docs,source:{originalSource:`args => {
2
2
  return <Table
3
3
  // eslint-disable-next-line react/jsx-props-no-spreading
4
4
  {...args} />;
@@ -1,4 +1,4 @@
1
- import{j as s}from"./jsx-runtime-eps93zm2.js";import{G as w}from"./grid-B6LFPf51.js";import{T as d}from"./text-B3-TSWok.js";import{F as v}from"./flex-EllkLxgO.js";import{t,d as u}from"./toaster-DPbde9Mi.js";import{B as o}from"./button-_0DiND6h.js";import{S as l}from"./spacer-BWoNR27H.js";import{a as m}from"./message-ttrR1AaP.js";import"./index-DhsZuJvc.js";import"./styled-components.browser.esm-Bf0q9Yjk.js";import"./index-Bk2sglWO.js";import"./toaster-7wnI6hqB.js";import"./index-CUZDtIZe.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"./tooltip-C_E_6ym5.js";const O={type:m.SUCCESS,icon:!0,heading:"Heading",content:"Great results"},A={type:m.ERROR,icon:!0,heading:"Heading",content:"An error has happened",details:"Bad input data lorem ipsum dolor est compendum lorem ipsum."},F={type:m.WARNING,icon:!0,heading:"Heading",content:"Warning message"},B={type:m.INFO,icon:!0,heading:"Heading",content:"Long content lorem ipsum dolor est compendum lorem ipsum."},ts={title:"Modals/Toaster",parameters:{docs:{story:{inline:!1,iframeHeight:400}}},source:{type:"code"},args:{id:void 0,message:B,autoClose:6e3,onClose:()=>{}}},G=()=>s.jsxs(s.Fragment,{children:[s.jsx(o,{label:"Info",onClick:()=>t({message:B,onClose:()=>console.log("toast closed")})}),s.jsx(l,{}),s.jsx(o,{label:"Error",onClick:()=>t({message:A,onClose:()=>console.log("toast closed")})}),s.jsx(l,{}),s.jsx(o,{label:"Warning",onClick:()=>t({message:F,onClose:()=>console.log("toast closed")})}),s.jsx(l,{}),s.jsx(o,{label:"Success",onClick:()=>t({message:O,onClose:()=>console.log("toast closed")})})]}),c=G.bind({}),n=()=>s.jsx(o,{label:"Show Toast",onClick:()=>{const e=Math.random()>=.5;t({message:{type:e?"Success":"Error",icon:!0,content:e?"Success":"Error"},onClose:()=>console.log("toast closed"),id:"uniqueId"})}});n.parameters={docs:{iframeHeight:200,description:{story:"Pass a unique `id` in the `toast` object to prevent duplicates. Successive toasts with the same ID will update the existing toast."}}};const a=()=>{const e="sessionExpiring",p={type:"Info",content:s.jsxs(w,{children:[s.jsx(d,{bold:!0,children:"You will be signed out soon"}),s.jsx(d,{children:"For your security, you will be automatically signed out in 30 minutes unless you extend your session."}),s.jsx(l,{height:"var(--padding-xxs)"}),s.jsxs(v,{gap:"var(--padding-xs)",children:[s.jsx(o,{label:"Extend session",small:!0,colored:"success",onClick:()=>u(e)}),s.jsx(o,{label:"Dismiss",small:!0,onClick:()=>u(e)})]})]})};return s.jsx(o,{label:"Show Toast",onClick:()=>t({message:p,autoClose:!1,id:e})})},r=()=>{const e="sessionExpiringSoon",p={type:"Error",content:s.jsxs(w,{children:[s.jsx(d,{bold:!0,children:"You will be signed out very soon"}),s.jsx(d,{children:"For your security, you will be automatically signed out in 30 minutes unless you extend your session."}),s.jsx(l,{height:"var(--padding-xxs)"}),s.jsxs(v,{gap:"var(--padding-xs)",children:[s.jsx(o,{label:"Extend session",small:!0,colored:"success",onClick:()=>u(e)}),s.jsx(o,{label:"Dismiss",small:!0,onClick:()=>u(e)})]})]})};return s.jsx(o,{label:"Show Toast",onClick:()=>t({message:p,autoClose:!1,id:e})})},i=()=>{const e={type:"Success",content:"Your session has been extended for 1 hour"};return s.jsx(o,{label:"Show Toast",onClick:()=>t({message:e})})};n.__docgenInfo={description:"",methods:[],displayName:"PreventDuplicates"};a.__docgenInfo={description:"",methods:[],displayName:"SessionExpiring"};r.__docgenInfo={description:"",methods:[],displayName:"SessionExpiringSoon"};i.__docgenInfo={description:"",methods:[],displayName:"SessionExtended"};var g,x,S;c.parameters={...c.parameters,docs:{...(g=c.parameters)==null?void 0:g.docs,source:{originalSource:`() => {
1
+ import{j as s}from"./jsx-runtime-eps93zm2.js";import{G as w}from"./grid-B6LFPf51.js";import{T as d}from"./text-B3-TSWok.js";import{F as v}from"./flex-EllkLxgO.js";import{t,d as u}from"./toaster-DPbde9Mi.js";import{B as o}from"./button-C1sV-0mR.js";import{S as l}from"./spacer-BWoNR27H.js";import{a as m}from"./message-ttrR1AaP.js";import"./index-DhsZuJvc.js";import"./styled-components.browser.esm-Bf0q9Yjk.js";import"./index-Bk2sglWO.js";import"./toaster-7wnI6hqB.js";import"./index-CUZDtIZe.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"./tooltip-1V7clEnw.js";const O={type:m.SUCCESS,icon:!0,heading:"Heading",content:"Great results"},A={type:m.ERROR,icon:!0,heading:"Heading",content:"An error has happened",details:"Bad input data lorem ipsum dolor est compendum lorem ipsum."},F={type:m.WARNING,icon:!0,heading:"Heading",content:"Warning message"},B={type:m.INFO,icon:!0,heading:"Heading",content:"Long content lorem ipsum dolor est compendum lorem ipsum."},ts={title:"Modals/Toaster",parameters:{docs:{story:{inline:!1,iframeHeight:400}}},source:{type:"code"},args:{id:void 0,message:B,autoClose:6e3,onClose:()=>{}}},G=()=>s.jsxs(s.Fragment,{children:[s.jsx(o,{label:"Info",onClick:()=>t({message:B,onClose:()=>console.log("toast closed")})}),s.jsx(l,{}),s.jsx(o,{label:"Error",onClick:()=>t({message:A,onClose:()=>console.log("toast closed")})}),s.jsx(l,{}),s.jsx(o,{label:"Warning",onClick:()=>t({message:F,onClose:()=>console.log("toast closed")})}),s.jsx(l,{}),s.jsx(o,{label:"Success",onClick:()=>t({message:O,onClose:()=>console.log("toast closed")})})]}),c=G.bind({}),n=()=>s.jsx(o,{label:"Show Toast",onClick:()=>{const e=Math.random()>=.5;t({message:{type:e?"Success":"Error",icon:!0,content:e?"Success":"Error"},onClose:()=>console.log("toast closed"),id:"uniqueId"})}});n.parameters={docs:{iframeHeight:200,description:{story:"Pass a unique `id` in the `toast` object to prevent duplicates. Successive toasts with the same ID will update the existing toast."}}};const a=()=>{const e="sessionExpiring",p={type:"Info",content:s.jsxs(w,{children:[s.jsx(d,{bold:!0,children:"You will be signed out soon"}),s.jsx(d,{children:"For your security, you will be automatically signed out in 30 minutes unless you extend your session."}),s.jsx(l,{height:"var(--padding-xxs)"}),s.jsxs(v,{gap:"var(--padding-xs)",children:[s.jsx(o,{label:"Extend session",small:!0,colored:"success",onClick:()=>u(e)}),s.jsx(o,{label:"Dismiss",small:!0,onClick:()=>u(e)})]})]})};return s.jsx(o,{label:"Show Toast",onClick:()=>t({message:p,autoClose:!1,id:e})})},r=()=>{const e="sessionExpiringSoon",p={type:"Error",content:s.jsxs(w,{children:[s.jsx(d,{bold:!0,children:"You will be signed out very soon"}),s.jsx(d,{children:"For your security, you will be automatically signed out in 30 minutes unless you extend your session."}),s.jsx(l,{height:"var(--padding-xxs)"}),s.jsxs(v,{gap:"var(--padding-xs)",children:[s.jsx(o,{label:"Extend session",small:!0,colored:"success",onClick:()=>u(e)}),s.jsx(o,{label:"Dismiss",small:!0,onClick:()=>u(e)})]})]})};return s.jsx(o,{label:"Show Toast",onClick:()=>t({message:p,autoClose:!1,id:e})})},i=()=>{const e={type:"Success",content:"Your session has been extended for 1 hour"};return s.jsx(o,{label:"Show Toast",onClick:()=>t({message:e})})};n.__docgenInfo={description:"",methods:[],displayName:"PreventDuplicates"};a.__docgenInfo={description:"",methods:[],displayName:"SessionExpiring"};r.__docgenInfo={description:"",methods:[],displayName:"SessionExpiringSoon"};i.__docgenInfo={description:"",methods:[],displayName:"SessionExtended"};var g,x,S;c.parameters={...c.parameters,docs:{...(g=c.parameters)==null?void 0:g.docs,source:{originalSource:`() => {
2
2
  return <>
3
3
  <Button label="Info" onClick={() => toast({
4
4
  message: messageInfo,
@@ -1 +1 @@
1
- import{j as n}from"./jsx-runtime-eps93zm2.js";import{r as b}from"./index-DhsZuJvc.js";import{c as T}from"./index-Bk2sglWO.js";import{b as _}from"./common-types-Sih75Sav.js";import{D as E}from"./disabled-context-rmpd7YJS.js";import{H as v}from"./help-icon-LfPZiYla.js";const x="_toggle_1mo1i_9",C="_small_1mo1i_25",q="_disabled_1mo1i_102",I="_noMargin_1mo1i_113",R="_helpIconEnabled_1mo1i_116",a={toggle:x,small:C,disabled:q,noMargin:I,helpIconEnabled:R},h=({name:l,label:r,checked:e=!1,disabled:m,display:d,small:p=!1,onChange:u,noMargin:c=!1,testId:g,helpText:i,onClickHelp:o})=>{const f=b.useContext(E),y=i||o,s=m||f;return n.jsxs("div",{className:T(a.toggle,s?a.disabled:null,p?a.small:null,c?a.noMargin:null),style:{display:d},onClick:t=>{s||(t.target.name=l,t.target.checked=!e,t.target.value=!e,u(t))},"data-testid":g,children:[n.jsx("input",{type:_.CHECKBOX,name:l,value:e==null?void 0:e.toString(),disabled:s,checked:e,onChange:()=>{}}),n.jsx("label",{children:r}),y&&n.jsx("div",{className:a.helpIconEnabled,onClick:o,children:n.jsx(v,{text:i})})]})};h.__docgenInfo={description:"",methods:[],displayName:"Toggle",props:{name:{required:!1,tsType:{name:"string"},description:""},label:{required:!1,tsType:{name:"union",raw:"string | React.ReactElement | null",elements:[{name:"string"},{name:"ReactReactElement",raw:"React.ReactElement"},{name:"null"}]},description:""},checked:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},disabled:{required:!1,tsType:{name:"boolean"},description:""},display:{required:!1,tsType:{name:"string"},description:""},small:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},onChange:{required:!0,tsType:{name:"signature",type:"function",raw:"(evt: React.ChangeEvent<HTMLInputElement>) => void",signature:{arguments:[{type:{name:"ReactChangeEvent",raw:"React.ChangeEvent<HTMLInputElement>",elements:[{name:"HTMLInputElement"}]},name:"evt"}],return:{name:"void"}}},description:""},noMargin:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},testId:{required:!1,tsType:{name:"string"},description:""},helpText:{required:!1,tsType:{name:"string"},description:""},onClickHelp:{required:!1,tsType:{name:"signature",type:"function",raw:"(evt: any) => void",signature:{arguments:[{type:{name:"any"},name:"evt"}],return:{name:"void"}}},description:""}}};export{h as T};
1
+ import{j as n}from"./jsx-runtime-eps93zm2.js";import{r as b}from"./index-DhsZuJvc.js";import{c as T}from"./index-Bk2sglWO.js";import{b as _}from"./common-types-Sih75Sav.js";import{D as E}from"./disabled-context-rmpd7YJS.js";import{H as v}from"./help-icon-41R-Z9N1.js";const x="_toggle_1mo1i_9",C="_small_1mo1i_25",q="_disabled_1mo1i_102",I="_noMargin_1mo1i_113",R="_helpIconEnabled_1mo1i_116",a={toggle:x,small:C,disabled:q,noMargin:I,helpIconEnabled:R},h=({name:l,label:r,checked:e=!1,disabled:m,display:d,small:p=!1,onChange:u,noMargin:c=!1,testId:g,helpText:i,onClickHelp:o})=>{const f=b.useContext(E),y=i||o,s=m||f;return n.jsxs("div",{className:T(a.toggle,s?a.disabled:null,p?a.small:null,c?a.noMargin:null),style:{display:d},onClick:t=>{s||(t.target.name=l,t.target.checked=!e,t.target.value=!e,u(t))},"data-testid":g,children:[n.jsx("input",{type:_.CHECKBOX,name:l,value:e==null?void 0:e.toString(),disabled:s,checked:e,onChange:()=>{}}),n.jsx("label",{children:r}),y&&n.jsx("div",{className:a.helpIconEnabled,onClick:o,children:n.jsx(v,{text:i})})]})};h.__docgenInfo={description:"",methods:[],displayName:"Toggle",props:{name:{required:!1,tsType:{name:"string"},description:""},label:{required:!1,tsType:{name:"union",raw:"string | React.ReactElement | null",elements:[{name:"string"},{name:"ReactReactElement",raw:"React.ReactElement"},{name:"null"}]},description:""},checked:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},disabled:{required:!1,tsType:{name:"boolean"},description:""},display:{required:!1,tsType:{name:"string"},description:""},small:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},onChange:{required:!0,tsType:{name:"signature",type:"function",raw:"(evt: React.ChangeEvent<HTMLInputElement>) => void",signature:{arguments:[{type:{name:"ReactChangeEvent",raw:"React.ChangeEvent<HTMLInputElement>",elements:[{name:"HTMLInputElement"}]},name:"evt"}],return:{name:"void"}}},description:""},noMargin:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},testId:{required:!1,tsType:{name:"string"},description:""},helpText:{required:!1,tsType:{name:"string"},description:""},onClickHelp:{required:!1,tsType:{name:"signature",type:"function",raw:"(evt: any) => void",signature:{arguments:[{type:{name:"any"},name:"evt"}],return:{name:"void"}}},description:""}}};export{h as T};
@@ -1,4 +1,4 @@
1
- import{j as e}from"./jsx-runtime-eps93zm2.js";import{r as X}from"./index-DhsZuJvc.js";import{F as C}from"./flex-EllkLxgO.js";import{T as i}from"./text-B3-TSWok.js";import{T as p}from"./toggle-t1iTuSL7.js";import"./index-Bk2sglWO.js";import"./common-types-Sih75Sav.js";import"./disabled-context-rmpd7YJS.js";import"./help-icon-LfPZiYla.js";import"./tooltip-C_E_6ym5.js";import"./index-CUZDtIZe.js";import"./icon-BP4BO6-k.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./inheritsLoose-DR8r8Ogv.js";import"./index-CEuq6vkz.js";const{useArgs:Z}=__STORYBOOK_MODULE_PREVIEW_API__,ue={title:"Forms/Toggle",component:p,args:{label:"Label"}},n=u=>{const[{checked:m},x]=Z(),b=()=>{x({checked:!m})};return e.jsx(p,{...u,onChange:b})},h=n.bind({}),s=n.bind({});s.args={disabled:!0};const a=n.bind({});a.args={checked:!0,disabled:!0};const r=n.bind({});r.args={small:!0};const t=n.bind({});t.args={label:null};const c=n.bind({});c.args={helpText:"Help text"};const o=n.bind({});o.args={onClickHelp:()=>console.log("Help clicked")};const d=()=>e.jsxs(e.Fragment,{children:[e.jsx(p,{display:"block",label:e.jsxs(C,{justifyContent:"space-between",wrap:!1,gap:!0,children:[e.jsx(i,{bold:!0,children:"Label"}),e.jsx(i,{success:!0,children:"Released yesterday"})]}),onChange:()=>{}}),e.jsx(p,{label:e.jsxs(C,{justifyContent:"space-between",wrap:!1,gap:!0,children:[e.jsx(i,{bold:!0,children:"Label"}),e.jsx(i,{success:!0,children:"Released yesterday"})]}),onChange:()=>{}})]}),l=()=>{const[u,m]=X.useState(!1);return e.jsx(p,{name:"name",label:"Label",checked:u,onChange:x=>{const{name:b,value:Q,checked:k}=x.target;m(k),console.log(b,Q,k)}})},g=n.bind({});g.args={helpText:"Help text",disabled:!0};d.__docgenInfo={description:"",methods:[],displayName:"Display"};l.__docgenInfo={description:"",methods:[],displayName:"TestClickevt"};var T,A,j;h.parameters={...h.parameters,docs:{...(T=h.parameters)==null?void 0:T.docs,source:{originalSource:`args => {
1
+ import{j as e}from"./jsx-runtime-eps93zm2.js";import{r as X}from"./index-DhsZuJvc.js";import{F as C}from"./flex-EllkLxgO.js";import{T as i}from"./text-B3-TSWok.js";import{T as p}from"./toggle-Bo-JPbUP.js";import"./index-Bk2sglWO.js";import"./common-types-Sih75Sav.js";import"./disabled-context-rmpd7YJS.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";const{useArgs:Z}=__STORYBOOK_MODULE_PREVIEW_API__,ue={title:"Forms/Toggle",component:p,args:{label:"Label"}},n=u=>{const[{checked:m},x]=Z(),b=()=>{x({checked:!m})};return e.jsx(p,{...u,onChange:b})},h=n.bind({}),s=n.bind({});s.args={disabled:!0};const a=n.bind({});a.args={checked:!0,disabled:!0};const r=n.bind({});r.args={small:!0};const t=n.bind({});t.args={label:null};const c=n.bind({});c.args={helpText:"Help text"};const o=n.bind({});o.args={onClickHelp:()=>console.log("Help clicked")};const d=()=>e.jsxs(e.Fragment,{children:[e.jsx(p,{display:"block",label:e.jsxs(C,{justifyContent:"space-between",wrap:!1,gap:!0,children:[e.jsx(i,{bold:!0,children:"Label"}),e.jsx(i,{success:!0,children:"Released yesterday"})]}),onChange:()=>{}}),e.jsx(p,{label:e.jsxs(C,{justifyContent:"space-between",wrap:!1,gap:!0,children:[e.jsx(i,{bold:!0,children:"Label"}),e.jsx(i,{success:!0,children:"Released yesterday"})]}),onChange:()=>{}})]}),l=()=>{const[u,m]=X.useState(!1);return e.jsx(p,{name:"name",label:"Label",checked:u,onChange:x=>{const{name:b,value:Q,checked:k}=x.target;m(k),console.log(b,Q,k)}})},g=n.bind({});g.args={helpText:"Help text",disabled:!0};d.__docgenInfo={description:"",methods:[],displayName:"Display"};l.__docgenInfo={description:"",methods:[],displayName:"TestClickevt"};var T,A,j;h.parameters={...h.parameters,docs:{...(T=h.parameters)==null?void 0:T.docs,source:{originalSource:`args => {
2
2
  const [{
3
3
  checked
4
4
  }, updateArgs] = useArgs();
@@ -6,7 +6,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
6
6
  top: 0px;
7
7
  left: 0px;
8
8
  right: 0px;
9
- `,document.body.appendChild(r))}return r}var Qt=["size","angle","borderWidth","borderColor","roundness","backgroundColor","layerSide","style"],ie="left",oe="top",se="bottom",ae="right";function fe(e,r){return Math.tan(e*(Math.PI/180))*r}function er(e,r,n,t){var i,o=(i={},i[se]="0 "+-t+" "+r+" "+e,i[oe]="0 0 "+r+" "+(e+t),i[ae]=-t+" 0 "+e+" "+r,i[ie]="0 0 "+(e+t)+" "+r,i);return o[n.prop]}function tr(e,r,n,t,i){var o,s,a,l=t/10*e*2,u=(o={},o[se]=[0,e],o[oe]=[0,0],o[ae]=[e,r],o[ie]=[0,r],o)[n.prop].join(" "),c=n.isHorizontal?"V 0":"H "+r,f=r/2,d=r/2+fe(i,e/8),p=e/8,v=(s={},s[se]=["C",d,p,f+l,0,f,0],s[oe]=["C",d,e-p,f+l,e,f,e],s[ae]=["C",p,r-d,0,f-l,0,f],s[ie]=["C",e-p,r-d,e,f-l,e,f],s)[n.prop].join(" "),h=r/2-fe(i,e/8),m=e/8,y=(a={},a[se]=["C",f-l,0,h,m,u],a[oe]=["C",f-l,e,h,e-m,u],a[ae]=["C",0,f+l,m,r-h,u],a[ie]=["C",e,f+l,e-m,r-h,u],a)[n.prop].join(" ");return["M",u,c,v,y].join(" ")}function rr(e,r,n,t,i){var o=fe(i,n),s=t.isPush?[0,n]:[e,e-n],a=s[0],l=s[1];return t.isHorizontal?["M",a,n,"V",r-n,"L",l,r-n-o,"V",o+n,"Z"].join(" "):["M",n,a,"H",r-n,"L",r-n-o,l,"H",o+n,"Z"].join(" ")}var nr=g.forwardRef(function(r,n){var t=r.size,i=t===void 0?8:t,o=r.angle,s=o===void 0?45:o,a=r.borderWidth,l=a===void 0?0:a,u=r.borderColor,c=u===void 0?"black":u,f=r.roundness,d=f===void 0?0:f,p=r.backgroundColor,v=p===void 0?"white":p,h=r.layerSide,m=h===void 0?"top":h,y=r.style,b=y===void 0?{}:y,C=jt(r,Qt);if(m==="center")return null;var L=_[m],O=i,T=fe(s,i)*2,M=Math.max(O,T);return g.createElement("svg",x({ref:n},C,{style:x({},b,{transform:"translate"+(L.isHorizontal?"Y":"X")+"(-50%)"}),width:M,height:M,preserveAspectRatio:L.isPush?"xMinYMin":"xMaxYMax",viewBox:er(O,T,L,l)}),g.createElement("path",{fill:v,strokeWidth:l,stroke:c,d:tr(O,T,L,d,s)}),g.createElement("path",{fill:v,d:rr(O,T,l,L,s)}))}),$;(function(e){e[e.ENTERING=0]="ENTERING",e[e.LEAVING=1]="LEAVING",e[e.IDLE=2]="IDLE"})($||($={}));function ir(e){var r=e===void 0?{}:e,n=r.delayEnter,t=n===void 0?0:n,i=r.delayLeave,o=i===void 0?0:i,s=r.hideOnScroll,a=s===void 0?!0:s,l=g.useState(!1),u=l[0],c=l[1],f=g.useRef(null),d=g.useRef($.IDLE),p=g.useRef(!1),v=g.useCallback(function(){clearTimeout(f.current),f.current=null,d.current=$.IDLE},[]);function h(){d.current===$.LEAVING&&f.current&&v(),!u&&(d.current=$.ENTERING,f.current=window.setTimeout(function(){c(!0),f.current=null,d.current=$.IDLE},t))}function m(b,C){if(d.current===$.ENTERING&&f.current&&v(),!!u){if(C){c(!1),f.current=null,d.current=$.IDLE;return}d.current=$.LEAVING,f.current=window.setTimeout(function(){c(!1),f.current=null,d.current=$.IDLE},o)}}g.useEffect(function(){function b(){u&&a&&(v(),c(!1))}return window.addEventListener("scroll",b,!0),function(){window.removeEventListener("scroll",b,!0),f.current&&clearTimeout(f.current)}},[u,a,v]);var y={onMouseEnter:h,onMouseLeave:m,onTouchStart:function(){p.current=!1},onTouchMove:function(){p.current=!0},onTouchEnd:function(){!p.current&&!u&&c(!0),p.current=!1}};return[u,y,function(){return m(null,!0)}]}const or="_tooltip_wli9z_1",sr="_error_wli9z_15",ar="_warning_wli9z_19",me={tooltip:or,error:sr,warning:ar},Xe=({text:e="",error:r=!1,warning:n=!1,maxWidth:t="none",fontSize:i="inherit",padding:o="var(--padding-xxs) var(--padding-xs)",layerProps:s={style:{position:"fixed"}},arrowProps:a={style:{top:"100%",bottom:void 0,left:"50%",right:void 0,position:"absolute"}}})=>W.jsxs("div",{className:dt(me.tooltip,r?me.error:n?me.warning:""),...s,children:[W.jsx("div",{style:{maxWidth:t,fontSize:i,padding:o},children:e}),W.jsx(nr,{...a,size:6,onPointerEnterCapture:void 0,onPointerLeaveCapture:void 0})]});Xe.__docgenInfo={description:"",methods:[],displayName:"TooltipLayer",props:{text:{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}},error:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},warning:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},fontSize:{required:!1,tsType:{name:"union",raw:"string | number",elements:[{name:"string"},{name:"number"}]},description:"",defaultValue:{value:"'inherit'",computed:!1}},padding:{required:!1,tsType:{name:"union",raw:"string | number",elements:[{name:"string"},{name:"number"}]},description:"",defaultValue:{value:"'var(--padding-xxs) var(--padding-xs)'",computed:!1}},maxWidth:{required:!1,tsType:{name:"union",raw:"string | number",elements:[{name:"string"},{name:"number"}]},description:"",defaultValue:{value:"'none'",computed:!1}},layerProps:{required:!1,tsType:{name:"signature",type:"object",raw:`{
9
+ `,document.body.appendChild(r))}return r}var Qt=["size","angle","borderWidth","borderColor","roundness","backgroundColor","layerSide","style"],ie="left",oe="top",se="bottom",ae="right";function fe(e,r){return Math.tan(e*(Math.PI/180))*r}function er(e,r,n,t){var i,o=(i={},i[se]="0 "+-t+" "+r+" "+e,i[oe]="0 0 "+r+" "+(e+t),i[ae]=-t+" 0 "+e+" "+r,i[ie]="0 0 "+(e+t)+" "+r,i);return o[n.prop]}function tr(e,r,n,t,i){var o,s,a,l=t/10*e*2,u=(o={},o[se]=[0,e],o[oe]=[0,0],o[ae]=[e,r],o[ie]=[0,r],o)[n.prop].join(" "),c=n.isHorizontal?"V 0":"H "+r,f=r/2,d=r/2+fe(i,e/8),p=e/8,v=(s={},s[se]=["C",d,p,f+l,0,f,0],s[oe]=["C",d,e-p,f+l,e,f,e],s[ae]=["C",p,r-d,0,f-l,0,f],s[ie]=["C",e-p,r-d,e,f-l,e,f],s)[n.prop].join(" "),h=r/2-fe(i,e/8),m=e/8,y=(a={},a[se]=["C",f-l,0,h,m,u],a[oe]=["C",f-l,e,h,e-m,u],a[ae]=["C",0,f+l,m,r-h,u],a[ie]=["C",e,f+l,e-m,r-h,u],a)[n.prop].join(" ");return["M",u,c,v,y].join(" ")}function rr(e,r,n,t,i){var o=fe(i,n),s=t.isPush?[0,n]:[e,e-n],a=s[0],l=s[1];return t.isHorizontal?["M",a,n,"V",r-n,"L",l,r-n-o,"V",o+n,"Z"].join(" "):["M",n,a,"H",r-n,"L",r-n-o,l,"H",o+n,"Z"].join(" ")}var nr=g.forwardRef(function(r,n){var t=r.size,i=t===void 0?8:t,o=r.angle,s=o===void 0?45:o,a=r.borderWidth,l=a===void 0?0:a,u=r.borderColor,c=u===void 0?"black":u,f=r.roundness,d=f===void 0?0:f,p=r.backgroundColor,v=p===void 0?"white":p,h=r.layerSide,m=h===void 0?"top":h,y=r.style,b=y===void 0?{}:y,C=jt(r,Qt);if(m==="center")return null;var L=_[m],O=i,T=fe(s,i)*2,M=Math.max(O,T);return g.createElement("svg",x({ref:n},C,{style:x({},b,{transform:"translate"+(L.isHorizontal?"Y":"X")+"(-50%)"}),width:M,height:M,preserveAspectRatio:L.isPush?"xMinYMin":"xMaxYMax",viewBox:er(O,T,L,l)}),g.createElement("path",{fill:v,strokeWidth:l,stroke:c,d:tr(O,T,L,d,s)}),g.createElement("path",{fill:v,d:rr(O,T,l,L,s)}))}),$;(function(e){e[e.ENTERING=0]="ENTERING",e[e.LEAVING=1]="LEAVING",e[e.IDLE=2]="IDLE"})($||($={}));function ir(e){var r=e===void 0?{}:e,n=r.delayEnter,t=n===void 0?0:n,i=r.delayLeave,o=i===void 0?0:i,s=r.hideOnScroll,a=s===void 0?!0:s,l=g.useState(!1),u=l[0],c=l[1],f=g.useRef(null),d=g.useRef($.IDLE),p=g.useRef(!1),v=g.useCallback(function(){clearTimeout(f.current),f.current=null,d.current=$.IDLE},[]);function h(){d.current===$.LEAVING&&f.current&&v(),!u&&(d.current=$.ENTERING,f.current=window.setTimeout(function(){c(!0),f.current=null,d.current=$.IDLE},t))}function m(b,C){if(d.current===$.ENTERING&&f.current&&v(),!!u){if(C){c(!1),f.current=null,d.current=$.IDLE;return}d.current=$.LEAVING,f.current=window.setTimeout(function(){c(!1),f.current=null,d.current=$.IDLE},o)}}g.useEffect(function(){function b(){u&&a&&(v(),c(!1))}return window.addEventListener("scroll",b,!0),function(){window.removeEventListener("scroll",b,!0),f.current&&clearTimeout(f.current)}},[u,a,v]);var y={onMouseEnter:h,onMouseLeave:m,onTouchStart:function(){p.current=!1},onTouchMove:function(){p.current=!0},onTouchEnd:function(){!p.current&&!u&&c(!0),p.current=!1}};return[u,y,function(){return m(null,!0)}]}const or="_tooltip_wli9z_1",sr="_error_wli9z_15",ar="_warning_wli9z_19",me={tooltip:or,error:sr,warning:ar},Xe=({text:e="",error:r=!1,warning:n=!1,maxWidth:t="none",fontSize:i="inherit",padding:o="var(--padding-xxs) var(--padding-xs)",layerProps:s={style:{position:"fixed"}},arrowProps:a={style:{top:"100%",bottom:void 0,left:"50%",right:void 0,position:"absolute"}}})=>W.jsxs("div",{className:dt(me.tooltip,r?me.error:n?me.warning:""),...s,children:[W.jsx("div",{style:{maxWidth:t,fontSize:i,padding:o},children:e}),W.jsx(nr,{...a,size:6})]});Xe.__docgenInfo={description:"",methods:[],displayName:"TooltipLayer",props:{text:{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}},error:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},warning:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},fontSize:{required:!1,tsType:{name:"union",raw:"string | number",elements:[{name:"string"},{name:"number"}]},description:"",defaultValue:{value:"'inherit'",computed:!1}},padding:{required:!1,tsType:{name:"union",raw:"string | number",elements:[{name:"string"},{name:"number"}]},description:"",defaultValue:{value:"'var(--padding-xxs) var(--padding-xs)'",computed:!1}},maxWidth:{required:!1,tsType:{name:"union",raw:"string | number",elements:[{name:"string"},{name:"number"}]},description:"",defaultValue:{value:"'none'",computed:!1}},layerProps:{required:!1,tsType:{name:"signature",type:"object",raw:`{
10
10
  style?: CSSProperties;
11
11
  [key: string]: any;
12
12
  }`,signature:{properties:[{key:"style",value:{name:"CSSProperties",required:!1}},{key:{name:"string"},value:{name:"any",required:!0}}]}},description:"",defaultValue:{value:`{
@@ -1,4 +1,4 @@
1
- import{j as e}from"./jsx-runtime-eps93zm2.js";import{T as P}from"./tooltip-C_E_6ym5.js";import"./index-DhsZuJvc.js";import"./index-CUZDtIZe.js";import"./index-Bk2sglWO.js";const A={title:"Basic/Tooltip",component:P,args:{text:"Tooltip text",error:!1,warning:!1,enabled:!0,placement:void 0,triggerOffset:void 0,fontSize:void 0,padding:void 0,maxWidth:void 0,display:void 0,children:e.jsx("span",{children:"Hover over me"})}},r=X=>e.jsx(P,{...X}),p=r.bind({}),a=r.bind({});a.args={error:!0};const o=r.bind({});o.args={warning:!0};const t=r.bind({});t.args={text:e.jsxs(e.Fragment,{children:["Select from options:",e.jsxs("ul",{children:[e.jsx("li",{children:"One"}),e.jsx("li",{children:"Two"})]})]})};const n=r.bind({});n.args={placement:"right-end"};const i=r.bind({});i.args={triggerOffset:30};const c=r.bind({});c.args={forceOpen:!0};const s=r.bind({});s.args={display:"block",children:e.jsx("div",{style:{background:"lightgray"},children:"Block element"})};s.parameters={docs:{source:{type:"code"},description:{story:"The `Tooltip` trigger wrapper defaults to `display: inline`. If you encounter layout issues, try changing this to match its content (i.e. `display: block` for `block` elements)"}}};var l,d,g;p.parameters={...p.parameters,docs:{...(l=p.parameters)==null?void 0:l.docs,source:{originalSource:`args => <Tooltip
1
+ import{j as e}from"./jsx-runtime-eps93zm2.js";import{T as P}from"./tooltip-1V7clEnw.js";import"./index-DhsZuJvc.js";import"./index-CUZDtIZe.js";import"./index-Bk2sglWO.js";const A={title:"Basic/Tooltip",component:P,args:{text:"Tooltip text",error:!1,warning:!1,enabled:!0,placement:void 0,triggerOffset:void 0,fontSize:void 0,padding:void 0,maxWidth:void 0,display:void 0,children:e.jsx("span",{children:"Hover over me"})}},r=X=>e.jsx(P,{...X}),p=r.bind({}),a=r.bind({});a.args={error:!0};const o=r.bind({});o.args={warning:!0};const t=r.bind({});t.args={text:e.jsxs(e.Fragment,{children:["Select from options:",e.jsxs("ul",{children:[e.jsx("li",{children:"One"}),e.jsx("li",{children:"Two"})]})]})};const n=r.bind({});n.args={placement:"right-end"};const i=r.bind({});i.args={triggerOffset:30};const c=r.bind({});c.args={forceOpen:!0};const s=r.bind({});s.args={display:"block",children:e.jsx("div",{style:{background:"lightgray"},children:"Block element"})};s.parameters={docs:{source:{type:"code"},description:{story:"The `Tooltip` trigger wrapper defaults to `display: inline`. If you encounter layout issues, try changing this to match its content (i.e. `display: block` for `block` elements)"}}};var l,d,g;p.parameters={...p.parameters,docs:{...(l=p.parameters)==null?void 0:l.docs,source:{originalSource:`args => <Tooltip
2
2
  // eslint-disable-next-line react/jsx-props-no-spreading
3
3
  {...args} />`,...(g=(d=p.parameters)==null?void 0:d.docs)==null?void 0:g.source}}};var m,u,x;a.parameters={...a.parameters,docs:{...(m=a.parameters)==null?void 0:m.docs,source:{originalSource:`args => <Tooltip
4
4
  // eslint-disable-next-line react/jsx-props-no-spreading
@@ -1,4 +1,4 @@
1
- import{j as o}from"./jsx-runtime-eps93zm2.js";import{T as m}from"./tooltip-C_E_6ym5.js";import{M as u}from"./actions-Cu_0szZ4.js";import{m as d}from"./menu.stories-data-DeDnsKpk.js";import"./index-DhsZuJvc.js";import"./index-CUZDtIZe.js";import"./index-Bk2sglWO.js";import"./lodash-BHd_uQHh.js";import"./common-types-Sih75Sav.js";import"./disabled-context-rmpd7YJS.js";import"./button-_0DiND6h.js";import"./spinner-AWUe4xwQ.js";import"./icon-BP4BO6-k.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./inheritsLoose-DR8r8Ogv.js";import"./index-CEuq6vkz.js";import"./types-BmbYqTX_.js";import"./types-UmZ4Y_CR.js";import"./badge-CLQ59MDF.js";import"./flex-EllkLxgO.js";const B={title:"Basic/Tooltip/Test Cases",component:m,args:{text:"Tooltip text"}},l=c=>o.jsx(m,{...c}),e=l.bind({});e.args={children:o.jsx(u,{menu:d}),placement:"bottom-end",display:"inline-block"};const s=l.bind({});s.args={children:o.jsx("span",{children:"Hover over me"}),text:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean pharetra tellus eu cursus suscipit. Maecenas leo sapien, convallis ac urna ullamcorper, tempus porttitor eros. Suspendisse pellentesque odio ac metus semper, nec sagittis nisi cursus. Aenean felis libero, bibendum id accumsan id, commodo suscipit ex. Pellentesque gravida rhoncus neque, ac tincidunt libero maximus vel. In lacus nisi, malesuada vitae velit vel, laoreet porta nisl."};var t,r,i;e.parameters={...e.parameters,docs:{...(t=e.parameters)==null?void 0:t.docs,source:{originalSource:`args => <Tooltip
1
+ import{j as o}from"./jsx-runtime-eps93zm2.js";import{T as m}from"./tooltip-1V7clEnw.js";import{M as u}from"./actions-CZK3mphC.js";import{m as d}from"./menu.stories-data-DeDnsKpk.js";import"./index-DhsZuJvc.js";import"./index-CUZDtIZe.js";import"./index-Bk2sglWO.js";import"./lodash-BHd_uQHh.js";import"./common-types-Sih75Sav.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"./types-BmbYqTX_.js";import"./types-UmZ4Y_CR.js";import"./badge-CLQ59MDF.js";import"./flex-EllkLxgO.js";const B={title:"Basic/Tooltip/Test Cases",component:m,args:{text:"Tooltip text"}},l=c=>o.jsx(m,{...c}),e=l.bind({});e.args={children:o.jsx(u,{menu:d}),placement:"bottom-end",display:"inline-block"};const s=l.bind({});s.args={children:o.jsx("span",{children:"Hover over me"}),text:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean pharetra tellus eu cursus suscipit. Maecenas leo sapien, convallis ac urna ullamcorper, tempus porttitor eros. Suspendisse pellentesque odio ac metus semper, nec sagittis nisi cursus. Aenean felis libero, bibendum id accumsan id, commodo suscipit ex. Pellentesque gravida rhoncus neque, ac tincidunt libero maximus vel. In lacus nisi, malesuada vitae velit vel, laoreet porta nisl."};var t,r,i;e.parameters={...e.parameters,docs:{...(t=e.parameters)==null?void 0:t.docs,source:{originalSource:`args => <Tooltip
2
2
  // eslint-disable-next-line react/jsx-props-no-spreading
3
3
  {...args} />`,...(i=(r=e.parameters)==null?void 0:r.docs)==null?void 0:i.source}}};var a,n,p;s.parameters={...s.parameters,docs:{...(a=s.parameters)==null?void 0:a.docs,source:{originalSource:`args => <Tooltip
4
4
  // eslint-disable-next-line react/jsx-props-no-spreading
@@ -1,4 +1,4 @@
1
- import{j as n}from"./jsx-runtime-eps93zm2.js";import{c as d}from"./index-Bk2sglWO.js";import{I as q}from"./icon-BP4BO6-k.js";import{T}from"./common-types-Sih75Sav.js";import{B as E}from"./button-_0DiND6h.js";import{M as w}from"./actions-Cu_0szZ4.js";import{r as N}from"./index-DhsZuJvc.js";import{D as M}from"./disabled-context-rmpd7YJS.js";const R="_topbar_oyr59_11",_="_fixed_oyr59_21",j="_appSwitcher_oyr59_29",h="_title_oyr59_75",C="_logo_oyr59_91",x="_label_oyr59_94",I="_brand_oyr59_99",B="_version_oyr59_104",H="_left_oyr59_111",L="_right_oyr59_112",P="_item_oyr59_126",A="_link_oyr59_127",D="_button_oyr59_138",O="_menu_oyr59_139",S="_active_oyr59_168",V="_alert_oyr59_193",a={topbar:R,fixed:_,appSwitcher:j,title:h,logo:C,label:x,brand:I,version:B,left:H,right:L,item:P,link:A,button:D,menu:O,active:S,alert:V},g=({warning:e})=>n.jsx("div",{className:a.alert,children:e});g.__docgenInfo={description:"",methods:[],displayName:"Warning",props:{warning:{required:!0,tsType:{name:"ReactNode"},description:""}}};const f=({icon:e,url:t,onClick:s})=>{const r=n.jsx(q,{icon:e});return t?n.jsx("a",{href:t,onClick:s,className:a.appSwitcher,children:r}):n.jsx("div",{onClick:s,className:a.appSwitcher,children:r})};f.__docgenInfo={description:"",methods:[],displayName:"AppSwitcher",props:{icon:{required:!1,tsType:{name:"ReactReactNode",raw:"React.ReactNode"},description:""},url:{required:!1,tsType:{name:"string"},description:""},onClick:{required:!1,tsType:{name:"MouseEventHandler",elements:[{name:"union",raw:"HTMLDivElement | HTMLAnchorElement",elements:[{name:"HTMLDivElement"},{name:"HTMLAnchorElement"}]}],raw:"MouseEventHandler<HTMLDivElement | HTMLAnchorElement>"},description:""}}};const b=({label:e,logo:t,url:s,version:r,onClick:i})=>{const l=n.jsxs("div",{className:a.title,children:[t&&n.jsx("div",{className:a.logo,children:t}),e&&n.jsx("span",{className:a.label,children:e}),r&&n.jsx("div",{className:a.version,children:r})]});return n.jsx("div",{className:d(a.item,a.brand),children:s?n.jsx("a",{href:s,onClick:i,children:l}):n.jsx("div",{onClick:i,children:l})})};b.__docgenInfo={description:"",methods:[],displayName:"Title",props:{label:{required:!1,tsType:{name:"union",raw:"string | null",elements:[{name:"string"},{name:"null"}]},description:""},logo:{required:!1,tsType:{name:"ReactReactNode",raw:"React.ReactNode"},description:""},url:{required:!1,tsType:{name:"string"},description:""},version:{required:!1,tsType:{name:"union",raw:"string | number",elements:[{name:"string"},{name:"number"}]},description:""},onClick:{required:!1,tsType:{name:"MouseEventHandler",elements:[{name:"union",raw:"HTMLDivElement | HTMLAnchorElement",elements:[{name:"HTMLDivElement"},{name:"HTMLAnchorElement"}]}],raw:"MouseEventHandler<HTMLDivElement | HTMLAnchorElement>"},description:""}}};var m=(e=>(e.LINK="Link",e.BUTTON="Button",e.MENU="Menu",e.COMPONENT="Component",e))(m||{});const p=({label:e,url:t,icon:s,onClick:r,active:i,disabled:l,testId:c,component:o="a"})=>{const u=N.useContext(M),k=v=>{(l||u)&&v.preventDefault(),r==null||r(v)};return n.jsxs(o,{className:d(a.link,i?a.active:""),href:t||"#",to:t,onClick:k,"aria-disabled":l||u,"data-testid":c,role:r&&!t?"button":void 0,children:[s,n.jsx("span",{className:a.label,children:e})]})};p.__docgenInfo={description:"",methods:[],displayName:"Link",props:{label:{required:!1,tsType:{name:"union",raw:"string | null",elements:[{name:"string"},{name:"null"}]},description:""},url:{required:!1,tsType:{name:"string"},description:""},icon:{required:!1,tsType:{name:"ReactReactNode",raw:"React.ReactNode"},description:""},onClick:{required:!1,tsType:{name:"MouseEventHandler",elements:[{name:"HTMLAnchorElement"}],raw:"MouseEventHandler<HTMLAnchorElement>"},description:""},active:{required:!1,tsType:{name:"boolean"},description:""},disabled:{required:!1,tsType:{name:"boolean"},description:""},testId:{required:!1,tsType:{name:"string"},description:""},component:{required:!1,tsType:{name:"ReactElementType",raw:"React.ElementType"},description:"",defaultValue:{value:"'a'",computed:!1}}}};const y=({element:e})=>{switch(e.type){case m.LINK:return n.jsx("div",{className:a.item,children:n.jsx(p,{label:e.label,url:e.url,icon:e.icon,onClick:e.onClick,active:e.active,disabled:e.disabled,testId:e.testId,component:e.component})});case m.BUTTON:return n.jsx("div",{className:d(a.item,a.button),children:n.jsx(E,{label:e.label,colored:e.colored,pill:!0,disabled:e.disabled,onClick:e.onClick,icon:e.icon,testId:e.testId})});case m.MENU:return n.jsx("div",{className:d(a.item,a.menu),children:n.jsx(w,{maxHeight:"100%",menu:{trigger:T.COMPONENT,fullHeightTrigger:!0,placement:"bottom-start",component:n.jsx(p,{label:e.label,icon:e.icon,onClick:e.onClick}),sections:e.sections}})});case m.COMPONENT:return n.jsx("div",{className:a.item,children:e.component});default:return null}};y.__docgenInfo={description:"",methods:[],displayName:"Element",props:{element:{required:!0,tsType:{name:"union",raw:"TLinkElement | TButtonElement | TMenuElement | TComponentElement",elements:[{name:"intersection",raw:`TBaseElementProps & {
1
+ import{j as n}from"./jsx-runtime-eps93zm2.js";import{c as d}from"./index-Bk2sglWO.js";import{I as q}from"./icon-BP4BO6-k.js";import{T}from"./common-types-Sih75Sav.js";import{B as E}from"./button-C1sV-0mR.js";import{M as w}from"./actions-CZK3mphC.js";import{r as N}from"./index-DhsZuJvc.js";import{D as M}from"./disabled-context-rmpd7YJS.js";const R="_topbar_oyr59_11",_="_fixed_oyr59_21",j="_appSwitcher_oyr59_29",h="_title_oyr59_75",C="_logo_oyr59_91",x="_label_oyr59_94",I="_brand_oyr59_99",B="_version_oyr59_104",H="_left_oyr59_111",L="_right_oyr59_112",P="_item_oyr59_126",A="_link_oyr59_127",D="_button_oyr59_138",O="_menu_oyr59_139",S="_active_oyr59_168",V="_alert_oyr59_193",a={topbar:R,fixed:_,appSwitcher:j,title:h,logo:C,label:x,brand:I,version:B,left:H,right:L,item:P,link:A,button:D,menu:O,active:S,alert:V},g=({warning:e})=>n.jsx("div",{className:a.alert,children:e});g.__docgenInfo={description:"",methods:[],displayName:"Warning",props:{warning:{required:!0,tsType:{name:"ReactNode"},description:""}}};const f=({icon:e,url:t,onClick:s})=>{const r=n.jsx(q,{icon:e});return t?n.jsx("a",{href:t,onClick:s,className:a.appSwitcher,children:r}):n.jsx("div",{onClick:s,className:a.appSwitcher,children:r})};f.__docgenInfo={description:"",methods:[],displayName:"AppSwitcher",props:{icon:{required:!1,tsType:{name:"ReactReactNode",raw:"React.ReactNode"},description:""},url:{required:!1,tsType:{name:"string"},description:""},onClick:{required:!1,tsType:{name:"MouseEventHandler",elements:[{name:"union",raw:"HTMLDivElement | HTMLAnchorElement",elements:[{name:"HTMLDivElement"},{name:"HTMLAnchorElement"}]}],raw:"MouseEventHandler<HTMLDivElement | HTMLAnchorElement>"},description:""}}};const b=({label:e,logo:t,url:s,version:r,onClick:i})=>{const l=n.jsxs("div",{className:a.title,children:[t&&n.jsx("div",{className:a.logo,children:t}),e&&n.jsx("span",{className:a.label,children:e}),r&&n.jsx("div",{className:a.version,children:r})]});return n.jsx("div",{className:d(a.item,a.brand),children:s?n.jsx("a",{href:s,onClick:i,children:l}):n.jsx("div",{onClick:i,children:l})})};b.__docgenInfo={description:"",methods:[],displayName:"Title",props:{label:{required:!1,tsType:{name:"union",raw:"string | null",elements:[{name:"string"},{name:"null"}]},description:""},logo:{required:!1,tsType:{name:"ReactReactNode",raw:"React.ReactNode"},description:""},url:{required:!1,tsType:{name:"string"},description:""},version:{required:!1,tsType:{name:"union",raw:"string | number",elements:[{name:"string"},{name:"number"}]},description:""},onClick:{required:!1,tsType:{name:"MouseEventHandler",elements:[{name:"union",raw:"HTMLDivElement | HTMLAnchorElement",elements:[{name:"HTMLDivElement"},{name:"HTMLAnchorElement"}]}],raw:"MouseEventHandler<HTMLDivElement | HTMLAnchorElement>"},description:""}}};var m=(e=>(e.LINK="Link",e.BUTTON="Button",e.MENU="Menu",e.COMPONENT="Component",e))(m||{});const p=({label:e,url:t,icon:s,onClick:r,active:i,disabled:l,testId:c,component:o="a"})=>{const u=N.useContext(M),k=v=>{(l||u)&&v.preventDefault(),r==null||r(v)};return n.jsxs(o,{className:d(a.link,i?a.active:""),href:t||"#",to:t,onClick:k,"aria-disabled":l||u,"data-testid":c,role:r&&!t?"button":void 0,children:[s,n.jsx("span",{className:a.label,children:e})]})};p.__docgenInfo={description:"",methods:[],displayName:"Link",props:{label:{required:!1,tsType:{name:"union",raw:"string | null",elements:[{name:"string"},{name:"null"}]},description:""},url:{required:!1,tsType:{name:"string"},description:""},icon:{required:!1,tsType:{name:"ReactReactNode",raw:"React.ReactNode"},description:""},onClick:{required:!1,tsType:{name:"MouseEventHandler",elements:[{name:"HTMLAnchorElement"}],raw:"MouseEventHandler<HTMLAnchorElement>"},description:""},active:{required:!1,tsType:{name:"boolean"},description:""},disabled:{required:!1,tsType:{name:"boolean"},description:""},testId:{required:!1,tsType:{name:"string"},description:""},component:{required:!1,tsType:{name:"ReactElementType",raw:"React.ElementType"},description:"",defaultValue:{value:"'a'",computed:!1}}}};const y=({element:e})=>{switch(e.type){case m.LINK:return n.jsx("div",{className:a.item,children:n.jsx(p,{label:e.label,url:e.url,icon:e.icon,onClick:e.onClick,active:e.active,disabled:e.disabled,testId:e.testId,component:e.component})});case m.BUTTON:return n.jsx("div",{className:d(a.item,a.button),children:n.jsx(E,{label:e.label,colored:e.colored,pill:!0,disabled:e.disabled,onClick:e.onClick,icon:e.icon,testId:e.testId})});case m.MENU:return n.jsx("div",{className:d(a.item,a.menu),children:n.jsx(w,{maxHeight:"100%",menu:{trigger:T.COMPONENT,fullHeightTrigger:!0,placement:"bottom-start",component:n.jsx(p,{label:e.label,icon:e.icon,onClick:e.onClick}),sections:e.sections}})});case m.COMPONENT:return n.jsx("div",{className:a.item,children:e.component});default:return null}};y.__docgenInfo={description:"",methods:[],displayName:"Element",props:{element:{required:!0,tsType:{name:"union",raw:"TLinkElement | TButtonElement | TMenuElement | TComponentElement",elements:[{name:"intersection",raw:`TBaseElementProps & {
2
2
  type: 'Link';
3
3
  url?: string;
4
4
  active?: boolean;
@@ -1,4 +1,4 @@
1
- import{j as e}from"./jsx-runtime-eps93zm2.js";import{H as I,L as c,S as D,R as l}from"./react-router-dom-CMITYWBH.js";import{I as O,T as A}from"./common-types-Sih75Sav.js";import{T as p}from"./top-bar-R-CjhJ21.js";import{P as w}from"./page-7SSpdYhb.js";import{M as N}from"./actions-Cu_0szZ4.js";import{B as m}from"./button-_0DiND6h.js";import{B as P}from"./badge-CLQ59MDF.js";import{L as v}from"./logo-BVP9045W.js";import{s as H}from"./icon-custom-Xcl4YkWP.js";import{M as s}from"./types-BmbYqTX_.js";import"./index-DhsZuJvc.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"./icon-BP4BO6-k.js";import"./disabled-context-rmpd7YJS.js";import"./lodash-BHd_uQHh.js";import"./tooltip-C_E_6ym5.js";import"./index-CUZDtIZe.js";import"./types-UmZ4Y_CR.js";import"./spinner-AWUe4xwQ.js";const M=[{type:"Link",label:"Link",onClick:()=>{}},{type:"Link",label:"Active",active:!0,onClick:()=>{}},{type:"Link",label:"Disabled",disabled:!0,onClick:()=>{}},{type:"Menu",label:"Dropdown",onClick:()=>{},sections:[{type:"Option",label:"Alpacas",onClick:()=>{}},{type:"Option",label:"Llamas",onClick:()=>{}}]},{type:"Button",label:"Save",colored:!0,onClick:()=>{},testId:"top-bar-button-save"}],E=[{type:"Component",component:e.jsx(P,{title:"3",small:!0,margin:"5px",children:e.jsx(m,{icon:O.NOTIFICATION,round:!0,onClick:()=>{}})})},{type:"Component",component:e.jsx(N,{menu:{trigger:A.COMPONENT,fullHeightTrigger:!0,placement:"bottom-end",component:e.jsx(m,{label:"TU",round:!0,onClick:()=>{}}),sections:[{type:s.HEADING,label:"Test User"},{type:s.OPTION,label:"Profile",icon:"user",onClick:()=>{}},{type:s.DIVIDER},{type:s.OPTION,label:"Sign out",icon:"lock",onClick:()=>{}}]}})}],le={title:"Navigation/TopBar",component:p,parameters:{layout:"fullscreen",docs:{story:{inline:!1,iframeHeight:400}}},argTypes:{height:{control:"text"}},args:{title:{logo:e.jsx("img",{src:v,alt:"logo"}),onClick:()=>{}},content:M,contentRight:E}},i=j=>e.jsx(p,{...j}),n=i.bind({}),t=i.bind({});t.args={warning:"Application update available. Please refresh your browser."};const r=i.bind({});r.args={title:{label:"Text Branding",onClick:()=>{}}};const o=i.bind({});o.args={appSwitcher:{icon:H,onClick:()=>{}}};const a=()=>e.jsx(I,{children:e.jsxs(w,{left:0,children:[e.jsx(p,{content:[{type:"Link",label:"Dashboard",component:c,url:"/dashboard"},{type:"Link",label:"Settings",component:c,url:"/settings"}]}),e.jsxs(D,{children:[e.jsx(l,{path:"/dashboard",children:"Dashboard"}),e.jsx(l,{path:"/settings",children:"Settings"})]})]})});a.__docgenInfo={description:"",methods:[],displayName:"AsRouterLink"};var d,u,g;n.parameters={...n.parameters,docs:{...(d=n.parameters)==null?void 0:d.docs,source:{originalSource:"args => <TopBar {...args} />",...(g=(u=n.parameters)==null?void 0:u.docs)==null?void 0:g.source}}};var h,b,k;t.parameters={...t.parameters,docs:{...(h=t.parameters)==null?void 0:h.docs,source:{originalSource:"args => <TopBar {...args} />",...(k=(b=t.parameters)==null?void 0:b.docs)==null?void 0:k.source}}};var T,y,f;r.parameters={...r.parameters,docs:{...(T=r.parameters)==null?void 0:T.docs,source:{originalSource:"args => <TopBar {...args} />",...(f=(y=r.parameters)==null?void 0:y.docs)==null?void 0:f.source}}};var x,S,C;o.parameters={...o.parameters,docs:{...(x=o.parameters)==null?void 0:x.docs,source:{originalSource:"args => <TopBar {...args} />",...(C=(S=o.parameters)==null?void 0:S.docs)==null?void 0:C.source}}};var L,B,R;a.parameters={...a.parameters,docs:{...(L=a.parameters)==null?void 0:L.docs,source:{originalSource:`() => {
1
+ import{j as e}from"./jsx-runtime-eps93zm2.js";import{H as I,L as c,S as D,R as l}from"./react-router-dom-CMITYWBH.js";import{I as O,T as A}from"./common-types-Sih75Sav.js";import{T as p}from"./top-bar-DG4ok0uF.js";import{P as w}from"./page-7SSpdYhb.js";import{M as N}from"./actions-CZK3mphC.js";import{B as m}from"./button-C1sV-0mR.js";import{B as P}from"./badge-CLQ59MDF.js";import{L as v}from"./logo-BVP9045W.js";import{s as H}from"./icon-custom-Xcl4YkWP.js";import{M as s}from"./types-BmbYqTX_.js";import"./index-DhsZuJvc.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"./icon-BP4BO6-k.js";import"./disabled-context-rmpd7YJS.js";import"./lodash-BHd_uQHh.js";import"./tooltip-1V7clEnw.js";import"./index-CUZDtIZe.js";import"./types-UmZ4Y_CR.js";import"./spinner-AWUe4xwQ.js";const M=[{type:"Link",label:"Link",onClick:()=>{}},{type:"Link",label:"Active",active:!0,onClick:()=>{}},{type:"Link",label:"Disabled",disabled:!0,onClick:()=>{}},{type:"Menu",label:"Dropdown",onClick:()=>{},sections:[{type:"Option",label:"Alpacas",onClick:()=>{}},{type:"Option",label:"Llamas",onClick:()=>{}}]},{type:"Button",label:"Save",colored:!0,onClick:()=>{},testId:"top-bar-button-save"}],E=[{type:"Component",component:e.jsx(P,{title:"3",small:!0,margin:"5px",children:e.jsx(m,{icon:O.NOTIFICATION,round:!0,onClick:()=>{}})})},{type:"Component",component:e.jsx(N,{menu:{trigger:A.COMPONENT,fullHeightTrigger:!0,placement:"bottom-end",component:e.jsx(m,{label:"TU",round:!0,onClick:()=>{}}),sections:[{type:s.HEADING,label:"Test User"},{type:s.OPTION,label:"Profile",icon:"user",onClick:()=>{}},{type:s.DIVIDER},{type:s.OPTION,label:"Sign out",icon:"lock",onClick:()=>{}}]}})}],le={title:"Navigation/TopBar",component:p,parameters:{layout:"fullscreen",docs:{story:{inline:!1,iframeHeight:400}}},argTypes:{height:{control:"text"}},args:{title:{logo:e.jsx("img",{src:v,alt:"logo"}),onClick:()=>{}},content:M,contentRight:E}},i=j=>e.jsx(p,{...j}),n=i.bind({}),t=i.bind({});t.args={warning:"Application update available. Please refresh your browser."};const r=i.bind({});r.args={title:{label:"Text Branding",onClick:()=>{}}};const o=i.bind({});o.args={appSwitcher:{icon:H,onClick:()=>{}}};const a=()=>e.jsx(I,{children:e.jsxs(w,{left:0,children:[e.jsx(p,{content:[{type:"Link",label:"Dashboard",component:c,url:"/dashboard"},{type:"Link",label:"Settings",component:c,url:"/settings"}]}),e.jsxs(D,{children:[e.jsx(l,{path:"/dashboard",children:"Dashboard"}),e.jsx(l,{path:"/settings",children:"Settings"})]})]})});a.__docgenInfo={description:"",methods:[],displayName:"AsRouterLink"};var d,u,g;n.parameters={...n.parameters,docs:{...(d=n.parameters)==null?void 0:d.docs,source:{originalSource:"args => <TopBar {...args} />",...(g=(u=n.parameters)==null?void 0:u.docs)==null?void 0:g.source}}};var h,b,k;t.parameters={...t.parameters,docs:{...(h=t.parameters)==null?void 0:h.docs,source:{originalSource:"args => <TopBar {...args} />",...(k=(b=t.parameters)==null?void 0:b.docs)==null?void 0:k.source}}};var T,y,f;r.parameters={...r.parameters,docs:{...(T=r.parameters)==null?void 0:T.docs,source:{originalSource:"args => <TopBar {...args} />",...(f=(y=r.parameters)==null?void 0:y.docs)==null?void 0:f.source}}};var x,S,C;o.parameters={...o.parameters,docs:{...(x=o.parameters)==null?void 0:x.docs,source:{originalSource:"args => <TopBar {...args} />",...(C=(S=o.parameters)==null?void 0:S.docs)==null?void 0:C.source}}};var L,B,R;a.parameters={...a.parameters,docs:{...(L=a.parameters)==null?void 0:L.docs,source:{originalSource:`() => {
2
2
  return <HashRouter>
3
3
  <Page left={0}>
4
4
  <TopBar content={[{
@@ -1,4 +1,4 @@
1
- import{j as e}from"./jsx-runtime-eps93zm2.js";import{I as n}from"./common-types-Sih75Sav.js";import{T as l}from"./top-bar-R-CjhJ21.js";import{B as s}from"./button-_0DiND6h.js";import{B as m}from"./badge-CLQ59MDF.js";import{L as p}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"./actions-Cu_0szZ4.js";import"./lodash-BHd_uQHh.js";import"./tooltip-C_E_6ym5.js";import"./index-CUZDtIZe.js";import"./types-BmbYqTX_.js";import"./types-UmZ4Y_CR.js";import"./spinner-AWUe4xwQ.js";const h={title:"Navigation/TopBar/Test Cases",parameters:{layout:"fullscreen",docs:{story:{inline:!1,iframeHeight:400}}}},o=()=>e.jsx(l,{title:{logo:e.jsx("img",{src:p,alt:"logo"}),version:"V1.2.3",onClick:()=>{}},content:[{type:"Link",label:"Link",onClick:()=>{}},{type:"Link",label:"Lorem ipsum dolor est compendum lorem ipsum dolor est compendum lorem ipsum dolor est (cloned 2022-06-17 01:33:42)",active:!0,onClick:()=>{}},{type:"Link",label:"Disabled",disabled:!0,onClick:()=>{}},{type:"Button",label:"Save",colored:!0,onClick:()=>{},testId:"top-bar-button-save"}],contentRight:[{type:"Component",component:e.jsx(m,{title:"3",small:!0,margin:"5px",children:e.jsx(s,{icon:n.NOTIFICATION,round:!0,onClick:()=>{}})})}]});o.__docgenInfo={description:"",methods:[],displayName:"OverflowingLinks"};var t,r,i;o.parameters={...o.parameters,docs:{...(t=o.parameters)==null?void 0:t.docs,source:{originalSource:`() => <TopBar title={{
1
+ import{j as e}from"./jsx-runtime-eps93zm2.js";import{I as n}from"./common-types-Sih75Sav.js";import{T as l}from"./top-bar-DG4ok0uF.js";import{B as s}from"./button-C1sV-0mR.js";import{B as m}from"./badge-CLQ59MDF.js";import{L as p}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"./actions-CZK3mphC.js";import"./lodash-BHd_uQHh.js";import"./tooltip-1V7clEnw.js";import"./index-CUZDtIZe.js";import"./types-BmbYqTX_.js";import"./types-UmZ4Y_CR.js";import"./spinner-AWUe4xwQ.js";const h={title:"Navigation/TopBar/Test Cases",parameters:{layout:"fullscreen",docs:{story:{inline:!1,iframeHeight:400}}}},o=()=>e.jsx(l,{title:{logo:e.jsx("img",{src:p,alt:"logo"}),version:"V1.2.3",onClick:()=>{}},content:[{type:"Link",label:"Link",onClick:()=>{}},{type:"Link",label:"Lorem ipsum dolor est compendum lorem ipsum dolor est compendum lorem ipsum dolor est (cloned 2022-06-17 01:33:42)",active:!0,onClick:()=>{}},{type:"Link",label:"Disabled",disabled:!0,onClick:()=>{}},{type:"Button",label:"Save",colored:!0,onClick:()=>{},testId:"top-bar-button-save"}],contentRight:[{type:"Component",component:e.jsx(m,{title:"3",small:!0,margin:"5px",children:e.jsx(s,{icon:n.NOTIFICATION,round:!0,onClick:()=>{}})})}]});o.__docgenInfo={description:"",methods:[],displayName:"OverflowingLinks"};var t,r,i;o.parameters={...o.parameters,docs:{...(t=o.parameters)==null?void 0:t.docs,source:{originalSource:`() => <TopBar title={{
2
2
  logo: <img src={LogoSVG} alt="logo" />,
3
3
  version: 'V1.2.3',
4
4
  onClick: () => {}