@algolia/satellite 1.0.0-beta.132 → 1.0.0-beta.135
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 +6 -1
- package/cjs/AnnouncementBadge/AnnouncementBadge.js +15 -2
- package/cjs/AutoComplete/AutoComplete.d.ts +19 -14
- package/cjs/AutoComplete/AutoComplete.js +65 -18
- package/cjs/AutoComplete/AutoComplete.tailwind.d.ts +4 -4
- package/cjs/AutoComplete/AutoComplete.tailwind.js +10 -13
- package/cjs/AutoComplete/components/DefaultOptionItem.d.ts +6 -2
- package/cjs/AutoComplete/components/DefaultOptionItem.js +5 -2
- package/cjs/AutoComplete/types.d.ts +26 -18
- package/cjs/AutoComplete/utils.d.ts +5 -4
- package/cjs/AutoComplete/utils.js +22 -2
- package/cjs/Avatars/ApplicationAvatar.js +1 -1
- package/cjs/Banners/Alert/Alert.d.ts +1 -0
- package/cjs/Banners/Alert/Alert.js +1 -1
- package/cjs/Banners/BigBertha/BigBertha.d.ts +2 -1
- package/cjs/Banners/Promote/Promote.d.ts +1 -0
- package/cjs/Button/Button.js +2 -2
- 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/Card/Card.tailwind.d.ts +4 -4
- package/cjs/Card/Card.tailwind.js +5 -8
- package/cjs/Card/components/CardTitle.d.ts +4 -2
- package/cjs/Checkbox/Checkbox.d.ts +1 -1
- package/cjs/Checkbox/Checkbox.tailwind.d.ts +5 -5
- package/cjs/Checkbox/Checkbox.tailwind.js +11 -14
- package/cjs/ClickAwayContainer/ClickAwayContainer.d.ts +2 -1
- package/cjs/DatePicker/DatePicker/DatePicker.d.ts +5 -11
- package/cjs/DatePicker/DatePicker/DatePicker.js +17 -7
- package/cjs/DatePicker/DatePicker.tailwind.d.ts +4 -4
- package/cjs/DatePicker/DatePicker.tailwind.js +19 -14
- package/cjs/DatePicker/DateRangePicker/DateRangePicker.d.ts +5 -11
- package/cjs/DatePicker/DateRangePicker/DateRangePicker.js +25 -8
- package/cjs/DatePicker/DateRangePicker/DateRangePickerDisplay.d.ts +3 -0
- package/cjs/DatePicker/DateRangePicker/DateRangePickerDisplay.js +3 -2
- package/cjs/DatePicker/components/Calendar.d.ts +5 -1
- package/cjs/DatePicker/components/Calendar.js +3 -1
- package/cjs/DatePicker/components/Display.d.ts +1 -1
- package/cjs/DatePicker/components/FooterActions.d.ts +3 -0
- package/cjs/DatePicker/components/FooterActions.js +4 -3
- package/cjs/DatePicker/components/Modal.d.ts +2 -2
- package/cjs/DatePicker/components/Modal.js +5 -4
- package/cjs/DatePicker/components/NavBar.d.ts +5 -1
- package/cjs/DatePicker/components/NavBar.js +4 -3
- 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 +1 -1
- package/cjs/Dropdown/Dropdown.js +5 -4
- package/cjs/Dropdown/DropdownButton.d.ts +1 -0
- package/cjs/Dropdown/components/DropdownButtonItem.js +2 -2
- package/cjs/Dropdown/components/DropdownLinkItem.js +1 -2
- package/cjs/Dropdown/components/DropdownTitle.d.ts +4 -2
- package/cjs/Dropdown/components/DropdownToggleItem.js +2 -2
- package/cjs/Dropdown/useDropdownItemProps.d.ts +9 -1
- package/cjs/Dropdown/useDropdownItemProps.js +16 -7
- package/cjs/Dropzone/Dropzone.d.ts +5 -1
- package/cjs/Dropzone/Dropzone.js +14 -5
- package/cjs/EmptyState/EmptyState.tailwind.d.ts +4 -4
- package/cjs/EmptyState/EmptyState.tailwind.js +5 -8
- package/cjs/Field/Field.d.ts +1 -0
- package/cjs/Flag/Flag.d.ts +1 -0
- package/cjs/Flag/Flag.js +17 -2
- package/cjs/Flag/Flag.tailwind.d.ts +4 -4
- package/cjs/Flag/Flag.tailwind.js +8 -15
- package/cjs/Flag/Flags.d.ts +1 -1
- package/cjs/Flag/Flags.js +5 -4
- package/cjs/Flag/types.d.ts +4 -0
- package/cjs/FlexGrid/FlexGrid.d.ts +2 -1
- package/cjs/FlexGrid/FlexGrid.tailwind.d.ts +6 -3
- package/cjs/FlexGrid/FlexGrid.tailwind.js +8 -11
- package/cjs/HelpUnderline/HelpUnderline.d.ts +1 -0
- package/cjs/HelpUnderline/HelpUnderline.tailwind.d.ts +4 -4
- package/cjs/HelpUnderline/HelpUnderline.tailwind.js +3 -6
- package/cjs/Input/Input.d.ts +6 -0
- package/cjs/Input/Input.js +15 -4
- package/cjs/Input/Input.tailwind.d.ts +4 -4
- package/cjs/Input/Input.tailwind.js +12 -15
- package/cjs/Insert/Insert.d.ts +1 -0
- package/cjs/InstantSearch/InstantSearch.tailwind.d.ts +4 -5
- package/cjs/InstantSearch/InstantSearch.tailwind.js +34 -32
- package/cjs/KeyboardKey/KeyboardKey.d.ts +1 -0
- package/cjs/KeyboardKey/KeyboardKey.js +3 -2
- package/cjs/KeyboardKey/KeyboardKey.tailwind.d.ts +4 -4
- package/cjs/KeyboardKey/KeyboardKey.tailwind.js +5 -8
- package/cjs/Link/ButtonLink.js +1 -10
- package/cjs/Medallion/Medallion.tailwind.d.ts +4 -4
- package/cjs/Medallion/Medallion.tailwind.js +8 -11
- package/cjs/Modal/Modal.d.ts +5 -2
- package/cjs/Modal/Modal.js +16 -9
- 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/Pagination/CompactPagination/CompactPagination.d.ts +8 -0
- package/cjs/Pagination/CompactPagination/CompactPagination.js +29 -5
- package/cjs/Pagination/DotPagination/DotPagination.d.ts +5 -1
- package/cjs/Pagination/DotPagination/DotPagination.js +21 -2
- package/cjs/Pagination/Pagination/Pagination.d.ts +7 -1
- package/cjs/Pagination/Pagination/Pagination.js +32 -8
- package/cjs/ProgressBar/ProgressBar.tailwind.d.ts +5 -5
- package/cjs/ProgressBar/ProgressBar.tailwind.js +7 -10
- package/cjs/ProgressSpinner/ProgressSpinner.tailwind.d.ts +5 -5
- package/cjs/ProgressSpinner/ProgressSpinner.tailwind.js +4 -7
- package/cjs/RadioGroup/RadioButton.d.ts +1 -1
- package/cjs/RadioGroup/RadioButton.tailwind.d.ts +4 -4
- package/cjs/RadioGroup/RadioButton.tailwind.js +11 -14
- package/cjs/RadioGroup/RadioGroup.d.ts +1 -0
- package/cjs/RadioGroup/RadioGroup.js +1 -1
- package/cjs/RangeSlider/RangeSlider.d.ts +1 -1
- package/cjs/RangeSlider/RangeSlider.tailwind.d.ts +4 -4
- package/cjs/RangeSlider/RangeSlider.tailwind.js +21 -24
- package/cjs/Satellite/Satellite.d.ts +5 -1
- package/cjs/Satellite/Satellite.js +9 -2
- package/cjs/Satellite/SatelliteContext.d.ts +4 -1
- package/cjs/Satellite/SatelliteContext.js +2 -1
- package/cjs/Satellite/index.d.ts +2 -0
- package/cjs/Satellite/index.js +28 -0
- package/cjs/Satellite/locale.d.ts +29 -0
- package/cjs/Satellite/locale.js +21 -0
- package/cjs/Satellite/useCreatePortal.d.ts +4 -0
- package/cjs/Satellite/useCreatePortal.js +29 -0
- package/cjs/ScrollIndicator/ScrollIndicator.d.ts +4 -1
- package/cjs/ScrollIndicator/ScrollIndicator.js +2 -1
- package/cjs/ScrollIndicator/ScrollIndicator.tailwind.d.ts +4 -4
- package/cjs/ScrollIndicator/ScrollIndicator.tailwind.js +8 -11
- package/cjs/Select/Select.tailwind.d.ts +5 -5
- package/cjs/Select/Select.tailwind.js +5 -8
- package/cjs/Sidebar/Sidebar.d.ts +33 -10
- package/cjs/Sidebar/Sidebar.js +48 -38
- package/cjs/Sidebar/SidebarButtonLink.d.ts +14 -0
- package/cjs/Sidebar/SidebarButtonLink.js +110 -0
- package/cjs/Sidebar/SidebarContext.d.ts +7 -8
- package/cjs/Sidebar/SidebarContext.js +10 -11
- package/cjs/Sidebar/SidebarHeader.d.ts +6 -0
- package/cjs/Sidebar/SidebarHeader.js +29 -0
- package/cjs/Sidebar/SidebarHeading.d.ts +6 -0
- package/cjs/Sidebar/SidebarHeading.js +35 -0
- package/cjs/Sidebar/SidebarLink.d.ts +8 -0
- package/cjs/Sidebar/SidebarLink.js +58 -0
- package/cjs/Sidebar/SidebarLinksGroup/ActiveLinkIndicator.d.ts +8 -0
- package/cjs/Sidebar/SidebarLinksGroup/ActiveLinkIndicator.js +47 -0
- package/cjs/Sidebar/SidebarLinksGroup/SidebarGroupLink.d.ts +7 -0
- package/cjs/Sidebar/{components/SidebarHeader.js → SidebarLinksGroup/SidebarGroupLink.js} +14 -23
- package/cjs/Sidebar/SidebarLinksGroup/SidebarLinksGroup.d.ts +23 -0
- package/cjs/Sidebar/SidebarLinksGroup/SidebarLinksGroup.js +120 -0
- package/cjs/Sidebar/SidebarLinksGroup/index.d.ts +2 -0
- package/cjs/Sidebar/SidebarLinksGroup/index.js +18 -0
- package/cjs/Sidebar/SidebarLinksGroup/types.d.ts +10 -0
- package/cjs/Sidebar/SidebarLinksGroup/types.js +5 -0
- package/cjs/Sidebar/SidebarNav.d.ts +9 -0
- package/cjs/Sidebar/SidebarNav.js +46 -0
- package/cjs/Sidebar/index.d.ts +7 -4
- package/cjs/Sidebar/index.js +61 -21
- package/cjs/Sidebar/types.d.ts +6 -2
- 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 +1 -1
- package/cjs/Tables/DataTable/DataTable.d.ts +11 -1
- package/cjs/Tables/DataTable/DataTable.js +25 -7
- 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 +3 -2
- package/cjs/Tables/DataTable/components/Body.js +6 -5
- package/cjs/Tables/DataTable/components/Loader.d.ts +3 -1
- package/cjs/Tables/DataTable/components/Loader.js +4 -3
- package/cjs/Tables/Table/Table.tailwind.d.ts +4 -4
- package/cjs/Tables/Table/Table.tailwind.js +3 -6
- package/cjs/Tabs/Tabs.tailwind.d.ts +4 -4
- package/cjs/Tabs/Tabs.tailwind.js +13 -16
- package/cjs/Tabs/components/LinkTab.js +7 -9
- package/cjs/Tag/Tag.d.ts +5 -1
- package/cjs/Tag/Tag.js +15 -6
- package/cjs/Tag/Tag.tailwind.d.ts +4 -4
- package/cjs/Tag/Tag.tailwind.js +6 -9
- package/cjs/TextArea/TextArea.tailwind.d.ts +4 -4
- package/cjs/TextArea/TextArea.tailwind.js +4 -7
- package/cjs/Toggle/Toggle.d.ts +1 -1
- package/cjs/Toggle/Toggle.tailwind.d.ts +5 -5
- package/cjs/Toggle/Toggle.tailwind.js +19 -22
- package/cjs/Tooltip/OverflowTooltipWrapper.d.ts +1 -0
- package/cjs/Tooltip/OverflowTooltipWrapper.js +6 -4
- package/cjs/Tooltip/Tooltip.d.ts +1 -1
- package/cjs/Tooltip/Tooltip.tailwind.d.ts +4 -4
- package/cjs/Tooltip/Tooltip.tailwind.js +19 -18
- package/cjs/Tooltip/TooltipWrapper.d.ts +1 -0
- package/cjs/Tooltip/TooltipWrapper.js +5 -4
- package/cjs/Tooltip/types.d.ts +2 -0
- package/cjs/Typography/Typography.tailwind.d.ts +5 -17
- package/cjs/Typography/Typography.tailwind.js +123 -133
- package/cjs/UserContent/UserContent.tailwind.d.ts +4 -1
- package/cjs/UserContent/UserContent.tailwind.js +11 -9
- package/cjs/index.d.ts +0 -1
- package/cjs/index.js +0 -14
- 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 +25 -29
- package/cjs/types.d.ts +7 -0
- package/cjs/utilities/utilities.tailwind.d.ts +4 -1
- package/cjs/utilities/utilities.tailwind.js +4 -6
- package/cjs/utils/isCssPropertySupported.d.ts +1 -1
- package/cjs/utils/pluralize.js +6 -1
- package/cjs/utils/useLinkProps.d.ts +5 -2
- package/cjs/utils/useLinkProps.js +9 -2
- package/esm/AnnouncementBadge/AnnouncementBadge.d.ts +6 -1
- package/esm/AnnouncementBadge/AnnouncementBadge.js +14 -2
- package/esm/AutoComplete/AutoComplete.d.ts +19 -14
- package/esm/AutoComplete/AutoComplete.js +67 -18
- package/esm/AutoComplete/AutoComplete.tailwind.d.ts +4 -4
- package/esm/AutoComplete/AutoComplete.tailwind.js +10 -13
- package/esm/AutoComplete/components/DefaultOptionItem.d.ts +6 -2
- package/esm/AutoComplete/components/DefaultOptionItem.js +5 -2
- package/esm/AutoComplete/types.d.ts +26 -18
- package/esm/AutoComplete/utils.d.ts +5 -4
- package/esm/AutoComplete/utils.js +16 -0
- package/esm/Avatars/ApplicationAvatar.js +1 -1
- package/esm/Banners/Alert/Alert.d.ts +1 -0
- package/esm/Banners/Alert/Alert.js +1 -1
- package/esm/Banners/BigBertha/BigBertha.d.ts +2 -1
- package/esm/Banners/Promote/Promote.d.ts +1 -0
- package/esm/Button/Button.js +2 -2
- 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/Card/Card.tailwind.d.ts +4 -4
- package/esm/Card/Card.tailwind.js +6 -9
- package/esm/Card/components/CardTitle.d.ts +4 -2
- package/esm/Checkbox/Checkbox.d.ts +1 -1
- package/esm/Checkbox/Checkbox.tailwind.d.ts +5 -5
- package/esm/Checkbox/Checkbox.tailwind.js +11 -14
- package/esm/ClickAwayContainer/ClickAwayContainer.d.ts +2 -1
- package/esm/DatePicker/DatePicker/DatePicker.d.ts +5 -11
- package/esm/DatePicker/DatePicker/DatePicker.js +16 -7
- package/esm/DatePicker/DatePicker.tailwind.d.ts +4 -4
- package/esm/DatePicker/DatePicker.tailwind.js +19 -15
- package/esm/DatePicker/DateRangePicker/DateRangePicker.d.ts +5 -11
- package/esm/DatePicker/DateRangePicker/DateRangePicker.js +23 -7
- package/esm/DatePicker/DateRangePicker/DateRangePickerDisplay.d.ts +3 -0
- package/esm/DatePicker/DateRangePicker/DateRangePickerDisplay.js +3 -2
- package/esm/DatePicker/components/Calendar.d.ts +5 -1
- package/esm/DatePicker/components/Calendar.js +3 -1
- package/esm/DatePicker/components/Display.d.ts +1 -1
- package/esm/DatePicker/components/FooterActions.d.ts +3 -0
- package/esm/DatePicker/components/FooterActions.js +4 -3
- package/esm/DatePicker/components/Modal.d.ts +2 -2
- package/esm/DatePicker/components/Modal.js +4 -3
- package/esm/DatePicker/components/NavBar.d.ts +5 -1
- package/esm/DatePicker/components/NavBar.js +4 -3
- 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 +1 -1
- package/esm/Dropdown/Dropdown.js +4 -3
- package/esm/Dropdown/DropdownButton.d.ts +1 -0
- package/esm/Dropdown/components/DropdownButtonItem.js +2 -2
- package/esm/Dropdown/components/DropdownLinkItem.js +1 -2
- package/esm/Dropdown/components/DropdownTitle.d.ts +4 -2
- package/esm/Dropdown/components/DropdownToggleItem.js +2 -2
- package/esm/Dropdown/useDropdownItemProps.d.ts +9 -1
- package/esm/Dropdown/useDropdownItemProps.js +15 -7
- package/esm/Dropzone/Dropzone.d.ts +5 -1
- package/esm/Dropzone/Dropzone.js +13 -4
- package/esm/EmptyState/EmptyState.tailwind.d.ts +4 -4
- package/esm/EmptyState/EmptyState.tailwind.js +6 -9
- package/esm/Field/Field.d.ts +1 -0
- package/esm/Flag/Flag.d.ts +1 -0
- package/esm/Flag/Flag.js +15 -2
- package/esm/Flag/Flag.tailwind.d.ts +4 -4
- package/esm/Flag/Flag.tailwind.js +9 -16
- package/esm/Flag/Flags.d.ts +1 -1
- package/esm/Flag/Flags.js +4 -3
- package/esm/Flag/types.d.ts +4 -0
- package/esm/FlexGrid/FlexGrid.d.ts +2 -1
- package/esm/FlexGrid/FlexGrid.tailwind.d.ts +6 -3
- package/esm/FlexGrid/FlexGrid.tailwind.js +8 -11
- package/esm/HelpUnderline/HelpUnderline.d.ts +1 -0
- package/esm/HelpUnderline/HelpUnderline.tailwind.d.ts +4 -4
- package/esm/HelpUnderline/HelpUnderline.tailwind.js +4 -7
- package/esm/Input/Input.d.ts +6 -0
- package/esm/Input/Input.js +15 -4
- package/esm/Input/Input.tailwind.d.ts +4 -4
- package/esm/Input/Input.tailwind.js +14 -17
- package/esm/Insert/Insert.d.ts +1 -0
- package/esm/InstantSearch/InstantSearch.tailwind.d.ts +4 -5
- package/esm/InstantSearch/InstantSearch.tailwind.js +35 -33
- package/esm/KeyboardKey/KeyboardKey.d.ts +1 -0
- package/esm/KeyboardKey/KeyboardKey.js +3 -2
- package/esm/KeyboardKey/KeyboardKey.tailwind.d.ts +4 -4
- package/esm/KeyboardKey/KeyboardKey.tailwind.js +6 -9
- package/esm/Link/ButtonLink.js +1 -10
- package/esm/Medallion/Medallion.tailwind.d.ts +4 -4
- package/esm/Medallion/Medallion.tailwind.js +8 -11
- package/esm/Modal/Modal.d.ts +5 -2
- package/esm/Modal/Modal.js +14 -8
- 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/Pagination/CompactPagination/CompactPagination.d.ts +8 -0
- package/esm/Pagination/CompactPagination/CompactPagination.js +26 -5
- package/esm/Pagination/DotPagination/DotPagination.d.ts +5 -1
- package/esm/Pagination/DotPagination/DotPagination.js +18 -2
- package/esm/Pagination/Pagination/Pagination.d.ts +7 -1
- package/esm/Pagination/Pagination/Pagination.js +30 -8
- package/esm/ProgressBar/ProgressBar.tailwind.d.ts +5 -5
- package/esm/ProgressBar/ProgressBar.tailwind.js +7 -10
- package/esm/ProgressSpinner/ProgressSpinner.tailwind.d.ts +5 -5
- package/esm/ProgressSpinner/ProgressSpinner.tailwind.js +5 -8
- package/esm/RadioGroup/RadioButton.d.ts +1 -1
- package/esm/RadioGroup/RadioButton.tailwind.d.ts +4 -4
- package/esm/RadioGroup/RadioButton.tailwind.js +13 -16
- package/esm/RadioGroup/RadioGroup.d.ts +1 -0
- package/esm/RadioGroup/RadioGroup.js +1 -1
- package/esm/RangeSlider/RangeSlider.d.ts +1 -1
- package/esm/RangeSlider/RangeSlider.tailwind.d.ts +4 -4
- package/esm/RangeSlider/RangeSlider.tailwind.js +21 -24
- package/esm/Satellite/Satellite.d.ts +5 -1
- package/esm/Satellite/Satellite.js +8 -2
- package/esm/Satellite/SatelliteContext.d.ts +4 -1
- package/esm/Satellite/SatelliteContext.js +2 -1
- package/esm/Satellite/index.d.ts +2 -0
- package/esm/Satellite/index.js +2 -0
- package/esm/Satellite/locale.d.ts +29 -0
- package/esm/Satellite/locale.js +8 -0
- package/esm/Satellite/useCreatePortal.d.ts +4 -0
- package/esm/Satellite/useCreatePortal.js +16 -0
- package/esm/ScrollIndicator/ScrollIndicator.d.ts +4 -1
- package/esm/ScrollIndicator/ScrollIndicator.js +2 -1
- package/esm/ScrollIndicator/ScrollIndicator.tailwind.d.ts +4 -4
- package/esm/ScrollIndicator/ScrollIndicator.tailwind.js +8 -11
- package/esm/Select/Select.tailwind.d.ts +5 -5
- package/esm/Select/Select.tailwind.js +5 -8
- package/esm/Sidebar/Sidebar.d.ts +33 -10
- package/esm/Sidebar/Sidebar.js +44 -29
- package/esm/Sidebar/SidebarButtonLink.d.ts +14 -0
- package/esm/Sidebar/SidebarButtonLink.js +92 -0
- package/esm/Sidebar/SidebarContext.d.ts +7 -8
- package/esm/Sidebar/SidebarContext.js +9 -8
- package/esm/Sidebar/SidebarHeader.d.ts +6 -0
- package/esm/Sidebar/SidebarHeader.js +15 -0
- package/esm/Sidebar/SidebarHeading.d.ts +6 -0
- package/esm/Sidebar/SidebarHeading.js +20 -0
- package/esm/Sidebar/SidebarLink.d.ts +8 -0
- package/esm/Sidebar/SidebarLink.js +42 -0
- package/esm/Sidebar/SidebarLinksGroup/ActiveLinkIndicator.d.ts +8 -0
- package/esm/Sidebar/SidebarLinksGroup/ActiveLinkIndicator.js +32 -0
- package/esm/Sidebar/SidebarLinksGroup/SidebarGroupLink.d.ts +7 -0
- package/esm/Sidebar/{components/SidebarHeader.js → SidebarLinksGroup/SidebarGroupLink.js} +13 -19
- package/esm/Sidebar/SidebarLinksGroup/SidebarLinksGroup.d.ts +23 -0
- package/esm/Sidebar/SidebarLinksGroup/SidebarLinksGroup.js +100 -0
- package/esm/Sidebar/SidebarLinksGroup/index.d.ts +2 -0
- package/esm/Sidebar/SidebarLinksGroup/index.js +2 -0
- package/esm/Sidebar/SidebarLinksGroup/types.d.ts +10 -0
- package/esm/Sidebar/SidebarLinksGroup/types.js +1 -0
- package/esm/Sidebar/SidebarNav.d.ts +9 -0
- package/esm/Sidebar/SidebarNav.js +31 -0
- package/esm/Sidebar/index.d.ts +7 -4
- package/esm/Sidebar/index.js +7 -4
- package/esm/Sidebar/types.d.ts +6 -2
- 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 +1 -1
- package/esm/Tables/DataTable/DataTable.d.ts +11 -1
- package/esm/Tables/DataTable/DataTable.js +22 -6
- 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 +3 -2
- package/esm/Tables/DataTable/components/Body.js +6 -5
- package/esm/Tables/DataTable/components/Loader.d.ts +3 -1
- package/esm/Tables/DataTable/components/Loader.js +4 -3
- package/esm/Tables/Table/Table.tailwind.d.ts +4 -4
- package/esm/Tables/Table/Table.tailwind.js +4 -7
- package/esm/Tabs/Tabs.tailwind.d.ts +4 -4
- package/esm/Tabs/Tabs.tailwind.js +14 -17
- package/esm/Tabs/components/LinkTab.js +7 -9
- package/esm/Tag/Tag.d.ts +5 -1
- package/esm/Tag/Tag.js +14 -6
- package/esm/Tag/Tag.tailwind.d.ts +4 -4
- package/esm/Tag/Tag.tailwind.js +7 -10
- package/esm/TextArea/TextArea.tailwind.d.ts +4 -4
- package/esm/TextArea/TextArea.tailwind.js +6 -9
- package/esm/Toggle/Toggle.d.ts +1 -1
- package/esm/Toggle/Toggle.tailwind.d.ts +5 -5
- package/esm/Toggle/Toggle.tailwind.js +19 -22
- package/esm/Tooltip/OverflowTooltipWrapper.d.ts +1 -0
- package/esm/Tooltip/OverflowTooltipWrapper.js +6 -3
- package/esm/Tooltip/Tooltip.d.ts +1 -1
- package/esm/Tooltip/Tooltip.tailwind.d.ts +4 -4
- package/esm/Tooltip/Tooltip.tailwind.js +20 -19
- package/esm/Tooltip/TooltipWrapper.d.ts +1 -0
- package/esm/Tooltip/TooltipWrapper.js +4 -3
- package/esm/Tooltip/types.d.ts +2 -0
- package/esm/Typography/Typography.tailwind.d.ts +5 -17
- package/esm/Typography/Typography.tailwind.js +124 -134
- package/esm/UserContent/UserContent.tailwind.d.ts +4 -1
- package/esm/UserContent/UserContent.tailwind.js +12 -10
- package/esm/index.d.ts +0 -1
- package/esm/index.js +0 -1
- 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 +27 -30
- package/esm/types.d.ts +7 -0
- package/esm/utilities/utilities.tailwind.d.ts +4 -1
- package/esm/utilities/utilities.tailwind.js +4 -6
- package/esm/utils/isCssPropertySupported.d.ts +1 -1
- package/esm/utils/pluralize.js +6 -1
- package/esm/utils/useLinkProps.d.ts +5 -2
- package/esm/utils/useLinkProps.js +9 -2
- package/package.json +8 -11
- package/satellite.min.css +2 -4
- package/scss/colors.scss +1 -0
- package/cjs/Banner/Banner.d.ts +0 -85
- package/cjs/Banner/Banner.js +0 -176
- package/cjs/Banner/index.d.ts +0 -2
- package/cjs/Banner/index.js +0 -32
- package/cjs/Sidebar/Sidebar.tailwind.d.ts +0 -5
- package/cjs/Sidebar/Sidebar.tailwind.js +0 -69
- package/cjs/Sidebar/components/SidebarHeader.d.ts +0 -5
- package/cjs/Sidebar/components/SidebarLink.d.ts +0 -9
- package/cjs/Sidebar/components/SidebarLink.js +0 -98
- package/cjs/tailwind-types.d.ts +0 -52
- package/esm/Banner/Banner.d.ts +0 -85
- package/esm/Banner/Banner.js +0 -161
- package/esm/Banner/index.d.ts +0 -2
- package/esm/Banner/index.js +0 -2
- package/esm/Sidebar/Sidebar.tailwind.d.ts +0 -5
- package/esm/Sidebar/Sidebar.tailwind.js +0 -67
- package/esm/Sidebar/components/SidebarHeader.d.ts +0 -5
- package/esm/Sidebar/components/SidebarLink.d.ts +0 -9
- package/esm/Sidebar/components/SidebarLink.js +0 -78
- package/esm/tailwind-types.d.ts +0 -52
- package/satellite.css +0 -196852
package/README.md
CHANGED
@@ -82,39 +82,24 @@ yarn add -D tailwindcss
|
|
82
82
|
Example `main.css`
|
83
83
|
|
84
84
|
```css
|
85
|
-
@
|
85
|
+
@tailwind base;
|
86
|
+
@tailwind components;
|
87
|
+
@tailwind utilities;
|
86
88
|
|
87
|
-
@
|
88
|
-
|
89
|
-
|
89
|
+
@layer components {
|
90
|
+
/* your custom components */
|
91
|
+
}
|
90
92
|
```
|
91
93
|
|
92
94
|
Example `postcss.config.js`
|
93
95
|
|
94
96
|
```js
|
95
|
-
|
96
|
-
const cssnano = require("cssnano");
|
97
|
-
|
98
|
-
// Feel free to customize it
|
99
|
-
const tailwindConfig = require("@algolia/satellite/cjs/styles/tailwind.config.js");
|
100
|
-
|
101
|
-
// If you're gonna use purge css, you need to configure a custom extractor to avoid removing classes used in the Satellite components.
|
102
|
-
const { makePurgeCssExtractor } = require("@algolia/satellite");
|
103
|
-
const PurgeCssExtractor = makePurgeCssExtractor(tailwindConfig.prefix);
|
97
|
+
// ...
|
104
98
|
|
105
99
|
const plugins = [
|
106
100
|
require("postcss-import"),
|
107
101
|
require("tailwindcss")(tailwindConfig),
|
108
102
|
require("autoprefixer"),
|
109
|
-
purgecss({
|
110
|
-
content: ["./dist/**/*.{js,html}"],
|
111
|
-
defaultExtractor: PurgeCssExtractor,
|
112
|
-
// This entry will allow you to safelist some prefix in order to avoid some classnames to be wiped out.
|
113
|
-
// Here, it will keep all the classnames starting with:
|
114
|
-
// - 'ais-*' to preserve the instant-search widgets style
|
115
|
-
// - 'DayPicker*' to preserve all the DatePicker styles (used in the DatePicker and DateRangePicker)
|
116
|
-
whitelistPatterns: [/^ais-/, /^DayPicker/],
|
117
|
-
}),
|
118
103
|
cssnano({ preset: "default" }),
|
119
104
|
];
|
120
105
|
|
@@ -124,11 +109,31 @@ module.exports = { plugins };
|
|
124
109
|
Example `tailwind.config.js`
|
125
110
|
|
126
111
|
```js
|
127
|
-
const
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
112
|
+
const { makePurgeCssExtractor } = require('@algolia/satellite');
|
113
|
+
const satelliteConfig = require("@algolia/satellite/cjs/styles/tailwind.config.js");
|
114
|
+
|
115
|
+
module.exports = {
|
116
|
+
presets: [satellite],
|
117
|
+
content: [
|
118
|
+
files: [
|
119
|
+
`node_modules/@algolia/satellite/**/*.js`,
|
120
|
+
`node_modules/react-day-picker/lib/style.css`,
|
121
|
+
`node_modules/react-day-picker/src/**/*.js`,
|
122
|
+
|
123
|
+
`src/**/*.{ts,tsx,js,jsx}`,
|
124
|
+
// Any other sources files
|
125
|
+
],
|
126
|
+
extract: makePurgeCssExtractor(prefix),
|
127
|
+
],
|
128
|
+
theme: {
|
129
|
+
extend: {
|
130
|
+
// any colors, fonts... you want to add
|
131
|
+
}
|
132
|
+
},
|
133
|
+
plugins: [
|
134
|
+
// extra plugins you want to add
|
135
|
+
]
|
136
|
+
};
|
132
137
|
```
|
133
138
|
|
134
139
|
Example `index.jsx`
|
@@ -139,7 +144,7 @@ import ReactDOM from "react-dom";
|
|
139
144
|
|
140
145
|
import "./main.css";
|
141
146
|
|
142
|
-
import { Button, stl } from "@algolia/satellite
|
147
|
+
import { Button, stl } from "@algolia/satellite";
|
143
148
|
|
144
149
|
const loading = true;
|
145
150
|
|
@@ -1,9 +1,14 @@
|
|
1
1
|
import type { FunctionComponent, HTMLAttributes } from "react";
|
2
2
|
export declare type AnnouncementBadgeSizes = "default" | "small";
|
3
|
+
export declare type AnnouncementBadgeTexts = "new" | "beta" | "internal" | "pilot";
|
4
|
+
export declare type AnnouncementBadgeLocale = {
|
5
|
+
[key in AnnouncementBadgeTexts]?: string;
|
6
|
+
};
|
3
7
|
export interface AnnouncementBadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
4
8
|
size?: AnnouncementBadgeSizes;
|
5
|
-
text?:
|
9
|
+
text?: AnnouncementBadgeTexts;
|
6
10
|
variant?: "accent" | "red";
|
11
|
+
locale?: AnnouncementBadgeLocale;
|
7
12
|
children?: never;
|
8
13
|
}
|
9
14
|
export declare const AnnouncementBadge: FunctionComponent<AnnouncementBadgeProps>;
|
@@ -15,11 +15,13 @@ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/hel
|
|
15
15
|
|
16
16
|
var _classnames = _interopRequireDefault(require("classnames"));
|
17
17
|
|
18
|
+
var _Satellite = require("../Satellite");
|
19
|
+
|
18
20
|
var _satellitePrefixer = _interopRequireDefault(require("../styles/helpers/satellitePrefixer"));
|
19
21
|
|
20
22
|
var _jsxRuntime = require("react/jsx-runtime");
|
21
23
|
|
22
|
-
var _excluded = ["size", "text", "variant", "className"];
|
24
|
+
var _excluded = ["size", "text", "variant", "className", "locale"];
|
23
25
|
|
24
26
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
25
27
|
|
@@ -27,6 +29,12 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
27
29
|
|
28
30
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
29
31
|
|
32
|
+
var DEFAULT_LOCALE = {
|
33
|
+
beta: "beta",
|
34
|
+
internal: "internal",
|
35
|
+
"new": "new",
|
36
|
+
pilot: "pilot"
|
37
|
+
};
|
30
38
|
var DEFAULT_CLASSNAME = (0, _satellitePrefixer["default"])(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["capitalize inline-block rounded-full text-white select-none"])));
|
31
39
|
var SIZE_CLASSNAMES = {
|
32
40
|
"default": (0, _satellitePrefixer["default"])(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["display-body h-6 leading-md px-2"]))),
|
@@ -40,11 +48,16 @@ var AnnouncementBadge = function AnnouncementBadge(_ref) {
|
|
40
48
|
text = _ref$text === void 0 ? "new" : _ref$text,
|
41
49
|
variantProp = _ref.variant,
|
42
50
|
className = _ref.className,
|
51
|
+
propsLocale = _ref.locale,
|
43
52
|
props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
53
|
+
var contextLocale = (0, _Satellite.useLocale)("announcementBadge");
|
54
|
+
|
55
|
+
var locale = _objectSpread(_objectSpread(_objectSpread({}, DEFAULT_LOCALE), contextLocale), propsLocale);
|
56
|
+
|
44
57
|
var variant = typeof variantProp === "string" ? variantProp : text === "internal" ? "red" : "accent";
|
45
58
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", _objectSpread(_objectSpread({}, props), {}, {
|
46
59
|
className: (0, _classnames["default"])(DEFAULT_CLASSNAME, variant === "red" ? (0, _satellitePrefixer["default"])(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["bg-red-600"]))) : (0, _satellitePrefixer["default"])(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["bg-accent-600"]))), SIZE_CLASSNAMES[size], className),
|
47
|
-
children: text
|
60
|
+
children: locale[text]
|
48
61
|
}));
|
49
62
|
};
|
50
63
|
|
@@ -1,14 +1,17 @@
|
|
1
|
-
import { ControllerStateAndHelpers } from "downshift";
|
1
|
+
import type { A11yStatusMessageOptions, ControllerStateAndHelpers } from "downshift";
|
2
2
|
import { Component } from "react";
|
3
3
|
import type { ChangeEvent, FocusEvent, KeyboardEvent, MouseEvent } from "react";
|
4
4
|
import { FieldState } from "../Field/FieldStateContext";
|
5
|
-
import type { AutoCompleteProps, Option } from "./types";
|
5
|
+
import type { AutoCompleteLocale, AutoCompleteProps, Option, OptionItemProps } from "./types";
|
6
6
|
interface State {
|
7
7
|
inputFocused: boolean;
|
8
8
|
inputValue: string;
|
9
9
|
inputWidth?: number;
|
10
10
|
showAllResults: boolean;
|
11
11
|
}
|
12
|
+
declare type DefaultOptionProps = OptionItemProps & {
|
13
|
+
optionItemPrefix?: AutoCompleteLocale["optionItemPrefix"];
|
14
|
+
};
|
12
15
|
/**
|
13
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.
|
14
17
|
*
|
@@ -25,37 +28,39 @@ interface State {
|
|
25
28
|
* - Provide matching results quickly
|
26
29
|
* - Style different data
|
27
30
|
*/
|
28
|
-
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>;
|
29
33
|
static defaultProps: {
|
30
34
|
clearable: boolean;
|
31
35
|
creatable: boolean;
|
32
36
|
multiple: boolean;
|
33
37
|
maxResults: number;
|
34
|
-
|
35
|
-
createFromInputValue: import("./types").CreateFromInputValue;
|
38
|
+
createFromInputValue: <T_1 extends Option = Option>(options: T_1[] | undefined, inputValue: string) => Option[];
|
36
39
|
options: never[];
|
37
40
|
separatorKeyCodes: never[];
|
38
41
|
separatorKeys: never[];
|
39
|
-
optionItemComponent:
|
42
|
+
optionItemComponent: ({ optionItemPrefix, ...props }: DefaultOptionProps) => JSX.Element;
|
40
43
|
noWrap: boolean;
|
41
44
|
};
|
42
45
|
state: State;
|
43
46
|
inputContainerRef: HTMLDivElement | null;
|
44
47
|
inputRef: HTMLInputElement | null;
|
45
|
-
componentDidUpdate(prevProps: AutoCompleteProps): void;
|
48
|
+
componentDidUpdate(prevProps: AutoCompleteProps<T>): void;
|
46
49
|
handleClearClick: () => void;
|
47
50
|
handleFakeInputClick: () => void | null;
|
48
|
-
handleInputBlur: (state: ControllerStateAndHelpers<Option>) => (evt: FocusEvent<HTMLInputElement>) => void;
|
51
|
+
handleInputBlur: (state: ControllerStateAndHelpers<T | Option>) => (evt: FocusEvent<HTMLInputElement>) => void;
|
49
52
|
handleInputChange: (evt: ChangeEvent<HTMLInputElement>) => void;
|
50
53
|
handleInputContainerRefUpdate: (el: HTMLDivElement | null) => void;
|
51
54
|
updateInputWidth: () => void;
|
52
|
-
handleKeyDown: (state: ControllerStateAndHelpers<Option>) => (evt: KeyboardEvent<any>) => void;
|
53
|
-
handleChange: (option:
|
55
|
+
handleKeyDown: (state: ControllerStateAndHelpers<T | Option>) => (evt: KeyboardEvent<any>) => void;
|
56
|
+
handleChange: (option: T) => void;
|
54
57
|
handleShowAllResults: (evt: MouseEvent<HTMLButtonElement>) => void;
|
55
|
-
removeValue: (removedOption:
|
56
|
-
|
57
|
-
|
58
|
-
|
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();
|
59
64
|
render(): JSX.Element;
|
60
65
|
}
|
61
66
|
export default AutoComplete;
|
@@ -27,6 +27,8 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
|
|
27
27
|
|
28
28
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
29
29
|
|
30
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
31
|
+
|
30
32
|
var _classnames = _interopRequireDefault(require("classnames"));
|
31
33
|
|
32
34
|
var _downshift = _interopRequireDefault(require("downshift"));
|
@@ -45,14 +47,14 @@ var _Card = _interopRequireDefault(require("../Card"));
|
|
45
47
|
|
46
48
|
var _FieldStateContext = require("../Field/FieldStateContext");
|
47
49
|
|
50
|
+
var _Satellite = require("../Satellite");
|
51
|
+
|
48
52
|
var _ScrollIndicator = _interopRequireDefault(require("../ScrollIndicator"));
|
49
53
|
|
50
54
|
var _satellitePrefixer = _interopRequireDefault(require("../styles/helpers/satellitePrefixer"));
|
51
55
|
|
52
56
|
var _Tag = _interopRequireDefault(require("../Tag"));
|
53
57
|
|
54
|
-
var _pluralize = _interopRequireDefault(require("../utils/pluralize"));
|
55
|
-
|
56
58
|
var _uniqBy = _interopRequireDefault(require("../utils/uniqBy"));
|
57
59
|
|
58
60
|
var _AutoCompleteEmptyState = _interopRequireDefault(require("./components/AutoCompleteEmptyState"));
|
@@ -65,14 +67,16 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
65
67
|
|
66
68
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16;
|
67
69
|
|
68
|
-
|
69
|
-
|
70
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
70
|
+
var _excluded = ["optionItemPrefix"];
|
71
71
|
|
72
72
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
73
73
|
|
74
74
|
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; } }
|
75
75
|
|
76
|
+
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; }
|
77
|
+
|
78
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
79
|
+
|
76
80
|
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; } } }; }
|
77
81
|
|
78
82
|
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); }
|
@@ -140,9 +144,24 @@ var MENU_POPPER_MODFIERS = [{
|
|
140
144
|
}
|
141
145
|
}];
|
142
146
|
var BACKSPACE_KEY_CODE = 8;
|
143
|
-
|
144
|
-
|
145
|
-
|
147
|
+
|
148
|
+
/** @ignore */
|
149
|
+
var DefaultEmptyState = function DefaultEmptyState(_ref) {
|
150
|
+
var emptyStateTitle = _ref.emptyStateTitle;
|
151
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_AutoCompleteEmptyState["default"], {
|
152
|
+
title: emptyStateTitle
|
153
|
+
});
|
154
|
+
};
|
155
|
+
|
156
|
+
var DefaultOption = function DefaultOption(_ref2) {
|
157
|
+
var optionItemPrefix = _ref2.optionItemPrefix,
|
158
|
+
props = (0, _objectWithoutProperties2["default"])(_ref2, _excluded);
|
159
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_DefaultOptionItem["default"], _objectSpread(_objectSpread({}, props), {}, {
|
160
|
+
locale: {
|
161
|
+
optionItemPrefix: optionItemPrefix !== null && optionItemPrefix !== void 0 ? optionItemPrefix : _utils.DEFAULT_AUTOCOMPLETE_LOCALE.optionItemPrefix
|
162
|
+
}
|
163
|
+
}));
|
164
|
+
};
|
146
165
|
/**
|
147
166
|
* 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.
|
148
167
|
*
|
@@ -160,6 +179,7 @@ var defaultEmptyState = /*#__PURE__*/(0, _jsxRuntime.jsx)(_AutoCompleteEmptyStat
|
|
160
179
|
* - Style different data
|
161
180
|
*/
|
162
181
|
|
182
|
+
|
163
183
|
var AutoComplete = /*#__PURE__*/function (_Component) {
|
164
184
|
(0, _inherits2["default"])(AutoComplete, _Component);
|
165
185
|
|
@@ -333,6 +353,21 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
333
353
|
|
334
354
|
_this.props.onChange(newOptions);
|
335
355
|
});
|
356
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getA11yStatusMessage", function (options) {
|
357
|
+
if (!options.isOpen) {
|
358
|
+
return "";
|
359
|
+
}
|
360
|
+
|
361
|
+
if (!options.resultCount) {
|
362
|
+
return _this.locale.emptyStateTitle;
|
363
|
+
}
|
364
|
+
|
365
|
+
if (options.resultCount > 0) {
|
366
|
+
return _this.locale.itemsAvailable(options.resultCount);
|
367
|
+
}
|
368
|
+
|
369
|
+
return "";
|
370
|
+
});
|
336
371
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "renderInput", function (results, autocompleteHelpers, fieldState) {
|
337
372
|
var _this$props3 = _this.props,
|
338
373
|
id = _this$props3.id,
|
@@ -399,7 +434,7 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
399
434
|
onClick: _this.handleFakeInputClick,
|
400
435
|
ref: _this.handleInputContainerRefUpdate,
|
401
436
|
children: [Icon && /*#__PURE__*/(0, _jsxRuntime.jsx)(Icon, {
|
402
|
-
className: (0, _satellitePrefixer["default"])(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["mr-4
|
437
|
+
className: (0, _satellitePrefixer["default"])(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["mr-4 shrink-0 ", ""])), disabled ? "text-grey-200" : inputFocused ? "text-accent-600" : "text-grey-500"),
|
403
438
|
size: "1rem"
|
404
439
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
405
440
|
className: (0, _classnames["default"])((0, _satellitePrefixer["default"])(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["flex items-center flex-1 ", " ", ""])), !noWrap && "flex-wrap", multiple && "-ml-1"), valuesClassName),
|
@@ -431,7 +466,7 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
431
466
|
type: "button",
|
432
467
|
className: (0, _satellitePrefixer["default"])(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["w-6 flex items-center justify-center text-grey-500"]))),
|
433
468
|
onClick: _this.handleClearClick,
|
434
|
-
"aria-label":
|
469
|
+
"aria-label": _this.locale.clearInputButton,
|
435
470
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFeather.X, {
|
436
471
|
size: ".75rem"
|
437
472
|
})
|
@@ -447,12 +482,15 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
447
482
|
highlightedIndex = autocompleteHelpers.highlightedIndex,
|
448
483
|
inputValue = autocompleteHelpers.inputValue,
|
449
484
|
isOpen = autocompleteHelpers.isOpen;
|
485
|
+
var defaultEmptyState = /*#__PURE__*/(0, _jsxRuntime.jsx)(DefaultEmptyState, {
|
486
|
+
emptyStateTitle: _this.locale.emptyStateTitle
|
487
|
+
});
|
450
488
|
var _this$props4 = _this.props,
|
451
489
|
menuClassName = _this$props4.menuClassName,
|
452
490
|
menuSize = _this$props4.menuSize,
|
453
|
-
_this$props4$emptySta = _this$props4.emptyState,
|
454
|
-
emptyState = _this$props4$emptySta === void 0 ? AutoComplete.defaultProps.emptyState : _this$props4$emptySta,
|
455
491
|
menuFooter = _this$props4.menuFooter,
|
492
|
+
_this$props4$emptySta = _this$props4.emptyState,
|
493
|
+
emptyState = _this$props4$emptySta === void 0 ? defaultEmptyState : _this$props4$emptySta,
|
456
494
|
_this$props4$maxResul = _this$props4.maxResults,
|
457
495
|
maxResults = _this$props4$maxResul === void 0 ? AutoComplete.defaultProps.maxResults : _this$props4$maxResul,
|
458
496
|
_this$props4$multiple = _this$props4.multiple,
|
@@ -509,16 +547,17 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
509
547
|
})), {}, {
|
510
548
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(OptionItem, _objectSpread(_objectSpread({}, optionItemProps), {}, {
|
511
549
|
highlighted: index === highlightedIndex,
|
512
|
-
option: result
|
550
|
+
option: result,
|
551
|
+
optionItemPrefix: _this.locale.optionItemPrefix
|
513
552
|
}))
|
514
553
|
}), result.value);
|
515
554
|
}), extraResults > 0 && !showAllResults && /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
|
516
555
|
className: (0, _satellitePrefixer["default"])(_templateObject15 || (_templateObject15 = (0, _taggedTemplateLiteral2["default"])(["p-2 text-right"]))),
|
517
|
-
children: /*#__PURE__*/(0, _jsxRuntime.
|
556
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button["default"], {
|
518
557
|
variant: "subtle",
|
519
558
|
size: "small",
|
520
559
|
onMouseDown: _this.handleShowAllResults,
|
521
|
-
children:
|
560
|
+
children: _this.locale.showMoreButton(extraResults)
|
522
561
|
})
|
523
562
|
})]
|
524
563
|
}))
|
@@ -532,6 +571,8 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
532
571
|
});
|
533
572
|
});
|
534
573
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "renderSelect", function (autocompleteHelpers, fieldState) {
|
574
|
+
var _this$context$portalT;
|
575
|
+
|
535
576
|
var _this$props5 = _this.props,
|
536
577
|
className = _this$props5.className,
|
537
578
|
options = _this$props5.options,
|
@@ -549,7 +590,7 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
549
590
|
|
550
591
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
551
592
|
className: className,
|
552
|
-
children: [_this.renderInput(results, autocompleteHelpers, fieldState), _this.inputContainerRef && /*#__PURE__*/(0, _reactDom.createPortal)(_this.renderMenu(results, autocompleteHelpers), document.body)]
|
593
|
+
children: [_this.renderInput(results, autocompleteHelpers, fieldState), _this.inputContainerRef && /*#__PURE__*/(0, _reactDom.createPortal)(_this.renderMenu(results, autocompleteHelpers), (_this$context$portalT = _this.context["portalTarget"]) !== null && _this$context$portalT !== void 0 ? _this$context$portalT : document.body)]
|
553
594
|
});
|
554
595
|
});
|
555
596
|
return _this;
|
@@ -571,6 +612,11 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
571
612
|
});
|
572
613
|
}
|
573
614
|
}
|
615
|
+
}, {
|
616
|
+
key: "locale",
|
617
|
+
get: function get() {
|
618
|
+
return _objectSpread(_objectSpread(_objectSpread({}, _utils.DEFAULT_AUTOCOMPLETE_LOCALE), this.context["locales"]), this.props.locale);
|
619
|
+
}
|
574
620
|
}, {
|
575
621
|
key: "render",
|
576
622
|
value: function render() {
|
@@ -589,6 +635,7 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
589
635
|
*/
|
590
636
|
,
|
591
637
|
selectedItem: null,
|
638
|
+
getA11yStatusMessage: _this2.getA11yStatusMessage,
|
592
639
|
onChange: _this2.handleChange,
|
593
640
|
itemToString: optionToString,
|
594
641
|
defaultHighlightedIndex: 0,
|
@@ -604,17 +651,17 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
|
|
604
651
|
}(_react.Component);
|
605
652
|
|
606
653
|
exports.AutoComplete = AutoComplete;
|
654
|
+
(0, _defineProperty2["default"])(AutoComplete, "contextType", _Satellite.SatelliteContext);
|
607
655
|
(0, _defineProperty2["default"])(AutoComplete, "defaultProps", {
|
608
656
|
clearable: false,
|
609
657
|
creatable: false,
|
610
658
|
multiple: false,
|
611
659
|
maxResults: 7,
|
612
|
-
emptyState: defaultEmptyState,
|
613
660
|
createFromInputValue: _utils.defaultCreateFromInputValue,
|
614
661
|
options: [],
|
615
662
|
separatorKeyCodes: [],
|
616
663
|
separatorKeys: [],
|
617
|
-
optionItemComponent:
|
664
|
+
optionItemComponent: DefaultOption,
|
618
665
|
noWrap: false
|
619
666
|
});
|
620
667
|
var _default = AutoComplete;
|
@@ -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,15 +1,13 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
// @ts-check
|
4
|
+
var plugin = require("tailwindcss/plugin");
|
5
|
+
|
4
6
|
var disabledColor = require("../styles/disabledColor");
|
5
7
|
|
6
8
|
var rgba = require("../styles/rgba");
|
7
|
-
/**
|
8
|
-
* @type {import('../tailwind-types').TailwindPlugin}
|
9
|
-
*/
|
10
|
-
|
11
9
|
|
12
|
-
var autoCompletePlugin = function
|
10
|
+
var autoCompletePlugin = plugin(function (_ref) {
|
13
11
|
var addComponents = _ref.addComponents,
|
14
12
|
theme = _ref.theme;
|
15
13
|
addComponents({
|
@@ -32,14 +30,14 @@ var autoCompletePlugin = function autoCompletePlugin(_ref) {
|
|
32
30
|
"&::after": {
|
33
31
|
content: '" "',
|
34
32
|
display: "block",
|
35
|
-
minHeight:
|
33
|
+
minHeight: "30px",
|
36
34
|
// don't ask me why 30
|
37
|
-
fontSize:
|
35
|
+
fontSize: "0px"
|
38
36
|
},
|
39
37
|
"&.autocomplete-large": {
|
40
38
|
minHeight: "3rem",
|
41
39
|
"&::after": {
|
42
|
-
minHeight:
|
40
|
+
minHeight: "38px" // don't ask me why 38
|
43
41
|
|
44
42
|
}
|
45
43
|
}
|
@@ -69,12 +67,12 @@ var autoCompletePlugin = function autoCompletePlugin(_ref) {
|
|
69
67
|
scrollbarWidth: "none",
|
70
68
|
msOverflowStyle: "-ms-autohiding-scrollbar",
|
71
69
|
"&::-webkit-scrollbar": {
|
72
|
-
width:
|
73
|
-
height:
|
70
|
+
width: "0px",
|
71
|
+
height: "0px"
|
74
72
|
}
|
75
73
|
},
|
76
74
|
".autocomplete-input": {
|
77
|
-
flex: 1,
|
75
|
+
flex: "1",
|
78
76
|
backgroundColor: "transparent",
|
79
77
|
caretColor: theme("colors.grey.600"),
|
80
78
|
color: theme("colors.grey.900"),
|
@@ -94,6 +92,5 @@ var autoCompletePlugin = function autoCompletePlugin(_ref) {
|
|
94
92
|
}
|
95
93
|
}
|
96
94
|
});
|
97
|
-
};
|
98
|
-
|
95
|
+
});
|
99
96
|
module.exports = autoCompletePlugin;
|
@@ -1,3 +1,7 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
/// <reference types="react" />
|
2
|
+
import type { AutoCompleteLocale, OptionItemProps } from "../types";
|
3
|
+
declare type DefaultOptionItemProps = OptionItemProps & {
|
4
|
+
locale?: AutoCompleteLocale;
|
5
|
+
};
|
6
|
+
declare const DefaultOptionItem: ({ option, multiple, locale }: DefaultOptionItemProps) => JSX.Element;
|
3
7
|
export default DefaultOptionItem;
|
@@ -21,13 +21,16 @@ var metadataSpacer = /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
21
21
|
});
|
22
22
|
|
23
23
|
var DefaultOptionItem = function DefaultOptionItem(_ref) {
|
24
|
+
var _locale$optionItemPre;
|
25
|
+
|
24
26
|
var option = _ref.option,
|
25
|
-
multiple = _ref.multiple
|
27
|
+
multiple = _ref.multiple,
|
28
|
+
locale = _ref.locale;
|
26
29
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
27
30
|
className: (0, _satellitePrefixer["default"])(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["truncate py-2"]))),
|
28
31
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
29
32
|
className: (0, _satellitePrefixer["default"])(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["font-semibold text-md text-grey-900"]))),
|
30
|
-
children: option["new"] ? "".concat(
|
33
|
+
children: option["new"] ? "".concat(locale === null || locale === void 0 ? void 0 : (_locale$optionItemPre = locale.optionItemPrefix) === null || _locale$optionItemPre === void 0 ? void 0 : _locale$optionItemPre.call(locale, multiple), " ").concat(option.label) : option.label
|
31
34
|
}), option.metadata && option.metadata.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)("ul", {
|
32
35
|
className: (0, _satellitePrefixer["default"])(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["flex text-grey-600"]))),
|
33
36
|
children: option.metadata.map(function (metadata, idx) {
|
@@ -1,7 +1,14 @@
|
|
1
1
|
import type { ComponentType, FocusEventHandler, ReactNode } from "react";
|
2
2
|
import type { IconComponentType } from "../types";
|
3
3
|
export declare type AutoCompleteVariant = "medium" | "large";
|
4
|
-
export
|
4
|
+
export declare type AutoCompleteLocale = {
|
5
|
+
emptyStateTitle?: string;
|
6
|
+
clearInputButton?: string;
|
7
|
+
itemsAvailable?: (resultCount: number) => string;
|
8
|
+
showMoreButton?: (extraResults: number) => string;
|
9
|
+
optionItemPrefix?: (multiple: boolean) => string;
|
10
|
+
};
|
11
|
+
export interface AutoCompleteBaseProps<T extends Option = Option> {
|
5
12
|
id?: string;
|
6
13
|
icon?: IconComponentType;
|
7
14
|
name?: string;
|
@@ -12,7 +19,7 @@ export interface AutoCompleteBaseProps {
|
|
12
19
|
placeholder?: string;
|
13
20
|
disabled?: boolean;
|
14
21
|
autoFocus?: boolean;
|
15
|
-
options?:
|
22
|
+
options?: T[];
|
16
23
|
inputValue?: string;
|
17
24
|
onTextChange?: (text: string) => any;
|
18
25
|
onFocus?: FocusEventHandler<HTMLInputElement>;
|
@@ -21,13 +28,13 @@ export interface AutoCompleteBaseProps {
|
|
21
28
|
clearable?: boolean;
|
22
29
|
selectOnBlur?: boolean;
|
23
30
|
maxResults?: number;
|
24
|
-
createFromInputValue?: CreateFromInputValue
|
31
|
+
createFromInputValue?: CreateFromInputValue<T>;
|
25
32
|
separatorKeyCodes?: number[];
|
26
33
|
separatorKeys?: string[];
|
27
|
-
renderValueTemplate?: (args: RenderValueTemplateArgs) => JSX.Element;
|
34
|
+
renderValueTemplate?: (args: RenderValueTemplateArgs<T>) => JSX.Element;
|
28
35
|
emptyState?: ReactNode;
|
29
36
|
menuFooter?: ReactNode;
|
30
|
-
optionItemComponent?: OptionItemComponentType
|
37
|
+
optionItemComponent?: OptionItemComponentType<T>;
|
31
38
|
/** Keep the input on a single line */
|
32
39
|
noWrap?: boolean;
|
33
40
|
endItem?: ReactNode;
|
@@ -36,18 +43,19 @@ export interface AutoCompleteBaseProps {
|
|
36
43
|
* @default "medium"
|
37
44
|
*/
|
38
45
|
menuSize?: "medium" | "large";
|
46
|
+
locale?: AutoCompleteLocale;
|
39
47
|
}
|
40
|
-
export interface AutoCompleteSingleProps extends AutoCompleteBaseProps {
|
48
|
+
export interface AutoCompleteSingleProps<T extends Option = Option> extends AutoCompleteBaseProps<T> {
|
41
49
|
multiple?: false;
|
42
|
-
value?:
|
43
|
-
onChange: (option:
|
50
|
+
value?: T;
|
51
|
+
onChange: (option: T | null) => void;
|
44
52
|
}
|
45
|
-
export interface AutoCompleteMultiProps extends AutoCompleteBaseProps {
|
53
|
+
export interface AutoCompleteMultiProps<T extends Option = Option> extends AutoCompleteBaseProps<T> {
|
46
54
|
multiple: true;
|
47
|
-
value?:
|
48
|
-
onChange: (option:
|
55
|
+
value?: T[];
|
56
|
+
onChange: (option: T[] | null) => void;
|
49
57
|
}
|
50
|
-
export declare type AutoCompleteProps = AutoCompleteMultiProps | AutoCompleteSingleProps
|
58
|
+
export declare type AutoCompleteProps<T extends Option = Option> = AutoCompleteMultiProps<T> | AutoCompleteSingleProps<T>;
|
51
59
|
declare type OptionsValue = string | number | boolean;
|
52
60
|
export interface Option {
|
53
61
|
value: OptionsValue;
|
@@ -57,22 +65,22 @@ export interface Option {
|
|
57
65
|
disabled?: boolean;
|
58
66
|
bypassNeedleMatch?: boolean;
|
59
67
|
}
|
60
|
-
export interface OptionItemProps {
|
61
|
-
option:
|
68
|
+
export interface OptionItemProps<T extends Option = Option> {
|
69
|
+
option: T;
|
62
70
|
multiple: boolean;
|
63
71
|
inputValue: string;
|
64
72
|
highlighted: boolean;
|
65
73
|
}
|
66
|
-
export declare type OptionItemComponentType = ComponentType<OptionItemProps
|
74
|
+
export declare type OptionItemComponentType<T extends Option = Option> = ComponentType<OptionItemProps<T>>;
|
67
75
|
export interface OptionRendererParams {
|
68
76
|
multiple: boolean;
|
69
77
|
inputValue: string;
|
70
78
|
highlighted: boolean;
|
71
79
|
}
|
72
|
-
export interface RenderValueTemplateArgs {
|
73
|
-
option:
|
80
|
+
export interface RenderValueTemplateArgs<T extends Option = Option> {
|
81
|
+
option: T;
|
74
82
|
key: string;
|
75
83
|
editable: boolean;
|
76
84
|
}
|
77
|
-
export declare type CreateFromInputValue = (options:
|
85
|
+
export declare type CreateFromInputValue<T extends Option = Option> = (options: T[] | undefined, inputValue: string) => Option[];
|
78
86
|
export {};
|