@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,63 @@
|
|
|
1
|
+
import { jsxs as y, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as w } from "react";
|
|
3
|
+
import p, { css as R } from "styled-components";
|
|
4
|
+
import { useField as I } from "./FieldContext.js";
|
|
5
|
+
import { inputFocusStyle as k } from "../themes/utils.js";
|
|
6
|
+
import { Box as l } from "../Box/Box.js";
|
|
7
|
+
import { Flex as B } from "../Flex/Flex.js";
|
|
8
|
+
const c = {
|
|
9
|
+
S: 6.5,
|
|
10
|
+
M: 10.5
|
|
11
|
+
}, M = w(({ endAction: r, startAction: o, disabled: e = !1, onChange: d, size: u = "M", ...f }, $) => {
|
|
12
|
+
const { id: i, error: t, hint: h, name: g, required: m } = I();
|
|
13
|
+
let n;
|
|
14
|
+
t ? n = `${i}-error` : h && (n = `${i}-hint`);
|
|
15
|
+
const s = !!t, b = (x) => {
|
|
16
|
+
!e && d && d(x);
|
|
17
|
+
};
|
|
18
|
+
return y(j, { justifyContent: "space-between", hasError: s, disabled: e, children: [o ? a(l, { paddingLeft: 3, paddingRight: 2, children: o }) : null, a(F, { id: i, name: g, ref: $, "aria-describedby": n, "aria-invalid": s, "aria-disabled": e, disabled: e, "data-disabled": e ? "" : void 0, hasLeftAction: !!o, hasRightAction: !!r, onChange: b, "aria-required": m, $size: u, ...f }), r ? a(l, { paddingLeft: 2, paddingRight: 3, children: r }) : null] });
|
|
19
|
+
}), F = p.input`
|
|
20
|
+
border: none;
|
|
21
|
+
border-radius: ${({ theme: r }) => r.borderRadius};
|
|
22
|
+
padding-bottom: ${({ $size: r }) => `${c[r] / 16}rem`};
|
|
23
|
+
padding-left: ${({ theme: r, hasLeftAction: o }) => o ? 0 : r.spaces[4]};
|
|
24
|
+
padding-right: ${({ theme: r, hasRightAction: o }) => o ? 0 : r.spaces[4]};
|
|
25
|
+
padding-top: ${({ $size: r }) => `${c[r] / 16}rem`};
|
|
26
|
+
cursor: ${(r) => r["aria-disabled"] ? "not-allowed" : void 0};
|
|
27
|
+
|
|
28
|
+
color: ${({ theme: r }) => r.colors.neutral800};
|
|
29
|
+
font-weight: 400;
|
|
30
|
+
font-size: ${(r) => r.theme.fontSizes[2]};
|
|
31
|
+
display: block;
|
|
32
|
+
width: 100%;
|
|
33
|
+
background: inherit;
|
|
34
|
+
|
|
35
|
+
::placeholder {
|
|
36
|
+
color: ${({ theme: r }) => r.colors.neutral500};
|
|
37
|
+
opacity: 1;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&[aria-disabled='true'] {
|
|
41
|
+
color: inherit;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
//focus managed by InputWrapper
|
|
45
|
+
&:focus {
|
|
46
|
+
outline: none;
|
|
47
|
+
box-shadow: none;
|
|
48
|
+
}
|
|
49
|
+
`, j = p(B)`
|
|
50
|
+
border: 1px solid ${({ theme: r, hasError: o }) => o ? r.colors.danger600 : r.colors.neutral200};
|
|
51
|
+
border-radius: ${({ theme: r }) => r.borderRadius};
|
|
52
|
+
background: ${({ theme: r }) => r.colors.neutral0};
|
|
53
|
+
${k()}
|
|
54
|
+
|
|
55
|
+
${({ theme: r, disabled: o }) => o ? R`
|
|
56
|
+
color: ${r.colors.neutral600};
|
|
57
|
+
background: ${r.colors.neutral150};
|
|
58
|
+
` : void 0}
|
|
59
|
+
`;
|
|
60
|
+
export {
|
|
61
|
+
M as FieldInput,
|
|
62
|
+
j as InputWrapper
|
|
63
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),u=require("react"),p=require("styled-components"),h=require("./FieldContext.cjs"),f=require("../helpers/deprecations.cjs"),o=require("../Typography/Typography.cjs"),g=require("../Flex/Flex.cjs"),y=e=>e&&e.__esModule?e:{default:e},t=y(p),q=f.once(console.warn),x=u.forwardRef(({children:e,action:n,required:i,...l},s)=>{const{id:a,required:d}=h.useField(),c=d||i;return i!==void 0&&q('Deprecation warning: Usage of "required" prop in FieldLabel component is deprecated. This is discouraged and will be removed in the next major release. Please use the Field component to share the required prop.'),r.jsxs(F,{ref:s,variant:"pi",textColor:"neutral800",htmlFor:a,fontWeight:"bold",as:"label",...l,children:[e,c&&r.jsx(m,{textColor:"danger600",children:"*"}),n&&r.jsx(b,{marginLeft:1,children:n})]})}),F=t.default(o.Typography)`
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
`,m=t.default(o.Typography)`
|
|
5
|
+
line-height: 0;
|
|
6
|
+
`,b=t.default(g.Flex)`
|
|
7
|
+
line-height: 0;
|
|
8
|
+
|
|
9
|
+
svg path {
|
|
10
|
+
fill: ${({theme:e})=>e.colors.neutral500};
|
|
11
|
+
}
|
|
12
|
+
`;exports.FieldLabel=x;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsxs as m, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as c } from "react";
|
|
3
|
+
import r from "styled-components";
|
|
4
|
+
import { useField as h } from "./FieldContext.js";
|
|
5
|
+
import { once as f } from "../helpers/deprecations.js";
|
|
6
|
+
import { Typography as n } from "../Typography/Typography.js";
|
|
7
|
+
import { Flex as g } from "../Flex/Flex.js";
|
|
8
|
+
const u = f(console.warn), A = c(({ children: e, action: o, required: i, ...l }, s) => {
|
|
9
|
+
const { id: a, required: d } = h(), p = d || i;
|
|
10
|
+
return i !== void 0 && u('Deprecation warning: Usage of "required" prop in FieldLabel component is deprecated. This is discouraged and will be removed in the next major release. Please use the Field component to share the required prop.'), m(x, { ref: s, variant: "pi", textColor: "neutral800", htmlFor: a, fontWeight: "bold", as: "label", ...l, children: [e, p && t(y, { textColor: "danger600", children: "*" }), o && t(F, { marginLeft: 1, children: o })] });
|
|
11
|
+
}), x = r(n)`
|
|
12
|
+
display: flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
`, y = r(n)`
|
|
15
|
+
line-height: 0;
|
|
16
|
+
`, F = r(g)`
|
|
17
|
+
line-height: 0;
|
|
18
|
+
|
|
19
|
+
svg path {
|
|
20
|
+
fill: ${({ theme: e }) => e.colors.neutral500};
|
|
21
|
+
}
|
|
22
|
+
`;
|
|
23
|
+
export {
|
|
24
|
+
A as FieldLabel
|
|
25
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./Field.cjs"),t=require("./FieldLabel.cjs"),e=require("./FieldInput.cjs"),l=require("./FieldHint.cjs"),d=require("./FieldError.cjs"),i=require("./FieldContext.cjs"),n=require("./FieldAction.cjs");exports.Field=r.Field;exports.FieldLabel=t.FieldLabel;exports.FieldInput=e.FieldInput;exports.InputWrapper=e.InputWrapper;exports.FieldHint=l.FieldHint;exports.FieldError=d.FieldError;exports.FieldContext=i.FieldContext;exports.useField=i.useField;exports.FieldAction=n.FieldAction;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Field as o } from "./Field.js";
|
|
2
|
+
import { FieldLabel as p } from "./FieldLabel.js";
|
|
3
|
+
import { FieldInput as l, InputWrapper as d } from "./FieldInput.js";
|
|
4
|
+
import { FieldHint as F } from "./FieldHint.js";
|
|
5
|
+
import { FieldError as m } from "./FieldError.js";
|
|
6
|
+
import { FieldContext as u, useField as a } from "./FieldContext.js";
|
|
7
|
+
import { FieldAction as b } from "./FieldAction.js";
|
|
8
|
+
export {
|
|
9
|
+
o as Field,
|
|
10
|
+
b as FieldAction,
|
|
11
|
+
u as FieldContext,
|
|
12
|
+
m as FieldError,
|
|
13
|
+
F as FieldHint,
|
|
14
|
+
l as FieldInput,
|
|
15
|
+
p as FieldLabel,
|
|
16
|
+
d as InputWrapper,
|
|
17
|
+
a as useField
|
|
18
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("styled-components"),o=require("../helpers/handleResponsiveValues.cjs"),l=require("../Box/Box.cjs"),i=e=>e&&e.__esModule?e:{default:e},r=i(n),s={direction:!0},u=r.default(l.Box).withConfig({shouldForwardProp:(e,t)=>!s[e]&&t(e)})`
|
|
2
|
+
align-items: ${({alignItems:e="center"})=>e};
|
|
3
|
+
display: ${({inline:e})=>e?"inline-flex":"flex"};
|
|
4
|
+
flex-direction: ${({direction:e="row"})=>e};
|
|
5
|
+
flex-shrink: ${({shrink:e})=>e};
|
|
6
|
+
flex-wrap: ${({wrap:e})=>e};
|
|
7
|
+
${({gap:e,theme:t})=>o("gap",e,t)};
|
|
8
|
+
justify-content: ${({justifyContent:e})=>e};
|
|
9
|
+
`;exports.Flex=u;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import i from "styled-components";
|
|
2
|
+
import r from "../helpers/handleResponsiveValues.js";
|
|
3
|
+
import { Box as t } from "../Box/Box.js";
|
|
4
|
+
const n = {
|
|
5
|
+
direction: !0
|
|
6
|
+
}, a = i(t).withConfig({
|
|
7
|
+
shouldForwardProp: (e, o) => !n[e] && o(e)
|
|
8
|
+
})`
|
|
9
|
+
align-items: ${({ alignItems: e = "center" }) => e};
|
|
10
|
+
display: ${({ inline: e }) => e ? "inline-flex" : "flex"};
|
|
11
|
+
flex-direction: ${({ direction: e = "row" }) => e};
|
|
12
|
+
flex-shrink: ${({ shrink: e }) => e};
|
|
13
|
+
flex-wrap: ${({ wrap: e }) => e};
|
|
14
|
+
${({ gap: e, theme: o }) => r("gap", e, o)};
|
|
15
|
+
justify-content: ${({ justifyContent: e }) => e};
|
|
16
|
+
`;
|
|
17
|
+
export {
|
|
18
|
+
a as Flex
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./Flex.cjs");exports.Flex=e.Flex;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),r=require("react"),l=require("../helpers/getFocusableNodes.cjs"),f=require("../helpers/keyboardKeys.cjs"),m=({onEscape:s,restoreFocus:o=!0,...i})=>{const n=r.useRef(null);r.useEffect(()=>{let e=null;return o&&(e=document.activeElement),()=>{e&&e.focus()}},[o]),r.useEffect(()=>{if(!n.current)return;const e=l.getFocusableNodes(n.current);e.length>0?e[0].focus():console.warn("[FocusTrap]: it seems there are no focusable elements in the focus trap tree. Make sure there s at least one.")},[]);const a=e=>{if(e.key===f.KeyboardKeys.ESCAPE&&s){s();return}if(e.key!==f.KeyboardKeys.TAB)return;const t=l.getFocusableNodes(n.current);if(t.length>0){const u=t[0],c=t[t.length-1];e.shiftKey?u===document.activeElement&&(e.preventDefault(),c.focus()):c===document.activeElement&&(e.preventDefault(),u.focus())}};return d.jsx("div",{ref:n,onKeyDown:a,...i})};exports.FocusTrap=m;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as m, useEffect as l } from "react";
|
|
3
|
+
import { getFocusableNodes as u } from "../helpers/getFocusableNodes.js";
|
|
4
|
+
import { KeyboardKeys as c } from "../helpers/keyboardKeys.js";
|
|
5
|
+
const v = ({ onEscape: r, restoreFocus: o = !0, ...i }) => {
|
|
6
|
+
const n = m(null);
|
|
7
|
+
return l(() => {
|
|
8
|
+
let e = null;
|
|
9
|
+
return o && (e = document.activeElement), () => {
|
|
10
|
+
e && e.focus();
|
|
11
|
+
};
|
|
12
|
+
}, [o]), l(() => {
|
|
13
|
+
if (!n.current)
|
|
14
|
+
return;
|
|
15
|
+
const e = u(n.current);
|
|
16
|
+
e.length > 0 ? e[0].focus() : console.warn("[FocusTrap]: it seems there are no focusable elements in the focus trap tree. Make sure there s at least one.");
|
|
17
|
+
}, []), a("div", { ref: n, onKeyDown: (e) => {
|
|
18
|
+
if (e.key === c.ESCAPE && r) {
|
|
19
|
+
r();
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
if (e.key !== c.TAB)
|
|
23
|
+
return;
|
|
24
|
+
const t = u(n.current);
|
|
25
|
+
if (t.length > 0) {
|
|
26
|
+
const s = t[0], f = t[t.length - 1];
|
|
27
|
+
e.shiftKey ? s === document.activeElement && (e.preventDefault(), f.focus()) : f === document.activeElement && (e.preventDefault(), s.focus());
|
|
28
|
+
}
|
|
29
|
+
}, ...i });
|
|
30
|
+
};
|
|
31
|
+
export {
|
|
32
|
+
v as FocusTrap
|
|
33
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./FocusTrap.cjs");exports.FocusTrap=e.FocusTrap;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),c=require("react"),l=require("prop-types"),d=require("styled-components"),i=require("./GridContext.cjs"),f=require("../helpers/handleResponsiveValues.cjs"),p=require("../Box/Box.cjs"),a=e=>e&&e.__esModule?e:{default:e};function y(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 m=y(c),o=a(l),_=a(d),b=_.default(p.Box)`
|
|
2
|
+
display: grid;
|
|
3
|
+
grid-template-columns: repeat(${({gridCols:e})=>e}, 1fr);
|
|
4
|
+
${({theme:e,gap:t})=>f("gap",t,e)}
|
|
5
|
+
`,u=({gap:e,gridCols:t,...r})=>{const n=m.useMemo(()=>({gap:e,gridCols:t}),[e,t]);return s.jsx(i.GridContext.Provider,{value:n,children:s.jsx(b,{gap:e,gridCols:t,...r})})};u.defaultProps={gap:0,gridCols:12};u.propTypes={gap:o.default.oneOfType([o.default.number,o.default.arrayOf(o.default.number)]),gridCols:o.default.number};exports.Grid=u;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import * as s from "react";
|
|
3
|
+
import e from "prop-types";
|
|
4
|
+
import n from "styled-components";
|
|
5
|
+
import { GridContext as a } from "./GridContext.js";
|
|
6
|
+
import d from "../helpers/handleResponsiveValues.js";
|
|
7
|
+
import { Box as f } from "../Box/Box.js";
|
|
8
|
+
const l = n(f)`
|
|
9
|
+
display: grid;
|
|
10
|
+
grid-template-columns: repeat(${({ gridCols: r }) => r}, 1fr);
|
|
11
|
+
${({ theme: r, gap: o }) => d("gap", o, r)}
|
|
12
|
+
`, t = ({ gap: r, gridCols: o, ...m }) => {
|
|
13
|
+
const i = s.useMemo(() => ({ gap: r, gridCols: o }), [r, o]);
|
|
14
|
+
return /* @__PURE__ */ p(a.Provider, { value: i, children: /* @__PURE__ */ p(l, { gap: r, gridCols: o, ...m }) });
|
|
15
|
+
};
|
|
16
|
+
t.defaultProps = {
|
|
17
|
+
gap: 0,
|
|
18
|
+
gridCols: 12
|
|
19
|
+
};
|
|
20
|
+
t.propTypes = {
|
|
21
|
+
gap: e.oneOfType([e.number, e.arrayOf(e.number)]),
|
|
22
|
+
gridCols: e.number
|
|
23
|
+
};
|
|
24
|
+
export {
|
|
25
|
+
t as Grid
|
|
26
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=e.createContext({gap:0,gridCols:12}),o=()=>e.useContext(t);exports.GridContext=t;exports.useGrid=o;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime");require("react");const a=require("prop-types"),c=require("styled-components"),p=require("./GridContext.cjs"),m=require("../Box/Box.cjs"),s=e=>e&&e.__esModule?e:{default:e},r=s(a),f=s(c),x=f.default.div`
|
|
2
|
+
grid-column: span ${({col:e})=>e};
|
|
3
|
+
max-width: 100%;
|
|
4
|
+
|
|
5
|
+
${({theme:e})=>e.mediaQueries.tablet} {
|
|
6
|
+
grid-column: span ${({s:e})=>e};
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
${({theme:e})=>e.mediaQueries.mobile} {
|
|
10
|
+
grid-column: span ${({xs:e})=>e};
|
|
11
|
+
}
|
|
12
|
+
`,t=({col:e,xs:i,s:d,...u})=>{const{gap:n,gridCols:l}=p.useGrid();return o.jsx(x,{gap:n,gridCols:l,col:e,xs:i,s:d,children:o.jsx(m.Box,{...u})})};t.defaultProps={col:void 0,s:void 0,xs:void 0};t.propTypes={col:r.default.number,s:r.default.number,xs:r.default.number};exports.GridItem=t;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import o from "prop-types";
|
|
4
|
+
import n from "styled-components";
|
|
5
|
+
import { useGrid as l } from "./GridContext.js";
|
|
6
|
+
import { Box as u } from "../Box/Box.js";
|
|
7
|
+
const a = n.div`
|
|
8
|
+
grid-column: span ${({ col: r }) => r};
|
|
9
|
+
max-width: 100%;
|
|
10
|
+
|
|
11
|
+
${({ theme: r }) => r.mediaQueries.tablet} {
|
|
12
|
+
grid-column: span ${({ s: r }) => r};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
${({ theme: r }) => r.mediaQueries.mobile} {
|
|
16
|
+
grid-column: span ${({ xs: r }) => r};
|
|
17
|
+
}
|
|
18
|
+
`, m = ({ col: r, xs: e, s: p, ...s }) => {
|
|
19
|
+
const { gap: t, gridCols: d } = l();
|
|
20
|
+
return /* @__PURE__ */ i(a, { gap: t, gridCols: d, col: r, xs: e, s: p, children: /* @__PURE__ */ i(u, { ...s }) });
|
|
21
|
+
};
|
|
22
|
+
m.defaultProps = {
|
|
23
|
+
col: void 0,
|
|
24
|
+
s: void 0,
|
|
25
|
+
xs: void 0
|
|
26
|
+
};
|
|
27
|
+
m.propTypes = {
|
|
28
|
+
col: o.number,
|
|
29
|
+
s: o.number,
|
|
30
|
+
xs: o.number
|
|
31
|
+
};
|
|
32
|
+
export {
|
|
33
|
+
m as GridItem
|
|
34
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./Grid.cjs"),r=require("./GridItem.cjs");exports.Grid=e.Grid;exports.GridItem=r.GridItem;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),s=require("react"),u=require("styled-components"),a=require("../helpers/theme.cjs"),d=require("../Box/Box.cjs"),o=e=>e&&e.__esModule?e:{default:e},i=o(s),f=o(u),m=f.default(d.Box)`
|
|
2
|
+
path {
|
|
3
|
+
fill: ${({color:e,theme:t})=>a.extractStyleFromTheme(t.colors,e,void 0)};
|
|
4
|
+
}
|
|
5
|
+
${({theme:e,colors:t})=>t(e)}
|
|
6
|
+
`,r=i.default.forwardRef(({color:e="neutral600",colors:t=()=>"",...c},n)=>l.jsx(m,{ref:n,color:e,colors:t,...c}));r.displayName="Icon";exports.Icon=r;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import f from "react";
|
|
3
|
+
import c from "styled-components";
|
|
4
|
+
import { extractStyleFromTheme as l } from "../helpers/theme.js";
|
|
5
|
+
import { Box as p } from "../Box/Box.js";
|
|
6
|
+
const a = c(p)`
|
|
7
|
+
path {
|
|
8
|
+
fill: ${({ color: o, theme: r }) => l(r.colors, o, void 0)};
|
|
9
|
+
}
|
|
10
|
+
${({ theme: o, colors: r }) => r(o)}
|
|
11
|
+
`, n = f.forwardRef(({ color: o = "neutral600", colors: r = () => "", ...t }, e) => m(a, { ref: e, color: o, colors: r, ...t }));
|
|
12
|
+
n.displayName = "Icon";
|
|
13
|
+
export {
|
|
14
|
+
n as Icon
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./Icon.cjs");exports.Icon=e.Icon;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),v=require("react"),j=require("styled-components"),y=require("../VisuallyHidden/VisuallyHidden.cjs"),_=require("../Tooltip/Tooltip.cjs"),B=require("../BaseButton/BaseButton.cjs"),m=require("../Flex/Flex.cjs"),R=e=>e&&e.__esModule?e:{default:e};function q(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 o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const u=q(v),c=R(j),x=u.forwardRef(({label:e,background:t,borderWidth:r,noBorder:o=!1,children:d,icon:f,disabled:l=!1,onClick:a,"aria-label":p,...b},g)=>{const $=h=>{!l&&a&&a(h)},s=n.jsxs(i,{"aria-disabled":l,background:l?"neutral150":t,borderWidth:o?0:r,justifyContent:"center",height:"2rem",width:"2rem",...b,ref:g,onClick:$,children:[n.jsx(y.VisuallyHidden,{as:"span",children:e??p}),u.cloneElement(f||d,{"aria-hidden":!0,focusable:!1})]});return e?n.jsx(_.Tooltip,{label:e,children:s}):s}),i=c.default(B.BaseButton)`
|
|
2
|
+
svg {
|
|
3
|
+
> g,
|
|
4
|
+
path {
|
|
5
|
+
fill: ${({theme:e})=>e.colors.neutral500};
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
&:hover {
|
|
10
|
+
svg {
|
|
11
|
+
> g,
|
|
12
|
+
path {
|
|
13
|
+
fill: ${({theme:e})=>e.colors.neutral600};
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&:active {
|
|
19
|
+
svg {
|
|
20
|
+
> g,
|
|
21
|
+
path {
|
|
22
|
+
fill: ${({theme:e})=>e.colors.neutral400};
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&[aria-disabled='true'] {
|
|
28
|
+
svg {
|
|
29
|
+
path {
|
|
30
|
+
fill: ${({theme:e})=>e.colors.neutral600};
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
`,O=c.default(m.Flex)`
|
|
35
|
+
& span:first-child button {
|
|
36
|
+
border-left: 1px solid ${({theme:e})=>e.colors.neutral200};
|
|
37
|
+
border-radius: ${({theme:e})=>`${e.borderRadius} 0 0 ${e.borderRadius}`};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
& span:last-child button {
|
|
41
|
+
border-radius: ${({theme:e})=>`0 ${e.borderRadius} ${e.borderRadius} 0`};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
& ${i} {
|
|
45
|
+
border-radius: 0;
|
|
46
|
+
border-left: none;
|
|
47
|
+
|
|
48
|
+
svg {
|
|
49
|
+
path {
|
|
50
|
+
fill: ${({theme:e})=>e.colors.neutral700};
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&:hover {
|
|
55
|
+
background-color: ${({theme:e})=>e.colors.neutral100};
|
|
56
|
+
|
|
57
|
+
svg {
|
|
58
|
+
path {
|
|
59
|
+
fill: ${({theme:e})=>e.colors.neutral800};
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&:active {
|
|
65
|
+
background-color: ${({theme:e})=>e.colors.neutral150};
|
|
66
|
+
svg {
|
|
67
|
+
path {
|
|
68
|
+
fill: ${({theme:e})=>e.colors.neutral900};
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&[aria-disabled='true'] {
|
|
74
|
+
svg {
|
|
75
|
+
path {
|
|
76
|
+
fill: ${({theme:e})=>e.colors.neutral600};
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
`;exports.IconButton=x;exports.IconButtonGroup=O;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { jsxs as m, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import * as e from "react";
|
|
3
|
+
import s from "styled-components";
|
|
4
|
+
import { VisuallyHidden as g } from "../VisuallyHidden/VisuallyHidden.js";
|
|
5
|
+
import { Tooltip as v } from "../Tooltip/Tooltip.js";
|
|
6
|
+
import { BaseButton as R } from "../BaseButton/BaseButton.js";
|
|
7
|
+
import { Flex as k } from "../Flex/Flex.js";
|
|
8
|
+
const W = e.forwardRef(({ label: r, background: i, borderWidth: c, noBorder: d = !1, children: u, icon: f, disabled: o = !1, onClick: l, "aria-label": p, ...h }, $) => {
|
|
9
|
+
const t = m(n, { "aria-disabled": o, background: o ? "neutral150" : i, borderWidth: d ? 0 : c, justifyContent: "center", height: "2rem", width: "2rem", ...h, ref: $, onClick: (b) => {
|
|
10
|
+
!o && l && l(b);
|
|
11
|
+
}, children: [a(g, { as: "span", children: r ?? p }), e.cloneElement(f || u, {
|
|
12
|
+
"aria-hidden": !0,
|
|
13
|
+
focusable: !1
|
|
14
|
+
// See: https://allyjs.io/tutorials/focusing-in-svg.html#making-svg-elements-focusable
|
|
15
|
+
})] });
|
|
16
|
+
return r ? a(v, { label: r, children: t }) : t;
|
|
17
|
+
}), n = s(R)`
|
|
18
|
+
svg {
|
|
19
|
+
> g,
|
|
20
|
+
path {
|
|
21
|
+
fill: ${({ theme: r }) => r.colors.neutral500};
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&:hover {
|
|
26
|
+
svg {
|
|
27
|
+
> g,
|
|
28
|
+
path {
|
|
29
|
+
fill: ${({ theme: r }) => r.colors.neutral600};
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&:active {
|
|
35
|
+
svg {
|
|
36
|
+
> g,
|
|
37
|
+
path {
|
|
38
|
+
fill: ${({ theme: r }) => r.colors.neutral400};
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&[aria-disabled='true'] {
|
|
44
|
+
svg {
|
|
45
|
+
path {
|
|
46
|
+
fill: ${({ theme: r }) => r.colors.neutral600};
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
`, E = s(k)`
|
|
51
|
+
& span:first-child button {
|
|
52
|
+
border-left: 1px solid ${({ theme: r }) => r.colors.neutral200};
|
|
53
|
+
border-radius: ${({ theme: r }) => `${r.borderRadius} 0 0 ${r.borderRadius}`};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
& span:last-child button {
|
|
57
|
+
border-radius: ${({ theme: r }) => `0 ${r.borderRadius} ${r.borderRadius} 0`};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
& ${n} {
|
|
61
|
+
border-radius: 0;
|
|
62
|
+
border-left: none;
|
|
63
|
+
|
|
64
|
+
svg {
|
|
65
|
+
path {
|
|
66
|
+
fill: ${({ theme: r }) => r.colors.neutral700};
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
&:hover {
|
|
71
|
+
background-color: ${({ theme: r }) => r.colors.neutral100};
|
|
72
|
+
|
|
73
|
+
svg {
|
|
74
|
+
path {
|
|
75
|
+
fill: ${({ theme: r }) => r.colors.neutral800};
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&:active {
|
|
81
|
+
background-color: ${({ theme: r }) => r.colors.neutral150};
|
|
82
|
+
svg {
|
|
83
|
+
path {
|
|
84
|
+
fill: ${({ theme: r }) => r.colors.neutral900};
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
&[aria-disabled='true'] {
|
|
90
|
+
svg {
|
|
91
|
+
path {
|
|
92
|
+
fill: ${({ theme: r }) => r.colors.neutral600};
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
`;
|
|
98
|
+
export {
|
|
99
|
+
W as IconButton,
|
|
100
|
+
E as IconButtonGroup
|
|
101
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./IconButton.cjs");exports.IconButton=o.IconButton;exports.IconButtonGroup=o.IconButtonGroup;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),u=require("react"),S=require("@codemirror/lang-json"),M=require("@uiw/react-codemirror"),N=require("./JSONInputContainer.cjs"),l=require("./utils/decorationExtension.cjs"),R=require("../Field/Field.cjs"),H=require("../Flex/Flex.cjs"),L=require("../Field/FieldLabel.cjs"),y=require("../Field/FieldError.cjs"),z=require("../Field/FieldHint.cjs"),A=({label:a,error:d,hint:x,labelAction:F,value:m="",required:q=!1,disabled:h=!1,onChange:p=()=>null,...b})=>{const i=u.useRef(),o=u.useRef(),c=u.useRef(),j=!!d,C=e=>{const r=o.current?.doc;if(r){const{text:s,to:t}=r.line(e),E=t-s.trimStart().length;t>E&&c.current?.dispatch({effects:l.addMarks.of([l.lineHighlightMark.range(E,t)])})}},O=()=>{const e=o.current?.doc;if(e){const r=e.length||0;c.current?.dispatch({effects:l.filterMarks.of((s,t)=>t<=0||s>=r)})}},f=({state:e,view:r})=>{c.current=r,o.current=e,O();const t=S.jsonParseLinter()(r);t.length&&C(e.doc.lineAt(t[0].from).number)},k=(e,r)=>{f(r),p(e)},I=(e,r)=>{c.current=e,o.current=r,f({view:e,state:r})},{setContainer:g}=M.useCodeMirror({value:m,onCreateEditor:I,container:i.current,editable:!h,extensions:[S.json(),l.markField],onChange:k,theme:"dark",basicSetup:{lineNumbers:!0,bracketMatching:!0,closeBrackets:!0,indentOnInput:!0,syntaxHighlighting:!0,highlightSelectionMatches:!0,tabSize:2}}),J=()=>{h||i.current?.children[0].children[1].children[1]?.focus()};return u.useEffect(()=>{const e=i.current;e&&g(e)},[g]),n.jsx(R.Field,{error:d,hint:x,required:q,children:n.jsxs(H.Flex,{direction:"column",alignItems:"stretch",gap:1,children:[a&&n.jsx(L.FieldLabel,{onClick:J,action:F,children:a}),n.jsx(N.JSONInputContainer,{ref:i,hasError:j,alignItems:"stretch",fontSize:2,hasRadius:!0,...b}),n.jsx(y.FieldError,{}),n.jsx(z.FieldHint,{})]})})};exports.JSONInput=A;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { jsx as n, jsxs as O } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as l, useEffect as J } from "react";
|
|
3
|
+
import { json as j, jsonParseLinter as H } from "@codemirror/lang-json";
|
|
4
|
+
import { useCodeMirror as L } from "@uiw/react-codemirror";
|
|
5
|
+
import { JSONInputContainer as z } from "./JSONInputContainer.js";
|
|
6
|
+
import { markField as A, addMarks as B, lineHighlightMark as R, filterMarks as q } from "./utils/decorationExtension.js";
|
|
7
|
+
import { Field as y } from "../Field/Field.js";
|
|
8
|
+
import { Flex as P } from "../Flex/Flex.js";
|
|
9
|
+
import { FieldLabel as V } from "../Field/FieldLabel.js";
|
|
10
|
+
import { FieldError as D } from "../Field/FieldError.js";
|
|
11
|
+
import { FieldHint as G } from "../Field/FieldHint.js";
|
|
12
|
+
const v = ({ label: a, error: d, hint: g, labelAction: p, value: E = "", required: S = !1, disabled: u = !1, onChange: k = () => null, ...C }) => {
|
|
13
|
+
const o = l(), i = l(), c = l(), F = !!d, b = (r) => {
|
|
14
|
+
const t = i.current?.doc;
|
|
15
|
+
if (t) {
|
|
16
|
+
const { text: s, to: e } = t.line(r), m = e - s.trimStart().length;
|
|
17
|
+
e > m && c.current?.dispatch({
|
|
18
|
+
effects: B.of([R.range(m, e)])
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}, x = () => {
|
|
22
|
+
const r = i.current?.doc;
|
|
23
|
+
if (r) {
|
|
24
|
+
const t = r.length || 0;
|
|
25
|
+
c.current?.dispatch({
|
|
26
|
+
effects: q.of((s, e) => e <= 0 || s >= t)
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}, f = ({ state: r, view: t }) => {
|
|
30
|
+
c.current = t, i.current = r, x();
|
|
31
|
+
const e = H()(t);
|
|
32
|
+
e.length && b(r.doc.lineAt(e[0].from).number);
|
|
33
|
+
}, M = (r, t) => {
|
|
34
|
+
f(t), k(r);
|
|
35
|
+
}, I = (r, t) => {
|
|
36
|
+
c.current = r, i.current = t, f({ view: r, state: t });
|
|
37
|
+
}, { setContainer: h } = L({
|
|
38
|
+
value: E,
|
|
39
|
+
onCreateEditor: I,
|
|
40
|
+
container: o.current,
|
|
41
|
+
editable: !u,
|
|
42
|
+
extensions: [j(), A],
|
|
43
|
+
onChange: M,
|
|
44
|
+
theme: "dark",
|
|
45
|
+
basicSetup: {
|
|
46
|
+
lineNumbers: !0,
|
|
47
|
+
bracketMatching: !0,
|
|
48
|
+
closeBrackets: !0,
|
|
49
|
+
indentOnInput: !0,
|
|
50
|
+
syntaxHighlighting: !0,
|
|
51
|
+
highlightSelectionMatches: !0,
|
|
52
|
+
tabSize: 2
|
|
53
|
+
}
|
|
54
|
+
}), N = () => {
|
|
55
|
+
u || o.current?.children[0].children[1].children[1]?.focus();
|
|
56
|
+
};
|
|
57
|
+
return J(() => {
|
|
58
|
+
const r = o.current;
|
|
59
|
+
r && h(r);
|
|
60
|
+
}, [h]), n(y, { error: d, hint: g, required: S, children: O(P, { direction: "column", alignItems: "stretch", gap: 1, children: [a && n(V, { onClick: N, action: p, children: a }), n(z, { ref: o, hasError: F, alignItems: "stretch", fontSize: 2, hasRadius: !0, ...C }), n(D, {}), n(G, {})] }) });
|
|
61
|
+
};
|
|
62
|
+
export {
|
|
63
|
+
v as JSONInput
|
|
64
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("styled-components"),o=require("../themes/utils.cjs"),s=require("../Flex/Flex.cjs"),n=e=>e&&e.__esModule?e:{default:e},c=n(r),l=c.default(s.Flex)`
|
|
2
|
+
line-height: ${({theme:e})=>e.lineHeights[2]};
|
|
3
|
+
|
|
4
|
+
.cm-editor {
|
|
5
|
+
/**
|
|
6
|
+
* Hard coded since the color is the same between themes,
|
|
7
|
+
* theme.colors.neutral800 changes between themes
|
|
8
|
+
*/
|
|
9
|
+
background-color: #32324d;
|
|
10
|
+
width: 100%;
|
|
11
|
+
outline: none;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.cm-scroller {
|
|
15
|
+
border: 1px solid ${({theme:e,hasError:t})=>t?e.colors.danger600:e.colors.neutral200};
|
|
16
|
+
/* inputFocusStyle will receive hasError prop */
|
|
17
|
+
${o.inputFocusStyle()}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.cm-editor,
|
|
21
|
+
.cm-scroller {
|
|
22
|
+
border-radius: ${({theme:e})=>e.borderRadius};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.cm-gutters,
|
|
26
|
+
.cm-activeLineGutter {
|
|
27
|
+
/**
|
|
28
|
+
* Hard coded since the color is the same between themes,
|
|
29
|
+
* theme.colors.neutral700 changes between themes
|
|
30
|
+
*/
|
|
31
|
+
background-color: #4a4a6a;
|
|
32
|
+
}
|
|
33
|
+
`;exports.JSONInputContainer=l;
|