@strapi/design-system 1.8.0 → 1.8.2

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.
Files changed (69) hide show
  1. package/dist/Button/Button.cjs +2 -2
  2. package/dist/Button/Button.js +4 -4
  3. package/dist/Combobox/Combobox.cjs +3 -3
  4. package/dist/Combobox/Combobox.js +16 -16
  5. package/dist/DatePicker/DatePicker.cjs +14 -14
  6. package/dist/DatePicker/DatePicker.js +257 -223
  7. package/dist/DateTimePicker/DateTimePicker.cjs +3 -3
  8. package/dist/DateTimePicker/DateTimePicker.js +69 -63
  9. package/dist/Grid/Grid.cjs +3 -3
  10. package/dist/Grid/Grid.js +6 -3
  11. package/dist/MainNav/MainNav.cjs +2 -2
  12. package/dist/MainNav/MainNav.js +9 -31
  13. package/dist/MainNav/MainNavContext.cjs +1 -1
  14. package/dist/MainNav/MainNavContext.js +1 -1
  15. package/dist/MainNav/NavBrand.cjs +3 -3
  16. package/dist/MainNav/NavBrand.js +12 -38
  17. package/dist/MainNav/NavCondense.cjs +2 -2
  18. package/dist/MainNav/NavCondense.js +15 -23
  19. package/dist/MainNav/NavFooter.cjs +1 -1
  20. package/dist/MainNav/NavFooter.js +4 -10
  21. package/dist/MainNav/NavLink.cjs +9 -9
  22. package/dist/MainNav/NavLink.js +13 -35
  23. package/dist/MainNav/NavSection.cjs +1 -1
  24. package/dist/MainNav/NavSection.js +9 -43
  25. package/dist/MainNav/NavSections.cjs +2 -2
  26. package/dist/MainNav/NavSections.js +7 -21
  27. package/dist/MainNav/NavUser.cjs +2 -2
  28. package/dist/MainNav/NavUser.js +13 -27
  29. package/dist/Popover/Popover.cjs +3 -3
  30. package/dist/Popover/Popover.js +52 -51
  31. package/dist/Select/MultiSelect.cjs +5 -5
  32. package/dist/Select/MultiSelect.js +41 -41
  33. package/dist/Select/SingleSelect.cjs +1 -1
  34. package/dist/Select/SingleSelect.js +32 -32
  35. package/dist/SimpleMenu/SimpleMenu.cjs +9 -9
  36. package/dist/SimpleMenu/SimpleMenu.js +62 -151
  37. package/dist/SubNav/SubNav.cjs +5 -5
  38. package/dist/SubNav/SubNav.js +8 -13
  39. package/dist/SubNav/SubNavHeader.cjs +3 -3
  40. package/dist/SubNav/SubNavHeader.js +29 -76
  41. package/dist/SubNav/SubNavLink.cjs +13 -13
  42. package/dist/SubNav/SubNavLink.js +20 -52
  43. package/dist/SubNav/SubNavLinkSection.cjs +4 -4
  44. package/dist/SubNav/SubNavLinkSection.js +19 -35
  45. package/dist/SubNav/SubNavSection.cjs +2 -2
  46. package/dist/SubNav/SubNavSection.js +15 -55
  47. package/dist/SubNav/SubNavSectionLabel.cjs +3 -3
  48. package/dist/SubNav/SubNavSectionLabel.js +10 -38
  49. package/dist/SubNav/SubNavSections.cjs +1 -1
  50. package/dist/SubNav/SubNavSections.js +4 -18
  51. package/dist/ToggleInput/ToggleInput.cjs +20 -4
  52. package/dist/ToggleInput/ToggleInput.js +43 -18
  53. package/dist/Typography/Typography.cjs +1 -1
  54. package/dist/Typography/Typography.js +6 -6
  55. package/dist/Typography/utils.cjs +1 -1
  56. package/dist/Typography/utils.js +4 -5
  57. package/dist/v2/Breadcrumbs/Breadcrumbs.cjs +2 -2
  58. package/dist/v2/Breadcrumbs/Breadcrumbs.js +15 -23
  59. package/dist/v2/Breadcrumbs/Crumb.cjs +1 -1
  60. package/dist/v2/Breadcrumbs/Crumb.js +6 -25
  61. package/dist/v2/Breadcrumbs/CrumbLink.cjs +2 -2
  62. package/dist/v2/Breadcrumbs/CrumbLink.js +6 -15
  63. package/dist/v2/Breadcrumbs/CrumbSimpleMenu.cjs +4 -3
  64. package/dist/v2/Breadcrumbs/CrumbSimpleMenu.js +8 -14
  65. package/dist/v2/Breadcrumbs/Divider.cjs +1 -1
  66. package/dist/v2/Breadcrumbs/Divider.js +3 -4
  67. package/dist/v2/SimpleMenu/Menu.cjs +10 -10
  68. package/dist/v2/SimpleMenu/Menu.js +11 -11
  69. package/package.json +15 -15
