@strapi/design-system 1.7.10 → 1.8.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.
Files changed (116) hide show
  1. package/README.md +9 -17
  2. package/dist/Button/Button.cjs +2 -2
  3. package/dist/Button/Button.js +4 -4
  4. package/dist/Combobox/Combobox.cjs +14 -13
  5. package/dist/Combobox/Combobox.js +73 -68
  6. package/dist/DatePicker/DatePicker.cjs +82 -6
  7. package/dist/DatePicker/DatePicker.js +414 -55
  8. package/dist/DateTimePicker/DateTimePicker.cjs +7 -1
  9. package/dist/DateTimePicker/DateTimePicker.js +97 -53
  10. package/dist/DateTimePicker/index.cjs +1 -1
  11. package/dist/DateTimePicker/index.js +3 -2
  12. package/dist/DesignSystemProvider.cjs +1 -0
  13. package/dist/DesignSystemProvider.js +10 -0
  14. package/dist/Grid/Grid.cjs +3 -3
  15. package/dist/Grid/Grid.js +6 -3
  16. package/dist/MainNav/MainNav.cjs +2 -2
  17. package/dist/MainNav/MainNav.js +9 -31
  18. package/dist/MainNav/MainNavContext.cjs +1 -1
  19. package/dist/MainNav/MainNavContext.js +1 -1
  20. package/dist/MainNav/NavBrand.cjs +3 -3
  21. package/dist/MainNav/NavBrand.js +12 -38
  22. package/dist/MainNav/NavCondense.cjs +2 -2
  23. package/dist/MainNav/NavCondense.js +15 -23
  24. package/dist/MainNav/NavFooter.cjs +1 -1
  25. package/dist/MainNav/NavFooter.js +4 -10
  26. package/dist/MainNav/NavLink.cjs +9 -9
  27. package/dist/MainNav/NavLink.js +13 -35
  28. package/dist/MainNav/NavSection.cjs +1 -1
  29. package/dist/MainNav/NavSection.js +9 -43
  30. package/dist/MainNav/NavSections.cjs +2 -2
  31. package/dist/MainNav/NavSections.js +7 -21
  32. package/dist/MainNav/NavUser.cjs +2 -2
  33. package/dist/MainNav/NavUser.js +13 -27
  34. package/dist/NumberInput/NumberInput.cjs +2 -2
  35. package/dist/NumberInput/NumberInput.js +40 -40
  36. package/dist/Popover/Popover.cjs +3 -4
  37. package/dist/Popover/Popover.js +46 -48
  38. package/dist/Popover/index.cjs +1 -1
  39. package/dist/Popover/index.js +5 -9
  40. package/dist/Popover/primitives.cjs +1 -0
  41. package/dist/Popover/primitives.js +5 -0
  42. package/dist/Searchbar/Searchbar.cjs +2 -2
  43. package/dist/Searchbar/Searchbar.js +5 -5
  44. package/dist/Select/SelectParts.cjs +1 -1
  45. package/dist/Select/SelectParts.js +1 -1
  46. package/dist/Select/SingleSelect.cjs +1 -1
  47. package/dist/Select/SingleSelect.js +36 -32
  48. package/dist/SimpleMenu/SimpleMenu.cjs +9 -9
  49. package/dist/SimpleMenu/SimpleMenu.js +62 -151
  50. package/dist/SubNav/SubNav.cjs +5 -5
  51. package/dist/SubNav/SubNav.js +8 -13
  52. package/dist/SubNav/SubNavHeader.cjs +3 -3
  53. package/dist/SubNav/SubNavHeader.js +29 -76
  54. package/dist/SubNav/SubNavLink.cjs +13 -13
  55. package/dist/SubNav/SubNavLink.js +20 -52
  56. package/dist/SubNav/SubNavLinkSection.cjs +4 -4
  57. package/dist/SubNav/SubNavLinkSection.js +19 -35
  58. package/dist/SubNav/SubNavSection.cjs +2 -2
  59. package/dist/SubNav/SubNavSection.js +15 -55
  60. package/dist/SubNav/SubNavSectionLabel.cjs +3 -3
  61. package/dist/SubNav/SubNavSectionLabel.js +10 -38
  62. package/dist/SubNav/SubNavSections.cjs +1 -1
  63. package/dist/SubNav/SubNavSections.js +4 -18
  64. package/dist/TextInput/TextInput.cjs +1 -1
  65. package/dist/TextInput/TextInput.js +5 -5
  66. package/dist/ThemeProvider/ThemeProvider.cjs +2 -2
  67. package/dist/ThemeProvider/ThemeProvider.js +4 -3
  68. package/dist/TimePicker/TimePicker.cjs +5 -7
  69. package/dist/TimePicker/TimePicker.js +79 -33
  70. package/dist/TimePicker/index.cjs +1 -1
  71. package/dist/TimePicker/index.js +3 -2
  72. package/dist/helpers/context.cjs +1 -0
  73. package/dist/helpers/context.js +21 -0
  74. package/dist/helpers/getDefaultLocale.cjs +4 -1
  75. package/dist/helpers/getDefaultLocale.js +7 -2
  76. package/dist/hooks/useDateFormatter.cjs +1 -0
  77. package/dist/hooks/useDateFormatter.js +20 -0
  78. package/dist/index.cjs +1 -1
  79. package/dist/index.js +309 -304
  80. package/dist/v2/Breadcrumbs/Breadcrumbs.cjs +2 -2
  81. package/dist/v2/Breadcrumbs/Breadcrumbs.js +15 -23
  82. package/dist/v2/Breadcrumbs/Crumb.cjs +1 -1
  83. package/dist/v2/Breadcrumbs/Crumb.js +6 -25
  84. package/dist/v2/Breadcrumbs/CrumbLink.cjs +2 -2
  85. package/dist/v2/Breadcrumbs/CrumbLink.js +6 -15
  86. package/dist/v2/Breadcrumbs/CrumbSimpleMenu.cjs +4 -3
  87. package/dist/v2/Breadcrumbs/CrumbSimpleMenu.js +8 -14
  88. package/dist/v2/Breadcrumbs/Divider.cjs +1 -1
  89. package/dist/v2/Breadcrumbs/Divider.js +3 -4
  90. package/dist/v2/SimpleMenu/Menu.cjs +10 -10
  91. package/dist/v2/SimpleMenu/Menu.js +11 -11
  92. package/package.json +11 -10
  93. package/dist/DatePicker/DatePickerCalendar.cjs +0 -1
  94. package/dist/DatePicker/DatePickerCalendar.js +0 -43
  95. package/dist/DatePicker/DatePickerTd.cjs +0 -19
  96. package/dist/DatePicker/DatePickerTd.js +0 -29
  97. package/dist/DatePicker/DatePickerTh.cjs +0 -9
  98. package/dist/DatePicker/DatePickerTh.js +0 -18
  99. package/dist/DatePicker/compareDates.cjs +0 -1
  100. package/dist/DatePicker/compareDates.js +0 -4
  101. package/dist/DatePicker/components.cjs +0 -39
  102. package/dist/DatePicker/components.js +0 -53
  103. package/dist/DatePicker/utils/formatDate.cjs +0 -1
  104. package/dist/DatePicker/utils/formatDate.js +0 -4
  105. package/dist/DatePicker/utils/generateWeeks.cjs +0 -1
  106. package/dist/DatePicker/utils/generateWeeks.js +0 -17
  107. package/dist/DatePicker/utils/getDayOfWeek.cjs +0 -1
  108. package/dist/DatePicker/utils/getDayOfWeek.js +0 -15
  109. package/dist/DatePicker/utils/getMonths.cjs +0 -1
  110. package/dist/DatePicker/utils/getMonths.js +0 -7
  111. package/dist/DatePicker/utils/getYears.cjs +0 -1
  112. package/dist/DatePicker/utils/getYears.js +0 -9
  113. package/dist/DatePicker/utils/index.cjs +0 -1
  114. package/dist/DatePicker/utils/index.js +0 -12
  115. package/dist/DateTimePicker/parseDate.cjs +0 -1
  116. package/dist/DateTimePicker/parseDate.js +0 -8
