@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
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import e, { useState as L, useEffect as W } from "react";
|
|
2
2
|
import a from "prop-types";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { SimpleMenu as s, MenuItem as f } from "../SimpleMenu/SimpleMenu.js";
|
|
6
|
-
import { Flex as I } from "../Flex/Flex.js";
|
|
7
|
-
import { Box as p } from "../Box/Box.js";
|
|
8
|
-
import { RawTable as V } from "../RawTable/RawTable.js";
|
|
9
|
-
import "../RawTable/RawCell.js";
|
|
10
|
-
import { RawThead as j } from "../RawTable/RawThead.js";
|
|
11
|
-
import { RawTbody as z } from "../RawTable/RawTbody.js";
|
|
12
|
-
import { RawTr as d } from "../RawTable/RawTr.js";
|
|
3
|
+
import { DatePickerPopover as _ } from "./components.js";
|
|
4
|
+
import { DatePickerTd as H } from "./DatePickerTd.js";
|
|
13
5
|
import { DatePickerTh as r } from "./DatePickerTh.js";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
6
|
+
import { getDayOfWeek as I } from "./utils/getDayOfWeek.js";
|
|
7
|
+
import { getMonths as V } from "./utils/getMonths.js";
|
|
8
|
+
import { generateWeeks as j } from "./utils/generateWeeks.js";
|
|
9
|
+
import { getYears as z } from "./utils/getYears.js";
|
|
10
|
+
import { formatDate as A } from "./utils/formatDate.js";
|
|
11
|
+
import { Box as p } from "../Box/Box.js";
|
|
12
|
+
import { Flex as G } from "../Flex/Flex.js";
|
|
13
|
+
import { FocusTrap as J } from "../FocusTrap/FocusTrap.js";
|
|
14
|
+
import { RawTable as K } from "../RawTable/RawTable.js";
|
|
15
|
+
import "react/jsx-runtime";
|
|
16
|
+
import "../RawTable/RawTableContext.js";
|
|
17
|
+
import { RawThead as N } from "../RawTable/RawThead.js";
|
|
18
|
+
import { RawTbody as Q } from "../RawTable/RawTbody.js";
|
|
19
|
+
import { RawTr as s } from "../RawTable/RawTr.js";
|
|
20
|
+
import { SimpleMenu as f, MenuItem as d } from "../SimpleMenu/SimpleMenu.js";
|
|
21
|
+
import { VisuallyHidden as U } from "../VisuallyHidden/VisuallyHidden.js";
|
|
21
22
|
const E = ({
|
|
22
23
|
selectedDate: i,
|
|
23
24
|
initialDate: g,
|
|
@@ -28,7 +29,7 @@ const E = ({
|
|
|
28
29
|
maxDate: R,
|
|
29
30
|
onEscape: y
|
|
30
31
|
}) => {
|
|
31
|
-
const [l, m] = L(g), [u, C, T] =
|
|
32
|
+
const [l, m] = L(g), [u, C, T] = j(l, i), { sun: v, mon: x, tue: M, wed: O, thu: P, fri: b, sat: q } = I(), c = V(), F = z(w, R);
|
|
32
33
|
W(() => {
|
|
33
34
|
i && m(i);
|
|
34
35
|
}, [i]);
|
|
@@ -39,50 +40,17 @@ const E = ({
|
|
|
39
40
|
const n = new Date(l);
|
|
40
41
|
n.setFullYear(t), m(n);
|
|
41
42
|
};
|
|
42
|
-
return /* @__PURE__ */ e.createElement(
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
paddingBottom: 4,
|
|
54
|
-
paddingLeft: 2,
|
|
55
|
-
paddingRight: 2
|
|
56
|
-
}, /* @__PURE__ */ e.createElement(I, null, /* @__PURE__ */ e.createElement(s, {
|
|
57
|
-
label: c[l.getMonth()]
|
|
58
|
-
}, c.map((t) => /* @__PURE__ */ e.createElement(f, {
|
|
59
|
-
key: t,
|
|
60
|
-
onClick: () => Y(t)
|
|
61
|
-
}, t))), /* @__PURE__ */ e.createElement(p, {
|
|
62
|
-
paddingLeft: 2
|
|
63
|
-
}, /* @__PURE__ */ e.createElement(s, {
|
|
64
|
-
label: l.getFullYear()
|
|
65
|
-
}, F.map((t) => /* @__PURE__ */ e.createElement(f, {
|
|
66
|
-
key: t,
|
|
67
|
-
onClick: () => S(t)
|
|
68
|
-
}, t)))))), /* @__PURE__ */ e.createElement(V, {
|
|
69
|
-
colCount: 7,
|
|
70
|
-
rowCount: u.length + 1,
|
|
71
|
-
initialCol: T,
|
|
72
|
-
initialRow: C,
|
|
73
|
-
role: "grid"
|
|
74
|
-
}, /* @__PURE__ */ e.createElement(j, null, /* @__PURE__ */ e.createElement(d, {
|
|
75
|
-
"aria-rowindex": 1
|
|
76
|
-
}, /* @__PURE__ */ e.createElement(r, null, v), /* @__PURE__ */ e.createElement(r, null, x), /* @__PURE__ */ e.createElement(r, null, M), /* @__PURE__ */ e.createElement(r, null, O), /* @__PURE__ */ e.createElement(r, null, P), /* @__PURE__ */ e.createElement(r, null, b), /* @__PURE__ */ e.createElement(r, null, q))), /* @__PURE__ */ e.createElement(z, null, u.map((t, n) => /* @__PURE__ */ e.createElement(d, {
|
|
77
|
-
key: n
|
|
78
|
-
}, t.map(({ date: o, outsideMonth: $, isSelected: B }) => /* @__PURE__ */ e.createElement(A, {
|
|
79
|
-
key: `${o.getFullYear()}-${o.getMonth() + 1}-${o.getDate()}`,
|
|
80
|
-
outsideMonth: $,
|
|
81
|
-
onSelectDay: () => h(o),
|
|
82
|
-
isSelected: B
|
|
83
|
-
}, /* @__PURE__ */ e.createElement("span", {
|
|
84
|
-
"aria-hidden": !0
|
|
85
|
-
}, o.getDate()), /* @__PURE__ */ e.createElement(_, null, /* @__PURE__ */ e.createElement("span", null, U(o))))))))))));
|
|
43
|
+
return /* @__PURE__ */ e.createElement(_, { source: D, role: "dialog", "aria-modal": "true", "aria-label": k, spacing: 4 }, /* @__PURE__ */ e.createElement(J, { onEscape: y }, /* @__PURE__ */ e.createElement(p, { padding: 4 }, /* @__PURE__ */ e.createElement(p, { paddingBottom: 4, paddingLeft: 2, paddingRight: 2 }, /* @__PURE__ */ e.createElement(G, null, /* @__PURE__ */ e.createElement(f, { label: c[l.getMonth()] }, c.map((t) => /* @__PURE__ */ e.createElement(d, { key: t, onClick: () => Y(t) }, t))), /* @__PURE__ */ e.createElement(p, { paddingLeft: 2 }, /* @__PURE__ */ e.createElement(f, { label: l.getFullYear() }, F.map((t) => /* @__PURE__ */ e.createElement(d, { key: t, onClick: () => S(t) }, t)))))), /* @__PURE__ */ e.createElement(K, { colCount: 7, rowCount: u.length + 1, initialCol: T, initialRow: C, role: "grid" }, /* @__PURE__ */ e.createElement(N, null, /* @__PURE__ */ e.createElement(s, { "aria-rowindex": 1 }, /* @__PURE__ */ e.createElement(r, null, v), /* @__PURE__ */ e.createElement(r, null, x), /* @__PURE__ */ e.createElement(r, null, M), /* @__PURE__ */ e.createElement(r, null, O), /* @__PURE__ */ e.createElement(r, null, P), /* @__PURE__ */ e.createElement(r, null, b), /* @__PURE__ */ e.createElement(r, null, q))), /* @__PURE__ */ e.createElement(Q, null, u.map((t, n) => /* @__PURE__ */ e.createElement(s, { key: n }, t.map(({ date: o, outsideMonth: $, isSelected: B }) => /* @__PURE__ */ e.createElement(
|
|
44
|
+
H,
|
|
45
|
+
{
|
|
46
|
+
key: `${o.getFullYear()}-${o.getMonth() + 1}-${o.getDate()}`,
|
|
47
|
+
outsideMonth: $,
|
|
48
|
+
onSelectDay: () => h(o),
|
|
49
|
+
isSelected: B
|
|
50
|
+
},
|
|
51
|
+
/* @__PURE__ */ e.createElement("span", { "aria-hidden": !0 }, o.getDate()),
|
|
52
|
+
/* @__PURE__ */ e.createElement(U, null, /* @__PURE__ */ e.createElement("span", null, A(o)))
|
|
53
|
+
)))))))));
|
|
86
54
|
};
|
|
87
55
|
E.defaultProps = {
|
|
88
56
|
selectedDate: void 0,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("react"),p=require("prop-types"),f=require("styled-components");require("
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("react"),p=require("prop-types"),f=require("styled-components");require("react/jsx-runtime");require("../RawTable/RawTableContext.cjs");const y=require("../RawTable/RawCell.cjs");require("../Box/Box.cjs");const i=require("../Typography/Typography.cjs"),n=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},l=n(d),t=n(p),b=n(f),T=b.default.button`
|
|
2
2
|
border: none;
|
|
3
3
|
background: ${({theme:e,isSelected:r})=>r?e.colors.primary100:e.colors.neutral0};
|
|
4
4
|
height: ${32/16}rem;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
background: ${({theme:e})=>e.colors.primary100};
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
&:hover > ${
|
|
16
|
+
&:hover > ${i.Typography} {
|
|
17
17
|
color: ${({theme:e})=>e.colors.primary600};
|
|
18
18
|
}
|
|
19
|
-
`,
|
|
19
|
+
`,u=({children:e,outsideMonth:r,onSelectDay:s,isSelected:o,...c})=>{let a="neutral900";return o?a="primary600":r&&(a="neutral600"),l.default.createElement(y.RawTd,{...c},l.default.createElement(T,{tabIndex:-1,onClick:s,isSelected:o,type:"button"},l.default.createElement(i.Typography,{variant:"pi",textColor:a,fontWeight:o?"bold":null},e)))};u.defaultProps={isSelected:!1,outsideMonth:!1};u.propTypes={children:t.default.node.isRequired,isSelected:t.default.bool,onSelectDay:t.default.func.isRequired,outsideMonth:t.default.bool};exports.DatePickerTd=u;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import l from "react";
|
|
2
2
|
import o from "prop-types";
|
|
3
|
-
import
|
|
4
|
-
import "
|
|
5
|
-
import
|
|
6
|
-
import "../RawTable/
|
|
7
|
-
import "../
|
|
8
|
-
import "../RawTable/RawTr.js";
|
|
3
|
+
import c from "styled-components";
|
|
4
|
+
import "react/jsx-runtime";
|
|
5
|
+
import "../RawTable/RawTableContext.js";
|
|
6
|
+
import { RawTd as m } from "../RawTable/RawCell.js";
|
|
7
|
+
import "../Box/Box.js";
|
|
9
8
|
import { Typography as n } from "../Typography/Typography.js";
|
|
10
|
-
const s =
|
|
9
|
+
const s = c.button`
|
|
11
10
|
border: none;
|
|
12
11
|
background: ${({ theme: e, isSelected: r }) => r ? e.colors.primary100 : e.colors.neutral0};
|
|
13
12
|
height: ${32 / 16}rem;
|
|
@@ -25,20 +24,9 @@ const s = u.button`
|
|
|
25
24
|
&:hover > ${n} {
|
|
26
25
|
color: ${({ theme: e }) => e.colors.primary600};
|
|
27
26
|
}
|
|
28
|
-
`, a = ({ children: e, outsideMonth: r, onSelectDay: p, isSelected: t, ...
|
|
27
|
+
`, a = ({ children: e, outsideMonth: r, onSelectDay: p, isSelected: t, ...u }) => {
|
|
29
28
|
let i = "neutral900";
|
|
30
|
-
return t ? i = "primary600" : r && (i = "neutral600"), /* @__PURE__ */ l.createElement(
|
|
31
|
-
...m
|
|
32
|
-
}, /* @__PURE__ */ l.createElement(s, {
|
|
33
|
-
tabIndex: -1,
|
|
34
|
-
onClick: p,
|
|
35
|
-
isSelected: t,
|
|
36
|
-
type: "button"
|
|
37
|
-
}, /* @__PURE__ */ l.createElement(n, {
|
|
38
|
-
variant: "pi",
|
|
39
|
-
textColor: i,
|
|
40
|
-
fontWeight: t ? "bold" : null
|
|
41
|
-
}, e)));
|
|
29
|
+
return t ? i = "primary600" : r && (i = "neutral600"), /* @__PURE__ */ l.createElement(m, { ...u }, /* @__PURE__ */ l.createElement(s, { tabIndex: -1, onClick: p, isSelected: t, type: "button" }, /* @__PURE__ */ l.createElement(n, { variant: "pi", textColor: i, fontWeight: t ? "bold" : null }, e)));
|
|
42
30
|
};
|
|
43
31
|
a.defaultProps = {
|
|
44
32
|
isSelected: !1,
|
|
@@ -1,9 +1,9 @@
|
|
|
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 n=require("react"),i=require("prop-types"),s=require("styled-components"),u=require("../Flex/Flex.cjs");require("react/jsx-runtime");require("../RawTable/RawTableContext.cjs");const c=require("../RawTable/RawCell.cjs");require("../Box/Box.cjs");const d=require("../Typography/Typography.cjs"),p=require("../VisuallyHidden/VisuallyHidden.cjs"),r=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},t=r(n),f=r(i),a=r(s),y=a.default(c.RawTh)`
|
|
2
2
|
// Trick to prevent the outline from overflowing because of the general outline-offset
|
|
3
3
|
outline-offset: -2px;
|
|
4
4
|
border-radius: ${({theme:e})=>e.borderRadius};
|
|
5
5
|
text-transform: capitalize;
|
|
6
|
-
`,T=a.default(
|
|
6
|
+
`,T=a.default(u.Flex)`
|
|
7
7
|
height: ${24/16}rem;
|
|
8
8
|
width: ${32/16}rem;
|
|
9
|
-
`,l=({children:e,...o})=>t.default.createElement(y,{...o},t.default.createElement(T,{justifyContent:"center"},t.default.createElement(
|
|
9
|
+
`,l=({children:e,...o})=>t.default.createElement(y,{...o},t.default.createElement(T,{justifyContent:"center"},t.default.createElement(d.Typography,{variant:"pi",fontWeight:"bold",color:"neutral800","aria-hidden":!0},e.substr(0,2)),t.default.createElement(p.VisuallyHidden,null,t.default.createElement("span",null,e))));l.propTypes={children:f.default.string.isRequired};exports.DatePickerTh=l;
|
|
@@ -1,32 +1,22 @@
|
|
|
1
1
|
import e from "react";
|
|
2
2
|
import i from "prop-types";
|
|
3
3
|
import r from "styled-components";
|
|
4
|
-
import "../
|
|
5
|
-
import
|
|
6
|
-
import "../RawTable/
|
|
7
|
-
import "../RawTable/
|
|
8
|
-
import "../
|
|
9
|
-
import { Typography as
|
|
10
|
-
import { VisuallyHidden as
|
|
11
|
-
|
|
12
|
-
const l = r(n)`
|
|
4
|
+
import { Flex as n } from "../Flex/Flex.js";
|
|
5
|
+
import "react/jsx-runtime";
|
|
6
|
+
import "../RawTable/RawTableContext.js";
|
|
7
|
+
import { RawTh as a } from "../RawTable/RawCell.js";
|
|
8
|
+
import "../Box/Box.js";
|
|
9
|
+
import { Typography as m } from "../Typography/Typography.js";
|
|
10
|
+
import { VisuallyHidden as p } from "../VisuallyHidden/VisuallyHidden.js";
|
|
11
|
+
const l = r(a)`
|
|
13
12
|
// Trick to prevent the outline from overflowing because of the general outline-offset
|
|
14
13
|
outline-offset: -2px;
|
|
15
14
|
border-radius: ${({ theme: t }) => t.borderRadius};
|
|
16
15
|
text-transform: capitalize;
|
|
17
|
-
`, s = r(
|
|
16
|
+
`, s = r(n)`
|
|
18
17
|
height: ${24 / 16}rem;
|
|
19
18
|
width: ${32 / 16}rem;
|
|
20
|
-
`, f = ({ children: t, ...o }) => /* @__PURE__ */ e.createElement(l, {
|
|
21
|
-
...o
|
|
22
|
-
}, /* @__PURE__ */ e.createElement(s, {
|
|
23
|
-
justifyContent: "center"
|
|
24
|
-
}, /* @__PURE__ */ e.createElement(a, {
|
|
25
|
-
variant: "pi",
|
|
26
|
-
fontWeight: "bold",
|
|
27
|
-
color: "neutral800",
|
|
28
|
-
"aria-hidden": !0
|
|
29
|
-
}, t.substr(0, 2)), /* @__PURE__ */ e.createElement(m, null, /* @__PURE__ */ e.createElement("span", null, t))));
|
|
19
|
+
`, f = ({ children: t, ...o }) => /* @__PURE__ */ e.createElement(l, { ...o }, /* @__PURE__ */ e.createElement(s, { justifyContent: "center" }, /* @__PURE__ */ e.createElement(m, { variant: "pi", fontWeight: "bold", color: "neutral800", "aria-hidden": !0 }, t.substr(0, 2)), /* @__PURE__ */ e.createElement(p, null, /* @__PURE__ */ e.createElement("span", null, t))));
|
|
30
20
|
f.propTypes = {
|
|
31
21
|
children: i.string.isRequired
|
|
32
22
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("styled-components"),a=require("../
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("styled-components"),a=require("../Box/Box.cjs"),n=require("../Field/FieldInput.cjs"),i=require("../Popover/Popover.cjs"),d=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},o=d(t),s=o.default(i.Popover)`
|
|
2
2
|
max-height: ${3*6}rem;
|
|
3
3
|
overflow: hidden;
|
|
4
4
|
`,l=o.default.button`
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
fill: ${({theme:e})=>e.colors.neutral500};
|
|
12
12
|
}
|
|
13
13
|
`,c=o.default.div`
|
|
14
|
-
${({bold:e,theme:r})=>e?`& ${
|
|
14
|
+
${({bold:e,theme:r})=>e?`& ${n.InputWrapper} {
|
|
15
15
|
border: 1px solid ${r.colors.primary600};
|
|
16
16
|
}`:void 0}
|
|
17
|
-
`,u=o.default(
|
|
17
|
+
`,u=o.default(a.Box)`
|
|
18
18
|
background: transparent;
|
|
19
19
|
border: none;
|
|
20
20
|
position: relative;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import o from "styled-components";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
const l = o(
|
|
2
|
+
import { Box as t } from "../Box/Box.js";
|
|
3
|
+
import { InputWrapper as i } from "../Field/FieldInput.js";
|
|
4
|
+
import { Popover as a } from "../Popover/Popover.js";
|
|
5
|
+
const l = o(a)`
|
|
6
6
|
max-height: ${3 * 6}rem;
|
|
7
7
|
overflow: hidden;
|
|
8
8
|
`, c = o.button`
|
|
@@ -15,10 +15,10 @@ const l = o(i)`
|
|
|
15
15
|
fill: ${({ theme: r }) => r.colors.neutral500};
|
|
16
16
|
}
|
|
17
17
|
`, m = o.div`
|
|
18
|
-
${({ bold: r, theme: e }) => r ? `& ${
|
|
18
|
+
${({ bold: r, theme: e }) => r ? `& ${i} {
|
|
19
19
|
border: 1px solid ${e.colors.primary600};
|
|
20
20
|
}` : void 0}
|
|
21
|
-
`, u = o(
|
|
21
|
+
`, u = o(t)`
|
|
22
22
|
background: transparent;
|
|
23
23
|
border: none;
|
|
24
24
|
position: relative;
|
|
@@ -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 f=require("react"),$=require("./DateTimePickerProps.cjs"),y=require("./parseDate.cjs"),_=require("../DatePicker/DatePicker.cjs"),L=require("../Field/Field.cjs"),V=require("../Field/FieldLabel.cjs");require("../Field/FieldInput.cjs");const v=require("../Field/FieldHint.cjs"),C=require("../Field/FieldError.cjs");require("../Field/FieldContext.cjs");require("../Field/FieldAction.cjs");const S=require("../Flex/Flex.cjs"),R=require("../hooks/useId.cjs"),A=require("../TimePicker/TimePicker.cjs"),O=i=>i&&typeof i=="object"&&"default"in i?i:{default:i},s=O(f),P=({ariaLabel:i,clearLabel:T,disabled:k,error:p,hint:m,label:o,labelAction:H,onChange:a,onClear:D,name:j,required:F,selectButtonTitle:M,size:q,step:x,value:l,...E})=>{const d=y.parseDate(l),[r,n]=f.useState(d),[u,c]=f.useState(d?`${d.getHours()}:${d.getMinutes()}:${d.getSeconds()}`:null),I=e=>{n(e);let t;u?(t=new Date(e),t.setHours(u.split(":")[0]),t.setMinutes(u.split(":")[1])):(t=new Date(e),c(`${t.getHours()}:${t.getMinutes()}:${t.getSeconds()}`)),a&&a(t)},b=e=>{c(e);const t=r?new Date(r):new Date;t.setHours(e.split(":")[0]),t.setMinutes(e.split(":")[1]),r||n(t),a&&a(t)},h=()=>{n(void 0),c(void 0),D()},w=()=>{c(void 0);let e;r&&(e=new Date(r),e.setHours("00"),e.setMinutes("00")),a&&a(e)};f.useEffect(()=>{if(l&&+l!=+r){const e=y.parseDate(l);n(e),c(e?`${e.getHours()}:${e.getMinutes()}:${e.getSeconds()}`:null)}else l||(n(void 0),c(void 0))},[l,r]);const g=R.useId(E?.id);return s.default.createElement(L.Field,{name:j,role:"group",id:g,"aria-labelledby":g,hint:m,error:p,required:F},s.default.createElement(S.Flex,{direction:"column",alignItems:"stretch",gap:1},o&&s.default.createElement(V.FieldLabel,{action:H},o),s.default.createElement(S.Flex,{gap:2},s.default.createElement(_.DatePicker,{"data-testid":"datetimepicker-date",id:g,name:j,ariaLabel:o||i,error:typeof p=="string",hint:typeof m=="string",selectedDate:r,selectedDateLabel:e=>`Date picker, current is ${e}`,onChange:I,required:F,size:q,onClear:D&&h,clearLabel:T,disabled:k,...E}),s.default.createElement(A.TimePicker,{"data-testid":"datetimepicker-time",size:q,"aria-label":o||i,error:typeof p=="string",hint:typeof m=="string",value:u,onChange:b,onClear:D&&w,clearLabel:T,required:F,selectButtonTitle:M,disabled:k,step:x})),s.default.createElement(v.FieldHint,null),s.default.createElement(C.FieldError,null)))};P.defaultProps=$.dateTimePickerDefaultProps;P.propTypes=$.dateTimePickerPropTypes;exports.DateTimePicker=P;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import r, { useState as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { Field as
|
|
6
|
-
import { FieldLabel as
|
|
1
|
+
import r, { useState as y, useEffect as v } from "react";
|
|
2
|
+
import { dateTimePickerDefaultProps as C, dateTimePickerPropTypes as L } from "./DateTimePickerProps.js";
|
|
3
|
+
import { parseDate as H } from "./parseDate.js";
|
|
4
|
+
import { DatePicker as R } from "../DatePicker/DatePicker.js";
|
|
5
|
+
import { Field as b } from "../Field/Field.js";
|
|
6
|
+
import { FieldLabel as j } from "../Field/FieldLabel.js";
|
|
7
7
|
import "../Field/FieldInput.js";
|
|
8
|
-
import { FieldHint as
|
|
9
|
-
import { FieldError as
|
|
8
|
+
import { FieldHint as A } from "../Field/FieldHint.js";
|
|
9
|
+
import { FieldError as B } from "../Field/FieldError.js";
|
|
10
10
|
import "../Field/FieldContext.js";
|
|
11
11
|
import "../Field/FieldAction.js";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
12
|
+
import { Flex as S } from "../Flex/Flex.js";
|
|
13
|
+
import { useId as G } from "../hooks/useId.js";
|
|
14
|
+
import { TimePicker as J } from "../TimePicker/TimePicker.js";
|
|
15
15
|
const M = ({
|
|
16
|
-
ariaLabel:
|
|
16
|
+
ariaLabel: D,
|
|
17
17
|
clearLabel: T,
|
|
18
18
|
disabled: E,
|
|
19
19
|
error: d,
|
|
@@ -24,13 +24,13 @@ const M = ({
|
|
|
24
24
|
onClear: f,
|
|
25
25
|
name: $,
|
|
26
26
|
required: u,
|
|
27
|
-
selectButtonTitle:
|
|
27
|
+
selectButtonTitle: F,
|
|
28
28
|
size: k,
|
|
29
|
-
step:
|
|
29
|
+
step: h,
|
|
30
30
|
value: a,
|
|
31
31
|
...P
|
|
32
32
|
}) => {
|
|
33
|
-
const n = H(a), [i, m] =
|
|
33
|
+
const n = H(a), [i, m] = y(n), [c, s] = y(
|
|
34
34
|
n ? `${n.getHours()}:${n.getMinutes()}:${n.getSeconds()}` : null
|
|
35
35
|
), V = (e) => {
|
|
36
36
|
m(e);
|
|
@@ -40,14 +40,14 @@ const M = ({
|
|
|
40
40
|
s(e);
|
|
41
41
|
const t = i ? new Date(i) : new Date();
|
|
42
42
|
t.setHours(e.split(":")[0]), t.setMinutes(e.split(":")[1]), i || m(t), o && o(t);
|
|
43
|
-
},
|
|
43
|
+
}, x = () => {
|
|
44
44
|
m(void 0), s(void 0), f();
|
|
45
|
-
},
|
|
45
|
+
}, _ = () => {
|
|
46
46
|
s(void 0);
|
|
47
47
|
let e;
|
|
48
48
|
i && (e = new Date(i), e.setHours("00"), e.setMinutes("00")), o && o(e);
|
|
49
49
|
};
|
|
50
|
-
|
|
50
|
+
v(() => {
|
|
51
51
|
if (a && +a != +i) {
|
|
52
52
|
const e = H(a);
|
|
53
53
|
m(e), s(
|
|
@@ -56,56 +56,59 @@ const M = ({
|
|
|
56
56
|
} else
|
|
57
57
|
a || (m(void 0), s(void 0));
|
|
58
58
|
}, [a, i]);
|
|
59
|
-
const
|
|
60
|
-
return /* @__PURE__ */ r.createElement(
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
action: w
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
59
|
+
const g = G(P?.id);
|
|
60
|
+
return /* @__PURE__ */ r.createElement(
|
|
61
|
+
b,
|
|
62
|
+
{
|
|
63
|
+
name: $,
|
|
64
|
+
role: "group",
|
|
65
|
+
id: g,
|
|
66
|
+
"aria-labelledby": g,
|
|
67
|
+
hint: p,
|
|
68
|
+
error: d,
|
|
69
|
+
required: u
|
|
70
|
+
},
|
|
71
|
+
/* @__PURE__ */ r.createElement(S, { direction: "column", alignItems: "stretch", gap: 1 }, l && /* @__PURE__ */ r.createElement(j, { action: w }, l), /* @__PURE__ */ r.createElement(S, { gap: 2 }, /* @__PURE__ */ r.createElement(
|
|
72
|
+
R,
|
|
73
|
+
{
|
|
74
|
+
"data-testid": "datetimepicker-date",
|
|
75
|
+
id: g,
|
|
76
|
+
name: $,
|
|
77
|
+
ariaLabel: l || D,
|
|
78
|
+
error: typeof d == "string",
|
|
79
|
+
hint: typeof p == "string",
|
|
80
|
+
selectedDate: i,
|
|
81
|
+
selectedDateLabel: (e) => `Date picker, current is ${e}`,
|
|
82
|
+
onChange: V,
|
|
83
|
+
required: u,
|
|
84
|
+
size: k,
|
|
85
|
+
onClear: f && x,
|
|
86
|
+
clearLabel: T,
|
|
87
|
+
disabled: E,
|
|
88
|
+
...P
|
|
89
|
+
}
|
|
90
|
+
), /* @__PURE__ */ r.createElement(
|
|
91
|
+
J,
|
|
92
|
+
{
|
|
93
|
+
"data-testid": "datetimepicker-time",
|
|
94
|
+
size: k,
|
|
95
|
+
"aria-label": l || D,
|
|
96
|
+
error: typeof d == "string",
|
|
97
|
+
hint: typeof p == "string",
|
|
98
|
+
value: c,
|
|
99
|
+
onChange: I,
|
|
100
|
+
onClear: f && _,
|
|
101
|
+
clearLabel: T,
|
|
102
|
+
required: u,
|
|
103
|
+
selectButtonTitle: F,
|
|
104
|
+
disabled: E,
|
|
105
|
+
step: h
|
|
106
|
+
}
|
|
107
|
+
)), /* @__PURE__ */ r.createElement(A, null), /* @__PURE__ */ r.createElement(B, null))
|
|
108
|
+
);
|
|
106
109
|
};
|
|
107
|
-
M.defaultProps =
|
|
108
|
-
M.propTypes =
|
|
110
|
+
M.defaultProps = C;
|
|
111
|
+
M.propTypes = L;
|
|
109
112
|
export {
|
|
110
113
|
M as DateTimePicker
|
|
111
114
|
};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import t from "react";
|
|
2
2
|
import e from "prop-types";
|
|
3
|
-
const i = (r) => /* @__PURE__ */ t.createElement("div", {
|
|
4
|
-
...r
|
|
5
|
-
}), o = {
|
|
3
|
+
const i = (r) => /* @__PURE__ */ t.createElement("div", { ...r }), o = {
|
|
6
4
|
ariaLabel: void 0,
|
|
7
5
|
clearLabel: "clear",
|
|
8
6
|
disabled: !1,
|
package/dist/Dialog/Dialog.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const y=require("
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const y=require("react"),g=require("prop-types"),m=require("styled-components"),r=require("../Box/Box.cjs"),b=require("../DismissibleLayer/DismissibleLayer.cjs"),q=require("../Flex/Flex.cjs"),h=require("../FocusTrap/FocusTrap.cjs"),x=require("../helpers/setOpacity.cjs"),D=require("../hooks/useId.cjs"),T=require("../hooks/useLockScroll.cjs"),j=require("../Portal/Portal.cjs"),E=require("../Typography/Typography.cjs"),s=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},t=s(y),a=s(g),l=s(m),P=l.default(r.Box)`
|
|
2
2
|
inset: 0;
|
|
3
|
-
background: ${({theme:e})=>
|
|
4
|
-
`,_=
|
|
3
|
+
background: ${({theme:e})=>x.setOpacity(e.colors.neutral800,.2)};
|
|
4
|
+
`,_=l.default(r.Box)`
|
|
5
5
|
max-width: ${412/16}rem;
|
|
6
6
|
margin: 0 auto;
|
|
7
7
|
overflow: hidden;
|
|
8
8
|
margin-top: 10%;
|
|
9
|
-
`,F=
|
|
9
|
+
`,F=l.default(q.Flex)`
|
|
10
10
|
border-bottom: 1px solid ${({theme:e})=>e.colors.neutral150};
|
|
11
|
-
`,
|
|
11
|
+
`,o=({onClose:e,title:n,as:c,isOpen:i,id:d,...p})=>{const f=D.useId(d);if(T(i),!i)return null;const u=`${f}-label`;return t.default.createElement(j.Portal,null,t.default.createElement(P,{padding:8,position:"fixed",zIndex:4},t.default.createElement(h.FocusTrap,null,t.default.createElement(b.DismissibleLayer,{onEscapeKeyDown:e,onPointerDownOutside:e},t.default.createElement(_,{"aria-labelledby":u,"aria-modal":!0,background:"neutral0",hasRadius:!0,shadow:"popupShadow",role:"dialog"},t.default.createElement(F,{padding:6,justifyContent:"center"},t.default.createElement(E.Typography,{variant:"beta",as:c||"h2",id:u},n)),t.default.createElement(r.Box,{...p}))))))};o.displayName="Dialog";o.defaultProps={as:"h2",id:void 0};o.propTypes={as:a.default.string,id:a.default.oneOfType([a.default.string,a.default.number]),isOpen:a.default.bool.isRequired,onClose:a.default.func.isRequired,title:a.default.string.isRequired};exports.Dialog=o;
|
package/dist/Dialog/Dialog.js
CHANGED
|
@@ -1,54 +1,43 @@
|
|
|
1
|
-
import o from "prop-types";
|
|
2
1
|
import e from "react";
|
|
2
|
+
import o from "prop-types";
|
|
3
3
|
import t from "styled-components";
|
|
4
4
|
import { Box as a } from "../Box/Box.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import h from "../
|
|
12
|
-
import {
|
|
5
|
+
import { DismissibleLayer as c } from "../DismissibleLayer/DismissibleLayer.js";
|
|
6
|
+
import { Flex as f } from "../Flex/Flex.js";
|
|
7
|
+
import { FocusTrap as g } from "../FocusTrap/FocusTrap.js";
|
|
8
|
+
import { setOpacity as y } from "../helpers/setOpacity.js";
|
|
9
|
+
import { useId as b } from "../hooks/useId.js";
|
|
10
|
+
import E from "../hooks/useLockScroll.js";
|
|
11
|
+
import { Portal as h } from "../Portal/Portal.js";
|
|
12
|
+
import { Typography as D } from "../Typography/Typography.js";
|
|
13
13
|
const x = t(a)`
|
|
14
14
|
inset: 0;
|
|
15
|
-
background: ${({ theme: r }) =>
|
|
15
|
+
background: ${({ theme: r }) => y(r.colors.neutral800, 0.2)};
|
|
16
16
|
`, w = t(a)`
|
|
17
17
|
max-width: ${412 / 16}rem;
|
|
18
18
|
margin: 0 auto;
|
|
19
19
|
overflow: hidden;
|
|
20
20
|
margin-top: 10%;
|
|
21
|
-
`, R = t(
|
|
21
|
+
`, R = t(f)`
|
|
22
22
|
border-bottom: 1px solid ${({ theme: r }) => r.colors.neutral150};
|
|
23
23
|
`, i = ({ onClose: r, title: m, as: s, isOpen: n, id: d, ...p }) => {
|
|
24
|
-
const u =
|
|
25
|
-
if (
|
|
24
|
+
const u = b(d);
|
|
25
|
+
if (E(n), !n)
|
|
26
26
|
return null;
|
|
27
27
|
const l = `${u}-label`;
|
|
28
|
-
return /* @__PURE__ */ e.createElement(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
role: "dialog"
|
|
42
|
-
}, /* @__PURE__ */ e.createElement(R, {
|
|
43
|
-
padding: 6,
|
|
44
|
-
justifyContent: "center"
|
|
45
|
-
}, /* @__PURE__ */ e.createElement(y, {
|
|
46
|
-
variant: "beta",
|
|
47
|
-
as: s || "h2",
|
|
48
|
-
id: l
|
|
49
|
-
}, m)), /* @__PURE__ */ e.createElement(a, {
|
|
50
|
-
...p
|
|
51
|
-
}))))));
|
|
28
|
+
return /* @__PURE__ */ e.createElement(h, null, /* @__PURE__ */ e.createElement(x, { padding: 8, position: "fixed", zIndex: 4 }, /* @__PURE__ */ e.createElement(g, null, /* @__PURE__ */ e.createElement(c, { onEscapeKeyDown: r, onPointerDownOutside: r }, /* @__PURE__ */ e.createElement(
|
|
29
|
+
w,
|
|
30
|
+
{
|
|
31
|
+
"aria-labelledby": l,
|
|
32
|
+
"aria-modal": !0,
|
|
33
|
+
background: "neutral0",
|
|
34
|
+
hasRadius: !0,
|
|
35
|
+
shadow: "popupShadow",
|
|
36
|
+
role: "dialog"
|
|
37
|
+
},
|
|
38
|
+
/* @__PURE__ */ e.createElement(R, { padding: 6, justifyContent: "center" }, /* @__PURE__ */ e.createElement(D, { variant: "beta", as: s || "h2", id: l }, m)),
|
|
39
|
+
/* @__PURE__ */ e.createElement(a, { ...p })
|
|
40
|
+
)))));
|
|
52
41
|
};
|
|
53
42
|
i.displayName = "Dialog";
|
|
54
43
|
i.defaultProps = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react"),r=require("
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react"),r=require("prop-types"),c=require("styled-components"),l=require("../Box/Box.cjs"),i=require("../Flex/Flex.cjs"),d=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},o=d(s),n=d(r),u=d(c),p=u.default(l.Box)`
|
|
2
2
|
svg {
|
|
3
3
|
width: ${({theme:e})=>e.spaces[6]};
|
|
4
4
|
height: ${({theme:e})=>e.spaces[6]};
|