@algolia/satellite 1.0.0-beta.131 → 1.0.0-beta.134
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/README.md +33 -28
- package/cjs/AnnouncementBadge/AnnouncementBadge.d.ts +8 -3
- package/cjs/AnnouncementBadge/AnnouncementBadge.js +25 -7
- package/cjs/AutoComplete/AutoComplete.d.ts +23 -17
- package/cjs/AutoComplete/AutoComplete.js +180 -124
- package/cjs/AutoComplete/AutoComplete.tailwind.d.ts +4 -4
- package/cjs/AutoComplete/AutoComplete.tailwind.js +10 -13
- package/cjs/AutoComplete/components/AutoCompleteEmptyState.d.ts +4 -4
- package/cjs/AutoComplete/components/AutoCompleteEmptyState.js +16 -13
- package/cjs/AutoComplete/components/DefaultOptionItem.d.ts +6 -2
- package/cjs/AutoComplete/components/DefaultOptionItem.js +24 -17
- package/cjs/AutoComplete/types.d.ts +33 -25
- package/cjs/AutoComplete/utils.d.ts +5 -4
- package/cjs/AutoComplete/utils.js +22 -2
- package/cjs/Avatars/ApplicationAvatar.js +7 -6
- package/cjs/Avatars/UserAvatar.js +19 -20
- package/cjs/Avatars/utils.d.ts +1 -1
- package/cjs/Badge/Badge.d.ts +5 -5
- package/cjs/Badge/Badge.js +21 -12
- package/cjs/Banner/Banner.d.ts +5 -4
- package/cjs/Banner/Banner.js +30 -25
- package/cjs/Banners/Alert/Alert.d.ts +5 -4
- package/cjs/Banners/Alert/Alert.js +29 -23
- package/cjs/Banners/BigBertha/BigBertha.d.ts +3 -2
- package/cjs/Banners/BigBertha/BigBertha.js +11 -9
- package/cjs/Banners/Promote/Promote.d.ts +6 -5
- package/cjs/Banners/Promote/Promote.js +38 -30
- package/cjs/Button/Button.js +23 -17
- package/cjs/Button/Button.tailwind.d.ts +4 -4
- package/cjs/Button/Button.tailwind.js +11 -14
- package/cjs/Button/ButtonGroup.d.ts +2 -1
- package/cjs/Button/ButtonGroup.js +6 -5
- package/cjs/Button/IconButton.d.ts +2 -2
- package/cjs/Button/IconButton.js +24 -22
- package/cjs/Button/styles.d.ts +1 -1
- package/cjs/Button/types.d.ts +5 -5
- package/cjs/Card/Card.d.ts +3 -3
- package/cjs/Card/Card.js +8 -11
- package/cjs/Card/Card.tailwind.d.ts +4 -4
- package/cjs/Card/Card.tailwind.js +5 -8
- package/cjs/Card/components/CardHeader.js +8 -4
- package/cjs/Card/components/CardTitle.d.ts +4 -2
- package/cjs/Card/components/CardTitle.js +11 -6
- package/cjs/Checkbox/Checkbox.d.ts +3 -3
- package/cjs/Checkbox/Checkbox.js +33 -30
- package/cjs/Checkbox/Checkbox.tailwind.d.ts +5 -5
- package/cjs/Checkbox/Checkbox.tailwind.js +11 -14
- package/cjs/ClickAwayContainer/ClickAwayContainer.d.ts +3 -2
- package/cjs/ClickAwayContainer/ClickAwayContainer.js +6 -9
- package/cjs/DatePicker/DatePicker/DatePicker.d.ts +13 -19
- package/cjs/DatePicker/DatePicker/DatePicker.js +90 -63
- package/cjs/DatePicker/DatePicker/datePickerReducer.d.ts +2 -2
- package/cjs/DatePicker/DatePicker/datePickerReducer.js +2 -2
- package/cjs/DatePicker/DatePicker.tailwind.d.ts +4 -4
- package/cjs/DatePicker/DatePicker.tailwind.js +19 -14
- package/cjs/DatePicker/DateRangePicker/DateRangePicker.d.ts +11 -17
- package/cjs/DatePicker/DateRangePicker/DateRangePicker.js +101 -70
- package/cjs/DatePicker/DateRangePicker/DateRangePickerDisplay.d.ts +4 -1
- package/cjs/DatePicker/DateRangePicker/DateRangePickerDisplay.js +18 -12
- package/cjs/DatePicker/DateRangePicker/dateRangePickerReducer.d.ts +3 -3
- package/cjs/DatePicker/DateRangePicker/dateRangePickerReducer.js +5 -5
- package/cjs/DatePicker/components/Calendar.d.ts +6 -2
- package/cjs/DatePicker/components/Calendar.js +12 -10
- package/cjs/DatePicker/components/Display.d.ts +3 -3
- package/cjs/DatePicker/components/Display.js +6 -5
- package/cjs/DatePicker/components/Footer.d.ts +2 -2
- package/cjs/DatePicker/components/Footer.js +6 -5
- package/cjs/DatePicker/components/FooterActions.d.ts +4 -1
- package/cjs/DatePicker/components/FooterActions.js +17 -13
- package/cjs/DatePicker/components/Modal.d.ts +5 -5
- package/cjs/DatePicker/components/Modal.js +18 -16
- package/cjs/DatePicker/components/NavBar.d.ts +7 -3
- package/cjs/DatePicker/components/NavBar.js +42 -41
- package/cjs/DatePicker/components/SidePanel.d.ts +2 -2
- package/cjs/DatePicker/components/SidePanel.js +9 -7
- package/cjs/DatePicker/types.d.ts +17 -0
- package/cjs/{tailwind-types.js → DatePicker/types.js} +0 -0
- package/cjs/DatePicker/utils.d.ts +2 -0
- package/cjs/DatePicker/utils.js +10 -2
- package/cjs/Dropdown/Dropdown.d.ts +8 -8
- package/cjs/Dropdown/Dropdown.js +49 -40
- package/cjs/Dropdown/DropdownButton.d.ts +4 -3
- package/cjs/Dropdown/DropdownButton.js +15 -9
- package/cjs/Dropdown/DropdownContext.d.ts +2 -2
- package/cjs/Dropdown/DropdownContext.js +2 -9
- package/cjs/Dropdown/components/DropdownButtonItem.d.ts +1 -1
- package/cjs/Dropdown/components/DropdownButtonItem.js +14 -14
- package/cjs/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItem.d.ts +4 -4
- package/cjs/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItem.js +30 -29
- package/cjs/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsGroup.d.ts +1 -1
- package/cjs/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsGroup.js +6 -7
- package/cjs/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsMultiGroup.d.ts +1 -1
- package/cjs/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsMultiGroup.js +6 -9
- package/cjs/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsSingleGroup.d.ts +1 -1
- package/cjs/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsSingleGroup.js +6 -9
- package/cjs/Dropdown/components/DropdownDivider.js +3 -3
- package/cjs/Dropdown/components/DropdownFooterItem.d.ts +2 -2
- package/cjs/Dropdown/components/DropdownFooterItem.js +11 -5
- package/cjs/Dropdown/components/DropdownLinkItem.js +14 -13
- package/cjs/Dropdown/components/DropdownRadioItem.d.ts +2 -2
- package/cjs/Dropdown/components/DropdownRadioItem.js +17 -16
- package/cjs/Dropdown/components/DropdownTitle.d.ts +4 -2
- package/cjs/Dropdown/components/DropdownTitle.js +8 -4
- package/cjs/Dropdown/components/DropdownToggleItem.d.ts +3 -3
- package/cjs/Dropdown/components/DropdownToggleItem.js +16 -16
- package/cjs/Dropdown/useDropdownItemProps.d.ts +3 -3
- package/cjs/Dropzone/Dropzone.d.ts +7 -3
- package/cjs/Dropzone/Dropzone.js +70 -56
- package/cjs/EmptyState/EmptyState.d.ts +1 -1
- package/cjs/EmptyState/EmptyState.js +29 -22
- package/cjs/EmptyState/EmptyState.tailwind.d.ts +4 -4
- package/cjs/EmptyState/EmptyState.tailwind.js +5 -8
- package/cjs/EmptyState/types.d.ts +7 -7
- package/cjs/Field/Field.d.ts +4 -3
- package/cjs/Field/Field.js +33 -26
- package/cjs/Flag/Flag.d.ts +3 -2
- package/cjs/Flag/Flag.js +58 -38
- package/cjs/Flag/Flag.tailwind.d.ts +4 -4
- package/cjs/Flag/Flag.tailwind.js +8 -15
- package/cjs/Flag/Flags.d.ts +3 -3
- package/cjs/Flag/Flags.js +32 -22
- package/cjs/Flag/types.d.ts +8 -4
- package/cjs/FlexGrid/FlexGrid.d.ts +2 -1
- package/cjs/FlexGrid/FlexGrid.js +15 -9
- package/cjs/FlexGrid/FlexGrid.tailwind.d.ts +6 -3
- package/cjs/FlexGrid/FlexGrid.tailwind.js +10 -13
- package/cjs/HelpUnderline/HelpUnderline.d.ts +2 -1
- package/cjs/HelpUnderline/HelpUnderline.js +9 -7
- package/cjs/HelpUnderline/HelpUnderline.tailwind.d.ts +4 -4
- package/cjs/HelpUnderline/HelpUnderline.tailwind.js +3 -6
- package/cjs/Input/Input.d.ts +11 -5
- package/cjs/Input/Input.js +131 -115
- package/cjs/Input/Input.tailwind.d.ts +4 -4
- package/cjs/Input/Input.tailwind.js +12 -15
- package/cjs/Insert/Insert.d.ts +3 -2
- package/cjs/Insert/Insert.js +29 -23
- package/cjs/InstantSearch/InstantSearch.tailwind.d.ts +4 -5
- package/cjs/InstantSearch/InstantSearch.tailwind.js +34 -32
- package/cjs/KeyboardKey/KeyboardKey.d.ts +2 -1
- package/cjs/KeyboardKey/KeyboardKey.js +11 -13
- package/cjs/KeyboardKey/KeyboardKey.tailwind.d.ts +4 -4
- package/cjs/KeyboardKey/KeyboardKey.tailwind.js +5 -8
- package/cjs/Link/BaseLink.d.ts +3 -3
- package/cjs/Link/BaseLink.js +7 -7
- package/cjs/Link/ButtonLink.d.ts +1 -1
- package/cjs/Link/ButtonLink.js +9 -5
- package/cjs/Link/IconButtonLink.d.ts +1 -1
- package/cjs/Link/IconButtonLink.js +8 -4
- package/cjs/Link/Link.d.ts +5 -5
- package/cjs/Link/Link.js +16 -15
- package/cjs/Medallion/Medallion.d.ts +2 -2
- package/cjs/Medallion/Medallion.js +8 -7
- package/cjs/Medallion/Medallion.tailwind.d.ts +4 -4
- package/cjs/Medallion/Medallion.tailwind.js +8 -11
- package/cjs/Modal/Modal.d.ts +8 -5
- package/cjs/Modal/Modal.js +60 -47
- package/cjs/Modal/Modal.tailwind.d.ts +4 -4
- package/cjs/Modal/Modal.tailwind.js +9 -18
- package/cjs/Modal/components/ModalFooter.d.ts +4 -2
- package/cjs/Modal/components/ModalFooter.js +16 -10
- package/cjs/Modal/components/ModalSection.d.ts +1 -1
- package/cjs/Modal/components/ModalSection.js +6 -5
- package/cjs/Pagination/CompactPagination/CompactPagination.d.ts +8 -0
- package/cjs/Pagination/CompactPagination/CompactPagination.js +62 -36
- package/cjs/Pagination/DotPagination/DotPagination.d.ts +5 -1
- package/cjs/Pagination/DotPagination/DotPagination.js +36 -16
- package/cjs/Pagination/Pagination/Pagination.d.ts +7 -1
- package/cjs/Pagination/Pagination/Pagination.js +79 -49
- package/cjs/ProgressBar/ProgressBar.d.ts +2 -2
- package/cjs/ProgressBar/ProgressBar.js +16 -11
- package/cjs/ProgressBar/ProgressBar.tailwind.d.ts +5 -5
- package/cjs/ProgressBar/ProgressBar.tailwind.js +7 -10
- package/cjs/ProgressSpinner/ProgressSpinner.d.ts +2 -2
- package/cjs/ProgressSpinner/ProgressSpinner.js +18 -11
- package/cjs/ProgressSpinner/ProgressSpinner.tailwind.d.ts +5 -5
- package/cjs/ProgressSpinner/ProgressSpinner.tailwind.js +4 -7
- package/cjs/RadioGroup/RadioButton.d.ts +3 -3
- package/cjs/RadioGroup/RadioButton.js +8 -8
- package/cjs/RadioGroup/RadioButton.tailwind.d.ts +4 -4
- package/cjs/RadioGroup/RadioButton.tailwind.js +11 -14
- package/cjs/RadioGroup/RadioGroup.d.ts +4 -3
- package/cjs/RadioGroup/RadioGroup.js +36 -34
- package/cjs/RangeSlider/RangeSlider.d.ts +3 -3
- package/cjs/RangeSlider/RangeSlider.js +37 -36
- package/cjs/RangeSlider/RangeSlider.tailwind.d.ts +4 -4
- package/cjs/RangeSlider/RangeSlider.tailwind.js +21 -24
- package/cjs/Satellite/Satellite.d.ts +5 -2
- package/cjs/Satellite/Satellite.js +13 -7
- package/cjs/Satellite/SatelliteContext.d.ts +3 -1
- package/cjs/Satellite/SatelliteContext.js +4 -3
- package/cjs/Satellite/SatelliteRouter.d.ts +1 -1
- package/cjs/Satellite/index.d.ts +1 -0
- package/cjs/Satellite/index.js +14 -0
- package/cjs/Satellite/locale.d.ts +27 -0
- package/cjs/Satellite/locale.js +21 -0
- package/cjs/ScrollIndicator/ScrollIndicator.d.ts +6 -3
- package/cjs/ScrollIndicator/ScrollIndicator.js +13 -16
- package/cjs/ScrollIndicator/ScrollIndicator.tailwind.d.ts +4 -4
- package/cjs/ScrollIndicator/ScrollIndicator.tailwind.js +8 -11
- package/cjs/Select/Select.d.ts +3 -3
- package/cjs/Select/Select.js +8 -8
- package/cjs/Select/Select.tailwind.d.ts +5 -5
- package/cjs/Select/Select.tailwind.js +5 -8
- package/cjs/Sidebar/Sidebar.d.ts +6 -4
- package/cjs/Sidebar/Sidebar.js +18 -10
- package/cjs/Sidebar/Sidebar.tailwind.d.ts +4 -4
- package/cjs/Sidebar/Sidebar.tailwind.js +5 -8
- package/cjs/Sidebar/SidebarContext.d.ts +1 -1
- package/cjs/Sidebar/components/SidebarHeader.d.ts +2 -2
- package/cjs/Sidebar/components/SidebarHeader.js +11 -6
- package/cjs/Sidebar/components/SidebarLink.d.ts +4 -3
- package/cjs/Sidebar/components/SidebarLink.js +32 -22
- package/cjs/Switch/Switch.d.ts +3 -3
- package/cjs/Switch/Switch.js +17 -19
- package/cjs/Switch/Switch.tailwind.d.ts +5 -5
- package/cjs/Switch/Switch.tailwind.js +7 -8
- package/cjs/Switch/SwitchOption.d.ts +2 -1
- package/cjs/Switch/SwitchOption.js +25 -17
- package/cjs/Tables/DataTable/DataTable.d.ts +15 -5
- package/cjs/Tables/DataTable/DataTable.js +79 -60
- package/cjs/Tables/DataTable/DataTable.tailwind.d.ts +4 -4
- package/cjs/Tables/DataTable/DataTable.tailwind.js +3 -6
- package/cjs/Tables/DataTable/components/Body.d.ts +7 -6
- package/cjs/Tables/DataTable/components/Body.js +62 -47
- package/cjs/Tables/DataTable/components/Footer.d.ts +1 -1
- package/cjs/Tables/DataTable/components/Footer.js +6 -6
- package/cjs/Tables/DataTable/components/Header.js +24 -20
- package/cjs/Tables/DataTable/components/HeaderCell.d.ts +3 -3
- package/cjs/Tables/DataTable/components/HeaderCell.js +20 -14
- package/cjs/Tables/DataTable/components/Loader.d.ts +3 -1
- package/cjs/Tables/DataTable/components/Loader.js +19 -20
- package/cjs/Tables/DataTable/types.d.ts +3 -3
- package/cjs/Tables/DataTable/utils.d.ts +1 -1
- package/cjs/Tables/Table/Table.d.ts +3 -3
- package/cjs/Tables/Table/Table.js +19 -12
- package/cjs/Tables/Table/Table.tailwind.d.ts +4 -4
- package/cjs/Tables/Table/Table.tailwind.js +3 -6
- package/cjs/Tables/Table/components/Footer.d.ts +2 -2
- package/cjs/Tables/Table/components/Footer.js +6 -5
- package/cjs/Tabs/ContentTabs.d.ts +1 -1
- package/cjs/Tabs/ContentTabs.js +39 -38
- package/cjs/Tabs/LinkTabs.d.ts +1 -1
- package/cjs/Tabs/LinkTabs.js +16 -16
- package/cjs/Tabs/Tabs.tailwind.d.ts +4 -4
- package/cjs/Tabs/Tabs.tailwind.js +5 -8
- package/cjs/Tabs/components/LinkTab.d.ts +3 -3
- package/cjs/Tabs/components/LinkTab.js +18 -12
- package/cjs/Tabs/types.d.ts +6 -6
- package/cjs/Tabs/utils.d.ts +1 -1
- package/cjs/Tag/Tag.d.ts +8 -4
- package/cjs/Tag/Tag.js +36 -24
- package/cjs/Tag/Tag.tailwind.d.ts +4 -4
- package/cjs/Tag/Tag.tailwind.js +6 -9
- package/cjs/TextArea/TextArea.d.ts +3 -3
- package/cjs/TextArea/TextArea.js +8 -8
- package/cjs/TextArea/TextArea.tailwind.d.ts +4 -4
- package/cjs/TextArea/TextArea.tailwind.js +4 -7
- package/cjs/TextWrap/TextWrap.js +20 -20
- package/cjs/Toggle/Toggle.d.ts +3 -3
- package/cjs/Toggle/Toggle.js +23 -21
- package/cjs/Toggle/Toggle.tailwind.d.ts +5 -5
- package/cjs/Toggle/Toggle.tailwind.js +19 -22
- package/cjs/Tooltip/OverflowTooltipWrapper.d.ts +3 -2
- package/cjs/Tooltip/OverflowTooltipWrapper.js +32 -24
- package/cjs/Tooltip/Tooltip.d.ts +3 -3
- package/cjs/Tooltip/Tooltip.js +8 -8
- package/cjs/Tooltip/Tooltip.tailwind.d.ts +4 -4
- package/cjs/Tooltip/Tooltip.tailwind.js +19 -18
- package/cjs/Tooltip/TooltipWrapper.d.ts +4 -3
- package/cjs/Tooltip/TooltipWrapper.js +47 -39
- package/cjs/Tooltip/types.d.ts +4 -2
- package/cjs/Typography/Typography.tailwind.d.ts +5 -17
- package/cjs/Typography/Typography.tailwind.js +125 -135
- package/cjs/UserContent/UserContent.js +3 -3
- package/cjs/UserContent/UserContent.tailwind.d.ts +4 -1
- package/cjs/UserContent/UserContent.tailwind.js +13 -13
- package/cjs/styles/base.tailwind.d.ts +4 -4
- package/cjs/styles/base.tailwind.js +3 -6
- package/cjs/styles/tailwind.config.d.ts +2 -198
- package/cjs/styles/tailwind.config.js +27 -31
- package/cjs/types.d.ts +10 -3
- package/cjs/utilities/utilities.tailwind.d.ts +4 -1
- package/cjs/utilities/utilities.tailwind.js +4 -6
- package/cjs/utils/genericChangeHandler.d.ts +3 -3
- package/cjs/utils/isCssPropertySupported.d.ts +1 -1
- package/cjs/utils/isRenderedChild.d.ts +2 -2
- package/cjs/utils/pluralize.js +6 -1
- package/cjs/utils/useForwardedRef.d.ts +2 -2
- package/cjs/utils/useLinkProps.d.ts +2 -2
- package/cjs/utils/useTriggerInputChange.d.ts +2 -2
- package/esm/AnnouncementBadge/AnnouncementBadge.d.ts +8 -3
- package/esm/AnnouncementBadge/AnnouncementBadge.js +23 -6
- package/esm/AutoComplete/AutoComplete.d.ts +23 -17
- package/esm/AutoComplete/AutoComplete.js +184 -115
- package/esm/AutoComplete/AutoComplete.tailwind.d.ts +4 -4
- package/esm/AutoComplete/AutoComplete.tailwind.js +10 -13
- package/esm/AutoComplete/components/AutoCompleteEmptyState.d.ts +4 -4
- package/esm/AutoComplete/components/AutoCompleteEmptyState.js +16 -12
- package/esm/AutoComplete/components/DefaultOptionItem.d.ts +6 -2
- package/esm/AutoComplete/components/DefaultOptionItem.js +25 -16
- package/esm/AutoComplete/types.d.ts +33 -25
- package/esm/AutoComplete/utils.d.ts +5 -4
- package/esm/AutoComplete/utils.js +16 -0
- package/esm/Avatars/ApplicationAvatar.js +6 -5
- package/esm/Avatars/UserAvatar.js +19 -14
- package/esm/Avatars/utils.d.ts +1 -1
- package/esm/Badge/Badge.d.ts +5 -5
- package/esm/Badge/Badge.js +21 -11
- package/esm/Banner/Banner.d.ts +5 -4
- package/esm/Banner/Banner.js +31 -25
- package/esm/Banners/Alert/Alert.d.ts +5 -4
- package/esm/Banners/Alert/Alert.js +30 -23
- package/esm/Banners/BigBertha/BigBertha.d.ts +3 -2
- package/esm/Banners/BigBertha/BigBertha.js +11 -8
- package/esm/Banners/Promote/Promote.d.ts +6 -5
- package/esm/Banners/Promote/Promote.js +37 -28
- package/esm/Button/Button.js +23 -16
- package/esm/Button/Button.tailwind.d.ts +4 -4
- package/esm/Button/Button.tailwind.js +13 -16
- package/esm/Button/ButtonGroup.d.ts +2 -1
- package/esm/Button/ButtonGroup.js +5 -4
- package/esm/Button/IconButton.d.ts +2 -2
- package/esm/Button/IconButton.js +24 -19
- package/esm/Button/styles.d.ts +1 -1
- package/esm/Button/types.d.ts +5 -5
- package/esm/Card/Card.d.ts +3 -3
- package/esm/Card/Card.js +6 -4
- package/esm/Card/Card.tailwind.d.ts +4 -4
- package/esm/Card/Card.tailwind.js +6 -9
- package/esm/Card/components/CardHeader.js +8 -3
- package/esm/Card/components/CardTitle.d.ts +4 -2
- package/esm/Card/components/CardTitle.js +11 -5
- package/esm/Checkbox/Checkbox.d.ts +3 -3
- package/esm/Checkbox/Checkbox.js +35 -26
- package/esm/Checkbox/Checkbox.tailwind.d.ts +5 -5
- package/esm/Checkbox/Checkbox.tailwind.js +11 -14
- package/esm/ClickAwayContainer/ClickAwayContainer.d.ts +3 -2
- package/esm/ClickAwayContainer/ClickAwayContainer.js +6 -4
- package/esm/DatePicker/DatePicker/DatePicker.d.ts +13 -19
- package/esm/DatePicker/DatePicker/DatePicker.js +92 -59
- package/esm/DatePicker/DatePicker/datePickerReducer.d.ts +2 -2
- package/esm/DatePicker/DatePicker/datePickerReducer.js +2 -2
- package/esm/DatePicker/DatePicker.tailwind.d.ts +4 -4
- package/esm/DatePicker/DatePicker.tailwind.js +19 -15
- package/esm/DatePicker/DateRangePicker/DateRangePicker.d.ts +11 -17
- package/esm/DatePicker/DateRangePicker/DateRangePicker.js +105 -67
- package/esm/DatePicker/DateRangePicker/DateRangePickerDisplay.d.ts +4 -1
- package/esm/DatePicker/DateRangePicker/DateRangePickerDisplay.js +19 -11
- package/esm/DatePicker/DateRangePicker/dateRangePickerReducer.d.ts +3 -3
- package/esm/DatePicker/DateRangePicker/dateRangePickerReducer.js +4 -4
- package/esm/DatePicker/components/Calendar.d.ts +6 -2
- package/esm/DatePicker/components/Calendar.js +13 -5
- package/esm/DatePicker/components/Display.d.ts +3 -3
- package/esm/DatePicker/components/Display.js +5 -4
- package/esm/DatePicker/components/Footer.d.ts +2 -2
- package/esm/DatePicker/components/Footer.js +5 -4
- package/esm/DatePicker/components/FooterActions.d.ts +4 -1
- package/esm/DatePicker/components/FooterActions.js +18 -13
- package/esm/DatePicker/components/Modal.d.ts +5 -5
- package/esm/DatePicker/components/Modal.js +19 -12
- package/esm/DatePicker/components/NavBar.d.ts +7 -3
- package/esm/DatePicker/components/NavBar.js +42 -35
- package/esm/DatePicker/components/SidePanel.d.ts +2 -2
- package/esm/DatePicker/components/SidePanel.js +8 -6
- package/esm/DatePicker/types.d.ts +17 -0
- package/esm/{tailwind-types.js → DatePicker/types.js} +0 -0
- package/esm/DatePicker/utils.d.ts +2 -0
- package/esm/DatePicker/utils.js +7 -0
- package/esm/Dropdown/Dropdown.d.ts +8 -8
- package/esm/Dropdown/Dropdown.js +45 -30
- package/esm/Dropdown/DropdownButton.d.ts +4 -3
- package/esm/Dropdown/DropdownButton.js +15 -8
- package/esm/Dropdown/DropdownContext.d.ts +2 -2
- package/esm/Dropdown/DropdownContext.js +2 -2
- package/esm/Dropdown/components/DropdownButtonItem.d.ts +1 -1
- package/esm/Dropdown/components/DropdownButtonItem.js +14 -12
- package/esm/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItem.d.ts +4 -4
- package/esm/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItem.js +29 -22
- package/esm/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsGroup.d.ts +1 -1
- package/esm/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsGroup.js +5 -4
- package/esm/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsMultiGroup.d.ts +1 -1
- package/esm/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsMultiGroup.js +6 -4
- package/esm/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsSingleGroup.d.ts +1 -1
- package/esm/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsSingleGroup.js +6 -4
- package/esm/Dropdown/components/DropdownDivider.js +2 -2
- package/esm/Dropdown/components/DropdownFooterItem.d.ts +2 -2
- package/esm/Dropdown/components/DropdownFooterItem.js +11 -4
- package/esm/Dropdown/components/DropdownLinkItem.js +14 -11
- package/esm/Dropdown/components/DropdownRadioItem.d.ts +2 -2
- package/esm/Dropdown/components/DropdownRadioItem.js +17 -14
- package/esm/Dropdown/components/DropdownTitle.d.ts +4 -2
- package/esm/Dropdown/components/DropdownTitle.js +8 -3
- package/esm/Dropdown/components/DropdownToggleItem.d.ts +3 -3
- package/esm/Dropdown/components/DropdownToggleItem.js +16 -14
- package/esm/Dropdown/useDropdownItemProps.d.ts +3 -3
- package/esm/Dropzone/Dropzone.d.ts +7 -3
- package/esm/Dropzone/Dropzone.js +69 -49
- package/esm/EmptyState/EmptyState.d.ts +1 -1
- package/esm/EmptyState/EmptyState.js +29 -21
- package/esm/EmptyState/EmptyState.tailwind.d.ts +4 -4
- package/esm/EmptyState/EmptyState.tailwind.js +6 -9
- package/esm/EmptyState/types.d.ts +7 -7
- package/esm/Field/Field.d.ts +4 -3
- package/esm/Field/Field.js +33 -25
- package/esm/Flag/Flag.d.ts +3 -2
- package/esm/Flag/Flag.js +57 -33
- package/esm/Flag/Flag.tailwind.d.ts +4 -4
- package/esm/Flag/Flag.tailwind.js +9 -16
- package/esm/Flag/Flags.d.ts +3 -3
- package/esm/Flag/Flags.js +30 -21
- package/esm/Flag/types.d.ts +8 -4
- package/esm/FlexGrid/FlexGrid.d.ts +2 -1
- package/esm/FlexGrid/FlexGrid.js +13 -8
- package/esm/FlexGrid/FlexGrid.tailwind.d.ts +6 -3
- package/esm/FlexGrid/FlexGrid.tailwind.js +10 -13
- package/esm/HelpUnderline/HelpUnderline.d.ts +2 -1
- package/esm/HelpUnderline/HelpUnderline.js +8 -6
- package/esm/HelpUnderline/HelpUnderline.tailwind.d.ts +4 -4
- package/esm/HelpUnderline/HelpUnderline.tailwind.js +4 -7
- package/esm/Input/Input.d.ts +11 -5
- package/esm/Input/Input.js +131 -109
- package/esm/Input/Input.tailwind.d.ts +4 -4
- package/esm/Input/Input.tailwind.js +14 -17
- package/esm/Insert/Insert.d.ts +3 -2
- package/esm/Insert/Insert.js +28 -21
- package/esm/InstantSearch/InstantSearch.tailwind.d.ts +4 -5
- package/esm/InstantSearch/InstantSearch.tailwind.js +35 -33
- package/esm/KeyboardKey/KeyboardKey.d.ts +2 -1
- package/esm/KeyboardKey/KeyboardKey.js +9 -6
- package/esm/KeyboardKey/KeyboardKey.tailwind.d.ts +4 -4
- package/esm/KeyboardKey/KeyboardKey.tailwind.js +6 -9
- package/esm/Link/BaseLink.d.ts +3 -3
- package/esm/Link/BaseLink.js +9 -3
- package/esm/Link/ButtonLink.d.ts +1 -1
- package/esm/Link/ButtonLink.js +9 -4
- package/esm/Link/IconButtonLink.d.ts +1 -1
- package/esm/Link/IconButtonLink.js +9 -4
- package/esm/Link/Link.d.ts +5 -5
- package/esm/Link/Link.js +18 -10
- package/esm/Medallion/Medallion.d.ts +2 -2
- package/esm/Medallion/Medallion.js +7 -6
- package/esm/Medallion/Medallion.tailwind.d.ts +4 -4
- package/esm/Medallion/Medallion.tailwind.js +8 -11
- package/esm/Modal/Modal.d.ts +8 -5
- package/esm/Modal/Modal.js +58 -39
- package/esm/Modal/Modal.tailwind.d.ts +4 -4
- package/esm/Modal/Modal.tailwind.js +10 -19
- package/esm/Modal/components/ModalFooter.d.ts +4 -2
- package/esm/Modal/components/ModalFooter.js +16 -9
- package/esm/Modal/components/ModalSection.d.ts +1 -1
- package/esm/Modal/components/ModalSection.js +5 -4
- package/esm/Pagination/CompactPagination/CompactPagination.d.ts +8 -0
- package/esm/Pagination/CompactPagination/CompactPagination.js +61 -37
- package/esm/Pagination/DotPagination/DotPagination.d.ts +5 -1
- package/esm/Pagination/DotPagination/DotPagination.js +33 -16
- package/esm/Pagination/Pagination/Pagination.d.ts +7 -1
- package/esm/Pagination/Pagination/Pagination.js +78 -48
- package/esm/ProgressBar/ProgressBar.d.ts +2 -2
- package/esm/ProgressBar/ProgressBar.js +16 -10
- package/esm/ProgressBar/ProgressBar.tailwind.d.ts +5 -5
- package/esm/ProgressBar/ProgressBar.tailwind.js +7 -10
- package/esm/ProgressSpinner/ProgressSpinner.d.ts +2 -2
- package/esm/ProgressSpinner/ProgressSpinner.js +18 -10
- package/esm/ProgressSpinner/ProgressSpinner.tailwind.d.ts +5 -5
- package/esm/ProgressSpinner/ProgressSpinner.tailwind.js +5 -8
- package/esm/RadioGroup/RadioButton.d.ts +3 -3
- package/esm/RadioGroup/RadioButton.js +9 -3
- package/esm/RadioGroup/RadioButton.tailwind.d.ts +4 -4
- package/esm/RadioGroup/RadioButton.tailwind.js +13 -16
- package/esm/RadioGroup/RadioGroup.d.ts +4 -3
- package/esm/RadioGroup/RadioGroup.js +36 -28
- package/esm/RangeSlider/RangeSlider.d.ts +3 -3
- package/esm/RangeSlider/RangeSlider.js +39 -31
- package/esm/RangeSlider/RangeSlider.tailwind.d.ts +4 -4
- package/esm/RangeSlider/RangeSlider.tailwind.js +21 -24
- package/esm/Satellite/Satellite.d.ts +5 -2
- package/esm/Satellite/Satellite.js +11 -6
- package/esm/Satellite/SatelliteContext.d.ts +3 -1
- package/esm/Satellite/SatelliteContext.js +4 -3
- package/esm/Satellite/SatelliteRouter.d.ts +1 -1
- package/esm/Satellite/index.d.ts +1 -0
- package/esm/Satellite/index.js +1 -0
- package/esm/Satellite/locale.d.ts +27 -0
- package/esm/Satellite/locale.js +8 -0
- package/esm/ScrollIndicator/ScrollIndicator.d.ts +6 -3
- package/esm/ScrollIndicator/ScrollIndicator.js +12 -10
- package/esm/ScrollIndicator/ScrollIndicator.tailwind.d.ts +4 -4
- package/esm/ScrollIndicator/ScrollIndicator.tailwind.js +8 -11
- package/esm/Select/Select.d.ts +3 -3
- package/esm/Select/Select.js +8 -3
- package/esm/Select/Select.tailwind.d.ts +5 -5
- package/esm/Select/Select.tailwind.js +5 -8
- package/esm/Sidebar/Sidebar.d.ts +6 -4
- package/esm/Sidebar/Sidebar.js +16 -8
- package/esm/Sidebar/Sidebar.tailwind.d.ts +4 -4
- package/esm/Sidebar/Sidebar.tailwind.js +6 -9
- package/esm/Sidebar/SidebarContext.d.ts +1 -1
- package/esm/Sidebar/components/SidebarHeader.d.ts +2 -2
- package/esm/Sidebar/components/SidebarHeader.js +11 -5
- package/esm/Sidebar/components/SidebarLink.d.ts +4 -3
- package/esm/Sidebar/components/SidebarLink.js +34 -21
- package/esm/Switch/Switch.d.ts +3 -3
- package/esm/Switch/Switch.js +16 -12
- package/esm/Switch/Switch.tailwind.d.ts +5 -5
- package/esm/Switch/Switch.tailwind.js +7 -8
- package/esm/Switch/SwitchOption.d.ts +2 -1
- package/esm/Switch/SwitchOption.js +25 -16
- package/esm/Tables/DataTable/DataTable.d.ts +15 -5
- package/esm/Tables/DataTable/DataTable.js +77 -54
- package/esm/Tables/DataTable/DataTable.tailwind.d.ts +4 -4
- package/esm/Tables/DataTable/DataTable.tailwind.js +4 -7
- package/esm/Tables/DataTable/components/Body.d.ts +7 -6
- package/esm/Tables/DataTable/components/Body.js +60 -45
- package/esm/Tables/DataTable/components/Footer.d.ts +1 -1
- package/esm/Tables/DataTable/components/Footer.js +5 -5
- package/esm/Tables/DataTable/components/Header.js +22 -18
- package/esm/Tables/DataTable/components/HeaderCell.d.ts +3 -3
- package/esm/Tables/DataTable/components/HeaderCell.js +20 -13
- package/esm/Tables/DataTable/components/Loader.d.ts +3 -1
- package/esm/Tables/DataTable/components/Loader.js +18 -14
- package/esm/Tables/DataTable/types.d.ts +3 -3
- package/esm/Tables/DataTable/utils.d.ts +1 -1
- package/esm/Tables/Table/Table.d.ts +3 -3
- package/esm/Tables/Table/Table.js +20 -11
- package/esm/Tables/Table/Table.tailwind.d.ts +4 -4
- package/esm/Tables/Table/Table.tailwind.js +4 -7
- package/esm/Tables/Table/components/Footer.d.ts +2 -2
- package/esm/Tables/Table/components/Footer.js +5 -4
- package/esm/Tabs/ContentTabs.d.ts +1 -1
- package/esm/Tabs/ContentTabs.js +38 -31
- package/esm/Tabs/LinkTabs.d.ts +1 -1
- package/esm/Tabs/LinkTabs.js +14 -14
- package/esm/Tabs/Tabs.tailwind.d.ts +4 -4
- package/esm/Tabs/Tabs.tailwind.js +6 -9
- package/esm/Tabs/components/LinkTab.d.ts +3 -3
- package/esm/Tabs/components/LinkTab.js +18 -11
- package/esm/Tabs/types.d.ts +6 -6
- package/esm/Tabs/utils.d.ts +1 -1
- package/esm/Tag/Tag.d.ts +8 -4
- package/esm/Tag/Tag.js +36 -19
- package/esm/Tag/Tag.tailwind.d.ts +4 -4
- package/esm/Tag/Tag.tailwind.js +7 -10
- package/esm/TextArea/TextArea.d.ts +3 -3
- package/esm/TextArea/TextArea.js +9 -3
- package/esm/TextArea/TextArea.tailwind.d.ts +4 -4
- package/esm/TextArea/TextArea.tailwind.js +6 -9
- package/esm/TextWrap/TextWrap.js +22 -17
- package/esm/Toggle/Toggle.d.ts +3 -3
- package/esm/Toggle/Toggle.js +25 -16
- package/esm/Toggle/Toggle.tailwind.d.ts +5 -5
- package/esm/Toggle/Toggle.tailwind.js +19 -22
- package/esm/Tooltip/OverflowTooltipWrapper.d.ts +3 -2
- package/esm/Tooltip/OverflowTooltipWrapper.js +35 -19
- package/esm/Tooltip/Tooltip.d.ts +3 -3
- package/esm/Tooltip/Tooltip.js +8 -3
- package/esm/Tooltip/Tooltip.tailwind.d.ts +4 -4
- package/esm/Tooltip/Tooltip.tailwind.js +20 -19
- package/esm/Tooltip/TooltipWrapper.d.ts +4 -3
- package/esm/Tooltip/TooltipWrapper.js +48 -33
- package/esm/Tooltip/types.d.ts +4 -2
- package/esm/Typography/Typography.tailwind.d.ts +5 -17
- package/esm/Typography/Typography.tailwind.js +126 -136
- package/esm/UserContent/UserContent.js +2 -2
- package/esm/UserContent/UserContent.tailwind.d.ts +4 -1
- package/esm/UserContent/UserContent.tailwind.js +14 -14
- package/esm/styles/base.tailwind.d.ts +4 -4
- package/esm/styles/base.tailwind.js +4 -7
- package/esm/styles/tailwind.config.d.ts +2 -198
- package/esm/styles/tailwind.config.js +29 -32
- package/esm/types.d.ts +10 -3
- package/esm/utilities/utilities.tailwind.d.ts +4 -1
- package/esm/utilities/utilities.tailwind.js +4 -6
- package/esm/utils/genericChangeHandler.d.ts +3 -3
- package/esm/utils/isCssPropertySupported.d.ts +1 -1
- package/esm/utils/isRenderedChild.d.ts +2 -2
- package/esm/utils/pluralize.js +6 -1
- package/esm/utils/useForwardedRef.d.ts +2 -2
- package/esm/utils/useForwardedRef.js +1 -1
- package/esm/utils/useLinkProps.d.ts +2 -2
- package/esm/utils/useTriggerInputChange.d.ts +2 -2
- package/package.json +11 -14
- package/satellite.min.css +2 -4
- package/scss/colors.scss +1 -0
- package/cjs/tailwind-types.d.ts +0 -52
- package/esm/tailwind-types.d.ts +0 -52
- package/satellite.css +0 -196852
@@ -1,13 +1,24 @@
|
|
1
|
-
import
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
3
3
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
4
|
-
var _excluded = ["size", "text", "variant", "className"];
|
4
|
+
var _excluded = ["size", "text", "variant", "className", "locale"];
|
5
5
|
|
6
6
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
7
7
|
|
8
|
-
|
8
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
9
|
+
|
10
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
11
|
+
|
9
12
|
import cx from "classnames";
|
13
|
+
import { useLocale } from "../Satellite";
|
10
14
|
import stl from "../styles/helpers/satellitePrefixer";
|
15
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
16
|
+
var DEFAULT_LOCALE = {
|
17
|
+
beta: "beta",
|
18
|
+
internal: "internal",
|
19
|
+
"new": "new",
|
20
|
+
pilot: "pilot"
|
21
|
+
};
|
11
22
|
var DEFAULT_CLASSNAME = stl(_templateObject || (_templateObject = _taggedTemplateLiteral(["capitalize inline-block rounded-full text-white select-none"])));
|
12
23
|
var SIZE_CLASSNAMES = {
|
13
24
|
"default": stl(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["display-body h-6 leading-md px-2"]))),
|
@@ -20,11 +31,17 @@ export var AnnouncementBadge = function AnnouncementBadge(_ref) {
|
|
20
31
|
text = _ref$text === void 0 ? "new" : _ref$text,
|
21
32
|
variantProp = _ref.variant,
|
22
33
|
className = _ref.className,
|
34
|
+
propsLocale = _ref.locale,
|
23
35
|
props = _objectWithoutProperties(_ref, _excluded);
|
24
36
|
|
37
|
+
var contextLocale = useLocale("announcementBadge");
|
38
|
+
|
39
|
+
var locale = _objectSpread(_objectSpread(_objectSpread({}, DEFAULT_LOCALE), contextLocale), propsLocale);
|
40
|
+
|
25
41
|
var variant = typeof variantProp === "string" ? variantProp : text === "internal" ? "red" : "accent";
|
26
|
-
return /*#__PURE__*/
|
27
|
-
className: cx(DEFAULT_CLASSNAME, variant === "red" ? stl(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["bg-red-600"]))) : stl(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["bg-accent-600"]))), SIZE_CLASSNAMES[size], className)
|
28
|
-
|
42
|
+
return /*#__PURE__*/_jsx("span", _objectSpread(_objectSpread({}, props), {}, {
|
43
|
+
className: cx(DEFAULT_CLASSNAME, variant === "red" ? stl(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["bg-red-600"]))) : stl(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["bg-accent-600"]))), SIZE_CLASSNAMES[size], className),
|
44
|
+
children: locale[text]
|
45
|
+
}));
|
29
46
|
};
|
30
47
|
export default AnnouncementBadge;
|
@@ -1,13 +1,17 @@
|
|
1
|
-
import
|
2
|
-
import {
|
1
|
+
import type { A11yStatusMessageOptions, ControllerStateAndHelpers } from "downshift";
|
2
|
+
import { Component } from "react";
|
3
|
+
import type { ChangeEvent, FocusEvent, KeyboardEvent, MouseEvent } from "react";
|
3
4
|
import { FieldState } from "../Field/FieldStateContext";
|
4
|
-
import {
|
5
|
+
import type { AutoCompleteLocale, AutoCompleteProps, Option, OptionItemProps } from "./types";
|
5
6
|
interface State {
|
6
7
|
inputFocused: boolean;
|
7
8
|
inputValue: string;
|
8
9
|
inputWidth?: number;
|
9
10
|
showAllResults: boolean;
|
10
11
|
}
|
12
|
+
declare type DefaultOptionProps = OptionItemProps & {
|
13
|
+
optionItemPrefix?: AutoCompleteLocale["optionItemPrefix"];
|
14
|
+
};
|
11
15
|
/**
|
12
16
|
* 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.
|
13
17
|
*
|
@@ -24,37 +28,39 @@ interface State {
|
|
24
28
|
* - Provide matching results quickly
|
25
29
|
* - Style different data
|
26
30
|
*/
|
27
|
-
export declare class AutoComplete<T extends Option> extends Component<AutoCompleteProps
|
31
|
+
export declare class AutoComplete<T extends Option = Option> extends Component<AutoCompleteProps<T>, State> {
|
32
|
+
static contextType: import("react").Context<import("../Satellite").SatelliteContextType>;
|
28
33
|
static defaultProps: {
|
29
34
|
clearable: boolean;
|
30
35
|
creatable: boolean;
|
31
36
|
multiple: boolean;
|
32
37
|
maxResults: number;
|
33
|
-
|
34
|
-
createFromInputValue: import("./types").CreateFromInputValue;
|
38
|
+
createFromInputValue: <T_1 extends Option = Option>(options: T_1[] | undefined, inputValue: string) => Option[];
|
35
39
|
options: never[];
|
36
40
|
separatorKeyCodes: never[];
|
37
41
|
separatorKeys: never[];
|
38
|
-
optionItemComponent:
|
42
|
+
optionItemComponent: ({ optionItemPrefix, ...props }: DefaultOptionProps) => JSX.Element;
|
39
43
|
noWrap: boolean;
|
40
44
|
};
|
41
45
|
state: State;
|
42
46
|
inputContainerRef: HTMLDivElement | null;
|
43
47
|
inputRef: HTMLInputElement | null;
|
44
|
-
componentDidUpdate(prevProps: AutoCompleteProps): void;
|
48
|
+
componentDidUpdate(prevProps: AutoCompleteProps<T>): void;
|
45
49
|
handleClearClick: () => void;
|
46
50
|
handleFakeInputClick: () => void | null;
|
47
|
-
handleInputBlur: (state: ControllerStateAndHelpers<Option>) => (evt:
|
48
|
-
handleInputChange: (evt:
|
51
|
+
handleInputBlur: (state: ControllerStateAndHelpers<T | Option>) => (evt: FocusEvent<HTMLInputElement>) => void;
|
52
|
+
handleInputChange: (evt: ChangeEvent<HTMLInputElement>) => void;
|
49
53
|
handleInputContainerRefUpdate: (el: HTMLDivElement | null) => void;
|
50
54
|
updateInputWidth: () => void;
|
51
|
-
handleKeyDown: (state: ControllerStateAndHelpers<Option>) => (evt:
|
52
|
-
handleChange: (option:
|
53
|
-
handleShowAllResults: (evt:
|
54
|
-
removeValue: (removedOption:
|
55
|
-
|
56
|
-
|
57
|
-
|
55
|
+
handleKeyDown: (state: ControllerStateAndHelpers<T | Option>) => (evt: KeyboardEvent<any>) => void;
|
56
|
+
handleChange: (option: T) => void;
|
57
|
+
handleShowAllResults: (evt: MouseEvent<HTMLButtonElement>) => void;
|
58
|
+
removeValue: (removedOption: T) => void;
|
59
|
+
getA11yStatusMessage: (options: A11yStatusMessageOptions<Option>) => any;
|
60
|
+
renderInput: (results: T[], autocompleteHelpers: ControllerStateAndHelpers<T | Option>, fieldState: FieldState) => JSX.Element;
|
61
|
+
renderMenu: (results: T[], autocompleteHelpers: ControllerStateAndHelpers<T | Option>) => JSX.Element;
|
62
|
+
renderSelect: (autocompleteHelpers: ControllerStateAndHelpers<T | Option>, fieldState: FieldState) => JSX.Element;
|
63
|
+
private get locale();
|
58
64
|
render(): JSX.Element;
|
59
65
|
}
|
60
66
|
export default AutoComplete;
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
2
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
3
2
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
4
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
@@ -9,40 +8,45 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
9
8
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
10
9
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
11
10
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
11
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
12
12
|
|
13
13
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16;
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
15
|
+
var _excluded = ["optionItemPrefix"];
|
18
16
|
|
19
17
|
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); }; }
|
20
18
|
|
21
19
|
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; } }
|
22
20
|
|
21
|
+
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; }
|
22
|
+
|
23
|
+
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; }
|
24
|
+
|
23
25
|
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; } } }; }
|
24
26
|
|
25
27
|
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); }
|
26
28
|
|
27
29
|
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; }
|
28
30
|
|
29
|
-
import React, { Component } from "react";
|
30
|
-
import { createPortal } from "react-dom";
|
31
|
-
import { Popper } from "react-popper";
|
32
|
-
import Downshift from "downshift";
|
33
31
|
import cx from "classnames";
|
32
|
+
import Downshift from "downshift";
|
33
|
+
import { Component } from "react";
|
34
|
+
import { createPortal } from "react-dom";
|
34
35
|
import { X } from "react-feather";
|
35
|
-
import
|
36
|
-
import pluralize from "../utils/pluralize";
|
37
|
-
import uniqBy from "../utils/uniqBy";
|
38
|
-
import Card from "../Card";
|
36
|
+
import { Popper } from "react-popper";
|
39
37
|
import Button from "../Button";
|
38
|
+
import Card from "../Card";
|
39
|
+
import { FieldStateContext } from "../Field/FieldStateContext";
|
40
|
+
import { SatelliteContext } from "../Satellite";
|
40
41
|
import ScrollIndicator from "../ScrollIndicator";
|
42
|
+
import stl from "../styles/helpers/satellitePrefixer";
|
41
43
|
import Tag from "../Tag";
|
42
|
-
import
|
43
|
-
import { defaultCreateFromInputValue, isAutoCompleteMultiProps } from "./utils";
|
44
|
-
import DefaultOptionItem from "./components/DefaultOptionItem";
|
44
|
+
import uniqBy from "../utils/uniqBy";
|
45
45
|
import AutoCompleteEmptyState from "./components/AutoCompleteEmptyState";
|
46
|
+
import DefaultOptionItem from "./components/DefaultOptionItem";
|
47
|
+
import { DEFAULT_AUTOCOMPLETE_LOCALE, defaultCreateFromInputValue, isAutoCompleteMultiProps } from "./utils";
|
48
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
49
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
46
50
|
|
47
51
|
function optionToString(option) {
|
48
52
|
return option ? option.label : "";
|
@@ -105,9 +109,25 @@ var MENU_POPPER_MODFIERS = [{
|
|
105
109
|
}
|
106
110
|
}];
|
107
111
|
var BACKSPACE_KEY_CODE = 8;
|
108
|
-
|
109
|
-
|
110
|
-
|
112
|
+
|
113
|
+
/** @ignore */
|
114
|
+
var DefaultEmptyState = function DefaultEmptyState(_ref) {
|
115
|
+
var emptyStateTitle = _ref.emptyStateTitle;
|
116
|
+
return /*#__PURE__*/_jsx(AutoCompleteEmptyState, {
|
117
|
+
title: emptyStateTitle
|
118
|
+
});
|
119
|
+
};
|
120
|
+
|
121
|
+
var DefaultOption = function DefaultOption(_ref2) {
|
122
|
+
var optionItemPrefix = _ref2.optionItemPrefix,
|
123
|
+
props = _objectWithoutProperties(_ref2, _excluded);
|
124
|
+
|
125
|
+
return /*#__PURE__*/_jsx(DefaultOptionItem, _objectSpread(_objectSpread({}, props), {}, {
|
126
|
+
locale: {
|
127
|
+
optionItemPrefix: optionItemPrefix !== null && optionItemPrefix !== void 0 ? optionItemPrefix : DEFAULT_AUTOCOMPLETE_LOCALE.optionItemPrefix
|
128
|
+
}
|
129
|
+
}));
|
130
|
+
};
|
111
131
|
/**
|
112
132
|
* 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.
|
113
133
|
*
|
@@ -125,6 +145,7 @@ var defaultEmptyState = /*#__PURE__*/React.createElement(AutoCompleteEmptyState,
|
|
125
145
|
* - Style different data
|
126
146
|
*/
|
127
147
|
|
148
|
+
|
128
149
|
export var AutoComplete = /*#__PURE__*/function (_Component) {
|
129
150
|
_inherits(AutoComplete, _Component);
|
130
151
|
|
@@ -312,6 +333,22 @@ export var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
312
333
|
_this.props.onChange(newOptions);
|
313
334
|
});
|
314
335
|
|
336
|
+
_defineProperty(_assertThisInitialized(_this), "getA11yStatusMessage", function (options) {
|
337
|
+
if (!options.isOpen) {
|
338
|
+
return "";
|
339
|
+
}
|
340
|
+
|
341
|
+
if (!options.resultCount) {
|
342
|
+
return _this.locale.emptyStateTitle;
|
343
|
+
}
|
344
|
+
|
345
|
+
if (options.resultCount > 0) {
|
346
|
+
return _this.locale.itemsAvailable(options.resultCount);
|
347
|
+
}
|
348
|
+
|
349
|
+
return "";
|
350
|
+
});
|
351
|
+
|
315
352
|
_defineProperty(_assertThisInitialized(_this), "renderInput", function (results, autocompleteHelpers, fieldState) {
|
316
353
|
var _this$props3 = _this.props,
|
317
354
|
id = _this$props3.id,
|
@@ -373,45 +410,50 @@ export var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
373
410
|
autoComplete: "off",
|
374
411
|
autoFocus: autoFocus
|
375
412
|
});
|
376
|
-
return /*#__PURE__*/
|
413
|
+
return /*#__PURE__*/_jsxs("div", {
|
377
414
|
className: inputContainerClassName,
|
378
415
|
onClick: _this.handleFakeInputClick,
|
379
|
-
ref: _this.handleInputContainerRefUpdate
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
416
|
+
ref: _this.handleInputContainerRefUpdate,
|
417
|
+
children: [Icon && /*#__PURE__*/_jsx(Icon, {
|
418
|
+
className: stl(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["mr-4 shrink-0 ", ""])), disabled ? "text-grey-200" : inputFocused ? "text-accent-600" : "text-grey-500"),
|
419
|
+
size: "1rem"
|
420
|
+
}), /*#__PURE__*/_jsxs("div", {
|
421
|
+
className: cx(stl(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["flex items-center flex-1 ", " ", ""])), !noWrap && "flex-wrap", multiple && "-ml-1"), valuesClassName),
|
422
|
+
children: [multiple && Array.isArray(value) && value.map(function (option) {
|
423
|
+
return renderValueTemplate ? renderValueTemplate({
|
424
|
+
option: option,
|
425
|
+
key: String(option.value),
|
426
|
+
editable: !disabled
|
427
|
+
}) : /*#__PURE__*/_jsx(Tag, {
|
428
|
+
onDelete: disabled ? undefined : function () {
|
429
|
+
return _this.removeValue(option);
|
430
|
+
},
|
431
|
+
className: stl(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["m-1 max-w-48 ", ""])), disabled && "opacity-50"),
|
432
|
+
children: option.label
|
433
|
+
}, String(option.value));
|
434
|
+
}), shouldRenderCustomTemplate && renderValueTemplate({
|
435
|
+
option: value,
|
436
|
+
key: String(value),
|
437
|
+
editable: !disabled
|
438
|
+
}), /*#__PURE__*/_jsx("input", _objectSpread(_objectSpread({}, inputProps), {}, {
|
439
|
+
"data-lpignore": true
|
440
|
+
}))]
|
441
|
+
}), (showClearButton || endItem) && /*#__PURE__*/_jsxs("div", {
|
442
|
+
className: cx(showClearButton && endItem && stl(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["my-2 flex self-end space-x-4"])))),
|
443
|
+
children: [endItem && /*#__PURE__*/_jsx("div", {
|
444
|
+
className: stl(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["text-grey-700 my-auto"]))),
|
445
|
+
children: endItem
|
446
|
+
}), showClearButton && /*#__PURE__*/_jsx("button", {
|
447
|
+
type: "button",
|
448
|
+
className: stl(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["w-6 flex items-center justify-center text-grey-500"]))),
|
449
|
+
onClick: _this.handleClearClick,
|
450
|
+
"aria-label": _this.locale.clearInputButton,
|
451
|
+
children: /*#__PURE__*/_jsx(X, {
|
452
|
+
size: ".75rem"
|
453
|
+
})
|
454
|
+
})]
|
455
|
+
})]
|
456
|
+
});
|
415
457
|
});
|
416
458
|
|
417
459
|
_defineProperty(_assertThisInitialized(_this), "renderMenu", function (results, autocompleteHelpers) {
|
@@ -422,12 +464,17 @@ export var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
422
464
|
highlightedIndex = autocompleteHelpers.highlightedIndex,
|
423
465
|
inputValue = autocompleteHelpers.inputValue,
|
424
466
|
isOpen = autocompleteHelpers.isOpen;
|
467
|
+
|
468
|
+
var defaultEmptyState = /*#__PURE__*/_jsx(DefaultEmptyState, {
|
469
|
+
emptyStateTitle: _this.locale.emptyStateTitle
|
470
|
+
});
|
471
|
+
|
425
472
|
var _this$props4 = _this.props,
|
426
473
|
menuClassName = _this$props4.menuClassName,
|
427
474
|
menuSize = _this$props4.menuSize,
|
428
|
-
_this$props4$emptySta = _this$props4.emptyState,
|
429
|
-
emptyState = _this$props4$emptySta === void 0 ? AutoComplete.defaultProps.emptyState : _this$props4$emptySta,
|
430
475
|
menuFooter = _this$props4.menuFooter,
|
476
|
+
_this$props4$emptySta = _this$props4.emptyState,
|
477
|
+
emptyState = _this$props4$emptySta === void 0 ? defaultEmptyState : _this$props4$emptySta,
|
431
478
|
_this$props4$maxResul = _this$props4.maxResults,
|
432
479
|
maxResults = _this$props4$maxResul === void 0 ? AutoComplete.defaultProps.maxResults : _this$props4$maxResul,
|
433
480
|
_this$props4$multiple = _this$props4.multiple,
|
@@ -451,49 +498,60 @@ export var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
451
498
|
var showResults = results.length > 0;
|
452
499
|
|
453
500
|
if (!isOpen || !showResults && !shouldShowEmptyState && !shouldShowDefaultEmptyState) {
|
454
|
-
return /*#__PURE__*/
|
501
|
+
return /*#__PURE__*/_jsx("ul", _objectSpread(_objectSpread({}, getMenuProps()), {}, {
|
455
502
|
className: stl(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["hidden h-0"])))
|
456
503
|
}));
|
457
504
|
}
|
458
505
|
|
459
|
-
return /*#__PURE__*/
|
506
|
+
return /*#__PURE__*/_jsx(Popper, {
|
460
507
|
placement: "bottom-start",
|
461
508
|
strategy: "fixed",
|
462
509
|
referenceElement: (_this$inputContainerR3 = _this.inputContainerRef) !== null && _this$inputContainerR3 !== void 0 ? _this$inputContainerR3 : undefined,
|
463
|
-
modifiers: MENU_POPPER_MODFIERS
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
510
|
+
modifiers: MENU_POPPER_MODFIERS,
|
511
|
+
children: function children(popper) {
|
512
|
+
return /*#__PURE__*/_jsx("div", {
|
513
|
+
className: cx(stl(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["z-dropdown"]))), menuClassName),
|
514
|
+
style: _objectSpread(_objectSpread({}, popper.style), dropdownStyle),
|
515
|
+
"data-popper-placement": popper.placement,
|
516
|
+
ref: popper.ref,
|
517
|
+
children: /*#__PURE__*/_jsxs(Card, {
|
518
|
+
fullBleed: true,
|
519
|
+
elevation: "300",
|
520
|
+
children: [results.length === 0 ? /*#__PURE__*/_jsx("div", _objectSpread(_objectSpread({}, getMenuProps()), {}, {
|
521
|
+
className: stl(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["min-h-10"]))),
|
522
|
+
children: emptyState
|
523
|
+
})) : /*#__PURE__*/_jsx(ScrollIndicator, {
|
524
|
+
className: menuSize === "large" ? stl(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["max-h-96"]))) : stl(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["max-h-64"]))),
|
525
|
+
children: /*#__PURE__*/_jsxs("ul", _objectSpread(_objectSpread({}, getMenuProps()), {}, {
|
526
|
+
children: [results.slice(0, showAllResults ? Number.MAX_SAFE_INTEGER : maxResults).map(function (result, index) {
|
527
|
+
return /*#__PURE__*/_jsx("li", _objectSpread(_objectSpread({}, getItemProps({
|
528
|
+
item: result,
|
529
|
+
disabled: result.disabled,
|
530
|
+
className: stl(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["\n autocomplete-result\n flex items-center min-h-10 px-4 cursor-pointer\n ", "\n ", "\n "])), index === highlightedIndex && "bg-grey-100", result.disabled && "cursor-not-allowed")
|
531
|
+
})), {}, {
|
532
|
+
children: /*#__PURE__*/_jsx(OptionItem, _objectSpread(_objectSpread({}, optionItemProps), {}, {
|
533
|
+
highlighted: index === highlightedIndex,
|
534
|
+
option: result,
|
535
|
+
optionItemPrefix: _this.locale.optionItemPrefix
|
536
|
+
}))
|
537
|
+
}), result.value);
|
538
|
+
}), extraResults > 0 && !showAllResults && /*#__PURE__*/_jsx("li", {
|
539
|
+
className: stl(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["p-2 text-right"]))),
|
540
|
+
children: /*#__PURE__*/_jsx(Button, {
|
541
|
+
variant: "subtle",
|
542
|
+
size: "small",
|
543
|
+
onMouseDown: _this.handleShowAllResults,
|
544
|
+
children: _this.locale.showMoreButton(extraResults)
|
545
|
+
})
|
546
|
+
})]
|
547
|
+
}))
|
548
|
+
}), menuFooter && /*#__PURE__*/_jsx("footer", {
|
549
|
+
className: stl(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["flex items-center justify-center min-h-12 p-4 bg-grey-100 border-t border-grey-200 text-grey-600"]))),
|
550
|
+
children: menuFooter
|
551
|
+
})]
|
552
|
+
})
|
553
|
+
});
|
554
|
+
}
|
497
555
|
});
|
498
556
|
});
|
499
557
|
|
@@ -513,9 +571,10 @@ export var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
513
571
|
results.unshift.apply(results, _toConsumableArray(createFromInputValue(options, inputValue)));
|
514
572
|
}
|
515
573
|
|
516
|
-
return /*#__PURE__*/
|
517
|
-
className: className
|
518
|
-
|
574
|
+
return /*#__PURE__*/_jsxs("div", {
|
575
|
+
className: className,
|
576
|
+
children: [_this.renderInput(results, autocompleteHelpers, fieldState), _this.inputContainerRef && /*#__PURE__*/createPortal(_this.renderMenu(results, autocompleteHelpers), document.body)]
|
577
|
+
});
|
519
578
|
});
|
520
579
|
|
521
580
|
return _this;
|
@@ -537,29 +596,38 @@ export var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
537
596
|
});
|
538
597
|
}
|
539
598
|
}
|
599
|
+
}, {
|
600
|
+
key: "locale",
|
601
|
+
get: function get() {
|
602
|
+
return _objectSpread(_objectSpread(_objectSpread({}, DEFAULT_AUTOCOMPLETE_LOCALE), this.context["locales"]), this.props.locale);
|
603
|
+
}
|
540
604
|
}, {
|
541
605
|
key: "render",
|
542
606
|
value: function render() {
|
543
607
|
var _this2 = this;
|
544
608
|
|
545
609
|
var inputValue = (this.props.inputValue !== undefined ? this.props.inputValue : this.state.inputValue) || "";
|
546
|
-
return /*#__PURE__*/
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
610
|
+
return /*#__PURE__*/_jsx(FieldStateContext.Consumer, {
|
611
|
+
children: function children(fieldState) {
|
612
|
+
return /*#__PURE__*/_jsx(Downshift, {
|
613
|
+
inputValue: inputValue
|
614
|
+
/*
|
615
|
+
* See https://github.com/algolia/AlgoliaWeb/issues/9045
|
616
|
+
* See multi-select example
|
617
|
+
* https://github.com/downshift-js/downshift#examples
|
618
|
+
* 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
|
619
|
+
*/
|
620
|
+
,
|
621
|
+
selectedItem: null,
|
622
|
+
getA11yStatusMessage: _this2.getA11yStatusMessage,
|
623
|
+
onChange: _this2.handleChange,
|
624
|
+
itemToString: optionToString,
|
625
|
+
defaultHighlightedIndex: 0,
|
626
|
+
children: function children(autocompleteHelpers) {
|
627
|
+
return _this2.renderSelect(autocompleteHelpers, fieldState);
|
628
|
+
}
|
629
|
+
});
|
630
|
+
}
|
563
631
|
});
|
564
632
|
}
|
565
633
|
}]);
|
@@ -567,17 +635,18 @@ export var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
567
635
|
return AutoComplete;
|
568
636
|
}(Component);
|
569
637
|
|
638
|
+
_defineProperty(AutoComplete, "contextType", SatelliteContext);
|
639
|
+
|
570
640
|
_defineProperty(AutoComplete, "defaultProps", {
|
571
641
|
clearable: false,
|
572
642
|
creatable: false,
|
573
643
|
multiple: false,
|
574
644
|
maxResults: 7,
|
575
|
-
emptyState: defaultEmptyState,
|
576
645
|
createFromInputValue: defaultCreateFromInputValue,
|
577
646
|
options: [],
|
578
647
|
separatorKeyCodes: [],
|
579
648
|
separatorKeys: [],
|
580
|
-
optionItemComponent:
|
649
|
+
optionItemComponent: DefaultOption,
|
581
650
|
noWrap: false
|
582
651
|
});
|
583
652
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
export = autoCompletePlugin;
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
2
|
+
declare const autoCompletePlugin: {
|
3
|
+
handler: import("tailwindcss/types/config").PluginCreator;
|
4
|
+
config?: import("tailwindcss").Config | undefined;
|
5
|
+
};
|
@@ -1,13 +1,11 @@
|
|
1
1
|
import _rgba from "../styles/rgba";
|
2
2
|
import _disabledColor from "../styles/disabledColor";
|
3
|
+
import _plugin from "tailwindcss/plugin";
|
3
4
|
// @ts-check
|
5
|
+
var plugin = _plugin;
|
4
6
|
var disabledColor = _disabledColor;
|
5
7
|
var rgba = _rgba;
|
6
|
-
|
7
|
-
* @type {import('../tailwind-types').TailwindPlugin}
|
8
|
-
*/
|
9
|
-
|
10
|
-
var autoCompletePlugin = function autoCompletePlugin(_ref) {
|
8
|
+
var autoCompletePlugin = plugin(function (_ref) {
|
11
9
|
var addComponents = _ref.addComponents,
|
12
10
|
theme = _ref.theme;
|
13
11
|
addComponents({
|
@@ -30,14 +28,14 @@ var autoCompletePlugin = function autoCompletePlugin(_ref) {
|
|
30
28
|
"&::after": {
|
31
29
|
content: '" "',
|
32
30
|
display: "block",
|
33
|
-
minHeight:
|
31
|
+
minHeight: "30px",
|
34
32
|
// don't ask me why 30
|
35
|
-
fontSize:
|
33
|
+
fontSize: "0px"
|
36
34
|
},
|
37
35
|
"&.autocomplete-large": {
|
38
36
|
minHeight: "3rem",
|
39
37
|
"&::after": {
|
40
|
-
minHeight:
|
38
|
+
minHeight: "38px" // don't ask me why 38
|
41
39
|
|
42
40
|
}
|
43
41
|
}
|
@@ -67,12 +65,12 @@ var autoCompletePlugin = function autoCompletePlugin(_ref) {
|
|
67
65
|
scrollbarWidth: "none",
|
68
66
|
msOverflowStyle: "-ms-autohiding-scrollbar",
|
69
67
|
"&::-webkit-scrollbar": {
|
70
|
-
width:
|
71
|
-
height:
|
68
|
+
width: "0px",
|
69
|
+
height: "0px"
|
72
70
|
}
|
73
71
|
},
|
74
72
|
".autocomplete-input": {
|
75
|
-
flex: 1,
|
73
|
+
flex: "1",
|
76
74
|
backgroundColor: "transparent",
|
77
75
|
caretColor: theme("colors.grey.600"),
|
78
76
|
color: theme("colors.grey.900"),
|
@@ -92,6 +90,5 @@ var autoCompletePlugin = function autoCompletePlugin(_ref) {
|
|
92
90
|
}
|
93
91
|
}
|
94
92
|
});
|
95
|
-
};
|
96
|
-
|
93
|
+
});
|
97
94
|
export default autoCompletePlugin;
|