@strapi/design-system 1.5.0-alpha.0 → 1.6.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Accordion/Accordion.cjs +8 -8
- package/dist/Accordion/Accordion.js +73 -67
- package/dist/Accordion/AccordionContent.cjs +1 -1
- package/dist/Accordion/AccordionContent.js +20 -17
- package/dist/Accordion/AccordionContext.cjs +1 -1
- package/dist/Accordion/AccordionContext.js +10 -4
- package/dist/Accordion/AccordionGroup.cjs +20 -20
- package/dist/Accordion/AccordionGroup.js +98 -59
- package/dist/Accordion/AccordionToggle.cjs +3 -3
- package/dist/Accordion/AccordionToggle.js +108 -89
- package/dist/Accordion/utils.cjs +1 -1
- package/dist/Accordion/utils.js +4 -4
- package/dist/Alert/Alert.cjs +7 -7
- package/dist/Alert/Alert.js +92 -85
- package/dist/Avatar/Avatar.cjs +6 -6
- package/dist/Avatar/Avatar.js +68 -67
- package/dist/Avatar/constants.cjs +1 -1
- package/dist/Avatar/constants.js +1 -1
- package/dist/Badge/Badge.cjs +4 -4
- package/dist/Badge/Badge.js +37 -37
- package/dist/BaseButton/BaseButton.cjs +3 -3
- package/dist/BaseButton/BaseButton.js +39 -27
- package/dist/BaseCheckbox/BaseCheckbox.cjs +6 -6
- package/dist/BaseCheckbox/BaseCheckbox.js +77 -59
- package/dist/BaseLink/BaseLink.cjs +2 -2
- package/dist/BaseLink/BaseLink.js +20 -27
- package/dist/BaseRadio/BaseRadio.cjs +7 -7
- package/dist/BaseRadio/BaseRadio.js +55 -35
- package/dist/BaseRadio/RadioGroup.cjs +1 -1
- package/dist/BaseRadio/RadioGroup.js +31 -28
- package/dist/BaseRadio/context.cjs +1 -1
- package/dist/BaseRadio/context.js +8 -4
- package/dist/BaseRadio/utils.cjs +1 -1
- package/dist/BaseRadio/utils.js +1 -1
- package/dist/Box/Box.cjs +31 -32
- package/dist/Box/Box.js +182 -59
- package/dist/Breadcrumbs/Breadcrumbs.cjs +3 -3
- package/dist/Breadcrumbs/Breadcrumbs.js +50 -39
- package/dist/Button/Button.cjs +20 -20
- package/dist/Button/Button.js +83 -74
- package/dist/Button/utils.cjs +23 -23
- package/dist/Button/utils.js +15 -15
- package/dist/Card/Card.cjs +1 -1
- package/dist/Card/Card.js +28 -29
- package/dist/Card/CardAction.cjs +4 -4
- package/dist/Card/CardAction.js +12 -6
- package/dist/Card/CardAsset.cjs +4 -4
- package/dist/Card/CardAsset.js +32 -26
- package/dist/Card/CardBadge.cjs +3 -3
- package/dist/Card/CardBadge.js +14 -10
- package/dist/Card/CardBody.cjs +1 -1
- package/dist/Card/CardBody.js +11 -10
- package/dist/Card/CardCheckbox.cjs +1 -1
- package/dist/Card/CardCheckbox.js +16 -13
- package/dist/Card/CardContent.cjs +2 -2
- package/dist/Card/CardContent.js +11 -11
- package/dist/Card/CardContext.cjs +1 -1
- package/dist/Card/CardContext.js +3 -1
- package/dist/Card/CardHeader.cjs +2 -2
- package/dist/Card/CardHeader.js +9 -7
- package/dist/Card/CardTimer.cjs +2 -2
- package/dist/Card/CardTimer.js +21 -16
- package/dist/Card/CardTitle.cjs +1 -1
- package/dist/Card/CardTitle.js +11 -9
- package/dist/CarouselInput/Carousel.cjs +4 -4
- package/dist/CarouselInput/Carousel.js +8 -9
- package/dist/Combobox/Combobox.cjs +1 -1
- package/dist/Combobox/Combobox.js +32 -33
- package/dist/DatePicker/DatePicker.cjs +1 -1
- package/dist/DatePicker/DatePicker.js +26 -29
- package/dist/Flex/Flex.cjs +5 -5
- package/dist/Flex/Flex.js +29 -17
- package/dist/Icon/Icon.cjs +3 -3
- package/dist/Icon/Icon.js +23 -19
- package/dist/JSONInput/JSONInput.cjs +1 -0
- package/dist/JSONInput/JSONInput.js +97 -0
- package/dist/JSONInput/JSONInputContainer.cjs +30 -0
- package/dist/JSONInput/JSONInputContainer.js +36 -0
- package/dist/JSONInput/index.cjs +1 -0
- package/dist/JSONInput/index.js +4 -0
- package/dist/JSONInput/utils/decorationExtension.cjs +1 -0
- package/dist/JSONInput/utils/decorationExtension.js +24 -0
- package/dist/KeyboardNavigable/KeyboardNavigable.cjs +1 -1
- package/dist/KeyboardNavigable/KeyboardNavigable.js +44 -49
- package/dist/Link/Link.cjs +5 -5
- package/dist/Link/Link.js +1 -1
- package/dist/LiveRegions/LiveRegions.cjs +1 -1
- package/dist/LiveRegions/LiveRegions.js +22 -20
- package/dist/LiveRegions/index.cjs +1 -1
- package/dist/LiveRegions/index.js +4 -2
- package/dist/MainNav/NavCondense.cjs +3 -3
- package/dist/MainNav/NavCondense.js +1 -2
- package/dist/MainNav/NavSections.cjs +3 -3
- package/dist/MainNav/NavSections.js +5 -5
- package/dist/ModalLayout/ModalHeader.cjs +2 -2
- package/dist/ModalLayout/ModalHeader.js +1 -1
- package/dist/NumberInput/NumberInput.cjs +2 -2
- package/dist/NumberInput/NumberInput.js +1 -1
- package/dist/Pagination/components.cjs +6 -6
- package/dist/Pagination/components.js +16 -17
- package/dist/Searchbar/Searchbar.cjs +7 -7
- package/dist/Searchbar/Searchbar.js +7 -8
- package/dist/Select/Select.cjs +2 -2
- package/dist/Select/Select.js +4 -5
- package/dist/Select/SelectTags.cjs +3 -3
- package/dist/Select/SelectTags.js +1 -1
- package/dist/SimpleMenu/SimpleMenu.cjs +9 -9
- package/dist/SimpleMenu/SimpleMenu.js +1 -1
- package/dist/Stack/Stack.cjs +5 -5
- package/dist/Stack/Stack.js +33 -33
- package/dist/SubNav/SubNavHeader.cjs +2 -2
- package/dist/SubNav/SubNavHeader.js +1 -1
- package/dist/SubNav/SubNavLink.cjs +4 -4
- package/dist/SubNav/SubNavLink.js +4 -4
- package/dist/SubNav/SubNavLinkSection.cjs +2 -2
- package/dist/SubNav/SubNavLinkSection.js +1 -1
- package/dist/SubNav/SubNavSectionLabel.cjs +3 -3
- package/dist/SubNav/SubNavSectionLabel.js +1 -1
- package/dist/TextButton/TextButton.cjs +6 -6
- package/dist/TextButton/TextButton.js +51 -50
- package/dist/ThemeProvider/ThemeProvider.cjs +2 -2
- package/dist/ThemeProvider/ThemeProvider.js +12 -11
- package/dist/TimePicker/TimePicker.cjs +2 -2
- package/dist/TimePicker/TimePicker.js +1 -1
- package/dist/Typography/Typography.cjs +7 -7
- package/dist/Typography/Typography.js +28 -17
- package/dist/Typography/utils.cjs +2 -2
- package/dist/Typography/utils.js +6 -6
- package/dist/helpers/arrays.cjs +1 -0
- package/dist/helpers/arrays.js +6 -0
- package/dist/helpers/handleResponsiveValues.cjs +1 -5
- package/dist/helpers/handleResponsiveValues.js +21 -15
- package/dist/helpers/objects.cjs +1 -0
- package/dist/helpers/objects.js +26 -0
- package/dist/helpers/setOpacity.cjs +1 -1
- package/dist/helpers/setOpacity.js +1 -1
- package/dist/helpers/theme.cjs +1 -0
- package/dist/helpers/theme.js +7 -0
- package/dist/helpers/useIntersection.cjs +1 -1
- package/dist/helpers/useIntersection.js +8 -8
- package/dist/hooks/useControllableState.cjs +1 -1
- package/dist/hooks/useControllableState.js +13 -16
- package/dist/index.cjs +1 -1
- package/dist/index.js +205 -201
- package/dist/themes/extendTheme.cjs +4 -4
- package/dist/themes/extendTheme.js +13 -21
- package/dist/v2/Breadcrumbs/CrumbSimpleMenu.cjs +2 -2
- package/dist/v2/Breadcrumbs/CrumbSimpleMenu.js +1 -1
- package/dist/v2/Link/Link.cjs +4 -4
- package/dist/v2/Link/Link.js +1 -1
- package/dist/v2/MainNav/NavCondense.cjs +3 -3
- package/dist/v2/MainNav/NavCondense.js +1 -2
- package/dist/v2/MainNav/NavSections.cjs +3 -3
- package/dist/v2/MainNav/NavSections.js +5 -5
- package/dist/v2/Pagination/components.cjs +7 -7
- package/dist/v2/Pagination/components.js +18 -19
- package/dist/v2/SimpleMenu/SimpleMenu.cjs +9 -9
- package/dist/v2/SimpleMenu/SimpleMenu.js +96 -89
- package/dist/v2/SubNav/SubNavHeader.cjs +2 -2
- package/dist/v2/SubNav/SubNavHeader.js +1 -1
- package/dist/v2/SubNav/SubNavLink.cjs +4 -4
- package/dist/v2/SubNav/SubNavLink.js +1 -1
- package/dist/v2/SubNav/SubNavLinkSection.cjs +4 -4
- package/dist/v2/SubNav/SubNavLinkSection.js +1 -1
- package/dist/v2/SubNav/SubNavSectionLabel.cjs +3 -3
- package/dist/v2/SubNav/SubNavSectionLabel.js +1 -1
- package/package.json +18 -15
- package/dist/Box/BoxProps.cjs +0 -1
- package/dist/Box/BoxProps.js +0 -51
- package/dist/Flex/FlexProps.cjs +0 -1
- package/dist/Flex/FlexProps.js +0 -41
- package/dist/FocusTrap/ExampleComponent.cjs +0 -1
- package/dist/FocusTrap/ExampleComponent.js +0 -71
- package/dist/LiveRegions/StoryComponent.cjs +0 -1
- package/dist/LiveRegions/StoryComponent.js +0 -18
- package/dist/Typography/TypographyProps.cjs +0 -1
- package/dist/Typography/TypographyProps.js +0 -31
- package/dist/themes/ColorButton.cjs +0 -3
- package/dist/themes/ColorButton.js +0 -25
- package/dist/themes/colors.cjs +0 -1
- package/dist/themes/colors.js +0 -49
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("react"),d=require("prop-types"),l=require("styled-components"),s=require("@strapi/icons"),c=require("../../Icon/Icon.cjs"),u=require("../../VisuallyHidden/VisuallyHidden.cjs"),p=require("./MainNavContext.cjs"),o=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},n=o(i),f=o(d),h=o(l),y=h.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};
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
justify-content: center;
|
|
8
8
|
position: absolute;
|
|
9
9
|
bottom: ${(9+4)/16}rem; // 9 is the height of the svg and 4 is the padding below
|
|
10
|
-
right: ${({theme:e,condensed:
|
|
10
|
+
right: ${({theme:e,condensed:t})=>t?0:e.spaces[5]};
|
|
11
11
|
transform: ${({condensed:e})=>e?"translateX(50%)":void 0};
|
|
12
12
|
z-index: 2;
|
|
13
13
|
width: ${18/16}rem;
|
|
@@ -17,4 +17,4 @@
|
|
|
17
17
|
width: ${6/16}rem;
|
|
18
18
|
height: ${9/16}rem;
|
|
19
19
|
}
|
|
20
|
-
`,
|
|
20
|
+
`,a=({children:e,...t})=>{const r=p.useMainNav();return n.default.createElement(y,{as:"button",condensed:r,...t},n.default.createElement(c.Icon,{as:r?s.ChevronRight:s.ChevronLeft,"aria-hidden":!0,color:"neutral600"}),n.default.createElement(u.VisuallyHidden,null,e))};a.propTypes={children:f.default.string.isRequired};exports.NavCondense=a;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import t from "react";
|
|
2
2
|
import n from "prop-types";
|
|
3
3
|
import i from "styled-components";
|
|
4
|
-
import s from "@strapi/icons
|
|
5
|
-
import a from "@strapi/icons/ChevronLeft";
|
|
4
|
+
import { ChevronRight as s, ChevronLeft as a } from "@strapi/icons";
|
|
6
5
|
import { Icon as d } from "../../Icon/Icon.js";
|
|
7
6
|
import { VisuallyHidden as m } from "../../VisuallyHidden/VisuallyHidden.js";
|
|
8
7
|
import { useMainNav as l } from "./MainNavContext.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react"),d=require("prop-types"),l=require("styled-components"),u=require("../../Stack/Stack.cjs"),i=require("../../Box/Box.cjs"),o=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},t=o(a),p=o(d),f=o(l),y=f.default(i.Box)`
|
|
2
2
|
flex-grow: 1;
|
|
3
|
-
overflow-y:
|
|
4
|
-
`,
|
|
3
|
+
overflow-y: auto;
|
|
4
|
+
`,r=({children:e,...c})=>t.default.createElement(y,{paddingLeft:3,paddingRight:2,paddingTop:3,paddingBottom:8},t.default.createElement(u.Stack,{as:"ul",spacing:4,...c},a.Children.map(e,(n,s)=>t.default.createElement("li",{key:s},n))));r.propTypes={children:p.default.node.isRequired};exports.NavSections=r;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import e, { Children as i } from "react";
|
|
2
2
|
import n from "prop-types";
|
|
3
|
-
import
|
|
4
|
-
import { Stack as
|
|
3
|
+
import a from "styled-components";
|
|
4
|
+
import { Stack as m } from "../../Stack/Stack.js";
|
|
5
5
|
import { Box as d } from "../../Box/Box.js";
|
|
6
|
-
const l =
|
|
6
|
+
const l = a(d)`
|
|
7
7
|
flex-grow: 1;
|
|
8
|
-
overflow-y:
|
|
8
|
+
overflow-y: auto;
|
|
9
9
|
`, c = ({ children: o, ...r }) => /* @__PURE__ */ e.createElement(l, {
|
|
10
10
|
paddingLeft: 3,
|
|
11
11
|
paddingRight: 2,
|
|
12
12
|
paddingTop: 3,
|
|
13
13
|
paddingBottom: 8
|
|
14
|
-
}, /* @__PURE__ */ e.createElement(
|
|
14
|
+
}, /* @__PURE__ */ e.createElement(m, {
|
|
15
15
|
as: "ul",
|
|
16
16
|
spacing: 4,
|
|
17
17
|
...r
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const L=require("react"),k=require("styled-components"),q=require("prop-types"),g=require("@strapi/icons"),d=require("../../VisuallyHidden/VisuallyHidden.cjs"),u=require("./PaginationContext.cjs"),T=require("../../Typography/Typography.cjs"),x=require("../../themes/utils.cjs"),E=require("../../BaseLink/BaseLink.cjs"),c=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},a=c(L),s=c(k),l=c(q),v=s.default(T.Typography)`
|
|
2
2
|
line-height: revert;
|
|
3
|
-
|
|
3
|
+
`,w={active:!0},p=s.default(E.BaseLink).withConfig({shouldForwardProp:(e,t)=>!w[e]&&t(e)})`
|
|
4
4
|
padding: ${({theme:e})=>e.spaces[3]};
|
|
5
5
|
border-radius: ${({theme:e})=>e.borderRadius};
|
|
6
6
|
box-shadow: ${({active:e,theme:t})=>e?t.shadows.filterShadow:void 0};
|
|
7
7
|
text-decoration: none;
|
|
8
8
|
display: flex;
|
|
9
9
|
|
|
10
|
-
${
|
|
11
|
-
`,
|
|
10
|
+
${x.buttonFocusStyle}
|
|
11
|
+
`,R=s.default(p)`
|
|
12
12
|
color: ${({theme:e,active:t})=>t?e.colors.primary700:e.colors.neutral800};
|
|
13
13
|
background: ${({theme:e,active:t})=>t?e.colors.neutral0:void 0};
|
|
14
14
|
|
|
15
15
|
&:hover {
|
|
16
16
|
box-shadow: ${({theme:e})=>e.shadows.filterShadow};
|
|
17
17
|
}
|
|
18
|
-
`,
|
|
18
|
+
`,m=s.default(p)`
|
|
19
19
|
font-size: 0.7rem;
|
|
20
20
|
svg path {
|
|
21
21
|
fill: ${e=>e["aria-disabled"]?e.theme.colors.neutral300:e.theme.colors.neutral600};
|
|
@@ -31,6 +31,6 @@
|
|
|
31
31
|
${e=>e["aria-disabled"]?`
|
|
32
32
|
pointer-events: none;
|
|
33
33
|
`:void 0}
|
|
34
|
-
|
|
34
|
+
`,$=s.default(p)`
|
|
35
35
|
color: ${({theme:e})=>e.colors.neutral800};
|
|
36
|
-
`,
|
|
36
|
+
`,f=a.default.forwardRef(({children:e,...t},n)=>{const{activePage:i}=u.usePagination(),r=i===1;return a.default.createElement(m,{ref:n,"aria-disabled":r,tabIndex:r?-1:void 0,...t},a.default.createElement(d.VisuallyHidden,null,e),a.default.createElement(g.ChevronLeft,{"aria-hidden":!0}))});f.displayName="PreviousLink";const y=a.default.forwardRef(({children:e,...t},n)=>{const{activePage:i,pageCount:r}=u.usePagination(),o=i===r;return a.default.createElement(m,{ref:n,"aria-disabled":o,tabIndex:o?-1:void 0,...t},a.default.createElement(d.VisuallyHidden,null,e),a.default.createElement(g.ChevronRight,{"aria-hidden":!0}))});y.displayName="NextLink";const h=a.default.forwardRef(({number:e,children:t,...n},i)=>{const{activePage:r}=u.usePagination(),o=r===e;return a.default.createElement(R,{ref:i,...n,active:o},a.default.createElement(d.VisuallyHidden,null,t),a.default.createElement(v,{"aria-hidden":!0,variant:"pi",fontWeight:o?"bold":null},e))});h.displayName="PageLink";const P=({children:e,...t})=>a.default.createElement($,{...t,as:"div"},a.default.createElement(d.VisuallyHidden,null,e),a.default.createElement(v,{"aria-hidden":!0,variant:"pi"},"\u2026"));h.propTypes={children:l.default.node.isRequired,number:l.default.number.isRequired};const b={children:l.default.node.isRequired};y.propTypes=b;f.propTypes=b;P.propTypes={children:l.default.node.isRequired};exports.Dots=P;exports.NextLink=y;exports.PageLink=h;exports.PreviousLink=f;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import t from "react";
|
|
2
2
|
import s from "styled-components";
|
|
3
3
|
import d from "prop-types";
|
|
4
|
-
import b from "@strapi/icons
|
|
5
|
-
import y from "@strapi/icons/ChevronRight";
|
|
4
|
+
import { ChevronLeft as b, ChevronRight as y } from "@strapi/icons";
|
|
6
5
|
import { VisuallyHidden as l } from "../../VisuallyHidden/VisuallyHidden.js";
|
|
7
6
|
import { usePagination as c } from "./PaginationContext.js";
|
|
8
7
|
import { Typography as P } from "../../Typography/Typography.js";
|
|
@@ -47,47 +46,47 @@ const m = s(P)`
|
|
|
47
46
|
` : void 0}
|
|
48
47
|
`, $ = s(p)`
|
|
49
48
|
color: ${({ theme: e }) => e.colors.neutral800};
|
|
50
|
-
`, h =
|
|
51
|
-
const { activePage: i } = c(),
|
|
52
|
-
return /* @__PURE__ */
|
|
49
|
+
`, h = t.forwardRef(({ children: e, ...r }, a) => {
|
|
50
|
+
const { activePage: i } = c(), o = i === 1;
|
|
51
|
+
return /* @__PURE__ */ t.createElement(u, {
|
|
53
52
|
ref: a,
|
|
54
|
-
"aria-disabled":
|
|
55
|
-
tabIndex:
|
|
53
|
+
"aria-disabled": o,
|
|
54
|
+
tabIndex: o ? -1 : void 0,
|
|
56
55
|
...r
|
|
57
|
-
}, /* @__PURE__ */
|
|
56
|
+
}, /* @__PURE__ */ t.createElement(l, null, e), /* @__PURE__ */ t.createElement(b, {
|
|
58
57
|
"aria-hidden": !0
|
|
59
58
|
}));
|
|
60
59
|
});
|
|
61
60
|
h.displayName = "PreviousLink";
|
|
62
|
-
const f =
|
|
63
|
-
const { activePage: i, pageCount:
|
|
64
|
-
return /* @__PURE__ */
|
|
61
|
+
const f = t.forwardRef(({ children: e, ...r }, a) => {
|
|
62
|
+
const { activePage: i, pageCount: o } = c(), n = i === o;
|
|
63
|
+
return /* @__PURE__ */ t.createElement(u, {
|
|
65
64
|
ref: a,
|
|
66
65
|
"aria-disabled": n,
|
|
67
66
|
tabIndex: n ? -1 : void 0,
|
|
68
67
|
...r
|
|
69
|
-
}, /* @__PURE__ */
|
|
68
|
+
}, /* @__PURE__ */ t.createElement(l, null, e), /* @__PURE__ */ t.createElement(y, {
|
|
70
69
|
"aria-hidden": !0
|
|
71
70
|
}));
|
|
72
71
|
});
|
|
73
72
|
f.displayName = "NextLink";
|
|
74
|
-
const v =
|
|
75
|
-
const { activePage:
|
|
76
|
-
return /* @__PURE__ */
|
|
73
|
+
const v = t.forwardRef(({ number: e, children: r, ...a }, i) => {
|
|
74
|
+
const { activePage: o } = c(), n = o === e;
|
|
75
|
+
return /* @__PURE__ */ t.createElement(L, {
|
|
77
76
|
ref: i,
|
|
78
77
|
...a,
|
|
79
78
|
active: n
|
|
80
|
-
}, /* @__PURE__ */
|
|
79
|
+
}, /* @__PURE__ */ t.createElement(l, null, r), /* @__PURE__ */ t.createElement(m, {
|
|
81
80
|
"aria-hidden": !0,
|
|
82
81
|
variant: "pi",
|
|
83
82
|
fontWeight: n ? "bold" : null
|
|
84
83
|
}, e));
|
|
85
84
|
});
|
|
86
85
|
v.displayName = "PageLink";
|
|
87
|
-
const x = ({ children: e, ...r }) => /* @__PURE__ */
|
|
86
|
+
const x = ({ children: e, ...r }) => /* @__PURE__ */ t.createElement($, {
|
|
88
87
|
...r,
|
|
89
88
|
as: "div"
|
|
90
|
-
}, /* @__PURE__ */
|
|
89
|
+
}, /* @__PURE__ */ t.createElement(l, null, e), /* @__PURE__ */ t.createElement(m, {
|
|
91
90
|
"aria-hidden": !0,
|
|
92
91
|
variant: "pi"
|
|
93
92
|
}, "\u2026"));
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react"),z=require("prop-types"),U=require("styled-components"),D=require("@radix-ui/react-use-callback-ref"),H=require("@strapi/icons"),G=require("../Link/Link.cjs"),C=require("../../Typography/Typography.cjs"),k=require("../../Box/Box.cjs"),J=require("../../Flex/Flex.cjs"),M=require("../../Button/Button.cjs"),Q=require("../../BaseLink/BaseLink.cjs"),j=require("../../Popover/Popover.cjs"),T=require("./utils.cjs"),X=require("../../helpers/useId.cjs"),u=require("../../helpers/keyboardKeys.cjs"),q=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},o=q(a),t=q(z),y=q(U),Y=y.default.button`
|
|
2
2
|
border: none;
|
|
3
3
|
padding: 0;
|
|
4
4
|
background: transparent;
|
|
5
5
|
cursor: pointer;
|
|
6
|
-
${
|
|
7
|
-
`,
|
|
6
|
+
${T.getOptionStyle}
|
|
7
|
+
`,Z=y.default(Q.BaseLink)`
|
|
8
8
|
text-decoration: none;
|
|
9
|
-
${
|
|
10
|
-
`,
|
|
9
|
+
${T.getOptionStyle}
|
|
10
|
+
`,ee=y.default(G.Link)`
|
|
11
11
|
&:focus-visible {
|
|
12
12
|
/* Removes Link focus-visible after properties and reset to global outline */
|
|
13
13
|
outline: 2px solid ${({theme:e})=>e.colors.primary600};
|
|
@@ -20,14 +20,14 @@
|
|
|
20
20
|
svg path {
|
|
21
21
|
fill: currentColor;
|
|
22
22
|
}
|
|
23
|
-
${
|
|
24
|
-
`,
|
|
23
|
+
${T.getOptionStyle}
|
|
24
|
+
`,te=y.default.span`
|
|
25
25
|
display: flex;
|
|
26
26
|
align-items: center;
|
|
27
27
|
svg {
|
|
28
28
|
height: 4px;
|
|
29
29
|
width: 6px;
|
|
30
30
|
}
|
|
31
|
-
`,
|
|
31
|
+
`,ne=y.default(M.Button)`
|
|
32
32
|
padding: ${({theme:e})=>`${e.spaces[1]} ${e.spaces[3]}`};
|
|
33
|
-
`,
|
|
33
|
+
`,I=({as:e,children:i,onClick:E,isFocused:c,isLink:h,isExternal:b,...x})=>{const d=a.useRef();a.useEffect(()=>{c&&d.current&&d.current.focus()},[c]);const l={tabIndex:c?0:-1,ref:d,role:"menuitem",...x},v=r=>{(r.key===u.KeyboardKeys.SPACE||r.key===u.KeyboardKeys.ENTER)&&E()};return h?o.default.createElement(Z,{as:e,...l},o.default.createElement(k.Box,{padding:2},o.default.createElement(C.Typography,null,i))):b?o.default.createElement(ee,{isExternal:!0,...l},o.default.createElement(k.Box,{padding:2},o.default.createElement(C.Typography,null,i))):o.default.createElement(Y,{onKeyDown:v,onMouseDown:E,type:"button",...l},o.default.createElement(k.Box,{padding:2},o.default.createElement(C.Typography,null,i)))};I.defaultProps={as:void 0,onClick(){},isExternal:!1,isFocused:!1,isLink:!1};I.propTypes={as:t.default.elementType,children:t.default.node.isRequired,isExternal:t.default.bool,isFocused:t.default.bool,isLink:t.default.bool,onClick:t.default.func};const m=({label:e,children:i,id:E,as:c,onOpen:h=()=>{},onClose:b=()=>{},size:x,popoverPlacement:d,onReachEnd:l,...v})=>{const r=a.useRef(),B=X.useId("simplemenu",E),K=a.useRef(!1),[f,p]=a.useState(!1),[P,R]=a.useState(0),g=a.Children.toArray(i),w=x==="S"?ne:M.Button,_=c||w,O=!!l&&typeof l=="function";a.useEffect(()=>{if(["string","number"].includes(typeof e)){const n=g.findIndex(s=>s.props.children===e);n!==-1&&R(n)}},[e]);const S=D.useCallbackRef(h),L=D.useCallbackRef(b);a.useEffect(()=>{K?.current?f?S():L():K.current=!0},[K,f,S,L]),a.useEffect(()=>{o.default.isValidElement(e)&&P===-1&&r.current.focus()},[e,P]);const $=n=>{f&&(n.key===u.KeyboardKeys.ESCAPE&&(n.stopPropagation(),p(!1),r.current.focus()),n.key===u.KeyboardKeys.DOWN&&R(s=>s===g.length-1?0:s+1),n.key===u.KeyboardKeys.UP&&R(s=>s===0?g.length-1:s-1))},F=n=>{(n.key===u.KeyboardKeys.ENTER||n.key===u.KeyboardKeys.SPACE)&&p(s=>!s)},A=n=>{n.preventDefault(),n.currentTarget.contains(n.relatedTarget)||p(!1)},N=n=>{n.preventDefault(),p(s=>!s)},V=()=>{O&&l()},W=g.map((n,s)=>o.default.createElement(J.Flex,{as:"li",key:s,justifyContent:"center",role:"menuitem"},a.cloneElement(n,{onClick(){n.props.onClick(),p(!1),r.current.focus()},isFocused:P===s})));return o.default.createElement("div",{onKeyDown:$},o.default.createElement(_,{label:o.default.isValidElement(e)?null:e,"aria-haspopup":!0,"aria-expanded":f,"aria-controls":B,onKeyDown:F,onMouseDown:N,ref:r,type:"button",variant:"ghost",endIcon:o.default.createElement(te,null,o.default.createElement(H.CarretDown,{"aria-hidden":!0})),...v},e),f&&o.default.createElement(j.Popover,{onBlur:A,placement:d,source:r,onReachEnd:V,intersectionId:O?`popover-${B}`:void 0,spacing:4},o.default.createElement(k.Box,{role:"menu",as:"ul",padding:1,id:B},W)))};m.defaultProps={as:void 0};m.displayName="SimpleMenu";m.defaultProps={id:void 0,onClose(){},onOpen(){},onReachEnd:void 0,popoverPlacement:"bottom-start",size:"M"};m.propTypes={as:t.default.any,children:t.default.oneOfType([t.default.arrayOf(t.default.node),t.default.node]).isRequired,id:t.default.string,label:t.default.oneOfType([t.default.string,t.default.number,t.default.element]).isRequired,onClose:t.default.func,onOpen:t.default.func,onReachEnd:t.default.func,popoverPlacement:t.default.oneOf(j.POPOVER_PLACEMENTS),size:t.default.oneOf(["S","M"])};exports.MenuItem=I;exports.SimpleMenu=m;
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import t, { useRef as
|
|
1
|
+
import t, { useRef as b, useEffect as E, useState as B, Children as z, cloneElement as j } from "react";
|
|
2
2
|
import e from "prop-types";
|
|
3
|
-
import
|
|
4
|
-
import { useCallbackRef as
|
|
5
|
-
import
|
|
6
|
-
import { Link as
|
|
7
|
-
import { Typography as
|
|
8
|
-
import { Box as
|
|
9
|
-
import { Flex as
|
|
10
|
-
import { Button as
|
|
11
|
-
import { BaseLink as
|
|
12
|
-
import { POPOVER_PLACEMENTS as
|
|
13
|
-
import { getOptionStyle as
|
|
14
|
-
import { useId as
|
|
15
|
-
import { KeyboardKeys as
|
|
16
|
-
const
|
|
3
|
+
import f from "styled-components";
|
|
4
|
+
import { useCallbackRef as L } from "@radix-ui/react-use-callback-ref";
|
|
5
|
+
import { CarretDown as H } from "@strapi/icons";
|
|
6
|
+
import { Link as U } from "../Link/Link.js";
|
|
7
|
+
import { Typography as O } from "../../Typography/Typography.js";
|
|
8
|
+
import { Box as g } from "../../Box/Box.js";
|
|
9
|
+
import { Flex as G } from "../../Flex/Flex.js";
|
|
10
|
+
import { Button as K } from "../../Button/Button.js";
|
|
11
|
+
import { BaseLink as J } from "../../BaseLink/BaseLink.js";
|
|
12
|
+
import { POPOVER_PLACEMENTS as Q, Popover as X } from "../../Popover/Popover.js";
|
|
13
|
+
import { getOptionStyle as T } from "./utils.js";
|
|
14
|
+
import { useId as Y } from "../../helpers/useId.js";
|
|
15
|
+
import { KeyboardKeys as a } from "../../helpers/keyboardKeys.js";
|
|
16
|
+
const Z = f.button`
|
|
17
17
|
border: none;
|
|
18
18
|
padding: 0;
|
|
19
19
|
background: transparent;
|
|
20
20
|
cursor: pointer;
|
|
21
|
-
${
|
|
22
|
-
`,
|
|
21
|
+
${T}
|
|
22
|
+
`, ee = f(J)`
|
|
23
23
|
text-decoration: none;
|
|
24
|
-
${
|
|
25
|
-
`,
|
|
24
|
+
${T}
|
|
25
|
+
`, ne = f(U)`
|
|
26
26
|
&:focus-visible {
|
|
27
27
|
/* Removes Link focus-visible after properties and reset to global outline */
|
|
28
28
|
outline: 2px solid ${({ theme: o }) => o.colors.primary600};
|
|
@@ -35,49 +35,49 @@ const Q = d.button`
|
|
|
35
35
|
svg path {
|
|
36
36
|
fill: currentColor;
|
|
37
37
|
}
|
|
38
|
-
${
|
|
39
|
-
`,
|
|
38
|
+
${T}
|
|
39
|
+
`, te = f.span`
|
|
40
40
|
display: flex;
|
|
41
41
|
align-items: center;
|
|
42
42
|
svg {
|
|
43
43
|
height: 4px;
|
|
44
44
|
width: 6px;
|
|
45
45
|
}
|
|
46
|
-
`,
|
|
46
|
+
`, oe = f(K)`
|
|
47
47
|
padding: ${({ theme: o }) => `${o.spaces[1]} ${o.spaces[3]}`};
|
|
48
|
-
`,
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}, [
|
|
53
|
-
const
|
|
54
|
-
tabIndex:
|
|
55
|
-
ref:
|
|
48
|
+
`, $ = ({ as: o, children: l, onClick: d, isFocused: c, isLink: k, isExternal: v, ...C }) => {
|
|
49
|
+
const p = b();
|
|
50
|
+
E(() => {
|
|
51
|
+
c && p.current && p.current.focus();
|
|
52
|
+
}, [c]);
|
|
53
|
+
const i = {
|
|
54
|
+
tabIndex: c ? 0 : -1,
|
|
55
|
+
ref: p,
|
|
56
56
|
role: "menuitem",
|
|
57
|
-
...
|
|
58
|
-
},
|
|
59
|
-
(
|
|
57
|
+
...C
|
|
58
|
+
}, x = (s) => {
|
|
59
|
+
(s.key === a.SPACE || s.key === a.ENTER) && d();
|
|
60
60
|
};
|
|
61
|
-
return
|
|
61
|
+
return k ? /* @__PURE__ */ t.createElement(ee, {
|
|
62
62
|
as: o,
|
|
63
|
-
...
|
|
64
|
-
}, /* @__PURE__ */ t.createElement(
|
|
63
|
+
...i
|
|
64
|
+
}, /* @__PURE__ */ t.createElement(g, {
|
|
65
65
|
padding: 2
|
|
66
|
-
}, /* @__PURE__ */ t.createElement(
|
|
66
|
+
}, /* @__PURE__ */ t.createElement(O, null, l))) : v ? /* @__PURE__ */ t.createElement(ne, {
|
|
67
67
|
isExternal: !0,
|
|
68
|
-
...
|
|
69
|
-
}, /* @__PURE__ */ t.createElement(
|
|
68
|
+
...i
|
|
69
|
+
}, /* @__PURE__ */ t.createElement(g, {
|
|
70
70
|
padding: 2
|
|
71
|
-
}, /* @__PURE__ */ t.createElement(
|
|
72
|
-
onKeyDown:
|
|
73
|
-
onMouseDown:
|
|
71
|
+
}, /* @__PURE__ */ t.createElement(O, null, l))) : /* @__PURE__ */ t.createElement(Z, {
|
|
72
|
+
onKeyDown: x,
|
|
73
|
+
onMouseDown: d,
|
|
74
74
|
type: "button",
|
|
75
|
-
...
|
|
76
|
-
}, /* @__PURE__ */ t.createElement(
|
|
75
|
+
...i
|
|
76
|
+
}, /* @__PURE__ */ t.createElement(g, {
|
|
77
77
|
padding: 2
|
|
78
|
-
}, /* @__PURE__ */ t.createElement(
|
|
78
|
+
}, /* @__PURE__ */ t.createElement(O, null, l)));
|
|
79
79
|
};
|
|
80
|
-
|
|
80
|
+
$.defaultProps = {
|
|
81
81
|
as: void 0,
|
|
82
82
|
onClick() {
|
|
83
83
|
},
|
|
@@ -85,7 +85,7 @@ L.defaultProps = {
|
|
|
85
85
|
isFocused: !1,
|
|
86
86
|
isLink: !1
|
|
87
87
|
};
|
|
88
|
-
|
|
88
|
+
$.propTypes = {
|
|
89
89
|
as: e.elementType,
|
|
90
90
|
children: e.node.isRequired,
|
|
91
91
|
isExternal: e.bool,
|
|
@@ -95,76 +95,81 @@ L.propTypes = {
|
|
|
95
95
|
};
|
|
96
96
|
const h = ({
|
|
97
97
|
label: o,
|
|
98
|
-
children:
|
|
99
|
-
id:
|
|
100
|
-
as:
|
|
101
|
-
onOpen:
|
|
98
|
+
children: l,
|
|
99
|
+
id: d,
|
|
100
|
+
as: c,
|
|
101
|
+
onOpen: k = () => {
|
|
102
102
|
},
|
|
103
|
-
onClose:
|
|
103
|
+
onClose: v = () => {
|
|
104
104
|
},
|
|
105
|
-
size:
|
|
106
|
-
popoverPlacement:
|
|
107
|
-
|
|
105
|
+
size: C,
|
|
106
|
+
popoverPlacement: p,
|
|
107
|
+
onReachEnd: i,
|
|
108
|
+
...x
|
|
108
109
|
}) => {
|
|
109
|
-
const s =
|
|
110
|
-
|
|
110
|
+
const s = b(), P = Y("simplemenu", d), R = b(!1), [u, m] = B(!1), [D, I] = B(0), y = z.toArray(l), A = c || (C === "S" ? oe : K), S = !!i && typeof i == "function";
|
|
111
|
+
E(() => {
|
|
111
112
|
if (["string", "number"].includes(typeof o)) {
|
|
112
|
-
const n =
|
|
113
|
-
n !== -1 &&
|
|
113
|
+
const n = y.findIndex((r) => r.props.children === o);
|
|
114
|
+
n !== -1 && I(n);
|
|
114
115
|
}
|
|
115
116
|
}, [o]);
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}, [
|
|
117
|
+
const w = L(k), M = L(v);
|
|
118
|
+
E(() => {
|
|
119
|
+
R?.current ? u ? w() : M() : R.current = !0;
|
|
120
|
+
}, [R, u, w, M]), E(() => {
|
|
120
121
|
t.isValidElement(o) && D === -1 && s.current.focus();
|
|
121
122
|
}, [o, D]);
|
|
122
|
-
const
|
|
123
|
-
|
|
124
|
-
}, A = (n) => {
|
|
125
|
-
(n.key === i.ENTER || n.key === i.SPACE) && f((r) => !r);
|
|
126
|
-
}, N = (n) => {
|
|
127
|
-
n.preventDefault(), n.currentTarget.contains(n.relatedTarget) || f(!1);
|
|
123
|
+
const N = (n) => {
|
|
124
|
+
u && (n.key === a.ESCAPE && (n.stopPropagation(), m(!1), s.current.focus()), n.key === a.DOWN && I((r) => r === y.length - 1 ? 0 : r + 1), n.key === a.UP && I((r) => r === 0 ? y.length - 1 : r - 1));
|
|
128
125
|
}, F = (n) => {
|
|
129
|
-
n.
|
|
130
|
-
}, V =
|
|
126
|
+
(n.key === a.ENTER || n.key === a.SPACE) && m((r) => !r);
|
|
127
|
+
}, V = (n) => {
|
|
128
|
+
n.preventDefault(), n.currentTarget.contains(n.relatedTarget) || m(!1);
|
|
129
|
+
}, q = (n) => {
|
|
130
|
+
n.preventDefault(), m((r) => !r);
|
|
131
|
+
}, W = () => {
|
|
132
|
+
S && i();
|
|
133
|
+
}, _ = y.map((n, r) => /* @__PURE__ */ t.createElement(G, {
|
|
131
134
|
as: "li",
|
|
132
135
|
key: r,
|
|
133
136
|
justifyContent: "center",
|
|
134
137
|
role: "menuitem"
|
|
135
|
-
},
|
|
138
|
+
}, j(n, {
|
|
136
139
|
onClick() {
|
|
137
|
-
n.props.onClick(),
|
|
140
|
+
n.props.onClick(), m(!1), s.current.focus();
|
|
138
141
|
},
|
|
139
142
|
isFocused: D === r
|
|
140
143
|
})));
|
|
141
144
|
return /* @__PURE__ */ t.createElement("div", {
|
|
142
|
-
onKeyDown:
|
|
143
|
-
}, /* @__PURE__ */ t.createElement(
|
|
145
|
+
onKeyDown: N
|
|
146
|
+
}, /* @__PURE__ */ t.createElement(A, {
|
|
144
147
|
label: t.isValidElement(o) ? null : o,
|
|
145
148
|
"aria-haspopup": !0,
|
|
146
|
-
"aria-expanded":
|
|
147
|
-
"aria-controls":
|
|
148
|
-
onKeyDown:
|
|
149
|
-
onMouseDown:
|
|
149
|
+
"aria-expanded": u,
|
|
150
|
+
"aria-controls": P,
|
|
151
|
+
onKeyDown: F,
|
|
152
|
+
onMouseDown: q,
|
|
150
153
|
ref: s,
|
|
151
154
|
type: "button",
|
|
152
155
|
variant: "ghost",
|
|
153
|
-
endIcon: /* @__PURE__ */ t.createElement(
|
|
156
|
+
endIcon: /* @__PURE__ */ t.createElement(te, null, /* @__PURE__ */ t.createElement(H, {
|
|
154
157
|
"aria-hidden": !0
|
|
155
158
|
})),
|
|
156
|
-
...
|
|
157
|
-
}, o),
|
|
158
|
-
onBlur:
|
|
159
|
-
placement:
|
|
159
|
+
...x
|
|
160
|
+
}, o), u && /* @__PURE__ */ t.createElement(X, {
|
|
161
|
+
onBlur: V,
|
|
162
|
+
placement: p,
|
|
160
163
|
source: s,
|
|
164
|
+
onReachEnd: W,
|
|
165
|
+
intersectionId: S ? `popover-${P}` : void 0,
|
|
161
166
|
spacing: 4
|
|
162
|
-
}, /* @__PURE__ */ t.createElement(
|
|
167
|
+
}, /* @__PURE__ */ t.createElement(g, {
|
|
163
168
|
role: "menu",
|
|
164
169
|
as: "ul",
|
|
165
170
|
padding: 1,
|
|
166
|
-
id:
|
|
167
|
-
},
|
|
171
|
+
id: P
|
|
172
|
+
}, _)));
|
|
168
173
|
};
|
|
169
174
|
h.defaultProps = {
|
|
170
175
|
as: void 0
|
|
@@ -176,6 +181,7 @@ h.defaultProps = {
|
|
|
176
181
|
},
|
|
177
182
|
onOpen() {
|
|
178
183
|
},
|
|
184
|
+
onReachEnd: void 0,
|
|
179
185
|
popoverPlacement: "bottom-start",
|
|
180
186
|
size: "M"
|
|
181
187
|
};
|
|
@@ -186,10 +192,11 @@ h.propTypes = {
|
|
|
186
192
|
label: e.oneOfType([e.string, e.number, e.element]).isRequired,
|
|
187
193
|
onClose: e.func,
|
|
188
194
|
onOpen: e.func,
|
|
189
|
-
|
|
195
|
+
onReachEnd: e.func,
|
|
196
|
+
popoverPlacement: e.oneOf(Q),
|
|
190
197
|
size: e.oneOf(["S", "M"])
|
|
191
198
|
};
|
|
192
199
|
export {
|
|
193
|
-
|
|
200
|
+
$ as MenuItem,
|
|
194
201
|
h as SimpleMenu
|
|
195
202
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react"),C=require("prop-types"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react"),C=require("prop-types"),I=require("styled-components"),R=require("@strapi/icons"),_=require("../../Flex/Flex.cjs"),D=require("../../Typography/Typography.cjs"),P=require("../../IconButton/IconButton.cjs"),s=require("../../Box/Box.cjs"),F=require("../../Divider/Divider.cjs"),K=require("../../Searchbar/Searchbar.cjs"),L=require("../../Searchbar/SearchForm.cjs"),k=require("../../helpers/useId.cjs"),w=require("../../helpers/usePrevious.cjs"),O=require("../../helpers/keyboardKeys.cjs"),d=t=>t&&typeof t=="object"&&"default"in t?t:{default:t},e=d(o),r=d(C),H=d(I),h=H.default(F.Divider)`
|
|
2
2
|
width: ${24/16}rem;
|
|
3
3
|
background-color: ${({theme:t})=>t.colors.neutral200};
|
|
4
|
-
`,i=({as:t,label:g,searchLabel:f,searchable:b,onChange:y,value:m,onClear:S,onSubmit:v,id:B})=>{const[n,
|
|
4
|
+
`,i=({as:t,label:g,searchLabel:f,searchable:b,onChange:y,value:m,onClear:S,onSubmit:v,id:B})=>{const[n,l]=o.useState(!1),p=w.usePrevious(n),q=k.useId("subnav-searchbar-clear",B),c=o.useRef(),u=o.useRef();o.useEffect(()=>{n&&c.current&&c.current.focus(),p&&!n&&u.current&&u.current.focus()},[n,p]);const E=()=>{l(a=>!a)},j=a=>{S(a),c.current.focus()},T=a=>{a.relatedTarget?.id!==q&&l(!1)},x=a=>{a.key===O.KeyboardKeys.ESCAPE&&l(!1)};return n?e.default.createElement(s.Box,{paddingLeft:4,paddingTop:5,paddingBottom:2,paddingRight:4},e.default.createElement(L.SearchForm,null,e.default.createElement(K.Searchbar,{name:"searchbar",value:m,onChange:y,placeholder:"e.g: strapi-plugin-abcd",onKeyDown:x,ref:c,onBlur:T,onClear:j,onSubmit:v,clearLabel:"Clear",size:"S"},f)),e.default.createElement(s.Box,{paddingLeft:2,paddingTop:4},e.default.createElement(h,null))):e.default.createElement(s.Box,{paddingLeft:6,paddingTop:6,paddingBottom:2,paddingRight:4},e.default.createElement(_.Flex,{justifyContent:"space-between",alignItems:"flex-start"},e.default.createElement(D.Typography,{variant:"beta",as:t},g),b&&e.default.createElement(P.IconButton,{ref:u,onClick:E,label:f,icon:e.default.createElement(R.Search,null)})),e.default.createElement(s.Box,{paddingTop:4},e.default.createElement(h,null)))};i.defaultProps={as:"h2",searchable:!1,onChange(){},onClear(){},onSubmit(){},value:"",searchLabel:"",id:void 0};i.propTypes={as:r.default.string,id:r.default.string,label:r.default.string.isRequired,onChange:r.default.func,onClear:r.default.func,onSubmit:r.default.func,searchLabel:r.default.string,searchable:r.default.bool,value:r.default.string};exports.SubNavHeader=i;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import e, { useState as L, useRef as p, useEffect as w } from "react";
|
|
2
2
|
import r from "prop-types";
|
|
3
3
|
import x from "styled-components";
|
|
4
|
-
import D from "@strapi/icons
|
|
4
|
+
import { Search as D } from "@strapi/icons";
|
|
5
5
|
import { Flex as I } from "../../Flex/Flex.js";
|
|
6
6
|
import { Typography as K } from "../../Typography/Typography.js";
|
|
7
7
|
import { IconButton as P } from "../../IconButton/IconButton.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const m=require("react"),b=require("prop-types"),h=require("styled-components"),x=require("@strapi/icons
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const m=require("react"),b=require("prop-types"),h=require("styled-components"),x=require("@strapi/icons"),a=require("../../Box/Box.cjs"),c=require("../../Typography/Typography.cjs"),i=require("../../Flex/Flex.cjs"),B=require("../../BaseLink/BaseLink.cjs"),n=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},t=n(m),o=n(b),s=n(h),$=s.default(a.Box)`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
justify-content: space-between;
|
|
@@ -25,15 +25,15 @@
|
|
|
25
25
|
&:focus-visible {
|
|
26
26
|
outline-offset: -2px;
|
|
27
27
|
}
|
|
28
|
-
`,u=s.default(
|
|
28
|
+
`,u=s.default(x.Dot)`
|
|
29
29
|
width: ${12/16}rem;
|
|
30
30
|
height: ${4/16}rem;
|
|
31
31
|
* {
|
|
32
32
|
fill: ${({theme:e,$active:l})=>l?e.colors.primary600:e.colors.neutral600};
|
|
33
33
|
}
|
|
34
|
-
`,
|
|
34
|
+
`,v=s.default.div`
|
|
35
35
|
svg {
|
|
36
36
|
height: ${12/16}rem;
|
|
37
37
|
width: ${12/16}rem;
|
|
38
38
|
}
|
|
39
|
-
`,
|
|
39
|
+
`,r=t.default.forwardRef(({children:e,icon:l,withBullet:d,as:p,isSubSectionChild:f,...y},g)=>t.default.createElement($,{as:p,icon:l,background:"neutral100",paddingLeft:f?9:7,paddingBottom:2,paddingTop:2,ref:g,...y},t.default.createElement(i.Flex,null,l?t.default.createElement(v,null,l):t.default.createElement(u,null),t.default.createElement(a.Box,{paddingLeft:2},t.default.createElement(c.Typography,{as:"span"},e))),d&&t.default.createElement(a.Box,{as:i.Flex,paddingRight:4},t.default.createElement(u,{$active:!0}))));r.displayName="SubNavLink";r.defaultProps={as:B.BaseLink,icon:null,isSubSectionChild:!1,withBullet:!1};r.propTypes={as:o.default.elementType,children:o.default.node.isRequired,icon:o.default.element,isSubSectionChild:o.default.bool,withBullet:o.default.bool};exports.SubNavLink=r;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import r from "react";
|
|
2
2
|
import t from "prop-types";
|
|
3
3
|
import i from "styled-components";
|
|
4
|
-
import g from "@strapi/icons
|
|
4
|
+
import { Dot as g } from "@strapi/icons";
|
|
5
5
|
import { Box as l } from "../../Box/Box.js";
|
|
6
6
|
import { Typography as p } from "../../Typography/Typography.js";
|
|
7
7
|
import { Flex as a } from "../../Flex/Flex.js";
|