@@ -1,7 +1,7 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),U=require("react"),d=require("@internationalized/date"),A=require("styled-components"),G=require("../DatePicker/DatePicker.cjs"),J=require("../DesignSystemProvider.cjs"),K=require("../hooks/useControllableState.cjs"),N=require("../hooks/useDateFormatter.cjs"),x=require("../hooks/useId.cjs"),Q=require("../TimePicker/TimePicker.cjs"),W=require("../Field/Field.cjs"),j=require("../Flex/Flex.cjs"),X=require("../Field/FieldLabel.cjs"),k=require("../VisuallyHidden/VisuallyHidden.cjs"),Y=require("../Field/FieldHint.cjs"),ee=require("../Field/FieldError.cjs"),S=i=>i&&i.__esModule?i:{default:i},te=S(U),L=S(A),ne=({ariaLabel:i,clearLabel:c="clear",dateLabel:h="Choose date",timeLabel:o="Choose time",disabled:b=!1,error:D,hint:_,id:$,label:w,labelAction:V,onChange:q,onClear:u,name:H,required:p=!1,selectButtonTitle:se,size:I="M",step:R,value:T,initialDate:F,...v})=>{const C=te.default.useRef(null),[n,m]=K.useControllableState({defaultProp:F?a(F,!1):void 0,prop:T?a(T,!1):T??void 0,onChange(e){q&&q(e?.toDate(d.getLocalTimeZone()))}}),M=J.useDesignSystem("DateTimePicker"),Z=N.useDateFormatter(M.locale,{hour:"2-digit",minute:"2-digit",hour12:!1}),l=n?Z.format(n.toDate(d.getLocalTimeZone())):"",z=e=>{let r=e?a(e):void 0;if(!(r&&n&&r.compare(n)===0)){if(l&&r){const[f,g]=l.split(":");r=r.set({hour:parseInt(f,10),minute:parseInt(g,10)})}m(r)}},B=e=>{if(!e)return;const[r,f]=e.split(":"),g=n?n.set({hour:parseInt(r,10),minute:parseInt(f,10)}):a(new Date).set({hour:parseInt(r,10),minute:parseInt(f,10)});m(g)},E=e=>{m(void 0),u&&u(e)},O=()=>{const e=n?n.set({hour:0,minute:0}):a(new Date);m(e)},s=x.useId($),y=x.useId(),P=x.useId();return t.jsx(W.Field,{name:H,as:"fieldset",id:s,"aria-labelledby":s,hint:_,error:D,required:p,children:t.jsxs(j.Flex,{as:"span",direction:"column",alignItems:"stretch",gap:1,children:[t.jsx(X.FieldLabel,{onClick:()=>{C.current.focus()},as:"legend",id:s,action:V,children:w}),t.jsxs(j.Flex,{flex:"1",gap:1,children:[t.jsx(k.VisuallyHidden,{as:"label",htmlFor:P,children:h}),t.jsx(re,{...v,selectedDate:n?.toDate(d.getLocalTimeZone()),onChange:z,error:typeof D=="string",required:p,size:I,onClear:u?E:void 0,clearLabel:`${c} date`,disabled:b,id:P,ref:C,"aria-describedby":`${s}-hint ${s}-error`}),t.jsx(k.VisuallyHidden,{as:"label",htmlFor:y,children:o}),t.jsx(ie,{size:I,error:typeof D=="string",value:l,onChange:B,onClear:u&&l!==void 0&&l!=="00:00"?O:void 0,clearLabel:`${c} time`,required:p,disabled:b,step:R,id:y,"aria-describedby":`${s}-hint ${s}-error`})]}),t.jsx(Y.FieldHint,{}),t.jsx(ee.FieldError,{})]})})},a=(i,c=!0)=>{const h=i.toISOString();let o=d.parseAbsoluteToLocal(h);return c&&(o=o.set({hour:0,minute:0})),d.toCalendarDateTime(o)},re=L.default(G.DatePickerInput)`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),E=require("react"),d=require("@internationalized/date"),U=require("styled-components"),A=require("../DatePicker/DatePicker.cjs"),G=require("../DesignSystemProvider.cjs"),J=require("../helpers/deprecations.cjs"),K=require("../hooks/useControllableState.cjs"),Q=require("../hooks/useDateFormatter.cjs"),x=require("../hooks/useId.cjs"),W=require("../TimePicker/TimePicker.cjs"),X=require("../Field/Field.cjs"),P=require("../Flex/Flex.cjs"),Y=require("../Field/FieldLabel.cjs"),j=require("../VisuallyHidden/VisuallyHidden.cjs"),ee=require("../Field/FieldHint.cjs"),te=require("../Field/FieldError.cjs"),w=e=>e&&e.__esModule?e:{default:e},ne=w(E),S=w(U),re=({ariaLabel:e,clearLabel:u="clear",dateLabel:D="Choose date",timeLabel:o="Choose time",disabled:l=!1,error:p,hint:L,id:_,label:V,labelAction:H,onChange:q,onClear:m,name:R,required:g=!1,selectButtonTitle:oe,size:I="M",step:$,value:T,initialDate:y,...v})=>{const F=ne.default.useRef(null),[r,f]=K.useControllableState({defaultProp:y?a(y,!1):void 0,prop:T?a(T,!1):T??void 0,onChange(t){q&&q(t?.toDate(d.getLocalTimeZone()))}}),M=G.useDesignSystem("DateTimePicker"),N=Q.useDateFormatter(M.locale,{hour:"2-digit",minute:"2-digit",hour12:!1}),c=r?N.format(r.toDate(d.getLocalTimeZone())):"",O=t=>{let i=t?a(t):void 0;if(!(i&&r&&i.compare(r)===0)){if(c&&i){const[h,b]=c.split(":");i=i.set({hour:parseInt(h,10),minute:parseInt(b,10)})}f(i)}},Z=t=>{if(!t)return;const[i,h]=t.split(":"),b=r?r.set({hour:parseInt(i,10),minute:parseInt(h,10)}):a(new Date).set({hour:parseInt(i,10),minute:parseInt(h,10)});f(b)},z=t=>{f(void 0),m&&m(t)},B=()=>{const t=r?r.set({hour:0,minute:0}):a(new Date);f(t)},s=x.useId(_),k=x.useId(),C=x.useId();return n.jsx(X.Field,{name:R,as:"fieldset",id:s,"aria-labelledby":s,hint:L,error:p,required:g,children:n.jsxs(P.Flex,{as:"span",direction:"column",alignItems:"stretch",gap:1,children:[n.jsx(Y.FieldLabel,{onClick:()=>{F.current.focus()},as:"legend",id:s,action:H,children:V}),n.jsxs(P.Flex,{flex:"1",gap:1,children:[n.jsx(j.VisuallyHidden,{as:"label",htmlFor:C,children:D}),n.jsx(se,{...v,selectedDate:r?.toDate(d.getLocalTimeZone()),onChange:O,error:typeof p=="string",required:g,size:I,onClear:m?z:void 0,clearLabel:`${u} date`,disabled:l,id:C,ref:F,"aria-describedby":`${s}-hint ${s}-error`}),n.jsx(j.VisuallyHidden,{as:"label",htmlFor:k,children:o}),n.jsx(ae,{size:I,error:typeof p=="string",value:c,onChange:Z,onClear:m&&c!==void 0&&c!=="00:00"?B:void 0,clearLabel:`${u} time`,required:g,disabled:l,step:$,id:k,"aria-describedby":`${s}-hint ${s}-error`})]}),n.jsx(ee.FieldHint,{}),n.jsx(te.FieldError,{})]})})},ie=J.once(console.warn),a=(e,u=!0)=>{if(typeof e=="string"){ie("It looks like you're passing a string as representation of a Date to the DatePicker. This is deprecated, look to passing a Date instead.");const l=Date.parse(e);Number.isNaN(l)?e=new Date:e=new Date(l)}const D=e.toISOString();let o=d.parseAbsoluteToLocal(D);return u&&(o=o.set({hour:0,minute:0})),d.toCalendarDateTime(o)},se=S.default(A.DatePickerInput)`
2
2
  flex: 1 1 70%;
3
3
  min-width: 120px;
4
- `,ie=L.default(Q.TimePickerInput)`
4
+ `,ae=S.default(W.TimePickerInput)`
5
5
  flex: 1 1 30%;
6
6
  min-width: 120px;
