@worldresources/wri-design-systems 2.136.3 → 2.137.1
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 +8 -14
- package/dist/index.d.ts +1 -3
- package/dist/index.esm.js +8 -14
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -2156,7 +2156,7 @@
|
|
|
2156
2156
|
`,zo=(e,t)=>r.css`
|
|
2157
2157
|
height: ${((e,t)=>e&&t?`calc(100% - ${e+t}px)`:e?`calc(100% - ${e}px)`:t?`calc(100% - ${t}px)`:"100%")(e,t)};
|
|
2158
2158
|
width: 100%;
|
|
2159
|
-
overflow-y:
|
|
2159
|
+
overflow-y: auto;
|
|
2160
2160
|
`,Po=r.css`
|
|
2161
2161
|
min-height: 64px;
|
|
2162
2162
|
width: 100%;
|
|
@@ -2268,7 +2268,7 @@
|
|
|
2268
2268
|
`,Uo=(e,t)=>r.css`
|
|
2269
2269
|
min-height: 56px;
|
|
2270
2270
|
width: 100vw;
|
|
2271
|
-
position: ${e?"
|
|
2271
|
+
position: ${e?"sticky":"absolute"};
|
|
2272
2272
|
bottom: 0;
|
|
2273
2273
|
left: 0;
|
|
2274
2274
|
background-color: ${t?p("neutral",200):"transparent"};
|
|
@@ -2318,7 +2318,7 @@
|
|
|
2318
2318
|
height: ${e?"96px":"48px"};
|
|
2319
2319
|
width: 100%;
|
|
2320
2320
|
background-color: ${p("neutral",100)};
|
|
2321
|
-
position: ${t?"
|
|
2321
|
+
position: ${t?"sticky":"absolute"};
|
|
2322
2322
|
top: 0;
|
|
2323
2323
|
left: 0;
|
|
2324
2324
|
z-index: 102;
|
|
@@ -2574,13 +2574,10 @@
|
|
|
2574
2574
|
button {
|
|
2575
2575
|
width: calc(48% - 24px);
|
|
2576
2576
|
}
|
|
2577
|
-
`,Ci=({navigationSection:e,utilitySection:r,actionsSection:n,linkRouter:i,isOpen:l,setIsOpen:a,pathname:s})=>{const[c,d]=o.useState(void 0),[p,u]=o.useState(-1),x=o.useRef(null),h=o.useRef([]),g=i;return t.jsxs(t.Fragment,{children:[t.jsx("div",{css:si(l),children:l&&t.jsxs("div",{css:ci,children:[t.jsxs("div",{style:{overflowY:"scroll",width:"100%",height:"100%",paddingBottom:"72px"},children:[r?t.jsx("div",{css:di,children:r?.map((e=>t.jsx("div",{className:"utility-item",children:e})))}):null,e?t.jsx("div",{css:pi,children:e.map(((e,r)=>e.link?t.jsx(g,{to:e.link,href:e.link,onClick:()=>{d(void 0),u(-1),a(!1)},css:xi(s===e.link),children:e.label},e.label):t.jsxs("button",{css:hi,type:"button",ref:e=>h.current[r]=e,onClick:()=>{e.items&&(d(e),u(r),setTimeout((()=>{x.current?.focus()}),100))},children:[e.label,e.items?t.jsx(y,{rotate:"270",color:"var(--chakra-colors-neutral-700)"}):null]},e.label)))}):null]}),n?t.jsx("div",{css:bi,children:n.map((e=>t.jsx(b,{label:e.label,onClick:()=>{e?.onClick?.(),d(void 0),u(-1),a(!1)}},e.label)))}):null]})}),t.jsx("div",{css:gi(!!c?.items),children:c?.items?t.jsxs(t.Fragment,{children:[t.jsxs("div",{css:fi,children:[t.jsxs("button",{type:"button",onClick:()=>{d(void 0),u(-1),h.current[p]?.focus()},"aria-label":"Go back",css:ai,ref:x,children:[t.jsx(y,{rotate:"90",color:"var(--chakra-colors-neutral-700)"}),c?.label]}),t.jsxs("button",{type:"button",onClick:()=>{d(void 0),u(-1),a(!1)},"aria-label":"Close menu",css:ai,children:["Close",t.jsx(k,{height:"16px",width:"16px"})]})]}),t.jsx("div",{css:ui,children:c?.items?.map((e=>t.jsx(g,{to:e.link,href:e.link,css:xi(),onClick:()=>{d(void 0),u(-1),a(!1)},children:e.label},e.label)))})]}):null})]})},mi=1023,vi=
|
|
2577
|
+
`,Ci=({navigationSection:e,utilitySection:r,actionsSection:n,linkRouter:i,isOpen:l,setIsOpen:a,pathname:s})=>{const[c,d]=o.useState(void 0),[p,u]=o.useState(-1),x=o.useRef(null),h=o.useRef([]),g=i;return t.jsxs(t.Fragment,{children:[t.jsx("div",{css:si(l),children:l&&t.jsxs("div",{css:ci,children:[t.jsxs("div",{style:{overflowY:"scroll",width:"100%",height:"100%",paddingBottom:"72px"},children:[r?t.jsx("div",{css:di,children:r?.map((e=>t.jsx("div",{className:"utility-item",children:e})))}):null,e?t.jsx("div",{css:pi,children:e.map(((e,r)=>e.link?t.jsx(g,{to:e.link,href:e.link,onClick:()=>{d(void 0),u(-1),a(!1)},css:xi(s===e.link),children:e.label},e.label):t.jsxs("button",{css:hi,type:"button",ref:e=>h.current[r]=e,onClick:()=>{e.items&&(d(e),u(r),setTimeout((()=>{x.current?.focus()}),100))},children:[e.label,e.items?t.jsx(y,{rotate:"270",color:"var(--chakra-colors-neutral-700)"}):null]},e.label)))}):null]}),n?t.jsx("div",{css:bi,children:n.map((e=>t.jsx(b,{label:e.label,onClick:()=>{e?.onClick?.(),d(void 0),u(-1),a(!1)}},e.label)))}):null]})}),t.jsx("div",{css:gi(!!c?.items),children:c?.items?t.jsxs(t.Fragment,{children:[t.jsxs("div",{css:fi,children:[t.jsxs("button",{type:"button",onClick:()=>{d(void 0),u(-1),h.current[p]?.focus()},"aria-label":"Go back",css:ai,ref:x,children:[t.jsx(y,{rotate:"90",color:"var(--chakra-colors-neutral-700)"}),c?.label]}),t.jsxs("button",{type:"button",onClick:()=>{d(void 0),u(-1),a(!1)},"aria-label":"Close menu",css:ai,children:["Close",t.jsx(k,{height:"16px",width:"16px"})]})]}),t.jsx("div",{css:ui,children:c?.items?.map((e=>t.jsx(g,{to:e.link,href:e.link,css:xi(),onClick:()=>{d(void 0),u(-1),a(!1)},children:e.label},e.label)))})]}):null})]})},mi=1023,vi=r.css`
|
|
2578
2578
|
width: 64px;
|
|
2579
|
-
height:
|
|
2579
|
+
height: 100%;
|
|
2580
2580
|
z-index: 100;
|
|
2581
|
-
position: fixed;
|
|
2582
|
-
top: ${e||"0px"};
|
|
2583
|
-
left: 0;
|
|
2584
2581
|
border-right: 1px solid ${p("neutral",300)};
|
|
2585
2582
|
background-color: ${p("neutral",200)};
|
|
2586
2583
|
display: flex;
|
|
@@ -2727,13 +2724,10 @@
|
|
|
2727
2724
|
text-align: center;
|
|
2728
2725
|
color: ${p("neutral",600)};
|
|
2729
2726
|
}
|
|
2730
|
-
`,$i=
|
|
2727
|
+
`,$i=r.css`
|
|
2731
2728
|
width: 320px;
|
|
2732
|
-
height:
|
|
2729
|
+
height: 100%;
|
|
2733
2730
|
z-index: 100;
|
|
2734
|
-
position: fixed;
|
|
2735
|
-
top: ${e||"0px"};
|
|
2736
|
-
left: 64px;
|
|
2737
2731
|
box-shadow: 2px 0px 2px 0px #0000000d;
|
|
2738
2732
|
background-color: ${p("neutral",100)};
|
|
2739
2733
|
overflow-y: auto;
|
|
@@ -3160,7 +3154,7 @@
|
|
|
3160
3154
|
justify-content: flex-start;
|
|
3161
3155
|
gap: 12px;
|
|
3162
3156
|
color: ${p("neutral",M?100:900)};
|
|
3163
|
-
`),ref:x,children:[e?t.jsx("div",{ref:g,css:ti,children:e}):null,t.jsx("div",{css:ri(f),children:l?.map((e=>e.link?t.jsx(S,{to:e.link,href:e.link,css:ni(i===e.link),children:e.label},e.label):t.jsx(xe,{label:e.label,items:e.items||[]},e.label)))})]}),t.jsx("div",{css:oi,ref:h,children:w?t.jsxs("button",{type:"button",onClick:()=>$(!y),"aria-label":"Open menu",css:ai,children:[y?"Close":"Menu",y?t.jsx(k,{height:"16px",width:"16px"}):t.jsx(U,{height:"16px",width:"16px"})]}):t.jsxs(t.Fragment,{children:[t.jsx("div",{css:oi,children:a?.map(((e,r)=>t.jsx("div",{css:ii(f),children:e},r)))}),s?t.jsx("div",{css:li(f),children:s.map((e=>t.jsx(b,{...e},e.label)))}):null]})})]}),f&&!w?t.jsx("div",{css:Qo,children:l?.map((e=>e.link?t.jsx(S,{to:e.link,href:e.link,css:ni(i===e.link),children:e.label},e.label):t.jsx(xe,{label:e.label,items:e.items||[]},e.label)))}):null,w?t.jsx(Ci,{navigationSection:l,utilitySection:a,actionsSection:s,linkRouter:n,isOpen:y,setIsOpen:$,pathname:i}):null]});var M},exports.NavigationRail=({tabs:r=[],defaultValue:n,onTabClick:i,children:l,onOpenChange:a
|
|
3157
|
+
`),ref:x,children:[e?t.jsx("div",{ref:g,css:ti,children:e}):null,t.jsx("div",{css:ri(f),children:l?.map((e=>e.link?t.jsx(S,{to:e.link,href:e.link,css:ni(i===e.link),children:e.label},e.label):t.jsx(xe,{label:e.label,items:e.items||[]},e.label)))})]}),t.jsx("div",{css:oi,ref:h,children:w?t.jsxs("button",{type:"button",onClick:()=>$(!y),"aria-label":"Open menu",css:ai,children:[y?"Close":"Menu",y?t.jsx(k,{height:"16px",width:"16px"}):t.jsx(U,{height:"16px",width:"16px"})]}):t.jsxs(t.Fragment,{children:[t.jsx("div",{css:oi,children:a?.map(((e,r)=>t.jsx("div",{css:ii(f),children:e},r)))}),s?t.jsx("div",{css:li(f),children:s.map((e=>t.jsx(b,{...e},e.label)))}):null]})})]}),f&&!w?t.jsx("div",{css:Qo,children:l?.map((e=>e.link?t.jsx(S,{to:e.link,href:e.link,css:ni(i===e.link),children:e.label},e.label):t.jsx(xe,{label:e.label,items:e.items||[]},e.label)))}):null,w?t.jsx(Ci,{navigationSection:l,utilitySection:a,actionsSection:s,linkRouter:n,isOpen:y,setIsOpen:$,pathname:i}):null]});var M},exports.NavigationRail=({tabs:r=[],defaultValue:n,onTabClick:i,children:l,onOpenChange:a})=>{const[s,c]=o.useState(!1),[d,p]=o.useState(n||r?.[0]?.value);return t.jsxs("div",{style:{height:"calc(100vh - 48px - 56px)",position:"fixed",top:"48px",left:0,display:"flex"},children:[t.jsxs("div",{css:vi,children:[t.jsx(e.Tabs.Root,{defaultValue:n||r?.[0]?.value,orientation:"horizontal",width:"full",onValueChange:({value:e})=>{var t;p(t=e),i&&i(t)},role:"tablist",children:t.jsx(e.Tabs.List,{alignItems:"center",border:"none",style:{flexDirection:"column"},children:r.map((r=>t.jsx(e.Tabs.Trigger,{css:wi,"aria-label":r["aria-label"]||r.label,...r,children:t.jsxs(e.Box,{display:"flex",alignItems:"center",flexDirection:"column",gap:"5px",className:"tab-label",children:[r.icon?t.jsx("div",{css:ji,children:r.icon}):null,t.jsx("p",{children:r.label})]})},r.label)))})}),l?t.jsx(e.Collapsible.Root,{onOpenChange:({open:e})=>{c(e),a&&a(!e)},children:t.jsxs(e.Collapsible.Trigger,{css:yi,children:[t.jsx("div",{css:ji,children:s?t.jsx(m,{}):t.jsx(C,{})}),t.jsxs("div",{className:"tab-label",children:[t.jsx("p",{children:s?"Show":"Hide"}),t.jsx("p",{children:"Sidebar"})]})]})}):null]}),l?t.jsx(e.Collapsible.Root,{defaultOpen:!0,open:!s,children:t.jsx(e.Collapsible.Content,{height:"100%",children:t.jsx("div",{css:$i,role:"tabpanel","aria-labelledby":d,children:l})})}):null]})},exports.OptionCard=({defaultValue:n,items:o,onValueChange:i})=>t.jsx(e.RadioCard.Root,{defaultValue:n,onValueChange:i,children:t.jsx(e.HStack,{alignItems:"flex-start",flexWrap:"wrap",gap:"12px",children:o.map((n=>{return t.jsxs(e.RadioCard.Item,{css:Se,value:n.value,disabled:n.disabled,children:[t.jsx(e.RadioCard.ItemHiddenInput,{}),t.jsxs(e.RadioCard.ItemControl,{css:Le,children:[t.jsxs("div",{css:(i=n.variant,r.css`
|
|
3164
3158
|
width: 100%;
|
|
3165
3159
|
display: flex;
|
|
3166
3160
|
flex-direction: ${"centered"===i?"column":"row"};
|
package/dist/index.d.ts
CHANGED
|
@@ -656,11 +656,9 @@ type NavigationRailProps = {
|
|
|
656
656
|
onTabClick?: (selectedValue: string) => void;
|
|
657
657
|
children?: React.ReactNode;
|
|
658
658
|
onOpenChange?: (open: boolean) => void;
|
|
659
|
-
navbarHeight?: string;
|
|
660
|
-
footerHeight?: string;
|
|
661
659
|
};
|
|
662
660
|
|
|
663
|
-
declare const NavigationRail: ({ tabs, defaultValue, onTabClick, children, onOpenChange,
|
|
661
|
+
declare const NavigationRail: ({ tabs, defaultValue, onTabClick, children, onOpenChange, }: NavigationRailProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
664
662
|
|
|
665
663
|
type PaginationProps = {
|
|
666
664
|
currentPage: number;
|
package/dist/index.esm.js
CHANGED
|
@@ -2236,7 +2236,7 @@ import{createSystem as e,defaultConfig as t,Button as r,Box as n,Spinner as o,Ic
|
|
|
2236
2236
|
`,Gi=(e,t)=>F`
|
|
2237
2237
|
height: ${((e,t)=>e&&t?`calc(100% - ${e+t}px)`:e?`calc(100% - ${e}px)`:t?`calc(100% - ${t}px)`:"100%")(e,t)};
|
|
2238
2238
|
width: 100%;
|
|
2239
|
-
overflow-y:
|
|
2239
|
+
overflow-y: auto;
|
|
2240
2240
|
`,Ki=F`
|
|
2241
2241
|
min-height: 64px;
|
|
2242
2242
|
width: 100%;
|
|
@@ -2348,7 +2348,7 @@ import{createSystem as e,defaultConfig as t,Button as r,Box as n,Spinner as o,Ic
|
|
|
2348
2348
|
`,cl=({links:e,separator:t,maxItems:r=99,linkRouter:n})=>{const[o,i]=X(e.length>r);G((()=>{i(e.length>r)}),[e.length]);const l=n;return N(I.Root,{children:N(I.List,{gap:"16px",children:o?B(Z,{children:[N(I.Item,{css:al,children:B(l,{to:e[0].link,href:e[0].link,children:[e[0].icon,e[0].label]})}),N(I.Separator,{css:sl,children:t||N(me,{rotate:"270"})}),N("li",{className:"chakra-breadcrumb__item",children:N("button",{css:dl,type:"button",onClick:()=>i(!1),children:"..."})}),N(I.Separator,{css:sl,children:t||N(me,{rotate:"270"})}),N(I.Item,{css:al,children:B("p",{"aria-current":"page","aria-label":e[e.length-1].label,children:[e[e.length-1].icon,e[e.length-1].label]})})]}):e.map(((r,n)=>r?.label?B(ee,{children:[N(I.Item,{css:al,children:n<e.length-1?B(l,{to:r.link,href:r.link,children:[r.icon,r.label]}):B("p",{"aria-current":"page","aria-label":r.label,children:[r.label&&r.icon?r.icon:"",r.label]})}),n<e.length-1?N(I.Separator,{css:sl,children:t||N(me,{rotate:"270"})}):null]},r.label):null))})})},pl=(e,t)=>F`
|
|
2349
2349
|
min-height: 56px;
|
|
2350
2350
|
width: 100vw;
|
|
2351
|
-
position: ${e?"
|
|
2351
|
+
position: ${e?"sticky":"absolute"};
|
|
2352
2352
|
bottom: 0;
|
|
2353
2353
|
left: 0;
|
|
2354
2354
|
background-color: ${t?le("neutral",200):"transparent"};
|
|
@@ -2398,7 +2398,7 @@ import{createSystem as e,defaultConfig as t,Button as r,Box as n,Spinner as o,Ic
|
|
|
2398
2398
|
height: ${e?"96px":"48px"};
|
|
2399
2399
|
width: 100%;
|
|
2400
2400
|
background-color: ${le("neutral",100)};
|
|
2401
|
-
position: ${t?"
|
|
2401
|
+
position: ${t?"sticky":"absolute"};
|
|
2402
2402
|
top: 0;
|
|
2403
2403
|
left: 0;
|
|
2404
2404
|
z-index: 102;
|
|
@@ -2660,13 +2660,10 @@ import{createSystem as e,defaultConfig as t,Button as r,Box as n,Spinner as o,Ic
|
|
|
2660
2660
|
justify-content: flex-start;
|
|
2661
2661
|
gap: 12px;
|
|
2662
2662
|
color: ${le("neutral",y?100:900)};
|
|
2663
|
-
`),ref:d,children:[e?N("div",{ref:p,css:Cl,children:e}):null,N("div",{css:vl(u),children:n?.map((e=>e.link?N(v,{to:e.link,href:e.link,css:wl(r===e.link),children:e.label},e.label):N(st,{label:e.label,items:e.items||[]},e.label)))})]}),N("div",{css:yl,ref:c,children:f?B("button",{type:"button",onClick:()=>C(!m),"aria-label":"Open menu",css:Ll,children:[m?"Close":"Menu",N(m?ve:Fe,{height:"16px",width:"16px"})]}):B(Z,{children:[N("div",{css:yl,children:o?.map(((e,t)=>N("div",{css:$l(u),children:e},t)))}),i?N("div",{css:kl(u),children:i.map((e=>N(ue,{...e},e.label)))}):null]})})]}),u&&!f?N("div",{css:bl,children:n?.map((e=>e.link?N(v,{to:e.link,href:e.link,css:wl(r===e.link),children:e.label},e.label):N(st,{label:e.label,items:e.items||[]},e.label)))}):null,f?N(jl,{navigationSection:n,utilitySection:o,actionsSection:i,linkRouter:t,isOpen:m,setIsOpen:C,pathname:r}):null]});var y},Ol=
|
|
2663
|
+
`),ref:d,children:[e?N("div",{ref:p,css:Cl,children:e}):null,N("div",{css:vl(u),children:n?.map((e=>e.link?N(v,{to:e.link,href:e.link,css:wl(r===e.link),children:e.label},e.label):N(st,{label:e.label,items:e.items||[]},e.label)))})]}),N("div",{css:yl,ref:c,children:f?B("button",{type:"button",onClick:()=>C(!m),"aria-label":"Open menu",css:Ll,children:[m?"Close":"Menu",N(m?ve:Fe,{height:"16px",width:"16px"})]}):B(Z,{children:[N("div",{css:yl,children:o?.map(((e,t)=>N("div",{css:$l(u),children:e},t)))}),i?N("div",{css:kl(u),children:i.map((e=>N(ue,{...e},e.label)))}):null]})})]}),u&&!f?N("div",{css:bl,children:n?.map((e=>e.link?N(v,{to:e.link,href:e.link,css:wl(r===e.link),children:e.label},e.label):N(st,{label:e.label,items:e.items||[]},e.label)))}):null,f?N(jl,{navigationSection:n,utilitySection:o,actionsSection:i,linkRouter:t,isOpen:m,setIsOpen:C,pathname:r}):null]});var y},Ol=F`
|
|
2664
2664
|
width: 64px;
|
|
2665
|
-
height:
|
|
2665
|
+
height: 100%;
|
|
2666
2666
|
z-index: 100;
|
|
2667
|
-
position: fixed;
|
|
2668
|
-
top: ${e||"0px"};
|
|
2669
|
-
left: 0;
|
|
2670
2667
|
border-right: 1px solid ${le("neutral",300)};
|
|
2671
2668
|
background-color: ${le("neutral",200)};
|
|
2672
2669
|
display: flex;
|
|
@@ -2813,18 +2810,15 @@ import{createSystem as e,defaultConfig as t,Button as r,Box as n,Spinner as o,Ic
|
|
|
2813
2810
|
text-align: center;
|
|
2814
2811
|
color: ${le("neutral",600)};
|
|
2815
2812
|
}
|
|
2816
|
-
`,Fl=
|
|
2813
|
+
`,Fl=F`
|
|
2817
2814
|
width: 320px;
|
|
2818
|
-
height:
|
|
2815
|
+
height: 100%;
|
|
2819
2816
|
z-index: 100;
|
|
2820
|
-
position: fixed;
|
|
2821
|
-
top: ${e||"0px"};
|
|
2822
|
-
left: 64px;
|
|
2823
2817
|
box-shadow: 2px 0px 2px 0px #0000000d;
|
|
2824
2818
|
background-color: ${le("neutral",100)};
|
|
2825
2819
|
overflow-y: auto;
|
|
2826
2820
|
overflow-x: hidden;
|
|
2827
|
-
`,Al=({tabs:e=[],defaultValue:t,onTabClick:r,children:o,onOpenChange:i
|
|
2821
|
+
`,Al=({tabs:e=[],defaultValue:t,onTabClick:r,children:o,onOpenChange:i})=>{const[l,a]=X(!1),[s,d]=X(t||e?.[0]?.value);return B("div",{style:{height:"calc(100vh - 48px - 56px)",position:"fixed",top:"48px",left:0,display:"flex"},children:[B("div",{css:Ol,children:[N(E.Root,{defaultValue:t||e?.[0]?.value,orientation:"horizontal",width:"full",onValueChange:({value:e})=>{var t;d(t=e),r&&r(t)},role:"tablist",children:N(E.List,{alignItems:"center",border:"none",style:{flexDirection:"column"},children:e.map((e=>N(E.Trigger,{css:Bl,"aria-label":e["aria-label"]||e.label,...e,children:B(n,{display:"flex",alignItems:"center",flexDirection:"column",gap:"5px",className:"tab-label",children:[e.icon?N("div",{css:Nl,children:e.icon}):null,N("p",{children:e.label})]})},e.label)))})}),o?N(H.Root,{onOpenChange:({open:e})=>{a(e),i&&i(!e)},children:B(H.Trigger,{css:Zl,children:[N("div",{css:Nl,children:N(l?xe:he,{})}),B("div",{className:"tab-label",children:[N("p",{children:l?"Show":"Hide"}),N("p",{children:"Sidebar"})]})]})}):null]}),o?N(H.Root,{defaultOpen:!0,open:!l,children:N(H.Content,{height:"100%",children:N("div",{css:Fl,role:"tabpanel","aria-labelledby":s,children:o})})}):null]})},Wl=e=>F`
|
|
2828
2822
|
width: 100%;
|
|
2829
2823
|
display: flex;
|
|
2830
2824
|
align-items: center;
|