@strapi/design-system 1.6.2 → 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 +2 -2
- package/dist/Box/Box.js +36 -33
- 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 +111 -102
- package/dist/Popover/index.cjs +1 -1
- package/dist/Popover/index.js +9 -3
- 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 +87 -107
- 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 +14 -32
- 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 +27 -26
- 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/index.cjs +1 -1
- package/dist/index.js +136 -134
- 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
package/dist/MainNav/NavLink.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import r from "react";
|
|
2
|
-
import i from "styled-components";
|
|
3
2
|
import o from "prop-types";
|
|
4
3
|
import { NavLink as g } from "react-router-dom";
|
|
5
|
-
import
|
|
4
|
+
import i from "styled-components";
|
|
5
|
+
import { useMainNav as f } from "./MainNavContext.js";
|
|
6
|
+
import { Badge as h } from "../Badge/Badge.js";
|
|
7
|
+
import { Box as v } from "../Box/Box.js";
|
|
6
8
|
import { Flex as $ } from "../Flex/Flex.js";
|
|
9
|
+
import { Tooltip as b } from "../Tooltip/Tooltip.js";
|
|
7
10
|
import { Typography as a } from "../Typography/Typography.js";
|
|
8
|
-
|
|
9
|
-
import { Tooltip as v } from "../Tooltip/Tooltip.js";
|
|
10
|
-
import { Badge as b } from "../Badge/Badge.js";
|
|
11
|
-
const p = i(f)`
|
|
11
|
+
const p = i(v)`
|
|
12
12
|
svg {
|
|
13
13
|
width: 1rem;
|
|
14
14
|
height: 1rem;
|
|
@@ -54,7 +54,7 @@ const p = i(f)`
|
|
|
54
54
|
}
|
|
55
55
|
`, m = i($)`
|
|
56
56
|
padding: ${({ theme: e }) => `${e.spaces[2]} ${e.spaces[3]}`};
|
|
57
|
-
`, u = i(
|
|
57
|
+
`, u = i(h)`
|
|
58
58
|
${({ theme: e, condensed: t }) => t && `
|
|
59
59
|
position: absolute;
|
|
60
60
|
// Values based on visual aspect
|
|
@@ -76,33 +76,7 @@ const p = i(f)`
|
|
|
76
76
|
padding: ${({ theme: e }) => `0 ${e.spaces[2]}`};
|
|
77
77
|
border-radius: ${({ theme: e }) => e.spaces[10]};
|
|
78
78
|
background: ${({ theme: e }) => e.colors.primary600};
|
|
79
|
-
`, s = ({ children: e, icon: t, badgeContent: n, badgeAriaLabel: l, ...c }) =>
|
|
80
|
-
position: "right",
|
|
81
|
-
label: e
|
|
82
|
-
}, /* @__PURE__ */ r.createElement(d, {
|
|
83
|
-
...c
|
|
84
|
-
}, /* @__PURE__ */ r.createElement(m, {
|
|
85
|
-
as: "span"
|
|
86
|
-
}, /* @__PURE__ */ r.createElement(p, {
|
|
87
|
-
"aria-hidden": !0,
|
|
88
|
-
paddingRight: 0,
|
|
89
|
-
as: "span"
|
|
90
|
-
}, t), n && /* @__PURE__ */ r.createElement(u, {
|
|
91
|
-
condensed: !0,
|
|
92
|
-
"aria-label": l
|
|
93
|
-
}, n)))) : /* @__PURE__ */ r.createElement(d, {
|
|
94
|
-
...c
|
|
95
|
-
}, /* @__PURE__ */ r.createElement(m, {
|
|
96
|
-
as: "span",
|
|
97
|
-
justifyContent: "space-between"
|
|
98
|
-
}, /* @__PURE__ */ r.createElement($, null, /* @__PURE__ */ r.createElement(p, {
|
|
99
|
-
"aria-hidden": !0,
|
|
100
|
-
paddingRight: 3,
|
|
101
|
-
as: "span"
|
|
102
|
-
}, t), /* @__PURE__ */ r.createElement(a, null, e)), n && /* @__PURE__ */ r.createElement(u, {
|
|
103
|
-
justifyContent: "center",
|
|
104
|
-
"aria-label": l
|
|
105
|
-
}, n)));
|
|
79
|
+
`, s = ({ children: e, icon: t, badgeContent: n, badgeAriaLabel: l, ...c }) => f() ? /* @__PURE__ */ r.createElement(b, { position: "right", label: e }, /* @__PURE__ */ r.createElement(d, { ...c }, /* @__PURE__ */ r.createElement(m, { as: "span" }, /* @__PURE__ */ r.createElement(p, { "aria-hidden": !0, paddingRight: 0, as: "span" }, t), n && /* @__PURE__ */ r.createElement(u, { condensed: !0, "aria-label": l }, n)))) : /* @__PURE__ */ r.createElement(d, { ...c }, /* @__PURE__ */ r.createElement(m, { as: "span", justifyContent: "space-between" }, /* @__PURE__ */ r.createElement($, null, /* @__PURE__ */ r.createElement(p, { "aria-hidden": !0, paddingRight: 3, as: "span" }, t), /* @__PURE__ */ r.createElement(a, null, e)), n && /* @__PURE__ */ r.createElement(u, { justifyContent: "center", "aria-label": l }, n)));
|
|
106
80
|
s.displayName = "NavLink";
|
|
107
81
|
s.defaultProps = {
|
|
108
82
|
badgeContent: void 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("react"),p=require("prop-types"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("react"),p=require("prop-types"),f=require("./MainNavContext.cjs"),u=require("../Box/Box.cjs"),g=require("../Divider/Divider.cjs"),a=require("../Stack/Stack.cjs"),y=require("../Typography/Typography.cjs"),m=require("../VisuallyHidden/VisuallyHidden.cjs"),s=t=>t&&typeof t=="object"&&"default"in t?t:{default:t},e=s(i),c=s(p),o=({label:t,children:l,...d})=>f.useMainNav()?e.default.createElement(a.Stack,{spacing:2},e.default.createElement(u.Box,{paddingTop:1,paddingBottom:1,background:"neutral0",hasRadius:!0,as:"span"},e.default.createElement(g.Divider,null),e.default.createElement(m.VisuallyHidden,null,e.default.createElement("span",null,t))),e.default.createElement(a.Stack,{as:"ul",spacing:2,...d},i.Children.map(l,(n,r)=>e.default.createElement("li",{key:r},n)))):e.default.createElement(a.Stack,{spacing:2},e.default.createElement(u.Box,{paddingTop:1,paddingBottom:1,background:"neutral0",paddingRight:3,paddingLeft:3,hasRadius:!0,as:"span"},e.default.createElement(y.Typography,{variant:"sigma",textColor:"neutral600"},t)),e.default.createElement(a.Stack,{as:"ul",spacing:2,...d},i.Children.map(l,(n,r)=>e.default.createElement("li",{key:r},n))));o.propTypes={children:c.default.node.isRequired,label:c.default.string.isRequired};exports.NavSection=o;
|
|
@@ -1,45 +1,12 @@
|
|
|
1
1
|
import e, { Children as m } from "react";
|
|
2
2
|
import p from "prop-types";
|
|
3
|
+
import { useMainNav as d } from "./MainNavContext.js";
|
|
3
4
|
import { Box as l } from "../Box/Box.js";
|
|
4
|
-
import {
|
|
5
|
+
import { Divider as s } from "../Divider/Divider.js";
|
|
5
6
|
import { Stack as t } from "../Stack/Stack.js";
|
|
6
|
-
import {
|
|
7
|
-
import { VisuallyHidden as
|
|
8
|
-
|
|
9
|
-
const g = ({ label: n, children: i, ...o }) => s() ? /* @__PURE__ */ e.createElement(t, {
|
|
10
|
-
spacing: 2
|
|
11
|
-
}, /* @__PURE__ */ e.createElement(l, {
|
|
12
|
-
paddingTop: 1,
|
|
13
|
-
paddingBottom: 1,
|
|
14
|
-
background: "neutral0",
|
|
15
|
-
hasRadius: !0,
|
|
16
|
-
as: "span"
|
|
17
|
-
}, /* @__PURE__ */ e.createElement(u, null), /* @__PURE__ */ e.createElement(c, null, /* @__PURE__ */ e.createElement("span", null, n))), /* @__PURE__ */ e.createElement(t, {
|
|
18
|
-
as: "ul",
|
|
19
|
-
spacing: 2,
|
|
20
|
-
...o
|
|
21
|
-
}, m.map(i, (r, a) => /* @__PURE__ */ e.createElement("li", {
|
|
22
|
-
key: a
|
|
23
|
-
}, r)))) : /* @__PURE__ */ e.createElement(t, {
|
|
24
|
-
spacing: 2
|
|
25
|
-
}, /* @__PURE__ */ e.createElement(l, {
|
|
26
|
-
paddingTop: 1,
|
|
27
|
-
paddingBottom: 1,
|
|
28
|
-
background: "neutral0",
|
|
29
|
-
paddingRight: 3,
|
|
30
|
-
paddingLeft: 3,
|
|
31
|
-
hasRadius: !0,
|
|
32
|
-
as: "span"
|
|
33
|
-
}, /* @__PURE__ */ e.createElement(d, {
|
|
34
|
-
variant: "sigma",
|
|
35
|
-
textColor: "neutral600"
|
|
36
|
-
}, n)), /* @__PURE__ */ e.createElement(t, {
|
|
37
|
-
as: "ul",
|
|
38
|
-
spacing: 2,
|
|
39
|
-
...o
|
|
40
|
-
}, m.map(i, (r, a) => /* @__PURE__ */ e.createElement("li", {
|
|
41
|
-
key: a
|
|
42
|
-
}, r))));
|
|
7
|
+
import { Typography as c } from "../Typography/Typography.js";
|
|
8
|
+
import { VisuallyHidden as u } from "../VisuallyHidden/VisuallyHidden.js";
|
|
9
|
+
const g = ({ label: n, children: i, ...o }) => d() ? /* @__PURE__ */ e.createElement(t, { spacing: 2 }, /* @__PURE__ */ e.createElement(l, { paddingTop: 1, paddingBottom: 1, background: "neutral0", hasRadius: !0, as: "span" }, /* @__PURE__ */ e.createElement(s, null), /* @__PURE__ */ e.createElement(u, null, /* @__PURE__ */ e.createElement("span", null, n))), /* @__PURE__ */ e.createElement(t, { as: "ul", spacing: 2, ...o }, m.map(i, (r, a) => /* @__PURE__ */ e.createElement("li", { key: a }, r)))) : /* @__PURE__ */ e.createElement(t, { spacing: 2 }, /* @__PURE__ */ e.createElement(l, { paddingTop: 1, paddingBottom: 1, background: "neutral0", paddingRight: 3, paddingLeft: 3, hasRadius: !0, as: "span" }, /* @__PURE__ */ e.createElement(c, { variant: "sigma", textColor: "neutral600" }, n)), /* @__PURE__ */ e.createElement(t, { as: "ul", spacing: 2, ...o }, m.map(i, (r, a) => /* @__PURE__ */ e.createElement("li", { key: a }, r))));
|
|
43
10
|
g.propTypes = {
|
|
44
11
|
children: p.node.isRequired,
|
|
45
12
|
label: p.string.isRequired
|
|
@@ -1,4 +1,4 @@
|
|
|
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("../
|
|
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("../Box/Box.cjs"),i=require("../Stack/Stack.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(u.Box)`
|
|
2
2
|
flex-grow: 1;
|
|
3
3
|
overflow-y: auto;
|
|
4
|
-
`,r=({children:e,...c})=>t.default.createElement(y,{paddingLeft:3,paddingRight:2,paddingTop:3,paddingBottom:8},t.default.createElement(
|
|
4
|
+
`,r=({children:e,...c})=>t.default.createElement(y,{paddingLeft:3,paddingRight:2,paddingTop:3,paddingBottom:8},t.default.createElement(i.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,23 +1,12 @@
|
|
|
1
1
|
import e, { Children as i } from "react";
|
|
2
2
|
import n from "prop-types";
|
|
3
3
|
import a from "styled-components";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
const l = a(
|
|
4
|
+
import { Box as m } from "../Box/Box.js";
|
|
5
|
+
import { Stack as d } from "../Stack/Stack.js";
|
|
6
|
+
const l = a(m)`
|
|
7
7
|
flex-grow: 1;
|
|
8
8
|
overflow-y: auto;
|
|
9
|
-
`, c = ({ children: o, ...r }) => /* @__PURE__ */ e.createElement(l, {
|
|
10
|
-
paddingLeft: 3,
|
|
11
|
-
paddingRight: 2,
|
|
12
|
-
paddingTop: 3,
|
|
13
|
-
paddingBottom: 8
|
|
14
|
-
}, /* @__PURE__ */ e.createElement(m, {
|
|
15
|
-
as: "ul",
|
|
16
|
-
spacing: 4,
|
|
17
|
-
...r
|
|
18
|
-
}, i.map(o, (t, p) => /* @__PURE__ */ e.createElement("li", {
|
|
19
|
-
key: p
|
|
20
|
-
}, t))));
|
|
9
|
+
`, c = ({ children: o, ...r }) => /* @__PURE__ */ e.createElement(l, { paddingLeft: 3, paddingRight: 2, paddingTop: 3, paddingBottom: 8 }, /* @__PURE__ */ e.createElement(d, { as: "ul", spacing: 4, ...r }, i.map(o, (t, p) => /* @__PURE__ */ e.createElement("li", { key: p }, t))));
|
|
21
10
|
c.propTypes = {
|
|
22
11
|
children: n.node.isRequired
|
|
23
12
|
};
|
package/dist/MainNav/NavUser.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const p=require("react"),f=require("prop-types"),y=require("styled-components"),s=require("../Avatar/Avatar.cjs");require("../Avatar/AvatarGroup.cjs");const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const p=require("react"),f=require("prop-types"),y=require("styled-components"),v=require("./MainNavContext.cjs"),s=require("../Avatar/Avatar.cjs");require("../Avatar/AvatarGroup.cjs");const d=require("../Box/Box.cjs"),g=require("../Flex/Flex.cjs"),x=require("../Typography/Typography.cjs"),m=require("../VisuallyHidden/VisuallyHidden.cjs"),l=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},t=l(p),r=l(f),q=l(y),j=q.default(d.Box)`
|
|
2
2
|
border-top: 1px solid ${({theme:e})=>e.colors.neutral150};
|
|
3
|
-
`,a=t.default.forwardRef(({src:e,children:n,initials:i,...u},c)=>{const o=
|
|
3
|
+
`,a=t.default.forwardRef(({src:e,children:n,initials:i,...u},c)=>{const o=v.useMainNav();return t.default.createElement(j,{paddingTop:3,paddingBottom:3,paddingLeft:5,paddingRight:5,...u},t.default.createElement(g.Flex,{as:"button",justifyContent:o?"center":void 0,ref:c},e?t.default.createElement(s.Avatar,{src:e,alt:"","aria-hidden":!0}):t.default.createElement(s.Initials,null,i),o?t.default.createElement(m.VisuallyHidden,null,t.default.createElement("span",null,n)):t.default.createElement(d.Box,{width:`${130/16}rem`,paddingLeft:2,as:"span"},t.default.createElement(x.Typography,{ellipsis:!0,textColor:"neutral600"},n))))});a.displayName="NavUser";a.defaultProps={src:void 0,initials:void 0};a.propTypes={children:r.default.node.isRequired,initials:r.default.node,src:r.default.string};exports.NavUser=a;
|
package/dist/MainNav/NavUser.js
CHANGED
|
@@ -1,39 +1,18 @@
|
|
|
1
1
|
import e from "react";
|
|
2
2
|
import r from "prop-types";
|
|
3
3
|
import m from "styled-components";
|
|
4
|
-
import {
|
|
4
|
+
import { useMainNav as s } from "./MainNavContext.js";
|
|
5
|
+
import { Avatar as c, Initials as f } from "../Avatar/Avatar.js";
|
|
5
6
|
import "../Avatar/AvatarGroup.js";
|
|
6
|
-
import { Typography as f } from "../Typography/Typography.js";
|
|
7
|
-
import { Flex as u } from "../Flex/Flex.js";
|
|
8
7
|
import { Box as n } from "../Box/Box.js";
|
|
9
|
-
import {
|
|
8
|
+
import { Flex as u } from "../Flex/Flex.js";
|
|
9
|
+
import { Typography as g } from "../Typography/Typography.js";
|
|
10
10
|
import { VisuallyHidden as v } from "../VisuallyHidden/VisuallyHidden.js";
|
|
11
11
|
const y = m(n)`
|
|
12
12
|
border-top: 1px solid ${({ theme: t }) => t.colors.neutral150};
|
|
13
13
|
`, o = e.forwardRef(({ src: t, children: i, initials: l, ...p }, d) => {
|
|
14
|
-
const a =
|
|
15
|
-
return /* @__PURE__ */ e.createElement(y, {
|
|
16
|
-
paddingTop: 3,
|
|
17
|
-
paddingBottom: 3,
|
|
18
|
-
paddingLeft: 5,
|
|
19
|
-
paddingRight: 5,
|
|
20
|
-
...p
|
|
21
|
-
}, /* @__PURE__ */ e.createElement(u, {
|
|
22
|
-
as: "button",
|
|
23
|
-
justifyContent: a ? "center" : void 0,
|
|
24
|
-
ref: d
|
|
25
|
-
}, t ? /* @__PURE__ */ e.createElement(s, {
|
|
26
|
-
src: t,
|
|
27
|
-
alt: "",
|
|
28
|
-
"aria-hidden": !0
|
|
29
|
-
}) : /* @__PURE__ */ e.createElement(c, null, l), a ? /* @__PURE__ */ e.createElement(v, null, /* @__PURE__ */ e.createElement("span", null, i)) : /* @__PURE__ */ e.createElement(n, {
|
|
30
|
-
width: `${130 / 16}rem`,
|
|
31
|
-
paddingLeft: 2,
|
|
32
|
-
as: "span"
|
|
33
|
-
}, /* @__PURE__ */ e.createElement(f, {
|
|
34
|
-
ellipsis: !0,
|
|
35
|
-
textColor: "neutral600"
|
|
36
|
-
}, i))));
|
|
14
|
+
const a = s();
|
|
15
|
+
return /* @__PURE__ */ e.createElement(y, { paddingTop: 3, paddingBottom: 3, paddingLeft: 5, paddingRight: 5, ...p }, /* @__PURE__ */ e.createElement(u, { as: "button", justifyContent: a ? "center" : void 0, ref: d }, t ? /* @__PURE__ */ e.createElement(c, { src: t, alt: "", "aria-hidden": !0 }) : /* @__PURE__ */ e.createElement(f, null, l), a ? /* @__PURE__ */ e.createElement(v, null, /* @__PURE__ */ e.createElement("span", null, i)) : /* @__PURE__ */ e.createElement(n, { width: `${130 / 16}rem`, paddingLeft: 2, as: "span" }, /* @__PURE__ */ e.createElement(g, { ellipsis: !0, textColor: "neutral600" }, i))));
|
|
37
16
|
});
|
|
38
17
|
o.displayName = "NavUser";
|
|
39
18
|
o.defaultProps = {
|
|
@@ -4,10 +4,7 @@ import { Box as e } from "../Box/Box.js";
|
|
|
4
4
|
const a = r(e)`
|
|
5
5
|
overflow: auto;
|
|
6
6
|
max-height: 60vh;
|
|
7
|
-
`, l = (o) => /* @__PURE__ */ t.createElement(a, {
|
|
8
|
-
padding: 7,
|
|
9
|
-
...o
|
|
10
|
-
});
|
|
7
|
+
`, l = (o) => /* @__PURE__ */ t.createElement(a, { padding: 7, ...o });
|
|
11
8
|
export {
|
|
12
9
|
l as ModalBody
|
|
13
10
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("react"),c=require("
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("react"),c=require("prop-types"),i=require("styled-components"),p=require("../Box/Box.cjs"),n=require("../Flex/Flex.cjs"),o=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},t=o(u),a=o(c),l=o(i),f=l.default(p.Box)`
|
|
2
2
|
border-radius: 0 0 ${({theme:e})=>e.borderRadius} ${({theme:e})=>e.borderRadius};
|
|
3
3
|
border-top: 1px solid ${({theme:e})=>e.colors.neutral150};
|
|
4
4
|
`,d=l.default(n.Flex)`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import o from "react";
|
|
2
|
-
import n from "styled-components";
|
|
3
2
|
import t from "prop-types";
|
|
3
|
+
import n from "styled-components";
|
|
4
4
|
import { Box as i } from "../Box/Box.js";
|
|
5
5
|
import { Flex as d } from "../Flex/Flex.js";
|
|
6
6
|
const s = n(i)`
|
|
@@ -10,15 +10,7 @@ const s = n(i)`
|
|
|
10
10
|
& > * + * {
|
|
11
11
|
margin-left: ${({ theme: e }) => e.spaces[2]};
|
|
12
12
|
}
|
|
13
|
-
`, a = ({ startActions: e, endActions: p }) => /* @__PURE__ */ o.createElement(s, {
|
|
14
|
-
paddingTop: 4,
|
|
15
|
-
paddingBottom: 4,
|
|
16
|
-
paddingLeft: 5,
|
|
17
|
-
paddingRight: 5,
|
|
18
|
-
background: "neutral100"
|
|
19
|
-
}, /* @__PURE__ */ o.createElement(d, {
|
|
20
|
-
justifyContent: "space-between"
|
|
21
|
-
}, /* @__PURE__ */ o.createElement(r, null, e), /* @__PURE__ */ o.createElement(r, null, p)));
|
|
13
|
+
`, a = ({ startActions: e, endActions: p }) => /* @__PURE__ */ o.createElement(s, { paddingTop: 4, paddingBottom: 4, paddingLeft: 5, paddingRight: 5, background: "neutral100" }, /* @__PURE__ */ o.createElement(d, { justifyContent: "space-between" }, /* @__PURE__ */ o.createElement(r, null, e), /* @__PURE__ */ o.createElement(r, null, p)));
|
|
22
14
|
a.defaultProps = {
|
|
23
15
|
endActions: void 0,
|
|
24
16
|
startActions: void 0
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react"),d=require("
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react"),d=require("@strapi/icons"),c=require("prop-types"),u=require("styled-components"),i=require("./ModalContext.cjs"),p=require("../Box/Box.cjs"),f=require("../Flex/Flex.cjs"),b=require("../IconButton/IconButton.cjs"),o=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},t=o(s),n=o(c),x=o(u),y=x.default(p.Box)`
|
|
2
2
|
border-radius: ${({theme:e})=>e.borderRadius} ${({theme:e})=>e.borderRadius} 0 0;
|
|
3
3
|
border-bottom: 1px solid ${({theme:e})=>e.colors.neutral150};
|
|
4
|
-
`,r=({children:e,closeLabel:a})=>{const l=
|
|
4
|
+
`,r=({children:e,closeLabel:a})=>{const l=i.useModal();return t.default.createElement(y,{paddingTop:4,paddingBottom:4,paddingLeft:5,paddingRight:5,background:"neutral100"},t.default.createElement(f.Flex,{justifyContent:"space-between"},e,t.default.createElement(b.IconButton,{onClick:l,"aria-label":a,icon:t.default.createElement(d.Cross,null)})))};r.defaultProps={closeLabel:"Close the modal"};r.propTypes={children:n.default.node.isRequired,closeLabel:n.default.string};exports.ModalHeader=r;
|
|
@@ -1,29 +1,17 @@
|
|
|
1
1
|
import o from "react";
|
|
2
|
-
import l from "
|
|
2
|
+
import { Cross as l } from "@strapi/icons";
|
|
3
3
|
import r from "prop-types";
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
4
|
+
import n from "styled-components";
|
|
5
|
+
import { useModal as i } from "./ModalContext.js";
|
|
6
6
|
import { Box as p } from "../Box/Box.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
const c =
|
|
7
|
+
import { Flex as m } from "../Flex/Flex.js";
|
|
8
|
+
import { IconButton as s } from "../IconButton/IconButton.js";
|
|
9
|
+
const c = n(p)`
|
|
10
10
|
border-radius: ${({ theme: e }) => e.borderRadius} ${({ theme: e }) => e.borderRadius} 0 0;
|
|
11
11
|
border-bottom: 1px solid ${({ theme: e }) => e.colors.neutral150};
|
|
12
12
|
`, t = ({ children: e, closeLabel: a }) => {
|
|
13
|
-
const d =
|
|
14
|
-
return /* @__PURE__ */ o.createElement(c, {
|
|
15
|
-
paddingTop: 4,
|
|
16
|
-
paddingBottom: 4,
|
|
17
|
-
paddingLeft: 5,
|
|
18
|
-
paddingRight: 5,
|
|
19
|
-
background: "neutral100"
|
|
20
|
-
}, /* @__PURE__ */ o.createElement(i, {
|
|
21
|
-
justifyContent: "space-between"
|
|
22
|
-
}, e, /* @__PURE__ */ o.createElement(m, {
|
|
23
|
-
onClick: d,
|
|
24
|
-
"aria-label": a,
|
|
25
|
-
icon: /* @__PURE__ */ o.createElement(n, null)
|
|
26
|
-
})));
|
|
13
|
+
const d = i();
|
|
14
|
+
return /* @__PURE__ */ o.createElement(c, { paddingTop: 4, paddingBottom: 4, paddingLeft: 5, paddingRight: 5, background: "neutral100" }, /* @__PURE__ */ o.createElement(m, { justifyContent: "space-between" }, e, /* @__PURE__ */ o.createElement(s, { onClick: d, "aria-label": a, icon: /* @__PURE__ */ o.createElement(l, null) })));
|
|
27
15
|
};
|
|
28
16
|
t.defaultProps = {
|
|
29
17
|
closeLabel: "Close the modal"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("react"),i=require("
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("react"),i=require("prop-types"),d=require("styled-components"),p=require("./ModalContext.cjs"),f=require("../Box/Box.cjs"),y=require("../DismissibleLayer/DismissibleLayer.cjs"),m=require("../Flex/Flex.cjs"),x=require("../FocusTrap/FocusTrap.cjs"),b=require("../helpers/useLockScroll.cjs"),q=require("../Portal/Portal.cjs"),o=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},t=o(c),r=o(i),a=o(d),g=a.default(m.Flex)`
|
|
2
2
|
inset: 0;
|
|
3
3
|
background: ${({theme:e})=>`${e.colors.neutral800}1F`};
|
|
4
|
-
`,j=a.default(
|
|
4
|
+
`,j=a.default(f.Box)`
|
|
5
5
|
width: ${830/16}rem;
|
|
6
|
-
`,l=({onClose:e,labelledBy:s,...u})=>(
|
|
6
|
+
`,l=({onClose:e,labelledBy:s,...u})=>(b(!0),t.default.createElement(q.Portal,null,t.default.createElement(p.ModalContext.Provider,{value:e},t.default.createElement(g,{justifyContent:"center",paddingLeft:8,paddingRight:8,position:"fixed",zIndex:4},t.default.createElement(x.FocusTrap,null,t.default.createElement(y.DismissibleLayer,{onEscapeKeyDown:e,onPointerDownOutside:e},t.default.createElement(j,{"aria-labelledby":s,onClick:n=>n.stopPropagation(),background:"neutral0",hasRadius:!0,shadow:"popupShadow",role:"dialog","aria-modal":!0,...u})))))));l.propTypes={labelledBy:r.default.string.isRequired,onClose:r.default.func.isRequired};exports.ModalLayout=l;
|
|
@@ -1,39 +1,31 @@
|
|
|
1
1
|
import e from "react";
|
|
2
|
-
import t from "styled-components";
|
|
3
2
|
import r from "prop-types";
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
|
|
3
|
+
import t from "styled-components";
|
|
4
|
+
import { ModalContext as l } from "./ModalContext.js";
|
|
5
|
+
import { Box as m } from "../Box/Box.js";
|
|
6
|
+
import { DismissibleLayer as p } from "../DismissibleLayer/DismissibleLayer.js";
|
|
7
|
+
import { Flex as d } from "../Flex/Flex.js";
|
|
8
|
+
import { FocusTrap as s } from "../FocusTrap/FocusTrap.js";
|
|
9
|
+
import u from "../helpers/useLockScroll.js";
|
|
10
|
+
import { Portal as c } from "../Portal/Portal.js";
|
|
11
|
+
const f = t(d)`
|
|
12
12
|
inset: 0;
|
|
13
13
|
background: ${({ theme: o }) => `${o.colors.neutral800}1F`};
|
|
14
|
-
`, y = t(
|
|
14
|
+
`, y = t(m)`
|
|
15
15
|
width: ${830 / 16}rem;
|
|
16
|
-
`, g = ({ onClose: o, labelledBy: a, ...i }) => (
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
onClick: (n) => n.stopPropagation(),
|
|
30
|
-
background: "neutral0",
|
|
31
|
-
hasRadius: !0,
|
|
32
|
-
shadow: "popupShadow",
|
|
33
|
-
role: "dialog",
|
|
34
|
-
"aria-modal": !0,
|
|
35
|
-
...i
|
|
36
|
-
})))))));
|
|
16
|
+
`, g = ({ onClose: o, labelledBy: a, ...i }) => (u(!0), /* @__PURE__ */ e.createElement(c, null, /* @__PURE__ */ e.createElement(l.Provider, { value: o }, /* @__PURE__ */ e.createElement(f, { justifyContent: "center", paddingLeft: 8, paddingRight: 8, position: "fixed", zIndex: 4 }, /* @__PURE__ */ e.createElement(s, null, /* @__PURE__ */ e.createElement(p, { onEscapeKeyDown: o, onPointerDownOutside: o }, /* @__PURE__ */ e.createElement(
|
|
17
|
+
y,
|
|
18
|
+
{
|
|
19
|
+
"aria-labelledby": a,
|
|
20
|
+
onClick: (n) => n.stopPropagation(),
|
|
21
|
+
background: "neutral0",
|
|
22
|
+
hasRadius: !0,
|
|
23
|
+
shadow: "popupShadow",
|
|
24
|
+
role: "dialog",
|
|
25
|
+
"aria-modal": !0,
|
|
26
|
+
...i
|
|
27
|
+
}
|
|
28
|
+
)))))));
|
|
37
29
|
g.propTypes = {
|
|
38
30
|
labelledBy: r.string.isRequired,
|
|
39
31
|
onClose: r.func.isRequired
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("react"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("react"),F=require("@internationalized/number"),q=require("@strapi/icons"),O=require("prop-types"),T=require("styled-components"),$=require("../Field/Field.cjs"),B=require("../Field/FieldLabel.cjs"),H=require("../Field/FieldInput.cjs"),M=require("../Field/FieldHint.cjs"),U=require("../Field/FieldError.cjs");require("../Field/FieldContext.cjs");require("../Field/FieldAction.cjs");const W=require("../helpers/getDefaultLocale.cjs"),h=require("../helpers/keyboardKeys.cjs"),X=require("../helpers/useId.cjs"),Y=require("../hooks/useControllableState.cjs"),v=require("../Icon/Icon.cjs"),G=require("../Stack/Stack.cjs"),J=require("../themes/sizes.cjs"),m=r=>r&&typeof r=="object"&&"default"in r?r:{default:r},a=m(f),t=m(O),Q=m(T),I=Q.default.button`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 1rem;
|
|
4
4
|
align-items: ${({reverse:r})=>r?"flex-end":"flex-start"};
|
|
@@ -9,4 +9,4 @@
|
|
|
9
9
|
height: ${4/16}rem;
|
|
10
10
|
transform: ${({reverse:r})=>r?"rotateX(180deg)":void 0};
|
|
11
11
|
}
|
|
12
|
-
`,Z="",d=a.default.forwardRef(({size:r,startAction:N,name:j,hint:w,error:E,label:p,labelAction:k,locale:D,id:A,onValueChange:C,value:S,step:o,required:V,disabled:u,...x},_)=>{const L=
|
|
12
|
+
`,Z="",d=a.default.forwardRef(({size:r,startAction:N,name:j,hint:w,error:E,label:p,labelAction:k,locale:D,id:A,onValueChange:C,value:S,step:o,required:V,disabled:u,...x},_)=>{const L=X.useId(A),b=D||W.getDefaultLocale(),i=f.useRef(new F.NumberParser(b,{style:"decimal"})),c=f.useRef(new F.NumberFormatter(b,{maximumFractionDigits:20})),[l,P]=Y.useControllableState({prop(e){const n=String(S);return isNaN(n)||n!==e&&e!==""?e:n},defaultProp:Z,onChange(e){const n=i.current.parse(e);C(isNaN(n)?void 0:n)}}),s=e=>{P(String(e))},R=({target:{value:e}})=>{i.current.isValidPartialNumber(e)&&s(e)},y=()=>{if(!l){s(o);return}const e=i.current.parse(l),n=isNaN(e)?o:e+o;s(c.current.format(n))},g=()=>{if(!l){s(-o);return}const e=i.current.parse(l),n=isNaN(e)?-o:e-o;s(c.current.format(n))},K=e=>{if(!u)switch(e.key){case h.KeyboardKeys.DOWN:{e.preventDefault(),g();break}case h.KeyboardKeys.UP:{e.preventDefault(),y();break}}},z=()=>{if(l){const e=i.current.parse(l),n=isNaN(e)?"":c.current.format(e);s(n)}};return a.default.createElement($.Field,{name:j,hint:w,error:E,id:L,required:V},a.default.createElement(G.Stack,{spacing:1},p&&a.default.createElement(B.FieldLabel,{action:k},p),a.default.createElement(H.FieldInput,{ref:_,startAction:N,disabled:u,type:"text",inputmode:"decimal",onChange:R,onKeyDown:K,onBlur:z,value:l,size:r,endAction:a.default.createElement(a.default.Fragment,null,a.default.createElement(I,{disabled:u,"aria-hidden":!0,reverse:!0,onClick:y,tabIndex:-1,type:"button","data-testid":"ArrowUp"},a.default.createElement(v.Icon,{as:q.CarretDown,color:"neutral500"})),a.default.createElement(I,{disabled:u,"aria-hidden":!0,onClick:g,tabIndex:-1,type:"button","data-testid":"ArrowDown"},a.default.createElement(v.Icon,{as:q.CarretDown,color:"neutral500"}))),...x}),a.default.createElement(M.FieldHint,null),a.default.createElement(U.FieldError,null)))});d.displayName="NumberInput";d.defaultProps={"aria-label":void 0,disabled:!1,error:void 0,hint:void 0,id:void 0,label:void 0,labelAction:void 0,locale:void 0,required:!1,size:"M",startAction:void 0,step:1,value:void 0};d.propTypes={"aria-label":t.default.string,disabled:t.default.bool,error:t.default.string,hint:t.default.oneOfType([t.default.string,t.default.node,t.default.arrayOf(t.default.node)]),id:t.default.string,label:t.default.string,labelAction:t.default.element,locale:t.default.string,name:t.default.string.isRequired,onValueChange:t.default.func.isRequired,required:t.default.bool,size:t.default.oneOf(Object.keys(J.sizes.input)),startAction:t.default.element,step:t.default.number,value:t.default.number};exports.NumberInput=d;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import t, { useRef as g } from "react";
|
|
2
|
-
import
|
|
3
|
-
import L from "styled-components";
|
|
2
|
+
import { NumberParser as L, NumberFormatter as T } from "@internationalized/number";
|
|
4
3
|
import { CarretDown as v } from "@strapi/icons";
|
|
5
|
-
import
|
|
4
|
+
import r from "prop-types";
|
|
5
|
+
import z from "styled-components";
|
|
6
6
|
import { Field as B } from "../Field/Field.js";
|
|
7
7
|
import { FieldLabel as U } from "../Field/FieldLabel.js";
|
|
8
8
|
import { FieldInput as _ } from "../Field/FieldInput.js";
|
|
@@ -10,14 +10,14 @@ import { FieldHint as j } from "../Field/FieldHint.js";
|
|
|
10
10
|
import { FieldError as H } from "../Field/FieldError.js";
|
|
11
11
|
import "../Field/FieldContext.js";
|
|
12
12
|
import "../Field/FieldAction.js";
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
const h =
|
|
13
|
+
import { getDefaultLocale as M } from "../helpers/getDefaultLocale.js";
|
|
14
|
+
import { KeyboardKeys as N } from "../helpers/keyboardKeys.js";
|
|
15
|
+
import { useId as W } from "../helpers/useId.js";
|
|
16
|
+
import { useControllableState as X } from "../hooks/useControllableState.js";
|
|
17
|
+
import { Icon as y } from "../Icon/Icon.js";
|
|
18
|
+
import { Stack as Y } from "../Stack/Stack.js";
|
|
19
|
+
import { sizes as G } from "../themes/sizes.js";
|
|
20
|
+
const h = z.button`
|
|
21
21
|
display: flex;
|
|
22
22
|
height: 1rem;
|
|
23
23
|
align-items: ${({ reverse: n }) => n ? "flex-end" : "flex-start"};
|
|
@@ -46,7 +46,7 @@ const h = L.button`
|
|
|
46
46
|
disabled: m,
|
|
47
47
|
...P
|
|
48
48
|
}, R) => {
|
|
49
|
-
const O =
|
|
49
|
+
const O = W(D), p = x || M(), s = g(new L(p, { style: "decimal" })), c = g(new T(p, { maximumFractionDigits: 20 })), [a, S] = X({
|
|
50
50
|
prop(e) {
|
|
51
51
|
const o = String(k);
|
|
52
52
|
return isNaN(o) || o !== e && e !== "" ? e : o;
|
|
@@ -77,11 +77,11 @@ const h = L.button`
|
|
|
77
77
|
}, q = (e) => {
|
|
78
78
|
if (!m)
|
|
79
79
|
switch (e.key) {
|
|
80
|
-
case
|
|
80
|
+
case N.DOWN: {
|
|
81
81
|
e.preventDefault(), b();
|
|
82
82
|
break;
|
|
83
83
|
}
|
|
84
|
-
case
|
|
84
|
+
case N.UP: {
|
|
85
85
|
e.preventDefault(), f();
|
|
86
86
|
break;
|
|
87
87
|
}
|
|
@@ -92,51 +92,46 @@ const h = L.button`
|
|
|
92
92
|
l(o);
|
|
93
93
|
}
|
|
94
94
|
};
|
|
95
|
-
return /* @__PURE__ */ t.createElement(B, {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
required: C
|
|
101
|
-
}, /* @__PURE__ */ t.createElement(M, {
|
|
102
|
-
spacing: 1
|
|
103
|
-
}, d && /* @__PURE__ */ t.createElement(U, {
|
|
104
|
-
action: V
|
|
105
|
-
}, d), /* @__PURE__ */ t.createElement(_, {
|
|
106
|
-
ref: R,
|
|
107
|
-
startAction: w,
|
|
108
|
-
disabled: m,
|
|
109
|
-
type: "text",
|
|
110
|
-
inputmode: "decimal",
|
|
111
|
-
onChange: $,
|
|
112
|
-
onKeyDown: q,
|
|
113
|
-
onBlur: K,
|
|
114
|
-
value: a,
|
|
115
|
-
size: n,
|
|
116
|
-
endAction: /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(h, {
|
|
95
|
+
return /* @__PURE__ */ t.createElement(B, { name: E, hint: I, error: A, id: O, required: C }, /* @__PURE__ */ t.createElement(Y, { spacing: 1 }, d && /* @__PURE__ */ t.createElement(U, { action: V }, d), /* @__PURE__ */ t.createElement(
|
|
96
|
+
_,
|
|
97
|
+
{
|
|
98
|
+
ref: R,
|
|
99
|
+
startAction: w,
|
|
117
100
|
disabled: m,
|
|
118
|
-
"
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
101
|
+
type: "text",
|
|
102
|
+
inputmode: "decimal",
|
|
103
|
+
onChange: $,
|
|
104
|
+
onKeyDown: q,
|
|
105
|
+
onBlur: K,
|
|
106
|
+
value: a,
|
|
107
|
+
size: n,
|
|
108
|
+
endAction: /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(
|
|
109
|
+
h,
|
|
110
|
+
{
|
|
111
|
+
disabled: m,
|
|
112
|
+
"aria-hidden": !0,
|
|
113
|
+
reverse: !0,
|
|
114
|
+
onClick: f,
|
|
115
|
+
tabIndex: -1,
|
|
116
|
+
type: "button",
|
|
117
|
+
"data-testid": "ArrowUp"
|
|
118
|
+
},
|
|
119
|
+
/* @__PURE__ */ t.createElement(y, { as: v, color: "neutral500" })
|
|
120
|
+
), /* @__PURE__ */ t.createElement(
|
|
121
|
+
h,
|
|
122
|
+
{
|
|
123
|
+
disabled: m,
|
|
124
|
+
"aria-hidden": !0,
|
|
125
|
+
onClick: b,
|
|
126
|
+
tabIndex: -1,
|
|
127
|
+
type: "button",
|
|
128
|
+
"data-testid": "ArrowDown"
|
|
129
|
+
},
|
|
130
|
+
/* @__PURE__ */ t.createElement(y, { as: v, color: "neutral500" })
|
|
131
|
+
)),
|
|
132
|
+
...P
|
|
133
|
+
}
|
|
134
|
+
), /* @__PURE__ */ t.createElement(j, null), /* @__PURE__ */ t.createElement(H, null)));
|
|
140
135
|
}
|
|
141
136
|
);
|
|
142
137
|
u.displayName = "NumberInput";
|
|
@@ -167,7 +162,7 @@ u.propTypes = {
|
|
|
167
162
|
name: r.string.isRequired,
|
|
168
163
|
onValueChange: r.func.isRequired,
|
|
169
164
|
required: r.bool,
|
|
170
|
-
size: r.oneOf(Object.keys(
|
|
165
|
+
size: r.oneOf(Object.keys(G.input)),
|
|
171
166
|
startAction: r.element,
|
|
172
167
|
step: r.number,
|
|
173
168
|
value: r.number
|
|
@@ -1,5 +1,5 @@
|
|
|
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 p=require("react"),f=require("prop-types"),g=require("styled-components"),m=require("./PaginationContext.cjs"),b=require("../Flex/Flex.cjs"),l=e=>e&&typeof e=="object"&&"default"in e?e:{default:e};function y(e){if(e&&e.__esModule)return e;const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const n=y(p),o=l(f),s=l(g),P=s.default.nav``,_=s.default(b.Flex)`
|
|
2
2
|
& > * + * {
|
|
3
3
|
margin-left: ${({theme:e})=>e.spaces[1]};
|
|
4
4
|
}
|
|
5
|
-
`,
|
|
5
|
+
`,i=({children:e,label:a,activePage:t,pageCount:r})=>{const u=n.useMemo(()=>({activePage:t,pageCount:r}),[t,r]);return n.createElement(m.PaginationContext.Provider,{value:u},n.createElement(P,{"aria-label":a},n.createElement(_,{as:"ul"},n.Children.map(e,(c,d)=>n.createElement("li",{key:d},c)))))};i.defaultProps={label:"pagination"};i.propTypes={activePage:o.default.number.isRequired,children:o.default.node.isRequired,label:o.default.string,pageCount:o.default.number.isRequired};exports.Pagination=i;
|