@oliasoft-open-source/react-ui-library 4.3.1 → 4.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/404.html +1 -1
- package/dist/assets/{index-pNLRgTGq.js → index-KHBkFPvW.js} +39 -37
- package/dist/assets/{index-1SRgv0eL.css → index-Z_bN_4fb.css} +67 -64
- package/dist/index.d.ts +8 -1
- package/dist/index.html +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/storybook/assets/{Color-6VNJS4EI-74NMK_ph.js → Color-6VNJS4EI-N_ztWf-2.js} +1 -1
- package/dist/storybook/assets/{DocsRenderer-NNNQARDV-3vsXFSwl.js → DocsRenderer-NNNQARDV-n9vPiSxN.js} +1 -1
- package/dist/storybook/assets/{WithTooltip-4HIR6TLV-SoNAVatX.js → WithTooltip-4HIR6TLV-SapwsMVA.js} +1 -1
- package/dist/storybook/assets/{afe.stories-FJFe0iiG.js → afe.stories-4IYdV9SC.js} +1 -1
- package/dist/storybook/assets/{button.stories-3R6aC9Rs.js → button.stories-f6VcbEgi.js} +1 -1
- package/dist/storybook/assets/{buttons-and-links-sDEyZ90k.js → buttons-and-links-tNxsA8cW.js} +1 -1
- package/dist/storybook/assets/{casing-loads.stories-GDGZ_fYs.js → casing-loads.stories-Yonx5Xjy.js} +1 -1
- package/dist/storybook/assets/{cell.stories-S4scZ-t1.js → cell.stories-Ai43vY3p.js} +1 -1
- package/dist/storybook/assets/{chunk-HLWAVYOI-bxc7QupL.js → chunk-HLWAVYOI-vQmBbPB0.js} +1 -1
- package/dist/storybook/assets/{color-q4ze05A-.js → color-vWRh3Qae.js} +1 -1
- package/dist/storybook/assets/{drawer.stories-lRem_fZs.js → drawer.stories-yRZlQHoV.js} +1 -1
- package/dist/storybook/assets/{file-input.stories-JMkh7Ovh.js → file-input.stories-wkU6vhN2.js} +1 -1
- package/dist/storybook/assets/{flex-KzhjL9yc.js → flex-3eLDDUyy.js} +1 -1
- package/dist/storybook/assets/{flex.stories-Ty-qNXaD.js → flex.stories-_VBDAVzN.js} +1 -1
- package/dist/storybook/assets/{footer.stories-LKj4DmGv.js → footer.stories-sVnY5dxB.js} +1 -1
- package/dist/storybook/assets/{form.stories-0Xg8lA47.js → form.stories-vqEAUdaV.js} +1 -1
- package/dist/storybook/assets/{formatter-SWP5E3XI-pvgDL1On.js → formatter-SWP5E3XI-JiERVZcR.js} +1 -1
- package/dist/storybook/assets/{heading.stories-IEBN66V-.js → heading.stories-DmZLaZJb.js} +1 -1
- package/dist/storybook/assets/{icon.stories-D_XEmSGG.js → icon.stories-h0hheUmg.js} +1 -1
- package/dist/storybook/assets/{iframe-Ne5PDyYi.js → iframe-MASZ_taO.js} +2 -2
- package/dist/storybook/assets/{index-OQM9o5C5.js → index-VjG8bBMn.js} +5 -5
- package/dist/storybook/assets/{input-validation-8JO3a7mr.js → input-validation-MPaWGcuk.js} +1 -1
- package/dist/storybook/assets/{inputs-KI8iubZP.js → inputs-Sm5fiswx.js} +1 -1
- package/dist/storybook/assets/{layout-forms-d_qIWKd4.js → layout-forms-VHDoIwjI.js} +1 -1
- package/dist/storybook/assets/{layout-general-ZZbIRlpS.js → layout-general-QHIsmA1E.js} +1 -1
- package/dist/storybook/assets/{list-4R9tCaeF.js → list-AFiJglj_.js} +1 -1
- package/dist/storybook/assets/list-heading-Y8BAUuV6.css +1 -0
- package/dist/storybook/assets/list-heading-aUkU7WVX.js +1 -0
- package/dist/storybook/assets/{list.stories-hekyberH.js → list.stories-W1gjIbW0.js} +1 -1
- package/dist/storybook/assets/{list.stories-data-JaZdq4F4.js → list.stories-data-diC_-6U8.js} +1 -1
- package/dist/storybook/assets/{menu.stories-SmTLDEcl.js → menu.stories-5QTqzc0j.js} +1 -1
- package/dist/storybook/assets/{menu.stories-data-c8X93fYM.js → menu.stories-data-l5rlcD9_.js} +1 -1
- package/dist/storybook/assets/{padding-and-spacing-GE0SFR50.js → padding-and-spacing-8Wu8yRXq.js} +1 -1
- package/dist/storybook/assets/{popover.stories-VEw9p8NV.js → popover.stories-A0yFzv01.js} +1 -1
- package/dist/storybook/assets/{preview-ABcGy_UQ.js → preview-a0xf0jE3.js} +1 -1
- package/dist/storybook/assets/{preview-On8eUdCB.js → preview-gGv3xOED.js} +2 -2
- package/dist/storybook/assets/{projects.stories-1Ks1DnAG.js → projects.stories-th_1Q6JE.js} +1 -1
- package/dist/storybook/assets/{reservoirs.stories-IQ4Alo9P.js → reservoirs.stories-8TqqVc0I.js} +1 -1
- package/dist/storybook/assets/{row.stories-w8GHs2MZ.js → row.stories-bgcrzXdg.js} +1 -1
- package/dist/storybook/assets/{side-bar.stories-ze7SsfEv.js → side-bar.stories-0_pud_bN.js} +1 -1
- package/dist/storybook/assets/{site.stories-tEgKZ4mq.js → site.stories-DZWVugCr.js} +1 -1
- package/dist/storybook/assets/{spacer.stories-T6GlFAJH.js → spacer.stories-bgTBb3VB.js} +1 -1
- package/dist/storybook/assets/{syntaxhighlighter-NMPM6SWI-RxUnwOsq.js → syntaxhighlighter-NMPM6SWI-sxd_zSAO.js} +1 -1
- package/dist/storybook/assets/{table.stories-WO94AjqR.js → table.stories--_S1ugBI.js} +1 -1
- package/dist/storybook/assets/{table.stories-data-_RfPv9jG.js → table.stories-data-I6ced_TS.js} +1 -1
- package/dist/storybook/assets/{textarea-Kk8R9MgX.js → textarea-4DUPP53K.js} +1 -1
- package/dist/storybook/assets/{textarea.stories-2paZI6_B.js → textarea.stories-vQSCjGav.js} +1 -1
- package/dist/storybook/assets/{title.stories-t_2VHVut.js → title.stories-Iv83hSjO.js} +1 -1
- package/dist/storybook/assets/{toaster.stories-gOvrfYS0.js → toaster.stories-pt8KZ3ho.js} +1 -1
- package/dist/storybook/assets/{toggle.stories-9D_QmqBC.js → toggle.stories-HiGs6slZ.js} +1 -1
- package/dist/storybook/assets/{tooltip.test-case.stories-fQh9tpot.js → tooltip.test-case.stories-3XN1XAsX.js} +1 -1
- package/dist/storybook/assets/{tree.stories-BAujNdxx.js → tree.stories-Qj5XiDg8.js} +1 -1
- package/dist/storybook/iframe.html +1 -1
- package/dist/storybook/project.json +1 -1
- package/package.json +1 -1
- package/dist/storybook/assets/list-heading-BTMHiuhI.js +0 -1
- package/dist/storybook/assets/list-heading-Pgb8O1zv.css +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as s}from"./jsx-runtime-FsUICBgo.js";import{r as cr}from"./index-RfLt4OUa.js";import{T as W,I as pr}from"./common-types-U65vzrrz.js";import{M as A}from"./actions-ESle7xCw.js";import{B as R}from"./button-7V8oA22w.js";import{F as dr}from"./flex-
|
|
1
|
+
import{j as s}from"./jsx-runtime-FsUICBgo.js";import{r as cr}from"./index-RfLt4OUa.js";import{T as W,I as pr}from"./common-types-U65vzrrz.js";import{M as A}from"./actions-ESle7xCw.js";import{B as R}from"./button-7V8oA22w.js";import{F as dr}from"./flex-3eLDDUyy.js";import{m as r,a as mr,b as lr,c as gr,d as ur,e as xr,f as br,g as Sr,h as jr,i as Mr}from"./menu.stories-data-l5rlcD9_.js";import"./index-VW3EWkuE.js";import"./lodash-Bmg8FrMx.js";import"./disabled-context-urNQThQz.js";import"./tooltip-HEHiU__l.js";import"./index-miLrID2P.js";import"./icon-y1a2N5SZ.js";import"./inheritsLoose-Y9jOMJLd.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"./spinner-R8Il4aRe.js";const vr={title:"Basic/Menu",component:A,args:{menu:r}},e=a=>s.jsx(A,{...a}),I=e.bind({}),n=e.bind({});n.args={menu:{...r,colored:!0}};const o=e.bind({});o.args={menu:{...r,label:"Delete",colored:"danger"}};const t=e.bind({});t.args={menu:{...r,trigger:W.TEXT}};const i=e.bind({});i.args={menu:{...r,trigger:W.COMPONENT,component:s.jsx(R,{small:!0,colored:!0,round:!0,icon:pr.SETTINGS})}};const c=e.bind({});c.args={menu:mr};const p=e.bind({});p.args={menu:lr};const d=e.bind({});d.args={menu:gr};const m=e.bind({});m.args={menu:ur};const l=e.bind({});l.args={disabled:!0};const g=e.bind({});g.args={tooltip:"Tooltip goes here"};const u=e.bind({});u.args={error:"Error goes here"};const x=e.bind({});x.args={warning:"Warning goes here"};const b=e.bind({});b.args={loading:!0,disabled:!0};const S=e.bind({});S.args={badgeTitle:"3"};const j=e.bind({});j.args={badgeDot:!0};const M=e.bind({});M.args={menu:xr};const T=e.bind({});T.args={menu:br};const C=e.bind({});C.args={closeOnOptionClick:!1};const O=e.bind({});O.args={contextMenu:!0,menu:{...r,trigger:W.TEXT,label:"Right-click me"}};const h=e.bind({});h.args={width:"100%"};const f=e.bind({});f.args={menu:{...r,small:!0}};const D=e.bind({});D.args={menu:Sr};const E=e.bind({});E.args={menu:{...r,sections:s.jsx("div",{children:"Testing"})}};const F=e.bind({});F.args={menu:jr};const k=e.bind({});k.args={menu:Mr};const y=()=>{const[a,B]=cr.useState(!1);return s.jsxs(dr,{gap:!0,children:[s.jsx(A,{menu:r,open:a,setOpen:B}),s.jsx(R,{label:"Open",onClick:()=>B(!0),disabled:a}),s.jsx(R,{label:"Close",onClick:()=>B(!1),disabled:!a})]})};var X,w,J;I.parameters={...I.parameters,docs:{...(X=I.parameters)==null?void 0:X.docs,source:{originalSource:`args => <Menu
|
|
2
2
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
3
3
|
{...args} />`,...(J=(w=I.parameters)==null?void 0:w.docs)==null?void 0:J.source}}};var L,P,v;n.parameters={...n.parameters,docs:{...(L=n.parameters)==null?void 0:L.docs,source:{originalSource:`args => <Menu
|
|
4
4
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
package/dist/storybook/assets/{menu.stories-data-c8X93fYM.js → menu.stories-data-l5rlcD9_.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as n}from"./jsx-runtime-FsUICBgo.js";import{T as o}from"./common-types-U65vzrrz.js";import{F as i}from"./flex-
|
|
1
|
+
import{j as n}from"./jsx-runtime-FsUICBgo.js";import{T as o}from"./common-types-U65vzrrz.js";import{F as i}from"./flex-3eLDDUyy.js";import{B as s}from"./badge-23Ty_zBt.js";import{M as l}from"./types-VB5zD18b.js";const a=async e=>{await console.log("onFileChange",e)},t={label:"Select",trigger:o.DROP_DOWN_BUTTON,sections:[{type:l.HEADING,label:"Heading"},{type:l.OPTION,label:"King",onClick:()=>{}},{type:l.OPTION,label:"Queen",selected:!0,onClick:()=>{}},{type:l.DIVIDER},{type:l.OPTION,label:"Knight",disabled:!0,onClick:()=>{}},{type:l.OPTION,label:"Bishop",onClick:()=>{}}]},y={...t,sections:t.sections.map(e=>e.type===l.OPTION?{...e,onClick:void 0,onChange:a,upload:!0}:e)},b={...t,label:n.jsxs(i,{alignItems:"center",gap:"4px",children:["Select",n.jsx(s,{small:!0,title:"BETA"})]}),sections:Array(3).fill({type:"Menu",trigger:"Text",menu:{trigger:"Text",placement:"right-start",label:n.jsxs(i,{alignItems:"center",gap:"4px",children:["Parent",n.jsx(s,{small:!0,title:"BETA"})]}),title:"Parent",sections:Array(3).fill({type:"Option",label:n.jsxs(i,{alignItems:"center",gap:"4px",children:["Child",n.jsx(s,{small:!0,title:"BETA"})]}),title:"Child"})}})},d={label:"123 m",trigger:"DropDownButton",sections:[{type:"Option",label:"403.5433",description:"ft",inline:!0,onClick:()=>{}},{type:"Option",label:"123",description:"m",inline:!0,onClick:()=>{},selected:!0},{type:"Option",label:"0.123",description:"km",inline:!0,onClick:()=>{}}]},r=[{label:"Delete",icon:"delete",onClick:()=>{}},{label:"Rename",icon:"rename",onClick:()=>{}}],O={...t,sections:t.sections.map(e=>e.type==="Option"?{...e,inline:!0,actions:r}:e)},h={...t,sections:t.sections.map(e=>e.type==="Option"||e.type==="Heading"?{...e,icon:"star",onClick:()=>{}}:e)},C={...t,sections:Array(3).fill({type:"Menu",trigger:"Text",menu:{trigger:"Text",placement:"right-start",label:"Parent",sections:Array(3).fill({type:"Option",label:"Child",onClick:()=>{}})}})},T={...t,sections:Array(100).fill({type:"Option",label:"Item",onClick:()=>{}})},x={label:"No sections",trigger:"DropDownButton",sections:[]},k={label:"Select",trigger:"DropDownButton",showAllButton:{visible:!0,showAllTitle:"Show all...",showLessTitle:"Show less...",additionalSections:[{type:"Divider"},{type:"Option",label:"This item is always shown",onClick:()=>{}}]},sections:Array(8).fill({type:"Option",label:"Item",onClick:()=>{}})};export{y as a,d as b,O as c,h as d,x as e,C as f,b as g,k as h,T as i,t as m};
|
package/dist/storybook/assets/{padding-and-spacing-GE0SFR50.js → padding-and-spacing-8Wu8yRXq.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e}from"./jsx-runtime-FsUICBgo.js";import{M as r}from"./index-
|
|
1
|
+
import{j as e}from"./jsx-runtime-FsUICBgo.js";import{M as r}from"./index-VjG8bBMn.js";import{useMDXComponents as t}from"./index-4YXVTraW.js";import"./index-RfLt4OUa.js";import"./iframe-MASZ_taO.js";import"../sb-preview/runtime.js";import"./index-miLrID2P.js";import"./extends-dGVwEr9R.js";import"./assertThisInitialized-4q6YPdh3.js";import"./inheritsLoose-Y9jOMJLd.js";import"./index-gM75B7fB.js";function i(n){const s=Object.assign({h1:"h1",h2:"h2",p:"p",ul:"ul",li:"li",strong:"strong",code:"code"},t(),n.components);return e.jsxs(e.Fragment,{children:[e.jsx(r,{title:"Padding, Margin & Size"}),`
|
|
2
2
|
`,e.jsx(s.h1,{id:"padding-margin--size",children:"Padding, Margin & Size"}),`
|
|
3
3
|
`,e.jsx(s.h2,{id:"padding--margin",children:"Padding & Margin"}),`
|
|
4
4
|
`,e.jsx(s.p,{children:"There are standard CSS spacing variables for padding and margin."}),`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as r}from"./jsx-runtime-FsUICBgo.js";import{P as C}from"./popover-Y3FpGdUS.js";import{I as S}from"./input-u1He-wWs.js";import{B as i}from"./button-7V8oA22w.js";import{F as P}from"./flex-
|
|
1
|
+
import{j as r}from"./jsx-runtime-FsUICBgo.js";import{P as C}from"./popover-Y3FpGdUS.js";import{I as S}from"./input-u1He-wWs.js";import{B as i}from"./button-7V8oA22w.js";import{F as P}from"./flex-3eLDDUyy.js";import{S as B}from"./select-5jrVNbFb.js";import"./index-RfLt4OUa.js";import"./tooltip-HEHiU__l.js";import"./index-miLrID2P.js";import"./index-VW3EWkuE.js";import"./common-types-U65vzrrz.js";import"./disabled-context-urNQThQz.js";import"./types-5uVBABF4.js";import"./lodash-Bmg8FrMx.js";import"./spinner-R8Il4aRe.js";import"./icon-y1a2N5SZ.js";import"./inheritsLoose-Y9jOMJLd.js";import"./tslib.es6-OIsz3r9a.js";import"./index-4QtD-hFu.js";import"./extends-dGVwEr9R.js";import"./assertThisInitialized-4q6YPdh3.js";import"./memoize-one.esm-hqe5SRxC.js";import"./types-VB5zD18b.js";import"./text-6KQ6ntOV.js";import"./actions-ESle7xCw.js";import"./badge-23Ty_zBt.js";import"./select.input-zP5tW20f.js";const l=[{label:"Option 1",value:"1"},{label:"Option 2",value:"2"}],w=({close:e})=>r.jsxs(P,{gap:"var(--padding-xs)",children:[r.jsx(S,{value:"Value",width:"150px",small:!0}),r.jsx(B,{options:l,value:l[0],width:"auto",small:!0}),r.jsx(i,{colored:!0,label:"Save",onClick:()=>{},small:!0}),r.jsx(i,{label:"Cancel",onClick:e,small:!0})]}),$={title:"Basic/Popover",component:C,args:{overflowContainer:!0,content:r.jsx(w,{}),children:r.jsx(i,{label:"Toggle me"})},decorators:[e=>r.jsx("div",{style:{display:"flex"},children:e()})],parameters:{docs:{source:{excludeDecorators:!0}}}},p=e=>r.jsx(C,{...e}),a=p.bind({}),o=p.bind({});o.args={children:r.jsx(S,{value:"Value",width:"100%"})};const s=p.bind({});s.args={closeOnOutsideClick:!1,showCloseButton:!0};const t=p.bind({});t.args={disabled:!0};var m,c,n;a.parameters={...a.parameters,docs:{...(m=a.parameters)==null?void 0:m.docs,source:{originalSource:"args => <Popover {...args} />",...(n=(c=a.parameters)==null?void 0:c.docs)==null?void 0:n.source}}};var u,d,g;o.parameters={...o.parameters,docs:{...(u=o.parameters)==null?void 0:u.docs,source:{originalSource:"args => <Popover {...args} />",...(g=(d=o.parameters)==null?void 0:d.docs)==null?void 0:g.source}}};var x,v,b;s.parameters={...s.parameters,docs:{...(x=s.parameters)==null?void 0:x.docs,source:{originalSource:"args => <Popover {...args} />",...(b=(v=s.parameters)==null?void 0:v.docs)==null?void 0:b.source}}};var f,j,h;t.parameters={...t.parameters,docs:{...(f=t.parameters)==null?void 0:f.docs,source:{originalSource:"args => <Popover {...args} />",...(h=(j=t.parameters)==null?void 0:j.docs)==null?void 0:h.source}}};const rr=["Default","InputTrigger","CloseButton","Disabled"];export{s as CloseButton,a as Default,t as Disabled,o as InputTrigger,rr as __namedExportsOrder,$ as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as at}from"./jsx-runtime-FsUICBgo.js";import{g as De,c as ct,a as Li,r as he,R as fe}from"./index-RfLt4OUa.js";import{T as Di}from"./toaster-_gH13Vo0.js";import{r as ga,s as ma,t as qr,i as ki,v as ya,e as Hr,w as Mi,x as Bi,c as zr,y as Gi,z as Ui,A as qi,B as Hi,C as va,D as zi,E as Wi,F as Yi,G as Xi,H as Ki,I as Vi,J as Qi,K as Ji,p as ba}from"./index-gM75B7fB.js";import{f as Zi,k as Sa,h as eo,i as to,j as ro,l as no,o as ao,m as ke,p as io,q as oo,r as so,t as cn}from"./index-
|
|
1
|
+
import{j as at}from"./jsx-runtime-FsUICBgo.js";import{g as De,c as ct,a as Li,r as he,R as fe}from"./index-RfLt4OUa.js";import{T as Di}from"./toaster-_gH13Vo0.js";import{r as ga,s as ma,t as qr,i as ki,v as ya,e as Hr,w as Mi,x as Bi,c as zr,y as Gi,z as Ui,A as qi,B as Hi,C as va,D as zi,E as Wi,F as Yi,G as Xi,H as Ki,I as Vi,J as Qi,K as Ji,p as ba}from"./index-gM75B7fB.js";import{f as Zi,k as Sa,h as eo,i as to,j as ro,l as no,o as ao,m as ke,p as io,q as oo,r as so,t as cn}from"./index-VjG8bBMn.js";import{a as lo}from"./isPlainObject-4RuU_w9g.js";import{e as pn}from"./index-cCpkwrS5.js";import"./chunk-HLWAVYOI-vQmBbPB0.js";import"./index-miLrID2P.js";import"./message--yMWfUQv.js";import"./index-VW3EWkuE.js";import"./common-types-U65vzrrz.js";import"./icon-y1a2N5SZ.js";import"./inheritsLoose-Y9jOMJLd.js";import"./tslib.es6-OIsz3r9a.js";import"./index-4QtD-hFu.js";import"./disabled-context-urNQThQz.js";import"./iframe-MASZ_taO.js";import"../sb-preview/runtime.js";import"./extends-dGVwEr9R.js";import"./assertThisInitialized-4q6YPdh3.js";import"./react-16-hgR7FrAp.js";var hn="DARK_MODE";const{global:uo}=__STORYBOOK_MODULE_GLOBAL__;__STORYBOOK_MODULE_CLIENT_LOGGER__;function Te(){return Te=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Te.apply(this,arguments)}function fo(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Qe(t,e){return Qe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Qe(t,e)}function co(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Qe(t,e)}function yr(t){return yr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},yr(t)}function po(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function ho(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function pt(t,e,r){return ho()?pt=Reflect.construct.bind():pt=function(n,s,o){var l=[null];l.push.apply(l,s);var a=Function.bind.apply(n,l),i=new a;return o&&Qe(i,o.prototype),i},pt.apply(null,arguments)}function vr(t){var e=typeof Map=="function"?new Map:void 0;return vr=function(r){if(r===null||!po(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(r))return e.get(r);e.set(r,n)}function n(){return pt(r,arguments,yr(this).constructor)}return n.prototype=Object.create(r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Qe(n,r)},vr(t)}var go={1:`Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }).
|
|
2
2
|
|
|
3
3
|
`,2:`Passed invalid arguments to hsla, please pass multiple numbers e.g. hsla(360, 0.75, 0.4, 0.7) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75, alpha: 0.7 }).
|
|
4
4
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{_ as e}from"./iframe-
|
|
1
|
+
import{_ as e}from"./iframe-MASZ_taO.js";import"../sb-preview/runtime.js";var a={docs:{renderer:async()=>{let{DocsRenderer:r}=await e(()=>import("./DocsRenderer-NNNQARDV-n9vPiSxN.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]),import.meta.url);return new r}}};export{a as parameters};
|
|
2
2
|
function __vite__mapDeps(indexes) {
|
|
3
3
|
if (!__vite__mapDeps.viteFileDeps) {
|
|
4
|
-
__vite__mapDeps.viteFileDeps = ["./DocsRenderer-NNNQARDV-
|
|
4
|
+
__vite__mapDeps.viteFileDeps = ["./DocsRenderer-NNNQARDV-n9vPiSxN.js","./chunk-HLWAVYOI-vQmBbPB0.js","./iframe-MASZ_taO.js","./index-RfLt4OUa.js","./react-16-hgR7FrAp.js","./index-miLrID2P.js","./index-VjG8bBMn.js","./extends-dGVwEr9R.js","./assertThisInitialized-4q6YPdh3.js","./inheritsLoose-Y9jOMJLd.js","./index-gM75B7fB.js"]
|
|
5
5
|
}
|
|
6
6
|
return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
|
|
7
7
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e}from"./jsx-runtime-FsUICBgo.js";import"./index-RfLt4OUa.js";import{T as n}from"./top-bar-C1c_2fzK.js";import{L as r}from"./list-
|
|
1
|
+
import{j as e}from"./jsx-runtime-FsUICBgo.js";import"./index-RfLt4OUa.js";import{T as n}from"./top-bar-C1c_2fzK.js";import{L as r}from"./list-AFiJglj_.js";import{P as p}from"./page-9-f6BzS0.js";import{R as c,C as o}from"./row-vFUhHoz5.js";import{T as d}from"./tabs-fcLbHC1n.js";import{S as u}from"./spacer-Yji9g2AW.js";import"./index-VW3EWkuE.js";import"./icon-y1a2N5SZ.js";import"./inheritsLoose-Y9jOMJLd.js";import"./tslib.es6-OIsz3r9a.js";import"./index-4QtD-hFu.js";import"./disabled-context-urNQThQz.js";import"./common-types-U65vzrrz.js";import"./button-7V8oA22w.js";import"./spinner-R8Il4aRe.js";import"./tooltip-HEHiU__l.js";import"./index-miLrID2P.js";import"./actions-ESle7xCw.js";import"./lodash-Bmg8FrMx.js";import"./types-VB5zD18b.js";import"./types-5uVBABF4.js";import"./badge-23Ty_zBt.js";import"./index.es-JXn3JM7k.js";import"./extends-dGVwEr9R.js";import"./redux-F5dueAP3.js";import"./objectSpread2-93s0nBry.js";import"./memoize-one.esm-hqe5SRxC.js";import"./card-0r8RRVk-.js";import"./list-heading-aUkU7WVX.js";import"./heading-Bk0bpNfe.js";import"./help-icon--rUDxLUD.js";import"./loader-TGOJBZQG.js";import"./styled-components.browser.esm-qIipjd6c.js";import"./select.input-zP5tW20f.js";const t=[{label:"Browse",value:"Browse"},{label:"Recent",value:"Recent"},{label:"My Projects",value:"My Projects"}],s=[{id:1,name:"Lorem",active:!0},{id:2,name:"Ipsum"},{id:3,name:"Dolor"},{id:4,name:"Long name goes here lorem ipsum"},{id:5,name:"Lorem"},{id:6,name:"Ipsum"},{id:7,name:"Dolor"},{id:8,name:"Long name goes here lorem ipsum"},{id:9,name:"Lorem"},{id:10,name:"Ipsum"},{id:11,name:"Dolor"},{id:12,name:"Long name goes here lorem ipsum"},{id:13,name:"Lorem"},{id:14,name:"Ipsum"},{id:15,name:"Dolor"},{id:16,name:"Long name goes here lorem ipsum"}],X={title:"Layout/Layout Examples",parameters:{layout:"fullscreen",docs:{story:{inline:!1,iframeHeight:400}}}},l=()=>e.jsxs(e.Fragment,{children:[e.jsx(n,{}),e.jsxs(p,{padding:!1,left:0,scroll:!1,children:[e.jsx(u,{}),e.jsx(d,{margin:!1,padding:!0,options:t,value:t[0]}),e.jsxs(c,{spacing:0,flex:!0,height:"100%",children:[e.jsx(o,{borderRight:!0,scroll:!0,showScrollbar:!1,children:e.jsx(r,{list:{name:"Country",items:s}})}),e.jsx(o,{borderRight:!0,scroll:!0,showScrollbar:!1,children:e.jsx(r,{list:{name:"Field",items:s}})}),e.jsx(o,{borderRight:!0,scroll:!0,showScrollbar:!1,children:e.jsx(r,{list:{name:"Site",items:s}})}),e.jsx(o,{borderRight:!0,scroll:!0,showScrollbar:!1,children:e.jsx(r,{list:{name:"Well",items:s}})}),e.jsx(o,{borderRight:!0,scroll:!0,showScrollbar:!1,children:e.jsx(r,{list:{name:"Wellbore",items:s}})}),e.jsx(o,{scroll:!0,showScrollbar:!1,children:e.jsx(r,{list:{name:"Design",items:s}})})]})]})]});var i,m,a;l.parameters={...l.parameters,docs:{...(i=l.parameters)==null?void 0:i.docs,source:{originalSource:`() => {
|
|
2
2
|
return <>
|
|
3
3
|
<TopBar />
|
|
4
4
|
<Page padding={false} left={0} scroll={false}>
|
package/dist/storybook/assets/{reservoirs.stories-IQ4Alo9P.js → reservoirs.stories-8TqqVc0I.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e}from"./jsx-runtime-FsUICBgo.js";import{r as b}from"./index-RfLt4OUa.js";import{I as j}from"./common-types-U65vzrrz.js";import{T as w}from"./top-bar-C1c_2fzK.js";import{S as L}from"./side-bar-Fjr2t9MT.js";import{H as t}from"./heading-Bk0bpNfe.js";import{B as m}from"./button-7V8oA22w.js";import{D as v}from"./drawer-WuErQ5Z8.js";import{L as C}from"./list-
|
|
1
|
+
import{j as e}from"./jsx-runtime-FsUICBgo.js";import{r as b}from"./index-RfLt4OUa.js";import{I as j}from"./common-types-U65vzrrz.js";import{T as w}from"./top-bar-C1c_2fzK.js";import{S as L}from"./side-bar-Fjr2t9MT.js";import{H as t}from"./heading-Bk0bpNfe.js";import{B as m}from"./button-7V8oA22w.js";import{D as v}from"./drawer-WuErQ5Z8.js";import{L as C}from"./list-AFiJglj_.js";import{F as l}from"./field-eknsj_Ll.js";import{I as i}from"./input-u1He-wWs.js";import{C as p}from"./check-box-s9CvqRSD.js";import{R as h}from"./radio-button-jHcwHUA4.js";import{C as d}from"./card-0r8RRVk-.js";import{F}from"./form-row-bwoDTUga.js";import{P as g}from"./page-9-f6BzS0.js";import{R as a,C as r}from"./row-vFUhHoz5.js";import{S as R}from"./select-5jrVNbFb.js";import{S as f}from"./spacer-Yji9g2AW.js";import"./index-VW3EWkuE.js";import"./icon-y1a2N5SZ.js";import"./inheritsLoose-Y9jOMJLd.js";import"./tslib.es6-OIsz3r9a.js";import"./index-4QtD-hFu.js";import"./disabled-context-urNQThQz.js";import"./actions-ESle7xCw.js";import"./lodash-Bmg8FrMx.js";import"./tooltip-HEHiU__l.js";import"./index-miLrID2P.js";import"./types-VB5zD18b.js";import"./types-5uVBABF4.js";import"./badge-23Ty_zBt.js";import"./index-ugi_ZH6T.js";import"./help-icon--rUDxLUD.js";import"./spinner-R8Il4aRe.js";import"./index.es-JXn3JM7k.js";import"./extends-dGVwEr9R.js";import"./redux-F5dueAP3.js";import"./objectSpread2-93s0nBry.js";import"./memoize-one.esm-hqe5SRxC.js";import"./list-heading-aUkU7WVX.js";import"./loader-TGOJBZQG.js";import"./label-0_Qf6I8t.js";import"./select.input-zP5tW20f.js";import"./styled-components.browser.esm-qIipjd6c.js";import"./assertThisInitialized-4q6YPdh3.js";import"./text-6KQ6ntOV.js";const k=({width:o,height:n})=>e.jsx("div",{style:{background:"#ddd",width:o,height:n}}),ve={title:"Layout/Layout Examples",parameters:{layout:"fullscreen",docs:{story:{inline:!1,iframeHeight:400}}}},s=()=>{const[o,n]=b.useState(!0);return e.jsxs(e.Fragment,{children:[e.jsx(w,{}),e.jsx(L,{options:{title:"",sections:[]}}),e.jsx(g,{padding:!1,scroll:!1,children:e.jsxs(a,{spacing:0,height:"100%",children:[e.jsx(v,{button:e.jsx(m,{onClick:()=>n(!o),round:!0,icon:j.CHEVRON_LEFT}),open:o,width:300,closedWidth:"var(--size-sidebar)",children:e.jsx(C,{drawer:!0,narrow:!o,list:{name:"Reservoirs",items:[{id:1,name:"Lorem",active:!0},{id:2,name:"Ipsum"}]}})}),e.jsxs(r,{scroll:!0,padding:!0,borderLeft:!0,children:[e.jsxs(a,{children:[e.jsxs(r,{children:[e.jsx(t,{top:!0,children:"Reservoir name here"}),e.jsxs(F,{children:[e.jsx(l,{label:"Name",children:e.jsx(i,{value:"Reservoir name here",width:"200px"})}),e.jsx(l,{label:"Lorem",children:e.jsx(h,{name:"example",options:[{label:"Aardvarks",value:"termites"},{label:"Monkeys",value:"bananas"}],value:{label:"Monkeys",value:"bananas"},inline:!0})}),e.jsx(l,{label:"Ipsum",children:e.jsx(R,{name:"example",options:[{label:"Monkeys",value:"bananas"},{label:"Possums",value:"slugs"}],value:{label:"Monkeys",value:"bananas"},native:!0})}),e.jsx(l,{children:e.jsx(p,{label:"Dolor"})})]})]}),e.jsx(r,{flex:!1,children:e.jsx(m,{onClick:()=>{},round:!0,icon:"question"})})]}),e.jsxs(a,{children:[e.jsx(r,{width:"50%",children:e.jsx(d,{heading:e.jsx(t,{onClickHelp:()=>console.log("help!"),children:"Reservoir Zone"}),children:e.jsxs(a,{children:[e.jsxs(r,{width:"50%",children:[e.jsxs(l,{label:"Label",helpText:"Lorem ipsum",children:[e.jsx(h,{options:[{label:"Aardvarks",value:"termites"},{label:"Monkeys",value:"bananas"}],value:{label:"Monkeys",value:"bananas"},inline:!0}),e.jsx(i,{width:"100%"})]}),e.jsxs(l,{label:"Label",helpText:"Lorem ipsum",children:[e.jsx(p,{label:"Lorem ipsum"}),e.jsx(i,{width:"100%",disabled:!0})]}),e.jsx(l,{label:"Label",helpText:"Lorem ipsum",children:e.jsx(i,{width:"100%"})}),e.jsx(l,{label:"Label",helpText:"Lorem ipsum",children:e.jsx(i,{width:"100%"})})]}),e.jsxs(r,{width:"50%",children:[e.jsx(l,{label:"Label",helpText:"Lorem ipsum",children:e.jsx(i,{width:"100%"})}),e.jsx(l,{label:"Label",helpText:"Lorem ipsum",children:e.jsx(i,{width:"100%"})}),e.jsx(l,{label:"Label",helpText:"Lorem ipsum",children:e.jsx(i,{width:"100%"})}),e.jsx(l,{label:"Label",helpText:"Lorem ipsum",children:e.jsx(i,{width:"100%"})})]})]})})}),e.jsxs(r,{width:"50%",children:[e.jsx(d,{heading:e.jsx(t,{children:"Reservoir Size"}),children:e.jsxs(a,{children:[e.jsxs(r,{width:"160px",children:[e.jsx(l,{label:"Length",children:e.jsx(i,{width:"100%"})}),e.jsx(l,{label:"Width",children:e.jsx(i,{width:"100%"})})]}),e.jsx(r,{children:e.jsx(k,{width:"100%",height:"100%"})})]})}),e.jsx(f,{}),e.jsx(d,{heading:e.jsx(t,{children:"Reservoir Properties"}),children:e.jsxs(a,{children:[e.jsx(r,{children:e.jsx(l,{label:"Label",children:e.jsx(i,{width:"100%"})})}),e.jsx(r,{children:e.jsx(l,{label:"Label",children:e.jsx(i,{width:"100%"})})}),e.jsx(r,{children:e.jsx(l,{label:"Label",children:e.jsx(i,{width:"100%"})})})]})})]})]})]})]})})]})};var u,x,c;s.parameters={...s.parameters,docs:{...(u=s.parameters)==null?void 0:u.docs,source:{originalSource:`() => {
|
|
2
2
|
const [open, setOpen] = useState(true);
|
|
3
3
|
return <>
|
|
4
4
|
<TopBar />
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as o}from"./jsx-runtime-FsUICBgo.js";import{r as R}from"./index-RfLt4OUa.js";import{T as c}from"./table-GUPoXZvd.js";import{T as V}from"./text-6KQ6ntOV.js";import{t as g,i as W,q as B}from"./table.stories-data-
|
|
1
|
+
import{j as o}from"./jsx-runtime-FsUICBgo.js";import{r as R}from"./index-RfLt4OUa.js";import{T as c}from"./table-GUPoXZvd.js";import{T as V}from"./text-6KQ6ntOV.js";import{t as g,i as W,q as B}from"./table.stories-data-I6ced_TS.js";import"./index-VW3EWkuE.js";import"./index.es-JXn3JM7k.js";import"./inheritsLoose-Y9jOMJLd.js";import"./extends-dGVwEr9R.js";import"./redux-F5dueAP3.js";import"./objectSpread2-93s0nBry.js";import"./index-miLrID2P.js";import"./memoize-one.esm-hqe5SRxC.js";import"./icon-y1a2N5SZ.js";import"./tslib.es6-OIsz3r9a.js";import"./index-4QtD-hFu.js";import"./disabled-context-urNQThQz.js";import"./lodash-Bmg8FrMx.js";import"./actions-ESle7xCw.js";import"./common-types-U65vzrrz.js";import"./button-7V8oA22w.js";import"./spinner-R8Il4aRe.js";import"./tooltip-HEHiU__l.js";import"./types-VB5zD18b.js";import"./types-5uVBABF4.js";import"./badge-23Ty_zBt.js";import"./heading-Bk0bpNfe.js";import"./help-icon--rUDxLUD.js";import"./pagination-xSK12Mw6.js";import"./select-5jrVNbFb.js";import"./assertThisInitialized-4q6YPdh3.js";import"./select.input-zP5tW20f.js";import"./input-u1He-wWs.js";import"./input-group-R8LoqKRn.js";import"./input-group-addon-BHVsW9mL.js";import"./number-input-SvjJIGsW.js";import"./index-IQMsp8Ab.js";import"./index-cCpkwrS5.js";import"./check-box-s9CvqRSD.js";import"./slider-nl2rJ9LF.js";import"./index-ugi_ZH6T.js";import"./popover-Y3FpGdUS.js";import"./flex-3eLDDUyy.js";const Le={title:"Basic/Table/Row",component:c,args:{table:{...g}}},b=n=>o.jsx(c,{...n}),i=b.bind({});i.args={table:W};const p=b.bind({});p.args={table:B};const t=b.bind({});t.args={table:{...g,striped:!1}};t.parameters={docs:{description:{story:"`striped: false` removes tinted background on alternative rows."}}};const m=()=>{const[n,e]=R.useState(null),a=r=>e(n===r?null:r);return o.jsx(c,{table:{...g,striped:!1,rows:g.rows.map((r,d)=>({...r,onRowClick:()=>a(d),expandedContent:{content:n===d?o.jsx("div",{children:"Example expanded content"}):null}}))}})},w=()=>{const n={draggable:!0,headers:[{cells:[{value:"Name"},{value:"Weight (kg)"},{value:"Energy (kcal / 100g)"},{value:"Origin"}]}],rows:[{noDrag:!0,cells:[{value:"Undraggable"},{value:100},{value:361},{value:"Vietnam"}]},{cells:[{value:"Buckwheat"},{value:50},{value:358},{value:"Poland"}]},{cells:[{value:"Couscous"},{value:10},{value:368},{value:"France"}]}]},e=(s,u,l)=>{const x=[...s];return s[l].noDrag?s:(x.splice(l,0,x.splice(u,1)[0]),x)},[a,r]=R.useState(n.rows),d=s=>{const{to:u,from:l}=s;e(a,l,u),r(e(a,l,u))};return o.jsx(c,{table:{...n,rows:a},onListReorder:d})},v=()=>{const[n,e]=R.useState("Hover any row!"),a=[1,2,3,4,5].map(r=>({cells:[{value:`Row ${r}`},{value:`${r**2}`}],onRowMouseEnter:()=>e(`Hovering row ${r}`),onRowMouseLeave:()=>e("Not hovering any row...")}));return o.jsxs(o.Fragment,{children:[o.jsx(V,{children:n}),o.jsx(c,{table:{fixedWidth:"100%",headers:[{cells:[{value:"Description"},{value:"Value"}],onRowMouseEnter:()=>e("Hovering header row"),onRowMouseLeave:()=>e("Not hovering any row...")}],rows:a}})]})};var y,D,E;i.parameters={...i.parameters,docs:{...(y=i.parameters)==null?void 0:y.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 a}from"./jsx-runtime-FsUICBgo.js";import{I as t}from"./common-types-U65vzrrz.js";import{S as m}from"./side-bar-Fjr2t9MT.js";import{F as g}from"./flex-
|
|
1
|
+
import{j as a}from"./jsx-runtime-FsUICBgo.js";import{I as t}from"./common-types-U65vzrrz.js";import{S as m}from"./side-bar-Fjr2t9MT.js";import{F as g}from"./flex-3eLDDUyy.js";import{B as u}from"./badge-23Ty_zBt.js";import{s as S}from"./icon-custom-PyWFQsS3.js";import"./index-RfLt4OUa.js";import"./index-VW3EWkuE.js";import"./index-ugi_ZH6T.js";import"./drawer-WuErQ5Z8.js";import"./lodash-Bmg8FrMx.js";import"./index-4QtD-hFu.js";import"./index-miLrID2P.js";import"./icon-y1a2N5SZ.js";import"./inheritsLoose-Y9jOMJLd.js";import"./tslib.es6-OIsz3r9a.js";import"./disabled-context-urNQThQz.js";import"./button-7V8oA22w.js";import"./spinner-R8Il4aRe.js";import"./tooltip-HEHiU__l.js";const h=[{heading:"First Heading",items:[{label:"Section A",value:"/path/to/something",onClick:()=>{},icon:S},{label:a.jsxs(g,{alignItems:"center",gap:"var(--padding-xxs)",children:["Section B",a.jsx(u,{small:!0,title:"BETA"})]}),value:"/path/to/something",onClick:()=>{},icon:t.HELP,isActive:!0},{label:"Section C",value:"/path/to/something",onClick:()=>{},icon:t.EDIT},{label:"Experimental Section",value:"/path/to/something",onClick:()=>{},icon:t.LIBRARY,isExperimental:!0}]},{heading:"Second Heading",items:[{label:"Section 1",value:"/path/to/something",onClick:()=>{},icon:t.SETTINGS},{label:"Section 2",value:"/path/to/something",onClick:()=>{},icon:t.STAR},{label:"Invalid Section",value:"/path/to/something",onClick:()=>{},icon:t.NOTIFICATION,invalid:!0}]}],L={title:"Navigation/SideBar",component:m,parameters:{layout:"fullscreen",docs:{story:{inline:!1,iframeHeight:400}}},args:{options:{title:"Title",sections:h},startOpen:!1},argTypes:{top:{control:{type:"text"}},startOpen:{control:{type:"boolean"}}}},c=d=>a.jsx(m,{...d}),o=c.bind({}),e=c.bind({});e.args={startOpen:!0};var i,r,s;o.parameters={...o.parameters,docs:{...(i=o.parameters)==null?void 0:i.docs,source:{originalSource:"args => <SideBar {...args} />",...(s=(r=o.parameters)==null?void 0:r.docs)==null?void 0:s.source}}};var n,l,p;e.parameters={...e.parameters,docs:{...(n=e.parameters)==null?void 0:n.docs,source:{originalSource:"args => <SideBar {...args} />",...(p=(l=e.parameters)==null?void 0:l.docs)==null?void 0:p.source}}};const G=["Default","StartOpen"];export{o as Default,e as StartOpen,G as __namedExportsOrder,L as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e}from"./jsx-runtime-FsUICBgo.js";import{r as x}from"./index-RfLt4OUa.js";import{I as j}from"./common-types-U65vzrrz.js";import{T as g}from"./top-bar-C1c_2fzK.js";import{S as w}from"./side-bar-Fjr2t9MT.js";import{H as t}from"./heading-Bk0bpNfe.js";import{B as L}from"./button-7V8oA22w.js";import{D as v}from"./drawer-WuErQ5Z8.js";import{L as d}from"./list-
|
|
1
|
+
import{j as e}from"./jsx-runtime-FsUICBgo.js";import{r as x}from"./index-RfLt4OUa.js";import{I as j}from"./common-types-U65vzrrz.js";import{T as g}from"./top-bar-C1c_2fzK.js";import{S as w}from"./side-bar-Fjr2t9MT.js";import{H as t}from"./heading-Bk0bpNfe.js";import{B as L}from"./button-7V8oA22w.js";import{D as v}from"./drawer-WuErQ5Z8.js";import{L as d}from"./list-AFiJglj_.js";import{F as l}from"./field-eknsj_Ll.js";import{I as a}from"./input-u1He-wWs.js";import{C as m}from"./check-box-s9CvqRSD.js";import{P as f}from"./page-9-f6BzS0.js";import{R as o,C as i}from"./row-vFUhHoz5.js";import{A as u}from"./accordion-6_27SROY.js";import{S as s}from"./spacer-Yji9g2AW.js";import{T as F}from"./tabs-fcLbHC1n.js";import"./index-VW3EWkuE.js";import"./icon-y1a2N5SZ.js";import"./inheritsLoose-Y9jOMJLd.js";import"./tslib.es6-OIsz3r9a.js";import"./index-4QtD-hFu.js";import"./disabled-context-urNQThQz.js";import"./actions-ESle7xCw.js";import"./lodash-Bmg8FrMx.js";import"./tooltip-HEHiU__l.js";import"./index-miLrID2P.js";import"./types-VB5zD18b.js";import"./types-5uVBABF4.js";import"./badge-23Ty_zBt.js";import"./index-ugi_ZH6T.js";import"./help-icon--rUDxLUD.js";import"./spinner-R8Il4aRe.js";import"./index.es-JXn3JM7k.js";import"./extends-dGVwEr9R.js";import"./redux-F5dueAP3.js";import"./objectSpread2-93s0nBry.js";import"./memoize-one.esm-hqe5SRxC.js";import"./card-0r8RRVk-.js";import"./list-heading-aUkU7WVX.js";import"./loader-TGOJBZQG.js";import"./label-0_Qf6I8t.js";import"./styled-components.browser.esm-qIipjd6c.js";import"./select.input-zP5tW20f.js";const C=[{label:"Import",value:"import",right:!0},{label:"Settings",value:"settings",right:!0}],S=()=>e.jsx("div",{style:{background:"#AAD3DF",borderLeft:"1px solid #8AB3BF",display:"flex",alignItems:"center",justifyContent:"center",color:"white",height:"100%"},children:"MAP"}),xe={title:"Layout/Layout Examples",parameters:{layout:"fullscreen",docs:{story:{inline:!1,iframeHeight:400}}}},n=()=>{const[r,b]=x.useState(!0);return e.jsxs(e.Fragment,{children:[e.jsx(g,{}),e.jsx(w,{options:{title:"",sections:[]},width:"250px"}),e.jsx(f,{padding:!1,scroll:!1,children:e.jsxs(o,{spacing:0,flex:!0,children:[e.jsxs(v,{button:e.jsx(L,{onClick:()=>b(!r),round:!0,icon:j.CHEVRON_LEFT}),open:r,width:300,closedWidth:"var(--size-sidebar)",children:[e.jsx(d,{drawer:!0,narrow:!r,list:{name:"Sites",items:[{id:1,name:"Main Site",type:"Heading"},{id:2,name:"Site name here",active:!0,label:{value:1,color:"#69779b"}},{id:3,name:"Locations",type:"Heading"},{id:4,name:"Ipsum",label:{value:2,color:"#69779b"}},{id:5,name:"Dolor",label:{value:3,color:"#69779b"}}]}}),e.jsx(d,{drawer:!0,narrow:!r,list:{name:"Wells",items:[{id:1,name:"Main Wellbore",type:"Heading"},{id:2,name:"Lorem",label:{value:1,color:"#77699b"}}]}}),e.jsx(d,{drawer:!0,narrow:!r,list:{name:"Targets",items:[{id:1,name:"Lorem",label:{value:1,color:"#9b6977"}}]}})]}),e.jsxs(i,{borderLeft:!0,flexbox:!0,children:[e.jsx(s,{}),e.jsx(F,{padding:!0,margin:!1,options:C}),e.jsxs(o,{spacing:0,flex:!0,children:[e.jsxs(i,{scroll:!0,padding:!0,width:550,children:[e.jsx(t,{top:!0,children:"Site name here"}),e.jsx(l,{label:"Name",children:e.jsx(a,{value:"Site name here",width:"200px"})}),e.jsxs(u,{heading:e.jsx(t,{children:"Coordinate Reference System"}),managed:!0,children:[e.jsx(l,{label:"Label",labelLeft:!0,labelWidth:"50px",children:e.jsx(a,{value:"Value",width:"100%"})}),e.jsx(l,{label:"Label",labelLeft:!0,labelWidth:"50px",children:e.jsx(a,{value:"Value",width:"100%"})}),e.jsx(l,{label:"Label",labelLeft:!0,labelWidth:"50px",children:e.jsx(a,{value:"Value",width:"100%"})}),e.jsx(l,{children:e.jsx(m,{label:"Dolor"})})]}),e.jsx(s,{}),e.jsx(t,{marginBottom:"var(--padding)",children:"Location"}),e.jsxs(o,{children:[e.jsx(i,{children:e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})})}),e.jsx(i,{children:e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})})}),e.jsx(i,{children:e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})})}),e.jsx(i,{children:e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})})})]}),e.jsx(s,{}),e.jsx(t,{marginBottom:"var(--padding)",children:"Model"}),e.jsxs(o,{children:[e.jsx(i,{children:e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})})}),e.jsx(i,{children:e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})})})]}),e.jsxs(u,{heading:e.jsx(t,{children:"Settings"}),managed:!0,children:[e.jsx(l,{children:e.jsx(m,{label:"Dolor"})}),e.jsxs(o,{children:[e.jsxs(i,{children:[e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})}),e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})})]}),e.jsxs(i,{children:[e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})}),e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})})]})]})]})]}),e.jsx(i,{children:e.jsx(S,{})})]})]})]})})]})};var p,c,h;n.parameters={...n.parameters,docs:{...(p=n.parameters)==null?void 0:p.docs,source:{originalSource:`() => {
|
|
2
2
|
const [open, setOpen] = useState(true);
|
|
3
3
|
return <>
|
|
4
4
|
<TopBar />
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as r}from"./jsx-runtime-FsUICBgo.js";import{S as h}from"./spacer-Yji9g2AW.js";import{F as j}from"./flex-
|
|
1
|
+
import{j as r}from"./jsx-runtime-FsUICBgo.js";import{S as h}from"./spacer-Yji9g2AW.js";import{F as j}from"./flex-3eLDDUyy.js";import{B as s}from"./button-7V8oA22w.js";import"./index-RfLt4OUa.js";import"./index-VW3EWkuE.js";import"./common-types-U65vzrrz.js";import"./disabled-context-urNQThQz.js";import"./spinner-R8Il4aRe.js";import"./icon-y1a2N5SZ.js";import"./inheritsLoose-Y9jOMJLd.js";import"./tslib.es6-OIsz3r9a.js";import"./index-4QtD-hFu.js";import"./tooltip-HEHiU__l.js";import"./index-miLrID2P.js";const W={title:"Layout/Spacer",component:h,argTypes:{width:{control:"text"},height:{control:"text"}}},p=t=>r.jsx(h,{...t}),a=p.bind({});a.decorators=[t=>r.jsxs(r.Fragment,{children:[r.jsx(s,{label:"Button"}),t(),r.jsx(s,{label:"Button"})]})];const e=p.bind({});e.args={height:"var(--padding-xxs)"};e.decorators=[t=>r.jsxs(r.Fragment,{children:[r.jsx(s,{label:"Button"}),t(),r.jsx(s,{label:"Button"})]})];const o=p.bind({});o.args={width:"var(--padding)"};o.decorators=[t=>r.jsxs(j,{children:[r.jsx(s,{label:"Button"}),t(),r.jsx(s,{label:"Button"})]})];var c,i,m;a.parameters={...a.parameters,docs:{...(c=a.parameters)==null?void 0:c.docs,source:{originalSource:"(args: ISpacerProps) => <Spacer {...args} />",...(m=(i=a.parameters)==null?void 0:i.docs)==null?void 0:m.source}}};var n,d,l;e.parameters={...e.parameters,docs:{...(n=e.parameters)==null?void 0:n.docs,source:{originalSource:"(args: ISpacerProps) => <Spacer {...args} />",...(l=(d=e.parameters)==null?void 0:d.docs)==null?void 0:l.source}}};var u,g,x;o.parameters={...o.parameters,docs:{...(u=o.parameters)==null?void 0:u.docs,source:{originalSource:"(args: ISpacerProps) => <Spacer {...args} />",...(x=(g=o.parameters)==null?void 0:g.docs)==null?void 0:x.source}}};const L=["Default","Height","Width"];export{a as Default,e as Height,o as Width,L as __namedExportsOrder,W as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{S as l,c as n,s as d}from"./index-
|
|
1
|
+
import{S as l,c as n,s as d}from"./index-VjG8bBMn.js";import"./iframe-MASZ_taO.js";import"../sb-preview/runtime.js";import"./index-RfLt4OUa.js";import"./index-miLrID2P.js";import"./extends-dGVwEr9R.js";import"./assertThisInitialized-4q6YPdh3.js";import"./inheritsLoose-Y9jOMJLd.js";import"./index-gM75B7fB.js";export{l as SyntaxHighlighter,n as createCopyToClipboardFunction,d as default};
|
|
@@ -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 K}from"./immer.esm-bD7SSJ7T.js";import{l as oe}from"./lodash-Bmg8FrMx.js";import{G as se}from"./grid-u1mZpaML.js";import{T as V}from"./text-6KQ6ntOV.js";import{T as A}from"./table-GUPoXZvd.js";import{C as sn}from"./card-0r8RRVk-.js";import{I as ae}from"./input-u1He-wWs.js";import{F as re}from"./field-eknsj_Ll.js";import{H as ln}from"./heading-Bk0bpNfe.js";import{t as ne,a as on,b as cn,c as dn,d as un,e as pn,f as gn,g as mn}from"./table.stories-data-_RfPv9jG.js";import"./styled-components.browser.esm-qIipjd6c.js";import"./tslib.es6-OIsz3r9a.js";import"./index-VW3EWkuE.js";import"./index.es-JXn3JM7k.js";import"./inheritsLoose-Y9jOMJLd.js";import"./extends-dGVwEr9R.js";import"./redux-F5dueAP3.js";import"./objectSpread2-93s0nBry.js";import"./index-miLrID2P.js";import"./memoize-one.esm-hqe5SRxC.js";import"./icon-y1a2N5SZ.js";import"./index-4QtD-hFu.js";import"./disabled-context-urNQThQz.js";import"./actions-ESle7xCw.js";import"./common-types-U65vzrrz.js";import"./button-7V8oA22w.js";import"./spinner-R8Il4aRe.js";import"./tooltip-HEHiU__l.js";import"./types-VB5zD18b.js";import"./types-5uVBABF4.js";import"./badge-23Ty_zBt.js";import"./pagination-xSK12Mw6.js";import"./select-5jrVNbFb.js";import"./assertThisInitialized-4q6YPdh3.js";import"./select.input-zP5tW20f.js";import"./input-group-R8LoqKRn.js";import"./input-group-addon-BHVsW9mL.js";import"./number-input-SvjJIGsW.js";import"./index-IQMsp8Ab.js";import"./index-cCpkwrS5.js";import"./check-box-s9CvqRSD.js";import"./help-icon--rUDxLUD.js";import"./slider-nl2rJ9LF.js";import"./index-ugi_ZH6T.js";import"./popover-Y3FpGdUS.js";import"./label-0_Qf6I8t.js";import"./flex-KzhjL9yc.js";const dt={title:"Basic/Table",component:A,args:{table:{...ne}}},I=g=>n.jsx(A,{...g}),B=I.bind({}),_=I.bind({});_.args={table:{...ne,fixedWidth:"400px"}};const M=I.bind({});M.args={table:{...ne,fixedWidth:"auto"}};const O=I.bind({});O.args={table:on};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=I.bind({});L.args={table:cn};const U=I.bind({});U.args={table:dn};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=I.bind({});Q.args={table:un};const E=I.bind({});E.args={table:pn};E.decorators=[g=>n.jsx("div",{style:{position:"absolute",inset:0,padding:"var(--padding)"},children:n.jsx(g,{})})];const N=I.bind({});N.args={table:gn};N.parameters={docs:{description:{story:"If a `maxHeight` is set, the table should only fill that height if it needs to."}}};const G=I.bind({});G.args={table:mn};const q=()=>n.jsx(sn,{heading:n.jsx(ln,{children:"Card heading"}),padding:!1,children:n.jsx(A,{table:{...ne,bordered:!1}})});q.parameters={docs:{source:{type:"dynamic"}}};const z=()=>{const g=["Section","Width","Height"];let u=["","m","m"],r=[...Array(175).keys()].map((s,t)=>[t,t*2,t*2]);const T=(s,t,i)=>s==="m"&&t==="ft"?i*3.28084:s==="ft"&&t==="m"?i/3.28084:i,o=(s,t,i,p)=>{r[t][i]=s.target.value,p()},C=s=>{r=r.concat([["","",""]]),s()},k=(s,t)=>{r=r.filter((i,p)=>p!==s),t()},d=(s,t,i)=>{const p=u[t],y=s.target.value;u=u.map((R,h)=>h===t?y:R),r=r.map(R=>R.map((h,b)=>b===t?T(p,y,h):h)),i()},m=()=>{const s=[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"Show all",value:0}],[t,i]=S.useState(10),[p,y]=S.useState(1),[R,h]=S.useState(!1),b=()=>{h(!R)},W=()=>{const e=Math.ceil(r.length/t);y(e)},D=(p-1)*t,a=t===0?r.length-1:D+t,c={headers:[{cells:g.map(e=>({value:e})),actions:[{primary:!0,label:"Add",icon:"add",onClick:()=>{C(b),W()}}]},{cells:[{},{options:[{label:"m",value:"m"},{label:"ft",value:"ft"}],value:u[1],type:"Select",native:!0,onChange:e=>d(e,1,b)},{options:[{label:"m",value:"m"},{label:"ft",value:"ft"}],value:u[2],type:"Select",native:!0,onChange:e=>d(e,2,b)}]}],rows:r.slice(D,a).map((e,l)=>{const P=D+l;return{cells:[...Array(3).keys()].map((f,w)=>({value:e[w],type:"Input",onChange:x=>o(x,P,w,b)})),actions:[{label:"Delete",icon:"minus",onClick:()=>k(P,b)}]}}),footer:{pagination:{rowCount:r.length,selectedPage:p,rowsPerPage:{onChange:e=>{const{value:l}=e.target;i(Number(l))},options:s,value:t},onSelectPage:e=>y(e),small:!0}}};return n.jsx(A,{table:c})};return n.jsx(m,{})},J=()=>{const g=["Section","Width","Height"];let u=[...Array(175).keys()].map((T,o)=>({Section:o,Width:o*2,Height:o*2}));const r=()=>{const T=[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"Show all",value:0}],[o,C]=S.useState(10),[k,d]=S.useState(1),[m,s]=S.useState({}),[t,i]=S.useState({});S.useEffect(()=>{d(1)},[m,t]);const p=(k-1)*o,y=o===0?u.length-1:p+o,R=(e,l,P)=>e.filter(f=>Object.keys(l).every(w=>l[w]===""?!0:f[w].toString().includes(l[w]))).sort((f,w)=>Object.entries(P).map(([x,F])=>{switch(F){case"up":return f[x]-w[x];case"down":return w[x]-f[x];default:return 0}}).reduce((x,F)=>x||F,0)),h=(e,l,P,f,w)=>{const x=e.map(v=>{const j=Object.keys(f).includes(v)?f[v]:"",H=`${v[0].toUpperCase()}${v.slice(1)}`;return{key:v,value:H,hasSort:!0,sort:j,onSort:()=>{const $=j===""?"up":j==="up"?"down":"";w({...f,[v]:$})}}}),F=e.map(v=>{const j=Object.keys(l).includes(v)?l[v]:"";return{key:v,value:j,type:"Input",placeholder:"Filter",onChange:H=>P({...l,[v]:H.target.value})}});return{dataSortCells:x,dataFilterCells:F}},{dataSortCells:b,dataFilterCells:W}=h(g,m,s,t,i),D=R(u,m,t),a=[...D.slice(p,y).map(e=>({cells:Object.entries(e).map(([P,f])=>({key:P,value:f,type:"Input",disabled:!0}))}))],c={headers:[{cells:b},{cells:W}],rows:a,footer:{pagination:{rowCount:D.length,selectedPage:k,rowsPerPage:{onChange:e=>{const{value:l}=e.target;C(Number(l))},options:T,value:o},onSelectPage:e=>d(e),small:!0}}};return n.jsx(A,{table:c})};return n.jsx(r,{})},X=()=>{const g={tea:3.6,coffee:3.2,orange:4.1},u=[{label:"Tea",value:"tea"},{label:"Coffee",value:"coffee"},{label:"Orange juice",value:"orange"}],r={cells:[{type:"Select",options:u,value:{value:"tea"}},{type:"Input"},{type:"Static"}]},T=[...Array(15).keys()].map((a,c)=>({cells:[{type:"Select",options:u,value:{value:"tea"}},{type:"Input",value:c+1},{type:"Static"}]})),[o,C]=S.useState(T),k=[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"Show all",value:0}],[d,m]=S.useState(10),[s,t]=S.useState(1),i=(s-1)*d,p=d===0?o.length-1:i+d,y=({newRow:a}={})=>{const c=K(o,e=>{e.push(a??r)});C(c)},R=({rowIndex:a})=>{const c=K(o,e=>{delete e[a]}).filter(e=>e);C(c)},h=({rowIndex:a,value:c})=>{const e=K(o,l=>{l[a].cells[0].value.value=c});C(e)},b=({rowIndex:a,value:c})=>{const e=K(o,l=>{l[a].cells[1].value=c});C(e)},W=({value:a})=>{const c=Number(a);return!oe.isNaN(c)&&oe.isInteger(c)&&c>0},D=o.slice(i,p).map((a,c)=>{const e=i+c;return o.length-1,{...a,cells:a==null?void 0:a.cells.map((l,P)=>{var v,j,H,$,le;const f=(H=(j=(v=a==null?void 0:a.cells)==null?void 0:v[0])==null?void 0:j.value)==null?void 0:H.value,w=Number((le=($=a==null?void 0:a.cells)==null?void 0:$[1])==null?void 0:le.value),x=g==null?void 0:g[f],F=x&&W({value:w})?(x*w).toFixed(2):null;if(P===0)return{...l,onChange:te=>h({rowIndex:e,value:te.target.value})};if(P===1)return{...l,onChange:te=>b({rowIndex:e,value:te.target.value}),error:W({value:l.value})?null:"Must be valid whole number"};if(P===2)return{...l,value:F}}),actions:[{label:"Delete",icon:"minus",onClick:()=>R({rowIndex:e})}]}});return n.jsx(A,{table:{defaultEmptyRow:r,onAddRow:y,columnAlignment:["left","right","right"],headers:[{cells:[{value:"Drink"},{value:"Quantity"},{value:"Total Price (£)"}],actions:[{primary:!0,icon:"plus",label:"Add",onClick:()=>y()}]}],rows:D,footer:{pagination:{rowCount:o.length,selectedPage:s,rowsPerPage:{onChange:a=>{const{value:c}=a.target;m(Number(c))},options:k,value:d},onSelectPage:a=>t(a),small:!0}}}})},Y=()=>{const g=["Section","Width","Height"];let u=Array.from(Array(10),(d,m)=>[m,m*2,m*2]);const[r,T]=S.useState({pastedValues:"",rowIndex:0,cellIndex:0}),o=(d,m,s,t)=>{u[m][s]=Number(d.target.value),t()},C=(d,m,s,t)=>{var p;let i=((p=d==null?void 0:d.clipboardData)==null?void 0:p.getData("text"))??"";return T({rowIndex:m,cellIndex:s,pastedValues:i}),t(),{pastedData:r}},k=()=>{const[d,m]=S.useState(!1),s=()=>{m(!d)},t={headers:[{cells:g.map(i=>({value:i}))}],rows:u.map((i,p)=>{const y=p;return{cells:[...Array(3).keys()].map((R,h)=>({value:i[h],type:"Input",onChange:b=>o(b,y,h,s),onPaste:b=>C(b,y,h,s)}))}})};return n.jsxs(n.Fragment,{children:[n.jsx(A,{table:t}),n.jsx(re,{label:"Pasted Data",children:n.jsx(ae,{value:r.pastedValues})}),n.jsx(re,{label:"At Row",children:n.jsx(ae,{value:r.rowIndex})}),n.jsx(re,{label:"At Cell Index",children:n.jsx(ae,{value:r.cellIndex})})]})};return n.jsx(k,{})},Z=()=>{const g={fixedWidth:"auto",name:"Table title",actions:[{icon:"download",tooltip:"Download"}],columnAlignment:[...Array(10)].map((u,r)=>"right"),headers:[{cells:[...Array(10)].map((u,r)=>({value:"Heading"}))},{cells:[...Array(10)].map((u,r)=>({options:[{label:"m",value:"m"},{label:"ft",value:"ft"}],type:"Select",searchable:!1,value:{label:"m",value:"m"},autoLayerWidth:!0}))}],rows:[...Array(10)].map((u,r)=>({cells:[...Array(10)].map((T,o)=>({value:123.45})),actions:[{icon:"help",tooltip:n.jsxs(se,{children:[n.jsx(V,{bold:!0,children:"Title goes here lorem ipsum"}),n.jsx(V,{children:"Label: 123.45m"}),n.jsx(V,{children:"Another label: 123.45m"}),n.jsx(V,{children:"Label: 123.45m"})]})}]}))};return n.jsx(A,{table:g})},ee=()=>{const g={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(se,{children:[n.jsx(V,{bold:!0,children:"Title goes here"}),n.jsx(V,{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(se,{children:[n.jsx(V,{bold:!0,children:"Title goes here"}),n.jsx(V,{children:"Details go here"})]})}]}]};return n.jsx(A,{table:g})};var ie,ce,de;B.parameters={...B.parameters,docs:{...(ie=B.parameters)==null?void 0:ie.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 K}from"./immer.esm-bD7SSJ7T.js";import{l as oe}from"./lodash-Bmg8FrMx.js";import{G as se}from"./grid-u1mZpaML.js";import{T as V}from"./text-6KQ6ntOV.js";import{T as A}from"./table-GUPoXZvd.js";import{C as sn}from"./card-0r8RRVk-.js";import{I as ae}from"./input-u1He-wWs.js";import{F as re}from"./field-eknsj_Ll.js";import{H as ln}from"./heading-Bk0bpNfe.js";import{t as ne,a as on,b as cn,c as dn,d as un,e as pn,f as gn,g as mn}from"./table.stories-data-I6ced_TS.js";import"./styled-components.browser.esm-qIipjd6c.js";import"./tslib.es6-OIsz3r9a.js";import"./index-VW3EWkuE.js";import"./index.es-JXn3JM7k.js";import"./inheritsLoose-Y9jOMJLd.js";import"./extends-dGVwEr9R.js";import"./redux-F5dueAP3.js";import"./objectSpread2-93s0nBry.js";import"./index-miLrID2P.js";import"./memoize-one.esm-hqe5SRxC.js";import"./icon-y1a2N5SZ.js";import"./index-4QtD-hFu.js";import"./disabled-context-urNQThQz.js";import"./actions-ESle7xCw.js";import"./common-types-U65vzrrz.js";import"./button-7V8oA22w.js";import"./spinner-R8Il4aRe.js";import"./tooltip-HEHiU__l.js";import"./types-VB5zD18b.js";import"./types-5uVBABF4.js";import"./badge-23Ty_zBt.js";import"./pagination-xSK12Mw6.js";import"./select-5jrVNbFb.js";import"./assertThisInitialized-4q6YPdh3.js";import"./select.input-zP5tW20f.js";import"./input-group-R8LoqKRn.js";import"./input-group-addon-BHVsW9mL.js";import"./number-input-SvjJIGsW.js";import"./index-IQMsp8Ab.js";import"./index-cCpkwrS5.js";import"./check-box-s9CvqRSD.js";import"./help-icon--rUDxLUD.js";import"./slider-nl2rJ9LF.js";import"./index-ugi_ZH6T.js";import"./popover-Y3FpGdUS.js";import"./label-0_Qf6I8t.js";import"./flex-3eLDDUyy.js";const dt={title:"Basic/Table",component:A,args:{table:{...ne}}},I=g=>n.jsx(A,{...g}),B=I.bind({}),_=I.bind({});_.args={table:{...ne,fixedWidth:"400px"}};const M=I.bind({});M.args={table:{...ne,fixedWidth:"auto"}};const O=I.bind({});O.args={table:on};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=I.bind({});L.args={table:cn};const U=I.bind({});U.args={table:dn};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=I.bind({});Q.args={table:un};const E=I.bind({});E.args={table:pn};E.decorators=[g=>n.jsx("div",{style:{position:"absolute",inset:0,padding:"var(--padding)"},children:n.jsx(g,{})})];const N=I.bind({});N.args={table:gn};N.parameters={docs:{description:{story:"If a `maxHeight` is set, the table should only fill that height if it needs to."}}};const G=I.bind({});G.args={table:mn};const q=()=>n.jsx(sn,{heading:n.jsx(ln,{children:"Card heading"}),padding:!1,children:n.jsx(A,{table:{...ne,bordered:!1}})});q.parameters={docs:{source:{type:"dynamic"}}};const z=()=>{const g=["Section","Width","Height"];let u=["","m","m"],r=[...Array(175).keys()].map((s,t)=>[t,t*2,t*2]);const T=(s,t,i)=>s==="m"&&t==="ft"?i*3.28084:s==="ft"&&t==="m"?i/3.28084:i,o=(s,t,i,p)=>{r[t][i]=s.target.value,p()},C=s=>{r=r.concat([["","",""]]),s()},k=(s,t)=>{r=r.filter((i,p)=>p!==s),t()},d=(s,t,i)=>{const p=u[t],y=s.target.value;u=u.map((R,h)=>h===t?y:R),r=r.map(R=>R.map((h,b)=>b===t?T(p,y,h):h)),i()},m=()=>{const s=[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"Show all",value:0}],[t,i]=S.useState(10),[p,y]=S.useState(1),[R,h]=S.useState(!1),b=()=>{h(!R)},W=()=>{const e=Math.ceil(r.length/t);y(e)},D=(p-1)*t,a=t===0?r.length-1:D+t,c={headers:[{cells:g.map(e=>({value:e})),actions:[{primary:!0,label:"Add",icon:"add",onClick:()=>{C(b),W()}}]},{cells:[{},{options:[{label:"m",value:"m"},{label:"ft",value:"ft"}],value:u[1],type:"Select",native:!0,onChange:e=>d(e,1,b)},{options:[{label:"m",value:"m"},{label:"ft",value:"ft"}],value:u[2],type:"Select",native:!0,onChange:e=>d(e,2,b)}]}],rows:r.slice(D,a).map((e,l)=>{const P=D+l;return{cells:[...Array(3).keys()].map((f,w)=>({value:e[w],type:"Input",onChange:x=>o(x,P,w,b)})),actions:[{label:"Delete",icon:"minus",onClick:()=>k(P,b)}]}}),footer:{pagination:{rowCount:r.length,selectedPage:p,rowsPerPage:{onChange:e=>{const{value:l}=e.target;i(Number(l))},options:s,value:t},onSelectPage:e=>y(e),small:!0}}};return n.jsx(A,{table:c})};return n.jsx(m,{})},J=()=>{const g=["Section","Width","Height"];let u=[...Array(175).keys()].map((T,o)=>({Section:o,Width:o*2,Height:o*2}));const r=()=>{const T=[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"Show all",value:0}],[o,C]=S.useState(10),[k,d]=S.useState(1),[m,s]=S.useState({}),[t,i]=S.useState({});S.useEffect(()=>{d(1)},[m,t]);const p=(k-1)*o,y=o===0?u.length-1:p+o,R=(e,l,P)=>e.filter(f=>Object.keys(l).every(w=>l[w]===""?!0:f[w].toString().includes(l[w]))).sort((f,w)=>Object.entries(P).map(([x,F])=>{switch(F){case"up":return f[x]-w[x];case"down":return w[x]-f[x];default:return 0}}).reduce((x,F)=>x||F,0)),h=(e,l,P,f,w)=>{const x=e.map(v=>{const j=Object.keys(f).includes(v)?f[v]:"",H=`${v[0].toUpperCase()}${v.slice(1)}`;return{key:v,value:H,hasSort:!0,sort:j,onSort:()=>{const $=j===""?"up":j==="up"?"down":"";w({...f,[v]:$})}}}),F=e.map(v=>{const j=Object.keys(l).includes(v)?l[v]:"";return{key:v,value:j,type:"Input",placeholder:"Filter",onChange:H=>P({...l,[v]:H.target.value})}});return{dataSortCells:x,dataFilterCells:F}},{dataSortCells:b,dataFilterCells:W}=h(g,m,s,t,i),D=R(u,m,t),a=[...D.slice(p,y).map(e=>({cells:Object.entries(e).map(([P,f])=>({key:P,value:f,type:"Input",disabled:!0}))}))],c={headers:[{cells:b},{cells:W}],rows:a,footer:{pagination:{rowCount:D.length,selectedPage:k,rowsPerPage:{onChange:e=>{const{value:l}=e.target;C(Number(l))},options:T,value:o},onSelectPage:e=>d(e),small:!0}}};return n.jsx(A,{table:c})};return n.jsx(r,{})},X=()=>{const g={tea:3.6,coffee:3.2,orange:4.1},u=[{label:"Tea",value:"tea"},{label:"Coffee",value:"coffee"},{label:"Orange juice",value:"orange"}],r={cells:[{type:"Select",options:u,value:{value:"tea"}},{type:"Input"},{type:"Static"}]},T=[...Array(15).keys()].map((a,c)=>({cells:[{type:"Select",options:u,value:{value:"tea"}},{type:"Input",value:c+1},{type:"Static"}]})),[o,C]=S.useState(T),k=[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"Show all",value:0}],[d,m]=S.useState(10),[s,t]=S.useState(1),i=(s-1)*d,p=d===0?o.length-1:i+d,y=({newRow:a}={})=>{const c=K(o,e=>{e.push(a??r)});C(c)},R=({rowIndex:a})=>{const c=K(o,e=>{delete e[a]}).filter(e=>e);C(c)},h=({rowIndex:a,value:c})=>{const e=K(o,l=>{l[a].cells[0].value.value=c});C(e)},b=({rowIndex:a,value:c})=>{const e=K(o,l=>{l[a].cells[1].value=c});C(e)},W=({value:a})=>{const c=Number(a);return!oe.isNaN(c)&&oe.isInteger(c)&&c>0},D=o.slice(i,p).map((a,c)=>{const e=i+c;return o.length-1,{...a,cells:a==null?void 0:a.cells.map((l,P)=>{var v,j,H,$,le;const f=(H=(j=(v=a==null?void 0:a.cells)==null?void 0:v[0])==null?void 0:j.value)==null?void 0:H.value,w=Number((le=($=a==null?void 0:a.cells)==null?void 0:$[1])==null?void 0:le.value),x=g==null?void 0:g[f],F=x&&W({value:w})?(x*w).toFixed(2):null;if(P===0)return{...l,onChange:te=>h({rowIndex:e,value:te.target.value})};if(P===1)return{...l,onChange:te=>b({rowIndex:e,value:te.target.value}),error:W({value:l.value})?null:"Must be valid whole number"};if(P===2)return{...l,value:F}}),actions:[{label:"Delete",icon:"minus",onClick:()=>R({rowIndex:e})}]}});return n.jsx(A,{table:{defaultEmptyRow:r,onAddRow:y,columnAlignment:["left","right","right"],headers:[{cells:[{value:"Drink"},{value:"Quantity"},{value:"Total Price (£)"}],actions:[{primary:!0,icon:"plus",label:"Add",onClick:()=>y()}]}],rows:D,footer:{pagination:{rowCount:o.length,selectedPage:s,rowsPerPage:{onChange:a=>{const{value:c}=a.target;m(Number(c))},options:k,value:d},onSelectPage:a=>t(a),small:!0}}}})},Y=()=>{const g=["Section","Width","Height"];let u=Array.from(Array(10),(d,m)=>[m,m*2,m*2]);const[r,T]=S.useState({pastedValues:"",rowIndex:0,cellIndex:0}),o=(d,m,s,t)=>{u[m][s]=Number(d.target.value),t()},C=(d,m,s,t)=>{var p;let i=((p=d==null?void 0:d.clipboardData)==null?void 0:p.getData("text"))??"";return T({rowIndex:m,cellIndex:s,pastedValues:i}),t(),{pastedData:r}},k=()=>{const[d,m]=S.useState(!1),s=()=>{m(!d)},t={headers:[{cells:g.map(i=>({value:i}))}],rows:u.map((i,p)=>{const y=p;return{cells:[...Array(3).keys()].map((R,h)=>({value:i[h],type:"Input",onChange:b=>o(b,y,h,s),onPaste:b=>C(b,y,h,s)}))}})};return n.jsxs(n.Fragment,{children:[n.jsx(A,{table:t}),n.jsx(re,{label:"Pasted Data",children:n.jsx(ae,{value:r.pastedValues})}),n.jsx(re,{label:"At Row",children:n.jsx(ae,{value:r.rowIndex})}),n.jsx(re,{label:"At Cell Index",children:n.jsx(ae,{value:r.cellIndex})})]})};return n.jsx(k,{})},Z=()=>{const g={fixedWidth:"auto",name:"Table title",actions:[{icon:"download",tooltip:"Download"}],columnAlignment:[...Array(10)].map((u,r)=>"right"),headers:[{cells:[...Array(10)].map((u,r)=>({value:"Heading"}))},{cells:[...Array(10)].map((u,r)=>({options:[{label:"m",value:"m"},{label:"ft",value:"ft"}],type:"Select",searchable:!1,value:{label:"m",value:"m"},autoLayerWidth:!0}))}],rows:[...Array(10)].map((u,r)=>({cells:[...Array(10)].map((T,o)=>({value:123.45})),actions:[{icon:"help",tooltip:n.jsxs(se,{children:[n.jsx(V,{bold:!0,children:"Title goes here lorem ipsum"}),n.jsx(V,{children:"Label: 123.45m"}),n.jsx(V,{children:"Another label: 123.45m"}),n.jsx(V,{children:"Label: 123.45m"})]})}]}))};return n.jsx(A,{table:g})},ee=()=>{const g={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(se,{children:[n.jsx(V,{bold:!0,children:"Title goes here"}),n.jsx(V,{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(se,{children:[n.jsx(V,{bold:!0,children:"Title goes here"}),n.jsx(V,{children:"Details go here"})]})}]}]};return n.jsx(A,{table:g})};var ie,ce,de;B.parameters={...B.parameters,docs:{...(ie=B.parameters)==null?void 0:ie.docs,source:{originalSource:`args => {
|
|
2
2
|
return <Table
|
|
3
3
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
4
4
|
{...args} />;
|
package/dist/storybook/assets/{table.stories-data-_RfPv9jG.js → table.stories-data-I6ced_TS.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as a}from"./jsx-runtime-FsUICBgo.js";import{I as o,T as c}from"./common-types-U65vzrrz.js";import{F as v}from"./flex-KzhjL9yc.js";import{M as p}from"./actions-ESle7xCw.js";import{T as d}from"./text-6KQ6ntOV.js";import{I as n}from"./icon-y1a2N5SZ.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(t=>({...t,tooltip:"Tooltip"}))}))},f={...e,rows:e.rows.map(l=>({...l,cells:l.cells.map(t=>({...t,width:"200px"}))}))},W={...e,rows:e.rows.map(l=>({...l,cells:l.cells.map(t=>({...t,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]},L={...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"},{}]}]},A={...e,rows:e.rows.map((l,t)=>({...l,active:t===0,onRowClick:()=>{}}))},D={...e,name:"Food"},E={...e,name:a.jsxs(v,{gap:"var(--padding-xs)",alignItems:"center",children:["Food",a.jsx(n,{icon:o.STAR})]})},u=[{childComponent:a.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}})}],P={...e,name:"Food",actions:u,testId:"table-child-component"},V={...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,t)=>({cells:[{type:"Input",value:`Strawberry Letter ${t+1}`},{type:"Input",value:100},{type:"Input",value:361},{type:"Input",value:"Vietnam"}]})),footer:{content:a.jsxs(a.Fragment,{children:[a.jsx("strong",{children:"Footer content:"})," goes here"]})}},B={...i,maxHeight:"100%"},O={...i,rows:Array.from({length:1},(l,t)=>({cells:[{type:"Input",value:`Strawberry Letter ${t+1}`},{type:"Input",value:100},{type:"Input",value:361},{type:"Input",value:"Vietnam"}]}))},j={...i,draggable:!0},N={...e,rows:e.rows.map(l=>({...l,onRowFocus:()=>{}}))},b=()=>a.jsxs("ul",{children:[a.jsx("li",{children:"Carrots"}),a.jsx("li",{children:"Chocolate"}),a.jsx("li",{children:"Chorizo"})]}),T={headers:[{cells:[{value:"Name"},{value:"Content"}]}],rows:[{cells:[{value:"Sub-component"},{value:b()}]},{cells:[{value:"JSX"},{value:a.jsxs("div",{children:["Some ",a.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}]}]},H={...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:"白米"}]}]},q={...e,columnWidths:["auto","120px","120px","auto"],headers:[{cells:[{value:"Header"},{value:"Header",colSpan:2},{value:"Header"}]}]},R={...e,columnAlignment:["left","right","right","left"]},M={...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"}]}]},U={...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]}))},z={...s,rows:s.rows.map(l=>({...l,cells:l.cells.map(t=>({...t,disabled:!0}))}))},_={...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:()=>{}}]}]},G={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"}]}]},J={headers:[{cells:[{},{value:"Name"},{value:"Weight (kg)"},{value:"Energy (kcal / 100g)"},{value:"Origin"}]}],rows:[{cells:[{type:"Icon",icon:a.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:a.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:a.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"}]}]},$={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")}]}]},X={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}]}]},K={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:()=>{}}]}]},Q={...e,footer:{content:a.jsxs(a.Fragment,{children:[a.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:()=>{}}]}},Y={...e,headers:e.headers.map(l=>({...l,cells:l.cells.map(t=>({...t,helpIcon:{onClick:()=>console.log("Help clicked"),tooltip:"Help text goes here"},libraryIcon:{onClick:()=>console.log("Library clicked"),tooltip:"Edit in library"}}))}))},Z={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"}]}]};export{U as A,J as B,$ as C,X as D,K as E,T as F,x as G,F as H,Z as I,S as a,R as b,M as c,i as d,B as e,O as f,j as g,L as h,A as i,D as j,E as k,P as l,_ as m,G as n,V as o,Y as p,N as q,Q as r,s,e as t,z as u,m as v,q as w,f as x,W as y,H as z};
|
|
1
|
+
import{j as a}from"./jsx-runtime-FsUICBgo.js";import{I as o,T as c}from"./common-types-U65vzrrz.js";import{F as v}from"./flex-3eLDDUyy.js";import{M as p}from"./actions-ESle7xCw.js";import{T as d}from"./text-6KQ6ntOV.js";import{I as n}from"./icon-y1a2N5SZ.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(t=>({...t,tooltip:"Tooltip"}))}))},f={...e,rows:e.rows.map(l=>({...l,cells:l.cells.map(t=>({...t,width:"200px"}))}))},W={...e,rows:e.rows.map(l=>({...l,cells:l.cells.map(t=>({...t,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]},L={...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"},{}]}]},A={...e,rows:e.rows.map((l,t)=>({...l,active:t===0,onRowClick:()=>{}}))},D={...e,name:"Food"},E={...e,name:a.jsxs(v,{gap:"var(--padding-xs)",alignItems:"center",children:["Food",a.jsx(n,{icon:o.STAR})]})},u=[{childComponent:a.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}})}],P={...e,name:"Food",actions:u,testId:"table-child-component"},V={...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,t)=>({cells:[{type:"Input",value:`Strawberry Letter ${t+1}`},{type:"Input",value:100},{type:"Input",value:361},{type:"Input",value:"Vietnam"}]})),footer:{content:a.jsxs(a.Fragment,{children:[a.jsx("strong",{children:"Footer content:"})," goes here"]})}},B={...i,maxHeight:"100%"},O={...i,rows:Array.from({length:1},(l,t)=>({cells:[{type:"Input",value:`Strawberry Letter ${t+1}`},{type:"Input",value:100},{type:"Input",value:361},{type:"Input",value:"Vietnam"}]}))},j={...i,draggable:!0},N={...e,rows:e.rows.map(l=>({...l,onRowFocus:()=>{}}))},b=()=>a.jsxs("ul",{children:[a.jsx("li",{children:"Carrots"}),a.jsx("li",{children:"Chocolate"}),a.jsx("li",{children:"Chorizo"})]}),T={headers:[{cells:[{value:"Name"},{value:"Content"}]}],rows:[{cells:[{value:"Sub-component"},{value:b()}]},{cells:[{value:"JSX"},{value:a.jsxs("div",{children:["Some ",a.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}]}]},H={...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:"白米"}]}]},q={...e,columnWidths:["auto","120px","120px","auto"],headers:[{cells:[{value:"Header"},{value:"Header",colSpan:2},{value:"Header"}]}]},R={...e,columnAlignment:["left","right","right","left"]},M={...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"}]}]},U={...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]}))},z={...s,rows:s.rows.map(l=>({...l,cells:l.cells.map(t=>({...t,disabled:!0}))}))},_={...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:()=>{}}]}]},G={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"}]}]},J={headers:[{cells:[{},{value:"Name"},{value:"Weight (kg)"},{value:"Energy (kcal / 100g)"},{value:"Origin"}]}],rows:[{cells:[{type:"Icon",icon:a.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:a.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:a.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"}]}]},$={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")}]}]},X={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}]}]},K={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:()=>{}}]}]},Q={...e,footer:{content:a.jsxs(a.Fragment,{children:[a.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:()=>{}}]}},Y={...e,headers:e.headers.map(l=>({...l,cells:l.cells.map(t=>({...t,helpIcon:{onClick:()=>console.log("Help clicked"),tooltip:"Help text goes here"},libraryIcon:{onClick:()=>console.log("Library clicked"),tooltip:"Edit in library"}}))}))},Z={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"}]}]};export{U as A,J as B,$ as C,X as D,K as E,T as F,x as G,F as H,Z as I,S as a,R as b,M as c,i as d,B as e,O as f,j as g,L as h,A as i,D as j,E as k,P as l,_ as m,G as n,V as o,Y as p,N as q,Q as r,s,e as t,z as u,m as v,q as w,f as x,W as y,H as z};
|
|
@@ -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-HEHiU__l.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:'"
|
|
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-HEHiU__l.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:'"vertical"'},{value:'"initial"'},{value:'"-moz-initial"'},{value:'"inherit"'},{value:'"revert"'},{value:'"revert-layer"'},{value:'"unset"'},{value:'"none"'},{value:'"inline"'},{value:'"block"'},{value:'"both"'},{value:'"horizontal"'}]}},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-
|
|
1
|
+
import{j as u}from"./jsx-runtime-FsUICBgo.js";import{T as s}from"./textarea-4DUPP53K.js";import"./index-RfLt4OUa.js";import"./index-VW3EWkuE.js";import"./types-5uVBABF4.js";import"./lodash-Bmg8FrMx.js";import"./disabled-context-urNQThQz.js";import"./tooltip-HEHiU__l.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 B}from"./jsx-runtime-FsUICBgo.js";import{T as X}from"./table-GUPoXZvd.js";import{t as O,h as W,i as q,j as z,k as D,l as G,m as K,n as M,o as P,p as Q}from"./table.stories-data-
|
|
1
|
+
import{j as B}from"./jsx-runtime-FsUICBgo.js";import{T as X}from"./table-GUPoXZvd.js";import{t as O,h as W,i as q,j as z,k as D,l as G,m as K,n as M,o as P,p as Q}from"./table.stories-data-I6ced_TS.js";import"./index-RfLt4OUa.js";import"./index-VW3EWkuE.js";import"./index.es-JXn3JM7k.js";import"./inheritsLoose-Y9jOMJLd.js";import"./extends-dGVwEr9R.js";import"./redux-F5dueAP3.js";import"./objectSpread2-93s0nBry.js";import"./index-miLrID2P.js";import"./memoize-one.esm-hqe5SRxC.js";import"./icon-y1a2N5SZ.js";import"./tslib.es6-OIsz3r9a.js";import"./index-4QtD-hFu.js";import"./disabled-context-urNQThQz.js";import"./lodash-Bmg8FrMx.js";import"./actions-ESle7xCw.js";import"./common-types-U65vzrrz.js";import"./button-7V8oA22w.js";import"./spinner-R8Il4aRe.js";import"./tooltip-HEHiU__l.js";import"./types-VB5zD18b.js";import"./types-5uVBABF4.js";import"./badge-23Ty_zBt.js";import"./heading-Bk0bpNfe.js";import"./help-icon--rUDxLUD.js";import"./pagination-xSK12Mw6.js";import"./select-5jrVNbFb.js";import"./assertThisInitialized-4q6YPdh3.js";import"./text-6KQ6ntOV.js";import"./select.input-zP5tW20f.js";import"./input-u1He-wWs.js";import"./input-group-R8LoqKRn.js";import"./input-group-addon-BHVsW9mL.js";import"./number-input-SvjJIGsW.js";import"./index-IQMsp8Ab.js";import"./index-cCpkwrS5.js";import"./check-box-s9CvqRSD.js";import"./slider-nl2rJ9LF.js";import"./index-ugi_ZH6T.js";import"./popover-Y3FpGdUS.js";import"./flex-3eLDDUyy.js";const Br={title:"Basic/Table/Title & Header",component:X,args:{table:{...O}}},r=k=>B.jsx(X,{...k}),e=r.bind({});e.args={table:W};const s=r.bind({});s.args={table:q};const a=r.bind({});a.args={table:z};const t=r.bind({});t.args={table:D};const o=r.bind({});o.args={table:G};const n=r.bind({});n.args={table:K};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-
|
|
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-3eLDDUyy.js";import{t,d}from"./toaster-_gH13Vo0.js";import{B as o}from"./button-7V8oA22w.js";import{S as a}from"./spacer-Yji9g2AW.js";import{M as m}from"./message--yMWfUQv.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-y1a2N5SZ.js";import"./inheritsLoose-Y9jOMJLd.js";import"./index-4QtD-hFu.js";import"./tooltip-HEHiU__l.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."},os={title:"Modals/Toaster",parameters:{docs:{story:{inline:!1,iframeHeight:400}}},source:{type:"code"},args:{id:void 0,message:O,autoClose:6e3,onClose:()=>{}}},M=()=>s.jsxs(s.Fragment,{children:[s.jsx(o,{label:"Info",onClick:()=>t({message:O,onClose:()=>console.log("toast closed")})}),s.jsx(a,{}),s.jsx(o,{label:"Error",onClick:()=>t({message:A,onClose:()=>console.log("toast closed")})}),s.jsx(a,{}),s.jsx(o,{label:"Warning",onClick:()=>t({message:F,onClose:()=>console.log("toast closed")})}),s.jsx(a,{}),s.jsx(o,{label:"Success",onClick:()=>t({message:_,onClose:()=>console.log("toast closed")})})]}),r=M.bind({}),n=()=>s.jsx(o,{label:"Show Toast",onClick:()=>{const e=Math.random()>=.5;t({message:{type:e?"Success":"Error",icon:!0,content:e?"Success":"Error"},onClose:()=>console.log("toast closed"),id:"uniqueId"})}});n.parameters={docs:{iframeHeight:200,description:{story:"Pass a unique `id` in the `toast` object to prevent duplicates. Successive toasts with the same ID will update the existing toast."}}};const 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:()=>t({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:()=>t({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:()=>t({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,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-
|
|
1
|
+
import{j as e}from"./jsx-runtime-FsUICBgo.js";import{r as X}from"./index-RfLt4OUa.js";import{F as C}from"./flex-3eLDDUyy.js";import{T as g}from"./text-6KQ6ntOV.js";import{T as d}from"./toggle-BPI2y-lU.js";import"./index-VW3EWkuE.js";import"./common-types-U65vzrrz.js";import"./disabled-context-urNQThQz.js";import"./help-icon--rUDxLUD.js";import"./tooltip-HEHiU__l.js";import"./index-miLrID2P.js";import"./icon-y1a2N5SZ.js";import"./inheritsLoose-Y9jOMJLd.js";import"./tslib.es6-OIsz3r9a.js";import"./index-4QtD-hFu.js";const{useArgs:Z}=__STORYBOOK_MODULE_ADDONS__,ue={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();
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{j as s}from"./jsx-runtime-FsUICBgo.js";import{T as p}from"./tooltip-HEHiU__l.js";import{M as m}from"./actions-ESle7xCw.js";import{m as n}from"./menu.stories-data-
|
|
1
|
+
import{j as s}from"./jsx-runtime-FsUICBgo.js";import{T as p}from"./tooltip-HEHiU__l.js";import{M as m}from"./actions-ESle7xCw.js";import{m as n}from"./menu.stories-data-l5rlcD9_.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-7V8oA22w.js";import"./spinner-R8Il4aRe.js";import"./icon-y1a2N5SZ.js";import"./inheritsLoose-Y9jOMJLd.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-3eLDDUyy.js";const R={title:"Basic/Tooltip/Test Cases",component:p,args:{text:"Tooltip text"}},a=i=>s.jsx(p,{...i}),o=a.bind({});o.args={children:s.jsx(m,{menu:n}),placement:"bottom-end",display:"inline-block"};var t,r,e;o.parameters={...o.parameters,docs:{...(t=o.parameters)==null?void 0:t.docs,source:{originalSource:`args => <Tooltip
|
|
2
2
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
3
3
|
{...args} />`,...(e=(r=o.parameters)==null?void 0:r.docs)==null?void 0:e.source}}};const S=["CloseWhenMenuOpen"];export{o as CloseWhenMenuOpen,S as __namedExportsOrder,R as default};
|