@@ -1,56 +1,100 @@
1
- import { jsx as r, jsxs as D } from "react/jsx-runtime";
2
- import { useControllableState as P } from "../hooks/useControllableState.js";
3
- import { useId as V } from "../hooks/useId.js";
4
- import { DatePicker as j } from "../DatePicker/DatePicker.js";
5
- import { TimePicker as q } from "../TimePicker/TimePicker.js";
6
- import { Field as v } from "../Field/Field.js";
7
- import { Flex as C } from "../Flex/Flex.js";
8
- import { FieldLabel as z } from "../Field/FieldLabel.js";
9
- import { FieldHint as B } from "../Field/FieldHint.js";
10
- import { FieldError as E } from "../Field/FieldError.js";
11
- const Z = ({ ariaLabel: a, clearLabel: n = "clear", disabled: f = !1, error: d, hint: c, id: b, label: m, labelAction: I, onChange: T, onClear: g, name: $, required: u = !1, selectButtonTitle: w = "select", size: h = "M", step: y = 1, value: F, ...H }) => {
12
- const M = A(F), [t, o] = P({
13
- prop: M,
14
- onChange: T
15
- }), i = t ? `${t.getHours()}:${t.getMinutes()}:${t.getSeconds()}` : void 0, k = (e) => {
16
- if (i) {
17
- const [s, p] = i.split(":");
18
- e.setHours(parseInt(s, 10)), e.setMinutes(parseInt(p, 10));
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
+ import $ from "styled-components";
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";
13
+ import { Flex as L } from "../Flex/Flex.js";
14
+ import { FieldLabel as ee } from "../Field/FieldLabel.js";
15
+ import { VisuallyHidden as S } from "../VisuallyHidden/VisuallyHidden.js";
16
+ import { FieldHint as te } from "../Field/FieldHint.js";
17
+ import { FieldError as re } from "../Field/FieldError.js";
18
+ const xe = ({
19
+ /**
20
+ * @preserve
21
+ * @deprecated This is no longer used.
22
+ */
23
+ ariaLabel: n,
24
+ clearLabel: d = "clear",
25
+ dateLabel: p = "Choose date",
26
+ timeLabel: a = "Choose time",
27
+ disabled: s = !1,
28
+ error: h,
29
+ hint: V,
30
+ id: _,
31
+ label: N,
32
+ labelAction: R,
33
+ onChange: k,
34
+ onClear: c,
35
+ name: j,
36
+ required: D = !1,
37
+ /**
38
+ * @preserve
39
+ * @deprecated This is no longer used.
40
+ */
41
+ selectButtonTitle: ae,
42
+ size: C = "M",
43
+ step: z,
44
+ value: g,
45
+ initialDate: w,
46
+ ...B
47
+ }) => {
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,
51
+ onChange(e) {
52
+ k && k(e?.toDate(b()));
19
53
  }
20
- o(e);
21
- }, x = (e) => {
22
- const s = t ? new Date(t) : /* @__PURE__ */ new Date(), [p, N] = e.split(":");
23
- s.setHours(parseInt(p, 10)), s.setMinutes(parseInt(N, 10)), o(s);
24
- }, S = () => {
25
- o(void 0), g && g();
26
- }, L = () => {
27
- let e = t ? new Date(t) : /* @__PURE__ */ new Date();
28
- e.setHours(0), e.setMinutes(0), o(e);
29
- }, l = V(b);
30
- return r(v, { name: $, role: "group", id: l, "aria-labelledby": l, hint: c, error: d, required: u, children: D(C, { direction: "column", alignItems: "stretch", gap: 1, children: [r(z, { action: I, children: m }), D(C, { gap: 2, children: [r(j, { ariaLabel: m || a, selectedDate: t, selectedDateLabel: (e) => `Date picker, current is ${e}`, onChange: k, error: typeof d == "string", hint: typeof c == "string", required: u, size: h, onClear: S, clearLabel: `${n} date`, disabled: f, id: l, ...H }), r(q, {
31
- size: h,
32
- "aria-label": m || a,
33
- error: typeof d == "string",
34
- hint: typeof c == "string",
35
- value: i,
36
- onChange: x,
37
- /**
38
- * In reality the time picker is only cleared when there is no date otherwise it's just 00:00
39
- * and we should show that for accurate UX and therefore you cannot clear it when it's 00:00.
40
- */
41
- onClear: i !== void 0 && i !== "0:0:0" ? L : void 0,
42
- clearLabel: `${n} time`,
43
- required: u,
44
- selectButtonTitle: w,
45
- disabled: f,
46
- step: y,
47
- id: l
48
- })] }), r(B, {}), r(E, {})] }) });
49
- }, A = (a) => {
50
- const n = Date.parse(a);
51
- if (!Number.isNaN(n))
52
- return new Date(n);
53
- };
54
+ }), H = J("DateTimePicker"), O = W(H.locale, {
55
+ hour: "2-digit",
56
+ minute: "2-digit",
57
+ hour12: !1
58
+ }), l = t ? O.format(t.toDate(b())) : "", q = (e) => {
59
+ let r = e ? m(e) : void 0;
60
+ if (!(r && t && r.compare(t) === 0)) {
61
+ if (l && r) {
62
+ const [u, T] = l.split(":");
63
+ r = r.set({ hour: parseInt(u, 10), minute: parseInt(T, 10) });
64
+ }
65
+ f(r);
66
+ }
67
+ }, A = (e) => {
68
+ if (!e)
69
+ return;
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)`
91
+ flex: 1 1 70%;
92
+ min-width: 120px;
93
+ `, ne = $(X)`
94
+ flex: 1 1 30%;
95
+ min-width: 120px;
96
+ `;
54
97
  export {
55
- Z as DateTimePicker
98
+ xe as DateTimePicker,
99
+ m as convertUTCDateToCalendarDateTime
56
100
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./DateTimePicker.cjs");exports.DateTimePicker=e.DateTimePicker;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./DateTimePicker.cjs");exports.DateTimePicker=e.DateTimePicker;exports.convertUTCDateToCalendarDateTime=e.convertUTCDateToCalendarDateTime;
@@ -1,4 +1,5 @@
1
- import { DateTimePicker as i } from "./DateTimePicker.js";
1
+ import { DateTimePicker as r, convertUTCDateToCalendarDateTime as t } from "./DateTimePicker.js";
2
2
  export {
3
- i as DateTimePicker
3
+ r as DateTimePicker,
4
+ t as convertUTCDateToCalendarDateTime
4
5
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("./helpers/context.cjs"),s=require("./ThemeProvider/ThemeProvider.cjs"),t="en-EN",r=()=>typeof navigator>"u"?t:navigator.language?navigator.language:t,[a,u]=o.createContext("StrapiDesignSystem",{locale:r()}),c=({locale:n=r(),...i})=>e.jsx(a,{locale:n,children:e.jsx(s.ThemeProvider,{...i})});exports.DesignSystemProvider=c;exports.useDesignSystem=u;
@@ -0,0 +1,10 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { createContext as i } from "./helpers/context.js";
3
+ import { ThemeProvider as a } from "./ThemeProvider/ThemeProvider.js";
4
+ const r = "en-EN", t = () => typeof navigator > "u" ? r : navigator.language ? navigator.language : r, [s, l] = i("StrapiDesignSystem", {
5
+ locale: t()
6
+ }), u = ({ locale: o = t(), ...n }) => e(s, { locale: o, children: e(a, { ...n }) });
7
+ export {
8
+ u as DesignSystemProvider,
9
+ l as useDesignSystem
10
+ };
@@ -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
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("react"),x=require("prop-types"),g=require("./MainNavContext.cjs"),h=require("../Divider/Divider.cjs"),i=require("../Flex/Flex.cjs"),l=require("../Box/Box.cjs"),m=require("../VisuallyHidden/VisuallyHidden.cjs"),j=require("../Typography/Typography.cjs"),q=n=>n&&n.__esModule?n:{default:n},u=q(x),p=({label:n,children:d,spacing:a=2,horizontal:r=!1,...c})=>g.useMainNav()?e.jsxs(i.Flex,{direction:"column",alignItems:"stretch",gap:2,children:[e.jsxs(l.Box,{paddingTop:1,paddingBottom:1,background:"neutral0",hasRadius:!0,as:"span",children:[e.jsx(h.Divider,{}),e.jsx(m.VisuallyHidden,{children:e.jsx("span",{children:n})})]}),e.jsx(i.Flex,{as:"ul",gap:a,direction:r?"row":"column",alignItems:r?"center":"stretch",...c,children:o.Children.map(d,(t,s)=>e.jsx("li",{children:t},s))})]}):e.jsxs(i.Flex,{direction:"column",alignItems:"stretch",gap:2,children:[e.jsx(l.Box,{paddingTop:1,paddingBottom:1,background:"neutral0",paddingRight:3,paddingLeft:3,hasRadius:!0,as:"span",children:e.jsx(j.Typography,{variant:"sigma",textColor:"neutral600",children:n})}),e.jsx(i.Flex,{as:"ul",gap:a,direction:r?"row":"column",alignItems:r?"center":"stretch",...c,children:o.Children.map(d,(t,s)=>e.jsx("li",{children:t},s))})]});p.propTypes={children:u.default.node.isRequired,label:u.default.string.isRequired};exports.NavSection=p;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("react"),x=require("./MainNavContext.cjs"),g=require("../Divider/Divider.cjs"),r=require("../Flex/Flex.cjs"),l=require("../Box/Box.cjs"),p=require("../VisuallyHidden/VisuallyHidden.cjs"),h=require("../Typography/Typography.cjs"),m=n=>n&&n.__esModule?n:{default:n},o=m(u),j=({label:n,children:a,spacing:d=2,horizontal:t=!1,...c})=>x.useMainNav()?e.jsxs(r.Flex,{direction:"column",alignItems:"stretch",gap:2,children:[e.jsxs(l.Box,{paddingTop:1,paddingBottom:1,background:"neutral0",hasRadius:!0,as:"span",children:[e.jsx(g.Divider,{}),e.jsx(p.VisuallyHidden,{children:e.jsx("span",{children:n})})]}),e.jsx(r.Flex,{as:"ul",gap:d,direction:t?"row":"column",alignItems:t?"center":"stretch",...c,children:o.default.Children.map(a,(i,s)=>e.jsx("li",{children:i},s))})]}):e.jsxs(r.Flex,{direction:"column",alignItems:"stretch",gap:2,children:[e.jsx(l.Box,{paddingTop:1,paddingBottom:1,background:"neutral0",paddingRight:3,paddingLeft:3,hasRadius:!0,as:"span",children:e.jsx(h.Typography,{variant:"sigma",textColor:"neutral600",children:n})}),e.jsx(r.Flex,{as:"ul",gap:d,direction:t?"row":"column",alignItems:t?"center":"stretch",...c,children:o.default.Children.map(a,(i,s)=>e.jsx("li",{children:i},s))})]});exports.NavSection=j;