@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/Portal/Portal.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 o=require("react"),c=require("react-dom");function a(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const u=a(o),l=({children:e})=>{const t=u.useRef(null),[r,n]=u.useState(!1);return u.useLayoutEffect(()=>(t.current=document.createElement("div"),t.current.setAttribute("data-react-portal","true"),document.body.appendChild(t.current),n(!0),()=>{t.current?.remove()}),[]),!r||!t.current?null:c.createPortal(e,t.current)};exports.Portal=l;
|
package/dist/Portal/Portal.js
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { createPortal as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
};
|
|
10
|
-
p.propTypes = {
|
|
11
|
-
children: d.node.isRequired
|
|
1
|
+
import * as e from "react";
|
|
2
|
+
import { createPortal as o } from "react-dom";
|
|
3
|
+
const a = ({
|
|
4
|
+
children: r
|
|
5
|
+
}) => {
|
|
6
|
+
const t = e.useRef(null), [u, n] = e.useState(!1);
|
|
7
|
+
return e.useLayoutEffect(() => (t.current = document.createElement("div"), t.current.setAttribute("data-react-portal", "true"), document.body.appendChild(t.current), n(!0), () => {
|
|
8
|
+
t.current?.remove();
|
|
9
|
+
}), []), !u || !t.current ? null : o(r, t.current);
|
|
12
10
|
};
|
|
13
11
|
export {
|
|
14
|
-
|
|
12
|
+
a as Portal
|
|
15
13
|
};
|
|
@@ -12,20 +12,23 @@ const p = m(l)`
|
|
|
12
12
|
top: 0;
|
|
13
13
|
width: ${({ value: r }) => `${r}%`};
|
|
14
14
|
}
|
|
15
|
-
`, t = ({ min: r, max: i, value: o, children: s, size: a, ...n }) => /* @__PURE__ */ u.createElement(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
15
|
+
`, t = ({ min: r, max: i, value: o, children: s, size: a, ...n }) => /* @__PURE__ */ u.createElement(
|
|
16
|
+
p,
|
|
17
|
+
{
|
|
18
|
+
background: "neutral600",
|
|
19
|
+
hasRadius: !0,
|
|
20
|
+
"aria-label": s,
|
|
21
|
+
"aria-valuemax": i,
|
|
22
|
+
"aria-valuemin": r,
|
|
23
|
+
"aria-valuenow": o,
|
|
24
|
+
height: a === "S" ? 1 : 2,
|
|
25
|
+
position: "relative",
|
|
26
|
+
role: "progressbar",
|
|
27
|
+
value: o,
|
|
28
|
+
width: a === "S" ? "78px" : "102px",
|
|
29
|
+
...n
|
|
30
|
+
}
|
|
31
|
+
);
|
|
29
32
|
t.defaultProps = {
|
|
30
33
|
min: 0,
|
|
31
34
|
max: 100,
|
package/dist/Radio/Radio.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("react"),d=require("prop-types"),n=require("styled-components"),u=require("../BaseRadio/BaseRadio.cjs"),c=require("../
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("react"),d=require("prop-types"),n=require("styled-components"),u=require("../BaseRadio/BaseRadio.cjs"),c=require("../Box/Box.cjs"),i=require("../Typography/Typography.cjs"),a=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},t=a(l),o=a(d),p=a(n),y=p.default(i.Typography)`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
|
-
`,r=({children:e,...s})=>t.default.createElement(y,{as:"label",textColor:"neutral800"},t.default.createElement(u.BaseRadio,{...s}),t.default.createElement(
|
|
4
|
+
`,r=({children:e,...s})=>t.default.createElement(y,{as:"label",textColor:"neutral800"},t.default.createElement(u.BaseRadio,{...s}),t.default.createElement(c.Box,{paddingLeft:2},e));r.propTypes={children:o.default.node.isRequired,value:o.default.any.isRequired};exports.Radio=r;
|
package/dist/Radio/Radio.js
CHANGED
|
@@ -2,19 +2,12 @@ import e from "react";
|
|
|
2
2
|
import r from "prop-types";
|
|
3
3
|
import a from "styled-components";
|
|
4
4
|
import { BaseRadio as i } from "../BaseRadio/BaseRadio.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
const l = a(
|
|
5
|
+
import { Box as m } from "../Box/Box.js";
|
|
6
|
+
import { Typography as p } from "../Typography/Typography.js";
|
|
7
|
+
const l = a(p)`
|
|
8
8
|
display: flex;
|
|
9
9
|
align-items: center;
|
|
10
|
-
`, n = ({ children: t, ...o }) => /* @__PURE__ */ e.createElement(l, {
|
|
11
|
-
as: "label",
|
|
12
|
-
textColor: "neutral800"
|
|
13
|
-
}, /* @__PURE__ */ e.createElement(i, {
|
|
14
|
-
...o
|
|
15
|
-
}), /* @__PURE__ */ e.createElement(p, {
|
|
16
|
-
paddingLeft: 2
|
|
17
|
-
}, t));
|
|
10
|
+
`, n = ({ children: t, ...o }) => /* @__PURE__ */ e.createElement(l, { as: "label", textColor: "neutral800" }, /* @__PURE__ */ e.createElement(i, { ...o }), /* @__PURE__ */ e.createElement(m, { paddingLeft: 2 }, t));
|
|
18
11
|
n.propTypes = {
|
|
19
12
|
children: r.node.isRequired,
|
|
20
13
|
value: r.any.isRequired
|
|
@@ -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 g=require("react/jsx-runtime"),l=require("react"),F=require("./RawTableContext.cjs"),v=require("../Box/Box.cjs"),s=require("../helpers/getFocusableNodes.cjs"),d=require("../helpers/keyboardKeys.cjs"),m=n=>g.jsx(y,{...n,as:"th"}),y=({coords:n,as:h="td",...x})=>{const a=l.useRef(null),{rowIndex:T,colIndex:E,setTableValues:N}=F.useTable(),[c,i]=l.useState(!1),K=e=>{const t=s.getFocusableNodes(a.current,!0);if(t.length===0||t.length===1&&s.getFocusableNodesWithKeyboardNav(t).length===0)return;if(t.length>1&&!t.find(u=>u.tagName!=="BUTTON")){e.preventDefault();const u=t.findIndex(r=>r===document.activeElement);if(e.key===d.KeyboardKeys.RIGHT){const r=t[u+1];r&&(e.stopPropagation(),r.focus())}else if(e.key===d.KeyboardKeys.LEFT){const r=t[u-1];r&&(e.stopPropagation(),r.focus())}return}const o=e.key===d.KeyboardKeys.ENTER;if(o&&!c)i(!0);else if((e.key===d.KeyboardKeys.ESCAPE||o)&&c){if(o&&document.activeElement?.tagName==="A")return;i(!1),a.current.focus()}else c&&e.stopPropagation()},f=T===n.row-1&&E===n.col-1;l.useLayoutEffect(()=>{const e=s.getFocusableNodes(a.current,!0);e.length===0||e.length===1&&s.getFocusableNodesWithKeyboardNav(e).length!==0||e.length>1&&Boolean(e.find(t=>t.tagName!=="BUTTON"))?(a.current.setAttribute("tabIndex",!c&&f?"0":"-1"),e.forEach((t,o)=>{t.setAttribute("tabIndex",c?"0":"-1"),c&&o===0&&t.focus()})):e.forEach(t=>{t.setAttribute("tabIndex",f?"0":"-1")})},[c,f]);const b=l.useCallback(()=>{const e=s.getFocusableNodes(a.current,!0);e.length>=1&&(s.getFocusableNodesWithKeyboardNav(e).length!==0||!e.find(t=>t.tagName!=="BUTTON"))&&i(!0),N({rowIndex:n.row-1,colIndex:n.col-1})},[n,N]);return l.useLayoutEffect(()=>{const e=a.current;return s.getFocusableNodes(e,!0).forEach(o=>{o.addEventListener("focus",b)}),()=>{s.getFocusableNodes(e,!0).forEach(u=>{u.removeEventListener("focus",b)})}},[b]),g.jsx(v.Box,{role:"gridcell",as:h,ref:a,onKeyDown:K,...x})};exports.RawTd=y;exports.RawTh=m;
|
package/dist/RawTable/RawCell.js
CHANGED
|
@@ -1,95 +1,80 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
const
|
|
8
|
-
...
|
|
1
|
+
import { jsx as g } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as y, useState as I, useLayoutEffect as N, useCallback as v } from "react";
|
|
3
|
+
import { useTable as w } from "./RawTableContext.js";
|
|
4
|
+
import { Box as A } from "../Box/Box.js";
|
|
5
|
+
import { getFocusableNodes as u, getFocusableNodesWithKeyboardNav as b } from "../helpers/getFocusableNodes.js";
|
|
6
|
+
import { KeyboardKeys as f } from "../helpers/keyboardKeys.js";
|
|
7
|
+
const D = (n) => g(B, {
|
|
8
|
+
...n,
|
|
9
9
|
as: "th"
|
|
10
|
-
}),
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
}), B = ({
|
|
11
|
+
coords: n,
|
|
12
|
+
as: h = "td",
|
|
13
|
+
...E
|
|
14
|
+
}) => {
|
|
15
|
+
const s = y(null), {
|
|
16
|
+
rowIndex: p,
|
|
17
|
+
colIndex: x,
|
|
18
|
+
setTableValues: m
|
|
19
|
+
} = w(), [r, l] = I(!1), T = (e) => {
|
|
20
|
+
const t = u(s.current, !0);
|
|
13
21
|
if (t.length === 0 || t.length === 1 && b(t).length === 0)
|
|
14
22
|
return;
|
|
15
|
-
if (t.length > 1 && !t.find((
|
|
23
|
+
if (t.length > 1 && !t.find((a) => a.tagName !== "BUTTON")) {
|
|
16
24
|
e.preventDefault();
|
|
17
|
-
const
|
|
18
|
-
if (e.key ===
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
} else if (e.key ===
|
|
22
|
-
const
|
|
23
|
-
|
|
25
|
+
const a = t.findIndex((c) => c === document.activeElement);
|
|
26
|
+
if (e.key === f.RIGHT) {
|
|
27
|
+
const c = t[a + 1];
|
|
28
|
+
c && (e.stopPropagation(), c.focus());
|
|
29
|
+
} else if (e.key === f.LEFT) {
|
|
30
|
+
const c = t[a - 1];
|
|
31
|
+
c && (e.stopPropagation(), c.focus());
|
|
24
32
|
}
|
|
25
33
|
return;
|
|
26
34
|
}
|
|
27
|
-
const
|
|
28
|
-
if (
|
|
29
|
-
|
|
30
|
-
else if ((e.key ===
|
|
31
|
-
if (
|
|
35
|
+
const o = e.key === f.ENTER;
|
|
36
|
+
if (o && !r)
|
|
37
|
+
l(!0);
|
|
38
|
+
else if ((e.key === f.ESCAPE || o) && r) {
|
|
39
|
+
if (o && document.activeElement?.tagName === "A")
|
|
32
40
|
return;
|
|
33
|
-
|
|
41
|
+
l(!1), s.current.focus();
|
|
34
42
|
} else
|
|
35
|
-
|
|
36
|
-
},
|
|
43
|
+
r && e.stopPropagation();
|
|
44
|
+
}, i = p === n.row - 1 && x === n.col - 1;
|
|
37
45
|
N(() => {
|
|
38
|
-
const e =
|
|
39
|
-
e.length === 0 || e.length === 1 && b(e).length !== 0 || e.length > 1 && Boolean(e.find((t) => t.tagName !== "BUTTON")) ? (s.current.setAttribute("tabIndex", !
|
|
40
|
-
t.setAttribute("tabIndex",
|
|
46
|
+
const e = u(s.current, !0);
|
|
47
|
+
e.length === 0 || e.length === 1 && b(e).length !== 0 || e.length > 1 && Boolean(e.find((t) => t.tagName !== "BUTTON")) ? (s.current.setAttribute("tabIndex", !r && i ? "0" : "-1"), e.forEach((t, o) => {
|
|
48
|
+
t.setAttribute("tabIndex", r ? "0" : "-1"), r && o === 0 && t.focus();
|
|
41
49
|
})) : e.forEach((t) => {
|
|
42
|
-
t.setAttribute("tabIndex",
|
|
50
|
+
t.setAttribute("tabIndex", i ? "0" : "-1");
|
|
43
51
|
});
|
|
44
|
-
}, [
|
|
45
|
-
const
|
|
46
|
-
const e =
|
|
47
|
-
e.length >= 1 && (b(e).length !== 0 || !e.find((t) => t.tagName !== "BUTTON")) &&
|
|
48
|
-
|
|
52
|
+
}, [r, i]);
|
|
53
|
+
const d = v(() => {
|
|
54
|
+
const e = u(s.current, !0);
|
|
55
|
+
e.length >= 1 && (b(e).length !== 0 || !e.find((t) => t.tagName !== "BUTTON")) && l(!0), m({
|
|
56
|
+
rowIndex: n.row - 1,
|
|
57
|
+
colIndex: n.col - 1
|
|
58
|
+
});
|
|
59
|
+
}, [n, m]);
|
|
49
60
|
return N(() => {
|
|
50
61
|
const e = s.current;
|
|
51
|
-
return
|
|
52
|
-
|
|
62
|
+
return u(e, !0).forEach((o) => {
|
|
63
|
+
o.addEventListener("focus", d);
|
|
53
64
|
}), () => {
|
|
54
|
-
|
|
55
|
-
|
|
65
|
+
u(e, !0).forEach((a) => {
|
|
66
|
+
a.removeEventListener("focus", d);
|
|
56
67
|
});
|
|
57
68
|
};
|
|
58
|
-
}, [
|
|
69
|
+
}, [d]), g(A, {
|
|
59
70
|
role: "gridcell",
|
|
60
|
-
as:
|
|
71
|
+
as: h,
|
|
61
72
|
ref: s,
|
|
62
|
-
onKeyDown:
|
|
63
|
-
...
|
|
73
|
+
onKeyDown: T,
|
|
74
|
+
...E
|
|
64
75
|
});
|
|
65
76
|
};
|
|
66
|
-
E.defaultProps = {
|
|
67
|
-
children: void 0,
|
|
68
|
-
coords: {}
|
|
69
|
-
};
|
|
70
|
-
E.propTypes = {
|
|
71
|
-
"aria-colindex": o.number.isRequired,
|
|
72
|
-
children: o.node,
|
|
73
|
-
coords: o.shape({
|
|
74
|
-
col: o.number,
|
|
75
|
-
row: o.number
|
|
76
|
-
})
|
|
77
|
-
};
|
|
78
|
-
h.defaultProps = {
|
|
79
|
-
as: "td",
|
|
80
|
-
children: void 0,
|
|
81
|
-
coords: {}
|
|
82
|
-
};
|
|
83
|
-
h.propTypes = {
|
|
84
|
-
"aria-colindex": o.number.isRequired,
|
|
85
|
-
as: o.oneOf(["td", "th"]),
|
|
86
|
-
children: o.node,
|
|
87
|
-
coords: o.shape({
|
|
88
|
-
col: o.number,
|
|
89
|
-
row: o.number
|
|
90
|
-
})
|
|
91
|
-
};
|
|
92
77
|
export {
|
|
93
|
-
|
|
94
|
-
|
|
78
|
+
B as RawTd,
|
|
79
|
+
D as RawTh
|
|
95
80
|
};
|
|
@@ -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 i=require("react/jsx-runtime"),r=require("react"),E=require("./focusFocusable.cjs"),P=require("./RawTableContext.cjs"),s=require("../helpers/keyboardKeys.cjs"),j=({colCount:b,rowCount:c,jumpStep:l=3,initialCol:D=0,initialRow:d=0,...k})=>{const f=r.useRef(null),n=r.useRef(!1),[o,t]=r.useState(d),[y,u]=r.useState(D),K=r.useCallback(({colIndex:a,rowIndex:e})=>{u(a),t(e)},[]);r.useEffect(()=>{n.current&&E.focusFocusable(f.current),n.current||(n.current=!0)},[y,o]);const T=a=>{switch(a.key){case s.KeyboardKeys.RIGHT:{a.preventDefault(),u(e=>e<b-1?e+1:e);break}case s.KeyboardKeys.LEFT:{a.preventDefault(),u(e=>e>0?e-1:e);break}case s.KeyboardKeys.UP:{a.preventDefault(),t(e=>e>0?e-1:e);break}case s.KeyboardKeys.DOWN:{a.preventDefault(),t(e=>e<c-1?e+1:e);break}case s.KeyboardKeys.HOME:{a.preventDefault(),a.ctrlKey&&t(0),u(0);break}case s.KeyboardKeys.END:{a.preventDefault(),a.ctrlKey&&t(c-1),u(b-1);break}case s.KeyboardKeys.PAGE_DOWN:{a.preventDefault(),t(e=>e+l<c?e+l:c-1);break}case s.KeyboardKeys.PAGE_UP:{a.preventDefault(),t(e=>e-l>0?e-l:0);break}}},R=r.useMemo(()=>({rowIndex:o,colIndex:y,setTableValues:K}),[y,o,K]);return i.jsx(P.RawTableContext.Provider,{value:R,children:i.jsx("table",{role:"grid",ref:f,"aria-rowcount":c,"aria-colcount":b,onKeyDown:T,...k})})};exports.RawTable=j;
|
|
@@ -1,23 +1,33 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
1
|
+
import { jsx as D } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as k, useState as m, useCallback as h, useEffect as G, useMemo as N } from "react";
|
|
3
|
+
import { focusFocusable as O } from "./focusFocusable.js";
|
|
4
|
+
import { RawTableContext as A } from "./RawTableContext.js";
|
|
4
5
|
import { KeyboardKeys as a } from "../helpers/keyboardKeys.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
const _ = ({
|
|
7
|
+
colCount: l,
|
|
8
|
+
rowCount: c,
|
|
9
|
+
jumpStep: f = 3,
|
|
10
|
+
initialCol: y = 0,
|
|
11
|
+
initialRow: E = 0,
|
|
12
|
+
...K
|
|
13
|
+
}) => {
|
|
14
|
+
const b = k(null), n = k(!1), [u, r] = m(E), [o, s] = m(y), i = h(({
|
|
15
|
+
colIndex: t,
|
|
16
|
+
rowIndex: e
|
|
17
|
+
}) => {
|
|
18
|
+
s(t), r(e);
|
|
9
19
|
}, []);
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}, [
|
|
13
|
-
const
|
|
20
|
+
G(() => {
|
|
21
|
+
n.current && O(b.current), n.current || (n.current = !0);
|
|
22
|
+
}, [o, u]);
|
|
23
|
+
const P = (t) => {
|
|
14
24
|
switch (t.key) {
|
|
15
25
|
case a.RIGHT: {
|
|
16
|
-
t.preventDefault(),
|
|
26
|
+
t.preventDefault(), s((e) => e < l - 1 ? e + 1 : e);
|
|
17
27
|
break;
|
|
18
28
|
}
|
|
19
29
|
case a.LEFT: {
|
|
20
|
-
t.preventDefault(),
|
|
30
|
+
t.preventDefault(), s((e) => e > 0 ? e - 1 : e);
|
|
21
31
|
break;
|
|
22
32
|
}
|
|
23
33
|
case a.UP: {
|
|
@@ -25,50 +35,43 @@ const y = ({ colCount: i, rowCount: l, jumpStep: n, initialCol: p, initialRow: E
|
|
|
25
35
|
break;
|
|
26
36
|
}
|
|
27
37
|
case a.DOWN: {
|
|
28
|
-
t.preventDefault(), r((e) => e <
|
|
38
|
+
t.preventDefault(), r((e) => e < c - 1 ? e + 1 : e);
|
|
29
39
|
break;
|
|
30
40
|
}
|
|
31
41
|
case a.HOME: {
|
|
32
|
-
t.preventDefault(), t.ctrlKey && r(0),
|
|
42
|
+
t.preventDefault(), t.ctrlKey && r(0), s(0);
|
|
33
43
|
break;
|
|
34
44
|
}
|
|
35
45
|
case a.END: {
|
|
36
|
-
t.preventDefault(), t.ctrlKey && r(
|
|
46
|
+
t.preventDefault(), t.ctrlKey && r(c - 1), s(l - 1);
|
|
37
47
|
break;
|
|
38
48
|
}
|
|
39
49
|
case a.PAGE_DOWN: {
|
|
40
|
-
t.preventDefault(), r((e) => e +
|
|
50
|
+
t.preventDefault(), r((e) => e + f < c ? e + f : c - 1);
|
|
41
51
|
break;
|
|
42
52
|
}
|
|
43
53
|
case a.PAGE_UP: {
|
|
44
|
-
t.preventDefault(), r((e) => e -
|
|
54
|
+
t.preventDefault(), r((e) => e - f > 0 ? e - f : 0);
|
|
45
55
|
break;
|
|
46
56
|
}
|
|
47
57
|
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
"
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
};
|
|
65
|
-
y.propTypes = {
|
|
66
|
-
colCount: s.number.isRequired,
|
|
67
|
-
initialCol: s.number,
|
|
68
|
-
initialRow: s.number,
|
|
69
|
-
jumpStep: s.number,
|
|
70
|
-
rowCount: s.number.isRequired
|
|
58
|
+
}, T = N(() => ({
|
|
59
|
+
rowIndex: u,
|
|
60
|
+
colIndex: o,
|
|
61
|
+
setTableValues: i
|
|
62
|
+
}), [o, u, i]);
|
|
63
|
+
return D(A.Provider, {
|
|
64
|
+
value: T,
|
|
65
|
+
children: D("table", {
|
|
66
|
+
role: "grid",
|
|
67
|
+
ref: b,
|
|
68
|
+
"aria-rowcount": c,
|
|
69
|
+
"aria-colcount": l,
|
|
70
|
+
onKeyDown: P,
|
|
71
|
+
...K
|
|
72
|
+
})
|
|
73
|
+
});
|
|
71
74
|
};
|
|
72
75
|
export {
|
|
73
|
-
|
|
76
|
+
_ as RawTable
|
|
74
77
|
};
|
|
@@ -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 a=require("react/jsx-runtime"),r=require("react"),u=({children:t,...n})=>{const o=r.Children.toArray(t).map((e,i)=>r.isValidElement(e)?r.cloneElement(e,{"aria-rowindex":i+2}):e);return a.jsx("tbody",{...n,children:o})};exports.RawTbody=u;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import a from "
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { Children as m, isValidElement as a, cloneElement as l } from "react";
|
|
3
|
+
const s = ({
|
|
4
|
+
children: e,
|
|
5
|
+
...n
|
|
6
|
+
}) => {
|
|
7
|
+
const o = m.toArray(e).map((r, t) => a(r) ? l(r, {
|
|
8
|
+
"aria-rowindex": t + 2
|
|
9
|
+
}) : r);
|
|
10
|
+
return i("tbody", {
|
|
11
|
+
...n,
|
|
12
|
+
children: o
|
|
13
|
+
});
|
|
13
14
|
};
|
|
14
15
|
export {
|
|
15
|
-
|
|
16
|
+
s as RawTbody
|
|
16
17
|
};
|
|
@@ -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 i=require("react/jsx-runtime"),r=require("react"),o=({children:t,...n})=>{const a=r.Children.toArray(t).map(e=>r.isValidElement(e)?r.cloneElement(e,{"aria-rowindex":1}):e);return i.jsx("thead",{...n,children:a})};exports.RawThead=o;
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import i from "
|
|
3
|
-
const p = ({
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { Children as a, isValidElement as i, cloneElement as m } from "react";
|
|
3
|
+
const p = ({
|
|
4
|
+
children: e,
|
|
5
|
+
...n
|
|
6
|
+
}) => {
|
|
7
|
+
const t = a.toArray(e).map((r) => i(r) ? m(r, {
|
|
8
|
+
"aria-rowindex": 1
|
|
9
|
+
}) : r);
|
|
10
|
+
return o("thead", {
|
|
11
|
+
...n,
|
|
12
|
+
children: t
|
|
13
|
+
});
|
|
11
14
|
};
|
|
12
15
|
export {
|
|
13
16
|
p as RawThead
|
package/dist/RawTable/RawTr.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 i=require("react/jsx-runtime"),r=require("react"),c=require("../Box/Box.cjs"),s=({children:n,...t})=>{const a=r.Children.toArray(n).map((e,o)=>r.isValidElement(e)?r.cloneElement(e,{"aria-colindex":o+1,coords:{col:o+1,row:t["aria-rowindex"]}}):e);return i.jsx(c.Box,{as:"tr",...t,children:a})};exports.RawTr=s;
|
package/dist/RawTable/RawTr.js
CHANGED
|
@@ -1,19 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { Box as
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { Children as a, isValidElement as m, cloneElement as l } from "react";
|
|
3
|
+
import { Box as c } from "../Box/Box.js";
|
|
4
|
+
const x = ({
|
|
5
|
+
children: n,
|
|
6
|
+
...o
|
|
7
|
+
}) => {
|
|
8
|
+
const t = a.toArray(n).map((r, e) => m(r) ? l(r, {
|
|
9
|
+
"aria-colindex": e + 1,
|
|
10
|
+
coords: {
|
|
11
|
+
col: e + 1,
|
|
12
|
+
row: o["aria-rowindex"]
|
|
13
|
+
}
|
|
14
|
+
}) : r);
|
|
15
|
+
return i(c, {
|
|
9
16
|
as: "tr",
|
|
10
|
-
...
|
|
11
|
-
|
|
12
|
-
};
|
|
13
|
-
m.propTypes = {
|
|
14
|
-
"aria-rowindex": o.number.isRequired,
|
|
15
|
-
children: o.node.isRequired
|
|
17
|
+
...o,
|
|
18
|
+
children: t
|
|
19
|
+
});
|
|
16
20
|
};
|
|
17
21
|
export {
|
|
18
|
-
|
|
22
|
+
x as RawTr
|
|
19
23
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react"),E=require("prop-types"),S=require("styled-components"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react"),d=require("@strapi/icons"),E=require("prop-types"),S=require("styled-components"),x=require("../Field/Field.cjs"),_=require("../Field/FieldLabel.cjs"),a=require("../Field/FieldInput.cjs");require("react/jsx-runtime");require("../Field/FieldContext.cjs");require("../Typography/Typography.cjs");const v=require("../Field/FieldAction.cjs"),o=require("../Flex/Flex.cjs"),$=require("../themes/sizes.cjs"),z=require("../themes/utils.cjs"),C=require("../VisuallyHidden/VisuallyHidden.cjs"),i=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},t=i(s),l=i(E),n=i(S),I=n.default(o.Flex)`
|
|
2
2
|
font-size: 0.5rem;
|
|
3
3
|
svg path {
|
|
4
4
|
fill: ${({theme:e})=>e.colors.neutral400};
|
|
@@ -25,5 +25,5 @@
|
|
|
25
25
|
border: 1px solid transparent;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
${
|
|
29
|
-
`,r=s.forwardRef(({name:e,size:f,children:F,value:u,onClear:y,clearLabel:h,...m},q)=>{const c=s.useRef(null),b=u.length>0,
|
|
28
|
+
${z.inputFocusStyle(a.InputWrapper)}
|
|
29
|
+
`,r=s.forwardRef(({name:e,size:f,children:F,value:u,onClear:y,clearLabel:h,...m},q)=>{const c=s.useRef(null),b=u.length>0,j=R=>{y(R),c.current.focus()},g=q||c;return t.default.createElement(T,null,t.default.createElement(x.Field,{name:e},t.default.createElement(C.VisuallyHidden,null,t.default.createElement(_.FieldLabel,null,F)),t.default.createElement(a.FieldInput,{ref:g,value:u,startAction:t.default.createElement(p,null,t.default.createElement(d.Search,{"aria-hidden":!0})),size:f,endAction:b?t.default.createElement(v.FieldAction,{label:h,onClick:j},t.default.createElement(I,null,t.default.createElement(d.Cross,null))):void 0,...m})))});r.displayName="Searchbar";r.defaultProps={value:"",size:"M"};r.propTypes={children:l.default.node.isRequired,clearLabel:l.default.string.isRequired,name:l.default.string.isRequired,onClear:l.default.func.isRequired,size:l.default.oneOf(Object.keys($.sizes.input)),value:l.default.string};exports.Searchbar=r;
|