7
- `;exports.DateTimePicker=ne;exports.convertUTCDateToCalendarDateTime=a;
7
+ `;exports.DateTimePicker=re;exports.convertUTCDateToCalendarDateTime=a;
@@ -1,94 +1,100 @@
1
- import { jsx as i, jsxs as w } from "react/jsx-runtime";
2
- import Z from "react";
3
- import { getLocalTimeZone as g, parseAbsoluteToLocal as v, toCalendarDateTime as G } from "@internationalized/date";
1
+ import { jsx as o, jsxs as P } from "react/jsx-runtime";
2
+ import U from "react";
3
+ import { getLocalTimeZone as b, parseAbsoluteToLocal as Z, toCalendarDateTime as v } from "@internationalized/date";
4
4
  import $ from "styled-components";
5
- import { DatePickerInput as J } from "../DatePicker/DatePicker.js";
6
- import { useDesignSystem as K } from "../DesignSystemProvider.js";
7
- import { useControllableState as N } from "../hooks/useControllableState.js";
8
- import { useDateFormatter as Q } from "../hooks/useDateFormatter.js";
9
- import { useId as T } from "../hooks/useId.js";
10
- import { TimePickerInput as W } from "../TimePicker/TimePicker.js";
11
- import { Field as X } from "../Field/Field.js";
5
+ import { DatePickerInput as G } from "../DatePicker/DatePicker.js";
6
+ import { useDesignSystem as J } from "../DesignSystemProvider.js";
7
+ import { once as K } from "../helpers/deprecations.js";
8
+ import { useControllableState as Q } from "../hooks/useControllableState.js";
9
+ import { useDateFormatter as W } from "../hooks/useDateFormatter.js";
10
+ import { useId as I } from "../hooks/useId.js";
11
+ import { TimePickerInput as X } from "../TimePicker/TimePicker.js";
12
+ import { Field as Y } from "../Field/Field.js";
12
13
  import { Flex as L } from "../Flex/Flex.js";
13
- import { FieldLabel as Y } from "../Field/FieldLabel.js";
14
+ import { FieldLabel as ee } from "../Field/FieldLabel.js";
14
15
  import { VisuallyHidden as S } from "../VisuallyHidden/VisuallyHidden.js";
