@worldresources/wri-design-systems 2.199.0 → 2.200.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +3 -3
- package/dist/index.d.ts +7 -4
- package/dist/index.esm.js +2 -2
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -404,7 +404,7 @@
|
|
|
404
404
|
}
|
|
405
405
|
|
|
406
406
|
${t||n?`\n border: ${j(100)} solid ${w("neutral",700)};\n `:""}
|
|
407
|
-
`,Ym=({label:t,caption:o,placeholder:i,errorMessage:s,required:a,disabled:l,size:c="default",
|
|
407
|
+
`,Ym=({label:t,caption:o,placeholder:i,errorMessage:s,required:a,disabled:l,size:c="default",showOptionalLabel:d=!0,noMarginBottom:u=!1,defaultValue:h="",onChange:p,labels:f,...m})=>{const g=Mf("TextInput",f),[v,b]=n.useState(h);return r.jsxs("div",{css:Um(c,u),className:"ds-text-input-container",children:[s?r.jsx("div",{css:Km}):null,r.jsxs(e.Field.Root,{required:a,invalid:!!s,gap:"0",style:{marginLeft:s?"1.1875rem":"0px"},children:[t?r.jsxs(e.Field.Label,{css:Gm(c,l),"aria-label":t,children:[r.jsx(e.Field.RequiredIndicator,{"aria-label":g.requiredSymbolLabel}),t,!a&&d?r.jsx("span",{children:g.optionalSuffix}):null]}):null,o?r.jsx(e.Field.HelperText,{css:Zm(c,l),"aria-label":o,children:o}):null,s?r.jsx(e.Field.ErrorText,{css:Jm(c),"aria-label":s,children:s}):null,r.jsx(e.Input,{placeholder:i,disabled:l,css:Xm(c,v,h),onChange:e=>{b(e.target.value),p&&p(e)},value:v,_placeholder:{color:"var(--chakra-colors-neutral-500)"},...m})]})]})};const Qm=n=>{const{editor:r,disabled:o}=xf(),[i,s]=l.useState(!1),[a,c]=l.useState(""),[d,u]=l.useState(""),[h,p]=l.useState(""),f=l.useRef(null);if(l.useEffect((()=>{o&&s(!1)}),[o]),!r)return null;const{label:m="Link",urlPlaceholder:g="http://example.org",labelPlaceholder:v="Label (optional)",labelInputAriaLabel:b="Link label",applyLabel:y="Apply",removeLabel:x="Remove",invalidUrlMessage:C="Please enter a valid URL",...S}=n,$=r.isActive("link"),j=()=>f.current?r.chain().focus().setTextSelection({from:f.current.from,to:f.current.to}):r.chain().focus();return t.jsxs(e.Popover.Root,{open:i,onOpenChange:({open:e})=>{o?s(!1):(s(e),e&&(()=>{const{from:e,to:t,empty:n}=r.state.selection,o=r.state.doc.textBetween(e,t," ").trim();f.current={from:e,to:t,empty:n,selectedText:o};const i=r.getAttributes("link")?.href||o||"";c(i||"http://"),u(o),p("")})())},positioning:{placement:"bottom-start"},children:[t.jsx(e.Popover.Trigger,{asChild:!0,children:t.jsx(e.Box,{children:t.jsx(Tm,{content:m,children:t.jsx(Of,{icon:t.jsx("span",{"data-rte-icon":"true",children:t.jsx(pm,{})}),"aria-label":m,"aria-pressed":$||i,disabled:o,onMouseDown:e=>{e.preventDefault()},onClick:()=>{o||s((e=>!e))},...S})})})}),t.jsx(e.Popover.Positioner,{children:t.jsx(e.Popover.Content,{css:{padding:k(300),borderColor:w("neutral",300),width:`calc(( ${k(2800)} + ${k(2e3)} ) * 2)`,maxWidth:"90vw"},children:t.jsx(e.Popover.Body,{children:t.jsxs(e.Box,{css:{display:"flex",flexDirection:"column",gap:k(300)},children:[t.jsx(Ym,{"aria-label":m,placeholder:g,disabled:o,noMarginBottom:!0,value:a,onChange:e=>{c(e.target.value),h&&p("")}}),t.jsx(Ym,{"aria-label":b,placeholder:v,disabled:o,noMarginBottom:!0,value:d,onChange:e=>{u(e.target.value)}}),h?t.jsx(e.Text,{css:{color:w("error",700)},children:h}):null,t.jsxs(e.Box,{css:{display:"flex",gap:k(200),justifyContent:"flex-end"},children:[$?t.jsx(Ef,{variant:"borderless",size:"small",label:x,disabled:o,onMouseDown:e=>e.preventDefault(),onClick:()=>{j().unsetLink().run(),s(!1)}}):null,t.jsx(Ef,{variant:"secondary",size:"small",label:y,disabled:o,onMouseDown:e=>e.preventDefault(),onClick:()=>{const e=function(e){const t=e.trim();return t?/^(https?:\/\/|mailto:|tel:)/i.test(t)?t:`http://${t}`:""}(a),t=d.trim();if(!e||!function(e){if(/^(mailto:|tel:)/i.test(e))return!0;try{const t=new URL(e);return"http:"===t.protocol||"https:"===t.protocol}catch{return!1}}(e))return void p(C);const n=j(),r=f.current;if(r?.empty){const r=t||e;n.insertContent({type:"text",text:r,marks:[{type:"link",attrs:{href:e}}]}).run()}else t&&t!==r?.selectedText?n.insertContent({type:"text",text:t,marks:[{type:"link",attrs:{href:e}}]}).run():n.extendMarkRange("link").setLink({href:e}).run();s(!1)}})]})]})})})})]})},eg=l.forwardRef(((n,r)=>{const{editor:o,children:i,css:s,disabled:a,...c}=n,d=l.useMemo((()=>({editor:o,disabled:Boolean(a)})),[o,a]);return t.jsx(yf.Provider,{value:d,children:t.jsx(e.Box,{ref:r,"data-disabled":a||void 0,css:[wf,s],...c,children:i})})})),tg={fixed:{bg:"bg",roundedTop:"l2",borderBottomWidth:"1px",p:"3"},floating:{bg:"bg.panel",roundedTop:"l2",shadow:"sm",p:"3"}},ng={Root:eg,Toolbar:l.forwardRef(((n,r)=>{const{variant:o="fixed",css:i,...s}=n;return t.jsx(e.HStack,{ref:r,flexWrap:"wrap",separator:t.jsx(e.StackSeparator,{h:"5",alignSelf:"center"}),css:[tg[o],i],...s})})),Content:l.forwardRef(((e,n)=>{const{editor:r}=xf();return r?t.jsx(sf,{editor:r,innerRef:n,...e}):null})),ControlGroup:l.forwardRef(((n,r)=>t.jsx(e.HStack,{ref:r,gap:"2",...n})))},rg=["undo","redo","textType","alignment","fontSize","bold","italic","underline","strikethrough","bulletList","orderedList","link","image"],og={Google:({ariaLabel:e,size:n="default",onClick:r})=>t.jsx(Ef,{label:"Google",leftIcon:t.jsx(om,{}),"aria-label":e||"Google Login",variant:"secondary",size:n,onClick:r}),Facebook:({ariaLabel:e,size:n="default",onClick:r})=>t.jsx(Ef,{label:"Facebook",leftIcon:t.jsx(im,{}),"aria-label":e||"Facebook Login",variant:"secondary",size:n,onClick:r}),X:({ariaLabel:e,size:n="default",onClick:r})=>t.jsx(Ef,{label:"X",leftIcon:t.jsx(sm,{}),"aria-label":e||"X Login",variant:"secondary",size:n,onClick:r}),Microsoft:({ariaLabel:e,size:n="default",onClick:r})=>t.jsx(Ef,{label:"Microsoft",leftIcon:t.jsx(am,{}),"aria-label":e||"Microsoft Login",variant:"secondary",size:n,onClick:r})},ig=i.css`
|
|
408
408
|
width: ${k(500)} !important;
|
|
409
409
|
padding: 0 !important;
|
|
410
410
|
min-width: ${k(500)} !important;
|
|
@@ -3915,7 +3915,7 @@ function _M(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
|
|
|
3915
3915
|
padding: 0;
|
|
3916
3916
|
padding-top: ${k(200)};
|
|
3917
3917
|
color: ${o?w("neutral",500):"inherit"};
|
|
3918
|
-
`),children:n.children}):null]},`${n.label}-${n.value}`);var o,s}))})}),exports.CloseButton=sg,exports.ClusterPoint=({onClick:e,triggerRef:n,showFocusState:r,count:o,mode:i,variant:s="cluster"})=>t.jsx(vb,{count:o,mode:i,onClick:e,ref:n,showFocusState:r,variant:s}),exports.Combobox=({label:t,required:o,caption:i,errorMessage:s,size:a,disabled:l,placeholder:c,labels:d,noMarginBottom:u,initialItems:h=[],multiple:p=!1,showSelectedItems:f=!1})=>{const[m,g]=n.useState([]),v=Mf("Combobox",d),{contains:b}=e.useFilter({sensitivity:"base"}),{collection:y,filter:x}=e.useListCollection({initialItems:h,filter:b});return r.jsxs("div",{css:Um(a,u),className:"ds-text-input-container",children:[s?r.jsx("div",{css:Km}):null,r.jsxs(e.Field.Root,{required:o,invalid:!!s,gap:"0",style:{marginLeft:s?"1.1875rem":"0px"},children:[t?r.jsxs(e.Field.Label,{css:Gm(a,l),"aria-label":t,children:[r.jsx(e.Field.RequiredIndicator,{"aria-label":v.requiredSymbolLabel}),t,o?"":r.jsx("span",{children:v.optionalSuffix})]}):null,i?r.jsx(e.Field.HelperText,{css:Zm(a,l),"aria-label":i,children:i}):null,s?r.jsx(e.Field.ErrorText,{css:Jm(a),"aria-label":s,children:s}):null,r.jsxs(e.Combobox.Root,{multiple:p,onValueChange:e=>{g(e.items.map((e=>({label:e.label,value:e.value}))))},value:m.map((e=>e.value)),collection:y,onInputValueChange:e=>x(e.inputValue),width:"20rem",size:"small"===a?"sm":"md",children:[r.jsxs(e.Combobox.Control,{children:[r.jsx(e.Combobox.Input,{placeholder:c,css:Xm(a),disabled:l,"aria-label":t||c||v.defaultInputAriaLabel}),r.jsxs(e.Combobox.IndicatorGroup,{children:[r.jsx(e.Combobox.ClearTrigger,{"aria-label":v.clearSelectionLabel}),r.jsx(e.Combobox.Trigger,{"aria-label":v.toggleOptionsLabel})]})]}),r.jsx(e.Portal,{children:r.jsx(e.Combobox.Positioner,{children:r.jsxs(e.Combobox.Content,{children:[r.jsx(e.Combobox.Empty,{children:v.noItemsFoundLabel}),y.items.map((t=>r.jsxs(e.Combobox.Item,{item:t,children:[t.label,r.jsx(e.Combobox.ItemIndicator,{})]},t.value)))]})})}),r.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"0.25rem",paddingTop:"0.5rem"},children:f&&m.map((e=>r.jsx(Nv,{label:e.label,variant:"info-white",onClose:()=>g((t=>t.filter((t=>t.value!==e.value)))),closable:!0},e.value)))})]})]})]})},exports.DesignSystemLocaleProvider=({labels:e,children:r})=>{const o=n.useMemo((()=>({labels:e})),[e]);return t.jsx(M.Provider,{value:o,children:r})},exports.ExtendableCard=({children:t,header:n,footer:o})=>r.jsx(e.Box,{css:Xw,children:r.jsx(e.Accordion.Root,{multiple:!0,children:r.jsxs(e.Accordion.Item,{value:"extendable-card-item",children:[r.jsxs(e.Accordion.ItemTrigger,{css:Yw,alignItems:"center",children:[r.jsx(e.Flex,{gap:3,flex:"1",overflow:"hidden",alignItems:"center",children:n}),r.jsx(e.Accordion.ItemIndicator,{children:r.jsx(If,{color:"var(--chakra-colors-neutral-700)",height:"1rem",width:"1rem"})})]}),r.jsxs(e.Accordion.ItemContent,{children:[t,o]})]})})}),exports.Footer=({children:e,label:t="© World Resources Institute",fixed:n,filled:o,maxWidth:i,additionalLogos:s})=>{const a=(new Date).getFullYear();return r.jsx("footer",{css:GT(n,o),children:r.jsxs("div",{css:ZT(i),children:[r.jsxs("div",{css:YT,children:[r.jsx(Wf,{height:"2rem",width:"5.6875rem"}),s&&s.map(((e,t)=>r.jsx("div",{children:e},t)))]}),r.jsx("div",{css:JT,children:e}),r.jsx("div",{children:r.jsxs("p",{css:XT,children:[t," ",a]})})]})})},exports.FormContainer=({label:e,error:t,children:o})=>{const i=n.useId(),s=e?`${i}-label`:void 0,a=t?`${i}-error`:void 0;return r.jsxs("div",{css:bg,role:"group","aria-labelledby":s,"aria-describedby":a,children:[t?r.jsx("div",{css:xg}):null,r.jsxs("div",{children:[e?r.jsx("p",{id:s,css:yg,children:e}):null,t?r.jsx("p",{id:a,css:wg,children:t}):null,o]})]})},exports.IconButton=Of,exports.InlineMessage=AT,exports.InputWithUnits=({label:t,caption:o,errorMessage:i,units:s,unitsPosition:a="end",defaultUnit:l="",defaultValue:c="",onChange:d,required:u,disabled:h})=>{const[p,f]=n.useState(c),[m,g]=n.useState(l?[l]:[s[0].value]),v=(e,t)=>{d&&d("end"===a?""+(t?`${p} ${e}`:`${e} ${m}`):""+(t?`${e} ${p}`:`${m} ${e}`))};return r.jsxs("div",{css:sv,children:[i?r.jsx("div",{css:cv}):null,r.jsxs("div",{style:{marginLeft:i?"1.1875rem":"0px"},children:[r.jsxs("p",{css:av(h),"aria-label":t,children:[u?r.jsx("span",{children:"*"}):null,t]}),r.jsx("p",{css:lv(h),"aria-label":o,children:o}),i?r.jsx("p",{css:dv,"aria-label":i,children:i}):null,r.jsxs(e.Group,{css:uv(!!i,a),attached:!0,children:["start"===a?r.jsx(Pv,{placeholder:"","aria-label":`${t} unit`,value:m,items:s,disabled:h,onChange:e=>{g(e),v(e?.[0],!0)}}):null,r.jsx(Ym,{type:"number","aria-label":`${t} value`,value:p,disabled:h,onChange:e=>{f(e.target.value),v(e.target.value)}}),"end"===a?r.jsx(Pv,{placeholder:"","aria-label":`${t} unit`,value:m,items:s,disabled:h,onChange:e=>{g(e),v(e?.[0],!0)}}):null]})]})]})},exports.ItemCount=ww,exports.LayerGroup=({label:t,caption:o,value:i,layerItems:s,onChangeForRadioVariant:a,labels:l})=>{const c=Mf("LayerGroup",l),[d,u]=n.useState({}),[h]=n.useState((e=>{const t=e.find((e=>"radio"===e.variant&&e.isDefaultSelected));return t?.name})(s));n.useEffect((()=>{let e={...d};s.forEach((n=>{n.isDefaultSelected&&(e={...e,["radio"===n.variant?t:n.name]:n.isDefaultSelected})})),u(e)}),[]);const p=(e,t,n,r)=>{const o={...d,[e]:t};u(o),n&&n(e,t,r)},f=Object.values(d).filter((e=>!0===e)).length,m=c.groupAriaLabel(t,f,o);return r.jsxs(e.Accordion.Item,{value:i,width:"100%",children:[r.jsxs(e.Accordion.ItemTrigger,{css:Nx,alignItems:"flex-start","aria-label":m,children:[r.jsxs(e.Box,{width:"full",display:"flex",flexDirection:"column",alignItems:"flex-start",children:[r.jsxs("span",{css:Dx,children:[t,r.jsx(Nv,{label:c.activeTagLabel(f),size:"small",variant:f>0?"success":"info-grey"})]}),r.jsx("div",{css:Ix,children:o})]}),r.jsx(e.Accordion.ItemIndicator,{display:"flex",children:r.jsx(If,{color:"var(--chakra-colors-neutral-700)",height:"1rem",width:"1rem"})})]}),r.jsx(e.Accordion.ItemContent,{paddingLeft:"1rem",paddingRight:"1rem",children:r.jsx(Bg,{name:t,value:h,customGap:"0",onChange:(e,t)=>p(e,!!t,a,t),children:s.map((e=>r.jsx(_x,{...e,onChange:(t,n)=>p(t,n,e.onChange)},e.label)))})})]})},exports.LayerGroupContainer=({children:t,defaultValue:n,...o})=>r.jsx("div",{css:Rx,style:{width:"100%"},children:r.jsx(e.Accordion.Root,{css:{},defaultValue:n,multiple:!0,...o,children:t})}),exports.LayerItem=_x,exports.LayerParameters=({label:t,children:o,openedByDefault:i})=>r.jsx("div",{children:r.jsx(e.Accordion.Root,{defaultValue:i?[t]:[],multiple:!0,children:r.jsxs(e.Accordion.Item,{css:Fx,value:t,children:[r.jsxs(e.Accordion.ItemTrigger,{css:qx,children:[r.jsx(e.Box,{width:"full",display:"flex",flexDirection:"column",alignItems:"flex-start",children:r.jsx("p",{css:Wx,children:t})}),r.jsx(e.Accordion.ItemIndicator,{display:"flex",children:r.jsx(If,{color:"var(--chakra-colors-neutral-700)",height:"1rem",width:"1rem"})})]}),r.jsx(e.Accordion.ItemContent,{css:Ux,children:n.Children.map(o,(e=>r.jsx("div",{className:"ds-layer-parameters-item-child",children:e})))})]})})}),exports.LegendItem=({layerName:e,dataUnit:t,onDrag:n,onUpClick:o,onDownClick:i,onRemoveClick:s,children:a,onInfoClick:l,onOpacityChanged:c,labels:d})=>{const u=Mf("LegendItem",d);return r.jsxs("div",{css:Kx,children:[r.jsx("div",{css:Gx,children:r.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"0.75rem"},children:[r.jsx(Of,{icon:r.jsx(If,{rotate:"180"}),"aria-label":u.upLabel,onClick:o}),r.jsx(Of,{icon:r.jsx(If,{}),"aria-label":u.downLabel,onClick:i})]})}),r.jsxs("div",{style:{width:"100%"},children:[r.jsxs("div",{css:Zx,children:[r.jsxs("div",{children:[r.jsx("h3",{css:Jx,children:e}),r.jsx("p",{css:Xx,children:t})]}),r.jsx(Ef,{label:u.removeLabel,size:"small",variant:"secondary",rightIcon:r.jsx(zf,{}),onClick:s})]}),a,r.jsxs("div",{css:Yx,children:[r.jsx(Ef,{label:u.aboutDataLabel,size:"small",variant:"secondary",leftIcon:r.jsx(Df,{}),onClick:l}),r.jsx(rw,{defaultValue:80,onOpacityChanged:c})]})]})]})},exports.List=Ow,exports.MapControlsToolbar=({onZoomInClick:e,onZoomOutClick:n,onExpandClick:r,onShareClick:o,onPrintClick:i,onSettingsClick:s,onQuestionClick:a,vertical:l,expanded:c,showExpandedToggle:d,ariaLabel:u,labels:h})=>{const p=Mf("MapControlsToolbar",h),f=[{icon:t.jsx(Kf,{}),label:p.zoomInLabel,ariaLabel:p.zoomInAriaLabel,onClick:e},{icon:t.jsx(Gf,{}),label:p.zoomOutLabel,ariaLabel:p.zoomOutAriaLabel,onClick:n,gap:!0},{icon:t.jsx(Zf,{}),label:p.expandLabel,ariaLabel:p.expandAriaLabel,onClick:r,gap:!0},{icon:t.jsx(Jf,{}),label:p.shareLabel,ariaLabel:p.shareAriaLabel,onClick:o,gap:!0},{icon:t.jsx(Xf,{}),label:p.printLabel,ariaLabel:p.printAriaLabel,onClick:i,gap:!0},{icon:t.jsx(Yf,{}),label:p.settingsLabel,ariaLabel:p.settingsAriaLabel,onClick:s,gap:!0},{icon:t.jsx(Qf,{}),label:p.helpLabel,ariaLabel:p.helpAriaLabel,onClick:a}];return t.jsx(ug,{items:f,vertical:l,expanded:c,showExpandedToggle:d,ariaLabel:u||p.toolbarAriaLabel})},exports.MapMarker=vb,exports.MapMarkers=bb,exports.MapPopUp=({open:e,onOpenChange:t,anchorRef:o,header:i,content:s,footer:a,placement:c="bottom",offset:d=30,closeOnEscape:u=!0,closeOnOutsideClick:h=!1,labels:p})=>{const f=Mf("MapPopUp",p),m=n.useRef(null),{refs:g,floatingStyles:v,context:b,middlewareData:y,placement:x}=Sx({open:e,onOpenChange:t,placement:c,whileElementsMounted:Uy,middleware:[ox(d),(w={fallbackAxisSideDirection:"start"},{...Zy(w),options:[w,C]}),ix({padding:8}),sx({element:m})]});var w,C;n.useEffect((()=>{o?.current&&g.setReference(o.current)}),[o,g]);const k=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:i}=e,{enabled:s=!0,escapeKey:a=!0,outsidePress:c=!0,outsidePressEvent:d="pointerdown",referencePress:u=!1,referencePressEvent:h="pointerdown",ancestorScroll:p=!1,bubbles:f,capture:m}=t,g=yx(),v=$y("function"==typeof c?c:()=>!1),b="function"==typeof c?v:c,y=l.useRef(!1),{escapeKey:x,outsidePress:w}=Cx(f),{escapeKey:C,outsidePress:k}=Cx(m),S=l.useRef(!1),$=$y((e=>{var t;if(!n||!s||!a||"Escape"!==e.key)return;if(S.current)return;const o=null==(t=i.current.floatingContext)?void 0:t.nodeId,l=g?Cy(g.nodesRef.current,o):[];if(!x&&(e.stopPropagation(),l.length>0)){let e=!0;if(l.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}r(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")})),j=$y((e=>{var t;const n=()=>{var t;$(e),null==(t=yy(e))||t.removeEventListener("keydown",n)};null==(t=yy(e))||t.addEventListener("keydown",n)})),M=$y((e=>{var t;const n=i.current.insideReactTree;i.current.insideReactTree=!1;const s=y.current;if(y.current=!1,"click"===d&&s)return;if(n)return;if("function"==typeof b&&!b(e))return;const a=yy(e),l="[data-floating-ui-inert]",c=wy(o.floating).querySelectorAll(l);let u=Sb(a)?a:null;for(;u&&!Vb(u);){const e=_b(u);if(Vb(e)||!Sb(e))break;u=e}if(c.length&&Sb(a)&&!a.matches("html,body")&&!by(a,o.floating)&&Array.from(c).every((e=>!by(u,e))))return;if($b(a)&&O){const t=Vb(a),n=Bb(a),r=/auto|scroll/,o=t||r.test(n.overflowX),i=t||r.test(n.overflowY),s=o&&a.clientWidth>0&&a.scrollWidth>a.clientWidth,l=i&&a.clientHeight>0&&a.scrollHeight>a.clientHeight,c="rtl"===n.direction,d=l&&(c?e.offsetX<=a.offsetWidth-a.clientWidth:e.offsetX>a.clientWidth),u=s&&e.offsetY>a.clientHeight;if(d||u)return}const h=null==(t=i.current.floatingContext)?void 0:t.nodeId,p=g&&Cy(g.nodesRef.current,h).some((t=>{var n;return xy(e,null==(n=t.context)?void 0:n.elements.floating)}));if(xy(e,o.floating)||xy(e,o.domReference)||p)return;const f=g?Cy(g.nodesRef.current,h):[];if(f.length>0){let e=!0;if(f.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}r(!1,e,"outside-press")})),E=$y((e=>{var t;const n=()=>{var t;M(e),null==(t=yy(e))||t.removeEventListener(d,n)};null==(t=yy(e))||t.addEventListener(d,n)}));l.useEffect((()=>{if(!n||!s)return;i.current.__escapeKeyBubbles=x,i.current.__outsidePressBubbles=w;let e=-1;function t(e){r(!1,e,"ancestor-scroll")}function l(){window.clearTimeout(e),S.current=!0}function c(){e=window.setTimeout((()=>{S.current=!1}),Pb()?5:0)}const u=wy(o.floating);a&&(u.addEventListener("keydown",C?j:$,C),u.addEventListener("compositionstart",l),u.addEventListener("compositionend",c)),b&&u.addEventListener(d,k?E:M,k);let h=[];return p&&(Sb(o.domReference)&&(h=qb(o.domReference)),Sb(o.floating)&&(h=h.concat(qb(o.floating))),!Sb(o.reference)&&o.reference&&o.reference.contextElement&&(h=h.concat(qb(o.reference.contextElement)))),h=h.filter((e=>{var t;return e!==(null==(t=u.defaultView)?void 0:t.visualViewport)})),h.forEach((e=>{e.addEventListener("scroll",t,{passive:!0})})),()=>{a&&(u.removeEventListener("keydown",C?j:$,C),u.removeEventListener("compositionstart",l),u.removeEventListener("compositionend",c)),b&&u.removeEventListener(d,k?E:M,k),h.forEach((e=>{e.removeEventListener("scroll",t)})),window.clearTimeout(e)}}),[i,o,a,b,d,n,r,p,s,x,w,$,C,j,M,k,E]),l.useEffect((()=>{i.current.insideReactTree=!1}),[i,b,d]);const T=l.useMemo((()=>({onKeyDown:$,...u&&{[xx[h]]:e=>{r(!1,e.nativeEvent,"reference-press")},..."click"!==h&&{onClick(e){r(!1,e.nativeEvent,"reference-press")}}}})),[$,r,u,h]),O=l.useMemo((()=>({onKeyDown:$,onMouseDown(){y.current=!0},onMouseUp(){y.current=!0},[wx[d]]:()=>{i.current.insideReactTree=!0}})),[$,d,i]);return l.useMemo((()=>s?{reference:T,floating:O}:{}),[s,T,O])}(b,{escapeKey:u,outsidePress:h}),S=Mx(b,{role:"dialog"}),{getFloatingProps:$}=function(e){void 0===e&&(e=[]);const t=e.map((e=>null==e?void 0:e.reference)),n=e.map((e=>null==e?void 0:e.floating)),r=e.map((e=>null==e?void 0:e.item)),o=l.useCallback((t=>$x(t,e,"reference")),t),i=l.useCallback((t=>$x(t,e,"floating")),n),s=l.useCallback((t=>$x(t,e,"item")),r);return l.useMemo((()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:s})),[o,i,s])}([k,S]),{x:j,y:M}=y.arrow??{x:null,y:null},E={top:"bottom",right:"left",bottom:"top",left:"right"}[x.split("-")[0]];if(!e)return null;let T=d-1,O=4;return"left"!==E&&"right"!==E||(T=4,O=d-1),r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:g.setFloating,style:v,"aria-label":f.dialogAriaLabel,"aria-modal":!0,...$(),css:Ex,children:[r.jsxs("div",{css:Tx,children:[i,r.jsx(sg,{onClick:()=>t(!1),className:"ds-map-pop-up-close-button","aria-label":f.closeLabel})]}),r.jsx("div",{css:Ox,children:s}),a?r.jsx("div",{css:Lx,children:a}):null,r.jsx("div",{ref:m,css:Ax(T,O,j,M,E,d)})]}),r.jsx("div",{className:"fixed inset-0 z-[999] bg-black/20 backdrop-blur-[1px]",onClick:()=>h&&t(!1)})]})},exports.Menu=jm,exports.MobileSearch=({value:t,placeholder:o,showInfoMessage:i=!0,items:s=[],disabled:a,readOnly:l,id:c,name:d,autoFocus:u,autoComplete:h,onBlur:p,onFocus:f,onQueryChange:m,onCancel:g,onItemClick:v,onChange:b,labels:y})=>{const x=Mf("MobileSearch",y),[C,k]=n.useState(t??""),[S,$]=n.useState(!0),[j,M]=n.useState(!1),E=n.useRef(null),T="string"==typeof t,O=T?t:C;n.useEffect((()=>{T&&k(t)}),[T,t]),n.useEffect((()=>{m?.(O)}),[O,m]);const L=n.useMemo((()=>{const e=O.trim().toLowerCase();return e?s.filter((t=>`${t.id??""} ${t.label} ${t.caption??""}`.toLowerCase().includes(e))):s}),[s,O]),A=O.trim().length?x.matchingResultsTitle(L.length):x.recentSearchesTitle,R=O.length?r.jsx(sg,{onClick:()=>{T||k("");const e=E.current?.querySelector("input");e&&(e.value="",e.focus()),$(!0)}}):null;let N=w("neutral",500);return a?N=w("neutral",500):j&&(N=w("primary",700)),r.jsxs("div",{ref:E,css:RT,children:[r.jsxs("div",{css:NT,children:[r.jsx("div",{css:DT,children:r.jsx(e.InputGroup,{startElement:r.jsx(hm,{width:"1.25rem",height:"1.25rem",fill:N,"aria-hidden":"true"}),endElement:R,children:r.jsx(Ym,{label:"",value:O,placeholder:o??x.inputAriaLabel,onChange:e=>{T||k(e.target.value),$(!0),b?.(e)},onFocus:e=>{M(!0),$(!0),f?.(e)},onBlur:e=>{M(!1),p?.(e)},noMarginBottom:!0,type:"search","aria-label":o??x.inputAriaLabel,disabled:a,readOnly:l,id:c,name:d,autoFocus:u??!0,autoComplete:h,style:{paddingLeft:"2.5rem"}})})}),r.jsx(Ef,{css:IT,variant:"borderless",label:x.cancelLabel,onClick:()=>{T||k(""),$(!1);const e=E.current?.querySelector("input");e&&(e.value="",e.blur()),g?.()}})]}),S?r.jsxs("div",{css:PT,children:[r.jsx("h3",{css:zT,children:A}),i?r.jsx("div",{css:VT,children:r.jsx(AT,{label:x.infoLabel,variant:"info-white",size:"full-width"})}):null,r.jsx("ul",{css:BT,"aria-label":A,children:L.map((t=>r.jsx("li",{children:r.jsxs(e.chakra.button,{type:"button",css:HT,onClick:()=>(e=>{v?.(e)})(t),"aria-label":`${t.label}, ${t.caption??""}`,style:{width:"100%"},children:[t.icon??null,r.jsxs("div",{css:_T,children:[r.jsx("p",{css:FT,children:t.label}),r.jsx("p",{css:qT,children:t.caption})]})]})},t.id)))})]}):null]})},exports.MobileTabBar=({defaultValue:t,tabs:o,onTabClick:i,hideLabels:s,activationMode:a="manual",labels:l})=>{const c=Mf("MobileTabBar",l),d=o.length,[u,h]=n.useState((()=>rO(o,t)));return r.jsx("div",{css:QT,children:r.jsx(e.Tabs.Root,{width:"full",defaultValue:t||o?.[0]?.value,onValueChange:({value:e})=>(e=>{const t=rO(o,e);h(t),i&&i(e)})(e),activationMode:a,children:r.jsx(e.Tabs.List,{alignItems:"center",border:"none",children:o.map(((t,n)=>{const{label:o,icon:i,bagdeCount:a,"aria-label":l,"aria-describedby":h,disabled:p,...f}=t,m=`${t.value}-str-status`,g=u===n,v=[c.tabPositionStatus(n+1,d),g?c.selectedStatus:c.notSelectedStatus];p&&v.push(c.disabledStatus);const b=[h,m].filter(Boolean).join(" ")||void 0;return r.jsxs(e.Tabs.Trigger,{css:eO,"aria-label":l||o,"aria-disabled":!!p||void 0,"aria-describedby":b,disabled:p,...f,children:[r.jsxs("div",{css:tO,children:[i,a?r.jsx("div",{css:nO,className:"ds-badge-count",children:a}):null]}),s?null:r.jsx("p",{children:o}),r.jsx(e.VisuallyHidden,{id:m,children:v.join(", ")})]},t.value)}))})})})},exports.Modal=({header:t,content:o,footer:i,size:s="medium",width:a,height:l,maxHeight:c,draggable:d,blocking:u,open:h,onClose:p,labels:f})=>{const m=Mf("Modal",f),g=n.useRef(null);return h?r.jsx(e.Dialog.Root,{open:h,onOpenChange:p,placement:"center",scrollBehavior:"inside",closeOnInteractOutside:!d&&!u,preventScroll:!d&&!u,closeOnEscape:!u,defaultOpen:!0,children:r.jsxs(e.Portal,{children:[d?null:r.jsx(e.Dialog.Backdrop,{css:{background:"rgba(0, 0, 0, 0.64)"}}),r.jsx(XC,{disabled:!d,nodeRef:g,children:r.jsx(e.Dialog.Positioner,{ref:g,children:r.jsxs(e.Dialog.Content,{"aria-label":m.dialogAriaLabel,css:YC(s,a,l,c),children:[r.jsxs(e.Dialog.Header,{css:QC,children:[t,u?null:r.jsx(e.Dialog.CloseTrigger,{css:ek,asChild:!0,children:r.jsx(sg,{})})]}),r.jsx(e.Dialog.Body,{css:tk,children:o}),i?r.jsx(e.Dialog.Footer,{padding:"0.75rem",children:i}):null]})})})]})}):null},exports.MultiActionButton=({variant:t="primary",size:o="default",mainActionLabel:i,mainActionOnClick:s=()=>{},otherActions:a=[],disabled:l,mainActionLeftIcon:c,mainActionRightIcon:d,...u})=>{const[h,p]=n.useState(!1),f=l?`${i} action button with menu, disabled`:void 0;return r.jsxs(e.Group,{css:mg,attached:!0,tabIndex:l?0:void 0,"aria-disabled":l,"aria-label":f,role:"group",children:[r.jsx(Ef,{css:{},label:i,variant:t,size:o,onClick:s,disabled:l,leftIcon:c,rightIcon:d,...u}),r.jsxs(e.Menu.Root,{onOpenChange:({open:e})=>p(e),positioning:{placement:"bottom-end"},children:[r.jsx(e.Menu.Trigger,{css:pg(t),"data-group-item":!0,"data-last":!0,asChild:!0,children:r.jsx(Ef,{style:gg,"aria-label":`Open ${i} options`,"aria-haspopup":"menu","aria-expanded":h,variant:t,size:o,leftIcon:r.jsx(If,{"aria-hidden":"true",rotate:h?"180":"0",color:w("accessible","text-on-primary-mids")||w("primary",900)}),disabled:l})}),r.jsx(vg,{children:a.map((({label:t,value:n,onClick:i})=>r.jsx(e.Menu.Item,{css:fg(o),onClick:i,value:n,children:t},n)))})]})]})},exports.Navbar=({variant:e="default",theme:t="light",logo:o,linkRouter:i,pathname:s,navigationSection:a,utilitySection:l,actionsSection:c,maxWidth:d,fixed:u,onNavbarHeightChange:h,backgroundColor:p,labels:f})=>{const m=Mf("Navbar",f),g=n.useRef(null),v=n.useRef(null),b=n.useRef(null),[y,x]=n.useState(!1),[w,C]=n.useState(-1),[k,S]=n.useState("undefined"!=typeof window&&window?.innerWidth<=jO),[$,j]=n.useState(!1),M=i,E=n.useCallback((()=>{if(v.current&&g.current&&b.current){const e=g.current.getBoundingClientRect(),t=v.current.getBoundingClientRect(),n=b.current.getBoundingClientRect();t.width,e.width,window.innerWidth<=jO||window.innerWidth<=w?(h?.(96),x(!0)):window.innerWidth>jO&&window.innerWidth<=1440?e.right>=t.left?(h?.(96),x(!0),C(window.innerWidth)):window.innerWidth>w&&(h?.(48),x(!1),C(-1)):(h?.(48),x(!1),C(-1)),y&&(window.innerWidth<=jO||n.right>=t.left?(S(!0),h?.(48)):(S(!1),h?.(96)))}}),[w,y]);n.useEffect((()=>(E(),window.addEventListener("resize",E),()=>{window.removeEventListener("resize",E)})),[E]);const T="condensed"===e;return r.jsxs("nav",{css:oO(y&&!k,u,p,t,T),children:[r.jsxs("div",{css:sO(y&&!k,d,T),children:[r.jsxs("div",{css:aO(y&&!k||"dark"===t,T),ref:g,children:[o?r.jsx("div",{ref:b,css:lO,children:o}):null,r.jsx("div",{css:cO(y),children:a?.map((e=>e.link?r.jsx(M,{to:e.link,href:e.link,css:dO(s===e.link,t,T),children:e.label},e.label):r.jsx(jm,{theme:t,label:e.label,fontSize:T?"0.875rem":"1rem",items:e.items||[]},e.label)))})]}),r.jsx("div",{css:uO(T),ref:v,children:k?r.jsxs("button",{type:"button",onClick:()=>j(!$),"aria-label":$?m.closeMenuLabel:m.openMenuLabel,"aria-expanded":$,css:fO(t),children:[$?m.closeLabel:m.menuLabel,$?r.jsx(zf,{height:T?"0.75rem":"1rem",width:T?"0.75rem":"1rem"}):r.jsx(lm,{height:T?"0.75rem":"1rem",width:T?"0.75rem":"1rem"})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{css:uO(T),children:l?.map(((e,t)=>r.jsx("div",{css:hO(y),children:e},t)))}),c?.length?r.jsx("div",{css:pO(y),children:c.map((e=>r.jsx(Ef,{...e},e.ariaLabel)))}):null]})})]}),y&&!k?r.jsx("div",{css:iO(t,T),children:a?.map((e=>e.link?r.jsx(M,{to:e.link,href:e.link,css:dO(s===e.link,t,T),children:e.label},e.label):r.jsx(jm,{theme:t,label:e.label,fontSize:T?"0.875rem":"1rem",items:e.items||[]},e.label)))}):null,k?r.jsx($O,{theme:t,variant:e,navigationSection:a,utilitySection:l,actionsSection:c,linkRouter:i,isOpen:$,setIsOpen:j,pathname:s,resolvedLabels:m}):null]})},exports.NavigationRail=({tabs:t=[],defaultValue:o,onTabClick:i,children:s,onOpenChange:a,labels:l})=>{const c=Mf("NavigationRail",l),[d,u]=n.useState(!1),[h,p]=n.useState(o||t?.[0]?.value),f=e=>{p(e),i&&i(e)},[m]=e.useMediaQuery(["(max-width: 48rem)"]);return m?r.jsxs(e.Tabs.Root,{defaultValue:h,onValueChange:({value:e})=>f(e),children:[r.jsx(e.Tabs.List,{style:{display:"flex",overflowX:"auto",whiteSpace:"nowrap",padding:"0.5rem",gap:"0.5rem"},children:t.map((t=>r.jsx(e.Tabs.Trigger,{value:t.value,css:{"--indicator-color":w("primary",500),flexShrink:0,padding:"0.625rem 1rem",color:w("neutral",600),"&[data-selected]":{color:w("neutral",800),fontWeight:600}},children:t.label},t.value)))}),t.map((t=>r.jsx(e.Tabs.Content,{value:t.value,children:s},t.value)))]}):r.jsxs("div",{style:{height:"calc(100vh - 3rem - 3.5rem)",position:"fixed",top:"3rem",left:0,display:"flex"},children:[r.jsxs("div",{css:MO,children:[r.jsx(e.Tabs.Root,{defaultValue:o||t?.[0]?.value,orientation:"horizontal",width:"full",onValueChange:({value:e})=>{f(e)},children:r.jsx(e.Tabs.List,{alignItems:"center",border:"none",style:{flexDirection:"column"},children:t.map((t=>r.jsx(e.Tabs.Trigger,{css:EO,"aria-label":t["aria-label"]||t.label,...t,children:r.jsxs(e.Box,{display:"flex",alignItems:"center",flexDirection:"column",gap:"0.3125rem",className:"ds-tab-label",children:[t.icon?r.jsx("div",{css:TO,children:t.icon}):null,r.jsx("p",{children:t.label})]})},t.label)))})}),s?r.jsx(e.Collapsible.Root,{onOpenChange:({open:e})=>{u(e),a&&a(!e)},children:r.jsxs(e.Collapsible.Trigger,{css:OO,children:[r.jsx("div",{css:TO,children:d?r.jsx(Af,{}):r.jsx(Lf,{})}),r.jsxs("div",{className:"ds-tab-label",children:[r.jsx("p",{children:d?c.showLabel:c.hideLabel}),r.jsx("p",{children:c.sidebarLabel})]})]})}):null]}),s?r.jsx(e.Collapsible.Root,{defaultOpen:!0,open:!d,children:r.jsx(e.Collapsible.Content,{height:"100%",children:r.jsx("div",{css:LO,role:"tabpanel","aria-labelledby":h,children:s})})}):null]})},exports.OptionCard=({defaultValue:t,items:n,onValueChange:o,variant:s,itemWidth:a,hideControl:l})=>r.jsx(e.RadioCard.Root,{defaultValue:t,onValueChange:o,children:r.jsx(e.HStack,{alignItems:"flex-start",flexWrap:"wrap",gap:"0.75rem",children:n?.map((t=>{return r.jsxs(e.RadioCard.Item,{css:(o=a,c=t.selectedColor,d=t.selectedBackgroundColor,i.css`
|
|
3918
|
+
`),children:n.children}):null]},`${n.label}-${n.value}`);var o,s}))})}),exports.CloseButton=sg,exports.ClusterPoint=({onClick:e,triggerRef:n,showFocusState:r,count:o,mode:i,variant:s="cluster"})=>t.jsx(vb,{count:o,mode:i,onClick:e,ref:n,showFocusState:r,variant:s}),exports.Combobox=({label:t,required:o,caption:i,errorMessage:s,size:a,disabled:l,showOptionalLabel:c=!0,placeholder:d,labels:u,noMarginBottom:h,initialItems:p=[],multiple:f=!1,showSelectedItems:m=!1})=>{const[g,v]=n.useState([]),b=Mf("Combobox",u),{contains:y}=e.useFilter({sensitivity:"base"}),{collection:x,filter:w}=e.useListCollection({initialItems:p,filter:y});return r.jsxs("div",{css:Um(a,h),className:"ds-text-input-container",children:[s?r.jsx("div",{css:Km}):null,r.jsxs(e.Field.Root,{required:o,invalid:!!s,gap:"0",style:{marginLeft:s?"1.1875rem":"0px"},children:[t?r.jsxs(e.Field.Label,{css:Gm(a,l),"aria-label":t,children:[r.jsx(e.Field.RequiredIndicator,{"aria-label":b.requiredSymbolLabel}),t,!o&&c?r.jsx("span",{children:b.optionalSuffix}):null]}):null,i?r.jsx(e.Field.HelperText,{css:Zm(a,l),"aria-label":i,children:i}):null,s?r.jsx(e.Field.ErrorText,{css:Jm(a),"aria-label":s,children:s}):null,r.jsxs(e.Combobox.Root,{multiple:f,onValueChange:e=>{v(e.items.map((e=>({label:e.label,value:e.value}))))},value:g.map((e=>e.value)),collection:x,onInputValueChange:e=>w(e.inputValue),width:"20rem",size:"small"===a?"sm":"md",children:[r.jsxs(e.Combobox.Control,{children:[r.jsx(e.Combobox.Input,{placeholder:d,css:Xm(a),disabled:l,"aria-label":t||d||b.defaultInputAriaLabel}),r.jsxs(e.Combobox.IndicatorGroup,{children:[r.jsx(e.Combobox.ClearTrigger,{"aria-label":b.clearSelectionLabel}),r.jsx(e.Combobox.Trigger,{"aria-label":b.toggleOptionsLabel})]})]}),r.jsx(e.Portal,{children:r.jsx(e.Combobox.Positioner,{children:r.jsxs(e.Combobox.Content,{children:[r.jsx(e.Combobox.Empty,{children:b.noItemsFoundLabel}),x.items.map((t=>r.jsxs(e.Combobox.Item,{item:t,children:[t.label,r.jsx(e.Combobox.ItemIndicator,{})]},t.value)))]})})}),r.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"0.25rem",paddingTop:"0.5rem"},children:m&&g.map((e=>r.jsx(Nv,{label:e.label,variant:"info-white",onClose:()=>v((t=>t.filter((t=>t.value!==e.value)))),closable:!0},e.value)))})]})]})]})},exports.DesignSystemLocaleProvider=({labels:e,children:r})=>{const o=n.useMemo((()=>({labels:e})),[e]);return t.jsx(M.Provider,{value:o,children:r})},exports.ExtendableCard=({children:t,header:n,footer:o})=>r.jsx(e.Box,{css:Xw,children:r.jsx(e.Accordion.Root,{multiple:!0,children:r.jsxs(e.Accordion.Item,{value:"extendable-card-item",children:[r.jsxs(e.Accordion.ItemTrigger,{css:Yw,alignItems:"center",children:[r.jsx(e.Flex,{gap:3,flex:"1",overflow:"hidden",alignItems:"center",children:n}),r.jsx(e.Accordion.ItemIndicator,{children:r.jsx(If,{color:"var(--chakra-colors-neutral-700)",height:"1rem",width:"1rem"})})]}),r.jsxs(e.Accordion.ItemContent,{children:[t,o]})]})})}),exports.Footer=({children:e,label:t="© World Resources Institute",fixed:n,filled:o,maxWidth:i,additionalLogos:s})=>{const a=(new Date).getFullYear();return r.jsx("footer",{css:GT(n,o),children:r.jsxs("div",{css:ZT(i),children:[r.jsxs("div",{css:YT,children:[r.jsx(Wf,{height:"2rem",width:"5.6875rem"}),s&&s.map(((e,t)=>r.jsx("div",{children:e},t)))]}),r.jsx("div",{css:JT,children:e}),r.jsx("div",{children:r.jsxs("p",{css:XT,children:[t," ",a]})})]})})},exports.FormContainer=({label:e,error:t,children:o})=>{const i=n.useId(),s=e?`${i}-label`:void 0,a=t?`${i}-error`:void 0;return r.jsxs("div",{css:bg,role:"group","aria-labelledby":s,"aria-describedby":a,children:[t?r.jsx("div",{css:xg}):null,r.jsxs("div",{children:[e?r.jsx("p",{id:s,css:yg,children:e}):null,t?r.jsx("p",{id:a,css:wg,children:t}):null,o]})]})},exports.IconButton=Of,exports.InlineMessage=AT,exports.InputWithUnits=({label:t,caption:o,errorMessage:i,units:s,unitsPosition:a="end",defaultUnit:l="",defaultValue:c="",onChange:d,required:u,disabled:h})=>{const[p,f]=n.useState(c),[m,g]=n.useState(l?[l]:[s[0].value]),v=(e,t)=>{d&&d("end"===a?""+(t?`${p} ${e}`:`${e} ${m}`):""+(t?`${e} ${p}`:`${m} ${e}`))};return r.jsxs("div",{css:sv,children:[i?r.jsx("div",{css:cv}):null,r.jsxs("div",{style:{marginLeft:i?"1.1875rem":"0px"},children:[r.jsxs("p",{css:av(h),"aria-label":t,children:[u?r.jsx("span",{children:"*"}):null,t]}),r.jsx("p",{css:lv(h),"aria-label":o,children:o}),i?r.jsx("p",{css:dv,"aria-label":i,children:i}):null,r.jsxs(e.Group,{css:uv(!!i,a),attached:!0,children:["start"===a?r.jsx(Pv,{placeholder:"","aria-label":`${t} unit`,value:m,items:s,disabled:h,onChange:e=>{g(e),v(e?.[0],!0)}}):null,r.jsx(Ym,{type:"number","aria-label":`${t} value`,value:p,disabled:h,onChange:e=>{f(e.target.value),v(e.target.value)}}),"end"===a?r.jsx(Pv,{placeholder:"","aria-label":`${t} unit`,value:m,items:s,disabled:h,onChange:e=>{g(e),v(e?.[0],!0)}}):null]})]})]})},exports.ItemCount=ww,exports.LayerGroup=({label:t,caption:o,value:i,layerItems:s,onChangeForRadioVariant:a,labels:l})=>{const c=Mf("LayerGroup",l),[d,u]=n.useState({}),[h]=n.useState((e=>{const t=e.find((e=>"radio"===e.variant&&e.isDefaultSelected));return t?.name})(s));n.useEffect((()=>{let e={...d};s.forEach((n=>{n.isDefaultSelected&&(e={...e,["radio"===n.variant?t:n.name]:n.isDefaultSelected})})),u(e)}),[]);const p=(e,t,n,r)=>{const o={...d,[e]:t};u(o),n&&n(e,t,r)},f=Object.values(d).filter((e=>!0===e)).length,m=c.groupAriaLabel(t,f,o);return r.jsxs(e.Accordion.Item,{value:i,width:"100%",children:[r.jsxs(e.Accordion.ItemTrigger,{css:Nx,alignItems:"flex-start","aria-label":m,children:[r.jsxs(e.Box,{width:"full",display:"flex",flexDirection:"column",alignItems:"flex-start",children:[r.jsxs("span",{css:Dx,children:[t,r.jsx(Nv,{label:c.activeTagLabel(f),size:"small",variant:f>0?"success":"info-grey"})]}),r.jsx("div",{css:Ix,children:o})]}),r.jsx(e.Accordion.ItemIndicator,{display:"flex",children:r.jsx(If,{color:"var(--chakra-colors-neutral-700)",height:"1rem",width:"1rem"})})]}),r.jsx(e.Accordion.ItemContent,{paddingLeft:"1rem",paddingRight:"1rem",children:r.jsx(Bg,{name:t,value:h,customGap:"0",onChange:(e,t)=>p(e,!!t,a,t),children:s.map((e=>r.jsx(_x,{...e,onChange:(t,n)=>p(t,n,e.onChange)},e.label)))})})]})},exports.LayerGroupContainer=({children:t,defaultValue:n,...o})=>r.jsx("div",{css:Rx,style:{width:"100%"},children:r.jsx(e.Accordion.Root,{css:{},defaultValue:n,multiple:!0,...o,children:t})}),exports.LayerItem=_x,exports.LayerParameters=({label:t,children:o,openedByDefault:i})=>r.jsx("div",{children:r.jsx(e.Accordion.Root,{defaultValue:i?[t]:[],multiple:!0,children:r.jsxs(e.Accordion.Item,{css:Fx,value:t,children:[r.jsxs(e.Accordion.ItemTrigger,{css:qx,children:[r.jsx(e.Box,{width:"full",display:"flex",flexDirection:"column",alignItems:"flex-start",children:r.jsx("p",{css:Wx,children:t})}),r.jsx(e.Accordion.ItemIndicator,{display:"flex",children:r.jsx(If,{color:"var(--chakra-colors-neutral-700)",height:"1rem",width:"1rem"})})]}),r.jsx(e.Accordion.ItemContent,{css:Ux,children:n.Children.map(o,(e=>r.jsx("div",{className:"ds-layer-parameters-item-child",children:e})))})]})})}),exports.LegendItem=({layerName:e,dataUnit:t,onDrag:n,onUpClick:o,onDownClick:i,onRemoveClick:s,children:a,onInfoClick:l,onOpacityChanged:c,labels:d})=>{const u=Mf("LegendItem",d);return r.jsxs("div",{css:Kx,children:[r.jsx("div",{css:Gx,children:r.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"0.75rem"},children:[r.jsx(Of,{icon:r.jsx(If,{rotate:"180"}),"aria-label":u.upLabel,onClick:o}),r.jsx(Of,{icon:r.jsx(If,{}),"aria-label":u.downLabel,onClick:i})]})}),r.jsxs("div",{style:{width:"100%"},children:[r.jsxs("div",{css:Zx,children:[r.jsxs("div",{children:[r.jsx("h3",{css:Jx,children:e}),r.jsx("p",{css:Xx,children:t})]}),r.jsx(Ef,{label:u.removeLabel,size:"small",variant:"secondary",rightIcon:r.jsx(zf,{}),onClick:s})]}),a,r.jsxs("div",{css:Yx,children:[r.jsx(Ef,{label:u.aboutDataLabel,size:"small",variant:"secondary",leftIcon:r.jsx(Df,{}),onClick:l}),r.jsx(rw,{defaultValue:80,onOpacityChanged:c})]})]})]})},exports.List=Ow,exports.MapControlsToolbar=({onZoomInClick:e,onZoomOutClick:n,onExpandClick:r,onShareClick:o,onPrintClick:i,onSettingsClick:s,onQuestionClick:a,vertical:l,expanded:c,showExpandedToggle:d,ariaLabel:u,labels:h})=>{const p=Mf("MapControlsToolbar",h),f=[{icon:t.jsx(Kf,{}),label:p.zoomInLabel,ariaLabel:p.zoomInAriaLabel,onClick:e},{icon:t.jsx(Gf,{}),label:p.zoomOutLabel,ariaLabel:p.zoomOutAriaLabel,onClick:n,gap:!0},{icon:t.jsx(Zf,{}),label:p.expandLabel,ariaLabel:p.expandAriaLabel,onClick:r,gap:!0},{icon:t.jsx(Jf,{}),label:p.shareLabel,ariaLabel:p.shareAriaLabel,onClick:o,gap:!0},{icon:t.jsx(Xf,{}),label:p.printLabel,ariaLabel:p.printAriaLabel,onClick:i,gap:!0},{icon:t.jsx(Yf,{}),label:p.settingsLabel,ariaLabel:p.settingsAriaLabel,onClick:s,gap:!0},{icon:t.jsx(Qf,{}),label:p.helpLabel,ariaLabel:p.helpAriaLabel,onClick:a}];return t.jsx(ug,{items:f,vertical:l,expanded:c,showExpandedToggle:d,ariaLabel:u||p.toolbarAriaLabel})},exports.MapMarker=vb,exports.MapMarkers=bb,exports.MapPopUp=({open:e,onOpenChange:t,anchorRef:o,header:i,content:s,footer:a,placement:c="bottom",offset:d=30,closeOnEscape:u=!0,closeOnOutsideClick:h=!1,labels:p})=>{const f=Mf("MapPopUp",p),m=n.useRef(null),{refs:g,floatingStyles:v,context:b,middlewareData:y,placement:x}=Sx({open:e,onOpenChange:t,placement:c,whileElementsMounted:Uy,middleware:[ox(d),(w={fallbackAxisSideDirection:"start"},{...Zy(w),options:[w,C]}),ix({padding:8}),sx({element:m})]});var w,C;n.useEffect((()=>{o?.current&&g.setReference(o.current)}),[o,g]);const k=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:i}=e,{enabled:s=!0,escapeKey:a=!0,outsidePress:c=!0,outsidePressEvent:d="pointerdown",referencePress:u=!1,referencePressEvent:h="pointerdown",ancestorScroll:p=!1,bubbles:f,capture:m}=t,g=yx(),v=$y("function"==typeof c?c:()=>!1),b="function"==typeof c?v:c,y=l.useRef(!1),{escapeKey:x,outsidePress:w}=Cx(f),{escapeKey:C,outsidePress:k}=Cx(m),S=l.useRef(!1),$=$y((e=>{var t;if(!n||!s||!a||"Escape"!==e.key)return;if(S.current)return;const o=null==(t=i.current.floatingContext)?void 0:t.nodeId,l=g?Cy(g.nodesRef.current,o):[];if(!x&&(e.stopPropagation(),l.length>0)){let e=!0;if(l.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}r(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")})),j=$y((e=>{var t;const n=()=>{var t;$(e),null==(t=yy(e))||t.removeEventListener("keydown",n)};null==(t=yy(e))||t.addEventListener("keydown",n)})),M=$y((e=>{var t;const n=i.current.insideReactTree;i.current.insideReactTree=!1;const s=y.current;if(y.current=!1,"click"===d&&s)return;if(n)return;if("function"==typeof b&&!b(e))return;const a=yy(e),l="[data-floating-ui-inert]",c=wy(o.floating).querySelectorAll(l);let u=Sb(a)?a:null;for(;u&&!Vb(u);){const e=_b(u);if(Vb(e)||!Sb(e))break;u=e}if(c.length&&Sb(a)&&!a.matches("html,body")&&!by(a,o.floating)&&Array.from(c).every((e=>!by(u,e))))return;if($b(a)&&O){const t=Vb(a),n=Bb(a),r=/auto|scroll/,o=t||r.test(n.overflowX),i=t||r.test(n.overflowY),s=o&&a.clientWidth>0&&a.scrollWidth>a.clientWidth,l=i&&a.clientHeight>0&&a.scrollHeight>a.clientHeight,c="rtl"===n.direction,d=l&&(c?e.offsetX<=a.offsetWidth-a.clientWidth:e.offsetX>a.clientWidth),u=s&&e.offsetY>a.clientHeight;if(d||u)return}const h=null==(t=i.current.floatingContext)?void 0:t.nodeId,p=g&&Cy(g.nodesRef.current,h).some((t=>{var n;return xy(e,null==(n=t.context)?void 0:n.elements.floating)}));if(xy(e,o.floating)||xy(e,o.domReference)||p)return;const f=g?Cy(g.nodesRef.current,h):[];if(f.length>0){let e=!0;if(f.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}r(!1,e,"outside-press")})),E=$y((e=>{var t;const n=()=>{var t;M(e),null==(t=yy(e))||t.removeEventListener(d,n)};null==(t=yy(e))||t.addEventListener(d,n)}));l.useEffect((()=>{if(!n||!s)return;i.current.__escapeKeyBubbles=x,i.current.__outsidePressBubbles=w;let e=-1;function t(e){r(!1,e,"ancestor-scroll")}function l(){window.clearTimeout(e),S.current=!0}function c(){e=window.setTimeout((()=>{S.current=!1}),Pb()?5:0)}const u=wy(o.floating);a&&(u.addEventListener("keydown",C?j:$,C),u.addEventListener("compositionstart",l),u.addEventListener("compositionend",c)),b&&u.addEventListener(d,k?E:M,k);let h=[];return p&&(Sb(o.domReference)&&(h=qb(o.domReference)),Sb(o.floating)&&(h=h.concat(qb(o.floating))),!Sb(o.reference)&&o.reference&&o.reference.contextElement&&(h=h.concat(qb(o.reference.contextElement)))),h=h.filter((e=>{var t;return e!==(null==(t=u.defaultView)?void 0:t.visualViewport)})),h.forEach((e=>{e.addEventListener("scroll",t,{passive:!0})})),()=>{a&&(u.removeEventListener("keydown",C?j:$,C),u.removeEventListener("compositionstart",l),u.removeEventListener("compositionend",c)),b&&u.removeEventListener(d,k?E:M,k),h.forEach((e=>{e.removeEventListener("scroll",t)})),window.clearTimeout(e)}}),[i,o,a,b,d,n,r,p,s,x,w,$,C,j,M,k,E]),l.useEffect((()=>{i.current.insideReactTree=!1}),[i,b,d]);const T=l.useMemo((()=>({onKeyDown:$,...u&&{[xx[h]]:e=>{r(!1,e.nativeEvent,"reference-press")},..."click"!==h&&{onClick(e){r(!1,e.nativeEvent,"reference-press")}}}})),[$,r,u,h]),O=l.useMemo((()=>({onKeyDown:$,onMouseDown(){y.current=!0},onMouseUp(){y.current=!0},[wx[d]]:()=>{i.current.insideReactTree=!0}})),[$,d,i]);return l.useMemo((()=>s?{reference:T,floating:O}:{}),[s,T,O])}(b,{escapeKey:u,outsidePress:h}),S=Mx(b,{role:"dialog"}),{getFloatingProps:$}=function(e){void 0===e&&(e=[]);const t=e.map((e=>null==e?void 0:e.reference)),n=e.map((e=>null==e?void 0:e.floating)),r=e.map((e=>null==e?void 0:e.item)),o=l.useCallback((t=>$x(t,e,"reference")),t),i=l.useCallback((t=>$x(t,e,"floating")),n),s=l.useCallback((t=>$x(t,e,"item")),r);return l.useMemo((()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:s})),[o,i,s])}([k,S]),{x:j,y:M}=y.arrow??{x:null,y:null},E={top:"bottom",right:"left",bottom:"top",left:"right"}[x.split("-")[0]];if(!e)return null;let T=d-1,O=4;return"left"!==E&&"right"!==E||(T=4,O=d-1),r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:g.setFloating,style:v,"aria-label":f.dialogAriaLabel,"aria-modal":!0,...$(),css:Ex,children:[r.jsxs("div",{css:Tx,children:[i,r.jsx(sg,{onClick:()=>t(!1),className:"ds-map-pop-up-close-button","aria-label":f.closeLabel})]}),r.jsx("div",{css:Ox,children:s}),a?r.jsx("div",{css:Lx,children:a}):null,r.jsx("div",{ref:m,css:Ax(T,O,j,M,E,d)})]}),r.jsx("div",{className:"fixed inset-0 z-[999] bg-black/20 backdrop-blur-[1px]",onClick:()=>h&&t(!1)})]})},exports.Menu=jm,exports.MobileSearch=({value:t,placeholder:o,showInfoMessage:i=!0,items:s=[],disabled:a,readOnly:l,id:c,name:d,autoFocus:u,autoComplete:h,onBlur:p,onFocus:f,onQueryChange:m,onCancel:g,onItemClick:v,onChange:b,labels:y})=>{const x=Mf("MobileSearch",y),[C,k]=n.useState(t??""),[S,$]=n.useState(!0),[j,M]=n.useState(!1),E=n.useRef(null),T="string"==typeof t,O=T?t:C;n.useEffect((()=>{T&&k(t)}),[T,t]),n.useEffect((()=>{m?.(O)}),[O,m]);const L=n.useMemo((()=>{const e=O.trim().toLowerCase();return e?s.filter((t=>`${t.id??""} ${t.label} ${t.caption??""}`.toLowerCase().includes(e))):s}),[s,O]),A=O.trim().length?x.matchingResultsTitle(L.length):x.recentSearchesTitle,R=O.length?r.jsx(sg,{onClick:()=>{T||k("");const e=E.current?.querySelector("input");e&&(e.value="",e.focus()),$(!0)}}):null;let N=w("neutral",500);return a?N=w("neutral",500):j&&(N=w("primary",700)),r.jsxs("div",{ref:E,css:RT,children:[r.jsxs("div",{css:NT,children:[r.jsx("div",{css:DT,children:r.jsx(e.InputGroup,{startElement:r.jsx(hm,{width:"1.25rem",height:"1.25rem",fill:N,"aria-hidden":"true"}),endElement:R,children:r.jsx(Ym,{label:"",value:O,placeholder:o??x.inputAriaLabel,onChange:e=>{T||k(e.target.value),$(!0),b?.(e)},onFocus:e=>{M(!0),$(!0),f?.(e)},onBlur:e=>{M(!1),p?.(e)},noMarginBottom:!0,type:"search","aria-label":o??x.inputAriaLabel,disabled:a,readOnly:l,id:c,name:d,autoFocus:u??!0,autoComplete:h,style:{paddingLeft:"2.5rem"}})})}),r.jsx(Ef,{css:IT,variant:"borderless",label:x.cancelLabel,onClick:()=>{T||k(""),$(!1);const e=E.current?.querySelector("input");e&&(e.value="",e.blur()),g?.()}})]}),S?r.jsxs("div",{css:PT,children:[r.jsx("h3",{css:zT,children:A}),i?r.jsx("div",{css:VT,children:r.jsx(AT,{label:x.infoLabel,variant:"info-white",size:"full-width"})}):null,r.jsx("ul",{css:BT,"aria-label":A,children:L.map((t=>r.jsx("li",{children:r.jsxs(e.chakra.button,{type:"button",css:HT,onClick:()=>(e=>{v?.(e)})(t),"aria-label":`${t.label}, ${t.caption??""}`,style:{width:"100%"},children:[t.icon??null,r.jsxs("div",{css:_T,children:[r.jsx("p",{css:FT,children:t.label}),r.jsx("p",{css:qT,children:t.caption})]})]})},t.id)))})]}):null]})},exports.MobileTabBar=({defaultValue:t,tabs:o,onTabClick:i,hideLabels:s,activationMode:a="manual",labels:l})=>{const c=Mf("MobileTabBar",l),d=o.length,[u,h]=n.useState((()=>rO(o,t)));return r.jsx("div",{css:QT,children:r.jsx(e.Tabs.Root,{width:"full",defaultValue:t||o?.[0]?.value,onValueChange:({value:e})=>(e=>{const t=rO(o,e);h(t),i&&i(e)})(e),activationMode:a,children:r.jsx(e.Tabs.List,{alignItems:"center",border:"none",children:o.map(((t,n)=>{const{label:o,icon:i,bagdeCount:a,"aria-label":l,"aria-describedby":h,disabled:p,...f}=t,m=`${t.value}-str-status`,g=u===n,v=[c.tabPositionStatus(n+1,d),g?c.selectedStatus:c.notSelectedStatus];p&&v.push(c.disabledStatus);const b=[h,m].filter(Boolean).join(" ")||void 0;return r.jsxs(e.Tabs.Trigger,{css:eO,"aria-label":l||o,"aria-disabled":!!p||void 0,"aria-describedby":b,disabled:p,...f,children:[r.jsxs("div",{css:tO,children:[i,a?r.jsx("div",{css:nO,className:"ds-badge-count",children:a}):null]}),s?null:r.jsx("p",{children:o}),r.jsx(e.VisuallyHidden,{id:m,children:v.join(", ")})]},t.value)}))})})})},exports.Modal=({header:t,content:o,footer:i,size:s="medium",width:a,height:l,maxHeight:c,draggable:d,blocking:u,open:h,onClose:p,labels:f})=>{const m=Mf("Modal",f),g=n.useRef(null);return h?r.jsx(e.Dialog.Root,{open:h,onOpenChange:p,placement:"center",scrollBehavior:"inside",closeOnInteractOutside:!d&&!u,preventScroll:!d&&!u,closeOnEscape:!u,defaultOpen:!0,children:r.jsxs(e.Portal,{children:[d?null:r.jsx(e.Dialog.Backdrop,{css:{background:"rgba(0, 0, 0, 0.64)"}}),r.jsx(XC,{disabled:!d,nodeRef:g,children:r.jsx(e.Dialog.Positioner,{ref:g,children:r.jsxs(e.Dialog.Content,{"aria-label":m.dialogAriaLabel,css:YC(s,a,l,c),children:[r.jsxs(e.Dialog.Header,{css:QC,children:[t,u?null:r.jsx(e.Dialog.CloseTrigger,{css:ek,asChild:!0,children:r.jsx(sg,{})})]}),r.jsx(e.Dialog.Body,{css:tk,children:o}),i?r.jsx(e.Dialog.Footer,{padding:"0.75rem",children:i}):null]})})})]})}):null},exports.MultiActionButton=({variant:t="primary",size:o="default",mainActionLabel:i,mainActionOnClick:s=()=>{},otherActions:a=[],disabled:l,mainActionLeftIcon:c,mainActionRightIcon:d,...u})=>{const[h,p]=n.useState(!1),f=l?`${i} action button with menu, disabled`:void 0;return r.jsxs(e.Group,{css:mg,attached:!0,tabIndex:l?0:void 0,"aria-disabled":l,"aria-label":f,role:"group",children:[r.jsx(Ef,{css:{},label:i,variant:t,size:o,onClick:s,disabled:l,leftIcon:c,rightIcon:d,...u}),r.jsxs(e.Menu.Root,{onOpenChange:({open:e})=>p(e),positioning:{placement:"bottom-end"},children:[r.jsx(e.Menu.Trigger,{css:pg(t),"data-group-item":!0,"data-last":!0,asChild:!0,children:r.jsx(Ef,{style:gg,"aria-label":`Open ${i} options`,"aria-haspopup":"menu","aria-expanded":h,variant:t,size:o,leftIcon:r.jsx(If,{"aria-hidden":"true",rotate:h?"180":"0",color:w("accessible","text-on-primary-mids")||w("primary",900)}),disabled:l})}),r.jsx(vg,{children:a.map((({label:t,value:n,onClick:i})=>r.jsx(e.Menu.Item,{css:fg(o),onClick:i,value:n,children:t},n)))})]})]})},exports.Navbar=({variant:e="default",theme:t="light",logo:o,linkRouter:i,pathname:s,navigationSection:a,utilitySection:l,actionsSection:c,maxWidth:d,fixed:u,onNavbarHeightChange:h,backgroundColor:p,labels:f})=>{const m=Mf("Navbar",f),g=n.useRef(null),v=n.useRef(null),b=n.useRef(null),[y,x]=n.useState(!1),[w,C]=n.useState(-1),[k,S]=n.useState("undefined"!=typeof window&&window?.innerWidth<=jO),[$,j]=n.useState(!1),M=i,E=n.useCallback((()=>{if(v.current&&g.current&&b.current){const e=g.current.getBoundingClientRect(),t=v.current.getBoundingClientRect(),n=b.current.getBoundingClientRect();t.width,e.width,window.innerWidth<=jO||window.innerWidth<=w?(h?.(96),x(!0)):window.innerWidth>jO&&window.innerWidth<=1440?e.right>=t.left?(h?.(96),x(!0),C(window.innerWidth)):window.innerWidth>w&&(h?.(48),x(!1),C(-1)):(h?.(48),x(!1),C(-1)),y&&(window.innerWidth<=jO||n.right>=t.left?(S(!0),h?.(48)):(S(!1),h?.(96)))}}),[w,y]);n.useEffect((()=>(E(),window.addEventListener("resize",E),()=>{window.removeEventListener("resize",E)})),[E]);const T="condensed"===e;return r.jsxs("nav",{css:oO(y&&!k,u,p,t,T),children:[r.jsxs("div",{css:sO(y&&!k,d,T),children:[r.jsxs("div",{css:aO(y&&!k||"dark"===t,T),ref:g,children:[o?r.jsx("div",{ref:b,css:lO,children:o}):null,r.jsx("div",{css:cO(y),children:a?.map((e=>e.link?r.jsx(M,{to:e.link,href:e.link,css:dO(s===e.link,t,T),children:e.label},e.label):r.jsx(jm,{theme:t,label:e.label,fontSize:T?"0.875rem":"1rem",items:e.items||[]},e.label)))})]}),r.jsx("div",{css:uO(T),ref:v,children:k?r.jsxs("button",{type:"button",onClick:()=>j(!$),"aria-label":$?m.closeMenuLabel:m.openMenuLabel,"aria-expanded":$,css:fO(t),children:[$?m.closeLabel:m.menuLabel,$?r.jsx(zf,{height:T?"0.75rem":"1rem",width:T?"0.75rem":"1rem"}):r.jsx(lm,{height:T?"0.75rem":"1rem",width:T?"0.75rem":"1rem"})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{css:uO(T),children:l?.map(((e,t)=>r.jsx("div",{css:hO(y),children:e},t)))}),c?.length?r.jsx("div",{css:pO(y),children:c.map((e=>r.jsx(Ef,{...e},e.ariaLabel)))}):null]})})]}),y&&!k?r.jsx("div",{css:iO(t,T),children:a?.map((e=>e.link?r.jsx(M,{to:e.link,href:e.link,css:dO(s===e.link,t,T),children:e.label},e.label):r.jsx(jm,{theme:t,label:e.label,fontSize:T?"0.875rem":"1rem",items:e.items||[]},e.label)))}):null,k?r.jsx($O,{theme:t,variant:e,navigationSection:a,utilitySection:l,actionsSection:c,linkRouter:i,isOpen:$,setIsOpen:j,pathname:s,resolvedLabels:m}):null]})},exports.NavigationRail=({tabs:t=[],defaultValue:o,onTabClick:i,children:s,onOpenChange:a,labels:l})=>{const c=Mf("NavigationRail",l),[d,u]=n.useState(!1),[h,p]=n.useState(o||t?.[0]?.value),f=e=>{p(e),i&&i(e)},[m]=e.useMediaQuery(["(max-width: 48rem)"]);return m?r.jsxs(e.Tabs.Root,{defaultValue:h,onValueChange:({value:e})=>f(e),children:[r.jsx(e.Tabs.List,{style:{display:"flex",overflowX:"auto",whiteSpace:"nowrap",padding:"0.5rem",gap:"0.5rem"},children:t.map((t=>r.jsx(e.Tabs.Trigger,{value:t.value,css:{"--indicator-color":w("primary",500),flexShrink:0,padding:"0.625rem 1rem",color:w("neutral",600),"&[data-selected]":{color:w("neutral",800),fontWeight:600}},children:t.label},t.value)))}),t.map((t=>r.jsx(e.Tabs.Content,{value:t.value,children:s},t.value)))]}):r.jsxs("div",{style:{height:"calc(100vh - 3rem - 3.5rem)",position:"fixed",top:"3rem",left:0,display:"flex"},children:[r.jsxs("div",{css:MO,children:[r.jsx(e.Tabs.Root,{defaultValue:o||t?.[0]?.value,orientation:"horizontal",width:"full",onValueChange:({value:e})=>{f(e)},children:r.jsx(e.Tabs.List,{alignItems:"center",border:"none",style:{flexDirection:"column"},children:t.map((t=>r.jsx(e.Tabs.Trigger,{css:EO,"aria-label":t["aria-label"]||t.label,...t,children:r.jsxs(e.Box,{display:"flex",alignItems:"center",flexDirection:"column",gap:"0.3125rem",className:"ds-tab-label",children:[t.icon?r.jsx("div",{css:TO,children:t.icon}):null,r.jsx("p",{children:t.label})]})},t.label)))})}),s?r.jsx(e.Collapsible.Root,{onOpenChange:({open:e})=>{u(e),a&&a(!e)},children:r.jsxs(e.Collapsible.Trigger,{css:OO,children:[r.jsx("div",{css:TO,children:d?r.jsx(Af,{}):r.jsx(Lf,{})}),r.jsxs("div",{className:"ds-tab-label",children:[r.jsx("p",{children:d?c.showLabel:c.hideLabel}),r.jsx("p",{children:c.sidebarLabel})]})]})}):null]}),s?r.jsx(e.Collapsible.Root,{defaultOpen:!0,open:!d,children:r.jsx(e.Collapsible.Content,{height:"100%",children:r.jsx("div",{css:LO,role:"tabpanel","aria-labelledby":h,children:s})})}):null]})},exports.OptionCard=({defaultValue:t,items:n,onValueChange:o,variant:s,itemWidth:a,hideControl:l})=>r.jsx(e.RadioCard.Root,{defaultValue:t,onValueChange:o,children:r.jsx(e.HStack,{alignItems:"flex-start",flexWrap:"wrap",gap:"0.75rem",children:n?.map((t=>{return r.jsxs(e.RadioCard.Item,{css:(o=a,c=t.selectedColor,d=t.selectedBackgroundColor,i.css`
|
|
3919
3919
|
width: ${o||"15.0625rem"};
|
|
3920
3920
|
min-height: 4.375rem;
|
|
3921
3921
|
padding: ${k(300)};
|
|
@@ -3993,7 +3993,7 @@ function _M(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
|
|
|
3993
3993
|
border: ${j(100)} solid ${w("neutral",300)};
|
|
3994
3994
|
border-radius: ${$(300)};
|
|
3995
3995
|
${s?`background: ${s};`:""}
|
|
3996
|
-
`)}):r.jsx("div",{css:pw,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:fw,children:t?.map((e=>r.jsx("div",{style:{width:o?"auto":`calc(100% / ${t.length})`,display:"flex",justifyContent:"center"},children:r.jsx("p",{css:mw,children:e})},e)))}),n&&n.length?r.jsx("div",{css:fw,children:n.map((e=>r.jsx("div",{style:{width:o?"auto":`calc(100% / ${t.length})`,display:"flex",justifyContent:"center"},children:r.jsx("p",{css:gw,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=Mf("Search",m),[v,b]=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=n.useRef(null),O=`search-results-${n.useId()}`,L=e=>{const t=s.find((t=>t.id===e||t.label===e));t&&(d?.(t),b(""),C())};n.useEffect((()=>{if(h?.(v),!v)return void S(s);const e=s.filter((e=>e.id?.toLowerCase().includes(v.toLowerCase())||e.label.toLowerCase().includes(v.toLowerCase())||e.caption?.toLowerCase().includes(v.toLowerCase()))).map((e=>({id:e.id,label:e.label,caption:e.caption,variant:"select",icon:e.icon,onItemClick:()=>L(e.id||e.label)})));S(e),x()}),[v]),n.useEffect((()=>{function e(e){y&&T.current&&!T.current.contains(e.target)&&C()}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[y]);const A=v.length?r.jsx(sg,{onClick:()=>{b(""),p?.()}}):null,R="none"!==c&&!!v.length&&k.length>0&&y;let N=w("neutral",500);o?N=w("neutral",500):M&&(N=w("primary",700));const D="small"===i?"1rem":"1.25rem",I=u(a);return r.jsxs("div",{ref:T,style:{position:"relative",width:"100%"},children:[r.jsx(e.InputGroup,{startElement:r.jsx(hm,{width:D,height:D,fill:N}),endElement:A,children:r.jsx(Ym,{autoComplete:"off",placeholder:t||g.filterPlaceholder,onChange:e=>{const{value:t}=e.target;b(t)},onFocus:()=>E(!0),onBlur:()=>E(!1),value:v,label:"",style:{paddingLeft:"2.5rem"},type:"search","aria-label":t||g.filterAriaLabel,"aria-expanded":R,"aria-controls":O,role:"combobox","aria-autocomplete":"list",disabled:o,size:i,noMarginBottom:!0,onKeyDown:e=>{if(R){if("ArrowDown"===e.key&&(e.preventDefault(),j((e=>Math.min(e+1,k.length-1)))),"ArrowUp"===e.key&&(e.preventDefault(),j((e=>Math.max(e-1,0)))),"Enter"===e.key&&(e.preventDefault(),$>=0)){const e=k[$];L(e.id||e.label)}"Escape"===e.key&&C()}}})}),(R||l&&!!v.length)&&"custom"===c&&f&&!l&&f({items:k,highlightedIndex:$,query:v,onSelect:L}),(R||l&&!!v.length)&&r.jsx(e.Portal,{container:T,children:r.jsxs(e.Box,{position:"absolute",width:"100%",backgroundColor:"white",border:"custom"===c?"none":"0.0625rem solid",borderColor:"gray.200",borderRadius:"md",zIndex:1e3,overflowY:"auto",maxHeight:I,children:[l&&r.jsx(e.Box,{padding:"1rem",children:r.jsx(e.Spinner,{})}),"text"===c&&!l&&r.jsx(HO,{highlightedIndex:$,items:k,query:v,onSelect:L}),"list"===c&&!l&&r.jsx(Ow,{items:k,highlightedIndex:$})]})})]})},exports.Select=Pv,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=Mf("Sheet",f),g=n.useRef(null),v=n.useRef([]),[b,y]=n.useState(null),x=window.innerWidth>768,w=v.current;let C=m.expandSheetLabel;if(null!=b){const e=wT(b,w);e>0&&e<w.length-1?C=m.makeFullScreenLabel:e===w.length-1&&(C=m.expandedSheetLabel)}const k=!(null==b||!w.length||wT(b,w)!==w.length-1);return r.jsx(bT,{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=b??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 v.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(vb,{count:o,mode:i,onClick:e,ref:n,showFocusState:r,variant:s}),exports.Slider=Zg,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.jsxs("div",{children:[r.jsxs("p",{css:Yv(o),"aria-label":e,children:[s?r.jsx("span",{children:"*"}):null,e]}),t?r.jsx("p",{css:Qv(o),"aria-label":t,children:t}):null,r.jsxs("div",{css:eb,children:[i.step&&i.marks?r.jsx(Pv,{items:i.marks.map((e=>({label:`${e.label}`,value:`${e.value}`}))),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(Ym,{"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()}),r.jsx(Zg,{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(Ym,{"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()}):null]})]})},exports.StepProgressIndicator=({steps:e,currentStep:t,labels:n})=>{const o=Mf("StepProgressIndicator",n);return r.jsxs("div",{css:oL,children:[e.map(((e,n)=>r.jsxs("div",{css:iL,children:[r.jsx("button",{css:sL(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(Rf,{height:"1rem",width:"1rem"}):n+1}),e.label?r.jsx("p",{css:aL(t===n+1),children:e.label}):null]},`${e.label}-${n}`))),r.jsx("div",{css:lL,children:r.jsx("div",{css:cL})})]})},exports.Switch=Xg,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:v,loading:b,height:y,labels:x})=>{const C=Mf("Table",x),[k,S]=n.useState({key:"",order:""}),$=n.useRef({}),[j,M]=n.useState({}),[E,T]=n.useState([]),{totalItems:O=i.length,currentPage:L=1,pageSize:A=10,showItemCount:R,showItemCountText:N}=c||{},D=Boolean(p),I=n.useMemo((()=>Gw(i,k,D)),[i,D,k]),P=(e,t)=>{S({key:e,order:t}),p&&p({key:e,order:t})},z=u??E,V=I.length>0&&z.length===I.length,B=z.length>0&&z.length<I.length,H=n.useMemo((()=>(e=>e.reduce(((e,t)=>(e[t.key]=t,e)),{}))(o)),[o]),_=n.useMemo((()=>(e=>e.filter((e=>e.sticky)).map((e=>e.key)))(o)),[o]),F=(e=>e.length>0?e[e.length-1]:void 0)(_),q=n.useCallback((()=>{const e=((e,t)=>{const n={};let r=0;return e.filter((e=>e.sticky)).forEach((e=>{n[e.key]=r,r+=t[e.key]?.offsetWidth||0})),n})(o,$.current);M(e)}),[o]);n.useEffect((()=>{q()}),[q,i.length]),n.useEffect((()=>{const e=()=>{q()};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[q]),n.useEffect((()=>{void 0===u&&T((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 W=e=>Kw(j,e.key,F),U=e=>((e,t,n,r)=>({...Uw(e,n),...Kw(t,n,r)}))(H,j,e,F),K=e=>((e,t)=>e.some((e=>e.id===t.id)))(z,e),G=(({columns:n,selectable:r,isRowSelected:o,onRowSelected:i,getSelectRowLabel:s})=>(a,l)=>{const{id:c,name:d}=a;return t.jsxs(e.Table.Row,{className:l?.className,children:[r?t.jsx(e.Table.Cell,{children:t.jsx(kg,{name:`checkbox-${c}`,"aria-label":s(d,c),checked:o(a),onCheckedChange:({checked:e})=>{i(a,e)}})}):null,n.map((n=>t.jsx(e.Table.Cell,{...l?.getCellProps(n.key),children:n.cell?n.cell(a):a?.[n.key]},n.key)))]})})({columns:o,selectable:d,isRowSelected:K,onRowSelected:(e,t)=>{void 0===u&&T((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))),v&&v(e,t)},getSelectRowLabel:(e,t)=>C.selectRowLabel(e,t)}),Z=s||G;return r.jsxs("div",{children:[r.jsx("div",{css:y?qw(y):void 0,children:r.jsxs(e.Table.Root,{css:Iw(h,l),striped:a,stickyHeader:l,interactive:!0,children:[r.jsx(e.Table.Header,{css:Pw(h),children:r.jsxs(e.Table.Row,{children:[d?r.jsx(e.Table.ColumnHeader,{children:r.jsx(kg,{name:"header-checkbox","aria-label":C.selectAllRowsLabel,checked:V,indeterminate:B,onCheckedChange:({checked:e})=>{void 0===u&&T(e?I:[]),g&&g(e)}})}):null,o.map((t=>{return r.jsx(e.Table.ColumnHeader,{ref:e=>{$.current[t.key]=e},...(n=t.key,Uw(H,n)),role:t.sortable?"columnheader":void 0,"aria-sort":t.sortable&&"asc"===k.order?"ascending":t.sortable&&"desc"===k.order?"descending":void 0,...W(t),children:r.jsxs("div",{css:zw,children:[t.label,t.sortable?r.jsxs("div",{css:Vw,children:[r.jsx(Of,{css:Bw(k.key===t.key&&"asc"===k.order),icon:r.jsx(If,{style:{transform:"rotate(180deg)"}}),onClick:()=>P(t.key,"asc"),"aria-label":C.ascendingLabel}),r.jsx(Of,{css:Bw(k.key===t.key&&"desc"===k.order),icon:r.jsx(If,{}),onClick:()=>P(t.key,"desc"),"aria-label":C.descendingLabel})]}):null]})},t.key);var n}))]})}),r.jsx(e.Table.Body,{css:Fw,children:I.map((e=>r.jsx(n.Fragment,{children:Z(e,{className:K(e)?"selected":void 0,getCellProps:U})},e.id)))})]})}),b?r.jsx("div",{css:Ww,children:r.jsx(e.Spinner,{size:"lg",color:w("primary",500)})}):null,r.jsxs("div",{css:Hw,children:[r.jsx("div",{children:R?r.jsx(ww,{pageSize:A,currentPage:L,totalItems:O,onPageSizeChange:f,showItemCountText:N}):null}),c?r.jsx("div",{css:_w,children:r.jsx(Dw,{totalItems:O,pageSize:A,currentPage:L,onPageChange:m})}):null]})]})},exports.TableCell=Jw,exports.TableRow=Zw,exports.Tag=Nv,exports.TextInput=Ym,exports.Textarea=({label:t,caption:o,placeholder:i,errorMessage:s,required:a,disabled:l,size:c="default",defaultValue:d="",onChange:u,minLength:h,maxLength:p,labels:f,...m})=>{const g=Mf("Textarea",f),[v,b]=n.useState(d),[y,x]=n.useState(!1),[w,C]=n.useState(!1),[k,S]=n.useState(""),$=n.useId(),j=n.useId(),M=n.useId();n.useEffect((()=>{const{length:e}=d;h&&e<h&&e>0?(x(e<h),C(!1),S(g.enterAtLeastChars(h-e))):h&&0===e&&S(g.minChars(h)),p&&e>0?(x(!1),C(e>p),S(g.charsRemaining(p-e))):p&&0===e&&S(g.maxChars(p))}),[]);const E=!!s||y||w,T=[o?$:null,E?j:null,k?M:null].filter(Boolean).join(" ")||void 0;return r.jsxs("div",{css:tb(c),children:[E?r.jsx("div",{css:nb}):null,r.jsxs(e.Field.Root,{required:a,invalid:E,gap:"0",style:{marginLeft:E?"1.1875rem":"0px"},children:[t?r.jsxs(e.Field.Label,{css:rb(c,l),"aria-label":t,children:[r.jsx(e.Field.RequiredIndicator,{"aria-label":g.requiredSymbolLabel}),t,a?"":r.jsx("span",{children:g.optionalSuffix})]}):null,o?r.jsx(e.Field.HelperText,{id:$,css:ob(c,l),children:o}):null,s?r.jsx(e.Field.ErrorText,{id:j,css:sb,"aria-label":`${g.errorPrefix} ${s}`,"aria-live":"polite",children:s}):null,r.jsx(e.Textarea,{placeholder:i,disabled:l,css:ab(c,v,d),onChange:e=>{b(e.target.value);const{length:t}=e.target.value;h&&p?(x(t<h),C(t>p),S(g.charsRemaining(p-t))):h?(x(t<h),C(!1),S(t<h?g.enterAtLeastChars(h-t):"")):p&&(C(t>p),x(!1),S(g.charsRemaining(p-t))),u&&u(e)},value:v,"aria-label":t||i,"aria-describedby":T,_placeholder:{color:"var(--chakra-colors-neutral-500)"},...m}),y&&h?r.jsx(e.Field.ErrorText,{id:j,css:sb,style:{marginTop:"0.5rem",fontSize:"0.75rem",lineHeight:"1rem"},"aria-live":"polite",children:g.needMoreChars(h-v.length)}):null,w&&p?r.jsx(e.Field.ErrorText,{id:j,css:sb,style:{marginTop:"0.5rem",fontSize:"0.75rem",lineHeight:"1rem"},"aria-live":"polite",children:g.tooManyChars(v.length-p)}):null,!k||w||y?null:r.jsx(e.Field.HelperText,{id:M,css:ib,"aria-live":"polite",children:k})]})]})},exports.Toast=({labels:t})=>{const n=Mf("Toast",t);return Object.keys(mL).map((t=>r.jsx(e.Portal,{children:r.jsx(e.Toaster,{toaster:mL[t],insetInline:{mdDown:"4"},children:o=>{return r.jsxs(e.Toast.Root,{css:(s=o.meta?.maxWidth,i.css`
|
|
3996
|
+
`)}):r.jsx("div",{css:pw,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:fw,children:t?.map((e=>r.jsx("div",{style:{width:o?"auto":`calc(100% / ${t.length})`,display:"flex",justifyContent:"center"},children:r.jsx("p",{css:mw,children:e})},e)))}),n&&n.length?r.jsx("div",{css:fw,children:n.map((e=>r.jsx("div",{style:{width:o?"auto":`calc(100% / ${t.length})`,display:"flex",justifyContent:"center"},children:r.jsx("p",{css:gw,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=Mf("Search",m),[v,b]=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=n.useRef(null),O=`search-results-${n.useId()}`,L=e=>{const t=s.find((t=>t.id===e||t.label===e));t&&(d?.(t),b(""),C())};n.useEffect((()=>{if(h?.(v),!v)return void S(s);const e=s.filter((e=>e.id?.toLowerCase().includes(v.toLowerCase())||e.label.toLowerCase().includes(v.toLowerCase())||e.caption?.toLowerCase().includes(v.toLowerCase()))).map((e=>({id:e.id,label:e.label,caption:e.caption,variant:"select",icon:e.icon,onItemClick:()=>L(e.id||e.label)})));S(e),x()}),[v]),n.useEffect((()=>{function e(e){y&&T.current&&!T.current.contains(e.target)&&C()}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[y]);const A=v.length?r.jsx(sg,{onClick:()=>{b(""),p?.()}}):null,R="none"!==c&&!!v.length&&k.length>0&&y;let N=w("neutral",500);o?N=w("neutral",500):M&&(N=w("primary",700));const D="small"===i?"1rem":"1.25rem",I=u(a);return r.jsxs("div",{ref:T,style:{position:"relative",width:"100%"},children:[r.jsx(e.InputGroup,{startElement:r.jsx(hm,{width:D,height:D,fill:N}),endElement:A,children:r.jsx(Ym,{autoComplete:"off",placeholder:t||g.filterPlaceholder,onChange:e=>{const{value:t}=e.target;b(t)},onFocus:()=>E(!0),onBlur:()=>E(!1),value:v,label:"",style:{paddingLeft:"2.5rem"},type:"search","aria-label":t||g.filterAriaLabel,"aria-expanded":R,"aria-controls":O,role:"combobox","aria-autocomplete":"list",disabled:o,size:i,noMarginBottom:!0,onKeyDown:e=>{if(R){if("ArrowDown"===e.key&&(e.preventDefault(),j((e=>Math.min(e+1,k.length-1)))),"ArrowUp"===e.key&&(e.preventDefault(),j((e=>Math.max(e-1,0)))),"Enter"===e.key&&(e.preventDefault(),$>=0)){const e=k[$];L(e.id||e.label)}"Escape"===e.key&&C()}}})}),(R||l&&!!v.length)&&"custom"===c&&f&&!l&&f({items:k,highlightedIndex:$,query:v,onSelect:L}),(R||l&&!!v.length)&&r.jsx(e.Portal,{container:T,children:r.jsxs(e.Box,{position:"absolute",width:"100%",backgroundColor:"white",border:"custom"===c?"none":"0.0625rem solid",borderColor:"gray.200",borderRadius:"md",zIndex:1e3,overflowY:"auto",maxHeight:I,children:[l&&r.jsx(e.Box,{padding:"1rem",children:r.jsx(e.Spinner,{})}),"text"===c&&!l&&r.jsx(HO,{highlightedIndex:$,items:k,query:v,onSelect:L}),"list"===c&&!l&&r.jsx(Ow,{items:k,highlightedIndex:$})]})})]})},exports.Select=Pv,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=Mf("Sheet",f),g=n.useRef(null),v=n.useRef([]),[b,y]=n.useState(null),x=window.innerWidth>768,w=v.current;let C=m.expandSheetLabel;if(null!=b){const e=wT(b,w);e>0&&e<w.length-1?C=m.makeFullScreenLabel:e===w.length-1&&(C=m.expandedSheetLabel)}const k=!(null==b||!w.length||wT(b,w)!==w.length-1);return r.jsx(bT,{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=b??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 v.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(vb,{count:o,mode:i,onClick:e,ref:n,showFocusState:r,variant:s}),exports.Slider=Zg,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.jsxs("div",{children:[r.jsxs("p",{css:Yv(o),"aria-label":e,children:[s?r.jsx("span",{children:"*"}):null,e]}),t?r.jsx("p",{css:Qv(o),"aria-label":t,children:t}):null,r.jsxs("div",{css:eb,children:[i.step&&i.marks?r.jsx(Pv,{items:i.marks.map((e=>({label:`${e.label}`,value:`${e.value}`}))),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(Ym,{"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()}),r.jsx(Zg,{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(Ym,{"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()}):null]})]})},exports.StepProgressIndicator=({steps:e,currentStep:t,labels:n})=>{const o=Mf("StepProgressIndicator",n);return r.jsxs("div",{css:oL,children:[e.map(((e,n)=>r.jsxs("div",{css:iL,children:[r.jsx("button",{css:sL(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(Rf,{height:"1rem",width:"1rem"}):n+1}),e.label?r.jsx("p",{css:aL(t===n+1),children:e.label}):null]},`${e.label}-${n}`))),r.jsx("div",{css:lL,children:r.jsx("div",{css:cL})})]})},exports.Switch=Xg,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:v,loading:b,height:y,labels:x})=>{const C=Mf("Table",x),[k,S]=n.useState({key:"",order:""}),$=n.useRef({}),[j,M]=n.useState({}),[E,T]=n.useState([]),{totalItems:O=i.length,currentPage:L=1,pageSize:A=10,showItemCount:R,showItemCountText:N}=c||{},D=Boolean(p),I=n.useMemo((()=>Gw(i,k,D)),[i,D,k]),P=(e,t)=>{S({key:e,order:t}),p&&p({key:e,order:t})},z=u??E,V=I.length>0&&z.length===I.length,B=z.length>0&&z.length<I.length,H=n.useMemo((()=>(e=>e.reduce(((e,t)=>(e[t.key]=t,e)),{}))(o)),[o]),_=n.useMemo((()=>(e=>e.filter((e=>e.sticky)).map((e=>e.key)))(o)),[o]),F=(e=>e.length>0?e[e.length-1]:void 0)(_),q=n.useCallback((()=>{const e=((e,t)=>{const n={};let r=0;return e.filter((e=>e.sticky)).forEach((e=>{n[e.key]=r,r+=t[e.key]?.offsetWidth||0})),n})(o,$.current);M(e)}),[o]);n.useEffect((()=>{q()}),[q,i.length]),n.useEffect((()=>{const e=()=>{q()};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[q]),n.useEffect((()=>{void 0===u&&T((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 W=e=>Kw(j,e.key,F),U=e=>((e,t,n,r)=>({...Uw(e,n),...Kw(t,n,r)}))(H,j,e,F),K=e=>((e,t)=>e.some((e=>e.id===t.id)))(z,e),G=(({columns:n,selectable:r,isRowSelected:o,onRowSelected:i,getSelectRowLabel:s})=>(a,l)=>{const{id:c,name:d}=a;return t.jsxs(e.Table.Row,{className:l?.className,children:[r?t.jsx(e.Table.Cell,{children:t.jsx(kg,{name:`checkbox-${c}`,"aria-label":s(d,c),checked:o(a),onCheckedChange:({checked:e})=>{i(a,e)}})}):null,n.map((n=>t.jsx(e.Table.Cell,{...l?.getCellProps(n.key),children:n.cell?n.cell(a):a?.[n.key]},n.key)))]})})({columns:o,selectable:d,isRowSelected:K,onRowSelected:(e,t)=>{void 0===u&&T((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))),v&&v(e,t)},getSelectRowLabel:(e,t)=>C.selectRowLabel(e,t)}),Z=s||G;return r.jsxs("div",{children:[r.jsx("div",{css:y?qw(y):void 0,children:r.jsxs(e.Table.Root,{css:Iw(h,l),striped:a,stickyHeader:l,interactive:!0,children:[r.jsx(e.Table.Header,{css:Pw(h),children:r.jsxs(e.Table.Row,{children:[d?r.jsx(e.Table.ColumnHeader,{children:r.jsx(kg,{name:"header-checkbox","aria-label":C.selectAllRowsLabel,checked:V,indeterminate:B,onCheckedChange:({checked:e})=>{void 0===u&&T(e?I:[]),g&&g(e)}})}):null,o.map((t=>{return r.jsx(e.Table.ColumnHeader,{ref:e=>{$.current[t.key]=e},...(n=t.key,Uw(H,n)),role:t.sortable?"columnheader":void 0,"aria-sort":t.sortable&&"asc"===k.order?"ascending":t.sortable&&"desc"===k.order?"descending":void 0,...W(t),children:r.jsxs("div",{css:zw,children:[t.label,t.sortable?r.jsxs("div",{css:Vw,children:[r.jsx(Of,{css:Bw(k.key===t.key&&"asc"===k.order),icon:r.jsx(If,{style:{transform:"rotate(180deg)"}}),onClick:()=>P(t.key,"asc"),"aria-label":C.ascendingLabel}),r.jsx(Of,{css:Bw(k.key===t.key&&"desc"===k.order),icon:r.jsx(If,{}),onClick:()=>P(t.key,"desc"),"aria-label":C.descendingLabel})]}):null]})},t.key);var n}))]})}),r.jsx(e.Table.Body,{css:Fw,children:I.map((e=>r.jsx(n.Fragment,{children:Z(e,{className:K(e)?"selected":void 0,getCellProps:U})},e.id)))})]})}),b?r.jsx("div",{css:Ww,children:r.jsx(e.Spinner,{size:"lg",color:w("primary",500)})}):null,r.jsxs("div",{css:Hw,children:[r.jsx("div",{children:R?r.jsx(ww,{pageSize:A,currentPage:L,totalItems:O,onPageSizeChange:f,showItemCountText:N}):null}),c?r.jsx("div",{css:_w,children:r.jsx(Dw,{totalItems:O,pageSize:A,currentPage:L,onPageChange:m})}):null]})]})},exports.TableCell=Jw,exports.TableRow=Zw,exports.Tag=Nv,exports.TextInput=Ym,exports.Textarea=({label:t,caption:o,placeholder:i,errorMessage:s,required:a,disabled:l,size:c="default",showOptionalLabel:d=!0,defaultValue:u="",onChange:h,minLength:p,maxLength:f,labels:m,...g})=>{const v=Mf("Textarea",m),[b,y]=n.useState(u),[x,w]=n.useState(!1),[C,k]=n.useState(!1),[S,$]=n.useState(""),j=n.useId(),M=n.useId(),E=n.useId();n.useEffect((()=>{const{length:e}=u;p&&e<p&&e>0?(w(e<p),k(!1),$(v.enterAtLeastChars(p-e))):p&&0===e&&$(v.minChars(p)),f&&e>0?(w(!1),k(e>f),$(v.charsRemaining(f-e))):f&&0===e&&$(v.maxChars(f))}),[]);const T=!!s||x||C,O=[o?j:null,T?M:null,S?E:null].filter(Boolean).join(" ")||void 0;return r.jsxs("div",{css:tb(c),children:[T?r.jsx("div",{css:nb}):null,r.jsxs(e.Field.Root,{required:a,invalid:T,gap:"0",style:{marginLeft:T?"1.1875rem":"0px"},children:[t?r.jsxs(e.Field.Label,{css:rb(c,l),"aria-label":t,children:[r.jsx(e.Field.RequiredIndicator,{"aria-label":v.requiredSymbolLabel}),t,!a&&d?r.jsx("span",{children:v.optionalSuffix}):null]}):null,o?r.jsx(e.Field.HelperText,{id:j,css:ob(c,l),children:o}):null,s?r.jsx(e.Field.ErrorText,{id:M,css:sb,"aria-label":`${v.errorPrefix} ${s}`,"aria-live":"polite",children:s}):null,r.jsx(e.Textarea,{placeholder:i,disabled:l,css:ab(c,b,u),onChange:e=>{y(e.target.value);const{length:t}=e.target.value;p&&f?(w(t<p),k(t>f),$(v.charsRemaining(f-t))):p?(w(t<p),k(!1),$(t<p?v.enterAtLeastChars(p-t):"")):f&&(k(t>f),w(!1),$(v.charsRemaining(f-t))),h&&h(e)},value:b,"aria-label":t||i,"aria-describedby":O,_placeholder:{color:"var(--chakra-colors-neutral-500)"},...g}),x&&p?r.jsx(e.Field.ErrorText,{id:M,css:sb,style:{marginTop:"0.5rem",fontSize:"0.75rem",lineHeight:"1rem"},"aria-live":"polite",children:v.needMoreChars(p-b.length)}):null,C&&f?r.jsx(e.Field.ErrorText,{id:M,css:sb,style:{marginTop:"0.5rem",fontSize:"0.75rem",lineHeight:"1rem"},"aria-live":"polite",children:v.tooManyChars(b.length-f)}):null,!S||C||x?null:r.jsx(e.Field.HelperText,{id:E,css:ib,"aria-live":"polite",children:S})]})]})},exports.Toast=({labels:t})=>{const n=Mf("Toast",t);return Object.keys(mL).map((t=>r.jsx(e.Portal,{children:r.jsx(e.Toaster,{toaster:mL[t],insetInline:{mdDown:"4"},children:o=>{return r.jsxs(e.Toast.Root,{css:(s=o.meta?.maxWidth,i.css`
|
|
3997
3997
|
justify-content: space-between;
|
|
3998
3998
|
align-items: center;
|
|
3999
3999
|
gap: ${k(200)};
|
package/dist/index.d.ts
CHANGED
|
@@ -1127,15 +1127,16 @@ type TextareaProps = Omit<TextareaProps$1, 'size' | 'variant' | 'colorPalette' |
|
|
|
1127
1127
|
required?: boolean;
|
|
1128
1128
|
disabled?: boolean;
|
|
1129
1129
|
size?: 'small' | 'default';
|
|
1130
|
+
showOptionalLabel?: boolean;
|
|
1130
1131
|
defaultValue?: string;
|
|
1131
|
-
onChange?: (e: React.ChangeEvent<
|
|
1132
|
+
onChange?: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
1132
1133
|
minLength?: number;
|
|
1133
1134
|
maxLength?: number;
|
|
1134
1135
|
/** Override internal UI labels for internationalization support. */
|
|
1135
1136
|
labels?: Partial<TextareaLabels>;
|
|
1136
1137
|
};
|
|
1137
1138
|
|
|
1138
|
-
declare const Textarea: ({ label, caption, placeholder, errorMessage, required, disabled, size, defaultValue, onChange, minLength, maxLength, labels, ...rest }: TextareaProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
1139
|
+
declare const Textarea: ({ label, caption, placeholder, errorMessage, required, disabled, size, showOptionalLabel, defaultValue, onChange, minLength, maxLength, labels, ...rest }: TextareaProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
1139
1140
|
|
|
1140
1141
|
type TextInputProps = Omit<InputProps, 'size' | 'variant' | 'colorPalette' | 'defaultChecked'> & {
|
|
1141
1142
|
label?: string;
|
|
@@ -1145,6 +1146,7 @@ type TextInputProps = Omit<InputProps, 'size' | 'variant' | 'colorPalette' | 'de
|
|
|
1145
1146
|
required?: boolean;
|
|
1146
1147
|
disabled?: boolean;
|
|
1147
1148
|
size?: 'small' | 'default';
|
|
1149
|
+
showOptionalLabel?: boolean;
|
|
1148
1150
|
noMarginBottom?: boolean;
|
|
1149
1151
|
defaultValue?: string;
|
|
1150
1152
|
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
@@ -1152,7 +1154,7 @@ type TextInputProps = Omit<InputProps, 'size' | 'variant' | 'colorPalette' | 'de
|
|
|
1152
1154
|
labels?: Partial<TextInputLabels>;
|
|
1153
1155
|
};
|
|
1154
1156
|
|
|
1155
|
-
declare const TextInput: ({ label, caption, placeholder, errorMessage, required, disabled, size, noMarginBottom, defaultValue, onChange, labels, ...rest }: TextInputProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
1157
|
+
declare const TextInput: ({ label, caption, placeholder, errorMessage, required, disabled, size, showOptionalLabel, noMarginBottom, defaultValue, onChange, labels, ...rest }: TextInputProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
1156
1158
|
|
|
1157
1159
|
type ComboboxProps = {
|
|
1158
1160
|
initialItems?: {
|
|
@@ -1165,6 +1167,7 @@ type ComboboxProps = {
|
|
|
1165
1167
|
errorMessage?: string;
|
|
1166
1168
|
size?: 'small' | 'default';
|
|
1167
1169
|
disabled?: boolean;
|
|
1170
|
+
showOptionalLabel?: boolean;
|
|
1168
1171
|
placeholder?: string;
|
|
1169
1172
|
labels?: Partial<ComboboxLabels>;
|
|
1170
1173
|
noMarginBottom?: boolean;
|
|
@@ -1172,7 +1175,7 @@ type ComboboxProps = {
|
|
|
1172
1175
|
showSelectedItems?: boolean;
|
|
1173
1176
|
};
|
|
1174
1177
|
|
|
1175
|
-
declare const Combobox: ({ label, required, caption, errorMessage, size, disabled, placeholder, labels, noMarginBottom, initialItems, multiple, showSelectedItems, }: ComboboxProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
1178
|
+
declare const Combobox: ({ label, required, caption, errorMessage, size, disabled, showOptionalLabel, placeholder, labels, noMarginBottom, initialItems, multiple, showSelectedItems, }: ComboboxProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
1176
1179
|
|
|
1177
1180
|
type TagProps = Omit<Tag$1.RootProps, 'size' | 'variant' | 'colorPalette' | 'children'> & {
|
|
1178
1181
|
label: string;
|
package/dist/index.esm.js
CHANGED
|
@@ -404,7 +404,7 @@ import{createSystem as e,defaultConfig as t,Button as n,Box as r,Spinner as o,Ic
|
|
|
404
404
|
}
|
|
405
405
|
|
|
406
406
|
${t||n?`\n border: ${je(100)} solid ${ze("neutral",700)};\n `:""}
|
|
407
|
-
`,mv=({label:e,caption:t,placeholder:n,errorMessage:r,required:o,disabled:i,size:s="default",
|
|
407
|
+
`,mv=({label:e,caption:t,placeholder:n,errorMessage:r,required:o,disabled:i,size:s="default",showOptionalLabel:a=!0,noMarginBottom:l=!1,defaultValue:u="",onChange:h,labels:p,...f})=>{const m=qm("TextInput",p),[g,v]=le(u);return be("div",{css:cv(s,l),className:"ds-text-input-container",children:[r?ye("div",{css:dv}):null,be(c.Root,{required:o,invalid:!!r,gap:"0",style:{marginLeft:r?"1.1875rem":"0px"},children:[e?be(c.Label,{css:uv(s,i),"aria-label":e,children:[ye(c.RequiredIndicator,{"aria-label":m.requiredSymbolLabel}),e,!o&&a?ye("span",{children:m.optionalSuffix}):null]}):null,t?ye(c.HelperText,{css:hv(s,i),"aria-label":t,children:t}):null,r?ye(c.ErrorText,{css:pv(s),"aria-label":r,children:r}):null,ye(d,{placeholder:n,disabled:i,css:fv(s,g,u),onChange:e=>{v(e.target.value),h&&h(e)},value:g,_placeholder:{color:"var(--chakra-colors-neutral-500)"},...f})]})]})};const gv=e=>{const{editor:t,disabled:n}=zm(),[o,i]=te.useState(!1),[s,a]=te.useState(""),[l,c]=te.useState(""),[d,p]=te.useState(""),f=te.useRef(null);if(te.useEffect((()=>{n&&i(!1)}),[n]),!t)return null;const{label:m="Link",urlPlaceholder:g="http://example.org",labelPlaceholder:v="Label (optional)",labelInputAriaLabel:b="Link label",applyLabel:y="Apply",removeLabel:w="Remove",invalidUrlMessage:C="Please enter a valid URL",...x}=e,k=t.isActive("link"),$=()=>f.current?t.chain().focus().setTextSelection({from:f.current.from,to:f.current.to}):t.chain().focus();return Q(u.Root,{open:o,onOpenChange:({open:e})=>{n?i(!1):(i(e),e&&(()=>{const{from:e,to:n,empty:r}=t.state.selection,o=t.state.doc.textBetween(e,n," ").trim();f.current={from:e,to:n,empty:r,selectedText:o};const i=t.getAttributes("link")?.href||o||"";a(i||"http://"),c(o),p("")})())},positioning:{placement:"bottom-start"},children:[Y(u.Trigger,{asChild:!0,children:Y(r,{children:Y(Ug,{content:m,children:Y(Km,{icon:Y("span",{"data-rte-icon":"true",children:Y(Lg,{})}),"aria-label":m,"aria-pressed":k||o,disabled:n,onMouseDown:e=>{e.preventDefault()},onClick:()=>{n||i((e=>!e))},...x})})})}),Y(u.Positioner,{children:Y(u.Content,{css:{padding:He(300),borderColor:ze("neutral",300),width:`calc(( ${He(2800)} + ${He(2e3)} ) * 2)`,maxWidth:"90vw"},children:Y(u.Body,{children:Q(r,{css:{display:"flex",flexDirection:"column",gap:He(300)},children:[Y(mv,{"aria-label":m,placeholder:g,disabled:n,noMarginBottom:!0,value:s,onChange:e=>{a(e.target.value),d&&p("")}}),Y(mv,{"aria-label":b,placeholder:v,disabled:n,noMarginBottom:!0,value:l,onChange:e=>{c(e.target.value)}}),d?Y(h,{css:{color:ze("error",700)},children:d}):null,Q(r,{css:{display:"flex",gap:He(200),justifyContent:"flex-end"},children:[k?Y(Wm,{variant:"borderless",size:"small",label:w,disabled:n,onMouseDown:e=>e.preventDefault(),onClick:()=>{$().unsetLink().run(),i(!1)}}):null,Y(Wm,{variant:"secondary",size:"small",label:y,disabled:n,onMouseDown:e=>e.preventDefault(),onClick:()=>{const e=function(e){const t=e.trim();return t?/^(https?:\/\/|mailto:|tel:)/i.test(t)?t:`http://${t}`:""}(s),t=l.trim();if(!e||!function(e){if(/^(mailto:|tel:)/i.test(e))return!0;try{const t=new URL(e);return"http:"===t.protocol||"https:"===t.protocol}catch{return!1}}(e))return void p(C);const n=$(),r=f.current;if(r?.empty){const r=t||e;n.insertContent({type:"text",text:r,marks:[{type:"link",attrs:{href:e}}]}).run()}else t&&t!==r?.selectedText?n.insertContent({type:"text",text:t,marks:[{type:"link",attrs:{href:e}}]}).run():n.extendMarkRange("link").setLink({href:e}).run();i(!1)}})]})]})})})})]})},vv=te.forwardRef(((e,t)=>{const{editor:n,children:o,css:i,disabled:s,...a}=e,l=te.useMemo((()=>({editor:n,disabled:Boolean(s)})),[n,s]);return Y(Im.Provider,{value:l,children:Y(r,{ref:t,"data-disabled":s||void 0,css:[Vm,i],...a,children:o})})})),bv={fixed:{bg:"bg",roundedTop:"l2",borderBottomWidth:"1px",p:"3"},floating:{bg:"bg.panel",roundedTop:"l2",shadow:"sm",p:"3"}},yv=te.forwardRef(((e,t)=>{const{variant:n="fixed",css:r,...o}=e;return Y(p,{ref:t,flexWrap:"wrap",separator:Y(f,{h:"5",alignSelf:"center"}),css:[bv[n],r],...o})})),wv={Root:vv,Toolbar:yv,Content:te.forwardRef(((e,t)=>{const{editor:n}=zm();return n?Y(km,{editor:n,innerRef:t,...e}):null})),ControlGroup:te.forwardRef(((e,t)=>Y(p,{ref:t,gap:"2",...e})))},Cv=["undo","redo","textType","alignment","fontSize","bold","italic","underline","strikethrough","bulletList","orderedList","link","image"],xv=({defaultValue:e="",disabled:t=!1,ariaLabel:n,placeholder:r,minHeight:o,visibleControls:i=Cv,onChange:s,labels:a})=>{const l=qm("RichTextEditor",a),c=n||l.editorAriaLabel,d=r||l.placeholder,u=o,h=Lm({extensions:[Sf.configure({link:!1}),wh.configure({openOnClick:!0,autolink:!0,defaultProtocol:"https"}),Cd,kf,ap.configure({placeholder:d,emptyEditorClass:"is-editor-empty"}),lp,cp,dp.configure({types:["paragraph","heading"]}),bp],content:e,editable:!t,shouldRerenderOnTransaction:!0,immediatelyRender:!1,onUpdate:({editor:e})=>{s?.(e.getHTML())},editorProps:{attributes:{"aria-label":c}}},[d,c]);return te.useEffect((()=>{h&&h.setEditable(!t)}),[h,t]),be(wv.Root,{editor:h,disabled:t,css:{"& .ProseMirror":{minHeight:u||0}},children:[ye(wv.Toolbar,{children:be(wv.ControlGroup,{children:[i.includes("undo")?ye(iv,{label:l.undoTooltip}):null,i.includes("redo")?ye(sv,{label:l.redoTooltip}):null,i.includes("textType")?ye(Jg,{label:l.textTypeTooltip}):null,i.includes("alignment")?ye(lv,{label:l.alignmentTooltip,alignLeftLabel:l.alignLeftOptionLabel,alignCenterLabel:l.alignCenterOptionLabel,alignRightLabel:l.alignRightOptionLabel,alignJustifyLabel:l.alignJustifyOptionLabel}):null,i.includes("fontSize")?ye(Xg,{label:l.fontSizeTooltip}):null,i.includes("bold")?ye(Yg,{label:l.boldTooltip,icon:ye("strong",{css:{fontSize:Ve(600),lineHeight:1},children:l.boldIconText})}):null,i.includes("italic")?ye(Qg,{label:l.italicTooltip,icon:ye("em",{css:{fontStyle:"italic",fontSize:Ve(600),lineHeight:1},children:l.italicIconText})}):null,i.includes("underline")?ye(ev,{label:l.underlineTooltip,icon:ye("span",{css:{fontSize:Ve(600),lineHeight:1,textDecoration:"underline"},children:l.underlineIconText})}):null,i.includes("strikethrough")?ye(tv,{label:l.strikethroughTooltip,icon:ye("span",{css:{fontSize:Ve(600),lineHeight:1,textDecoration:"line-through"},children:l.strikethroughIconText})}):null,i.includes("bulletList")?ye(nv,{label:l.bulletListTooltip}):null,i.includes("orderedList")?ye(rv,{label:l.orderedListTooltip}):null,i.includes("link")?ye(gv,{label:l.linkTooltip,urlPlaceholder:l.linkUrlPlaceholder,labelPlaceholder:l.linkLabelPlaceholder,labelInputAriaLabel:l.linkLabelAriaLabel,applyLabel:l.linkApplyLabel,removeLabel:l.linkRemoveLabel,invalidUrlMessage:l.linkInvalidUrlMessage}):null,i.includes("image")?ye(ov,{label:l.imageTooltip}):null]})}),ye(wv.Content,{})]})},kv={Google:({ariaLabel:e,size:t="default",onClick:n})=>Y(Wm,{label:"Google",leftIcon:Y(Cg,{}),"aria-label":e||"Google Login",variant:"secondary",size:t,onClick:n}),Facebook:({ariaLabel:e,size:t="default",onClick:n})=>Y(Wm,{label:"Facebook",leftIcon:Y(xg,{}),"aria-label":e||"Facebook Login",variant:"secondary",size:t,onClick:n}),X:({ariaLabel:e,size:t="default",onClick:n})=>Y(Wm,{label:"X",leftIcon:Y(kg,{}),"aria-label":e||"X Login",variant:"secondary",size:t,onClick:n}),Microsoft:({ariaLabel:e,size:t="default",onClick:n})=>Y(Wm,{label:"Microsoft",leftIcon:Y($g,{}),"aria-label":e||"Microsoft Login",variant:"secondary",size:t,onClick:n})},$v=$e`
|
|
408
408
|
width: ${He(500)} !important;
|
|
409
409
|
padding: 0 !important;
|
|
410
410
|
min-width: ${He(500)} !important;
|
|
@@ -1783,7 +1783,7 @@ import{createSystem as e,defaultConfig as t,Button as n,Box as r,Spinner as o,Ic
|
|
|
1783
1783
|
}
|
|
1784
1784
|
|
|
1785
1785
|
${t||n?`\n border: ${je(100)} solid ${ze("neutral",700)};\n `:""}
|
|
1786
|
-
`,zy=({label:e,caption:t,placeholder:n,errorMessage:r,required:o,disabled:i,size:s="default",defaultValue:
|
|
1786
|
+
`,zy=({label:e,caption:t,placeholder:n,errorMessage:r,required:o,disabled:i,size:s="default",showOptionalLabel:a=!0,defaultValue:l="",onChange:d,minLength:u,maxLength:h,labels:p,...f})=>{const m=qm("Textarea",p),[g,v]=le(l),[b,y]=le(!1),[w,C]=le(!1),[x,k]=le(""),$=he(),S=he(),M=he();de((()=>{const{length:e}=l;u&&e<u&&e>0?(y(e<u),C(!1),k(m.enterAtLeastChars(u-e))):u&&0===e&&k(m.minChars(u)),h&&e>0?(y(!1),C(e>h),k(m.charsRemaining(h-e))):h&&0===e&&k(m.maxChars(h))}),[]);const T=!!r||b||w,O=[t?$:null,T?S:null,x?M:null].filter(Boolean).join(" ")||void 0;return be("div",{css:Ly(s),children:[T?ye("div",{css:Ay}):null,be(c.Root,{required:o,invalid:T,gap:"0",style:{marginLeft:T?"1.1875rem":"0px"},children:[e?be(c.Label,{css:Ry(s,i),"aria-label":e,children:[ye(c.RequiredIndicator,{"aria-label":m.requiredSymbolLabel}),e,!o&&a?ye("span",{children:m.optionalSuffix}):null]}):null,t?ye(c.HelperText,{id:$,css:Ny(s,i),children:t}):null,r?ye(c.ErrorText,{id:S,css:Py,"aria-label":`${m.errorPrefix} ${r}`,"aria-live":"polite",children:r}):null,ye(E,{placeholder:n,disabled:i,css:Iy(s,g,l),onChange:e=>{v(e.target.value);const{length:t}=e.target.value;u&&h?(y(t<u),C(t>h),k(m.charsRemaining(h-t))):u?(y(t<u),C(!1),k(t<u?m.enterAtLeastChars(u-t):"")):h&&(C(t>h),y(!1),k(m.charsRemaining(h-t))),d&&d(e)},value:g,"aria-label":e||n,"aria-describedby":O,_placeholder:{color:"var(--chakra-colors-neutral-500)"},...f}),b&&u?ye(c.ErrorText,{id:S,css:Py,style:{marginTop:"0.5rem",fontSize:"0.75rem",lineHeight:"1rem"},"aria-live":"polite",children:m.needMoreChars(u-g.length)}):null,w&&h?ye(c.ErrorText,{id:S,css:Py,style:{marginTop:"0.5rem",fontSize:"0.75rem",lineHeight:"1rem"},"aria-live":"polite",children:m.tooManyChars(g.length-h)}):null,!x||w||b?null:ye(c.HelperText,{id:M,css:Dy,"aria-live":"polite",children:x})]})]})},Vy=({label:e,required:t,caption:n,errorMessage:r,size:o,disabled:i,showOptionalLabel:s=!0,placeholder:l,labels:d,noMarginBottom:u,initialItems:h=[],multiple:p=!1,showSelectedItems:f=!1})=>{const[m,g]=le([]),v=qm("Combobox",d),{contains:b}=T({sensitivity:"base"}),{collection:y,filter:w}=O({initialItems:h,filter:b});return be("div",{css:cv(o,u),className:"ds-text-input-container",children:[r?ye("div",{css:dv}):null,be(c.Root,{required:t,invalid:!!r,gap:"0",style:{marginLeft:r?"1.1875rem":"0px"},children:[e?be(c.Label,{css:uv(o,i),"aria-label":e,children:[ye(c.RequiredIndicator,{"aria-label":v.requiredSymbolLabel}),e,!t&&s?ye("span",{children:v.optionalSuffix}):null]}):null,n?ye(c.HelperText,{css:hv(o,i),"aria-label":n,children:n}):null,r?ye(c.ErrorText,{css:pv(o),"aria-label":r,children:r}):null,be(L.Root,{multiple:p,onValueChange:e=>{g(e.items.map((e=>({label:e.label,value:e.value}))))},value:m.map((e=>e.value)),collection:y,onInputValueChange:e=>w(e.inputValue),width:"20rem",size:"small"===o?"sm":"md",children:[be(L.Control,{children:[ye(L.Input,{placeholder:l,css:fv(o),disabled:i,"aria-label":e||l||v.defaultInputAriaLabel}),be(L.IndicatorGroup,{children:[ye(L.ClearTrigger,{"aria-label":v.clearSelectionLabel}),ye(L.Trigger,{"aria-label":v.toggleOptionsLabel})]})]}),ye(a,{children:ye(L.Positioner,{children:be(L.Content,{children:[ye(L.Empty,{children:v.noItemsFoundLabel}),y.items.map((e=>be(L.Item,{item:e,children:[e.label,ye(L.ItemIndicator,{})]},e.value)))]})})}),ye("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"0.25rem",paddingTop:"0.5rem"},children:f&&m.map((e=>ye(iy,{label:e.label,variant:"info-white",onClose:()=>g((t=>t.filter((t=>t.value!==e.value)))),closable:!0},e.value)))})]})]})]})},Hy=(e,t)=>$e`
|
|
1787
1787
|
height: ${e};
|
|
1788
1788
|
width: ${t};
|
|
1789
1789
|
border: ${je(100)} solid ${ze("neutral",300)};
|