@worldresources/wri-design-systems 2.202.4 → 2.202.6
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 +30 -30
- package/dist/index.d.ts +2 -1
- package/dist/index.esm.js +137 -137
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -592,7 +592,7 @@
|
|
|
592
592
|
padding: ${"small"===e?`${k(100)} ${k(200)}`:k(300)};
|
|
593
593
|
background-color: ${w("neutral",100)};
|
|
594
594
|
color: ${w("neutral",800)};
|
|
595
|
-
border: ${M(100)} solid ${w("neutral",
|
|
595
|
+
border: ${M(100)} solid ${w("neutral",400)};
|
|
596
596
|
box-shadow: 0 0.0625rem 0.125rem 0 #0000000d;
|
|
597
597
|
font-size: ${C("small"===e?300:400)};
|
|
598
598
|
|
|
@@ -2346,7 +2346,7 @@
|
|
|
2346
2346
|
&:disabled {
|
|
2347
2347
|
background-color: ${w("neutral",200)};
|
|
2348
2348
|
}
|
|
2349
|
-
`,jw=({id:t,label:n,caption:o,icon:i,value:s,variant:a="data",onItemClick:l,isExpanded:c=!1,ariaLabel:d,disabled:u=!1,isHighlighted:h=!1})=>{const p=("navigation"===a||"select"===a)&&!!l,f=p?e.chakra.button:e.chakra.div,m=d||("data"===a&&
|
|
2349
|
+
`,jw=({id:t,label:n,caption:o,icon:i,value:s,variant:a="data",onItemClick:l,isExpanded:c=!1,ariaLabel:d,disabled:u=!1,isHighlighted:h=!1})=>{const p=("navigation"===a||"select"===a)&&!!l,f=p?e.chakra.button:e.chakra.div,m="string"==typeof n||"number"==typeof n||"bigint"==typeof n?String(n):"",g="string"==typeof s||"number"==typeof s||"bigint"==typeof s?String(s):"",b=d||("data"===a&&g?`${m}, ${g}`:m);return r.jsxs(f,{id:t,css:["data"===a?Mw:Ew,h&&{backgroundColor:w("neutral",200)}],onClick:p?l:void 0,tabIndex:p?0:void 0,onKeyDown:e=>{p&&("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),l?.()))},role:p?"button":void 0,"aria-expanded":p?c:void 0,"aria-label":b,disabled:u,"data-selected":h||void 0,"data-highlighted":h||void 0,children:[r.jsxs(e.Flex,{gap:3,flex:"1",overflow:"hidden",children:[i,r.jsxs(e.Box,{flex:"1",minWidth:0,children:[r.jsx(e.Text,{fontWeight:"data"===a?"400":"700",css:Cw(u),children:n}),o&&r.jsx(e.Text,{css:kw,children:o})]})]}),"data"===a&&s&&r.jsx(e.Text,{css:Sw,children:s}),"navigation"===a&&r.jsx(e.Icon,{as:Zf,boxSize:4,"aria-hidden":"true",css:$w(u)})]})},Tw=({items:t,noBorder:n,highlightedIndex:o})=>r.jsx(e.Box,{css:ww(n),children:t.map(((e,t)=>r.jsx(jw,{id:e.id,icon:e.icon,label:e.label,caption:e.caption,value:e.value,variant:e.variant??"data",onItemClick:e.onItemClick,isHighlighted:t===o||e.isHighlighted},e.id??e.label)))}),Ow=i.css`
|
|
2350
2350
|
background: transparent;
|
|
2351
2351
|
svg {
|
|
2352
2352
|
path {
|
|
@@ -3851,7 +3851,7 @@ function _E(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
|
|
|
3851
3851
|
&:active {
|
|
3852
3852
|
background-color: ${kf(40)};
|
|
3853
3853
|
}
|
|
3854
|
-
`,qO=({text:e,query:t})=>{if(!t)return e;const n=new RegExp(`(${t})`,"ig"),o=e.split(n);return r.jsx(r.Fragment,{children:o.map((e=>n.test(e)?r.jsx("strong",{children:e},e):r.jsx("span",{children:e},e)))})},WO=({items:t,query:o,onSelect:i,highlightedIndex:s})=>{const a=n.useRef(null);return n.useEffect((()=>{if(!a.current)return;const e=a.current.children[s];e&&e.scrollIntoView({block:"nearest"})}),[s]),r.jsx(e.Box,{ref:a,padding:"0.5rem",children:t.map(((t,n)=>r.jsx(e.Box,{css:FO,"data-highlighted":n===s||void 0,onClick:()=>i(t.id||
|
|
3854
|
+
`,qO=({text:e,query:t})=>{if(!t)return e;const n=new RegExp(`(${t})`,"ig"),o=e.split(n);return r.jsx(r.Fragment,{children:o.map((e=>n.test(e)?r.jsx("strong",{children:e},e):r.jsx("span",{children:e},e)))})},WO=({items:t,query:o,onSelect:i,highlightedIndex:s})=>{const a=n.useRef(null);return n.useEffect((()=>{if(!a.current)return;const e=a.current.children[s];e&&e.scrollIntoView({block:"nearest"})}),[s]),r.jsx(e.Box,{ref:a,padding:"0.5rem",children:t.map(((t,n)=>{const a=t.searchLabel||("string"==typeof t.label||"number"==typeof t.label?String(t.label):"");return r.jsx(e.Box,{css:FO,"data-highlighted":n===s||void 0,onClick:()=>i(t.id||a),children:"string"==typeof t.label||"number"==typeof t.label?r.jsx(qO,{text:String(t.label),query:o}):t.label},t.id)}))})},UO=e=>e.searchLabel?e.searchLabel:"string"==typeof e.label||"number"==typeof e.label?String(e.label):"",KO={small:k(400),medium:k(600),large:k(1e3),default:k(400)};function GO(e,t,n,r){const o=function(e,t){return null!=t&&""!==t?u(t):e&&KO[e]?KO[e]:KO.default}(e,t),s=n?w("neutral",200):w("primary",300),a=r??s,l=r&&n?"opacity: 0.7;":"",c=w("neutral",n?400:800);return i.css`
|
|
3855
3855
|
height: ${o};
|
|
3856
3856
|
width: ${o};
|
|
3857
3857
|
border-radius: 50%;
|
|
@@ -3886,17 +3886,17 @@ function _E(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
|
|
|
3886
3886
|
background-color: ${w("primary",500)};
|
|
3887
3887
|
}
|
|
3888
3888
|
}
|
|
3889
|
-
`}const
|
|
3889
|
+
`}const ZO=e=>i.css`
|
|
3890
3890
|
width: ${e||k(400)};
|
|
3891
3891
|
position: absolute;
|
|
3892
3892
|
top: -${k(200)};
|
|
3893
3893
|
left: 0.9375rem;
|
|
3894
|
-
`,
|
|
3894
|
+
`,JO=i.css`
|
|
3895
3895
|
font-size: ${C(200)};
|
|
3896
3896
|
line-height: ${S(400)};
|
|
3897
3897
|
font-weight: 700;
|
|
3898
3898
|
color: ${w("primary",800)};
|
|
3899
|
-
`,
|
|
3899
|
+
`,XO=n.forwardRef((({name:t,ariaLabel:n,size:o="medium",customSize:s,src:a,srcSet:l,onClick:c,notificationCount:d,disabled:u=!0,customBackgroundColor:h="",labels:p},f)=>{const m=Vf("Avatar",p),g=()=>{u||c?.()},b=(()=>{let e="";return d&&d>0&&(e=`${d>99?"99+":d}`),e})();let v="1rem";d&&d>99?v="1.75rem":d&&d>9&&(v="1.375rem");const y=!!a||!!l,x=c&&!u;return r.jsxs(e.Avatar.Root,{"aria-label":n||t,ref:f,css:GO(o,s,u,h),onClick:g,onKeyDown:e=>{u||"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),g())},role:x?"button":"img",tabIndex:x?0:void 0,"aria-disabled":x?u:void 0,children:[y&&r.jsx(e.Avatar.Image,{src:a,srcSet:l,alt:n||t||"Avatar image"}),!y&&t&&r.jsx(e.Avatar.Fallback,{name:t,css:JO}),!y&&!t&&r.jsx(wm,{size:"100%",style:{padding:"15%",color:u?w("neutral",400):void 0}}),b.length>0?r.jsx("div",{css:ZO(v),children:r.jsx("div",{css:i.css`
|
|
3900
3900
|
height: ${k(400)};
|
|
3901
3901
|
width: auto;
|
|
3902
3902
|
background-color: ${w("error",500)};
|
|
@@ -3909,16 +3909,16 @@ function _E(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
|
|
|
3909
3909
|
line-height: ${S(400)};
|
|
3910
3910
|
font-weight: 700;
|
|
3911
3911
|
color: ${w("error",100)};
|
|
3912
|
-
`,children:r.jsx("p",{"aria-label":m.unreadMessagesLabel(d||0),children:b})})}):null]})})),
|
|
3912
|
+
`,children:r.jsx("p",{"aria-label":m.unreadMessagesLabel(d||0),children:b})})}):null]})})),YO=i.css`
|
|
3913
3913
|
display: flex;
|
|
3914
3914
|
justify-content: flex-start;
|
|
3915
3915
|
align-items: center;
|
|
3916
3916
|
gap: ${k(200)};
|
|
3917
|
-
`,
|
|
3917
|
+
`,QO=e=>i.css`
|
|
3918
3918
|
width: ${e||k(400)};
|
|
3919
3919
|
position: relative;
|
|
3920
3920
|
display: flex;
|
|
3921
|
-
`,
|
|
3921
|
+
`,eL=i.css`
|
|
3922
3922
|
height: ${k(100)};
|
|
3923
3923
|
width: ${k(100)};
|
|
3924
3924
|
background-color: ${w("error",500)};
|
|
@@ -3926,7 +3926,7 @@ function _E(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
|
|
|
3926
3926
|
position: absolute;
|
|
3927
3927
|
top: 0rem;
|
|
3928
3928
|
right: 0rem;
|
|
3929
|
-
`,
|
|
3929
|
+
`,tL=i.css`
|
|
3930
3930
|
height: 0.625rem;
|
|
3931
3931
|
background-color: ${w("error",500)};
|
|
3932
3932
|
padding: 0 0.1875rem 0.0625rem 0.1875rem;
|
|
@@ -3937,12 +3937,12 @@ function _E(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
|
|
|
3937
3937
|
position: absolute;
|
|
3938
3938
|
top: -${k(50)};
|
|
3939
3939
|
left: 0.5625rem;
|
|
3940
|
-
`,
|
|
3940
|
+
`,nL=i.css`
|
|
3941
3941
|
font-size: ${C(200)};
|
|
3942
3942
|
line-height: ${S(400)};
|
|
3943
3943
|
font-weight: 700;
|
|
3944
3944
|
color: ${w("error",100)};
|
|
3945
|
-
`,
|
|
3945
|
+
`,rL=i.css`
|
|
3946
3946
|
height: ${k(400)};
|
|
3947
3947
|
min-width: ${k(400)};
|
|
3948
3948
|
background-color: ${w("error",500)};
|
|
@@ -3951,44 +3951,44 @@ function _E(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
|
|
|
3951
3951
|
justify-content: center;
|
|
3952
3952
|
align-items: center;
|
|
3953
3953
|
padding: 0rem ${k(100)} 0.0625rem ${k(100)};
|
|
3954
|
-
`,
|
|
3954
|
+
`,oL=i.css`
|
|
3955
3955
|
font-size: ${C(400)};
|
|
3956
3956
|
line-height: ${S(600)};
|
|
3957
3957
|
font-weight: 700;
|
|
3958
3958
|
color: ${w("error",100)};
|
|
3959
|
-
`,
|
|
3959
|
+
`,iL=e=>{let t="",n="",r="";return"success"===e?(t=w("success",100),n=w("success",500),r=w("success",300)):"warning"===e?(t=w("warning",100),n=w("warning",500),r=w("warning",300)):"error"===e?(t=w("error",100),n=w("error",500),r=w("error",300)):"information"===e?(t=w("secondary",100),n=w("secondary",500),r=w("secondary",200)):"general-grey"===e?(t=w("neutral",200),n=w("neutral",700),r=w("neutral",300)):(t=w("neutral",100),n=w("neutral",700),r=w("neutral",300)),i.css`
|
|
3960
3960
|
display: flex;
|
|
3961
3961
|
color: ${n};
|
|
3962
3962
|
align-items: center;
|
|
3963
3963
|
background-color: ${t};
|
|
3964
3964
|
border-bottom: ${M(100)} solid ${r};
|
|
3965
3965
|
border-radius: 0;
|
|
3966
|
-
`},
|
|
3966
|
+
`},sL=l.forwardRef((({title:t,children:n,icon:o,variant:i,onClose:s,labels:a},c)=>{const d=Vf("AlertBanner",a),[u,h]=l.useState(!0),p="success"===i?r.jsx(em,{}):"warning"===i?r.jsx(tm,{}):r.jsx(Kf,{});return u?r.jsxs(e.Alert.Root,{css:iL(i),children:[r.jsx(e.Alert.Indicator,{children:o||p}),n?r.jsx(e.Alert.Content,{children:r.jsxs("div",{style:{display:"flex",gap:"0.75rem",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,{"aria-label":d.closeAlertLabel,pos:"absolute",insetEnd:"2",_hover:{bg:"gray.200"},onClick:()=>{h(!1),s?.()}})]}):null})),aL=i.css`
|
|
3967
3967
|
height: ${k(200)};
|
|
3968
3968
|
width: 100%;
|
|
3969
3969
|
background-color: ${w("neutral",300)};
|
|
3970
3970
|
display: flex;
|
|
3971
3971
|
align-items: center;
|
|
3972
3972
|
justify-content: flex-start;
|
|
3973
|
-
`,
|
|
3973
|
+
`,lL=(e,t)=>i.css`
|
|
3974
3974
|
height: 100%;
|
|
3975
3975
|
width: ${e}%;
|
|
3976
3976
|
background-color: ${t??w("primary",500)};
|
|
3977
3977
|
transition: width 0.5s ease-in-out;
|
|
3978
|
-
`,
|
|
3978
|
+
`,cL=i.css`
|
|
3979
3979
|
width: 100%;
|
|
3980
3980
|
display: flex;
|
|
3981
3981
|
align-items: center;
|
|
3982
3982
|
justify-content: space-between;
|
|
3983
3983
|
position: relative;
|
|
3984
|
-
`,
|
|
3984
|
+
`,dL=i.css`
|
|
3985
3985
|
height: 3.75rem;
|
|
3986
3986
|
width: ${k(2e3)};
|
|
3987
3987
|
display: flex;
|
|
3988
3988
|
flex-direction: column;
|
|
3989
3989
|
align-items: center;
|
|
3990
3990
|
justify-content: space-between;
|
|
3991
|
-
`,
|
|
3991
|
+
`,uL=(e,t)=>i.css`
|
|
3992
3992
|
height: ${k(800)};
|
|
3993
3993
|
width: ${k(800)};
|
|
3994
3994
|
display: flex;
|
|
@@ -4024,12 +4024,12 @@ function _E(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
|
|
|
4024
4024
|
}
|
|
4025
4025
|
|
|
4026
4026
|
${t?`\n background-color: ${w("neutral",300)};\n \n &:hover {\n background-color: ${w("neutral",300)};\n box-shadow: none;\n }\n `:""}
|
|
4027
|
-
`,
|
|
4027
|
+
`,hL=e=>i.css`
|
|
4028
4028
|
color: ${w("neutral",e?800:600)};
|
|
4029
4029
|
font-size: ${C(300)};
|
|
4030
4030
|
line-height: ${S(500)};
|
|
4031
4031
|
font-weight: 400;
|
|
4032
|
-
`,
|
|
4032
|
+
`,pL=i.css`
|
|
4033
4033
|
height: ${M(100)};
|
|
4034
4034
|
width: 100%;
|
|
4035
4035
|
padding: 0 1.875rem;
|
|
@@ -4037,25 +4037,25 @@ function _E(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
|
|
|
4037
4037
|
top: ${k(400)};
|
|
4038
4038
|
left: 0;
|
|
4039
4039
|
z-index: -1;
|
|
4040
|
-
`,
|
|
4040
|
+
`,fL=i.css`
|
|
4041
4041
|
height: ${M(100)};
|
|
4042
4042
|
width: 100%;
|
|
4043
4043
|
background-color: ${w("neutral",400)};
|
|
4044
|
-
`,
|
|
4044
|
+
`,mL=i.css`
|
|
4045
4045
|
font-size: ${C(500)};
|
|
4046
4046
|
line-height: ${S(700)};
|
|
4047
4047
|
font-weight: 400;
|
|
4048
4048
|
color: ${w("neutral",800)};
|
|
4049
|
-
`,
|
|
4049
|
+
`,gL=i.css`
|
|
4050
4050
|
font-size: ${C(400)};
|
|
4051
4051
|
line-height: ${S(600)};
|
|
4052
4052
|
font-weight: 400;
|
|
4053
4053
|
color: ${w("neutral",700)};
|
|
4054
|
-
`,gL=i.css`
|
|
4055
|
-
padding: 0.375rem;
|
|
4056
4054
|
`,bL=i.css`
|
|
4057
4055
|
padding: 0.375rem;
|
|
4058
|
-
`,vL=
|
|
4056
|
+
`,vL=i.css`
|
|
4057
|
+
padding: 0.375rem;
|
|
4058
|
+
`,yL={pauseOnPageIdle:!0,offsets:"1.5rem"},xL={"top-start":e.createToaster({placement:"top-start",...yL}),top:e.createToaster({placement:"top",...yL}),"top-end":e.createToaster({placement:"top-end",...yL}),"bottom-start":e.createToaster({placement:"bottom-start",...yL}),bottom:e.createToaster({placement:"bottom",...yL}),"bottom-end":e.createToaster({placement:"bottom-end",...yL})};exports.AlertBanner=sL,exports.AnalysisWidget=({children:t,header:o,footer:i,expanded:s=!0,collapsible:a=!0,actions:l,showFooterOnCollapsed:c=!1,labels:d})=>{Vf("AnalysisWidget",d);const u="analysis-widget-item",[h,p]=n.useState(s),f=`analysis-widget-header-${u}`;return r.jsx(e.Box,{as:"section","aria-labelledby":f,css:Qw,children:r.jsxs(e.Accordion.Root,{multiple:!0,value:a?void 0:[u],defaultValue:s?[u]:[],children:[r.jsxs(e.Accordion.Item,{css:tC,value:u,children:[o&&r.jsx(e.Accordion.ItemTrigger,{id:f,"aria-expanded":h,css:eC,pointerEvents:a?"auto":"none",onClick:a?()=>{p(!h)}: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(Bf,{variant:"secondary",size:"small",label:e.label,onClick:t=>{e.onClick(),t.preventDefault(),t.stopPropagation()},leftIcon:e?.icon},e.label))),a&&r.jsx(e.Accordion.ItemIndicator,{height:"1rem",marginTop:"0.5rem",display:"flex",children:r.jsx(Gf,{"aria-hidden":"true",color:"var(--chakra-colors-neutral-700)",height:"1rem",width:"1rem"})})]})}),r.jsxs("div",{className:h?"item-content-open":"item-content-closed","aria-hidden":!h,children:[t,!c&&i&&r.jsx(e.Box,{css:nC,children:i})]})]}),c&&i&&r.jsx(e.Box,{css:nC,children:i})]})})},exports.Avatar=XO,exports.Badge=({hasNotification:e,notificationCount:t,label:o,labels:i})=>{const s=Vf("Badge",i),[a,l]=n.useState(!1);n.useEffect((()=>{const e=()=>{window.innerWidth<1024?l(!0):l(!1)};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]);const c=(()=>{let e="";return t&&t>0&&(e=`${t>99?"99+":t}`),e})();let d="1rem";return t&&t>99?d="1.75rem":t&&t>9&&(d="1.375rem"),a?r.jsxs("div",{css:YO,role:"status","aria-live":"polite",children:[r.jsxs("div",{css:QO(),children:[r.jsx(om,{color:"currentColor",height:"1rem",width:"1rem"}),!e||t||o?null:r.jsx("div",{css:eL,"aria-hidden":!0})]}),o?r.jsx("p",{children:o}):null,c.length>0?r.jsx("div",{css:rL,children:r.jsx("p",{css:oL,"aria-label":s.unreadMessagesLabel(t||0),children:c})}):null]}):r.jsxs("div",{css:YO,role:"status","aria-live":"polite",children:[o?r.jsx("p",{children:o}):null,r.jsxs("div",{css:QO(d),children:[c.length>0?r.jsx("div",{css:tL,children:r.jsx("p",{css:nL,"aria-label":s.unreadMessagesLabel(t||0),children:c})}):null,e&&!t?r.jsx("div",{css:eL,"aria-hidden":!0}):null,r.jsx(om,{color:"currentColor",height:"1rem",width:"1rem"})]})]})},exports.BaseMap=({title:e,caption:t,additionalSettings:o,options:s,onOptionSelected:a,maxHeight:l="25rem",maxWidth:c="16.25rem",labels:d})=>{const u=Vf("BaseMap",d),h=n.useRef(null),p=n.useRef(null);return n.useEffect((()=>{const e=h.current,t=p.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:p,css:av(l,c),children:r.jsxs("div",{className:"ds-base-map-scroll-content",children:[r.jsxs("div",{css:lv,children:[r.jsx("h2",{ref:h,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:cv,children:[o?r.jsx("div",{css:dv,children:o.map((e=>r.jsxs("div",{children:[r.jsx(_g,{css:{},checked:e.checked,onCheckedChange:({checked:t})=>e.onCheckedChange({checked:Boolean(t)}),children:e.label}),e.checked&&e.children?r.jsx("div",{css:uv,children:e.children}):null]},e.label)))}):null,s?r.jsx("div",{css:hv,children:s.map((e=>{return r.jsxs("div",{css:pv(e.active),role:"button","aria-label":`${e.label}${e.caption?`, ${e.caption}`:""}`,onClick:()=>a?.(e),tabIndex:0,onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),a?.(e))},children:[r.jsx("div",{css:(t=e.imageUrl,i.css`
|
|
4059
4059
|
height: ${k(800)};
|
|
4060
4060
|
width: ${k(800)};
|
|
4061
4061
|
border: ${M(100)} solid ${w("neutral",300)};
|
|
@@ -4174,14 +4174,14 @@ function _E(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
|
|
|
4174
4174
|
font-weight: 700;
|
|
4175
4175
|
color: ${w("medium"===y?"warning":"strong"===y||"very-strong"===y?"success":"error",900)};
|
|
4176
4176
|
}
|
|
4177
|
-
`),"aria-live":"polite",role:"status",children:[u.strengthPrefix," ",r.jsx("span",{children:v[g.strength]})]}),r.jsx("div",{css:Kb(g.strength),children:r.jsx("div",{})}),r.jsxs("div",{css:Gb(g.length),"aria-label":`${u.minLengthRule(l)}. ${g.length?u.requirementMet:u.requirementNotMet}`,children:[r.jsx("div",{children:g.length?r.jsx(Wf,{color:"var(--chakra-colors-success-500)",height:"0.5rem",width:"0.5rem"}):r.jsx(Jf,{color:"var(--chakra-colors-error-900)",height:"0.5rem",width:"0.5rem"})}),r.jsx("p",{children:u.minLengthRule(l)})]}),s?.uppercase?null:r.jsxs("div",{css:Gb(g.uppercase),"aria-label":`${u.uppercaseRule}. ${g.uppercase?u.requirementMet:u.requirementNotMet}`,children:[r.jsx("div",{children:g.uppercase?r.jsx(Wf,{color:"var(--chakra-colors-success-500)",height:"0.5rem",width:"0.5rem"}):r.jsx(Jf,{color:"var(--chakra-colors-error-900)",height:"0.5rem",width:"0.5rem"})}),r.jsx("p",{children:u.uppercaseRule})]}),s?.lowercase?null:r.jsxs("div",{css:Gb(g.lowercase),"aria-label":`${u.lowercaseRule}. ${g.lowercase?u.requirementMet:u.requirementNotMet}`,children:[r.jsx("div",{children:g.lowercase?r.jsx(Wf,{color:"var(--chakra-colors-success-500)",height:"0.5rem",width:"0.5rem"}):r.jsx(Jf,{color:"var(--chakra-colors-error-900)",height:"0.5rem",width:"0.5rem"})}),r.jsx("p",{children:u.lowercaseRule})]}),s?.numbers?null:r.jsxs("div",{css:Gb(g.numbers),"aria-label":`${u.numberRule}. ${g.numbers?u.requirementMet:u.requirementNotMet}`,children:[r.jsx("div",{children:g.numbers?r.jsx(Wf,{color:"var(--chakra-colors-success-500)",height:"0.5rem",width:"0.5rem"}):r.jsx(Jf,{color:"var(--chakra-colors-error-900)",height:"0.5rem",width:"0.5rem"})}),r.jsx("p",{children:u.numberRule})]}),s?.specialCharacters?null:r.jsxs("div",{css:Gb(g.specialCharacters),"aria-label":`${u.specialCharRule}. ${g.specialCharacters?u.requirementMet:u.requirementNotMet}`,children:[r.jsx("div",{children:g.specialCharacters?r.jsx(Wf,{color:"var(--chakra-colors-success-500)",height:"0.5rem",width:"0.5rem"}):r.jsx(Jf,{color:"var(--chakra-colors-error-900)",height:"0.5rem",width:"0.5rem"})}),r.jsx("p",{children:u.specialCharRule})]})]}):null]})});var y},exports.ProgressBar=({progress:e,labels:t,color:n})=>{const o=Vf("ProgressBar",t);let i=e;return i>100&&(i=100),i<0&&(i=0),r.jsx("div",{css:
|
|
4177
|
+
`),"aria-live":"polite",role:"status",children:[u.strengthPrefix," ",r.jsx("span",{children:v[g.strength]})]}),r.jsx("div",{css:Kb(g.strength),children:r.jsx("div",{})}),r.jsxs("div",{css:Gb(g.length),"aria-label":`${u.minLengthRule(l)}. ${g.length?u.requirementMet:u.requirementNotMet}`,children:[r.jsx("div",{children:g.length?r.jsx(Wf,{color:"var(--chakra-colors-success-500)",height:"0.5rem",width:"0.5rem"}):r.jsx(Jf,{color:"var(--chakra-colors-error-900)",height:"0.5rem",width:"0.5rem"})}),r.jsx("p",{children:u.minLengthRule(l)})]}),s?.uppercase?null:r.jsxs("div",{css:Gb(g.uppercase),"aria-label":`${u.uppercaseRule}. ${g.uppercase?u.requirementMet:u.requirementNotMet}`,children:[r.jsx("div",{children:g.uppercase?r.jsx(Wf,{color:"var(--chakra-colors-success-500)",height:"0.5rem",width:"0.5rem"}):r.jsx(Jf,{color:"var(--chakra-colors-error-900)",height:"0.5rem",width:"0.5rem"})}),r.jsx("p",{children:u.uppercaseRule})]}),s?.lowercase?null:r.jsxs("div",{css:Gb(g.lowercase),"aria-label":`${u.lowercaseRule}. ${g.lowercase?u.requirementMet:u.requirementNotMet}`,children:[r.jsx("div",{children:g.lowercase?r.jsx(Wf,{color:"var(--chakra-colors-success-500)",height:"0.5rem",width:"0.5rem"}):r.jsx(Jf,{color:"var(--chakra-colors-error-900)",height:"0.5rem",width:"0.5rem"})}),r.jsx("p",{children:u.lowercaseRule})]}),s?.numbers?null:r.jsxs("div",{css:Gb(g.numbers),"aria-label":`${u.numberRule}. ${g.numbers?u.requirementMet:u.requirementNotMet}`,children:[r.jsx("div",{children:g.numbers?r.jsx(Wf,{color:"var(--chakra-colors-success-500)",height:"0.5rem",width:"0.5rem"}):r.jsx(Jf,{color:"var(--chakra-colors-error-900)",height:"0.5rem",width:"0.5rem"})}),r.jsx("p",{children:u.numberRule})]}),s?.specialCharacters?null:r.jsxs("div",{css:Gb(g.specialCharacters),"aria-label":`${u.specialCharRule}. ${g.specialCharacters?u.requirementMet:u.requirementNotMet}`,children:[r.jsx("div",{children:g.specialCharacters?r.jsx(Wf,{color:"var(--chakra-colors-success-500)",height:"0.5rem",width:"0.5rem"}):r.jsx(Jf,{color:"var(--chakra-colors-error-900)",height:"0.5rem",width:"0.5rem"})}),r.jsx("p",{children:u.specialCharRule})]})]}):null]})});var y},exports.ProgressBar=({progress:e,labels:t,color:n})=>{const o=Vf("ProgressBar",t);let i=e;return i>100&&(i=100),i<0&&(i=0),r.jsx("div",{css:aL,role:"progressbar","aria-label":o.progressAriaLabel(i),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":i,children:r.jsx("div",{css:lL(i,n)})})},exports.QualitativeAttribute=({type:e,label:t,caption:o,color:i,onActionClick:s,showActionButton:a,pointIcon:l=r.jsx(hm,{color:"#006D2C"}),ariaLabelType:c="",labels:d})=>{const u=Vf("QualitativeAttribute",d),[h,p]=n.useState(!0),f=n.useId(),m=n.useId(),g="raster"===e,b="line"===e,v="point"===e,y=n.useId(),x=n.useMemo((()=>{const e=h?u.visibleText:u.hiddenText;let n=c??`${c},`;return b&&(n=u.linePrefix),u.currentlyTemplate(String(t),o,n,e)}),[h,e,t,o,c,u]),w=h?u.hideLabel:u.showLabel;return r.jsxs("div",{css:sw,children:[r.jsx("p",{id:y,css:{position:"absolute",width:1,height:1,margin:-1,padding:0,border:0,clip:"rect(0 0 0 0)",overflow:"hidden"},children:x}),r.jsxs("div",{css:aw,children:[r.jsxs("div",{children:[g&&r.jsx("div",{css:rw(i)}),b&&r.jsx("div",{css:ow(i)}),v&&r.jsx("div",{css:iw(i),children:l})]}),r.jsxs("div",{children:[r.jsx("p",{id:f,css:lw,children:t}),o?r.jsx("p",{id:m,css:cw,children:o}):null]})]}),s&&a?r.jsx("div",{css:dw,children:r.jsx(Bf,{type:"button",variant:"borderless",label:String(w),rightIcon:h?r.jsx(Qf,{}):r.jsx(Yf,{}),"aria-pressed":h,"aria-labelledby":`${y} ${f}`,onClick:()=>{p((e=>!e)),s?.()}})}):null]})},exports.Radio=ob,exports.RadioGroup=ib,exports.RadioList=({label:e,caption:t,name:n,radios:o,defaultValue:i,onCheckedChange:s,errorMessage:a,horizontal:l,variant:c="default",required:d,labels:u})=>{const h=Vf("RadioList",u),p=`${e}. ${t?`${t}.`:""} ${d?h.requiredLabel:h.optionalLabel} ${a?`${h.errorPrefix} ${a}.`:""} `;return r.jsx(ag,{label:e,caption:t,errorMessage:a,required:d,showOptionalLabel:!1,noMarginBottom:!0,semantics:"group",labels:{requiredSymbolLabel:h.requiredSymbolLabel},containerProps:{"aria-roledescription":"group","aria-label":p},children:r.jsx(ib,{name:n,value:i,onChange:s,horizontal:l&&"card"!==c,children:o.map((e=>r.jsx(ob,{css:"card"===c?Zb:{},...e},e.value)))})})},exports.RichTextEditor=({defaultValue:e="",disabled:t=!1,ariaLabel:n,placeholder:o,minHeight:i,visibleControls:s=wg,onChange:a,labels:c})=>{const d=Vf("RichTextEditor",c),u=n||d.editorAriaLabel,h=o||d.placeholder,p=i,f=pf({extensions:[ap.configure({link:!1}),ru.configure({openOnClick:!0,autolink:!0,defaultProtocol:"https"}),oc,ip,qu.configure({placeholder:h,emptyEditorClass:"is-editor-empty"}),Wu,Uu,Ku.configure({types:["paragraph","heading"]}),th],content:e,editable:!t,shouldRerenderOnTransaction:!0,immediatelyRender:!1,onUpdate:({editor:e})=>{a?.(e.getHTML())},editorProps:{attributes:{"aria-label":u}}},[h,u]);return l.useEffect((()=>{f&&f.setEditable(!t)}),[f,t]),r.jsxs(xg.Root,{editor:f,disabled:t,css:{"& .ProseMirror":{minHeight:p||0}},children:[r.jsx(xg.Toolbar,{children:r.jsxs(xg.ControlGroup,{children:[s.includes("undo")?r.jsx(ng,{label:d.undoTooltip}):null,s.includes("redo")?r.jsx(rg,{label:d.redoTooltip}):null,s.includes("textType")?r.jsx(Km,{label:d.textTypeTooltip}):null,s.includes("alignment")?r.jsx(ig,{label:d.alignmentTooltip,alignLeftLabel:d.alignLeftOptionLabel,alignCenterLabel:d.alignCenterOptionLabel,alignRightLabel:d.alignRightOptionLabel,alignJustifyLabel:d.alignJustifyOptionLabel}):null,s.includes("fontSize")?r.jsx(Gm,{label:d.fontSizeTooltip}):null,s.includes("bold")?r.jsx(Zm,{label:d.boldTooltip,icon:r.jsx("strong",{css:{fontSize:C(600),lineHeight:1},children:d.boldIconText})}):null,s.includes("italic")?r.jsx(Jm,{label:d.italicTooltip,icon:r.jsx("em",{css:{fontStyle:"italic",fontSize:C(600),lineHeight:1},children:d.italicIconText})}):null,s.includes("underline")?r.jsx(Xm,{label:d.underlineTooltip,icon:r.jsx("span",{css:{fontSize:C(600),lineHeight:1,textDecoration:"underline"},children:d.underlineIconText})}):null,s.includes("strikethrough")?r.jsx(Ym,{label:d.strikethroughTooltip,icon:r.jsx("span",{css:{fontSize:C(600),lineHeight:1,textDecoration:"line-through"},children:d.strikethroughIconText})}):null,s.includes("bulletList")?r.jsx(Qm,{label:d.bulletListTooltip}):null,s.includes("orderedList")?r.jsx(eg,{label:d.orderedListTooltip}):null,s.includes("link")?r.jsx(bg,{label:d.linkTooltip,urlPlaceholder:d.linkUrlPlaceholder,labelPlaceholder:d.linkLabelPlaceholder,labelInputAriaLabel:d.linkLabelAriaLabel,applyLabel:d.linkApplyLabel,removeLabel:d.linkRemoveLabel,invalidUrlMessage:d.linkInvalidUrlMessage}):null,s.includes("image")?r.jsx(tg,{label:d.imageTooltip}):null]})}),r.jsx(xg.Content,{})]})},exports.SSOButtons=Cg,exports.ScaleBar=({colors:e,values:t,subLabels:n,isGradient:o})=>{return r.jsxs("div",{css:uw,children:[o?r.jsx("div",{css:(s=gw(e),i.css`
|
|
4178
4178
|
height: ${k(500)};
|
|
4179
4179
|
width: 100%;
|
|
4180
4180
|
margin-bottom: ${k(200)};
|
|
4181
4181
|
border: ${M(100)} solid ${w("neutral",300)};
|
|
4182
4182
|
border-radius: ${$(300)};
|
|
4183
4183
|
${s?`background: ${s};`:""}
|
|
4184
|
-
`)}):r.jsx("div",{css:hw,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:pw,children:t?.map((e=>r.jsx("div",{style:{width:o?"auto":`calc(100% / ${t.length})`,display:"flex",justifyContent:"center"},children:r.jsx("p",{css:fw,children:e})},e)))}),n&&n.length?r.jsx("div",{css:pw,children:n.map((e=>r.jsx("div",{style:{width:o?"auto":`calc(100% / ${t.length})`,display:"flex",justifyContent:"center"},children:r.jsx("p",{css:mw,style:{width:"100%"},children:e})},e)))}):null]});var s},exports.Search=({placeholder:t,disabled:o,size:i="default",options:s=[],resultsMaxHeight:a=50,isLoading:l=!1,displayResults:c="text",onSelect:d,onQueryChange:h,onClear:p,renderResults:f,labels:m})=>{const g=Vf("Search",m),[b,v]=n.useState(""),{open:y,onOpen:x,onClose:C}=e.useDisclosure(),[k,S]=n.useState(s),[$,M]=n.useState(-1),[E,j]=n.useState(!1),[T,O]=n.useState("pointer"),L=n.useRef(null),{contentRef:A,placement:R}=tv(),N=`search-results-${n.useId()}`,D=e=>{const t=s.find((t=>t.id===e||t.label===e));t&&(d?.(t),v(""),C())};n.useEffect((()=>{if(h?.(b),!b)return void S(s);const e=s.filter((e=>e.id?.toLowerCase().includes(b.toLowerCase())||e.label.toLowerCase().includes(b.toLowerCase())||e.caption?.toLowerCase().includes(b.toLowerCase()))).map((e=>({id:e.id,label:e.label,caption:e.caption,variant:"select",icon:e.icon,onItemClick:()=>D(e.id||e.label)})));S(e),x()}),[b]);const I=b.length?r.jsx(Sg,{onClick:()=>{v(""),p?.()}}):null,P="none"!==c&&!!b.length&&k.length>0&&y,z=(P||l&&!!b.length)&&"custom"!==c;let V=w("neutral",500);o?V=w("neutral",500):E&&(V=w("primary",700));const B="small"===i?"1rem":"1.25rem",H=u(a);return r.jsxs(e.Popover.Root,{open:z,onOpenChange:e=>{e.open||C()},autoFocus:!1,closeOnEscape:!1,positioning:{sameWidth:!0,gutter:0},children:[r.jsxs("div",{ref:L,css:HO,"data-open":z||void 0,"data-placement":R,children:[r.jsx(e.Popover.Anchor,{children:r.jsx(e.InputGroup,{startElement:r.jsx(Sm,{width:B,height:B,fill:V}),endElement:I,children:r.jsx(gg,{autoComplete:"off",placeholder:t||g.filterPlaceholder,onChange:e=>{const{value:t}=e.target;v(t)},onFocus:()=>j(!0),onBlur:()=>j(!1),value:b,label:"",style:{paddingLeft:"2.5rem"},type:"search","aria-label":t||g.filterAriaLabel,"aria-expanded":P,"aria-controls":N,role:"combobox","aria-autocomplete":"list",disabled:o,size:i,noMarginBottom:!0,onKeyDown:e=>{if(P){if("ArrowDown"===e.key&&(e.preventDefault(),O("keyboard"),M((e=>Math.min(e+1,k.length-1)))),"ArrowUp"===e.key&&(e.preventDefault(),O("keyboard"),M((e=>Math.max(e-1,0)))),"Enter"===e.key&&(e.preventDefault(),$>=0)){const e=k[$];D(e.id||e.label)}"Escape"===e.key&&C()}}})})}),(P||l&&!!b.length)&&"custom"===c&&f&&!l&&f({items:k,highlightedIndex:$,query:b,onSelect:D})]}),r.jsx(e.Portal,{children:r.jsx(e.Popover.Positioner,{children:r.jsxs(e.Popover.Content,{ref:A,css:_O,style:{maxHeight:H},"data-nav-source":T,onPointerMove:()=>O("pointer"),children:[l&&r.jsx(e.Box,{padding:"1rem",children:r.jsx(e.Spinner,{})}),"text"===c&&!l&&r.jsx(WO,{highlightedIndex:$,items:k,query:b,onSelect:D}),"list"===c&&!l&&r.jsx(Tw,{items:k,highlightedIndex:$})]})})})]})},exports.Select=Fb,exports.Sheet=({header:e,content:t,footer:o,open:i=!1,onClose:s,minimizedHeight:a,midHeight:l=200,maxFullHeight:c,defaultSnap:d="minimized",className:u,blocking:h,zIndex:p=1e3,labels:f})=>{const m=Vf("Sheet",f),g=n.useRef(null),b=n.useRef([]),[v,y]=n.useState(null),x=window.innerWidth>768,w=b.current;let C=m.expandSheetLabel;if(null!=v){const e=wT(v,w);e>0&&e<w.length-1?C=m.makeFullScreenLabel:e===w.length-1&&(C=m.expandedSheetLabel)}const k=!(null==v||!w.length||wT(v,w)!==w.length-1);return r.jsx(vT,{ref:g,css:xT(!!e,p),className:u,open:i,onDismiss:s,header:r.jsxs("div",{children:[r.jsx("button",{type:"button",disabled:k,"aria-label":C,css:yT,onKeyDown:e=>{if("Enter"!==e.key&&" "!==e.key)return;e.preventDefault();const t=w[w.length-1];if(x)return void g.current?.snapTo?.((()=>t));const n=v??w[0];let r=w.findIndex((e=>e>n));-1===r&&(r=w.length-1);const o=w[r];g.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:C}),e]}),footer:o,snapPoints:({headerHeight:e,maxHeight:t,footerHeight:n})=>{const r=[20,a||e,l+(o?n:0),c||t-t/6];return b.current=r,r},onSpringEnd:()=>{const e=g.current?.height;e&&y(e)},defaultSnap:({headerHeight:e,maxHeight:t,footerHeight:n})=>{let r=20;return"minimized"===d?r=a||e:"mid"===d?r=l+(o?n:0):"full"===d&&(r=c||t-t/6),r},blocking:h,children:i?t:null})},exports.SimpleMapPin=({onClick:e,triggerRef:n,showFocusState:r,count:o,mode:i,variant:s="simple-pin"})=>t.jsx(gv,{count:o,mode:i,onClick:e,ref:n,showFocusState:r,variant:s}),exports.Slider=fb,exports.SliderInput=({label:e,caption:t,size:o="default",sliderItem:i,required:s,onChange:a})=>{const[l,c]=n.useState(i.value||[]),d=(e,t)=>{const n=e.target.value,r=[...l];let o=n?parseInt(n,10):n;const s=i.min||0,a=i.max||100;o=Number.isNaN(o)?s:o,o=o<s?s:o,o=o>a?a:o,r[t]=o,c(r)},u=(e,t)=>{const n=e.target.value||"0",r=[...l];let o=parseInt(n,10);const s=i.min||0,d=i.max||100;if(o=Number.isNaN(o)?s:o,o=o<s?s:o,o=o>d?d:o,2===l?.length){o=Number.isNaN(o)?s:o;const e=l[0],n=l[1];0===t?(o=o<s?s:o,o=o>n?n:o):1===t&&(o=o<e?e:o,o=o>d?d:o)}r[t]=o,c(r),a&&a(r)};return r.jsx(ag,{label:e,caption:t,required:s,size:o,showOptionalLabel:!1,noMarginBottom:!0,semantics:"group",children:r.jsxs("div",{css:Jb,children:[i.step&&i.marks?r.jsx(Fb,{items:i.marks.map((e=>{const t="number"==typeof e?e:e.value;return{label:`${"number"==typeof e?e:e.label}`,value:`${t}`}})),placeholder:"",style:{width:"5.625rem"},value:[`${l?.[0]}`],onChange:e=>{const t=e.map((e=>parseInt(e,10)));c(t),a&&a(t)}}):r.jsx(gg,{"aria-label":e,min:i.min,max:i.max,value:l?.[0],type:"number",onChange:e=>d(e,0),onBlur:e=>u(e,0),className:"ds-opacity-control-text-input",onClick:e=>e.target.select(),noMarginBottom:!0}),r.jsx(fb,{css:{},...i,value:l,"aria-label":2===l?.length?[`${e} minimum`,`${e} maximum`]:[e],onValueChangeEnd:e=>{c(e.value),a&&a(e.value)}}),2===l?.length?r.jsx(gg,{"aria-label":e,min:i.min,max:i.max,value:l?.[1],type:"number",onChange:e=>d(e,1),onBlur:e=>u(e,1),className:"ds-opacity-control-text-input",onClick:e=>e.target.select(),noMarginBottom:!0}):null]})})},exports.StepProgressIndicator=({steps:e,currentStep:t,labels:n})=>{const o=Vf("StepProgressIndicator",n);return r.jsxs("div",{css:lL,children:[e.map(((e,n)=>r.jsxs("div",{css:cL,children:[r.jsx("button",{css:dL(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":o.currentStepLabel(n+1,e.label||"",t>n+1),"data-active":t>=n+1,children:t>n+1?r.jsx(Wf,{height:"1rem",width:"1rem"}):n+1}),e.label?r.jsx("p",{css:uL(t===n+1),children:e.label}):null]},`${e.label}-${n}`))),r.jsx("div",{css:hL,children:r.jsx("div",{css:pL})})]})},exports.Switch=gb,exports.TabBar=({variant:t="panel",defaultValue:o,tabs:i,onTabClick:s,activationMode:a="manual"})=>{const[l,c]=n.useState(zO(i,o)||0);return r.jsx("div",{css:AO(t),children:r.jsx(e.Tabs.Root,{width:"full",defaultValue:o||i?.[0]?.value,onValueChange:({value:e})=>{return c(zO(i,t=e)),void(s&&s(t));var t},activationMode:a,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"===VO(l)?r.jsx("div",{css:DO}):null,r.jsx(e.Tabs.Trigger,{css:[RO,"view"===t&&IO,"panel"===t&&NO,"transparent"===t&&PO],"aria-label":o["aria-label"]||o.label,...o,children:r.jsxs(e.Box,{display:"flex",alignItems:"center",gap:"0.3125rem",children:[o.icon,o.label]})},o.label),"view"===t&&1===i&&"right"===VO(l)?r.jsx("div",{css:DO}):null]},o.label)))})})})},exports.Table=({columns:o,data:i=[],renderRow:s,striped:a,stickyHeader:l,pagination:c,selectable:d,selectedRows:u,variant:h="default",onSortColumn:p,onPageSizeChange:f,onPageChange:m,onAllItemsSelected:g,onRowSelected:b,loading:v,height:y,labels:x})=>{const C=Vf("Table",x),[k,S]=n.useState({key:"",order:""}),$=n.useRef({}),M=n.useRef(null),[E,j]=n.useState({}),[T,O]=n.useState([]),{totalItems:L=i.length,currentPage:A=1,pageSize:R=10,showItemCount:N,showItemCountText:D}=c||{},I=Boolean(p),P=n.useMemo((()=>Gw(i,k,I)),[i,I,k]),z=(e,t)=>{S({key:e,order:t}),p&&p({key:e,order:t})},V=u??T,B=P.length>0&&V.length===P.length,H=V.length>0&&V.length<P.length,_=n.useMemo((()=>(e=>e.reduce(((e,t)=>(e[t.key]=t,e)),{}))(o)),[o]),F=n.useMemo((()=>(e=>e.filter((e=>e.sticky)).map((e=>e.key)))(o)),[o]),q=(e=>e.length>0?e[e.length-1]:void 0)([...void 0!==E[Ww]?[Ww]:[],...F]),W=n.useCallback((()=>{const e=((e,t,n)=>{const r={};let o=0;const i=e.filter((e=>e.sticky));return n&&i.length>0&&(r[Ww]=0,o+=n.offsetWidth),i.forEach((e=>{r[e.key]=o,o+=t[e.key]?.offsetWidth||0})),r})(o,$.current,d?M.current:void 0);j(e)}),[o,d]);n.useEffect((()=>{W()}),[W,i.length]),n.useEffect((()=>{const e=()=>{W()};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[W]),n.useEffect((()=>{void 0===u&&O((e=>((e,t)=>{const n=e.filter((e=>t.some((t=>t.id===e.id)))),r=n.length===e.length&&n.every(((t,n)=>t.id===e[n]?.id));return r?e:n})(e,i)))}),[i,u]);const U=e=>Kw(E,e.key,q),K=e=>((e,t,n,r)=>({...Uw(e,n),...Kw(t,n,r)}))(_,E,e,q),G=e=>((e,t)=>e.some((e=>e.id===t.id)))(V,e),Z=(({columns:n,selectable:r,isRowSelected:o,onRowSelected:i,stickyOffsets:s={},lastStickyColumnKey:a,getSelectRowLabel:l})=>(c,d)=>{const{id:u,name:h}=c;return t.jsxs(e.Table.Row,{className:d?.className,children:[r?t.jsx(e.Table.Cell,{...Kw(s,Ww,a),children:t.jsx(_g,{name:`checkbox-${u}`,"aria-label":l(h,u),checked:o(c),onCheckedChange:({checked:e})=>{i(c,e)}})}):null,n.map((n=>t.jsx(e.Table.Cell,{...d?.getCellProps(n.key),children:n.cell?n.cell(c):c?.[n.key]},n.key)))]})})({columns:o,selectable:d,isRowSelected:G,onRowSelected:(e,t)=>{void 0===u&&O((n=>((e,t,n)=>n?e.some((e=>e.id===t.id))?e:[...e,t]:e.filter((e=>e.id!==t.id)))(n,e,t))),b&&b(e,t)},stickyOffsets:E,lastStickyColumnKey:q,getSelectRowLabel:(e,t)=>C.selectRowLabel(e,t)}),J=s||Z;return r.jsxs("div",{children:[r.jsx("div",{css:y?Fw(y):void 0,children:r.jsxs(e.Table.Root,{css:Dw(h,l),striped:a,stickyHeader:l,interactive:!0,children:[r.jsx(e.Table.Header,{css:Iw(h),children:r.jsxs(e.Table.Row,{children:[d?r.jsx(e.Table.ColumnHeader,{ref:M,...Kw(E,Ww,q),children:r.jsx(_g,{name:"header-checkbox","aria-label":C.selectAllRowsLabel,checked:B,indeterminate:H,onCheckedChange:({checked:e})=>{void 0===u&&O(e?P:[]),g&&g(e)}})}):null,o.map((t=>{return r.jsx(e.Table.ColumnHeader,{ref:e=>{$.current[t.key]=e},...(n=t.key,Uw(_,n)),role:t.sortable?"columnheader":void 0,"aria-sort":t.sortable&&"asc"===k.order?"ascending":t.sortable&&"desc"===k.order?"descending":void 0,...U(t),children:r.jsxs("div",{css:Pw,children:[t.label,t.sortable?r.jsxs("div",{css:zw,children:[r.jsx(_f,{css:Vw(k.key===t.key&&"asc"===k.order),icon:r.jsx(Gf,{style:{transform:"rotate(180deg)"}}),onClick:()=>z(t.key,"asc"),"aria-label":C.ascendingLabel}),r.jsx(_f,{css:Vw(k.key===t.key&&"desc"===k.order),icon:r.jsx(Gf,{}),onClick:()=>z(t.key,"desc"),"aria-label":C.descendingLabel})]}):null]})},t.key);var n}))]})}),r.jsx(e.Table.Body,{css:_w(a),children:P.map((e=>r.jsx(n.Fragment,{children:J(e,{className:G(e)?"selected":void 0,getCellProps:K})},e.id)))})]})}),v?r.jsx("div",{css:qw,children:r.jsx(e.Spinner,{size:"lg",color:w("primary",500)})}):null,r.jsxs("div",{css:Bw,children:[r.jsx("div",{children:N?r.jsx(xw,{pageSize:R,currentPage:A,totalItems:L,onPageSizeChange:f,showItemCountText:D}):null}),c?r.jsx("div",{css:Hw,children:r.jsx(Nw,{totalItems:L,pageSize:R,currentPage:A,onPageChange:m})}):null]})]})},exports.TableCell=Jw,exports.TableRow=Zw,exports.Tag=Bb,exports.TextInput=gg,exports.Textarea=({label:t,caption:o,placeholder:i,errorMessage:s,required:a,disabled:l,size:c="default",showOptionalLabel:d=!0,defaultValue:u="",onChange:h,onFocus:p,onBlur:f,minLength:m,maxLength:g,labels:b,value:v,...y})=>{const x=Vf("Textarea",b),[w,C]=n.useState(u),[k,S]=n.useState(!1),[$,M]=n.useState(!1),[E,j]=n.useState(""),T=void 0!==v,O=T?String(v??""):w,L=n.useId(),A=n.useId(),R=n.useId();n.useEffect((()=>{const{length:e}=u;m&&e<m&&e>0?(S(e<m),M(!1),j(x.enterAtLeastChars(m-e))):m&&0===e&&j(x.minChars(m)),g&&e>0?(S(!1),M(e>g),j(x.charsRemaining(g-e))):g&&0===e&&j(x.maxChars(g))}),[]);const N=!!s||k||$,D=[o?L:null,N?A:null,E?R:null].filter(Boolean).join(" ")||void 0,I=Boolean(O),P=mg(p,f),z=E&&!$&&!k,V=k&&!!m||$&&!!g||z?r.jsxs(r.Fragment,{children:[k&&m?r.jsx(e.Field.ErrorText,{id:A,css:Yb,style:{fontSize:"0.75rem",lineHeight:"1rem"},"aria-live":"polite",children:x.needMoreChars(m-O.length)}):null,$&&g?r.jsx(e.Field.ErrorText,{id:A,css:Yb,style:{fontSize:"0.75rem",lineHeight:"1rem"},"aria-live":"polite",children:x.tooManyChars(O.length-g)}):null,z?r.jsx(e.Field.HelperText,{id:R,css:Xb,"aria-live":"polite",children:E}):null]}):null;return r.jsx(ag,{label:t,caption:o,errorMessage:s,invalid:N,required:a,disabled:l,size:c,showOptionalLabel:d,labels:{requiredSymbolLabel:x.requiredSymbolLabel,optionalSuffix:x.optionalSuffix},captionId:L,errorId:s?A:void 0,footer:V,semantics:"field",children:r.jsx(e.Textarea,{placeholder:i,disabled:l,focusVisibleRing:"none",css:Qb(c,I),onChange:e=>{T||C(e.target.value);const{length:t}=e.target.value;m&&g?(S(t<m),M(t>g),j(x.charsRemaining(g-t))):m?(S(t<m),M(!1),j(t<m?x.enterAtLeastChars(m-t):"")):g&&(M(t>g),S(!1),j(x.charsRemaining(g-t))),h&&h(e)},value:O,"aria-label":t||i,"aria-describedby":D,"aria-invalid":N||void 0,_placeholder:{color:"var(--chakra-colors-neutral-700)"},...y,"data-focus-visible":P.isTabFocused||void 0,onFocus:P.onFocus,onBlur:P.onBlur})})},exports.Toast=({labels:t})=>{const n=Vf("Toast",t);return Object.keys(yL).map((t=>r.jsx(e.Portal,{children:r.jsx(e.Toaster,{toaster:yL[t],insetInline:{mdDown:"4"},children:o=>{return r.jsxs(e.Toast.Root,{css:(s=o.meta?.maxWidth,i.css`
|
|
4184
|
+
`)}):r.jsx("div",{css:hw,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:pw,children:t?.map((e=>r.jsx("div",{style:{width:o?"auto":`calc(100% / ${t.length})`,display:"flex",justifyContent:"center"},children:r.jsx("p",{css:fw,children:e})},e)))}),n&&n.length?r.jsx("div",{css:pw,children:n.map((e=>r.jsx("div",{style:{width:o?"auto":`calc(100% / ${t.length})`,display:"flex",justifyContent:"center"},children:r.jsx("p",{css:mw,style:{width:"100%"},children:e})},e)))}):null]});var s},exports.Search=({placeholder:t,disabled:o,size:i="default",options:s=[],resultsMaxHeight:a=50,isLoading:l=!1,displayResults:c="text",onSelect:d,onQueryChange:h,onClear:p,renderResults:f,labels:m})=>{const g=Vf("Search",m),[b,v]=n.useState(""),{open:y,onOpen:x,onClose:C}=e.useDisclosure(),[k,S]=n.useState(s),[$,M]=n.useState(-1),[E,j]=n.useState(!1),[T,O]=n.useState("pointer"),L=n.useRef(null),{contentRef:A,placement:R}=tv(),N=`search-results-${n.useId()}`,D=e=>{const t=s.find((t=>t.id===e||UO(t)===e));t&&(d?.(t),v(""),C())};n.useEffect((()=>{if(h?.(b),!b)return void S(s);const e=s.filter((e=>{const t=b.toLowerCase();return e.id?.toLowerCase().includes(t)||UO(e).toLowerCase().includes(t)||e.caption?.toLowerCase().includes(t)})).map((e=>({id:e.id??UO(e),label:e.label,searchLabel:e.searchLabel,caption:e.caption,variant:"select",icon:e.icon,onItemClick:()=>D(e.id||UO(e))})));S(e),x()}),[b]);const I=b.length?r.jsx(Sg,{onClick:()=>{v(""),p?.()}}):null,P="none"!==c&&!!b.length&&k.length>0&&y,z=(P||l&&!!b.length)&&"custom"!==c;let V=w("neutral",500);o?V=w("neutral",500):E&&(V=w("primary",700));const B="small"===i?"1rem":"1.25rem",H=u(a);return r.jsxs(e.Popover.Root,{open:z,onOpenChange:e=>{e.open||C()},autoFocus:!1,closeOnEscape:!1,positioning:{sameWidth:!0,gutter:0},children:[r.jsxs("div",{ref:L,css:HO,"data-open":z||void 0,"data-placement":R,children:[r.jsx(e.Popover.Anchor,{children:r.jsx(e.InputGroup,{startElement:r.jsx(Sm,{width:B,height:B,fill:V}),endElement:I,children:r.jsx(gg,{autoComplete:"off",placeholder:t||g.filterPlaceholder,onChange:e=>{const{value:t}=e.target;v(t)},onFocus:()=>j(!0),onBlur:()=>j(!1),value:b,label:"",style:{paddingLeft:"2.5rem"},type:"search","aria-label":t||g.filterAriaLabel,"aria-expanded":P,"aria-controls":N,role:"combobox","aria-autocomplete":"list",disabled:o,size:i,noMarginBottom:!0,onKeyDown:e=>{if(P){if("ArrowDown"===e.key&&(e.preventDefault(),O("keyboard"),M((e=>Math.min(e+1,k.length-1)))),"ArrowUp"===e.key&&(e.preventDefault(),O("keyboard"),M((e=>Math.max(e-1,0)))),"Enter"===e.key&&(e.preventDefault(),$>=0)){const e=k[$];D(e.id||UO(e))}"Escape"===e.key&&C()}}})})}),(P||l&&!!b.length)&&"custom"===c&&f&&!l&&f({items:k,highlightedIndex:$,query:b,onSelect:D})]}),r.jsx(e.Portal,{children:r.jsx(e.Popover.Positioner,{children:r.jsxs(e.Popover.Content,{ref:A,css:_O,style:{maxHeight:H},"data-nav-source":T,onPointerMove:()=>O("pointer"),children:[l&&r.jsx(e.Box,{padding:"1rem",children:r.jsx(e.Spinner,{})}),"text"===c&&!l&&r.jsx(WO,{highlightedIndex:$,items:k,query:b,onSelect:D}),"list"===c&&!l&&r.jsx(Tw,{items:k,highlightedIndex:$})]})})})]})},exports.Select=Fb,exports.Sheet=({header:e,content:t,footer:o,open:i=!1,onClose:s,minimizedHeight:a,midHeight:l=200,maxFullHeight:c,defaultSnap:d="minimized",className:u,blocking:h,zIndex:p=1e3,labels:f})=>{const m=Vf("Sheet",f),g=n.useRef(null),b=n.useRef([]),[v,y]=n.useState(null),x=window.innerWidth>768,w=b.current;let C=m.expandSheetLabel;if(null!=v){const e=wT(v,w);e>0&&e<w.length-1?C=m.makeFullScreenLabel:e===w.length-1&&(C=m.expandedSheetLabel)}const k=!(null==v||!w.length||wT(v,w)!==w.length-1);return r.jsx(vT,{ref:g,css:xT(!!e,p),className:u,open:i,onDismiss:s,header:r.jsxs("div",{children:[r.jsx("button",{type:"button",disabled:k,"aria-label":C,css:yT,onKeyDown:e=>{if("Enter"!==e.key&&" "!==e.key)return;e.preventDefault();const t=w[w.length-1];if(x)return void g.current?.snapTo?.((()=>t));const n=v??w[0];let r=w.findIndex((e=>e>n));-1===r&&(r=w.length-1);const o=w[r];g.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:C}),e]}),footer:o,snapPoints:({headerHeight:e,maxHeight:t,footerHeight:n})=>{const r=[20,a||e,l+(o?n:0),c||t-t/6];return b.current=r,r},onSpringEnd:()=>{const e=g.current?.height;e&&y(e)},defaultSnap:({headerHeight:e,maxHeight:t,footerHeight:n})=>{let r=20;return"minimized"===d?r=a||e:"mid"===d?r=l+(o?n:0):"full"===d&&(r=c||t-t/6),r},blocking:h,children:i?t:null})},exports.SimpleMapPin=({onClick:e,triggerRef:n,showFocusState:r,count:o,mode:i,variant:s="simple-pin"})=>t.jsx(gv,{count:o,mode:i,onClick:e,ref:n,showFocusState:r,variant:s}),exports.Slider=fb,exports.SliderInput=({label:e,caption:t,size:o="default",sliderItem:i,required:s,onChange:a})=>{const[l,c]=n.useState(i.value||[]),d=(e,t)=>{const n=e.target.value,r=[...l];let o=n?parseInt(n,10):n;const s=i.min||0,a=i.max||100;o=Number.isNaN(o)?s:o,o=o<s?s:o,o=o>a?a:o,r[t]=o,c(r)},u=(e,t)=>{const n=e.target.value||"0",r=[...l];let o=parseInt(n,10);const s=i.min||0,d=i.max||100;if(o=Number.isNaN(o)?s:o,o=o<s?s:o,o=o>d?d:o,2===l?.length){o=Number.isNaN(o)?s:o;const e=l[0],n=l[1];0===t?(o=o<s?s:o,o=o>n?n:o):1===t&&(o=o<e?e:o,o=o>d?d:o)}r[t]=o,c(r),a&&a(r)};return r.jsx(ag,{label:e,caption:t,required:s,size:o,showOptionalLabel:!1,noMarginBottom:!0,semantics:"group",children:r.jsxs("div",{css:Jb,children:[i.step&&i.marks?r.jsx(Fb,{items:i.marks.map((e=>{const t="number"==typeof e?e:e.value;return{label:`${"number"==typeof e?e:e.label}`,value:`${t}`}})),placeholder:"",style:{width:"5.625rem"},value:[`${l?.[0]}`],onChange:e=>{const t=e.map((e=>parseInt(e,10)));c(t),a&&a(t)}}):r.jsx(gg,{"aria-label":e,min:i.min,max:i.max,value:l?.[0],type:"number",onChange:e=>d(e,0),onBlur:e=>u(e,0),className:"ds-opacity-control-text-input",onClick:e=>e.target.select(),noMarginBottom:!0}),r.jsx(fb,{css:{},...i,value:l,"aria-label":2===l?.length?[`${e} minimum`,`${e} maximum`]:[e],onValueChangeEnd:e=>{c(e.value),a&&a(e.value)}}),2===l?.length?r.jsx(gg,{"aria-label":e,min:i.min,max:i.max,value:l?.[1],type:"number",onChange:e=>d(e,1),onBlur:e=>u(e,1),className:"ds-opacity-control-text-input",onClick:e=>e.target.select(),noMarginBottom:!0}):null]})})},exports.StepProgressIndicator=({steps:e,currentStep:t,labels:n})=>{const o=Vf("StepProgressIndicator",n);return r.jsxs("div",{css:cL,children:[e.map(((e,n)=>r.jsxs("div",{css:dL,children:[r.jsx("button",{css:uL(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":o.currentStepLabel(n+1,e.label||"",t>n+1),"data-active":t>=n+1,children:t>n+1?r.jsx(Wf,{height:"1rem",width:"1rem"}):n+1}),e.label?r.jsx("p",{css:hL(t===n+1),children:e.label}):null]},`${e.label}-${n}`))),r.jsx("div",{css:pL,children:r.jsx("div",{css:fL})})]})},exports.Switch=gb,exports.TabBar=({variant:t="panel",defaultValue:o,tabs:i,onTabClick:s,activationMode:a="manual"})=>{const[l,c]=n.useState(zO(i,o)||0);return r.jsx("div",{css:AO(t),children:r.jsx(e.Tabs.Root,{width:"full",defaultValue:o||i?.[0]?.value,onValueChange:({value:e})=>{return c(zO(i,t=e)),void(s&&s(t));var t},activationMode:a,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"===VO(l)?r.jsx("div",{css:DO}):null,r.jsx(e.Tabs.Trigger,{css:[RO,"view"===t&&IO,"panel"===t&&NO,"transparent"===t&&PO],"aria-label":o["aria-label"]||o.label,...o,children:r.jsxs(e.Box,{display:"flex",alignItems:"center",gap:"0.3125rem",children:[o.icon,o.label]})},o.label),"view"===t&&1===i&&"right"===VO(l)?r.jsx("div",{css:DO}):null]},o.label)))})})})},exports.Table=({columns:o,data:i=[],renderRow:s,striped:a,stickyHeader:l,pagination:c,selectable:d,selectedRows:u,variant:h="default",onSortColumn:p,onPageSizeChange:f,onPageChange:m,onAllItemsSelected:g,onRowSelected:b,loading:v,height:y,labels:x})=>{const C=Vf("Table",x),[k,S]=n.useState({key:"",order:""}),$=n.useRef({}),M=n.useRef(null),[E,j]=n.useState({}),[T,O]=n.useState([]),{totalItems:L=i.length,currentPage:A=1,pageSize:R=10,showItemCount:N,showItemCountText:D}=c||{},I=Boolean(p),P=n.useMemo((()=>Gw(i,k,I)),[i,I,k]),z=(e,t)=>{S({key:e,order:t}),p&&p({key:e,order:t})},V=u??T,B=P.length>0&&V.length===P.length,H=V.length>0&&V.length<P.length,_=n.useMemo((()=>(e=>e.reduce(((e,t)=>(e[t.key]=t,e)),{}))(o)),[o]),F=n.useMemo((()=>(e=>e.filter((e=>e.sticky)).map((e=>e.key)))(o)),[o]),q=(e=>e.length>0?e[e.length-1]:void 0)([...void 0!==E[Ww]?[Ww]:[],...F]),W=n.useCallback((()=>{const e=((e,t,n)=>{const r={};let o=0;const i=e.filter((e=>e.sticky));return n&&i.length>0&&(r[Ww]=0,o+=n.offsetWidth),i.forEach((e=>{r[e.key]=o,o+=t[e.key]?.offsetWidth||0})),r})(o,$.current,d?M.current:void 0);j(e)}),[o,d]);n.useEffect((()=>{W()}),[W,i.length]),n.useEffect((()=>{const e=()=>{W()};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[W]),n.useEffect((()=>{void 0===u&&O((e=>((e,t)=>{const n=e.filter((e=>t.some((t=>t.id===e.id)))),r=n.length===e.length&&n.every(((t,n)=>t.id===e[n]?.id));return r?e:n})(e,i)))}),[i,u]);const U=e=>Kw(E,e.key,q),K=e=>((e,t,n,r)=>({...Uw(e,n),...Kw(t,n,r)}))(_,E,e,q),G=e=>((e,t)=>e.some((e=>e.id===t.id)))(V,e),Z=(({columns:n,selectable:r,isRowSelected:o,onRowSelected:i,stickyOffsets:s={},lastStickyColumnKey:a,getSelectRowLabel:l})=>(c,d)=>{const{id:u,name:h}=c;return t.jsxs(e.Table.Row,{className:d?.className,children:[r?t.jsx(e.Table.Cell,{...Kw(s,Ww,a),children:t.jsx(_g,{name:`checkbox-${u}`,"aria-label":l(h,u),checked:o(c),onCheckedChange:({checked:e})=>{i(c,e)}})}):null,n.map((n=>t.jsx(e.Table.Cell,{...d?.getCellProps(n.key),children:n.cell?n.cell(c):c?.[n.key]},n.key)))]})})({columns:o,selectable:d,isRowSelected:G,onRowSelected:(e,t)=>{void 0===u&&O((n=>((e,t,n)=>n?e.some((e=>e.id===t.id))?e:[...e,t]:e.filter((e=>e.id!==t.id)))(n,e,t))),b&&b(e,t)},stickyOffsets:E,lastStickyColumnKey:q,getSelectRowLabel:(e,t)=>C.selectRowLabel(e,t)}),J=s||Z;return r.jsxs("div",{children:[r.jsx("div",{css:y?Fw(y):void 0,children:r.jsxs(e.Table.Root,{css:Dw(h,l),striped:a,stickyHeader:l,interactive:!0,children:[r.jsx(e.Table.Header,{css:Iw(h),children:r.jsxs(e.Table.Row,{children:[d?r.jsx(e.Table.ColumnHeader,{ref:M,...Kw(E,Ww,q),children:r.jsx(_g,{name:"header-checkbox","aria-label":C.selectAllRowsLabel,checked:B,indeterminate:H,onCheckedChange:({checked:e})=>{void 0===u&&O(e?P:[]),g&&g(e)}})}):null,o.map((t=>{return r.jsx(e.Table.ColumnHeader,{ref:e=>{$.current[t.key]=e},...(n=t.key,Uw(_,n)),role:t.sortable?"columnheader":void 0,"aria-sort":t.sortable&&"asc"===k.order?"ascending":t.sortable&&"desc"===k.order?"descending":void 0,...U(t),children:r.jsxs("div",{css:Pw,children:[t.label,t.sortable?r.jsxs("div",{css:zw,children:[r.jsx(_f,{css:Vw(k.key===t.key&&"asc"===k.order),icon:r.jsx(Gf,{style:{transform:"rotate(180deg)"}}),onClick:()=>z(t.key,"asc"),"aria-label":C.ascendingLabel}),r.jsx(_f,{css:Vw(k.key===t.key&&"desc"===k.order),icon:r.jsx(Gf,{}),onClick:()=>z(t.key,"desc"),"aria-label":C.descendingLabel})]}):null]})},t.key);var n}))]})}),r.jsx(e.Table.Body,{css:_w(a),children:P.map((e=>r.jsx(n.Fragment,{children:J(e,{className:G(e)?"selected":void 0,getCellProps:K})},e.id)))})]})}),v?r.jsx("div",{css:qw,children:r.jsx(e.Spinner,{size:"lg",color:w("primary",500)})}):null,r.jsxs("div",{css:Bw,children:[r.jsx("div",{children:N?r.jsx(xw,{pageSize:R,currentPage:A,totalItems:L,onPageSizeChange:f,showItemCountText:D}):null}),c?r.jsx("div",{css:Hw,children:r.jsx(Nw,{totalItems:L,pageSize:R,currentPage:A,onPageChange:m})}):null]})]})},exports.TableCell=Jw,exports.TableRow=Zw,exports.Tag=Bb,exports.TextInput=gg,exports.Textarea=({label:t,caption:o,placeholder:i,errorMessage:s,required:a,disabled:l,size:c="default",showOptionalLabel:d=!0,defaultValue:u="",onChange:h,onFocus:p,onBlur:f,minLength:m,maxLength:g,labels:b,value:v,...y})=>{const x=Vf("Textarea",b),[w,C]=n.useState(u),[k,S]=n.useState(!1),[$,M]=n.useState(!1),[E,j]=n.useState(""),T=void 0!==v,O=T?String(v??""):w,L=n.useId(),A=n.useId(),R=n.useId();n.useEffect((()=>{const{length:e}=u;m&&e<m&&e>0?(S(e<m),M(!1),j(x.enterAtLeastChars(m-e))):m&&0===e&&j(x.minChars(m)),g&&e>0?(S(!1),M(e>g),j(x.charsRemaining(g-e))):g&&0===e&&j(x.maxChars(g))}),[]);const N=!!s||k||$,D=[o?L:null,N?A:null,E?R:null].filter(Boolean).join(" ")||void 0,I=Boolean(O),P=mg(p,f),z=E&&!$&&!k,V=k&&!!m||$&&!!g||z?r.jsxs(r.Fragment,{children:[k&&m?r.jsx(e.Field.ErrorText,{id:A,css:Yb,style:{fontSize:"0.75rem",lineHeight:"1rem"},"aria-live":"polite",children:x.needMoreChars(m-O.length)}):null,$&&g?r.jsx(e.Field.ErrorText,{id:A,css:Yb,style:{fontSize:"0.75rem",lineHeight:"1rem"},"aria-live":"polite",children:x.tooManyChars(O.length-g)}):null,z?r.jsx(e.Field.HelperText,{id:R,css:Xb,"aria-live":"polite",children:E}):null]}):null;return r.jsx(ag,{label:t,caption:o,errorMessage:s,invalid:N,required:a,disabled:l,size:c,showOptionalLabel:d,labels:{requiredSymbolLabel:x.requiredSymbolLabel,optionalSuffix:x.optionalSuffix},captionId:L,errorId:s?A:void 0,footer:V,semantics:"field",children:r.jsx(e.Textarea,{placeholder:i,disabled:l,focusVisibleRing:"none",css:Qb(c,I),onChange:e=>{T||C(e.target.value);const{length:t}=e.target.value;m&&g?(S(t<m),M(t>g),j(x.charsRemaining(g-t))):m?(S(t<m),M(!1),j(t<m?x.enterAtLeastChars(m-t):"")):g&&(M(t>g),S(!1),j(x.charsRemaining(g-t))),h&&h(e)},value:O,"aria-label":t||i,"aria-describedby":D,"aria-invalid":N||void 0,_placeholder:{color:"var(--chakra-colors-neutral-700)"},...y,"data-focus-visible":P.isTabFocused||void 0,onFocus:P.onFocus,onBlur:P.onBlur})})},exports.Toast=({labels:t})=>{const n=Vf("Toast",t);return Object.keys(xL).map((t=>r.jsx(e.Portal,{children:r.jsx(e.Toaster,{toaster:xL[t],insetInline:{mdDown:"4"},children:o=>{return r.jsxs(e.Toast.Root,{css:(s=o.meta?.maxWidth,i.css`
|
|
4185
4185
|
justify-content: space-between;
|
|
4186
4186
|
align-items: center;
|
|
4187
4187
|
gap: ${k(200)};
|
|
@@ -4225,4 +4225,4 @@ function _E(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
|
|
|
4225
4225
|
color: ${w("error",900)};
|
|
4226
4226
|
}
|
|
4227
4227
|
}
|
|
4228
|
-
`),width:{md:"sm"},children:[r.jsxs(e.Stack,{flexDirection:"row",className:"ds-toast-icon-container",alignItems:o.description?"flex-start":"center",children:["info"===o.type?o.meta?.icon?o.meta.icon:r.jsx(Kf,{color:"var(--chakra-colors-neutral-700)"}):null,"loading"===o.type?r.jsx(e.Spinner,{size:"lg",borderWidth:"0.1875rem",color:"var(--chakra-colors-primary-500)"}):null,"success"===o.type?o.meta?.icon?o.meta.icon:r.jsx(em,{color:"var(--chakra-colors-success-500)"}):null,"warning"===o.type?o.meta?.icon?o.meta.icon:r.jsx(tm,{color:"var(--chakra-colors-warning-500)"}):null,"error"===o.type?o.meta?.icon?o.meta.icon:r.jsx(nm,{color:"var(--chakra-colors-error-500)"}):null,r.jsxs(e.Stack,{gap:"1",flex:"1",maxWidth:"100%",children:[r.jsx(e.Toast.Title,{css:
|
|
4228
|
+
`),width:{md:"sm"},children:[r.jsxs(e.Stack,{flexDirection:"row",className:"ds-toast-icon-container",alignItems:o.description?"flex-start":"center",children:["info"===o.type?o.meta?.icon?o.meta.icon:r.jsx(Kf,{color:"var(--chakra-colors-neutral-700)"}):null,"loading"===o.type?r.jsx(e.Spinner,{size:"lg",borderWidth:"0.1875rem",color:"var(--chakra-colors-primary-500)"}):null,"success"===o.type?o.meta?.icon?o.meta.icon:r.jsx(em,{color:"var(--chakra-colors-success-500)"}):null,"warning"===o.type?o.meta?.icon?o.meta.icon:r.jsx(tm,{color:"var(--chakra-colors-warning-500)"}):null,"error"===o.type?o.meta?.icon?o.meta.icon:r.jsx(nm,{color:"var(--chakra-colors-error-500)"}):null,r.jsxs(e.Stack,{gap:"1",flex:"1",maxWidth:"100%",children:[r.jsx(e.Toast.Title,{css:mL,"aria-label":`${o.title}`,children:o.title}),o.description?r.jsx(e.Toast.Title,{css:gL,"aria-label":`${o.description}`,children:o.description}):null]})]}),o.action||o.meta?.closable?r.jsxs(e.Stack,{flexDirection:"row",children:[o.action?r.jsx(Bf,{css:bL,label:o.action.label,size:"small",variant:"info"===o.type?"primary":"secondary",onClick:()=>{o?.action?.onClick&&o.action.onClick(),xL[t].dismiss()}}):null,o.meta?.closable?r.jsx(Bf,{css:vL,label:o.meta.closableLabel,"aria-label":o.meta?.closableLabel||n.dismissLabel,leftIcon:r.jsx(Jf,{height:"0.625rem!",width:"0.625rem!"}),size:"small",variant:"secondary",onClick:()=>{o.meta?.onClose&&o.meta.onClose(),xL[t].dismiss()}}):null]}):null]});var s}})},t)))},exports.Toolbar=Tg,exports.Tooltip=Fm,exports.closeToast=e=>{Object.values(xL).forEach((t=>{t.dismiss(e)}))},exports.designSystemStyles=x,exports.designSystemStylesForTailwind=y,exports.getThemedBorderWidth=M,exports.getThemedColor=w,exports.getThemedFontSize=C,exports.getThemedLineHeight=S,exports.getThemedRadius=$,exports.getThemedSpacing=k,exports.showToast=e=>{xL[e.placement].create({title:e.label,description:e.caption,duration:e.duration||5e3,meta:{closable:e.closable,icon:e.icon,closableLabel:e.closableLabel,onClose:e.onClose,maxWidth:e.maxWidth},...e})};
|
package/dist/index.d.ts
CHANGED
|
@@ -1420,7 +1420,8 @@ declare const ItemCount: ({ pageSize, currentPage, totalItems, onPageSizeChange,
|
|
|
1420
1420
|
type ListItemVariant = 'data' | 'navigation' | 'select';
|
|
1421
1421
|
interface ListItemProps {
|
|
1422
1422
|
id?: string;
|
|
1423
|
-
label:
|
|
1423
|
+
label: React__default.ReactNode;
|
|
1424
|
+
searchLabel?: string;
|
|
1424
1425
|
caption?: string;
|
|
1425
1426
|
icon?: ReactElement;
|
|
1426
1427
|
value?: React__default.ReactNode;
|