15
- import { FieldHint as ee } from "../Field/FieldHint.js";
16
- import { FieldError as te } from "../Field/FieldError.js";
17
- const Ce = ({
16
+ import { FieldHint as te } from "../Field/FieldHint.js";
17
+ import { FieldError as re } from "../Field/FieldError.js";
18
+ const xe = ({
18
19
  /**
19
20
  * @preserve
20
21
  * @deprecated This is no longer used.
21
22
  */
22
- ariaLabel: b,
23
- clearLabel: l = "clear",
24
- dateLabel: u = "Choose date",
25
- timeLabel: n = "Choose time",
26
- disabled: I = !1,
27
- error: f,
23
+ ariaLabel: n,
24
+ clearLabel: d = "clear",
25
+ dateLabel: p = "Choose date",
26
+ timeLabel: a = "Choose time",
27
+ disabled: s = !1,
28
+ error: h,
28
29
  hint: V,
29
30
  id: _,
30
- label: R,
31
- labelAction: j,
32
- onChange: C,
33
- onClear: d,
34
- name: z,
35
- required: p = !1,
31
+ label: N,
32
+ labelAction: R,
33
+ onChange: k,
34
+ onClear: c,
35
+ name: j,
36
+ required: D = !1,
36
37
  /**
37
38
  * @preserve
38
39
  * @deprecated This is no longer used.
39
40
  */
40
- selectButtonTitle: oe,
41
- size: x = "M",
42
- step: B,
43
- value: h,
44
- initialDate: F,
45
- ...H
41
+ selectButtonTitle: ae,
42
+ size: C = "M",
43
+ step: z,
44
+ value: g,
45
+ initialDate: w,
46
+ ...B
46
47
  }) => {
47
- const k = Z.useRef(null), [t, m] = N({
48
- defaultProp: F ? s(F, !1) : void 0,
49
- prop: h ? s(h, !1) : h ?? void 0,
48
+ const x = U.useRef(null), [t, f] = Q({
49
+ defaultProp: w ? m(w, !1) : void 0,
50
+ prop: g ? m(g, !1) : g ?? void 0,
50
51
  onChange(e) {
51
- C && C(e?.toDate(g()));
52
+ k && k(e?.toDate(b()));
52
53
  }
53
- }), q = K("DateTimePicker"), A = Q(q.locale, {
54
+ }), H = J("DateTimePicker"), O = W(H.locale, {
54
55
  hour: "2-digit",
55
56
  minute: "2-digit",
56
57
  hour12: !1
57
- }), a = t ? A.format(t.toDate(g())) : "", E = (e) => {
58
- let r = e ? s(e) : void 0;
58
+ }), l = t ? O.format(t.toDate(b())) : "", q = (e) => {
59
+ let r = e ? m(e) : void 0;
59
60
  if (!(r && t && r.compare(t) === 0)) {
60
- if (a && r) {
61
- const [c, D] = a.split(":");
62
- r = r.set({ hour: parseInt(c, 10), minute: parseInt(D, 10) });
61
+ if (l && r) {
62
+ const [u, T] = l.split(":");
63
+ r = r.set({ hour: parseInt(u, 10), minute: parseInt(T, 10) });
63
64
  }
64
- m(r);
65
+ f(r);
65
66
  }
66
- }, M = (e) => {
67
+ }, A = (e) => {
67
68
  if (!e)
68
69
  return;
69
- const [r, c] = e.split(":"), D = t ? t.set({ hour: parseInt(r, 10), minute: parseInt(c, 10) }) : s(/* @__PURE__ */ new Date()).set({ hour: parseInt(r, 10), minute: parseInt(c, 10) });
70
- m(D);
71
- }, O = (e) => {
72
- m(void 0), d && d(e);
73
- }, U = () => {
74
- const e = t ? t.set({ hour: 0, minute: 0 }) : s(/* @__PURE__ */ new Date());
75
- m(e);
76
- }, o = T(_), y = T(), P = T();
77
- return i(X, { name: z, as: "fieldset", id: o, "aria-labelledby": o, hint: V, error: f, required: p, children: w(L, { as: "span", direction: "column", alignItems: "stretch", gap: 1, children: [i(Y, { onClick: () => {
78
- k.current.focus();
79
- }, as: "legend", id: o, action: j, children: R }), w(L, { flex: "1", gap: 1, children: [i(S, { as: "label", htmlFor: P, children: u }), i(re, { ...H, selectedDate: t?.toDate(g()), onChange: E, error: typeof f == "string", required: p, size: x, onClear: d ? O : void 0, clearLabel: `${l} date`, disabled: I, id: P, ref: k, "aria-describedby": `${o}-hint ${o}-error` }), i(S, { as: "label", htmlFor: y, children: n }), i(ie, { size: x, error: typeof f == "string", value: a, onChange: M, onClear: d && a !== void 0 && a !== "00:00" ? U : void 0, clearLabel: `${l} time`, required: p, disabled: I, step: B, id: y, "aria-describedby": `${o}-hint ${o}-error` })] }), i(ee, {}), i(te, {})] }) });
80
- }, s = (b, l = !0) => {
81
- const u = b.toISOString();
82
- let n = v(u);
83
- return l && (n = n.set({ hour: 0, minute: 0 })), G(n);
84
- }, re = $(J)`
70
+ const [r, u] = e.split(":"), T = t ? t.set({ hour: parseInt(r, 10), minute: parseInt(u, 10) }) : m(/* @__PURE__ */ new Date()).set({ hour: parseInt(r, 10), minute: parseInt(u, 10) });
71
+ f(T);
72
+ }, E = (e) => {
73
+ f(void 0), c && c(e);
74
+ }, M = () => {
75
+ const e = t ? t.set({ hour: 0, minute: 0 }) : m(/* @__PURE__ */ new Date());
76
+ f(e);
77
+ }, i = I(_), y = I(), F = I();
78
+ return o(Y, { name: j, as: "fieldset", id: i, "aria-labelledby": i, hint: V, error: h, required: D, children: P(L, { as: "span", direction: "column", alignItems: "stretch", gap: 1, children: [o(ee, { onClick: () => {
79
+ x.current.focus();
80
+ }, as: "legend", id: i, action: R, children: N }), P(L, { flex: "1", gap: 1, children: [o(S, { as: "label", htmlFor: F, children: p }), o(ie, { ...B, selectedDate: t?.toDate(b()), onChange: q, error: typeof h == "string", required: D, size: C, onClear: c ? E : void 0, clearLabel: `${d} date`, disabled: s, id: F, ref: x, "aria-describedby": `${i}-hint ${i}-error` }), o(S, { as: "label", htmlFor: y, children: a }), o(ne, { size: C, error: typeof h == "string", value: l, onChange: A, onClear: c && l !== void 0 && l !== "00:00" ? M : void 0, clearLabel: `${d} time`, required: D, disabled: s, step: z, id: y, "aria-describedby": `${i}-hint ${i}-error` })] }), o(te, {}), o(re, {})] }) });
81
+ }, oe = K(console.warn), m = (n, d = !0) => {
82
+ if (typeof n == "string") {
83
+ oe("It looks like you're passing a string as representation of a Date to the DatePicker. This is deprecated, look to passing a Date instead.");
84
+ const s = Date.parse(n);
85
+ Number.isNaN(s) ? n = /* @__PURE__ */ new Date() : n = new Date(s);
86
+ }
87
+ const p = n.toISOString();
88
+ let a = Z(p);
89
+ return d && (a = a.set({ hour: 0, minute: 0 })), v(a);
90
+ }, ie = $(G)`
85
91
  flex: 1 1 70%;
86
92
  min-width: 120px;
87
- `, ie = $(W)`
93
+ `, ne = $(X)`
88
94
  flex: 1 1 30%;
89
95
  min-width: 120px;
90
96
  `;
91
97
  export {
92
- Ce as DateTimePicker,
93
- s as convertUTCDateToCalendarDateTime
98
+ xe as DateTimePicker,
99
+ m as convertUTCDateToCalendarDateTime
94
100
  };
@@ -1,5 +1,5 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),o=require("styled-components"),i=require("../helpers/handleResponsiveValues.cjs"),d=require("../Box/Box.cjs"),l=e=>e&&e.__esModule?e:{default:e},n=l(o),u=n.default(d.Box)`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),i=require("styled-components"),d=require("../helpers/handleResponsiveValues.cjs"),l=require("../Box/Box.cjs"),n=e=>e&&e.__esModule?e:{default:e},u=n(i),a=u.default(l.Box)`
2
2
  display: grid;
3
3
  grid-template-columns: repeat(${({gridCols:e})=>e}, 1fr);
4
- ${({theme:e,gap:t})=>i("gap",t,e)}
5
- `,a=({gap:e="0",gridCols:t=12,...r})=>s.jsx(u,{gap:e,gridCols:t,...r});exports.Grid=a;
4
+ ${({theme:e,gap:t})=>d("gap",t,e)}
5
+ `,c=e=>{const{gap:t="0",gridCols:r=12,...s}=e;return o.jsx(a,{gap:t,gridCols:r,...s})};exports.Grid=c;
package/dist/Grid/Grid.js CHANGED
@@ -1,12 +1,15 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
- import t from "styled-components";
2
+ import s from "styled-components";
3
3
  import i from "../helpers/handleResponsiveValues.js";
4
4
  import { Box as m } from "../Box/Box.js";
5
- const s = t(m)`
5
+ const a = s(m)`
6
6
  display: grid;
7
7
  grid-template-columns: repeat(${({ gridCols: r }) => r}, 1fr);
8
8
  ${({ theme: r, gap: o }) => i("gap", o, r)}
9
- `, f = ({ gap: r = "0", gridCols: o = 12, ...p }) => e(s, { gap: r, gridCols: o, ...p });
9
+ `, f = (r) => {
10
+ const { gap: o = "0", gridCols: p = 12, ...t } = r;
11
+ return e(a, { gap: o, gridCols: p, ...t });
12
+ };
10
13
  export {
11
14
  f as Grid
12
15
  };
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime");require("react");const a=require("prop-types"),s=require("styled-components"),i=require("./MainNavContext.cjs"),l=require("../Flex/Flex.cjs"),r=e=>e&&e.__esModule?e:{default:e},u=r(a),d=r(s),c=d.default(l.Flex)`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),r=require("styled-components"),o=require("./MainNavContext.cjs"),a=require("../Flex/Flex.cjs"),i=e=>e&&e.__esModule?e:{default:e},s=i(r),l=s.default(a.Flex)`
2
2
  width: ${({condensed:e})=>e?"max-content":`${224/16}rem`};
3
3
  border-right: 1px solid ${({theme:e})=>e.colors.neutral150};
4
- `,t=({condensed:e,...n})=>o.jsx(i.MainNavContext.Provider,{value:e,children:o.jsx(c,{alignItems:"normal",as:"nav",background:"neutral0",condensed:e,direction:"column",height:"100vh",position:"sticky",top:0,zIndex:2,...n})});t.defaultProps={condensed:!1};t.propTypes={condensed:u.default.bool};exports.MainNav=t;
4
+ `,u=({condensed:e=!1,...n})=>t.jsx(o.MainNavContext.Provider,{value:e,children:t.jsx(l,{alignItems:"normal",as:"nav",background:"neutral0",condensed:e,direction:"column",height:"100vh",position:"sticky",top:0,zIndex:2,...n})});exports.MainNav=u;
@@ -1,33 +1,11 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import "react";
3
- import n from "prop-types";
4
- import i from "styled-components";
5
- import { MainNavContext as a } from "./MainNavContext.js";
6
- import { Flex as p } from "../Flex/Flex.js";
7
- const m = i(p)`
8
- width: ${({ condensed: o }) => o ? "max-content" : `${224 / 16}rem`};
9
- border-right: 1px solid ${({ theme: o }) => o.colors.neutral150};
10
- `, t = ({ condensed: o, ...e }) => /* @__PURE__ */ r(a.Provider, { value: o, children: /* @__PURE__ */ r(
11
- m,
12
- {
13
- alignItems: "normal",
14
- as: "nav",
15
- background: "neutral0",
16
- condensed: o,
17
- direction: "column",
18
- height: "100vh",
19
- position: "sticky",
20
- top: 0,
21
- zIndex: 2,
22
- ...e
23
- }
24
- ) });
25
- t.defaultProps = {
26
- condensed: !1
27
- };
28
- t.propTypes = {
29
- condensed: n.bool
30
- };
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import n from "styled-components";
3
+ import { MainNavContext as e } from "./MainNavContext.js";
4
+ import { Flex as i } from "../Flex/Flex.js";
5
+ const a = n(i)`
6
+ width: ${({ condensed: r }) => r ? "max-content" : `${224 / 16}rem`};
7
+ border-right: 1px solid ${({ theme: r }) => r.colors.neutral150};
8
+ `, c = ({ condensed: r = !1, ...t }) => o(e.Provider, { value: r, children: o(a, { alignItems: "normal", as: "nav", background: "neutral0", condensed: r, direction: "column", height: "100vh", position: "sticky", top: 0, zIndex: 2, ...t }) });
31
9
  export {
32
- t as MainNav
10
+ c as MainNav
33
11
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=e.createContext(),n=()=>e.useContext(t);exports.MainNavContext=t;exports.useMainNav=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=e.createContext(!1),a=()=>e.useContext(t);exports.MainNavContext=t;exports.useMainNav=a;
@@ -1,5 +1,5 @@
1
1
  import { createContext as t, useContext as e } from "react";
2
- const o = t(), a = () => e(o);
2
+ const o = t(!1), a = () => e(o);
3
3
  export {
4
4
  o as MainNavContext,
5
5
  a as useMainNav
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime");require("react");const x=require("prop-types"),t=require("react-router-dom"),g=require("styled-components"),f=require("./MainNavContext.cjs"),d=require("../Box/Box.cjs"),l=require("../VisuallyHidden/VisuallyHidden.cjs"),j=require("../Flex/Flex.cjs"),u=require("../Typography/Typography.cjs"),p=e=>e&&e.__esModule?e:{default:e},n=p(x),h=p(g),c=h.default.div`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),i=require("react-router-dom"),u=require("styled-components"),p=require("./MainNavContext.cjs"),d=require("../Box/Box.cjs"),a=require("../VisuallyHidden/VisuallyHidden.cjs"),h=require("../Flex/Flex.cjs"),o=require("../Typography/Typography.cjs"),x=e=>e&&e.__esModule?e:{default:e},l=x(u),c=l.default.div`
2
2
  svg,
3
3
  img {
4
4
  border-radius: ${({theme:e})=>e.borderRadius};
@@ -6,7 +6,7 @@
6
6
  height: ${({condensed:e})=>e?`${40/16}rem`:`${32/16}rem`};
7
7
  width: ${({condensed:e})=>e?`${40/16}rem`:`${32/16}rem`};
8
8
  }
9
- `,y=h.default(t.NavLink)`
9
+ `,g=l.default(i.NavLink)`
10
10
  text-decoration: unset;
11
11
  color: inherit;
12
- `,s=({workplace:e,title:a,icon:o,to:i})=>f.useMainNav()?r.jsx(d.Box,{paddingLeft:3,paddingRight:3,paddingTop:4,paddingBottom:4,children:r.jsx(c,{condensed:!0,children:r.jsxs(t.NavLink,{to:i,children:[o,r.jsxs(l.VisuallyHidden,{children:[r.jsx("span",{children:a}),r.jsx("span",{children:e})]})]})})}):r.jsx(d.Box,{paddingLeft:3,paddingRight:3,paddingTop:4,paddingBottom:4,children:r.jsxs(j.Flex,{children:[r.jsx(c,{as:t.NavLink,to:i,"aria-hidden":!0,tabIndex:-1,children:o}),r.jsxs(d.Box,{paddingLeft:2,children:[r.jsx(u.Typography,{fontWeight:"bold",textColor:"neutral800",as:"span",children:r.jsxs(y,{to:i,children:[a,r.jsx(l.VisuallyHidden,{as:"span",children:e})]})}),r.jsx(u.Typography,{variant:"pi",as:"p",textColor:"neutral600","aria-hidden":!0,children:e})]})]})});s.defaultProps={to:"/"};s.propTypes={icon:n.default.node.isRequired,title:n.default.string.isRequired,to:n.default.string,workplace:n.default.string.isRequired};exports.NavBrand=s;
12
+ `,j=({workplace:e,title:t,icon:s,to:r="/"})=>p.useMainNav()?n.jsx(d.Box,{paddingLeft:3,paddingRight:3,paddingTop:4,paddingBottom:4,children:n.jsx(c,{condensed:!0,children:n.jsxs(i.NavLink,{to:r,children:[s,n.jsxs(a.VisuallyHidden,{children:[n.jsx("span",{children:t}),n.jsx("span",{children:e})]})]})})}):n.jsx(d.Box,{paddingLeft:3,paddingRight:3,paddingTop:4,paddingBottom:4,children:n.jsxs(h.Flex,{children:[n.jsx(c,{as:i.NavLink,to:r,"aria-hidden":!0,tabIndex:-1,children:s}),n.jsxs(d.Box,{paddingLeft:2,children:[n.jsx(o.Typography,{fontWeight:"bold",textColor:"neutral800",as:"span",children:n.jsxs(g,{to:r,children:[t,n.jsx(a.VisuallyHidden,{as:"span",children:e})]})}),n.jsx(o.Typography,{variant:"pi",as:"p",textColor:"neutral600","aria-hidden":!0,children:e})]})]})});exports.NavBrand=j;
@@ -1,14 +1,12 @@
1
- import { jsx as i, jsxs as e } from "react/jsx-runtime";
2
- import "react";
3
- import n from "prop-types";
4
- import { NavLink as o } from "react-router-dom";
5
- import h from "styled-components";
6
- import { useMainNav as g } from "./MainNavContext.js";
7
- import { Box as t } from "../Box/Box.js";
8
- import { VisuallyHidden as s } from "../VisuallyHidden/VisuallyHidden.js";
9
- import { Flex as f } from "../Flex/Flex.js";
10
- import { Typography as m } from "../Typography/Typography.js";
11
- const c = h.div`
1
+ import { jsx as n, jsxs as d } from "react/jsx-runtime";
2
+ import { NavLink as t } from "react-router-dom";
3
+ import c from "styled-components";
4
+ import { useMainNav as m } from "./MainNavContext.js";
5
+ import { Box as e } from "../Box/Box.js";
6
+ import { VisuallyHidden as p } from "../VisuallyHidden/VisuallyHidden.js";
7
+ import { Flex as l } from "../Flex/Flex.js";
8
+ import { Typography as s } from "../Typography/Typography.js";
9
+ const h = c.div`
12
10
  svg,
13
11
  img {
14
12
  border-radius: ${({ theme: r }) => r.borderRadius};
@@ -16,34 +14,10 @@ const c = h.div`
16
14
  height: ${({ condensed: r }) => r ? `${40 / 16}rem` : `${32 / 16}rem`};
17
15
  width: ${({ condensed: r }) => r ? `${40 / 16}rem` : `${32 / 16}rem`};
18
16
  }
