@algolia/satellite 1.0.0-beta.147 → 1.0.0-beta.149
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 +5 -12
- 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 +14 -34
- package/cjs/Button/Button.tailwind.js +3 -5
- package/cjs/Button/ButtonGroup.js +3 -11
- package/cjs/Button/IconButton.js +13 -36
- 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 +8 -32
- 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.d.ts +3 -3
- package/cjs/Dropdown/DropdownContext.js +0 -6
- package/cjs/Dropdown/components/DropdownButtonItem.js +6 -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.d.ts +3 -3
- 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 +7 -23
- package/cjs/Dropdown/components/DropdownRadioItem.js +5 -20
- package/cjs/Dropdown/components/DropdownTitle.js +1 -14
- package/cjs/Dropdown/components/DropdownToggleItem.js +6 -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.d.ts +1 -0
- package/cjs/Input/Input.js +27 -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 +3 -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 +10 -33
- 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 +4 -29
- 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 +45 -73
- 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 +5 -7
- package/esm/Banners/Promote/Promote.js +8 -10
- package/esm/Button/Button.js +14 -22
- package/esm/Button/Button.tailwind.js +3 -2
- package/esm/Button/ButtonGroup.js +3 -6
- package/esm/Button/IconButton.js +13 -23
- 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 +8 -20
- 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.d.ts +3 -3
- package/esm/Dropdown/DropdownContext.js +0 -2
- package/esm/Dropdown/components/DropdownButtonItem.js +6 -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.d.ts +3 -3
- 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 +7 -13
- package/esm/Dropdown/components/DropdownRadioItem.js +5 -11
- package/esm/Dropdown/components/DropdownTitle.js +1 -7
- package/esm/Dropdown/components/DropdownToggleItem.js +6 -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.d.ts +1 -0
- package/esm/Input/Input.js +27 -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 +3 -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 +9 -19
- 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 +4 -20
- 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 +44 -57
- 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 +2 -2
- package/satellite.min.css +1 -1
- package/scss/colors.scss +16 -16
@@ -1,9 +1,6 @@
|
|
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
|
import endOfDay from "date-fns/endOfDay";
|
8
5
|
import isAfter from "date-fns/isAfter";
|
9
6
|
import isBefore from "date-fns/isBefore";
|
@@ -11,7 +8,6 @@ import isSameDay from "date-fns/isSameDay";
|
|
11
8
|
import startOfDay from "date-fns/startOfDay";
|
12
9
|
import { isPartialTimeRange } from "./dateRangePickerTimeRange";
|
13
10
|
export var DateRangePickerActionTypes;
|
14
|
-
|
15
11
|
(function (DateRangePickerActionTypes) {
|
16
12
|
DateRangePickerActionTypes["show"] = "show";
|
17
13
|
DateRangePickerActionTypes["dateSelect"] = "date select";
|
@@ -22,7 +18,6 @@ export var DateRangePickerActionTypes;
|
|
22
18
|
DateRangePickerActionTypes["cancel"] = "cancel";
|
23
19
|
DateRangePickerActionTypes["reset"] = "reset";
|
24
20
|
})(DateRangePickerActionTypes || (DateRangePickerActionTypes = {}));
|
25
|
-
|
26
21
|
var initialState = {
|
27
22
|
show: false,
|
28
23
|
candidateRange: {
|
@@ -33,11 +28,9 @@ var initialState = {
|
|
33
28
|
};
|
34
29
|
export var initDateRangePickerReducer = function initDateRangePickerReducer(state) {
|
35
30
|
var _state$candidateRange;
|
36
|
-
|
37
31
|
var _ref = (_state$candidateRange = state.candidateRange) !== null && _state$candidateRange !== void 0 ? _state$candidateRange : initialState.candidateRange,
|
38
|
-
|
39
|
-
|
40
|
-
|
32
|
+
start = _ref.start,
|
33
|
+
end = _ref.end;
|
41
34
|
return _objectSpread(_objectSpread(_objectSpread({}, initialState), state), {}, {
|
42
35
|
candidateRange: {
|
43
36
|
start: start && startOfDay(start),
|
@@ -51,7 +44,6 @@ export var dateRangePickerReducer = function dateRangePickerReducer(state, actio
|
|
51
44
|
return _objectSpread(_objectSpread({}, state), {}, {
|
52
45
|
show: action.payload
|
53
46
|
});
|
54
|
-
|
55
47
|
case DateRangePickerActionTypes.dateSelect:
|
56
48
|
{
|
57
49
|
return _objectSpread(_objectSpread({}, state), {}, {
|
@@ -64,25 +56,23 @@ export var dateRangePickerReducer = function dateRangePickerReducer(state, actio
|
|
64
56
|
}
|
65
57
|
});
|
66
58
|
}
|
67
|
-
|
68
59
|
case DateRangePickerActionTypes.rangeSelect:
|
69
60
|
{
|
70
61
|
return _objectSpread(_objectSpread({}, state), {}, {
|
71
62
|
candidateRange: action.payload
|
72
63
|
});
|
73
64
|
}
|
74
|
-
|
75
65
|
case DateRangePickerActionTypes.mouseDayEnter:
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
66
|
+
{
|
67
|
+
var shouldStoreHover = state.candidateRange.start && isBefore(state.candidateRange.start, action.payload);
|
68
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
69
|
+
hovered: shouldStoreHover ? action.payload : null
|
70
|
+
});
|
71
|
+
}
|
81
72
|
case DateRangePickerActionTypes.mouseDayLeave:
|
82
73
|
return _objectSpread(_objectSpread({}, state), {}, {
|
83
74
|
hovered: null
|
84
75
|
});
|
85
|
-
|
86
76
|
case DateRangePickerActionTypes.apply:
|
87
77
|
case DateRangePickerActionTypes.cancel:
|
88
78
|
return _objectSpread(_objectSpread({}, state), {}, {
|
@@ -92,12 +82,10 @@ export var dateRangePickerReducer = function dateRangePickerReducer(state, actio
|
|
92
82
|
},
|
93
83
|
show: false
|
94
84
|
});
|
95
|
-
|
96
85
|
case DateRangePickerActionTypes.reset:
|
97
86
|
return _objectSpread(_objectSpread({}, initialState), {}, {
|
98
87
|
show: state.show
|
99
88
|
});
|
100
|
-
|
101
89
|
default:
|
102
90
|
return state;
|
103
91
|
}
|
@@ -1,29 +1,25 @@
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
3
|
-
|
4
3
|
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; }
|
5
|
-
|
6
4
|
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; }
|
7
|
-
|
8
5
|
import { DayPicker } from "react-day-picker";
|
9
6
|
import NavBar from "./NavBar";
|
10
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
11
8
|
var excludedDayPickerPropsList = ["captionElement", "showOutsideDays", "enableOutsideDaysClick", "fixedWeeks", "labels", "navbarElement", "onTodayButtonClick", "pagedNavigation", "renderDay", "renderWeek", "reverseMonths", "showWeekNumber", "showWeekDays", "weekdayElement", "weekdaysLong", "weekdaysShort"];
|
12
|
-
|
13
9
|
var Calendar = function Calendar(props) {
|
14
10
|
var curatedProps = Object.fromEntries(Object.entries(props).filter(function (_ref) {
|
15
11
|
var _ref2 = _slicedToArray(_ref, 1),
|
16
|
-
|
17
|
-
|
18
|
-
|
12
|
+
key = _ref2[0];
|
13
|
+
return (
|
14
|
+
// @ts-expect-error
|
19
15
|
!excludedDayPickerPropsList.includes(key)
|
20
16
|
);
|
21
17
|
}));
|
18
|
+
|
22
19
|
/**
|
23
20
|
* modifierClassNames applies the object value (className) to the key (modifier). These classNames are
|
24
21
|
* defined / modified in the DatePicker.tailwind.js file.
|
25
22
|
*/
|
26
|
-
|
27
23
|
var modifierClassNames = {
|
28
24
|
start: "rdp-day_range_start",
|
29
25
|
end: "rdp-day_range_end",
|
@@ -32,8 +28,8 @@ var Calendar = function Calendar(props) {
|
|
32
28
|
displayedRangesStart: "rdp-day_displayedRangesStart",
|
33
29
|
//stl`bg-grey-600 text-white rounded-l border-0`,
|
34
30
|
displayedRangesEnd: "rdp-day_displayedRangesEnd" //stl`bg-grey-600 text-white rounded-r border-0`,
|
35
|
-
|
36
31
|
};
|
32
|
+
|
37
33
|
return /*#__PURE__*/_jsx(DayPicker, _objectSpread(_objectSpread({
|
38
34
|
mode: props.mode
|
39
35
|
}, curatedProps), {}, {
|
@@ -49,5 +45,4 @@ var Calendar = function Calendar(props) {
|
|
49
45
|
}
|
50
46
|
}));
|
51
47
|
};
|
52
|
-
|
53
48
|
export default Calendar;
|
@@ -1,12 +1,11 @@
|
|
1
1
|
import { Calendar } from "react-feather";
|
2
2
|
import Button from "../../Button";
|
3
3
|
import { jsx as _jsx } from "react/jsx-runtime";
|
4
|
-
|
5
4
|
var Display = function Display(_ref) {
|
6
5
|
var id = _ref.id,
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
size = _ref.size,
|
7
|
+
onClick = _ref.onClick,
|
8
|
+
children = _ref.children;
|
10
9
|
return /*#__PURE__*/_jsx(Button, {
|
11
10
|
id: id,
|
12
11
|
size: size,
|
@@ -15,5 +14,4 @@ var Display = function Display(_ref) {
|
|
15
14
|
children: children
|
16
15
|
});
|
17
16
|
};
|
18
|
-
|
19
17
|
export default Display;
|
@@ -1,10 +1,7 @@
|
|
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 { jsx as _jsx } from "react/jsx-runtime";
|
7
|
-
|
8
5
|
var Footer = function Footer(_ref) {
|
9
6
|
var children = _ref.children;
|
10
7
|
return /*#__PURE__*/_jsx("div", {
|
@@ -12,5 +9,4 @@ var Footer = function Footer(_ref) {
|
|
12
9
|
children: children
|
13
10
|
});
|
14
11
|
};
|
15
|
-
|
16
12
|
export default Footer;
|
@@ -1,17 +1,14 @@
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
2
|
-
|
3
2
|
var _templateObject, _templateObject2;
|
4
|
-
|
5
3
|
import { Button } from "../../Button";
|
6
4
|
import stl from "../../styles/helpers/satellitePrefixer";
|
7
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
8
6
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
9
|
-
|
10
7
|
var FooterActions = function FooterActions(_ref) {
|
11
8
|
var onCancel = _ref.onCancel,
|
12
|
-
|
13
|
-
|
14
|
-
|
9
|
+
onApply = _ref.onApply,
|
10
|
+
disableApply = _ref.disableApply,
|
11
|
+
locale = _ref.locale;
|
15
12
|
return /*#__PURE__*/_jsxs("div", {
|
16
13
|
className: stl(_templateObject || (_templateObject = _taggedTemplateLiteral(["ml-auto flex justify-end"]))),
|
17
14
|
children: [/*#__PURE__*/_jsx(Button, {
|
@@ -26,5 +23,4 @@ var FooterActions = function FooterActions(_ref) {
|
|
26
23
|
})]
|
27
24
|
});
|
28
25
|
};
|
29
|
-
|
30
26
|
export default FooterActions;
|
@@ -2,13 +2,9 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
3
3
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
4
4
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
5
|
-
|
6
5
|
var _templateObject;
|
7
|
-
|
8
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; }
|
9
|
-
|
10
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; }
|
11
|
-
|
12
8
|
import cx from "clsx";
|
13
9
|
import { useState } from "react";
|
14
10
|
import { usePopper } from "react-popper";
|
@@ -22,36 +18,31 @@ export var DEFAULT_DATE_PICKER_MODAL_POPPER_MODIFIERS = [{
|
|
22
18
|
offset: [0, 16]
|
23
19
|
}
|
24
20
|
}];
|
25
|
-
|
26
21
|
var Modal = function Modal(_ref) {
|
27
22
|
var show = _ref.show,
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
23
|
+
targetElement = _ref.targetElement,
|
24
|
+
_onClickAway = _ref.onClickAway,
|
25
|
+
children = _ref.children,
|
26
|
+
_ref$placement = _ref.placement,
|
27
|
+
placement = _ref$placement === void 0 ? "bottom-start" : _ref$placement,
|
28
|
+
_ref$modifiers = _ref.modifiers,
|
29
|
+
modifiers = _ref$modifiers === void 0 ? [] : _ref$modifiers,
|
30
|
+
className = _ref.className;
|
36
31
|
var createPortal = useCreatePortal();
|
37
|
-
|
38
32
|
var _useState = useState(null),
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
33
|
+
_useState2 = _slicedToArray(_useState, 2),
|
34
|
+
datePickerElement = _useState2[0],
|
35
|
+
setDatePickerElement = _useState2[1];
|
43
36
|
var _usePopper = usePopper(targetElement, datePickerElement, {
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
37
|
+
modifiers: [].concat(DEFAULT_DATE_PICKER_MODAL_POPPER_MODIFIERS, _toConsumableArray(modifiers)),
|
38
|
+
placement: placement,
|
39
|
+
strategy: "fixed"
|
40
|
+
}),
|
41
|
+
styles = _usePopper.styles,
|
42
|
+
attributes = _usePopper.attributes;
|
51
43
|
if (!show) {
|
52
44
|
return null;
|
53
45
|
}
|
54
|
-
|
55
46
|
return createPortal( /*#__PURE__*/_jsx(ClickAwayContainer, {
|
56
47
|
element: datePickerElement,
|
57
48
|
onClickAway: function onClickAway(evt) {
|
@@ -66,5 +57,4 @@ var Modal = function Modal(_ref) {
|
|
66
57
|
}))
|
67
58
|
}));
|
68
59
|
};
|
69
|
-
|
70
60
|
export default Modal;
|
@@ -1,8 +1,6 @@
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
2
2
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
3
|
-
|
4
3
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
|
5
|
-
|
6
4
|
import cx from "clsx";
|
7
5
|
import { add, eachYearOfInterval, getYear, setYear } from "date-fns";
|
8
6
|
import isSameMonth from "date-fns/isSameMonth";
|
@@ -14,25 +12,22 @@ import stl from "../../styles/helpers/satellitePrefixer";
|
|
14
12
|
import { uniqueId } from "../../utils";
|
15
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
16
14
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
17
|
-
|
18
15
|
var NavBar = function NavBar(props) {
|
19
16
|
var _useDayPicker = useDayPicker(),
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
17
|
+
numberOfMonths = _useDayPicker.numberOfMonths,
|
18
|
+
onMonthChange = _useDayPicker.onMonthChange,
|
19
|
+
formatMonthCaption = _useDayPicker.formatters.formatMonthCaption,
|
20
|
+
dir = _useDayPicker.dir,
|
21
|
+
locale = _useDayPicker.locale;
|
26
22
|
var _useNavigation = useNavigation(),
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
23
|
+
previousMonth = _useNavigation.previousMonth,
|
24
|
+
nextMonth = _useNavigation.nextMonth,
|
25
|
+
goToMonth = _useNavigation.goToMonth,
|
26
|
+
goToDate = _useNavigation.goToDate,
|
27
|
+
displayMonths = _useNavigation.displayMonths;
|
33
28
|
var _props$locale = props.locale,
|
34
|
-
|
35
|
-
|
29
|
+
nextMonthLabel = _props$locale.nextMonth,
|
30
|
+
previousMonthLabel = _props$locale.previousMonth;
|
36
31
|
var initialDate = useMemo(function () {
|
37
32
|
return props.editableYear && props.initialDate ? props.initialDate : new Date();
|
38
33
|
}, [props]);
|
@@ -41,19 +36,16 @@ var NavBar = function NavBar(props) {
|
|
41
36
|
});
|
42
37
|
var showNext = numberOfMonths === 1 || displayIndex === displayMonths.length - 1;
|
43
38
|
var showPrevious = numberOfMonths === 1 || displayIndex === 0;
|
44
|
-
|
45
39
|
var handlePreviousClick = function handlePreviousClick() {
|
46
40
|
if (!previousMonth) return;
|
47
41
|
goToMonth(previousMonth);
|
48
42
|
onMonthChange === null || onMonthChange === void 0 ? void 0 : onMonthChange(previousMonth);
|
49
43
|
};
|
50
|
-
|
51
44
|
var handleNextClick = function handleNextClick() {
|
52
45
|
if (!nextMonth) return;
|
53
46
|
goToMonth(nextMonth);
|
54
47
|
onMonthChange === null || onMonthChange === void 0 ? void 0 : onMonthChange(nextMonth);
|
55
48
|
};
|
56
|
-
|
57
49
|
var years = useMemo(function () {
|
58
50
|
if (!props.editableYear) return [];
|
59
51
|
if (props.years) return props.years;
|
@@ -66,7 +58,6 @@ var NavBar = function NavBar(props) {
|
|
66
58
|
})
|
67
59
|
}).map(getYear);
|
68
60
|
var monthYear = props.displayMonth.getFullYear(); // year of the currently shown month
|
69
|
-
|
70
61
|
if (interval.includes(monthYear)) return interval;
|
71
62
|
var minYear = Math.min.apply(Math, _toConsumableArray(interval).concat([monthYear]));
|
72
63
|
var maxYear = Math.max.apply(Math, _toConsumableArray(interval).concat([monthYear]));
|
@@ -123,5 +114,4 @@ var NavBar = function NavBar(props) {
|
|
123
114
|
})]
|
124
115
|
});
|
125
116
|
};
|
126
|
-
|
127
117
|
export default NavBar;
|
@@ -1,10 +1,7 @@
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
2
|
-
|
3
2
|
var _templateObject, _templateObject2;
|
4
|
-
|
5
3
|
import stl from "../../styles/helpers/satellitePrefixer";
|
6
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
7
|
-
|
8
5
|
var SidePanel = function SidePanel(_ref) {
|
9
6
|
var children = _ref.children;
|
10
7
|
return /*#__PURE__*/_jsx("div", {
|
@@ -15,5 +12,4 @@ var SidePanel = function SidePanel(_ref) {
|
|
15
12
|
})
|
16
13
|
});
|
17
14
|
};
|
18
|
-
|
19
15
|
export default SidePanel;
|
package/esm/Dropdown/Dropdown.js
CHANGED
@@ -2,13 +2,9 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
3
3
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
4
4
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
5
|
-
|
6
5
|
var _templateObject, _templateObject2, _templateObject3;
|
7
|
-
|
8
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; }
|
9
|
-
|
10
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; }
|
11
|
-
|
12
8
|
import cx from "clsx";
|
13
9
|
import { useState } from "react";
|
14
10
|
import { usePopper } from "react-popper";
|
@@ -33,6 +29,7 @@ export var DEFAULT_DROPDOWN_POPPER_MODIFIERS = [{
|
|
33
29
|
offset: [0, 16]
|
34
30
|
}
|
35
31
|
}];
|
32
|
+
|
36
33
|
/**
|
37
34
|
* ## Best practices
|
38
35
|
* - Sort list of options in a way that will make the most sense to the user. You can order:
|
@@ -43,43 +40,36 @@ export var DEFAULT_DROPDOWN_POPPER_MODIFIERS = [{
|
|
43
40
|
* - Clearly label options based on what each one will do
|
44
41
|
* - Make sure the most common options are listed. These can be grouped into sub-categories under headings
|
45
42
|
*/
|
46
|
-
|
47
43
|
export var Dropdown = function Dropdown(_ref) {
|
48
44
|
var _renderFooter;
|
49
|
-
|
50
45
|
var _ref$placement = _ref.placement,
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
46
|
+
placement = _ref$placement === void 0 ? "bottom-start" : _ref$placement,
|
47
|
+
menuClassName = _ref.menuClassName,
|
48
|
+
_ref$modifiers = _ref.modifiers,
|
49
|
+
modifiers = _ref$modifiers === void 0 ? [] : _ref$modifiers,
|
50
|
+
renderTarget = _ref.renderTarget,
|
51
|
+
renderFooter = _ref.renderFooter,
|
52
|
+
children = _ref.children;
|
58
53
|
var createPortal = useCreatePortal();
|
59
|
-
|
60
54
|
var _useState = useState(false),
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
55
|
+
_useState2 = _slicedToArray(_useState, 2),
|
56
|
+
showMenu = _useState2[0],
|
57
|
+
setShowMenu = _useState2[1];
|
65
58
|
var _useState3 = useState(null),
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
59
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
60
|
+
targetEl = _useState4[0],
|
61
|
+
setTargetEl = _useState4[1];
|
70
62
|
var _useState5 = useState(null),
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
63
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
64
|
+
menuContainerEl = _useState6[0],
|
65
|
+
setMenuContainerEl = _useState6[1];
|
75
66
|
var _usePopper = usePopper(targetEl, menuContainerEl, {
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
67
|
+
modifiers: [].concat(DEFAULT_DROPDOWN_POPPER_MODIFIERS, _toConsumableArray(modifiers)),
|
68
|
+
placement: placement,
|
69
|
+
strategy: "fixed"
|
70
|
+
}),
|
71
|
+
styles = _usePopper.styles,
|
72
|
+
attributes = _usePopper.attributes;
|
83
73
|
var target = renderTarget({
|
84
74
|
toggle: function toggle(open) {
|
85
75
|
return setShowMenu(open === undefined ? !showMenu : open);
|
@@ -105,7 +95,6 @@ export var Dropdown = function Dropdown(_ref) {
|
|
105
95
|
element: menuContainerEl,
|
106
96
|
onClickAway: function onClickAway(evt) {
|
107
97
|
var isContainedInTarget = targetEl === null || targetEl === void 0 ? void 0 : targetEl.contains(evt.target);
|
108
|
-
|
109
98
|
if (!isContainedInTarget) {
|
110
99
|
setShowMenu(false);
|
111
100
|
}
|
@@ -1,41 +1,33 @@
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
3
3
|
var _excluded = ["children", "title", "renderFooter"];
|
4
|
-
|
5
4
|
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; }
|
6
|
-
|
7
5
|
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; }
|
8
|
-
|
9
6
|
import { ChevronDown } from "react-feather";
|
10
7
|
import Button from "../Button";
|
11
8
|
import Dropdown from "./Dropdown";
|
12
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
13
10
|
export var DropdownButton = function DropdownButton(_ref) {
|
14
11
|
var children = _ref.children,
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
12
|
+
title = _ref.title,
|
13
|
+
renderFooter = _ref.renderFooter,
|
14
|
+
buttonProps = _objectWithoutProperties(_ref, _excluded);
|
19
15
|
var renderButton = function renderButton(_ref2) {
|
20
16
|
var toggle = _ref2.toggle;
|
21
|
-
|
22
17
|
var handleClick = function handleClick(evt) {
|
23
18
|
if (buttonProps.onClick) {
|
24
19
|
buttonProps.onClick(evt);
|
25
20
|
}
|
26
|
-
|
27
21
|
if (!evt.defaultPrevented) {
|
28
22
|
toggle();
|
29
23
|
}
|
30
24
|
};
|
31
|
-
|
32
25
|
return /*#__PURE__*/_jsx(Button, _objectSpread(_objectSpread({}, buttonProps), {}, {
|
33
26
|
onClick: handleClick,
|
34
27
|
endIcon: ChevronDown,
|
35
28
|
children: title
|
36
29
|
}));
|
37
30
|
};
|
38
|
-
|
39
31
|
return /*#__PURE__*/_jsx(Dropdown, {
|
40
32
|
renderTarget: renderButton,
|
41
33
|
renderFooter: renderFooter,
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
export interface
|
2
|
+
export interface DropdownContextInterface {
|
3
3
|
showMenu(show: boolean): void;
|
4
4
|
}
|
5
|
-
export declare const DropdownContext: import("react").Context<
|
6
|
-
export declare const useDropdownContext: () =>
|
5
|
+
export declare const DropdownContext: import("react").Context<DropdownContextInterface | null>;
|
6
|
+
export declare const useDropdownContext: () => DropdownContextInterface;
|
7
7
|
export default DropdownContext;
|
@@ -2,11 +2,9 @@ import { createContext, useContext } from "react";
|
|
2
2
|
export var DropdownContext = /*#__PURE__*/createContext(null);
|
3
3
|
export var useDropdownContext = function useDropdownContext() {
|
4
4
|
var context = useContext(DropdownContext);
|
5
|
-
|
6
5
|
if (!context) {
|
7
6
|
throw new Error("useDropdownContext used outside DropdownContext");
|
8
7
|
}
|
9
|
-
|
10
8
|
return context;
|
11
9
|
};
|
12
10
|
export default DropdownContext;
|
@@ -1,15 +1,10 @@
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
4
|
-
|
5
4
|
var _templateObject, _templateObject2, _templateObject3;
|
6
|
-
|
7
5
|
var _excluded = ["toggle", "children", "variant", "startIcon"];
|
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 useDropdownItemProps from "../useDropdownItemProps";
|
@@ -17,14 +12,13 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
12
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
18
13
|
export var DropdownButtonItem = function DropdownButtonItem(props) {
|
19
14
|
var dropdownItemProps = useDropdownItemProps(props);
|
20
|
-
|
15
|
+
// `toggle` is destructured here because we don't want it passed to the `button`
|
21
16
|
var _props$dropdownItemPr = _objectSpread(_objectSpread({}, props), dropdownItemProps),
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
17
|
+
toggle = _props$dropdownItemPr.toggle,
|
18
|
+
children = _props$dropdownItemPr.children,
|
19
|
+
variant = _props$dropdownItemPr.variant,
|
20
|
+
StartIcon = _props$dropdownItemPr.startIcon,
|
21
|
+
mergedProps = _objectWithoutProperties(_props$dropdownItemPr, _excluded);
|
28
22
|
var showDestructiveVariant = !props.disabled && variant === "destructive";
|
29
23
|
return /*#__PURE__*/_jsxs("button", _objectSpread(_objectSpread({}, mergedProps), {}, {
|
30
24
|
className: cx(mergedProps.className, stl(_templateObject || (_templateObject = _taggedTemplateLiteral(["w-full"])))),
|
@@ -1,8 +1,6 @@
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
3
|
-
|
4
3
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
5
|
-
|
6
4
|
import { useState } from "react";
|
7
5
|
import { ChevronDown, ChevronRight } from "react-feather";
|
8
6
|
import stl from "../../../styles/helpers/satellitePrefixer";
|
@@ -12,21 +10,18 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
10
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
13
11
|
export var DropdownCollapsibleItem = function DropdownCollapsibleItem(_ref) {
|
14
12
|
var title = _ref.title,
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
13
|
+
name = _ref.name,
|
14
|
+
expanded = _ref.expanded,
|
15
|
+
_onClick = _ref.onClick,
|
16
|
+
children = _ref.children;
|
20
17
|
var _useDropdownCollapsib = useDropdownCollapsibleItemsGroup(),
|
21
|
-
|
22
|
-
|
23
|
-
|
18
|
+
expandedItems = _useDropdownCollapsib.expandedItems,
|
19
|
+
onItemClick = _useDropdownCollapsib.onItemClick;
|
24
20
|
var _useState = useState(function () {
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
21
|
+
return uniqueId("ddci");
|
22
|
+
}),
|
23
|
+
_useState2 = _slicedToArray(_useState, 1),
|
24
|
+
internalName = _useState2[0];
|
30
25
|
var itemName = name !== null && name !== void 0 ? name : internalName;
|
31
26
|
var isExpanded = typeof expanded === "boolean" ? expanded : expandedItems.includes(itemName);
|
32
27
|
return /*#__PURE__*/_jsxs("div", {
|
@@ -2,8 +2,8 @@ import { DropdownCollapsibleItemsGroupContext } from "./DropdownCollapsibleItems
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
3
3
|
export var DropdownCollapsibleItemsGroup = function DropdownCollapsibleItemsGroup(_ref) {
|
4
4
|
var expandedItems = _ref.expandedItems,
|
5
|
-
|
6
|
-
|
5
|
+
onItemClick = _ref.onItemClick,
|
6
|
+
children = _ref.children;
|
7
7
|
return /*#__PURE__*/_jsx(DropdownCollapsibleItemsGroupContext.Provider, {
|
8
8
|
value: {
|
9
9
|
expandedItems: expandedItems,
|
package/esm/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsGroupContext.d.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
export interface
|
2
|
+
export interface DropdownCollapsibleItemsGroupContextInterface {
|
3
3
|
expandedItems: readonly string[];
|
4
4
|
onItemClick(name: string): void;
|
5
5
|
}
|
6
|
-
export declare const DropdownCollapsibleItemsGroupContext: import("react").Context<
|
7
|
-
export declare const useDropdownCollapsibleItemsGroup: () =>
|
6
|
+
export declare const DropdownCollapsibleItemsGroupContext: import("react").Context<DropdownCollapsibleItemsGroupContextInterface | null>;
|
7
|
+
export declare const useDropdownCollapsibleItemsGroup: () => DropdownCollapsibleItemsGroupContextInterface;
|