@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,6 +1,6 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const m=require("react"),x=require("
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const m=require("react"),x=require("prop-types"),T=require("styled-components"),y=require("../Field/Field.cjs"),k=require("../Field/FieldLabel.cjs");require("../Field/FieldInput.cjs");const E=require("../Field/FieldHint.cjs"),h=require("../Field/FieldError.cjs");require("../Field/FieldContext.cjs");require("../Field/FieldAction.cjs");const _=require("../Flex/Flex.cjs"),v=require("../helpers/useId.cjs"),C=require("../Stack/Stack.cjs"),I=require("../TextButton/TextButton.cjs"),S=require("../themes/sizes.cjs"),z=require("../ToggleCheckbox/ToggleCheckbox.cjs"),d=t=>t&&typeof t=="object"&&"default"in t?t:{default:t},l=d(m),e=d(x),s=d(T),B=s.default(y.Field)`
|
|
2
2
|
max-width: 320px;
|
|
3
|
-
`,L=s.default(
|
|
3
|
+
`,L=s.default(I.TextButton)`
|
|
4
4
|
align-self: flex-end;
|
|
5
5
|
margin-left: auto;
|
|
6
|
-
`,r=({disabled:t,size:c,error:f,hint:g,label:i,name:p,labelAction:F,required:b,id:q,onClear:o,clearLabel:n,checked:a,...j})=>{const u=
|
|
6
|
+
`,r=({disabled:t,size:c,error:f,hint:g,label:i,name:p,labelAction:F,required:b,id:q,onClear:o,clearLabel:n,checked:a,...j})=>{const u=v.useId(q);return l.default.createElement(B,{name:p,hint:g,error:f,id:u,required:b},l.default.createElement(C.Stack,{spacing:1},l.default.createElement(_.Flex,null,l.default.createElement(k.FieldLabel,{action:F},i),n&&o&&a!==null&&!t&&l.default.createElement(L,{onClick:o},n)),l.default.createElement(z.ToggleCheckbox,{id:u,size:c,checked:a,disabled:t,...j},i),l.default.createElement(E.FieldHint,null),l.default.createElement(h.FieldError,null)))};r.displayName="ToggleInput";r.defaultProps={checked:!1,clearLabel:void 0,disabled:!1,error:void 0,hint:void 0,id:void 0,label:"",labelAction:void 0,name:"",onClear:void 0,required:!1,size:"M"};r.propTypes={checked:e.default.bool,clearLabel:e.default.string,disabled:e.default.bool,error:e.default.string,hint:e.default.oneOfType([e.default.string,e.default.node,e.default.arrayOf(e.default.node)]),id:e.default.string,label:e.default.string,labelAction:e.default.node,name:e.default.string,onClear:e.default.func,required:e.default.bool,size:e.default.oneOf(Object.keys(S.sizes.input))};exports.ToggleInput=r;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import r from "react";
|
|
2
|
-
import d from "styled-components";
|
|
3
2
|
import e from "prop-types";
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { FieldLabel as v } from "../Field/FieldLabel.js";
|
|
3
|
+
import d from "styled-components";
|
|
4
|
+
import { Field as x } from "../Field/Field.js";
|
|
5
|
+
import { FieldLabel as y } from "../Field/FieldLabel.js";
|
|
8
6
|
import "../Field/FieldInput.js";
|
|
9
|
-
import { FieldHint as
|
|
10
|
-
import { FieldError as
|
|
7
|
+
import { FieldHint as T } from "../Field/FieldHint.js";
|
|
8
|
+
import { FieldError as v } from "../Field/FieldError.js";
|
|
11
9
|
import "../Field/FieldContext.js";
|
|
12
10
|
import "../Field/FieldAction.js";
|
|
11
|
+
import { Flex as F } from "../Flex/Flex.js";
|
|
12
|
+
import { useId as h } from "../helpers/useId.js";
|
|
13
13
|
import { Stack as k } from "../Stack/Stack.js";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
14
|
+
import { TextButton as C } from "../TextButton/TextButton.js";
|
|
15
|
+
import { sizes as I } from "../themes/sizes.js";
|
|
16
16
|
import { ToggleCheckbox as O } from "../ToggleCheckbox/ToggleCheckbox.js";
|
|
17
|
-
const z = d(
|
|
17
|
+
const z = d(x)`
|
|
18
18
|
max-width: 320px;
|
|
19
|
-
`, q = d(
|
|
19
|
+
`, q = d(C)`
|
|
20
20
|
align-self: flex-end;
|
|
21
21
|
margin-left: auto;
|
|
22
22
|
`, o = ({
|
|
@@ -34,26 +34,8 @@ const z = d(T)`
|
|
|
34
34
|
checked: m,
|
|
35
35
|
...E
|
|
36
36
|
}) => {
|
|
37
|
-
const a =
|
|
38
|
-
return /* @__PURE__ */ r.createElement(z, {
|
|
39
|
-
name: f,
|
|
40
|
-
hint: c,
|
|
41
|
-
error: s,
|
|
42
|
-
id: a,
|
|
43
|
-
required: g
|
|
44
|
-
}, /* @__PURE__ */ r.createElement(k, {
|
|
45
|
-
spacing: 1
|
|
46
|
-
}, /* @__PURE__ */ r.createElement(C, null, /* @__PURE__ */ r.createElement(v, {
|
|
47
|
-
action: u
|
|
48
|
-
}, i), n && l && m !== null && !t && /* @__PURE__ */ r.createElement(q, {
|
|
49
|
-
onClick: l
|
|
50
|
-
}, n)), /* @__PURE__ */ r.createElement(O, {
|
|
51
|
-
id: a,
|
|
52
|
-
size: p,
|
|
53
|
-
checked: m,
|
|
54
|
-
disabled: t,
|
|
55
|
-
...E
|
|
56
|
-
}, i), /* @__PURE__ */ r.createElement(F, null), /* @__PURE__ */ r.createElement(h, null)));
|
|
37
|
+
const a = h(b);
|
|
38
|
+
return /* @__PURE__ */ r.createElement(z, { name: f, hint: c, error: s, id: a, required: g }, /* @__PURE__ */ r.createElement(k, { spacing: 1 }, /* @__PURE__ */ r.createElement(F, null, /* @__PURE__ */ r.createElement(y, { action: u }, i), n && l && m !== null && !t && /* @__PURE__ */ r.createElement(q, { onClick: l }, n)), /* @__PURE__ */ r.createElement(O, { id: a, size: p, checked: m, disabled: t, ...E }, i), /* @__PURE__ */ r.createElement(T, null), /* @__PURE__ */ r.createElement(v, null)));
|
|
57
39
|
};
|
|
58
40
|
o.displayName = "ToggleInput";
|
|
59
41
|
o.defaultProps = {
|
|
@@ -82,7 +64,7 @@ o.propTypes = {
|
|
|
82
64
|
name: e.string,
|
|
83
65
|
onClear: e.func,
|
|
84
66
|
required: e.bool,
|
|
85
|
-
size: e.oneOf(Object.keys(
|
|
67
|
+
size: e.oneOf(Object.keys(I.input))
|
|
86
68
|
};
|
|
87
69
|
export {
|
|
88
70
|
o as ToggleInput
|
package/dist/Tooltip/Tooltip.cjs
CHANGED
|
@@ -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 o=require("react/jsx-runtime"),b=require("react"),g=require("styled-components"),x=require("./hooks/useTooltipHandlers.cjs"),h=require("./hooks/useTooltipLayout.cjs"),T=require("../Box/Box.cjs"),l=require("../helpers/useId.cjs"),m=require("../Portal/Portal.cjs"),q=require("../Typography/Typography.cjs"),_=require("../VisuallyHidden/VisuallyHidden.cjs"),H=e=>e&&typeof e=="object"&&"default"in e?e:{default:e};function v(e){if(e&&e.__esModule)return e;const s=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(s,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return s.default=e,Object.freeze(s)}const I=v(b),P=H(g),O=P.default(T.Box)`
|
|
2
2
|
/* z-index exist because of its position inside Modals */
|
|
3
3
|
z-index: 4;
|
|
4
4
|
display: ${({visible:e})=>e?"revert":"none"};
|
|
5
|
-
`,
|
|
5
|
+
`,R=({children:e,label:s,description:t,delay:r=500,position:a="top",id:u,...d})=>{const n=l.useId(u),c=l.useId(),{visible:i,...p}=x.useTooltipHandlers(r),{tooltipWrapperRef:y,toggleSourceRef:f}=h.useTooltipLayout(i,a),j=I.cloneElement(e,{tabIndex:0,"aria-labelledby":s?n:void 0,"aria-describedby":t?n:void 0,...p});return o.jsxs(o.Fragment,{children:[o.jsx(m.Portal,{children:o.jsxs(O,{id:n,background:"neutral900",hasRadius:!0,padding:2,role:"tooltip",ref:y,visible:i,position:"absolute",...d,children:[i&&o.jsx(_.VisuallyHidden,{id:c,children:t}),o.jsx(q.Typography,{as:"p",variant:"pi",fontWeight:"bold",textColor:"neutral0",children:s||t})]})}),o.jsx("span",{ref:f,children:j})]})};exports.Tooltip=R;
|
package/dist/Tooltip/Tooltip.js
CHANGED
|
@@ -1,60 +1,69 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { VisuallyHidden as
|
|
11
|
-
const
|
|
1
|
+
import { jsxs as l, Fragment as x, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import * as y from "react";
|
|
3
|
+
import g from "styled-components";
|
|
4
|
+
import { useTooltipHandlers as T } from "./hooks/useTooltipHandlers.js";
|
|
5
|
+
import { useTooltipLayout as v } from "./hooks/useTooltipLayout.js";
|
|
6
|
+
import { Box as I } from "../Box/Box.js";
|
|
7
|
+
import { useId as d } from "../helpers/useId.js";
|
|
8
|
+
import { Portal as R } from "../Portal/Portal.js";
|
|
9
|
+
import { Typography as H } from "../Typography/Typography.js";
|
|
10
|
+
import { VisuallyHidden as W } from "../VisuallyHidden/VisuallyHidden.js";
|
|
11
|
+
const j = g(I)`
|
|
12
12
|
/* z-index exist because of its position inside Modals */
|
|
13
13
|
z-index: 4;
|
|
14
|
-
display: ${({
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
display: ${({
|
|
15
|
+
visible: e
|
|
16
|
+
}) => e ? "revert" : "none"};
|
|
17
|
+
`, S = ({
|
|
18
|
+
children: e,
|
|
19
|
+
label: n,
|
|
20
|
+
description: r,
|
|
21
|
+
delay: s = 500,
|
|
22
|
+
position: p = "top",
|
|
23
|
+
id: a,
|
|
24
|
+
...m
|
|
25
|
+
}) => {
|
|
26
|
+
const t = d(a), c = d(), {
|
|
27
|
+
visible: i,
|
|
28
|
+
...f
|
|
29
|
+
} = T(s), {
|
|
30
|
+
tooltipWrapperRef: u,
|
|
31
|
+
toggleSourceRef: b
|
|
32
|
+
} = v(i, p), h = y.cloneElement(e, {
|
|
17
33
|
tabIndex: 0,
|
|
18
|
-
"aria-labelledby": n ?
|
|
19
|
-
"aria-describedby": r ?
|
|
20
|
-
...
|
|
34
|
+
"aria-labelledby": n ? t : void 0,
|
|
35
|
+
"aria-describedby": r ? t : void 0,
|
|
36
|
+
...f
|
|
37
|
+
});
|
|
38
|
+
return l(x, {
|
|
39
|
+
children: [o(R, {
|
|
40
|
+
children: l(j, {
|
|
41
|
+
id: t,
|
|
42
|
+
background: "neutral900",
|
|
43
|
+
hasRadius: !0,
|
|
44
|
+
padding: 2,
|
|
45
|
+
role: "tooltip",
|
|
46
|
+
ref: u,
|
|
47
|
+
visible: i,
|
|
48
|
+
position: "absolute",
|
|
49
|
+
...m,
|
|
50
|
+
children: [i && o(W, {
|
|
51
|
+
id: c,
|
|
52
|
+
children: r
|
|
53
|
+
}), o(H, {
|
|
54
|
+
as: "p",
|
|
55
|
+
variant: "pi",
|
|
56
|
+
fontWeight: "bold",
|
|
57
|
+
textColor: "neutral0",
|
|
58
|
+
children: n || r
|
|
59
|
+
})]
|
|
60
|
+
})
|
|
61
|
+
}), o("span", {
|
|
62
|
+
ref: b,
|
|
63
|
+
children: h
|
|
64
|
+
})]
|
|
21
65
|
});
|
|
22
|
-
return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(T, null, /* @__PURE__ */ e.createElement(H, {
|
|
23
|
-
id: i,
|
|
24
|
-
background: "neutral900",
|
|
25
|
-
hasRadius: !0,
|
|
26
|
-
padding: 2,
|
|
27
|
-
role: "tooltip",
|
|
28
|
-
ref: b,
|
|
29
|
-
visible: l,
|
|
30
|
-
position: "absolute",
|
|
31
|
-
...c
|
|
32
|
-
}, l && /* @__PURE__ */ e.createElement(I, {
|
|
33
|
-
id: f
|
|
34
|
-
}, r), /* @__PURE__ */ e.createElement(E, {
|
|
35
|
-
as: "p",
|
|
36
|
-
variant: "pi",
|
|
37
|
-
fontWeight: "bold",
|
|
38
|
-
textColor: "neutral0"
|
|
39
|
-
}, n || r))), /* @__PURE__ */ e.createElement("span", {
|
|
40
|
-
ref: y
|
|
41
|
-
}, g));
|
|
42
|
-
};
|
|
43
|
-
a.defaultProps = {
|
|
44
|
-
delay: 500,
|
|
45
|
-
id: void 0,
|
|
46
|
-
position: "top",
|
|
47
|
-
label: void 0,
|
|
48
|
-
description: void 0
|
|
49
|
-
};
|
|
50
|
-
a.propTypes = {
|
|
51
|
-
children: o.node.isRequired,
|
|
52
|
-
delay: o.number,
|
|
53
|
-
description: o.string,
|
|
54
|
-
id: o.string,
|
|
55
|
-
label: o.string,
|
|
56
|
-
position: o.oneOf(["top", "left", "bottom", "right"])
|
|
57
66
|
};
|
|
58
67
|
export {
|
|
59
|
-
|
|
68
|
+
S as Tooltip
|
|
60
69
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react"),n=
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react"),n=s=>{const[u,e]=o.useState(!1),t=o.useRef(null),r=()=>{typeof t.current=="number"&&(clearTimeout(t.current),t.current=null)};return o.useEffect(()=>()=>{r()},[]),{visible:u,onFocus:()=>{e(!0)},onBlur:()=>{e(!1)},onMouseEnter:()=>{t.current=setTimeout(()=>{e(!0)},s)},onMouseLeave:()=>{r(),e(!1)}}};exports.useTooltipHandlers=n;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { useState as
|
|
2
|
-
const
|
|
3
|
-
const [
|
|
4
|
-
o.current && clearTimeout(o.current);
|
|
1
|
+
import { useState as s, useRef as u, useEffect as c } from "react";
|
|
2
|
+
const p = (n) => {
|
|
3
|
+
const [r, e] = s(!1), o = u(null), t = () => {
|
|
4
|
+
typeof o.current == "number" && (clearTimeout(o.current), o.current = null);
|
|
5
5
|
};
|
|
6
6
|
return c(() => () => {
|
|
7
7
|
t();
|
|
8
|
-
}, []), { visible:
|
|
8
|
+
}, []), { visible: r, onFocus: () => {
|
|
9
9
|
e(!0);
|
|
10
10
|
}, onBlur: () => {
|
|
11
11
|
e(!1);
|
|
12
12
|
}, onMouseEnter: () => {
|
|
13
13
|
o.current = setTimeout(() => {
|
|
14
14
|
e(!0);
|
|
15
|
-
},
|
|
15
|
+
}, n);
|
|
16
16
|
}, onMouseLeave: () => {
|
|
17
17
|
t(), e(!1);
|
|
18
18
|
} };
|
|
19
19
|
};
|
|
20
20
|
export {
|
|
21
|
-
|
|
21
|
+
p as useTooltipHandlers
|
|
22
22
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react"),c=require("../utils/positionTooltip.cjs"),n=(e,u)=>{const l=o.useRef(null),s=o.useRef(null);return o.useLayoutEffect(()=>{if(e){const t=l.current,
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react"),c=require("../utils/positionTooltip.cjs"),n=(e,u)=>{const l=o.useRef(null),s=o.useRef(null);return o.useLayoutEffect(()=>{if(e){const t=l.current,i=s.current;if(t&&i){const r=c.positionTooltip(t,i,u);t.style.left=`${r.left}px`,t.style.top=`${r.top}px`}}},[u,e]),{tooltipWrapperRef:l,toggleSourceRef:s}};exports.useTooltipLayout=n;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import { useRef as
|
|
2
|
-
import { positionTooltip as
|
|
1
|
+
import { useRef as u, useLayoutEffect as c } from "react";
|
|
2
|
+
import { positionTooltip as f } from "../utils/positionTooltip.js";
|
|
3
3
|
const g = (o, e) => {
|
|
4
|
-
const r =
|
|
4
|
+
const r = u(null), l = u(null);
|
|
5
5
|
return c(() => {
|
|
6
6
|
if (o) {
|
|
7
|
-
const t = r.current,
|
|
8
|
-
t
|
|
7
|
+
const t = r.current, p = l.current;
|
|
8
|
+
if (t && p) {
|
|
9
|
+
const n = f(t, p, e);
|
|
10
|
+
t.style.left = `${n.left}px`, t.style.top = `${n.top}px`;
|
|
11
|
+
}
|
|
9
12
|
}
|
|
10
13
|
}, [e, o]), { tooltipWrapperRef: r, toggleSourceRef: l };
|
|
11
14
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("styled-components"),o=require("./utils.cjs"),r=require("../helpers/theme.cjs"),i=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},s=i(n),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("styled-components"),o=require("./utils.cjs"),r=require("../helpers/theme.cjs"),i=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},s=i(n),a={fontSize:!0,fontWeight:!0},l=s.default.span.withConfig({shouldForwardProp:(e,t)=>!a[e]&&t(e)})`
|
|
2
2
|
${o.variantStyle}
|
|
3
3
|
${o.ellipsisStyle}
|
|
4
4
|
|
|
@@ -9,5 +9,6 @@
|
|
|
9
9
|
line-height: ${({theme:e,lineHeight:t})=>r.extractStyleFromTheme(e.lineHeights,t,void 0)};
|
|
10
10
|
color: ${o.handleColor};
|
|
11
11
|
text-align: ${({textAlign:e})=>e};
|
|
12
|
+
text-decoration: ${({textDecoration:e})=>e};
|
|
12
13
|
text-transform: ${({textTransform:e})=>e};
|
|
13
|
-
`;exports.Typography=
|
|
14
|
+
`;exports.Typography=l;
|
|
@@ -5,7 +5,7 @@ const s = {
|
|
|
5
5
|
fontSize: !0,
|
|
6
6
|
fontWeight: !0
|
|
7
7
|
}, d = i.span.withConfig({
|
|
8
|
-
shouldForwardProp: (
|
|
8
|
+
shouldForwardProp: (t, e) => !s[t] && e(t)
|
|
9
9
|
})`
|
|
10
10
|
${r}
|
|
11
11
|
${n}
|
|
@@ -13,24 +13,27 @@ const s = {
|
|
|
13
13
|
// These properties need to come after {variantStyle}, because they might
|
|
14
14
|
// overwrite a variant attribute
|
|
15
15
|
font-weight: ${({
|
|
16
|
-
theme:
|
|
17
|
-
fontWeight:
|
|
18
|
-
}) => o(
|
|
16
|
+
theme: t,
|
|
17
|
+
fontWeight: e
|
|
18
|
+
}) => o(t.fontWeights, e, void 0)};
|
|
19
19
|
font-size: ${({
|
|
20
|
-
theme:
|
|
21
|
-
fontSize:
|
|
22
|
-
}) => o(
|
|
20
|
+
theme: t,
|
|
21
|
+
fontSize: e
|
|
22
|
+
}) => o(t.fontSizes, e, void 0)};
|
|
23
23
|
line-height: ${({
|
|
24
|
-
theme:
|
|
25
|
-
lineHeight:
|
|
26
|
-
}) => o(
|
|
24
|
+
theme: t,
|
|
25
|
+
lineHeight: e
|
|
26
|
+
}) => o(t.lineHeights, e, void 0)};
|
|
27
27
|
color: ${a};
|
|
28
28
|
text-align: ${({
|
|
29
|
-
textAlign:
|
|
30
|
-
}) =>
|
|
29
|
+
textAlign: t
|
|
30
|
+
}) => t};
|
|
31
|
+
text-decoration: ${({
|
|
32
|
+
textDecoration: t
|
|
33
|
+
}) => t};
|
|
31
34
|
text-transform: ${({
|
|
32
|
-
textTransform:
|
|
33
|
-
}) =>
|
|
35
|
+
textTransform: t
|
|
36
|
+
}) => t};
|
|
34
37
|
`;
|
|
35
38
|
export {
|
|
36
39
|
d as Typography
|
package/dist/helpers/objects.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("./arrays.cjs");function b(e,i){return typeof e=="string"?!1:i in e}function n(e){return e&&typeof e=="object"&&!Array.isArray(e)}function o(e,...i){if(!i.length)return e;const r=i.shift();if(r
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("./arrays.cjs");function b(e,i){return typeof e=="string"?!1:i in e}function n(e){return e&&typeof e=="object"&&!Array.isArray(e)}function o(e,...i){if(!i.length)return e;const r=i.shift();if(r===void 0)return e;const c=n(e)&&n(r),t=f.isArray(e)&&f.isArray(r);if(c||t)for(const s of Object.keys(r)){const u=n(r[s]),y=f.isArray(r[s]);u||y?(e[s]||Object.assign(e,{[s]:u?{}:[]}),o(e[s],r[s])):c?Object.assign(e,{[s]:r[s]}):e.push(r[s])}return o(e,...i)}exports.isKeyOf=b;exports.isObject=n;exports.mergeDeep=o;
|
package/dist/helpers/objects.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react"),c=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},n=c(t),r=n.default["useId".toString()]||(()=>{});let a=0;const d=e=>{const[u,o]=t.useState(r());return t.useLayoutEffect(()=>{e||o(s=>s??String(a++))},[e]),e?.toString()??(u||"")};exports.useId=d;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import s, { useState as n, useLayoutEffect as r } from "react";
|
|
2
|
+
const c = s["useId".toString()] || (() => {
|
|
3
|
+
});
|
|
4
|
+
let d = 0;
|
|
5
|
+
const S = (t) => {
|
|
6
|
+
const [e, o] = n(c());
|
|
7
|
+
return r(() => {
|
|
8
|
+
t || o((u) => u ?? String(d++));
|
|
9
|
+
}, [t]), t?.toString() ?? (e || "");
|
|
10
|
+
};
|
|
11
|
+
export {
|
|
12
|
+
S as useId
|
|
13
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("./lightTheme/index.cjs"),r=require("../helpers/objects.cjs"),n=t=>`
|
|
2
2
|
${t}
|
|
3
3
|
|
|
4
4
|
The following is an example:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { lightTheme as h } from "./lightTheme/index.js";
|
|
2
|
+
import { isObject as r, mergeDeep as m } from "../helpers/objects.js";
|
|
3
3
|
const n = (t) => `
|
|
4
4
|
${t}
|
|
5
5
|
|
|
@@ -9,7 +9,7 @@ The following is an example:
|
|
|
9
9
|
import { lightTheme, extendTheme } from '@strapi/design-system';
|
|
10
10
|
|
|
11
11
|
const myCustomTheme = extendTheme(lightTheme, {
|
|
12
|
-
${Object.keys(
|
|
12
|
+
${Object.keys(h).map((e) => `${e}: /* put the overrides for the ${e} key */,`).join(`
|
|
13
13
|
`)}
|
|
14
14
|
})
|
|
15
15
|
`, a = (t, e) => {
|
|
@@ -21,7 +21,7 @@ const myCustomTheme = extendTheme(lightTheme, {
|
|
|
21
21
|
const o = n("The second argument should be an object and corresponds to the keys of the theme you want to override.");
|
|
22
22
|
throw new Error(o);
|
|
23
23
|
}
|
|
24
|
-
return
|
|
24
|
+
return m(t ?? {}, e ?? {});
|
|
25
25
|
};
|
|
26
26
|
export {
|
|
27
27
|
a as extendTheme
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("react"),h=require("prop-types"),p=require("styled-components"),m=require("
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("react"),h=require("prop-types"),p=require("styled-components"),m=require("./Divider.cjs"),y=require("../../Box/Box.cjs"),s=require("../../Flex/Flex.cjs"),i=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},r=i(l),t=i(h),b=i(p),g=b.default(s.Flex)`
|
|
2
2
|
// CrumbLinks do have padding-x, because they need to have a
|
|
3
3
|
// interaction effect, which mis-aligns the breadcrumbs on the left.
|
|
4
4
|
// This normalizes the behavior by moving the first item to left by
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
:first-child {
|
|
7
7
|
margin-left: ${({theme:e})=>`calc(-1*${e.spaces[2]})`};
|
|
8
8
|
}
|
|
9
|
-
`,n=({label:e,children:o,...d})=>{const a=l.Children.toArray(o);return r.default.createElement(
|
|
9
|
+
`,n=({label:e,children:o,...d})=>{const a=l.Children.toArray(o);return r.default.createElement(y.Box,{"aria-label":e,...d},r.default.createElement(g,{as:"ol",horizontal:!0},l.Children.map(a,(c,u)=>{const f=a.length>1&&u+1<a.length;return r.default.createElement(s.Flex,{inline:!0,as:"li"},c,f&&r.default.createElement(m.Divider,null))})))};n.displayName="Breadcrumbs";n.propTypes={children:t.default.oneOfType([t.default.arrayOf(t.default.node),t.default.node]).isRequired,label:t.default.string.isRequired};exports.Breadcrumbs=n;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import r, { Children as a } from "react";
|
|
2
2
|
import e from "prop-types";
|
|
3
3
|
import h from "styled-components";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { Divider as p } from "./Divider.js";
|
|
5
|
+
import { Box as f } from "../../Box/Box.js";
|
|
6
6
|
import { Flex as n } from "../../Flex/Flex.js";
|
|
7
7
|
const u = h(n)`
|
|
8
8
|
// CrumbLinks do have padding-x, because they need to have a
|
|
@@ -14,18 +14,9 @@ const u = h(n)`
|
|
|
14
14
|
}
|
|
15
15
|
`, o = ({ label: t, children: l, ...s }) => {
|
|
16
16
|
const i = a.toArray(l);
|
|
17
|
-
return /* @__PURE__ */ r.createElement(
|
|
18
|
-
"aria-label": t,
|
|
19
|
-
...s
|
|
20
|
-
}, /* @__PURE__ */ r.createElement(u, {
|
|
21
|
-
as: "ol",
|
|
22
|
-
horizontal: !0
|
|
23
|
-
}, a.map(i, (m, d) => {
|
|
17
|
+
return /* @__PURE__ */ r.createElement(f, { "aria-label": t, ...s }, /* @__PURE__ */ r.createElement(u, { as: "ol", horizontal: !0 }, a.map(i, (m, d) => {
|
|
24
18
|
const c = i.length > 1 && d + 1 < i.length;
|
|
25
|
-
return /* @__PURE__ */ r.createElement(n, {
|
|
26
|
-
inline: !0,
|
|
27
|
-
as: "li"
|
|
28
|
-
}, m, c && /* @__PURE__ */ r.createElement(f, null));
|
|
19
|
+
return /* @__PURE__ */ r.createElement(n, { inline: !0, as: "li" }, m, c && /* @__PURE__ */ r.createElement(p, null));
|
|
29
20
|
})));
|
|
30
21
|
};
|
|
31
22
|
o.displayName = "Breadcrumbs";
|
|
@@ -2,18 +2,17 @@ import o from "react";
|
|
|
2
2
|
import t from "prop-types";
|
|
3
3
|
import { Box as i } from "../../Box/Box.js";
|
|
4
4
|
import { Typography as d } from "../../Typography/Typography.js";
|
|
5
|
-
const r = ({ children: p, isCurrent: e, ...a }) => /* @__PURE__ */ o.createElement(i, {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}, p));
|
|
5
|
+
const r = ({ children: p, isCurrent: e, ...a }) => /* @__PURE__ */ o.createElement(i, { paddingLeft: 2, paddingRight: 2, paddingTop: 1, paddingBottom: 1 }, /* @__PURE__ */ o.createElement(
|
|
6
|
+
d,
|
|
7
|
+
{
|
|
8
|
+
variant: "pi",
|
|
9
|
+
textColor: "neutral800",
|
|
10
|
+
fontWeight: e ? "bold" : "normal",
|
|
11
|
+
"aria-current": e,
|
|
12
|
+
...a
|
|
13
|
+
},
|
|
14
|
+
p
|
|
15
|
+
));
|
|
17
16
|
r.displayName = "Crumb";
|
|
18
17
|
r.defaultProps = {
|
|
19
18
|
isCurrent: !1
|
|
@@ -15,9 +15,7 @@ const l = s(n)`
|
|
|
15
15
|
background-color: ${({ theme: o }) => o.colors.neutral200};
|
|
16
16
|
color: ${({ theme: o }) => o.colors.neutral700};
|
|
17
17
|
}
|
|
18
|
-
`, r = ({ children: o, ...t }) => /* @__PURE__ */ i.createElement(l, {
|
|
19
|
-
...t
|
|
20
|
-
}, o);
|
|
18
|
+
`, r = ({ children: o, ...t }) => /* @__PURE__ */ i.createElement(l, { ...t }, o);
|
|
21
19
|
r.displayName = "CrumbLink";
|
|
22
20
|
r.defaultProps = {
|
|
23
21
|
to: void 0
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("react"),s=require("@strapi/icons"),a=require("prop-types"),c=require("styled-components"),i=require("../../Button/Button.cjs"),d=require("../SimpleMenu/SimpleMenu.cjs"),u=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},n=u(l),t=u(a),p=u(c),f=p.default(i.Button)`
|
|
2
2
|
padding: ${({theme:e})=>`${e.spaces[1]} ${e.spaces[3]}`};
|
|
3
3
|
|
|
4
4
|
:hover,
|
|
5
5
|
:focus {
|
|
6
6
|
background-color: ${({theme:e})=>e.colors.neutral200};
|
|
7
7
|
}
|
|
8
|
-
`,o=({children:e,...r})=>n.default.createElement(d.SimpleMenu,{noBorder:!0,icon:n.default.createElement(
|
|
8
|
+
`,o=({children:e,...r})=>n.default.createElement(d.SimpleMenu,{noBorder:!0,icon:n.default.createElement(s.CarretDown,null),as:f,size:"S",...r},e);o.displayName="CrumbSimpleMenu";o.propTypes={"aria-label":t.default.string.isRequired,children:t.default.oneOfType([t.default.arrayOf(t.default.node),t.default.node]).isRequired};exports.CrumbSimpleMenu=o;
|
|
@@ -1,23 +1,17 @@
|
|
|
1
|
-
import r from "prop-types";
|
|
2
1
|
import o from "react";
|
|
3
|
-
import i from "
|
|
4
|
-
import
|
|
2
|
+
import { CarretDown as i } from "@strapi/icons";
|
|
3
|
+
import r from "prop-types";
|
|
4
|
+
import p from "styled-components";
|
|
5
5
|
import { Button as m } from "../../Button/Button.js";
|
|
6
6
|
import { SimpleMenu as a } from "../SimpleMenu/SimpleMenu.js";
|
|
7
|
-
const l =
|
|
7
|
+
const l = p(m)`
|
|
8
8
|
padding: ${({ theme: e }) => `${e.spaces[1]} ${e.spaces[3]}`};
|
|
9
9
|
|
|
10
10
|
:hover,
|
|
11
11
|
:focus {
|
|
12
12
|
background-color: ${({ theme: e }) => e.colors.neutral200};
|
|
13
13
|
}
|
|
14
|
-
`, t = ({ children: e, ...n }) => /* @__PURE__ */ o.createElement(a, {
|
|
15
|
-
noBorder: !0,
|
|
16
|
-
icon: /* @__PURE__ */ o.createElement(p, null),
|
|
17
|
-
as: l,
|
|
18
|
-
size: "S",
|
|
19
|
-
...n
|
|
20
|
-
}, e);
|
|
14
|
+
`, t = ({ children: e, ...n }) => /* @__PURE__ */ o.createElement(a, { noBorder: !0, icon: /* @__PURE__ */ o.createElement(i, null), as: l, size: "S", ...n }, e);
|
|
21
15
|
t.displayName = "CrumbSimpleMenu";
|
|
22
16
|
t.propTypes = {
|
|
23
17
|
"aria-label": r.string.isRequired,
|
|
@@ -1,14 +1,7 @@
|
|
|
1
1
|
import e from "react";
|
|
2
2
|
import { Box as r } from "../../Box/Box.js";
|
|
3
3
|
import { Typography as t } from "../../Typography/Typography.js";
|
|
4
|
-
const i = () => /* @__PURE__ */ e.createElement(r, {
|
|
5
|
-
"aria-hidden": !0,
|
|
6
|
-
paddingLeft: 1,
|
|
7
|
-
paddingRight: 1
|
|
8
|
-
}, /* @__PURE__ */ e.createElement(t, {
|
|
9
|
-
variant: "pi",
|
|
10
|
-
textColor: "neutral500"
|
|
11
|
-
}, "/"));
|
|
4
|
+
const i = () => /* @__PURE__ */ e.createElement(r, { "aria-hidden": !0, paddingLeft: 1, paddingRight: 1 }, /* @__PURE__ */ e.createElement(t, { variant: "pi", textColor: "neutral500" }, "/"));
|
|
12
5
|
i.displayName = "Divider";
|
|
13
6
|
export {
|
|
14
7
|
i as Divider
|
package/dist/v2/Link/Link.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("react"),y=require("
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("react"),y=require("@strapi/icons"),m=require("prop-types"),g=require("styled-components"),h=require("../../BaseLink/BaseLink.cjs"),v=require("../../Box/Box.cjs"),L=require("../../themes/utils.cjs"),k=require("../../Typography/Typography.cjs"),l=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},t=l(f),a=l(m),u=l(g),q=u.default(h.BaseLink)`
|
|
2
2
|
display: inline-flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
text-decoration: none;
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
${L.buttonFocusStyle};
|
|
21
21
|
`,s=u.default(v.Box)`
|
|
22
22
|
display: flex;
|
|
23
|
-
`,n=t.default.forwardRef(({children:e,href:r,disabled:i,startIcon:d,endIcon:o,...c},p)=>t.default.createElement(q,{ref:p,href:r,disabled:i,...c},d&&t.default.createElement(s,{as:"span","aria-hidden":!0,paddingRight:2},d),t.default.createElement(
|
|
23
|
+
`,n=t.default.forwardRef(({children:e,href:r,disabled:i,startIcon:d,endIcon:o,...c},p)=>t.default.createElement(q,{ref:p,href:r,disabled:i,...c},d&&t.default.createElement(s,{as:"span","aria-hidden":!0,paddingRight:2},d),t.default.createElement(k.Typography,{textColor:i?"neutral600":"primary600"},e),o&&t.default.createElement(s,{as:"span","aria-hidden":!0,paddingLeft:2},o),r&&!o&&t.default.createElement(s,{as:"span","aria-hidden":!0,paddingLeft:2},t.default.createElement(y.ExternalLink,null))));n.displayName="Link";n.defaultProps={as:void 0,href:void 0,disabled:!1,startIcon:void 0,endIcon:void 0};n.propTypes={as:a.default.elementType,children:a.default.node.isRequired,disabled:a.default.bool,endIcon:a.default.element,href:a.default.string,startIcon:a.default.element};exports.Link=n;
|