19
- `, u = h(o)`
17
+ `, g = c(t)`
20
18
  text-decoration: unset;
21
19
  color: inherit;
22
- `, l = ({ workplace: r, title: a, icon: p, to: d }) => g() ? /* @__PURE__ */ i(t, { paddingLeft: 3, paddingRight: 3, paddingTop: 4, paddingBottom: 4, children: /* @__PURE__ */ i(c, { condensed: !0, children: /* @__PURE__ */ e(o, { to: d, children: [
23
- p,
24
- /* @__PURE__ */ e(s, { children: [
25
- /* @__PURE__ */ i("span", { children: a }),
26
- /* @__PURE__ */ i("span", { children: r })
27
- ] })
28
- ] }) }) }) : /* @__PURE__ */ i(t, { paddingLeft: 3, paddingRight: 3, paddingTop: 4, paddingBottom: 4, children: /* @__PURE__ */ e(f, { children: [
29
- /* @__PURE__ */ i(c, { as: o, to: d, "aria-hidden": !0, tabIndex: -1, children: p }),
30
- /* @__PURE__ */ e(t, { paddingLeft: 2, children: [
31
- /* @__PURE__ */ i(m, { fontWeight: "bold", textColor: "neutral800", as: "span", children: /* @__PURE__ */ e(u, { to: d, children: [
32
- a,
33
- /* @__PURE__ */ i(s, { as: "span", children: r })
34
- ] }) }),
35
- /* @__PURE__ */ i(m, { variant: "pi", as: "p", textColor: "neutral600", "aria-hidden": !0, children: r })
36
- ] })
37
- ] }) });
38
- l.defaultProps = {
39
- to: "/"
40
- };
41
- l.propTypes = {
42
- icon: n.node.isRequired,
43
- title: n.string.isRequired,
44
- to: n.string,
45
- workplace: n.string.isRequired
46
- };
20
+ `, N = ({ workplace: r, title: o, icon: a, to: i = "/" }) => m() ? n(e, { paddingLeft: 3, paddingRight: 3, paddingTop: 4, paddingBottom: 4, children: n(h, { condensed: !0, children: d(t, { to: i, children: [a, d(p, { children: [n("span", { children: o }), n("span", { children: r })] })] }) }) }) : n(e, { paddingLeft: 3, paddingRight: 3, paddingTop: 4, paddingBottom: 4, children: d(l, { children: [n(h, { as: t, to: i, "aria-hidden": !0, tabIndex: -1, children: a }), d(e, { paddingLeft: 2, children: [n(s, { fontWeight: "bold", textColor: "neutral800", as: "span", children: d(g, { to: i, children: [o, n(p, { as: "span", children: r })] }) }), n(s, { variant: "pi", as: "p", textColor: "neutral600", "aria-hidden": !0, children: r })] })] }) });
47
21
  export {
48
- l as NavBrand
22
+ N as NavBrand
49
23
  };
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime");require("react");const s=require("@strapi/icons"),d=require("prop-types"),a=require("styled-components"),u=require("./MainNavContext.cjs"),l=require("../Icon/Icon.cjs"),c=require("../VisuallyHidden/VisuallyHidden.cjs"),o=e=>e&&e.__esModule?e:{default:e},h=o(d),p=o(a),g=p.default.button`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),o=require("@strapi/icons"),s=require("styled-components"),i=require("./MainNavContext.cjs"),d=require("../Icon/Icon.cjs"),a=require("../VisuallyHidden/VisuallyHidden.cjs"),u=e=>e&&e.__esModule?e:{default:e},l=u(s),c=l.default.button`
2
2
  background: ${({theme:e})=>e.colors.neutral0};
