@strapi/design-system 0.0.0-3cf3ff39
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 +7 -0
- package/README.md +47 -0
- package/dist/Accordion/Accordion.cjs +23 -0
- package/dist/Accordion/Accordion.js +38 -0
- package/dist/Accordion/AccordionContent.cjs +1 -0
- package/dist/Accordion/AccordionContent.js +13 -0
- package/dist/Accordion/AccordionContext.cjs +1 -0
- package/dist/Accordion/AccordionContext.js +12 -0
- package/dist/Accordion/AccordionGroup.cjs +47 -0
- package/dist/Accordion/AccordionGroup.js +60 -0
- package/dist/Accordion/AccordionToggle.cjs +28 -0
- package/dist/Accordion/AccordionToggle.js +53 -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 +46 -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 +18 -0
- package/dist/Avatar/Avatar.js +39 -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 +4 -0
- package/dist/Badge/Badge.js +14 -0
- package/dist/Badge/index.cjs +1 -0
- package/dist/Badge/index.js +4 -0
- package/dist/BaseButton/BaseButton.cjs +17 -0
- package/dist/BaseButton/BaseButton.js +27 -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 +80 -0
- package/dist/BaseCheckbox/assets/checkmark-black.svg.cjs +1 -0
- package/dist/BaseCheckbox/assets/checkmark-black.svg.js +4 -0
- package/dist/BaseCheckbox/assets/checkmark.svg.cjs +1 -0
- package/dist/BaseCheckbox/assets/checkmark.svg.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 +1 -0
- package/dist/BaseLink/BaseLink.js +8 -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 +58 -0
- package/dist/BaseRadio/RadioGroup.cjs +1 -0
- package/dist/BaseRadio/RadioGroup.js +15 -0
- package/dist/BaseRadio/context.cjs +1 -0
- package/dist/BaseRadio/context.js +10 -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 +79 -0
- package/dist/Box/Box.js +95 -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 +30 -0
- package/dist/Breadcrumbs/index.cjs +1 -0
- package/dist/Breadcrumbs/index.js +5 -0
- package/dist/Button/Button.cjs +31 -0
- package/dist/Button/Button.js +51 -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 +12 -0
- package/dist/Card/CardAction.cjs +6 -0
- package/dist/Card/CardAction.js +20 -0
- package/dist/Card/CardAsset.cjs +19 -0
- package/dist/Card/CardAsset.js +28 -0
- package/dist/Card/CardBadge.cjs +6 -0
- package/dist/Card/CardBadge.js +12 -0
- package/dist/Card/CardBody.cjs +1 -0
- package/dist/Card/CardBody.js +7 -0
- package/dist/Card/CardCheckbox.cjs +1 -0
- package/dist/Card/CardCheckbox.js +14 -0
- package/dist/Card/CardContent.cjs +3 -0
- package/dist/Card/CardContent.js +9 -0
- package/dist/Card/CardContext.cjs +1 -0
- package/dist/Card/CardContext.js +6 -0
- package/dist/Card/CardHeader.cjs +3 -0
- package/dist/Card/CardHeader.js +9 -0
- package/dist/Card/CardTimer.cjs +1 -0
- package/dist/Card/CardTimer.js +7 -0
- package/dist/Card/CardTitle.cjs +1 -0
- package/dist/Card/CardTitle.js +11 -0
- package/dist/Card/index.cjs +1 -0
- package/dist/Card/index.js +23 -0
- package/dist/CarouselInput/Carousel.cjs +13 -0
- package/dist/CarouselInput/Carousel.js +40 -0
- package/dist/CarouselInput/CarouselActions.cjs +1 -0
- package/dist/CarouselInput/CarouselActions.js +6 -0
- package/dist/CarouselInput/CarouselImage.cjs +3 -0
- package/dist/CarouselInput/CarouselImage.js +17 -0
- package/dist/CarouselInput/CarouselInput.cjs +1 -0
- package/dist/CarouselInput/CarouselInput.js +15 -0
- package/dist/CarouselInput/CarouselSlide.cjs +1 -0
- package/dist/CarouselInput/CarouselSlide.js +6 -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 +28 -0
- package/dist/Checkbox/index.cjs +1 -0
- package/dist/Checkbox/index.js +4 -0
- package/dist/Combobox/Combobox.cjs +107 -0
- package/dist/Combobox/Combobox.js +175 -0
- package/dist/Combobox/ComboboxList.cjs +5 -0
- package/dist/Combobox/ComboboxList.js +10 -0
- package/dist/Combobox/ComboboxOption.cjs +1 -0
- package/dist/Combobox/ComboboxOption.js +5 -0
- package/dist/Combobox/index.cjs +1 -0
- package/dist/Combobox/index.js +7 -0
- package/dist/DatePicker/DatePicker.cjs +88 -0
- package/dist/DatePicker/DatePicker.js +397 -0
- package/dist/DatePicker/DatePickerCalendar.cjs +1 -0
- package/dist/DatePicker/DatePickerCalendar.js +43 -0
- package/dist/DatePicker/DatePickerTd.cjs +19 -0
- package/dist/DatePicker/DatePickerTd.js +29 -0
- package/dist/DatePicker/DatePickerTh.cjs +9 -0
- package/dist/DatePicker/DatePickerTh.js +18 -0
- package/dist/DatePicker/compareDates.cjs +1 -0
- package/dist/DatePicker/compareDates.js +4 -0
- package/dist/DatePicker/components.cjs +39 -0
- package/dist/DatePicker/components.js +53 -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/DateTimePicker/DateTimePicker.cjs +5 -0
- package/dist/DateTimePicker/DateTimePicker.js +91 -0
- package/dist/DateTimePicker/index.cjs +1 -0
- package/dist/DateTimePicker/index.js +5 -0
- package/dist/DateTimePicker/parseDate.cjs +1 -0
- package/dist/DateTimePicker/parseDate.js +8 -0
- package/dist/DesignSystemProvider.cjs +1 -0
- package/dist/DesignSystemProvider.js +10 -0
- package/dist/Dialog/Dialog.cjs +11 -0
- package/dist/Dialog/Dialog.js +31 -0
- package/dist/Dialog/DialogBody.cjs +10 -0
- package/dist/Dialog/DialogBody.js +17 -0
- package/dist/Dialog/DialogFooter.cjs +9 -0
- package/dist/Dialog/DialogFooter.js +16 -0
- package/dist/Dialog/index.cjs +1 -0
- package/dist/Dialog/index.js +8 -0
- package/dist/DismissibleLayer/index.cjs +1 -0
- package/dist/DismissibleLayer/index.js +5 -0
- package/dist/Divider/Divider.cjs +7 -0
- package/dist/Divider/Divider.js +13 -0
- package/dist/Divider/index.cjs +1 -0
- package/dist/Divider/index.js +4 -0
- package/dist/EmptyStateLayout/EmptyStateLayout.cjs +5 -0
- package/dist/EmptyStateLayout/EmptyStateLayout.js +13 -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 +5 -0
- package/dist/Field/Field.cjs +1 -0
- package/dist/Field/Field.js +12 -0
- package/dist/Field/FieldAction.cjs +4 -0
- package/dist/Field/FieldAction.js +16 -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 +10 -0
- package/dist/Field/FieldHint.cjs +1 -0
- package/dist/Field/FieldHint.js +10 -0
- package/dist/Field/FieldInput.cjs +41 -0
- package/dist/Field/FieldInput.js +63 -0
- package/dist/Field/FieldLabel.cjs +12 -0
- package/dist/Field/FieldLabel.js +25 -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 +19 -0
- package/dist/Flex/index.cjs +1 -0
- package/dist/Flex/index.js +4 -0
- package/dist/FocusTrap/FocusTrap.cjs +1 -0
- package/dist/FocusTrap/FocusTrap.js +33 -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 +26 -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 +34 -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 +15 -0
- package/dist/Icon/index.cjs +1 -0
- package/dist/Icon/index.js +4 -0
- package/dist/IconButton/IconButton.cjs +81 -0
- package/dist/IconButton/IconButton.js +101 -0
- package/dist/IconButton/index.cjs +1 -0
- package/dist/IconButton/index.js +5 -0
- package/dist/JSONInput/JSONInput.cjs +1 -0
- package/dist/JSONInput/JSONInput.js +64 -0
- package/dist/JSONInput/JSONInputContainer.cjs +33 -0
- package/dist/JSONInput/JSONInputContainer.js +39 -0
- package/dist/JSONInput/index.cjs +1 -0
- package/dist/JSONInput/index.js +4 -0
- package/dist/JSONInput/utils/decorationExtension.cjs +1 -0
- package/dist/JSONInput/utils/decorationExtension.js +27 -0
- package/dist/KeyboardNavigable/KeyboardNavigable.cjs +1 -0
- package/dist/KeyboardNavigable/KeyboardNavigable.js +46 -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 +29 -0
- package/dist/Layout/ContentLayout.cjs +1 -0
- package/dist/Layout/ContentLayout.js +11 -0
- package/dist/Layout/GridLayout.cjs +5 -0
- package/dist/Layout/GridLayout.js +13 -0
- package/dist/Layout/HeaderLayout.cjs +4 -0
- package/dist/Layout/HeaderLayout.js +127 -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 +17 -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 +44 -0
- package/dist/Link/index.cjs +1 -0
- package/dist/Link/index.js +4 -0
- package/dist/LinkButton/LinkButton.cjs +15 -0
- package/dist/LinkButton/LinkButton.js +29 -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 +7 -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 +6 -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 +20 -0
- package/dist/Loader/assets/loader.svg.cjs +1 -0
- package/dist/Loader/assets/loader.svg.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 +12 -0
- package/dist/Main/SkipToContent.cjs +8 -0
- package/dist/Main/SkipToContent.js +14 -0
- package/dist/Main/index.cjs +1 -0
- package/dist/Main/index.js +6 -0
- package/dist/MainNav/MainNav.cjs +4 -0
- package/dist/MainNav/MainNav.js +33 -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 +49 -0
- package/dist/MainNav/NavCondense.cjs +20 -0
- package/dist/MainNav/NavCondense.js +40 -0
- package/dist/MainNav/NavFooter.cjs +1 -0
- package/dist/MainNav/NavFooter.js +12 -0
- package/dist/MainNav/NavLink.cjs +69 -0
- package/dist/MainNav/NavLink.js +103 -0
- package/dist/MainNav/NavSection.cjs +1 -0
- package/dist/MainNav/NavSection.js +46 -0
- package/dist/MainNav/NavSections.cjs +4 -0
- package/dist/MainNav/NavSections.js +26 -0
- package/dist/MainNav/NavUser.cjs +3 -0
- package/dist/MainNav/NavUser.js +32 -0
- package/dist/MainNav/index.cjs +1 -0
- package/dist/MainNav/index.js +18 -0
- package/dist/ModalLayout/ModalBody.cjs +4 -0
- package/dist/ModalLayout/ModalBody.js +10 -0
- package/dist/ModalLayout/ModalContext.cjs +1 -0
- package/dist/ModalLayout/ModalContext.js +7 -0
- package/dist/ModalLayout/ModalFooter.cjs +4 -0
- package/dist/ModalLayout/ModalFooter.js +11 -0
- package/dist/ModalLayout/ModalHeader.cjs +4 -0
- package/dist/ModalLayout/ModalHeader.js +17 -0
- package/dist/ModalLayout/ModalLayout.cjs +4 -0
- package/dist/ModalLayout/ModalLayout.js +16 -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 +79 -0
- package/dist/NumberInput/index.cjs +1 -0
- package/dist/NumberInput/index.js +4 -0
- package/dist/Pagination/Pagination.cjs +1 -0
- package/dist/Pagination/Pagination.js +12 -0
- package/dist/Pagination/PaginationContext.cjs +1 -0
- package/dist/Pagination/PaginationContext.js +6 -0
- package/dist/Pagination/assets/next.svg.cjs +1 -0
- package/dist/Pagination/assets/next.svg.js +4 -0
- package/dist/Pagination/assets/previous.svg.cjs +1 -0
- package/dist/Pagination/assets/previous.svg.js +4 -0
- package/dist/Pagination/components.cjs +33 -0
- package/dist/Pagination/components.js +67 -0
- package/dist/Pagination/index.cjs +1 -0
- package/dist/Pagination/index.js +9 -0
- package/dist/Popover/Popover.cjs +25 -0
- package/dist/Popover/Popover.js +127 -0
- package/dist/Popover/index.cjs +1 -0
- package/dist/Popover/index.js +7 -0
- package/dist/Popover/primitives.cjs +1 -0
- package/dist/Popover/primitives.js +5 -0
- package/dist/Portal/Portal.cjs +1 -0
- package/dist/Portal/Portal.js +9 -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 +17 -0
- package/dist/ProgressBar/index.cjs +1 -0
- package/dist/ProgressBar/index.js +4 -0
- package/dist/Radio/Radio.cjs +1 -0
- package/dist/Radio/Radio.js +8 -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 +60 -0
- package/dist/RawTable/RawTable.cjs +1 -0
- package/dist/RawTable/RawTable.js +53 -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 +9 -0
- package/dist/RawTable/RawThead.cjs +1 -0
- package/dist/RawTable/RawThead.js +9 -0
- package/dist/RawTable/RawTr.cjs +1 -0
- package/dist/RawTable/RawTr.js +13 -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 +5 -0
- package/dist/Searchbar/Searchbar.cjs +28 -0
- package/dist/Searchbar/Searchbar.js +47 -0
- package/dist/Searchbar/index.cjs +1 -0
- package/dist/Searchbar/index.js +6 -0
- package/dist/Select/MultiSelect.cjs +30 -0
- package/dist/Select/MultiSelect.js +75 -0
- package/dist/Select/MultiSelectNested.cjs +3 -0
- package/dist/Select/MultiSelectNested.js +9 -0
- package/dist/Select/OptGroup.cjs +5 -0
- package/dist/Select/OptGroup.js +10 -0
- package/dist/Select/Option.cjs +5 -0
- package/dist/Select/Option.js +16 -0
- package/dist/Select/Select.cjs +6 -0
- package/dist/Select/Select.js +19 -0
- package/dist/Select/SelectList.cjs +5 -0
- package/dist/Select/SelectList.js +85 -0
- package/dist/Select/SelectParts.cjs +83 -0
- package/dist/Select/SelectParts.js +110 -0
- package/dist/Select/SingleSelect.cjs +1 -0
- package/dist/Select/SingleSelect.js +44 -0
- package/dist/Select/index.cjs +1 -0
- package/dist/Select/index.js +19 -0
- package/dist/SimpleMenu/SimpleMenu.cjs +35 -0
- package/dist/SimpleMenu/SimpleMenu.js +198 -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 +35 -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 +22 -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 +22 -0
- package/dist/SubNav/SubNavHeader.cjs +4 -0
- package/dist/SubNav/SubNavHeader.js +86 -0
- package/dist/SubNav/SubNavLink.cjs +39 -0
- package/dist/SubNav/SubNavLink.js +81 -0
- package/dist/SubNav/SubNavLinkSection.cjs +19 -0
- package/dist/SubNav/SubNavLinkSection.js +51 -0
- package/dist/SubNav/SubNavSection.cjs +8 -0
- package/dist/SubNav/SubNavSection.js +64 -0
- package/dist/SubNav/SubNavSectionLabel.cjs +9 -0
- package/dist/SubNav/SubNavSectionLabel.js +47 -0
- package/dist/SubNav/SubNavSections.cjs +1 -0
- package/dist/SubNav/SubNavSections.js +22 -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 +50 -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 +38 -0
- package/dist/Table/TFooter.cjs +22 -0
- package/dist/Table/TFooter.js +43 -0
- package/dist/Table/Table.cjs +34 -0
- package/dist/Table/Table.js +70 -0
- package/dist/Table/Tbody.cjs +5 -0
- package/dist/Table/Tbody.js +12 -0
- package/dist/Table/Thead.cjs +3 -0
- package/dist/Table/Thead.js +10 -0
- package/dist/Table/Tr.cjs +20 -0
- package/dist/Table/Tr.js +27 -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 +16 -0
- package/dist/Tabs/TabPanels.cjs +1 -0
- package/dist/Tabs/TabPanels.js +14 -0
- package/dist/Tabs/Tabs.cjs +5 -0
- package/dist/Tabs/Tabs.js +76 -0
- package/dist/Tabs/TabsContext.cjs +1 -0
- package/dist/Tabs/TabsContext.js +13 -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/Tag/Tag.cjs +14 -0
- package/dist/Tag/Tag.js +23 -0
- package/dist/Tag/index.cjs +1 -0
- package/dist/Tag/index.js +4 -0
- package/dist/TextButton/TextButton.cjs +26 -0
- package/dist/TextButton/TextButton.js +40 -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 +21 -0
- package/dist/TextInput/index.cjs +1 -0
- package/dist/TextInput/index.js +4 -0
- package/dist/Textarea/Textarea.cjs +17 -0
- package/dist/Textarea/Textarea.js +39 -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 +180 -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 +8 -0
- package/dist/TimePicker/TimePicker.js +83 -0
- package/dist/TimePicker/index.cjs +1 -0
- package/dist/TimePicker/index.js +5 -0
- package/dist/ToggleCheckbox/ToggleCheckbox.cjs +36 -0
- package/dist/ToggleCheckbox/ToggleCheckbox.js +59 -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 +23 -0
- package/dist/ToggleInput/index.cjs +1 -0
- package/dist/ToggleInput/index.js +4 -0
- package/dist/Tooltip/Tooltip.cjs +5 -0
- package/dist/Tooltip/Tooltip.js +26 -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 +17 -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 +14 -0
- package/dist/Typography/Typography.js +25 -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/context.cjs +1 -0
- package/dist/helpers/context.js +21 -0
- package/dist/helpers/deprecations.cjs +1 -0
- package/dist/helpers/deprecations.js +13 -0
- package/dist/helpers/getDefaultLocale.cjs +4 -0
- package/dist/helpers/getDefaultLocale.js +9 -0
- package/dist/helpers/getFocusableNodes.cjs +1 -0
- package/dist/helpers/getFocusableNodes.js +7 -0
- package/dist/helpers/handleResponsiveValues.cjs +1 -0
- package/dist/helpers/handleResponsiveValues.js +25 -0
- package/dist/helpers/keyboardKeys.cjs +1 -0
- package/dist/helpers/keyboardKeys.js +20 -0
- package/dist/helpers/objects.cjs +1 -0
- package/dist/helpers/objects.js +10 -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/strings.cjs +1 -0
- package/dist/helpers/strings.js +4 -0
- package/dist/helpers/theme.cjs +1 -0
- package/dist/helpers/theme.js +7 -0
- package/dist/helpers/useElementOnScreen.cjs +4 -0
- package/dist/helpers/useElementOnScreen.js +11 -0
- package/dist/helpers/useId.cjs +4 -0
- package/dist/helpers/useId.js +11 -0
- package/dist/helpers/useIntersection.cjs +4 -0
- package/dist/helpers/useIntersection.js +11 -0
- package/dist/helpers/useLockScroll.cjs +4 -0
- package/dist/helpers/useLockScroll.js +11 -0
- package/dist/helpers/usePrevious.cjs +4 -0
- package/dist/helpers/usePrevious.js +11 -0
- package/dist/helpers/useResizeObserver.cjs +4 -0
- package/dist/helpers/useResizeObserver.js +11 -0
- package/dist/hooks/useComposeRefs.cjs +1 -0
- package/dist/hooks/useComposeRefs.js +14 -0
- package/dist/hooks/useControllableState.cjs +1 -0
- package/dist/hooks/useControllableState.js +22 -0
- package/dist/hooks/useDateFormatter.cjs +1 -0
- package/dist/hooks/useDateFormatter.js +20 -0
- 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 -0
- package/dist/hooks/useIntersection.js +23 -0
- 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/index.cjs +1 -0
- package/dist/index.js +311 -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 +22 -0
- package/dist/themes/utils.cjs +41 -0
- package/dist/themes/utils.js +47 -0
- package/dist/v2/Breadcrumbs/Breadcrumbs.cjs +9 -0
- package/dist/v2/Breadcrumbs/Breadcrumbs.js +33 -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 +30 -0
- package/dist/v2/Breadcrumbs/CrumbSimpleMenu.cjs +8 -0
- package/dist/v2/Breadcrumbs/CrumbSimpleMenu.js +23 -0
- package/dist/v2/Breadcrumbs/Divider.cjs +1 -0
- package/dist/v2/Breadcrumbs/Divider.js +9 -0
- package/dist/v2/Breadcrumbs/index.cjs +1 -0
- package/dist/v2/Breadcrumbs/index.js +10 -0
- package/dist/v2/Link/Link.cjs +25 -0
- package/dist/v2/Link/Link.js +36 -0
- package/dist/v2/Link/index.cjs +1 -0
- package/dist/v2/Link/index.js +4 -0
- package/dist/v2/LinkButton/LinkButton.cjs +20 -0
- package/dist/v2/LinkButton/LinkButton.js +35 -0
- package/dist/v2/LinkButton/index.cjs +1 -0
- package/dist/v2/LinkButton/index.js +4 -0
- package/dist/v2/MainNav/MainNav.cjs +4 -0
- package/dist/v2/MainNav/MainNav.js +33 -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 +50 -0
- package/dist/v2/MainNav/NavCondense.cjs +20 -0
- package/dist/v2/MainNav/NavCondense.js +40 -0
- package/dist/v2/MainNav/NavFooter.cjs +1 -0
- package/dist/v2/MainNav/NavFooter.js +12 -0
- package/dist/v2/MainNav/NavLink.cjs +69 -0
- package/dist/v2/MainNav/NavLink.js +103 -0
- package/dist/v2/MainNav/NavSection.cjs +1 -0
- package/dist/v2/MainNav/NavSection.js +46 -0
- package/dist/v2/MainNav/NavSections.cjs +4 -0
- package/dist/v2/MainNav/NavSections.js +26 -0
- package/dist/v2/MainNav/NavUser.cjs +3 -0
- package/dist/v2/MainNav/NavUser.js +32 -0
- package/dist/v2/MainNav/index.cjs +1 -0
- package/dist/v2/MainNav/index.js +18 -0
- package/dist/v2/Pagination/Pagination.cjs +5 -0
- package/dist/v2/Pagination/Pagination.js +26 -0
- package/dist/v2/Pagination/PaginationContext.cjs +1 -0
- package/dist/v2/Pagination/PaginationContext.js +6 -0
- package/dist/v2/Pagination/assets/next.svg.cjs +1 -0
- package/dist/v2/Pagination/assets/next.svg.js +4 -0
- package/dist/v2/Pagination/assets/previous.svg.cjs +1 -0
- package/dist/v2/Pagination/assets/previous.svg.js +4 -0
- package/dist/v2/Pagination/components.cjs +36 -0
- package/dist/v2/Pagination/components.js +95 -0
- package/dist/v2/Pagination/index.cjs +1 -0
- package/dist/v2/Pagination/index.js +9 -0
- package/dist/v2/SimpleMenu/Menu.cjs +65 -0
- package/dist/v2/SimpleMenu/Menu.js +89 -0
- package/dist/v2/SimpleMenu/SimpleMenu.cjs +1 -0
- package/dist/v2/SimpleMenu/SimpleMenu.js +27 -0
- package/dist/v2/SimpleMenu/index.cjs +1 -0
- package/dist/v2/SimpleMenu/index.js +7 -0
- package/dist/v2/SubNav/SubNav.cjs +10 -0
- package/dist/v2/SubNav/SubNav.js +22 -0
- package/dist/v2/SubNav/SubNavHeader.cjs +4 -0
- package/dist/v2/SubNav/SubNavHeader.js +86 -0
- package/dist/v2/SubNav/SubNavLink.cjs +39 -0
- package/dist/v2/SubNav/SubNavLink.js +84 -0
- package/dist/v2/SubNav/SubNavLinkSection.cjs +19 -0
- package/dist/v2/SubNav/SubNavLinkSection.js +50 -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 +47 -0
- package/dist/v2/SubNav/SubNavSections.cjs +1 -0
- package/dist/v2/SubNav/SubNavSections.js +22 -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 +55 -0
- package/package.json +69 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { jsx as r, jsxs as D } from "react/jsx-runtime";
|
|
2
|
+
import * as m from "react";
|
|
3
|
+
import { Clock as M } from "@strapi/icons";
|
|
4
|
+
import S from "styled-components";
|
|
5
|
+
import { ComboboxInput as $, Option as v } from "../Combobox/Combobox.js";
|
|
6
|
+
import { useDesignSystem as L } from "../DesignSystemProvider.js";
|
|
7
|
+
import { useControllableState as P } from "../hooks/useControllableState.js";
|
|
8
|
+
import { useDateFormatter as j } from "../hooks/useDateFormatter.js";
|
|
9
|
+
import { useId as V } from "../hooks/useId.js";
|
|
10
|
+
import { Field as E } from "../Field/Field.js";
|
|
11
|
+
import { Flex as O } from "../Flex/Flex.js";
|
|
12
|
+
import { FieldLabel as _ } from "../Field/FieldLabel.js";
|
|
13
|
+
import { FieldHint as q } from "../Field/FieldHint.js";
|
|
14
|
+
import { FieldError as z } from "../Field/FieldError.js";
|
|
15
|
+
const h = (o) => !!o.match(/^[^a-zA-Z]*$/), H = ({
|
|
16
|
+
id: o,
|
|
17
|
+
step: a = 15,
|
|
18
|
+
/**
|
|
19
|
+
* @preserve
|
|
20
|
+
* @deprecated This is no longer used.
|
|
21
|
+
*/
|
|
22
|
+
ariaLabel: b,
|
|
23
|
+
/**
|
|
24
|
+
* @preserve
|
|
25
|
+
* @deprecated This is no longer used.
|
|
26
|
+
*/
|
|
27
|
+
selectButtonTitle: C,
|
|
28
|
+
value: n,
|
|
29
|
+
defaultValue: c,
|
|
30
|
+
onChange: d,
|
|
31
|
+
...u
|
|
32
|
+
}) => {
|
|
33
|
+
const w = L("TimePicker"), k = V(o), [I, l] = m.useState(""), [x, f] = P({
|
|
34
|
+
prop: n,
|
|
35
|
+
defaultProp: c,
|
|
36
|
+
onChange: d
|
|
37
|
+
}), s = j(w.locale, {
|
|
38
|
+
hour: "2-digit",
|
|
39
|
+
minute: "2-digit"
|
|
40
|
+
}), p = m.useMemo(() => {
|
|
41
|
+
const e = s.formatToParts(/* @__PURE__ */ new Date()), { value: t } = e.find((i) => i.type === "literal");
|
|
42
|
+
return t;
|
|
43
|
+
}, [s]), A = m.useMemo(() => {
|
|
44
|
+
const e = 60 / a;
|
|
45
|
+
return [...Array(24).keys()].flatMap((t) => [...Array(e).keys()].map((i) => s.format(new Date(0, 0, 0, t, i * a))));
|
|
46
|
+
}, [a, s]), F = (e) => {
|
|
47
|
+
(!e || h(e)) && l(e);
|
|
48
|
+
}, y = (e) => {
|
|
49
|
+
const [t, i] = e.split(p);
|
|
50
|
+
if (!t && !i)
|
|
51
|
+
return;
|
|
52
|
+
const T = Number(t ?? "0"), g = Number(i ?? "0");
|
|
53
|
+
if (!(T > 23 || g > 59))
|
|
54
|
+
return s.format(new Date(0, 0, 0, T, g));
|
|
55
|
+
}, N = (e) => {
|
|
56
|
+
const t = y(e.target.value);
|
|
57
|
+
t ? (l(t), f(t)) : l(x);
|
|
58
|
+
}, B = (e) => {
|
|
59
|
+
if (typeof e < "u") {
|
|
60
|
+
const t = y(e);
|
|
61
|
+
f(t);
|
|
62
|
+
} else
|
|
63
|
+
f(e);
|
|
64
|
+
};
|
|
65
|
+
return m.useEffect(() => {
|
|
66
|
+
const e = typeof n > "u" ? "" : n;
|
|
67
|
+
h(e) && l(e);
|
|
68
|
+
}, [n, l]), r($, { ...u, value: x, onChange: B, isPrintableCharacter: h, allowCustomValue: !0, placeholder: `--${p}--`, autocomplete: "none", startIcon: r(R, {}), id: k, inputMode: "numeric", pattern: `\\d{2}${p}\\d{2}`, textValue: I, onTextValueChange: F, onBlur: N, children: A.map((e) => r(v, { value: e, children: e }, e)) });
|
|
69
|
+
}, R = S(M)`
|
|
70
|
+
height: 1rem;
|
|
71
|
+
width: 1rem;
|
|
72
|
+
|
|
73
|
+
& > path {
|
|
74
|
+
fill: ${({ theme: o }) => o.colors.neutral500};
|
|
75
|
+
}
|
|
76
|
+
`, ne = ({ label: o, error: a, hint: b, id: C, required: n, labelAction: c, ...d }) => {
|
|
77
|
+
const u = V(C);
|
|
78
|
+
return r(E, { hint: b, error: a, id: u, required: n, children: D(O, { direction: "column", alignItems: "stretch", gap: 1, children: [r(_, { action: c, children: o }), r(H, { id: u, error: a, required: n, ...d }), r(q, {}), r(z, {})] }) });
|
|
79
|
+
};
|
|
80
|
+
export {
|
|
81
|
+
ne as TimePicker,
|
|
82
|
+
H as TimePickerInput
|
|
83
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./TimePicker.cjs");exports.TimePicker=e.TimePicker;exports.TimePickerInput=e.TimePickerInput;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),R=require("react"),k=require("styled-components"),m=require("../themes/utils.cjs"),_=require("../Box/Box.cjs"),S=require("../Flex/Flex.cjs"),B=require("../Field/FieldContext.cjs"),F=require("../VisuallyHidden/VisuallyHidden.cjs"),f=require("../Typography/Typography.cjs"),x=e=>e&&e.__esModule?e:{default:e},L=x(R),a=x(k),W=a.default.label`
|
|
2
|
+
position: relative;
|
|
3
|
+
display: inline-block;
|
|
4
|
+
z-index: 0;
|
|
5
|
+
width: 100%;
|
|
6
|
+
`,z=a.default(_.Box)`
|
|
7
|
+
cursor: ${({disabled:e})=>e?"not-allowed":void 0};
|
|
8
|
+
// Masks the background of each value
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
flex-wrap: wrap;
|
|
11
|
+
|
|
12
|
+
${m.inputFocusStyle()}
|
|
13
|
+
`,h=a.default(S.Flex).attrs({hasRadius:!0})`
|
|
14
|
+
background-color: ${({theme:e,checked:o,disabled:l})=>o?l?e.colors.neutral200:e.colors.neutral0:"transparent"};
|
|
15
|
+
border: 1px solid
|
|
16
|
+
${({theme:e,checked:o,disabled:l})=>o&&o!==null?l?e.colors.neutral300:e.colors.neutral200:l?e.colors.neutral150:e.colors.neutral100};
|
|
17
|
+
position: relative;
|
|
18
|
+
user-select: none;
|
|
19
|
+
z-index: 2;
|
|
20
|
+
flex: 1 1 50%;
|
|
21
|
+
/**
|
|
22
|
+
We declare the defined value because we want the height of the input when
|
|
23
|
+
the values are in a row to be 40px. But defining a height on the label
|
|
24
|
+
would break the input when it wraps.
|
|
25
|
+
*/
|
|
26
|
+
padding-top: ${({size:e})=>`${e==="S"?"2px":"6px"}`};
|
|
27
|
+
padding-bottom: ${({size:e})=>`${e==="S"?"2px":"6px"}`};
|
|
28
|
+
`,M=a.default.input`
|
|
29
|
+
height: 100%;
|
|
30
|
+
left: 0;
|
|
31
|
+
opacity: 0;
|
|
32
|
+
position: absolute;
|
|
33
|
+
top: 0;
|
|
34
|
+
z-index: 1;
|
|
35
|
+
width: 100%;
|
|
36
|
+
`,g=L.default.forwardRef(({size:e="M",onLabel:o,offLabel:l,children:b,checked:r=!1,disabled:t=!1,onChange:u,...y},C)=>{const{error:d,hint:w,id:c,name:j,required:q}=B.useField(),p="neutral600";let T=!r&&r!==null?"danger700":p,$=r?"primary600":p;const v=s=>{t||u&&u(s)};let i;return d?i=`${c}-error`:w&&(i=`${c}-hint`),n.jsxs(W,{children:[n.jsx(F.VisuallyHidden,{children:b}),n.jsxs(z,{hasRadius:!0,disabled:t,padding:1,display:"flex",background:t?"neutral150":"neutral100",borderStyle:"solid",borderWidth:"1px",borderColor:"neutral200",hasError:!!d,children:[n.jsx(h,{size:e,paddingLeft:3,paddingRight:3,justifyContent:"center",alignItems:"center","aria-hidden":!0,checked:r===null?!1:!r,disabled:t,children:n.jsx(f.Typography,{variant:"pi",fontWeight:"bold",textTransform:"uppercase",textColor:t?"neutral700":T,children:l})}),n.jsx(h,{size:e,paddingLeft:3,paddingRight:3,justifyContent:"center",alignItems:"center","aria-hidden":!0,checked:r===null?!1:r,disabled:t,children:n.jsx(f.Typography,{variant:"pi",fontWeight:"bold",textTransform:"uppercase",textColor:t?"neutral700":$,children:o})}),n.jsx(M,{type:"checkbox","aria-disabled":t,"aria-describedby":i,onChange:s=>v(s),name:j,ref:C,"aria-required":q,...y,checked:!(r===null||!r)})]})]})});g.displayName="ToggleCheckbox";exports.ToggleCheckbox=g;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { jsxs as c, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import R from "react";
|
|
3
|
+
import i from "styled-components";
|
|
4
|
+
import { inputFocusStyle as T } from "../themes/utils.js";
|
|
5
|
+
import { Box as L } from "../Box/Box.js";
|
|
6
|
+
import { Flex as W } from "../Flex/Flex.js";
|
|
7
|
+
import { useField as j } from "../Field/FieldContext.js";
|
|
8
|
+
import { VisuallyHidden as z } from "../VisuallyHidden/VisuallyHidden.js";
|
|
9
|
+
import { Typography as h } from "../Typography/Typography.js";
|
|
10
|
+
const B = i.label`
|
|
11
|
+
position: relative;
|
|
12
|
+
display: inline-block;
|
|
13
|
+
z-index: 0;
|
|
14
|
+
width: 100%;
|
|
15
|
+
`, S = i(L)`
|
|
16
|
+
cursor: ${({ disabled: e }) => e ? "not-allowed" : void 0};
|
|
17
|
+
// Masks the background of each value
|
|
18
|
+
overflow: hidden;
|
|
19
|
+
flex-wrap: wrap;
|
|
20
|
+
|
|
21
|
+
${T()}
|
|
22
|
+
`, g = i(W).attrs({
|
|
23
|
+
hasRadius: !0
|
|
24
|
+
})`
|
|
25
|
+
background-color: ${({ theme: e, checked: o, disabled: n }) => o ? n ? e.colors.neutral200 : e.colors.neutral0 : "transparent"};
|
|
26
|
+
border: 1px solid
|
|
27
|
+
${({ theme: e, checked: o, disabled: n }) => o && o !== null ? n ? e.colors.neutral300 : e.colors.neutral200 : n ? e.colors.neutral150 : e.colors.neutral100};
|
|
28
|
+
position: relative;
|
|
29
|
+
user-select: none;
|
|
30
|
+
z-index: 2;
|
|
31
|
+
flex: 1 1 50%;
|
|
32
|
+
/**
|
|
33
|
+
We declare the defined value because we want the height of the input when
|
|
34
|
+
the values are in a row to be 40px. But defining a height on the label
|
|
35
|
+
would break the input when it wraps.
|
|
36
|
+
*/
|
|
37
|
+
padding-top: ${({ size: e }) => `${e === "S" ? "2px" : "6px"}`};
|
|
38
|
+
padding-bottom: ${({ size: e }) => `${e === "S" ? "2px" : "6px"}`};
|
|
39
|
+
`, F = i.input`
|
|
40
|
+
height: 100%;
|
|
41
|
+
left: 0;
|
|
42
|
+
opacity: 0;
|
|
43
|
+
position: absolute;
|
|
44
|
+
top: 0;
|
|
45
|
+
z-index: 1;
|
|
46
|
+
width: 100%;
|
|
47
|
+
`, I = R.forwardRef(({ size: e = "M", onLabel: o, offLabel: n, children: x, checked: r = !1, disabled: t = !1, onChange: s, ...b }, m) => {
|
|
48
|
+
const { error: d, hint: y, id: p, name: w, required: C } = j(), f = "neutral600";
|
|
49
|
+
let $ = !r && r !== null ? "danger700" : f, v = r ? "primary600" : f;
|
|
50
|
+
const k = (u) => {
|
|
51
|
+
t || s && s(u);
|
|
52
|
+
};
|
|
53
|
+
let l;
|
|
54
|
+
return d ? l = `${p}-error` : y && (l = `${p}-hint`), c(B, { children: [a(z, { children: x }), c(S, { hasRadius: !0, disabled: t, padding: 1, display: "flex", background: t ? "neutral150" : "neutral100", borderStyle: "solid", borderWidth: "1px", borderColor: "neutral200", hasError: !!d, children: [a(g, { size: e, paddingLeft: 3, paddingRight: 3, justifyContent: "center", alignItems: "center", "aria-hidden": !0, checked: r === null ? !1 : !r, disabled: t, children: a(h, { variant: "pi", fontWeight: "bold", textTransform: "uppercase", textColor: t ? "neutral700" : $, children: n }) }), a(g, { size: e, paddingLeft: 3, paddingRight: 3, justifyContent: "center", alignItems: "center", "aria-hidden": !0, checked: r === null ? !1 : r, disabled: t, children: a(h, { variant: "pi", fontWeight: "bold", textTransform: "uppercase", textColor: t ? "neutral700" : v, children: o }) }), a(F, { type: "checkbox", "aria-disabled": t, "aria-describedby": l, onChange: (u) => k(u), name: w, ref: m, "aria-required": C, ...b, checked: !(r === null || !r) })] })] });
|
|
55
|
+
});
|
|
56
|
+
I.displayName = "ToggleCheckbox";
|
|
57
|
+
export {
|
|
58
|
+
I as ToggleCheckbox
|
|
59
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ToggleCheckbox.cjs");exports.ToggleCheckbox=e.ToggleCheckbox;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),j=require("styled-components"),p=require("../hooks/useId.cjs"),m=require("../ToggleCheckbox/ToggleCheckbox.cjs"),T=require("../Field/Field.cjs"),I=require("../TextButton/TextButton.cjs"),o=require("../Flex/Flex.cjs"),y=require("../Field/FieldLabel.cjs"),_=require("../Field/FieldHint.cjs"),b=require("../Field/FieldError.cjs"),k=t=>t&&t.__esModule?t:{default:t},d=k(j),B=d.default(T.Field)`
|
|
2
|
+
max-width: 320px;
|
|
3
|
+
`,C=d.default(I.TextButton)`
|
|
4
|
+
align-self: flex-end;
|
|
5
|
+
margin-left: auto;
|
|
6
|
+
`,u=({disabled:t=!1,size:c="M",error:a,hint:x,label:r,name:g,labelAction:f,required:F=!1,id:h,onClear:i,clearLabel:n,checked:l=!1,...q})=>{const s=p.useId(h);return e.jsx(B,{name:g,hint:x,error:a,id:s,required:F,children:e.jsxs(o.Flex,{direction:"column",alignItems:"stretch",gap:1,children:[e.jsxs(o.Flex,{children:[e.jsx(y.FieldLabel,{action:f,children:r}),n&&i&&l!==null&&!t&&e.jsx(C,{onClick:i,children:n})]}),e.jsx(m.ToggleCheckbox,{id:s,size:c,checked:l,disabled:t,...q,children:r}),e.jsx(_.FieldHint,{}),e.jsx(b.FieldError,{})]})})};u.displayName="ToggleInput";exports.ToggleInput=u;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as r, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import p from "styled-components";
|
|
3
|
+
import { useId as F } from "../hooks/useId.js";
|
|
4
|
+
import { ToggleCheckbox as I } from "../ToggleCheckbox/ToggleCheckbox.js";
|
|
5
|
+
import { Field as T } from "../Field/Field.js";
|
|
6
|
+
import { TextButton as j } from "../TextButton/TextButton.js";
|
|
7
|
+
import { Flex as d } from "../Flex/Flex.js";
|
|
8
|
+
import { FieldLabel as k } from "../Field/FieldLabel.js";
|
|
9
|
+
import { FieldHint as y } from "../Field/FieldHint.js";
|
|
10
|
+
import { FieldError as B } from "../Field/FieldError.js";
|
|
11
|
+
const C = p(T)`
|
|
12
|
+
max-width: 320px;
|
|
13
|
+
`, q = p(j)`
|
|
14
|
+
align-self: flex-end;
|
|
15
|
+
margin-left: auto;
|
|
16
|
+
`, w = ({ disabled: e = !1, size: s = "M", error: f, hint: c, label: o, name: a, labelAction: g, required: h = !1, id: u, onClear: i, clearLabel: t, checked: n = !1, ...x }) => {
|
|
17
|
+
const l = F(u);
|
|
18
|
+
return r(C, { name: a, hint: c, error: f, id: l, required: h, children: m(d, { direction: "column", alignItems: "stretch", gap: 1, children: [m(d, { children: [r(k, { action: g, children: o }), t && i && n !== null && !e && r(q, { onClick: i, children: t })] }), r(I, { id: l, size: s, checked: n, disabled: e, ...x, children: o }), r(y, {}), r(B, {})] }) });
|
|
19
|
+
};
|
|
20
|
+
w.displayName = "ToggleInput";
|
|
21
|
+
export {
|
|
22
|
+
w as ToggleInput
|
|
23
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ToggleInput.cjs");exports.ToggleInput=e.ToggleInput;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),g=require("react"),x=require("styled-components"),j=require("./hooks/useTooltipHandlers.cjs"),h=require("./hooks/useTooltipLayout.cjs"),l=require("../hooks/useId.cjs"),T=require("../Portal/Portal.cjs"),q=require("../Box/Box.cjs"),_=require("../VisuallyHidden/VisuallyHidden.cjs"),m=require("../Typography/Typography.cjs"),v=e=>e&&e.__esModule?e:{default:e};function I(e){if(e&&e.__esModule)return e;const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const O=I(g),R=v(x),H=R.default(q.Box)`
|
|
2
|
+
/* z-index exist because of its position inside Modals */
|
|
3
|
+
z-index: 4;
|
|
4
|
+
display: ${({visible:e})=>e?"revert":"none"};
|
|
5
|
+
`,M=({children:e,label:r,description:t,delay:n=500,position:d="top",id:u,...a})=>{const i=l.useId(u),c=l.useId(),{visible:s,...p}=j.useTooltipHandlers(n),{tooltipWrapperRef:f,toggleSourceRef:b}=h.useTooltipLayout(s,d),y=O.cloneElement(e,{tabIndex:0,"aria-labelledby":r?i:void 0,"aria-describedby":t?i:void 0,...p});return o.jsxs(o.Fragment,{children:[o.jsx(T.Portal,{children:o.jsxs(H,{id:i,background:"neutral900",hasRadius:!0,padding:2,role:"tooltip",ref:f,visible:s,position:"absolute",...a,children:[s&&o.jsx(_.VisuallyHidden,{id:c,children:t}),o.jsx(m.Typography,{as:"p",variant:"pi",fontWeight:"bold",textColor:"neutral0",children:r||t})]})}),o.jsx("span",{ref:b,children:y})]})};exports.Tooltip=M;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsxs as l, Fragment as x, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import * as y from "react";
|
|
3
|
+
import g from "styled-components";
|
|
4
|
+
import { useTooltipHandlers as T } from "./hooks/useTooltipHandlers.js";
|
|
5
|
+
import { useTooltipLayout as v } from "./hooks/useTooltipLayout.js";
|
|
6
|
+
import { useId as d } from "../hooks/useId.js";
|
|
7
|
+
import { Portal as I } from "../Portal/Portal.js";
|
|
8
|
+
import { Box as R } from "../Box/Box.js";
|
|
9
|
+
import { VisuallyHidden as H } from "../VisuallyHidden/VisuallyHidden.js";
|
|
10
|
+
import { Typography as W } from "../Typography/Typography.js";
|
|
11
|
+
const j = g(R)`
|
|
12
|
+
/* z-index exist because of its position inside Modals */
|
|
13
|
+
z-index: 4;
|
|
14
|
+
display: ${({ visible: e }) => e ? "revert" : "none"};
|
|
15
|
+
`, S = ({ children: e, label: n, description: r, delay: s = 500, position: p = "top", id: a, ...m }) => {
|
|
16
|
+
const t = d(a), c = d(), { visible: i, ...f } = T(s), { tooltipWrapperRef: u, toggleSourceRef: b } = v(i, p), h = y.cloneElement(e, {
|
|
17
|
+
tabIndex: 0,
|
|
18
|
+
"aria-labelledby": n ? t : void 0,
|
|
19
|
+
"aria-describedby": r ? t : void 0,
|
|
20
|
+
...f
|
|
21
|
+
});
|
|
22
|
+
return l(x, { children: [o(I, { children: l(j, { id: t, background: "neutral900", hasRadius: !0, padding: 2, role: "tooltip", ref: u, visible: i, position: "absolute", ...m, children: [i && o(H, { id: c, children: r }), o(W, { as: "p", variant: "pi", fontWeight: "bold", textColor: "neutral0", children: n || r })] }) }), o("span", { ref: b, children: h })] });
|
|
23
|
+
};
|
|
24
|
+
export {
|
|
25
|
+
S as Tooltip
|
|
26
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react"),u=r=>{const[s,e]=o.useState(!1),t=o.useRef(null),n=()=>{typeof t.current=="number"&&(clearTimeout(t.current),t.current=null)};return o.useEffect(()=>()=>{n()},[]),{visible:s,onFocus:()=>{e(!0)},onBlur:()=>{e(!1)},onMouseEnter:()=>{t.current=setTimeout(()=>{e(!0)},r)},onMouseLeave:()=>{n(),e(!1)}}};exports.useTooltipHandlers=u;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useState as s, useRef as u, useEffect as c } from "react";
|
|
2
|
+
const p = (n) => {
|
|
3
|
+
const [r, e] = s(!1), o = u(null), t = () => {
|
|
4
|
+
typeof o.current == "number" && (clearTimeout(o.current), o.current = null);
|
|
5
|
+
};
|
|
6
|
+
return c(() => () => {
|
|
7
|
+
t();
|
|
8
|
+
}, []), { visible: r, onFocus: () => {
|
|
9
|
+
e(!0);
|
|
10
|
+
}, onBlur: () => {
|
|
11
|
+
e(!1);
|
|
12
|
+
}, onMouseEnter: () => {
|
|
13
|
+
o.current = setTimeout(() => {
|
|
14
|
+
e(!0);
|
|
15
|
+
}, n);
|
|
16
|
+
}, onMouseLeave: () => {
|
|
17
|
+
t(), e(!1);
|
|
18
|
+
} };
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
p as useTooltipHandlers
|
|
22
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react"),c=require("../utils/positionTooltip.cjs"),i=(e,u)=>{const l=o.useRef(null),r=o.useRef(null);return o.useLayoutEffect(()=>{if(e){const t=l.current,s=r.current;if(t&&s){const n=c.positionTooltip(t,s,u);t.style.left=`${n.left}px`,t.style.top=`${n.top}px`}}},[u,e]),{tooltipWrapperRef:l,toggleSourceRef:r}};exports.useTooltipLayout=i;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useRef as u, useLayoutEffect as c } from "react";
|
|
2
|
+
import { positionTooltip as f } from "../utils/positionTooltip.js";
|
|
3
|
+
const g = (o, e) => {
|
|
4
|
+
const r = u(null), l = u(null);
|
|
5
|
+
return c(() => {
|
|
6
|
+
if (o) {
|
|
7
|
+
const t = r.current, p = l.current;
|
|
8
|
+
if (t && p) {
|
|
9
|
+
const n = f(t, p, e);
|
|
10
|
+
t.style.left = `${n.left}px`, t.style.top = `${n.top}px`;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}, [e, o]), { tooltipWrapperRef: r, toggleSourceRef: l };
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
g as useTooltipLayout
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./Tooltip.cjs");exports.Tooltip=o.Tooltip;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=8,d=(h,i)=>{const f=(h.width-i.width)/2,t=i.left-f,n=i.top+i.height+s+window.pageYOffset;return{left:t,top:n}},o=(h,i)=>{const f=(h.height-i.height)/2,t=i.left+i.width+s,n=i.top-f+window.pageYOffset;return{left:t,top:n}},p=(h,i)=>{const f=(h.height-i.height)/2,t=i.left-h.width-s,n=i.top-f+window.pageYOffset;return{left:t,top:n}},e=(h,i)=>{const f=(h.width-i.width)/2;let t=i.left-f,n=i.top-h.height-s+window.pageYOffset;const w=window.innerWidth-i.right;return i.left+h.width-w>window.innerWidth?(t=i.left-h.width-s,n=i.top+window.scrollY-i.height/2):t<0?(t=i.width+i.left+s,n=i.top+window.scrollY-h.height/2+s):n<0&&t>0&&(n=i.top+i.height+s),{left:t,top:n}},r=(h,i,f)=>{const t=h.getBoundingClientRect(),n=i.getBoundingClientRect();return f==="bottom"?d(t,n):f==="right"?o(t,n):f==="left"?p(t,n):e(t,n)};exports.positionTooltip=r;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
const s = (h, i) => {
|
|
2
|
+
const f = (h.width - i.width) / 2, n = i.left - f, t = i.top + i.height + 8 + window.pageYOffset;
|
|
3
|
+
return {
|
|
4
|
+
left: n,
|
|
5
|
+
top: t
|
|
6
|
+
};
|
|
7
|
+
}, w = (h, i) => {
|
|
8
|
+
const f = (h.height - i.height) / 2, n = i.left + i.width + 8, t = i.top - f + window.pageYOffset;
|
|
9
|
+
return { left: n, top: t };
|
|
10
|
+
}, d = (h, i) => {
|
|
11
|
+
const f = (h.height - i.height) / 2, n = i.left - h.width - 8, t = i.top - f + window.pageYOffset;
|
|
12
|
+
return { left: n, top: t };
|
|
13
|
+
}, p = (h, i) => {
|
|
14
|
+
const f = (h.width - i.width) / 2;
|
|
15
|
+
let n = i.left - f, t = i.top - h.height - 8 + window.pageYOffset;
|
|
16
|
+
const E = window.innerWidth - i.right;
|
|
17
|
+
return i.left + h.width - E > window.innerWidth ? (n = i.left - h.width - 8, t = i.top + window.scrollY - i.height / 2) : n < 0 ? (n = i.width + i.left + 8, t = i.top + window.scrollY - h.height / 2 + 8) : t < 0 && n > 0 && (t = i.top + i.height + 8), {
|
|
18
|
+
left: n,
|
|
19
|
+
top: t
|
|
20
|
+
};
|
|
21
|
+
}, e = (h, i, f) => {
|
|
22
|
+
const n = h.getBoundingClientRect(), t = i.getBoundingClientRect();
|
|
23
|
+
return f === "bottom" ? s(n, t) : f === "right" ? w(n, t) : f === "left" ? d(n, t) : p(n, t);
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
e as positionTooltip
|
|
27
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("styled-components"),o=require("./utils.cjs"),r=require("../helpers/theme.cjs"),i=e=>e&&e.__esModule?e:{default:e},a=i(n),s={fontSize:!0,fontWeight:!0},l=a.default.span.withConfig({shouldForwardProp:(e,t)=>!s[e]&&t(e)})`
|
|
2
|
+
${o.variantStyle}
|
|
3
|
+
${o.ellipsisStyle}
|
|
4
|
+
|
|
5
|
+
// These properties need to come after {variantStyle}, because they might
|
|
6
|
+
// overwrite a variant attribute
|
|
7
|
+
font-weight: ${({theme:e,fontWeight:t})=>r.extractStyleFromTheme(e.fontWeights,t,void 0)};
|
|
8
|
+
font-size: ${({theme:e,fontSize:t})=>r.extractStyleFromTheme(e.fontSizes,t,void 0)};
|
|
9
|
+
line-height: ${({theme:e,lineHeight:t})=>r.extractStyleFromTheme(e.lineHeights,t,t)};
|
|
10
|
+
color: ${o.handleColor};
|
|
11
|
+
text-align: ${({textAlign:e})=>e};
|
|
12
|
+
text-decoration: ${({textDecoration:e})=>e};
|
|
13
|
+
text-transform: ${({textTransform:e})=>e};
|
|
14
|
+
`;exports.Typography=l;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import r from "styled-components";
|
|
2
|
+
import { variantStyle as i, ellipsisStyle as n, handleColor as a } from "./utils.js";
|
|
3
|
+
import { extractStyleFromTheme as o } from "../helpers/theme.js";
|
|
4
|
+
const s = {
|
|
5
|
+
fontSize: !0,
|
|
6
|
+
fontWeight: !0
|
|
7
|
+
}, m = r.span.withConfig({
|
|
8
|
+
shouldForwardProp: (t, e) => !s[t] && e(t)
|
|
9
|
+
})`
|
|
10
|
+
${i}
|
|
11
|
+
${n}
|
|
12
|
+
|
|
13
|
+
// These properties need to come after {variantStyle}, because they might
|
|
14
|
+
// overwrite a variant attribute
|
|
15
|
+
font-weight: ${({ theme: t, fontWeight: e }) => o(t.fontWeights, e, void 0)};
|
|
16
|
+
font-size: ${({ theme: t, fontSize: e }) => o(t.fontSizes, e, void 0)};
|
|
17
|
+
line-height: ${({ theme: t, lineHeight: e }) => o(t.lineHeights, e, e)};
|
|
18
|
+
color: ${a};
|
|
19
|
+
text-align: ${({ textAlign: t }) => t};
|
|
20
|
+
text-decoration: ${({ textDecoration: t }) => t};
|
|
21
|
+
text-transform: ${({ textTransform: t }) => t};
|
|
22
|
+
`;
|
|
23
|
+
export {
|
|
24
|
+
m as Typography
|
|
25
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t="alpha",A="beta",o="delta",s="epsilon",e="omega",n="pi",T="sigma",c=[t,A,o,s,e,n,T];exports.ALPHA=t;exports.BETA=A;exports.DELTA=o;exports.EPSILON=s;exports.OMEGA=e;exports.PI=n;exports.SIGMA=T;exports.TEXT_VARIANTS=c;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./Typography.cjs");exports.Typography=e.Typography;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./constants.cjs"),n=({ellipsis:e=!1})=>e&&`
|
|
2
|
+
display: block;
|
|
3
|
+
white-space: nowrap;
|
|
4
|
+
overflow: hidden;
|
|
5
|
+
text-overflow: ellipsis;
|
|
6
|
+
`,s=({variant:e=t.OMEGA,theme:i})=>{switch(e){case t.ALPHA:return`
|
|
7
|
+
font-weight: ${i.fontWeights.bold};
|
|
8
|
+
font-size: ${i.fontSizes[5]};
|
|
9
|
+
line-height: ${i.lineHeights[2]};
|
|
10
|
+
`;case t.BETA:return`
|
|
11
|
+
font-weight: ${i.fontWeights.bold};
|
|
12
|
+
font-size: ${i.fontSizes[4]};
|
|
13
|
+
line-height: ${i.lineHeights[1]};
|
|
14
|
+
`;case t.DELTA:return`
|
|
15
|
+
font-weight: ${i.fontWeights.semiBold};
|
|
16
|
+
font-size: ${i.fontSizes[3]};
|
|
17
|
+
line-height: ${i.lineHeights[2]};
|
|
18
|
+
`;case t.EPSILON:return`
|
|
19
|
+
font-size: ${i.fontSizes[3]};
|
|
20
|
+
line-height: ${i.lineHeights[6]};
|
|
21
|
+
`;case t.OMEGA:return`
|
|
22
|
+
font-size: ${i.fontSizes[2]};
|
|
23
|
+
line-height: ${i.lineHeights[4]};
|
|
24
|
+
`;case t.PI:return`
|
|
25
|
+
font-size: ${i.fontSizes[1]};
|
|
26
|
+
line-height: ${i.lineHeights[3]};
|
|
27
|
+
`;case t.SIGMA:return`
|
|
28
|
+
font-weight: ${i.fontWeights.bold};
|
|
29
|
+
font-size: ${i.fontSizes[0]};
|
|
30
|
+
line-height: ${i.lineHeights[5]};
|
|
31
|
+
text-transform: uppercase;
|
|
32
|
+
`;default:return`
|
|
33
|
+
font-size: ${i.fontSizes[2]};
|
|
34
|
+
`}},o=({theme:e,textColor:i})=>e.colors[i||"neutral800"];exports.ellipsisStyle=n;exports.handleColor=o;exports.variantStyle=s;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { SIGMA as e, PI as s, OMEGA as t, EPSILON as o, DELTA as l, BETA as f, ALPHA as r } from "./constants.js";
|
|
2
|
+
const $ = ({ ellipsis: n = !1 }) => n && `
|
|
3
|
+
display: block;
|
|
4
|
+
white-space: nowrap;
|
|
5
|
+
overflow: hidden;
|
|
6
|
+
text-overflow: ellipsis;
|
|
7
|
+
`, a = ({ variant: n = t, theme: i }) => {
|
|
8
|
+
switch (n) {
|
|
9
|
+
case r:
|
|
10
|
+
return `
|
|
11
|
+
font-weight: ${i.fontWeights.bold};
|
|
12
|
+
font-size: ${i.fontSizes[5]};
|
|
13
|
+
line-height: ${i.lineHeights[2]};
|
|
14
|
+
`;
|
|
15
|
+
case f:
|
|
16
|
+
return `
|
|
17
|
+
font-weight: ${i.fontWeights.bold};
|
|
18
|
+
font-size: ${i.fontSizes[4]};
|
|
19
|
+
line-height: ${i.lineHeights[1]};
|
|
20
|
+
`;
|
|
21
|
+
case l:
|
|
22
|
+
return `
|
|
23
|
+
font-weight: ${i.fontWeights.semiBold};
|
|
24
|
+
font-size: ${i.fontSizes[3]};
|
|
25
|
+
line-height: ${i.lineHeights[2]};
|
|
26
|
+
`;
|
|
27
|
+
case o:
|
|
28
|
+
return `
|
|
29
|
+
font-size: ${i.fontSizes[3]};
|
|
30
|
+
line-height: ${i.lineHeights[6]};
|
|
31
|
+
`;
|
|
32
|
+
case t:
|
|
33
|
+
return `
|
|
34
|
+
font-size: ${i.fontSizes[2]};
|
|
35
|
+
line-height: ${i.lineHeights[4]};
|
|
36
|
+
`;
|
|
37
|
+
case s:
|
|
38
|
+
return `
|
|
39
|
+
font-size: ${i.fontSizes[1]};
|
|
40
|
+
line-height: ${i.lineHeights[3]};
|
|
41
|
+
`;
|
|
42
|
+
case e:
|
|
43
|
+
return `
|
|
44
|
+
font-weight: ${i.fontWeights.bold};
|
|
45
|
+
font-size: ${i.fontSizes[0]};
|
|
46
|
+
line-height: ${i.lineHeights[5]};
|
|
47
|
+
text-transform: uppercase;
|
|
48
|
+
`;
|
|
49
|
+
default:
|
|
50
|
+
return `
|
|
51
|
+
font-size: ${i.fontSizes[2]};
|
|
52
|
+
`;
|
|
53
|
+
}
|
|
54
|
+
}, z = ({ theme: n, textColor: i }) => n.colors[i || "neutral800"];
|
|
55
|
+
export {
|
|
56
|
+
$ as ellipsisStyle,
|
|
57
|
+
z as handleColor,
|
|
58
|
+
a as variantStyle
|
|
59
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("styled-components"),d=e=>e&&e.__esModule?e:{default:e},i=d(t),l=i.default.div`
|
|
2
|
+
border: 0;
|
|
3
|
+
clip: rect(0 0 0 0);
|
|
4
|
+
height: 1px;
|
|
5
|
+
margin: -1px;
|
|
6
|
+
overflow: hidden;
|
|
7
|
+
padding: 0;
|
|
8
|
+
position: absolute;
|
|
9
|
+
width: 1px;
|
|
10
|
+
`;exports.VisuallyHidden=l;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./VisuallyHidden.cjs");exports.VisuallyHidden=e.VisuallyHidden;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),d=require("react");function f(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const u=f(d),b=(e,t)=>{const r=u.createContext(t);function n(c){const{children:o,...i}=c,a=u.useMemo(()=>i,Object.values(i));return l.jsx(r.Provider,{value:a,children:o})}function s(c){const o=u.useContext(r);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${c}\` must be used within \`${e}\``)}return n.displayName=`${e}Provider`,[n,s]};exports.createContext=b;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as x } from "react/jsx-runtime";
|
|
2
|
+
import * as n from "react";
|
|
3
|
+
const v = (o, t) => {
|
|
4
|
+
const c = n.createContext(t);
|
|
5
|
+
function i(r) {
|
|
6
|
+
const { children: e, ...s } = r, d = n.useMemo(() => s, Object.values(s));
|
|
7
|
+
return x(c.Provider, { value: d, children: e });
|
|
8
|
+
}
|
|
9
|
+
function u(r) {
|
|
10
|
+
const e = n.useContext(c);
|
|
11
|
+
if (e)
|
|
12
|
+
return e;
|
|
13
|
+
if (t !== void 0)
|
|
14
|
+
return t;
|
|
15
|
+
throw new Error(`\`${r}\` must be used within \`${o}\``);
|
|
16
|
+
}
|
|
17
|
+
return i.displayName = `${o}Provider`, [i, u];
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
v as createContext
|
|
21
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n="[@strapi/design-system]:",c=r=>{const e=r;let t=!1;if(typeof e!="function")throw new TypeError(`${n} once requires a function parameter`);return(...o)=>{t||(e(...o),t=!0)}};exports.PREFIX=n;exports.once=c;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const o = "[@strapi/design-system]:", c = (n) => {
|
|
2
|
+
const e = n;
|
|
3
|
+
let t = !1;
|
|
4
|
+
if (typeof e != "function")
|
|
5
|
+
throw new TypeError(`${o} once requires a function parameter`);
|
|
6
|
+
return (...r) => {
|
|
7
|
+
t || (e(...r), t = !0);
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
o as PREFIX,
|
|
12
|
+
c as once
|
|
13
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="en-EN";/**
|
|
2
|
+
* @preserve
|
|
3
|
+
* @deprecated This will be removed in v2.0.0, you can access the locale from `useDesignSystem` instead.
|
|
4
|
+
*/const t=()=>typeof navigator>"u"?e:navigator.language?navigator.language:e;exports.getDefaultLocale=t;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const e = "en-EN";
|
|
2
|
+
/**
|
|
3
|
+
* @preserve
|
|
4
|
+
* @deprecated This will be removed in v2.0.0, you can access the locale from `useDesignSystem` instead.
|
|
5
|
+
*/
|
|
6
|
+
const n = () => typeof navigator > "u" ? e : navigator.language ? navigator.language : e;
|
|
7
|
+
export {
|
|
8
|
+
n as getDefaultLocale
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=(t,e)=>[...t.querySelectorAll('a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])')].filter(r=>r.hasAttribute("disabled")?!1:e?!0:r.getAttribute("tabindex")!=="-1"),s=t=>t.filter(e=>e.tagName==="INPUT"?e.type!=="checkbox"&&e.type!=="radio":!1);exports.getFocusableNodes=a;exports.getFocusableNodesWithKeyboardNav=s;
|