@worldresources/wri-design-systems 2.138.6 → 2.138.7
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 +2 -1
- package/dist/index.esm.js +2 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -3218,6 +3218,8 @@ function yc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
|
|
|
3218
3218
|
[data-rsbs-overlay] {
|
|
3219
3219
|
border-top-left-radius: 16px;
|
|
3220
3220
|
border-top-right-radius: 16px;
|
|
3221
|
+
overflow: hidden;
|
|
3222
|
+
z-index: 1000;
|
|
3221
3223
|
}
|
|
3222
3224
|
|
|
3223
3225
|
[data-rsbs-overlay],
|
|
@@ -3240,6 +3242,5 @@ function yc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
|
|
|
3240
3242
|
[data-rsbs-footer] {
|
|
3241
3243
|
padding: 0px;
|
|
3242
3244
|
min-height: 64px;
|
|
3243
|
-
background-color: ${d("neutral",100)};
|
|
3244
3245
|
}
|
|
3245
3246
|
`),className:p,open:o,onDismiss:a,header:e,footer:i,snapPoints:({headerHeight:e,maxHeight:t,footerHeight:n})=>[20,s||e,l+(i?n:0),c||t-t/6],defaultSnap:({headerHeight:e,maxHeight:t,footerHeight:n})=>{let r=20;return"minimized"===u?r=s||e:"mid"===u?r=l+(i?n:0):"full"===u&&(r=c||t-t/6),r},children:n});var h},exports.Slider=qe,exports.SliderInput=({label:e,caption:r,size:i="default",sliderItem:o,required:a,onChange:s})=>{const[l,c]=n.useState(o.value||[]),u=(e,t)=>{const n=e.target.value,r=[...l];let i=n?parseInt(n,10):n;const a=o.min||0,s=o.max||100;i=Number.isNaN(i)?a:i,i=i<a?a:i,i=i>s?s:i,r[t]=i,c(r)},d=(e,t)=>{const n=e.target.value||"0",r=[...l];let i=parseInt(n,10);const a=o.min||0,u=o.max||100;if(i=Number.isNaN(i)?a:i,i=i<a?a:i,i=i>u?u:i,2===l?.length){i=Number.isNaN(i)?a:i;const e=l[0],n=l[1];0===t?(i=i<a?a:i,i=i>n?n:i):1===t&&(i=i<e?e:i,i=i>u?u:i)}r[t]=i,c(r),s&&s(r)};return t.jsxs("div",{children:[t.jsxs("p",{css:en(i),"aria-label":e,children:[a?t.jsx("span",{children:"*"}):null,e]}),r?t.jsx("p",{css:tn(i),"aria-label":r,children:r}):null,t.jsxs("div",{css:nn,children:[o.step&&o.marks?t.jsx(zt,{items:o.marks.map((e=>({label:`${e.label}`,value:`${e.value}`}))),placeholder:"",style:{width:"90px"},value:[`${l?.[0]}`],onChange:e=>{const t=e.map((e=>parseInt(e,10)));c(t),s&&s(t)}}):t.jsx(ht,{"aria-label":e,min:o.min,max:o.max,value:l?.[0],type:"number",onChange:e=>u(e,0),onBlur:e=>d(e,0),className:"opacity-control-text-input",onClick:e=>e.target.select()}),t.jsx(qe,{css:{},...o,value:l,onValueChangeEnd:e=>{c(e.value),s&&s(e.value)}}),2===l?.length?t.jsx(ht,{"aria-label":e,min:o.min,max:o.max,value:l?.[1],type:"number",onChange:e=>u(e,1),onBlur:e=>d(e,1),className:"opacity-control-text-input",onClick:e=>e.target.select()}):null]})]})},exports.StepProgressIndicator=({steps:e,currentStep:n})=>t.jsxs("div",{css:np,children:[e.map(((e,r)=>t.jsxs("div",{css:rp,children:[t.jsx("button",{css:ip(n>=r+1,n<r+1),type:"button",onClick:e.onClick,"aria-current":n===r+1,"aria-disabled":n<r+1,disabled:n<r+1,"aria-label":`Current Step ${r}${e.label?` ${e.label}`:""}`,"data-active":n>=r+1,children:n>r+1?t.jsx(y,{height:"16px",width:"16px"}):r+1}),e.label?t.jsx("p",{css:op(n===r+1),children:e.label}):null]},`${e.label}-${r}`))),t.jsx("div",{css:ap,children:t.jsx("div",{css:sp})})]}),exports.Switch=Ue,exports.TabBar=({variant:r="panel",defaultValue:i,tabs:o,onTabClick:a})=>{const[s,l]=n.useState(Id(o,i)||0),c="view"===r;return t.jsx("div",{css:Td(r),children:t.jsx(e.Tabs.Root,{width:"full",defaultValue:i||o?.[0]?.value,onValueChange:({value:e})=>{return l(Id(o,t=e)),void(a&&a(t));var t},children:t.jsx(e.Tabs.List,{alignItems:"center",border:"none",children:o.map(((r,i)=>t.jsxs(n.Fragment,{children:[c&&1===i&&"left"===Nd(s)?t.jsx("div",{css:Md}):null,t.jsx(e.Tabs.Trigger,{css:[_d,c?Dd:Pd],"aria-label":r["aria-label"]||r.label,...r,children:t.jsxs(e.Box,{display:"flex",alignItems:"center",gap:"5px",children:[r.icon,r.label]})},r.label),c&&1===i&&"right"===Nd(s)?t.jsx("div",{css:Md}):null]},r.label)))})})})},exports.Table=({columns:r,data:i,renderRow:o,striped:a,stickyHeader:s,pagination:l,selectable:c,selectedRows:u,onSortColumn:d,onPageSizeChange:p,onPageChange:h,onAllItemsSelected:f})=>{const[x,g]=n.useState({key:"",order:""}),{totalItems:v=i.length,currentPage:m=1,pageSize:b=10,showItemCount:y,showItemCountText:C}=l||{},w=(e,t)=>{g({key:e,order:t}),d&&d({key:e,order:t})},k=u?.length===i?.length,S=u&&u.length>0&&!k;return t.jsxs("div",{children:[t.jsxs(e.Table.Root,{css:kr,striped:a,stickyHeader:s,interactive:!0,children:[t.jsx(e.Table.Header,{css:Sr,children:t.jsxs(e.Table.Row,{children:[c?t.jsx(e.Table.ColumnHeader,{children:t.jsx(Ce,{name:"header-checkbox",checked:k,indeterminate:S,onCheckedChange:({checked:e})=>{f&&f(e)}})}):null,r.map((n=>t.jsx(e.Table.ColumnHeader,{role:n.sortable?"columnheader":void 0,"aria-sort":n.sortable&&"asc"===x.order?"ascending":n.sortable&&"desc"===x.order?"descending":void 0,children:t.jsxs("div",{css:$r,children:[n.label,n.sortable?t.jsxs("div",{css:Er,children:[t.jsx(Q,{css:Or(x.key===n.key&&"asc"===x.order),icon:t.jsx(j,{style:{transform:"rotate(180deg)"}}),onClick:()=>w(n.key,"asc"),"aria-label":"Ascending"}),t.jsx(Q,{css:Or(x.key===n.key&&"desc"===x.order),icon:t.jsx(j,{}),onClick:()=>w(n.key,"desc"),"aria-label":"Descending"})]}):null]})},n.key)))]})}),t.jsx(e.Table.Body,{children:i.map((e=>t.jsx(n.Fragment,{children:o(e)},e.id)))})]}),t.jsxs("div",{css:Rr,children:[t.jsx("div",{children:y?t.jsx(ur,{pageSize:b,currentPage:m,totalItems:v,onPageSizeChange:p,showItemCountText:C}):null}),l?t.jsx("div",{css:Lr,children:t.jsx(jr,{totalItems:v,pageSize:b,currentPage:m,onPageChange:h})}):null]})]})},exports.TableCell=_r,exports.TableRow=Tr,exports.Tag=It,exports.TextInput=ht,exports.Textarea=({label:r,caption:i,placeholder:o,errorMessage:a,required:s,disabled:l,size:c="default",defaultValue:u="",onChange:d,minLength:p,maxLength:h,...f})=>{const[x,g]=n.useState(u),[v,m]=n.useState(!1),[b,y]=n.useState(!1),[C,w]=n.useState(""),j=n.useId(),k=n.useId(),S=n.useId();n.useEffect((()=>{const{length:e}=u;p&&e<p&&e>0?(m(e<p),y(!1),w(`Enter at least ${p-e} characters`)):p&&0===e&&w(`Min ${p} characters`),h&&e>0?(m(!1),y(e>h),w(`You have ${h-e} characters remaining`)):h&&0===e&&w(`Max ${h} characters`)}),[]);const $=!!a||v||b,E=[i?j:null,$?k:null,C?S:null].filter(Boolean).join(" ")||void 0;return t.jsxs("div",{css:rn(c),children:[$?t.jsx("div",{css:on}):null,t.jsxs(e.Field.Root,{required:s,invalid:$,gap:"0",style:{marginLeft:$?"19px":"0px"},children:[r?t.jsxs(e.Field.Label,{css:an(c,l),"aria-label":r,children:[t.jsx(e.Field.RequiredIndicator,{"aria-label":"required"}),r,s?"":t.jsx("span",{children:" (Optional)"})]}):null,i?t.jsx(e.Field.HelperText,{id:j,css:sn(c,l),children:i}):null,a?t.jsx(e.Field.ErrorText,{id:k,css:cn,"aria-label":`Error: ${a}`,"aria-live":"polite",children:a}):null,t.jsx(e.Textarea,{placeholder:o,disabled:l,css:un(c,x,u),onChange:e=>{g(e.target.value);const{length:t}=e.target.value;p&&h?(m(t<p),y(t>h),w(`You have ${h-t} characters remaining`)):p?(m(t<p),y(!1),w(t<p?`Enter at least ${p-t} characters`:"")):h&&(y(t>h),m(!1),w(`You have ${h-t} characters remaining`)),d&&d(e)},value:x,"aria-describedby":E,_placeholder:{color:"var(--chakra-colors-neutral-500)"},...f}),v&&p?t.jsxs(e.Field.ErrorText,{id:k,css:cn,style:{marginTop:"8px",fontSize:"12px",lineHeight:"16px"},"aria-live":"polite",children:["You need ",p-x.length," more characters"]}):null,b&&h?t.jsxs(e.Field.ErrorText,{id:k,css:cn,style:{marginTop:"8px",fontSize:"12px",lineHeight:"16px"},"aria-live":"polite",children:["You have ",x.length-h," characters too many"]}):null,!C||b||v?null:t.jsx(e.Field.HelperText,{id:S,css:ln,"aria-live":"polite",children:C})]})]})},exports.Toast=()=>Object.keys(fp).map((n=>t.jsx(e.Portal,{children:t.jsx(e.Toaster,{toaster:fp[n],insetInline:{mdDown:"4"},children:r=>t.jsxs(e.Toast.Root,{css:lp,width:{md:"sm"},children:[t.jsxs(e.Stack,{flexDirection:"row",className:"icon-container",children:["info"===r.type?r.meta?.icon?r.meta.icon:t.jsx(w,{color:"var(--chakra-colors-neutral-700)"}):null,"loading"===r.type?t.jsx(e.Spinner,{size:"lg",borderWidth:"3px",color:"var(--chakra-colors-primary-500)"}):null,"success"===r.type?r.meta?.icon?r.meta.icon:t.jsx(R,{color:"var(--chakra-colors-success-500)"}):null,"warning"===r.type?r.meta?.icon?r.meta.icon:t.jsx(L,{color:"var(--chakra-colors-warning-500)"}):null,"error"===r.type?r.meta?.icon?r.meta.icon:t.jsx(T,{color:"var(--chakra-colors-error-500)"}):null,t.jsxs(e.Stack,{gap:"1",flex:"1",maxWidth:"100%",children:[t.jsx(e.Toast.Title,{css:cp,"aria-label":`${r.title}`,children:r.title}),r.description?t.jsx(e.Toast.Title,{css:up,"aria-label":`${r.description}`,children:r.description}):null]})]}),r.action||r.meta?.closable?t.jsxs(e.Stack,{flexDirection:"row",children:[r.action?t.jsx(v,{css:dp,label:r.action.label,size:"small",variant:"info"===r.type?"primary":"secondary",onClick:()=>{r?.action?.onClick&&r.action.onClick(),fp[n].dismiss()}}):null,r.meta?.closable?t.jsx(v,{css:pp,label:r.meta.closableLabel,"aria-label":r.meta?.closableLabel||"Dismiss",leftIcon:t.jsx(S,{height:"10px!",width:"10px!"}),size:"small",variant:"secondary",onClick:()=>fp[n].dismiss()}):null]}):null]})})},n))),exports.designSystemStyles=u,exports.getThemedColor=d,exports.showToast=e=>{fp[e.placement].create({title:e.label,description:e.caption,duration:e.duration||5e3,meta:{closable:e.closable,icon:e.icon,closableLabel:e.closableLabel},...e})};
|
package/dist/index.esm.js
CHANGED
|
@@ -2296,6 +2296,8 @@ function Bd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
|
|
|
2296
2296
|
[data-rsbs-overlay] {
|
|
2297
2297
|
border-top-left-radius: 16px;
|
|
2298
2298
|
border-top-right-radius: 16px;
|
|
2299
|
+
overflow: hidden;
|
|
2300
|
+
z-index: 1000;
|
|
2299
2301
|
}
|
|
2300
2302
|
|
|
2301
2303
|
[data-rsbs-overlay],
|
|
@@ -2318,7 +2320,6 @@ function Bd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
|
|
|
2318
2320
|
[data-rsbs-footer] {
|
|
2319
2321
|
padding: 0px;
|
|
2320
2322
|
min-height: 64px;
|
|
2321
|
-
background-color: ${he("neutral",100)};
|
|
2322
2323
|
}
|
|
2323
2324
|
`),className:c,open:r,onDismiss:i,header:e,footer:n,snapPoints:({headerHeight:e,maxHeight:t,footerHeight:r})=>[20,o||e,a+(n?r:0),l||t-t/6],defaultSnap:({headerHeight:e,maxHeight:t,footerHeight:r})=>{let i=20;return"minimized"===s?i=o||e:"mid"===s?i=a+(n?r:0):"full"===s&&(i=l||t-t/6),i},children:t});var d},yp=ie`
|
|
2324
2325
|
a,
|