3
3
  border: 1px solid ${({theme:e})=>e.colors.neutral150};
4
4
  border-radius: ${({theme:e})=>e.borderRadius};
@@ -17,4 +17,4 @@
17
17
  width: ${6/16}rem;
18
18
  height: ${9/16}rem;
19
19
  }
20
- `,i=({children:e,...t})=>{const n=u.useMainNav();return r.jsxs(g,{as:"button",condensed:n,...t,children:[r.jsx(l.Icon,{as:n?s.ChevronRight:s.ChevronLeft,"aria-hidden":!0,color:"neutral600"}),r.jsx(c.VisuallyHidden,{children:e})]})};i.propTypes={children:h.default.string.isRequired};exports.NavCondense=i;
20
+ `,h=({children:e,...t})=>{const r=i.useMainNav();return n.jsxs(c,{as:"button",condensed:r,...t,children:[n.jsx(d.Icon,{as:r?o.ChevronRight:o.ChevronLeft,"aria-hidden":!0,color:"neutral600"}),n.jsx(a.VisuallyHidden,{children:e})]})};exports.NavCondense=h;
@@ -1,22 +1,20 @@
1
- import { jsxs as i, jsx as t } from "react/jsx-runtime";
2
- import "react";
3
- import { ChevronRight as n, ChevronLeft as s } from "@strapi/icons";
4
- import d from "prop-types";
5
- import a from "styled-components";
6
- import { useMainNav as m } from "./MainNavContext.js";
7
- import { Icon as p } from "../Icon/Icon.js";
1
+ import { jsxs as n, jsx as t } from "react/jsx-runtime";
2
+ import { ChevronRight as i, ChevronLeft as s } from "@strapi/icons";
3
+ import d from "styled-components";
4
+ import { useMainNav as a } from "./MainNavContext.js";
5
+ import { Icon as m } from "../Icon/Icon.js";
8
6
  import { VisuallyHidden as h } from "../VisuallyHidden/VisuallyHidden.js";
