@strapi/design-system 1.6.3 → 1.6.5
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 +6 -6
- package/dist/Accordion/AccordionToggle.js +50 -53
- 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 +3 -3
- package/dist/Box/Box.js +27 -27
- 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.cjs +1 -1
- package/dist/CarouselInput/CarouselActions.js +16 -12
- package/dist/CarouselInput/CarouselImage.js +1 -10
- package/dist/CarouselInput/CarouselInput.cjs +1 -1
- package/dist/CarouselInput/CarouselInput.js +23 -28
- package/dist/CarouselInput/CarouselSlide.js +13 -9
- package/dist/Checkbox/Checkbox.cjs +2 -2
- package/dist/Checkbox/Checkbox.js +15 -34
- package/dist/Combobox/Combobox.cjs +1 -1
- package/dist/Combobox/Combobox.js +144 -159
- 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 +30 -62
- package/dist/DatePicker/DatePickerTd.cjs +3 -3
- package/dist/DatePicker/DatePickerTd.js +8 -20
- package/dist/DatePicker/DatePickerTh.cjs +3 -3
- package/dist/DatePicker/DatePickerTh.js +10 -20
- 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 +70 -67
- package/dist/DateTimePicker/DateTimePickerProps.js +1 -3
- package/dist/Dialog/Dialog.cjs +5 -5
- 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 +3 -3
- package/dist/Dialog/DialogFooter.js +3 -8
- 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 +31 -28
- package/dist/Field/FieldAction.cjs +2 -8
- package/dist/Field/FieldAction.js +26 -19
- package/dist/Field/FieldContext.cjs +1 -1
- package/dist/Field/FieldContext.js +2 -2
- package/dist/Field/FieldError.cjs +1 -1
- package/dist/Field/FieldError.js +11 -7
- package/dist/Field/FieldHint.cjs +1 -1
- package/dist/Field/FieldHint.js +15 -10
- package/dist/Field/FieldInput.cjs +14 -16
- package/dist/Field/FieldInput.js +105 -81
- package/dist/Field/FieldLabel.cjs +3 -3
- package/dist/Field/FieldLabel.js +43 -38
- package/dist/FocusTrap/FocusTrap.cjs +1 -1
- package/dist/FocusTrap/FocusTrap.js +33 -41
- 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 +88 -79
- 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 +2 -2
- package/dist/Layout/HeaderLayout.js +37 -66
- 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 +31 -44
- package/dist/MainNav/NavSections.cjs +2 -2
- package/dist/MainNav/NavSections.js +20 -21
- 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 +75 -80
- 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 +1 -1
- 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 +57 -72
- package/dist/RawTable/RawTable.cjs +1 -1
- package/dist/RawTable/RawTable.js +45 -42
- package/dist/RawTable/RawTbody.cjs +1 -1
- package/dist/RawTable/RawTbody.js +14 -13
- package/dist/RawTable/RawThead.cjs +1 -1
- package/dist/RawTable/RawThead.js +13 -10
- package/dist/RawTable/RawTr.cjs +1 -1
- package/dist/RawTable/RawTr.js +19 -15
- package/dist/Searchbar/SearchForm.js +1 -4
- package/dist/Searchbar/Searchbar.cjs +3 -3
- package/dist/Searchbar/Searchbar.js +25 -28
- 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 +98 -119
- 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 +24 -18
- package/dist/Select/SelectTags.cjs +3 -3
- package/dist/Select/SelectTags.js +17 -15
- 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 +3 -3
- package/dist/SubNav/SubNavLinkSection.js +5 -30
- package/dist/SubNav/SubNavSection.cjs +2 -2
- package/dist/SubNav/SubNavSection.js +27 -34
- 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 +17 -16
- 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 +8 -8
- package/dist/Tag/Tag.js +52 -52
- 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 +13 -31
- package/dist/Textarea/Textarea.cjs +2 -2
- package/dist/Textarea/Textarea.js +12 -28
- package/dist/Textarea/TextareaInput.cjs +4 -4
- package/dist/Textarea/TextareaInput.js +22 -21
- 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 +86 -60
- package/dist/ToggleInput/ToggleInput.cjs +3 -3
- package/dist/ToggleInput/ToggleInput.js +28 -47
- 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/deprecations.cjs +1 -1
- package/dist/helpers/deprecations.js +7 -7
- package/dist/helpers/objects.cjs +1 -1
- package/dist/helpers/objects.js +1 -1
- package/dist/helpers/useElementOnScreen.cjs +1 -1
- package/dist/helpers/useElementOnScreen.js +4 -13
- package/dist/helpers/useId.cjs +1 -1
- package/dist/helpers/useId.js +4 -11
- package/dist/helpers/useIntersection.cjs +1 -1
- package/dist/helpers/useIntersection.js +4 -21
- package/dist/helpers/useLockScroll.cjs +1 -1
- package/dist/helpers/useLockScroll.js +4 -7
- package/dist/helpers/usePrevious.cjs +1 -1
- package/dist/helpers/usePrevious.js +4 -8
- package/dist/helpers/useResizeObserver.cjs +1 -1
- package/dist/helpers/useResizeObserver.js +4 -14
- package/dist/hooks/useElementOnScreen.cjs +1 -0
- package/dist/hooks/useElementOnScreen.js +15 -0
- package/dist/hooks/useId.cjs +1 -0
- package/dist/hooks/useId.js +13 -0
- package/dist/hooks/useIntersection.cjs +1 -1
- package/dist/hooks/useIntersection.js +3 -3
- package/dist/hooks/useLockScroll.cjs +1 -0
- package/dist/hooks/useLockScroll.js +9 -0
- package/dist/hooks/usePrevious.cjs +1 -0
- package/dist/hooks/usePrevious.js +10 -0
- package/dist/hooks/useResizeObserver.cjs +1 -0
- package/dist/hooks/useResizeObserver.js +16 -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 +31 -44
- package/dist/v2/MainNav/NavSections.cjs +2 -2
- package/dist/v2/MainNav/NavSections.js +20 -21
- 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 +3 -3
- package/dist/v2/SubNav/SubNavLinkSection.js +5 -30
- package/dist/v2/SubNav/SubNavSection.cjs +2 -2
- package/dist/v2/SubNav/SubNavSection.js +29 -36
- 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 +17 -16
- package/package.json +8 -4
- package/dist/Select/SingleSelect.cjs +0 -82
- package/dist/Select/SingleSelect.js +0 -285
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 "../hooks/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
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r="[@strapi/design-system]:",
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r="[@strapi/design-system]:",s=n=>{const e=n;let t=!1;if(typeof e!="function")throw new TypeError(`${r} once requires a function parameter`);return(...o)=>{t||(e(...o),t=!0)}};exports.PREFIX=r;exports.once=s;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
const o = "[@strapi/design-system]:", c = (
|
|
2
|
-
const e =
|
|
3
|
-
let
|
|
1
|
+
const o = "[@strapi/design-system]:", c = (n) => {
|
|
2
|
+
const e = n;
|
|
3
|
+
let t = !1;
|
|
4
4
|
if (typeof e != "function")
|
|
5
5
|
throw new TypeError(`${o} once requires a function parameter`);
|
|
6
|
-
return (...
|
|
7
|
-
|
|
6
|
+
return (...r) => {
|
|
7
|
+
t || (e(...r), t = !0);
|
|
8
8
|
};
|
|
9
9
|
};
|
|
10
10
|
export {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
o as PREFIX,
|
|
12
|
+
c as once
|
|
13
13
|
};
|
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
|
@@ -1 +1 @@
|
|
|
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 e=require("./deprecations.cjs"),s=require("../hooks/useElementOnScreen.cjs"),r=e.once(console.warn),t=(...n)=>(r(`${e.PREFIX} useElementOnScreen has moved. Please import it from "@strapi/design-system/hooks/useElementOnScreen"`),s.useElementOnScreen(...n));exports.useElementOnScreen=t;
|
|
@@ -1,15 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
c(n.isIntersecting);
|
|
5
|
-
};
|
|
6
|
-
return l(() => {
|
|
7
|
-
const n = e.current, r = new IntersectionObserver(i, t);
|
|
8
|
-
return n && r.observe(e.current), () => {
|
|
9
|
-
n && r.disconnect();
|
|
10
|
-
};
|
|
11
|
-
}, [e, t]), [e, s];
|
|
12
|
-
};
|
|
1
|
+
import { once as n, PREFIX as r } from "./deprecations.js";
|
|
2
|
+
import { useElementOnScreen as s } from "../hooks/useElementOnScreen.js";
|
|
3
|
+
const t = n(console.warn), c = (...e) => (t(`${r} useElementOnScreen has moved. Please import it from "@strapi/design-system/hooks/useElementOnScreen"`), s(...e));
|
|
13
4
|
export {
|
|
14
|
-
|
|
5
|
+
c as useElementOnScreen
|
|
15
6
|
};
|
package/dist/helpers/useId.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
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 e=require("./deprecations.cjs"),o=require("../hooks/useId.cjs"),r=e.once(console.warn),t=(...s)=>(r(`${e.PREFIX} useId has moved. Please import it from "@strapi/design-system/hooks/useId"`),o.useId(...s));exports.useId=t;
|
package/dist/helpers/useId.js
CHANGED
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
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
|
-
};
|
|
1
|
+
import { once as s, PREFIX as o } from "./deprecations.js";
|
|
2
|
+
import { useId as r } from "../hooks/useId.js";
|
|
3
|
+
const t = s(console.warn), n = (...e) => (t(`${o} useId has moved. Please import it from "@strapi/design-system/hooks/useId"`), r(...e));
|
|
11
4
|
export {
|
|
12
|
-
|
|
5
|
+
n as useId
|
|
13
6
|
};
|
|
@@ -1 +1 @@
|
|
|
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 e=require("./deprecations.cjs"),t=require("../hooks/useIntersection.cjs"),n=e.once(console.warn),o=(...s)=>(n(`${e.PREFIX} useIntersection has moved. Please import it from "@strapi/design-system/hooks/useIntersection"`),t.useIntersection(...s));exports.useIntersection=o;
|
|
@@ -1,23 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
const
|
|
4
|
-
const e = p(s);
|
|
5
|
-
m(() => {
|
|
6
|
-
if (r)
|
|
7
|
-
return;
|
|
8
|
-
const u = {
|
|
9
|
-
root: t.current,
|
|
10
|
-
rootMargin: "0px"
|
|
11
|
-
}, f = (g) => {
|
|
12
|
-
g.forEach((i) => {
|
|
13
|
-
i.isIntersecting && t.current.scrollHeight > t.current.clientHeight && e(i);
|
|
14
|
-
});
|
|
15
|
-
}, o = new IntersectionObserver(f, u), c = t.current.querySelector(n);
|
|
16
|
-
return c && o.observe(c), () => {
|
|
17
|
-
o.disconnect();
|
|
18
|
-
};
|
|
19
|
-
}, [r, e, n, t]);
|
|
20
|
-
};
|
|
1
|
+
import { once as s, PREFIX as t } from "./deprecations.js";
|
|
2
|
+
import { useIntersection as o } from "../hooks/useIntersection.js";
|
|
3
|
+
const n = s(console.warn), c = (...e) => (n(`${t} useIntersection has moved. Please import it from "@strapi/design-system/hooks/useIntersection"`), o(...e));
|
|
21
4
|
export {
|
|
22
|
-
|
|
5
|
+
c as useIntersection
|
|
23
6
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const o=require("./deprecations.cjs"),s=require("../hooks/useLockScroll.cjs"),c=o.once(console.warn),r=(...e)=>(c(`${o.PREFIX} useLockScroll has moved. Please import it from "@strapi/design-system/hooks/useLockScroll"`),s(...e));module.exports=r;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
document.body.classList.remove("lock-body-scroll");
|
|
5
|
-
}), [o]);
|
|
6
|
-
};
|
|
1
|
+
import { once as e, PREFIX as r } from "./deprecations.js";
|
|
2
|
+
import s from "../hooks/useLockScroll.js";
|
|
3
|
+
const c = e(console.warn), a = (...o) => (c(`${r} useLockScroll has moved. Please import it from "@strapi/design-system/hooks/useLockScroll"`), s(...o));
|
|
7
4
|
export {
|
|
8
|
-
|
|
5
|
+
a as default
|
|
9
6
|
};
|
|
@@ -1 +1 @@
|
|
|
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 e=require("./deprecations.cjs"),o=require("../hooks/usePrevious.cjs"),r=e.once(console.warn),u=(...s)=>(r(`${e.PREFIX} usePrevious has moved. Please import it from "@strapi/design-system/hooks/usePrevious"`),o.usePrevious(...s));exports.usePrevious=u;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
return u(() => {
|
|
5
|
-
e.current = r;
|
|
6
|
-
}), e.current;
|
|
7
|
-
};
|
|
1
|
+
import { once as s, PREFIX as o } from "./deprecations.js";
|
|
2
|
+
import { usePrevious as r } from "../hooks/usePrevious.js";
|
|
3
|
+
const i = s(console.warn), m = (...e) => (i(`${o} usePrevious has moved. Please import it from "@strapi/design-system/hooks/usePrevious"`), r(...e));
|
|
8
4
|
export {
|
|
9
|
-
|
|
5
|
+
m as usePrevious
|
|
10
6
|
};
|
|
@@ -1 +1 @@
|
|
|
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 e=require("./deprecations.cjs"),r=require("../hooks/useResizeObserver.cjs"),o=e.once(console.warn),i=(...s)=>(o(`${e.PREFIX} useResizeObserver has moved. Please import it from "@strapi/design-system/hooks/useResizeObserver"`),r.useResizeObserver(...s));exports.useResizeObserver=i;
|
|
@@ -1,16 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
const
|
|
4
|
-
const t = s(i);
|
|
5
|
-
f(() => {
|
|
6
|
-
const r = new ResizeObserver(t);
|
|
7
|
-
return Array.isArray(e) ? e.forEach((n) => {
|
|
8
|
-
n.current && r.observe(n.current);
|
|
9
|
-
}) : e.current && r.observe(e.current), () => {
|
|
10
|
-
r.disconnect();
|
|
11
|
-
};
|
|
12
|
-
}, [e, t]);
|
|
13
|
-
};
|
|
1
|
+
import { once as s, PREFIX as r } from "./deprecations.js";
|
|
2
|
+
import { useResizeObserver as o } from "../hooks/useResizeObserver.js";
|
|
3
|
+
const i = s(console.warn), n = (...e) => (i(`${r} useResizeObserver has moved. Please import it from "@strapi/design-system/hooks/useResizeObserver"`), o(...e));
|
|
14
4
|
export {
|
|
15
|
-
|
|
5
|
+
n as useResizeObserver
|
|
16
6
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react"),o=r=>{const e=n.useRef(null),[c,u]=n.useState(!0),i=([t])=>{u(t.isIntersecting)};return n.useEffect(()=>{const t=e.current,s=new IntersectionObserver(i,r);return t&&s.observe(e.current),()=>{t&&s.disconnect()}},[e,r]),[e,c]};exports.useElementOnScreen=o;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { useRef as o, useState as u, useEffect as l } from "react";
|
|
2
|
+
const b = (t) => {
|
|
3
|
+
const e = o(null), [s, c] = u(!0), i = ([n]) => {
|
|
4
|
+
c(n.isIntersecting);
|
|
5
|
+
};
|
|
6
|
+
return l(() => {
|
|
7
|
+
const n = e.current, r = new IntersectionObserver(i, t);
|
|
8
|
+
return n && r.observe(e.current), () => {
|
|
9
|
+
n && r.disconnect();
|
|
10
|
+
};
|
|
11
|
+
}, [e, t]), [e, s];
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
b as useElementOnScreen
|
|
15
|
+
};
|
|
@@ -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 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const g=require("react"),d=require("@radix-ui/react-use-callback-ref"),v=(e,i,{selectorToWatch:t,skipWhen:r=!1})=>{const n=d.useCallbackRef(i);g.useEffect(()=>{if(r
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const g=require("react"),d=require("@radix-ui/react-use-callback-ref"),v=(e,i,{selectorToWatch:t,skipWhen:r=!1})=>{const n=d.useCallbackRef(i);g.useEffect(()=>{if(r)return;const u={root:e.current,rootMargin:"0px"},a=f=>{f.forEach(s=>{s.isIntersecting&&e.current.scrollHeight>e.current.clientHeight&&n(s)})},c=new IntersectionObserver(a,u),o=e.current.querySelector(t);return o&&c.observe(o),()=>{c.disconnect()}},[r,n,t,e])};exports.useIntersection=v;
|
|
@@ -3,20 +3,20 @@ import { useCallbackRef as p } from "@radix-ui/react-use-callback-ref";
|
|
|
3
3
|
const E = (t, s, { selectorToWatch: n, skipWhen: r = !1 }) => {
|
|
4
4
|
const e = p(s);
|
|
5
5
|
m(() => {
|
|
6
|
-
if (r
|
|
6
|
+
if (r)
|
|
7
7
|
return;
|
|
8
8
|
const u = {
|
|
9
9
|
root: t.current,
|
|
10
10
|
rootMargin: "0px"
|
|
11
11
|
}, f = (g) => {
|
|
12
12
|
g.forEach((i) => {
|
|
13
|
-
i.isIntersecting && t.current
|
|
13
|
+
i.isIntersecting && t.current.scrollHeight > t.current.clientHeight && e(i);
|
|
14
14
|
});
|
|
15
15
|
}, o = new IntersectionObserver(f, u), c = t.current.querySelector(n);
|
|
16
16
|
return c && o.observe(c), () => {
|
|
17
17
|
o.disconnect();
|
|
18
18
|
};
|
|
19
|
-
}, [r, e, n]);
|
|
19
|
+
}, [r, e, n, t]);
|
|
20
20
|
};
|
|
21
21
|
export {
|
|
22
22
|
E as useIntersection
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const c=require("react"),e=s=>{c.useEffect(()=>(s&&document.body.classList.add("lock-body-scroll"),()=>{document.body.classList.remove("lock-body-scroll")}),[s])};module.exports=e;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react"),u=t=>{const e=r.useRef();return r.useEffect(()=>{e.current=t}),e.current};exports.usePrevious=u;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("react"),i=require("@radix-ui/react-use-callback-ref"),n=(e,a)=>{const t=i.useCallbackRef(a);c.useLayoutEffect(()=>{const r=new ResizeObserver(t);return Array.isArray(e)?e.forEach(s=>{s.current&&r.observe(s.current)}):e.current&&r.observe(e.current),()=>{r.disconnect()}},[e,t])};exports.useResizeObserver=n;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useLayoutEffect as f } from "react";
|
|
2
|
+
import { useCallbackRef as s } from "@radix-ui/react-use-callback-ref";
|
|
3
|
+
const c = (e, i) => {
|
|
4
|
+
const t = s(i);
|
|
5
|
+
f(() => {
|
|
6
|
+
const r = new ResizeObserver(t);
|
|
7
|
+
return Array.isArray(e) ? e.forEach((n) => {
|
|
8
|
+
n.current && r.observe(n.current);
|
|
9
|
+
}) : e.current && r.observe(e.current), () => {
|
|
10
|
+
r.disconnect();
|
|
11
|
+
};
|
|
12
|
+
}, [e, t]);
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
c as useResizeObserver
|
|
16
|
+
};
|
|
@@ -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;
|