@oliasoft-open-source/react-ui-library 4.7.0-beta-3 → 4.7.0

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 (127) hide show
  1. package/dist/404.html +1 -0
  2. package/dist/assets/{index-ffnttoim.js → index-3CeHq3uM.js} +5 -6
  3. package/dist/assets/{index-dOfLgtRX.css → index-DdTheZoQ.css} +1 -4
  4. package/dist/global.css +45 -48
  5. package/dist/index.d.ts +69 -79
  6. package/dist/index.html +1 -1
  7. package/dist/index.js +2013 -2282
  8. package/dist/index.js.map +1 -1
  9. package/dist/storybook/assets/{Color-6VNJS4EI-5mv-gOfo.js → Color-6VNJS4EI-xX703Erw.js} +1 -1
  10. package/dist/storybook/assets/{DocsRenderer-NNNQARDV-WaSwS_18.js → DocsRenderer-NNNQARDV-jfRj2DTn.js} +1 -1
  11. package/dist/storybook/assets/{WithTooltip-V3YHNWJZ-Dlt0G_eH.js → WithTooltip-V3YHNWJZ-AvjzxEIz.js} +1 -1
  12. package/dist/storybook/assets/{accordion.stories-BbpRXaiJ.js → accordion.stories-N0ePGIzZ.js} +1 -1
  13. package/dist/storybook/assets/{actions-MkrpU3sl.js → actions-0ELEGFed.js} +1 -1
  14. package/dist/storybook/assets/{actions.stories-9i52_Rux.js → actions.stories-kCR8bnxR.js} +1 -1
  15. package/dist/storybook/assets/{afe.stories-U0-W5U64.js → afe.stories-gS6IvugS.js} +1 -1
  16. package/dist/storybook/assets/{badge.stories--T9ak5cr.js → badge.stories-fpUlm73g.js} +1 -1
  17. package/dist/storybook/assets/{blowout.stories-G-gAIxfk.js → blowout.stories-vtbbYHQT.js} +1 -1
  18. package/dist/storybook/assets/{button-MXXjI7Bb.js → button-BiJw0fB3.js} +1 -1
  19. package/dist/storybook/assets/{button-group-f5VgIRsa.js → button-group-uKCjEKYR.js} +1 -1
  20. package/dist/storybook/assets/{button-group.stories-C7TuTTy6.js → button-group.stories-mynaBhDz.js} +1 -1
  21. package/dist/storybook/assets/{button.stories-rq3SXBTn.js → button.stories-7N3AZjiw.js} +1 -1
  22. package/dist/storybook/assets/{buttons-and-links-VQgmPqVJ.js → buttons-and-links-0h-AVRdJ.js} +1 -1
  23. package/dist/storybook/assets/{card.stories-pCYBc-Vt.js → card.stories-N8mLrD63.js} +1 -1
  24. package/dist/storybook/assets/{casing-loads.stories-gq4jb1p0.js → casing-loads.stories-cCvBYMPa.js} +1 -1
  25. package/dist/storybook/assets/{cell.stories-ycwhWlIa.js → cell.stories-hT2-0Ekx.js} +1 -1
  26. package/dist/storybook/assets/{check-box-w174Mu0R.js → check-box-KynSyTaY.js} +1 -1
  27. package/dist/storybook/assets/{check-box.stories-72A4TN39.js → check-box.stories-yE82OQod.js} +1 -1
  28. package/dist/storybook/assets/{chunk-HLWAVYOI-_b1tlWM3.js → chunk-HLWAVYOI-UQuxjHgI.js} +1 -1
  29. package/dist/storybook/assets/{color-cEzs-xnA.js → color-Sdh3kTOi.js} +1 -1
  30. package/dist/storybook/assets/{column.stories-U4nQqgWb.js → column.stories-cX-u-DHI.js} +1 -1
  31. package/dist/storybook/assets/{dialog-u5m1F-lX.js → dialog-Au78k7wS.js} +1 -1
  32. package/dist/storybook/assets/{drawer-was2OGqf.js → drawer-Vhj7CUNA.js} +1 -1
  33. package/dist/storybook/assets/{drawer.stories-euYpu-I_.js → drawer.stories-FPi2nBqL.js} +1 -1
  34. package/dist/storybook/assets/{empty.stories-T-_CrIhL.js → empty.stories-oRmjEU7P.js} +1 -1
  35. package/dist/storybook/assets/{field-fx75Y95f.js → field-m7XXDdEG.js} +1 -1
  36. package/dist/storybook/assets/{field.stories-2Qckj9Ou.js → field.stories-6xmZA-uD.js} +1 -1
  37. package/dist/storybook/assets/{file-button.stories-0zVuRMcp.js → file-button.stories-gojUYo7t.js} +1 -1
  38. package/dist/storybook/assets/{file-input-fzEQtraw.js → file-input-X63bjABB.js} +1 -1
  39. package/dist/storybook/assets/{file-input.stories-P1T12gxg.js → file-input.stories-KZSe0jKl.js} +1 -1
  40. package/dist/storybook/assets/{flex.stories-Vlk77f1V.js → flex.stories-xAOrglx5.js} +1 -1
  41. package/dist/storybook/assets/{footer.stories-OOGCWJOv.js → footer.stories-2AIpYgl_.js} +1 -1
  42. package/dist/storybook/assets/{form.stories-NIwGiDxn.js → form.stories-qFitN202.js} +1 -1
  43. package/dist/storybook/assets/{formation.stories-1BHk-Z5n.js → formation.stories-u2HG5vE1.js} +1 -1
  44. package/dist/storybook/assets/{formatter-SWP5E3XI-lPjnxviv.js → formatter-SWP5E3XI-AcQFFmvi.js} +1 -1
  45. package/dist/storybook/assets/{heading-CRsqGmBL.js → heading-4tVgoT7O.js} +1 -1
  46. package/dist/storybook/assets/{heading.stories-i7xajcE_.js → heading.stories-7Bqlw14c.js} +1 -1
  47. package/dist/storybook/assets/{help-icon-DUhtRK0A.js → help-icon-eelulTML.js} +1 -1
  48. package/dist/storybook/assets/{help-icon.stories-FyPetqQr.js → help-icon.stories-CptgOV2E.js} +1 -1
  49. package/dist/storybook/assets/iframe-3RlYxWwB.js +7 -0
  50. package/dist/storybook/assets/{index-xs8f072L.js → index-dKL70FW5.js} +5 -5
  51. package/dist/storybook/assets/{index-VSx05S_2.js → index-qZmQ7nA9.js} +1 -1
  52. package/dist/storybook/assets/{input-vzl5J-q1.js → input-fYKvBwPs.js} +1 -1
  53. package/dist/storybook/assets/{input-group.stories-6EUjHyss.js → input-group.stories-MuX_NnP5.js} +1 -1
  54. package/dist/storybook/assets/{input-validation-fn2c7CZI.js → input-validation--CWCjQnL.js} +1 -1
  55. package/dist/storybook/assets/{input.stories-rTyGPzfX.js → input.stories-Y5X-JFWU.js} +1 -1
  56. package/dist/storybook/assets/{inputs-4CE3Qz8f.js → inputs-97VxSPJR.js} +4 -4
  57. package/dist/storybook/assets/{label-CezqEpI3.js → label-bLcoUwtK.js} +1 -1
  58. package/dist/storybook/assets/{label.stories-niFJlzWW.js → label.stories-KbJuUVw3.js} +1 -1
  59. package/dist/storybook/assets/{layout-forms-hnqEzhUh.js → layout-forms-N4FQBaG8.js} +1 -1
  60. package/dist/storybook/assets/{layout-general-GKzWTVlq.js → layout-general-NDOvxP4q.js} +1 -1
  61. package/dist/storybook/assets/{list-obj4NAnI.js → list-oRkYBU-W.js} +1 -1
  62. package/dist/storybook/assets/{list.stories-q5ZUuhM_.js → list.stories-EMdcTvdT.js} +1 -1
  63. package/dist/storybook/assets/{list.stories-data-xxLjz2Y6.js → list.stories-data-oQzKw4Pq.js} +1 -1
  64. package/dist/storybook/assets/{loader.stories-UWhF9bJF.js → loader.stories-B5lK8-XB.js} +1 -1
  65. package/dist/storybook/assets/{menu.stories-y0NlwAvu.js → menu.stories-PBBlly2o.js} +1 -1
  66. package/dist/storybook/assets/{message.stories-iT_DKpjU.js → message.stories-aLAQs_iU.js} +1 -1
  67. package/dist/storybook/assets/{meta-content-egPJiNdW.js → meta-content-sjR-N3-O.js} +1 -1
  68. package/dist/storybook/assets/{modal.stories-VOY0gBdV.js → modal.stories-w8Ga2is6.js} +1 -1
  69. package/dist/storybook/assets/number-input-ymd7m-s5.js +1 -0
  70. package/dist/storybook/assets/number-input.stories-vPnYf6Zp.js +97 -0
  71. package/dist/storybook/assets/{option-dropdown.stories-hrDlMrbm.js → option-dropdown.stories-TfHqGoeH.js} +1 -1
  72. package/dist/storybook/assets/{padding-and-spacing-J0l6qP8c.js → padding-and-spacing-c8LvBBMe.js} +1 -1
  73. package/dist/storybook/assets/{page.stories--jUrPw0e.js → page.stories-uG2-dlo7.js} +1 -1
  74. package/dist/storybook/assets/{pagination-APbPWlVY.js → pagination-H0l4VC9v.js} +1 -1
  75. package/dist/storybook/assets/{pagination.stories-r3XGZlP9.js → pagination.stories-NQ91Xlrk.js} +1 -1
  76. package/dist/storybook/assets/{pop-confirm.stories-pXKS5ukj.js → pop-confirm.stories-6V_XrhKa.js} +1 -1
  77. package/dist/storybook/assets/{popover-ZJGe9jlj.js → popover-N9B8JT3G.js} +1 -1
  78. package/dist/storybook/assets/{popover.stories-2K90u4uo.js → popover.stories-7Q50puZs.js} +1 -1
  79. package/dist/storybook/assets/{preview-BYvKcpdH.js → preview-AHjAdEy1.js} +2 -2
  80. package/dist/storybook/assets/{preview-vq7_vD2k.js → preview-VX4P0egZ.js} +1 -1
  81. package/dist/storybook/assets/{projects.stories-LB28sKC4.js → projects.stories-UnlGjNFI.js} +1 -1
  82. package/dist/storybook/assets/{radio-button-9Xi1TwWI.js → radio-button-HPU-KHv4.js} +1 -1
  83. package/dist/storybook/assets/{radio-button.stories-7dkCcpUZ.js → radio-button.stories-ZyjCpReq.js} +1 -1
  84. package/dist/storybook/assets/{reservoirs.stories-f7usYIda.js → reservoirs.stories-tIoVea3g.js} +1 -1
  85. package/dist/storybook/assets/{rich-text-input.stories-YWaiFQEd.js → rich-text-input.stories-vk9xwB_D.js} +1 -1
  86. package/dist/storybook/assets/{row.stories-wtewEk0Z.js → row.stories-ot7Jjnt6.js} +1 -1
  87. package/dist/storybook/assets/{select-Bp8YY8Ze.js → select-I01_W6_4.js} +1 -1
  88. package/dist/storybook/assets/{select.stories-RjqGVn2g.js → select.stories-XAI8pyEc.js} +1 -1
  89. package/dist/storybook/assets/{side-bar-V0uxIghC.js → side-bar-evBxuVzm.js} +1 -1
  90. package/dist/storybook/assets/{side-bar.stories-rKoL8lrf.js → side-bar.stories-mtQSbRi1.js} +1 -1
  91. package/dist/storybook/assets/{site.stories-nwcDZZdB.js → site.stories-L_U9kFiJ.js} +1 -1
  92. package/dist/storybook/assets/{slider-0HIxE6AZ.js → slider-n3IxC2iq.js} +1 -1
  93. package/dist/storybook/assets/{slider.stories-9wM3WmDC.js → slider.stories-ZZQVWjaY.js} +1 -1
  94. package/dist/storybook/assets/{smart-upload-modal.stories-Lqh7FFLe.js → smart-upload-modal.stories-2PLKfrKC.js} +1 -1
  95. package/dist/storybook/assets/{spacer.stories-4n4RL13L.js → spacer.stories-oFV2pFb8.js} +1 -1
  96. package/dist/storybook/assets/{syntaxhighlighter-B5GMVT5T-jJ-aXkjr.js → syntaxhighlighter-B5GMVT5T-exhsGVYA.js} +1 -1
  97. package/dist/storybook/assets/table-yS0o5bJS.js +1 -0
  98. package/dist/storybook/assets/{table.stories-data-6LXl4zwR.js → table.stories-data-UtsQXBjO.js} +1 -1
  99. package/dist/storybook/assets/{table.stories-N07QxfiK.js → table.stories-gVTJDINj.js} +1 -1
  100. package/dist/storybook/assets/{textarea-c5fYK9-8.js → textarea-RrPYPGCC.js} +1 -1
  101. package/dist/storybook/assets/{textarea.stories-soUP2Yhm.js → textarea.stories-rqdJWVro.js} +1 -1
  102. package/dist/storybook/assets/{title.stories-MKmiziEV.js → title.stories-ILp8GFMp.js} +1 -1
  103. package/dist/storybook/assets/{toaster.stories-Na9wGy65.js → toaster.stories-Cu8HbPc6.js} +1 -1
  104. package/dist/storybook/assets/{toggle-gxvny8zu.js → toggle-R__kwKym.js} +1 -1
  105. package/dist/storybook/assets/{toggle.stories-_Qd5Xk1K.js → toggle.stories-ViKd2aK_.js} +1 -1
  106. package/dist/storybook/assets/{tooltip-pjcB4ZxN.js → tooltip-dueTLnwA.js} +1 -1
  107. package/dist/storybook/assets/{tooltip.stories-YJfYxnb3.js → tooltip.stories-a_gd0XYu.js} +1 -1
  108. package/dist/storybook/assets/{tooltip.test-case.stories-ZUrHDklJ.js → tooltip.test-case.stories-68kziAjk.js} +1 -1
  109. package/dist/storybook/assets/{top-bar--h98E6oo.js → top-bar-KGd_PI0n.js} +1 -1
  110. package/dist/storybook/assets/{top-bar.stories-eahNLSjM.js → top-bar.stories-wVH6POte.js} +1 -1
  111. package/dist/storybook/assets/{top-bar.testcase.stories-AbbFHB0-.js → top-bar.testcase.stories-ATUEatgx.js} +1 -1
  112. package/dist/storybook/assets/{tree.stories-JyczIgiP.js → tree.stories-cTww9R00.js} +1 -1
  113. package/dist/storybook/assets/unit-input-qBUtqoTb.css +1 -0
  114. package/dist/storybook/assets/unit-input.stories-AGMYBqCC.js +284 -0
  115. package/dist/storybook/assets/unit-table.stories-KRnQ5bCj.js +150 -0
  116. package/dist/storybook/iframe.html +1 -1
  117. package/dist/storybook/index.json +1 -1
  118. package/dist/storybook/project.json +1 -1
  119. package/dist/storybook/stories.json +1 -1
  120. package/package.json +8 -9
  121. package/dist/storybook/assets/iframe-7Gvk33Dy.js +0 -7
  122. package/dist/storybook/assets/number-input-yoDwXp2C.js +0 -1
  123. package/dist/storybook/assets/number-input.stories-QRbtwUKs.js +0 -153
  124. package/dist/storybook/assets/table-tDId3FKL.js +0 -1
  125. package/dist/storybook/assets/unit-input-OT-AqIIa.css +0 -1
  126. package/dist/storybook/assets/unit-input.stories-diwgawFe.js +0 -349
  127. package/dist/storybook/assets/unit-table.stories-6agZ80lN.js +0 -150
