@algolia/satellite 1.0.0-beta.147 → 1.0.0-beta.148
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/cjs/AnnouncementBadge/AnnouncementBadge.js +7 -24
- package/cjs/AnnouncementBadge/index.js +0 -5
- package/cjs/AutoComplete/AutoComplete.js +68 -163
- package/cjs/AutoComplete/AutoComplete.tailwind.js +2 -5
- package/cjs/AutoComplete/components/AutoCompleteEmptyState.js +5 -14
- package/cjs/AutoComplete/components/DefaultOptionItem.js +2 -11
- package/cjs/AutoComplete/index.js +0 -11
- package/cjs/AutoComplete/utils.js +0 -8
- package/cjs/Avatars/ApplicationAvatar.js +3 -13
- package/cjs/Avatars/UserAvatar.js +6 -20
- package/cjs/Avatars/index.js +0 -7
- package/cjs/Avatars/utils.js +6 -37
- package/cjs/Badge/Badge.js +13 -36
- package/cjs/Badge/index.js +0 -5
- package/cjs/Banners/Alert/Alert.js +18 -28
- package/cjs/Banners/Alert/index.js +0 -5
- package/cjs/Banners/BigBertha/BigBertha.js +1 -9
- package/cjs/Banners/BigBertha/index.js +0 -5
- package/cjs/Banners/Promote/Promote.js +8 -19
- package/cjs/Banners/Promote/index.js +0 -5
- package/cjs/Banners/index.js +0 -6
- package/cjs/Button/Button.js +13 -33
- package/cjs/Button/Button.tailwind.js +3 -5
- package/cjs/Button/ButtonGroup.js +3 -11
- package/cjs/Button/IconButton.js +12 -35
- package/cjs/Button/index.js +0 -11
- package/cjs/Button/styles.js +1 -10
- package/cjs/Button/types.js +0 -1
- package/cjs/Card/Card.js +6 -21
- package/cjs/Card/Card.tailwind.js +1 -2
- package/cjs/Card/components/CardHeader.js +1 -14
- package/cjs/Card/components/CardTitle.js +2 -15
- package/cjs/Card/index.js +0 -9
- package/cjs/Checkbox/Checkbox.js +14 -38
- package/cjs/Checkbox/Checkbox.tailwind.js +1 -3
- package/cjs/Checkbox/index.js +0 -5
- package/cjs/ClickAwayContainer/ClickAwayContainer.js +11 -23
- package/cjs/ClickAwayContainer/index.js +0 -2
- package/cjs/DatePicker/DatePicker/DatePicker.js +13 -46
- package/cjs/DatePicker/DatePicker/datePickerReducer.js +0 -15
- package/cjs/DatePicker/DatePicker/index.js +0 -7
- package/cjs/DatePicker/DatePicker.tailwind.js +2 -12
- package/cjs/DatePicker/DateRangePicker/DateRangePicker.js +29 -72
- package/cjs/DatePicker/DateRangePicker/DateRangePickerDisplay.js +4 -14
- package/cjs/DatePicker/DateRangePicker/dateRangePickerReducer.js +2 -28
- package/cjs/DatePicker/DateRangePicker/dateRangePickerTimeRange.js +0 -6
- package/cjs/DatePicker/DateRangePicker/index.js +0 -9
- package/cjs/DatePicker/components/Calendar.js +5 -16
- package/cjs/DatePicker/components/Display.js +3 -9
- package/cjs/DatePicker/components/Footer.js +0 -7
- package/cjs/DatePicker/components/FooterActions.js +3 -11
- package/cjs/DatePicker/components/Modal.js +17 -39
- package/cjs/DatePicker/components/NavBar.js +12 -34
- package/cjs/DatePicker/components/SidePanel.js +0 -7
- package/cjs/DatePicker/components/index.js +0 -7
- package/cjs/DatePicker/index.js +0 -9
- package/cjs/DatePicker/utils.js +0 -4
- package/cjs/Dropdown/Dropdown.js +23 -58
- package/cjs/Dropdown/DropdownButton.js +3 -20
- package/cjs/Dropdown/DropdownContext.js +0 -6
- package/cjs/Dropdown/components/DropdownButtonItem.js +5 -21
- package/cjs/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItem.js +10 -25
- package/cjs/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsGroup.js +2 -6
- package/cjs/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsGroupContext.js +0 -6
- package/cjs/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsMultiGroup.js +6 -16
- package/cjs/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsSingleGroup.js +6 -15
- package/cjs/Dropdown/components/DropdownCollapsibleItem/index.js +0 -9
- package/cjs/Dropdown/components/DropdownDivider.js +0 -7
- package/cjs/Dropdown/components/DropdownFooterItem.js +2 -15
- package/cjs/Dropdown/components/DropdownLinkItem.js +6 -23
- package/cjs/Dropdown/components/DropdownRadioItem.js +4 -20
- package/cjs/Dropdown/components/DropdownTitle.js +1 -14
- package/cjs/Dropdown/components/DropdownToggleItem.js +5 -22
- package/cjs/Dropdown/index.js +0 -27
- package/cjs/Dropdown/useDropdownItemProps.js +1 -14
- package/cjs/Dropzone/Dropzone.js +27 -62
- package/cjs/Dropzone/index.js +0 -5
- package/cjs/EmptyState/EmptyState.js +12 -23
- package/cjs/EmptyState/EmptyState.tailwind.js +0 -1
- package/cjs/EmptyState/index.js +0 -7
- package/cjs/Field/Field.js +8 -21
- package/cjs/Field/FieldStateContext.js +0 -2
- package/cjs/Field/index.js +0 -9
- package/cjs/Field/useFieldState.js +0 -7
- package/cjs/Flag/Flag.js +17 -40
- package/cjs/Flag/Flag.tailwind.js +0 -1
- package/cjs/Flag/Flags.js +4 -19
- package/cjs/Flag/index.js +0 -9
- package/cjs/FlexGrid/FlexGrid.js +13 -24
- package/cjs/FlexGrid/FlexGrid.tailwind.js +4 -11
- package/cjs/FlexGrid/index.js +0 -5
- package/cjs/HelpUnderline/HelpUnderline.js +5 -14
- package/cjs/HelpUnderline/HelpUnderline.tailwind.js +1 -2
- package/cjs/HelpUnderline/index.js +0 -5
- package/cjs/Input/Input.js +26 -70
- package/cjs/Input/Input.tailwind.js +1 -4
- package/cjs/Input/index.js +0 -5
- package/cjs/Insert/Insert.js +7 -17
- package/cjs/Insert/index.js +0 -5
- package/cjs/InstantSearch/InstantSearch.tailwind.js +4 -10
- package/cjs/KeyboardKey/KeyboardKey.js +1 -12
- package/cjs/KeyboardKey/KeyboardKey.tailwind.js +1 -2
- package/cjs/KeyboardKey/index.js +0 -2
- package/cjs/Link/BaseLink.js +2 -12
- package/cjs/Link/ButtonLink.js +3 -17
- package/cjs/Link/IconButtonLink.js +2 -13
- package/cjs/Link/Link.js +6 -23
- package/cjs/Link/index.js +0 -11
- package/cjs/Medallion/Medallion.js +5 -14
- package/cjs/Medallion/Medallion.tailwind.js +3 -6
- package/cjs/Medallion/index.js +0 -7
- package/cjs/Modal/Modal.js +21 -57
- package/cjs/Modal/Modal.tailwind.js +3 -3
- package/cjs/Modal/components/ModalFooter.js +2 -16
- package/cjs/Modal/components/ModalSection.js +3 -11
- package/cjs/Modal/index.js +0 -9
- package/cjs/Pagination/CompactPagination/CompactPagination.js +1 -22
- package/cjs/Pagination/CompactPagination/index.js +0 -5
- package/cjs/Pagination/DotPagination/DotPagination.js +5 -19
- package/cjs/Pagination/DotPagination/index.js +0 -5
- package/cjs/Pagination/Pagination/Pagination.js +9 -34
- package/cjs/Pagination/Pagination/index.js +0 -5
- package/cjs/Pagination/index.js +0 -9
- package/cjs/ProgressBar/ProgressBar.js +3 -16
- package/cjs/ProgressBar/ProgressBar.tailwind.js +1 -3
- package/cjs/ProgressBar/index.js +0 -5
- package/cjs/ProgressSpinner/ProgressSpinner.js +8 -20
- package/cjs/ProgressSpinner/ProgressSpinner.tailwind.js +2 -3
- package/cjs/ProgressSpinner/index.js +0 -5
- package/cjs/RadioGroup/RadioButton.js +1 -14
- package/cjs/RadioGroup/RadioButton.tailwind.js +1 -4
- package/cjs/RadioGroup/RadioGroup.js +19 -38
- package/cjs/RadioGroup/RadiogroupContext.js +0 -6
- package/cjs/RadioGroup/index.js +0 -9
- package/cjs/RangeSlider/RangeSlider.js +26 -43
- package/cjs/RangeSlider/RangeSlider.tailwind.js +1 -3
- package/cjs/RangeSlider/index.js +0 -5
- package/cjs/Satellite/Satellite.js +4 -10
- package/cjs/Satellite/SatelliteContext.js +0 -9
- package/cjs/Satellite/SatelliteRouter.js +2 -9
- package/cjs/Satellite/index.js +0 -13
- package/cjs/Satellite/locale.js +1 -7
- package/cjs/Satellite/useCreatePortal.js +2 -8
- package/cjs/ScrollIndicator/ScrollIndicator.js +18 -41
- package/cjs/ScrollIndicator/ScrollIndicator.tailwind.js +1 -3
- package/cjs/ScrollIndicator/index.js +0 -5
- package/cjs/Select/Select.js +4 -17
- package/cjs/Select/Select.tailwind.js +2 -5
- package/cjs/Select/index.js +0 -5
- package/cjs/Sidebar/Sidebar.js +11 -30
- package/cjs/Sidebar/SidebarButtonLink.js +10 -30
- package/cjs/Sidebar/SidebarContext.js +0 -6
- package/cjs/Sidebar/SidebarHeader.js +1 -9
- package/cjs/Sidebar/SidebarHeading.js +3 -14
- package/cjs/Sidebar/SidebarLink.js +5 -20
- package/cjs/Sidebar/SidebarLinksGroup/ActiveLinkIndicator.js +2 -11
- package/cjs/Sidebar/SidebarLinksGroup/SidebarGroupLink.js +3 -14
- package/cjs/Sidebar/SidebarLinksGroup/SidebarLinksGroup.js +8 -31
- package/cjs/Sidebar/SidebarLinksGroup/index.js +0 -2
- package/cjs/Sidebar/SidebarNav.js +5 -16
- package/cjs/Sidebar/index.js +0 -17
- package/cjs/Switch/Switch.js +15 -36
- package/cjs/Switch/Switch.tailwind.js +1 -2
- package/cjs/Switch/SwitchOption.js +2 -15
- package/cjs/Switch/index.js +0 -7
- package/cjs/Switch/utils.js +0 -9
- package/cjs/Tables/DataTable/DataTable.js +28 -70
- package/cjs/Tables/DataTable/DataTable.tailwind.js +2 -2
- package/cjs/Tables/DataTable/components/Body.js +14 -33
- package/cjs/Tables/DataTable/components/Footer.js +1 -17
- package/cjs/Tables/DataTable/components/Header.js +5 -12
- package/cjs/Tables/DataTable/components/HeaderCell.js +10 -27
- package/cjs/Tables/DataTable/components/Loader.js +4 -17
- package/cjs/Tables/DataTable/components/index.js +0 -10
- package/cjs/Tables/DataTable/index.js +0 -7
- package/cjs/Tables/DataTable/utils.js +0 -9
- package/cjs/Tables/Table/Table.js +7 -21
- package/cjs/Tables/Table/Table.tailwind.js +1 -2
- package/cjs/Tables/Table/components/TableFooter.js +2 -10
- package/cjs/Tables/Table/index.js +0 -7
- package/cjs/Tables/index.js +0 -7
- package/cjs/Tabs/ContentTabs.js +10 -21
- package/cjs/Tabs/LinkTabs.js +5 -18
- package/cjs/Tabs/Tabs.tailwind.js +1 -2
- package/cjs/Tabs/components/LinkTab.js +2 -27
- package/cjs/Tabs/index.js +0 -9
- package/cjs/Tabs/utils.js +0 -5
- package/cjs/Tag/Tag.js +7 -26
- package/cjs/Tag/Tag.tailwind.js +1 -2
- package/cjs/Tag/index.js +0 -5
- package/cjs/TextArea/TextArea.js +1 -14
- package/cjs/TextArea/TextArea.tailwind.js +1 -4
- package/cjs/TextArea/index.js +0 -5
- package/cjs/TextWrap/TextWrap.js +3 -18
- package/cjs/TextWrap/index.js +0 -5
- package/cjs/Toggle/Toggle.js +6 -27
- package/cjs/Toggle/Toggle.tailwind.js +1 -3
- package/cjs/Toggle/index.js +0 -5
- package/cjs/Tooltip/OverflowTooltipWrapper.js +33 -62
- package/cjs/Tooltip/Tooltip.js +4 -17
- package/cjs/Tooltip/Tooltip.tailwind.js +3 -5
- package/cjs/Tooltip/TooltipWrapper.js +43 -71
- package/cjs/Tooltip/index.js +0 -9
- package/cjs/Typography/Typography.tailwind.js +12 -18
- package/cjs/UserContent/UserContent.js +3 -11
- package/cjs/UserContent/UserContent.tailwind.js +2 -11
- package/cjs/index.js +0 -89
- package/cjs/styles/base.tailwind.js +7 -7
- package/cjs/styles/colors.js +7 -7
- package/cjs/styles/disabledColor.js +1 -4
- package/cjs/styles/helpers/icons.js +5 -11
- package/cjs/styles/helpers/makePurgeCssExtractor.js +3 -15
- package/cjs/styles/helpers/makeTailwindPrefixer.js +1 -9
- package/cjs/styles/helpers/prefixTailwindClassName.js +6 -6
- package/cjs/styles/helpers/satellitePrefixer.js +1 -2
- package/cjs/styles/rgba.js +1 -3
- package/cjs/styles/tailwind.config.js +4 -11
- package/cjs/styles/zIndexes.js +1 -0
- package/cjs/utilities/utilities.tailwind.js +0 -3
- package/cjs/utils/event-polyfill.js +0 -2
- package/cjs/utils/formatters.js +12 -19
- package/cjs/utils/genericChangeHandler.js +0 -6
- package/cjs/utils/hashCode.js +0 -5
- package/cjs/utils/index.js +0 -7
- package/cjs/utils/isCssPropertySupported.js +0 -3
- package/cjs/utils/isNil.js +0 -2
- package/cjs/utils/isRenderedChild.js +0 -2
- package/cjs/utils/matchLocation.js +0 -4
- package/cjs/utils/onlyText.js +3 -12
- package/cjs/utils/parseUrl.js +2 -4
- package/cjs/utils/pluralize.js +2 -7
- package/cjs/utils/range.js +0 -2
- package/cjs/utils/toSentenceCase.js +0 -4
- package/cjs/utils/uniqBy.js +0 -4
- package/cjs/utils/uniqueId.js +0 -2
- package/cjs/utils/useForwardedRef.js +0 -6
- package/cjs/utils/useLinkProps.js +1 -13
- package/cjs/utils/useTriggerInputChange.js +2 -4
- package/esm/AnnouncementBadge/AnnouncementBadge.js +7 -14
- package/esm/AutoComplete/AutoComplete.js +68 -158
- package/esm/AutoComplete/AutoComplete.tailwind.js +2 -2
- package/esm/AutoComplete/components/AutoCompleteEmptyState.js +5 -7
- package/esm/AutoComplete/components/DefaultOptionItem.js +2 -8
- package/esm/AutoComplete/utils.js +0 -2
- package/esm/Avatars/ApplicationAvatar.js +3 -6
- package/esm/Avatars/UserAvatar.js +6 -12
- package/esm/Avatars/utils.js +7 -23
- package/esm/Badge/Badge.js +13 -28
- package/esm/Banners/Alert/Alert.js +18 -20
- package/esm/Banners/BigBertha/BigBertha.js +1 -4
- package/esm/Banners/Promote/Promote.js +8 -10
- package/esm/Button/Button.js +13 -21
- package/esm/Button/Button.tailwind.js +3 -2
- package/esm/Button/ButtonGroup.js +3 -6
- package/esm/Button/IconButton.js +12 -22
- package/esm/Button/styles.js +1 -5
- package/esm/Card/Card.js +6 -12
- package/esm/Card/Card.tailwind.js +1 -1
- package/esm/Card/components/CardHeader.js +1 -7
- package/esm/Card/components/CardTitle.js +2 -8
- package/esm/Checkbox/Checkbox.js +14 -28
- package/esm/Checkbox/Checkbox.tailwind.js +1 -1
- package/esm/ClickAwayContainer/ClickAwayContainer.js +11 -13
- package/esm/DatePicker/DatePicker/DatePicker.js +13 -31
- package/esm/DatePicker/DatePicker/datePickerReducer.js +0 -9
- package/esm/DatePicker/DatePicker.tailwind.js +2 -9
- package/esm/DatePicker/DateRangePicker/DateRangePicker.js +29 -55
- package/esm/DatePicker/DateRangePicker/DateRangePickerDisplay.js +4 -8
- package/esm/DatePicker/DateRangePicker/dateRangePickerReducer.js +2 -16
- package/esm/DatePicker/components/Calendar.js +5 -10
- package/esm/DatePicker/components/Display.js +3 -5
- package/esm/DatePicker/components/Footer.js +0 -4
- package/esm/DatePicker/components/FooterActions.js +3 -7
- package/esm/DatePicker/components/Modal.js +17 -27
- package/esm/DatePicker/components/NavBar.js +12 -22
- package/esm/DatePicker/components/SidePanel.js +0 -4
- package/esm/Dropdown/Dropdown.js +23 -34
- package/esm/Dropdown/DropdownButton.js +3 -11
- package/esm/Dropdown/DropdownContext.js +0 -2
- package/esm/Dropdown/components/DropdownButtonItem.js +5 -12
- package/esm/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItem.js +10 -15
- package/esm/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsGroup.js +2 -2
- package/esm/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsGroupContext.js +0 -2
- package/esm/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsMultiGroup.js +6 -9
- package/esm/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsSingleGroup.js +6 -9
- package/esm/Dropdown/components/DropdownDivider.js +0 -2
- package/esm/Dropdown/components/DropdownFooterItem.js +2 -8
- package/esm/Dropdown/components/DropdownLinkItem.js +6 -13
- package/esm/Dropdown/components/DropdownRadioItem.js +4 -11
- package/esm/Dropdown/components/DropdownTitle.js +1 -7
- package/esm/Dropdown/components/DropdownToggleItem.js +5 -12
- package/esm/Dropdown/useDropdownItemProps.js +1 -7
- package/esm/Dropzone/Dropzone.js +27 -45
- package/esm/EmptyState/EmptyState.js +12 -16
- package/esm/Field/Field.js +8 -11
- package/esm/Flag/Flag.js +17 -25
- package/esm/Flag/Flags.js +4 -9
- package/esm/FlexGrid/FlexGrid.js +13 -15
- package/esm/FlexGrid/FlexGrid.tailwind.js +4 -9
- package/esm/HelpUnderline/HelpUnderline.js +5 -7
- package/esm/HelpUnderline/HelpUnderline.tailwind.js +1 -1
- package/esm/Input/Input.js +26 -54
- package/esm/Input/Input.tailwind.js +1 -1
- package/esm/Insert/Insert.js +7 -11
- package/esm/InstantSearch/InstantSearch.tailwind.js +4 -4
- package/esm/KeyboardKey/KeyboardKey.js +1 -3
- package/esm/KeyboardKey/KeyboardKey.tailwind.js +1 -1
- package/esm/Link/BaseLink.js +2 -6
- package/esm/Link/ButtonLink.js +3 -9
- package/esm/Link/IconButtonLink.js +2 -6
- package/esm/Link/Link.js +6 -14
- package/esm/Medallion/Medallion.js +5 -7
- package/esm/Medallion/Medallion.tailwind.js +3 -2
- package/esm/Modal/Modal.js +21 -38
- package/esm/Modal/Modal.tailwind.js +3 -2
- package/esm/Modal/components/ModalFooter.js +2 -8
- package/esm/Modal/components/ModalSection.js +3 -5
- package/esm/Pagination/CompactPagination/CompactPagination.js +1 -9
- package/esm/Pagination/DotPagination/DotPagination.js +5 -11
- package/esm/Pagination/Pagination/Pagination.js +9 -21
- package/esm/ProgressBar/ProgressBar.js +3 -10
- package/esm/ProgressBar/ProgressBar.tailwind.js +1 -1
- package/esm/ProgressSpinner/ProgressSpinner.js +8 -12
- package/esm/ProgressSpinner/ProgressSpinner.tailwind.js +2 -2
- package/esm/RadioGroup/RadioButton.js +1 -7
- package/esm/RadioGroup/RadioButton.tailwind.js +1 -1
- package/esm/RadioGroup/RadioGroup.js +19 -25
- package/esm/RadioGroup/RadiogroupContext.js +0 -2
- package/esm/RangeSlider/RangeSlider.js +26 -35
- package/esm/RangeSlider/RangeSlider.tailwind.js +1 -1
- package/esm/Satellite/Satellite.js +4 -4
- package/esm/Satellite/SatelliteContext.js +0 -3
- package/esm/Satellite/SatelliteRouter.js +2 -4
- package/esm/Satellite/locale.js +1 -2
- package/esm/Satellite/useCreatePortal.js +2 -2
- package/esm/ScrollIndicator/ScrollIndicator.js +18 -31
- package/esm/ScrollIndicator/ScrollIndicator.tailwind.js +1 -1
- package/esm/Select/Select.js +4 -9
- package/esm/Select/Select.tailwind.js +2 -2
- package/esm/Sidebar/Sidebar.js +11 -17
- package/esm/Sidebar/SidebarButtonLink.js +10 -20
- package/esm/Sidebar/SidebarContext.js +0 -2
- package/esm/Sidebar/SidebarHeader.js +1 -3
- package/esm/Sidebar/SidebarHeading.js +3 -7
- package/esm/Sidebar/SidebarLink.js +5 -11
- package/esm/Sidebar/SidebarLinksGroup/ActiveLinkIndicator.js +2 -4
- package/esm/Sidebar/SidebarLinksGroup/SidebarGroupLink.js +3 -7
- package/esm/Sidebar/SidebarLinksGroup/SidebarLinksGroup.js +8 -18
- package/esm/Sidebar/SidebarNav.js +5 -9
- package/esm/Switch/Switch.js +15 -24
- package/esm/Switch/Switch.tailwind.js +1 -1
- package/esm/Switch/SwitchOption.js +2 -6
- package/esm/Tables/DataTable/DataTable.js +28 -49
- package/esm/Tables/DataTable/DataTable.tailwind.js +2 -1
- package/esm/Tables/DataTable/components/Body.js +14 -23
- package/esm/Tables/DataTable/components/Footer.js +1 -8
- package/esm/Tables/DataTable/components/Header.js +5 -6
- package/esm/Tables/DataTable/components/HeaderCell.js +10 -17
- package/esm/Tables/DataTable/components/Loader.js +4 -8
- package/esm/Tables/DataTable/utils.js +0 -1
- package/esm/Tables/Table/Table.js +7 -14
- package/esm/Tables/Table/Table.tailwind.js +1 -1
- package/esm/Tables/Table/components/TableFooter.js +2 -4
- package/esm/Tabs/ContentTabs.js +10 -12
- package/esm/Tabs/LinkTabs.js +5 -7
- package/esm/Tabs/Tabs.tailwind.js +1 -1
- package/esm/Tabs/components/LinkTab.js +2 -18
- package/esm/Tabs/utils.js +0 -2
- package/esm/Tag/Tag.js +7 -16
- package/esm/Tag/Tag.tailwind.js +1 -1
- package/esm/TextArea/TextArea.js +1 -7
- package/esm/TextArea/TextArea.tailwind.js +1 -1
- package/esm/TextWrap/TextWrap.js +3 -11
- package/esm/Toggle/Toggle.js +6 -19
- package/esm/Toggle/Toggle.tailwind.js +1 -1
- package/esm/Tooltip/OverflowTooltipWrapper.js +33 -46
- package/esm/Tooltip/Tooltip.js +4 -9
- package/esm/Tooltip/Tooltip.tailwind.js +3 -4
- package/esm/Tooltip/TooltipWrapper.js +43 -56
- package/esm/Typography/Typography.tailwind.js +12 -15
- package/esm/UserContent/UserContent.js +3 -5
- package/esm/UserContent/UserContent.tailwind.js +2 -7
- package/esm/styles/base.tailwind.js +7 -6
- package/esm/styles/colors.js +7 -7
- package/esm/styles/disabledColor.js +1 -2
- package/esm/styles/helpers/icons.js +5 -8
- package/esm/styles/helpers/makePurgeCssExtractor.js +3 -14
- package/esm/styles/helpers/makeTailwindPrefixer.js +1 -6
- package/esm/styles/helpers/prefixTailwindClassName.js +6 -6
- package/esm/styles/helpers/satellitePrefixer.js +1 -1
- package/esm/styles/rgba.js +1 -2
- package/esm/styles/tailwind.config.js +4 -6
- package/esm/styles/zIndexes.js +1 -0
- package/esm/utils/event-polyfill.js +0 -2
- package/esm/utils/formatters.js +12 -16
- package/esm/utils/genericChangeHandler.js +0 -2
- package/esm/utils/hashCode.js +0 -3
- package/esm/utils/isCssPropertySupported.js +0 -2
- package/esm/utils/isRenderedChild.js +0 -1
- package/esm/utils/matchLocation.js +0 -2
- package/esm/utils/onlyText.js +3 -11
- package/esm/utils/parseUrl.js +2 -2
- package/esm/utils/pluralize.js +2 -5
- package/esm/utils/toSentenceCase.js +1 -1
- package/esm/utils/uniqBy.js +0 -2
- package/esm/utils/useForwardedRef.js +0 -3
- package/esm/utils/useLinkProps.js +1 -7
- package/esm/utils/useTriggerInputChange.js +2 -3
- package/package.json +1 -1
- package/satellite.min.css +1 -1
- package/scss/colors.scss +16 -16
@@ -1,22 +1,16 @@
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
2
2
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
4
|
-
|
5
4
|
var _templateObject;
|
6
|
-
|
7
5
|
var _excluded = ["className"];
|
8
|
-
|
9
6
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
10
|
-
|
11
7
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
12
|
-
|
13
8
|
import cx from "clsx";
|
14
9
|
import stl from "../../styles/helpers/satellitePrefixer";
|
15
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
16
11
|
export var CardHeader = function CardHeader(_ref) {
|
17
12
|
var className = _ref.className,
|
18
|
-
|
19
|
-
|
13
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
20
14
|
return /*#__PURE__*/_jsx("div", _objectSpread(_objectSpread({}, props), {}, {
|
21
15
|
className: cx(stl(_templateObject || (_templateObject = _taggedTemplateLiteral(["flex justify-between"]))), className)
|
22
16
|
}));
|
@@ -1,23 +1,17 @@
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
2
2
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
4
|
-
|
5
4
|
var _templateObject;
|
6
|
-
|
7
5
|
var _excluded = ["className", "children"];
|
8
|
-
|
9
6
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
10
|
-
|
11
7
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
12
|
-
|
13
8
|
import cx from "clsx";
|
14
9
|
import stl from "../../styles/helpers/satellitePrefixer";
|
15
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
16
11
|
export var CardTitle = function CardTitle(_ref) {
|
17
12
|
var className = _ref.className,
|
18
|
-
|
19
|
-
|
20
|
-
|
13
|
+
children = _ref.children,
|
14
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
21
15
|
return /*#__PURE__*/_jsx("h2", _objectSpread(_objectSpread({}, props), {}, {
|
22
16
|
className: cx(stl(_templateObject || (_templateObject = _taggedTemplateLiteral(["typo-display-heading"]))), className),
|
23
17
|
children: children
|
package/esm/Checkbox/Checkbox.js
CHANGED
@@ -3,13 +3,9 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
4
4
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
5
5
|
var _excluded = ["children", "className", "textPosition", "indeterminate", "defaultChecked", "checkedColor", "checked", "disabled"];
|
6
|
-
|
7
6
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
8
|
-
|
9
7
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
10
|
-
|
11
8
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
12
|
-
|
13
9
|
import cx from "clsx";
|
14
10
|
import { forwardRef, useMemo, useState } from "react";
|
15
11
|
import { Check, Minus } from "react-feather";
|
@@ -17,62 +13,52 @@ import { useFieldState } from "../Field";
|
|
17
13
|
import stl from "../styles/helpers/satellitePrefixer";
|
18
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
19
15
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
20
|
-
|
21
16
|
var generateFieldId = function generateFieldId() {
|
22
17
|
return Math.random().toString(36).substring(7);
|
23
18
|
};
|
24
|
-
|
25
19
|
var STATUS_CLASSNAMES = {
|
26
20
|
"default": "",
|
27
21
|
invalid: stl(_templateObject || (_templateObject = _taggedTemplateLiteral(["checkbox-invalid"]))),
|
28
22
|
validated: ""
|
29
23
|
};
|
24
|
+
|
30
25
|
/**
|
31
26
|
* When users need to make a range of selections (none, one, or several), checkboxes are a good input control.
|
32
27
|
*
|
33
28
|
* - A checkbox control has two primary states: selected and unselected. If required, there's an additional visual state for indeterminate (usually for a parent checkbox, when some children checkboxes are selected, but not all of them)
|
34
29
|
* - Checkboxes require the use of a button to apply the settings once they are selected
|
35
30
|
*/
|
36
|
-
|
37
31
|
export var Checkbox = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
38
32
|
var children = _ref.children,
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
33
|
+
className = _ref.className,
|
34
|
+
_ref$textPosition = _ref.textPosition,
|
35
|
+
textPosition = _ref$textPosition === void 0 ? "right" : _ref$textPosition,
|
36
|
+
indeterminate = _ref.indeterminate,
|
37
|
+
defaultChecked = _ref.defaultChecked,
|
38
|
+
checkedColor = _ref.checkedColor,
|
39
|
+
checked = _ref.checked,
|
40
|
+
disabled = _ref.disabled,
|
41
|
+
checkboxProps = _objectWithoutProperties(_ref, _excluded);
|
49
42
|
var id = useMemo(function () {
|
50
43
|
return checkboxProps.id || generateFieldId();
|
51
44
|
}, [checkboxProps.id]);
|
52
|
-
|
53
45
|
var _useFieldState = useFieldState(),
|
54
|
-
|
55
|
-
|
46
|
+
status = _useFieldState.status;
|
56
47
|
var isControlled = typeof checked === "boolean";
|
57
|
-
|
58
48
|
var _useState = useState(Boolean(isControlled ? checked : defaultChecked)),
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
49
|
+
_useState2 = _slicedToArray(_useState, 2),
|
50
|
+
internalChecked = _useState2[0],
|
51
|
+
setInternalChecked = _useState2[1];
|
63
52
|
var isChecked = Boolean(isControlled ? checked : internalChecked);
|
64
53
|
var CheckboxIcon = indeterminate ? Minus : Check;
|
65
|
-
|
66
54
|
var handleChange = function handleChange(evt) {
|
67
55
|
if (checkboxProps.onChange) {
|
68
56
|
checkboxProps.onChange(evt);
|
69
57
|
}
|
70
|
-
|
71
58
|
if (!isControlled && !evt.isDefaultPrevented()) {
|
72
59
|
setInternalChecked(evt.currentTarget.checked);
|
73
60
|
}
|
74
61
|
};
|
75
|
-
|
76
62
|
return /*#__PURE__*/_jsxs("div", {
|
77
63
|
className: cx(stl(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["inline-flex items-center ", ""])), textPosition === "left" && "flex-row-reverse"), className),
|
78
64
|
children: [/*#__PURE__*/_jsxs("span", {
|
@@ -8,6 +8,7 @@ export var useClickAwayContext = function useClickAwayContext() {
|
|
8
8
|
return useContext(ClickAwayContext);
|
9
9
|
};
|
10
10
|
var AWAY_EVENTS = ["mousedown", "touchstart", "focusin"];
|
11
|
+
|
11
12
|
/**
|
12
13
|
* ClickAwayContainer is a low-level, compound component. It doesn't render anything apart from its children.
|
13
14
|
* Its goal is to construct a tree of ClickAway-able React components (e.g. nested dropdown).
|
@@ -16,26 +17,23 @@ var AWAY_EVENTS = ["mousedown", "touchstart", "focusin"];
|
|
16
17
|
* but it's not the case when using portals.
|
17
18
|
* This component allows click-away functionality even when portals are involved.
|
18
19
|
*/
|
19
|
-
|
20
20
|
export var ClickAwayContainer = function ClickAwayContainer(_ref) {
|
21
21
|
var element = _ref.element,
|
22
|
-
|
23
|
-
|
24
|
-
|
22
|
+
onClickAway = _ref.onClickAway,
|
23
|
+
children = _ref.children;
|
25
24
|
var _useSet = useSet(),
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
25
|
+
_useSet2 = _slicedToArray(_useSet, 2),
|
26
|
+
elementsSet = _useSet2[0],
|
27
|
+
_useSet2$ = _useSet2[1],
|
28
|
+
registerElement = _useSet2$.add,
|
29
|
+
unregisterElement = _useSet2$.remove;
|
32
30
|
|
31
|
+
// Handle elements registry
|
33
32
|
var parentClickAwayContext = useClickAwayContext();
|
34
33
|
useEffect(function () {
|
35
34
|
if (!parentClickAwayContext || !element) {
|
36
35
|
return;
|
37
36
|
}
|
38
|
-
|
39
37
|
var elementsArray = Array.from(elementsSet);
|
40
38
|
parentClickAwayContext.registerElement(element);
|
41
39
|
elementsArray.forEach(function (el) {
|
@@ -47,8 +45,9 @@ export var ClickAwayContainer = function ClickAwayContainer(_ref) {
|
|
47
45
|
return parentClickAwayContext.unregisterElement(el);
|
48
46
|
});
|
49
47
|
};
|
50
|
-
}, [element, elementsSet, parentClickAwayContext]);
|
48
|
+
}, [element, elementsSet, parentClickAwayContext]);
|
51
49
|
|
50
|
+
// Wire up click away events
|
52
51
|
var fakeElementRef = useMemo(function () {
|
53
52
|
return {
|
54
53
|
current: element
|
@@ -58,7 +57,6 @@ export var ClickAwayContainer = function ClickAwayContainer(_ref) {
|
|
58
57
|
var isEventInside = Array.from(elementsSet).some(function (el) {
|
59
58
|
return el.contains(evt.target);
|
60
59
|
});
|
61
|
-
|
62
60
|
if (!isEventInside) {
|
63
61
|
onClickAway === null || onClickAway === void 0 ? void 0 : onClickAway(evt);
|
64
62
|
}
|
@@ -1,13 +1,9 @@
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
4
|
-
|
5
4
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
6
|
-
|
7
5
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
8
|
-
|
9
6
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
10
|
-
|
11
7
|
import { useMemo, useReducer, useState } from "react";
|
12
8
|
import { useLocale } from "../../Satellite";
|
13
9
|
import stl from "../../styles/helpers/satellitePrefixer";
|
@@ -22,65 +18,53 @@ import { DatePickerActionTypes, datePickerReducer, initDatePickerReducer } from
|
|
22
18
|
import { jsx as _jsx } from "react/jsx-runtime";
|
23
19
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
24
20
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
25
|
-
|
26
21
|
var DatePicker = function DatePicker(props) {
|
27
22
|
var _props$initialValue, _props$validate, _props$validate$call, _props$calendarProps;
|
28
|
-
|
29
23
|
var contextLocale = useLocale("datePicker");
|
30
|
-
|
31
24
|
var locale = _objectSpread(_objectSpread(_objectSpread({}, DEFAULT_DATE_PICKER_LOCALE), contextLocale), props.locale);
|
32
|
-
|
33
25
|
var _useState = useState(null),
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
26
|
+
_useState2 = _slicedToArray(_useState, 2),
|
27
|
+
targetElement = _useState2[0],
|
28
|
+
setTargetElement = _useState2[1];
|
38
29
|
var isControlled = props.value !== undefined;
|
39
|
-
|
40
30
|
var _useReducer = useReducer(datePickerReducer, isControlled ? {} : {
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
31
|
+
selected: (_props$initialValue = props.initialValue) !== null && _props$initialValue !== void 0 ? _props$initialValue : null
|
32
|
+
}, initDatePickerReducer),
|
33
|
+
_useReducer2 = _slicedToArray(_useReducer, 2),
|
34
|
+
state = _useReducer2[0],
|
35
|
+
dispatch = _useReducer2[1];
|
47
36
|
|
37
|
+
// Computed properties
|
48
38
|
var isValid = !((_props$validate = props.validate) !== null && _props$validate !== void 0 && (_props$validate$call = _props$validate.call(props, state)) !== null && _props$validate$call !== void 0 && _props$validate$call.length);
|
49
|
-
var value = isControlled ? props.value : state.selected;
|
39
|
+
var value = isControlled ? props.value : state.selected;
|
50
40
|
|
41
|
+
// Event handlers
|
51
42
|
var handleOpen = function handleOpen(e) {
|
52
43
|
var _props$onOpen;
|
53
|
-
|
54
44
|
(_props$onOpen = props.onOpen) === null || _props$onOpen === void 0 ? void 0 : _props$onOpen.call(props, e);
|
55
45
|
dispatch({
|
56
46
|
type: DatePickerActionTypes.show,
|
57
47
|
payload: true
|
58
48
|
});
|
59
49
|
};
|
60
|
-
|
61
50
|
var handleClose = function handleClose(e) {
|
62
51
|
var _props$onCancel;
|
63
|
-
|
64
52
|
(_props$onCancel = props.onCancel) === null || _props$onCancel === void 0 ? void 0 : _props$onCancel.call(props, e);
|
65
53
|
dispatch({
|
66
54
|
type: DatePickerActionTypes.show,
|
67
55
|
payload: false
|
68
56
|
});
|
69
57
|
};
|
70
|
-
|
71
58
|
var handleApply = function handleApply(e) {
|
72
59
|
var _props$onSubmit;
|
73
|
-
|
74
60
|
(_props$onSubmit = props.onSubmit) === null || _props$onSubmit === void 0 ? void 0 : _props$onSubmit.call(props, e, value);
|
75
61
|
dispatch({
|
76
62
|
type: DatePickerActionTypes.apply
|
77
63
|
});
|
78
64
|
};
|
79
|
-
|
80
65
|
var handleDayClick = function handleDayClick(payload, modifiers) {
|
81
66
|
if (!modifiers.disabled) {
|
82
67
|
var _props$onChange;
|
83
|
-
|
84
68
|
(_props$onChange = props.onChange) === null || _props$onChange === void 0 ? void 0 : _props$onChange.call(props, payload);
|
85
69
|
dispatch({
|
86
70
|
type: DatePickerActionTypes.dateSelect,
|
@@ -88,10 +72,8 @@ var DatePicker = function DatePicker(props) {
|
|
88
72
|
});
|
89
73
|
}
|
90
74
|
};
|
91
|
-
|
92
75
|
var yearProps = useMemo(function () {
|
93
76
|
var _state$selected;
|
94
|
-
|
95
77
|
return props.editableYear ? {
|
96
78
|
editableYear: true,
|
97
79
|
initialDate: (_state$selected = state.selected) !== null && _state$selected !== void 0 ? _state$selected : undefined,
|
@@ -99,7 +81,8 @@ var DatePicker = function DatePicker(props) {
|
|
99
81
|
} : {
|
100
82
|
editableYear: false
|
101
83
|
};
|
102
|
-
},
|
84
|
+
},
|
85
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
103
86
|
[props]);
|
104
87
|
return /*#__PURE__*/_jsxs("div", {
|
105
88
|
children: [/*#__PURE__*/_jsx("span", {
|
@@ -173,5 +156,4 @@ var DatePicker = function DatePicker(props) {
|
|
173
156
|
})]
|
174
157
|
});
|
175
158
|
};
|
176
|
-
|
177
159
|
export default DatePicker;
|
@@ -1,18 +1,13 @@
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
2
|
-
|
3
2
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
4
|
-
|
5
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
6
|
-
|
7
4
|
export var DatePickerActionTypes;
|
8
|
-
|
9
5
|
(function (DatePickerActionTypes) {
|
10
6
|
DatePickerActionTypes["show"] = "show";
|
11
7
|
DatePickerActionTypes["dateSelect"] = "date select";
|
12
8
|
DatePickerActionTypes["apply"] = "apply";
|
13
9
|
DatePickerActionTypes["reset"] = "reset";
|
14
10
|
})(DatePickerActionTypes || (DatePickerActionTypes = {}));
|
15
|
-
|
16
11
|
var initialState = {
|
17
12
|
show: false,
|
18
13
|
selected: null
|
@@ -26,26 +21,22 @@ export var datePickerReducer = function datePickerReducer(state, action) {
|
|
26
21
|
return _objectSpread(_objectSpread({}, state), {}, {
|
27
22
|
show: action.payload
|
28
23
|
});
|
29
|
-
|
30
24
|
case DatePickerActionTypes.dateSelect:
|
31
25
|
{
|
32
26
|
return _objectSpread(_objectSpread({}, state), {}, {
|
33
27
|
selected: action.payload
|
34
28
|
});
|
35
29
|
}
|
36
|
-
|
37
30
|
case DatePickerActionTypes.apply:
|
38
31
|
return _objectSpread(_objectSpread({}, state), {}, {
|
39
32
|
show: false
|
40
33
|
});
|
41
|
-
|
42
34
|
case DatePickerActionTypes.reset:
|
43
35
|
return _objectSpread(_objectSpread({}, initDatePickerReducer({
|
44
36
|
selected: action.payload
|
45
37
|
})), {}, {
|
46
38
|
show: state.show
|
47
39
|
});
|
48
|
-
|
49
40
|
default:
|
50
41
|
return state;
|
51
42
|
}
|
@@ -4,30 +4,23 @@ import _plugin from "tailwindcss/plugin";
|
|
4
4
|
var plugin = _plugin;
|
5
5
|
var datePickerPlugin = plugin(function (_ref) {
|
6
6
|
var _rdpDay, _rdpDay2, _rdpDay4, _addComponents;
|
7
|
-
|
8
7
|
var addComponents = _ref.addComponents,
|
9
|
-
|
10
|
-
|
11
|
-
|
8
|
+
theme = _ref.theme,
|
9
|
+
prefix = _ref.prefix;
|
12
10
|
/** @type {string} */
|
13
11
|
var defaultRadius = theme("borderRadius.DEFAULT");
|
14
12
|
/** @type {string} */
|
15
|
-
|
16
13
|
var accent600 = theme("colors.accent.600");
|
17
14
|
/** @type {string} */
|
18
|
-
|
19
15
|
var accent200 = theme("colors.accent.200");
|
20
|
-
|
21
16
|
var not = function not() {
|
22
17
|
for (var _len = arguments.length, modifiers = new Array(_len), _key = 0; _key < _len; _key++) {
|
23
18
|
modifiers[_key] = arguments[_key];
|
24
19
|
}
|
25
|
-
|
26
20
|
return modifiers.map(function (modifier) {
|
27
21
|
return ":not(.rdp-day_".concat(modifier, ")");
|
28
22
|
}).join("");
|
29
23
|
};
|
30
|
-
|
31
24
|
addComponents((_addComponents = {
|
32
25
|
".rdp-year": {
|
33
26
|
// ChevronDown svg from react-feather,
|
@@ -2,15 +2,10 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
4
4
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
5
|
-
|
6
5
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
7
|
-
|
8
6
|
var _excluded = ["id", "range", "displayOnlyRanges", "calendarProps", "initialState", "stateReducer", "onAction", "validate", "renderTarget", "renderLeftFooter", "renderRightPanel", "buttonSize", "modalPlacement", "locale"];
|
9
|
-
|
10
7
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
11
|
-
|
12
8
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
13
|
-
|
14
9
|
import { useMemo, useReducer, useState } from "react";
|
15
10
|
import { useLocale } from "../../Satellite";
|
16
11
|
import stl from "../../styles/helpers/satellitePrefixer";
|
@@ -26,95 +21,83 @@ import { isCompleteTimeRange, isEmptyTimeRange } from "./dateRangePickerTimeRang
|
|
26
21
|
import { jsx as _jsx } from "react/jsx-runtime";
|
27
22
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
28
23
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
29
|
-
|
30
24
|
var defaultValidator = function defaultValidator(_ref) {
|
31
25
|
var candidateRange = _ref.candidateRange;
|
32
26
|
return isCompleteTimeRange(candidateRange) ? null : [new Error("Invalid time range")];
|
33
27
|
};
|
34
|
-
|
35
28
|
var DEFAULT_DATE_RANGE_PICKER_LOCALE = _objectSpread(_objectSpread({}, DEFAULT_DATE_PICKER_LOCALE), {}, {
|
36
29
|
openButton: "Enter a date period..."
|
37
30
|
});
|
38
|
-
|
39
31
|
export var DateRangePicker = function DateRangePicker(_ref2) {
|
40
32
|
var _validate, _displayedRange$start, _initialRange$start;
|
41
|
-
|
42
33
|
var id = _ref2.id,
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
34
|
+
initialRange = _ref2.range,
|
35
|
+
displayOnlyRanges = _ref2.displayOnlyRanges,
|
36
|
+
_ref2$calendarProps = _ref2.calendarProps,
|
37
|
+
calendarProps = _ref2$calendarProps === void 0 ? {} : _ref2$calendarProps,
|
38
|
+
_ref2$initialState = _ref2.initialState,
|
39
|
+
initialState = _ref2$initialState === void 0 ? {} : _ref2$initialState,
|
40
|
+
_ref2$stateReducer = _ref2.stateReducer,
|
41
|
+
stateReducer = _ref2$stateReducer === void 0 ? dateRangePickerReducer : _ref2$stateReducer,
|
42
|
+
onAction = _ref2.onAction,
|
43
|
+
_ref2$validate = _ref2.validate,
|
44
|
+
validate = _ref2$validate === void 0 ? defaultValidator : _ref2$validate,
|
45
|
+
renderTarget = _ref2.renderTarget,
|
46
|
+
renderLeftFooter = _ref2.renderLeftFooter,
|
47
|
+
renderRightPanel = _ref2.renderRightPanel,
|
48
|
+
buttonSize = _ref2.buttonSize,
|
49
|
+
modalPlacement = _ref2.modalPlacement,
|
50
|
+
propsLocale = _ref2.locale,
|
51
|
+
props = _objectWithoutProperties(_ref2, _excluded);
|
62
52
|
var contextLocale = useLocale("datePicker");
|
63
|
-
|
64
53
|
var locale = _objectSpread(_objectSpread(_objectSpread({}, DEFAULT_DATE_RANGE_PICKER_LOCALE), contextLocale), propsLocale);
|
65
|
-
|
66
54
|
var _useState = useState(null),
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
55
|
+
_useState2 = _slicedToArray(_useState, 2),
|
56
|
+
targetElement = _useState2[0],
|
57
|
+
setTargetElement = _useState2[1];
|
71
58
|
var _useReducer = useReducer(function (state, action) {
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
59
|
+
return stateReducer(state, action, dateRangePickerReducer);
|
60
|
+
}, initialState, initDateRangePickerReducer),
|
61
|
+
_useReducer2 = _slicedToArray(_useReducer, 2),
|
62
|
+
state = _useReducer2[0],
|
63
|
+
baseDispatch = _useReducer2[1];
|
78
64
|
|
65
|
+
// Computed properties
|
79
66
|
var isValid = !((_validate = validate(state)) !== null && _validate !== void 0 && _validate.length);
|
80
67
|
var displayedRange = useMemo(function () {
|
81
68
|
return isEmptyTimeRange(state.candidateRange) ? initialRange !== null && initialRange !== void 0 ? initialRange : {
|
82
69
|
start: null,
|
83
70
|
end: null
|
84
71
|
} : state.candidateRange;
|
85
|
-
}, [initialRange, state.candidateRange]);
|
72
|
+
}, [initialRange, state.candidateRange]);
|
86
73
|
|
74
|
+
// Event handlers
|
87
75
|
var dispatch = function dispatch(action) {
|
88
76
|
onAction === null || onAction === void 0 ? void 0 : onAction(action, state);
|
89
77
|
baseDispatch(action);
|
90
78
|
};
|
91
|
-
|
92
79
|
var handleOpen = function handleOpen() {
|
93
80
|
dispatch({
|
94
81
|
type: DateRangePickerActionTypes.show,
|
95
82
|
payload: true
|
96
83
|
});
|
97
84
|
};
|
98
|
-
|
99
85
|
var handleClose = function handleClose() {
|
100
86
|
dispatch({
|
101
87
|
type: DateRangePickerActionTypes.show,
|
102
88
|
payload: false
|
103
89
|
});
|
104
90
|
};
|
105
|
-
|
106
91
|
var handleCancel = function handleCancel() {
|
107
92
|
dispatch({
|
108
93
|
type: DateRangePickerActionTypes.cancel
|
109
94
|
});
|
110
95
|
};
|
111
|
-
|
112
96
|
var handleApply = function handleApply() {
|
113
97
|
dispatch({
|
114
98
|
type: DateRangePickerActionTypes.apply
|
115
99
|
});
|
116
100
|
};
|
117
|
-
|
118
101
|
var handleMouseEnter = function handleMouseEnter(payload, _a, event) {
|
119
102
|
dispatch({
|
120
103
|
type: DateRangePickerActionTypes.mouseDayEnter,
|
@@ -124,7 +107,6 @@ export var DateRangePicker = function DateRangePicker(_ref2) {
|
|
124
107
|
}
|
125
108
|
});
|
126
109
|
};
|
127
|
-
|
128
110
|
var handleMouseLeave = function handleMouseLeave(_a, _b, event) {
|
129
111
|
dispatch({
|
130
112
|
type: DateRangePickerActionTypes.mouseDayLeave,
|
@@ -133,7 +115,6 @@ export var DateRangePicker = function DateRangePicker(_ref2) {
|
|
133
115
|
}
|
134
116
|
});
|
135
117
|
};
|
136
|
-
|
137
118
|
var handleDayClick = function handleDayClick(payload, modifiers) {
|
138
119
|
if (!modifiers.disabled) {
|
139
120
|
dispatch({
|
@@ -142,7 +123,6 @@ export var DateRangePicker = function DateRangePicker(_ref2) {
|
|
142
123
|
});
|
143
124
|
}
|
144
125
|
};
|
145
|
-
|
146
126
|
var selectedDays = displayedRange.start && displayedRange.end ? {
|
147
127
|
from: displayedRange.start,
|
148
128
|
to: displayedRange.end
|
@@ -151,19 +131,15 @@ export var DateRangePicker = function DateRangePicker(_ref2) {
|
|
151
131
|
to: state.hovered
|
152
132
|
} : (_displayedRange$start = displayedRange.start) !== null && _displayedRange$start !== void 0 ? _displayedRange$start : undefined;
|
153
133
|
var modifiers = {};
|
154
|
-
|
155
134
|
if (displayedRange.start) {
|
156
135
|
modifiers.start = [displayedRange.start];
|
157
136
|
}
|
158
|
-
|
159
137
|
if (displayedRange.end) {
|
160
138
|
modifiers.end = [displayedRange.end];
|
161
139
|
}
|
162
|
-
|
163
140
|
if (state.hovered) {
|
164
141
|
modifiers.hoveredTo = [state.hovered];
|
165
142
|
}
|
166
|
-
|
167
143
|
if (displayOnlyRanges) {
|
168
144
|
modifiers.displayedRanges = displayOnlyRanges.filter(function (range) {
|
169
145
|
return typeof range !== "undefined" && range.start instanceof Date && range.end instanceof Date;
|
@@ -184,10 +160,8 @@ export var DateRangePicker = function DateRangePicker(_ref2) {
|
|
184
160
|
return range.end;
|
185
161
|
});
|
186
162
|
}
|
187
|
-
|
188
163
|
var yearProps = useMemo(function () {
|
189
164
|
var _ref3, _displayedRange$start2;
|
190
|
-
|
191
165
|
return props.editableYear ? {
|
192
166
|
editableYear: true,
|
193
167
|
initialDate: (_ref3 = (_displayedRange$start2 = displayedRange.start) !== null && _displayedRange$start2 !== void 0 ? _displayedRange$start2 : displayedRange.end) !== null && _ref3 !== void 0 ? _ref3 : undefined,
|
@@ -1,7 +1,5 @@
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
2
|
-
|
3
2
|
var _templateObject;
|
4
|
-
|
5
3
|
import stl from "../../styles/helpers/satellitePrefixer";
|
6
4
|
import Display from "../components/Display";
|
7
5
|
import { formatDate } from "../utils";
|
@@ -9,13 +7,12 @@ import { isCompleteTimeRange } from "./dateRangePickerTimeRange";
|
|
9
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
10
8
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
11
9
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
12
|
-
|
13
10
|
var DateRangePickerDisplay = function DateRangePickerDisplay(_ref) {
|
14
11
|
var id = _ref.id,
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
12
|
+
onClick = _ref.onClick,
|
13
|
+
range = _ref.range,
|
14
|
+
buttonSize = _ref.buttonSize,
|
15
|
+
locale = _ref.locale;
|
19
16
|
return /*#__PURE__*/_jsx(Display, {
|
20
17
|
id: id,
|
21
18
|
onClick: onClick,
|
@@ -33,5 +30,4 @@ var DateRangePickerDisplay = function DateRangePickerDisplay(_ref) {
|
|
33
30
|
}) : locale.openButton
|
34
31
|
});
|
35
32
|
};
|
36
|
-
|
37
33
|
export default DateRangePickerDisplay;
|