@worldresources/wri-design-systems 2.208.1 → 2.208.3
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 +12 -3
- package/dist/index.esm.js +11 -2
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -4409,7 +4409,7 @@ function jE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
|
|
|
4409
4409
|
padding: 0.375rem;
|
|
4410
4410
|
`,aA=i.css`
|
|
4411
4411
|
padding: 0.375rem;
|
|
4412
|
-
|
|
4412
|
+
`;let lA=!1;const cA=new Set,dA=e=>{let t,n=!1;const r=()=>{n&&(n=!1,(()=>{lA=!1;const[e]=cA;e&&(cA.delete(e),e())})())},o=()=>{lA=!0,n=!0,t=void 0,e()};return lA?(t=()=>o(),cA.add(t)):o(),()=>{n?r():t&&cA.delete(t)}},uA={pauseOnPageIdle:!0,offsets:"1.5rem"},hA={"top-start":e.createToaster({placement:"top-start",...uA}),top:e.createToaster({placement:"top",...uA}),"top-end":e.createToaster({placement:"top-end",...uA}),"bottom-start":e.createToaster({placement:"bottom-start",...uA}),bottom:e.createToaster({placement:"bottom",...uA}),"bottom-end":e.createToaster({placement:"bottom-end",...uA})};exports.AlertBanner=ZL,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:PC,children:r.jsxs(e.Accordion.Root,{multiple:!0,value:a?void 0:[u],defaultValue:s?[u]:[],children:[r.jsxs(e.Accordion.Item,{css:VC,value:u,children:[o&&r.jsx(e.Accordion.ItemTrigger,{id:f,"aria-expanded":h,css:zC,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:BC,children:i})]})]}),c&&i&&r.jsx(e.Box,{css:BC,children:i})]})})},exports.Avatar=qL,exports.Badge=FL,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:ow(l,c),children:r.jsxs("div",{className:"ds-base-map-scroll-content",children:[r.jsxs("div",{css:iw,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:sw,children:[o?r.jsx("div",{css:aw,children:o.map((e=>r.jsxs("div",{children:[r.jsx(cb,{css:{},checked:e.checked,onCheckedChange:({checked:t})=>e.onCheckedChange({checked:Boolean(t)}),children:e.label}),e.checked&&e.children?r.jsx("div",{css:lw,children:e.children}):null]},e.label)))}):null,s?r.jsx("div",{css:cw,children:s.map((e=>{return r.jsxs("div",{css:dw(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`
|
|
4413
4413
|
height: ${k(800)};
|
|
4414
4414
|
width: ${k(800)};
|
|
4415
4415
|
border: ${j(100)} solid ${w("neutral",300)};
|
|
@@ -4509,6 +4509,15 @@ function jE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
|
|
|
4509
4509
|
.option-card-icon-container svg {
|
|
4510
4510
|
color: ${w("neutral",400)};
|
|
4511
4511
|
}
|
|
4512
|
+
|
|
4513
|
+
&[data-state='checked'] {
|
|
4514
|
+
border: ${j(100)} solid
|
|
4515
|
+
${c||w("primary",700)};
|
|
4516
|
+
|
|
4517
|
+
.option-card-icon-container svg {
|
|
4518
|
+
color: ${c||w("neutral",900)};
|
|
4519
|
+
}
|
|
4520
|
+
}
|
|
4512
4521
|
}
|
|
4513
4522
|
`),value:t.value,disabled:t.disabled,children:[r.jsx(e.RadioCard.ItemHiddenInput,{}),r.jsxs(e.RadioCard.ItemControl,{css:gb,children:[r.jsxs("div",{css:bb(s),children:[r.jsx("div",{css:vb,className:"option-card-icon-container",children:t.icon}),r.jsxs("div",{style:{width:"100%"},children:[r.jsx("p",{css:yb(s,t.disabled),"aria-label":t.label,"aria-disabled":t.disabled,children:t.label}),r.jsx("p",{css:xb(s,t.disabled),"aria-label":t.caption,"aria-disabled":t.disabled,children:t.caption})]})]}),l?null:r.jsx(e.RadioCard.ItemIndicator,{css:wb(s)})]}),t.children&&"expanded"===s?r.jsx(e.RadioCard.ItemAddon,{css:(n=t.disabled,i.css`
|
|
4514
4523
|
width: 100%;
|
|
@@ -4537,7 +4546,7 @@ function jE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
|
|
|
4537
4546
|
border: ${j(100)} solid ${w("neutral",300)};
|
|
4538
4547
|
border-radius: ${$(300)};
|
|
4539
4548
|
${s?`background: ${s};`:""}
|
|
4540
|
-
`)}):r.jsx("div",{css:Zw,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:Jw,children:t?.map((e=>r.jsx("div",{style:{width:o?"auto":`calc(100% / ${t.length})`,display:"flex",justifyContent:"center"},children:r.jsx("p",{css:Xw,children:e})},e)))}),n&&n.length?r.jsx("div",{css:Jw,children:n.map((e=>r.jsx("div",{style:{width:o?"auto":`calc(100% / ${t.length})`,display:"flex",justifyContent:"center"},children:r.jsx("p",{css:Yw,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),[$,j]=n.useState(-1),[M,E]=n.useState(!1),[T,O]=n.useState("pointer"),L=n.useRef(null),{contentRef:A,placement:R}=Ov(),N=`search-results-${n.useId()}`,D=e=>{const t=s.find((t=>t.id===e||LL(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)||LL(e).toLowerCase().includes(t)||e.caption?.toLowerCase().includes(t)})).map((e=>({id:e.id??LL(e),label:e.label,searchLabel:e.searchLabel,caption:e.caption,variant:"select",icon:e.icon,onItemClick:()=>D(e.id||LL(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):M&&(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:jL,"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:()=>E(!0),onBlur:()=>E(!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"),j((e=>Math.min(e+1,k.length-1)))),"ArrowUp"===e.key&&(e.preventDefault(),O("keyboard"),j((e=>Math.max(e-1,0)))),"Enter"===e.key&&(e.preventDefault(),$>=0)){const e=k[$];D(e.id||LL(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:ML,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(OL,{highlightedIndex:$,items:k,query:b,onSelect:D}),"list"===c&&!l&&r.jsx(pC,{items:k,highlightedIndex:$})]})})})]})},exports.Select=vv,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=iO(v,w);e>0&&e<w.length-1?C=m.makeFullScreenLabel:e===w.length-1&&(C=m.expandedSheetLabel)}const k=!(null==v||!w.length||iO(v,w)!==w.length-1);return r.jsx(nO,{ref:g,css:oO(!!e,p),className:u,open:i,onDismiss:s,header:r.jsxs("div",{children:[r.jsx("button",{type:"button",disabled:k,"aria-label":C,css:rO,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(pw,{count:o,mode:i,onClick:e,ref:n,showFocusState:r,variant:s}),exports.Slider=Bb,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:$v,children:[i.step&&i.marks?r.jsx(vv,{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(Bb,{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:YL,children:[e.map(((e,n)=>r.jsxs("div",{css:QL,children:[r.jsx("button",{css:eA(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:tA(t===n+1),children:e.label}):null]},`${e.label}-${n}`))),r.jsx("div",{css:nA,children:r.jsx("div",{css:rA})})]})},exports.Switch=_b,exports.TabBar=({variant:t="panel",defaultValue:o,tabs:i,onTabClick:s,activationMode:a="manual"})=>{const[l,c]=n.useState(kL(i,o)||0);return r.jsx("div",{css:bL(t),children:r.jsx(e.Tabs.Root,{width:"full",defaultValue:o||i?.[0]?.value,onValueChange:({value:e})=>{return c(kL(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,s)=>r.jsxs(n.Fragment,{children:["view"===t&&1===s&&"left"===SL(l)?r.jsx("div",{css:xL}):null,r.jsx(e.Tabs.Trigger,{css:[vL,"view"===t&&wL,"panel"===t&&yL,"transparent"===t&&CL],"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===s&&s<i.length-1&&"right"===SL(l)?r.jsx("div",{css:xL}):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({}),j=n.useRef(null),[M,E]=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((()=>AC(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!==M[TC]?[TC]:[],...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[TC]=0,o+=n.offsetWidth),i.forEach((e=>{r[e.key]=o,o+=t[e.key]?.offsetWidth||0})),r})(o,$.current,d?j.current:void 0);E(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=>LC(M,e.key,q),K=e=>((e,t,n,r)=>({...OC(e,n),...LC(t,n,r)}))(_,M,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,{...LC(s,TC,a),children:t.jsx(cb,{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:M,lastStickyColumnKey:q,getSelectRowLabel:(e,t)=>C.selectRowLabel(e,t)}),J=s||Z;return r.jsxs("div",{children:[r.jsx("div",{css:y?MC(y):void 0,children:r.jsxs(e.Table.Root,{css:yC(h,l),striped:a,stickyHeader:l,interactive:!0,children:[r.jsx(e.Table.Header,{css:xC(h),children:r.jsxs(e.Table.Row,{children:[d?r.jsx(e.Table.ColumnHeader,{ref:j,...LC(M,TC,q),children:r.jsx(cb,{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,OC(_,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:wC,children:[t.label,t.sortable?r.jsxs("div",{css:CC,children:[r.jsx(_f,{css:kC(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:kC(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:jC(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:EC,children:r.jsx(e.Spinner,{size:"lg",color:w("primary",500)})}):null,r.jsxs("div",{css:SC,children:[N?r.jsx(oC,{pageSize:R,currentPage:A,totalItems:L,onPageSizeChange:f,showItemCountText:D}):null,c?r.jsx("div",{css:$C,children:r.jsx(vC,{totalItems:L,pageSize:R,currentPage:A,onPageChange:m})}):null]})]})},exports.TableCell=NC,exports.TableRow=RC,exports.Tag=mv,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),[$,j]=n.useState(!1),[M,E]=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),j(!1),E(x.enterAtLeastChars(m-e))):m&&0===e&&E(x.minChars(m)),g&&e>0?(S(!1),j(e>g),E(x.charsRemaining(g-e))):g&&0===e&&E(x.maxChars(g))}),[]);const N=!!s||k||$,D=[o?L:null,N?A:null,M?R:null].filter(Boolean).join(" ")||void 0,I=Boolean(O),P=mg(p,f),z=M&&!$&&!k,V=k&&!!m||$&&!!g||z?r.jsxs(r.Fragment,{children:[k&&m?r.jsx(e.Field.ErrorText,{id:A,css:Mv,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:Mv,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:jv,"aria-live":"polite",children:M}):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:Ev(c,I),onChange:e=>{T||C(e.target.value);const{length:t}=e.target.value;m&&g?(S(t<m),j(t>g),E(x.charsRemaining(g-t))):m?(S(t<m),j(!1),E(t<m?x.enterAtLeastChars(m-t):"")):g&&(j(t>g),S(!1),E(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(cA).map((t=>r.jsx(e.Portal,{children:r.jsx(e.Toaster,{toaster:cA[t],insetInline:{mdDown:"4"},children:o=>{return r.jsxs(e.Toast.Root,{css:(s=o.meta?.maxWidth,i.css`
|
|
4549
|
+
`)}):r.jsx("div",{css:Zw,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:Jw,children:t?.map((e=>r.jsx("div",{style:{width:o?"auto":`calc(100% / ${t.length})`,display:"flex",justifyContent:"center"},children:r.jsx("p",{css:Xw,children:e})},e)))}),n&&n.length?r.jsx("div",{css:Jw,children:n.map((e=>r.jsx("div",{style:{width:o?"auto":`calc(100% / ${t.length})`,display:"flex",justifyContent:"center"},children:r.jsx("p",{css:Yw,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),[$,j]=n.useState(-1),[M,E]=n.useState(!1),[T,O]=n.useState("pointer"),L=n.useRef(null),{contentRef:A,placement:R}=Ov(),N=`search-results-${n.useId()}`,D=e=>{const t=s.find((t=>t.id===e||LL(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)||LL(e).toLowerCase().includes(t)||e.caption?.toLowerCase().includes(t)})).map((e=>({id:e.id??LL(e),label:e.label,searchLabel:e.searchLabel,caption:e.caption,variant:"select",icon:e.icon,onItemClick:()=>D(e.id||LL(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):M&&(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:jL,"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:()=>E(!0),onBlur:()=>E(!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"),j((e=>Math.min(e+1,k.length-1)))),"ArrowUp"===e.key&&(e.preventDefault(),O("keyboard"),j((e=>Math.max(e-1,0)))),"Enter"===e.key&&(e.preventDefault(),$>=0)){const e=k[$];D(e.id||LL(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:ML,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(OL,{highlightedIndex:$,items:k,query:b,onSelect:D}),"list"===c&&!l&&r.jsx(pC,{items:k,highlightedIndex:$})]})})})]})},exports.Select=vv,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=iO(v,w);e>0&&e<w.length-1?C=m.makeFullScreenLabel:e===w.length-1&&(C=m.expandedSheetLabel)}const k=!(null==v||!w.length||iO(v,w)!==w.length-1);return r.jsx(nO,{ref:g,css:oO(!!e,p),className:u,open:i,onDismiss:s,header:r.jsxs("div",{children:[r.jsx("button",{type:"button",disabled:k,"aria-label":C,css:rO,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(pw,{count:o,mode:i,onClick:e,ref:n,showFocusState:r,variant:s}),exports.Slider=Bb,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:$v,children:[i.step&&i.marks?r.jsx(vv,{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(Bb,{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:YL,children:[e.map(((e,n)=>r.jsxs("div",{css:QL,children:[r.jsx("button",{css:eA(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:tA(t===n+1),children:e.label}):null]},`${e.label}-${n}`))),r.jsx("div",{css:nA,children:r.jsx("div",{css:rA})})]})},exports.Switch=_b,exports.TabBar=({variant:t="panel",defaultValue:o,tabs:i,onTabClick:s,activationMode:a="manual"})=>{const[l,c]=n.useState(kL(i,o)||0);return r.jsx("div",{css:bL(t),children:r.jsx(e.Tabs.Root,{width:"full",defaultValue:o||i?.[0]?.value,onValueChange:({value:e})=>{return c(kL(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,s)=>r.jsxs(n.Fragment,{children:["view"===t&&1===s&&"left"===SL(l)?r.jsx("div",{css:xL}):null,r.jsx(e.Tabs.Trigger,{css:[vL,"view"===t&&wL,"panel"===t&&yL,"transparent"===t&&CL],"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===s&&s<i.length-1&&"right"===SL(l)?r.jsx("div",{css:xL}):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({}),j=n.useRef(null),[M,E]=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((()=>AC(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!==M[TC]?[TC]:[],...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[TC]=0,o+=n.offsetWidth),i.forEach((e=>{r[e.key]=o,o+=t[e.key]?.offsetWidth||0})),r})(o,$.current,d?j.current:void 0);E(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=>LC(M,e.key,q),K=e=>((e,t,n,r)=>({...OC(e,n),...LC(t,n,r)}))(_,M,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,{...LC(s,TC,a),children:t.jsx(cb,{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:M,lastStickyColumnKey:q,getSelectRowLabel:(e,t)=>C.selectRowLabel(e,t)}),J=s||Z;return r.jsxs("div",{children:[r.jsx("div",{css:y?MC(y):void 0,children:r.jsxs(e.Table.Root,{css:yC(h,l),striped:a,stickyHeader:l,interactive:!0,children:[r.jsx(e.Table.Header,{css:xC(h),children:r.jsxs(e.Table.Row,{children:[d?r.jsx(e.Table.ColumnHeader,{ref:j,...LC(M,TC,q),children:r.jsx(cb,{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,OC(_,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:wC,children:[t.label,t.sortable?r.jsxs("div",{css:CC,children:[r.jsx(_f,{css:kC(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:kC(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:jC(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:EC,children:r.jsx(e.Spinner,{size:"lg",color:w("primary",500)})}):null,r.jsxs("div",{css:SC,children:[N?r.jsx(oC,{pageSize:R,currentPage:A,totalItems:L,onPageSizeChange:f,showItemCountText:D}):null,c?r.jsx("div",{css:$C,children:r.jsx(vC,{totalItems:L,pageSize:R,currentPage:A,onPageChange:m})}):null]})]})},exports.TableCell=NC,exports.TableRow=RC,exports.Tag=mv,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),[$,j]=n.useState(!1),[M,E]=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),j(!1),E(x.enterAtLeastChars(m-e))):m&&0===e&&E(x.minChars(m)),g&&e>0?(S(!1),j(e>g),E(x.charsRemaining(g-e))):g&&0===e&&E(x.maxChars(g))}),[]);const N=!!s||k||$,D=[o?L:null,N?A:null,M?R:null].filter(Boolean).join(" ")||void 0,I=Boolean(O),P=mg(p,f),z=M&&!$&&!k,V=k&&!!m||$&&!!g||z?r.jsxs(r.Fragment,{children:[k&&m?r.jsx(e.Field.ErrorText,{id:A,css:Mv,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:Mv,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:jv,"aria-live":"polite",children:M}):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:Ev(c,I),onChange:e=>{T||C(e.target.value);const{length:t}=e.target.value;m&&g?(S(t<m),j(t>g),E(x.charsRemaining(g-t))):m?(S(t<m),j(!1),E(t<m?x.enterAtLeastChars(m-t):"")):g&&(j(t>g),S(!1),E(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 o=Vf("Toast",t),[s,a]=n.useState(!1);return n.useEffect((()=>{const e=dA((()=>a(!0)));return()=>{e(),a(!1)}}),[]),s?Object.keys(hA).map((t=>r.jsx(e.Portal,{children:r.jsx(e.Toaster,{toaster:hA[t],insetInline:{mdDown:"4"},children:n=>{return r.jsxs(e.Toast.Root,{css:(s=n.meta?.maxWidth,i.css`
|
|
4541
4550
|
justify-content: space-between;
|
|
4542
4551
|
align-items: center;
|
|
4543
4552
|
gap: ${k(200)};
|
|
@@ -4581,4 +4590,4 @@ function jE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
|
|
|
4581
4590
|
color: ${w("error",900)};
|
|
4582
4591
|
}
|
|
4583
4592
|
}
|
|
4584
|
-
`),width:{md:"sm"},children:[r.jsxs(e.Stack,{flexDirection:"row",className:"ds-toast-icon-container",alignItems:
|
|
4593
|
+
`),width:{md:"sm"},children:[r.jsxs(e.Stack,{flexDirection:"row",className:"ds-toast-icon-container",alignItems:n.description?"flex-start":"center",children:["info"===n.type?n.meta?.icon?n.meta.icon:r.jsx(Kf,{color:"var(--chakra-colors-neutral-700)"}):null,"loading"===n.type?r.jsx(e.Spinner,{size:"lg",borderWidth:"0.1875rem",color:"var(--chakra-colors-primary-700)"}):null,"success"===n.type?n.meta?.icon?n.meta.icon:r.jsx(tm,{color:"var(--chakra-colors-success-500)"}):null,"warning"===n.type?n.meta?.icon?n.meta.icon:r.jsx(nm,{color:"var(--chakra-colors-warning-500)"}):null,"error"===n.type?n.meta?.icon?n.meta.icon:r.jsx(rm,{color:"var(--chakra-colors-error-500)"}):null,r.jsxs(e.Stack,{gap:"1",flex:"1",maxWidth:"100%",children:[r.jsx(e.Toast.Title,{css:oA,"aria-label":`${n.title}`,children:n.title}),n.description?r.jsx(e.Toast.Title,{css:iA,"aria-label":`${n.description}`,children:n.description}):null]})]}),n.action||n.meta?.closable?r.jsxs(e.Stack,{flexDirection:"row",children:[n.action?r.jsx(Bf,{css:sA,label:n.action.label,size:"small",variant:"info"===n.type?"primary":"secondary",onClick:()=>{n?.action?.onClick&&n.action.onClick(),hA[t].dismiss(n.id)}}):null,n.meta?.closable?r.jsx(Bf,{css:aA,label:n.meta.closableLabel,"aria-label":n.meta?.closableLabel||o.dismissLabel,leftIcon:r.jsx(Xf,{height:"0.625rem!",width:"0.625rem!"}),size:"small",variant:"secondary",onClick:()=>{n.meta?.onClose&&n.meta.onClose(),hA[t].dismiss(n.id)}}):null]}):null]});var s}})},t))):null},exports.Toolbar=Jg,exports.Tooltip=Fm,exports.closeToast=e=>{Object.values(hA).forEach((t=>{t.dismiss(e)}))},exports.designSystemStyles=x,exports.designSystemStylesForTailwind=y,exports.getThemedBorderWidth=j,exports.getThemedColor=w,exports.getThemedFontSize=C,exports.getThemedLineHeight=S,exports.getThemedRadius=$,exports.getThemedSpacing=k,exports.showToast=e=>{hA[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.esm.js
CHANGED
|
@@ -1307,6 +1307,15 @@ import{createSystem as e,defaultConfig as t,Button as n,Box as r,Spinner as o,Ic
|
|
|
1307
1307
|
.option-card-icon-container svg {
|
|
1308
1308
|
color: ${Ie("neutral",400)};
|
|
1309
1309
|
}
|
|
1310
|
+
|
|
1311
|
+
&[data-state='checked'] {
|
|
1312
|
+
border: ${_e(100)} solid
|
|
1313
|
+
${s||Ie("primary",700)};
|
|
1314
|
+
|
|
1315
|
+
.option-card-icon-container svg {
|
|
1316
|
+
color: ${s||Ie("neutral",900)};
|
|
1317
|
+
}
|
|
1318
|
+
}
|
|
1310
1319
|
}
|
|
1311
1320
|
`),value:e.value,disabled:e.disabled,children:[ve(y.ItemHiddenInput,{}),be(y.ItemControl,{css:Vv,children:[be("div",{css:Hv(r),children:[ve("div",{css:Bv,className:"option-card-icon-container",children:e.icon}),be("div",{style:{width:"100%"},children:[ve("p",{css:_v(r,e.disabled),"aria-label":e.label,"aria-disabled":e.disabled,children:e.label}),ve("p",{css:jv(r,e.disabled),"aria-label":e.caption,"aria-disabled":e.disabled,children:e.caption})]})]}),i?null:ve(y.ItemIndicator,{css:Fv(r)})]}),e.children&&"expanded"===r?ve(y.ItemAddon,{css:(t=e.disabled,ke`
|
|
1312
1321
|
width: 100%;
|
|
@@ -4537,7 +4546,7 @@ function bL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
|
|
|
4537
4546
|
padding: 0.375rem;
|
|
4538
4547
|
`,cD=ke`
|
|
4539
4548
|
padding: 0.375rem;
|
|
4540
|
-
|
|
4549
|
+
`;let dD=!1;const uD=new Set,hD=e=>{let t,n=!1;const r=()=>{n&&(n=!1,(()=>{dD=!1;const[e]=uD;e&&(uD.delete(e),e())})())},o=()=>{dD=!0,n=!0,t=void 0,e()};return dD?(t=()=>o(),uD.add(t)):o(),()=>{n?r():t&&uD.delete(t)}},pD={pauseOnPageIdle:!0,offsets:"1.5rem"},fD={"top-start":K({placement:"top-start",...pD}),top:K({placement:"top",...pD}),"top-end":K({placement:"top-end",...pD}),"bottom-start":K({placement:"bottom-start",...pD}),bottom:K({placement:"bottom",...pD}),"bottom-end":K({placement:"bottom-end",...pD})},mD=e=>{fD[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})},gD=e=>{Object.values(fD).forEach((t=>{t.dismiss(e)}))},bD=({labels:e})=>{const t=tg("Toast",e),[n,r]=ae(!1);return ce((()=>{const e=hD((()=>r(!0)));return()=>{e(),r(!1)}}),[]),n?Object.keys(fD).map((e=>ve(a,{children:ve(G,{toaster:fD[e],insetInline:{mdDown:"4"},children:n=>{return be(Z.Root,{css:(r=n.meta?.maxWidth,ke`
|
|
4541
4550
|
justify-content: space-between;
|
|
4542
4551
|
align-items: center;
|
|
4543
4552
|
gap: ${Ve(200)};
|
|
@@ -4581,4 +4590,4 @@ function bL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
|
|
|
4581
4590
|
color: ${Ie("error",900)};
|
|
4582
4591
|
}
|
|
4583
4592
|
}
|
|
4584
|
-
`),width:{md:"sm"},children:[be(J,{flexDirection:"row",className:"ds-toast-icon-container",alignItems:n.description?"flex-start":"center",children:["info"===n.type?n.meta?.icon?n.meta.icon:ve(cg,{color:"var(--chakra-colors-neutral-700)"}):null,"loading"===n.type?ve(o,{size:"lg",borderWidth:"0.1875rem",color:"var(--chakra-colors-primary-700)"}):null,"success"===n.type?n.meta?.icon?n.meta.icon:ve(bg,{color:"var(--chakra-colors-success-500)"}):null,"warning"===n.type?n.meta?.icon?n.meta.icon:ve(vg,{color:"var(--chakra-colors-warning-500)"}):null,"error"===n.type?n.meta?.icon?n.meta.icon:ve(yg,{color:"var(--chakra-colors-error-500)"}):null,be(J,{gap:"1",flex:"1",maxWidth:"100%",children:[ve(Z.Title,{css:sD,"aria-label":`${n.title}`,children:n.title}),n.description?ve(Z.Title,{css:aD,"aria-label":`${n.description}`,children:n.description}):null]})]}),n.action||n.meta?.closable?be(J,{flexDirection:"row",children:[n.action?ve(ng,{css:lD,label:n.action.label,size:"small",variant:"info"===n.type?"primary":"secondary",onClick:()=>{n?.action?.onClick&&n.action.onClick(),
|
|
4593
|
+
`),width:{md:"sm"},children:[be(J,{flexDirection:"row",className:"ds-toast-icon-container",alignItems:n.description?"flex-start":"center",children:["info"===n.type?n.meta?.icon?n.meta.icon:ve(cg,{color:"var(--chakra-colors-neutral-700)"}):null,"loading"===n.type?ve(o,{size:"lg",borderWidth:"0.1875rem",color:"var(--chakra-colors-primary-700)"}):null,"success"===n.type?n.meta?.icon?n.meta.icon:ve(bg,{color:"var(--chakra-colors-success-500)"}):null,"warning"===n.type?n.meta?.icon?n.meta.icon:ve(vg,{color:"var(--chakra-colors-warning-500)"}):null,"error"===n.type?n.meta?.icon?n.meta.icon:ve(yg,{color:"var(--chakra-colors-error-500)"}):null,be(J,{gap:"1",flex:"1",maxWidth:"100%",children:[ve(Z.Title,{css:sD,"aria-label":`${n.title}`,children:n.title}),n.description?ve(Z.Title,{css:aD,"aria-label":`${n.description}`,children:n.description}):null]})]}),n.action||n.meta?.closable?be(J,{flexDirection:"row",children:[n.action?ve(ng,{css:lD,label:n.action.label,size:"small",variant:"info"===n.type?"primary":"secondary",onClick:()=>{n?.action?.onClick&&n.action.onClick(),fD[e].dismiss(n.id)}}):null,n.meta?.closable?ve(ng,{css:cD,label:n.meta.closableLabel,"aria-label":n.meta?.closableLabel||t.dismissLabel,leftIcon:ve(pg,{height:"0.625rem!",width:"0.625rem!"}),size:"small",variant:"secondary",onClick:()=>{n.meta?.onClose&&n.meta.onClose(),fD[e].dismiss(n.id)}}):null]}):null]});var r}})},e))):null};export{ZR as AlertBanner,O$ as AnalysisWidget,qR as Avatar,FR as Badge,FC as BaseMap,MN as Breadcrumb,ng as Button,Lv as Checkbox,yy as CheckboxList,zv as CheckboxOptionCard,jb as CloseButton,UC as ClusterPoint,uw as Combobox,Fe as DesignSystemLocaleProvider,$$ as ExtendableCard,kb as FieldWrapper,NN as Footer,Tv as FormContainer,DC as GuidedTour,og as IconButton,cN as InlineMessage,Fy as InputWithUnits,qk as ItemCount,ik as LayerGroup,sk as LayerGroupContainer,ok as LayerItem,uk as LayerParameters,kk as LegendItem,Qk as List,mv as MapControlsToolbar,WC as MapMarker,GC as MapMarkers,EC as MapPopUp,nb as Menu,CN as MobileSearch,VN as MobileTabBar,OS as Modal,kv as MultiActionButton,lR as Navbar,fR as NavigationRail,Ck as OpacityControl,qv as OptionCard,o$ as Pagination,IS as Panel,Zy as Password,YR as ProgressBar,Nk as QualitativeAttribute,Gv as Radio,Zv as RadioGroup,Xy as RadioList,Hb as RichTextEditor,Bb as SSOButtons,Hk as ScaleBar,AR as Search,jy as Select,XA as Sheet,KC as SimpleMapPin,cy as Slider,Qy as SliderInput,iD as StepProgressIndicator,uy as Switch,kR as TabBar,y$ as Table,x$ as TableCell,w$ as TableRow,Hy as Tag,Nb as TextInput,rw as Textarea,bD as Toast,fv as Toolbar,ib as Tooltip,gD as closeToast,Pe as designSystemStyles,De as designSystemStylesForTailwind,_e as getThemedBorderWidth,Ie as getThemedColor,ze as getThemedFontSize,He as getThemedLineHeight,Be as getThemedRadius,Ve as getThemedSpacing,mD as showToast};
|