@strapi/design-system 1.6.3 → 1.6.4
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 +5 -5
- package/dist/Accordion/Accordion.js +45 -44
- package/dist/Accordion/AccordionContent.cjs +1 -1
- package/dist/Accordion/AccordionContent.js +4 -4
- package/dist/Accordion/AccordionGroup.cjs +4 -4
- package/dist/Accordion/AccordionGroup.js +18 -18
- package/dist/Accordion/AccordionToggle.cjs +2 -2
- package/dist/Accordion/AccordionToggle.js +11 -11
- package/dist/Alert/Alert.cjs +1 -1
- package/dist/Alert/Alert.js +8 -8
- package/dist/Avatar/Avatar.cjs +5 -5
- package/dist/Avatar/Avatar.js +11 -11
- package/dist/Avatar/AvatarGroup.cjs +2 -2
- package/dist/Avatar/AvatarGroup.js +4 -4
- package/dist/BaseButton/BaseButton.cjs +5 -11
- package/dist/BaseButton/BaseButton.js +31 -38
- package/dist/BaseCheckbox/BaseCheckbox.cjs +3 -3
- package/dist/BaseCheckbox/BaseCheckbox.js +22 -22
- package/dist/BaseRadio/BaseRadio.cjs +2 -2
- package/dist/BaseRadio/BaseRadio.js +4 -4
- package/dist/BaseRadio/RadioGroup.cjs +1 -1
- package/dist/BaseRadio/RadioGroup.js +28 -26
- package/dist/Box/Box.cjs +1 -1
- package/dist/Box/Box.js +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.cjs +4 -4
- package/dist/Breadcrumbs/Breadcrumbs.js +12 -12
- package/dist/Button/Button.cjs +10 -27
- package/dist/Button/Button.js +65 -85
- package/dist/Button/utils.cjs +22 -22
- package/dist/Button/utils.js +2 -2
- package/dist/Card/Card.cjs +1 -1
- package/dist/Card/Card.js +15 -14
- package/dist/Card/CardAsset.js +4 -4
- package/dist/Card/CardBody.cjs +1 -1
- package/dist/Card/CardBody.js +4 -4
- package/dist/Card/CardCheckbox.cjs +1 -1
- package/dist/Card/CardCheckbox.js +6 -6
- package/dist/Card/CardTitle.cjs +1 -1
- package/dist/Card/CardTitle.js +1 -1
- package/dist/CarouselInput/Carousel.cjs +2 -2
- package/dist/CarouselInput/Carousel.js +19 -64
- package/dist/CarouselInput/CarouselActions.js +1 -9
- package/dist/CarouselInput/CarouselImage.js +1 -10
- package/dist/CarouselInput/CarouselInput.cjs +1 -1
- package/dist/CarouselInput/CarouselInput.js +19 -24
- package/dist/CarouselInput/CarouselSlide.js +13 -9
- package/dist/Checkbox/Checkbox.cjs +2 -2
- package/dist/Checkbox/Checkbox.js +7 -26
- package/dist/Combobox/Combobox.cjs +1 -1
- package/dist/Combobox/Combobox.js +106 -120
- package/dist/Combobox/ComboboxOption.cjs +1 -1
- package/dist/Combobox/ComboboxOption.js +18 -17
- package/dist/DatePicker/DatePicker.cjs +1 -1
- package/dist/DatePicker/DatePicker.js +47 -46
- package/dist/DatePicker/DatePickerCalendar.cjs +1 -1
- package/dist/DatePicker/DatePickerCalendar.js +28 -61
- package/dist/DatePicker/DatePickerTd.js +1 -12
- package/dist/DatePicker/DatePickerTh.cjs +3 -3
- package/dist/DatePicker/DatePickerTh.js +7 -16
- package/dist/DatePicker/components.cjs +3 -3
- package/dist/DatePicker/components.js +6 -6
- package/dist/DateTimePicker/DateTimePicker.cjs +1 -1
- package/dist/DateTimePicker/DateTimePicker.js +64 -61
- package/dist/DateTimePicker/DateTimePickerProps.js +1 -3
- package/dist/Dialog/Dialog.cjs +4 -4
- package/dist/Dialog/Dialog.js +26 -37
- package/dist/Dialog/DialogBody.cjs +1 -1
- package/dist/Dialog/DialogBody.js +2 -11
- package/dist/Dialog/DialogFooter.cjs +1 -1
- package/dist/Dialog/DialogFooter.js +2 -7
- package/dist/DismissibleLayer/DismissibleLayer.js +1 -4
- package/dist/Divider/Divider.js +1 -5
- package/dist/EmptyStateLayout/EmptyStateLayout.cjs +1 -1
- package/dist/EmptyStateLayout/EmptyStateLayout.js +2 -16
- package/dist/EmptyStateLayout/story-assets/Illo.js +60 -45
- package/dist/Field/Field.cjs +1 -1
- package/dist/Field/Field.js +12 -13
- package/dist/Field/FieldAction.cjs +1 -1
- package/dist/Field/FieldAction.js +2 -6
- package/dist/Field/FieldError.js +1 -7
- package/dist/Field/FieldHint.js +1 -6
- package/dist/Field/FieldInput.cjs +4 -4
- package/dist/Field/FieldInput.js +26 -34
- package/dist/Field/FieldLabel.cjs +1 -1
- package/dist/Field/FieldLabel.js +3 -16
- package/dist/FocusTrap/FocusTrap.js +1 -5
- package/dist/Grid/Grid.cjs +3 -3
- package/dist/Grid/Grid.js +12 -15
- package/dist/Grid/GridItem.cjs +2 -2
- package/dist/Grid/GridItem.js +5 -13
- package/dist/IconButton/IconButton.cjs +7 -12
- package/dist/IconButton/IconButton.js +88 -84
- package/dist/JSONInput/JSONInput.cjs +1 -1
- package/dist/JSONInput/JSONInput.js +85 -78
- package/dist/JSONInput/JSONInputContainer.cjs +10 -10
- package/dist/JSONInput/JSONInputContainer.js +22 -15
- package/dist/Layout/ActionLayout.js +1 -13
- package/dist/Layout/ContentLayout.js +1 -4
- package/dist/Layout/HeaderLayout.cjs +1 -1
- package/dist/Layout/HeaderLayout.js +35 -64
- package/dist/Layout/Layout.js +1 -5
- package/dist/Layout/TwoColsLayout.js +1 -17
- package/dist/Link/Link.cjs +5 -5
- package/dist/Link/Link.js +55 -57
- package/dist/LinkButton/LinkButton.cjs +7 -24
- package/dist/LinkButton/LinkButton.js +60 -87
- package/dist/LiveRegions/LiveRegions.cjs +1 -1
- package/dist/LiveRegions/LiveRegions.js +1 -1
- package/dist/Loader/Loader.cjs +4 -4
- package/dist/Loader/Loader.js +26 -24
- package/dist/Main/Main.js +1 -6
- package/dist/Main/SkipToContent.cjs +2 -2
- package/dist/Main/SkipToContent.js +17 -13
- package/dist/MainNav/MainNav.cjs +2 -2
- package/dist/MainNav/MainNav.js +21 -20
- package/dist/MainNav/NavBrand.cjs +2 -2
- package/dist/MainNav/NavBrand.js +4 -38
- package/dist/MainNav/NavCondense.cjs +2 -2
- package/dist/MainNav/NavCondense.js +10 -18
- package/dist/MainNav/NavFooter.js +1 -3
- package/dist/MainNav/NavLink.cjs +4 -4
- package/dist/MainNav/NavLink.js +8 -34
- package/dist/MainNav/NavSection.cjs +1 -1
- package/dist/MainNav/NavSection.js +5 -38
- package/dist/MainNav/NavSections.cjs +2 -2
- package/dist/MainNav/NavSections.js +4 -15
- package/dist/MainNav/NavUser.cjs +2 -2
- package/dist/MainNav/NavUser.js +6 -27
- package/dist/ModalLayout/ModalBody.js +1 -4
- package/dist/ModalLayout/ModalFooter.cjs +1 -1
- package/dist/ModalLayout/ModalFooter.js +2 -10
- package/dist/ModalLayout/ModalHeader.cjs +2 -2
- package/dist/ModalLayout/ModalHeader.js +8 -20
- package/dist/ModalLayout/ModalLayout.cjs +3 -3
- package/dist/ModalLayout/ModalLayout.js +23 -31
- package/dist/NumberInput/NumberInput.cjs +2 -2
- package/dist/NumberInput/NumberInput.js +54 -59
- package/dist/Pagination/Pagination.cjs +2 -2
- package/dist/Pagination/Pagination.js +11 -16
- package/dist/Pagination/components.cjs +3 -3
- package/dist/Pagination/components.js +31 -38
- package/dist/Popover/Popover.cjs +3 -3
- package/dist/Popover/Popover.js +5 -5
- package/dist/Portal/Portal.cjs +1 -1
- package/dist/Portal/Portal.js +10 -12
- package/dist/ProgressBar/ProgressBar.js +17 -14
- package/dist/Radio/Radio.cjs +2 -2
- package/dist/Radio/Radio.js +4 -11
- package/dist/RawTable/RawCell.cjs +1 -1
- package/dist/RawTable/RawCell.js +5 -14
- package/dist/RawTable/RawTable.cjs +1 -1
- package/dist/RawTable/RawTable.js +36 -35
- package/dist/RawTable/RawTbody.js +1 -3
- package/dist/RawTable/RawThead.js +1 -3
- package/dist/RawTable/RawTr.js +1 -4
- package/dist/Searchbar/SearchForm.js +1 -4
- package/dist/Searchbar/Searchbar.cjs +3 -3
- package/dist/Searchbar/Searchbar.js +21 -25
- package/dist/Select/MultiSelectNested.js +2 -14
- package/dist/Select/OptGroup.cjs +1 -1
- package/dist/Select/OptGroup.js +14 -10
- package/dist/Select/Option.cjs +3 -3
- package/dist/Select/Option.js +31 -33
- package/dist/Select/Select.cjs +2 -2
- package/dist/Select/Select.js +86 -106
- package/dist/Select/SelectButton.cjs +1 -1
- package/dist/Select/SelectButton.js +14 -11
- package/dist/Select/SelectList.cjs +1 -1
- package/dist/Select/SelectList.js +20 -16
- package/dist/Select/SelectTags.cjs +3 -3
- package/dist/Select/SelectTags.js +17 -15
- package/dist/Select/SingleSelect.cjs +1 -1
- package/dist/Select/SingleSelect.js +1 -1
- package/dist/SimpleMenu/SimpleMenu.cjs +3 -3
- package/dist/SimpleMenu/SimpleMenu.js +43 -67
- package/dist/Status/Status.js +15 -13
- package/dist/SubNav/SubNav.cjs +2 -2
- package/dist/SubNav/SubNav.js +5 -9
- package/dist/SubNav/SubNavHeader.cjs +2 -2
- package/dist/SubNav/SubNavHeader.js +31 -53
- package/dist/SubNav/SubNavLink.cjs +3 -3
- package/dist/SubNav/SubNavLink.js +18 -22
- package/dist/SubNav/SubNavLinkSection.cjs +2 -2
- package/dist/SubNav/SubNavLinkSection.js +5 -30
- package/dist/SubNav/SubNavSection.cjs +2 -2
- package/dist/SubNav/SubNavSection.js +23 -30
- package/dist/SubNav/SubNavSectionLabel.cjs +2 -2
- package/dist/SubNav/SubNavSectionLabel.js +15 -24
- package/dist/SubNav/SubNavSections.cjs +1 -1
- package/dist/SubNav/SubNavSections.js +3 -12
- package/dist/Switch/Switch.cjs +2 -2
- package/dist/Switch/Switch.js +16 -17
- package/dist/Table/Cell.cjs +1 -1
- package/dist/Table/Cell.js +3 -8
- package/dist/Table/TFooter.cjs +2 -2
- package/dist/Table/TFooter.js +3 -17
- package/dist/Table/Table.cjs +1 -1
- package/dist/Table/Table.js +2 -18
- package/dist/Table/Tbody.js +1 -3
- package/dist/Table/Thead.js +1 -3
- package/dist/Table/Tr.js +1 -3
- package/dist/Tabs/TabGroup.cjs +1 -1
- package/dist/Tabs/TabGroup.js +30 -27
- package/dist/Tabs/TabPanels.js +2 -10
- package/dist/Tabs/Tabs.cjs +1 -1
- package/dist/Tabs/Tabs.js +43 -51
- package/dist/Tag/Tag.cjs +1 -1
- package/dist/Tag/Tag.js +20 -23
- package/dist/TextButton/TextButton.cjs +6 -6
- package/dist/TextButton/TextButton.js +15 -15
- package/dist/TextInput/TextInput.cjs +1 -1
- package/dist/TextInput/TextInput.js +6 -24
- package/dist/Textarea/Textarea.cjs +2 -2
- package/dist/Textarea/Textarea.js +10 -25
- package/dist/Textarea/TextareaInput.cjs +1 -1
- package/dist/Textarea/TextareaInput.js +15 -15
- package/dist/TimePicker/TimePicker.cjs +2 -2
- package/dist/TimePicker/TimePicker.js +26 -25
- package/dist/ToggleCheckbox/ToggleCheckbox.cjs +5 -5
- package/dist/ToggleCheckbox/ToggleCheckbox.js +85 -60
- package/dist/ToggleInput/ToggleInput.cjs +3 -3
- package/dist/ToggleInput/ToggleInput.js +14 -32
- package/dist/Tooltip/Tooltip.cjs +2 -2
- package/dist/Tooltip/Tooltip.js +62 -53
- package/dist/Tooltip/hooks/useTooltipHandlers.cjs +1 -1
- package/dist/Tooltip/hooks/useTooltipHandlers.js +7 -7
- package/dist/Tooltip/hooks/useTooltipLayout.cjs +1 -1
- package/dist/Tooltip/hooks/useTooltipLayout.js +8 -5
- package/dist/Typography/Typography.cjs +3 -2
- package/dist/Typography/Typography.js +17 -14
- package/dist/helpers/objects.cjs +1 -1
- package/dist/helpers/objects.js +1 -1
- package/dist/hooks/useId.cjs +1 -0
- package/dist/hooks/useId.js +13 -0
- package/dist/themes/extendTheme.cjs +1 -1
- package/dist/themes/extendTheme.js +4 -4
- package/dist/v2/Breadcrumbs/Breadcrumbs.cjs +2 -2
- package/dist/v2/Breadcrumbs/Breadcrumbs.js +4 -13
- package/dist/v2/Breadcrumbs/Crumb.js +11 -12
- package/dist/v2/Breadcrumbs/CrumbLink.js +1 -3
- package/dist/v2/Breadcrumbs/CrumbSimpleMenu.cjs +2 -2
- package/dist/v2/Breadcrumbs/CrumbSimpleMenu.js +5 -11
- package/dist/v2/Breadcrumbs/Divider.js +1 -8
- package/dist/v2/Link/Link.cjs +2 -2
- package/dist/v2/Link/Link.js +5 -24
- package/dist/v2/LinkButton/LinkButton.cjs +11 -24
- package/dist/v2/LinkButton/LinkButton.js +62 -84
- package/dist/v2/MainNav/MainNav.cjs +2 -2
- package/dist/v2/MainNav/MainNav.js +21 -20
- package/dist/v2/MainNav/NavBrand.cjs +2 -2
- package/dist/v2/MainNav/NavBrand.js +4 -38
- package/dist/v2/MainNav/NavCondense.cjs +2 -2
- package/dist/v2/MainNav/NavCondense.js +10 -18
- package/dist/v2/MainNav/NavFooter.js +1 -3
- package/dist/v2/MainNav/NavLink.cjs +4 -4
- package/dist/v2/MainNav/NavLink.js +10 -39
- package/dist/v2/MainNav/NavSection.cjs +1 -1
- package/dist/v2/MainNav/NavSection.js +5 -38
- package/dist/v2/MainNav/NavSections.cjs +2 -2
- package/dist/v2/MainNav/NavSections.js +4 -15
- package/dist/v2/MainNav/NavUser.cjs +2 -2
- package/dist/v2/MainNav/NavUser.js +6 -27
- package/dist/v2/Pagination/Pagination.cjs +2 -2
- package/dist/v2/Pagination/Pagination.js +11 -16
- package/dist/v2/Pagination/components.cjs +2 -2
- package/dist/v2/Pagination/components.js +11 -39
- package/dist/v2/SimpleMenu/SimpleMenu.cjs +4 -4
- package/dist/v2/SimpleMenu/SimpleMenu.js +42 -65
- package/dist/v2/SubNav/SubNav.cjs +2 -2
- package/dist/v2/SubNav/SubNav.js +5 -9
- package/dist/v2/SubNav/SubNavHeader.cjs +2 -2
- package/dist/v2/SubNav/SubNavHeader.js +31 -53
- package/dist/v2/SubNav/SubNavLink.cjs +2 -2
- package/dist/v2/SubNav/SubNavLink.js +18 -22
- package/dist/v2/SubNav/SubNavLinkSection.cjs +2 -2
- package/dist/v2/SubNav/SubNavLinkSection.js +5 -30
- package/dist/v2/SubNav/SubNavSection.cjs +2 -2
- package/dist/v2/SubNav/SubNavSection.js +26 -33
- package/dist/v2/SubNav/SubNavSectionLabel.cjs +2 -2
- package/dist/v2/SubNav/SubNavSectionLabel.js +15 -24
- package/dist/v2/SubNav/SubNavSections.cjs +1 -1
- package/dist/v2/SubNav/SubNavSections.js +3 -12
- package/package.json +7 -4
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import t, { useRef as T, useEffect as v, useState as B, Children as z, cloneElement as j } from "react";
|
|
2
|
+
import { useCallbackRef as K } from "@radix-ui/react-use-callback-ref";
|
|
3
|
+
import { CarretDown as H } from "@strapi/icons";
|
|
2
4
|
import e from "prop-types";
|
|
5
|
+
import { NavLink as U } from "react-router-dom";
|
|
3
6
|
import y from "styled-components";
|
|
4
|
-
import {
|
|
5
|
-
import { useCallbackRef as K } from "@radix-ui/react-use-callback-ref";
|
|
6
|
-
import { CarretDown as U } from "@strapi/icons";
|
|
7
|
-
import { Typography as O } from "../Typography/Typography.js";
|
|
8
|
-
import { Link as G } from "../Link/Link.js";
|
|
7
|
+
import { getOptionStyle as b } from "./utils.js";
|
|
9
8
|
import { Box as k } from "../Box/Box.js";
|
|
10
|
-
import { Flex as J } from "../Flex/Flex.js";
|
|
11
9
|
import { Button as $ } from "../Button/Button.js";
|
|
12
|
-
import {
|
|
13
|
-
import { getOptionStyle as b } from "./utils.js";
|
|
14
|
-
import { useId as Y } from "../helpers/useId.js";
|
|
10
|
+
import { Flex as G } from "../Flex/Flex.js";
|
|
15
11
|
import { KeyboardKeys as i } from "../helpers/keyboardKeys.js";
|
|
12
|
+
import { useId as J } from "../helpers/useId.js";
|
|
13
|
+
import { Link as Q } from "../Link/Link.js";
|
|
14
|
+
import { POPOVER_PLACEMENTS as X, Popover as Y } from "../Popover/Popover.js";
|
|
15
|
+
import { Typography as O } from "../Typography/Typography.js";
|
|
16
16
|
const Z = y.button`
|
|
17
17
|
border: none;
|
|
18
18
|
padding: 0;
|
|
19
19
|
background: transparent;
|
|
20
20
|
cursor: pointer;
|
|
21
21
|
${b}
|
|
22
|
-
`, ee = y(
|
|
22
|
+
`, ee = y(U)`
|
|
23
23
|
text-decoration: none;
|
|
24
24
|
${b}
|
|
25
|
-
`, ne = y(
|
|
25
|
+
`, ne = y(Q)`
|
|
26
26
|
/* Removing Link hover effect */
|
|
27
27
|
&:hover {
|
|
28
28
|
color: currentColor;
|
|
@@ -60,25 +60,7 @@ const Z = y.button`
|
|
|
60
60
|
}, u = (g) => {
|
|
61
61
|
(g.key === i.SPACE || g.key === i.ENTER) && E();
|
|
62
62
|
};
|
|
63
|
-
return s && !l ? /* @__PURE__ */ t.createElement(ee, {
|
|
64
|
-
to: s,
|
|
65
|
-
...p
|
|
66
|
-
}, /* @__PURE__ */ t.createElement(k, {
|
|
67
|
-
padding: 2
|
|
68
|
-
}, /* @__PURE__ */ t.createElement(O, null, o))) : l && !s ? /* @__PURE__ */ t.createElement(ne, {
|
|
69
|
-
isExternal: !0,
|
|
70
|
-
href: l,
|
|
71
|
-
...p
|
|
72
|
-
}, /* @__PURE__ */ t.createElement(k, {
|
|
73
|
-
padding: 2
|
|
74
|
-
}, /* @__PURE__ */ t.createElement(O, null, o))) : /* @__PURE__ */ t.createElement(Z, {
|
|
75
|
-
onKeyDown: u,
|
|
76
|
-
onMouseDown: E,
|
|
77
|
-
type: "button",
|
|
78
|
-
...p
|
|
79
|
-
}, /* @__PURE__ */ t.createElement(k, {
|
|
80
|
-
padding: 2
|
|
81
|
-
}, /* @__PURE__ */ t.createElement(O, null, o)));
|
|
63
|
+
return s && !l ? /* @__PURE__ */ t.createElement(ee, { to: s, ...p }, /* @__PURE__ */ t.createElement(k, { padding: 2 }, /* @__PURE__ */ t.createElement(O, null, o))) : l && !s ? /* @__PURE__ */ t.createElement(ne, { isExternal: !0, href: l, ...p }, /* @__PURE__ */ t.createElement(k, { padding: 2 }, /* @__PURE__ */ t.createElement(O, null, o))) : /* @__PURE__ */ t.createElement(Z, { onKeyDown: u, onMouseDown: E, type: "button", ...p }, /* @__PURE__ */ t.createElement(k, { padding: 2 }, /* @__PURE__ */ t.createElement(O, null, o)));
|
|
82
64
|
};
|
|
83
65
|
L.defaultProps = {
|
|
84
66
|
as: void 0,
|
|
@@ -110,7 +92,7 @@ const C = ({
|
|
|
110
92
|
onReachEnd: u,
|
|
111
93
|
...g
|
|
112
94
|
}) => {
|
|
113
|
-
const d = T(), R =
|
|
95
|
+
const d = T(), R = J(s), x = T(!1), [m, f] = B(!1), [D, I] = B(0), h = z.toArray(E), A = a || (c === "S" ? oe : $), S = !!u && typeof u == "function";
|
|
114
96
|
v(() => {
|
|
115
97
|
if (["string", "number"].includes(typeof o)) {
|
|
116
98
|
const n = h.findIndex((r) => r.props.children === o);
|
|
@@ -133,46 +115,40 @@ const C = ({
|
|
|
133
115
|
n.preventDefault(), f((r) => !r);
|
|
134
116
|
}, W = () => {
|
|
135
117
|
S && u();
|
|
136
|
-
}, _ = h.map((n, r) => /* @__PURE__ */ t.createElement(
|
|
137
|
-
as: "li",
|
|
138
|
-
key: r,
|
|
139
|
-
justifyContent: "center",
|
|
140
|
-
role: "menuitem"
|
|
141
|
-
}, j(n, {
|
|
118
|
+
}, _ = h.map((n, r) => /* @__PURE__ */ t.createElement(G, { as: "li", key: r, justifyContent: "center", role: "menuitem" }, j(n, {
|
|
142
119
|
onClick() {
|
|
143
120
|
n.props.onClick(), f(!1), d.current.focus();
|
|
144
121
|
},
|
|
145
122
|
isFocused: D === r
|
|
146
123
|
})));
|
|
147
|
-
return /* @__PURE__ */ t.createElement("div", {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
padding: 1,
|
|
174
|
-
|
|
175
|
-
}, _)));
|
|
124
|
+
return /* @__PURE__ */ t.createElement("div", { onKeyDown: N }, /* @__PURE__ */ t.createElement(
|
|
125
|
+
A,
|
|
126
|
+
{
|
|
127
|
+
label: t.isValidElement(o) ? null : o,
|
|
128
|
+
"aria-haspopup": !0,
|
|
129
|
+
"aria-expanded": m,
|
|
130
|
+
"aria-controls": R,
|
|
131
|
+
onKeyDown: F,
|
|
132
|
+
onMouseDown: q,
|
|
133
|
+
ref: d,
|
|
134
|
+
type: "button",
|
|
135
|
+
variant: "ghost",
|
|
136
|
+
endIcon: /* @__PURE__ */ t.createElement(te, null, /* @__PURE__ */ t.createElement(H, { "aria-hidden": !0 })),
|
|
137
|
+
...g
|
|
138
|
+
},
|
|
139
|
+
o
|
|
140
|
+
), m && /* @__PURE__ */ t.createElement(
|
|
141
|
+
Y,
|
|
142
|
+
{
|
|
143
|
+
onBlur: V,
|
|
144
|
+
placement: p,
|
|
145
|
+
source: d,
|
|
146
|
+
onReachEnd: W,
|
|
147
|
+
intersectionId: S ? `popover-${R}` : void 0,
|
|
148
|
+
spacing: 4
|
|
149
|
+
},
|
|
150
|
+
/* @__PURE__ */ t.createElement(k, { role: "menu", as: "ul", padding: 1, id: R }, _)
|
|
151
|
+
));
|
|
176
152
|
};
|
|
177
153
|
C.defaultProps = {
|
|
178
154
|
as: void 0
|
|
@@ -194,7 +170,7 @@ C.propTypes = {
|
|
|
194
170
|
onClose: e.func,
|
|
195
171
|
onOpen: e.func,
|
|
196
172
|
onReachEnd: e.func,
|
|
197
|
-
popoverPlacement: e.oneOf(
|
|
173
|
+
popoverPlacement: e.oneOf(X),
|
|
198
174
|
size: e.oneOf(["S", "M"])
|
|
199
175
|
};
|
|
200
176
|
export {
|
package/dist/Status/Status.js
CHANGED
|
@@ -16,19 +16,21 @@ const b = l.div`
|
|
|
16
16
|
}
|
|
17
17
|
`, p = ({ variant: o, showBullet: r, size: n, children: a, ...i }) => {
|
|
18
18
|
const c = `${o}100`, m = `${o}200`, u = `${o}600`, g = `${o}600`, s = n === "S" ? 2 : 5, d = n === "S" ? 1 : 4;
|
|
19
|
-
return /* @__PURE__ */ t.createElement(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
19
|
+
return /* @__PURE__ */ t.createElement(
|
|
20
|
+
y,
|
|
21
|
+
{
|
|
22
|
+
borderColor: m,
|
|
23
|
+
textColor: g,
|
|
24
|
+
background: c,
|
|
25
|
+
hasRadius: !0,
|
|
26
|
+
paddingTop: d,
|
|
27
|
+
paddingBottom: d,
|
|
28
|
+
paddingLeft: s,
|
|
29
|
+
paddingRight: s,
|
|
30
|
+
...i
|
|
31
|
+
},
|
|
32
|
+
r ? /* @__PURE__ */ t.createElement($, null, /* @__PURE__ */ t.createElement(b, { backgroundColor: u }), a) : a
|
|
33
|
+
);
|
|
32
34
|
};
|
|
33
35
|
p.defaultProps = {
|
|
34
36
|
showBullet: !0,
|
package/dist/SubNav/SubNav.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react"),i=require("
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react"),i=require("prop-types"),u=require("styled-components"),d=require("../Grid/Grid.cjs");require("../Grid/GridItem.cjs");const t=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},l=t(s),c=t(i),n=t(u),r=`${232/16}rem`,p=n.default(d.Grid)`
|
|
2
2
|
width: ${r};
|
|
3
3
|
background: ${({theme:e})=>e.colors.neutral100};
|
|
4
4
|
position: sticky;
|
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
overflow-y: auto;
|
|
8
8
|
border-right: 1px solid ${({theme:e})=>e.colors.neutral200};
|
|
9
9
|
z-index: 1;
|
|
10
|
-
`,o=({ariaLabel:e,...a})=>l.default.createElement(p,{"aria-label":e,as:"nav",...a});o.propTypes={ariaLabel:
|
|
10
|
+
`,o=({ariaLabel:e,...a})=>l.default.createElement(p,{"aria-label":e,as:"nav",...a});o.propTypes={ariaLabel:c.default.string.isRequired};exports.SubNav=o;exports.subNavWidth=r;
|
package/dist/SubNav/SubNav.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import t from "react";
|
|
2
|
-
import e from "
|
|
3
|
-
import i from "
|
|
2
|
+
import e from "prop-types";
|
|
3
|
+
import i from "styled-components";
|
|
4
4
|
import { Grid as a } from "../Grid/Grid.js";
|
|
5
5
|
import "../Grid/GridItem.js";
|
|
6
|
-
const p = `${232 / 16}rem`, s =
|
|
6
|
+
const p = `${232 / 16}rem`, s = i(a)`
|
|
7
7
|
width: ${p};
|
|
8
8
|
background: ${({ theme: r }) => r.colors.neutral100};
|
|
9
9
|
position: sticky;
|
|
@@ -12,13 +12,9 @@ const p = `${232 / 16}rem`, s = e(a)`
|
|
|
12
12
|
overflow-y: auto;
|
|
13
13
|
border-right: 1px solid ${({ theme: r }) => r.colors.neutral200};
|
|
14
14
|
z-index: 1;
|
|
15
|
-
`, l = ({ ariaLabel: r, ...o }) => /* @__PURE__ */ t.createElement(s, {
|
|
16
|
-
"aria-label": r,
|
|
17
|
-
as: "nav",
|
|
18
|
-
...o
|
|
19
|
-
});
|
|
15
|
+
`, l = ({ ariaLabel: r, ...o }) => /* @__PURE__ */ t.createElement(s, { "aria-label": r, as: "nav", ...o });
|
|
20
16
|
l.propTypes = {
|
|
21
|
-
ariaLabel:
|
|
17
|
+
ariaLabel: e.string.isRequired
|
|
22
18
|
};
|
|
23
19
|
export {
|
|
24
20
|
l as SubNav,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react"),C=require("
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react"),C=require("@strapi/icons"),I=require("prop-types"),R=require("styled-components"),s=require("../Box/Box.cjs"),_=require("../Divider/Divider.cjs"),D=require("../Flex/Flex.cjs"),P=require("../helpers/keyboardKeys.cjs"),F=require("../helpers/useId.cjs"),K=require("../helpers/usePrevious.cjs"),L=require("../IconButton/IconButton.cjs"),k=require("../Searchbar/Searchbar.cjs"),w=require("../Searchbar/SearchForm.cjs"),O=require("../Typography/Typography.cjs"),d=t=>t&&typeof t=="object"&&"default"in t?t:{default:t},e=d(o),r=d(I),H=d(R),h=H.default(_.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:y,onChange:b,value:m,onClear:S,onSubmit:v,id:B})=>{const[n,l]=o.useState(!1),p=
|
|
4
|
+
`,i=({as:t,label:g,searchLabel:f,searchable:y,onChange:b,value:m,onClear:S,onSubmit:v,id:B})=>{const[n,l]=o.useState(!1),p=K.usePrevious(n),q=F.useId(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===P.KeyboardKeys.ESCAPE&&l(!1)};return n?e.default.createElement(s.Box,{paddingLeft:4,paddingTop:5,paddingBottom:2,paddingRight:4},e.default.createElement(w.SearchForm,null,e.default.createElement(k.Searchbar,{name:"searchbar",value:m,onChange:b,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(D.Flex,{justifyContent:"space-between",alignItems:"flex-start"},e.default.createElement(O.Typography,{variant:"beta",as:t},g),y&&e.default.createElement(L.IconButton,{ref:u,onClick:E,label:f,icon:e.default.createElement(C.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,22 +1,22 @@
|
|
|
1
1
|
import e, { useState as L, useRef as p, useEffect as w } from "react";
|
|
2
|
+
import { Search as x } from "@strapi/icons";
|
|
2
3
|
import r from "prop-types";
|
|
3
|
-
import
|
|
4
|
-
import { Search as D } from "@strapi/icons";
|
|
5
|
-
import { Flex as I } from "../Flex/Flex.js";
|
|
6
|
-
import { Typography as K } from "../Typography/Typography.js";
|
|
7
|
-
import { IconButton as P } from "../IconButton/IconButton.js";
|
|
4
|
+
import D from "styled-components";
|
|
8
5
|
import { Box as n } from "../Box/Box.js";
|
|
9
|
-
import { Divider as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { useId as
|
|
13
|
-
import { usePrevious as
|
|
14
|
-
import {
|
|
15
|
-
|
|
6
|
+
import { Divider as I } from "../Divider/Divider.js";
|
|
7
|
+
import { Flex as K } from "../Flex/Flex.js";
|
|
8
|
+
import { KeyboardKeys as P } from "../helpers/keyboardKeys.js";
|
|
9
|
+
import { useId as k } from "../helpers/useId.js";
|
|
10
|
+
import { usePrevious as O } from "../helpers/usePrevious.js";
|
|
11
|
+
import { IconButton as F } from "../IconButton/IconButton.js";
|
|
12
|
+
import { Searchbar as _ } from "../Searchbar/Searchbar.js";
|
|
13
|
+
import { SearchForm as $ } from "../Searchbar/SearchForm.js";
|
|
14
|
+
import { Typography as j } from "../Typography/Typography.js";
|
|
15
|
+
const d = D(I)`
|
|
16
16
|
width: ${24 / 16}rem;
|
|
17
17
|
background-color: ${({ theme: l }) => l.colors.neutral200};
|
|
18
18
|
`, f = ({ as: l, label: u, searchLabel: s, searchable: g, onChange: h, value: b, onClear: E, onSubmit: S, id: y }) => {
|
|
19
|
-
const [o, i] = L(!1), m =
|
|
19
|
+
const [o, i] = L(!1), m = O(o), C = k(y), a = p(), c = p();
|
|
20
20
|
w(() => {
|
|
21
21
|
o && a.current && a.current.focus(), m && !o && c.current && c.current.focus();
|
|
22
22
|
}, [o, m]);
|
|
@@ -27,47 +27,25 @@ const d = x(k)`
|
|
|
27
27
|
}, T = (t) => {
|
|
28
28
|
t.relatedTarget?.id !== C && i(!1);
|
|
29
29
|
}, R = (t) => {
|
|
30
|
-
t.key ===
|
|
30
|
+
t.key === P.ESCAPE && i(!1);
|
|
31
31
|
};
|
|
32
|
-
return o ? /* @__PURE__ */ e.createElement(n, {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}, s)), /* @__PURE__ */ e.createElement(n, {
|
|
50
|
-
paddingLeft: 2,
|
|
51
|
-
paddingTop: 4
|
|
52
|
-
}, /* @__PURE__ */ e.createElement(d, null))) : /* @__PURE__ */ e.createElement(n, {
|
|
53
|
-
paddingLeft: 6,
|
|
54
|
-
paddingTop: 6,
|
|
55
|
-
paddingBottom: 2,
|
|
56
|
-
paddingRight: 4
|
|
57
|
-
}, /* @__PURE__ */ e.createElement(I, {
|
|
58
|
-
justifyContent: "space-between",
|
|
59
|
-
alignItems: "flex-start"
|
|
60
|
-
}, /* @__PURE__ */ e.createElement(K, {
|
|
61
|
-
variant: "beta",
|
|
62
|
-
as: l
|
|
63
|
-
}, u), g && /* @__PURE__ */ e.createElement(P, {
|
|
64
|
-
ref: c,
|
|
65
|
-
onClick: v,
|
|
66
|
-
label: s,
|
|
67
|
-
icon: /* @__PURE__ */ e.createElement(D, null)
|
|
68
|
-
})), /* @__PURE__ */ e.createElement(n, {
|
|
69
|
-
paddingTop: 4
|
|
70
|
-
}, /* @__PURE__ */ e.createElement(d, null)));
|
|
32
|
+
return o ? /* @__PURE__ */ e.createElement(n, { paddingLeft: 4, paddingTop: 5, paddingBottom: 2, paddingRight: 4 }, /* @__PURE__ */ e.createElement($, null, /* @__PURE__ */ e.createElement(
|
|
33
|
+
_,
|
|
34
|
+
{
|
|
35
|
+
name: "searchbar",
|
|
36
|
+
value: b,
|
|
37
|
+
onChange: h,
|
|
38
|
+
placeholder: "e.g: strapi-plugin-abcd",
|
|
39
|
+
onKeyDown: R,
|
|
40
|
+
ref: a,
|
|
41
|
+
onBlur: T,
|
|
42
|
+
onClear: B,
|
|
43
|
+
onSubmit: S,
|
|
44
|
+
clearLabel: "Clear",
|
|
45
|
+
size: "S"
|
|
46
|
+
},
|
|
47
|
+
s
|
|
48
|
+
)), /* @__PURE__ */ e.createElement(n, { paddingLeft: 2, paddingTop: 4 }, /* @__PURE__ */ e.createElement(d, null))) : /* @__PURE__ */ e.createElement(n, { paddingLeft: 6, paddingTop: 6, paddingBottom: 2, paddingRight: 4 }, /* @__PURE__ */ e.createElement(K, { justifyContent: "space-between", alignItems: "flex-start" }, /* @__PURE__ */ e.createElement(j, { variant: "beta", as: l }, u), g && /* @__PURE__ */ e.createElement(F, { ref: c, onClick: v, label: s, icon: /* @__PURE__ */ e.createElement(x, null) })), /* @__PURE__ */ e.createElement(n, { paddingTop: 4 }, /* @__PURE__ */ e.createElement(d, null)));
|
|
71
49
|
};
|
|
72
50
|
f.defaultProps = {
|
|
73
51
|
as: "h2",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const y=require("react"),g=require("
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const y=require("react"),g=require("@strapi/icons"),m=require("prop-types"),b=require("react-router-dom"),h=require("styled-components"),a=require("../Box/Box.cjs"),s=require("../Flex/Flex.cjs"),c=require("../Typography/Typography.cjs"),n=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},t=n(y),r=n(m),i=n(h),x=i.default(a.Box)`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
justify-content: space-between;
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
&:focus-visible {
|
|
26
26
|
outline-offset: -2px;
|
|
27
27
|
}
|
|
28
|
-
`,u=i.default(
|
|
28
|
+
`,u=i.default(g.Dot)`
|
|
29
29
|
width: ${12/16}rem;
|
|
30
30
|
height: ${4/16}rem;
|
|
31
31
|
* {
|
|
@@ -36,4 +36,4 @@
|
|
|
36
36
|
height: ${12/16}rem;
|
|
37
37
|
width: ${12/16}rem;
|
|
38
38
|
}
|
|
39
|
-
`,l=({children:e,icon:o,withBullet:d,isSubSectionChild:p,...f})=>t.default.createElement(x,{as:
|
|
39
|
+
`,l=({children:e,icon:o,withBullet:d,isSubSectionChild:p,...f})=>t.default.createElement(x,{as:b.NavLink,icon:o,background:"neutral100",paddingLeft:p?9:7,paddingBottom:2,paddingTop:2,...f},t.default.createElement(s.Flex,null,o?t.default.createElement(v,null,o):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:s.Flex,paddingRight:4},t.default.createElement(u,{$active:!0})));l.displayName="SubNavLink";l.defaultProps={icon:null,isSubSectionChild:!1,withBullet:!1};l.propTypes={children:r.default.node.isRequired,icon:r.default.element,isSubSectionChild:r.default.bool,withBullet:r.default.bool};exports.SubNavLink=l;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import r from "react";
|
|
2
|
+
import { Dot as u } from "@strapi/icons";
|
|
2
3
|
import t from "prop-types";
|
|
3
|
-
import { NavLink as
|
|
4
|
+
import { NavLink as f } from "react-router-dom";
|
|
4
5
|
import i from "styled-components";
|
|
5
|
-
import { Dot as f } from "@strapi/icons";
|
|
6
6
|
import { Box as l } from "../Box/Box.js";
|
|
7
|
-
import { Typography as s } from "../Typography/Typography.js";
|
|
8
7
|
import { Flex as a } from "../Flex/Flex.js";
|
|
8
|
+
import { Typography as s } from "../Typography/Typography.js";
|
|
9
9
|
const g = i(l)`
|
|
10
10
|
display: flex;
|
|
11
11
|
align-items: center;
|
|
@@ -33,7 +33,7 @@ const g = i(l)`
|
|
|
33
33
|
&:focus-visible {
|
|
34
34
|
outline-offset: -2px;
|
|
35
35
|
}
|
|
36
|
-
`, p = i(
|
|
36
|
+
`, p = i(u)`
|
|
37
37
|
width: ${12 / 16}rem;
|
|
38
38
|
height: ${4 / 16}rem;
|
|
39
39
|
* {
|
|
@@ -44,24 +44,20 @@ const g = i(l)`
|
|
|
44
44
|
height: ${12 / 16}rem;
|
|
45
45
|
width: ${12 / 16}rem;
|
|
46
46
|
}
|
|
47
|
-
`, n = ({ children: e, icon: o, withBullet: c, isSubSectionChild: m, ...d }) => /* @__PURE__ */ r.createElement(
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
},
|
|
58
|
-
as: "span"
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
paddingRight: 4
|
|
62
|
-
}, /* @__PURE__ */ r.createElement(p, {
|
|
63
|
-
$active: !0
|
|
64
|
-
})));
|
|
47
|
+
`, n = ({ children: e, icon: o, withBullet: c, isSubSectionChild: m, ...d }) => /* @__PURE__ */ r.createElement(
|
|
48
|
+
g,
|
|
49
|
+
{
|
|
50
|
+
as: f,
|
|
51
|
+
icon: o,
|
|
52
|
+
background: "neutral100",
|
|
53
|
+
paddingLeft: m ? 9 : 7,
|
|
54
|
+
paddingBottom: 2,
|
|
55
|
+
paddingTop: 2,
|
|
56
|
+
...d
|
|
57
|
+
},
|
|
58
|
+
/* @__PURE__ */ r.createElement(a, null, o ? /* @__PURE__ */ r.createElement($, null, o) : /* @__PURE__ */ r.createElement(p, null), /* @__PURE__ */ r.createElement(l, { paddingLeft: 2 }, /* @__PURE__ */ r.createElement(s, { as: "span" }, e))),
|
|
59
|
+
c && /* @__PURE__ */ r.createElement(l, { as: a, paddingRight: 4 }, /* @__PURE__ */ r.createElement(p, { $active: !0 }))
|
|
60
|
+
);
|
|
65
61
|
n.displayName = "SubNavLink";
|
|
66
62
|
n.defaultProps = {
|
|
67
63
|
icon: null,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react"),m=require("
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react"),m=require("@strapi/icons"),h=require("prop-types"),x=require("styled-components"),l=require("../Box/Box.cjs"),b=require("../Flex/Flex.cjs"),S=require("../helpers/useId.cjs"),v=require("../Typography/Typography.cjs"),d=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},t=d(o),r=d(h),i=d(x),E=i.default(l.Box)`
|
|
2
2
|
svg {
|
|
3
3
|
height: ${4/16}rem;
|
|
4
4
|
path {
|
|
@@ -16,4 +16,4 @@
|
|
|
16
16
|
align-items: center;
|
|
17
17
|
width: ${12/16}rem;
|
|
18
18
|
transform: rotateX(${({rotated:e})=>e?"0deg":"180deg"});
|
|
19
|
-
`,s=({label:e,children:u,id:p})=>{const[n,f]=o.useState(!0),c=
|
|
19
|
+
`,s=({label:e,children:u,id:p})=>{const[n,f]=o.useState(!0),c=S.useId(p),g=()=>{f(a=>!a)};return t.default.createElement(l.Box,null,t.default.createElement(E,{paddingLeft:7,paddingTop:2,paddingBottom:2,paddingRight:4},t.default.createElement(b.Flex,{justifyContent:"space-between"},t.default.createElement(k,{onClick:g,"aria-expanded":n,"aria-controls":c},t.default.createElement(q,{rotated:n},t.default.createElement(m.CarretDown,{"aria-hidden":!0})),t.default.createElement(l.Box,{paddingLeft:2},t.default.createElement(v.Typography,{as:"span",fontWeight:"semiBold",textColor:"neutral800"},e))))),n&&t.default.createElement("ul",{id:c},o.Children.map(u,(a,y)=>t.default.createElement("li",{key:y},a))))};s.defaultProps={children:void 0,id:void 0};s.propTypes={children:r.default.node,id:r.default.string,label:r.default.string.isRequired};exports.SubNavLinkSection=s;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import e, { useState as f, Children as g } from "react";
|
|
2
|
+
import { CarretDown as h } from "@strapi/icons";
|
|
2
3
|
import o from "prop-types";
|
|
3
4
|
import a from "styled-components";
|
|
4
|
-
import { CarretDown as h } from "@strapi/icons";
|
|
5
5
|
import { Box as i } from "../Box/Box.js";
|
|
6
6
|
import { Flex as E } from "../Flex/Flex.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { useId as y } from "../helpers/useId.js";
|
|
8
|
+
import { Typography as b } from "../Typography/Typography.js";
|
|
9
9
|
const k = a(i)`
|
|
10
10
|
svg {
|
|
11
11
|
height: ${4 / 16}rem;
|
|
@@ -25,35 +25,10 @@ const k = a(i)`
|
|
|
25
25
|
width: ${12 / 16}rem;
|
|
26
26
|
transform: rotateX(${({ rotated: t }) => t ? "0deg" : "180deg"});
|
|
27
27
|
`, l = ({ label: t, children: p, id: m }) => {
|
|
28
|
-
const [r, s] = f(!0), d =
|
|
28
|
+
const [r, s] = f(!0), d = y(m), c = () => {
|
|
29
29
|
s((n) => !n);
|
|
30
30
|
};
|
|
31
|
-
return /* @__PURE__ */ e.createElement(i, null, /* @__PURE__ */ e.createElement(k, {
|
|
32
|
-
paddingLeft: 7,
|
|
33
|
-
paddingTop: 2,
|
|
34
|
-
paddingBottom: 2,
|
|
35
|
-
paddingRight: 4
|
|
36
|
-
}, /* @__PURE__ */ e.createElement(E, {
|
|
37
|
-
justifyContent: "space-between"
|
|
38
|
-
}, /* @__PURE__ */ e.createElement(v, {
|
|
39
|
-
onClick: c,
|
|
40
|
-
"aria-expanded": r,
|
|
41
|
-
"aria-controls": d
|
|
42
|
-
}, /* @__PURE__ */ e.createElement(x, {
|
|
43
|
-
rotated: r
|
|
44
|
-
}, /* @__PURE__ */ e.createElement(h, {
|
|
45
|
-
"aria-hidden": !0
|
|
46
|
-
})), /* @__PURE__ */ e.createElement(i, {
|
|
47
|
-
paddingLeft: 2
|
|
48
|
-
}, /* @__PURE__ */ e.createElement(y, {
|
|
49
|
-
as: "span",
|
|
50
|
-
fontWeight: "semiBold",
|
|
51
|
-
textColor: "neutral800"
|
|
52
|
-
}, t))))), r && /* @__PURE__ */ e.createElement("ul", {
|
|
53
|
-
id: d
|
|
54
|
-
}, g.map(p, (n, u) => /* @__PURE__ */ e.createElement("li", {
|
|
55
|
-
key: u
|
|
56
|
-
}, n))));
|
|
31
|
+
return /* @__PURE__ */ e.createElement(i, null, /* @__PURE__ */ e.createElement(k, { paddingLeft: 7, paddingTop: 2, paddingBottom: 2, paddingRight: 4 }, /* @__PURE__ */ e.createElement(E, { justifyContent: "space-between" }, /* @__PURE__ */ e.createElement(v, { onClick: c, "aria-expanded": r, "aria-controls": d }, /* @__PURE__ */ e.createElement(x, { rotated: r }, /* @__PURE__ */ e.createElement(h, { "aria-hidden": !0 })), /* @__PURE__ */ e.createElement(i, { paddingLeft: 2 }, /* @__PURE__ */ e.createElement(b, { as: "span", fontWeight: "semiBold", textColor: "neutral800" }, t))))), r && /* @__PURE__ */ e.createElement("ul", { id: d }, g.map(p, (n, u) => /* @__PURE__ */ e.createElement("li", { key: u }, n))));
|
|
57
32
|
};
|
|
58
33
|
l.defaultProps = {
|
|
59
34
|
children: void 0,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react"),m=require("prop-types"),v=require("styled-components"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react"),m=require("prop-types"),v=require("styled-components"),h=require("./SubNavSectionLabel.cjs"),y=require("../Badge/Badge.cjs"),c=require("../Box/Box.cjs"),B=require("../helpers/useId.cjs"),k=require("../Stack/Stack.cjs"),r=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},t=r(n),a=r(m),q=r(v),_=q.default(c.Box)`
|
|
2
2
|
svg {
|
|
3
3
|
height: ${4/16}rem;
|
|
4
4
|
path {
|
|
5
5
|
fill: ${({theme:e})=>e.colors.neutral500};
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
|
-
`,s=({collapsable:e,label:u,badgeLabel:o,children:p,id:f})=>{const[d,g]=n.useState(!0),i=B.useId(f),S=()=>{g(l=>!l)};return t.default.createElement(k.Stack,{spacing:1},t.default.createElement(_,{paddingLeft:6,paddingTop:1,paddingBottom:1,paddingRight:4},t.default.createElement(c.Box,{position:"relative",paddingRight:o?6:0},t.default.createElement(
|
|
8
|
+
`,s=({collapsable:e,label:u,badgeLabel:o,children:p,id:f})=>{const[d,g]=n.useState(!0),i=B.useId(f),S=()=>{g(l=>!l)};return t.default.createElement(k.Stack,{spacing:1},t.default.createElement(_,{paddingLeft:6,paddingTop:1,paddingBottom:1,paddingRight:4},t.default.createElement(c.Box,{position:"relative",paddingRight:o?6:0},t.default.createElement(h.SubNavSectionLabel,{onClick:S,ariaExpanded:d,ariaControls:i,collapsable:e,label:u}),o&&t.default.createElement(y.Badge,{backgroundColor:"neutral150",textColor:"neutral600",position:"absolute",right:0,top:"50%",transform:"translateY(-50%)"},o))),(!e||d)&&t.default.createElement("ol",{id:i},n.Children.map(p,(l,b)=>t.default.createElement("li",{key:b},l))))};s.defaultProps={badgeLabel:null,children:void 0,collapsable:!1,id:void 0};s.propTypes={badgeLabel:a.default.string,children:a.default.node,collapsable:a.default.bool,id:a.default.string,label:a.default.string.isRequired};exports.SubNavSection=s;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import e, { useState as f, Children as h } from "react";
|
|
2
2
|
import t from "prop-types";
|
|
3
3
|
import b from "styled-components";
|
|
4
|
+
import { SubNavSectionLabel as E } from "./SubNavSectionLabel.js";
|
|
5
|
+
import { Badge as S } from "../Badge/Badge.js";
|
|
4
6
|
import { Box as l } from "../Box/Box.js";
|
|
5
|
-
import { Badge as E } from "../Badge/Badge.js";
|
|
6
|
-
import { SubNavSectionLabel as S } from "./SubNavSectionLabel.js";
|
|
7
7
|
import { useId as v } from "../helpers/useId.js";
|
|
8
8
|
import { Stack as k } from "../Stack/Stack.js";
|
|
9
9
|
const C = b(l)`
|
|
@@ -17,34 +17,27 @@ const C = b(l)`
|
|
|
17
17
|
const [n, c] = f(!0), a = v(m), u = () => {
|
|
18
18
|
c((i) => !i);
|
|
19
19
|
};
|
|
20
|
-
return /* @__PURE__ */ e.createElement(k, {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
top: "50%",
|
|
42
|
-
transform: "translateY(-50%)"
|
|
43
|
-
}, o))), (!r || n) && /* @__PURE__ */ e.createElement("ol", {
|
|
44
|
-
id: a
|
|
45
|
-
}, h.map(s, (i, g) => /* @__PURE__ */ e.createElement("li", {
|
|
46
|
-
key: g
|
|
47
|
-
}, i))));
|
|
20
|
+
return /* @__PURE__ */ e.createElement(k, { spacing: 1 }, /* @__PURE__ */ e.createElement(C, { paddingLeft: 6, paddingTop: 1, paddingBottom: 1, paddingRight: 4 }, /* @__PURE__ */ e.createElement(l, { position: "relative", paddingRight: o ? 6 : 0 }, /* @__PURE__ */ e.createElement(
|
|
21
|
+
E,
|
|
22
|
+
{
|
|
23
|
+
onClick: u,
|
|
24
|
+
ariaExpanded: n,
|
|
25
|
+
ariaControls: a,
|
|
26
|
+
collapsable: r,
|
|
27
|
+
label: d
|
|
28
|
+
}
|
|
29
|
+
), o && /* @__PURE__ */ e.createElement(
|
|
30
|
+
S,
|
|
31
|
+
{
|
|
32
|
+
backgroundColor: "neutral150",
|
|
33
|
+
textColor: "neutral600",
|
|
34
|
+
position: "absolute",
|
|
35
|
+
right: 0,
|
|
36
|
+
top: "50%",
|
|
37
|
+
transform: "translateY(-50%)"
|
|
38
|
+
},
|
|
39
|
+
o
|
|
40
|
+
))), (!r || n) && /* @__PURE__ */ e.createElement("ol", { id: a }, h.map(s, (i, g) => /* @__PURE__ */ e.createElement("li", { key: g }, i))));
|
|
48
41
|
};
|
|
49
42
|
p.defaultProps = {
|
|
50
43
|
badgeLabel: null,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("react"),g=require("
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("react"),g=require("@strapi/icons"),y=require("prop-types"),b=require("styled-components"),u=require("../Box/Box.cjs"),x=require("../Flex/Flex.cjs"),s=require("../Typography/Typography.cjs"),r=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},t=r(f),a=r(y),i=r(b),d=i.default(x.Flex)`
|
|
2
2
|
border: none;
|
|
3
3
|
padding: 0;
|
|
4
4
|
background: transparent;
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
display: flex;
|
|
7
7
|
align-items: center;
|
|
8
8
|
transform: rotateX(${({rotated:e})=>e?"0deg":"180deg"});
|
|
9
|
-
`,o=({collapsable:e,label:l,onClick:c,ariaExpanded:n,ariaControls:p})=>e?t.default.createElement(d,{as:"button",onClick:c,"aria-expanded":n,"aria-controls":p,textAlign:"left"},t.default.createElement(
|
|
9
|
+
`,o=({collapsable:e,label:l,onClick:c,ariaExpanded:n,ariaControls:p})=>e?t.default.createElement(d,{as:"button",onClick:c,"aria-expanded":n,"aria-controls":p,textAlign:"left"},t.default.createElement(u.Box,{paddingRight:1},t.default.createElement(s.Typography,{variant:"sigma",textColor:"neutral600"},l)),e&&t.default.createElement(m,{rotated:n},t.default.createElement(g.CarretDown,{"aria-hidden":!0}))):t.default.createElement(d,null,t.default.createElement(u.Box,{paddingRight:1},t.default.createElement(s.Typography,{variant:"sigma",textColor:"neutral600"},l)));o.defaultProps={ariaControls:null,ariaExpanded:null,collapsable:!1,onClick(){}};o.propTypes={ariaControls:a.default.string,ariaExpanded:a.default.bool,collapsable:a.default.bool,label:a.default.string.isRequired,onClick:a.default.func};exports.SubNavSectionLabel=o;
|