@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
@@ -9,26 +9,16 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
|
|
9
9
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
10
10
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
11
11
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
12
|
-
|
13
12
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17;
|
14
|
-
|
15
13
|
var _excluded = ["optionItemPrefix"],
|
16
|
-
|
17
|
-
|
14
|
+
_excluded2 = ["ref"];
|
18
15
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
19
|
-
|
20
16
|
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; } }
|
21
|
-
|
22
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; }
|
23
|
-
|
24
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) { _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; }
|
25
|
-
|
26
19
|
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; } } }; }
|
27
|
-
|
28
20
|
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); }
|
29
|
-
|
30
21
|
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; }
|
31
|
-
|
32
22
|
import cx from "clsx";
|
33
23
|
import Downshift from "downshift";
|
34
24
|
import { Component } from "react";
|
@@ -49,15 +39,12 @@ import DefaultOptionItem from "./components/DefaultOptionItem";
|
|
49
39
|
import { DEFAULT_AUTOCOMPLETE_LOCALE, defaultCreateFromInputValue, isAutoCompleteMultiProps } from "./utils";
|
50
40
|
import { jsx as _jsx } from "react/jsx-runtime";
|
51
41
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
52
|
-
|
53
42
|
function optionToString(option) {
|
54
43
|
return option ? option.label : "";
|
55
44
|
}
|
56
|
-
|
57
45
|
function makeNeedles(itemValue) {
|
58
46
|
return itemValue.toLowerCase().trim().split(/\s+/);
|
59
47
|
}
|
60
|
-
|
61
48
|
function needlesMatch(needles, option) {
|
62
49
|
var labels = (option.metadata || []).concat(option.label);
|
63
50
|
return needles.every(function (needle) {
|
@@ -66,21 +53,17 @@ function needlesMatch(needles, option) {
|
|
66
53
|
});
|
67
54
|
});
|
68
55
|
}
|
69
|
-
|
70
56
|
function filter(options, selectedItems, itemValue) {
|
71
57
|
var needles = makeNeedles(itemValue);
|
72
58
|
var selectedValues = selectedItems.map(function (option) {
|
73
59
|
return option.value;
|
74
60
|
});
|
75
61
|
var results = [];
|
76
|
-
|
77
62
|
var _iterator = _createForOfIteratorHelper(options),
|
78
|
-
|
79
|
-
|
63
|
+
_step;
|
80
64
|
try {
|
81
65
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
82
66
|
var option = _step.value;
|
83
|
-
|
84
67
|
if (selectedValues.includes(option.value)) {
|
85
68
|
continue;
|
86
69
|
} else if (option.bypassNeedleMatch || needlesMatch(needles, option)) {
|
@@ -92,18 +75,14 @@ function filter(options, selectedItems, itemValue) {
|
|
92
75
|
} finally {
|
93
76
|
_iterator.f();
|
94
77
|
}
|
95
|
-
|
96
78
|
return results;
|
97
79
|
}
|
98
|
-
|
99
80
|
function inputValueFromProps(props) {
|
100
81
|
if (props.inputValue !== undefined) {
|
101
82
|
return props.inputValue;
|
102
83
|
}
|
103
|
-
|
104
84
|
return !isAutoCompleteMultiProps(props) && props.value ? optionToString(props.value) : "";
|
105
85
|
}
|
106
|
-
|
107
86
|
var MENU_POPPER_MODFIERS = [{
|
108
87
|
name: "offset",
|
109
88
|
options: {
|
@@ -111,7 +90,6 @@ var MENU_POPPER_MODFIERS = [{
|
|
111
90
|
}
|
112
91
|
}];
|
113
92
|
var BACKSPACE_KEY_CODE = 8;
|
114
|
-
|
115
93
|
/** @ignore */
|
116
94
|
var DefaultEmptyState = function DefaultEmptyState(_ref) {
|
117
95
|
var emptyStateTitle = _ref.emptyStateTitle;
|
@@ -119,17 +97,16 @@ var DefaultEmptyState = function DefaultEmptyState(_ref) {
|
|
119
97
|
title: emptyStateTitle
|
120
98
|
});
|
121
99
|
};
|
122
|
-
|
123
100
|
var DefaultOption = function DefaultOption(_ref2) {
|
124
101
|
var optionItemPrefix = _ref2.optionItemPrefix,
|
125
|
-
|
126
|
-
|
102
|
+
props = _objectWithoutProperties(_ref2, _excluded);
|
127
103
|
return /*#__PURE__*/_jsx(DefaultOptionItem, _objectSpread(_objectSpread({}, props), {}, {
|
128
104
|
locale: {
|
129
105
|
optionItemPrefix: optionItemPrefix !== null && optionItemPrefix !== void 0 ? optionItemPrefix : DEFAULT_AUTOCOMPLETE_LOCALE.optionItemPrefix
|
130
106
|
}
|
131
107
|
}));
|
132
108
|
};
|
109
|
+
|
133
110
|
/**
|
134
111
|
* 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.
|
135
112
|
*
|
@@ -146,36 +123,24 @@ var DefaultOption = function DefaultOption(_ref2) {
|
|
146
123
|
* - Provide matching results quickly
|
147
124
|
* - Style different data
|
148
125
|
*/
|
149
|
-
|
150
|
-
|
151
126
|
export var AutoComplete = /*#__PURE__*/function (_Component) {
|
152
127
|
_inherits(AutoComplete, _Component);
|
153
|
-
|
154
128
|
var _super = _createSuper(AutoComplete);
|
155
|
-
|
156
129
|
function AutoComplete() {
|
157
130
|
var _this;
|
158
|
-
|
159
131
|
_classCallCheck(this, AutoComplete);
|
160
|
-
|
161
132
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
162
133
|
args[_key] = arguments[_key];
|
163
134
|
}
|
164
|
-
|
165
135
|
_this = _super.call.apply(_super, [this].concat(args));
|
166
|
-
|
167
136
|
_defineProperty(_assertThisInitialized(_this), "state", {
|
168
137
|
inputFocused: false,
|
169
138
|
inputValue: inputValueFromProps(_this.props),
|
170
139
|
showAllResults: false
|
171
140
|
});
|
172
|
-
|
173
141
|
_defineProperty(_assertThisInitialized(_this), "inputContainerRef", null);
|
174
|
-
|
175
142
|
_defineProperty(_assertThisInitialized(_this), "inputRef", null);
|
176
|
-
|
177
143
|
_defineProperty(_assertThisInitialized(_this), "menuWrapperRef", null);
|
178
|
-
|
179
144
|
_defineProperty(_assertThisInitialized(_this), "handleClearClick", function () {
|
180
145
|
return _this.setState({
|
181
146
|
inputValue: ""
|
@@ -183,21 +148,18 @@ export var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
183
148
|
return _this.props.onChange(null);
|
184
149
|
});
|
185
150
|
});
|
186
|
-
|
187
151
|
_defineProperty(_assertThisInitialized(_this), "handleFakeInputClick", function () {
|
188
152
|
return _this.inputRef && _this.inputRef.focus();
|
189
153
|
});
|
190
|
-
|
191
154
|
_defineProperty(_assertThisInitialized(_this), "handleInputBlur", function (state) {
|
192
155
|
return function (evt) {
|
193
156
|
var _this$props = _this.props,
|
194
|
-
|
195
|
-
|
157
|
+
selectOnBlur = _this$props.selectOnBlur,
|
158
|
+
onBlur = _this$props.onBlur;
|
196
159
|
var inputValue = state.inputValue,
|
197
|
-
|
198
|
-
|
160
|
+
highlightedIndex = state.highlightedIndex,
|
161
|
+
selectItemAtIndex = state.selectItemAtIndex;
|
199
162
|
var newInputValue;
|
200
|
-
|
201
163
|
if (selectOnBlur && inputValue && highlightedIndex !== null) {
|
202
164
|
newInputValue = isAutoCompleteMultiProps(_this.props) ? "" : optionToString(_this.props.value);
|
203
165
|
selectItemAtIndex(highlightedIndex);
|
@@ -206,11 +168,9 @@ export var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
206
168
|
} else {
|
207
169
|
newInputValue = optionToString(_this.props.value);
|
208
170
|
}
|
209
|
-
|
210
171
|
if (onBlur) {
|
211
172
|
onBlur(evt);
|
212
173
|
}
|
213
|
-
|
214
174
|
_this.setState({
|
215
175
|
inputValue: newInputValue || "",
|
216
176
|
inputFocused: false,
|
@@ -218,160 +178,133 @@ export var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
218
178
|
});
|
219
179
|
};
|
220
180
|
});
|
221
|
-
|
222
181
|
_defineProperty(_assertThisInitialized(_this), "handleInputChange", function (evt) {
|
223
182
|
var inputValue = evt.target.value;
|
224
|
-
|
225
183
|
_this.setState({
|
226
184
|
inputValue: inputValue
|
227
185
|
});
|
228
|
-
|
229
186
|
if (_this.props.onTextChange) {
|
230
187
|
_this.props.onTextChange(inputValue);
|
231
188
|
}
|
232
|
-
|
233
189
|
if (!_this.props.multiple && _this.props.value && !inputValue) {
|
234
190
|
_this.props.onChange(null);
|
235
191
|
}
|
236
192
|
});
|
237
|
-
|
238
193
|
_defineProperty(_assertThisInitialized(_this), "handleInputContainerRefUpdate", function (el) {
|
239
194
|
_this.inputContainerRef = el;
|
240
|
-
|
241
195
|
if (el) {
|
242
196
|
_this.updateInputWidth();
|
243
197
|
}
|
244
198
|
});
|
245
|
-
|
246
199
|
_defineProperty(_assertThisInitialized(_this), "updateInputWidth", function () {
|
247
200
|
var _this$inputContainerR, _this$inputContainerR2;
|
248
|
-
|
249
201
|
var inputWidth = _this.state.inputWidth;
|
250
202
|
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;
|
251
|
-
|
252
203
|
if (newInputWidth !== inputWidth) {
|
253
204
|
_this.setState({
|
254
205
|
inputWidth: newInputWidth
|
255
206
|
});
|
256
207
|
}
|
257
208
|
});
|
258
|
-
|
259
209
|
_defineProperty(_assertThisInitialized(_this), "handleKeyDown", function (state) {
|
260
210
|
return function (evt) {
|
261
211
|
if (!isAutoCompleteMultiProps(_this.props)) return;
|
262
212
|
var _this$props2 = _this.props,
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
213
|
+
_this$props2$value = _this$props2.value,
|
214
|
+
value = _this$props2$value === void 0 ? [] : _this$props2$value,
|
215
|
+
_this$props2$separato = _this$props2.separatorKeyCodes,
|
216
|
+
separatorKeyCodes = _this$props2$separato === void 0 ? AutoComplete.defaultProps.separatorKeyCodes : _this$props2$separato,
|
217
|
+
_this$props2$separato2 = _this$props2.separatorKeys,
|
218
|
+
separatorKeys = _this$props2$separato2 === void 0 ? AutoComplete.defaultProps.separatorKeys : _this$props2$separato2,
|
219
|
+
creatable = _this$props2.creatable,
|
220
|
+
_this$props2$createFr = _this$props2.createFromInputValue,
|
221
|
+
createFromInputValue = _this$props2$createFr === void 0 ? AutoComplete.defaultProps.createFromInputValue : _this$props2$createFr,
|
222
|
+
options = _this$props2.options,
|
223
|
+
onChange = _this$props2.onChange;
|
274
224
|
var inputValue = state.inputValue || "";
|
275
225
|
var canCreate = creatable && inputValue.trim().length > 0;
|
276
|
-
|
277
226
|
if (evt.keyCode === BACKSPACE_KEY_CODE && !inputValue.length) {
|
278
227
|
onChange(value.slice(0, -1));
|
279
228
|
} else if (canCreate && (separatorKeyCodes.includes(evt.keyCode) || separatorKeys.includes(evt.key))) {
|
280
229
|
evt.preventDefault();
|
281
|
-
|
282
230
|
var _createFromInputValue = createFromInputValue(options, inputValue),
|
283
|
-
|
284
|
-
|
285
|
-
|
231
|
+
_createFromInputValue2 = _slicedToArray(_createFromInputValue, 1),
|
232
|
+
newOption = _createFromInputValue2[0];
|
286
233
|
if (newOption && !newOption.disabled) {
|
287
234
|
state.selectItem(newOption);
|
288
235
|
}
|
289
236
|
}
|
290
237
|
};
|
291
238
|
});
|
292
|
-
|
293
239
|
_defineProperty(_assertThisInitialized(_this), "handleChange", function (option) {
|
294
240
|
if (option.disabled) return;
|
295
241
|
option = option ? _objectSpread(_objectSpread({}, option), {}, {
|
296
242
|
"new": undefined
|
297
243
|
}) : option;
|
298
|
-
|
299
244
|
if (isAutoCompleteMultiProps(_this.props)) {
|
300
245
|
var arrayValue = Array.isArray(_this.props.value) ? _this.props.value : [];
|
301
246
|
var newValue = uniqBy([].concat(_toConsumableArray(arrayValue), [option]), function (o) {
|
302
247
|
return o.value;
|
303
248
|
});
|
304
|
-
|
305
249
|
_this.props.onChange(newValue);
|
306
|
-
|
307
250
|
_this.setState({
|
308
251
|
inputValue: "",
|
309
252
|
showAllResults: false
|
310
253
|
});
|
311
254
|
} else {
|
312
255
|
_this.props.onChange(option);
|
313
|
-
|
314
256
|
_this.setState({
|
315
257
|
inputValue: option ? option.label : "",
|
316
258
|
showAllResults: false
|
317
259
|
});
|
318
260
|
}
|
319
261
|
});
|
320
|
-
|
321
262
|
_defineProperty(_assertThisInitialized(_this), "handleShowAllResults", function (evt) {
|
322
263
|
evt.preventDefault();
|
323
264
|
evt.stopPropagation();
|
324
|
-
|
325
265
|
_this.setState({
|
326
266
|
showAllResults: true
|
327
267
|
});
|
328
268
|
});
|
329
|
-
|
330
269
|
_defineProperty(_assertThisInitialized(_this), "removeValue", function (removedOption) {
|
331
270
|
if (!isAutoCompleteMultiProps(_this.props)) return;
|
332
271
|
var currentOptions = _this.props.value || [];
|
333
272
|
var newOptions = currentOptions.filter(function (option) {
|
334
273
|
return option.value !== removedOption.value;
|
335
274
|
});
|
336
|
-
|
337
275
|
_this.props.onChange(newOptions);
|
338
276
|
});
|
339
|
-
|
340
277
|
_defineProperty(_assertThisInitialized(_this), "getA11yStatusMessage", function (options) {
|
341
278
|
if (!options.isOpen) {
|
342
279
|
return "";
|
343
280
|
}
|
344
|
-
|
345
281
|
if (!options.resultCount) {
|
346
282
|
return _this.locale.emptyStateTitle;
|
347
283
|
}
|
348
|
-
|
349
284
|
if (options.resultCount > 0) {
|
350
285
|
return _this.locale.itemsAvailable(options.resultCount);
|
351
286
|
}
|
352
|
-
|
353
287
|
return "";
|
354
288
|
});
|
355
|
-
|
356
289
|
_defineProperty(_assertThisInitialized(_this), "renderInput", function (autocompleteHelpers, fieldState) {
|
357
290
|
var _this$props3 = _this.props,
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
291
|
+
id = _this$props3.id,
|
292
|
+
placeholder = _this$props3.placeholder,
|
293
|
+
name = _this$props3.name,
|
294
|
+
valuesClassName = _this$props3.valuesClassName,
|
295
|
+
disabled = _this$props3.disabled,
|
296
|
+
autoFocus = _this$props3.autoFocus,
|
297
|
+
clearable = _this$props3.clearable,
|
298
|
+
value = _this$props3.value,
|
299
|
+
multiple = _this$props3.multiple,
|
300
|
+
_this$props3$variant = _this$props3.variant,
|
301
|
+
variant = _this$props3$variant === void 0 ? "medium" : _this$props3$variant,
|
302
|
+
renderValueTemplate = _this$props3.renderValueTemplate,
|
303
|
+
Icon = _this$props3.icon,
|
304
|
+
_this$props3$noWrap = _this$props3.noWrap,
|
305
|
+
noWrap = _this$props3$noWrap === void 0 ? false : _this$props3$noWrap,
|
306
|
+
endItem = _this$props3.endItem,
|
307
|
+
_onFocus = _this$props3.onFocus;
|
375
308
|
var inputFocused = _this.state.inputFocused;
|
376
309
|
var getInputProps = autocompleteHelpers.getInputProps;
|
377
310
|
var hasValue = Boolean(value && (!Array.isArray(value) || value.length > 0));
|
@@ -393,19 +326,16 @@ export var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
393
326
|
onChange: _this.handleInputChange,
|
394
327
|
onFocus: function onFocus(evt) {
|
395
328
|
_onFocus === null || _onFocus === void 0 ? void 0 : _onFocus(evt);
|
396
|
-
|
397
329
|
if (evt.defaultPrevented) {
|
398
330
|
return;
|
399
331
|
}
|
400
|
-
|
401
332
|
_this.setState({
|
402
333
|
inputFocused: true
|
403
|
-
});
|
404
|
-
|
334
|
+
});
|
405
335
|
|
336
|
+
// Doesn't work without the setTimeout :/
|
406
337
|
setTimeout(function () {
|
407
338
|
_this.updateInputWidth();
|
408
|
-
|
409
339
|
autocompleteHelpers.openMenu();
|
410
340
|
});
|
411
341
|
},
|
@@ -459,35 +389,31 @@ export var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
459
389
|
})]
|
460
390
|
});
|
461
391
|
});
|
462
|
-
|
463
392
|
_defineProperty(_assertThisInitialized(_this), "renderMenu", function (results, autocompleteHelpers) {
|
464
393
|
var _this$inputContainerR3;
|
465
|
-
|
466
394
|
var getItemProps = autocompleteHelpers.getItemProps,
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
395
|
+
getMenuProps = autocompleteHelpers.getMenuProps,
|
396
|
+
highlightedIndex = autocompleteHelpers.highlightedIndex,
|
397
|
+
inputValue = autocompleteHelpers.inputValue,
|
398
|
+
isOpen = autocompleteHelpers.isOpen;
|
472
399
|
var defaultEmptyState = /*#__PURE__*/_jsx(DefaultEmptyState, {
|
473
400
|
emptyStateTitle: _this.locale.emptyStateTitle
|
474
401
|
});
|
475
|
-
|
476
402
|
var _this$props4 = _this.props,
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
403
|
+
menuClassName = _this$props4.menuClassName,
|
404
|
+
menuSize = _this$props4.menuSize,
|
405
|
+
menuFooter = _this$props4.menuFooter,
|
406
|
+
_this$props4$emptySta = _this$props4.emptyState,
|
407
|
+
emptyState = _this$props4$emptySta === void 0 ? defaultEmptyState : _this$props4$emptySta,
|
408
|
+
_this$props4$maxResul = _this$props4.maxResults,
|
409
|
+
maxResults = _this$props4$maxResul === void 0 ? AutoComplete.defaultProps.maxResults : _this$props4$maxResul,
|
410
|
+
_this$props4$multiple = _this$props4.multiple,
|
411
|
+
multiple = _this$props4$multiple === void 0 ? AutoComplete.defaultProps.multiple : _this$props4$multiple,
|
412
|
+
_this$props4$optionIt = _this$props4.optionItemComponent,
|
413
|
+
OptionItem = _this$props4$optionIt === void 0 ? AutoComplete.defaultProps.optionItemComponent : _this$props4$optionIt;
|
488
414
|
var _this$state = _this.state,
|
489
|
-
|
490
|
-
|
415
|
+
inputWidth = _this$state.inputWidth,
|
416
|
+
showAllResults = _this$state.showAllResults;
|
491
417
|
var dropdownStyle = inputWidth ? {
|
492
418
|
minWidth: inputWidth,
|
493
419
|
maxWidth: "42vw"
|
@@ -500,13 +426,11 @@ export var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
500
426
|
var shouldShowDefaultEmptyState = emptyState === defaultEmptyState && results.length === 0 && !!(inputValue !== null && inputValue !== void 0 && inputValue.length);
|
501
427
|
var shouldShowEmptyState = emptyState !== defaultEmptyState && !!emptyState && results.length === 0;
|
502
428
|
var showResults = results.length > 0;
|
503
|
-
|
504
429
|
if (!isOpen || !showResults && !shouldShowEmptyState && !shouldShowDefaultEmptyState) {
|
505
430
|
return /*#__PURE__*/_jsx("ul", _objectSpread(_objectSpread({}, getMenuProps()), {}, {
|
506
431
|
className: stl(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["hidden h-0"])))
|
507
432
|
}));
|
508
433
|
}
|
509
|
-
|
510
434
|
return /*#__PURE__*/_jsx(Popper, {
|
511
435
|
placement: "bottom-start",
|
512
436
|
strategy: "fixed",
|
@@ -517,11 +441,10 @@ export var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
517
441
|
},
|
518
442
|
children: function children(popper) {
|
519
443
|
var _getMenuProps = getMenuProps({
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
444
|
+
ref: popper.ref
|
445
|
+
}),
|
446
|
+
menuRef = _getMenuProps.ref,
|
447
|
+
menuProps = _objectWithoutProperties(_getMenuProps, _excluded2);
|
525
448
|
return /*#__PURE__*/_jsx(ClickAwayContainer, {
|
526
449
|
element: _this.menuWrapperRef,
|
527
450
|
children: /*#__PURE__*/_jsx("div", {
|
@@ -578,34 +501,28 @@ export var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
578
501
|
}
|
579
502
|
});
|
580
503
|
});
|
581
|
-
|
582
504
|
_defineProperty(_assertThisInitialized(_this), "renderSelect", function (autocompleteHelpers, fieldState) {
|
583
505
|
var _this$context$portalT;
|
584
|
-
|
585
506
|
var _this$props5 = _this.props,
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
507
|
+
className = _this$props5.className,
|
508
|
+
options = _this$props5.options,
|
509
|
+
value = _this$props5.value,
|
510
|
+
creatable = _this$props5.creatable,
|
511
|
+
_this$props5$createFr = _this$props5.createFromInputValue,
|
512
|
+
createFromInputValue = _this$props5$createFr === void 0 ? AutoComplete.defaultProps.createFromInputValue : _this$props5$createFr;
|
592
513
|
var inputValue = autocompleteHelpers.inputValue || "";
|
593
514
|
var results = options ? filter(options, Array.isArray(value) ? value : [], inputValue) : [];
|
594
515
|
var emptyInputValue = !inputValue || inputValue.trim().length === 0;
|
595
|
-
|
596
516
|
if (creatable && !emptyInputValue) {
|
597
517
|
results.unshift.apply(results, _toConsumableArray(createFromInputValue(options, inputValue)));
|
598
518
|
}
|
599
|
-
|
600
519
|
return /*#__PURE__*/_jsxs("div", {
|
601
520
|
className: cx(stl(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["flex"]))), className),
|
602
521
|
children: [_this.renderInput(autocompleteHelpers, fieldState), _this.inputContainerRef && /*#__PURE__*/createPortal(_this.renderMenu(results, autocompleteHelpers), (_this$context$portalT = _this.context["portalTarget"]) !== null && _this$context$portalT !== void 0 ? _this$context$portalT : document.body)]
|
603
522
|
});
|
604
523
|
});
|
605
|
-
|
606
524
|
return _this;
|
607
525
|
}
|
608
|
-
|
609
526
|
_createClass(AutoComplete, [{
|
610
527
|
key: "componentDidUpdate",
|
611
528
|
value: function componentDidUpdate(prevProps) {
|
@@ -615,7 +532,6 @@ export var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
615
532
|
var prevPropsInputValue = inputValueFromProps(prevProps);
|
616
533
|
var propsInputValue = inputValueFromProps(this.props);
|
617
534
|
var shouldUpdateInputValueFromProps = prevPropsInputValue !== propsInputValue && this.state.inputValue !== propsInputValue;
|
618
|
-
|
619
535
|
if (shouldUpdateInputValueFromProps) {
|
620
536
|
this.setState({
|
621
537
|
inputValue: propsInputValue
|
@@ -631,7 +547,6 @@ export var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
631
547
|
key: "render",
|
632
548
|
value: function render() {
|
633
549
|
var _this2 = this;
|
634
|
-
|
635
550
|
var inputValue = (this.props.inputValue !== undefined ? this.props.inputValue : this.state.inputValue) || "";
|
636
551
|
return /*#__PURE__*/_jsx(FieldStateContext.Consumer, {
|
637
552
|
children: function children(fieldState) {
|
@@ -642,8 +557,7 @@ export var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
642
557
|
* See multi-select example
|
643
558
|
* https://github.com/downshift-js/downshift#examples
|
644
559
|
* 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
|
645
|
-
|
646
|
-
,
|
560
|
+
*/,
|
647
561
|
selectedItem: null,
|
648
562
|
getA11yStatusMessage: _this2.getA11yStatusMessage,
|
649
563
|
onChange: _this2.handleChange,
|
@@ -657,12 +571,9 @@ export var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
657
571
|
});
|
658
572
|
}
|
659
573
|
}]);
|
660
|
-
|
661
574
|
return AutoComplete;
|
662
575
|
}(Component);
|
663
|
-
|
664
576
|
_defineProperty(AutoComplete, "contextType", SatelliteContext);
|
665
|
-
|
666
577
|
_defineProperty(AutoComplete, "defaultProps", {
|
667
578
|
clearable: false,
|
668
579
|
creatable: false,
|
@@ -675,5 +586,4 @@ _defineProperty(AutoComplete, "defaultProps", {
|
|
675
586
|
optionItemComponent: DefaultOption,
|
676
587
|
noWrap: false
|
677
588
|
});
|
678
|
-
|
679
589
|
export default AutoComplete;
|
@@ -7,7 +7,7 @@ var disabledColor = _disabledColor;
|
|
7
7
|
var rgba = _rgba;
|
8
8
|
var autoCompletePlugin = plugin(function (_ref) {
|
9
9
|
var addComponents = _ref.addComponents,
|
10
|
-
|
10
|
+
theme = _ref.theme;
|
11
11
|
addComponents({
|
12
12
|
".autocomplete-container": {
|
13
13
|
display: "flex",
|
@@ -36,10 +36,10 @@ var autoCompletePlugin = plugin(function (_ref) {
|
|
36
36
|
minHeight: "3rem",
|
37
37
|
"&::after": {
|
38
38
|
minHeight: "38px" // don't ask me why 38
|
39
|
-
|
40
39
|
}
|
41
40
|
}
|
42
41
|
},
|
42
|
+
|
43
43
|
".autocomplete-focused, .autocomplete-container:focus-within": {
|
44
44
|
borderColor: theme("colors.accent.600"),
|
45
45
|
boxShadow: "0px 1px 0px 0px ".concat(theme("colors.shadow.5"))
|
@@ -1,7 +1,5 @@
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
2
|
-
|
3
2
|
var _templateObject, _templateObject2, _templateObject3;
|
4
|
-
|
5
3
|
import { X } from "react-feather";
|
6
4
|
import { Medallion } from "../../Medallion";
|
7
5
|
import stl from "../../styles/helpers/satellitePrefixer";
|
@@ -9,11 +7,11 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
7
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
10
8
|
export var AutoCompleteEmptyState = function AutoCompleteEmptyState(_ref) {
|
11
9
|
var _ref$icon = _ref.icon,
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
10
|
+
icon = _ref$icon === void 0 ? X : _ref$icon,
|
11
|
+
_ref$variant = _ref.variant,
|
12
|
+
variant = _ref$variant === void 0 ? "grey" : _ref$variant,
|
13
|
+
title = _ref.title,
|
14
|
+
description = _ref.description;
|
17
15
|
return /*#__PURE__*/_jsxs("div", {
|
18
16
|
className: stl(_templateObject || (_templateObject = _taggedTemplateLiteral(["flex flex-col items-center p-6"]))),
|
19
17
|
children: [/*#__PURE__*/_jsx(Medallion, {
|
@@ -1,22 +1,17 @@
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
2
|
-
|
3
2
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
4
|
-
|
5
3
|
import stl from "../../styles/helpers/satellitePrefixer";
|
6
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
7
5
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
8
|
-
|
9
6
|
var metadataSpacer = /*#__PURE__*/_jsx("span", {
|
10
7
|
className: stl(_templateObject || (_templateObject = _taggedTemplateLiteral(["px-1"]))),
|
11
8
|
children: "\xB7"
|
12
9
|
});
|
13
|
-
|
14
10
|
var DefaultOptionItem = function DefaultOptionItem(_ref) {
|
15
11
|
var _locale$optionItemPre;
|
16
|
-
|
17
12
|
var option = _ref.option,
|
18
|
-
|
19
|
-
|
13
|
+
multiple = _ref.multiple,
|
14
|
+
locale = _ref.locale;
|
20
15
|
return /*#__PURE__*/_jsxs("div", {
|
21
16
|
className: stl(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["truncate py-2"]))),
|
22
17
|
children: [/*#__PURE__*/_jsx("span", {
|
@@ -32,5 +27,4 @@ var DefaultOptionItem = function DefaultOptionItem(_ref) {
|
|
32
27
|
})]
|
33
28
|
});
|
34
29
|
};
|
35
|
-
|
36
30
|
export default DefaultOptionItem;
|
@@ -2,7 +2,6 @@ import pluralize from "../utils/pluralize";
|
|
2
2
|
export function isAutoCompleteMultiProps(props) {
|
3
3
|
return Boolean(props.multiple);
|
4
4
|
}
|
5
|
-
|
6
5
|
function createFromInputValue() {
|
7
6
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
8
7
|
var inputValue = arguments.length > 1 ? arguments[1] : undefined;
|
@@ -15,7 +14,6 @@ function createFromInputValue() {
|
|
15
14
|
"new": true
|
16
15
|
}];
|
17
16
|
}
|
18
|
-
|
19
17
|
export var defaultCreateFromInputValue = function defaultCreateFromInputValue(options, inputValue) {
|
20
18
|
return createFromInputValue(options, inputValue, function (option) {
|
21
19
|
return option.value === inputValue;
|