@algolia/satellite 1.0.0-beta.130 → 1.0.0-beta.133
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.d.ts +3 -2
- package/cjs/AnnouncementBadge/AnnouncementBadge.js +13 -7
- package/cjs/AutoComplete/AutoComplete.d.ts +28 -17
- package/cjs/AutoComplete/AutoComplete.js +204 -124
- 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 +4 -4
- package/cjs/Avatars/ApplicationAvatar.js +6 -5
- 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 +4 -4
- package/cjs/Banner/Banner.js +30 -25
- package/cjs/Banners/Alert/Alert.d.ts +4 -4
- package/cjs/Banners/Alert/Alert.js +29 -23
- package/cjs/Banners/BigBertha/BigBertha.d.ts +2 -2
- package/cjs/Banners/BigBertha/BigBertha.js +11 -9
- package/cjs/Banners/Promote/Promote.d.ts +5 -5
- package/cjs/Banners/Promote/Promote.js +38 -30
- package/cjs/Button/Button.js +23 -17
- package/cjs/Button/ButtonGroup.d.ts +1 -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/components/CardHeader.js +8 -4
- package/cjs/Card/components/CardTitle.d.ts +1 -1
- 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/ClickAwayContainer/ClickAwayContainer.d.ts +2 -2
- package/cjs/ClickAwayContainer/ClickAwayContainer.js +6 -9
- package/cjs/DatePicker/DatePicker/DatePicker.d.ts +13 -19
- package/cjs/DatePicker/DatePicker/DatePicker.js +84 -63
- package/cjs/DatePicker/DatePicker/datePickerReducer.d.ts +2 -2
- package/cjs/DatePicker/DatePicker/datePickerReducer.js +2 -2
- package/cjs/DatePicker/DateRangePicker/DateRangePicker.d.ts +11 -17
- package/cjs/DatePicker/DateRangePicker/DateRangePicker.js +89 -69
- package/cjs/DatePicker/DateRangePicker/DateRangePickerDisplay.d.ts +3 -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 +5 -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 +3 -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 +6 -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/DatePicker/types.js +5 -0
- package/cjs/Dropdown/Dropdown.d.ts +8 -8
- package/cjs/Dropdown/Dropdown.js +49 -40
- package/cjs/Dropdown/DropdownButton.d.ts +3 -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 +1 -1
- 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 +2 -2
- package/cjs/Dropzone/Dropzone.js +58 -53
- package/cjs/EmptyState/EmptyState.d.ts +1 -1
- package/cjs/EmptyState/EmptyState.js +29 -22
- package/cjs/EmptyState/types.d.ts +7 -7
- package/cjs/Field/Field.d.ts +3 -3
- package/cjs/Field/Field.js +33 -26
- package/cjs/Flag/Flag.d.ts +2 -2
- package/cjs/Flag/Flag.js +45 -40
- package/cjs/Flag/Flags.d.ts +3 -3
- package/cjs/Flag/Flags.js +32 -22
- package/cjs/Flag/types.d.ts +4 -4
- package/cjs/FlexGrid/FlexGrid.d.ts +1 -1
- package/cjs/FlexGrid/FlexGrid.js +15 -9
- package/cjs/FlexGrid/FlexGrid.tailwind.js +2 -2
- package/cjs/HelpUnderline/HelpUnderline.d.ts +2 -1
- package/cjs/HelpUnderline/HelpUnderline.js +9 -7
- package/cjs/Input/Input.d.ts +5 -5
- package/cjs/Input/Input.js +119 -114
- package/cjs/Input/Input.tailwind.js +0 -3
- package/cjs/Insert/Insert.d.ts +2 -2
- package/cjs/Insert/Insert.js +29 -23
- package/cjs/KeyboardKey/KeyboardKey.d.ts +7 -0
- package/cjs/KeyboardKey/KeyboardKey.js +47 -0
- package/cjs/KeyboardKey/KeyboardKey.tailwind.d.ts +5 -0
- package/cjs/KeyboardKey/KeyboardKey.tailwind.js +33 -0
- package/cjs/KeyboardKey/index.d.ts +2 -0
- package/cjs/KeyboardKey/index.js +26 -0
- 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/Modal/Modal.d.ts +7 -5
- package/cjs/Modal/Modal.js +64 -40
- package/cjs/Modal/components/ModalFooter.d.ts +2 -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 +12 -0
- package/cjs/Pagination/CompactPagination/CompactPagination.js +40 -38
- package/cjs/Pagination/DotPagination/DotPagination.d.ts +4 -1
- package/cjs/Pagination/DotPagination/DotPagination.js +21 -17
- package/cjs/Pagination/Pagination/Pagination.d.ts +7 -1
- package/cjs/Pagination/Pagination/Pagination.js +62 -49
- package/cjs/ProgressBar/ProgressBar.d.ts +2 -2
- package/cjs/ProgressBar/ProgressBar.js +16 -11
- package/cjs/ProgressSpinner/ProgressSpinner.d.ts +2 -2
- package/cjs/ProgressSpinner/ProgressSpinner.js +21 -11
- package/cjs/RadioGroup/RadioButton.d.ts +3 -3
- package/cjs/RadioGroup/RadioButton.js +8 -8
- package/cjs/RadioGroup/RadioGroup.d.ts +3 -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/Satellite/Satellite.d.ts +2 -2
- package/cjs/Satellite/Satellite.js +6 -5
- package/cjs/Satellite/SatelliteContext.js +2 -2
- package/cjs/Satellite/SatelliteRouter.d.ts +1 -1
- package/cjs/ScrollIndicator/ScrollIndicator.d.ts +5 -3
- package/cjs/ScrollIndicator/ScrollIndicator.js +13 -16
- package/cjs/Select/Select.d.ts +3 -3
- package/cjs/Select/Select.js +8 -8
- package/cjs/Sidebar/Sidebar.d.ts +6 -4
- package/cjs/Sidebar/Sidebar.js +18 -10
- 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 +3 -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/SwitchOption.d.ts +1 -1
- package/cjs/Switch/SwitchOption.js +24 -16
- package/cjs/Tables/DataTable/DataTable.d.ts +15 -5
- package/cjs/Tables/DataTable/DataTable.js +62 -60
- package/cjs/Tables/DataTable/components/Body.d.ts +6 -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/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/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 +7 -4
- package/cjs/Tag/Tag.js +24 -20
- package/cjs/TextArea/TextArea.d.ts +3 -3
- package/cjs/TextArea/TextArea.js +8 -8
- package/cjs/TextWrap/TextWrap.js +20 -20
- package/cjs/Toggle/Toggle.d.ts +3 -3
- package/cjs/Toggle/Toggle.js +23 -21
- 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/TooltipWrapper.d.ts +3 -3
- package/cjs/Tooltip/TooltipWrapper.js +47 -39
- package/cjs/Tooltip/types.d.ts +2 -2
- package/cjs/Typography/Typography.tailwind.js +2 -2
- package/cjs/UserContent/UserContent.js +3 -3
- package/cjs/UserContent/UserContent.tailwind.js +2 -4
- package/cjs/index.d.ts +1 -0
- package/cjs/index.js +14 -0
- package/cjs/styles/tailwind.config.js +3 -3
- package/cjs/tailwind-types.d.ts +1 -1
- package/cjs/types.d.ts +3 -3
- package/cjs/utilities/utilities.tailwind.d.ts +2 -0
- package/cjs/utilities/utilities.tailwind.js +32 -0
- 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 +3 -2
- package/esm/AnnouncementBadge/AnnouncementBadge.js +12 -6
- package/esm/AutoComplete/AutoComplete.d.ts +28 -17
- package/esm/AutoComplete/AutoComplete.js +208 -116
- 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 +4 -4
- package/esm/Avatars/ApplicationAvatar.js +5 -4
- 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 +4 -4
- package/esm/Banner/Banner.js +31 -25
- package/esm/Banners/Alert/Alert.d.ts +4 -4
- package/esm/Banners/Alert/Alert.js +30 -23
- package/esm/Banners/BigBertha/BigBertha.d.ts +2 -2
- package/esm/Banners/BigBertha/BigBertha.js +11 -8
- package/esm/Banners/Promote/Promote.d.ts +5 -5
- package/esm/Banners/Promote/Promote.js +37 -28
- package/esm/Button/Button.js +23 -16
- package/esm/Button/ButtonGroup.d.ts +1 -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/components/CardHeader.js +8 -3
- package/esm/Card/components/CardTitle.d.ts +1 -1
- 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/ClickAwayContainer/ClickAwayContainer.d.ts +2 -2
- package/esm/ClickAwayContainer/ClickAwayContainer.js +6 -4
- package/esm/DatePicker/DatePicker/DatePicker.d.ts +13 -19
- package/esm/DatePicker/DatePicker/DatePicker.js +87 -59
- package/esm/DatePicker/DatePicker/datePickerReducer.d.ts +2 -2
- package/esm/DatePicker/DatePicker/datePickerReducer.js +2 -2
- package/esm/DatePicker/DateRangePicker/DateRangePicker.d.ts +11 -17
- package/esm/DatePicker/DateRangePicker/DateRangePicker.js +95 -67
- package/esm/DatePicker/DateRangePicker/DateRangePickerDisplay.d.ts +3 -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 +5 -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 +3 -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 +6 -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/DatePicker/types.js +1 -0
- package/esm/Dropdown/Dropdown.d.ts +8 -8
- package/esm/Dropdown/Dropdown.js +45 -30
- package/esm/Dropdown/DropdownButton.d.ts +3 -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 +1 -1
- 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 +2 -2
- package/esm/Dropzone/Dropzone.js +58 -47
- package/esm/EmptyState/EmptyState.d.ts +1 -1
- package/esm/EmptyState/EmptyState.js +29 -21
- package/esm/EmptyState/types.d.ts +7 -7
- package/esm/Field/Field.d.ts +3 -3
- package/esm/Field/Field.js +33 -25
- package/esm/Flag/Flag.d.ts +2 -2
- package/esm/Flag/Flag.js +44 -33
- package/esm/Flag/Flags.d.ts +3 -3
- package/esm/Flag/Flags.js +30 -21
- package/esm/Flag/types.d.ts +4 -4
- package/esm/FlexGrid/FlexGrid.d.ts +1 -1
- package/esm/FlexGrid/FlexGrid.js +13 -8
- package/esm/FlexGrid/FlexGrid.tailwind.js +2 -2
- package/esm/HelpUnderline/HelpUnderline.d.ts +2 -1
- package/esm/HelpUnderline/HelpUnderline.js +8 -6
- package/esm/Input/Input.d.ts +5 -5
- package/esm/Input/Input.js +119 -108
- package/esm/Input/Input.tailwind.js +0 -3
- package/esm/Insert/Insert.d.ts +2 -2
- package/esm/Insert/Insert.js +28 -21
- package/esm/KeyboardKey/KeyboardKey.d.ts +7 -0
- package/esm/KeyboardKey/KeyboardKey.js +30 -0
- package/esm/KeyboardKey/KeyboardKey.tailwind.d.ts +5 -0
- package/esm/KeyboardKey/KeyboardKey.tailwind.js +31 -0
- package/esm/KeyboardKey/index.d.ts +2 -0
- package/esm/KeyboardKey/index.js +2 -0
- 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/Modal/Modal.d.ts +7 -5
- package/esm/Modal/Modal.js +65 -35
- package/esm/Modal/components/ModalFooter.d.ts +2 -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 +12 -0
- package/esm/Pagination/CompactPagination/CompactPagination.js +41 -38
- package/esm/Pagination/DotPagination/DotPagination.d.ts +4 -1
- package/esm/Pagination/DotPagination/DotPagination.js +20 -16
- package/esm/Pagination/Pagination/Pagination.d.ts +7 -1
- package/esm/Pagination/Pagination/Pagination.js +63 -48
- package/esm/ProgressBar/ProgressBar.d.ts +2 -2
- package/esm/ProgressBar/ProgressBar.js +16 -10
- package/esm/ProgressSpinner/ProgressSpinner.d.ts +2 -2
- package/esm/ProgressSpinner/ProgressSpinner.js +21 -10
- package/esm/RadioGroup/RadioButton.d.ts +3 -3
- package/esm/RadioGroup/RadioButton.js +9 -3
- package/esm/RadioGroup/RadioGroup.d.ts +3 -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/Satellite/Satellite.d.ts +2 -2
- package/esm/Satellite/Satellite.js +5 -4
- package/esm/Satellite/SatelliteContext.js +2 -2
- package/esm/Satellite/SatelliteRouter.d.ts +1 -1
- package/esm/ScrollIndicator/ScrollIndicator.d.ts +5 -3
- package/esm/ScrollIndicator/ScrollIndicator.js +12 -10
- package/esm/Select/Select.d.ts +3 -3
- package/esm/Select/Select.js +8 -3
- package/esm/Sidebar/Sidebar.d.ts +6 -4
- package/esm/Sidebar/Sidebar.js +16 -8
- 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 +3 -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/SwitchOption.d.ts +1 -1
- package/esm/Switch/SwitchOption.js +24 -15
- package/esm/Tables/DataTable/DataTable.d.ts +15 -5
- package/esm/Tables/DataTable/DataTable.js +61 -53
- package/esm/Tables/DataTable/components/Body.d.ts +6 -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/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/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 +7 -4
- package/esm/Tag/Tag.js +25 -15
- package/esm/TextArea/TextArea.d.ts +3 -3
- package/esm/TextArea/TextArea.js +9 -3
- package/esm/TextWrap/TextWrap.js +22 -17
- package/esm/Toggle/Toggle.d.ts +3 -3
- package/esm/Toggle/Toggle.js +25 -16
- 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/TooltipWrapper.d.ts +3 -3
- package/esm/Tooltip/TooltipWrapper.js +48 -33
- package/esm/Tooltip/types.d.ts +2 -2
- package/esm/Typography/Typography.tailwind.js +2 -2
- package/esm/UserContent/UserContent.js +2 -2
- package/esm/UserContent/UserContent.tailwind.js +2 -4
- package/esm/index.d.ts +1 -0
- package/esm/index.js +1 -0
- package/esm/styles/tailwind.config.js +3 -3
- package/esm/tailwind-types.d.ts +1 -1
- package/esm/types.d.ts +3 -3
- package/esm/utilities/utilities.tailwind.d.ts +2 -0
- package/esm/utilities/utilities.tailwind.js +27 -0
- 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 +4 -4
- package/satellite.css +37 -4
- package/satellite.min.css +1 -1
@@ -1,13 +1,17 @@
|
|
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";
|
10
13
|
import stl from "../styles/helpers/satellitePrefixer";
|
14
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
11
15
|
var DEFAULT_CLASSNAME = stl(_templateObject || (_templateObject = _taggedTemplateLiteral(["capitalize inline-block rounded-full text-white select-none"])));
|
12
16
|
var SIZE_CLASSNAMES = {
|
13
17
|
"default": stl(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["display-body h-6 leading-md px-2"]))),
|
@@ -20,11 +24,13 @@ export var AnnouncementBadge = function AnnouncementBadge(_ref) {
|
|
20
24
|
text = _ref$text === void 0 ? "new" : _ref$text,
|
21
25
|
variantProp = _ref.variant,
|
22
26
|
className = _ref.className,
|
27
|
+
locale = _ref.locale,
|
23
28
|
props = _objectWithoutProperties(_ref, _excluded);
|
24
29
|
|
25
30
|
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
|
-
|
31
|
+
return /*#__PURE__*/_jsx("span", _objectSpread(_objectSpread({}, props), {}, {
|
32
|
+
className: cx(DEFAULT_CLASSNAME, variant === "red" ? stl(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["bg-red-600"]))) : stl(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["bg-accent-600"]))), SIZE_CLASSNAMES[size], className),
|
33
|
+
children: locale || text
|
34
|
+
}));
|
29
35
|
};
|
30
36
|
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
|
+
locale?: AutoCompleteLocale;
|
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,44 @@ 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> {
|
28
32
|
static defaultProps: {
|
29
33
|
clearable: boolean;
|
30
34
|
creatable: boolean;
|
31
35
|
multiple: boolean;
|
32
36
|
maxResults: number;
|
33
|
-
|
34
|
-
createFromInputValue: import("./types").CreateFromInputValue;
|
37
|
+
createFromInputValue: <T_1 extends Option = Option>(options: T_1[] | undefined, inputValue: string) => Option[];
|
35
38
|
options: never[];
|
36
39
|
separatorKeyCodes: never[];
|
37
40
|
separatorKeys: never[];
|
38
|
-
optionItemComponent:
|
41
|
+
optionItemComponent: ({ locale, ...props }: DefaultOptionProps) => JSX.Element;
|
39
42
|
noWrap: boolean;
|
43
|
+
locale: {
|
44
|
+
clearInputButton: string;
|
45
|
+
emptyStateTitle: string;
|
46
|
+
itemsAvailable: (resultCount: number) => string;
|
47
|
+
showMoreButton: (extraResults: number) => string;
|
48
|
+
optionItemPrefix: (multiple: boolean) => "Add" | "Use";
|
49
|
+
};
|
40
50
|
};
|
41
51
|
state: State;
|
42
52
|
inputContainerRef: HTMLDivElement | null;
|
43
53
|
inputRef: HTMLInputElement | null;
|
44
|
-
componentDidUpdate(prevProps: AutoCompleteProps): void;
|
54
|
+
componentDidUpdate(prevProps: AutoCompleteProps<T>): void;
|
45
55
|
handleClearClick: () => void;
|
46
56
|
handleFakeInputClick: () => void | null;
|
47
|
-
handleInputBlur: (state: ControllerStateAndHelpers<Option>) => (evt:
|
48
|
-
handleInputChange: (evt:
|
57
|
+
handleInputBlur: (state: ControllerStateAndHelpers<T | Option>) => (evt: FocusEvent<HTMLInputElement>) => void;
|
58
|
+
handleInputChange: (evt: ChangeEvent<HTMLInputElement>) => void;
|
49
59
|
handleInputContainerRefUpdate: (el: HTMLDivElement | null) => void;
|
50
60
|
updateInputWidth: () => void;
|
51
|
-
handleKeyDown: (state: ControllerStateAndHelpers<Option>) => (evt:
|
52
|
-
handleChange: (option:
|
53
|
-
handleShowAllResults: (evt:
|
54
|
-
removeValue: (removedOption:
|
55
|
-
|
56
|
-
|
57
|
-
|
61
|
+
handleKeyDown: (state: ControllerStateAndHelpers<T | Option>) => (evt: KeyboardEvent<any>) => void;
|
62
|
+
handleChange: (option: T) => void;
|
63
|
+
handleShowAllResults: (evt: MouseEvent<HTMLButtonElement>) => void;
|
64
|
+
removeValue: (removedOption: T) => void;
|
65
|
+
getA11yStatusMessage: (options: A11yStatusMessageOptions<any>) => string;
|
66
|
+
renderInput: (results: T[], autocompleteHelpers: ControllerStateAndHelpers<T | Option>, fieldState: FieldState) => JSX.Element;
|
67
|
+
renderMenu: (results: T[], autocompleteHelpers: ControllerStateAndHelpers<T | Option>) => JSX.Element;
|
68
|
+
renderSelect: (autocompleteHelpers: ControllerStateAndHelpers<T | Option>, fieldState: FieldState) => JSX.Element;
|
58
69
|
render(): JSX.Element;
|
59
70
|
}
|
60
71
|
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 = ["locale"];
|
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
40
|
import ScrollIndicator from "../ScrollIndicator";
|
41
|
+
import stl from "../styles/helpers/satellitePrefixer";
|
41
42
|
import Tag from "../Tag";
|
42
|
-
import
|
43
|
-
import
|
44
|
-
import DefaultOptionItem from "./components/DefaultOptionItem";
|
43
|
+
import pluralize from "../utils/pluralize";
|
44
|
+
import uniqBy from "../utils/uniqBy";
|
45
45
|
import AutoCompleteEmptyState from "./components/AutoCompleteEmptyState";
|
46
|
+
import DefaultOptionItem from "./components/DefaultOptionItem";
|
47
|
+
import { 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,32 @@ 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 _locale$emptyStateTit;
|
116
|
+
|
117
|
+
var locale = _ref.locale;
|
118
|
+
return /*#__PURE__*/_jsx(AutoCompleteEmptyState, {
|
119
|
+
title: (_locale$emptyStateTit = locale === null || locale === void 0 ? void 0 : locale.emptyStateTitle) !== null && _locale$emptyStateTit !== void 0 ? _locale$emptyStateTit : AutoComplete.defaultProps.locale.emptyStateTitle
|
120
|
+
});
|
121
|
+
};
|
122
|
+
|
123
|
+
/** @ignore */
|
124
|
+
var DefaultOption = function DefaultOption(_ref2) {
|
125
|
+
var locale = _ref2.locale,
|
126
|
+
props = _objectWithoutProperties(_ref2, _excluded);
|
127
|
+
|
128
|
+
return /*#__PURE__*/_jsx(DefaultOptionItem, _objectSpread(_objectSpread({}, props), {}, {
|
129
|
+
locale: {
|
130
|
+
optionItemPrefix: function optionItemPrefix(multiple) {
|
131
|
+
var _locale$optionItemPre, _locale$optionItemPre2;
|
132
|
+
|
133
|
+
return (_locale$optionItemPre = locale === null || locale === void 0 ? void 0 : (_locale$optionItemPre2 = locale.optionItemPrefix) === null || _locale$optionItemPre2 === void 0 ? void 0 : _locale$optionItemPre2.call(locale, multiple)) !== null && _locale$optionItemPre !== void 0 ? _locale$optionItemPre : AutoComplete.defaultProps.locale.optionItemPrefix(multiple);
|
134
|
+
}
|
135
|
+
}
|
136
|
+
}));
|
137
|
+
};
|
111
138
|
/**
|
112
139
|
* 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
140
|
*
|
@@ -125,6 +152,7 @@ var defaultEmptyState = /*#__PURE__*/React.createElement(AutoCompleteEmptyState,
|
|
125
152
|
* - Style different data
|
126
153
|
*/
|
127
154
|
|
155
|
+
|
128
156
|
export var AutoComplete = /*#__PURE__*/function (_Component) {
|
129
157
|
_inherits(AutoComplete, _Component);
|
130
158
|
|
@@ -312,7 +340,29 @@ export var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
312
340
|
_this.props.onChange(newOptions);
|
313
341
|
});
|
314
342
|
|
343
|
+
_defineProperty(_assertThisInitialized(_this), "getA11yStatusMessage", function (options) {
|
344
|
+
if (!options.isOpen) {
|
345
|
+
return "";
|
346
|
+
}
|
347
|
+
|
348
|
+
if (!options.resultCount) {
|
349
|
+
var _this$props$locale$em, _this$props$locale;
|
350
|
+
|
351
|
+
return (_this$props$locale$em = (_this$props$locale = _this.props.locale) === null || _this$props$locale === void 0 ? void 0 : _this$props$locale.emptyStateTitle) !== null && _this$props$locale$em !== void 0 ? _this$props$locale$em : "";
|
352
|
+
}
|
353
|
+
|
354
|
+
if (options.resultCount > 0) {
|
355
|
+
var _this$props$locale$it, _this$props$locale2, _this$props$locale2$i;
|
356
|
+
|
357
|
+
return (_this$props$locale$it = (_this$props$locale2 = _this.props.locale) === null || _this$props$locale2 === void 0 ? void 0 : (_this$props$locale2$i = _this$props$locale2.itemsAvailable) === null || _this$props$locale2$i === void 0 ? void 0 : _this$props$locale2$i.call(_this$props$locale2, options.resultCount)) !== null && _this$props$locale$it !== void 0 ? _this$props$locale$it : "";
|
358
|
+
}
|
359
|
+
|
360
|
+
return "";
|
361
|
+
});
|
362
|
+
|
315
363
|
_defineProperty(_assertThisInitialized(_this), "renderInput", function (results, autocompleteHelpers, fieldState) {
|
364
|
+
var _this$props$locale3;
|
365
|
+
|
316
366
|
var _this$props3 = _this.props,
|
317
367
|
id = _this$props3.id,
|
318
368
|
placeholder = _this$props3.placeholder,
|
@@ -373,45 +423,50 @@ export var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
373
423
|
autoComplete: "off",
|
374
424
|
autoFocus: autoFocus
|
375
425
|
});
|
376
|
-
return /*#__PURE__*/
|
426
|
+
return /*#__PURE__*/_jsxs("div", {
|
377
427
|
className: inputContainerClassName,
|
378
428
|
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
|
-
|
429
|
+
ref: _this.handleInputContainerRefUpdate,
|
430
|
+
children: [Icon && /*#__PURE__*/_jsx(Icon, {
|
431
|
+
className: stl(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["mr-4 flex-shrink-0 ", ""])), disabled ? "text-grey-200" : inputFocused ? "text-accent-600" : "text-grey-500"),
|
432
|
+
size: "1rem"
|
433
|
+
}), /*#__PURE__*/_jsxs("div", {
|
434
|
+
className: cx(stl(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["flex items-center flex-1 ", " ", ""])), !noWrap && "flex-wrap", multiple && "-ml-1"), valuesClassName),
|
435
|
+
children: [multiple && Array.isArray(value) && value.map(function (option) {
|
436
|
+
return renderValueTemplate ? renderValueTemplate({
|
437
|
+
option: option,
|
438
|
+
key: String(option.value),
|
439
|
+
editable: !disabled
|
440
|
+
}) : /*#__PURE__*/_jsx(Tag, {
|
441
|
+
onDelete: disabled ? undefined : function () {
|
442
|
+
return _this.removeValue(option);
|
443
|
+
},
|
444
|
+
className: stl(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["m-1 max-w-48 ", ""])), disabled && "opacity-50"),
|
445
|
+
children: option.label
|
446
|
+
}, String(option.value));
|
447
|
+
}), shouldRenderCustomTemplate && renderValueTemplate({
|
448
|
+
option: value,
|
449
|
+
key: String(value),
|
450
|
+
editable: !disabled
|
451
|
+
}), /*#__PURE__*/_jsx("input", _objectSpread(_objectSpread({}, inputProps), {}, {
|
452
|
+
"data-lpignore": true
|
453
|
+
}))]
|
454
|
+
}), (showClearButton || endItem) && /*#__PURE__*/_jsxs("div", {
|
455
|
+
className: cx(showClearButton && endItem && stl(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["my-2 flex self-end space-x-4"])))),
|
456
|
+
children: [endItem && /*#__PURE__*/_jsx("div", {
|
457
|
+
className: stl(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["text-grey-700 my-auto"]))),
|
458
|
+
children: endItem
|
459
|
+
}), showClearButton && /*#__PURE__*/_jsx("button", {
|
460
|
+
type: "button",
|
461
|
+
className: stl(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["w-6 flex items-center justify-center text-grey-500"]))),
|
462
|
+
onClick: _this.handleClearClick,
|
463
|
+
"aria-label": (_this$props$locale3 = _this.props.locale) === null || _this$props$locale3 === void 0 ? void 0 : _this$props$locale3.clearInputButton,
|
464
|
+
children: /*#__PURE__*/_jsx(X, {
|
465
|
+
size: ".75rem"
|
466
|
+
})
|
467
|
+
})]
|
468
|
+
})]
|
469
|
+
});
|
415
470
|
});
|
416
471
|
|
417
472
|
_defineProperty(_assertThisInitialized(_this), "renderMenu", function (results, autocompleteHelpers) {
|
@@ -422,12 +477,17 @@ export var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
422
477
|
highlightedIndex = autocompleteHelpers.highlightedIndex,
|
423
478
|
inputValue = autocompleteHelpers.inputValue,
|
424
479
|
isOpen = autocompleteHelpers.isOpen;
|
480
|
+
|
481
|
+
var defaultEmptyState = /*#__PURE__*/_jsx(DefaultEmptyState, {
|
482
|
+
locale: _this.props.locale
|
483
|
+
});
|
484
|
+
|
425
485
|
var _this$props4 = _this.props,
|
426
486
|
menuClassName = _this$props4.menuClassName,
|
427
487
|
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
488
|
menuFooter = _this$props4.menuFooter,
|
489
|
+
_this$props4$emptySta = _this$props4.emptyState,
|
490
|
+
emptyState = _this$props4$emptySta === void 0 ? defaultEmptyState : _this$props4$emptySta,
|
431
491
|
_this$props4$maxResul = _this$props4.maxResults,
|
432
492
|
maxResults = _this$props4$maxResul === void 0 ? AutoComplete.defaultProps.maxResults : _this$props4$maxResul,
|
433
493
|
_this$props4$multiple = _this$props4.multiple,
|
@@ -451,49 +511,62 @@ export var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
451
511
|
var showResults = results.length > 0;
|
452
512
|
|
453
513
|
if (!isOpen || !showResults && !shouldShowEmptyState && !shouldShowDefaultEmptyState) {
|
454
|
-
return /*#__PURE__*/
|
514
|
+
return /*#__PURE__*/_jsx("ul", _objectSpread(_objectSpread({}, getMenuProps()), {}, {
|
455
515
|
className: stl(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["hidden h-0"])))
|
456
516
|
}));
|
457
517
|
}
|
458
518
|
|
459
|
-
return /*#__PURE__*/
|
519
|
+
return /*#__PURE__*/_jsx(Popper, {
|
460
520
|
placement: "bottom-start",
|
461
521
|
strategy: "fixed",
|
462
522
|
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
|
-
|
523
|
+
modifiers: MENU_POPPER_MODFIERS,
|
524
|
+
children: function children(popper) {
|
525
|
+
var _this$props$locale4, _this$props$locale4$s;
|
526
|
+
|
527
|
+
return /*#__PURE__*/_jsx("div", {
|
528
|
+
className: cx(stl(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["z-dropdown"]))), menuClassName),
|
529
|
+
style: _objectSpread(_objectSpread({}, popper.style), dropdownStyle),
|
530
|
+
"data-popper-placement": popper.placement,
|
531
|
+
ref: popper.ref,
|
532
|
+
children: /*#__PURE__*/_jsxs(Card, {
|
533
|
+
fullBleed: true,
|
534
|
+
elevation: "300",
|
535
|
+
children: [results.length === 0 ? /*#__PURE__*/_jsx("div", _objectSpread(_objectSpread({}, getMenuProps()), {}, {
|
536
|
+
className: stl(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["min-h-10"]))),
|
537
|
+
children: emptyState
|
538
|
+
})) : /*#__PURE__*/_jsx(ScrollIndicator, {
|
539
|
+
className: menuSize === "large" ? stl(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["max-h-96"]))) : stl(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["max-h-64"]))),
|
540
|
+
children: /*#__PURE__*/_jsxs("ul", _objectSpread(_objectSpread({}, getMenuProps()), {}, {
|
541
|
+
children: [results.slice(0, showAllResults ? Number.MAX_SAFE_INTEGER : maxResults).map(function (result, index) {
|
542
|
+
return /*#__PURE__*/_jsx("li", _objectSpread(_objectSpread({}, getItemProps({
|
543
|
+
item: result,
|
544
|
+
disabled: result.disabled,
|
545
|
+
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")
|
546
|
+
})), {}, {
|
547
|
+
children: /*#__PURE__*/_jsx(OptionItem, _objectSpread(_objectSpread({}, optionItemProps), {}, {
|
548
|
+
highlighted: index === highlightedIndex,
|
549
|
+
option: result,
|
550
|
+
locale: _this.props.locale
|
551
|
+
}))
|
552
|
+
}), result.value);
|
553
|
+
}), extraResults > 0 && !showAllResults && /*#__PURE__*/_jsx("li", {
|
554
|
+
className: stl(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["p-2 text-right"]))),
|
555
|
+
children: /*#__PURE__*/_jsx(Button, {
|
556
|
+
variant: "subtle",
|
557
|
+
size: "small",
|
558
|
+
onMouseDown: _this.handleShowAllResults,
|
559
|
+
children: (_this$props$locale4 = _this.props.locale) === null || _this$props$locale4 === void 0 ? void 0 : (_this$props$locale4$s = _this$props$locale4.showMoreButton) === null || _this$props$locale4$s === void 0 ? void 0 : _this$props$locale4$s.call(_this$props$locale4, extraResults)
|
560
|
+
})
|
561
|
+
})]
|
562
|
+
}))
|
563
|
+
}), menuFooter && /*#__PURE__*/_jsx("footer", {
|
564
|
+
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"]))),
|
565
|
+
children: menuFooter
|
566
|
+
})]
|
567
|
+
})
|
568
|
+
});
|
569
|
+
}
|
497
570
|
});
|
498
571
|
});
|
499
572
|
|
@@ -513,9 +586,10 @@ export var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
513
586
|
results.unshift.apply(results, _toConsumableArray(createFromInputValue(options, inputValue)));
|
514
587
|
}
|
515
588
|
|
516
|
-
return /*#__PURE__*/
|
517
|
-
className: className
|
518
|
-
|
589
|
+
return /*#__PURE__*/_jsxs("div", {
|
590
|
+
className: className,
|
591
|
+
children: [_this.renderInput(results, autocompleteHelpers, fieldState), _this.inputContainerRef && /*#__PURE__*/createPortal(_this.renderMenu(results, autocompleteHelpers), document.body)]
|
592
|
+
});
|
519
593
|
});
|
520
594
|
|
521
595
|
return _this;
|
@@ -543,23 +617,27 @@ export var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
543
617
|
var _this2 = this;
|
544
618
|
|
545
619
|
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
|
-
|
620
|
+
return /*#__PURE__*/_jsx(FieldStateContext.Consumer, {
|
621
|
+
children: function children(fieldState) {
|
622
|
+
return /*#__PURE__*/_jsx(Downshift, {
|
623
|
+
inputValue: inputValue
|
624
|
+
/*
|
625
|
+
* See https://github.com/algolia/AlgoliaWeb/issues/9045
|
626
|
+
* See multi-select example
|
627
|
+
* https://github.com/downshift-js/downshift#examples
|
628
|
+
* 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
|
629
|
+
*/
|
630
|
+
,
|
631
|
+
selectedItem: null,
|
632
|
+
getA11yStatusMessage: _this2.getA11yStatusMessage,
|
633
|
+
onChange: _this2.handleChange,
|
634
|
+
itemToString: optionToString,
|
635
|
+
defaultHighlightedIndex: 0,
|
636
|
+
children: function children(autocompleteHelpers) {
|
637
|
+
return _this2.renderSelect(autocompleteHelpers, fieldState);
|
638
|
+
}
|
639
|
+
});
|
640
|
+
}
|
563
641
|
});
|
564
642
|
}
|
565
643
|
}]);
|
@@ -572,13 +650,27 @@ _defineProperty(AutoComplete, "defaultProps", {
|
|
572
650
|
creatable: false,
|
573
651
|
multiple: false,
|
574
652
|
maxResults: 7,
|
575
|
-
emptyState: defaultEmptyState,
|
576
653
|
createFromInputValue: defaultCreateFromInputValue,
|
577
654
|
options: [],
|
578
655
|
separatorKeyCodes: [],
|
579
656
|
separatorKeys: [],
|
580
|
-
optionItemComponent:
|
581
|
-
noWrap: false
|
657
|
+
optionItemComponent: DefaultOption,
|
658
|
+
noWrap: false,
|
659
|
+
locale: {
|
660
|
+
clearInputButton: "Clear input value",
|
661
|
+
emptyStateTitle: "No matches found",
|
662
|
+
itemsAvailable: function itemsAvailable(resultCount) {
|
663
|
+
return "".concat(pluralize(resultCount, "item is", {
|
664
|
+
plural: "items are"
|
665
|
+
}), " available");
|
666
|
+
},
|
667
|
+
showMoreButton: function showMoreButton(extraResults) {
|
668
|
+
return "Show ".concat(pluralize(extraResults, "result"), " more");
|
669
|
+
},
|
670
|
+
optionItemPrefix: function optionItemPrefix(multiple) {
|
671
|
+
return multiple ? "Add" : "Use";
|
672
|
+
}
|
673
|
+
}
|
582
674
|
});
|
583
675
|
|
584
676
|
export default AutoComplete;
|
@@ -1,13 +1,13 @@
|
|
1
|
-
import
|
2
|
-
import { IconComponentType } from "../../types";
|
1
|
+
import type { ReactNode } from "react";
|
3
2
|
import { MedallionVariant } from "../../Medallion";
|
3
|
+
import type { IconComponentType } from "../../types";
|
4
4
|
export interface AutoCompleteEmptyStateProps {
|
5
5
|
icon?: IconComponentType;
|
6
6
|
variant?: MedallionVariant;
|
7
7
|
/** Descriptive title for state */
|
8
|
-
title:
|
8
|
+
title: ReactNode;
|
9
9
|
/** Optional description to explain why the screen is empty or define next steps */
|
10
|
-
description?:
|
10
|
+
description?: ReactNode;
|
11
11
|
}
|
12
12
|
export declare const AutoCompleteEmptyState: ({ icon, variant, title, description, }: AutoCompleteEmptyStateProps) => JSX.Element;
|
13
13
|
export default AutoCompleteEmptyState;
|
@@ -2,10 +2,11 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
2
2
|
|
3
3
|
var _templateObject, _templateObject2, _templateObject3;
|
4
4
|
|
5
|
-
import React from "react";
|
6
5
|
import { X } from "react-feather";
|
7
|
-
import stl from "../../styles/helpers/satellitePrefixer";
|
8
6
|
import { Medallion } from "../../Medallion";
|
7
|
+
import stl from "../../styles/helpers/satellitePrefixer";
|
8
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
9
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
9
10
|
export var AutoCompleteEmptyState = function AutoCompleteEmptyState(_ref) {
|
10
11
|
var _ref$icon = _ref.icon,
|
11
12
|
icon = _ref$icon === void 0 ? X : _ref$icon,
|
@@ -13,15 +14,18 @@ export var AutoCompleteEmptyState = function AutoCompleteEmptyState(_ref) {
|
|
13
14
|
variant = _ref$variant === void 0 ? "grey" : _ref$variant,
|
14
15
|
title = _ref.title,
|
15
16
|
description = _ref.description;
|
16
|
-
return /*#__PURE__*/
|
17
|
-
className: stl(_templateObject || (_templateObject = _taggedTemplateLiteral(["flex flex-col items-center p-6"])))
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
17
|
+
return /*#__PURE__*/_jsxs("div", {
|
18
|
+
className: stl(_templateObject || (_templateObject = _taggedTemplateLiteral(["flex flex-col items-center p-6"]))),
|
19
|
+
children: [/*#__PURE__*/_jsx(Medallion, {
|
20
|
+
icon: icon,
|
21
|
+
variant: variant
|
22
|
+
}), /*#__PURE__*/_jsx("span", {
|
23
|
+
className: stl(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["font-semibold pt-4"]))),
|
24
|
+
children: title
|
25
|
+
}), description && /*#__PURE__*/_jsx("p", {
|
26
|
+
className: stl(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["display-caption typo-subdued pt-4"]))),
|
27
|
+
children: description
|
28
|
+
})]
|
29
|
+
});
|
26
30
|
};
|
27
31
|
export default AutoCompleteEmptyState;
|