@algolia/satellite 1.0.0-beta.147 → 1.0.0-beta.148
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/AnnouncementBadge/AnnouncementBadge.js +7 -24
- package/cjs/AnnouncementBadge/index.js +0 -5
- package/cjs/AutoComplete/AutoComplete.js +68 -163
- package/cjs/AutoComplete/AutoComplete.tailwind.js +2 -5
- package/cjs/AutoComplete/components/AutoCompleteEmptyState.js +5 -14
- package/cjs/AutoComplete/components/DefaultOptionItem.js +2 -11
- package/cjs/AutoComplete/index.js +0 -11
- package/cjs/AutoComplete/utils.js +0 -8
- package/cjs/Avatars/ApplicationAvatar.js +3 -13
- package/cjs/Avatars/UserAvatar.js +6 -20
- package/cjs/Avatars/index.js +0 -7
- package/cjs/Avatars/utils.js +6 -37
- package/cjs/Badge/Badge.js +13 -36
- package/cjs/Badge/index.js +0 -5
- package/cjs/Banners/Alert/Alert.js +18 -28
- package/cjs/Banners/Alert/index.js +0 -5
- package/cjs/Banners/BigBertha/BigBertha.js +1 -9
- package/cjs/Banners/BigBertha/index.js +0 -5
- package/cjs/Banners/Promote/Promote.js +8 -19
- package/cjs/Banners/Promote/index.js +0 -5
- package/cjs/Banners/index.js +0 -6
- package/cjs/Button/Button.js +13 -33
- package/cjs/Button/Button.tailwind.js +3 -5
- package/cjs/Button/ButtonGroup.js +3 -11
- package/cjs/Button/IconButton.js +12 -35
- package/cjs/Button/index.js +0 -11
- package/cjs/Button/styles.js +1 -10
- package/cjs/Button/types.js +0 -1
- package/cjs/Card/Card.js +6 -21
- package/cjs/Card/Card.tailwind.js +1 -2
- package/cjs/Card/components/CardHeader.js +1 -14
- package/cjs/Card/components/CardTitle.js +2 -15
- package/cjs/Card/index.js +0 -9
- package/cjs/Checkbox/Checkbox.js +14 -38
- package/cjs/Checkbox/Checkbox.tailwind.js +1 -3
- package/cjs/Checkbox/index.js +0 -5
- package/cjs/ClickAwayContainer/ClickAwayContainer.js +11 -23
- package/cjs/ClickAwayContainer/index.js +0 -2
- package/cjs/DatePicker/DatePicker/DatePicker.js +13 -46
- package/cjs/DatePicker/DatePicker/datePickerReducer.js +0 -15
- package/cjs/DatePicker/DatePicker/index.js +0 -7
- package/cjs/DatePicker/DatePicker.tailwind.js +2 -12
- package/cjs/DatePicker/DateRangePicker/DateRangePicker.js +29 -72
- package/cjs/DatePicker/DateRangePicker/DateRangePickerDisplay.js +4 -14
- package/cjs/DatePicker/DateRangePicker/dateRangePickerReducer.js +2 -28
- package/cjs/DatePicker/DateRangePicker/dateRangePickerTimeRange.js +0 -6
- package/cjs/DatePicker/DateRangePicker/index.js +0 -9
- package/cjs/DatePicker/components/Calendar.js +5 -16
- package/cjs/DatePicker/components/Display.js +3 -9
- package/cjs/DatePicker/components/Footer.js +0 -7
- package/cjs/DatePicker/components/FooterActions.js +3 -11
- package/cjs/DatePicker/components/Modal.js +17 -39
- package/cjs/DatePicker/components/NavBar.js +12 -34
- package/cjs/DatePicker/components/SidePanel.js +0 -7
- package/cjs/DatePicker/components/index.js +0 -7
- package/cjs/DatePicker/index.js +0 -9
- package/cjs/DatePicker/utils.js +0 -4
- package/cjs/Dropdown/Dropdown.js +23 -58
- package/cjs/Dropdown/DropdownButton.js +3 -20
- package/cjs/Dropdown/DropdownContext.js +0 -6
- package/cjs/Dropdown/components/DropdownButtonItem.js +5 -21
- package/cjs/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItem.js +10 -25
- package/cjs/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsGroup.js +2 -6
- package/cjs/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsGroupContext.js +0 -6
- package/cjs/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsMultiGroup.js +6 -16
- package/cjs/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsSingleGroup.js +6 -15
- package/cjs/Dropdown/components/DropdownCollapsibleItem/index.js +0 -9
- package/cjs/Dropdown/components/DropdownDivider.js +0 -7
- package/cjs/Dropdown/components/DropdownFooterItem.js +2 -15
- package/cjs/Dropdown/components/DropdownLinkItem.js +6 -23
- package/cjs/Dropdown/components/DropdownRadioItem.js +4 -20
- package/cjs/Dropdown/components/DropdownTitle.js +1 -14
- package/cjs/Dropdown/components/DropdownToggleItem.js +5 -22
- package/cjs/Dropdown/index.js +0 -27
- package/cjs/Dropdown/useDropdownItemProps.js +1 -14
- package/cjs/Dropzone/Dropzone.js +27 -62
- package/cjs/Dropzone/index.js +0 -5
- package/cjs/EmptyState/EmptyState.js +12 -23
- package/cjs/EmptyState/EmptyState.tailwind.js +0 -1
- package/cjs/EmptyState/index.js +0 -7
- package/cjs/Field/Field.js +8 -21
- package/cjs/Field/FieldStateContext.js +0 -2
- package/cjs/Field/index.js +0 -9
- package/cjs/Field/useFieldState.js +0 -7
- package/cjs/Flag/Flag.js +17 -40
- package/cjs/Flag/Flag.tailwind.js +0 -1
- package/cjs/Flag/Flags.js +4 -19
- package/cjs/Flag/index.js +0 -9
- package/cjs/FlexGrid/FlexGrid.js +13 -24
- package/cjs/FlexGrid/FlexGrid.tailwind.js +4 -11
- package/cjs/FlexGrid/index.js +0 -5
- package/cjs/HelpUnderline/HelpUnderline.js +5 -14
- package/cjs/HelpUnderline/HelpUnderline.tailwind.js +1 -2
- package/cjs/HelpUnderline/index.js +0 -5
- package/cjs/Input/Input.js +26 -70
- package/cjs/Input/Input.tailwind.js +1 -4
- package/cjs/Input/index.js +0 -5
- package/cjs/Insert/Insert.js +7 -17
- package/cjs/Insert/index.js +0 -5
- package/cjs/InstantSearch/InstantSearch.tailwind.js +4 -10
- package/cjs/KeyboardKey/KeyboardKey.js +1 -12
- package/cjs/KeyboardKey/KeyboardKey.tailwind.js +1 -2
- package/cjs/KeyboardKey/index.js +0 -2
- package/cjs/Link/BaseLink.js +2 -12
- package/cjs/Link/ButtonLink.js +3 -17
- package/cjs/Link/IconButtonLink.js +2 -13
- package/cjs/Link/Link.js +6 -23
- package/cjs/Link/index.js +0 -11
- package/cjs/Medallion/Medallion.js +5 -14
- package/cjs/Medallion/Medallion.tailwind.js +3 -6
- package/cjs/Medallion/index.js +0 -7
- package/cjs/Modal/Modal.js +21 -57
- package/cjs/Modal/Modal.tailwind.js +3 -3
- package/cjs/Modal/components/ModalFooter.js +2 -16
- package/cjs/Modal/components/ModalSection.js +3 -11
- package/cjs/Modal/index.js +0 -9
- package/cjs/Pagination/CompactPagination/CompactPagination.js +1 -22
- package/cjs/Pagination/CompactPagination/index.js +0 -5
- package/cjs/Pagination/DotPagination/DotPagination.js +5 -19
- package/cjs/Pagination/DotPagination/index.js +0 -5
- package/cjs/Pagination/Pagination/Pagination.js +9 -34
- package/cjs/Pagination/Pagination/index.js +0 -5
- package/cjs/Pagination/index.js +0 -9
- package/cjs/ProgressBar/ProgressBar.js +3 -16
- package/cjs/ProgressBar/ProgressBar.tailwind.js +1 -3
- package/cjs/ProgressBar/index.js +0 -5
- package/cjs/ProgressSpinner/ProgressSpinner.js +8 -20
- package/cjs/ProgressSpinner/ProgressSpinner.tailwind.js +2 -3
- package/cjs/ProgressSpinner/index.js +0 -5
- package/cjs/RadioGroup/RadioButton.js +1 -14
- package/cjs/RadioGroup/RadioButton.tailwind.js +1 -4
- package/cjs/RadioGroup/RadioGroup.js +19 -38
- package/cjs/RadioGroup/RadiogroupContext.js +0 -6
- package/cjs/RadioGroup/index.js +0 -9
- package/cjs/RangeSlider/RangeSlider.js +26 -43
- package/cjs/RangeSlider/RangeSlider.tailwind.js +1 -3
- package/cjs/RangeSlider/index.js +0 -5
- package/cjs/Satellite/Satellite.js +4 -10
- package/cjs/Satellite/SatelliteContext.js +0 -9
- package/cjs/Satellite/SatelliteRouter.js +2 -9
- package/cjs/Satellite/index.js +0 -13
- package/cjs/Satellite/locale.js +1 -7
- package/cjs/Satellite/useCreatePortal.js +2 -8
- package/cjs/ScrollIndicator/ScrollIndicator.js +18 -41
- package/cjs/ScrollIndicator/ScrollIndicator.tailwind.js +1 -3
- package/cjs/ScrollIndicator/index.js +0 -5
- package/cjs/Select/Select.js +4 -17
- package/cjs/Select/Select.tailwind.js +2 -5
- package/cjs/Select/index.js +0 -5
- package/cjs/Sidebar/Sidebar.js +11 -30
- package/cjs/Sidebar/SidebarButtonLink.js +10 -30
- package/cjs/Sidebar/SidebarContext.js +0 -6
- package/cjs/Sidebar/SidebarHeader.js +1 -9
- package/cjs/Sidebar/SidebarHeading.js +3 -14
- package/cjs/Sidebar/SidebarLink.js +5 -20
- package/cjs/Sidebar/SidebarLinksGroup/ActiveLinkIndicator.js +2 -11
- package/cjs/Sidebar/SidebarLinksGroup/SidebarGroupLink.js +3 -14
- package/cjs/Sidebar/SidebarLinksGroup/SidebarLinksGroup.js +8 -31
- package/cjs/Sidebar/SidebarLinksGroup/index.js +0 -2
- package/cjs/Sidebar/SidebarNav.js +5 -16
- package/cjs/Sidebar/index.js +0 -17
- package/cjs/Switch/Switch.js +15 -36
- package/cjs/Switch/Switch.tailwind.js +1 -2
- package/cjs/Switch/SwitchOption.js +2 -15
- package/cjs/Switch/index.js +0 -7
- package/cjs/Switch/utils.js +0 -9
- package/cjs/Tables/DataTable/DataTable.js +28 -70
- package/cjs/Tables/DataTable/DataTable.tailwind.js +2 -2
- package/cjs/Tables/DataTable/components/Body.js +14 -33
- package/cjs/Tables/DataTable/components/Footer.js +1 -17
- package/cjs/Tables/DataTable/components/Header.js +5 -12
- package/cjs/Tables/DataTable/components/HeaderCell.js +10 -27
- package/cjs/Tables/DataTable/components/Loader.js +4 -17
- package/cjs/Tables/DataTable/components/index.js +0 -10
- package/cjs/Tables/DataTable/index.js +0 -7
- package/cjs/Tables/DataTable/utils.js +0 -9
- package/cjs/Tables/Table/Table.js +7 -21
- package/cjs/Tables/Table/Table.tailwind.js +1 -2
- package/cjs/Tables/Table/components/TableFooter.js +2 -10
- package/cjs/Tables/Table/index.js +0 -7
- package/cjs/Tables/index.js +0 -7
- package/cjs/Tabs/ContentTabs.js +10 -21
- package/cjs/Tabs/LinkTabs.js +5 -18
- package/cjs/Tabs/Tabs.tailwind.js +1 -2
- package/cjs/Tabs/components/LinkTab.js +2 -27
- package/cjs/Tabs/index.js +0 -9
- package/cjs/Tabs/utils.js +0 -5
- package/cjs/Tag/Tag.js +7 -26
- package/cjs/Tag/Tag.tailwind.js +1 -2
- package/cjs/Tag/index.js +0 -5
- package/cjs/TextArea/TextArea.js +1 -14
- package/cjs/TextArea/TextArea.tailwind.js +1 -4
- package/cjs/TextArea/index.js +0 -5
- package/cjs/TextWrap/TextWrap.js +3 -18
- package/cjs/TextWrap/index.js +0 -5
- package/cjs/Toggle/Toggle.js +6 -27
- package/cjs/Toggle/Toggle.tailwind.js +1 -3
- package/cjs/Toggle/index.js +0 -5
- package/cjs/Tooltip/OverflowTooltipWrapper.js +33 -62
- package/cjs/Tooltip/Tooltip.js +4 -17
- package/cjs/Tooltip/Tooltip.tailwind.js +3 -5
- package/cjs/Tooltip/TooltipWrapper.js +43 -71
- package/cjs/Tooltip/index.js +0 -9
- package/cjs/Typography/Typography.tailwind.js +12 -18
- package/cjs/UserContent/UserContent.js +3 -11
- package/cjs/UserContent/UserContent.tailwind.js +2 -11
- package/cjs/index.js +0 -89
- package/cjs/styles/base.tailwind.js +7 -7
- package/cjs/styles/colors.js +7 -7
- package/cjs/styles/disabledColor.js +1 -4
- package/cjs/styles/helpers/icons.js +5 -11
- package/cjs/styles/helpers/makePurgeCssExtractor.js +3 -15
- package/cjs/styles/helpers/makeTailwindPrefixer.js +1 -9
- package/cjs/styles/helpers/prefixTailwindClassName.js +6 -6
- package/cjs/styles/helpers/satellitePrefixer.js +1 -2
- package/cjs/styles/rgba.js +1 -3
- package/cjs/styles/tailwind.config.js +4 -11
- package/cjs/styles/zIndexes.js +1 -0
- package/cjs/utilities/utilities.tailwind.js +0 -3
- package/cjs/utils/event-polyfill.js +0 -2
- package/cjs/utils/formatters.js +12 -19
- package/cjs/utils/genericChangeHandler.js +0 -6
- package/cjs/utils/hashCode.js +0 -5
- package/cjs/utils/index.js +0 -7
- package/cjs/utils/isCssPropertySupported.js +0 -3
- package/cjs/utils/isNil.js +0 -2
- package/cjs/utils/isRenderedChild.js +0 -2
- package/cjs/utils/matchLocation.js +0 -4
- package/cjs/utils/onlyText.js +3 -12
- package/cjs/utils/parseUrl.js +2 -4
- package/cjs/utils/pluralize.js +2 -7
- package/cjs/utils/range.js +0 -2
- package/cjs/utils/toSentenceCase.js +0 -4
- package/cjs/utils/uniqBy.js +0 -4
- package/cjs/utils/uniqueId.js +0 -2
- package/cjs/utils/useForwardedRef.js +0 -6
- package/cjs/utils/useLinkProps.js +1 -13
- package/cjs/utils/useTriggerInputChange.js +2 -4
- package/esm/AnnouncementBadge/AnnouncementBadge.js +7 -14
- package/esm/AutoComplete/AutoComplete.js +68 -158
- package/esm/AutoComplete/AutoComplete.tailwind.js +2 -2
- package/esm/AutoComplete/components/AutoCompleteEmptyState.js +5 -7
- package/esm/AutoComplete/components/DefaultOptionItem.js +2 -8
- package/esm/AutoComplete/utils.js +0 -2
- package/esm/Avatars/ApplicationAvatar.js +3 -6
- package/esm/Avatars/UserAvatar.js +6 -12
- package/esm/Avatars/utils.js +7 -23
- package/esm/Badge/Badge.js +13 -28
- package/esm/Banners/Alert/Alert.js +18 -20
- package/esm/Banners/BigBertha/BigBertha.js +1 -4
- package/esm/Banners/Promote/Promote.js +8 -10
- package/esm/Button/Button.js +13 -21
- package/esm/Button/Button.tailwind.js +3 -2
- package/esm/Button/ButtonGroup.js +3 -6
- package/esm/Button/IconButton.js +12 -22
- package/esm/Button/styles.js +1 -5
- package/esm/Card/Card.js +6 -12
- package/esm/Card/Card.tailwind.js +1 -1
- package/esm/Card/components/CardHeader.js +1 -7
- package/esm/Card/components/CardTitle.js +2 -8
- package/esm/Checkbox/Checkbox.js +14 -28
- package/esm/Checkbox/Checkbox.tailwind.js +1 -1
- package/esm/ClickAwayContainer/ClickAwayContainer.js +11 -13
- package/esm/DatePicker/DatePicker/DatePicker.js +13 -31
- package/esm/DatePicker/DatePicker/datePickerReducer.js +0 -9
- package/esm/DatePicker/DatePicker.tailwind.js +2 -9
- package/esm/DatePicker/DateRangePicker/DateRangePicker.js +29 -55
- package/esm/DatePicker/DateRangePicker/DateRangePickerDisplay.js +4 -8
- package/esm/DatePicker/DateRangePicker/dateRangePickerReducer.js +2 -16
- package/esm/DatePicker/components/Calendar.js +5 -10
- package/esm/DatePicker/components/Display.js +3 -5
- package/esm/DatePicker/components/Footer.js +0 -4
- package/esm/DatePicker/components/FooterActions.js +3 -7
- package/esm/DatePicker/components/Modal.js +17 -27
- package/esm/DatePicker/components/NavBar.js +12 -22
- package/esm/DatePicker/components/SidePanel.js +0 -4
- package/esm/Dropdown/Dropdown.js +23 -34
- package/esm/Dropdown/DropdownButton.js +3 -11
- package/esm/Dropdown/DropdownContext.js +0 -2
- package/esm/Dropdown/components/DropdownButtonItem.js +5 -12
- package/esm/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItem.js +10 -15
- package/esm/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsGroup.js +2 -2
- package/esm/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsGroupContext.js +0 -2
- package/esm/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsMultiGroup.js +6 -9
- package/esm/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsSingleGroup.js +6 -9
- package/esm/Dropdown/components/DropdownDivider.js +0 -2
- package/esm/Dropdown/components/DropdownFooterItem.js +2 -8
- package/esm/Dropdown/components/DropdownLinkItem.js +6 -13
- package/esm/Dropdown/components/DropdownRadioItem.js +4 -11
- package/esm/Dropdown/components/DropdownTitle.js +1 -7
- package/esm/Dropdown/components/DropdownToggleItem.js +5 -12
- package/esm/Dropdown/useDropdownItemProps.js +1 -7
- package/esm/Dropzone/Dropzone.js +27 -45
- package/esm/EmptyState/EmptyState.js +12 -16
- package/esm/Field/Field.js +8 -11
- package/esm/Flag/Flag.js +17 -25
- package/esm/Flag/Flags.js +4 -9
- package/esm/FlexGrid/FlexGrid.js +13 -15
- package/esm/FlexGrid/FlexGrid.tailwind.js +4 -9
- package/esm/HelpUnderline/HelpUnderline.js +5 -7
- package/esm/HelpUnderline/HelpUnderline.tailwind.js +1 -1
- package/esm/Input/Input.js +26 -54
- package/esm/Input/Input.tailwind.js +1 -1
- package/esm/Insert/Insert.js +7 -11
- package/esm/InstantSearch/InstantSearch.tailwind.js +4 -4
- package/esm/KeyboardKey/KeyboardKey.js +1 -3
- package/esm/KeyboardKey/KeyboardKey.tailwind.js +1 -1
- package/esm/Link/BaseLink.js +2 -6
- package/esm/Link/ButtonLink.js +3 -9
- package/esm/Link/IconButtonLink.js +2 -6
- package/esm/Link/Link.js +6 -14
- package/esm/Medallion/Medallion.js +5 -7
- package/esm/Medallion/Medallion.tailwind.js +3 -2
- package/esm/Modal/Modal.js +21 -38
- package/esm/Modal/Modal.tailwind.js +3 -2
- package/esm/Modal/components/ModalFooter.js +2 -8
- package/esm/Modal/components/ModalSection.js +3 -5
- package/esm/Pagination/CompactPagination/CompactPagination.js +1 -9
- package/esm/Pagination/DotPagination/DotPagination.js +5 -11
- package/esm/Pagination/Pagination/Pagination.js +9 -21
- package/esm/ProgressBar/ProgressBar.js +3 -10
- package/esm/ProgressBar/ProgressBar.tailwind.js +1 -1
- package/esm/ProgressSpinner/ProgressSpinner.js +8 -12
- package/esm/ProgressSpinner/ProgressSpinner.tailwind.js +2 -2
- package/esm/RadioGroup/RadioButton.js +1 -7
- package/esm/RadioGroup/RadioButton.tailwind.js +1 -1
- package/esm/RadioGroup/RadioGroup.js +19 -25
- package/esm/RadioGroup/RadiogroupContext.js +0 -2
- package/esm/RangeSlider/RangeSlider.js +26 -35
- package/esm/RangeSlider/RangeSlider.tailwind.js +1 -1
- package/esm/Satellite/Satellite.js +4 -4
- package/esm/Satellite/SatelliteContext.js +0 -3
- package/esm/Satellite/SatelliteRouter.js +2 -4
- package/esm/Satellite/locale.js +1 -2
- package/esm/Satellite/useCreatePortal.js +2 -2
- package/esm/ScrollIndicator/ScrollIndicator.js +18 -31
- package/esm/ScrollIndicator/ScrollIndicator.tailwind.js +1 -1
- package/esm/Select/Select.js +4 -9
- package/esm/Select/Select.tailwind.js +2 -2
- package/esm/Sidebar/Sidebar.js +11 -17
- package/esm/Sidebar/SidebarButtonLink.js +10 -20
- package/esm/Sidebar/SidebarContext.js +0 -2
- package/esm/Sidebar/SidebarHeader.js +1 -3
- package/esm/Sidebar/SidebarHeading.js +3 -7
- package/esm/Sidebar/SidebarLink.js +5 -11
- package/esm/Sidebar/SidebarLinksGroup/ActiveLinkIndicator.js +2 -4
- package/esm/Sidebar/SidebarLinksGroup/SidebarGroupLink.js +3 -7
- package/esm/Sidebar/SidebarLinksGroup/SidebarLinksGroup.js +8 -18
- package/esm/Sidebar/SidebarNav.js +5 -9
- package/esm/Switch/Switch.js +15 -24
- package/esm/Switch/Switch.tailwind.js +1 -1
- package/esm/Switch/SwitchOption.js +2 -6
- package/esm/Tables/DataTable/DataTable.js +28 -49
- package/esm/Tables/DataTable/DataTable.tailwind.js +2 -1
- package/esm/Tables/DataTable/components/Body.js +14 -23
- package/esm/Tables/DataTable/components/Footer.js +1 -8
- package/esm/Tables/DataTable/components/Header.js +5 -6
- package/esm/Tables/DataTable/components/HeaderCell.js +10 -17
- package/esm/Tables/DataTable/components/Loader.js +4 -8
- package/esm/Tables/DataTable/utils.js +0 -1
- package/esm/Tables/Table/Table.js +7 -14
- package/esm/Tables/Table/Table.tailwind.js +1 -1
- package/esm/Tables/Table/components/TableFooter.js +2 -4
- package/esm/Tabs/ContentTabs.js +10 -12
- package/esm/Tabs/LinkTabs.js +5 -7
- package/esm/Tabs/Tabs.tailwind.js +1 -1
- package/esm/Tabs/components/LinkTab.js +2 -18
- package/esm/Tabs/utils.js +0 -2
- package/esm/Tag/Tag.js +7 -16
- package/esm/Tag/Tag.tailwind.js +1 -1
- package/esm/TextArea/TextArea.js +1 -7
- package/esm/TextArea/TextArea.tailwind.js +1 -1
- package/esm/TextWrap/TextWrap.js +3 -11
- package/esm/Toggle/Toggle.js +6 -19
- package/esm/Toggle/Toggle.tailwind.js +1 -1
- package/esm/Tooltip/OverflowTooltipWrapper.js +33 -46
- package/esm/Tooltip/Tooltip.js +4 -9
- package/esm/Tooltip/Tooltip.tailwind.js +3 -4
- package/esm/Tooltip/TooltipWrapper.js +43 -56
- package/esm/Typography/Typography.tailwind.js +12 -15
- package/esm/UserContent/UserContent.js +3 -5
- package/esm/UserContent/UserContent.tailwind.js +2 -7
- package/esm/styles/base.tailwind.js +7 -6
- package/esm/styles/colors.js +7 -7
- package/esm/styles/disabledColor.js +1 -2
- package/esm/styles/helpers/icons.js +5 -8
- package/esm/styles/helpers/makePurgeCssExtractor.js +3 -14
- package/esm/styles/helpers/makeTailwindPrefixer.js +1 -6
- package/esm/styles/helpers/prefixTailwindClassName.js +6 -6
- package/esm/styles/helpers/satellitePrefixer.js +1 -1
- package/esm/styles/rgba.js +1 -2
- package/esm/styles/tailwind.config.js +4 -6
- package/esm/styles/zIndexes.js +1 -0
- package/esm/utils/event-polyfill.js +0 -2
- package/esm/utils/formatters.js +12 -16
- package/esm/utils/genericChangeHandler.js +0 -2
- package/esm/utils/hashCode.js +0 -3
- package/esm/utils/isCssPropertySupported.js +0 -2
- package/esm/utils/isRenderedChild.js +0 -1
- package/esm/utils/matchLocation.js +0 -2
- package/esm/utils/onlyText.js +3 -11
- package/esm/utils/parseUrl.js +2 -2
- package/esm/utils/pluralize.js +2 -5
- package/esm/utils/toSentenceCase.js +1 -1
- package/esm/utils/uniqBy.js +0 -2
- package/esm/utils/useForwardedRef.js +0 -3
- package/esm/utils/useLinkProps.js +1 -7
- package/esm/utils/useTriggerInputChange.js +2 -3
- package/package.json +1 -1
- package/satellite.min.css +1 -1
- package/scss/colors.scss +16 -16
package/cjs/Sidebar/index.js
CHANGED
@@ -12,9 +12,7 @@ Object.defineProperty(exports, "useSidebarContext", {
|
|
12
12
|
return _SidebarContext.useSidebarContext;
|
13
13
|
}
|
14
14
|
});
|
15
|
-
|
16
15
|
var _Sidebar = require("./Sidebar");
|
17
|
-
|
18
16
|
Object.keys(_Sidebar).forEach(function (key) {
|
19
17
|
if (key === "default" || key === "__esModule") return;
|
20
18
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
@@ -26,9 +24,7 @@ Object.keys(_Sidebar).forEach(function (key) {
|
|
26
24
|
}
|
27
25
|
});
|
28
26
|
});
|
29
|
-
|
30
27
|
var _SidebarButtonLink = require("./SidebarButtonLink");
|
31
|
-
|
32
28
|
Object.keys(_SidebarButtonLink).forEach(function (key) {
|
33
29
|
if (key === "default" || key === "__esModule") return;
|
34
30
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
@@ -40,9 +36,7 @@ Object.keys(_SidebarButtonLink).forEach(function (key) {
|
|
40
36
|
}
|
41
37
|
});
|
42
38
|
});
|
43
|
-
|
44
39
|
var _SidebarHeader = require("./SidebarHeader");
|
45
|
-
|
46
40
|
Object.keys(_SidebarHeader).forEach(function (key) {
|
47
41
|
if (key === "default" || key === "__esModule") return;
|
48
42
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
@@ -54,9 +48,7 @@ Object.keys(_SidebarHeader).forEach(function (key) {
|
|
54
48
|
}
|
55
49
|
});
|
56
50
|
});
|
57
|
-
|
58
51
|
var _SidebarHeading = require("./SidebarHeading");
|
59
|
-
|
60
52
|
Object.keys(_SidebarHeading).forEach(function (key) {
|
61
53
|
if (key === "default" || key === "__esModule") return;
|
62
54
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
@@ -68,9 +60,7 @@ Object.keys(_SidebarHeading).forEach(function (key) {
|
|
68
60
|
}
|
69
61
|
});
|
70
62
|
});
|
71
|
-
|
72
63
|
var _SidebarLink = require("./SidebarLink");
|
73
|
-
|
74
64
|
Object.keys(_SidebarLink).forEach(function (key) {
|
75
65
|
if (key === "default" || key === "__esModule") return;
|
76
66
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
@@ -82,9 +72,7 @@ Object.keys(_SidebarLink).forEach(function (key) {
|
|
82
72
|
}
|
83
73
|
});
|
84
74
|
});
|
85
|
-
|
86
75
|
var _SidebarLinksGroup = require("./SidebarLinksGroup");
|
87
|
-
|
88
76
|
Object.keys(_SidebarLinksGroup).forEach(function (key) {
|
89
77
|
if (key === "default" || key === "__esModule") return;
|
90
78
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
@@ -96,9 +84,7 @@ Object.keys(_SidebarLinksGroup).forEach(function (key) {
|
|
96
84
|
}
|
97
85
|
});
|
98
86
|
});
|
99
|
-
|
100
87
|
var _SidebarNav = require("./SidebarNav");
|
101
|
-
|
102
88
|
Object.keys(_SidebarNav).forEach(function (key) {
|
103
89
|
if (key === "default" || key === "__esModule") return;
|
104
90
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
@@ -110,9 +96,7 @@ Object.keys(_SidebarNav).forEach(function (key) {
|
|
110
96
|
}
|
111
97
|
});
|
112
98
|
});
|
113
|
-
|
114
99
|
var _types = require("./types");
|
115
|
-
|
116
100
|
Object.keys(_types).forEach(function (key) {
|
117
101
|
if (key === "default" || key === "__esModule") return;
|
118
102
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
@@ -124,5 +108,4 @@ Object.keys(_types).forEach(function (key) {
|
|
124
108
|
}
|
125
109
|
});
|
126
110
|
});
|
127
|
-
|
128
111
|
var _SidebarContext = require("./SidebarContext");
|
package/cjs/Switch/Switch.js
CHANGED
@@ -1,73 +1,54 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
-
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
6
5
|
value: true
|
7
6
|
});
|
8
7
|
exports["default"] = exports.Switch = void 0;
|
9
|
-
|
10
8
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
11
|
-
|
12
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
13
|
-
|
14
10
|
var _clsx = _interopRequireDefault(require("clsx"));
|
15
|
-
|
16
11
|
var _react = require("react");
|
17
|
-
|
18
12
|
var _styles = require("../Button/styles");
|
19
|
-
|
20
13
|
var _RadioGroup = require("../RadioGroup");
|
21
|
-
|
22
14
|
var _satellitePrefixer = _interopRequireDefault(require("../styles/helpers/satellitePrefixer"));
|
23
|
-
|
24
15
|
var _uniqueId = _interopRequireDefault(require("../utils/uniqueId"));
|
25
|
-
|
26
16
|
var _utils = require("./utils");
|
27
|
-
|
28
17
|
var _jsxRuntime = require("react/jsx-runtime");
|
29
|
-
|
30
18
|
var _templateObject, _templateObject2;
|
31
|
-
|
32
19
|
var Switch = function Switch(_ref) {
|
33
20
|
var className = _ref.className,
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
21
|
+
children = _ref.children,
|
22
|
+
value = _ref.value,
|
23
|
+
onChange = _ref.onChange,
|
24
|
+
disabled = _ref.disabled,
|
25
|
+
name = _ref.name,
|
26
|
+
_ref$size = _ref.size,
|
27
|
+
size = _ref$size === void 0 ? "medium" : _ref$size;
|
42
28
|
var _useState = (0, _react.useState)(function () {
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
29
|
+
return (0, _uniqueId["default"])("SwitchName-");
|
30
|
+
}),
|
31
|
+
_useState2 = (0, _slicedToArray2["default"])(_useState, 1),
|
32
|
+
componentDefaultName = _useState2[0];
|
48
33
|
var radioName = name !== null && name !== void 0 ? name : componentDefaultName;
|
49
34
|
var containerRef = (0, _react.useRef)(null);
|
50
35
|
var valueIndicatorRef = (0, _react.useRef)(null);
|
51
|
-
|
52
36
|
var _useState3 = (0, _react.useState)(),
|
53
|
-
|
54
|
-
|
55
|
-
|
37
|
+
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
|
38
|
+
valueIndicatorStyle = _useState4[0],
|
39
|
+
setValueIndicatorStyle = _useState4[1];
|
40
|
+
|
56
41
|
/**
|
57
42
|
* Positionning might be affected by different changes (changes in options order/number/label size, widget size etc),
|
58
43
|
* so we want to recompute things on every render. To avoid infinite loops, we check if the style
|
59
44
|
* actually changed before applying it.
|
60
45
|
*/
|
61
46
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
62
|
-
|
63
|
-
|
64
47
|
(0, _react.useLayoutEffect)(function () {
|
65
48
|
var targetEl = document.querySelector((0, _utils.buildAnimationKeySelector)(radioName, value));
|
66
|
-
|
67
49
|
if (!targetEl || !valueIndicatorRef.current || !containerRef.current) {
|
68
50
|
return setValueIndicatorStyle(undefined);
|
69
51
|
}
|
70
|
-
|
71
52
|
var containerRect = containerRef.current.getBoundingClientRect();
|
72
53
|
var targetRect = targetEl.getBoundingClientRect();
|
73
54
|
var newValueIndicatorStyle = {
|
@@ -78,7 +59,6 @@ var Switch = function Switch(_ref) {
|
|
78
59
|
transitionDuration: "200ms",
|
79
60
|
transitionTimingFunction: "ease-in-out"
|
80
61
|
};
|
81
|
-
|
82
62
|
if (newValueIndicatorStyle.transform !== (valueIndicatorStyle === null || valueIndicatorStyle === void 0 ? void 0 : valueIndicatorStyle.transform) || newValueIndicatorStyle.width !== (valueIndicatorStyle === null || valueIndicatorStyle === void 0 ? void 0 : valueIndicatorStyle.width)) {
|
83
63
|
setValueIndicatorStyle(newValueIndicatorStyle);
|
84
64
|
}
|
@@ -101,7 +81,6 @@ var Switch = function Switch(_ref) {
|
|
101
81
|
})
|
102
82
|
});
|
103
83
|
};
|
104
|
-
|
105
84
|
exports.Switch = Switch;
|
106
85
|
var _default = Switch;
|
107
86
|
exports["default"] = _default;
|
@@ -2,10 +2,9 @@
|
|
2
2
|
|
3
3
|
// @ts-check
|
4
4
|
var plugin = require("tailwindcss/plugin");
|
5
|
-
|
6
5
|
var switchPlugin = plugin(function (_ref) {
|
7
6
|
var addComponents = _ref.addComponents,
|
8
|
-
|
7
|
+
theme = _ref.theme;
|
9
8
|
addComponents({
|
10
9
|
".switch": {
|
11
10
|
// this + position relative helps create a new stack context (helps with z-index)
|
@@ -1,36 +1,24 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
-
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
6
5
|
value: true
|
7
6
|
});
|
8
7
|
exports["default"] = exports.SwitchOption = void 0;
|
9
|
-
|
10
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
11
|
-
|
12
9
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
13
|
-
|
14
10
|
var _RadioGroup = require("../RadioGroup");
|
15
|
-
|
16
11
|
var _satellitePrefixer = _interopRequireDefault(require("../styles/helpers/satellitePrefixer"));
|
17
|
-
|
18
12
|
var _OverflowTooltipWrapper = require("../Tooltip/OverflowTooltipWrapper");
|
19
|
-
|
20
13
|
var _utils = require("./utils");
|
21
|
-
|
22
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
23
|
-
|
24
15
|
var _templateObject, _templateObject2;
|
25
|
-
|
26
16
|
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; }
|
27
|
-
|
28
17
|
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
|
-
|
30
18
|
var SwitchOption = function SwitchOption(_ref) {
|
31
19
|
var value = _ref.value,
|
32
|
-
|
33
|
-
|
20
|
+
disabled = _ref.disabled,
|
21
|
+
children = _ref.children;
|
34
22
|
var context = (0, _RadioGroup.useRadioGroupContext)();
|
35
23
|
var checked = context.value === value;
|
36
24
|
var inputDisabled = context.disabled || disabled;
|
@@ -52,7 +40,6 @@ var SwitchOption = function SwitchOption(_ref) {
|
|
52
40
|
})]
|
53
41
|
}));
|
54
42
|
};
|
55
|
-
|
56
43
|
exports.SwitchOption = SwitchOption;
|
57
44
|
var _default = SwitchOption;
|
58
45
|
exports["default"] = _default;
|
package/cjs/Switch/index.js
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
4
|
-
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
6
5
|
value: true
|
7
6
|
});
|
@@ -12,9 +11,7 @@ Object.defineProperty(exports, "default", {
|
|
12
11
|
return _Switch["default"];
|
13
12
|
}
|
14
13
|
});
|
15
|
-
|
16
14
|
var _Switch = _interopRequireWildcard(require("./Switch"));
|
17
|
-
|
18
15
|
Object.keys(_Switch).forEach(function (key) {
|
19
16
|
if (key === "default" || key === "__esModule") return;
|
20
17
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
@@ -26,9 +23,7 @@ Object.keys(_Switch).forEach(function (key) {
|
|
26
23
|
}
|
27
24
|
});
|
28
25
|
});
|
29
|
-
|
30
26
|
var _SwitchOption = require("./SwitchOption");
|
31
|
-
|
32
27
|
Object.keys(_SwitchOption).forEach(function (key) {
|
33
28
|
if (key === "default" || key === "__esModule") return;
|
34
29
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
@@ -40,7 +35,5 @@ Object.keys(_SwitchOption).forEach(function (key) {
|
|
40
35
|
}
|
41
36
|
});
|
42
37
|
});
|
43
|
-
|
44
38
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
45
|
-
|
46
39
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
package/cjs/Switch/utils.js
CHANGED
@@ -1,31 +1,22 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
-
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
6
5
|
value: true
|
7
6
|
});
|
8
7
|
exports.buildAnimationProps = exports.buildAnimationKeyValue = exports.buildAnimationKeySelector = exports.SWITCH_ANIMATION_KEY = void 0;
|
9
|
-
|
10
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
11
|
-
|
12
9
|
var SWITCH_ANIMATION_KEY = "data-switch-animation-key";
|
13
10
|
exports.SWITCH_ANIMATION_KEY = SWITCH_ANIMATION_KEY;
|
14
|
-
|
15
11
|
var buildAnimationKeyValue = function buildAnimationKeyValue(name, value) {
|
16
12
|
return "".concat(name, "-").concat(value);
|
17
13
|
};
|
18
|
-
|
19
14
|
exports.buildAnimationKeyValue = buildAnimationKeyValue;
|
20
|
-
|
21
15
|
var buildAnimationKeySelector = function buildAnimationKeySelector(name, value) {
|
22
16
|
return "[".concat(SWITCH_ANIMATION_KEY, "=\"").concat(buildAnimationKeyValue(name, value), "\"]");
|
23
17
|
};
|
24
|
-
|
25
18
|
exports.buildAnimationKeySelector = buildAnimationKeySelector;
|
26
|
-
|
27
19
|
var buildAnimationProps = function buildAnimationProps(name, value) {
|
28
20
|
return (0, _defineProperty2["default"])({}, SWITCH_ANIMATION_KEY, buildAnimationKeyValue(name, value));
|
29
21
|
};
|
30
|
-
|
31
22
|
exports.buildAnimationProps = buildAnimationProps;
|
@@ -1,56 +1,32 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
-
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
6
5
|
value: true
|
7
6
|
});
|
8
7
|
exports["default"] = exports.DataTable = void 0;
|
9
|
-
|
10
8
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
11
|
-
|
12
9
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
13
|
-
|
14
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
15
|
-
|
16
11
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
17
|
-
|
18
12
|
var _compact = _interopRequireDefault(require("lodash/compact"));
|
19
|
-
|
20
13
|
var _get = _interopRequireDefault(require("lodash/get"));
|
21
|
-
|
22
14
|
var _react = require("react");
|
23
|
-
|
24
15
|
var _Checkbox = _interopRequireDefault(require("../../Checkbox"));
|
25
|
-
|
26
16
|
var _RadioGroup = require("../../RadioGroup");
|
27
|
-
|
28
17
|
var _Satellite = require("../../Satellite");
|
29
|
-
|
30
18
|
var _satellitePrefixer = _interopRequireDefault(require("../../styles/helpers/satellitePrefixer"));
|
31
|
-
|
32
19
|
var _utils = require("../../utils");
|
33
|
-
|
34
20
|
var _Table = _interopRequireDefault(require("../Table"));
|
35
|
-
|
36
21
|
var _Body = _interopRequireDefault(require("./components/Body"));
|
37
|
-
|
38
22
|
var _Footer = _interopRequireDefault(require("./components/Footer"));
|
39
|
-
|
40
23
|
var _Header = _interopRequireDefault(require("./components/Header"));
|
41
|
-
|
42
24
|
var _Loader = _interopRequireDefault(require("./components/Loader"));
|
43
|
-
|
44
25
|
var _utils2 = require("./utils");
|
45
|
-
|
46
26
|
var _jsxRuntime = require("react/jsx-runtime");
|
47
|
-
|
48
27
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12;
|
49
|
-
|
50
28
|
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; }
|
51
|
-
|
52
29
|
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; }
|
53
|
-
|
54
30
|
var DEFAULT_DATATABLE_LOCALE = {
|
55
31
|
selectAllButton: "Select all",
|
56
32
|
noDataTitle: "Empty",
|
@@ -60,10 +36,10 @@ var DEFAULT_DATATABLE_LOCALE = {
|
|
60
36
|
errorTitle: "Error",
|
61
37
|
errorDescription: "An error occurred while loading data."
|
62
38
|
};
|
63
|
-
|
64
39
|
var DEFAULT_GET_ITEM_ID = function DEFAULT_GET_ITEM_ID(_, idx) {
|
65
40
|
return String(idx);
|
66
41
|
};
|
42
|
+
|
67
43
|
/**
|
68
44
|
* Tables are used to structure content in a grid to make it easier to see relationships and to facilitate understanding.
|
69
45
|
*
|
@@ -83,50 +59,42 @@ var DEFAULT_GET_ITEM_ID = function DEFAULT_GET_ITEM_ID(_, idx) {
|
|
83
59
|
* - If a cell is empty or unavailable, keep the cell empty to reduce noise and help with legibility.
|
84
60
|
* - Truncate long text to make it fit into a cell. However, choose column width wisely based on expected values, and adjust the table accordingly
|
85
61
|
*/
|
86
|
-
|
87
|
-
|
88
62
|
var DataTable = function DataTable(_ref) {
|
89
63
|
var data = _ref.data,
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
64
|
+
itemId = _ref.itemId,
|
65
|
+
columns = _ref.columns,
|
66
|
+
onChange = _ref.onChange,
|
67
|
+
_ref$status = _ref.status,
|
68
|
+
status = _ref$status === void 0 ? "success" : _ref$status,
|
69
|
+
noDataContent = _ref.noDataContent,
|
70
|
+
errorContent = _ref.errorContent,
|
71
|
+
_ref$sorting = _ref.sorting,
|
72
|
+
sorting = _ref$sorting === void 0 ? [] : _ref$sorting,
|
73
|
+
_ref$pagination = _ref.pagination,
|
74
|
+
pagination = _ref$pagination === void 0 ? false : _ref$pagination,
|
75
|
+
_ref$selectMode = _ref.selectMode,
|
76
|
+
selectMode = _ref$selectMode === void 0 ? "none" : _ref$selectMode,
|
77
|
+
selection = _ref.selection,
|
78
|
+
onSelectionChange = _ref.onSelectionChange,
|
79
|
+
canSelectItem = _ref.canSelectItem,
|
80
|
+
canHoverRow = _ref.canHoverRow,
|
81
|
+
onRowHoveredChanged = _ref.onRowHoveredChanged,
|
82
|
+
propsLocale = _ref.locale;
|
109
83
|
var contextLocale = (0, _Satellite.useLocale)("dataTable");
|
110
|
-
|
111
84
|
var locale = _objectSpread(_objectSpread(_objectSpread({}, DEFAULT_DATATABLE_LOCALE), contextLocale), propsLocale);
|
112
|
-
|
113
85
|
if (process.env.NODE_ENV !== "production") {
|
114
86
|
var _selection$length;
|
115
|
-
|
116
87
|
if (itemId === undefined && (sorting.length > 0 || selectMode !== "none")) {
|
117
88
|
console.warn("You did not provide a custom `itemId` function, but you have defined `sorting` and/or `selectMode`. This can lead to unexpected results.");
|
118
89
|
}
|
119
|
-
|
120
90
|
if (selectMode === "single" && ((_selection$length = selection === null || selection === void 0 ? void 0 : selection.length) !== null && _selection$length !== void 0 ? _selection$length : 0) > 1) {
|
121
91
|
console.warn("You can only have one selected item at a time in single `selectMode`.");
|
122
92
|
}
|
123
93
|
}
|
124
|
-
|
125
94
|
var _useState = (0, _react.useState)(),
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
95
|
+
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
96
|
+
hoveredRowId = _useState2[0],
|
97
|
+
setHoveredRowId = _useState2[1];
|
130
98
|
(0, _react.useEffect)(function () {
|
131
99
|
// Reset hovered row when data changes to avoid inconsistent state
|
132
100
|
setHoveredRowId(undefined);
|
@@ -171,7 +139,8 @@ var DataTable = function DataTable(_ref) {
|
|
171
139
|
var isChecked = selectionLength === dataLength;
|
172
140
|
var isIndeterminate = selectionLength > 0 && selectionLength !== dataLength;
|
173
141
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Checkbox["default"], {
|
174
|
-
"aria-label": locale.selectAllButton
|
142
|
+
"aria-label": locale.selectAllButton
|
143
|
+
// Small hack to position the checkbox in the center of the header
|
175
144
|
,
|
176
145
|
className: (0, _satellitePrefixer["default"])(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["absolute mb-2.5"]))),
|
177
146
|
checked: isChecked,
|
@@ -195,7 +164,6 @@ var DataTable = function DataTable(_ref) {
|
|
195
164
|
className: (0, _satellitePrefixer["default"])(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["w-3"])))
|
196
165
|
}].concat((0, _toConsumableArray2["default"])(columns.map(function (c) {
|
197
166
|
var _c$Header;
|
198
|
-
|
199
167
|
return typeof c === "string" ? {
|
200
168
|
id: c,
|
201
169
|
accessor: c,
|
@@ -207,7 +175,6 @@ var DataTable = function DataTable(_ref) {
|
|
207
175
|
var getItemIdInternal = itemId || DEFAULT_GET_ITEM_ID;
|
208
176
|
var rows = data.map(function (item, index) {
|
209
177
|
var _ref4;
|
210
|
-
|
211
178
|
var id = typeof getItemIdInternal === "string" ? String((0, _get["default"])(item, getItemIdInternal, DEFAULT_GET_ITEM_ID(item, index))) : getItemIdInternal(item, index);
|
212
179
|
var hovered = hoveredRowId === id;
|
213
180
|
var sanitizedSelection = (_ref4 = selectMode === "single" ? selection === null || selection === void 0 ? void 0 : selection.slice(0, 1) : selectMode === "none" ? [] : selection) !== null && _ref4 !== void 0 ? _ref4 : [];
|
@@ -223,32 +190,26 @@ var DataTable = function DataTable(_ref) {
|
|
223
190
|
});
|
224
191
|
var internalSorting = computedColumns.map(function (c) {
|
225
192
|
var _sorting$find$, _sorting$find;
|
226
|
-
|
227
193
|
return [c.id, c.sort ? (_sorting$find$ = (_sorting$find = sorting.find(function (_ref5) {
|
228
194
|
var _ref6 = (0, _slicedToArray2["default"])(_ref5, 1),
|
229
|
-
|
230
|
-
|
195
|
+
columnId = _ref6[0];
|
231
196
|
return columnId === c.id;
|
232
197
|
})) === null || _sorting$find === void 0 ? void 0 : _sorting$find[1]) !== null && _sorting$find$ !== void 0 ? _sorting$find$ : "desc" : "none"];
|
233
198
|
});
|
234
|
-
|
235
199
|
var shouldRenderPagination = function shouldRenderPagination() {
|
236
200
|
if ((0, _utils2.isDeterminatePagination)(pagination)) return pagination && pagination.totalItemsCount > 0;
|
237
201
|
if ((0, _utils2.isIndeterminatePagination)(pagination)) return pagination && data.length > 0;
|
238
202
|
return false;
|
239
203
|
};
|
240
|
-
|
241
204
|
var onRowHoverChange = function onRowHoverChange(row) {
|
242
205
|
setHoveredRowId(row === null || row === void 0 ? void 0 : row.id);
|
243
206
|
onRowHoveredChanged === null || onRowHoveredChanged === void 0 ? void 0 : onRowHoveredChanged(row);
|
244
207
|
};
|
245
|
-
|
246
208
|
var onToggleSort = function onToggleSort(columnId, direction) {
|
247
209
|
var newSorting = internalSorting.map(function (_ref7) {
|
248
210
|
var _ref8 = (0, _slicedToArray2["default"])(_ref7, 2),
|
249
|
-
|
250
|
-
|
251
|
-
|
211
|
+
colId = _ref8[0],
|
212
|
+
d = _ref8[1];
|
252
213
|
return columnId === colId ? [columnId, direction] : [colId, d];
|
253
214
|
});
|
254
215
|
onChange === null || onChange === void 0 ? void 0 : onChange({
|
@@ -256,11 +217,9 @@ var DataTable = function DataTable(_ref) {
|
|
256
217
|
sorting: newSorting
|
257
218
|
});
|
258
219
|
};
|
259
|
-
|
260
220
|
var handlePaginationChange = function handlePaginationChange(dataConfiguration) {
|
261
221
|
return onChange === null || onChange === void 0 ? void 0 : onChange(dataConfiguration);
|
262
222
|
};
|
263
|
-
|
264
223
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
265
224
|
className: (0, _satellitePrefixer["default"])(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["relative"]))),
|
266
225
|
children: [status === "loading" && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
@@ -297,7 +256,6 @@ var DataTable = function DataTable(_ref) {
|
|
297
256
|
})]
|
298
257
|
});
|
299
258
|
};
|
300
|
-
|
301
259
|
exports.DataTable = DataTable;
|
302
260
|
var _default = DataTable;
|
303
261
|
exports["default"] = _default;
|
@@ -1,11 +1,11 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
// purgecss whitelist: th, td, tr
|
4
|
-
var plugin = require("tailwindcss/plugin");
|
5
4
|
|
5
|
+
var plugin = require("tailwindcss/plugin");
|
6
6
|
var datatablePlugin = plugin(function (_ref) {
|
7
7
|
var addComponents = _ref.addComponents,
|
8
|
-
|
8
|
+
theme = _ref.theme;
|
9
9
|
addComponents({
|
10
10
|
".datatable": {
|
11
11
|
th: {
|
@@ -1,51 +1,37 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
-
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
6
5
|
value: true
|
7
6
|
});
|
8
7
|
exports["default"] = exports.Body = void 0;
|
9
|
-
|
10
8
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
11
|
-
|
12
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
13
|
-
|
14
10
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
15
|
-
|
16
11
|
var _EmptyState = _interopRequireDefault(require("../../../EmptyState"));
|
17
|
-
|
18
12
|
var _satellitePrefixer = _interopRequireDefault(require("../../../styles/helpers/satellitePrefixer"));
|
19
|
-
|
20
13
|
var _utils = require("../utils");
|
21
|
-
|
22
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
23
|
-
|
24
15
|
var _react = require("react");
|
25
|
-
|
26
16
|
var _templateObject, _templateObject2, _templateObject3;
|
27
|
-
|
28
17
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
29
|
-
|
30
18
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
31
|
-
|
32
19
|
var Body = function Body(_ref) {
|
33
20
|
var rows = _ref.rows,
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
21
|
+
columns = _ref.columns,
|
22
|
+
status = _ref.status,
|
23
|
+
noDataContent = _ref.noDataContent,
|
24
|
+
errorContent = _ref.errorContent,
|
25
|
+
selectMode = _ref.selectMode,
|
26
|
+
_ref$selection = _ref.selection,
|
27
|
+
selection = _ref$selection === void 0 ? [] : _ref$selection,
|
28
|
+
onSelectionChange = _ref.onSelectionChange,
|
29
|
+
onRowHoverChange = _ref.onRowHoverChange,
|
30
|
+
_ref$canHoverRow = _ref.canHoverRow,
|
31
|
+
canHoverRow = _ref$canHoverRow === void 0 ? function () {
|
32
|
+
return true;
|
33
|
+
} : _ref$canHoverRow,
|
34
|
+
locale = _ref.locale;
|
49
35
|
var handleRowSelection = function handleRowSelection(row) {
|
50
36
|
if (!onSelectionChange) return;
|
51
37
|
var rowId = row.id;
|
@@ -55,7 +41,6 @@ var Body = function Body(_ref) {
|
|
55
41
|
}) : selectMode === "multi" ? [].concat((0, _toConsumableArray2["default"])(selection), [rowId]) : [rowId];
|
56
42
|
onSelectionChange(newSelection);
|
57
43
|
};
|
58
|
-
|
59
44
|
var additionalRowProps = function additionalRowProps(row) {
|
60
45
|
return _objectSpread(_objectSpread({}, canHoverRow(row) ? {
|
61
46
|
onMouseEnter: function onMouseEnter() {
|
@@ -73,7 +58,6 @@ var Body = function Body(_ref) {
|
|
73
58
|
}
|
74
59
|
});
|
75
60
|
};
|
76
|
-
|
77
61
|
if (status === "error") {
|
78
62
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("tbody", {
|
79
63
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("tr", {
|
@@ -92,7 +76,6 @@ var Body = function Body(_ref) {
|
|
92
76
|
})
|
93
77
|
});
|
94
78
|
}
|
95
|
-
|
96
79
|
if (rows.length === 0 && status !== "loading") {
|
97
80
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("tbody", {
|
98
81
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("tr", {
|
@@ -111,7 +94,6 @@ var Body = function Body(_ref) {
|
|
111
94
|
})
|
112
95
|
});
|
113
96
|
}
|
114
|
-
|
115
97
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("tbody", {
|
116
98
|
children: rows.map(function (row, rowIndex) {
|
117
99
|
return /*#__PURE__*/(0, _react.createElement)("tr", _objectSpread(_objectSpread({}, additionalRowProps(row)), {}, {
|
@@ -134,7 +116,6 @@ var Body = function Body(_ref) {
|
|
134
116
|
})
|
135
117
|
});
|
136
118
|
};
|
137
|
-
|
138
119
|
exports.Body = Body;
|
139
120
|
var _default = Body;
|
140
121
|
exports["default"] = _default;
|