@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
package/LICENSE
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Copyright (c) 2015-present Strapi Solutions SAS
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
+
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Strapi Design System
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@strapi/design-system)
|
|
4
|
+
[](https://www.npmjs.com/package/@strapi/design-system)
|
|
5
|
+
[](https://discord.gg/strapi)
|
|
6
|
+
|
|
7
|
+
<b>A UI component library for creating amazing Strapi extensions.</b>
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
$ yarn add react react-dom @strapi/design-system @strapi/icons styled-components react-router-dom
|
|
13
|
+
|
|
14
|
+
# or
|
|
15
|
+
|
|
16
|
+
$ npm i react react-dom @strapi/design-system @strapi/icons styled-components react-router-dom
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Getting Started
|
|
20
|
+
|
|
21
|
+
Wrap your application with the `DesignSystemProvider`. You can additionally pass a theme and/or locale, although you don't have to as we have default values for both.
|
|
22
|
+
|
|
23
|
+
```jsx
|
|
24
|
+
import { DesignSystemProvider, lightTheme } from '@strapi/design-system';
|
|
25
|
+
|
|
26
|
+
function MyApp({ children }) {
|
|
27
|
+
return (
|
|
28
|
+
<DesignSystemProvider locale="en-GB" theme={lightTheme}>
|
|
29
|
+
{children}
|
|
30
|
+
</DesignSystemProvider>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export default App;
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Then, checkout the complete [Storybook documentation](https://design-system-git-main-strapijs.vercel.app/) to find the components you want to use and how to use them.
|
|
38
|
+
|
|
39
|
+
## Contributing
|
|
40
|
+
|
|
41
|
+
Please follow our [CONTRIBUTING](https://github.com/strapi/design-system/blob/main/CONTRIBUTING.md) guidelines.
|
|
42
|
+
|
|
43
|
+
## License
|
|
44
|
+
|
|
45
|
+
Licensed under the MIT License, Copyright © 2015-present [Strapi Solutions SAS](https://strapi.io).
|
|
46
|
+
|
|
47
|
+
See [LICENSE](https://github.com/strapi/design-system/blob/main/LICENSE) for more information.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),b=require("react"),m=require("styled-components"),j=require("./AccordionContext.cjs"),_=require("../hooks/useId.cjs"),s=require("../Typography/Typography.cjs"),h=require("../Flex/Flex.cjs"),p=require("../Box/Box.cjs"),q=r=>r&&r.__esModule?r:{default:r};function T(r){if(r&&r.__esModule)return r;const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const e in r)if(e!=="default"){const t=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(o,e,t.get?t:{enumerable:!0,get:()=>r[e]})}}return o.default=r,Object.freeze(o)}const A=T(b),y=q(m),M=({theme:r,expanded:o,variant:e,disabled:t,error:c})=>c?`1px solid ${r.colors.danger600} !important`:t?`1px solid ${r.colors.neutral150}`:o?`1px solid ${r.colors.primary600}`:e==="primary"?`1px solid ${r.colors.neutral0}`:`1px solid ${r.colors.neutral100}`,f=y.default(s.Typography)``,O=y.default(p.Box)`
|
|
2
|
+
border: ${M};
|
|
3
|
+
|
|
4
|
+
&:hover:not([aria-disabled='true']) {
|
|
5
|
+
border: 1px solid ${({theme:r})=>r.colors.primary600};
|
|
6
|
+
|
|
7
|
+
${f} {
|
|
8
|
+
color: ${({theme:r,expanded:o})=>o?void 0:r.colors.primary700};
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
${s.Typography} {
|
|
12
|
+
color: ${({theme:r,expanded:o})=>o?void 0:r.colors.primary600};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
& > ${h.Flex} {
|
|
16
|
+
background: ${({theme:r})=>r.colors.primary100};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
[data-strapi-dropdown='true'] {
|
|
20
|
+
background: ${({theme:r})=>r.colors.primary200};
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
`,v=({children:r,disabled:o=!1,error:e,expanded:t=!1,hasErrorMessage:c=!0,id:x,onToggle:a,toggle:d,size:u="M",variant:i="primary",shadow:g})=>{const l=_.useId(x),$=A.useMemo(()=>({expanded:t,onToggle:a,toggle:d,id:l,size:u,variant:i,disabled:o}),[o,t,l,a,u,d,i]);return n.jsxs(j.AccordionContext.Provider,{value:$,children:[n.jsx(O,{"data-strapi-expanded":t,disabled:o,"aria-disabled":o,expanded:t,hasRadius:!0,variant:i,error:e,shadow:g,children:r}),e&&c&&n.jsx(p.Box,{paddingTop:1,children:n.jsx(s.Typography,{variant:"pi",textColor:"danger600",children:e})})]})};exports.Accordion=v;exports.AccordionTypography=f;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsxs as y, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import * as g from "react";
|
|
3
|
+
import m from "styled-components";
|
|
4
|
+
import { AccordionContext as h } from "./AccordionContext.js";
|
|
5
|
+
import { useId as b } from "../hooks/useId.js";
|
|
6
|
+
import { Typography as p } from "../Typography/Typography.js";
|
|
7
|
+
import { Flex as A } from "../Flex/Flex.js";
|
|
8
|
+
import { Box as u } from "../Box/Box.js";
|
|
9
|
+
const v = ({ theme: r, expanded: o, variant: t, disabled: i, error: a }) => a ? `1px solid ${r.colors.danger600} !important` : i ? `1px solid ${r.colors.neutral150}` : o ? `1px solid ${r.colors.primary600}` : t === "primary" ? `1px solid ${r.colors.neutral0}` : `1px solid ${r.colors.neutral100}`, j = m(p)``, k = m(u)`
|
|
10
|
+
border: ${v};
|
|
11
|
+
|
|
12
|
+
&:hover:not([aria-disabled='true']) {
|
|
13
|
+
border: 1px solid ${({ theme: r }) => r.colors.primary600};
|
|
14
|
+
|
|
15
|
+
${j} {
|
|
16
|
+
color: ${({ theme: r, expanded: o }) => o ? void 0 : r.colors.primary700};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
${p} {
|
|
20
|
+
color: ${({ theme: r, expanded: o }) => o ? void 0 : r.colors.primary600};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
& > ${A} {
|
|
24
|
+
background: ${({ theme: r }) => r.colors.primary100};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
[data-strapi-dropdown='true'] {
|
|
28
|
+
background: ${({ theme: r }) => r.colors.primary200};
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
`, F = ({ children: r, disabled: o = !1, error: t, expanded: i = !1, hasErrorMessage: a = !0, id: f, onToggle: s, toggle: c, size: e = "M", variant: d = "primary", shadow: $ }) => {
|
|
32
|
+
const l = b(f), x = g.useMemo(() => ({ expanded: i, onToggle: s, toggle: c, id: l, size: e, variant: d, disabled: o }), [o, i, l, s, e, c, d]);
|
|
33
|
+
return y(h.Provider, { value: x, children: [n(k, { "data-strapi-expanded": i, disabled: o, "aria-disabled": o, expanded: i, hasRadius: !0, variant: d, error: t, shadow: $, children: r }), t && a && n(u, { paddingTop: 1, children: n(p, { variant: "pi", textColor: "danger600", children: t }) })] });
|
|
34
|
+
};
|
|
35
|
+
export {
|
|
36
|
+
F as Accordion,
|
|
37
|
+
j as AccordionTypography
|
|
38
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),a=require("./AccordionContext.cjs"),s=require("../Box/Box.cjs"),l=({children:e,...n})=>{const{expanded:r,id:o}=a.useAccordion();if(!r)return null;const c=`accordion-content-${o}`,t=`accordion-label-${o}`,i=`accordion-desc-${o}`;return d.jsx(s.Box,{role:"region",id:c,"aria-labelledby":t,"aria-describedby":i,...n,children:e})};exports.AccordionContent=l;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import { useAccordion as a } from "./AccordionContext.js";
|
|
3
|
+
import { Box as l } from "../Box/Box.js";
|
|
4
|
+
const p = ({ children: r, ...n }) => {
|
|
5
|
+
const { expanded: i, id: o } = a();
|
|
6
|
+
if (!i)
|
|
7
|
+
return null;
|
|
8
|
+
const c = `accordion-content-${o}`, e = `accordion-label-${o}`, t = `accordion-desc-${o}`;
|
|
9
|
+
return d(l, { role: "region", id: c, "aria-labelledby": e, "aria-describedby": t, ...n, children: r });
|
|
10
|
+
};
|
|
11
|
+
export {
|
|
12
|
+
p as AccordionContent
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=e.createContext({disabled:!1,expanded:!1,id:"",size:"M",variant:"primary"}),o=()=>e.useContext(t);exports.AccordionContext=t;exports.useAccordion=o;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),p=require("react"),b=require("styled-components"),x=require("../KeyboardNavigable/KeyboardNavigable.cjs"),s=require("../Box/Box.cjs"),f=require("../Flex/Flex.cjs"),n=require("../Typography/Typography.cjs"),g=r=>r&&r.__esModule?r:{default:r};function y(r){if(r&&r.__esModule)return r;const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const d=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,d.get?d:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const l=y(p),a=g(b),$=a.default(s.Box)`
|
|
2
|
+
border-bottom: 1px solid ${({theme:r})=>r.colors.neutral200};
|
|
3
|
+
border-right: 1px solid ${({theme:r})=>r.colors.neutral200};
|
|
4
|
+
border-left: 1px solid ${({theme:r})=>r.colors.neutral200};
|
|
5
|
+
border-radius: 0 0 ${({theme:r})=>r.borderRadius} ${({theme:r})=>r.borderRadius};
|
|
6
|
+
`,h=a.default(s.Box)`
|
|
7
|
+
& > * {
|
|
8
|
+
& > * {
|
|
9
|
+
border-radius: unset;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
& > * {
|
|
14
|
+
border-radius: unset;
|
|
15
|
+
border-right: 1px solid ${({theme:r})=>r.colors.neutral200};
|
|
16
|
+
border-left: 1px solid ${({theme:r})=>r.colors.neutral200};
|
|
17
|
+
border-bottom: 1px solid ${({theme:r})=>r.colors.neutral200};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
& > *:first-of-type {
|
|
21
|
+
border-top: 1px solid ${({theme:r})=>r.colors.neutral200};
|
|
22
|
+
border-radius: ${({theme:r})=>r.borderRadius} ${({theme:r})=>r.borderRadius} 0 0;
|
|
23
|
+
& > * {
|
|
24
|
+
border-radius: ${({theme:r})=>r.borderRadius} ${({theme:r})=>r.borderRadius} 0 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&:hover {
|
|
28
|
+
border-top: 1px solid ${({theme:r})=>r.colors.primary600};
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
& [data-strapi-expanded='true'] {
|
|
33
|
+
border: 1px solid ${({theme:r})=>r.colors.primary600};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
${({theme:r,footer:e})=>`
|
|
37
|
+
&:not(${e}) {
|
|
38
|
+
& > *:last-of-type {
|
|
39
|
+
border-radius: 0 0 ${r.borderRadius} ${r.borderRadius};
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
`}
|
|
43
|
+
`,j=a.default(s.Box)`
|
|
44
|
+
svg path {
|
|
45
|
+
fill: ${({theme:r})=>r.colors.neutral500};
|
|
46
|
+
}
|
|
47
|
+
`,m=({children:r,footer:e,label:t,labelAction:d,error:i})=>{const u=l.Children.toArray(r).map(c=>l.cloneElement(c,{hasErrorMessage:!1}));return o.jsxs(x.KeyboardNavigable,{attributeName:"data-strapi-accordion-toggle",children:[t&&o.jsxs(f.Flex,{paddingBottom:1,children:[o.jsx(n.Typography,{variant:"pi",as:"label",textColor:"neutral800",fontWeight:"bold",children:t}),d&&o.jsx(j,{paddingLeft:1,children:d})]}),o.jsx(h,{footer:e,children:u}),e&&o.jsx($,{children:e}),i&&o.jsx(s.Box,{paddingTop:1,children:o.jsx(n.Typography,{variant:"pi",textColor:"danger600",children:i})})]})};exports.AccordionGroup=m;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { jsxs as l, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import * as n from "react";
|
|
3
|
+
import t from "styled-components";
|
|
4
|
+
import { KeyboardNavigable as b } from "../KeyboardNavigable/KeyboardNavigable.js";
|
|
5
|
+
import { Box as e } from "../Box/Box.js";
|
|
6
|
+
import { Flex as m } from "../Flex/Flex.js";
|
|
7
|
+
import { Typography as p } from "../Typography/Typography.js";
|
|
8
|
+
const $ = t(e)`
|
|
9
|
+
border-bottom: 1px solid ${({ theme: r }) => r.colors.neutral200};
|
|
10
|
+
border-right: 1px solid ${({ theme: r }) => r.colors.neutral200};
|
|
11
|
+
border-left: 1px solid ${({ theme: r }) => r.colors.neutral200};
|
|
12
|
+
border-radius: 0 0 ${({ theme: r }) => r.borderRadius} ${({ theme: r }) => r.borderRadius};
|
|
13
|
+
`, h = t(e)`
|
|
14
|
+
& > * {
|
|
15
|
+
& > * {
|
|
16
|
+
border-radius: unset;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
& > * {
|
|
21
|
+
border-radius: unset;
|
|
22
|
+
border-right: 1px solid ${({ theme: r }) => r.colors.neutral200};
|
|
23
|
+
border-left: 1px solid ${({ theme: r }) => r.colors.neutral200};
|
|
24
|
+
border-bottom: 1px solid ${({ theme: r }) => r.colors.neutral200};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
& > *:first-of-type {
|
|
28
|
+
border-top: 1px solid ${({ theme: r }) => r.colors.neutral200};
|
|
29
|
+
border-radius: ${({ theme: r }) => r.borderRadius} ${({ theme: r }) => r.borderRadius} 0 0;
|
|
30
|
+
& > * {
|
|
31
|
+
border-radius: ${({ theme: r }) => r.borderRadius} ${({ theme: r }) => r.borderRadius} 0 0;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&:hover {
|
|
35
|
+
border-top: 1px solid ${({ theme: r }) => r.colors.primary600};
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
& [data-strapi-expanded='true'] {
|
|
40
|
+
border: 1px solid ${({ theme: r }) => r.colors.primary600};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
${({ theme: r, footer: d }) => `
|
|
44
|
+
&:not(${d}) {
|
|
45
|
+
& > *:last-of-type {
|
|
46
|
+
border-radius: 0 0 ${r.borderRadius} ${r.borderRadius};
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
`}
|
|
50
|
+
`, x = t(e)`
|
|
51
|
+
svg path {
|
|
52
|
+
fill: ${({ theme: r }) => r.colors.neutral500};
|
|
53
|
+
}
|
|
54
|
+
`, C = ({ children: r, footer: d, label: i, labelAction: a, error: s }) => {
|
|
55
|
+
const c = n.Children.toArray(r).map((u) => n.cloneElement(u, { hasErrorMessage: !1 }));
|
|
56
|
+
return l(b, { attributeName: "data-strapi-accordion-toggle", children: [i && l(m, { paddingBottom: 1, children: [o(p, { variant: "pi", as: "label", textColor: "neutral800", fontWeight: "bold", children: i }), a && o(x, { paddingLeft: 1, children: a })] }), o(h, { footer: d, children: c }), d && o($, { children: d }), s && o(e, { paddingTop: 1, children: o(p, { variant: "pi", textColor: "danger600", children: s }) })] });
|
|
57
|
+
};
|
|
58
|
+
export {
|
|
59
|
+
C as AccordionGroup
|
|
60
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),A=require("@strapi/icons"),F=require("styled-components"),M=require("./Accordion.cjs"),B=require("./AccordionContext.cjs"),R=require("./utils.cjs"),z=require("../TextButton/TextButton.cjs"),I=require("../Icon/Icon.cjs"),d=require("../Flex/Flex.cjs"),S=require("../Typography/Typography.cjs"),_=e=>e&&e.__esModule?e:{default:e},m=_(F),D=m.default(z.TextButton)`
|
|
2
|
+
text-align: left;
|
|
3
|
+
|
|
4
|
+
// necessary to make the ellipsis prop work on the title
|
|
5
|
+
> span {
|
|
6
|
+
max-width: 100%;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
svg {
|
|
10
|
+
width: ${14/16}rem;
|
|
11
|
+
height: ${14/16}rem;
|
|
12
|
+
|
|
13
|
+
path {
|
|
14
|
+
fill: ${({theme:e,expanded:t})=>t?e.colors.primary600:e.colors.neutral500};
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
`,W=m.default(d.Flex)`
|
|
18
|
+
min-height: ${({theme:e,size:t})=>e.sizes.accordions[t]};
|
|
19
|
+
border-radius: ${({theme:e,expanded:t})=>t?`${e.borderRadius} ${e.borderRadius} 0 0`:e.borderRadius};
|
|
20
|
+
|
|
21
|
+
&:hover {
|
|
22
|
+
svg {
|
|
23
|
+
path {
|
|
24
|
+
fill: ${({theme:e})=>e.colors.primary600};
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
`,P=({title:e,description:t,as:y="span",togglePosition:s="right",action:u,...$})=>{const{onToggle:c,toggle:p,expanded:r,id:l,size:n,variant:j,disabled:i}=B.useAccordion(),w=`accordion-content-${l}`,g=`accordion-label-${l}`,T=`accordion-desc-${l}`,a=n==="M"?6:4,h=n==="M"?a:a-2,C=R.getBackground({expanded:r,disabled:i,variant:j}),q={as:y,fontWeight:n==="S"?"bold":void 0,id:g,textColor:r?"primary600":"neutral700",ellipsis:!0,variant:n==="M"?"delta":void 0},k=r?"primary600":"neutral600",v=r?"primary200":"neutral200",x=n==="M"?`${32/16}rem`:`${24/16}rem`,f=()=>{i||(p&&!c?(console.warn('Deprecation warning: Usage of "toggle" prop in Accordion component is deprecated. This is discouraged and will be removed in the next major release. Please use "onToggle" instead'),p()):c&&c())},b=o.jsx(d.Flex,{justifyContent:"center",borderRadius:"50%",height:x,width:x,transform:r?"rotate(180deg)":void 0,"data-strapi-dropdown":!0,"aria-hidden":!0,as:"span",background:v,cursor:i?"not-allowed":"pointer",onClick:f,shrink:0,children:o.jsx(I.Icon,{as:A.CarretDown,width:n==="M"?`${11/16}rem`:`${8/16}rem`,color:r?"primary600":"neutral600"})});return o.jsx(W,{paddingBottom:h,paddingLeft:a,paddingRight:a,paddingTop:h,background:C,expanded:r,size:n,justifyContent:"space-between",cursor:i?"not-allowed":"",children:o.jsxs(d.Flex,{gap:3,flex:1,maxWidth:"100%",children:[s==="left"&&b,o.jsx(D,{onClick:f,"aria-disabled":i,"aria-expanded":r,"aria-controls":w,"aria-labelledby":g,"data-strapi-accordion-toggle":!0,expanded:r,type:"button",flex:1,minWidth:0,...$,children:o.jsxs(o.Fragment,{children:[o.jsx(M.AccordionTypography,{...q,children:e}),t&&o.jsx(S.Typography,{as:"p",id:T,textColor:k,children:t})]})}),s==="right"&&o.jsxs(d.Flex,{gap:3,children:[b,u]}),s==="left"&&u]})})};exports.AccordionToggle=P;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsx as i, jsxs as p, Fragment as M } from "react/jsx-runtime";
|
|
2
|
+
import { CarretDown as R } from "@strapi/icons";
|
|
3
|
+
import y from "styled-components";
|
|
4
|
+
import { AccordionTypography as A } from "./Accordion.js";
|
|
5
|
+
import { useAccordion as I } from "./AccordionContext.js";
|
|
6
|
+
import { getBackground as W } from "./utils.js";
|
|
7
|
+
import { TextButton as D } from "../TextButton/TextButton.js";
|
|
8
|
+
import { Icon as F } from "../Icon/Icon.js";
|
|
9
|
+
import { Flex as d } from "../Flex/Flex.js";
|
|
10
|
+
import { Typography as S } from "../Typography/Typography.js";
|
|
11
|
+
const L = y(D)`
|
|
12
|
+
text-align: left;
|
|
13
|
+
|
|
14
|
+
// necessary to make the ellipsis prop work on the title
|
|
15
|
+
> span {
|
|
16
|
+
max-width: 100%;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
svg {
|
|
20
|
+
width: ${14 / 16}rem;
|
|
21
|
+
height: ${14 / 16}rem;
|
|
22
|
+
|
|
23
|
+
path {
|
|
24
|
+
fill: ${({ theme: o, expanded: e }) => e ? o.colors.primary600 : o.colors.neutral500};
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
`, P = y(d)`
|
|
28
|
+
min-height: ${({ theme: o, size: e }) => o.sizes.accordions[e]};
|
|
29
|
+
border-radius: ${({ theme: o, expanded: e }) => e ? `${o.borderRadius} ${o.borderRadius} 0 0` : o.borderRadius};
|
|
30
|
+
|
|
31
|
+
&:hover {
|
|
32
|
+
svg {
|
|
33
|
+
path {
|
|
34
|
+
fill: ${({ theme: o }) => o.colors.primary600};
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
`, Q = ({ title: o, description: e, as: $ = "span", togglePosition: l = "right", action: g, ...w }) => {
|
|
39
|
+
const { onToggle: s, toggle: m, expanded: r, id: c, size: t, variant: C, disabled: n } = I(), T = `accordion-content-${c}`, h = `accordion-label-${c}`, k = `accordion-desc-${c}`, a = t === "M" ? 6 : 4, u = t === "M" ? a : a - 2, v = W({ expanded: r, disabled: n, variant: C }), j = {
|
|
40
|
+
as: $,
|
|
41
|
+
fontWeight: t === "S" ? "bold" : void 0,
|
|
42
|
+
id: h,
|
|
43
|
+
textColor: r ? "primary600" : "neutral700",
|
|
44
|
+
ellipsis: !0,
|
|
45
|
+
variant: t === "M" ? "delta" : void 0
|
|
46
|
+
}, z = r ? "primary600" : "neutral600", B = r ? "primary200" : "neutral200", f = t === "M" ? `${32 / 16}rem` : `${24 / 16}rem`, x = () => {
|
|
47
|
+
n || (m && !s ? (console.warn('Deprecation warning: Usage of "toggle" prop in Accordion component is deprecated. This is discouraged and will be removed in the next major release. Please use "onToggle" instead'), m()) : s && s());
|
|
48
|
+
}, b = i(d, { justifyContent: "center", borderRadius: "50%", height: f, width: f, transform: r ? "rotate(180deg)" : void 0, "data-strapi-dropdown": !0, "aria-hidden": !0, as: "span", background: B, cursor: n ? "not-allowed" : "pointer", onClick: x, shrink: 0, children: i(F, { as: R, width: t === "M" ? `${11 / 16}rem` : `${8 / 16}rem`, color: r ? "primary600" : "neutral600" }) });
|
|
49
|
+
return i(P, { paddingBottom: u, paddingLeft: a, paddingRight: a, paddingTop: u, background: v, expanded: r, size: t, justifyContent: "space-between", cursor: n ? "not-allowed" : "", children: p(d, { gap: 3, flex: 1, maxWidth: "100%", children: [l === "left" && b, i(L, { onClick: x, "aria-disabled": n, "aria-expanded": r, "aria-controls": T, "aria-labelledby": h, "data-strapi-accordion-toggle": !0, expanded: r, type: "button", flex: 1, minWidth: 0, ...w, children: p(M, { children: [i(A, { ...j, children: o }), e && i(S, { as: "p", id: k, textColor: z, children: e })] }) }), l === "right" && p(d, { gap: 3, children: [b, g] }), l === "left" && g] }) });
|
|
50
|
+
};
|
|
51
|
+
export {
|
|
52
|
+
Q as AccordionToggle
|
|
53
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./Accordion.cjs"),c=require("./AccordionContent.cjs"),r=require("./AccordionToggle.cjs"),n=require("./AccordionGroup.cjs");exports.Accordion=o.Accordion;exports.AccordionTypography=o.AccordionTypography;exports.AccordionContent=c.AccordionContent;exports.AccordionToggle=r.AccordionToggle;exports.AccordionGroup=n.AccordionGroup;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Accordion as c, AccordionTypography as n } from "./Accordion.js";
|
|
2
|
+
import { AccordionContent as e } from "./AccordionContent.js";
|
|
3
|
+
import { AccordionToggle as d } from "./AccordionToggle.js";
|
|
4
|
+
import { AccordionGroup as A } from "./AccordionGroup.js";
|
|
5
|
+
export {
|
|
6
|
+
c as Accordion,
|
|
7
|
+
e as AccordionContent,
|
|
8
|
+
A as AccordionGroup,
|
|
9
|
+
d as AccordionToggle,
|
|
10
|
+
n as AccordionTypography
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=({expanded:r,disabled:t,variant:a})=>{let e="neutral100";return r?e="primary100":t?e="neutral150":a==="primary"&&(e="neutral0"),e};exports.getBackground=n;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),s=require("@strapi/icons"),p=require("styled-components"),l=require("./utils.cjs"),g=require("../themes/utils.cjs"),t=require("../Box/Box.cjs"),f=require("../Flex/Flex.cjs"),i=require("../Typography/Typography.cjs"),j=e=>e&&e.__esModule?e:{default:e},d=j(p),B=d.default(t.Box)`
|
|
2
|
+
flex: 1;
|
|
3
|
+
flex-wrap: wrap;
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: row;
|
|
6
|
+
`,C=d.default(t.Box)`
|
|
7
|
+
border: 1px solid ${l.handleBorderColor};
|
|
8
|
+
background: ${l.handleBackgroundColor};
|
|
9
|
+
box-shadow: ${({theme:e})=>e.shadows.filterShadow};
|
|
10
|
+
`,y=d.default.button`
|
|
11
|
+
border: none;
|
|
12
|
+
background: transparent;
|
|
13
|
+
font-size: ${12/16}rem;
|
|
14
|
+
svg path {
|
|
15
|
+
fill: ${({theme:e})=>e.colors.neutral700};
|
|
16
|
+
}
|
|
17
|
+
margin-top: ${({theme:e})=>e.spaces[1]};
|
|
18
|
+
${g.buttonFocusStyle};
|
|
19
|
+
`,$=d.default(t.Box)`
|
|
20
|
+
font-size: ${20/16}rem;
|
|
21
|
+
svg path {
|
|
22
|
+
fill: ${l.handleIconColor};
|
|
23
|
+
}
|
|
24
|
+
`,b=({variant:e,...o})=>e==="success"?r.jsx(s.CheckCircle,{...o}):e==="danger"||e==="warning"?r.jsx(s.ExclamationMarkCircle,{...o}):r.jsx(s.Information,{...o}),m=d.default(t.Box)`
|
|
25
|
+
// Checked with the designers, validated
|
|
26
|
+
padding-top: 1px;
|
|
27
|
+
|
|
28
|
+
& a > span {
|
|
29
|
+
color: ${l.handleIconColor};
|
|
30
|
+
|
|
31
|
+
svg path {
|
|
32
|
+
fill: ${l.handleIconColor};
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
`,q=({title:e,children:o,variant:n="default",onClose:c,closeLabel:u,titleAs:x="p",action:a,...h})=>r.jsx(C,{hasRadius:!0,paddingLeft:5,paddingRight:6,paddingTop:5,variant:n,...h,children:r.jsxs(f.Flex,{alignItems:"flex-start",children:[r.jsx($,{paddingRight:3,variant:n,children:r.jsx(b,{variant:n,"aria-hidden":!0})}),r.jsxs(B,{role:n==="danger"?"alert":"status",children:[r.jsx(t.Box,{paddingBottom:2,paddingRight:1,children:r.jsx(i.Typography,{fontWeight:"bold",textColor:"neutral800",as:x,children:e})}),r.jsx(t.Box,{paddingBottom:a?2:5,paddingRight:2,children:r.jsx(i.Typography,{as:"p",textColor:"neutral800",children:o})}),a&&r.jsx(m,{paddingBottom:5,variant:n,children:a})]}),r.jsx(y,{onClick:c,"aria-label":u,children:r.jsx(s.Cross,{"aria-hidden":!0})})]})});exports.Alert=q;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsx as r, jsxs as a } from "react/jsx-runtime";
|
|
2
|
+
import { Cross as f, CheckCircle as m, ExclamationMarkCircle as u, Information as x } from "@strapi/icons";
|
|
3
|
+
import d from "styled-components";
|
|
4
|
+
import { handleBorderColor as C, handleBackgroundColor as $, handleIconColor as l } from "./utils.js";
|
|
5
|
+
import { buttonFocusStyle as b } from "../themes/utils.js";
|
|
6
|
+
import { Box as t } from "../Box/Box.js";
|
|
7
|
+
import { Flex as B } from "../Flex/Flex.js";
|
|
8
|
+
import { Typography as s } from "../Typography/Typography.js";
|
|
9
|
+
const w = d(t)`
|
|
10
|
+
flex: 1;
|
|
11
|
+
flex-wrap: wrap;
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: row;
|
|
14
|
+
`, k = d(t)`
|
|
15
|
+
border: 1px solid ${C};
|
|
16
|
+
background: ${$};
|
|
17
|
+
box-shadow: ${({ theme: o }) => o.shadows.filterShadow};
|
|
18
|
+
`, y = d.button`
|
|
19
|
+
border: none;
|
|
20
|
+
background: transparent;
|
|
21
|
+
font-size: ${12 / 16}rem;
|
|
22
|
+
svg path {
|
|
23
|
+
fill: ${({ theme: o }) => o.colors.neutral700};
|
|
24
|
+
}
|
|
25
|
+
margin-top: ${({ theme: o }) => o.spaces[1]};
|
|
26
|
+
${b};
|
|
27
|
+
`, A = d(t)`
|
|
28
|
+
font-size: ${20 / 16}rem;
|
|
29
|
+
svg path {
|
|
30
|
+
fill: ${l};
|
|
31
|
+
}
|
|
32
|
+
`, I = ({ variant: o, ...e }) => o === "success" ? r(m, { ...e }) : o === "danger" || o === "warning" ? r(u, { ...e }) : r(x, { ...e }), R = d(t)`
|
|
33
|
+
// Checked with the designers, validated
|
|
34
|
+
padding-top: 1px;
|
|
35
|
+
|
|
36
|
+
& a > span {
|
|
37
|
+
color: ${l};
|
|
38
|
+
|
|
39
|
+
svg path {
|
|
40
|
+
fill: ${l};
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
`, L = ({ title: o, children: e, variant: n = "default", onClose: p, closeLabel: c, titleAs: h = "p", action: i, ...g }) => r(k, { hasRadius: !0, paddingLeft: 5, paddingRight: 6, paddingTop: 5, variant: n, ...g, children: a(B, { alignItems: "flex-start", children: [r(A, { paddingRight: 3, variant: n, children: r(I, { variant: n, "aria-hidden": !0 }) }), a(w, { role: n === "danger" ? "alert" : "status", children: [r(t, { paddingBottom: 2, paddingRight: 1, children: r(s, { fontWeight: "bold", textColor: "neutral800", as: h, children: o }) }), r(t, { paddingBottom: i ? 2 : 5, paddingRight: 2, children: r(s, { as: "p", textColor: "neutral800", children: e }) }), i && r(R, { paddingBottom: 5, variant: n, children: i })] }), r(y, { onClick: p, "aria-label": c, children: r(f, { "aria-hidden": !0 }) })] }) });
|
|
44
|
+
export {
|
|
45
|
+
L as Alert
|
|
46
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./Alert.cjs");exports.Alert=e.Alert;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=({theme:r,variant:o})=>o==="danger"?r.colors.danger100:o==="success"?r.colors.success100:o==="warning"?r.colors.warning100:r.colors.primary100,s=({theme:r,variant:o})=>o==="danger"?r.colors.danger200:o==="success"?r.colors.success200:o==="warning"?r.colors.warning200:r.colors.primary200,c=({theme:r,variant:o})=>o==="danger"?r.colors.danger700:o==="success"?r.colors.success700:o==="warning"?r.colors.warning700:r.colors.primary700;exports.handleBackgroundColor=n;exports.handleBorderColor=s;exports.handleIconColor=c;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
const s = ({ theme: r, variant: o }) => o === "danger" ? r.colors.danger100 : o === "success" ? r.colors.success100 : o === "warning" ? r.colors.warning100 : r.colors.primary100, n = ({ theme: r, variant: o }) => o === "danger" ? r.colors.danger200 : o === "success" ? r.colors.success200 : o === "warning" ? r.colors.warning200 : r.colors.primary200, c = ({ theme: r, variant: o }) => o === "danger" ? r.colors.danger700 : o === "success" ? r.colors.success700 : o === "warning" ? r.colors.warning700 : r.colors.primary700;
|
|
2
|
+
export {
|
|
3
|
+
s as handleBackgroundColor,
|
|
4
|
+
n as handleBorderColor,
|
|
5
|
+
c as handleIconColor
|
|
6
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),c=require("react"),d=require("styled-components"),t=require("./constants.cjs"),u=require("../Box/Box.cjs"),p=require("../Flex/Flex.cjs"),f=require("../Typography/Typography.cjs"),x=e=>e&&e.__esModule?e:{default:e};function h(e){if(e&&e.__esModule)return e;const a=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(a,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return a.default=e,Object.freeze(a)}const g=h(c),o=x(d),v=o.default.img`
|
|
2
|
+
border-radius: 50%;
|
|
3
|
+
object-fit: cover;
|
|
4
|
+
display: block;
|
|
5
|
+
position: relative;
|
|
6
|
+
`,b=o.default.img`
|
|
7
|
+
border-radius: 50%;
|
|
8
|
+
object-fit: cover;
|
|
9
|
+
position: absolute;
|
|
10
|
+
transform: translate(-${(t.previewSize-t.avatarSize)/2}px, -100%);
|
|
11
|
+
margin-top: -${({theme:e})=>e.spaces[1]};
|
|
12
|
+
`,S=o.default(u.Box)`
|
|
13
|
+
opacity: 0.4;
|
|
14
|
+
`,y=({src:e,alt:a,preview:r})=>{const[n,l]=g.useState(!1),s=!!(r&&n);return i.jsxs("span",{children:[s?i.jsx(b,{"aria-hidden":!0,alt:"",width:`${t.previewSize}px`,height:`${t.previewSize}px`,src:r===!0?e:typeof r=="string"?r:""}):null,i.jsxs(u.Box,{zIndex:s?1:void 0,position:"relative",onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),width:`${t.avatarSize}px`,height:`${t.avatarSize}px`,children:[s?i.jsx(S,{background:"neutral0",borderRadius:"50%",position:"absolute",width:`${t.avatarSize}px`,height:`${t.avatarSize}px`,zIndex:1}):null,i.jsx(v,{src:e,alt:a,width:`${t.avatarSize}px`,height:`${t.avatarSize}px`})]})]})},j=o.default(p.Flex)`
|
|
15
|
+
span {
|
|
16
|
+
line-height: 0;
|
|
17
|
+
}
|
|
18
|
+
`,z=({children:e,background:a="primary600",textColor:r="buttonNeutral0"})=>i.jsx(j,{background:a,borderRadius:"50%",width:`${t.avatarSize}px`,height:`${t.avatarSize}px`,justifyContent:"center",children:i.jsx(f.Typography,{fontSize:0,fontWeight:"bold",textColor:r,textTransform:"uppercase",children:e})});exports.Avatar=y;exports.Initials=z;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsxs as l, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import * as h from "react";
|
|
3
|
+
import o from "styled-components";
|
|
4
|
+
import { previewSize as s, avatarSize as t } from "./constants.js";
|
|
5
|
+
import { Box as d } from "../Box/Box.js";
|
|
6
|
+
import { Flex as u } from "../Flex/Flex.js";
|
|
7
|
+
import { Typography as m } from "../Typography/Typography.js";
|
|
8
|
+
const x = o.img`
|
|
9
|
+
border-radius: 50%;
|
|
10
|
+
object-fit: cover;
|
|
11
|
+
display: block;
|
|
12
|
+
position: relative;
|
|
13
|
+
`, f = o.img`
|
|
14
|
+
border-radius: 50%;
|
|
15
|
+
object-fit: cover;
|
|
16
|
+
position: absolute;
|
|
17
|
+
transform: translate(-${(s - t) / 2}px, -100%);
|
|
18
|
+
margin-top: -${({ theme: e }) => e.spaces[1]};
|
|
19
|
+
`, g = o(d)`
|
|
20
|
+
opacity: 0.4;
|
|
21
|
+
`, I = ({ src: e, alt: n, preview: r }) => {
|
|
22
|
+
const [c, p] = h.useState(!1), a = !!(r && c);
|
|
23
|
+
return l("span", { children: [a ? i(f, {
|
|
24
|
+
"aria-hidden": !0,
|
|
25
|
+
alt: "",
|
|
26
|
+
width: `${s}px`,
|
|
27
|
+
height: `${s}px`,
|
|
28
|
+
// eslint-disable-next-line no-nested-ternary
|
|
29
|
+
src: r === !0 ? e : typeof r == "string" ? r : ""
|
|
30
|
+
}) : null, l(d, { zIndex: a ? 1 : void 0, position: "relative", onMouseEnter: () => p(!0), onMouseLeave: () => p(!1), width: `${t}px`, height: `${t}px`, children: [a ? i(g, { background: "neutral0", borderRadius: "50%", position: "absolute", width: `${t}px`, height: `${t}px`, zIndex: 1 }) : null, i(x, { src: e, alt: n, width: `${t}px`, height: `${t}px` })] })] });
|
|
31
|
+
}, b = o(u)`
|
|
32
|
+
span {
|
|
33
|
+
line-height: 0;
|
|
34
|
+
}
|
|
35
|
+
`, S = ({ children: e, background: n = "primary600", textColor: r = "buttonNeutral0" }) => i(b, { background: n, borderRadius: "50%", width: `${t}px`, height: `${t}px`, justifyContent: "center", children: i(m, { fontSize: 0, fontWeight: "bold", textColor: r, textTransform: "uppercase", children: e }) });
|
|
36
|
+
export {
|
|
37
|
+
I as Avatar,
|
|
38
|
+
S as Initials
|
|
39
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("styled-components"),r=require("./constants.cjs"),a=require("../Flex/Flex.cjs"),o=t=>t&&t.__esModule?t:{default:t},l=o(e),s=l.default(a.Flex)`
|
|
2
|
+
& > * + * {
|
|
3
|
+
margin-left: -${r.avatarSize/2}px;
|
|
4
|
+
}
|
|
5
|
+
`;exports.AvatarGroup=s;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=32,t=64;exports.avatarSize=e;exports.previewSize=t;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./Avatar.cjs"),a=require("./AvatarGroup.cjs");exports.Avatar=r.Avatar;exports.Initials=r.Initials;exports.AvatarGroup=a.AvatarGroup;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),u=require("styled-components"),l=require("../Flex/Flex.cjs"),c=require("../Typography/Typography.cjs"),g=e=>e&&e.__esModule?e:{default:e},p=g(u),y=p.default(l.Flex)`
|
|
2
|
+
border-radius: ${({theme:e,size:t})=>t==="S"?"2px":e.borderRadius};
|
|
3
|
+
height: ${({size:e,theme:t})=>t.sizes.badge[e]};
|
|
4
|
+
`,f=({active:e=!1,size:t="M",textColor:i="neutral600",backgroundColor:a="neutral150",children:d,minWidth:s=5,...o})=>{const r=t==="S"?1:2;return n.jsx(y,{inline:!0,alignItem:"center",justifyContent:"center",minWidth:s,paddingLeft:r,paddingRight:r,background:e?"primary200":a,size:t,...o,children:n.jsx(c.Typography,{variant:"sigma",textColor:e?"primary600":i,children:d})})};exports.Badge=f;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import p from "styled-components";
|
|
3
|
+
import { Flex as s } from "../Flex/Flex.js";
|
|
4
|
+
import { Typography as g } from "../Typography/Typography.js";
|
|
5
|
+
const l = p(s)`
|
|
6
|
+
border-radius: ${({ theme: r, size: e }) => e === "S" ? "2px" : r.borderRadius};
|
|
7
|
+
height: ${({ size: r, theme: e }) => e.sizes.badge[r]};
|
|
8
|
+
`, y = ({ active: r = !1, size: e = "M", textColor: n = "neutral600", backgroundColor: o = "neutral150", children: a, minWidth: d = 5, ...m }) => {
|
|
9
|
+
const t = e === "S" ? 1 : 2;
|
|
10
|
+
return i(l, { inline: !0, alignItem: "center", justifyContent: "center", minWidth: d, paddingLeft: t, paddingRight: t, background: r ? "primary200" : o, size: e, ...m, children: i(g, { variant: "sigma", textColor: r ? "primary600" : n, children: a }) });
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
y as Badge
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./Badge.cjs");exports.Badge=e.Badge;
|