@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.
- package/README.md +9 -17
- package/dist/Button/Button.cjs +2 -2
- package/dist/Button/Button.js +4 -4
- package/dist/Combobox/Combobox.cjs +14 -13
- package/dist/Combobox/Combobox.js +73 -68
- package/dist/DatePicker/DatePicker.cjs +82 -6
- package/dist/DatePicker/DatePicker.js +414 -55
- package/dist/DateTimePicker/DateTimePicker.cjs +7 -1
- package/dist/DateTimePicker/DateTimePicker.js +97 -53
- package/dist/DateTimePicker/index.cjs +1 -1
- package/dist/DateTimePicker/index.js +3 -2
- package/dist/DesignSystemProvider.cjs +1 -0
- package/dist/DesignSystemProvider.js +10 -0
- package/dist/Grid/Grid.cjs +3 -3
- package/dist/Grid/Grid.js +6 -3
- package/dist/MainNav/MainNav.cjs +2 -2
- package/dist/MainNav/MainNav.js +9 -31
- package/dist/MainNav/MainNavContext.cjs +1 -1
- package/dist/MainNav/MainNavContext.js +1 -1
- package/dist/MainNav/NavBrand.cjs +3 -3
- package/dist/MainNav/NavBrand.js +12 -38
- package/dist/MainNav/NavCondense.cjs +2 -2
- package/dist/MainNav/NavCondense.js +15 -23
- package/dist/MainNav/NavFooter.cjs +1 -1
- package/dist/MainNav/NavFooter.js +4 -10
- package/dist/MainNav/NavLink.cjs +9 -9
- package/dist/MainNav/NavLink.js +13 -35
- package/dist/MainNav/NavSection.cjs +1 -1
- package/dist/MainNav/NavSection.js +9 -43
- package/dist/MainNav/NavSections.cjs +2 -2
- package/dist/MainNav/NavSections.js +7 -21
- package/dist/MainNav/NavUser.cjs +2 -2
- package/dist/MainNav/NavUser.js +13 -27
- package/dist/NumberInput/NumberInput.cjs +2 -2
- package/dist/NumberInput/NumberInput.js +40 -40
- package/dist/Popover/Popover.cjs +3 -4
- package/dist/Popover/Popover.js +46 -48
- package/dist/Popover/index.cjs +1 -1
- package/dist/Popover/index.js +5 -9
- package/dist/Popover/primitives.cjs +1 -0
- package/dist/Popover/primitives.js +5 -0
- package/dist/Searchbar/Searchbar.cjs +2 -2
- package/dist/Searchbar/Searchbar.js +5 -5
- package/dist/Select/SelectParts.cjs +1 -1
- package/dist/Select/SelectParts.js +1 -1
- package/dist/Select/SingleSelect.cjs +1 -1
- package/dist/Select/SingleSelect.js +36 -32
- package/dist/SimpleMenu/SimpleMenu.cjs +9 -9
- package/dist/SimpleMenu/SimpleMenu.js +62 -151
- package/dist/SubNav/SubNav.cjs +5 -5
- package/dist/SubNav/SubNav.js +8 -13
- package/dist/SubNav/SubNavHeader.cjs +3 -3
- package/dist/SubNav/SubNavHeader.js +29 -76
- package/dist/SubNav/SubNavLink.cjs +13 -13
- package/dist/SubNav/SubNavLink.js +20 -52
- package/dist/SubNav/SubNavLinkSection.cjs +4 -4
- package/dist/SubNav/SubNavLinkSection.js +19 -35
- package/dist/SubNav/SubNavSection.cjs +2 -2
- package/dist/SubNav/SubNavSection.js +15 -55
- package/dist/SubNav/SubNavSectionLabel.cjs +3 -3
- package/dist/SubNav/SubNavSectionLabel.js +10 -38
- package/dist/SubNav/SubNavSections.cjs +1 -1
- package/dist/SubNav/SubNavSections.js +4 -18
- package/dist/TextInput/TextInput.cjs +1 -1
- package/dist/TextInput/TextInput.js +5 -5
- package/dist/ThemeProvider/ThemeProvider.cjs +2 -2
- package/dist/ThemeProvider/ThemeProvider.js +4 -3
- package/dist/TimePicker/TimePicker.cjs +5 -7
- package/dist/TimePicker/TimePicker.js +79 -33
- package/dist/TimePicker/index.cjs +1 -1
- package/dist/TimePicker/index.js +3 -2
- package/dist/helpers/context.cjs +1 -0
- package/dist/helpers/context.js +21 -0
- package/dist/helpers/getDefaultLocale.cjs +4 -1
- package/dist/helpers/getDefaultLocale.js +7 -2
- package/dist/hooks/useDateFormatter.cjs +1 -0
- package/dist/hooks/useDateFormatter.js +20 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +309 -304
- package/dist/v2/Breadcrumbs/Breadcrumbs.cjs +2 -2
- package/dist/v2/Breadcrumbs/Breadcrumbs.js +15 -23
- package/dist/v2/Breadcrumbs/Crumb.cjs +1 -1
- package/dist/v2/Breadcrumbs/Crumb.js +6 -25
- package/dist/v2/Breadcrumbs/CrumbLink.cjs +2 -2
- package/dist/v2/Breadcrumbs/CrumbLink.js +6 -15
- package/dist/v2/Breadcrumbs/CrumbSimpleMenu.cjs +4 -3
- package/dist/v2/Breadcrumbs/CrumbSimpleMenu.js +8 -14
- package/dist/v2/Breadcrumbs/Divider.cjs +1 -1
- package/dist/v2/Breadcrumbs/Divider.js +3 -4
- package/dist/v2/SimpleMenu/Menu.cjs +10 -10
- package/dist/v2/SimpleMenu/Menu.js +11 -11
- package/package.json +11 -10
- package/dist/DatePicker/DatePickerCalendar.cjs +0 -1
- package/dist/DatePicker/DatePickerCalendar.js +0 -43
- package/dist/DatePicker/DatePickerTd.cjs +0 -19
- package/dist/DatePicker/DatePickerTd.js +0 -29
- package/dist/DatePicker/DatePickerTh.cjs +0 -9
- package/dist/DatePicker/DatePickerTh.js +0 -18
- package/dist/DatePicker/compareDates.cjs +0 -1
- package/dist/DatePicker/compareDates.js +0 -4
- package/dist/DatePicker/components.cjs +0 -39
- package/dist/DatePicker/components.js +0 -53
- package/dist/DatePicker/utils/formatDate.cjs +0 -1
- package/dist/DatePicker/utils/formatDate.js +0 -4
- package/dist/DatePicker/utils/generateWeeks.cjs +0 -1
- package/dist/DatePicker/utils/generateWeeks.js +0 -17
- package/dist/DatePicker/utils/getDayOfWeek.cjs +0 -1
- package/dist/DatePicker/utils/getDayOfWeek.js +0 -15
- package/dist/DatePicker/utils/getMonths.cjs +0 -1
- package/dist/DatePicker/utils/getMonths.js +0 -7
- package/dist/DatePicker/utils/getYears.cjs +0 -1
- package/dist/DatePicker/utils/getYears.js +0 -9
- package/dist/DatePicker/utils/index.cjs +0 -1
- package/dist/DatePicker/utils/index.js +0 -12
- package/dist/DateTimePicker/parseDate.cjs +0 -1
- package/dist/DateTimePicker/parseDate.js +0 -8
|
@@ -1,56 +1,100 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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
|
-
|
|
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;
|
|
@@ -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
|
+
};
|
package/dist/Grid/Grid.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
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})=>
|
|
5
|
-
`,
|
|
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
|
|
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
|
|
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 = (
|
|
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
|
};
|
package/dist/MainNav/MainNav.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
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
|
-
`,
|
|
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;
|
package/dist/MainNav/MainNav.js
CHANGED
|
@@ -1,33 +1,11 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import "
|
|
3
|
-
import
|
|
4
|
-
import i from "
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
|
|
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(),
|
|
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,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
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
|
-
`,
|
|
9
|
+
`,g=l.default(i.NavLink)`
|
|
10
10
|
text-decoration: unset;
|
|
11
11
|
color: inherit;
|
|
12
|
-
`,
|
|
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;
|
package/dist/MainNav/NavBrand.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import "react";
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
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
|
-
`,
|
|
17
|
+
`, g = c(t)`
|
|
20
18
|
text-decoration: unset;
|
|
21
19
|
color: inherit;
|
|
22
|
-
`,
|
|
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
|
-
|
|
22
|
+
N as NavBrand
|
|
49
23
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
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
|
-
`,
|
|
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
|
|
2
|
-
import "
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
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 =
|
|
10
|
-
background: ${({ theme:
|
|
11
|
-
border: 1px solid ${({ theme:
|
|
12
|
-
border-radius: ${({ theme:
|
|
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:
|
|
19
|
-
transform: ${({ condensed:
|
|
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
|
-
`,
|
|
29
|
-
const o =
|
|
30
|
-
return
|
|
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
|
-
|
|
31
|
+
b as NavCondense
|
|
40
32
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
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
|
|
2
|
-
import "
|
|
3
|
-
|
|
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
|
-
|
|
5
|
+
m as NavFooter
|
|
12
6
|
};
|
package/dist/MainNav/NavLink.cjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime")
|
|
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
|
-
`,
|
|
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
|
-
${
|
|
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
|
-
${
|
|
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
|
-
${
|
|
40
|
+
${o.Typography} {
|
|
41
41
|
color: ${({theme:e})=>e.colors.primary600};
|
|
42
42
|
font-weight: 500;
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
`,
|
|
45
|
+
`,d=t.default(p.Flex)`
|
|
46
46
|
padding: ${({theme:e})=>`${e.spaces[2]} ${e.spaces[3]}`};
|
|
47
|
-
`,
|
|
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
|
-
${
|
|
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
|
-
`,
|
|
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;
|
package/dist/MainNav/NavLink.js
CHANGED
|
@@ -1,20 +1,18 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
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
|
|
7
|
-
import { Box as
|
|
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
|
|
10
|
-
import { Badge as
|
|
11
|
-
import { Tooltip as
|
|
12
|
-
const
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
54
|
+
`, d = s(m)`
|
|
57
55
|
padding: ${({ theme: r }) => `${r.spaces[2]} ${r.spaces[3]}`};
|
|
58
|
-
`, h = s(
|
|
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
|
-
`,
|
|
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
|
-
|
|
80
|
+
M as NavLink
|
|
103
81
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),
|
|
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;
|