9
- const l = a.button`
10
- background: ${({ theme: r }) => r.colors.neutral0};
11
- border: 1px solid ${({ theme: r }) => r.colors.neutral150};
12
- border-radius: ${({ theme: r }) => r.borderRadius};
7
+ const l = d.button`
8
+ background: ${({ theme: e }) => e.colors.neutral0};
9
+ border: 1px solid ${({ theme: e }) => e.colors.neutral150};
10
+ border-radius: ${({ theme: e }) => e.borderRadius};
13
11
  display: flex;
14
12
  align-items: center;
15
13
  justify-content: center;
16
14
  position: absolute;
17
15
  bottom: ${(9 + 4) / 16}rem; // 9 is the height of the svg and 4 is the padding below
18
- right: ${({ theme: r, condensed: e }) => e ? 0 : r.spaces[5]};
19
- transform: ${({ condensed: r }) => r ? "translateX(50%)" : void 0};
16
+ right: ${({ theme: e, condensed: r }) => r ? 0 : e.spaces[5]};
17
+ transform: ${({ condensed: e }) => e ? "translateX(50%)" : void 0};
20
18
  z-index: 2;
21
19
  width: ${18 / 16}rem;
22
20
  height: ${25 / 16}rem;
@@ -25,16 +23,10 @@ const l = a.button`
25
23
  width: ${6 / 16}rem;
26
24
  height: ${9 / 16}rem;
27
25
  }
28
- `, c = ({ children: r, ...e }) => {
29
- const o = m();
30
- return /* @__PURE__ */ i(l, { as: "button", condensed: o, ...e, children: [
31
- /* @__PURE__ */ t(p, { as: o ? n : s, "aria-hidden": !0, color: "neutral600" }),
32
- /* @__PURE__ */ t(h, { children: r })
33
- ] });
34
- };
35
- c.propTypes = {
36
- children: d.string.isRequired
26
+ `, b = ({ children: e, ...r }) => {
27
+ const o = a();
28
+ return n(l, { as: "button", condensed: o, ...r, children: [t(m, { as: o ? i : s, "aria-hidden": !0, color: "neutral600" }), t(h, { children: e })] });
37
29
  };
38
30
  export {
39
- c as NavCondense
31
+ b as NavCondense
40
32
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime");require("react");const t=require("prop-types"),s=require("../Box/Box.cjs"),i=e=>e&&e.__esModule?e:{default:e},u=i(t),o=({children:e})=>r.jsx(s.Box,{position:"relative",children:e});o.displayName="NavFooter";o.propTypes={children:u.default.node.isRequired};exports.NavFooter=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),t=require("../Box/Box.cjs"),r=({children:e})=>o.jsx(t.Box,{position:"relative",children:e});exports.NavFooter=r;
@@ -1,12 +1,6 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import "react";
3
- import p from "prop-types";
4
- import { Box as i } from "../Box/Box.js";
5
- const o = ({ children: r }) => /* @__PURE__ */ e(i, { position: "relative", children: r });
6
- o.displayName = "NavFooter";
7
- o.propTypes = {
8
- children: p.node.isRequired
9
- };
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { Box as t } from "../Box/Box.js";
3
+ const m = ({ children: o }) => r(t, { position: "relative", children: o });
10
4
  export {
11
- o as NavFooter
5
+ m as NavFooter
12
6
  };
@@ -1,16 +1,16 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime");require("react");const f=require("prop-types"),$=require("react-router-dom"),x=require("styled-components"),v=require("./MainNavContext.cjs"),b=require("../Box/Box.cjs"),a=require("../Typography/Typography.cjs"),h=require("../Flex/Flex.cjs"),j=require("../Badge/Badge.cjs"),m=require("../Tooltip/Tooltip.cjs"),y=e=>e&&e.__esModule?e:{default:e},o=y(f),n=y(x),c=n.default(b.Box)`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),h=require("react-router-dom"),g=require("styled-components"),$=require("./MainNavContext.cjs"),y=require("../Box/Box.cjs"),o=require("../Typography/Typography.cjs"),p=require("../Flex/Flex.cjs"),x=require("../Badge/Badge.cjs"),f=require("../Tooltip/Tooltip.cjs"),v=e=>e&&e.__esModule?e:{default:e},t=v(g),l=t.default(y.Box)`
2
2
  svg {
3
3
  width: 1rem;
4
4
  height: 1rem;
5
5
  }
6
- `,u=n.default($.NavLink)`
6
+ `,c=t.default(h.NavLink)`
7
7
  position: relative;
8
8
  text-decoration: none;
9
9
  display: block;
10
10
  border-radius: ${({theme:e})=>e.borderRadius};
11
11
  background: ${({theme:e})=>e.colors.neutral0};
12
12
 
13
- ${a.Typography} {
13
+ ${o.Typography} {
14
14
  color: ${({theme:e})=>e.colors.neutral600};
15
15
  }
16
16
 
@@ -21,7 +21,7 @@
21
21
  &:hover {
22
22
  background: ${({theme:e})=>e.colors.neutral100};
23
23
 
24
- ${a.Typography} {
24
+ ${o.Typography} {
25
25
  color: ${({theme:e})=>e.colors.neutral700};
26
26
  }
27
27
 
@@ -37,14 +37,14 @@
37
37
  fill: ${({theme:e})=>e.colors.primary600};
38
38
  }
39
39
 
40
- ${a.Typography} {
40
+ ${o.Typography} {
41
41
  color: ${({theme:e})=>e.colors.primary600};
42
42
  font-weight: 500;
43
43
  }
44
44
  }
45
- `,p=n.default(h.Flex)`
45
+ `,d=t.default(p.Flex)`
46
46
  padding: ${({theme:e})=>`${e.spaces[2]} ${e.spaces[3]}`};
47
- `,g=n.default(j.Badge)`
47
+ `,u=t.default(x.Badge)`
48
48
  ${({theme:e,condensed:s})=>s&&`
49
49
  position: absolute;
50
50
  // Values based on visual aspect
@@ -52,7 +52,7 @@
52
52
  right: -${e.spaces[1]};
