@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,34 +1,21 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
-
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
6
5
|
value: true
|
7
6
|
});
|
8
7
|
exports["default"] = exports.AnnouncementBadge = void 0;
|
9
|
-
|
10
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
11
|
-
|
12
9
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
13
|
-
|
14
10
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
15
|
-
|
16
11
|
var _clsx = _interopRequireDefault(require("clsx"));
|
17
|
-
|
18
12
|
var _Satellite = require("../Satellite");
|
19
|
-
|
20
13
|
var _satellitePrefixer = _interopRequireDefault(require("../styles/helpers/satellitePrefixer"));
|
21
|
-
|
22
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
23
|
-
|
24
15
|
var _excluded = ["size", "text", "variant", "className", "locale"];
|
25
|
-
|
26
16
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
27
|
-
|
28
17
|
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; }
|
29
|
-
|
30
18
|
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) { (0, _defineProperty2["default"])(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; }
|
31
|
-
|
32
19
|
var DEFAULT_LOCALE = {
|
33
20
|
beta: "beta",
|
34
21
|
internal: "internal",
|
@@ -40,27 +27,23 @@ var SIZE_CLASSNAMES = {
|
|
40
27
|
"default": (0, _satellitePrefixer["default"])(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["display-body h-6 leading-md px-2"]))),
|
41
28
|
small: (0, _satellitePrefixer["default"])(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["display-caption px-1"])))
|
42
29
|
};
|
43
|
-
|
44
30
|
var AnnouncementBadge = function AnnouncementBadge(_ref) {
|
45
31
|
var _ref$size = _ref.size,
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
32
|
+
size = _ref$size === void 0 ? "default" : _ref$size,
|
33
|
+
_ref$text = _ref.text,
|
34
|
+
text = _ref$text === void 0 ? "new" : _ref$text,
|
35
|
+
variantProp = _ref.variant,
|
36
|
+
className = _ref.className,
|
37
|
+
propsLocale = _ref.locale,
|
38
|
+
props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
53
39
|
var contextLocale = (0, _Satellite.useLocale)("announcementBadge");
|
54
|
-
|
55
40
|
var locale = _objectSpread(_objectSpread(_objectSpread({}, DEFAULT_LOCALE), contextLocale), propsLocale);
|
56
|
-
|
57
41
|
var variant = typeof variantProp === "string" ? variantProp : text === "internal" ? "red" : "accent";
|
58
42
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", _objectSpread(_objectSpread({}, props), {}, {
|
59
43
|
className: (0, _clsx["default"])(DEFAULT_CLASSNAME, variant === "red" ? (0, _satellitePrefixer["default"])(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["bg-red-600"]))) : (0, _satellitePrefixer["default"])(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["bg-accent-600"]))), SIZE_CLASSNAMES[size], className),
|
60
44
|
children: locale[text]
|
61
45
|
}));
|
62
46
|
};
|
63
|
-
|
64
47
|
exports.AnnouncementBadge = AnnouncementBadge;
|
65
48
|
var _default = AnnouncementBadge;
|
66
49
|
exports["default"] = _default;
|
@@ -1,7 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
4
|
-
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
6
5
|
value: true
|
7
6
|
});
|
@@ -12,9 +11,7 @@ Object.defineProperty(exports, "default", {
|
|
12
11
|
return _AnnouncementBadge["default"];
|
13
12
|
}
|
14
13
|
});
|
15
|
-
|
16
14
|
var _AnnouncementBadge = _interopRequireWildcard(require("./AnnouncementBadge"));
|
17
|
-
|
18
15
|
Object.keys(_AnnouncementBadge).forEach(function (key) {
|
19
16
|
if (key === "default" || key === "__esModule") return;
|
20
17
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
@@ -26,7 +23,5 @@ Object.keys(_AnnouncementBadge).forEach(function (key) {
|
|
26
23
|
}
|
27
24
|
});
|
28
25
|
});
|
29
|
-
|
30
26
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
31
|
-
|
32
27
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
@@ -1,99 +1,56 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
-
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
6
5
|
value: true
|
7
6
|
});
|
8
7
|
exports["default"] = exports.AutoComplete = void 0;
|
9
|
-
|
10
8
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
11
|
-
|
12
9
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
13
|
-
|
14
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
15
|
-
|
16
11
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
17
|
-
|
18
12
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
19
|
-
|
20
13
|
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
21
|
-
|
22
14
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
23
|
-
|
24
15
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
25
|
-
|
26
16
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
27
|
-
|
28
17
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
29
|
-
|
30
18
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
31
|
-
|
32
19
|
var _clsx = _interopRequireDefault(require("clsx"));
|
33
|
-
|
34
20
|
var _downshift = _interopRequireDefault(require("downshift"));
|
35
|
-
|
36
21
|
var _react = require("react");
|
37
|
-
|
38
22
|
var _reactDom = require("react-dom");
|
39
|
-
|
40
23
|
var _reactFeather = require("react-feather");
|
41
|
-
|
42
24
|
var _reactPopper = require("react-popper");
|
43
|
-
|
44
25
|
var _Button = _interopRequireDefault(require("../Button"));
|
45
|
-
|
46
26
|
var _Card = _interopRequireDefault(require("../Card"));
|
47
|
-
|
48
27
|
var _ClickAwayContainer = require("../ClickAwayContainer");
|
49
|
-
|
50
28
|
var _FieldStateContext = require("../Field/FieldStateContext");
|
51
|
-
|
52
29
|
var _Satellite = require("../Satellite");
|
53
|
-
|
54
30
|
var _ScrollIndicator = _interopRequireDefault(require("../ScrollIndicator"));
|
55
|
-
|
56
31
|
var _satellitePrefixer = _interopRequireDefault(require("../styles/helpers/satellitePrefixer"));
|
57
|
-
|
58
32
|
var _Tag = _interopRequireDefault(require("../Tag"));
|
59
|
-
|
60
33
|
var _uniqBy = _interopRequireDefault(require("../utils/uniqBy"));
|
61
|
-
|
62
34
|
var _AutoCompleteEmptyState = _interopRequireDefault(require("./components/AutoCompleteEmptyState"));
|
63
|
-
|
64
35
|
var _DefaultOptionItem = _interopRequireDefault(require("./components/DefaultOptionItem"));
|
65
|
-
|
66
36
|
var _utils = require("./utils");
|
67
|
-
|
68
37
|
var _jsxRuntime = require("react/jsx-runtime");
|
69
|
-
|
70
38
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17;
|
71
|
-
|
72
39
|
var _excluded = ["optionItemPrefix"],
|
73
|
-
|
74
|
-
|
40
|
+
_excluded2 = ["ref"];
|
75
41
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
76
|
-
|
77
42
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
78
|
-
|
79
43
|
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; }
|
80
|
-
|
81
44
|
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) { (0, _defineProperty2["default"])(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; }
|
82
|
-
|
83
45
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
84
|
-
|
85
46
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
86
|
-
|
87
47
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
88
|
-
|
89
48
|
function optionToString(option) {
|
90
49
|
return option ? option.label : "";
|
91
50
|
}
|
92
|
-
|
93
51
|
function makeNeedles(itemValue) {
|
94
52
|
return itemValue.toLowerCase().trim().split(/\s+/);
|
95
53
|
}
|
96
|
-
|
97
54
|
function needlesMatch(needles, option) {
|
98
55
|
var labels = (option.metadata || []).concat(option.label);
|
99
56
|
return needles.every(function (needle) {
|
@@ -102,21 +59,17 @@ function needlesMatch(needles, option) {
|
|
102
59
|
});
|
103
60
|
});
|
104
61
|
}
|
105
|
-
|
106
62
|
function filter(options, selectedItems, itemValue) {
|
107
63
|
var needles = makeNeedles(itemValue);
|
108
64
|
var selectedValues = selectedItems.map(function (option) {
|
109
65
|
return option.value;
|
110
66
|
});
|
111
67
|
var results = [];
|
112
|
-
|
113
68
|
var _iterator = _createForOfIteratorHelper(options),
|
114
|
-
|
115
|
-
|
69
|
+
_step;
|
116
70
|
try {
|
117
71
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
118
72
|
var option = _step.value;
|
119
|
-
|
120
73
|
if (selectedValues.includes(option.value)) {
|
121
74
|
continue;
|
122
75
|
} else if (option.bypassNeedleMatch || needlesMatch(needles, option)) {
|
@@ -128,18 +81,14 @@ function filter(options, selectedItems, itemValue) {
|
|
128
81
|
} finally {
|
129
82
|
_iterator.f();
|
130
83
|
}
|
131
|
-
|
132
84
|
return results;
|
133
85
|
}
|
134
|
-
|
135
86
|
function inputValueFromProps(props) {
|
136
87
|
if (props.inputValue !== undefined) {
|
137
88
|
return props.inputValue;
|
138
89
|
}
|
139
|
-
|
140
90
|
return !(0, _utils.isAutoCompleteMultiProps)(props) && props.value ? optionToString(props.value) : "";
|
141
91
|
}
|
142
|
-
|
143
92
|
var MENU_POPPER_MODFIERS = [{
|
144
93
|
name: "offset",
|
145
94
|
options: {
|
@@ -147,7 +96,6 @@ var MENU_POPPER_MODFIERS = [{
|
|
147
96
|
}
|
148
97
|
}];
|
149
98
|
var BACKSPACE_KEY_CODE = 8;
|
150
|
-
|
151
99
|
/** @ignore */
|
152
100
|
var DefaultEmptyState = function DefaultEmptyState(_ref) {
|
153
101
|
var emptyStateTitle = _ref.emptyStateTitle;
|
@@ -155,16 +103,16 @@ var DefaultEmptyState = function DefaultEmptyState(_ref) {
|
|
155
103
|
title: emptyStateTitle
|
156
104
|
});
|
157
105
|
};
|
158
|
-
|
159
106
|
var DefaultOption = function DefaultOption(_ref2) {
|
160
107
|
var optionItemPrefix = _ref2.optionItemPrefix,
|
161
|
-
|
108
|
+
props = (0, _objectWithoutProperties2["default"])(_ref2, _excluded);
|
162
109
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_DefaultOptionItem["default"], _objectSpread(_objectSpread({}, props), {}, {
|
163
110
|
locale: {
|
164
111
|
optionItemPrefix: optionItemPrefix !== null && optionItemPrefix !== void 0 ? optionItemPrefix : _utils.DEFAULT_AUTOCOMPLETE_LOCALE.optionItemPrefix
|
165
112
|
}
|
166
113
|
}));
|
167
114
|
};
|
115
|
+
|
168
116
|
/**
|
169
117
|
* Autocomplete is a search-as-you-type function that matches what a person types, usually the beginning of a word, or a prefix, with a word list. Not to be confused with auto-suggestion that predicts the end of a query.
|
170
118
|
*
|
@@ -181,22 +129,15 @@ var DefaultOption = function DefaultOption(_ref2) {
|
|
181
129
|
* - Provide matching results quickly
|
182
130
|
* - Style different data
|
183
131
|
*/
|
184
|
-
|
185
|
-
|
186
132
|
var AutoComplete = /*#__PURE__*/function (_Component) {
|
187
133
|
(0, _inherits2["default"])(AutoComplete, _Component);
|
188
|
-
|
189
134
|
var _super = _createSuper(AutoComplete);
|
190
|
-
|
191
135
|
function AutoComplete() {
|
192
136
|
var _this;
|
193
|
-
|
194
137
|
(0, _classCallCheck2["default"])(this, AutoComplete);
|
195
|
-
|
196
138
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
197
139
|
args[_key] = arguments[_key];
|
198
140
|
}
|
199
|
-
|
200
141
|
_this = _super.call.apply(_super, [this].concat(args));
|
201
142
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "state", {
|
202
143
|
inputFocused: false,
|
@@ -219,13 +160,12 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
219
160
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleInputBlur", function (state) {
|
220
161
|
return function (evt) {
|
221
162
|
var _this$props = _this.props,
|
222
|
-
|
223
|
-
|
163
|
+
selectOnBlur = _this$props.selectOnBlur,
|
164
|
+
onBlur = _this$props.onBlur;
|
224
165
|
var inputValue = state.inputValue,
|
225
|
-
|
226
|
-
|
166
|
+
highlightedIndex = state.highlightedIndex,
|
167
|
+
selectItemAtIndex = state.selectItemAtIndex;
|
227
168
|
var newInputValue;
|
228
|
-
|
229
169
|
if (selectOnBlur && inputValue && highlightedIndex !== null) {
|
230
170
|
newInputValue = (0, _utils.isAutoCompleteMultiProps)(_this.props) ? "" : optionToString(_this.props.value);
|
231
171
|
selectItemAtIndex(highlightedIndex);
|
@@ -234,11 +174,9 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
234
174
|
} else {
|
235
175
|
newInputValue = optionToString(_this.props.value);
|
236
176
|
}
|
237
|
-
|
238
177
|
if (onBlur) {
|
239
178
|
onBlur(evt);
|
240
179
|
}
|
241
|
-
|
242
180
|
_this.setState({
|
243
181
|
inputValue: newInputValue || "",
|
244
182
|
inputFocused: false,
|
@@ -248,32 +186,26 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
248
186
|
});
|
249
187
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleInputChange", function (evt) {
|
250
188
|
var inputValue = evt.target.value;
|
251
|
-
|
252
189
|
_this.setState({
|
253
190
|
inputValue: inputValue
|
254
191
|
});
|
255
|
-
|
256
192
|
if (_this.props.onTextChange) {
|
257
193
|
_this.props.onTextChange(inputValue);
|
258
194
|
}
|
259
|
-
|
260
195
|
if (!_this.props.multiple && _this.props.value && !inputValue) {
|
261
196
|
_this.props.onChange(null);
|
262
197
|
}
|
263
198
|
});
|
264
199
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleInputContainerRefUpdate", function (el) {
|
265
200
|
_this.inputContainerRef = el;
|
266
|
-
|
267
201
|
if (el) {
|
268
202
|
_this.updateInputWidth();
|
269
203
|
}
|
270
204
|
});
|
271
205
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "updateInputWidth", function () {
|
272
206
|
var _this$inputContainerR, _this$inputContainerR2;
|
273
|
-
|
274
207
|
var inputWidth = _this.state.inputWidth;
|
275
208
|
var newInputWidth = (_this$inputContainerR = (_this$inputContainerR2 = _this.inputContainerRef) === null || _this$inputContainerR2 === void 0 ? void 0 : _this$inputContainerR2.getBoundingClientRect().width) !== null && _this$inputContainerR !== void 0 ? _this$inputContainerR : inputWidth;
|
276
|
-
|
277
209
|
if (newInputWidth !== inputWidth) {
|
278
210
|
_this.setState({
|
279
211
|
inputWidth: newInputWidth
|
@@ -284,29 +216,26 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
284
216
|
return function (evt) {
|
285
217
|
if (!(0, _utils.isAutoCompleteMultiProps)(_this.props)) return;
|
286
218
|
var _this$props2 = _this.props,
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
219
|
+
_this$props2$value = _this$props2.value,
|
220
|
+
value = _this$props2$value === void 0 ? [] : _this$props2$value,
|
221
|
+
_this$props2$separato = _this$props2.separatorKeyCodes,
|
222
|
+
separatorKeyCodes = _this$props2$separato === void 0 ? AutoComplete.defaultProps.separatorKeyCodes : _this$props2$separato,
|
223
|
+
_this$props2$separato2 = _this$props2.separatorKeys,
|
224
|
+
separatorKeys = _this$props2$separato2 === void 0 ? AutoComplete.defaultProps.separatorKeys : _this$props2$separato2,
|
225
|
+
creatable = _this$props2.creatable,
|
226
|
+
_this$props2$createFr = _this$props2.createFromInputValue,
|
227
|
+
createFromInputValue = _this$props2$createFr === void 0 ? AutoComplete.defaultProps.createFromInputValue : _this$props2$createFr,
|
228
|
+
options = _this$props2.options,
|
229
|
+
onChange = _this$props2.onChange;
|
298
230
|
var inputValue = state.inputValue || "";
|
299
231
|
var canCreate = creatable && inputValue.trim().length > 0;
|
300
|
-
|
301
232
|
if (evt.keyCode === BACKSPACE_KEY_CODE && !inputValue.length) {
|
302
233
|
onChange(value.slice(0, -1));
|
303
234
|
} else if (canCreate && (separatorKeyCodes.includes(evt.keyCode) || separatorKeys.includes(evt.key))) {
|
304
235
|
evt.preventDefault();
|
305
|
-
|
306
236
|
var _createFromInputValue = createFromInputValue(options, inputValue),
|
307
|
-
|
308
|
-
|
309
|
-
|
237
|
+
_createFromInputValue2 = (0, _slicedToArray2["default"])(_createFromInputValue, 1),
|
238
|
+
newOption = _createFromInputValue2[0];
|
310
239
|
if (newOption && !newOption.disabled) {
|
311
240
|
state.selectItem(newOption);
|
312
241
|
}
|
@@ -318,22 +247,18 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
318
247
|
option = option ? _objectSpread(_objectSpread({}, option), {}, {
|
319
248
|
"new": undefined
|
320
249
|
}) : option;
|
321
|
-
|
322
250
|
if ((0, _utils.isAutoCompleteMultiProps)(_this.props)) {
|
323
251
|
var arrayValue = Array.isArray(_this.props.value) ? _this.props.value : [];
|
324
252
|
var newValue = (0, _uniqBy["default"])([].concat((0, _toConsumableArray2["default"])(arrayValue), [option]), function (o) {
|
325
253
|
return o.value;
|
326
254
|
});
|
327
|
-
|
328
255
|
_this.props.onChange(newValue);
|
329
|
-
|
330
256
|
_this.setState({
|
331
257
|
inputValue: "",
|
332
258
|
showAllResults: false
|
333
259
|
});
|
334
260
|
} else {
|
335
261
|
_this.props.onChange(option);
|
336
|
-
|
337
262
|
_this.setState({
|
338
263
|
inputValue: option ? option.label : "",
|
339
264
|
showAllResults: false
|
@@ -343,7 +268,6 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
343
268
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleShowAllResults", function (evt) {
|
344
269
|
evt.preventDefault();
|
345
270
|
evt.stopPropagation();
|
346
|
-
|
347
271
|
_this.setState({
|
348
272
|
showAllResults: true
|
349
273
|
});
|
@@ -354,43 +278,39 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
354
278
|
var newOptions = currentOptions.filter(function (option) {
|
355
279
|
return option.value !== removedOption.value;
|
356
280
|
});
|
357
|
-
|
358
281
|
_this.props.onChange(newOptions);
|
359
282
|
});
|
360
283
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getA11yStatusMessage", function (options) {
|
361
284
|
if (!options.isOpen) {
|
362
285
|
return "";
|
363
286
|
}
|
364
|
-
|
365
287
|
if (!options.resultCount) {
|
366
288
|
return _this.locale.emptyStateTitle;
|
367
289
|
}
|
368
|
-
|
369
290
|
if (options.resultCount > 0) {
|
370
291
|
return _this.locale.itemsAvailable(options.resultCount);
|
371
292
|
}
|
372
|
-
|
373
293
|
return "";
|
374
294
|
});
|
375
295
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "renderInput", function (autocompleteHelpers, fieldState) {
|
376
296
|
var _this$props3 = _this.props,
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
297
|
+
id = _this$props3.id,
|
298
|
+
placeholder = _this$props3.placeholder,
|
299
|
+
name = _this$props3.name,
|
300
|
+
valuesClassName = _this$props3.valuesClassName,
|
301
|
+
disabled = _this$props3.disabled,
|
302
|
+
autoFocus = _this$props3.autoFocus,
|
303
|
+
clearable = _this$props3.clearable,
|
304
|
+
value = _this$props3.value,
|
305
|
+
multiple = _this$props3.multiple,
|
306
|
+
_this$props3$variant = _this$props3.variant,
|
307
|
+
variant = _this$props3$variant === void 0 ? "medium" : _this$props3$variant,
|
308
|
+
renderValueTemplate = _this$props3.renderValueTemplate,
|
309
|
+
Icon = _this$props3.icon,
|
310
|
+
_this$props3$noWrap = _this$props3.noWrap,
|
311
|
+
noWrap = _this$props3$noWrap === void 0 ? false : _this$props3$noWrap,
|
312
|
+
endItem = _this$props3.endItem,
|
313
|
+
_onFocus = _this$props3.onFocus;
|
394
314
|
var inputFocused = _this.state.inputFocused;
|
395
315
|
var getInputProps = autocompleteHelpers.getInputProps;
|
396
316
|
var hasValue = Boolean(value && (!Array.isArray(value) || value.length > 0));
|
@@ -412,19 +332,16 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
412
332
|
onChange: _this.handleInputChange,
|
413
333
|
onFocus: function onFocus(evt) {
|
414
334
|
_onFocus === null || _onFocus === void 0 ? void 0 : _onFocus(evt);
|
415
|
-
|
416
335
|
if (evt.defaultPrevented) {
|
417
336
|
return;
|
418
337
|
}
|
419
|
-
|
420
338
|
_this.setState({
|
421
339
|
inputFocused: true
|
422
|
-
});
|
423
|
-
|
340
|
+
});
|
424
341
|
|
342
|
+
// Doesn't work without the setTimeout :/
|
425
343
|
setTimeout(function () {
|
426
344
|
_this.updateInputWidth();
|
427
|
-
|
428
345
|
autocompleteHelpers.openMenu();
|
429
346
|
});
|
430
347
|
},
|
@@ -480,30 +397,29 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
480
397
|
});
|
481
398
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "renderMenu", function (results, autocompleteHelpers) {
|
482
399
|
var _this$inputContainerR3;
|
483
|
-
|
484
400
|
var getItemProps = autocompleteHelpers.getItemProps,
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
401
|
+
getMenuProps = autocompleteHelpers.getMenuProps,
|
402
|
+
highlightedIndex = autocompleteHelpers.highlightedIndex,
|
403
|
+
inputValue = autocompleteHelpers.inputValue,
|
404
|
+
isOpen = autocompleteHelpers.isOpen;
|
489
405
|
var defaultEmptyState = /*#__PURE__*/(0, _jsxRuntime.jsx)(DefaultEmptyState, {
|
490
406
|
emptyStateTitle: _this.locale.emptyStateTitle
|
491
407
|
});
|
492
408
|
var _this$props4 = _this.props,
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
409
|
+
menuClassName = _this$props4.menuClassName,
|
410
|
+
menuSize = _this$props4.menuSize,
|
411
|
+
menuFooter = _this$props4.menuFooter,
|
412
|
+
_this$props4$emptySta = _this$props4.emptyState,
|
413
|
+
emptyState = _this$props4$emptySta === void 0 ? defaultEmptyState : _this$props4$emptySta,
|
414
|
+
_this$props4$maxResul = _this$props4.maxResults,
|
415
|
+
maxResults = _this$props4$maxResul === void 0 ? AutoComplete.defaultProps.maxResults : _this$props4$maxResul,
|
416
|
+
_this$props4$multiple = _this$props4.multiple,
|
417
|
+
multiple = _this$props4$multiple === void 0 ? AutoComplete.defaultProps.multiple : _this$props4$multiple,
|
418
|
+
_this$props4$optionIt = _this$props4.optionItemComponent,
|
419
|
+
OptionItem = _this$props4$optionIt === void 0 ? AutoComplete.defaultProps.optionItemComponent : _this$props4$optionIt;
|
504
420
|
var _this$state = _this.state,
|
505
|
-
|
506
|
-
|
421
|
+
inputWidth = _this$state.inputWidth,
|
422
|
+
showAllResults = _this$state.showAllResults;
|
507
423
|
var dropdownStyle = inputWidth ? {
|
508
424
|
minWidth: inputWidth,
|
509
425
|
maxWidth: "42vw"
|
@@ -516,13 +432,11 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
516
432
|
var shouldShowDefaultEmptyState = emptyState === defaultEmptyState && results.length === 0 && !!(inputValue !== null && inputValue !== void 0 && inputValue.length);
|
517
433
|
var shouldShowEmptyState = emptyState !== defaultEmptyState && !!emptyState && results.length === 0;
|
518
434
|
var showResults = results.length > 0;
|
519
|
-
|
520
435
|
if (!isOpen || !showResults && !shouldShowEmptyState && !shouldShowDefaultEmptyState) {
|
521
436
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("ul", _objectSpread(_objectSpread({}, getMenuProps()), {}, {
|
522
437
|
className: (0, _satellitePrefixer["default"])(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["hidden h-0"])))
|
523
438
|
}));
|
524
439
|
}
|
525
|
-
|
526
440
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactPopper.Popper, {
|
527
441
|
placement: "bottom-start",
|
528
442
|
strategy: "fixed",
|
@@ -533,11 +447,10 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
533
447
|
},
|
534
448
|
children: function children(popper) {
|
535
449
|
var _getMenuProps = getMenuProps({
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
450
|
+
ref: popper.ref
|
451
|
+
}),
|
452
|
+
menuRef = _getMenuProps.ref,
|
453
|
+
menuProps = (0, _objectWithoutProperties2["default"])(_getMenuProps, _excluded2);
|
541
454
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ClickAwayContainer.ClickAwayContainer, {
|
542
455
|
element: _this.menuWrapperRef,
|
543
456
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
@@ -596,22 +509,19 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
596
509
|
});
|
597
510
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "renderSelect", function (autocompleteHelpers, fieldState) {
|
598
511
|
var _this$context$portalT;
|
599
|
-
|
600
512
|
var _this$props5 = _this.props,
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
513
|
+
className = _this$props5.className,
|
514
|
+
options = _this$props5.options,
|
515
|
+
value = _this$props5.value,
|
516
|
+
creatable = _this$props5.creatable,
|
517
|
+
_this$props5$createFr = _this$props5.createFromInputValue,
|
518
|
+
createFromInputValue = _this$props5$createFr === void 0 ? AutoComplete.defaultProps.createFromInputValue : _this$props5$createFr;
|
607
519
|
var inputValue = autocompleteHelpers.inputValue || "";
|
608
520
|
var results = options ? filter(options, Array.isArray(value) ? value : [], inputValue) : [];
|
609
521
|
var emptyInputValue = !inputValue || inputValue.trim().length === 0;
|
610
|
-
|
611
522
|
if (creatable && !emptyInputValue) {
|
612
523
|
results.unshift.apply(results, (0, _toConsumableArray2["default"])(createFromInputValue(options, inputValue)));
|
613
524
|
}
|
614
|
-
|
615
525
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
616
526
|
className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject17 || (_templateObject17 = (0, _taggedTemplateLiteral2["default"])(["flex"]))), className),
|
617
527
|
children: [_this.renderInput(autocompleteHelpers, fieldState), _this.inputContainerRef && /*#__PURE__*/(0, _reactDom.createPortal)(_this.renderMenu(results, autocompleteHelpers), (_this$context$portalT = _this.context["portalTarget"]) !== null && _this$context$portalT !== void 0 ? _this$context$portalT : document.body)]
|
@@ -619,7 +529,6 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
619
529
|
});
|
620
530
|
return _this;
|
621
531
|
}
|
622
|
-
|
623
532
|
(0, _createClass2["default"])(AutoComplete, [{
|
624
533
|
key: "componentDidUpdate",
|
625
534
|
value: function componentDidUpdate(prevProps) {
|
@@ -629,7 +538,6 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
629
538
|
var prevPropsInputValue = inputValueFromProps(prevProps);
|
630
539
|
var propsInputValue = inputValueFromProps(this.props);
|
631
540
|
var shouldUpdateInputValueFromProps = prevPropsInputValue !== propsInputValue && this.state.inputValue !== propsInputValue;
|
632
|
-
|
633
541
|
if (shouldUpdateInputValueFromProps) {
|
634
542
|
this.setState({
|
635
543
|
inputValue: propsInputValue
|
@@ -645,7 +553,6 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
645
553
|
key: "render",
|
646
554
|
value: function render() {
|
647
555
|
var _this2 = this;
|
648
|
-
|
649
556
|
var inputValue = (this.props.inputValue !== undefined ? this.props.inputValue : this.state.inputValue) || "";
|
650
557
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_FieldStateContext.FieldStateContext.Consumer, {
|
651
558
|
children: function children(fieldState) {
|
@@ -656,8 +563,7 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
656
563
|
* See multi-select example
|
657
564
|
* https://github.com/downshift-js/downshift#examples
|
658
565
|
* https://codesandbox.io/s/github/kentcdodds/downshift-examples/tree/master/?module=/src/ordered-examples/04-multi-select.js&moduleview=1&file=/src/ordered-examples/04-multi-select.js:2482-2509
|
659
|
-
|
660
|
-
,
|
566
|
+
*/,
|
661
567
|
selectedItem: null,
|
662
568
|
getA11yStatusMessage: _this2.getA11yStatusMessage,
|
663
569
|
onChange: _this2.handleChange,
|
@@ -673,7 +579,6 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
673
579
|
}]);
|
674
580
|
return AutoComplete;
|
675
581
|
}(_react.Component);
|
676
|
-
|
677
582
|
exports.AutoComplete = AutoComplete;
|
678
583
|
(0, _defineProperty2["default"])(AutoComplete, "contextType", _Satellite.SatelliteContext);
|
679
584
|
(0, _defineProperty2["default"])(AutoComplete, "defaultProps", {
|