@worldresources/wri-design-systems 2.187.1 → 2.188.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +23 -16
- package/dist/index.d.ts +13 -2
- package/dist/index.esm.js +918 -911
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -3541,32 +3541,39 @@ function tp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
|
|
|
3541
3541
|
p {
|
|
3542
3542
|
color: ${h("error",900)};
|
|
3543
3543
|
}
|
|
3544
|
-
`,tx=o.css`
|
|
3544
|
+
`,tx=e=>{let t="",n="",r="";return"success"===e?(t=h("success",100),n=h("success",500),r=h("success",300)):"warning"===e?(t=h("warning",100),n=h("warning",500),r=h("warning",300)):"error"===e?(t=h("error",100),n=h("error",500),r=h("error",300)):"information"===e?(t=h("secondary",100),n=h("secondary",500),r=h("secondary",200)):"general-grey"===e?(t=h("neutral",200),n=h("neutral",700),r=h("neutral",300)):(t=h("neutral",100),n=h("neutral",700),r=h("neutral",300)),o.css`
|
|
3545
|
+
display: flex;
|
|
3546
|
+
color: ${n};
|
|
3547
|
+
align-items: center;
|
|
3548
|
+
background-color: ${t};
|
|
3549
|
+
border-bottom: 1px solid ${r};
|
|
3550
|
+
border-radius: 0;
|
|
3551
|
+
`},nx=l.forwardRef((({title:t,children:n,icon:o,variant:i,onClose:a})=>{const[s,c]=l.useState(!0),u="success"===i?r.jsx(_,{}):"warning"===i?r.jsx(D,{}):r.jsx(S,{});return s?r.jsxs(e.Alert.Root,{css:tx(i),children:[r.jsx(e.Alert.Indicator,{children:o||u}),n?r.jsx(e.Alert.Content,{children:r.jsxs("div",{style:{display:"flex",gap:"12px",alignItems:"center"},children:[r.jsx(e.Alert.Title,{children:t}),r.jsx(e.Alert.Description,{children:n})]})}):r.jsx(e.Alert.Title,{flex:"1",children:t}),r.jsx(e.CloseButton,{pos:"absolute",insetEnd:"2",_hover:{bg:"gray.200"},onClick:()=>{c(!1),a?.()}})]}):null})),rx=o.css`
|
|
3545
3552
|
height: 8px;
|
|
3546
3553
|
width: 100%;
|
|
3547
3554
|
background-color: ${h("neutral",300)};
|
|
3548
3555
|
display: flex;
|
|
3549
3556
|
align-items: center;
|
|
3550
3557
|
justify-content: flex-start;
|
|
3551
|
-
`,
|
|
3558
|
+
`,ox=e=>o.css`
|
|
3552
3559
|
height: 100%;
|
|
3553
3560
|
width: ${e}%;
|
|
3554
3561
|
background-color: ${h("primary",500)};
|
|
3555
3562
|
transition: width 0.5s ease-in-out;
|
|
3556
|
-
`,
|
|
3563
|
+
`,ix=o.css`
|
|
3557
3564
|
width: 100%;
|
|
3558
3565
|
display: flex;
|
|
3559
3566
|
align-items: center;
|
|
3560
3567
|
justify-content: space-between;
|
|
3561
3568
|
position: relative;
|
|
3562
|
-
`,
|
|
3569
|
+
`,ax=o.css`
|
|
3563
3570
|
height: 60px;
|
|
3564
3571
|
width: 80px;
|
|
3565
3572
|
display: flex;
|
|
3566
3573
|
flex-direction: column;
|
|
3567
3574
|
align-items: center;
|
|
3568
3575
|
justify-content: space-between;
|
|
3569
|
-
`,
|
|
3576
|
+
`,sx=(e,t)=>o.css`
|
|
3570
3577
|
height: 32px;
|
|
3571
3578
|
width: 32px;
|
|
3572
3579
|
display: flex;
|
|
@@ -3602,12 +3609,12 @@ function tp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
|
|
|
3602
3609
|
}
|
|
3603
3610
|
|
|
3604
3611
|
${t?`\n background-color: ${h("neutral",300)};\n \n &:hover {\n background-color: ${h("neutral",300)};\n box-shadow: none;\n }\n `:""}
|
|
3605
|
-
`,
|
|
3612
|
+
`,lx=e=>o.css`
|
|
3606
3613
|
color: ${h("neutral",e?800:600)};
|
|
3607
3614
|
font-size: 14px;
|
|
3608
3615
|
line-height: 20px;
|
|
3609
3616
|
font-weight: 400;
|
|
3610
|
-
`,
|
|
3617
|
+
`,cx=o.css`
|
|
3611
3618
|
height: 1px;
|
|
3612
3619
|
width: 100%;
|
|
3613
3620
|
padding: 0 30px;
|
|
@@ -3615,11 +3622,11 @@ function tp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
|
|
|
3615
3622
|
top: 16px;
|
|
3616
3623
|
left: 0;
|
|
3617
3624
|
z-index: -1;
|
|
3618
|
-
`,
|
|
3625
|
+
`,ux=o.css`
|
|
3619
3626
|
height: 1px;
|
|
3620
3627
|
width: 100%;
|
|
3621
3628
|
background-color: ${h("neutral",400)};
|
|
3622
|
-
`,
|
|
3629
|
+
`,dx=o.css`
|
|
3623
3630
|
justify-content: space-between;
|
|
3624
3631
|
align-items: center;
|
|
3625
3632
|
gap: 8px;
|
|
@@ -3662,21 +3669,21 @@ function tp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
|
|
|
3662
3669
|
color: ${h("error",900)};
|
|
3663
3670
|
}
|
|
3664
3671
|
}
|
|
3665
|
-
`,
|
|
3672
|
+
`,px=o.css`
|
|
3666
3673
|
font-size: 18px;
|
|
3667
3674
|
line-height: 28px;
|
|
3668
3675
|
font-weight: 400;
|
|
3669
3676
|
color: ${h("neutral",800)};
|
|
3670
|
-
`,
|
|
3677
|
+
`,hx=o.css`
|
|
3671
3678
|
font-size: 16px;
|
|
3672
3679
|
line-height: 24px;
|
|
3673
3680
|
font-weight: 400;
|
|
3674
3681
|
color: ${h("neutral",700)};
|
|
3675
|
-
`,
|
|
3682
|
+
`,fx=o.css`
|
|
3676
3683
|
padding: 6px;
|
|
3677
|
-
`,
|
|
3684
|
+
`,xx=o.css`
|
|
3678
3685
|
padding: 6px;
|
|
3679
|
-
`,
|
|
3686
|
+
`,gx={pauseOnPageIdle:!0,offsets:"24px"},vx={"top-start":e.createToaster({placement:"top-start",...gx}),"top-end":e.createToaster({placement:"top-end",...gx}),"bottom-start":e.createToaster({placement:"bottom-start",...gx}),"bottom-end":e.createToaster({placement:"bottom-end",...gx})};exports.AlertBanner=nx,exports.AnalysisWidget=({children:t,header:o,footer:i,expanded:a=!0,collapsible:s=!0,actions:l,showFooterOnCollapsed:c=!1})=>{const u="analysis-widget-item",[d,p]=n.useState(a),h=`analysis-widget-header-${u}`;return r.jsx(e.Box,{as:"section","aria-labelledby":h,css:ha,children:r.jsxs(e.Accordion.Root,{multiple:!0,value:s?void 0:[u],defaultValue:a?[u]:[],children:[r.jsxs(e.Accordion.Item,{css:xa,value:u,children:[o&&r.jsx(e.Accordion.ItemTrigger,{id:h,role:"button","aria-expanded":d,tabIndex:0,css:fa,pointerEvents:s?"auto":"none",onClick:s?()=>{p(!d)}:void 0,children:r.jsxs(e.Flex,{gap:3,flex:"1",overflow:"hidden",alignItems:"top",justifyContent:"space-between",children:[o,l&&l.map((e=>r.jsx(w,{variant:"secondary",size:"small",label:e.label,onClick:t=>{e.onClick(),t.preventDefault(),t.stopPropagation()},leftIcon:e?.icon},e.label))),s&&r.jsx(e.Accordion.ItemIndicator,{height:"16px",marginTop:"8px",display:"flex",children:r.jsx(E,{"aria-label":"Toggle section",color:"var(--chakra-colors-neutral-700)",height:"16px",width:"16px"})})]})}),r.jsxs("div",{className:d?"item-content-open":"item-content-closed","aria-hidden":!d,children:[t,!c&&i&&r.jsx(e.Box,{css:ga,children:i})]})]}),c&&i&&r.jsx(e.Box,{css:ga,children:i})]})})},exports.Avatar=Nf,exports.Badge=({hasNotification:e,notificationCount:t,label:o})=>{const[i,a]=n.useState(!1);n.useEffect((()=>{const e=()=>{window.innerWidth<1024?a(!0):a(!1)};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]);const s=(()=>{let e="";return t&&t>0&&(e=`${t>99?"99+":t}`),e})();let l="16px";return t&&t>99?l="28px":t&&t>9&&(l="22px"),i?r.jsxs("div",{css:Vf,role:"status","aria-live":"polite",children:[r.jsxs("div",{css:Af(),children:[r.jsx(V,{color:"currentColor",height:"16px",width:"16px"}),!e||t||o?null:r.jsx("div",{css:zf,"aria-hidden":!0})]}),o?r.jsx("p",{children:o}):null,s.length>0?r.jsx("div",{css:Ff,children:r.jsx("p",{css:Zf,"aria-label":`${t} unread message`,children:s})}):null]}):r.jsxs("div",{css:Vf,role:"status","aria-live":"polite",children:[o?r.jsx("p",{children:o}):null,r.jsxs("div",{css:Af(l),children:[s.length>0?r.jsx("div",{css:Bf,children:r.jsx("p",{css:Hf,"aria-label":`${t} unread message`,children:s})}):null,e&&!t?r.jsx("div",{css:zf,"aria-hidden":!0}):null,r.jsx(V,{color:"currentColor",height:"16px",width:"16px"})]})]})},exports.BaseMap=({title:e,caption:t,additionalSettings:i,options:a,onOptionSelected:s,maxHeight:l="400px",maxWidth:c="260px"})=>{const u=n.useRef(null),d=n.useRef(null);return n.useEffect((()=>{const e=u.current,t=d.current;if(!e||!t)return;const n=()=>{e.focus()};if("undefined"!=typeof IntersectionObserver){let e=!1;const r=new IntersectionObserver((([t])=>{t?.isIntersecting?(e||n(),e=!0):e=!1}),{threshold:.01});return r.observe(t),()=>r.disconnect()}const r=window.setTimeout(n,0);return()=>window.clearTimeout(r)}),[]),r.jsx("div",{ref:d,css:$n(l,c),children:r.jsxs("div",{className:"ds-base-map-scroll-content",children:[r.jsxs("div",{css:Sn,children:[r.jsx("h2",{ref:u,className:"ds-base-map-header-title",tabIndex:-1,children:e}),r.jsx("p",{className:"ds-base-map-header-caption",children:t})]}),r.jsxs("div",{css:En,children:[i?r.jsx("div",{css:Rn,children:i.map((e=>r.jsxs("div",{children:[r.jsx(Te,{css:{},checked:e.checked,onCheckedChange:({checked:t})=>e.onCheckedChange({checked:Boolean(t)}),children:e.label}),e.checked&&e.children?r.jsx("div",{css:Ln,children:e.children}):null]},e.label)))}):null,a?r.jsx("div",{css:On,children:a.map((e=>{return r.jsxs("div",{css:Tn(e.active),role:"button",onClick:()=>s?.(e),tabIndex:0,onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||s?.(e)},children:[r.jsx("div",{css:(t=e.imageUrl,o.css`
|
|
3680
3687
|
height: 32px;
|
|
3681
3688
|
width: 32px;
|
|
3682
3689
|
border: 1px solid ${h("neutral",300)};
|
|
@@ -3724,7 +3731,7 @@ function tp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
|
|
|
3724
3731
|
font-weight: 700;
|
|
3725
3732
|
color: ${h("medium"===y?"warning":"strong"===y||"very-strong"===y?"success":"error",900)};
|
|
3726
3733
|
}
|
|
3727
|
-
`),"aria-live":"polite",role:"status",children:[d.strengthPrefix," ",r.jsx("span",{children:b[v.strength]})]}),r.jsx("div",{css:an(v.strength),children:r.jsx("div",{})}),r.jsxs("div",{css:sn(v.length),"aria-label":`${d.minLengthRule(l)}. ${v.length?d.requirementMet:d.requirementNotMet}`,children:[r.jsx("div",{children:v.length?r.jsx(k,{color:"var(--chakra-colors-success-500)",height:"8px",width:"8px"}):r.jsx(L,{color:"var(--chakra-colors-error-900)",height:"8px",width:"8px"})}),r.jsx("p",{children:d.minLengthRule(l)})]}),a?.uppercase?null:r.jsxs("div",{css:sn(v.uppercase),"aria-label":`${d.uppercaseRule}. ${v.uppercase?d.requirementMet:d.requirementNotMet}`,children:[r.jsx("div",{children:v.uppercase?r.jsx(k,{color:"var(--chakra-colors-success-500)",height:"8px",width:"8px"}):r.jsx(L,{color:"var(--chakra-colors-error-900)",height:"8px",width:"8px"})}),r.jsx("p",{children:d.uppercaseRule})]}),a?.lowercase?null:r.jsxs("div",{css:sn(v.lowercase),"aria-label":`${d.lowercaseRule}. ${v.lowercase?d.requirementMet:d.requirementNotMet}`,children:[r.jsx("div",{children:v.lowercase?r.jsx(k,{color:"var(--chakra-colors-success-500)",height:"8px",width:"8px"}):r.jsx(L,{color:"var(--chakra-colors-error-900)",height:"8px",width:"8px"})}),r.jsx("p",{children:d.lowercaseRule})]}),a?.numbers?null:r.jsxs("div",{css:sn(v.numbers),"aria-label":`${d.numberRule}. ${v.numbers?d.requirementMet:d.requirementNotMet}`,children:[r.jsx("div",{children:v.numbers?r.jsx(k,{color:"var(--chakra-colors-success-500)",height:"8px",width:"8px"}):r.jsx(L,{color:"var(--chakra-colors-error-900)",height:"8px",width:"8px"})}),r.jsx("p",{children:d.numberRule})]}),a?.specialCharacters?null:r.jsxs("div",{css:sn(v.specialCharacters),"aria-label":`${d.specialCharRule}. ${v.specialCharacters?d.requirementMet:d.requirementNotMet}`,children:[r.jsx("div",{children:v.specialCharacters?r.jsx(k,{color:"var(--chakra-colors-success-500)",height:"8px",width:"8px"}):r.jsx(L,{color:"var(--chakra-colors-error-900)",height:"8px",width:"8px"})}),r.jsx("p",{children:d.specialCharRule})]})]}):null]});var y},exports.ProgressBar=({progress:e})=>{let t=e;return t>100&&(t=100),t<0&&(t=0),r.jsx("div",{css:
|
|
3734
|
+
`),"aria-live":"polite",role:"status",children:[d.strengthPrefix," ",r.jsx("span",{children:b[v.strength]})]}),r.jsx("div",{css:an(v.strength),children:r.jsx("div",{})}),r.jsxs("div",{css:sn(v.length),"aria-label":`${d.minLengthRule(l)}. ${v.length?d.requirementMet:d.requirementNotMet}`,children:[r.jsx("div",{children:v.length?r.jsx(k,{color:"var(--chakra-colors-success-500)",height:"8px",width:"8px"}):r.jsx(L,{color:"var(--chakra-colors-error-900)",height:"8px",width:"8px"})}),r.jsx("p",{children:d.minLengthRule(l)})]}),a?.uppercase?null:r.jsxs("div",{css:sn(v.uppercase),"aria-label":`${d.uppercaseRule}. ${v.uppercase?d.requirementMet:d.requirementNotMet}`,children:[r.jsx("div",{children:v.uppercase?r.jsx(k,{color:"var(--chakra-colors-success-500)",height:"8px",width:"8px"}):r.jsx(L,{color:"var(--chakra-colors-error-900)",height:"8px",width:"8px"})}),r.jsx("p",{children:d.uppercaseRule})]}),a?.lowercase?null:r.jsxs("div",{css:sn(v.lowercase),"aria-label":`${d.lowercaseRule}. ${v.lowercase?d.requirementMet:d.requirementNotMet}`,children:[r.jsx("div",{children:v.lowercase?r.jsx(k,{color:"var(--chakra-colors-success-500)",height:"8px",width:"8px"}):r.jsx(L,{color:"var(--chakra-colors-error-900)",height:"8px",width:"8px"})}),r.jsx("p",{children:d.lowercaseRule})]}),a?.numbers?null:r.jsxs("div",{css:sn(v.numbers),"aria-label":`${d.numberRule}. ${v.numbers?d.requirementMet:d.requirementNotMet}`,children:[r.jsx("div",{children:v.numbers?r.jsx(k,{color:"var(--chakra-colors-success-500)",height:"8px",width:"8px"}):r.jsx(L,{color:"var(--chakra-colors-error-900)",height:"8px",width:"8px"})}),r.jsx("p",{children:d.numberRule})]}),a?.specialCharacters?null:r.jsxs("div",{css:sn(v.specialCharacters),"aria-label":`${d.specialCharRule}. ${v.specialCharacters?d.requirementMet:d.requirementNotMet}`,children:[r.jsx("div",{children:v.specialCharacters?r.jsx(k,{color:"var(--chakra-colors-success-500)",height:"8px",width:"8px"}):r.jsx(L,{color:"var(--chakra-colors-error-900)",height:"8px",width:"8px"})}),r.jsx("p",{children:d.specialCharRule})]})]}):null]});var y},exports.ProgressBar=({progress:e})=>{let t=e;return t>100&&(t=100),t<0&&(t=0),r.jsx("div",{css:rx,role:"progressbar","aria-label":`Progress: ${t}%`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":t,children:r.jsx("div",{css:ox(t)})})},exports.QualitativeAttribute=({type:e,label:t,caption:o,color:i,onActionClick:a,showActionButton:s,pointIcon:l=r.jsx(W,{color:"#006D2C"}),ariaLabelType:c=""})=>{const[u,d]=n.useState(!0),p=n.useId(),h=n.useId(),f="raster"===e,x="line"===e,g="point"===e,v=n.useId(),m=n.useMemo((()=>{let e=c??`${c},`;x&&(e="line,");return`${e} ${t}${o?`, ${o}`:""}. Currently ${u?"visible":"hidden"}.`}),[u,e,t,o]),b=u?"Hide":"Show";return r.jsxs("div",{css:$i,children:[r.jsx("p",{id:v,css:{position:"absolute",width:1,height:1,margin:-1,padding:0,border:0,clip:"rect(0 0 0 0)",overflow:"hidden"},children:m}),r.jsxs("div",{css:Si,children:[r.jsxs("div",{children:[f&&r.jsx("div",{css:Ci(i)}),x&&r.jsx("div",{css:ji(i)}),g&&r.jsx("div",{css:ki(i),children:l})]}),r.jsxs("div",{children:[r.jsx("p",{id:p,css:Ei,children:t}),o?r.jsx("p",{id:h,css:Ri,children:o}):null]})]}),a&&s?r.jsx("div",{css:Li,children:r.jsx(w,{type:"button",variant:"borderless",label:b,rightIcon:u?r.jsx(M,{}):r.jsx(T,{}),"aria-pressed":u,"aria-labelledby":`${v} ${p}`,onClick:()=>{d((e=>!e)),a?.()}})}):null]})},exports.Radio=Ge,exports.RadioGroup=Ue,exports.RadioList=({label:t,caption:n,name:i,radios:a,defaultValue:s,onCheckedChange:l,errorMessage:c,horizontal:u,variant:d="default",required:p})=>{const h=`${t}. ${n?`${n}.`:""} ${p?"Required.":"Optional."} ${c?`Error: ${c}.`:""} `;return r.jsxs(e.Group,{css:ln,"aria-roledescription":"group","aria-label":h,children:[c?r.jsx("div",{css:pn}):null,r.jsxs("div",{css:(f=!!c,o.css`
|
|
3728
3735
|
margin-left: ${f?"19px":"0px"};
|
|
3729
3736
|
`),children:[r.jsxs("p",{css:cn,"aria-label":t,children:[p&&r.jsx("span",{"aria-label":"required",children:"*"}),t]}),r.jsx("p",{css:un,"aria-label":n,children:n}),c?r.jsx("p",{css:hn,"aria-label":c,children:c}):null,r.jsx("div",{css:dn,children:r.jsx(Ue,{name:i,value:s,onChange:l,horizontal:u&&"card"!==d,children:a.map((e=>r.jsx(Ge,{css:"card"===d?fn:{},...e},e.value)))})})]})]});var f},exports.SSOButtons=ie,exports.ScaleBar=({colors:e,values:t,subLabels:n,isGradient:i})=>{return r.jsxs("div",{css:Oi,children:[i?r.jsx("div",{css:(a=Di(e),o.css`
|
|
3730
3737
|
height: 20px;
|
|
@@ -3733,4 +3740,4 @@ function tp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
|
|
|
3733
3740
|
border: 1px solid ${h("neutral",300)};
|
|
3734
3741
|
border-radius: 4px;
|
|
3735
3742
|
${a?`background: ${a};`:""}
|
|
3736
|
-
`)}):r.jsx("div",{css:Ti,children:e?.map(((e,n)=>r.jsx("div",{"data-test":`${e}-${t?.[n]}`,style:{backgroundColor:e,width:"100%",height:"100%"}},`${e}-${t?.[n]}`)))}),r.jsx("div",{css:Mi,children:t?.map((e=>r.jsx("div",{style:{width:i?"auto":`calc(100% / ${t.length})`,display:"flex",justifyContent:"center"},children:r.jsx("p",{css:Pi,children:e})},e)))}),n&&n.length?r.jsx("div",{css:Mi,children:n.map((e=>r.jsx("div",{style:{width:i?"auto":`calc(100% / ${t.length})`,display:"flex",justifyContent:"center"},children:r.jsx("p",{css:_i,style:{width:"100%"},children:e})},e)))}):null]});var a},exports.Search=({placeholder:t,disabled:o,size:i="default",options:a=[],resultsMaxHeight:s="200px",isLoading:l=!1,displayResults:c="text",onSelect:u,onQueryChange:d,onClear:p,renderResults:f})=>{const[x,g]=n.useState(""),{open:v,onOpen:m,onClose:b}=e.useDisclosure(),[y,w]=n.useState(a),[C,j]=n.useState(-1),[k,$]=n.useState(!1),S=n.useRef(null),E=`search-results-${n.useId()}`,R=e=>{const t=a.find((t=>t.id===e||t.label===e));t&&(u?.(t),g(""),b())};n.useEffect((()=>{if(d?.(x),!x)return void w(a);const e=a.filter((e=>e.id?.toLowerCase().includes(x.toLowerCase())||e.label.toLowerCase().includes(x.toLowerCase())||e.caption?.toLowerCase().includes(x.toLowerCase()))).map((e=>({id:e.id,label:e.label,caption:e.caption,variant:"select",icon:e.icon,onItemClick:()=>R(e.id||e.label)})));w(e),m()}),[x]),n.useEffect((()=>{function e(e){v&&S.current&&!S.current.contains(e.target)&&b()}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[v]);const L=x.length?r.jsx(ce,{style:{marginTop:"8px"},onClick:()=>{g(""),p?.()}}):null,O="none"!==c&&!!x.length&&y.length>0&&v;let T=h("neutral",500);o?T=h("neutral",500):k&&(T=h("primary",700));const M="small"===i?"16px":"20px";return r.jsxs("div",{ref:S,style:{position:"relative",width:"100%"},children:[r.jsx(e.InputGroup,{startElement:r.jsx(oe,{width:M,height:M,fill:T,style:{marginTop:"8px"}}),endElement:L,children:r.jsx(Et,{autoComplete:"off",placeholder:t||"Filter",onChange:e=>{const{value:t}=e.target;g(t)},onFocus:()=>$(!0),onBlur:()=>$(!1),value:x,label:"",style:{paddingLeft:"40px",borderColor:h("neutral",500)},type:"search","aria-label":t||"Search filter","aria-expanded":O,"aria-controls":E,role:"combobox","aria-autocomplete":"list",disabled:o,size:i,noMarginBottom:!0,onKeyDown:e=>{if(O){if("ArrowDown"===e.key&&(e.preventDefault(),j((e=>Math.min(e+1,y.length-1)))),"ArrowUp"===e.key&&(e.preventDefault(),j((e=>Math.max(e-1,0)))),"Enter"===e.key&&(e.preventDefault(),C>=0)){const e=y[C];R(e.id||e.label)}"Escape"===e.key&&b()}}})}),(O||l&&!!x.length)&&"custom"===c&&f&&!l&&f({items:y,highlightedIndex:C,query:x,onSelect:R}),(O||l&&!!x.length)&&r.jsx(e.Portal,{container:S,children:r.jsxs(e.Box,{position:"absolute",width:"100%",backgroundColor:"white",border:"custom"===c?"none":"1px solid",borderColor:"gray.200",borderRadius:"md",zIndex:1e3,overflowY:"auto",maxHeight:s,children:[l&&r.jsx(e.Box,{padding:"1rem",children:r.jsx(e.Spinner,{})}),"text"===c&&!l&&r.jsx(Mf,{highlightedIndex:C,items:y,query:x,onSelect:R}),"list"===c&&!l&&r.jsx(Ui,{items:y,highlightedIndex:C})]})})]})},exports.Select=Qt,exports.Sheet=({header:e,content:t,footer:o,open:i=!1,onClose:a,minimizedHeight:s,midHeight:l=200,maxFullHeight:c,defaultSnap:u="minimized",className:d,blocking:p,zIndex:h=1e3})=>{const f=n.useRef(null),x=n.useRef([]),[g,v]=n.useState(null),m=window.innerWidth>768,b=x.current;let y="Expand sheet";if(null!=g){const e=_h(g,b);e>0&&e<b.length-1?y="Make full screen":e===b.length-1&&(y="Expanded sheet")}const w=!(null==g||!b.length||_h(g,b)!==b.length-1);return r.jsx(Th,{ref:f,css:Ph(!!e,h),className:d,open:i,onDismiss:a,header:r.jsxs("div",{children:[r.jsx("button",{type:"button",disabled:w,"aria-label":y,css:Mh,onKeyDown:e=>{if("Enter"!==e.key&&" "!==e.key)return;e.preventDefault();const t=b[b.length-1];if(m)return void f.current?.snapTo?.((()=>t));const n=g??b[0];let r=b.findIndex((e=>e>n));-1===r&&(r=b.length-1);const o=b[r];f.current?.snapTo?.((()=>o))},children:r.jsx("div",{})}),r.jsx("span",{"aria-live":"polite",style:{position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)"},children:y}),e]}),footer:o,snapPoints:({headerHeight:e,maxHeight:t,footerHeight:n})=>{const r=[20,s||e,l+(o?n:0),c||t-t/6];return x.current=r,r},onSpringEnd:()=>{const e=f.current?.height;e&&v(e)},defaultSnap:({headerHeight:e,maxHeight:t,footerHeight:n})=>{let r=20;return"minimized"===u?r=s||e:"mid"===u?r=l+(o?n:0):"full"===u&&(r=c||t-t/6),r},blocking:p,children:i?t:null})},exports.SimpleMapPin=({onClick:e,triggerRef:n,showFocusState:r,count:o,mode:i,variant:a="simple-pin"})=>t.jsx(_n,{count:o,mode:i,onClick:e,ref:n,showFocusState:r,variant:a}),exports.Slider=rt,exports.SliderInput=({label:e,caption:t,size:o="default",sliderItem:i,required:a,onChange:s})=>{const[l,c]=n.useState(i.value||[]),u=(e,t)=>{const n=e.target.value,r=[...l];let o=n?parseInt(n,10):n;const a=i.min||0,s=i.max||100;o=Number.isNaN(o)?a:o,o=o<a?a:o,o=o>s?s:o,r[t]=o,c(r)},d=(e,t)=>{const n=e.target.value||"0",r=[...l];let o=parseInt(n,10);const a=i.min||0,u=i.max||100;if(o=Number.isNaN(o)?a:o,o=o<a?a:o,o=o>u?u:o,2===l?.length){o=Number.isNaN(o)?a:o;const e=l[0],n=l[1];0===t?(o=o<a?a:o,o=o>n?n:o):1===t&&(o=o<e?e:o,o=o>u?u:o)}r[t]=o,c(r),s&&s(r)};return r.jsxs("div",{children:[r.jsxs("p",{css:xn(o),"aria-label":e,children:[a?r.jsx("span",{children:"*"}):null,e]}),t?r.jsx("p",{css:gn(o),"aria-label":t,children:t}):null,r.jsxs("div",{css:vn,children:[i.step&&i.marks?r.jsx(Qt,{items:i.marks.map((e=>({label:`${e.label}`,value:`${e.value}`}))),placeholder:"",style:{width:"90px"},value:[`${l?.[0]}`],onChange:e=>{const t=e.map((e=>parseInt(e,10)));c(t),s&&s(t)}}):r.jsx(Et,{"aria-label":e,min:i.min,max:i.max,value:l?.[0],type:"number",onChange:e=>u(e,0),onBlur:e=>d(e,0),className:"ds-opacity-control-text-input",onClick:e=>e.target.select()}),r.jsx(rt,{css:{},...i,value:l,onValueChangeEnd:e=>{c(e.value),s&&s(e.value)}}),2===l?.length?r.jsx(Et,{"aria-label":e,min:i.min,max:i.max,value:l?.[1],type:"number",onChange:e=>u(e,1),onBlur:e=>d(e,1),className:"ds-opacity-control-text-input",onClick:e=>e.target.select()}):null]})]})},exports.StepProgressIndicator=({steps:e,currentStep:t})=>r.jsxs("div",{css:rx,children:[e.map(((e,n)=>r.jsxs("div",{css:ox,children:[r.jsx("button",{css:ix(t>=n+1,t<n+1),type:"button",onClick:e.onClick,"aria-current":t===n+1,"aria-disabled":t<n+1,disabled:t<n+1,"aria-label":`Current Step ${n}${e.label?` ${e.label}`:""}`,"data-active":t>=n+1,children:t>n+1?r.jsx(k,{height:"16px",width:"16px"}):n+1}),e.label?r.jsx("p",{css:ax(t===n+1),children:e.label}):null]},`${e.label}-${n}`))),r.jsx("div",{css:sx,children:r.jsx("div",{css:lx})})]}),exports.Switch=it,exports.TabBar=({variant:t="panel",defaultValue:o,tabs:i,onTabClick:a,activationMode:s="manual"})=>{const[l,c]=n.useState(Lf(i,o)||0);return r.jsx("div",{css:jf(t),children:r.jsx(e.Tabs.Root,{width:"full",defaultValue:o||i?.[0]?.value,onValueChange:({value:e})=>{return c(Lf(i,t=e)),void(a&&a(t));var t},activationMode:s,children:r.jsx(e.Tabs.List,{alignItems:"center",border:"none",children:i.map(((o,i)=>r.jsxs(n.Fragment,{children:["view"===t&&1===i&&"left"===Of(l)?r.jsx("div",{css:Sf}):null,r.jsx(e.Tabs.Trigger,{css:[kf,"view"===t&&Ef,"panel"===t&&$f,"transparent"===t&&Rf],"aria-label":o["aria-label"]||o.label,...o,children:r.jsxs(e.Box,{display:"flex",alignItems:"center",gap:"5px",children:[o.icon,o.label]})},o.label),"view"===t&&1===i&&"right"===Of(l)?r.jsx("div",{css:Sf}):null]},o.label)))})})})},exports.Table=({columns:t,data:o=[],renderRow:i,striped:a,stickyHeader:s,pagination:l,selectable:c,selectedRows:u,variant:d="default",onSortColumn:p,onPageSizeChange:f,onPageChange:x,onAllItemsSelected:g,loading:v})=>{const[m,b]=n.useState({key:"",order:""}),{totalItems:y=o.length,currentPage:w=1,pageSize:C=10,showItemCount:j,showItemCountText:k}=l||{},$=(e,t)=>{b({key:e,order:t}),p&&p({key:e,order:t})},S=u?.length===o?.length,R=u&&u.length>0&&!S;return r.jsxs("div",{children:[r.jsxs(e.Table.Root,{css:ea(d),striped:a,stickyHeader:s,interactive:!0,children:[r.jsx(e.Table.Header,{css:ta(d),children:r.jsxs(e.Table.Row,{children:[c?r.jsx(e.Table.ColumnHeader,{children:r.jsx(Te,{name:"header-checkbox",checked:S,indeterminate:R,onCheckedChange:({checked:e})=>{g&&g(e)}})}):null,t.map((t=>r.jsx(e.Table.ColumnHeader,{role:t.sortable?"columnheader":void 0,"aria-sort":t.sortable&&"asc"===m.order?"ascending":t.sortable&&"desc"===m.order?"descending":void 0,children:r.jsxs("div",{css:na,children:[t.label,t.sortable?r.jsxs("div",{css:ra,children:[r.jsx(le,{css:oa(m.key===t.key&&"asc"===m.order),icon:r.jsx(E,{style:{transform:"rotate(180deg)"}}),onClick:()=>$(t.key,"asc"),"aria-label":"Ascending"}),r.jsx(le,{css:oa(m.key===t.key&&"desc"===m.order),icon:r.jsx(E,{}),onClick:()=>$(t.key,"desc"),"aria-label":"Descending"})]}):null]})},t.key)))]})}),r.jsx(e.Table.Body,{css:sa,children:o.map((e=>r.jsx(n.Fragment,{children:i(e)},e.id)))})]}),v?r.jsx("div",{css:la,children:r.jsx(e.Spinner,{size:"lg",color:h("primary",500)})}):null,r.jsxs("div",{css:ia,children:[r.jsx("div",{children:j?r.jsx(Ai,{pageSize:C,currentPage:w,totalItems:y,onPageSizeChange:f,showItemCountText:k}):null}),l?r.jsx("div",{css:aa,children:r.jsx(Qi,{totalItems:y,pageSize:C,currentPage:w,onPageChange:x})}):null]})]})},exports.TableCell=ua,exports.TableRow=ca,exports.Tag=Yt,exports.TextInput=Et,exports.Textarea=({label:t,caption:o,placeholder:i,errorMessage:a,required:s,disabled:l,size:c="default",defaultValue:u="",onChange:d,minLength:p,maxLength:h,...f})=>{const[x,g]=n.useState(u),[v,m]=n.useState(!1),[b,y]=n.useState(!1),[w,C]=n.useState(""),j=n.useId(),k=n.useId(),$=n.useId();n.useEffect((()=>{const{length:e}=u;p&&e<p&&e>0?(m(e<p),y(!1),C(`Enter at least ${p-e} characters`)):p&&0===e&&C(`Min ${p} characters`),h&&e>0?(m(!1),y(e>h),C(`You have ${h-e} characters remaining`)):h&&0===e&&C(`Max ${h} characters`)}),[]);const S=!!a||v||b,E=[o?j:null,S?k:null,w?$:null].filter(Boolean).join(" ")||void 0;return r.jsxs("div",{css:mn(c),children:[S?r.jsx("div",{css:bn}):null,r.jsxs(e.Field.Root,{required:s,invalid:S,gap:"0",style:{marginLeft:S?"19px":"0px"},children:[t?r.jsxs(e.Field.Label,{css:yn(c,l),"aria-label":t,children:[r.jsx(e.Field.RequiredIndicator,{"aria-label":"required"}),t,s?"":r.jsx("span",{children:" (Optional)"})]}):null,o?r.jsx(e.Field.HelperText,{id:j,css:wn(c,l),children:o}):null,a?r.jsx(e.Field.ErrorText,{id:k,css:jn,"aria-label":`Error: ${a}`,"aria-live":"polite",children:a}):null,r.jsx(e.Textarea,{placeholder:i,disabled:l,css:kn(c,x,u),onChange:e=>{g(e.target.value);const{length:t}=e.target.value;p&&h?(m(t<p),y(t>h),C(`You have ${h-t} characters remaining`)):p?(m(t<p),y(!1),C(t<p?`Enter at least ${p-t} characters`:"")):h&&(y(t>h),m(!1),C(`You have ${h-t} characters remaining`)),d&&d(e)},value:x,"aria-describedby":E,_placeholder:{color:"var(--chakra-colors-neutral-500)"},...f}),v&&p?r.jsxs(e.Field.ErrorText,{id:k,css:jn,style:{marginTop:"8px",fontSize:"12px",lineHeight:"16px"},"aria-live":"polite",children:["You need ",p-x.length," more characters"]}):null,b&&h?r.jsxs(e.Field.ErrorText,{id:k,css:jn,style:{marginTop:"8px",fontSize:"12px",lineHeight:"16px"},"aria-live":"polite",children:["You have ",x.length-h," characters too many"]}):null,!w||b||v?null:r.jsx(e.Field.HelperText,{id:$,css:Cn,"aria-live":"polite",children:w})]})]})},exports.Toast=()=>Object.keys(xx).map((t=>r.jsx(e.Portal,{children:r.jsx(e.Toaster,{toaster:xx[t],insetInline:{mdDown:"4"},children:n=>r.jsxs(e.Toast.Root,{css:cx,width:{md:"sm"},children:[r.jsxs(e.Stack,{flexDirection:"row",className:"ds-toast-icon-container",children:["info"===n.type?n.meta?.icon?n.meta.icon:r.jsx(S,{color:"var(--chakra-colors-neutral-700)"}):null,"loading"===n.type?r.jsx(e.Spinner,{size:"lg",borderWidth:"3px",color:"var(--chakra-colors-primary-500)"}):null,"success"===n.type?n.meta?.icon?n.meta.icon:r.jsx(_,{color:"var(--chakra-colors-success-500)"}):null,"warning"===n.type?n.meta?.icon?n.meta.icon:r.jsx(D,{color:"var(--chakra-colors-warning-500)"}):null,"error"===n.type?n.meta?.icon?n.meta.icon:r.jsx(I,{color:"var(--chakra-colors-error-500)"}):null,r.jsxs(e.Stack,{gap:"1",flex:"1",maxWidth:"100%",children:[r.jsx(e.Toast.Title,{css:ux,"aria-label":`${n.title}`,children:n.title}),n.description?r.jsx(e.Toast.Title,{css:dx,"aria-label":`${n.description}`,children:n.description}):null]})]}),n.action||n.meta?.closable?r.jsxs(e.Stack,{flexDirection:"row",children:[n.action?r.jsx(w,{css:px,label:n.action.label,size:"small",variant:"info"===n.type?"primary":"secondary",onClick:()=>{n?.action?.onClick&&n.action.onClick(),xx[t].dismiss()}}):null,n.meta?.closable?r.jsx(w,{css:hx,label:n.meta.closableLabel,"aria-label":n.meta?.closableLabel||"Dismiss",leftIcon:r.jsx(L,{height:"10px!",width:"10px!"}),size:"small",variant:"secondary",onClick:()=>xx[t].dismiss()}):null]}):null]})})},t))),exports.Toolbar=ge,exports.Tooltip=fe,exports.designSystemStyles=p,exports.designSystemStylesForTailwind=d,exports.getThemedColor=h,exports.showToast=e=>{xx[e.placement].create({title:e.label,description:e.caption,duration:e.duration||5e3,meta:{closable:e.closable,icon:e.icon,closableLabel:e.closableLabel},...e})};
|
|
3743
|
+
`)}):r.jsx("div",{css:Ti,children:e?.map(((e,n)=>r.jsx("div",{"data-test":`${e}-${t?.[n]}`,style:{backgroundColor:e,width:"100%",height:"100%"}},`${e}-${t?.[n]}`)))}),r.jsx("div",{css:Mi,children:t?.map((e=>r.jsx("div",{style:{width:i?"auto":`calc(100% / ${t.length})`,display:"flex",justifyContent:"center"},children:r.jsx("p",{css:Pi,children:e})},e)))}),n&&n.length?r.jsx("div",{css:Mi,children:n.map((e=>r.jsx("div",{style:{width:i?"auto":`calc(100% / ${t.length})`,display:"flex",justifyContent:"center"},children:r.jsx("p",{css:_i,style:{width:"100%"},children:e})},e)))}):null]});var a},exports.Search=({placeholder:t,disabled:o,size:i="default",options:a=[],resultsMaxHeight:s="200px",isLoading:l=!1,displayResults:c="text",onSelect:u,onQueryChange:d,onClear:p,renderResults:f})=>{const[x,g]=n.useState(""),{open:v,onOpen:m,onClose:b}=e.useDisclosure(),[y,w]=n.useState(a),[C,j]=n.useState(-1),[k,$]=n.useState(!1),S=n.useRef(null),E=`search-results-${n.useId()}`,R=e=>{const t=a.find((t=>t.id===e||t.label===e));t&&(u?.(t),g(""),b())};n.useEffect((()=>{if(d?.(x),!x)return void w(a);const e=a.filter((e=>e.id?.toLowerCase().includes(x.toLowerCase())||e.label.toLowerCase().includes(x.toLowerCase())||e.caption?.toLowerCase().includes(x.toLowerCase()))).map((e=>({id:e.id,label:e.label,caption:e.caption,variant:"select",icon:e.icon,onItemClick:()=>R(e.id||e.label)})));w(e),m()}),[x]),n.useEffect((()=>{function e(e){v&&S.current&&!S.current.contains(e.target)&&b()}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[v]);const L=x.length?r.jsx(ce,{style:{marginTop:"8px"},onClick:()=>{g(""),p?.()}}):null,O="none"!==c&&!!x.length&&y.length>0&&v;let T=h("neutral",500);o?T=h("neutral",500):k&&(T=h("primary",700));const M="small"===i?"16px":"20px";return r.jsxs("div",{ref:S,style:{position:"relative",width:"100%"},children:[r.jsx(e.InputGroup,{startElement:r.jsx(oe,{width:M,height:M,fill:T,style:{marginTop:"8px"}}),endElement:L,children:r.jsx(Et,{autoComplete:"off",placeholder:t||"Filter",onChange:e=>{const{value:t}=e.target;g(t)},onFocus:()=>$(!0),onBlur:()=>$(!1),value:x,label:"",style:{paddingLeft:"40px",borderColor:h("neutral",500)},type:"search","aria-label":t||"Search filter","aria-expanded":O,"aria-controls":E,role:"combobox","aria-autocomplete":"list",disabled:o,size:i,noMarginBottom:!0,onKeyDown:e=>{if(O){if("ArrowDown"===e.key&&(e.preventDefault(),j((e=>Math.min(e+1,y.length-1)))),"ArrowUp"===e.key&&(e.preventDefault(),j((e=>Math.max(e-1,0)))),"Enter"===e.key&&(e.preventDefault(),C>=0)){const e=y[C];R(e.id||e.label)}"Escape"===e.key&&b()}}})}),(O||l&&!!x.length)&&"custom"===c&&f&&!l&&f({items:y,highlightedIndex:C,query:x,onSelect:R}),(O||l&&!!x.length)&&r.jsx(e.Portal,{container:S,children:r.jsxs(e.Box,{position:"absolute",width:"100%",backgroundColor:"white",border:"custom"===c?"none":"1px solid",borderColor:"gray.200",borderRadius:"md",zIndex:1e3,overflowY:"auto",maxHeight:s,children:[l&&r.jsx(e.Box,{padding:"1rem",children:r.jsx(e.Spinner,{})}),"text"===c&&!l&&r.jsx(Mf,{highlightedIndex:C,items:y,query:x,onSelect:R}),"list"===c&&!l&&r.jsx(Ui,{items:y,highlightedIndex:C})]})})]})},exports.Select=Qt,exports.Sheet=({header:e,content:t,footer:o,open:i=!1,onClose:a,minimizedHeight:s,midHeight:l=200,maxFullHeight:c,defaultSnap:u="minimized",className:d,blocking:p,zIndex:h=1e3})=>{const f=n.useRef(null),x=n.useRef([]),[g,v]=n.useState(null),m=window.innerWidth>768,b=x.current;let y="Expand sheet";if(null!=g){const e=_h(g,b);e>0&&e<b.length-1?y="Make full screen":e===b.length-1&&(y="Expanded sheet")}const w=!(null==g||!b.length||_h(g,b)!==b.length-1);return r.jsx(Th,{ref:f,css:Ph(!!e,h),className:d,open:i,onDismiss:a,header:r.jsxs("div",{children:[r.jsx("button",{type:"button",disabled:w,"aria-label":y,css:Mh,onKeyDown:e=>{if("Enter"!==e.key&&" "!==e.key)return;e.preventDefault();const t=b[b.length-1];if(m)return void f.current?.snapTo?.((()=>t));const n=g??b[0];let r=b.findIndex((e=>e>n));-1===r&&(r=b.length-1);const o=b[r];f.current?.snapTo?.((()=>o))},children:r.jsx("div",{})}),r.jsx("span",{"aria-live":"polite",style:{position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)"},children:y}),e]}),footer:o,snapPoints:({headerHeight:e,maxHeight:t,footerHeight:n})=>{const r=[20,s||e,l+(o?n:0),c||t-t/6];return x.current=r,r},onSpringEnd:()=>{const e=f.current?.height;e&&v(e)},defaultSnap:({headerHeight:e,maxHeight:t,footerHeight:n})=>{let r=20;return"minimized"===u?r=s||e:"mid"===u?r=l+(o?n:0):"full"===u&&(r=c||t-t/6),r},blocking:p,children:i?t:null})},exports.SimpleMapPin=({onClick:e,triggerRef:n,showFocusState:r,count:o,mode:i,variant:a="simple-pin"})=>t.jsx(_n,{count:o,mode:i,onClick:e,ref:n,showFocusState:r,variant:a}),exports.Slider=rt,exports.SliderInput=({label:e,caption:t,size:o="default",sliderItem:i,required:a,onChange:s})=>{const[l,c]=n.useState(i.value||[]),u=(e,t)=>{const n=e.target.value,r=[...l];let o=n?parseInt(n,10):n;const a=i.min||0,s=i.max||100;o=Number.isNaN(o)?a:o,o=o<a?a:o,o=o>s?s:o,r[t]=o,c(r)},d=(e,t)=>{const n=e.target.value||"0",r=[...l];let o=parseInt(n,10);const a=i.min||0,u=i.max||100;if(o=Number.isNaN(o)?a:o,o=o<a?a:o,o=o>u?u:o,2===l?.length){o=Number.isNaN(o)?a:o;const e=l[0],n=l[1];0===t?(o=o<a?a:o,o=o>n?n:o):1===t&&(o=o<e?e:o,o=o>u?u:o)}r[t]=o,c(r),s&&s(r)};return r.jsxs("div",{children:[r.jsxs("p",{css:xn(o),"aria-label":e,children:[a?r.jsx("span",{children:"*"}):null,e]}),t?r.jsx("p",{css:gn(o),"aria-label":t,children:t}):null,r.jsxs("div",{css:vn,children:[i.step&&i.marks?r.jsx(Qt,{items:i.marks.map((e=>({label:`${e.label}`,value:`${e.value}`}))),placeholder:"",style:{width:"90px"},value:[`${l?.[0]}`],onChange:e=>{const t=e.map((e=>parseInt(e,10)));c(t),s&&s(t)}}):r.jsx(Et,{"aria-label":e,min:i.min,max:i.max,value:l?.[0],type:"number",onChange:e=>u(e,0),onBlur:e=>d(e,0),className:"ds-opacity-control-text-input",onClick:e=>e.target.select()}),r.jsx(rt,{css:{},...i,value:l,onValueChangeEnd:e=>{c(e.value),s&&s(e.value)}}),2===l?.length?r.jsx(Et,{"aria-label":e,min:i.min,max:i.max,value:l?.[1],type:"number",onChange:e=>u(e,1),onBlur:e=>d(e,1),className:"ds-opacity-control-text-input",onClick:e=>e.target.select()}):null]})]})},exports.StepProgressIndicator=({steps:e,currentStep:t})=>r.jsxs("div",{css:ix,children:[e.map(((e,n)=>r.jsxs("div",{css:ax,children:[r.jsx("button",{css:sx(t>=n+1,t<n+1),type:"button",onClick:e.onClick,"aria-current":t===n+1,"aria-disabled":t<n+1,disabled:t<n+1,"aria-label":`Current Step ${n}${e.label?` ${e.label}`:""}`,"data-active":t>=n+1,children:t>n+1?r.jsx(k,{height:"16px",width:"16px"}):n+1}),e.label?r.jsx("p",{css:lx(t===n+1),children:e.label}):null]},`${e.label}-${n}`))),r.jsx("div",{css:cx,children:r.jsx("div",{css:ux})})]}),exports.Switch=it,exports.TabBar=({variant:t="panel",defaultValue:o,tabs:i,onTabClick:a,activationMode:s="manual"})=>{const[l,c]=n.useState(Lf(i,o)||0);return r.jsx("div",{css:jf(t),children:r.jsx(e.Tabs.Root,{width:"full",defaultValue:o||i?.[0]?.value,onValueChange:({value:e})=>{return c(Lf(i,t=e)),void(a&&a(t));var t},activationMode:s,children:r.jsx(e.Tabs.List,{alignItems:"center",border:"none",children:i.map(((o,i)=>r.jsxs(n.Fragment,{children:["view"===t&&1===i&&"left"===Of(l)?r.jsx("div",{css:Sf}):null,r.jsx(e.Tabs.Trigger,{css:[kf,"view"===t&&Ef,"panel"===t&&$f,"transparent"===t&&Rf],"aria-label":o["aria-label"]||o.label,...o,children:r.jsxs(e.Box,{display:"flex",alignItems:"center",gap:"5px",children:[o.icon,o.label]})},o.label),"view"===t&&1===i&&"right"===Of(l)?r.jsx("div",{css:Sf}):null]},o.label)))})})})},exports.Table=({columns:t,data:o=[],renderRow:i,striped:a,stickyHeader:s,pagination:l,selectable:c,selectedRows:u,variant:d="default",onSortColumn:p,onPageSizeChange:f,onPageChange:x,onAllItemsSelected:g,loading:v})=>{const[m,b]=n.useState({key:"",order:""}),{totalItems:y=o.length,currentPage:w=1,pageSize:C=10,showItemCount:j,showItemCountText:k}=l||{},$=(e,t)=>{b({key:e,order:t}),p&&p({key:e,order:t})},S=u?.length===o?.length,R=u&&u.length>0&&!S;return r.jsxs("div",{children:[r.jsxs(e.Table.Root,{css:ea(d),striped:a,stickyHeader:s,interactive:!0,children:[r.jsx(e.Table.Header,{css:ta(d),children:r.jsxs(e.Table.Row,{children:[c?r.jsx(e.Table.ColumnHeader,{children:r.jsx(Te,{name:"header-checkbox",checked:S,indeterminate:R,onCheckedChange:({checked:e})=>{g&&g(e)}})}):null,t.map((t=>r.jsx(e.Table.ColumnHeader,{role:t.sortable?"columnheader":void 0,"aria-sort":t.sortable&&"asc"===m.order?"ascending":t.sortable&&"desc"===m.order?"descending":void 0,children:r.jsxs("div",{css:na,children:[t.label,t.sortable?r.jsxs("div",{css:ra,children:[r.jsx(le,{css:oa(m.key===t.key&&"asc"===m.order),icon:r.jsx(E,{style:{transform:"rotate(180deg)"}}),onClick:()=>$(t.key,"asc"),"aria-label":"Ascending"}),r.jsx(le,{css:oa(m.key===t.key&&"desc"===m.order),icon:r.jsx(E,{}),onClick:()=>$(t.key,"desc"),"aria-label":"Descending"})]}):null]})},t.key)))]})}),r.jsx(e.Table.Body,{css:sa,children:o.map((e=>r.jsx(n.Fragment,{children:i(e)},e.id)))})]}),v?r.jsx("div",{css:la,children:r.jsx(e.Spinner,{size:"lg",color:h("primary",500)})}):null,r.jsxs("div",{css:ia,children:[r.jsx("div",{children:j?r.jsx(Ai,{pageSize:C,currentPage:w,totalItems:y,onPageSizeChange:f,showItemCountText:k}):null}),l?r.jsx("div",{css:aa,children:r.jsx(Qi,{totalItems:y,pageSize:C,currentPage:w,onPageChange:x})}):null]})]})},exports.TableCell=ua,exports.TableRow=ca,exports.Tag=Yt,exports.TextInput=Et,exports.Textarea=({label:t,caption:o,placeholder:i,errorMessage:a,required:s,disabled:l,size:c="default",defaultValue:u="",onChange:d,minLength:p,maxLength:h,...f})=>{const[x,g]=n.useState(u),[v,m]=n.useState(!1),[b,y]=n.useState(!1),[w,C]=n.useState(""),j=n.useId(),k=n.useId(),$=n.useId();n.useEffect((()=>{const{length:e}=u;p&&e<p&&e>0?(m(e<p),y(!1),C(`Enter at least ${p-e} characters`)):p&&0===e&&C(`Min ${p} characters`),h&&e>0?(m(!1),y(e>h),C(`You have ${h-e} characters remaining`)):h&&0===e&&C(`Max ${h} characters`)}),[]);const S=!!a||v||b,E=[o?j:null,S?k:null,w?$:null].filter(Boolean).join(" ")||void 0;return r.jsxs("div",{css:mn(c),children:[S?r.jsx("div",{css:bn}):null,r.jsxs(e.Field.Root,{required:s,invalid:S,gap:"0",style:{marginLeft:S?"19px":"0px"},children:[t?r.jsxs(e.Field.Label,{css:yn(c,l),"aria-label":t,children:[r.jsx(e.Field.RequiredIndicator,{"aria-label":"required"}),t,s?"":r.jsx("span",{children:" (Optional)"})]}):null,o?r.jsx(e.Field.HelperText,{id:j,css:wn(c,l),children:o}):null,a?r.jsx(e.Field.ErrorText,{id:k,css:jn,"aria-label":`Error: ${a}`,"aria-live":"polite",children:a}):null,r.jsx(e.Textarea,{placeholder:i,disabled:l,css:kn(c,x,u),onChange:e=>{g(e.target.value);const{length:t}=e.target.value;p&&h?(m(t<p),y(t>h),C(`You have ${h-t} characters remaining`)):p?(m(t<p),y(!1),C(t<p?`Enter at least ${p-t} characters`:"")):h&&(y(t>h),m(!1),C(`You have ${h-t} characters remaining`)),d&&d(e)},value:x,"aria-describedby":E,_placeholder:{color:"var(--chakra-colors-neutral-500)"},...f}),v&&p?r.jsxs(e.Field.ErrorText,{id:k,css:jn,style:{marginTop:"8px",fontSize:"12px",lineHeight:"16px"},"aria-live":"polite",children:["You need ",p-x.length," more characters"]}):null,b&&h?r.jsxs(e.Field.ErrorText,{id:k,css:jn,style:{marginTop:"8px",fontSize:"12px",lineHeight:"16px"},"aria-live":"polite",children:["You have ",x.length-h," characters too many"]}):null,!w||b||v?null:r.jsx(e.Field.HelperText,{id:$,css:Cn,"aria-live":"polite",children:w})]})]})},exports.Toast=()=>Object.keys(vx).map((t=>r.jsx(e.Portal,{children:r.jsx(e.Toaster,{toaster:vx[t],insetInline:{mdDown:"4"},children:n=>r.jsxs(e.Toast.Root,{css:dx,width:{md:"sm"},children:[r.jsxs(e.Stack,{flexDirection:"row",className:"ds-toast-icon-container",children:["info"===n.type?n.meta?.icon?n.meta.icon:r.jsx(S,{color:"var(--chakra-colors-neutral-700)"}):null,"loading"===n.type?r.jsx(e.Spinner,{size:"lg",borderWidth:"3px",color:"var(--chakra-colors-primary-500)"}):null,"success"===n.type?n.meta?.icon?n.meta.icon:r.jsx(_,{color:"var(--chakra-colors-success-500)"}):null,"warning"===n.type?n.meta?.icon?n.meta.icon:r.jsx(D,{color:"var(--chakra-colors-warning-500)"}):null,"error"===n.type?n.meta?.icon?n.meta.icon:r.jsx(I,{color:"var(--chakra-colors-error-500)"}):null,r.jsxs(e.Stack,{gap:"1",flex:"1",maxWidth:"100%",children:[r.jsx(e.Toast.Title,{css:px,"aria-label":`${n.title}`,children:n.title}),n.description?r.jsx(e.Toast.Title,{css:hx,"aria-label":`${n.description}`,children:n.description}):null]})]}),n.action||n.meta?.closable?r.jsxs(e.Stack,{flexDirection:"row",children:[n.action?r.jsx(w,{css:fx,label:n.action.label,size:"small",variant:"info"===n.type?"primary":"secondary",onClick:()=>{n?.action?.onClick&&n.action.onClick(),vx[t].dismiss()}}):null,n.meta?.closable?r.jsx(w,{css:xx,label:n.meta.closableLabel,"aria-label":n.meta?.closableLabel||"Dismiss",leftIcon:r.jsx(L,{height:"10px!",width:"10px!"}),size:"small",variant:"secondary",onClick:()=>vx[t].dismiss()}):null]}):null]})})},t))),exports.Toolbar=ge,exports.Tooltip=fe,exports.designSystemStyles=p,exports.designSystemStylesForTailwind=d,exports.getThemedColor=h,exports.showToast=e=>{vx[e.placement].create({title:e.label,description:e.caption,duration:e.duration||5e3,meta:{closable:e.closable,icon:e.icon,closableLabel:e.closableLabel},...e})};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _chakra_ui_react from '@chakra-ui/react';
|
|
2
|
-
import { ButtonProps as ButtonProps$1, Checkbox as Checkbox$1, RadioCardRootProps, RadioGroup as RadioGroup$1, Slider as Slider$1, Switch as Switch$1, SelectRootProps, SliderRootProps, TextareaProps as TextareaProps$1, InputProps, Tag as Tag$1, Accordion, Table as Table$1, Tabs } from '@chakra-ui/react';
|
|
2
|
+
import { ButtonProps as ButtonProps$1, Checkbox as Checkbox$1, RadioCardRootProps, RadioGroup as RadioGroup$1, Slider as Slider$1, Switch as Switch$1, SelectRootProps, SliderRootProps, TextareaProps as TextareaProps$1, InputProps, Tag as Tag$1, Accordion, Table as Table$1, Tabs, Alert } from '@chakra-ui/react';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import * as React$1 from 'react';
|
|
5
5
|
import React__default, { ReactNode, ReactElement, Ref } from 'react';
|
|
@@ -1026,6 +1026,17 @@ type InlineMessageProps = {
|
|
|
1026
1026
|
|
|
1027
1027
|
declare const InlineMessage: ({ label, caption, variant, size, icon, onActionClick, actionLabel, isButtonRight, buttonLeftIcon, buttonRightIcon, }: InlineMessageProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
1028
1028
|
|
|
1029
|
+
interface AlertProps extends Omit<Alert.RootProps, 'title' | 'variant'> {
|
|
1030
|
+
title?: React.ReactNode;
|
|
1031
|
+
icon?: React.ReactElement;
|
|
1032
|
+
onClose?: () => void;
|
|
1033
|
+
variant?: 'general-white' | 'general-grey' | 'information' | 'success' | 'warning' | 'error';
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
/** @jsxImportSource @emotion/react */
|
|
1037
|
+
|
|
1038
|
+
declare const AlertBanner: React$1.ForwardRefExoticComponent<AlertProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
1039
|
+
|
|
1029
1040
|
type ProgressBarProps = {
|
|
1030
1041
|
progress: number;
|
|
1031
1042
|
};
|
|
@@ -1063,4 +1074,4 @@ type ToastProps = {
|
|
|
1063
1074
|
|
|
1064
1075
|
declare const showToast: (props: ToastProps) => void;
|
|
1065
1076
|
|
|
1066
|
-
export { AnalysisWidget, Avatar, Badge, BaseMap, Breadcrumb, Button, Checkbox, CheckboxList, type CheckboxListLabels, CheckboxOptionCard, CloseButton, ClusterPoint, type DesignSystemLabels, DesignSystemLocaleProvider, type DesignSystemLocaleProviderProps, ExtendableCard, Footer, IconButton, InlineMessage, InputWithUnits, ItemCount, LayerGroup, LayerGroupContainer, LayerItem, LayerParameters, LegendItem, List, MapControlsToolbar, MapMarker, MapMarkers, MapPopUp, Menu, MobileTabBar, Modal, MultiActionButton, Navbar, NavigationRail, OptionCard, Pagination, Panel, Password, type PasswordLabels, ProgressBar, QualitativeAttribute, Radio, RadioGroup, RadioList, SSOButtons, ScaleBar, Search, Select, Sheet, SimpleMapPin, Slider, SliderInput, StepProgressIndicator, Switch, TabBar, Table, TableCell, TableRow, Tag, TextInput, type TextInputLabels, Textarea, Toast, Toolbar, Tooltip, designSystemStyles, designSystemStylesForTailwind, getThemedColor, showToast };
|
|
1077
|
+
export { AlertBanner, AnalysisWidget, Avatar, Badge, BaseMap, Breadcrumb, Button, Checkbox, CheckboxList, type CheckboxListLabels, CheckboxOptionCard, CloseButton, ClusterPoint, type DesignSystemLabels, DesignSystemLocaleProvider, type DesignSystemLocaleProviderProps, ExtendableCard, Footer, IconButton, InlineMessage, InputWithUnits, ItemCount, LayerGroup, LayerGroupContainer, LayerItem, LayerParameters, LegendItem, List, MapControlsToolbar, MapMarker, MapMarkers, MapPopUp, Menu, MobileTabBar, Modal, MultiActionButton, Navbar, NavigationRail, OptionCard, Pagination, Panel, Password, type PasswordLabels, ProgressBar, QualitativeAttribute, Radio, RadioGroup, RadioList, SSOButtons, ScaleBar, Search, Select, Sheet, SimpleMapPin, Slider, SliderInput, StepProgressIndicator, Switch, TabBar, Table, TableCell, TableRow, Tag, TextInput, type TextInputLabels, Textarea, Toast, Toolbar, Tooltip, designSystemStyles, designSystemStylesForTailwind, getThemedColor, showToast };
|