53
53
  `}
54
54
 
55
- ${a.Typography} {
55
+ ${o.Typography} {
56
56
  //find a solution to remove !important
57
57
  color: ${({theme:e})=>e.colors.neutral0} !important;
58
58
  line-height: 0;
@@ -66,4 +66,4 @@
66
66
  padding: ${({theme:e})=>`0 ${e.spaces[2]}`};
67
67
  border-radius: ${({theme:e})=>e.spaces[10]};
68
68
  background: ${({theme:e})=>e.colors.primary600};
69
- `,i=({children:e,icon:s,badgeContent:t,badgeAriaLabel:l,...d})=>v.useMainNav()?r.jsx(m.Tooltip,{position:"right",label:e,children:r.jsx(u,{...d,children:r.jsxs(p,{as:"span",children:[r.jsx(c,{"aria-hidden":!0,paddingRight:0,as:"span",children:s}),t&&r.jsx(g,{condensed:!0,"aria-label":l,children:t})]})})}):r.jsx(u,{...d,children:r.jsxs(p,{as:"span",justifyContent:"space-between",children:[r.jsxs(h.Flex,{children:[r.jsx(c,{"aria-hidden":!0,paddingRight:3,as:"span",children:s}),r.jsx(a.Typography,{children:e})]}),t&&r.jsx(g,{justifyContent:"center","aria-label":l,children:t})]})});i.displayName="NavLink";i.defaultProps={badgeContent:void 0,badgeAriaLabel:void 0};i.propTypes={badgeAriaLabel:o.default.string,badgeContent:o.default.oneOfType([o.default.string,o.default.number]),children:o.default.node.isRequired,icon:o.default.node.isRequired};exports.NavLink=i;
69
+ `,j=({children:e,icon:s,badgeContent:a,badgeAriaLabel:n,...i})=>$.useMainNav()?r.jsx(f.Tooltip,{position:"right",label:e,children:r.jsx(c,{...i,children:r.jsxs(d,{as:"span",children:[r.jsx(l,{"aria-hidden":!0,paddingRight:0,as:"span",children:s}),a&&r.jsx(u,{condensed:!0,"aria-label":n,children:a})]})})}):r.jsx(c,{...i,children:r.jsxs(d,{as:"span",justifyContent:"space-between",children:[r.jsxs(p.Flex,{children:[r.jsx(l,{"aria-hidden":!0,paddingRight:3,as:"span",children:s}),r.jsx(o.Typography,{children:e})]}),a&&r.jsx(u,{justifyContent:"center","aria-label":n,children:a})]})});exports.NavLink=j;
@@ -1,20 +1,18 @@
1
- import { jsx as o, jsxs as t } from "react/jsx-runtime";
2
- import "react";
3
- import e from "prop-types";
4
- import { NavLink as g } from "react-router-dom";
1
+ import { jsx as o, jsxs as n } from "react/jsx-runtime";
2
+ import { NavLink as u } from "react-router-dom";
5
3
  import s from "styled-components";
6
- import { useMainNav as f } from "./MainNavContext.js";
7
- import { Box as v } from "../Box/Box.js";
4
+ import { useMainNav as $ } from "./MainNavContext.js";
5
+ import { Box as g } from "../Box/Box.js";
8
6
  import { Typography as i } from "../Typography/Typography.js";
9
- import { Flex as $ } from "../Flex/Flex.js";
10
- import { Badge as b } from "../Badge/Badge.js";
11
- import { Tooltip as y } from "../Tooltip/Tooltip.js";
12
- const p = s(v)`
7
+ import { Flex as m } from "../Flex/Flex.js";
8
+ import { Badge as f } from "../Badge/Badge.js";
9
+ import { Tooltip as v } from "../Tooltip/Tooltip.js";
10
+ const c = s(g)`
13
11
  svg {
14
12
  width: 1rem;
15
13
  height: 1rem;
16
14
  }
17
- `, m = s(g)`
15
+ `, p = s(u)`
18
16
  position: relative;
19
17
  text-decoration: none;
20
18
  display: block;
@@ -53,9 +51,9 @@ const p = s(v)`
53
51
  font-weight: 500;
54
52
  }
55
53
  }
56
- `, u = s($)`
54
+ `, d = s(m)`
57
55
  padding: ${({ theme: r }) => `${r.spaces[2]} ${r.spaces[3]}`};
58
- `, h = s(b)`
56
+ `, h = s(f)`
59
57
  ${({ theme: r, condensed: a }) => a && `
60
58
  position: absolute;
61
59
  // Values based on visual aspect
@@ -77,27 +75,7 @@ const p = s(v)`
77
75
  padding: ${({ theme: r }) => `0 ${r.spaces[2]}`};
78
76
  border-radius: ${({ theme: r }) => r.spaces[10]};
79
77
  background: ${({ theme: r }) => r.colors.primary600};
80
- `, l = ({ children: r, icon: a, badgeContent: n, badgeAriaLabel: c, ...d }) => f() ? /* @__PURE__ */ o(y, { position: "right", label: r, children: /* @__PURE__ */ o(m, { ...d, children: /* @__PURE__ */ t(u, { as: "span", children: [
81
- /* @__PURE__ */ o(p, { "aria-hidden": !0, paddingRight: 0, as: "span", children: a }),
82
- n && /* @__PURE__ */ o(h, { condensed: !0, "aria-label": c, children: n })
83
- ] }) }) }) : /* @__PURE__ */ o(m, { ...d, children: /* @__PURE__ */ t(u, { as: "span", justifyContent: "space-between", children: [
84
- /* @__PURE__ */ t($, { children: [
85
- /* @__PURE__ */ o(p, { "aria-hidden": !0, paddingRight: 3, as: "span", children: a }),
86
- /* @__PURE__ */ o(i, { children: r })
87
- ] }),
88
- n && /* @__PURE__ */ o(h, { justifyContent: "center", "aria-label": c, children: n })
89
- ] }) });
90
- l.displayName = "NavLink";
91
- l.defaultProps = {
92
- badgeContent: void 0,
93
- badgeAriaLabel: void 0
94
- };
95
- l.propTypes = {
96
- badgeAriaLabel: e.string,
97
- badgeContent: e.oneOfType([e.string, e.number]),
98
- children: e.node.isRequired,
99
- icon: e.node.isRequired
100
- };
78
+ `, M = ({ children: r, icon: a, badgeContent: e, badgeAriaLabel: t, ...l }) => $() ? o(v, { position: "right", label: r, children: o(p, { ...l, children: n(d, { as: "span", children: [o(c, { "aria-hidden": !0, paddingRight: 0, as: "span", children: a }), e && o(h, { condensed: !0, "aria-label": t, children: e })] }) }) }) : o(p, { ...l, children: n(d, { as: "span", justifyContent: "space-between", children: [n(m, { children: [o(c, { "aria-hidden": !0, paddingRight: 3, as: "span", children: a }), o(i, { children: r })] }), e && o(h, { justifyContent: "center", "aria-label": t, children: e })] }) });
101
79
  export {
102
- l as NavLink
80
+ M as NavLink
103
81
  };