@@ -0,0 +1 @@
1
+ import{j as n}from"./jsx-runtime-FsUICBgo.js";import{r as q}from"./index-RfLt4OUa.js";import{c as w}from"./index-VW3EWkuE.js";import{I as He,D as Pe,C as Le,P as De}from"./index.es-VXFRDikp.js";import{l as Fe}from"./lodash-Bmg8FrMx.js";import{A as he}from"./actions-0ELEGFed.js";import{H as $e}from"./heading-4tVgoT7O.js";import{P as Be}from"./pagination-H0l4VC9v.js";import{A as x,I as B}from"./common-types-U65vzrrz.js";import{I as Oe}from"./input-fYKvBwPs.js";import{N as Me}from"./number-input-ymd7m-s5.js";import{S as Ue}from"./select-I01_W6_4.js";import{D as Ge}from"./disabled-context-urNQThQz.js";import{i as O}from"./types-5uVBABF4.js";import{T as be}from"./tooltip-dueTLnwA.js";import{C as Xe}from"./check-box-KynSyTaY.js";import{S as ze}from"./slider-n3IxC2iq.js";import{I as M}from"./icon-8EQazuuW.js";import{P as Je}from"./popover-N9B8JT3G.js";import{H as Ee}from"./help-icon-eelulTML.js";import{T as re}from"./text-6KQ6ntOV.js";const Ke="_inputInTable_y9car_1",Ye="_inputHover_y9car_13",Qe="_inputFocus_y9car_18",Ze="_inputError_y9car_25",en="_inputWarning_y9car_26",nn="_inputDisabled_y9car_61",tn="_hideScrollbars_y9car_67",rn="_wrapper_y9car_85",an="_bordered_y9car_93",ln="_scroll_y9car_98",on="_table_y9car_108",sn="_striped_y9car_188",W={inputInTable:Ke,inputHover:Ye,inputFocus:Qe,inputError:Ze,inputWarning:en,inputDisabled:nn,hideScrollbars:tn,wrapper:rn,bordered:an,scroll:ln,table:on,striped:sn},dn="_title_zn5s7_1",cn={title:dn},z=({name:e=null,actions:t=null,actionsRight:r=!1,testId:l})=>{const a=e!==null,o=t!==null;if(!a&&!o)return null;const s=()=>{if(!o)return null;const u=n.jsx(he,{actions:t});return r?u:n.jsx("div",{children:u})};return n.jsxs("div",{className:cn.title,children:[a?n.jsx($e,{children:n.jsx("span",{"data-testid":l,children:e})}):null,s()]})};try{z.displayName="Title",z.__docgenInfo={description:"",displayName:"Title",props:{name:{defaultValue:{value:"null"},description:"",name:"name",required:!1,type:{name:"string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | null"}},actions:{defaultValue:{value:"null"},description:"",name:"actions",required:!1,type:{name:"any"}},actionsRight:{defaultValue:{value:"false"},description:"",name:"actionsRight",required:!1,type:{name:"boolean"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}}}catch{}const un="_footer_4sumy_1",pn="_section_4sumy_7",ae={footer:un,section:pn},J=({colSpan:e,pagination:t,actions:r,content:l})=>{const a=r&&r.length,o=l!=null,s=()=>{var d,p;if(t){const{rowCount:c,rowsPerPage:y}=t,g=Number((p=(d=y==null?void 0:y.options)==null?void 0:d[0])==null?void 0:p.value);return c>g}return!1};return a||o||s()?n.jsxs("div",{className:ae.footer,children:[o?n.jsx("div",{className:ae.section,children:n.jsx("div",{children:l})}):null,a||s()?n.jsxs("div",{className:ae.section,children:[s()?n.jsx(Be,{pagination:t}):n.jsx("div",{}),a&&n.jsx("div",{children:n.jsx(he,{actions:r})})]}):null]}):null};try{J.displayName="Footer",J.__docgenInfo={description:"",displayName:"Footer",props:{colSpan:{defaultValue:null,description:"",name:"colSpan",required:!1,type:{name:"number"}},pagination:{defaultValue:null,description:"",name:"pagination",required:!0,type:{name:"IPagination"}},actions:{defaultValue:null,description:"",name:"actions",required:!1,type:{name:"IAction[]"}},content:{defaultValue:null,description:"",name:"content",required:!1,type:{name:"ReactNode"}}}}}catch{}const Ve=e=>{const t=Math.max(...e.reduce((r,l)=>{const a=l.cells.map(o=>o.colSpan?o.colSpan:1).reduce((o,s)=>o+s,0);return r.concat(a)},[]));return isNaN(t)?0:t},mn=(e,t)=>{const r=[Ve(t),Ve(e)];return Math.max(...r)},Te=e=>e.reduce((t,r)=>r.actions&&r.actions.length>0?1:t,0),_n=(e,t)=>Te(t)>0||Te(e)>0,K=({table:e,children:t})=>{const{rows:r,infiniteScroll:l}=e,a=Math.ceil(window.innerHeight/30),[o,s]=l?q.useState(a):[r.length,null],[u,d]=l?q.useState(o<r.length):[!1,null],p=()=>{if(o>=r.length&&d){d(!1);return}s&&s(o+a)};return n.jsx("div",{id:"scrollWrapper",className:W.scroll,children:l?n.jsx(He,{dataLength:Math.min(r.length,o+a),next:p,hasMore:u,scrollableTarget:"scrollWrapper",style:{overflow:"initial"},loader:null,children:t({visibleRows:o})}):t({visibleRows:o})})};try{K.displayName="TableScrollWrapper",K.__docgenInfo={description:"",displayName:"TableScrollWrapper",props:{table:{defaultValue:null,description:"",name:"table",required:!0,type:{name:"ITableProps"}}}}}catch{}const gn="_clickableRow_1ki29_1",yn="_hoverableRow_1ki29_4",fn="_rowActive_1ki29_4",hn="_expandableRow_1ki29_8",bn="_flush_1ki29_8",xn="_errorRow_1ki29_12",Cn="_warningRow_1ki29_15",In="_dragIconCell_1ki29_34",jn="_dragIcon_1ki29_34",b={clickableRow:gn,hoverableRow:yn,rowActive:fn,expandableRow:hn,flush:bn,errorRow:xn,warningRow:Cn,dragIconCell:In,dragIcon:jn},Y=({colSpan:e,children:t,flush:r})=>n.jsx("tr",{children:n.jsx("td",{colSpan:e,className:w(b.expandableRow,r?b.flush:""),children:t})});try{Y.displayName="ExpandedContentRow",Y.__docgenInfo={description:"",displayName:"ExpandedContentRow",props:{colSpan:{defaultValue:null,description:"",name:"colSpan",required:!0,type:{name:"number"}},flush:{defaultValue:null,description:"",name:"flush",required:!1,type:{name:"boolean"}}}}}catch{}const qe=(e,t={leftAligned:"",rightAligned:"",centerAligned:""},r=!1)=>{if(!e)return null;const{bodyAlignment:l,headerAlignment:a,isHeader:o}=e;switch(o&&a?a:l){case x.LEFT:return r?x.LEFT:t.leftAligned;case x.RIGHT:return r?x.RIGHT:t.rightAligned;case x.CENTER:return r?x.CENTER:t.centerAligned;default:return r?x.LEFT:t.leftAligned}},Nn=(e,t=!1,r=0)=>{if(!e||e.length===0)return[];const l=e.every(o=>Array.isArray(o)),a=e.every(o=>typeof o=="string");return l&&t?e[r]||[]:a?e:(console.warn("getHeaderAlignment: alignments array contains a mix of strings and arrays, returning an empty array."),[])},wn="_inputInTable_u3xdj_1",Rn="_inputHover_u3xdj_13",An="_inputFocus_u3xdj_18",vn="_inputError_u3xdj_25",Sn="_inputWarning_u3xdj_26",Vn="_inputDisabled_u3xdj_61",Tn="_hideScrollbars_u3xdj_67",qn="_cell_u3xdj_77",kn="_disabledLink_u3xdj_87",En="_inputWrapper_u3xdj_91",Wn="_breakWord_u3xdj_106",Hn="_inputCell_u3xdj_109",Pn="_sliderCell_u3xdj_112",Ln="_staticCell_u3xdj_116",Dn="_staticCellContent_u3xdj_119",Fn="_error_u3xdj_131",$n="_warning_u3xdj_132",Bn="_unit_u3xdj_141",On="_sortingCell_u3xdj_144",Mn="_sortingCellIcon_u3xdj_155",Un="_icon_u3xdj_166",Gn="_checkBoxCell_u3xdj_170",Xn="_iconCellWrapper_u3xdj_174",zn="_actionsCell_u3xdj_178",Jn="_rightAligned_u3xdj_186",Kn="_centerAligned_u3xdj_192",Yn="_leftAligned_u3xdj_198",Qn="_popover_u3xdj_201",Zn="_disabledPointerEvents_u3xdj_204",i={inputInTable:wn,inputHover:Rn,inputFocus:An,inputError:vn,inputWarning:Sn,inputDisabled:Vn,hideScrollbars:Tn,cell:qn,disabledLink:kn,inputWrapper:En,breakWord:Wn,inputCell:Hn,sliderCell:Pn,staticCell:Ln,staticCellContent:Dn,error:Fn,warning:$n,unit:Bn,sortingCell:On,sortingCellIcon:Mn,icon:Un,checkBoxCell:Gn,iconCellWrapper:Xn,actionsCell:zn,rightAligned:Jn,centerAligned:Kn,leftAligned:Yn,popover:Qn,disabledPointerEvents:Zn},Q=({cell:e,columnAlignment:t,testId:r,type:l})=>n.jsx(Oe,{name:e.name,value:e.value,onChange:a=>{var o;return(o=e.onChange)==null?void 0:o.call(e,a)},onFocus:e.onFocus,onBlur:e.onBlur,onPaste:a=>{var o;return(o=e.onPaste)==null?void 0:o.call(e,a)},placeholder:e.placeholder,error:e.error,warning:e.warning,disabled:e.disabled,isInTable:!0,maxTooltipWidth:e.maxTooltipWidth,right:t===x.RIGHT,testId:r,tabIndex:e.disabled?-1:0,tooltip:e.tooltip,type:l});try{Q.displayName="InputCell",Q.__docgenInfo={description:"",displayName:"InputCell",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"IInputCell"}},columnAlignment:{defaultValue:null,description:"",name:"columnAlignment",required:!1,type:{name:"string"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}},type:{defaultValue:null,description:"",name:"type",required:!1,type:{name:"enum",value:[{value:'"text"'},{value:'"date"'}]}}}}}catch{}const le=({cell:e,testId:t})=>n.jsx(Me,{name:e.name,value:e.value,onChange:r=>{var l;return(l=e.onChange)==null?void 0:l.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});try{le.displayName="NumberInputCell",le.__docgenInfo={description:"",displayName:"NumberInputCell",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"INumberInputCell"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}}}catch{}const oe=({cell:e,columnAlignment:t,testId:r})=>n.jsx(Ue,{name:e.name,borderRadius:0,options:e.options,onChange:l=>{var a;return(a=e.onChange)==null?void 0:a.call(e,l)},onCreate:e.onCreate?l=>e.onCreate&&e.onCreate(l):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===x.RIGHT,testId:r,tabIndex:e.disabled?-1:0});try{oe.displayName="SelectCell",oe.__docgenInfo={description:"",displayName:"SelectCell",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"ISelectCell"}},columnAlignment:{defaultValue:null,description:"",name:"columnAlignment",required:!1,type:{name:"string"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}}}catch{}const ie=({cell:e,columnAlignment:t,testId:r})=>n.jsx("div",{className:i.inputWrapper,children:e.type==="Input"?n.jsx(Q,{cell:e,columnAlignment:t,testId:r}):e.type==="NumberInput"?n.jsx(le,{cell:e,testId:r}):e.type==="DateInput"?n.jsx(Q,{cell:e,testId:r,type:"date"}):e.type==="Select"?n.jsx(oe,{cell:e,columnAlignment:t,testId:r}):null});try{ie.displayName="InputCellWrapper",ie.__docgenInfo={description:"",displayName:"InputCellWrapper",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"any"}},columnAlignment:{defaultValue:null,description:"",name:"columnAlignment",required:!0,type:{name:"string"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}}}catch{}const se=({cell:e,testId:t})=>{const r=q.useContext(Ge),{error:l,warning:a,tooltip:o,maxTooltipWidth:s}=e,u=d=>O(d);return n.jsx("div",{className:i.inputWrapper,children:n.jsx(be,{error:!!l,warning:!!a,text:o||l||a,enabled:u(o)||u(l)||u(a)||!1,maxWidth:s,placement:"bottom-center",children:n.jsx("div",{className:w(i.staticCellContent,l?i.error:a?i.warning:""),children:n.jsx("a",{className:w((e.disabled||r)&&i.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})})})})};try{se.displayName="LinkCell",se.__docgenInfo={description:"",displayName:"LinkCell",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"ILinkCell"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}}}catch{}const de=({cell:e,testId:t})=>n.jsx(Xe,{label:e.label,checked:e.checked,isInTable:!0,disabled:e.disabled,onChange:r=>e.onChange(r),testId:t,tabIndex:e.disabled?-1:0});try{de.displayName="CheckBoxCell",de.__docgenInfo={description:"",displayName:"CheckBoxCell",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"ICheckBoxCell"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}}}catch{}const ce=({cell:e})=>n.jsx("div",{className:i.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})});try{ce.displayName="SliderCell",ce.__docgenInfo={description:"",displayName:"SliderCell",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"ISliderCell"}}}}}catch{}const ue=({cell:e})=>{const{tooltip:t,icon:r}=e;return n.jsx("div",{className:i.iconCellWrapper,children:n.jsx(be,{text:t,enabled:!!t&&O(t),display:"flex",placement:"top-center",children:n.jsx(M,{icon:r})})})};try{ue.displayName="IconCell",ue.__docgenInfo={description:"",displayName:"IconCell",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"IIconCell"}}}}}catch{}const pe=({cell:e})=>n.jsx(he,{actions:e.actions});try{pe.displayName="ActionsCell",pe.__docgenInfo={description:"",displayName:"ActionsCell",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"IActionCell"}}}}}catch{}const me=({cell:e})=>{const{helpIcon:t}=e;return t?n.jsx("div",{className:i.icon,children:n.jsx(Ee,{onClick:t.onClick,text:t.tooltip})}):null};try{me.displayName="CellHelpIcon",me.__docgenInfo={description:"",displayName:"CellHelpIcon",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"IHelpIconCell"}}}}}catch{}const _e=({cell:e})=>{const{libraryIcon:t}=e;return t?n.jsx("div",{className:i.icon,children:n.jsx(Ee,{onClick:t.onClick,text:t.tooltip,icon:B.LIBRARY})}):null};try{_e.displayName="CellLibraryIcon",_e.__docgenInfo={description:"",displayName:"CellLibraryIcon",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"ILibraryIconCell"}}}}}catch{}const ge=({cell:e})=>{const{hasSort:t,sort:r,sortPriority:l}=e;return t?n.jsxs("span",{className:i.sortingCellIcon,children:[r==="down"?n.jsx(re,{link:!0,children:n.jsx(M,{icon:B.SORT_ASCENDING})}):r==="up"?n.jsx(re,{link:!0,children:n.jsx(M,{icon:B.SORT_DESCENDING})}):n.jsx(re,{faint:!0,children:n.jsx(M,{icon:B.SORT_DESCENDING})}),l&&r?n.jsx("sup",{children:l}):null]}):null};try{ge.displayName="Sort",ge.__docgenInfo={description:"",displayName:"Sort",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"ISortCell"}}}}}catch{}const Z=({cell:e,isHeader:t,testId:r})=>{const{error:l,warning:a,tooltip:o,maxTooltipWidth:s,hasSort:u,onSort:d,type:p}=e,c=n.jsxs("div",{className:w(i.staticCellContent,p==="Unit"?i.unit:"",l?i.error:a?i.warning:""),onClick:u?y=>d&&d(y):()=>{},"data-testid":r,children:[e.value,t?n.jsxs(n.Fragment,{children:[n.jsx(me,{cell:e}),n.jsx(_e,{cell:e}),n.jsx(ge,{cell:e})]}):null]});return n.jsx("div",{className:i.inputWrapper,children:n.jsx(be,{error:!!l,warning:!!a,text:o||l||a,enabled:o&&O(o)||l&&O(l)||a&&O(a)||!1,maxWidth:s,display:"block",placement:"bottom-center",children:c})})};try{Z.displayName="StaticCell",Z.__docgenInfo={description:"",displayName:"StaticCell",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"IStaticCell"}},isHeader:{defaultValue:null,description:"",name:"isHeader",required:!1,type:{name:"boolean"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}}}catch{}const ye=({cell:e,testId:t})=>{const{content:r,fullWidth:l,closeOnOutsideClick:a,disabled:o}=e;return n.jsx(Je,{content:r,fullWidth:l,closeOnOutsideClick:a,disabled:o,children:n.jsx("div",{className:i.popover,children:n.jsx(Z,{cell:e,testId:t})})})};try{ye.displayName="PopoverCell",ye.__docgenInfo={description:"",displayName:"PopoverCell",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"IPopoverCell"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}}}catch{}const fe=({cell:e,isHeader:t,columnAlignment:r,testId:l})=>{if(!e)return null;switch(e.type){case"Input":case"NumberInput":case"DateInput":case"Select":return n.jsx(ie,{cell:e,columnAlignment:r,testId:l});case"Link":return n.jsx(se,{cell:e,testId:l});case"CheckBox":return n.jsx(de,{cell:e,testId:l});case"Slider":return n.jsx(ce,{cell:e});case"Icon":return n.jsx(ue,{cell:e});case"Actions":return n.jsx(pe,{cell:e});case"Popover":return n.jsx(ye,{cell:e});default:return n.jsx(Z,{cell:e,isHeader:t,testId:l})}};try{fe.displayName="CellWrapper",fe.__docgenInfo={description:"",displayName:"CellWrapper",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"any"}},isHeader:{defaultValue:null,description:"",name:"isHeader",required:!0,type:{name:"boolean"}},columnAlignment:{defaultValue:null,description:"",name:"columnAlignment",required:!0,type:{name:"string"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}}}catch{}var v=(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))(v||{});const ee=({cell:e,isHeader:t,columnHeaderAlignment:r,columnAlignment:l=x.LEFT,width:a,snapshot:o,testId:s})=>{if(!e)return null;const{style:u,colSpan:d,rowSpan:p,width:c}=e,y=q.useRef(null),g={bodyAlignment:l,headerAlignment:r,isHeader:t},H=qe(g,i),C=qe(g,i,!0),P=e.type===v.INPUT||e.type===v.NUMBER_INPUT||e.type===v.SELECT||e.type===v.POPOVER?i.inputCell:e.type===v.SLIDER?i.sliderCell:e.type===v.CHECKBOX?i.checkBoxCell:e.type===v.ACTIONS?i.actionsCell:i.staticCell,R=w(i.cell,P,e.hasSort?i.sortingCell:null,H,e.breakWord?i.breakWord:""),k=c??a??((o==null?void 0:o.isDragging)&&y.current&&y.current.offsetWidth)??void 0,I={width:k,minWidth:k,...u},A=t?"th":"td";return n.jsx(A,{ref:y,className:R,style:I,colSpan:d,rowSpan:p,children:n.jsx(fe,{cell:e,columnAlignment:C??x.RIGHT,isHeader:t,testId:s})})};try{ee.displayName="Cell",ee.__docgenInfo={description:"",displayName:"Cell",props:{cell:{defaultValue:null,description:"",name:"cell",required:!1,type:{name:"TCellShape"}},isHeader:{defaultValue:null,description:"",name:"isHeader",required:!0,type:{name:"boolean"}},columnHeaderAlignment:{defaultValue:null,description:"",name:"columnHeaderAlignment",required:!1,type:{name:"string"}},columnAlignment:{defaultValue:{value:"Align.LEFT"},description:"",name:"columnAlignment",required:!1,type:{name:"Align.LEFT | Align.RIGHT | null"}},width:{defaultValue:null,description:"",name:"width",required:!1,type:{name:"TStringOrNumber"}},snapshot:{defaultValue:null,description:"",name:"snapshot",required:!1,type:{name:"any"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}}}catch{}const F=({row:e,rowIndex:t,isHeader:r=!1,columnCount:l,colSpan:a,columnHeaderAlignments:o=[],columnAlignment:s=[],hasRowActions:u,draggableTable:d=!1,snapshot:p=null,provided:c=null,width:y,columnWidths:g,testId:H})=>{const C=q.useRef(null),P=Nn(o,r,t),{onRowClick:R,onRowFocus:k,onRowMouseEnter:I,onRowMouseLeave:A,expandedContent:j,error:ne,warning:L,active:E}=e,S=e.cells.map((h,T)=>{const $=`${r?0:1}_${t}_${T}`;return n.jsx(ee,{cell:h,isHeader:r,columnAlignment:s[T],columnHeaderAlignment:P[T],width:g?g[T]:void 0,snapshot:p,testId:h.testId},$)}),V=u&&n.jsx(ee,{cell:{type:v.ACTIONS,actions:e.actions},isHeader:r},l),te=(h,T)=>({minWidth:h&&`${y}px`,width:h&&"100%",display:h&&"table",background:h&&"var(--color-background-listitem-active)",border:h&&"var(--color-border)",borderTop:h&&0,opacity:h&&.1,...T}),U=()=>e.noDrag?n.jsx("td",{"aria-labelledby":"unique-label-id"}):n.jsx("td",{className:b.dragIconCell,children:n.jsx("div",{...c.dragHandleProps,className:b.dragIcon,children:n.jsx(M,{icon:B.DRAG})})});return r?n.jsxs(n.Fragment,{children:[n.jsxs("tr",{ref:C,onClick:R,onMouseEnter:I,onMouseLeave:A,onFocus:k,className:w(R?b.clickableRow:null,I?b.hoverableRow:null),children:[d?n.jsx("th",{}):null,S,V]},t),j&&j.content?n.jsx(Y,{colSpan:a,flush:j.flush===!0,children:j.content},`${t}_expanded_content`):null]}):n.jsxs(n.Fragment,{children:[n.jsxs("tr",{onClick:R,onMouseEnter:I,onMouseLeave:A,onFocus:k,className:w(R&&!R.noStyle?b.clickableRow:null,I&&!I.noStyle?b.hoverableRow:null,E?b.rowActive:null,ne?b.errorRow:null,L?b.warningRow:null),ref:(c==null?void 0:c.innerRef)||null,...(c==null?void 0:c.draggableProps)||null,style:p&&c?te(p.isDragging,c.draggableProps.style):null,children:[d?U():null,S,V]},t),j&&j.content?n.jsx(Y,{colSpan:a,flush:j.flush===!0,children:j.content},`${t}_expanded_content`):null]})};try{F.displayName="Row",F.__docgenInfo={description:"",displayName:"Row",props:{row:{defaultValue:null,description:"",name:"row",required:!0,type:{name:"TRowType"}},rowIndex:{defaultValue:null,description:"",name:"rowIndex",required:!0,type:{name:"number"}},isHeader:{defaultValue:{value:"false"},description:"",name:"isHeader",required:!1,type:{name:"boolean"}},columnCount:{defaultValue:null,description:"",name:"columnCount",required:!0,type:{name:"number"}},colSpan:{defaultValue:null,description:"",name:"colSpan",required:!0,type:{name:"number"}},columnHeaderAlignments:{defaultValue:{value:"[]"},description:"",name:"columnHeaderAlignments",required:!1,type:{name:"string[] | string[][]"}},columnAlignment:{defaultValue:{value:"[]"},description:"",name:"columnAlignment",required:!1,type:{name:"string[]"}},hasRowActions:{defaultValue:null,description:"",name:"hasRowActions",required:!0,type:{name:"boolean"}},draggableTable:{defaultValue:{value:"false"},description:"",name:"draggableTable",required:!1,type:{name:"boolean"}},snapshot:{defaultValue:{value:"null"},description:"",name:"snapshot",required:!1,type:{name:"any"}},provided:{defaultValue:{value:"null"},description:"",name:"provided",required:!1,type:{name:"any"}},width:{defaultValue:null,description:"",name:"width",required:!1,type:{name:"TStringOrNumber"}},columnWidths:{defaultValue:null,description:"",name:"columnWidths",required:!1,type:{name:"string[]"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}}}catch{}const ke=e=>{var je,Ne,we,Re,Ae,ve,Se;const{onListReorder:t=()=>{},table:r}=e,{columnWidths:l,footer:a,name:o,rows:s=[],actions:u,actionsRight:d,columnHeaderAlignments:p,columnAlignment:c,striped:y=!0,testId:g,draggable:H,defaultEmptyRow:C=null,onAddRow:P=null,bordered:R=!0,maxHeight:k,fixedWidth:I}=r,A=q.useRef(null),[j,ne]=q.useState({width:0,height:0});q.useEffect(()=>{A.current&&ne({width:A.current.offsetWidth,height:A.current.offsetHeight})},[]);const L=Fe.get(e,"table.headers",[]),E=mn(s,L),S=_n(s,L),V=E+(S?1:0),te=a?((Ne=(je=a==null?void 0:a.pagination)==null?void 0:je.rowsPerPage)==null?void 0:Ne.value)===0||Number((we=a==null?void 0:a.pagination)==null?void 0:we.selectedPage)>=Number((Re=a==null?void 0:a.pagination)==null?void 0:Re.rowCount)/Number((ve=(Ae=a==null?void 0:a.pagination)==null?void 0:Ae.rowsPerPage)==null?void 0:ve.value):!0,U=((Se=C==null?void 0:C.cells)==null?void 0:Se.length)&&P&&te,T={cells:U?C.cells.map((m,N)=>(m==null?void 0:m.type)==="Input"?{...m,onChange:_=>{var G;const f=(G=_==null?void 0:_.target)==null?void 0:G.value,D={...C,cells:C.cells.map((X,We)=>({...X,value:We===N?f:X==null?void 0:X.value}))};P({newRow:D})}}:{...m,disabled:!0}):null,testId:g?`${g}-last-empty-row`:void 0},$=U?s.concat(T):s,xe={...r,rows:$},Ce=w(W.wrapper,R?W.bordered:""),Ie={maxHeight:k,width:I,display:I==="auto"?"inline-flex":"flex"};return H?n.jsxs("div",{ref:A,className:Ce,style:Ie,children:[n.jsx(z,{actions:u,actionsRight:d,name:o,testId:g&&`${g}-title`}),n.jsx(Pe,{onDragEnd:m=>{var f,D;const N=(f=m==null?void 0:m.source)==null?void 0:f.index,_=(D=m==null?void 0:m.destination)==null?void 0:D.index;typeof N=="number"&&typeof _=="number"&&t({from:N,to:_})},children:n.jsx(Le,{droppableId:"droppable",children:m=>n.jsx(K,{table:xe,children:({visibleRows:N})=>n.jsxs("table",{className:w(W.table,y?W.striped:""),"data-testid":g,ref:m.innerRef,children:[n.jsx("thead",{children:L.map((_,f)=>n.jsx(F,{rowIndex:f,isHeader:!0,row:_,columnCount:E,columnWidths:l,colSpan:V,hasRowActions:S,columnAlignment:c,columnHeaderAlignments:p,draggableTable:H},`0_${f}`))}),n.jsxs("tbody",{children:[$.slice(0,N).map((_,f)=>n.jsx(De,{draggableId:f+"",index:f,isDragDisabled:_.noDrag,children:(D,G)=>n.jsx(F,{rowIndex:f,row:_,columnCount:E,columnWidths:l,colSpan:V,hasRowActions:S,columnAlignment:c,provided:D,snapshot:G,draggableTable:H,width:j.width},`1_${f}`)},`index_${f}`)),m.placeholder]})]})})})}),a&&n.jsx(J,{pagination:a.pagination,actions:a.actions,content:a.content})]}):n.jsxs("div",{className:Ce,style:Ie,children:[n.jsx(z,{actions:u,actionsRight:d,name:o,testId:g&&`${g}-title`}),n.jsx(K,{table:xe,children:({visibleRows:m})=>n.jsxs("table",{className:w(W.table,y?W.striped:""),"data-testid":g,children:[n.jsx("thead",{children:L.map((N,_)=>n.jsx(F,{rowIndex:_,isHeader:!0,row:N,columnCount:E,columnWidths:l,colSpan:V,hasRowActions:S,columnAlignment:c,columnHeaderAlignments:p},`0_${_}`))}),n.jsx("tbody",{children:$.slice(0,m).map((N,_)=>n.jsx(F,{rowIndex:_,row:N,columnCount:E,columnWidths:l,colSpan:V,hasRowActions:S,columnAlignment:c},`1_${_}`))})]})}),a&&n.jsx(J,{colSpan:V,pagination:a.pagination,actions:a.actions,content:a.content})]})};try{ke.displayName="Table",ke.__docgenInfo={description:"",displayName:"Table",props:{onListReorder:{defaultValue:null,description:"",name:"onListReorder",required:!1,type:{name:"((obj: { from: number; to: number; }) => void)"}},table:{defaultValue:null,description:"",name:"table",required:!0,type:{name:"{ name?: string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | null | undefined; ... 18 more ...; actions?: any; }"}}}}}catch{}export{v as C,ke as T};
@@ -1 +1 @@
1
- import{j as t}from"./jsx-runtime-FsUICBgo.js";import{I as o,T as c}from"./common-types-U65vzrrz.js";import{F as v}from"./flex-RYZsoWEN.js";import{M as p}from"./actions-MkrpU3sl.js";import{T as d}from"./text-6KQ6ntOV.js";import{I as n}from"./icon-8EQazuuW.js";import{M as r}from"./types-VB5zD18b.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-FsUICBgo.js";import{I as o,T as c}from"./common-types-U65vzrrz.js";import{F as v}from"./flex-RYZsoWEN.js";import{M as p}from"./actions-0ELEGFed.js";import{T as d}from"./text-6KQ6ntOV.js";import{I as n}from"./icon-8EQazuuW.js";import{M as r}from"./types-VB5zD18b.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,4 +1,4 @@
1
- import{j as n}from"./jsx-runtime-FsUICBgo.js";import{r as S}from"./index-RfLt4OUa.js";import{f as B}from"./immer.esm-bD7SSJ7T.js";import{l as q}from"./lodash-Bmg8FrMx.js";import{G as le}from"./grid-u1mZpaML.js";import{T as W}from"./text-6KQ6ntOV.js";import{T as D}from"./table-tDId3FKL.js";import{C as dn}from"./card-0r8RRVk-.js";import{I as se}from"./input-vzl5J-q1.js";import{F as oe}from"./field-fx75Y95f.js";import{H as un}from"./heading-CRsqGmBL.js";import{t as ae,x as pn,y as gn,z as mn,A as bn,B as hn,C as wn,D as vn}from"./table.stories-data-6LXl4zwR.js";import"./styled-components.browser.esm-qIipjd6c.js";import"./tslib.es6-OIsz3r9a.js";import"./index-VW3EWkuE.js";import"./index.es-VXFRDikp.js";import"./inheritsLoose-8sb_A2v4.js";import"./redux-F5dueAP3.js";import"./objectSpread2-93s0nBry.js";import"./tiny-invariant-R4kOKlvx.js";import"./index-miLrID2P.js";import"./memoize-one.esm-hqe5SRxC.js";import"./objectWithoutPropertiesLoose-9Q1jwsKS.js";import"./actions-MkrpU3sl.js";import"./common-types-U65vzrrz.js";import"./disabled-context-urNQThQz.js";import"./button-MXXjI7Bb.js";import"./spinner-R8Il4aRe.js";import"./icon-8EQazuuW.js";import"./index-4QtD-hFu.js";import"./tooltip-pjcB4ZxN.js";import"./types-VB5zD18b.js";import"./types-5uVBABF4.js";import"./badge-23Ty_zBt.js";import"./pagination-APbPWlVY.js";import"./select-Bp8YY8Ze.js";import"./assertThisInitialized-4q6YPdh3.js";import"./select.input-zP5tW20f.js";import"./input-group-R8LoqKRn.js";import"./input-group-addon-BHVsW9mL.js";import"./number-input-yoDwXp2C.js";import"./index-VSx05S_2.js";import"./index-cCpkwrS5.js";import"./check-box-w174Mu0R.js";import"./help-icon-DUhtRK0A.js";import"./slider-0HIxE6AZ.js";import"./index-ugi_ZH6T.js";import"./popover-ZJGe9jlj.js";import"./label-CezqEpI3.js";import"./flex-RYZsoWEN.js";const bt={title:"Basic/Table",component:D,args:{table:{...ae}}},A=h=>n.jsx(D,{...h}),z=A.bind({}),_=A.bind({});_.args={table:{...ae,fixedWidth:"400px"}};const N=A.bind({});N.args={table:{...ae,fixedWidth:"auto"}};const O=A.bind({});O.args={table:pn};O.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 L=A.bind({});L.args={table:gn};const U=A.bind({});U.args={table:mn};U.parameters={docs:{description:{story:"This is only required when you need to override `columnAlignment` in header cells (i.e. they have different alignment)"}}};const Q=A.bind({});Q.args={table:bn};const E=A.bind({});E.args={table:hn};E.decorators=[h=>n.jsx("div",{style:{position:"absolute",inset:0,padding:"var(--padding)"},children:n.jsx(h,{})})];const M=A.bind({});M.args={table:wn};M.parameters={docs:{description:{story:"If a `maxHeight` is set, the table should only fill that height if it needs to."}}};const G=A.bind({});G.args={table:vn};const $=()=>n.jsx(dn,{heading:n.jsx(un,{children:"Card heading"}),padding:!1,children:n.jsx(D,{table:{...ae,bordered:!1}})});$.parameters={docs:{source:{type:"dynamic"}}};const J=()=>{const h=["Section","Width","Height"];let m=["","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=m[t],b=l.target.value;m=m.map((v,s)=>s===t?b:v),o=o.map(v=>v.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),[v,s]=S.useState(!1),u=()=>{s(!v)},j=()=>{const e=Math.ceil(o.length/t);b(e)},T=(c-1)*t,a=t===0?o.length-1:T+t,g={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:m[1],type:"Select",native:!0,onChange:e=>p(e,1,u)},{options:[{label:"m",value:"m"},{label:"ft",value:"ft"}],value:m[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,y)=>({value:e[y],type:"Input",onChange:C=>i(C,I,y,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:g})};return n.jsx(w,{})},X=()=>{const h=["Section","Width","Height"];let m=[...Array(20).keys()].map((x,i)=>({Section:q.random(0,100),Width:q.random(0,100),Height:q.random(0,100)}));const o=()=>{const[x,i]=S.useState({Section:"up"}),R=(r,c)=>r.sort((b,v)=>Object.entries(c).map(([s,u])=>{switch(u){case"up":return b[s]-v[s];case"down":return v[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(m,x).map(r=>({cells:Object.entries(r).map(([b,v])=>({key:b,value:v,type:"Input",disabled:!0}))}))],t={headers:[{cells:p}],rows:l};return n.jsx(D,{table:t})};return n.jsx(o,{})},Y=()=>{const h=["Section","Width","Height"];let m=[...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?m.length-1:c+i,v=(e,d,I)=>e.filter(P=>Object.keys(d).every(y=>d[y]===""?!0:P[y].toString().includes(d[y]))).sort((P,y)=>Object.entries(I).map(([C,H])=>{switch(H){case"up":return P[C]-y[C];case"down":return y[C]-P[C];default:return 0}}).reduce((C,H)=>C||H,0)),s=(e,d,I,P,y)=>{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 K=V===""?"up":V==="up"?"down":"";y({...P,[f]:K})}}}),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=v(m,w,t),a=[...T.slice(c,b).map(e=>({cells:Object.entries(e).map(([I,P])=>({key:I,value:P,type:"Input",disabled:!0}))}))],g={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:g})};return n.jsx(o,{})},Z=()=>{const h={tea:3.6,coffee:3.2,orange:4.1},m=[{label:"Tea",value:"tea"},{label:"Coffee",value:"coffee"},{label:"Orange juice",value:"orange"}],o={cells:[{type:"Select",options:m,value:{value:"tea"}},{type:"Input"},{type:"Static"}]},x=[...Array(15).keys()].map((a,g)=>({cells:[{type:"Select",options:m,value:{value:"tea"}},{type:"Input",value:g+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 g=B(i,e=>{e.push(a??o)});R(g)},v=({rowIndex:a})=>{const g=B(i,e=>{delete e[a]}).filter(e=>e);R(g)},s=({rowIndex:a,value:g})=>{const e=B(i,d=>{d[a].cells[0].value.value=g});R(e)},u=({rowIndex:a,value:g})=>{const e=B(i,d=>{d[a].cells[1].value=g});R(e)},j=({value:a})=>{const g=Number(a);return!q.isNaN(g)&&q.isInteger(g)&&g>0},T=i.slice(r,c).map((a,g)=>{const e=r+g;return i.length-1,{...a,cells:a==null?void 0:a.cells.map((d,I)=>{var f,V,F,K,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,y=Number((ie=(K=a==null?void 0:a.cells)==null?void 0:K[1])==null?void 0:ie.value),C=h==null?void 0:h[P],H=C&&j({value:y})?(C*y).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:()=>v({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:g}=a.target;w(Number(g))},options:k,value:p},onSelectPage:a=>t(a),small:!0}}}})},ee=()=>{const h=["Section","Width","Height"];let m=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)=>{m[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:m.map((r,c)=>{const b=c;return{cells:[...Array(3).keys()].map((v,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,{})},ne=()=>{const h={fixedWidth:"auto",name:"Table title",actions:[{icon:"download",tooltip:"Download"}],columnAlignment:[...Array(10)].map((m,o)=>"right"),headers:[{cells:[...Array(10)].map((m,o)=>({value:"Heading"}))},{cells:[...Array(10)].map((m,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((m,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})},te=()=>{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})};var ce,de,ue;z.parameters={...z.parameters,docs:{...(ce=z.parameters)==null?void 0:ce.docs,source:{originalSource:`args => {
1
+ import{j as n}from"./jsx-runtime-FsUICBgo.js";import{r as S}from"./index-RfLt4OUa.js";import{f as B}from"./immer.esm-bD7SSJ7T.js";import{l as q}from"./lodash-Bmg8FrMx.js";import{G as le}from"./grid-u1mZpaML.js";import{T as W}from"./text-6KQ6ntOV.js";import{T as D}from"./table-yS0o5bJS.js";import{C as dn}from"./card-0r8RRVk-.js";import{I as se}from"./input-fYKvBwPs.js";import{F as oe}from"./field-m7XXDdEG.js";import{H as un}from"./heading-4tVgoT7O.js";import{t as ae,x as pn,y as gn,z as mn,A as bn,B as hn,C as wn,D as vn}from"./table.stories-data-UtsQXBjO.js";import"./styled-components.browser.esm-qIipjd6c.js";import"./tslib.es6-OIsz3r9a.js";import"./index-VW3EWkuE.js";import"./index.es-VXFRDikp.js";import"./inheritsLoose-8sb_A2v4.js";import"./redux-F5dueAP3.js";import"./objectSpread2-93s0nBry.js";import"./tiny-invariant-R4kOKlvx.js";import"./index-miLrID2P.js";import"./memoize-one.esm-hqe5SRxC.js";import"./objectWithoutPropertiesLoose-9Q1jwsKS.js";import"./actions-0ELEGFed.js";import"./common-types-U65vzrrz.js";import"./disabled-context-urNQThQz.js";import"./button-BiJw0fB3.js";import"./spinner-R8Il4aRe.js";import"./icon-8EQazuuW.js";import"./index-4QtD-hFu.js";import"./tooltip-dueTLnwA.js";import"./types-VB5zD18b.js";import"./types-5uVBABF4.js";import"./badge-23Ty_zBt.js";import"./pagination-H0l4VC9v.js";import"./select-I01_W6_4.js";import"./assertThisInitialized-4q6YPdh3.js";import"./select.input-zP5tW20f.js";import"./input-group-R8LoqKRn.js";import"./input-group-addon-BHVsW9mL.js";import"./number-input-ymd7m-s5.js";import"./index-qZmQ7nA9.js";import"./index-cCpkwrS5.js";import"./check-box-KynSyTaY.js";import"./help-icon-eelulTML.js";import"./slider-n3IxC2iq.js";import"./index-ugi_ZH6T.js";import"./popover-N9B8JT3G.js";import"./label-bLcoUwtK.js";import"./flex-RYZsoWEN.js";const bt={title:"Basic/Table",component:D,args:{table:{...ae}}},A=h=>n.jsx(D,{...h}),z=A.bind({}),_=A.bind({});_.args={table:{...ae,fixedWidth:"400px"}};const N=A.bind({});N.args={table:{...ae,fixedWidth:"auto"}};const O=A.bind({});O.args={table:pn};O.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 L=A.bind({});L.args={table:gn};const U=A.bind({});U.args={table:mn};U.parameters={docs:{description:{story:"This is only required when you need to override `columnAlignment` in header cells (i.e. they have different alignment)"}}};const Q=A.bind({});Q.args={table:bn};const E=A.bind({});E.args={table:hn};E.decorators=[h=>n.jsx("div",{style:{position:"absolute",inset:0,padding:"var(--padding)"},children:n.jsx(h,{})})];const M=A.bind({});M.args={table:wn};M.parameters={docs:{description:{story:"If a `maxHeight` is set, the table should only fill that height if it needs to."}}};const G=A.bind({});G.args={table:vn};const $=()=>n.jsx(dn,{heading:n.jsx(un,{children:"Card heading"}),padding:!1,children:n.jsx(D,{table:{...ae,bordered:!1}})});$.parameters={docs:{source:{type:"dynamic"}}};const J=()=>{const h=["Section","Width","Height"];let m=["","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=m[t],b=l.target.value;m=m.map((v,s)=>s===t?b:v),o=o.map(v=>v.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),[v,s]=S.useState(!1),u=()=>{s(!v)},j=()=>{const e=Math.ceil(o.length/t);b(e)},T=(c-1)*t,a=t===0?o.length-1:T+t,g={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:m[1],type:"Select",native:!0,onChange:e=>p(e,1,u)},{options:[{label:"m",value:"m"},{label:"ft",value:"ft"}],value:m[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,y)=>({value:e[y],type:"Input",onChange:C=>i(C,I,y,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:g})};return n.jsx(w,{})},X=()=>{const h=["Section","Width","Height"];let m=[...Array(20).keys()].map((x,i)=>({Section:q.random(0,100),Width:q.random(0,100),Height:q.random(0,100)}));const o=()=>{const[x,i]=S.useState({Section:"up"}),R=(r,c)=>r.sort((b,v)=>Object.entries(c).map(([s,u])=>{switch(u){case"up":return b[s]-v[s];case"down":return v[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(m,x).map(r=>({cells:Object.entries(r).map(([b,v])=>({key:b,value:v,type:"Input",disabled:!0}))}))],t={headers:[{cells:p}],rows:l};return n.jsx(D,{table:t})};return n.jsx(o,{})},Y=()=>{const h=["Section","Width","Height"];let m=[...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?m.length-1:c+i,v=(e,d,I)=>e.filter(P=>Object.keys(d).every(y=>d[y]===""?!0:P[y].toString().includes(d[y]))).sort((P,y)=>Object.entries(I).map(([C,H])=>{switch(H){case"up":return P[C]-y[C];case"down":return y[C]-P[C];default:return 0}}).reduce((C,H)=>C||H,0)),s=(e,d,I,P,y)=>{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 K=V===""?"up":V==="up"?"down":"";y({...P,[f]:K})}}}),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=v(m,w,t),a=[...T.slice(c,b).map(e=>({cells:Object.entries(e).map(([I,P])=>({key:I,value:P,type:"Input",disabled:!0}))}))],g={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:g})};return n.jsx(o,{})},Z=()=>{const h={tea:3.6,coffee:3.2,orange:4.1},m=[{label:"Tea",value:"tea"},{label:"Coffee",value:"coffee"},{label:"Orange juice",value:"orange"}],o={cells:[{type:"Select",options:m,value:{value:"tea"}},{type:"Input"},{type:"Static"}]},x=[...Array(15).keys()].map((a,g)=>({cells:[{type:"Select",options:m,value:{value:"tea"}},{type:"Input",value:g+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 g=B(i,e=>{e.push(a??o)});R(g)},v=({rowIndex:a})=>{const g=B(i,e=>{delete e[a]}).filter(e=>e);R(g)},s=({rowIndex:a,value:g})=>{const e=B(i,d=>{d[a].cells[0].value.value=g});R(e)},u=({rowIndex:a,value:g})=>{const e=B(i,d=>{d[a].cells[1].value=g});R(e)},j=({value:a})=>{const g=Number(a);return!q.isNaN(g)&&q.isInteger(g)&&g>0},T=i.slice(r,c).map((a,g)=>{const e=r+g;return i.length-1,{...a,cells:a==null?void 0:a.cells.map((d,I)=>{var f,V,F,K,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,y=Number((ie=(K=a==null?void 0:a.cells)==null?void 0:K[1])==null?void 0:ie.value),C=h==null?void 0:h[P],H=C&&j({value:y})?(C*y).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:()=>v({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:g}=a.target;w(Number(g))},options:k,value:p},onSelectPage:a=>t(a),small:!0}}}})},ee=()=>{const h=["Section","Width","Height"];let m=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)=>{m[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:m.map((r,c)=>{const b=c;return{cells:[...Array(3).keys()].map((v,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,{})},ne=()=>{const h={fixedWidth:"auto",name:"Table title",actions:[{icon:"download",tooltip:"Download"}],columnAlignment:[...Array(10)].map((m,o)=>"right"),headers:[{cells:[...Array(10)].map((m,o)=>({value:"Heading"}))},{cells:[...Array(10)].map((m,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((m,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})},te=()=>{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})};var ce,de,ue;z.parameters={...z.parameters,docs:{...(ce=z.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 o}from"./jsx-runtime-FsUICBgo.js";import{r as V}from"./index-RfLt4OUa.js";import{c as h}from"./index-VW3EWkuE.js";import{i as l}from"./types-5uVBABF4.js";import{D as z}from"./disabled-context-urNQThQz.js";import{T as k}from"./tooltip-pjcB4ZxN.js";const I="_inputInTable_66zck_1",N="_inputHover_66zck_13",R="_inputFocus_66zck_18",C="_inputError_66zck_25",S="_inputWarning_66zck_26",A="_inputDisabled_66zck_61",F="_hideScrollbars_66zck_67",H="_textarea_66zck_77",W="_small_66zck_116",w="_error_66zck_121",D="_warning_66zck_138",P="_monospace_66zck_155",t={inputInTable:I,inputHover:N,inputFocus:R,inputError:C,inputWarning:S,inputDisabled:A,hideScrollbars:F,textarea:H,small:W,error:w,warning:D,monospace:P},i=({name:r,value:u="",placeholder:s="",cols:d,rows:c,disabled:m=!1,onChange:p=()=>{},onKeyPress:f=()=>{},onFocus:v=()=>{},onBlur:_=()=>{},tabIndex:b=0,error:e=null,warning:a=null,tooltip:n=null,maxTooltipWidth:y,resize:x,monospace:g=!1,testId:E})=>{const T=V.useContext(z),q=o.jsx("textarea",{className:h(t.textarea,e?t.error:"",a?t.warning:"",g?t.monospace:""),name:r,value:u,placeholder:s,cols:d,rows:c,onChange:p,disabled:m||T,onKeyPress:f,onFocus:v,onBlur:_,tabIndex:b,style:{resize:x},"data-testid":E});return o.jsx(k,{error:!!e,warning:!!a,text:n||e||a,enabled:n&&l(n)||e&&l(e)||a&&l(a)||!1,maxWidth:y,placement:"bottom-center",children:q})};try{i.displayName="TextArea",i.__docgenInfo={description:"",displayName:"TextArea",props:{name:{defaultValue:null,description:"",name:"name",required:!1,type:{name:"string"}},value:{defaultValue:{value:""},description:"",name:"value",required:!1,type:{name:"TStringOrNumber"}},placeholder:{defaultValue:{value:""},description:"",name:"placeholder",required:!1,type:{name:"string"}},cols:{defaultValue:null,description:"",name:"cols",required:!1,type:{name:"number"}},rows:{defaultValue:null,description:"",name:"rows",required:!1,type:{name:"number"}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},onChange:{defaultValue:{value:"() => {}"},description:"",name:"onChange",required:!1,type:{name:"((evt: ChangeEvent<HTMLTextAreaElement>) => void)"}},onKeyPress:{defaultValue:{value:"() => {}"},description:"",name:"onKeyPress",required:!1,type:{name:"((evt: KeyboardEvent<HTMLTextAreaElement>) => void)"}},onFocus:{defaultValue:{value:"() => {}"},description:"",name:"onFocus",required:!1,type:{name:"((evt: FocusEvent<HTMLTextAreaElement, Element>) => void)"}},onBlur:{defaultValue:{value:"() => {}"},description:"",name:"onBlur",required:!1,type:{name:"((evt: FocusEvent<HTMLTextAreaElement, Element>) => void)"}},tabIndex:{defaultValue:{value:"0"},description:"",name:"tabIndex",required:!1,type:{name:"number"}},error:{defaultValue:{value:"null"},description:"",name:"error",required:!1,type:{name:"string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | null"}},warning:{defaultValue:{value:"null"},description:"",name:"warning",required:!1,type:{name:"string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | null"}},tooltip:{defaultValue:{value:"null"},description:"",name:"tooltip",required:!1,type:{name:"string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | null"}},maxTooltipWidth:{defaultValue:null,description:"",name:"maxTooltipWidth",required:!1,type:{name:"TStringOrNumber"}},resize:{defaultValue:null,description:"",name:"resize",required:!1,type:{name:"enum",value:[{value:'"-moz-initial"'},{value:'"inherit"'},{value:'"initial"'},{value:'"revert"'},{value:'"revert-layer"'},{value:'"unset"'},{value:'"inline"'},{value:'"block"'},{value:'"both"'},{value:'"horizontal"'},{value:'"none"'},{value:'"vertical"'}]}},monospace:{defaultValue:{value:"false"},description:"",name:"monospace",required:!1,type:{name:"boolean"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}}}catch{}export{i as T};
1
+ import{j as o}from"./jsx-runtime-FsUICBgo.js";import{r as V}from"./index-RfLt4OUa.js";import{c as h}from"./index-VW3EWkuE.js";import{i as l}from"./types-5uVBABF4.js";import{D as z}from"./disabled-context-urNQThQz.js";import{T as k}from"./tooltip-dueTLnwA.js";const I="_inputInTable_66zck_1",N="_inputHover_66zck_13",R="_inputFocus_66zck_18",C="_inputError_66zck_25",S="_inputWarning_66zck_26",A="_inputDisabled_66zck_61",F="_hideScrollbars_66zck_67",H="_textarea_66zck_77",W="_small_66zck_116",w="_error_66zck_121",D="_warning_66zck_138",P="_monospace_66zck_155",t={inputInTable:I,inputHover:N,inputFocus:R,inputError:C,inputWarning:S,inputDisabled:A,hideScrollbars:F,textarea:H,small:W,error:w,warning:D,monospace:P},i=({name:r,value:u="",placeholder:s="",cols:d,rows:c,disabled:m=!1,onChange:p=()=>{},onKeyPress:f=()=>{},onFocus:v=()=>{},onBlur:_=()=>{},tabIndex:b=0,error:e=null,warning:a=null,tooltip:n=null,maxTooltipWidth:y,resize:x,monospace:g=!1,testId:E})=>{const T=V.useContext(z),q=o.jsx("textarea",{className:h(t.textarea,e?t.error:"",a?t.warning:"",g?t.monospace:""),name:r,value:u,placeholder:s,cols:d,rows:c,onChange:p,disabled:m||T,onKeyPress:f,onFocus:v,onBlur:_,tabIndex:b,style:{resize:x},"data-testid":E});return o.jsx(k,{error:!!e,warning:!!a,text:n||e||a,enabled:n&&l(n)||e&&l(e)||a&&l(a)||!1,maxWidth:y,placement:"bottom-center",children:q})};try{i.displayName="TextArea",i.__docgenInfo={description:"",displayName:"TextArea",props:{name:{defaultValue:null,description:"",name:"name",required:!1,type:{name:"string"}},value:{defaultValue:{value:""},description:"",name:"value",required:!1,type:{name:"TStringOrNumber"}},placeholder:{defaultValue:{value:""},description:"",name:"placeholder",required:!1,type:{name:"string"}},cols:{defaultValue:null,description:"",name:"cols",required:!1,type:{name:"number"}},rows:{defaultValue:null,description:"",name:"rows",required:!1,type:{name:"number"}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},onChange:{defaultValue:{value:"() => {}"},description:"",name:"onChange",required:!1,type:{name:"((evt: ChangeEvent<HTMLTextAreaElement>) => void)"}},onKeyPress:{defaultValue:{value:"() => {}"},description:"",name:"onKeyPress",required:!1,type:{name:"((evt: KeyboardEvent<HTMLTextAreaElement>) => void)"}},onFocus:{defaultValue:{value:"() => {}"},description:"",name:"onFocus",required:!1,type:{name:"((evt: FocusEvent<HTMLTextAreaElement, Element>) => void)"}},onBlur:{defaultValue:{value:"() => {}"},description:"",name:"onBlur",required:!1,type:{name:"((evt: FocusEvent<HTMLTextAreaElement, Element>) => void)"}},tabIndex:{defaultValue:{value:"0"},description:"",name:"tabIndex",required:!1,type:{name:"number"}},error:{defaultValue:{value:"null"},description:"",name:"error",required:!1,type:{name:"string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | null"}},warning:{defaultValue:{value:"null"},description:"",name:"warning",required:!1,type:{name:"string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | null"}},tooltip:{defaultValue:{value:"null"},description:"",name:"tooltip",required:!1,type:{name:"string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | null"}},maxTooltipWidth:{defaultValue:null,description:"",name:"maxTooltipWidth",required:!1,type:{name:"TStringOrNumber"}},resize:{defaultValue:null,description:"",name:"resize",required:!1,type:{name:"enum",value:[{value:'"-moz-initial"'},{value:'"inherit"'},{value:'"initial"'},{value:'"revert"'},{value:'"revert-layer"'},{value:'"unset"'},{value:'"inline"'},{value:'"none"'},{value:'"block"'},{value:'"both"'},{value:'"horizontal"'},{value:'"vertical"'}]}},monospace:{defaultValue:{value:"false"},description:"",name:"monospace",required:!1,type:{name:"boolean"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}}}}}catch{}export{i as T};
@@ -1,4 +1,4 @@
1
- import{j as u}from"./jsx-runtime-FsUICBgo.js";import{T as s}from"./textarea-c5fYK9-8.js";import"./index-RfLt4OUa.js";import"./index-VW3EWkuE.js";import"./types-5uVBABF4.js";import"./lodash-Bmg8FrMx.js";import"./disabled-context-urNQThQz.js";import"./tooltip-pjcB4ZxN.js";import"./index-miLrID2P.js";const{useArgs:g}=__STORYBOOK_MODULE_ADDONS__,C={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-FsUICBgo.js";import{T as s}from"./textarea-RrPYPGCC.js";import"./index-RfLt4OUa.js";import"./index-VW3EWkuE.js";import"./types-5uVBABF4.js";import"./lodash-Bmg8FrMx.js";import"./disabled-context-urNQThQz.js";import"./tooltip-dueTLnwA.js";import"./index-miLrID2P.js";const{useArgs:g}=__STORYBOOK_MODULE_ADDONS__,C={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-FsUICBgo.js";import{T as X}from"./table-tDId3FKL.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-6LXl4zwR.js";import"./index-RfLt4OUa.js";import"./index-VW3EWkuE.js";import"./index.es-VXFRDikp.js";import"./inheritsLoose-8sb_A2v4.js";import"./redux-F5dueAP3.js";import"./objectSpread2-93s0nBry.js";import"./tiny-invariant-R4kOKlvx.js";import"./index-miLrID2P.js";import"./memoize-one.esm-hqe5SRxC.js";import"./objectWithoutPropertiesLoose-9Q1jwsKS.js";import"./lodash-Bmg8FrMx.js";import"./actions-MkrpU3sl.js";import"./common-types-U65vzrrz.js";import"./disabled-context-urNQThQz.js";import"./button-MXXjI7Bb.js";import"./spinner-R8Il4aRe.js";import"./icon-8EQazuuW.js";import"./tslib.es6-OIsz3r9a.js";import"./index-4QtD-hFu.js";import"./tooltip-pjcB4ZxN.js";import"./types-VB5zD18b.js";import"./types-5uVBABF4.js";import"./badge-23Ty_zBt.js";import"./heading-CRsqGmBL.js";import"./help-icon-DUhtRK0A.js";import"./pagination-APbPWlVY.js";import"./select-Bp8YY8Ze.js";import"./assertThisInitialized-4q6YPdh3.js";import"./text-6KQ6ntOV.js";import"./select.input-zP5tW20f.js";import"./input-vzl5J-q1.js";import"./input-group-R8LoqKRn.js";import"./input-group-addon-BHVsW9mL.js";import"./number-input-yoDwXp2C.js";import"./index-VSx05S_2.js";import"./index-cCpkwrS5.js";import"./check-box-w174Mu0R.js";import"./slider-0HIxE6AZ.js";import"./index-ugi_ZH6T.js";import"./popover-ZJGe9jlj.js";import"./flex-RYZsoWEN.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-FsUICBgo.js";import{T as X}from"./table-yS0o5bJS.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-UtsQXBjO.js";import"./index-RfLt4OUa.js";import"./index-VW3EWkuE.js";import"./index.es-VXFRDikp.js";import"./inheritsLoose-8sb_A2v4.js";import"./redux-F5dueAP3.js";import"./objectSpread2-93s0nBry.js";import"./tiny-invariant-R4kOKlvx.js";import"./index-miLrID2P.js";import"./memoize-one.esm-hqe5SRxC.js";import"./objectWithoutPropertiesLoose-9Q1jwsKS.js";import"./lodash-Bmg8FrMx.js";import"./actions-0ELEGFed.js";import"./common-types-U65vzrrz.js";import"./disabled-context-urNQThQz.js";import"./button-BiJw0fB3.js";import"./spinner-R8Il4aRe.js";import"./icon-8EQazuuW.js";import"./tslib.es6-OIsz3r9a.js";import"./index-4QtD-hFu.js";import"./tooltip-dueTLnwA.js";import"./types-VB5zD18b.js";import"./types-5uVBABF4.js";import"./badge-23Ty_zBt.js";import"./heading-4tVgoT7O.js";import"./help-icon-eelulTML.js";import"./pagination-H0l4VC9v.js";import"./select-I01_W6_4.js";import"./assertThisInitialized-4q6YPdh3.js";import"./text-6KQ6ntOV.js";import"./select.input-zP5tW20f.js";import"./input-fYKvBwPs.js";import"./input-group-R8LoqKRn.js";import"./input-group-addon-BHVsW9mL.js";import"./number-input-ymd7m-s5.js";import"./index-qZmQ7nA9.js";import"./index-cCpkwrS5.js";import"./check-box-KynSyTaY.js";import"./slider-n3IxC2iq.js";import"./index-ugi_ZH6T.js";import"./popover-N9B8JT3G.js";import"./flex-RYZsoWEN.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-FsUICBgo.js";import{G as v}from"./grid-u1mZpaML.js";import{T as u}from"./text-6KQ6ntOV.js";import{F as B}from"./flex-RYZsoWEN.js";import{t as n,d}from"./toaster-yPcd4ELJ.js";import{B as o}from"./button-MXXjI7Bb.js";import{S as a}from"./spacer-Yji9g2AW.js";import{a as m}from"./message-CRKuTfOl.js";import"./index-RfLt4OUa.js";import"./styled-components.browser.esm-qIipjd6c.js";import"./tslib.es6-OIsz3r9a.js";import"./index-VW3EWkuE.js";import"./index-miLrID2P.js";import"./common-types-U65vzrrz.js";import"./disabled-context-urNQThQz.js";import"./spinner-R8Il4aRe.js";import"./icon-8EQazuuW.js";import"./objectWithoutPropertiesLoose-9Q1jwsKS.js";import"./inheritsLoose-8sb_A2v4.js";import"./index-4QtD-hFu.js";import"./tooltip-pjcB4ZxN.js";const _={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"},O={type:m.INFO,icon:!0,heading:"Heading",content:"Long content lorem ipsum dolor est compendum lorem ipsum."},ns={title:"Modals/Toaster",parameters:{docs:{story:{inline:!1,iframeHeight:400}}},source:{type:"code"},args:{id:void 0,message:O,autoClose:6e3,onClose:()=>{}}},G=()=>s.jsxs(s.Fragment,{children:[s.jsx(o,{label:"Info",onClick:()=>n({message:O,onClose:()=>console.log("toast closed")})}),s.jsx(a,{}),s.jsx(o,{label:"Error",onClick:()=>n({message:A,onClose:()=>console.log("toast closed")})}),s.jsx(a,{}),s.jsx(o,{label:"Warning",onClick:()=>n({message:F,onClose:()=>console.log("toast closed")})}),s.jsx(a,{}),s.jsx(o,{label:"Success",onClick:()=>n({message:_,onClose:()=>console.log("toast closed")})})]}),r=G.bind({}),t=()=>s.jsx(o,{label:"Show Toast",onClick:()=>{const e=Math.random()>=.5;n({message:{type:e?"Success":"Error",icon:!0,content:e?"Success":"Error"},onClose:()=>console.log("toast closed"),id:"uniqueId"})}});t.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 i=()=>{const e="sessionExpiring",p={type:"Info",content:s.jsxs(v,{children:[s.jsx(u,{bold:!0,children:"You will be signed out soon"}),s.jsx(u,{children:"For your security, you will be automatically signed out in 30 minutes unless you extend your session."}),s.jsx(a,{height:"var(--padding-xxs)"}),s.jsxs(B,{gap:"var(--padding-xs)",children:[s.jsx(o,{label:"Extend session",small:!0,colored:"success",onClick:()=>d(e)}),s.jsx(o,{label:"Dismiss",small:!0,onClick:()=>d(e)})]})]})};return s.jsx(o,{label:"Show Toast",onClick:()=>n({message:p,autoClose:!1,id:e})})},l=()=>{const e="sessionExpiringSoon",p={type:"Error",content:s.jsxs(v,{children:[s.jsx(u,{bold:!0,children:"You will be signed out very soon"}),s.jsx(u,{children:"For your security, you will be automatically signed out in 30 minutes unless you extend your session."}),s.jsx(a,{height:"var(--padding-xxs)"}),s.jsxs(B,{gap:"var(--padding-xs)",children:[s.jsx(o,{label:"Extend session",small:!0,colored:"success",onClick:()=>d(e)}),s.jsx(o,{label:"Dismiss",small:!0,onClick:()=>d(e)})]})]})};return s.jsx(o,{label:"Show Toast",onClick:()=>n({message:p,autoClose:!1,id:e})})},c=()=>{const e={type:"Success",content:"Your session has been extended for 1 hour"};return s.jsx(o,{label:"Show Toast",onClick:()=>n({message:e})})};var g,x,S;r.parameters={...r.parameters,docs:{...(g=r.parameters)==null?void 0:g.docs,source:{originalSource:`() => {
1
+ import{j as s}from"./jsx-runtime-FsUICBgo.js";import{G as v}from"./grid-u1mZpaML.js";import{T as u}from"./text-6KQ6ntOV.js";import{F as B}from"./flex-RYZsoWEN.js";import{t as n,d}from"./toaster-yPcd4ELJ.js";import{B as o}from"./button-BiJw0fB3.js";import{S as a}from"./spacer-Yji9g2AW.js";import{a as m}from"./message-CRKuTfOl.js";import"./index-RfLt4OUa.js";import"./styled-components.browser.esm-qIipjd6c.js";import"./tslib.es6-OIsz3r9a.js";import"./index-VW3EWkuE.js";import"./index-miLrID2P.js";import"./common-types-U65vzrrz.js";import"./disabled-context-urNQThQz.js";import"./spinner-R8Il4aRe.js";import"./icon-8EQazuuW.js";import"./objectWithoutPropertiesLoose-9Q1jwsKS.js";import"./inheritsLoose-8sb_A2v4.js";import"./index-4QtD-hFu.js";import"./tooltip-dueTLnwA.js";const _={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"},O={type:m.INFO,icon:!0,heading:"Heading",content:"Long content lorem ipsum dolor est compendum lorem ipsum."},ns={title:"Modals/Toaster",parameters:{docs:{story:{inline:!1,iframeHeight:400}}},source:{type:"code"},args:{id:void 0,message:O,autoClose:6e3,onClose:()=>{}}},G=()=>s.jsxs(s.Fragment,{children:[s.jsx(o,{label:"Info",onClick:()=>n({message:O,onClose:()=>console.log("toast closed")})}),s.jsx(a,{}),s.jsx(o,{label:"Error",onClick:()=>n({message:A,onClose:()=>console.log("toast closed")})}),s.jsx(a,{}),s.jsx(o,{label:"Warning",onClick:()=>n({message:F,onClose:()=>console.log("toast closed")})}),s.jsx(a,{}),s.jsx(o,{label:"Success",onClick:()=>n({message:_,onClose:()=>console.log("toast closed")})})]}),r=G.bind({}),t=()=>s.jsx(o,{label:"Show Toast",onClick:()=>{const e=Math.random()>=.5;n({message:{type:e?"Success":"Error",icon:!0,content:e?"Success":"Error"},onClose:()=>console.log("toast closed"),id:"uniqueId"})}});t.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 i=()=>{const e="sessionExpiring",p={type:"Info",content:s.jsxs(v,{children:[s.jsx(u,{bold:!0,children:"You will be signed out soon"}),s.jsx(u,{children:"For your security, you will be automatically signed out in 30 minutes unless you extend your session."}),s.jsx(a,{height:"var(--padding-xxs)"}),s.jsxs(B,{gap:"var(--padding-xs)",children:[s.jsx(o,{label:"Extend session",small:!0,colored:"success",onClick:()=>d(e)}),s.jsx(o,{label:"Dismiss",small:!0,onClick:()=>d(e)})]})]})};return s.jsx(o,{label:"Show Toast",onClick:()=>n({message:p,autoClose:!1,id:e})})},l=()=>{const e="sessionExpiringSoon",p={type:"Error",content:s.jsxs(v,{children:[s.jsx(u,{bold:!0,children:"You will be signed out very soon"}),s.jsx(u,{children:"For your security, you will be automatically signed out in 30 minutes unless you extend your session."}),s.jsx(a,{height:"var(--padding-xxs)"}),s.jsxs(B,{gap:"var(--padding-xs)",children:[s.jsx(o,{label:"Extend session",small:!0,colored:"success",onClick:()=>d(e)}),s.jsx(o,{label:"Dismiss",small:!0,onClick:()=>d(e)})]})]})};return s.jsx(o,{label:"Show Toast",onClick:()=>n({message:p,autoClose:!1,id:e})})},c=()=>{const e={type:"Success",content:"Your session has been extended for 1 hour"};return s.jsx(o,{label:"Show Toast",onClick:()=>n({message:e})})};var g,x,S;r.parameters={...r.parameters,docs:{...(g=r.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 l}from"./jsx-runtime-FsUICBgo.js";import{r as b}from"./index-RfLt4OUa.js";import{c as x}from"./index-VW3EWkuE.js";import{b as C}from"./common-types-U65vzrrz.js";import{D as q}from"./disabled-context-urNQThQz.js";import{H as E}from"./help-icon-DUhtRK0A.js";const V="_toggle_1mo1i_9",h="_small_1mo1i_25",I="_disabled_1mo1i_102",v="_noMargin_1mo1i_113",j="_helpIconEnabled_1mo1i_116",a={toggle:V,small:h,disabled:I,noMargin:v,helpIconEnabled:j},r=({name:t,label:d,checked:e=!1,disabled:u,display:m,small:p=!1,onChange:c,noMargin:g=!1,testId:f,helpText:i,onClickHelp:o})=>{const y=b.useContext(q),_=i||o,s=u||y;return l.jsxs("div",{className:x(a.toggle,s?a.disabled:null,p?a.small:null,g?a.noMargin:null),style:{display:m},onClick:n=>{s||(n.target.name=t,n.target.checked=!e,n.target.value=!e,c(n))},"data-testid":f,children:[l.jsx("input",{type:C.CHECKBOX,name:t,value:e==null?void 0:e.toString(),disabled:s,checked:e,onChange:()=>{}}),l.jsx("label",{children:d}),_&&l.jsx("div",{className:a.helpIconEnabled,onClick:o,children:l.jsx(E,{text:i})})]})};try{r.displayName="Toggle",r.__docgenInfo={description:"",displayName:"Toggle",props:{name:{defaultValue:null,description:"",name:"name",required:!1,type:{name:"string"}},label:{defaultValue:null,description:"",name:"label",required:!1,type:{name:"string | ReactElement<any, string | JSXElementConstructor<any>> | null"}},checked:{defaultValue:{value:"false"},description:"",name:"checked",required:!1,type:{name:"boolean"}},disabled:{defaultValue:null,description:"",name:"disabled",required:!1,type:{name:"boolean"}},display:{defaultValue:null,description:"",name:"display",required:!1,type:{name:"string"}},small:{defaultValue:{value:"false"},description:"",name:"small",required:!1,type:{name:"boolean"}},onChange:{defaultValue:null,description:"",name:"onChange",required:!0,type:{name:"(evt: ChangeEvent<HTMLInputElement>) => void"}},noMargin:{defaultValue:{value:"false"},description:"",name:"noMargin",required:!1,type:{name:"boolean"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}},helpText:{defaultValue:null,description:"",name:"helpText",required:!1,type:{name:"string"}},onClickHelp:{defaultValue:null,description:"",name:"onClickHelp",required:!1,type:{name:"((evt: any) => void)"}}}}}catch{}export{r as T};
1
+ import{j as l}from"./jsx-runtime-FsUICBgo.js";import{r as b}from"./index-RfLt4OUa.js";import{c as x}from"./index-VW3EWkuE.js";import{b as C}from"./common-types-U65vzrrz.js";import{D as q}from"./disabled-context-urNQThQz.js";import{H as E}from"./help-icon-eelulTML.js";const V="_toggle_1mo1i_9",h="_small_1mo1i_25",I="_disabled_1mo1i_102",v="_noMargin_1mo1i_113",j="_helpIconEnabled_1mo1i_116",a={toggle:V,small:h,disabled:I,noMargin:v,helpIconEnabled:j},r=({name:t,label:d,checked:e=!1,disabled:u,display:m,small:p=!1,onChange:c,noMargin:g=!1,testId:f,helpText:i,onClickHelp:o})=>{const y=b.useContext(q),_=i||o,s=u||y;return l.jsxs("div",{className:x(a.toggle,s?a.disabled:null,p?a.small:null,g?a.noMargin:null),style:{display:m},onClick:n=>{s||(n.target.name=t,n.target.checked=!e,n.target.value=!e,c(n))},"data-testid":f,children:[l.jsx("input",{type:C.CHECKBOX,name:t,value:e==null?void 0:e.toString(),disabled:s,checked:e,onChange:()=>{}}),l.jsx("label",{children:d}),_&&l.jsx("div",{className:a.helpIconEnabled,onClick:o,children:l.jsx(E,{text:i})})]})};try{r.displayName="Toggle",r.__docgenInfo={description:"",displayName:"Toggle",props:{name:{defaultValue:null,description:"",name:"name",required:!1,type:{name:"string"}},label:{defaultValue:null,description:"",name:"label",required:!1,type:{name:"string | ReactElement<any, string | JSXElementConstructor<any>> | null"}},checked:{defaultValue:{value:"false"},description:"",name:"checked",required:!1,type:{name:"boolean"}},disabled:{defaultValue:null,description:"",name:"disabled",required:!1,type:{name:"boolean"}},display:{defaultValue:null,description:"",name:"display",required:!1,type:{name:"string"}},small:{defaultValue:{value:"false"},description:"",name:"small",required:!1,type:{name:"boolean"}},onChange:{defaultValue:null,description:"",name:"onChange",required:!0,type:{name:"(evt: ChangeEvent<HTMLInputElement>) => void"}},noMargin:{defaultValue:{value:"false"},description:"",name:"noMargin",required:!1,type:{name:"boolean"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}},helpText:{defaultValue:null,description:"",name:"helpText",required:!1,type:{name:"string"}},onClickHelp:{defaultValue:null,description:"",name:"onClickHelp",required:!1,type:{name:"((evt: any) => void)"}}}}}catch{}export{r as T};
@@ -1,4 +1,4 @@
1
- import{j as e}from"./jsx-runtime-FsUICBgo.js";import{r as X}from"./index-RfLt4OUa.js";import{F as C}from"./flex-RYZsoWEN.js";import{T as g}from"./text-6KQ6ntOV.js";import{T as d}from"./toggle-gxvny8zu.js";import"./index-VW3EWkuE.js";import"./common-types-U65vzrrz.js";import"./disabled-context-urNQThQz.js";import"./help-icon-DUhtRK0A.js";import"./tooltip-pjcB4ZxN.js";import"./index-miLrID2P.js";import"./icon-8EQazuuW.js";import"./objectWithoutPropertiesLoose-9Q1jwsKS.js";import"./inheritsLoose-8sb_A2v4.js";import"./tslib.es6-OIsz3r9a.js";import"./index-4QtD-hFu.js";const{useArgs:Z}=__STORYBOOK_MODULE_ADDONS__,me={title:"Forms/Toggle",component:d,args:{label:"Label"}},n=u=>{const[{checked:m},x]=Z(),b=()=>{x({checked:!m})};return e.jsx(d,{...u,onChange:b})},p=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 i=()=>e.jsxs(e.Fragment,{children:[e.jsx(d,{display:"block",label:e.jsxs(C,{justifyContent:"space-between",wrap:!1,gap:!0,children:[e.jsx(g,{bold:!0,children:"Label"}),e.jsx(g,{success:!0,children:"Released yesterday"})]}),onChange:()=>{}}),e.jsx(d,{label:e.jsxs(C,{justifyContent:"space-between",wrap:!1,gap:!0,children:[e.jsx(g,{bold:!0,children:"Label"}),e.jsx(g,{success:!0,children:"Released yesterday"})]}),onChange:()=>{}})]}),h=()=>{const[u,m]=X.useState(!1);return e.jsx(d,{name:"name",label:"Label",checked:u,onChange:x=>{const{name:b,value:V,checked:k}=x.target;m(k),console.log(b,V,k)}})},l=n.bind({});l.args={helpText:"Help text",disabled:!0};var T,A,j;p.parameters={...p.parameters,docs:{...(T=p.parameters)==null?void 0:T.docs,source:{originalSource:`args => {
1
+ import{j as e}from"./jsx-runtime-FsUICBgo.js";import{r as X}from"./index-RfLt4OUa.js";import{F as C}from"./flex-RYZsoWEN.js";import{T as g}from"./text-6KQ6ntOV.js";import{T as d}from"./toggle-R__kwKym.js";import"./index-VW3EWkuE.js";import"./common-types-U65vzrrz.js";import"./disabled-context-urNQThQz.js";import"./help-icon-eelulTML.js";import"./tooltip-dueTLnwA.js";import"./index-miLrID2P.js";import"./icon-8EQazuuW.js";import"./objectWithoutPropertiesLoose-9Q1jwsKS.js";import"./inheritsLoose-8sb_A2v4.js";import"./tslib.es6-OIsz3r9a.js";import"./index-4QtD-hFu.js";const{useArgs:Z}=__STORYBOOK_MODULE_ADDONS__,me={title:"Forms/Toggle",component:d,args:{label:"Label"}},n=u=>{const[{checked:m},x]=Z(),b=()=>{x({checked:!m})};return e.jsx(d,{...u,onChange:b})},p=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 i=()=>e.jsxs(e.Fragment,{children:[e.jsx(d,{display:"block",label:e.jsxs(C,{justifyContent:"space-between",wrap:!1,gap:!0,children:[e.jsx(g,{bold:!0,children:"Label"}),e.jsx(g,{success:!0,children:"Released yesterday"})]}),onChange:()=>{}}),e.jsx(d,{label:e.jsxs(C,{justifyContent:"space-between",wrap:!1,gap:!0,children:[e.jsx(g,{bold:!0,children:"Label"}),e.jsx(g,{success:!0,children:"Released yesterday"})]}),onChange:()=>{}})]}),h=()=>{const[u,m]=X.useState(!1);return e.jsx(d,{name:"name",label:"Label",checked:u,onChange:x=>{const{name:b,value:V,checked:k}=x.target;m(k),console.log(b,V,k)}})},l=n.bind({});l.args={helpText:"Help text",disabled:!0};var T,A,j;p.parameters={...p.parameters,docs:{...(T=p.parameters)==null?void 0:T.docs,source:{originalSource:`args => {
2
2
  const [{
3
3
  checked
4
4
  }, updateArgs] = useArgs();
@@ -18,7 +18,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
18
18
  right: undefined,
19
19
  position: 'absolute',
20
20
  },
21
- }`},description:"",name:"arrowProps",required:!1,type:{name:"Partial<ArrowProps>"}}}}}catch{}const Ve=({children:e,text:r="",error:n=!1,placement:t="top-center",possiblePlacements:i=["top-center","left-center","bottom-center","right-center"],enabled:o=!0,warning:a=!1,maxWidth:s="40em",triggerOffset:l=12,fontSize:u="inherit",padding:c="var(--padding-xxs) var(--padding-xs)",display:f="inline",flex:d="none",forceOpen:v=!1})=>{const p=o&&(g.isValidElement(r)||typeof r=="string"&&r.length>0||typeof r=="number"),[h,m,y]=or({delayEnter:100,delayLeave:0}),b=p?v?!0:h:!1,{renderLayer:C,triggerProps:L,layerProps:O,arrowProps:_}=Kt({isOpen:b,overflowContainer:!0,ResizeObserver:Mt,auto:!0,triggerOffset:l,placement:t,possiblePlacements:i,onParentClose:y});return G.jsxs(G.Fragment,{children:[b&&C(G.jsx(Se,{text:r,error:n,warning:a,padding:c,maxWidth:s,fontSize:u,layerProps:O,arrowProps:_})),G.jsx("span",{...L,...m,style:{display:f,flex:d},children:e})]})};try{Ve.displayName="Tooltip",Ve.__docgenInfo={description:"",displayName:"Tooltip",props:{text:{defaultValue:{value:""},description:"",name:"text",required:!1,type:{name:"string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | null"}},error:{defaultValue:{value:"false"},description:"",name:"error",required:!1,type:{name:"boolean"}},warning:{defaultValue:{value:"false"},description:"",name:"warning",required:!1,type:{name:"boolean"}},placement:{defaultValue:{value:"top-center"},description:"",name:"placement",required:!1,type:{name:"enum",value:[{value:'"top-center"'},{value:'"bottom-center"'},{value:'"center"'},{value:'"right-start"'},{value:'"bottom-start"'},{value:'"bottom-end"'},{value:'"top-start"'},{value:'"top-end"'},{value:'"left-end"'},{value:'"left-center"'},{value:'"left-start"'},{value:'"right-end"'},{value:'"right-center"'}]}},possiblePlacements:{defaultValue:{value:`[
21
+ }`},description:"",name:"arrowProps",required:!1,type:{name:"Partial<ArrowProps>"}}}}}catch{}const Ve=({children:e,text:r="",error:n=!1,placement:t="top-center",possiblePlacements:i=["top-center","left-center","bottom-center","right-center"],enabled:o=!0,warning:a=!1,maxWidth:s="40em",triggerOffset:l=12,fontSize:u="inherit",padding:c="var(--padding-xxs) var(--padding-xs)",display:f="inline",flex:d="none",forceOpen:v=!1})=>{const p=o&&(g.isValidElement(r)||typeof r=="string"&&r.length>0||typeof r=="number"),[h,m,y]=or({delayEnter:100,delayLeave:0}),b=p?v?!0:h:!1,{renderLayer:C,triggerProps:L,layerProps:O,arrowProps:_}=Kt({isOpen:b,overflowContainer:!0,ResizeObserver:Mt,auto:!0,triggerOffset:l,placement:t,possiblePlacements:i,onParentClose:y});return G.jsxs(G.Fragment,{children:[b&&C(G.jsx(Se,{text:r,error:n,warning:a,padding:c,maxWidth:s,fontSize:u,layerProps:O,arrowProps:_})),G.jsx("span",{...L,...m,style:{display:f,flex:d},children:e})]})};try{Ve.displayName="Tooltip",Ve.__docgenInfo={description:"",displayName:"Tooltip",props:{text:{defaultValue:{value:""},description:"",name:"text",required:!1,type:{name:"string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | null"}},error:{defaultValue:{value:"false"},description:"",name:"error",required:!1,type:{name:"boolean"}},warning:{defaultValue:{value:"false"},description:"",name:"warning",required:!1,type:{name:"boolean"}},placement:{defaultValue:{value:"top-center"},description:"",name:"placement",required:!1,type:{name:"enum",value:[{value:'"top-center"'},{value:'"bottom-center"'},{value:'"center"'},{value:'"bottom-start"'},{value:'"bottom-end"'},{value:'"top-start"'},{value:'"top-end"'},{value:'"left-end"'},{value:'"left-center"'},{value:'"left-start"'},{value:'"right-end"'},{value:'"right-center"'},{value:'"right-start"'}]}},possiblePlacements:{defaultValue:{value:`[
22
22
  'top-center',
23
23
  'left-center',
24
24
  'bottom-center',
@@ -1,4 +1,4 @@
1
- import{j as e}from"./jsx-runtime-FsUICBgo.js";import{T as P}from"./tooltip-pjcB4ZxN.js";import"./index-RfLt4OUa.js";import"./index-miLrID2P.js";import"./index-VW3EWkuE.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-FsUICBgo.js";import{T as P}from"./tooltip-dueTLnwA.js";import"./index-RfLt4OUa.js";import"./index-miLrID2P.js";import"./index-VW3EWkuE.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-FsUICBgo.js";import{T as m}from"./tooltip-pjcB4ZxN.js";import{M as u}from"./actions-MkrpU3sl.js";import{m as d}from"./menu.stories-data-hEz8P1yK.js";import"./index-RfLt4OUa.js";import"./index-miLrID2P.js";import"./index-VW3EWkuE.js";import"./lodash-Bmg8FrMx.js";import"./common-types-U65vzrrz.js";import"./disabled-context-urNQThQz.js";import"./button-MXXjI7Bb.js";import"./spinner-R8Il4aRe.js";import"./icon-8EQazuuW.js";import"./objectWithoutPropertiesLoose-9Q1jwsKS.js";import"./inheritsLoose-8sb_A2v4.js";import"./tslib.es6-OIsz3r9a.js";import"./index-4QtD-hFu.js";import"./types-VB5zD18b.js";import"./types-5uVBABF4.js";import"./badge-23Ty_zBt.js";import"./flex-RYZsoWEN.js";const H={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-FsUICBgo.js";import{T as m}from"./tooltip-dueTLnwA.js";import{M as u}from"./actions-0ELEGFed.js";import{m as d}from"./menu.stories-data-hEz8P1yK.js";import"./index-RfLt4OUa.js";import"./index-miLrID2P.js";import"./index-VW3EWkuE.js";import"./lodash-Bmg8FrMx.js";import"./common-types-U65vzrrz.js";import"./disabled-context-urNQThQz.js";import"./button-BiJw0fB3.js";import"./spinner-R8Il4aRe.js";import"./icon-8EQazuuW.js";import"./objectWithoutPropertiesLoose-9Q1jwsKS.js";import"./inheritsLoose-8sb_A2v4.js";import"./tslib.es6-OIsz3r9a.js";import"./index-4QtD-hFu.js";import"./types-VB5zD18b.js";import"./types-5uVBABF4.js";import"./badge-23Ty_zBt.js";import"./flex-RYZsoWEN.js";const H={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 +1 @@
1
- import{j as n}from"./jsx-runtime-FsUICBgo.js";import{c as u}from"./index-VW3EWkuE.js";import{I as x}from"./icon-8EQazuuW.js";import{T as v}from"./common-types-U65vzrrz.js";import{B as T}from"./button-MXXjI7Bb.js";import{M as j}from"./actions-MkrpU3sl.js";import{r as q}from"./index-RfLt4OUa.js";import{D as V}from"./disabled-context-urNQThQz.js";const C="_topbar_oyr59_11",k="_fixed_oyr59_21",E="_appSwitcher_oyr59_29",I="_title_oyr59_75",M="_logo_oyr59_91",B="_label_oyr59_94",w="_brand_oyr59_99",L="_version_oyr59_104",H="_left_oyr59_111",O="_right_oyr59_112",S="_item_oyr59_126",A="_link_oyr59_127",P="_button_oyr59_138",R="_menu_oyr59_139",D="_active_oyr59_168",U="_alert_oyr59_193",r={topbar:C,fixed:k,appSwitcher:E,title:I,logo:M,label:B,brand:w,version:L,left:H,right:O,item:S,link:A,button:P,menu:R,active:D,alert:U},f=({warning:e})=>n.jsx("div",{className:r.alert,children:e});try{f.displayName="Warning",f.__docgenInfo={description:"",displayName:"Warning",props:{warning:{defaultValue:null,description:"",name:"warning",required:!0,type:{name:"ReactNode"}}}}}catch{}const y=({icon:e,url:a,onClick:i})=>{const t=n.jsx(x,{icon:e});return a?n.jsx("a",{href:a,onClick:i,className:r.appSwitcher,children:t}):n.jsx("div",{onClick:i,className:r.appSwitcher,children:t})};try{y.displayName="AppSwitcher",y.__docgenInfo={description:"",displayName:"AppSwitcher",props:{icon:{defaultValue:null,description:"",name:"icon",required:!1,type:{name:"ReactNode"}},url:{defaultValue:null,description:"",name:"url",required:!1,type:{name:"string"}},onClick:{defaultValue:null,description:"",name:"onClick",required:!1,type:{name:"MouseEventHandler<HTMLDivElement | HTMLAnchorElement>"}}}}}catch{}const h=({label:e,logo:a,url:i,version:t,onClick:l})=>{const o=n.jsxs("div",{className:r.title,children:[a&&n.jsx("div",{className:r.logo,children:a}),e&&n.jsx("span",{className:r.label,children:e}),t&&n.jsx("div",{className:r.version,children:t})]});return n.jsx("div",{className:u(r.item,r.brand),children:i?n.jsx("a",{href:i,onClick:l,children:o}):n.jsx("div",{onClick:l,children:o})})};try{h.displayName="Title",h.__docgenInfo={description:"",displayName:"Title",props:{label:{defaultValue:null,description:"",name:"label",required:!1,type:{name:"string | null"}},logo:{defaultValue:null,description:"",name:"logo",required:!1,type:{name:"ReactNode"}},url:{defaultValue:null,description:"",name:"url",required:!1,type:{name:"string"}},version:{defaultValue:null,description:"",name:"version",required:!1,type:{name:"TStringOrNumber"}},onClick:{defaultValue:null,description:"",name:"onClick",required:!1,type:{name:"MouseEventHandler<HTMLDivElement | HTMLAnchorElement>"}}}}}catch{}var d=(e=>(e.LINK="Link",e.BUTTON="Button",e.MENU="Menu",e.COMPONENT="Component",e))(d||{});const p=({label:e,url:a,icon:i,onClick:t,active:l,disabled:o,testId:_,component:s="a"})=>{const c=q.useContext(V),b=g=>{(o||c)&&g.preventDefault(),t==null||t(g)};return n.jsxs(s,{className:u(r.link,l?r.active:""),href:a||"#",to:a,onClick:b,"aria-disabled":o||c,"data-testid":_,role:t&&!a?"button":void 0,children:[i,n.jsx("span",{className:r.label,children:e})]})};try{p.displayName="Link",p.__docgenInfo={description:"",displayName:"Link",props:{label:{defaultValue:null,description:"",name:"label",required:!1,type:{name:"string | null"}},url:{defaultValue:null,description:"",name:"url",required:!1,type:{name:"string"}},icon:{defaultValue:null,description:"",name:"icon",required:!1,type:{name:"ReactNode"}},onClick:{defaultValue:null,description:"",name:"onClick",required:!1,type:{name:"MouseEventHandler<HTMLAnchorElement>"}},active:{defaultValue:null,description:"",name:"active",required:!1,type:{name:"boolean"}},disabled:{defaultValue:null,description:"",name:"disabled",required:!1,type:{name:"boolean"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}},component:{defaultValue:null,description:"",name:"component",required:!1,type:{name:"ElementType<any>"}}}}}catch{}const m=({element:e})=>{switch(e.type){case d.LINK:return n.jsx("div",{className:r.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 d.BUTTON:return n.jsx("div",{className:u(r.item,r.button),children:n.jsx(T,{label:e.label,colored:e.colored,pill:!0,disabled:e.disabled,onClick:e.onClick,icon:e.icon,testId:e.testId})});case d.MENU:return n.jsx("div",{className:u(r.item,r.menu),children:n.jsx(j,{maxHeight:"100%",menu:{trigger:v.COMPONENT,fullHeightTrigger:!0,placement:"bottom-start",component:n.jsx(p,{label:e.label,icon:e.icon,onClick:e.onClick}),sections:e.sections}})});case d.COMPONENT:return n.jsx("div",{className:r.item,children:e.component});default:return null}};try{m.displayName="Element",m.__docgenInfo={description:"",displayName:"Element",props:{element:{defaultValue:null,description:"",name:"element",required:!0,type:{name:"TLinkElement | TButtonElement | TMenuElement | TComponentElement"}}}}}catch{}const N=({title:e,appSwitcher:a,content:i=[],contentRight:t=[],warning:l="",height:o="var(--size-topbar)",fixedPosition:_=!0})=>n.jsxs("div",{children:[l&&n.jsx(f,{warning:l}),n.jsxs("div",{className:u(r.topbar,_?r.fixed:""),style:{height:o},children:[!!a&&n.jsx(y,{icon:a.icon,url:a.url,onClick:a.onClick}),n.jsxs("div",{className:r.left,children:[e&&n.jsx(h,{label:e.label,logo:e.logo,url:e.url,version:e.version,onClick:e.onClick}),i.map((s,c)=>s?n.jsx(m,{element:s},c):null)]}),n.jsx("div",{className:r.right,children:t.map((s,c)=>s?n.jsx(m,{element:s},c):null)})]})]});try{N.displayName="TopBar",N.__docgenInfo={description:"",displayName:"TopBar",props:{title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"ITopBarTitleProps"}},appSwitcher:{defaultValue:null,description:"",name:"appSwitcher",required:!1,type:{name:"ITopBarAppSwitcherProps"}},content:{defaultValue:{value:"[]"},description:"",name:"content",required:!1,type:{name:"TTopBarContent[]"}},contentRight:{defaultValue:{value:"[]"},description:"",name:"contentRight",required:!1,type:{name:"TTopBarContent[]"}},warning:{defaultValue:{value:""},description:"",name:"warning",required:!1,type:{name:"string"}},height:{defaultValue:{value:"var(--size-topbar)"},description:"",name:"height",required:!1,type:{name:"TStringOrNumber"}},fixedPosition:{defaultValue:{value:"true"},description:"",name:"fixedPosition",required:!1,type:{name:"boolean"}}}}}catch{}export{N as T};
1
+ import{j as n}from"./jsx-runtime-FsUICBgo.js";import{c as u}from"./index-VW3EWkuE.js";import{I as x}from"./icon-8EQazuuW.js";import{T as v}from"./common-types-U65vzrrz.js";import{B as T}from"./button-BiJw0fB3.js";import{M as j}from"./actions-0ELEGFed.js";import{r as q}from"./index-RfLt4OUa.js";import{D as V}from"./disabled-context-urNQThQz.js";const C="_topbar_oyr59_11",k="_fixed_oyr59_21",E="_appSwitcher_oyr59_29",I="_title_oyr59_75",M="_logo_oyr59_91",B="_label_oyr59_94",w="_brand_oyr59_99",L="_version_oyr59_104",H="_left_oyr59_111",O="_right_oyr59_112",S="_item_oyr59_126",A="_link_oyr59_127",P="_button_oyr59_138",R="_menu_oyr59_139",D="_active_oyr59_168",U="_alert_oyr59_193",r={topbar:C,fixed:k,appSwitcher:E,title:I,logo:M,label:B,brand:w,version:L,left:H,right:O,item:S,link:A,button:P,menu:R,active:D,alert:U},f=({warning:e})=>n.jsx("div",{className:r.alert,children:e});try{f.displayName="Warning",f.__docgenInfo={description:"",displayName:"Warning",props:{warning:{defaultValue:null,description:"",name:"warning",required:!0,type:{name:"ReactNode"}}}}}catch{}const y=({icon:e,url:a,onClick:i})=>{const t=n.jsx(x,{icon:e});return a?n.jsx("a",{href:a,onClick:i,className:r.appSwitcher,children:t}):n.jsx("div",{onClick:i,className:r.appSwitcher,children:t})};try{y.displayName="AppSwitcher",y.__docgenInfo={description:"",displayName:"AppSwitcher",props:{icon:{defaultValue:null,description:"",name:"icon",required:!1,type:{name:"ReactNode"}},url:{defaultValue:null,description:"",name:"url",required:!1,type:{name:"string"}},onClick:{defaultValue:null,description:"",name:"onClick",required:!1,type:{name:"MouseEventHandler<HTMLDivElement | HTMLAnchorElement>"}}}}}catch{}const h=({label:e,logo:a,url:i,version:t,onClick:l})=>{const o=n.jsxs("div",{className:r.title,children:[a&&n.jsx("div",{className:r.logo,children:a}),e&&n.jsx("span",{className:r.label,children:e}),t&&n.jsx("div",{className:r.version,children:t})]});return n.jsx("div",{className:u(r.item,r.brand),children:i?n.jsx("a",{href:i,onClick:l,children:o}):n.jsx("div",{onClick:l,children:o})})};try{h.displayName="Title",h.__docgenInfo={description:"",displayName:"Title",props:{label:{defaultValue:null,description:"",name:"label",required:!1,type:{name:"string | null"}},logo:{defaultValue:null,description:"",name:"logo",required:!1,type:{name:"ReactNode"}},url:{defaultValue:null,description:"",name:"url",required:!1,type:{name:"string"}},version:{defaultValue:null,description:"",name:"version",required:!1,type:{name:"TStringOrNumber"}},onClick:{defaultValue:null,description:"",name:"onClick",required:!1,type:{name:"MouseEventHandler<HTMLDivElement | HTMLAnchorElement>"}}}}}catch{}var d=(e=>(e.LINK="Link",e.BUTTON="Button",e.MENU="Menu",e.COMPONENT="Component",e))(d||{});const p=({label:e,url:a,icon:i,onClick:t,active:l,disabled:o,testId:_,component:s="a"})=>{const c=q.useContext(V),b=g=>{(o||c)&&g.preventDefault(),t==null||t(g)};return n.jsxs(s,{className:u(r.link,l?r.active:""),href:a||"#",to:a,onClick:b,"aria-disabled":o||c,"data-testid":_,role:t&&!a?"button":void 0,children:[i,n.jsx("span",{className:r.label,children:e})]})};try{p.displayName="Link",p.__docgenInfo={description:"",displayName:"Link",props:{label:{defaultValue:null,description:"",name:"label",required:!1,type:{name:"string | null"}},url:{defaultValue:null,description:"",name:"url",required:!1,type:{name:"string"}},icon:{defaultValue:null,description:"",name:"icon",required:!1,type:{name:"ReactNode"}},onClick:{defaultValue:null,description:"",name:"onClick",required:!1,type:{name:"MouseEventHandler<HTMLAnchorElement>"}},active:{defaultValue:null,description:"",name:"active",required:!1,type:{name:"boolean"}},disabled:{defaultValue:null,description:"",name:"disabled",required:!1,type:{name:"boolean"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}},component:{defaultValue:null,description:"",name:"component",required:!1,type:{name:"ElementType<any>"}}}}}catch{}const m=({element:e})=>{switch(e.type){case d.LINK:return n.jsx("div",{className:r.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 d.BUTTON:return n.jsx("div",{className:u(r.item,r.button),children:n.jsx(T,{label:e.label,colored:e.colored,pill:!0,disabled:e.disabled,onClick:e.onClick,icon:e.icon,testId:e.testId})});case d.MENU:return n.jsx("div",{className:u(r.item,r.menu),children:n.jsx(j,{maxHeight:"100%",menu:{trigger:v.COMPONENT,fullHeightTrigger:!0,placement:"bottom-start",component:n.jsx(p,{label:e.label,icon:e.icon,onClick:e.onClick}),sections:e.sections}})});case d.COMPONENT:return n.jsx("div",{className:r.item,children:e.component});default:return null}};try{m.displayName="Element",m.__docgenInfo={description:"",displayName:"Element",props:{element:{defaultValue:null,description:"",name:"element",required:!0,type:{name:"TLinkElement | TButtonElement | TMenuElement | TComponentElement"}}}}}catch{}const N=({title:e,appSwitcher:a,content:i=[],contentRight:t=[],warning:l="",height:o="var(--size-topbar)",fixedPosition:_=!0})=>n.jsxs("div",{children:[l&&n.jsx(f,{warning:l}),n.jsxs("div",{className:u(r.topbar,_?r.fixed:""),style:{height:o},children:[!!a&&n.jsx(y,{icon:a.icon,url:a.url,onClick:a.onClick}),n.jsxs("div",{className:r.left,children:[e&&n.jsx(h,{label:e.label,logo:e.logo,url:e.url,version:e.version,onClick:e.onClick}),i.map((s,c)=>s?n.jsx(m,{element:s},c):null)]}),n.jsx("div",{className:r.right,children:t.map((s,c)=>s?n.jsx(m,{element:s},c):null)})]})]});try{N.displayName="TopBar",N.__docgenInfo={description:"",displayName:"TopBar",props:{title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"ITopBarTitleProps"}},appSwitcher:{defaultValue:null,description:"",name:"appSwitcher",required:!1,type:{name:"ITopBarAppSwitcherProps"}},content:{defaultValue:{value:"[]"},description:"",name:"content",required:!1,type:{name:"TTopBarContent[]"}},contentRight:{defaultValue:{value:"[]"},description:"",name:"contentRight",required:!1,type:{name:"TTopBarContent[]"}},warning:{defaultValue:{value:""},description:"",name:"warning",required:!1,type:{name:"string"}},height:{defaultValue:{value:"var(--size-topbar)"},description:"",name:"height",required:!1,type:{name:"TStringOrNumber"}},fixedPosition:{defaultValue:{value:"true"},description:"",name:"fixedPosition",required:!1,type:{name:"boolean"}}}}}catch{}export{N as T};
@@ -1,4 +1,4 @@
1
- import{j as e}from"./jsx-runtime-FsUICBgo.js";import{H as I,L as c,S as D,R as l}from"./react-router-dom-EZH1n7K1.js";import{I as O,T as w}from"./common-types-U65vzrrz.js";import{T as p}from"./top-bar--h98E6oo.js";import{P as A}from"./page-9-f6BzS0.js";import{M as P}from"./actions-MkrpU3sl.js";import{B as m}from"./button-MXXjI7Bb.js";import{B as N}from"./badge-23Ty_zBt.js";import{L as v}from"./logo-nHW4TqZt.js";import{s as H}from"./icon-custom-PyWFQsS3.js";import{M as a}from"./types-VB5zD18b.js";import"./index-RfLt4OUa.js";import"./inheritsLoose-8sb_A2v4.js";import"./index-4QtD-hFu.js";import"./tiny-invariant-R4kOKlvx.js";import"./objectWithoutPropertiesLoose-9Q1jwsKS.js";import"./index-VW3EWkuE.js";import"./icon-8EQazuuW.js";import"./tslib.es6-OIsz3r9a.js";import"./disabled-context-urNQThQz.js";import"./lodash-Bmg8FrMx.js";import"./tooltip-pjcB4ZxN.js";import"./index-miLrID2P.js";import"./types-5uVBABF4.js";import"./spinner-R8Il4aRe.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(N,{title:"3",small:!0,margin:"5px",children:e.jsx(m,{icon:O.NOTIFICATION,round:!0,onClick:()=>{}})})},{type:"Component",component:e.jsx(P,{menu:{trigger:w.COMPONENT,fullHeightTrigger:!0,placement:"bottom-end",component:e.jsx(m,{label:"TU",round:!0,onClick:()=>{}}),sections:[{type:a.HEADING,label:"Test User"},{type:a.OPTION,label:"Profile",icon:"user",onClick:()=>{}},{type:a.DIVIDER},{type:a.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=R=>e.jsx(p,{...R}),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 s=()=>e.jsx(I,{children:e.jsxs(A,{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"})]})]})});var u,d,g;n.parameters={...n.parameters,docs:{...(u=n.parameters)==null?void 0:u.docs,source:{originalSource:"args => <TopBar {...args} />",...(g=(d=n.parameters)==null?void 0:d.docs)==null?void 0:g.source}}};var b,h,k;t.parameters={...t.parameters,docs:{...(b=t.parameters)==null?void 0:b.docs,source:{originalSource:"args => <TopBar {...args} />",...(k=(h=t.parameters)==null?void 0:h.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,j;s.parameters={...s.parameters,docs:{...(L=s.parameters)==null?void 0:L.docs,source:{originalSource:`() => {
1
+ import{j as e}from"./jsx-runtime-FsUICBgo.js";import{H as I,L as c,S as D,R as l}from"./react-router-dom-EZH1n7K1.js";import{I as O,T as w}from"./common-types-U65vzrrz.js";import{T as p}from"./top-bar-KGd_PI0n.js";import{P as A}from"./page-9-f6BzS0.js";import{M as P}from"./actions-0ELEGFed.js";import{B as m}from"./button-BiJw0fB3.js";import{B as N}from"./badge-23Ty_zBt.js";import{L as v}from"./logo-nHW4TqZt.js";import{s as H}from"./icon-custom-PyWFQsS3.js";import{M as a}from"./types-VB5zD18b.js";import"./index-RfLt4OUa.js";import"./inheritsLoose-8sb_A2v4.js";import"./index-4QtD-hFu.js";import"./tiny-invariant-R4kOKlvx.js";import"./objectWithoutPropertiesLoose-9Q1jwsKS.js";import"./index-VW3EWkuE.js";import"./icon-8EQazuuW.js";import"./tslib.es6-OIsz3r9a.js";import"./disabled-context-urNQThQz.js";import"./lodash-Bmg8FrMx.js";import"./tooltip-dueTLnwA.js";import"./index-miLrID2P.js";import"./types-5uVBABF4.js";import"./spinner-R8Il4aRe.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(N,{title:"3",small:!0,margin:"5px",children:e.jsx(m,{icon:O.NOTIFICATION,round:!0,onClick:()=>{}})})},{type:"Component",component:e.jsx(P,{menu:{trigger:w.COMPONENT,fullHeightTrigger:!0,placement:"bottom-end",component:e.jsx(m,{label:"TU",round:!0,onClick:()=>{}}),sections:[{type:a.HEADING,label:"Test User"},{type:a.OPTION,label:"Profile",icon:"user",onClick:()=>{}},{type:a.DIVIDER},{type:a.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=R=>e.jsx(p,{...R}),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 s=()=>e.jsx(I,{children:e.jsxs(A,{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"})]})]})});var u,d,g;n.parameters={...n.parameters,docs:{...(u=n.parameters)==null?void 0:u.docs,source:{originalSource:"args => <TopBar {...args} />",...(g=(d=n.parameters)==null?void 0:d.docs)==null?void 0:g.source}}};var b,h,k;t.parameters={...t.parameters,docs:{...(b=t.parameters)==null?void 0:b.docs,source:{originalSource:"args => <TopBar {...args} />",...(k=(h=t.parameters)==null?void 0:h.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,j;s.parameters={...s.parameters,docs:{...(L=s.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 o}from"./jsx-runtime-FsUICBgo.js";import{I as i}from"./common-types-U65vzrrz.js";import{T as l}from"./top-bar--h98E6oo.js";import{B as s}from"./button-MXXjI7Bb.js";import{B as m}from"./badge-23Ty_zBt.js";import{L as p}from"./logo-nHW4TqZt.js";import"./index-RfLt4OUa.js";import"./index-VW3EWkuE.js";import"./icon-8EQazuuW.js";import"./objectWithoutPropertiesLoose-9Q1jwsKS.js";import"./inheritsLoose-8sb_A2v4.js";import"./tslib.es6-OIsz3r9a.js";import"./index-4QtD-hFu.js";import"./disabled-context-urNQThQz.js";import"./actions-MkrpU3sl.js";import"./lodash-Bmg8FrMx.js";import"./tooltip-pjcB4ZxN.js";import"./index-miLrID2P.js";import"./types-VB5zD18b.js";import"./types-5uVBABF4.js";import"./spinner-R8Il4aRe.js";const V={title:"Navigation/TopBar/Test Cases",parameters:{layout:"fullscreen",docs:{story:{inline:!1,iframeHeight:400}}}},t=()=>o.jsx(l,{title:{logo:o.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:o.jsx(m,{title:"3",small:!0,margin:"5px",children:o.jsx(s,{icon:i.NOTIFICATION,round:!0,onClick:()=>{}})})}]});var e,n,r;t.parameters={...t.parameters,docs:{...(e=t.parameters)==null?void 0:e.docs,source:{originalSource:`() => <TopBar title={{
1
+ import{j as o}from"./jsx-runtime-FsUICBgo.js";import{I as i}from"./common-types-U65vzrrz.js";import{T as l}from"./top-bar-KGd_PI0n.js";import{B as s}from"./button-BiJw0fB3.js";import{B as m}from"./badge-23Ty_zBt.js";import{L as p}from"./logo-nHW4TqZt.js";import"./index-RfLt4OUa.js";import"./index-VW3EWkuE.js";import"./icon-8EQazuuW.js";import"./objectWithoutPropertiesLoose-9Q1jwsKS.js";import"./inheritsLoose-8sb_A2v4.js";import"./tslib.es6-OIsz3r9a.js";import"./index-4QtD-hFu.js";import"./disabled-context-urNQThQz.js";import"./actions-0ELEGFed.js";import"./lodash-Bmg8FrMx.js";import"./tooltip-dueTLnwA.js";import"./index-miLrID2P.js";import"./types-VB5zD18b.js";import"./types-5uVBABF4.js";import"./spinner-R8Il4aRe.js";const V={title:"Navigation/TopBar/Test Cases",parameters:{layout:"fullscreen",docs:{story:{inline:!1,iframeHeight:400}}}},t=()=>o.jsx(l,{title:{logo:o.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:o.jsx(m,{title:"3",small:!0,margin:"5px",children:o.jsx(s,{icon:i.NOTIFICATION,round:!0,onClick:()=>{}})})}]});var e,n,r;t.parameters={...t.parameters,docs:{...(e=t.parameters)==null?void 0:e.docs,source:{originalSource:`() => <TopBar title={{
2
2
  logo: <img src={LogoSVG} alt="logo" />,
3
3
  version: 'V1.2.3',
4
4
  onClick: () => {}