@strapi/design-system 1.3.0-beta.3 → 1.3.0
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/LICENSE +20 -0
- package/dist/Accordion/Accordion.cjs +23 -0
- package/dist/Accordion/Accordion.js +88 -0
- package/dist/Accordion/AccordionContent.cjs +1 -0
- package/dist/Accordion/AccordionContent.js +23 -0
- package/dist/Accordion/AccordionContext.cjs +1 -0
- package/dist/Accordion/AccordionContext.js +6 -0
- package/dist/Accordion/AccordionGroup.cjs +47 -0
- package/dist/Accordion/AccordionGroup.js +91 -0
- package/dist/Accordion/AccordionToggle.cjs +28 -0
- package/dist/Accordion/AccordionToggle.js +127 -0
- package/dist/Accordion/index.cjs +1 -0
- package/dist/Accordion/index.js +11 -0
- package/dist/Accordion/utils.cjs +1 -0
- package/dist/Accordion/utils.js +7 -0
- package/dist/Alert/Alert.cjs +35 -0
- package/dist/Alert/Alert.js +111 -0
- package/dist/Alert/index.cjs +1 -0
- package/dist/Alert/index.js +4 -0
- package/dist/Alert/utils.cjs +1 -0
- package/dist/Alert/utils.js +6 -0
- package/dist/Avatar/Avatar.cjs +29 -0
- package/dist/Avatar/Avatar.js +80 -0
- package/dist/Avatar/AvatarGroup.cjs +5 -0
- package/dist/Avatar/AvatarGroup.js +11 -0
- package/dist/Avatar/constants.cjs +1 -0
- package/dist/Avatar/constants.js +5 -0
- package/dist/Avatar/index.cjs +1 -0
- package/dist/Avatar/index.js +7 -0
- package/dist/Badge/Badge.cjs +1 -0
- package/dist/Badge/Badge.js +33 -0
- package/dist/Badge/index.cjs +1 -0
- package/dist/Badge/index.js +4 -0
- package/dist/BaseButton/BaseButton.cjs +23 -0
- package/dist/BaseButton/BaseButton.js +45 -0
- package/dist/BaseButton/index.cjs +1 -0
- package/dist/BaseButton/index.js +5 -0
- package/dist/BaseCheckbox/BaseCheckbox.cjs +62 -0
- package/dist/BaseCheckbox/BaseCheckbox.js +105 -0
- package/dist/BaseCheckbox/assets/checkmark-black.cjs +1 -0
- package/dist/BaseCheckbox/assets/checkmark-black.js +4 -0
- package/dist/BaseCheckbox/assets/checkmark.cjs +1 -0
- package/dist/BaseCheckbox/assets/checkmark.js +4 -0
- package/dist/BaseCheckbox/index.cjs +1 -0
- package/dist/BaseCheckbox/index.js +4 -0
- package/dist/BaseCheckbox/utils.cjs +1 -0
- package/dist/BaseCheckbox/utils.js +4 -0
- package/dist/BaseLink/BaseLink.cjs +3 -0
- package/dist/BaseLink/BaseLink.js +31 -0
- package/dist/BaseLink/index.cjs +1 -0
- package/dist/BaseLink/index.js +4 -0
- package/dist/BaseRadio/BaseRadio.cjs +31 -0
- package/dist/BaseRadio/BaseRadio.js +62 -0
- package/dist/BaseRadio/RadioGroup.cjs +1 -0
- package/dist/BaseRadio/RadioGroup.js +32 -0
- package/dist/BaseRadio/context.cjs +1 -0
- package/dist/BaseRadio/context.js +6 -0
- package/dist/BaseRadio/index.cjs +1 -0
- package/dist/BaseRadio/index.js +6 -0
- package/dist/BaseRadio/utils.cjs +1 -0
- package/dist/BaseRadio/utils.js +6 -0
- package/dist/Box/Box.cjs +80 -0
- package/dist/Box/Box.js +95 -0
- package/dist/Box/BoxProps.cjs +1 -0
- package/dist/Box/BoxProps.js +51 -0
- package/dist/Box/index.cjs +1 -0
- package/dist/Box/index.js +4 -0
- package/dist/Breadcrumbs/Breadcrumbs.cjs +16 -0
- package/dist/Breadcrumbs/Breadcrumbs.js +52 -0
- package/dist/Breadcrumbs/index.cjs +1 -0
- package/dist/Breadcrumbs/index.js +5 -0
- package/dist/Button/Button.cjs +48 -0
- package/dist/Button/Button.js +109 -0
- package/dist/Button/constants.cjs +1 -0
- package/dist/Button/constants.js +14 -0
- package/dist/Button/index.cjs +1 -0
- package/dist/Button/index.js +5 -0
- package/dist/Button/utils.cjs +87 -0
- package/dist/Button/utils.js +112 -0
- package/dist/Card/Card.cjs +1 -0
- package/dist/Card/Card.js +32 -0
- package/dist/Card/CardAction.cjs +6 -0
- package/dist/Card/CardAction.js +14 -0
- package/dist/Card/CardAsset.cjs +19 -0
- package/dist/Card/CardAsset.js +42 -0
- package/dist/Card/CardBadge.cjs +6 -0
- package/dist/Card/CardBadge.js +14 -0
- package/dist/Card/CardBody.cjs +1 -0
- package/dist/Card/CardBody.js +15 -0
- package/dist/Card/CardCheckbox.cjs +1 -0
- package/dist/Card/CardCheckbox.js +16 -0
- package/dist/Card/CardContent.cjs +3 -0
- package/dist/Card/CardContent.js +15 -0
- package/dist/Card/CardContext.cjs +1 -0
- package/dist/Card/CardContext.js +6 -0
- package/dist/Card/CardHeader.cjs +4 -0
- package/dist/Card/CardHeader.js +13 -0
- package/dist/Card/CardTimer.cjs +5 -0
- package/dist/Card/CardTimer.js +26 -0
- package/dist/Card/CardTitle.cjs +1 -0
- package/dist/Card/CardTitle.js +23 -0
- package/dist/Card/index.cjs +1 -0
- package/dist/Card/index.js +23 -0
- package/dist/CarouselInput/Carousel.cjs +14 -0
- package/dist/CarouselInput/Carousel.js +131 -0
- package/dist/CarouselInput/CarouselActions.cjs +1 -0
- package/dist/CarouselInput/CarouselActions.js +14 -0
- package/dist/CarouselInput/CarouselImage.cjs +4 -0
- package/dist/CarouselInput/CarouselImage.js +35 -0
- package/dist/CarouselInput/CarouselInput.cjs +1 -0
- package/dist/CarouselInput/CarouselInput.js +79 -0
- package/dist/CarouselInput/CarouselSlide.cjs +3 -0
- package/dist/CarouselInput/CarouselSlide.js +26 -0
- package/dist/CarouselInput/index.cjs +1 -0
- package/dist/CarouselInput/index.js +12 -0
- package/dist/Checkbox/Checkbox.cjs +7 -0
- package/dist/Checkbox/Checkbox.js +64 -0
- package/dist/Checkbox/index.cjs +1 -0
- package/dist/Checkbox/index.js +4 -0
- package/dist/Combobox/Combobox.cjs +1 -0
- package/dist/Combobox/Combobox.js +285 -0
- package/dist/Combobox/ComboboxList.cjs +1 -0
- package/dist/Combobox/ComboboxList.js +15 -0
- package/dist/Combobox/ComboboxOption.cjs +1 -0
- package/dist/Combobox/ComboboxOption.js +30 -0
- package/dist/Combobox/components.cjs +53 -0
- package/dist/Combobox/components.js +64 -0
- package/dist/Combobox/index.cjs +1 -0
- package/dist/Combobox/index.js +7 -0
- package/dist/Combobox/utils.cjs +1 -0
- package/dist/Combobox/utils.js +78 -0
- package/dist/DatePicker/DatePicker.cjs +1 -0
- package/dist/DatePicker/DatePicker.js +104 -0
- package/dist/DatePicker/DatePickerCalendar.cjs +1 -0
- package/dist/DatePicker/DatePickerCalendar.js +102 -0
- package/dist/DatePicker/DatePickerTd.cjs +19 -0
- package/dist/DatePicker/DatePickerTd.js +55 -0
- package/dist/DatePicker/DatePickerTh.cjs +9 -0
- package/dist/DatePicker/DatePickerTh.js +35 -0
- package/dist/DatePicker/compareDates.cjs +1 -0
- package/dist/DatePicker/compareDates.js +4 -0
- package/dist/DatePicker/components.cjs +31 -0
- package/dist/DatePicker/components.js +41 -0
- package/dist/DatePicker/index.cjs +1 -0
- package/dist/DatePicker/index.js +4 -0
- package/dist/DatePicker/utils/formatDate.cjs +1 -0
- package/dist/DatePicker/utils/formatDate.js +4 -0
- package/dist/DatePicker/utils/generateWeeks.cjs +1 -0
- package/dist/DatePicker/utils/generateWeeks.js +17 -0
- package/dist/DatePicker/utils/getDayOfWeek.cjs +1 -0
- package/dist/DatePicker/utils/getDayOfWeek.js +15 -0
- package/dist/DatePicker/utils/getMonths.cjs +1 -0
- package/dist/DatePicker/utils/getMonths.js +7 -0
- package/dist/DatePicker/utils/getYears.cjs +1 -0
- package/dist/DatePicker/utils/getYears.js +9 -0
- package/dist/DatePicker/utils/index.cjs +1 -0
- package/dist/DatePicker/utils/index.js +12 -0
- package/dist/Dialog/Dialog.cjs +14 -0
- package/dist/Dialog/Dialog.js +66 -0
- package/dist/Dialog/DialogBody.cjs +10 -0
- package/dist/Dialog/DialogBody.js +32 -0
- package/dist/Dialog/DialogFooter.cjs +9 -0
- package/dist/Dialog/DialogFooter.js +31 -0
- package/dist/Dialog/index.cjs +1 -0
- package/dist/Dialog/index.js +8 -0
- package/dist/DismissibleLayer/DismissibleLayer.cjs +1 -0
- package/dist/DismissibleLayer/DismissibleLayer.js +38 -0
- package/dist/DismissibleLayer/index.cjs +1 -0
- package/dist/DismissibleLayer/index.js +4 -0
- package/dist/Divider/Divider.cjs +5 -0
- package/dist/Divider/Divider.js +24 -0
- package/dist/Divider/index.cjs +1 -0
- package/dist/Divider/index.js +4 -0
- package/dist/EmptyStateLayout/EmptyStateLayout.cjs +10 -0
- package/dist/EmptyStateLayout/EmptyStateLayout.js +44 -0
- package/dist/EmptyStateLayout/index.cjs +1 -0
- package/dist/EmptyStateLayout/index.js +4 -0
- package/dist/EmptyStateLayout/story-assets/Illo.cjs +1 -0
- package/dist/EmptyStateLayout/story-assets/Illo.js +49 -0
- package/dist/Field/Field.cjs +1 -0
- package/dist/Field/Field.js +28 -0
- package/dist/Field/FieldAction.cjs +10 -0
- package/dist/Field/FieldAction.js +24 -0
- package/dist/Field/FieldContext.cjs +1 -0
- package/dist/Field/FieldContext.js +6 -0
- package/dist/Field/FieldError.cjs +1 -0
- package/dist/Field/FieldError.js +16 -0
- package/dist/Field/FieldHint.cjs +1 -0
- package/dist/Field/FieldHint.js +15 -0
- package/dist/Field/FieldInput.cjs +43 -0
- package/dist/Field/FieldInput.js +105 -0
- package/dist/Field/FieldLabel.cjs +9 -0
- package/dist/Field/FieldLabel.js +44 -0
- package/dist/Field/index.cjs +1 -0
- package/dist/Field/index.js +18 -0
- package/dist/Flex/Flex.cjs +9 -0
- package/dist/Flex/Flex.js +22 -0
- package/dist/Flex/FlexProps.cjs +1 -0
- package/dist/Flex/FlexProps.js +40 -0
- package/dist/Flex/index.cjs +1 -0
- package/dist/Flex/index.js +4 -0
- package/dist/FocusTrap/ExampleComponent.cjs +1 -0
- package/dist/FocusTrap/ExampleComponent.js +70 -0
- package/dist/FocusTrap/FocusTrap.cjs +1 -0
- package/dist/FocusTrap/FocusTrap.js +48 -0
- package/dist/FocusTrap/index.cjs +1 -0
- package/dist/FocusTrap/index.js +4 -0
- package/dist/Grid/Grid.cjs +5 -0
- package/dist/Grid/Grid.js +28 -0
- package/dist/Grid/GridContext.cjs +1 -0
- package/dist/Grid/GridContext.js +6 -0
- package/dist/Grid/GridItem.cjs +12 -0
- package/dist/Grid/GridItem.js +41 -0
- package/dist/Grid/index.cjs +1 -0
- package/dist/Grid/index.js +6 -0
- package/dist/Icon/Icon.cjs +6 -0
- package/dist/Icon/Icon.js +26 -0
- package/dist/Icon/index.cjs +1 -0
- package/dist/Icon/index.js +4 -0
- package/dist/IconButton/IconButton.cjs +86 -0
- package/dist/IconButton/IconButton.js +149 -0
- package/dist/IconButton/index.cjs +1 -0
- package/dist/IconButton/index.js +5 -0
- package/dist/KeyboardNavigable/KeyboardNavigable.cjs +1 -0
- package/dist/KeyboardNavigable/KeyboardNavigable.js +58 -0
- package/dist/KeyboardNavigable/index.cjs +1 -0
- package/dist/KeyboardNavigable/index.js +4 -0
- package/dist/Layout/ActionLayout.cjs +9 -0
- package/dist/Layout/ActionLayout.js +37 -0
- package/dist/Layout/ContentLayout.cjs +1 -0
- package/dist/Layout/ContentLayout.js +13 -0
- package/dist/Layout/GridLayout.cjs +5 -0
- package/dist/Layout/GridLayout.js +13 -0
- package/dist/Layout/HeaderLayout.cjs +8 -0
- package/dist/Layout/HeaderLayout.js +132 -0
- package/dist/Layout/Layout.cjs +6 -0
- package/dist/Layout/Layout.js +24 -0
- package/dist/Layout/TwoColsLayout.cjs +1 -0
- package/dist/Layout/TwoColsLayout.js +29 -0
- package/dist/Layout/index.cjs +1 -0
- package/dist/Layout/index.js +15 -0
- package/dist/Link/Link.cjs +33 -0
- package/dist/Link/Link.js +87 -0
- package/dist/Link/index.cjs +1 -0
- package/dist/Link/index.js +4 -0
- package/dist/LinkButton/LinkButton.cjs +32 -0
- package/dist/LinkButton/LinkButton.js +99 -0
- package/dist/LinkButton/index.cjs +1 -0
- package/dist/LinkButton/index.js +4 -0
- package/dist/LiveRegions/LiveRegions.cjs +1 -0
- package/dist/LiveRegions/LiveRegions.js +22 -0
- package/dist/LiveRegions/StoryComponent.cjs +1 -0
- package/dist/LiveRegions/StoryComponent.js +18 -0
- package/dist/LiveRegions/constants.cjs +1 -0
- package/dist/LiveRegions/constants.js +8 -0
- package/dist/LiveRegions/index.cjs +1 -0
- package/dist/LiveRegions/index.js +4 -0
- package/dist/LiveRegions/useNotifyAT.cjs +1 -0
- package/dist/LiveRegions/useNotifyAT.js +17 -0
- package/dist/Loader/Loader.cjs +12 -0
- package/dist/Loader/Loader.js +37 -0
- package/dist/Loader/assets/loader.cjs +1 -0
- package/dist/Loader/assets/loader.js +4 -0
- package/dist/Loader/index.cjs +1 -0
- package/dist/Loader/index.js +4 -0
- package/dist/Main/Main.cjs +6 -0
- package/dist/Main/Main.js +26 -0
- package/dist/Main/SkipToContent.cjs +12 -0
- package/dist/Main/SkipToContent.js +29 -0
- package/dist/Main/index.cjs +1 -0
- package/dist/Main/index.js +6 -0
- package/dist/MainNav/MainNav.cjs +9 -0
- package/dist/MainNav/MainNav.js +30 -0
- package/dist/MainNav/MainNavContext.cjs +1 -0
- package/dist/MainNav/MainNavContext.js +6 -0
- package/dist/MainNav/NavBrand.cjs +12 -0
- package/dist/MainNav/NavBrand.js +67 -0
- package/dist/MainNav/NavCondense.cjs +20 -0
- package/dist/MainNav/NavCondense.js +45 -0
- package/dist/MainNav/NavLink.cjs +69 -0
- package/dist/MainNav/NavLink.js +119 -0
- package/dist/MainNav/NavSection.cjs +1 -0
- package/dist/MainNav/NavSection.js +49 -0
- package/dist/MainNav/NavSections.cjs +1 -0
- package/dist/MainNav/NavSections.js +21 -0
- package/dist/MainNav/NavUser.cjs +7 -0
- package/dist/MainNav/NavUser.js +54 -0
- package/dist/MainNav/index.cjs +1 -0
- package/dist/MainNav/index.js +16 -0
- package/dist/ModalLayout/ModalBody.cjs +4 -0
- package/dist/ModalLayout/ModalBody.js +13 -0
- package/dist/ModalLayout/ModalContext.cjs +1 -0
- package/dist/ModalLayout/ModalContext.js +6 -0
- package/dist/ModalLayout/ModalFooter.cjs +8 -0
- package/dist/ModalLayout/ModalFooter.js +32 -0
- package/dist/ModalLayout/ModalHeader.cjs +4 -0
- package/dist/ModalLayout/ModalHeader.js +37 -0
- package/dist/ModalLayout/ModalLayout.cjs +12 -0
- package/dist/ModalLayout/ModalLayout.js +42 -0
- package/dist/ModalLayout/index.cjs +1 -0
- package/dist/ModalLayout/index.js +10 -0
- package/dist/NumberInput/NumberInput.cjs +12 -0
- package/dist/NumberInput/NumberInput.js +179 -0
- package/dist/NumberInput/index.cjs +1 -0
- package/dist/NumberInput/index.js +4 -0
- package/dist/Pagination/Pagination.cjs +5 -0
- package/dist/Pagination/Pagination.js +30 -0
- package/dist/Pagination/PaginationContext.cjs +1 -0
- package/dist/Pagination/PaginationContext.js +6 -0
- package/dist/Pagination/assets/next.cjs +1 -0
- package/dist/Pagination/assets/next.js +4 -0
- package/dist/Pagination/assets/previous.cjs +1 -0
- package/dist/Pagination/assets/previous.js +4 -0
- package/dist/Pagination/components.cjs +36 -0
- package/dist/Pagination/components.js +111 -0
- package/dist/Pagination/index.cjs +1 -0
- package/dist/Pagination/index.js +9 -0
- package/dist/Popover/Popover.cjs +26 -0
- package/dist/Popover/Popover.js +122 -0
- package/dist/Popover/index.cjs +1 -0
- package/dist/Popover/index.js +5 -0
- package/dist/Portal/Portal.cjs +1 -0
- package/dist/Portal/Portal.js +15 -0
- package/dist/Portal/index.cjs +1 -0
- package/dist/Portal/index.js +4 -0
- package/dist/ProgressBar/ProgressBar.cjs +11 -0
- package/dist/ProgressBar/ProgressBar.js +44 -0
- package/dist/ProgressBar/index.cjs +1 -0
- package/dist/ProgressBar/index.js +4 -0
- package/dist/Radio/Radio.cjs +4 -0
- package/dist/Radio/Radio.js +24 -0
- package/dist/Radio/index.cjs +1 -0
- package/dist/Radio/index.js +6 -0
- package/dist/RawTable/RawCell.cjs +1 -0
- package/dist/RawTable/RawCell.js +80 -0
- package/dist/RawTable/RawTable.cjs +1 -0
- package/dist/RawTable/RawTable.js +73 -0
- package/dist/RawTable/RawTableContext.cjs +1 -0
- package/dist/RawTable/RawTableContext.js +12 -0
- package/dist/RawTable/RawTbody.cjs +1 -0
- package/dist/RawTable/RawTbody.js +16 -0
- package/dist/RawTable/RawThead.cjs +1 -0
- package/dist/RawTable/RawThead.js +14 -0
- package/dist/RawTable/RawTr.cjs +1 -0
- package/dist/RawTable/RawTr.js +19 -0
- package/dist/RawTable/focusFocusable.cjs +1 -0
- package/dist/RawTable/focusFocusable.js +7 -0
- package/dist/RawTable/index.cjs +1 -0
- package/dist/RawTable/index.js +13 -0
- package/dist/Searchbar/SearchForm.cjs +1 -0
- package/dist/Searchbar/SearchForm.js +8 -0
- package/dist/Searchbar/Searchbar.cjs +29 -0
- package/dist/Searchbar/Searchbar.js +79 -0
- package/dist/Searchbar/index.cjs +1 -0
- package/dist/Searchbar/index.js +6 -0
- package/dist/Select/MultiSelectNested.cjs +1 -0
- package/dist/Select/MultiSelectNested.js +26 -0
- package/dist/Select/OptGroup.cjs +1 -0
- package/dist/Select/OptGroup.js +20 -0
- package/dist/Select/Option.cjs +49 -0
- package/dist/Select/Option.js +104 -0
- package/dist/Select/Select.cjs +3 -0
- package/dist/Select/Select.js +227 -0
- package/dist/Select/SelectButton.cjs +19 -0
- package/dist/Select/SelectButton.js +64 -0
- package/dist/Select/SelectList.cjs +1 -0
- package/dist/Select/SelectList.js +81 -0
- package/dist/Select/SelectTags.cjs +8 -0
- package/dist/Select/SelectTags.js +36 -0
- package/dist/Select/components.cjs +39 -0
- package/dist/Select/components.js +48 -0
- package/dist/Select/constants.cjs +1 -0
- package/dist/Select/constants.js +8 -0
- package/dist/Select/hooks/useButtonRef.cjs +1 -0
- package/dist/Select/hooks/useButtonRef.js +13 -0
- package/dist/Select/hooks/useListRef.cjs +1 -0
- package/dist/Select/hooks/useListRef.js +18 -0
- package/dist/Select/index.cjs +1 -0
- package/dist/Select/index.js +12 -0
- package/dist/Select/utils.cjs +1 -0
- package/dist/Select/utils.js +17 -0
- package/dist/SimpleMenu/SimpleMenu.cjs +19 -0
- package/dist/SimpleMenu/SimpleMenu.js +164 -0
- package/dist/SimpleMenu/index.cjs +1 -0
- package/dist/SimpleMenu/index.js +5 -0
- package/dist/SimpleMenu/utils.cjs +12 -0
- package/dist/SimpleMenu/utils.js +15 -0
- package/dist/Stack/Stack.cjs +19 -0
- package/dist/Stack/Stack.js +55 -0
- package/dist/Stack/index.cjs +1 -0
- package/dist/Stack/index.js +4 -0
- package/dist/Status/Status.cjs +11 -0
- package/dist/Status/Status.js +46 -0
- package/dist/Status/index.cjs +1 -0
- package/dist/Status/index.js +4 -0
- package/dist/SubNav/SubNav.cjs +10 -0
- package/dist/SubNav/SubNav.js +26 -0
- package/dist/SubNav/SubNavHeader.cjs +4 -0
- package/dist/SubNav/SubNavHeader.js +98 -0
- package/dist/SubNav/SubNavLink.cjs +39 -0
- package/dist/SubNav/SubNavLink.js +80 -0
- package/dist/SubNav/SubNavLinkSection.cjs +19 -0
- package/dist/SubNav/SubNavLinkSection.js +68 -0
- package/dist/SubNav/SubNavSection.cjs +8 -0
- package/dist/SubNav/SubNavSection.js +63 -0
- package/dist/SubNav/SubNavSectionLabel.cjs +9 -0
- package/dist/SubNav/SubNavSectionLabel.js +53 -0
- package/dist/SubNav/SubNavSections.cjs +1 -0
- package/dist/SubNav/SubNavSections.js +20 -0
- package/dist/SubNav/index.cjs +1 -0
- package/dist/SubNav/index.js +15 -0
- package/dist/Switch/Switch.cjs +42 -0
- package/dist/Switch/Switch.js +80 -0
- package/dist/Switch/index.cjs +1 -0
- package/dist/Switch/index.js +4 -0
- package/dist/Table/Cell.cjs +17 -0
- package/dist/Table/Cell.js +39 -0
- package/dist/Table/TFooter.cjs +22 -0
- package/dist/Table/TFooter.js +50 -0
- package/dist/Table/Table.cjs +36 -0
- package/dist/Table/Table.js +80 -0
- package/dist/Table/Tbody.cjs +5 -0
- package/dist/Table/Tbody.js +13 -0
- package/dist/Table/Thead.cjs +3 -0
- package/dist/Table/Thead.js +11 -0
- package/dist/Table/Tr.cjs +20 -0
- package/dist/Table/Tr.js +28 -0
- package/dist/Table/index.cjs +1 -0
- package/dist/Table/index.js +15 -0
- package/dist/Tabs/TabGroup.cjs +1 -0
- package/dist/Tabs/TabGroup.js +36 -0
- package/dist/Tabs/TabPanels.cjs +1 -0
- package/dist/Tabs/TabPanels.js +32 -0
- package/dist/Tabs/Tabs.cjs +5 -0
- package/dist/Tabs/Tabs.js +134 -0
- package/dist/Tabs/TabsContext.cjs +1 -0
- package/dist/Tabs/TabsContext.js +6 -0
- package/dist/Tabs/components.cjs +43 -0
- package/dist/Tabs/components.js +52 -0
- package/dist/Tabs/index.cjs +1 -0
- package/dist/Tabs/index.js +10 -0
- package/dist/Tabs/useTabsFocus.cjs +1 -0
- package/dist/Tabs/useTabsFocus.js +16 -0
- package/dist/Tag/Tag.cjs +14 -0
- package/dist/Tag/Tag.js +60 -0
- package/dist/Tag/index.cjs +1 -0
- package/dist/Tag/index.js +4 -0
- package/dist/TextButton/TextButton.cjs +32 -0
- package/dist/TextButton/TextButton.js +82 -0
- package/dist/TextButton/index.cjs +1 -0
- package/dist/TextButton/index.js +4 -0
- package/dist/TextInput/TextInput.cjs +1 -0
- package/dist/TextInput/TextInput.js +69 -0
- package/dist/TextInput/index.cjs +1 -0
- package/dist/TextInput/index.js +4 -0
- package/dist/Textarea/Textarea.cjs +15 -0
- package/dist/Textarea/Textarea.js +74 -0
- package/dist/Textarea/TextareaInput.cjs +30 -0
- package/dist/Textarea/TextareaInput.js +68 -0
- package/dist/Textarea/index.cjs +1 -0
- package/dist/Textarea/index.js +4 -0
- package/dist/ThemeProvider/ThemeProvider.cjs +173 -0
- package/dist/ThemeProvider/ThemeProvider.js +186 -0
- package/dist/ThemeProvider/hooks.cjs +1 -0
- package/dist/ThemeProvider/hooks.js +5 -0
- package/dist/ThemeProvider/index.cjs +1 -0
- package/dist/ThemeProvider/index.js +6 -0
- package/dist/TimePicker/TimePicker.cjs +12 -0
- package/dist/TimePicker/TimePicker.js +101 -0
- package/dist/TimePicker/index.cjs +1 -0
- package/dist/TimePicker/index.js +4 -0
- package/dist/ToggleCheckbox/ToggleCheckbox.cjs +36 -0
- package/dist/ToggleCheckbox/ToggleCheckbox.js +119 -0
- package/dist/ToggleCheckbox/index.cjs +1 -0
- package/dist/ToggleCheckbox/index.js +4 -0
- package/dist/ToggleInput/ToggleInput.cjs +6 -0
- package/dist/ToggleInput/ToggleInput.js +90 -0
- package/dist/ToggleInput/index.cjs +1 -0
- package/dist/ToggleInput/index.js +4 -0
- package/dist/Tooltip/Tooltip.cjs +6 -0
- package/dist/Tooltip/Tooltip.js +60 -0
- package/dist/Tooltip/hooks/useTooltipHandlers.cjs +1 -0
- package/dist/Tooltip/hooks/useTooltipHandlers.js +22 -0
- package/dist/Tooltip/hooks/useTooltipLayout.cjs +1 -0
- package/dist/Tooltip/hooks/useTooltipLayout.js +14 -0
- package/dist/Tooltip/index.cjs +1 -0
- package/dist/Tooltip/index.js +4 -0
- package/dist/Tooltip/utils/positionTooltip.cjs +1 -0
- package/dist/Tooltip/utils/positionTooltip.js +27 -0
- package/dist/Typography/Typography.cjs +13 -0
- package/dist/Typography/Typography.js +26 -0
- package/dist/Typography/TypographyProps.cjs +1 -0
- package/dist/Typography/TypographyProps.js +31 -0
- package/dist/Typography/constants.cjs +1 -0
- package/dist/Typography/constants.js +11 -0
- package/dist/Typography/index.cjs +1 -0
- package/dist/Typography/index.js +4 -0
- package/dist/Typography/utils.cjs +34 -0
- package/dist/Typography/utils.js +59 -0
- package/dist/VisuallyHidden/VisuallyHidden.cjs +10 -0
- package/dist/VisuallyHidden/VisuallyHidden.js +14 -0
- package/dist/VisuallyHidden/index.cjs +1 -0
- package/dist/VisuallyHidden/index.js +4 -0
- package/dist/helpers/escapeSelector.cjs +1 -0
- package/dist/helpers/escapeSelector.js +4 -0
- package/dist/helpers/genId.cjs +1 -0
- package/dist/helpers/genId.js +5 -0
- package/dist/helpers/getDefaultLocale.cjs +1 -0
- package/dist/helpers/getDefaultLocale.js +4 -0
- package/dist/helpers/getFocusableNodes.cjs +1 -0
- package/dist/helpers/getFocusableNodes.js +7 -0
- package/dist/helpers/handleResponsiveValues.cjs +5 -0
- package/dist/helpers/handleResponsiveValues.js +19 -0
- package/dist/helpers/keyboardKeys.cjs +1 -0
- package/dist/helpers/keyboardKeys.js +20 -0
- package/dist/helpers/setOpacity.cjs +1 -0
- package/dist/helpers/setOpacity.js +4 -0
- package/dist/helpers/setTabIndexOnFirstItem.cjs +1 -0
- package/dist/helpers/setTabIndexOnFirstItem.js +7 -0
- package/dist/helpers/useElementOnScreen.cjs +1 -0
- package/dist/helpers/useElementOnScreen.js +15 -0
- package/dist/helpers/useId.cjs +1 -0
- package/dist/helpers/useId.js +6 -0
- package/dist/helpers/useIntersection.cjs +1 -0
- package/dist/helpers/useIntersection.js +21 -0
- package/dist/helpers/useLockScroll.cjs +1 -0
- package/dist/helpers/useLockScroll.js +9 -0
- package/dist/helpers/usePrevious.cjs +1 -0
- package/dist/helpers/usePrevious.js +10 -0
- package/dist/helpers/useResizeObserver.cjs +1 -0
- package/dist/helpers/useResizeObserver.js +14 -0
- package/dist/index.cjs +1 -0
- package/dist/index.js +288 -0
- package/dist/themes/ColorButton.cjs +3 -0
- package/dist/themes/ColorButton.js +25 -0
- package/dist/themes/colors.cjs +1 -0
- package/dist/themes/colors.js +49 -0
- package/dist/themes/common-theme.cjs +1 -0
- package/dist/themes/common-theme.js +21 -0
- package/dist/themes/darkTheme/dark-colors.cjs +1 -0
- package/dist/themes/darkTheme/dark-colors.js +52 -0
- package/dist/themes/darkTheme/dark-shadows.cjs +1 -0
- package/dist/themes/darkTheme/dark-shadows.js +12 -0
- package/dist/themes/darkTheme/index.cjs +1 -0
- package/dist/themes/darkTheme/index.js +11 -0
- package/dist/themes/extendTheme.cjs +13 -0
- package/dist/themes/extendTheme.js +36 -0
- package/dist/themes/index.cjs +1 -0
- package/dist/themes/index.js +12 -0
- package/dist/themes/lightTheme/index.cjs +1 -0
- package/dist/themes/lightTheme/index.js +11 -0
- package/dist/themes/lightTheme/light-colors.cjs +1 -0
- package/dist/themes/lightTheme/light-colors.js +52 -0
- package/dist/themes/lightTheme/light-shadows.cjs +1 -0
- package/dist/themes/lightTheme/light-shadows.js +12 -0
- package/dist/themes/sizes.cjs +1 -0
- package/dist/themes/sizes.js +18 -0
- package/dist/themes/utils.cjs +41 -0
- package/dist/themes/utils.js +46 -0
- package/dist/v2/Breadcrumbs/Breadcrumbs.cjs +9 -0
- package/dist/v2/Breadcrumbs/Breadcrumbs.js +38 -0
- package/dist/v2/Breadcrumbs/Crumb.cjs +1 -0
- package/dist/v2/Breadcrumbs/Crumb.js +27 -0
- package/dist/v2/Breadcrumbs/CrumbLink.cjs +14 -0
- package/dist/v2/Breadcrumbs/CrumbLink.js +31 -0
- package/dist/v2/Breadcrumbs/CrumbSimpleMenu.cjs +8 -0
- package/dist/v2/Breadcrumbs/CrumbSimpleMenu.js +28 -0
- package/dist/v2/Breadcrumbs/Divider.cjs +1 -0
- package/dist/v2/Breadcrumbs/Divider.js +15 -0
- package/dist/v2/Breadcrumbs/index.cjs +1 -0
- package/dist/v2/Breadcrumbs/index.js +10 -0
- package/dist/v2/Link/Link.cjs +23 -0
- package/dist/v2/Link/Link.js +69 -0
- package/dist/v2/Link/index.cjs +1 -0
- package/dist/v2/Link/index.js +4 -0
- package/dist/v2/LinkButton/LinkButton.cjs +33 -0
- package/dist/v2/LinkButton/LinkButton.js +95 -0
- package/dist/v2/LinkButton/index.cjs +1 -0
- package/dist/v2/LinkButton/index.js +4 -0
- package/dist/v2/MainNav/MainNav.cjs +9 -0
- package/dist/v2/MainNav/MainNav.js +30 -0
- package/dist/v2/MainNav/MainNavContext.cjs +1 -0
- package/dist/v2/MainNav/MainNavContext.js +6 -0
- package/dist/v2/MainNav/NavBrand.cjs +12 -0
- package/dist/v2/MainNav/NavBrand.js +68 -0
- package/dist/v2/MainNav/NavCondense.cjs +20 -0
- package/dist/v2/MainNav/NavCondense.js +45 -0
- package/dist/v2/MainNav/NavLink.cjs +69 -0
- package/dist/v2/MainNav/NavLink.js +122 -0
- package/dist/v2/MainNav/NavSection.cjs +1 -0
- package/dist/v2/MainNav/NavSection.js +49 -0
- package/dist/v2/MainNav/NavSections.cjs +1 -0
- package/dist/v2/MainNav/NavSections.js +21 -0
- package/dist/v2/MainNav/NavUser.cjs +7 -0
- package/dist/v2/MainNav/NavUser.js +54 -0
- package/dist/v2/MainNav/index.cjs +1 -0
- package/dist/v2/MainNav/index.js +16 -0
- package/dist/v2/Pagination/Pagination.cjs +5 -0
- package/dist/v2/Pagination/Pagination.js +30 -0
- package/dist/v2/Pagination/PaginationContext.cjs +1 -0
- package/dist/v2/Pagination/PaginationContext.js +6 -0
- package/dist/v2/Pagination/assets/next.cjs +1 -0
- package/dist/v2/Pagination/assets/next.js +4 -0
- package/dist/v2/Pagination/assets/previous.cjs +1 -0
- package/dist/v2/Pagination/assets/previous.js +4 -0
- package/dist/v2/Pagination/components.cjs +36 -0
- package/dist/v2/Pagination/components.js +111 -0
- package/dist/v2/Pagination/index.cjs +1 -0
- package/dist/v2/Pagination/index.js +9 -0
- package/dist/v2/SimpleMenu/SimpleMenu.cjs +19 -0
- package/dist/v2/SimpleMenu/SimpleMenu.js +164 -0
- package/dist/v2/SimpleMenu/index.cjs +1 -0
- package/dist/v2/SimpleMenu/index.js +5 -0
- package/dist/v2/SimpleMenu/utils.cjs +12 -0
- package/dist/v2/SimpleMenu/utils.js +15 -0
- package/dist/v2/SubNav/SubNav.cjs +10 -0
- package/dist/v2/SubNav/SubNav.js +26 -0
- package/dist/v2/SubNav/SubNavHeader.cjs +4 -0
- package/dist/v2/SubNav/SubNavHeader.js +98 -0
- package/dist/v2/SubNav/SubNavLink.cjs +39 -0
- package/dist/v2/SubNav/SubNavLink.js +83 -0
- package/dist/v2/SubNav/SubNavLinkSection.cjs +19 -0
- package/dist/v2/SubNav/SubNavLinkSection.js +68 -0
- package/dist/v2/SubNav/SubNavSection.cjs +8 -0
- package/dist/v2/SubNav/SubNavSection.js +63 -0
- package/dist/v2/SubNav/SubNavSectionLabel.cjs +9 -0
- package/dist/v2/SubNav/SubNavSectionLabel.js +53 -0
- package/dist/v2/SubNav/SubNavSections.cjs +1 -0
- package/dist/v2/SubNav/SubNavSections.js +20 -0
- package/dist/v2/SubNav/index.cjs +1 -0
- package/dist/v2/SubNav/index.js +15 -0
- package/dist/v2/index.cjs +1 -0
- package/dist/v2/index.js +51 -0
- package/package.json +23 -22
- package/Accordion.development.js +0 -775
- package/Accordion.js +0 -9
- package/Accordion.production.js +0 -1
- package/Alert.development.js +0 -562
- package/Alert.js +0 -9
- package/Alert.production.js +0 -1
- package/Avatar.development.js +0 -485
- package/Avatar.js +0 -9
- package/Avatar.production.js +0 -1
- package/Badge.development.js +0 -494
- package/Badge.js +0 -9
- package/Badge.production.js +0 -1
- package/BaseButton.development.js +0 -285
- package/BaseButton.js +0 -9
- package/BaseButton.production.js +0 -1
- package/BaseCheckbox.development.js +0 -434
- package/BaseCheckbox.js +0 -9
- package/BaseCheckbox.production.js +0 -1
- package/BaseLink.development.js +0 -273
- package/BaseLink.js +0 -9
- package/BaseLink.production.js +0 -1
- package/BaseRadio.development.js +0 -321
- package/BaseRadio.js +0 -9
- package/BaseRadio.production.js +0 -1
- package/Box.development.js +0 -341
- package/Box.js +0 -9
- package/Box.production.js +0 -1
- package/Breadcrumbs.development.js +0 -518
- package/Breadcrumbs.js +0 -9
- package/Breadcrumbs.production.js +0 -1
- package/Button.development.js +0 -573
- package/Button.js +0 -9
- package/Button.production.js +0 -1
- package/Card.development.js +0 -746
- package/Card.js +0 -9
- package/Card.production.js +0 -1
- package/CarouselInput.development.js +0 -898
- package/CarouselInput.js +0 -9
- package/CarouselInput.production.js +0 -1
- package/Checkbox.development.js +0 -722
- package/Checkbox.js +0 -9
- package/Checkbox.production.js +0 -1
- package/Combobox.development.js +0 -934
- package/Combobox.js +0 -9
- package/Combobox.production.js +0 -1
- package/DatePicker.development.js +0 -1323
- package/DatePicker.js +0 -9
- package/DatePicker.production.js +0 -1
- package/DateTimePicker.development.js +0 -1622
- package/DateTimePicker.js +0 -9
- package/DateTimePicker.production.js +0 -1
- package/Dialog.development.js +0 -741
- package/Dialog.js +0 -9
- package/Dialog.production.js +0 -1
- package/DismissibleLayer.development.js +0 -218
- package/DismissibleLayer.js +0 -9
- package/DismissibleLayer.production.js +0 -1
- package/Divider.development.js +0 -398
- package/Divider.js +0 -9
- package/Divider.production.js +0 -1
- package/EmptyStateLayout.development.js +0 -425
- package/EmptyStateLayout.js +0 -9
- package/EmptyStateLayout.production.js +0 -1
- package/Field.development.js +0 -614
- package/Field.js +0 -9
- package/Field.production.js +0 -1
- package/Flex.development.js +0 -377
- package/Flex.js +0 -9
- package/Flex.production.js +0 -1
- package/FocusTrap.development.js +0 -341
- package/FocusTrap.js +0 -9
- package/FocusTrap.production.js +0 -1
- package/Grid.development.js +0 -422
- package/Grid.js +0 -9
- package/Grid.production.js +0 -1
- package/Icon.development.js +0 -376
- package/Icon.js +0 -9
- package/Icon.production.js +0 -1
- package/IconButton.development.js +0 -684
- package/IconButton.js +0 -9
- package/IconButton.production.js +0 -1
- package/KeyboardNavigable.development.js +0 -454
- package/KeyboardNavigable.js +0 -9
- package/KeyboardNavigable.production.js +0 -1
- package/Layout.development.js +0 -626
- package/Layout.js +0 -9
- package/Layout.production.js +0 -1
- package/Link.development.js +0 -492
- package/Link.js +0 -9
- package/Link.production.js +0 -1
- package/LinkButton.development.js +0 -573
- package/LinkButton.js +0 -9
- package/LinkButton.production.js +0 -1
- package/LiveRegions.development.js +0 -147
- package/LiveRegions.js +0 -9
- package/LiveRegions.production.js +0 -1
- package/Loader.development.js +0 -309
- package/Loader.js +0 -9
- package/Loader.production.js +0 -1
- package/Main.development.js +0 -410
- package/Main.js +0 -9
- package/Main.production.js +0 -1
- package/MainNav.development.js +0 -957
- package/MainNav.js +0 -9
- package/MainNav.production.js +0 -1
- package/ModalLayout.development.js +0 -895
- package/ModalLayout.js +0 -9
- package/ModalLayout.production.js +0 -1
- package/NumberInput.development.js +0 -733
- package/NumberInput.js +0 -9
- package/NumberInput.production.js +0 -1
- package/Pagination.development.js +0 -587
- package/Pagination.js +0 -9
- package/Pagination.production.js +0 -1
- package/Popover.development.js +0 -481
- package/Popover.js +0 -9
- package/Popover.production.js +0 -1
- package/Portal.development.js +0 -212
- package/Portal.js +0 -9
- package/Portal.production.js +0 -1
- package/ProgressBar.development.js +0 -273
- package/ProgressBar.js +0 -9
- package/ProgressBar.production.js +0 -1
- package/Radio.development.js +0 -518
- package/Radio.js +0 -9
- package/Radio.production.js +0 -1
- package/RawTable.development.js +0 -549
- package/RawTable.js +0 -9
- package/RawTable.production.js +0 -1
- package/Searchbar.development.js +0 -696
- package/Searchbar.js +0 -9
- package/Searchbar.production.js +0 -1
- package/Select.development.js +0 -1063
- package/Select.js +0 -9
- package/Select.production.js +0 -1
- package/SimpleMenu.development.js +0 -821
- package/SimpleMenu.js +0 -9
- package/SimpleMenu.production.js +0 -1
- package/Stack.development.js +0 -434
- package/Stack.js +0 -9
- package/Stack.production.js +0 -1
- package/Status.development.js +0 -494
- package/Status.js +0 -9
- package/Status.production.js +0 -1
- package/SubNav.development.js +0 -1123
- package/SubNav.js +0 -9
- package/SubNav.production.js +0 -1
- package/Switch.development.js +0 -434
- package/Switch.js +0 -9
- package/Switch.production.js +0 -1
- package/Table.development.js +0 -741
- package/Table.js +0 -9
- package/Table.production.js +0 -1
- package/Tabs.development.js +0 -590
- package/Tabs.js +0 -9
- package/Tabs.production.js +0 -1
- package/Tag.development.js +0 -494
- package/Tag.js +0 -9
- package/Tag.production.js +0 -1
- package/TextButton.development.js +0 -517
- package/TextButton.js +0 -9
- package/TextButton.production.js +0 -1
- package/TextInput.development.js +0 -662
- package/TextInput.js +0 -9
- package/TextInput.production.js +0 -1
- package/Textarea.development.js +0 -674
- package/Textarea.js +0 -9
- package/Textarea.production.js +0 -1
- package/ThemeProvider.development.js +0 -300
- package/ThemeProvider.js +0 -9
- package/ThemeProvider.production.js +0 -1
- package/TimePicker.development.js +0 -1098
- package/TimePicker.js +0 -9
- package/TimePicker.production.js +0 -1
- package/ToggleCheckbox.development.js +0 -542
- package/ToggleCheckbox.js +0 -9
- package/ToggleCheckbox.production.js +0 -1
- package/ToggleInput.development.js +0 -745
- package/ToggleInput.js +0 -9
- package/ToggleInput.production.js +0 -1
- package/Tooltip.development.js +0 -588
- package/Tooltip.js +0 -9
- package/Tooltip.production.js +0 -1
- package/Typography.development.js +0 -276
- package/Typography.js +0 -9
- package/Typography.production.js +0 -1
- package/VisuallyHidden.development.js +0 -146
- package/VisuallyHidden.js +0 -9
- package/VisuallyHidden.production.js +0 -1
- package/index.development.js +0 -4338
- package/index.js +0 -9
- package/index.production.js +0 -1
- package/themes.development.js +0 -254
- package/themes.js +0 -9
- package/themes.production.js +0 -1
- package/v2/Breadcrumbs.development.js +0 -906
- package/v2/Breadcrumbs.js +0 -9
- package/v2/Breadcrumbs.production.js +0 -1
- package/v2/Link.development.js +0 -505
- package/v2/Link.js +0 -9
- package/v2/Link.production.js +0 -1
- package/v2/LinkButton.development.js +0 -586
- package/v2/LinkButton.js +0 -9
- package/v2/LinkButton.production.js +0 -1
- package/v2/MainNav.development.js +0 -970
- package/v2/MainNav.js +0 -9
- package/v2/MainNav.production.js +0 -1
- package/v2/Pagination.development.js +0 -600
- package/v2/Pagination.js +0 -9
- package/v2/Pagination.production.js +0 -1
- package/v2/SimpleMenu.development.js +0 -834
- package/v2/SimpleMenu.js +0 -9
- package/v2/SimpleMenu.production.js +0 -1
- package/v2/SubNav.development.js +0 -1136
- package/v2/SubNav.js +0 -9
- package/v2/SubNav.production.js +0 -1
- package/v2/index.development.js +0 -1740
- package/v2/index.js +0 -9
- package/v2/index.production.js +0 -1
- package/v2/package.json +0 -81
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Box as i } from "../Box/Box.js";
|
|
2
|
+
import { Flex as e } from "../Flex/Flex.js";
|
|
3
|
+
import n from "styled-components";
|
|
4
|
+
import { inputFocusStyle as t } from "../themes/utils.js";
|
|
5
|
+
const c = n(e)`
|
|
6
|
+
position: relative;
|
|
7
|
+
border: 1px solid ${({ theme: o, hasError: r }) => r ? o.colors.danger600 : o.colors.neutral200};
|
|
8
|
+
padding-right: ${({ theme: o }) => o.spaces[3]};
|
|
9
|
+
padding-left: ${({ theme: o }) => o.spaces[3]};
|
|
10
|
+
border-radius: ${({ theme: o }) => o.borderRadius};
|
|
11
|
+
background: ${({ theme: o }) => o.colors.neutral0};
|
|
12
|
+
|
|
13
|
+
${({ theme: o, $disabled: r }) => r ? `
|
|
14
|
+
color: ${o.colors.neutral600};
|
|
15
|
+
background: ${o.colors.neutral150};
|
|
16
|
+
` : void 0}
|
|
17
|
+
|
|
18
|
+
${t()}
|
|
19
|
+
`, p = n.div`
|
|
20
|
+
padding: 1px 2px;
|
|
21
|
+
grid-area: 1 / 1 / 2 / 3;
|
|
22
|
+
`, u = n(e)`
|
|
23
|
+
display: grid;
|
|
24
|
+
flex: 1 1 0%;
|
|
25
|
+
position: relative;
|
|
26
|
+
`, g = n.input`
|
|
27
|
+
display: inline-grid;
|
|
28
|
+
grid-area: 1 / 1 / 2 / 3;
|
|
29
|
+
grid-template-columns: 0px min-content;
|
|
30
|
+
background: transparent;
|
|
31
|
+
min-height: ${40 / 16}rem;
|
|
32
|
+
border: none;
|
|
33
|
+
flex: 1;
|
|
34
|
+
font-size: ${14 / 16}rem;
|
|
35
|
+
color: ${({ theme: o }) => o.colors.neutral800};
|
|
36
|
+
outline: none;
|
|
37
|
+
&:focus-visible {
|
|
38
|
+
outline: none;
|
|
39
|
+
box-shadow: none;
|
|
40
|
+
outline-offset: 0;
|
|
41
|
+
}
|
|
42
|
+
&[aria-disabled='true'] {
|
|
43
|
+
background: inherit;
|
|
44
|
+
color: inherit;
|
|
45
|
+
cursor: not-allowed;
|
|
46
|
+
}
|
|
47
|
+
`, $ = n(i)`
|
|
48
|
+
width: 100%;
|
|
49
|
+
border: none;
|
|
50
|
+
text-align: left;
|
|
51
|
+
outline-offset: -3px;
|
|
52
|
+
${({ isSelected: o, theme: r }) => o && `background: ${r.colors.primary100};`}
|
|
53
|
+
|
|
54
|
+
&:hover {
|
|
55
|
+
background: ${({ theme: o }) => o.colors.primary100};
|
|
56
|
+
}
|
|
57
|
+
`;
|
|
58
|
+
export {
|
|
59
|
+
g as Input,
|
|
60
|
+
u as InputContainer,
|
|
61
|
+
c as MainRow,
|
|
62
|
+
$ as OptionBox,
|
|
63
|
+
p as ValueContainer
|
|
64
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("./Combobox.cjs"),b=require("./ComboboxOption.cjs");exports.Combobox=o.Combobox;exports.CreatableCombobox=o.CreatableCombobox;exports.ComboboxOption=b.ComboboxOption;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("compute-scroll-into-view"),r=require("../helpers/keyboardKeys.cjs"),a=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},c=a(l),t={Close:"Close",CloseSelect:"CloseSelect",First:"First",Last:"Last",Next:"Next",Open:"Open",PageDown:"PageDown",PageUp:"PageUp",Previous:"Previous",Select:"Select",Space:"Space",Type:"Type"},u={Close:"Close",First:"First",Last:"Last",Next:"Next",Open:"Open",Previous:"Previous",Select:"Select",UpLevel:"UpLevel"};function d(e=[],s,o=[]){const n=String(s??"").toLowerCase();return n?e.filter(i=>i.props.children.toString().toLowerCase().includes(n)&&o.indexOf(i)<0):e}function p(e,s){if(!s&&e===r.KeyboardKeys.DOWN)return t.Open;if(e===r.KeyboardKeys.DOWN)return t.Next;if(e===r.KeyboardKeys.UP)return t.Previous;if(e===r.KeyboardKeys.HOME)return t.First;if(e===r.KeyboardKeys.END)return t.Last;if(e===r.KeyboardKeys.ESCAPE)return t.Close;if(e===r.KeyboardKeys.ENTER)return t.CloseSelect;if(e===r.KeyboardKeys.BACKSPACE||e===r.KeyboardKeys.CLEAR||e.length===1)return t.Type}function f(e,s,o){switch(o){case t.First:return 0;case t.Last:return s;case t.Previous:return Math.max(0,e-1);case t.Next:return Math.min(s,e+1);default:return e}}function y(e){c.default(e,{scrollMode:"if-needed",block:"nearest",inline:"nearest"}).forEach(({el:o,top:n,left:i})=>{o.scrollTop=n,o.scrollLeft=i})}exports.MenuActions=t;exports.TreeActions=u;exports.filterOptions=d;exports.getActionFromKey=p;exports.getUpdatedIndex=f;exports.maintainScrollVisibility=y;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import l from "compute-scroll-into-view";
|
|
2
|
+
import { KeyboardKeys as r } from "../helpers/keyboardKeys.js";
|
|
3
|
+
const t = {
|
|
4
|
+
Close: "Close",
|
|
5
|
+
CloseSelect: "CloseSelect",
|
|
6
|
+
First: "First",
|
|
7
|
+
Last: "Last",
|
|
8
|
+
Next: "Next",
|
|
9
|
+
Open: "Open",
|
|
10
|
+
PageDown: "PageDown",
|
|
11
|
+
PageUp: "PageUp",
|
|
12
|
+
Previous: "Previous",
|
|
13
|
+
Select: "Select",
|
|
14
|
+
Space: "Space",
|
|
15
|
+
Type: "Type"
|
|
16
|
+
}, f = {
|
|
17
|
+
Close: "Close",
|
|
18
|
+
First: "First",
|
|
19
|
+
Last: "Last",
|
|
20
|
+
Next: "Next",
|
|
21
|
+
Open: "Open",
|
|
22
|
+
Previous: "Previous",
|
|
23
|
+
Select: "Select",
|
|
24
|
+
UpLevel: "UpLevel"
|
|
25
|
+
};
|
|
26
|
+
function d(e = [], s, n = []) {
|
|
27
|
+
const i = String(s ?? "").toLowerCase();
|
|
28
|
+
return i ? e.filter((o) => o.props.children.toString().toLowerCase().includes(i) && n.indexOf(o) < 0) : e;
|
|
29
|
+
}
|
|
30
|
+
function C(e, s) {
|
|
31
|
+
if (!s && e === r.DOWN)
|
|
32
|
+
return t.Open;
|
|
33
|
+
if (e === r.DOWN)
|
|
34
|
+
return t.Next;
|
|
35
|
+
if (e === r.UP)
|
|
36
|
+
return t.Previous;
|
|
37
|
+
if (e === r.HOME)
|
|
38
|
+
return t.First;
|
|
39
|
+
if (e === r.END)
|
|
40
|
+
return t.Last;
|
|
41
|
+
if (e === r.ESCAPE)
|
|
42
|
+
return t.Close;
|
|
43
|
+
if (e === r.ENTER)
|
|
44
|
+
return t.CloseSelect;
|
|
45
|
+
if (e === r.BACKSPACE || e === r.CLEAR || e.length === 1)
|
|
46
|
+
return t.Type;
|
|
47
|
+
}
|
|
48
|
+
function S(e, s, n) {
|
|
49
|
+
switch (n) {
|
|
50
|
+
case t.First:
|
|
51
|
+
return 0;
|
|
52
|
+
case t.Last:
|
|
53
|
+
return s;
|
|
54
|
+
case t.Previous:
|
|
55
|
+
return Math.max(0, e - 1);
|
|
56
|
+
case t.Next:
|
|
57
|
+
return Math.min(s, e + 1);
|
|
58
|
+
default:
|
|
59
|
+
return e;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
function P(e) {
|
|
63
|
+
l(e, {
|
|
64
|
+
scrollMode: "if-needed",
|
|
65
|
+
block: "nearest",
|
|
66
|
+
inline: "nearest"
|
|
67
|
+
}).forEach(({ el: n, top: i, left: o }) => {
|
|
68
|
+
n.scrollTop = i, n.scrollLeft = o;
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
export {
|
|
72
|
+
t as MenuActions,
|
|
73
|
+
f as TreeActions,
|
|
74
|
+
d as filterOptions,
|
|
75
|
+
C as getActionFromKey,
|
|
76
|
+
S as getUpdatedIndex,
|
|
77
|
+
P as maintainScrollVisibility
|
|
78
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react"),T=require("prop-types"),O=require("@strapi/icons/Calendar"),x=require("@strapi/icons/Cross"),z=require("../themes/sizes.cjs"),S=require("../TextInput/TextInput.cjs"),d=require("./components.cjs"),B=require("./DatePickerCalendar.cjs"),h=require("./utils/formatDate.cjs"),M=require("../helpers/useId.cjs"),W=require("../helpers/getDefaultLocale.cjs"),s=t=>t&&typeof t=="object"&&"default"in t?t:{default:t},a=s(o),e=s(T),A=s(O),V=s(x),f=({ariaLabel:t,initialDate:k,selectedDate:n,onChange:q,label:i,locale:v,selectedDateLabel:P,onClear:p,clearLabel:I,disabled:r,id:_,...j})=>{const y=M.useId("datepicker",_),[D,c]=o.useState(!1),l=o.useRef(null),b=o.useRef(null),g=v||W.getDefaultLocale(),m=n?h.formatDate(n,g):"",C=()=>{r||c(u=>!u)},R=()=>{r||(p(),b.current.focus())},E=u=>{q(u),c(!1)},L=()=>{c(!1)};return a.default.createElement(d.DatePickerWrapper,{bold:D},a.default.createElement(S.TextInput,{ref:l,onClick:C,onChange:()=>{},value:m,startAction:a.default.createElement(d.DatePickerButton,{ref:b,onClick:C,"aria-label":n?P(h.formatDate(n,g)):i,type:"button","aria-disabled":r},a.default.createElement(A.default,{"aria-hidden":!0})),endAction:p&&m?a.default.createElement(d.IconBox,{as:"button",onClick:R,"aria-label":I,"aria-disabled":r},a.default.createElement(V.default,null)):void 0,"aria-autocomplete":"none",label:i,"aria-label":t,disabled:r,id:y,...j}),l.current&&l.current.inputWrapperRef&&D&&a.default.createElement(B.DatePickerCalendar,{selectedDate:n,initialDate:k,onChange:E,onEscape:L,popoverSource:l.current.inputWrapperRef,label:i||t}))};f.defaultProps={ariaLabel:void 0,clearLabel:void 0,disabled:!1,id:void 0,label:void 0,initialDate:new Date,onClear:void 0,placeholder:void 0,selectedDate:void 0,size:"M"};f.propTypes={ariaLabel:e.default.string,clearLabel:e.default.string,disabled:e.default.bool,id:e.default.string,initialDate:e.default.instanceOf(Date),label:e.default.string,locale:e.default.string,maxDate:e.default.instanceOf(Date),minDate:e.default.instanceOf(Date),onChange:e.default.func.isRequired,onClear:e.default.func,placeholder:e.default.string,selectedDate:e.default.instanceOf(Date),selectedDateLabel:e.default.func.isRequired,size:e.default.oneOf(Object.keys(z.sizes.input))};exports.DatePicker=f;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import t, { useState as x, useRef as b } from "react";
|
|
2
|
+
import e from "prop-types";
|
|
3
|
+
import z from "@strapi/icons/Calendar";
|
|
4
|
+
import B from "@strapi/icons/Cross";
|
|
5
|
+
import { sizes as T } from "../themes/sizes.js";
|
|
6
|
+
import { TextInput as W } from "../TextInput/TextInput.js";
|
|
7
|
+
import { DatePickerWrapper as q, DatePickerButton as A, IconBox as S } from "./components.js";
|
|
8
|
+
import { DatePickerCalendar as V } from "./DatePickerCalendar.js";
|
|
9
|
+
import { formatDate as D } from "./utils/formatDate.js";
|
|
10
|
+
import { useId as _ } from "../helpers/useId.js";
|
|
11
|
+
import { getDefaultLocale as j } from "../helpers/getDefaultLocale.js";
|
|
12
|
+
const g = ({
|
|
13
|
+
ariaLabel: c,
|
|
14
|
+
initialDate: C,
|
|
15
|
+
selectedDate: a,
|
|
16
|
+
onChange: v,
|
|
17
|
+
label: o,
|
|
18
|
+
locale: h,
|
|
19
|
+
selectedDateLabel: k,
|
|
20
|
+
onClear: s,
|
|
21
|
+
clearLabel: E,
|
|
22
|
+
disabled: r,
|
|
23
|
+
id: R,
|
|
24
|
+
...P
|
|
25
|
+
}) => {
|
|
26
|
+
const O = _("datepicker", R), [f, i] = x(!1), n = b(null), p = b(null), u = h || j(), m = a ? D(a, u) : "", d = () => {
|
|
27
|
+
r || i((l) => !l);
|
|
28
|
+
}, y = () => {
|
|
29
|
+
r || (s(), p.current.focus());
|
|
30
|
+
}, I = (l) => {
|
|
31
|
+
v(l), i(!1);
|
|
32
|
+
}, L = () => {
|
|
33
|
+
i(!1);
|
|
34
|
+
};
|
|
35
|
+
return /* @__PURE__ */ t.createElement(q, {
|
|
36
|
+
bold: f
|
|
37
|
+
}, /* @__PURE__ */ t.createElement(W, {
|
|
38
|
+
ref: n,
|
|
39
|
+
onClick: d,
|
|
40
|
+
onChange: () => {
|
|
41
|
+
},
|
|
42
|
+
value: m,
|
|
43
|
+
startAction: /* @__PURE__ */ t.createElement(A, {
|
|
44
|
+
ref: p,
|
|
45
|
+
onClick: d,
|
|
46
|
+
"aria-label": a ? k(D(a, u)) : o,
|
|
47
|
+
type: "button",
|
|
48
|
+
"aria-disabled": r
|
|
49
|
+
}, /* @__PURE__ */ t.createElement(z, {
|
|
50
|
+
"aria-hidden": !0
|
|
51
|
+
})),
|
|
52
|
+
endAction: s && m ? /* @__PURE__ */ t.createElement(S, {
|
|
53
|
+
as: "button",
|
|
54
|
+
onClick: y,
|
|
55
|
+
"aria-label": E,
|
|
56
|
+
"aria-disabled": r
|
|
57
|
+
}, /* @__PURE__ */ t.createElement(B, null)) : void 0,
|
|
58
|
+
"aria-autocomplete": "none",
|
|
59
|
+
label: o,
|
|
60
|
+
"aria-label": c,
|
|
61
|
+
disabled: r,
|
|
62
|
+
id: O,
|
|
63
|
+
...P
|
|
64
|
+
}), n.current && n.current.inputWrapperRef && f && /* @__PURE__ */ t.createElement(V, {
|
|
65
|
+
selectedDate: a,
|
|
66
|
+
initialDate: C,
|
|
67
|
+
onChange: I,
|
|
68
|
+
onEscape: L,
|
|
69
|
+
popoverSource: n.current.inputWrapperRef,
|
|
70
|
+
label: o || c
|
|
71
|
+
}));
|
|
72
|
+
};
|
|
73
|
+
g.defaultProps = {
|
|
74
|
+
ariaLabel: void 0,
|
|
75
|
+
clearLabel: void 0,
|
|
76
|
+
disabled: !1,
|
|
77
|
+
id: void 0,
|
|
78
|
+
label: void 0,
|
|
79
|
+
initialDate: new Date(),
|
|
80
|
+
onClear: void 0,
|
|
81
|
+
placeholder: void 0,
|
|
82
|
+
selectedDate: void 0,
|
|
83
|
+
size: "M"
|
|
84
|
+
};
|
|
85
|
+
g.propTypes = {
|
|
86
|
+
ariaLabel: e.string,
|
|
87
|
+
clearLabel: e.string,
|
|
88
|
+
disabled: e.bool,
|
|
89
|
+
id: e.string,
|
|
90
|
+
initialDate: e.instanceOf(Date),
|
|
91
|
+
label: e.string,
|
|
92
|
+
locale: e.string,
|
|
93
|
+
maxDate: e.instanceOf(Date),
|
|
94
|
+
minDate: e.instanceOf(Date),
|
|
95
|
+
onChange: e.func.isRequired,
|
|
96
|
+
onClear: e.func,
|
|
97
|
+
placeholder: e.string,
|
|
98
|
+
selectedDate: e.instanceOf(Date),
|
|
99
|
+
selectedDateLabel: e.func.isRequired,
|
|
100
|
+
size: e.oneOf(Object.keys(T.input))
|
|
101
|
+
};
|
|
102
|
+
export {
|
|
103
|
+
g as DatePicker
|
|
104
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("react"),W=require("prop-types"),H=require("../VisuallyHidden/VisuallyHidden.cjs"),V=require("./components.cjs"),i=require("../SimpleMenu/SimpleMenu.cjs"),$=require("../Flex/Flex.cjs"),d=require("../Box/Box.cjs"),L=require("../RawTable/RawTable.cjs");require("../RawTable/RawCell.cjs");const I=require("../RawTable/RawThead.cjs"),z=require("../RawTable/RawTbody.cjs"),D=require("../RawTable/RawTr.cjs"),r=require("./DatePickerTh.cjs"),A=require("./DatePickerTd.cjs"),G=require("../FocusTrap/FocusTrap.cjs"),J=require("./utils/getDayOfWeek.cjs"),K=require("./utils/getMonths.cjs"),N=require("./utils/generateWeeks.cjs"),Q=require("./utils/getYears.cjs"),U=require("./utils/formatDate.cjs"),T=a=>a&&typeof a=="object"&&"default"in a?a:{default:a},e=T(f),l=T(W),m=({selectedDate:a,initialDate:g,popoverSource:E,onChange:k,label:w,minDate:R,maxDate:h,onEscape:q})=>{const[c,s]=f.useState(g),[p,y,j]=N.generateWeeks(c,a),{sun:P,mon:b,tue:M,wed:x,thu:C,fri:F,sat:O}=J.getDayOfWeek(),o=K.getMonths(),S=Q.getYears(R,h);f.useEffect(()=>{a&&s(a)},[a]);const v=t=>{const n=new Date(c);n.setMonth(o.indexOf(t)),s(n)},B=t=>{const n=new Date(c);n.setFullYear(t),s(n)};return e.default.createElement(V.DatePickerPopover,{source:E,role:"dialog","aria-modal":"true","aria-label":w,spacing:4},e.default.createElement(G.FocusTrap,{onEscape:q},e.default.createElement(d.Box,{padding:4},e.default.createElement(d.Box,{paddingBottom:4,paddingLeft:2,paddingRight:2},e.default.createElement($.Flex,null,e.default.createElement(i.SimpleMenu,{label:o[c.getMonth()]},o.map(t=>e.default.createElement(i.MenuItem,{key:t,onClick:()=>v(t)},t))),e.default.createElement(d.Box,{paddingLeft:2},e.default.createElement(i.SimpleMenu,{label:c.getFullYear()},S.map(t=>e.default.createElement(i.MenuItem,{key:t,onClick:()=>B(t)},t)))))),e.default.createElement(L.RawTable,{colCount:7,rowCount:p.length+1,initialCol:j,initialRow:y,role:"grid"},e.default.createElement(I.RawThead,null,e.default.createElement(D.RawTr,{"aria-rowindex":1},e.default.createElement(r.DatePickerTh,null,P),e.default.createElement(r.DatePickerTh,null,b),e.default.createElement(r.DatePickerTh,null,M),e.default.createElement(r.DatePickerTh,null,x),e.default.createElement(r.DatePickerTh,null,C),e.default.createElement(r.DatePickerTh,null,F),e.default.createElement(r.DatePickerTh,null,O))),e.default.createElement(z.RawTbody,null,p.map((t,n)=>e.default.createElement(D.RawTr,{key:`week-${n}`},t.map(({date:u,outsideMonth:Y,isSelected:_})=>e.default.createElement(A.DatePickerTd,{key:`${u.getFullYear()}-${u.getMonth()+1}-${u.getDate()}`,outsideMonth:Y,onSelectDay:()=>k(u),isSelected:_},e.default.createElement("span",{"aria-hidden":!0},u.getDate()),e.default.createElement(H.VisuallyHidden,null,e.default.createElement("span",null,U.formatDate(u))))))))))))};m.defaultProps={selectedDate:void 0,initialDate:new Date};m.propTypes={initialDate:l.default.instanceOf(Date),label:l.default.string.isRequired,maxDate:l.default.instanceOf(Date),minDate:l.default.instanceOf(Date),onChange:l.default.func.isRequired,onEscape:l.default.func.isRequired,popoverSource:l.default.shape({current:(typeof Element>"u"?l.default.any:l.default.instanceOf(Element)).isRequired}).isRequired,selectedDate:l.default.instanceOf(Date)};exports.DatePickerCalendar=m;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import e, { useState as L, useEffect as W } from "react";
|
|
2
|
+
import a from "prop-types";
|
|
3
|
+
import { VisuallyHidden as _ } from "../VisuallyHidden/VisuallyHidden.js";
|
|
4
|
+
import { DatePickerPopover as H } from "./components.js";
|
|
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";
|
|
13
|
+
import { DatePickerTh as r } from "./DatePickerTh.js";
|
|
14
|
+
import { DatePickerTd as A } from "./DatePickerTd.js";
|
|
15
|
+
import { FocusTrap as G } from "../FocusTrap/FocusTrap.js";
|
|
16
|
+
import { getDayOfWeek as J } from "./utils/getDayOfWeek.js";
|
|
17
|
+
import { getMonths as K } from "./utils/getMonths.js";
|
|
18
|
+
import { generateWeeks as N } from "./utils/generateWeeks.js";
|
|
19
|
+
import { getYears as Q } from "./utils/getYears.js";
|
|
20
|
+
import { formatDate as U } from "./utils/formatDate.js";
|
|
21
|
+
const E = ({
|
|
22
|
+
selectedDate: i,
|
|
23
|
+
initialDate: g,
|
|
24
|
+
popoverSource: D,
|
|
25
|
+
onChange: h,
|
|
26
|
+
label: k,
|
|
27
|
+
minDate: w,
|
|
28
|
+
maxDate: R,
|
|
29
|
+
onEscape: y
|
|
30
|
+
}) => {
|
|
31
|
+
const [o, m] = L(g), [u, C, T] = N(o, i), { sun: M, mon: O, tue: P, wed: b, thu: x, fri: q, sat: v } = J(), c = K(), F = Q(w, R);
|
|
32
|
+
W(() => {
|
|
33
|
+
i && m(i);
|
|
34
|
+
}, [i]);
|
|
35
|
+
const Y = (t) => {
|
|
36
|
+
const n = new Date(o);
|
|
37
|
+
n.setMonth(c.indexOf(t)), m(n);
|
|
38
|
+
}, S = (t) => {
|
|
39
|
+
const n = new Date(o);
|
|
40
|
+
n.setFullYear(t), m(n);
|
|
41
|
+
};
|
|
42
|
+
return /* @__PURE__ */ e.createElement(H, {
|
|
43
|
+
source: D,
|
|
44
|
+
role: "dialog",
|
|
45
|
+
"aria-modal": "true",
|
|
46
|
+
"aria-label": k,
|
|
47
|
+
spacing: 4
|
|
48
|
+
}, /* @__PURE__ */ e.createElement(G, {
|
|
49
|
+
onEscape: y
|
|
50
|
+
}, /* @__PURE__ */ e.createElement(p, {
|
|
51
|
+
padding: 4
|
|
52
|
+
}, /* @__PURE__ */ e.createElement(p, {
|
|
53
|
+
paddingBottom: 4,
|
|
54
|
+
paddingLeft: 2,
|
|
55
|
+
paddingRight: 2
|
|
56
|
+
}, /* @__PURE__ */ e.createElement(I, null, /* @__PURE__ */ e.createElement(s, {
|
|
57
|
+
label: c[o.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: o.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, M), /* @__PURE__ */ e.createElement(r, null, O), /* @__PURE__ */ e.createElement(r, null, P), /* @__PURE__ */ e.createElement(r, null, b), /* @__PURE__ */ e.createElement(r, null, x), /* @__PURE__ */ e.createElement(r, null, q), /* @__PURE__ */ e.createElement(r, null, v))), /* @__PURE__ */ e.createElement(z, null, u.map((t, n) => /* @__PURE__ */ e.createElement(d, {
|
|
77
|
+
key: `week-${n}`
|
|
78
|
+
}, t.map(({ date: l, outsideMonth: $, isSelected: B }) => /* @__PURE__ */ e.createElement(A, {
|
|
79
|
+
key: `${l.getFullYear()}-${l.getMonth() + 1}-${l.getDate()}`,
|
|
80
|
+
outsideMonth: $,
|
|
81
|
+
onSelectDay: () => h(l),
|
|
82
|
+
isSelected: B
|
|
83
|
+
}, /* @__PURE__ */ e.createElement("span", {
|
|
84
|
+
"aria-hidden": !0
|
|
85
|
+
}, l.getDate()), /* @__PURE__ */ e.createElement(_, null, /* @__PURE__ */ e.createElement("span", null, U(l))))))))))));
|
|
86
|
+
};
|
|
87
|
+
E.defaultProps = { selectedDate: void 0, initialDate: new Date() };
|
|
88
|
+
E.propTypes = {
|
|
89
|
+
initialDate: a.instanceOf(Date),
|
|
90
|
+
label: a.string.isRequired,
|
|
91
|
+
maxDate: a.instanceOf(Date),
|
|
92
|
+
minDate: a.instanceOf(Date),
|
|
93
|
+
onChange: a.func.isRequired,
|
|
94
|
+
onEscape: a.func.isRequired,
|
|
95
|
+
popoverSource: a.shape({
|
|
96
|
+
current: (typeof Element > "u" ? a.any : a.instanceOf(Element)).isRequired
|
|
97
|
+
}).isRequired,
|
|
98
|
+
selectedDate: a.instanceOf(Date)
|
|
99
|
+
};
|
|
100
|
+
export {
|
|
101
|
+
E as DatePickerCalendar
|
|
102
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
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("../RawTable/RawTable.cjs");const y=require("../RawTable/RawCell.cjs");require("../RawTable/RawThead.cjs");require("../RawTable/RawTbody.cjs");require("../RawTable/RawTr.cjs");const u=require("../Typography/Typography.cjs"),l=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},a=l(d),t=l(p),b=l(f),T=b.default.button`
|
|
2
|
+
border: none;
|
|
3
|
+
background: ${({theme:e,isSelected:r})=>r?e.colors.primary100:e.colors.neutral0};
|
|
4
|
+
height: ${32/16}rem;
|
|
5
|
+
text-align: center;
|
|
6
|
+
width: ${32/16}rem;
|
|
7
|
+
border-radius: ${({theme:e})=>e.borderRadius};
|
|
8
|
+
|
|
9
|
+
// Trick to prevent the outline from overflowing because of the general outline-offset
|
|
10
|
+
outline-offset: -2px;
|
|
11
|
+
|
|
12
|
+
&:hover {
|
|
13
|
+
background: ${({theme:e})=>e.colors.primary100};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&:hover > ${u.Typography} {
|
|
17
|
+
color: ${({theme:e})=>e.colors.primary600};
|
|
18
|
+
}
|
|
19
|
+
`,n=({children:e,outsideMonth:r,onSelectDay:c,isSelected:o,...s})=>{const i=o?"primary600":r?"neutral600":"neutral900";return a.default.createElement(y.RawTd,{...s},a.default.createElement(T,{tabIndex:-1,onClick:c,isSelected:o,type:"button"},a.default.createElement(u.Typography,{variant:"pi",textColor:i,fontWeight:o?"bold":null},e)))};n.defaultProps={isSelected:!1,outsideMonth:!1};n.propTypes={children:t.default.node.isRequired,isSelected:t.default.bool,onSelectDay:t.default.func.isRequired,outsideMonth:t.default.bool};exports.DatePickerTd=n;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import i from "react";
|
|
2
|
+
import o from "prop-types";
|
|
3
|
+
import m from "styled-components";
|
|
4
|
+
import "../RawTable/RawTable.js";
|
|
5
|
+
import { RawTd as u } from "../RawTable/RawCell.js";
|
|
6
|
+
import "../RawTable/RawThead.js";
|
|
7
|
+
import "../RawTable/RawTbody.js";
|
|
8
|
+
import "../RawTable/RawTr.js";
|
|
9
|
+
import { Typography as n } from "../Typography/Typography.js";
|
|
10
|
+
const s = m.button`
|
|
11
|
+
border: none;
|
|
12
|
+
background: ${({ theme: e, isSelected: r }) => r ? e.colors.primary100 : e.colors.neutral0};
|
|
13
|
+
height: ${32 / 16}rem;
|
|
14
|
+
text-align: center;
|
|
15
|
+
width: ${32 / 16}rem;
|
|
16
|
+
border-radius: ${({ theme: e }) => e.borderRadius};
|
|
17
|
+
|
|
18
|
+
// Trick to prevent the outline from overflowing because of the general outline-offset
|
|
19
|
+
outline-offset: -2px;
|
|
20
|
+
|
|
21
|
+
&:hover {
|
|
22
|
+
background: ${({ theme: e }) => e.colors.primary100};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&:hover > ${n} {
|
|
26
|
+
color: ${({ theme: e }) => e.colors.primary600};
|
|
27
|
+
}
|
|
28
|
+
`, l = ({ children: e, outsideMonth: r, onSelectDay: a, isSelected: t, ...p }) => {
|
|
29
|
+
const c = t ? "primary600" : r ? "neutral600" : "neutral900";
|
|
30
|
+
return /* @__PURE__ */ i.createElement(u, {
|
|
31
|
+
...p
|
|
32
|
+
}, /* @__PURE__ */ i.createElement(s, {
|
|
33
|
+
tabIndex: -1,
|
|
34
|
+
onClick: a,
|
|
35
|
+
isSelected: t,
|
|
36
|
+
type: "button"
|
|
37
|
+
}, /* @__PURE__ */ i.createElement(n, {
|
|
38
|
+
variant: "pi",
|
|
39
|
+
textColor: c,
|
|
40
|
+
fontWeight: t ? "bold" : null
|
|
41
|
+
}, e)));
|
|
42
|
+
};
|
|
43
|
+
l.defaultProps = {
|
|
44
|
+
isSelected: !1,
|
|
45
|
+
outsideMonth: !1
|
|
46
|
+
};
|
|
47
|
+
l.propTypes = {
|
|
48
|
+
children: o.node.isRequired,
|
|
49
|
+
isSelected: o.bool,
|
|
50
|
+
onSelectDay: o.func.isRequired,
|
|
51
|
+
outsideMonth: o.bool
|
|
52
|
+
};
|
|
53
|
+
export {
|
|
54
|
+
l as DatePickerTd
|
|
55
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react"),i=require("prop-types"),u=require("styled-components");require("../RawTable/RawTable.cjs");const n=require("../RawTable/RawCell.cjs");require("../RawTable/RawThead.cjs");require("../RawTable/RawTbody.cjs");require("../RawTable/RawTr.cjs");const c=require("../Typography/Typography.cjs"),d=require("../VisuallyHidden/VisuallyHidden.cjs"),p=require("../Flex/Flex.cjs"),r=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},t=r(s),f=r(i),a=r(u),y=a.default(n.RawTh)`
|
|
2
|
+
// Trick to prevent the outline from overflowing because of the general outline-offset
|
|
3
|
+
outline-offset: -2px;
|
|
4
|
+
border-radius: ${({theme:e})=>e.borderRadius};
|
|
5
|
+
text-transform: capitalize;
|
|
6
|
+
`,T=a.default(p.Flex)`
|
|
7
|
+
height: ${24/16}rem;
|
|
8
|
+
width: ${32/16}rem;
|
|
9
|
+
`,l=({children:e,...o})=>t.default.createElement(y,{...o},t.default.createElement(T,{justifyContent:"center"},t.default.createElement(c.Typography,{variant:"pi",fontWeight:"bold",color:"neutral800","aria-hidden":!0},e.substr(0,2)),t.default.createElement(d.VisuallyHidden,null,t.default.createElement("span",null,e))));l.propTypes={children:f.default.string.isRequired};exports.DatePickerTh=l;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import e from "react";
|
|
2
|
+
import i from "prop-types";
|
|
3
|
+
import r from "styled-components";
|
|
4
|
+
import "../RawTable/RawTable.js";
|
|
5
|
+
import { RawTh as n } from "../RawTable/RawCell.js";
|
|
6
|
+
import "../RawTable/RawThead.js";
|
|
7
|
+
import "../RawTable/RawTbody.js";
|
|
8
|
+
import "../RawTable/RawTr.js";
|
|
9
|
+
import { Typography as a } from "../Typography/Typography.js";
|
|
10
|
+
import { VisuallyHidden as m } from "../VisuallyHidden/VisuallyHidden.js";
|
|
11
|
+
import { Flex as p } from "../Flex/Flex.js";
|
|
12
|
+
const l = r(n)`
|
|
13
|
+
// Trick to prevent the outline from overflowing because of the general outline-offset
|
|
14
|
+
outline-offset: -2px;
|
|
15
|
+
border-radius: ${({ theme: t }) => t.borderRadius};
|
|
16
|
+
text-transform: capitalize;
|
|
17
|
+
`, s = r(p)`
|
|
18
|
+
height: ${24 / 16}rem;
|
|
19
|
+
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))));
|
|
30
|
+
f.propTypes = {
|
|
31
|
+
children: i.string.isRequired
|
|
32
|
+
};
|
|
33
|
+
export {
|
|
34
|
+
f as DatePickerTh
|
|
35
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=(e,t)=>!e||!t?!1:e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate();exports.isDateEqual=l;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("styled-components"),a=require("../Field/FieldInput.cjs"),n=require("../Popover/Popover.cjs"),i=require("../Box/Box.cjs"),d=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},o=d(t),s=o.default(n.Popover)`
|
|
2
|
+
max-height: ${3*6}rem;
|
|
3
|
+
overflow: hidden;
|
|
4
|
+
`,l=o.default.button`
|
|
5
|
+
border: none;
|
|
6
|
+
background: transparent;
|
|
7
|
+
border-radius: ${({theme:e})=>e.borderRadius};
|
|
8
|
+
cursor: ${e=>e["aria-disabled"]?"not-allowed":void 0};
|
|
9
|
+
|
|
10
|
+
& svg path {
|
|
11
|
+
fill: ${({theme:e})=>e.colors.neutral500};
|
|
12
|
+
}
|
|
13
|
+
`,c=o.default.div`
|
|
14
|
+
${({bold:e,theme:r})=>e?`& ${a.InputWrapper} {
|
|
15
|
+
border: 1px solid ${r.colors.primary600};
|
|
16
|
+
}`:void 0}
|
|
17
|
+
`,u=o.default(i.Box)`
|
|
18
|
+
background: transparent;
|
|
19
|
+
border: none;
|
|
20
|
+
position: relative;
|
|
21
|
+
z-index: 1;
|
|
22
|
+
|
|
23
|
+
svg {
|
|
24
|
+
height: ${11/16}rem;
|
|
25
|
+
width: ${11/16}rem;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
svg path {
|
|
29
|
+
fill: ${({theme:e})=>e.colors.neutral600};
|
|
30
|
+
}
|
|
31
|
+
`;exports.DatePickerButton=l;exports.DatePickerPopover=s;exports.DatePickerWrapper=c;exports.IconBox=u;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import o from "styled-components";
|
|
2
|
+
import { InputWrapper as t } from "../Field/FieldInput.js";
|
|
3
|
+
import { Popover as i } from "../Popover/Popover.js";
|
|
4
|
+
import { Box as a } from "../Box/Box.js";
|
|
5
|
+
const l = o(i)`
|
|
6
|
+
max-height: ${3 * 6}rem;
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
`, c = o.button`
|
|
9
|
+
border: none;
|
|
10
|
+
background: transparent;
|
|
11
|
+
border-radius: ${({ theme: r }) => r.borderRadius};
|
|
12
|
+
cursor: ${(r) => r["aria-disabled"] ? "not-allowed" : void 0};
|
|
13
|
+
|
|
14
|
+
& svg path {
|
|
15
|
+
fill: ${({ theme: r }) => r.colors.neutral500};
|
|
16
|
+
}
|
|
17
|
+
`, m = o.div`
|
|
18
|
+
${({ bold: r, theme: e }) => r ? `& ${t} {
|
|
19
|
+
border: 1px solid ${e.colors.primary600};
|
|
20
|
+
}` : void 0}
|
|
21
|
+
`, u = o(a)`
|
|
22
|
+
background: transparent;
|
|
23
|
+
border: none;
|
|
24
|
+
position: relative;
|
|
25
|
+
z-index: 1;
|
|
26
|
+
|
|
27
|
+
svg {
|
|
28
|
+
height: ${11 / 16}rem;
|
|
29
|
+
width: ${11 / 16}rem;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
svg path {
|
|
33
|
+
fill: ${({ theme: r }) => r.colors.neutral600};
|
|
34
|
+
}
|
|
35
|
+
`;
|
|
36
|
+
export {
|
|
37
|
+
c as DatePickerButton,
|
|
38
|
+
l as DatePickerPopover,
|
|
39
|
+
m as DatePickerWrapper,
|
|
40
|
+
u as IconBox
|
|
41
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./DatePicker.cjs");exports.DatePicker=e.DatePicker;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=(t,e)=>new Intl.DateTimeFormat(e).format(t);exports.formatDate=r;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const D=require("../compareDates.cjs"),M=7*6,f=(e,g)=>{const i=new Date(e.getFullYear(),e.getMonth(),1),l=new Date(e.getFullYear(),e.getMonth()+1,0).getDate(),c=new Date(e.getFullYear(),e.getMonth(),0).getDate(),s=i.getDay(),h=l+s,r=[];let a=0,u=0,n=0,o;for(let t=0;t<M;t++)t>6&&t%7===0&&n++,r[n]||(r[n]=[]),t<s?o={date:new Date(e.getFullYear(),e.getMonth()-1,c-s+t+1),outsideMonth:!0}:t<h?o={date:new Date(e.getFullYear(),e.getMonth(),t-s+1)}:o={date:new Date(e.getFullYear(),e.getMonth()+1,t-s-l+1),outsideMonth:!0},D.isDateEqual(g,o.date)&&(a=n+1,u=r[n].length,o.isSelected=!0),r[n].push(o);return[r,a,u]};exports.generateWeeks=f;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { isDateEqual as f } from "../compareDates.js";
|
|
2
|
+
const D = 7 * 6, w = (e, g) => {
|
|
3
|
+
const i = new Date(e.getFullYear(), e.getMonth(), 1), l = new Date(e.getFullYear(), e.getMonth() + 1, 0).getDate(), h = new Date(e.getFullYear(), e.getMonth(), 0).getDate(), r = i.getDay(), c = l + r, s = [];
|
|
4
|
+
let a = 0, u = 0, n = 0, o;
|
|
5
|
+
for (let t = 0; t < D; t++)
|
|
6
|
+
t > 6 && t % 7 === 0 && n++, s[n] || (s[n] = []), t < r ? o = {
|
|
7
|
+
date: new Date(e.getFullYear(), e.getMonth() - 1, h - r + t + 1),
|
|
8
|
+
outsideMonth: !0
|
|
9
|
+
} : t < c ? o = { date: new Date(e.getFullYear(), e.getMonth(), t - r + 1) } : o = {
|
|
10
|
+
date: new Date(e.getFullYear(), e.getMonth() + 1, t - r - l + 1),
|
|
11
|
+
outsideMonth: !0
|
|
12
|
+
}, f(g, o.date) && (a = n + 1, u = s[n].length, o.isSelected = !0), s[n].push(o);
|
|
13
|
+
return [s, a, u];
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
w as generateWeeks
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=()=>{const e=new Intl.DateTimeFormat(void 0,{weekday:"long"}).format,t=new Date(1970,0,1),n=new Date(1970,0,2),o=new Date(1970,0,3),a=new Date(1970,0,4),s=new Date(1970,0,5),u=new Date(1970,0,6),r=new Date(1970,0,7);return{sun:e(a),mon:e(s),tue:e(u),wed:e(r),thu:e(t),fri:e(n),sat:e(o)}};exports.getDayOfWeek=c;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const D = () => {
|
|
2
|
+
const t = new Intl.DateTimeFormat(void 0, { weekday: "long" }).format, e = new Date(1970, 0, 1), n = new Date(1970, 0, 2), o = new Date(1970, 0, 3), a = new Date(1970, 0, 4), s = new Date(1970, 0, 5), w = new Date(1970, 0, 6), c = new Date(1970, 0, 7);
|
|
3
|
+
return {
|
|
4
|
+
sun: t(a),
|
|
5
|
+
mon: t(s),
|
|
6
|
+
tue: t(w),
|
|
7
|
+
wed: t(c),
|
|
8
|
+
thu: t(e),
|
|
9
|
+
fri: t(n),
|
|
10
|
+
sat: t(o)
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
D as getDayOfWeek
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=()=>{const t=new Intl.DateTimeFormat(void 0,{month:"long"}).format;return Array(12).fill(null).map((n,e)=>t(new Date(1970,e,1)))};exports.getMonths=o;
|