@algolia/satellite 1.0.0-beta.160 → 1.0.0-beta.162
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/AnnouncementBadge/AnnouncementBadge.d.ts +2 -2
- package/cjs/AutoComplete/AutoComplete.tailwind.js +4 -1
- package/cjs/AutoComplete/components/AutoCompleteEmptyState.d.ts +2 -2
- package/cjs/AutoComplete/components/DefaultOptionItem.d.ts +2 -2
- package/cjs/Avatars/ApplicationAvatar.d.ts +2 -2
- package/cjs/Avatars/UserAvatar.d.ts +2 -2
- package/cjs/Badge/Badge.d.ts +3 -3
- package/cjs/Badge/Badge.js +6 -3
- package/cjs/Banners/Alert/Alert.d.ts +2 -2
- package/cjs/Banners/BigBertha/BigBertha.d.ts +2 -2
- package/cjs/Banners/Promote/Promote.d.ts +2 -2
- package/cjs/Button/ButtonGroup.d.ts +2 -2
- package/cjs/Button/PolymorphicIconButton.d.ts +1 -1
- package/cjs/Button/PolymorphicIconButton.js +4 -4
- package/cjs/Card/components/CardHeader.d.ts +2 -2
- package/cjs/Card/components/CardTitle.d.ts +2 -2
- package/cjs/Checkbox/Checkbox.js +3 -3
- package/cjs/Checkbox/Checkbox.tailwind.js +1 -1
- package/cjs/ClickAwayContainer/ClickAwayContainer.d.ts +2 -2
- package/cjs/DatePicker/DatePicker/DatePicker.d.ts +2 -2
- package/cjs/DatePicker/DateRangePicker/DateRangePicker.d.ts +2 -2
- package/cjs/DatePicker/DateRangePicker/DateRangePickerDisplay.d.ts +2 -2
- package/cjs/DatePicker/components/Calendar.d.ts +2 -2
- package/cjs/DatePicker/components/Display.d.ts +2 -2
- package/cjs/DatePicker/components/Footer.d.ts +2 -2
- package/cjs/DatePicker/components/FooterActions.d.ts +2 -2
- package/cjs/DatePicker/components/Modal.d.ts +2 -2
- package/cjs/DatePicker/components/NavBar.d.ts +2 -2
- package/cjs/DatePicker/components/SidePanel.d.ts +2 -2
- package/cjs/Dropdown/Dropdown.d.ts +20 -34
- package/cjs/Dropdown/components/DropdownButtonItem.d.ts +2 -7
- package/cjs/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItem.d.ts +2 -2
- package/cjs/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsGroup.d.ts +2 -2
- package/cjs/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsMultiGroup.d.ts +2 -1
- package/cjs/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsSingleGroup.d.ts +2 -1
- package/cjs/Dropdown/components/DropdownFooterItem.d.ts +2 -2
- package/cjs/Dropdown/components/DropdownLinkItem.d.ts +2 -7
- package/cjs/Dropdown/components/DropdownRadioItem.d.ts +2 -7
- package/cjs/Dropdown/components/DropdownTitle.d.ts +2 -2
- package/cjs/Dropdown/components/DropdownToggleItem.d.ts +2 -7
- package/cjs/Dropzone/Dropzone.d.ts +2 -2
- package/cjs/EmptyState/EmptyState.d.ts +2 -2
- package/cjs/Field/Field.d.ts +2 -2
- package/cjs/Flag/Flag.d.ts +2 -2
- package/cjs/Flag/Flags.d.ts +2 -2
- package/cjs/FlexGrid/FlexGrid.d.ts +2 -2
- package/cjs/HelpUnderline/HelpUnderline.d.ts +5 -6
- package/cjs/HelpUnderline/HelpUnderline.js +13 -10
- package/cjs/Input/Input.tailwind.js +28 -4
- package/cjs/Insert/Insert.d.ts +2 -2
- package/cjs/KeyboardKey/KeyboardKey.d.ts +2 -2
- package/cjs/Medallion/Medallion.d.ts +2 -2
- package/cjs/Modal/Modal.d.ts +7 -5
- package/cjs/Modal/components/ModalFooter.d.ts +2 -2
- package/cjs/Modal/components/ModalSection.d.ts +2 -2
- package/cjs/Pagination/CompactPagination/CompactPagination.d.ts +2 -2
- package/cjs/Pagination/Pagination/Pagination.d.ts +2 -2
- package/cjs/ProgressBar/ProgressBar.d.ts +2 -2
- package/cjs/ProgressSpinner/ProgressSpinner.d.ts +2 -2
- package/cjs/RadioGroup/RadioButton.tailwind.js +4 -1
- package/cjs/RadioGroup/RadioGroup.d.ts +6 -6
- package/cjs/RangeSlider/RangeSlider.js +2 -2
- package/cjs/Satellite/Satellite.d.ts +2 -3
- package/cjs/Satellite/Satellite.js +27 -16
- package/cjs/Satellite/SatelliteContext.d.ts +1 -1
- package/cjs/Satellite/SatelliteContext.js +2 -1
- package/cjs/ScrollIndicator/ScrollIndicator.d.ts +2 -2
- package/cjs/Select/Select.tailwind.js +2 -2
- package/cjs/Separator/Separator.d.ts +8 -0
- package/cjs/Separator/Separator.js +29 -0
- package/cjs/Separator/Separator.tailwind.d.ts +5 -0
- package/cjs/Separator/Separator.tailwind.js +25 -0
- package/cjs/Separator/index.d.ts +2 -0
- package/cjs/Separator/index.js +27 -0
- package/cjs/Sidebar/Sidebar.d.ts +2 -2
- package/cjs/Sidebar/SidebarButtonLink.d.ts +2 -2
- package/cjs/Sidebar/SidebarButtonLink.js +8 -14
- package/cjs/Sidebar/SidebarHeader.d.ts +2 -2
- package/cjs/Sidebar/SidebarHeading.d.ts +2 -2
- package/cjs/Sidebar/SidebarLink.d.ts +2 -2
- package/cjs/Sidebar/SidebarLinksGroup/ActiveLinkIndicator.d.ts +2 -2
- package/cjs/Sidebar/SidebarLinksGroup/SidebarGroupLink.d.ts +2 -2
- package/cjs/Sidebar/SidebarLinksGroup/SidebarLinksGroup.d.ts +2 -2
- package/cjs/Sidebar/SidebarNav.d.ts +2 -2
- package/cjs/Switch/Switch.d.ts +2 -2
- package/cjs/Switch/SwitchOption.d.ts +2 -2
- package/cjs/Tables/DataTable/DataTable.d.ts +4 -2
- package/cjs/Tables/DataTable/DataTable.js +9 -4
- package/cjs/Tables/DataTable/components/Footer.d.ts +2 -2
- package/cjs/Tables/DataTable/components/Loader.d.ts +2 -2
- package/cjs/Tables/Table/Table.d.ts +2 -2
- package/cjs/Tables/Table/components/TableFooter.d.ts +2 -2
- package/cjs/Tabs/ContentTabs.d.ts +2 -2
- package/cjs/Tabs/LinkTabs.d.ts +2 -2
- package/cjs/Tabs/components/LinkTab.d.ts +2 -2
- package/cjs/Tag/Tag.js +7 -7
- package/cjs/TextWrap/TextWrap.d.ts +2 -2
- package/cjs/Toggle/Toggle.js +3 -13
- package/cjs/Toggle/Toggle.tailwind.js +8 -2
- package/cjs/Tooltip/OverflowTooltipWrapper.d.ts +2 -5
- package/cjs/Tooltip/OverflowTooltipWrapper.js +20 -78
- package/cjs/Tooltip/Tooltip.d.ts +6 -6
- package/cjs/Tooltip/Tooltip.js +6 -6
- package/cjs/Tooltip/Tooltip.tailwind.js +85 -62
- package/cjs/Tooltip/TooltipWrapper.d.ts +8 -21
- package/cjs/Tooltip/TooltipWrapper.js +49 -158
- package/cjs/Tooltip/types.d.ts +57 -6
- package/cjs/Tooltip/utils.d.ts +1 -0
- package/cjs/Tooltip/utils.js +10 -0
- package/cjs/UserContent/UserContent.d.ts +2 -2
- package/cjs/index.d.ts +2 -1
- package/cjs/index.js +20 -8
- package/cjs/styles/tailwind.config.js +1 -1
- package/cjs/types.d.ts +6 -6
- package/esm/AnnouncementBadge/AnnouncementBadge.d.ts +2 -2
- package/esm/AutoComplete/AutoComplete.tailwind.js +4 -1
- package/esm/AutoComplete/components/AutoCompleteEmptyState.d.ts +2 -2
- package/esm/AutoComplete/components/DefaultOptionItem.d.ts +2 -2
- package/esm/Avatars/ApplicationAvatar.d.ts +2 -2
- package/esm/Avatars/UserAvatar.d.ts +2 -2
- package/esm/Badge/Badge.d.ts +3 -3
- package/esm/Badge/Badge.js +6 -3
- package/esm/Banners/Alert/Alert.d.ts +2 -2
- package/esm/Banners/BigBertha/BigBertha.d.ts +2 -2
- package/esm/Banners/Promote/Promote.d.ts +2 -2
- package/esm/Button/ButtonGroup.d.ts +2 -2
- package/esm/Button/PolymorphicIconButton.d.ts +1 -1
- package/esm/Button/PolymorphicIconButton.js +4 -4
- package/esm/Card/components/CardHeader.d.ts +2 -2
- package/esm/Card/components/CardTitle.d.ts +2 -2
- package/esm/Checkbox/Checkbox.js +3 -3
- package/esm/Checkbox/Checkbox.tailwind.js +1 -1
- package/esm/ClickAwayContainer/ClickAwayContainer.d.ts +2 -2
- package/esm/DatePicker/DatePicker/DatePicker.d.ts +2 -2
- package/esm/DatePicker/DateRangePicker/DateRangePicker.d.ts +2 -2
- package/esm/DatePicker/DateRangePicker/DateRangePickerDisplay.d.ts +2 -2
- package/esm/DatePicker/components/Calendar.d.ts +2 -2
- package/esm/DatePicker/components/Display.d.ts +2 -2
- package/esm/DatePicker/components/Footer.d.ts +2 -2
- package/esm/DatePicker/components/FooterActions.d.ts +2 -2
- package/esm/DatePicker/components/Modal.d.ts +2 -2
- package/esm/DatePicker/components/NavBar.d.ts +2 -2
- package/esm/DatePicker/components/SidePanel.d.ts +2 -2
- package/esm/Dropdown/Dropdown.d.ts +20 -34
- package/esm/Dropdown/components/DropdownButtonItem.d.ts +2 -7
- package/esm/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItem.d.ts +2 -2
- package/esm/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsGroup.d.ts +2 -2
- package/esm/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsMultiGroup.d.ts +2 -1
- package/esm/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsSingleGroup.d.ts +2 -1
- package/esm/Dropdown/components/DropdownFooterItem.d.ts +2 -2
- package/esm/Dropdown/components/DropdownLinkItem.d.ts +2 -7
- package/esm/Dropdown/components/DropdownRadioItem.d.ts +2 -7
- package/esm/Dropdown/components/DropdownTitle.d.ts +2 -2
- package/esm/Dropdown/components/DropdownToggleItem.d.ts +2 -7
- package/esm/Dropzone/Dropzone.d.ts +2 -2
- package/esm/EmptyState/EmptyState.d.ts +2 -2
- package/esm/Field/Field.d.ts +2 -2
- package/esm/Flag/Flag.d.ts +2 -2
- package/esm/Flag/Flags.d.ts +2 -2
- package/esm/FlexGrid/FlexGrid.d.ts +2 -2
- package/esm/HelpUnderline/HelpUnderline.d.ts +5 -6
- package/esm/HelpUnderline/HelpUnderline.js +13 -10
- package/esm/Input/Input.tailwind.js +28 -4
- package/esm/Insert/Insert.d.ts +2 -2
- package/esm/KeyboardKey/KeyboardKey.d.ts +2 -2
- package/esm/Medallion/Medallion.d.ts +2 -2
- package/esm/Modal/Modal.d.ts +7 -5
- package/esm/Modal/components/ModalFooter.d.ts +2 -2
- package/esm/Modal/components/ModalSection.d.ts +2 -2
- package/esm/Pagination/CompactPagination/CompactPagination.d.ts +2 -2
- package/esm/Pagination/Pagination/Pagination.d.ts +2 -2
- package/esm/ProgressBar/ProgressBar.d.ts +2 -2
- package/esm/ProgressSpinner/ProgressSpinner.d.ts +2 -2
- package/esm/RadioGroup/RadioButton.tailwind.js +4 -1
- package/esm/RadioGroup/RadioGroup.d.ts +6 -6
- package/esm/RangeSlider/RangeSlider.js +2 -2
- package/esm/Satellite/Satellite.d.ts +2 -3
- package/esm/Satellite/Satellite.js +26 -14
- package/esm/Satellite/SatelliteContext.d.ts +1 -1
- package/esm/Satellite/SatelliteContext.js +2 -1
- package/esm/ScrollIndicator/ScrollIndicator.d.ts +2 -2
- package/esm/Select/Select.tailwind.js +2 -2
- package/esm/Separator/Separator.d.ts +8 -0
- package/esm/Separator/Separator.js +17 -0
- package/esm/Separator/Separator.tailwind.d.ts +5 -0
- package/esm/Separator/Separator.tailwind.js +24 -0
- package/esm/Separator/index.d.ts +2 -0
- package/esm/Separator/index.js +2 -0
- package/esm/Sidebar/Sidebar.d.ts +2 -2
- package/esm/Sidebar/SidebarButtonLink.d.ts +2 -2
- package/esm/Sidebar/SidebarButtonLink.js +8 -14
- package/esm/Sidebar/SidebarHeader.d.ts +2 -2
- package/esm/Sidebar/SidebarHeading.d.ts +2 -2
- package/esm/Sidebar/SidebarLink.d.ts +2 -2
- package/esm/Sidebar/SidebarLinksGroup/ActiveLinkIndicator.d.ts +2 -2
- package/esm/Sidebar/SidebarLinksGroup/SidebarGroupLink.d.ts +2 -2
- package/esm/Sidebar/SidebarLinksGroup/SidebarLinksGroup.d.ts +2 -2
- package/esm/Sidebar/SidebarNav.d.ts +2 -2
- package/esm/Switch/Switch.d.ts +2 -2
- package/esm/Switch/SwitchOption.d.ts +2 -2
- package/esm/Tables/DataTable/DataTable.d.ts +4 -2
- package/esm/Tables/DataTable/DataTable.js +9 -4
- package/esm/Tables/DataTable/components/Footer.d.ts +2 -2
- package/esm/Tables/DataTable/components/Loader.d.ts +2 -2
- package/esm/Tables/Table/Table.d.ts +2 -2
- package/esm/Tables/Table/components/TableFooter.d.ts +2 -2
- package/esm/Tabs/ContentTabs.d.ts +2 -2
- package/esm/Tabs/LinkTabs.d.ts +2 -2
- package/esm/Tabs/components/LinkTab.d.ts +2 -2
- package/esm/Tag/Tag.js +7 -7
- package/esm/TextWrap/TextWrap.d.ts +2 -2
- package/esm/Toggle/Toggle.js +3 -13
- package/esm/Toggle/Toggle.tailwind.js +8 -2
- package/esm/Tooltip/OverflowTooltipWrapper.d.ts +2 -5
- package/esm/Tooltip/OverflowTooltipWrapper.js +20 -78
- package/esm/Tooltip/Tooltip.d.ts +6 -6
- package/esm/Tooltip/Tooltip.js +6 -6
- package/esm/Tooltip/Tooltip.tailwind.js +84 -62
- package/esm/Tooltip/TooltipWrapper.d.ts +8 -21
- package/esm/Tooltip/TooltipWrapper.js +47 -157
- package/esm/Tooltip/types.d.ts +57 -6
- package/esm/Tooltip/utils.d.ts +1 -0
- package/esm/Tooltip/utils.js +3 -0
- package/esm/UserContent/UserContent.d.ts +2 -2
- package/esm/index.d.ts +2 -1
- package/esm/index.js +2 -1
- package/esm/styles/tailwind.config.js +1 -1
- package/esm/types.d.ts +6 -6
- package/package.json +3 -1
- package/satellite.min.css +1 -1
@@ -1,4 +1,4 @@
|
|
1
|
-
import type {
|
1
|
+
import type { ReactNode, VFC } from "react";
|
2
2
|
export declare type SidebarNavSpacing = "small" | "large";
|
3
3
|
export declare type SidebarNavProps = {
|
4
4
|
id?: string;
|
@@ -7,4 +7,4 @@ export declare type SidebarNavProps = {
|
|
7
7
|
label: string;
|
8
8
|
children: ReactNode;
|
9
9
|
};
|
10
|
-
export declare const SidebarNav:
|
10
|
+
export declare const SidebarNav: VFC<SidebarNavProps>;
|
package/esm/Switch/Switch.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import type {
|
1
|
+
import type { ReactNode, VFC } from "react";
|
2
2
|
import type { SwitchSize } from "./types";
|
3
3
|
export interface SwitchProps {
|
4
4
|
className?: string;
|
@@ -9,5 +9,5 @@ export interface SwitchProps {
|
|
9
9
|
size?: SwitchSize;
|
10
10
|
name?: string;
|
11
11
|
}
|
12
|
-
export declare const Switch:
|
12
|
+
export declare const Switch: VFC<SwitchProps>;
|
13
13
|
export default Switch;
|
@@ -1,8 +1,8 @@
|
|
1
|
-
import type {
|
1
|
+
import type { ReactNode, VFC } from "react";
|
2
2
|
export interface SwitchOptionProps {
|
3
3
|
value: string;
|
4
4
|
disabled?: boolean;
|
5
5
|
children: ReactNode;
|
6
6
|
}
|
7
|
-
export declare const SwitchOption:
|
7
|
+
export declare const SwitchOption: VFC<SwitchOptionProps>;
|
8
8
|
export default SwitchOption;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import type { ReactNode } from "react";
|
2
2
|
import type { ColumnDefinition, DataConfiguration, GetItemId, PaginationConfiguration, Row, SelectMode, Sorting, Status } from "./types";
|
3
3
|
declare type CanSelectItem<Item> = (item: Item, idx: number) => boolean;
|
4
|
+
export declare type SortMode = "single" | "multi";
|
4
5
|
export declare type DataTableLocale = {
|
5
6
|
selectAllButton?: string;
|
6
7
|
noDataTitle?: string;
|
@@ -14,7 +15,6 @@ interface BaseDataTableProps<Item> {
|
|
14
15
|
data: Item[];
|
15
16
|
itemId?: GetItemId<Item>;
|
16
17
|
pagination?: PaginationConfiguration;
|
17
|
-
sorting?: Sorting[];
|
18
18
|
onChange?(dataConfiguration: DataConfiguration): void;
|
19
19
|
status?: Status;
|
20
20
|
noDataContent?: ReactNode;
|
@@ -22,6 +22,8 @@ interface BaseDataTableProps<Item> {
|
|
22
22
|
columns: ColumnDefinition<Item>[];
|
23
23
|
canHoverRow?(row: Row<Item>): boolean;
|
24
24
|
onRowHoveredChanged?(row: Row<Item> | null): void;
|
25
|
+
sorting?: Sorting[];
|
26
|
+
sortMode?: SortMode;
|
25
27
|
locale?: DataTableLocale;
|
26
28
|
}
|
27
29
|
declare type DataTableWithSelectMode<Item> = {
|
@@ -56,5 +58,5 @@ export declare type DataTableProps<Item> = BaseDataTableProps<Item> & (DataTable
|
|
56
58
|
* - If a cell is empty or unavailable, keep the cell empty to reduce noise and help with legibility.
|
57
59
|
* - Truncate long text to make it fit into a cell. However, choose column width wisely based on expected values, and adjust the table accordingly
|
58
60
|
*/
|
59
|
-
export declare const DataTable: <Item extends {}>({ data, itemId, columns, onChange, status, noDataContent, errorContent, sorting, pagination, selectMode, selection, onSelectionChange, canSelectItem, canHoverRow, onRowHoveredChanged, locale: propsLocale, }: DataTableProps<Item>) => JSX.Element;
|
61
|
+
export declare const DataTable: <Item extends {}>({ data, itemId, columns, onChange, status, noDataContent, errorContent, sorting, sortMode, pagination, selectMode, selection, onSelectionChange, canSelectItem, canHoverRow, onRowHoveredChanged, locale: propsLocale, }: DataTableProps<Item>) => JSX.Element;
|
60
62
|
export default DataTable;
|
@@ -67,6 +67,8 @@ export var DataTable = function DataTable(_ref) {
|
|
67
67
|
errorContent = _ref.errorContent,
|
68
68
|
_ref$sorting = _ref.sorting,
|
69
69
|
sorting = _ref$sorting === void 0 ? [] : _ref$sorting,
|
70
|
+
_ref$sortMode = _ref.sortMode,
|
71
|
+
sortMode = _ref$sortMode === void 0 ? "single" : _ref$sortMode,
|
70
72
|
_ref$pagination = _ref.pagination,
|
71
73
|
pagination = _ref$pagination === void 0 ? false : _ref$pagination,
|
72
74
|
_ref$selectMode = _ref.selectMode,
|
@@ -183,12 +185,15 @@ export var DataTable = function DataTable(_ref) {
|
|
183
185
|
};
|
184
186
|
});
|
185
187
|
var internalSorting = computedColumns.map(function (c) {
|
186
|
-
var _sorting$find
|
187
|
-
|
188
|
+
var _sorting$find;
|
189
|
+
if (c.sort === undefined) return [c.id, "none"];
|
190
|
+
var columnDirection = (_sorting$find = sorting.find(function (_ref5) {
|
188
191
|
var _ref6 = _slicedToArray(_ref5, 1),
|
189
192
|
columnId = _ref6[0];
|
190
193
|
return columnId === c.id;
|
191
|
-
})) === null || _sorting$find === void 0 ? void 0 : _sorting$find[1]
|
194
|
+
})) === null || _sorting$find === void 0 ? void 0 : _sorting$find[1];
|
195
|
+
if (columnDirection) return [c.id, columnDirection];
|
196
|
+
return [c.id, "desc"];
|
192
197
|
});
|
193
198
|
var shouldRenderPagination = function shouldRenderPagination() {
|
194
199
|
if (isDeterminatePagination(pagination)) return pagination && pagination.totalItemsCount > 0;
|
@@ -204,7 +209,7 @@ export var DataTable = function DataTable(_ref) {
|
|
204
209
|
var _ref8 = _slicedToArray(_ref7, 2),
|
205
210
|
colId = _ref8[0],
|
206
211
|
d = _ref8[1];
|
207
|
-
return columnId === colId ? [columnId, direction] : [colId, d];
|
212
|
+
return columnId === colId ? [columnId, direction] : [colId, sortMode === "multi" ? d : "none"];
|
208
213
|
});
|
209
214
|
onChange === null || onChange === void 0 ? void 0 : onChange({
|
210
215
|
pagination: pagination,
|
@@ -1,8 +1,8 @@
|
|
1
|
-
|
1
|
+
import type { VFC } from "react";
|
2
2
|
import type { DataConfiguration, PaginationConfiguration } from "../types";
|
3
3
|
export interface FooterProps {
|
4
4
|
pagination: PaginationConfiguration;
|
5
5
|
onChange(dataConfiguration: DataConfiguration): void;
|
6
6
|
}
|
7
|
-
export declare const Footer:
|
7
|
+
export declare const Footer: VFC<FooterProps>;
|
8
8
|
export default Footer;
|
@@ -1,8 +1,8 @@
|
|
1
|
-
|
1
|
+
import { VFC } from "react";
|
2
2
|
import type { DataTableLocale } from "../DataTable";
|
3
3
|
export interface LoaderProps {
|
4
4
|
className?: string;
|
5
5
|
locale: Required<DataTableLocale>;
|
6
6
|
}
|
7
|
-
export declare const Loader:
|
7
|
+
export declare const Loader: VFC<LoaderProps>;
|
8
8
|
export default Loader;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { DetailedHTMLProps, ReactNode, TableHTMLAttributes } from "react";
|
1
|
+
import type { DetailedHTMLProps, ReactNode, TableHTMLAttributes, VFC } from "react";
|
2
2
|
export interface TableProps extends DetailedHTMLProps<TableHTMLAttributes<HTMLTableElement>, HTMLTableElement> {
|
3
3
|
footer?: ReactNode;
|
4
4
|
smallFooter?: boolean;
|
@@ -24,5 +24,5 @@ export interface TableProps extends DetailedHTMLProps<TableHTMLAttributes<HTMLTa
|
|
24
24
|
* - If a cell is empty or unavailable, keep the cell empty to reduce noise and help with legibility.
|
25
25
|
* - Truncate long text to make it fit into a cell. However, choose column width wisely based on expected values, and adjust the table accordingly
|
26
26
|
*/
|
27
|
-
export declare const Table:
|
27
|
+
export declare const Table: VFC<TableProps>;
|
28
28
|
export default Table;
|
@@ -1,8 +1,8 @@
|
|
1
|
-
import type { ReactNode } from "react";
|
1
|
+
import type { ReactNode, VFC } from "react";
|
2
2
|
export declare type FooterSizes = "default" | "small";
|
3
3
|
export interface FooterProps {
|
4
4
|
size?: FooterSizes;
|
5
5
|
children?: ReactNode;
|
6
6
|
}
|
7
|
-
export declare const TableFooter:
|
7
|
+
export declare const TableFooter: VFC<FooterProps>;
|
8
8
|
export default TableFooter;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
import type { VFC } from "react";
|
2
2
|
import type { ContentTabsProps } from "./types";
|
3
|
-
export declare const ContentTabs:
|
3
|
+
export declare const ContentTabs: VFC<ContentTabsProps>;
|
4
4
|
export default ContentTabs;
|
package/esm/Tabs/LinkTabs.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
import type { VFC } from "react";
|
2
2
|
import type { LinkTabsProps, UrlMatcher } from "./types";
|
3
3
|
export declare const defaultUrlMatcher: UrlMatcher;
|
4
4
|
/**
|
@@ -29,5 +29,5 @@ export declare const defaultUrlMatcher: UrlMatcher;
|
|
29
29
|
* - Use more than one row of tabs. Multiple rows create jumping UI elements, which make it impossible for users to remember which tabs they've already visited
|
30
30
|
* - Place the tab on the sides or bottom of the page, where users often overlook them
|
31
31
|
*/
|
32
|
-
export declare const LinkTabs:
|
32
|
+
export declare const LinkTabs: VFC<LinkTabsProps>;
|
33
33
|
export default LinkTabs;
|
@@ -1,9 +1,9 @@
|
|
1
|
-
import type { MouseEventHandler } from "react";
|
1
|
+
import type { MouseEventHandler, VFC } from "react";
|
2
2
|
import type { LinkTab as LinkTabType } from "../types";
|
3
3
|
export interface LinkTabProps {
|
4
4
|
tab: LinkTabType;
|
5
5
|
onClick?: MouseEventHandler<HTMLAnchorElement>;
|
6
6
|
selected: boolean;
|
7
7
|
}
|
8
|
-
export declare const LinkTab:
|
8
|
+
export declare const LinkTab: VFC<LinkTabProps>;
|
9
9
|
export default LinkTab;
|
package/esm/Tag/Tag.js
CHANGED
@@ -2,7 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
3
3
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
4
4
|
var _excluded = ["children", "variant", "className", "onAdd", "addTooltip", "onRemove", "removeTooltip", "locale"];
|
5
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20
|
5
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20;
|
6
6
|
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; }
|
7
7
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
8
8
|
import cx from "clsx";
|
@@ -87,7 +87,7 @@ export var Tag = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
87
87
|
onRemove === null || onRemove === void 0 ? void 0 : onRemove(evt);
|
88
88
|
};
|
89
89
|
var content = /*#__PURE__*/_jsx("span", {
|
90
|
-
className: stl(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["truncate flex-1
|
90
|
+
className: stl(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["truncate flex-1"]))),
|
91
91
|
children: children
|
92
92
|
});
|
93
93
|
return /*#__PURE__*/_jsxs("span", _objectSpread(_objectSpread({}, props), {}, {
|
@@ -96,10 +96,9 @@ export var Tag = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
96
96
|
children: [addable ? /*#__PURE__*/_jsx(TooltipWrapper, {
|
97
97
|
content: addTooltip,
|
98
98
|
hideDelay: 0,
|
99
|
-
|
100
|
-
wrapperClassName: stl(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["h-full"]))),
|
99
|
+
side: "bottom",
|
101
100
|
children: /*#__PURE__*/_jsxs("button", {
|
102
|
-
className: cx(stl(
|
101
|
+
className: cx(stl(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["tag-add-button"]))), !removable && stl(_templateObject18 || (_templateObject18 = _taggedTemplateLiteral(["-mr-2"]))), BUTTON_VARIANT_CLASSNAMES[variant]),
|
103
102
|
type: "button",
|
104
103
|
onClick: handleAdd,
|
105
104
|
"aria-label": typeof locale.addButton === "function" ? locale.addButton(title) : locale.addButton,
|
@@ -110,9 +109,10 @@ export var Tag = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
110
109
|
}) : content, removable && /*#__PURE__*/_jsx(TooltipWrapper, {
|
111
110
|
content: removeTooltip,
|
112
111
|
hideDelay: 0,
|
113
|
-
|
112
|
+
side: "bottom",
|
113
|
+
align: "start",
|
114
114
|
children: /*#__PURE__*/_jsx("button", {
|
115
|
-
className: cx(stl(
|
115
|
+
className: cx(stl(_templateObject19 || (_templateObject19 = _taggedTemplateLiteral(["tag-close-button p-1"]))), !addable && stl(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral(["ml-2"]))), BUTTON_VARIANT_CLASSNAMES[variant]),
|
116
116
|
type: "button",
|
117
117
|
onClick: handleRemove,
|
118
118
|
"aria-label": typeof locale.removeButton === "function" ? locale.removeButton(title) : locale.removeButton,
|
@@ -1,8 +1,8 @@
|
|
1
|
-
|
1
|
+
import type { VFC } from "react";
|
2
2
|
export interface TextWrapProps extends Omit<JSX.IntrinsicElements["span"], "children"> {
|
3
3
|
/** The max number of lines before the text is cut with an ellipsis */
|
4
4
|
maxLines?: number;
|
5
5
|
children: string;
|
6
6
|
}
|
7
|
-
export declare const TextWrap:
|
7
|
+
export declare const TextWrap: VFC<TextWrapProps>;
|
8
8
|
export default TextWrap;
|
package/esm/Toggle/Toggle.js
CHANGED
@@ -2,13 +2,12 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
5
|
-
var _templateObject, _templateObject2
|
5
|
+
var _templateObject, _templateObject2;
|
6
6
|
var _excluded = ["className", "checked", "defaultChecked"];
|
7
7
|
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; }
|
8
8
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
9
9
|
import cx from "clsx";
|
10
10
|
import { forwardRef, useState } from "react";
|
11
|
-
import { Check, X } from "react-feather";
|
12
11
|
import stl from "../styles/helpers/satellitePrefixer";
|
13
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
14
13
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
@@ -46,17 +45,8 @@ export var Toggle = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
46
45
|
type: "checkbox",
|
47
46
|
role: "switch",
|
48
47
|
ref: ref
|
49
|
-
})), /*#__PURE__*/
|
50
|
-
className: stl(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["toggle
|
51
|
-
children: [/*#__PURE__*/_jsx(Check, {
|
52
|
-
size: 12,
|
53
|
-
className: stl(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["text-white"]))),
|
54
|
-
"aria-hidden": true
|
55
|
-
}), /*#__PURE__*/_jsx(X, {
|
56
|
-
size: 12,
|
57
|
-
className: stl(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["text-grey-300"]))),
|
58
|
-
"aria-hidden": true
|
59
|
-
})]
|
48
|
+
})), /*#__PURE__*/_jsx("div", {
|
49
|
+
className: stl(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["toggle"])))
|
60
50
|
})]
|
61
51
|
});
|
62
52
|
});
|
@@ -25,6 +25,12 @@ var togglePlugin = plugin(function (_ref) {
|
|
25
25
|
"&:disabled": {
|
26
26
|
cursor: "not-allowed"
|
27
27
|
}
|
28
|
+
},
|
29
|
+
"&:hover .toggle:after": {
|
30
|
+
transform: "translateX(2px)"
|
31
|
+
},
|
32
|
+
"&:hover input:checked ~ .toggle:after": {
|
33
|
+
transform: "translateX(12px)"
|
28
34
|
}
|
29
35
|
},
|
30
36
|
".toggle": {
|
@@ -35,7 +41,7 @@ var togglePlugin = plugin(function (_ref) {
|
|
35
41
|
height: "100%",
|
36
42
|
pointerEvents: "none",
|
37
43
|
borderRadius: "9999px",
|
38
|
-
background: theme("colors.grey.
|
44
|
+
background: theme("colors.grey.500"),
|
39
45
|
boxShadow: "inset 0px 1px 4px 0px ".concat(rgba(theme("colors.grey.500"), 0.2)),
|
40
46
|
transition: transition,
|
41
47
|
"&::after": {
|
@@ -58,7 +64,7 @@ var togglePlugin = plugin(function (_ref) {
|
|
58
64
|
}
|
59
65
|
},
|
60
66
|
"input:disabled ~ &": {
|
61
|
-
|
67
|
+
background: theme("colors.grey.200")
|
62
68
|
}
|
63
69
|
}
|
64
70
|
});
|
@@ -1,6 +1,3 @@
|
|
1
|
-
import
|
1
|
+
import { VFC } from "react";
|
2
2
|
import type { TooltipWrapperBaseProps } from "./types";
|
3
|
-
|
4
|
-
export declare const isOverflowing: (element: HTMLElement) => boolean;
|
5
|
-
export declare const OverflowTooltipWrapper: FunctionComponent<TooltipWrapperBaseProps>;
|
6
|
-
export default OverflowTooltipWrapper;
|
3
|
+
export declare const OverflowTooltipWrapper: VFC<TooltipWrapperBaseProps>;
|
@@ -1,94 +1,36 @@
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
2
2
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
3
|
-
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
4
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
5
|
-
|
4
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
5
|
+
var _templateObject;
|
6
|
+
var _excluded = ["children"];
|
6
7
|
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; }
|
7
8
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
8
|
-
import cx from "clsx";
|
9
9
|
import { useState } from "react";
|
10
|
-
import { usePopper } from "react-popper";
|
11
|
-
import { useCreatePortal } from "../Satellite";
|
12
10
|
import stl from "../styles/helpers/satellitePrefixer";
|
13
11
|
import TextWrap from "../TextWrap";
|
14
|
-
import
|
15
|
-
import {
|
12
|
+
import { TooltipWrapper } from "./TooltipWrapper";
|
13
|
+
import { isOverflowing } from "./utils";
|
16
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
17
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
18
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
19
|
-
/** @ignore */
|
20
|
-
export var isOverflowing = function isOverflowing(element) {
|
21
|
-
return element.scrollHeight > element.clientHeight || element.scrollWidth > element.clientWidth;
|
22
|
-
};
|
23
15
|
export var OverflowTooltipWrapper = function OverflowTooltipWrapper(_ref) {
|
24
|
-
var
|
25
|
-
|
26
|
-
_ref$tooltipVariant = _ref.tooltipVariant,
|
27
|
-
tooltipVariant = _ref$tooltipVariant === void 0 ? "dark" : _ref$tooltipVariant,
|
28
|
-
wrapperClassName = _ref.wrapperClassName,
|
29
|
-
tooltipClassName = _ref.tooltipClassName,
|
30
|
-
children = _ref.children,
|
31
|
-
_ref$modifiers = _ref.modifiers,
|
32
|
-
modifiers = _ref$modifiers === void 0 ? [] : _ref$modifiers,
|
33
|
-
_ref$noArrow = _ref.noArrow,
|
34
|
-
noArrow = _ref$noArrow === void 0 ? false : _ref$noArrow;
|
35
|
-
var createPortal = useCreatePortal();
|
16
|
+
var children = _ref.children,
|
17
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
36
18
|
var _useState = useState(null),
|
37
19
|
_useState2 = _slicedToArray(_useState, 2),
|
38
|
-
|
39
|
-
|
40
|
-
var _useState3 = useState(null),
|
41
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
42
|
-
popperEl = _useState4[0],
|
43
|
-
setPopperEl = _useState4[1];
|
44
|
-
var _useState5 = useState(null),
|
45
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
46
|
-
arrowEl = _useState6[0],
|
47
|
-
setArrowEl = _useState6[1];
|
48
|
-
var _useState7 = useState(null),
|
49
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
50
|
-
tooltipText = _useState8[0],
|
51
|
-
setTooltipText = _useState8[1];
|
52
|
-
var _usePopper = usePopper(targetEl, popperEl, {
|
53
|
-
placement: placement,
|
54
|
-
strategy: "fixed",
|
55
|
-
modifiers: [].concat(_toConsumableArray(DEFAULT_TOOLTIP_POPPER_MODIFIERS), [{
|
56
|
-
name: "arrow",
|
57
|
-
options: {
|
58
|
-
element: arrowEl
|
59
|
-
}
|
60
|
-
}], _toConsumableArray(modifiers))
|
61
|
-
}),
|
62
|
-
styles = _usePopper.styles,
|
63
|
-
attributes = _usePopper.attributes;
|
20
|
+
content = _useState2[0],
|
21
|
+
setContent = _useState2[1];
|
64
22
|
var onMouseEnter = function onMouseEnter(evt) {
|
65
|
-
|
23
|
+
setContent(isOverflowing(evt.currentTarget) ? evt.currentTarget.textContent : null);
|
66
24
|
};
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
className:
|
25
|
+
return /*#__PURE__*/_jsx(TooltipWrapper, _objectSpread(_objectSpread({
|
26
|
+
content: content && /*#__PURE__*/_jsx(TextWrap, {
|
27
|
+
children: content
|
28
|
+
})
|
29
|
+
}, props), {}, {
|
30
|
+
children: /*#__PURE__*/_jsx("div", {
|
31
|
+
className: stl(_templateObject || (_templateObject = _taggedTemplateLiteral(["truncate"]))),
|
74
32
|
onMouseEnter: onMouseEnter,
|
75
|
-
onMouseLeave: onMouseLeave,
|
76
33
|
children: children
|
77
|
-
})
|
78
|
-
|
79
|
-
|
80
|
-
ref: setPopperEl,
|
81
|
-
children: [!noArrow && /*#__PURE__*/_jsx("div", {
|
82
|
-
ref: setArrowEl,
|
83
|
-
style: styles.arrow,
|
84
|
-
className: stl(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["tooltip-wrapper-arrow ", ""])), tooltipVariant === "light" && "tooltip-wrapper-arrow-light")
|
85
|
-
}), /*#__PURE__*/_jsx(Tooltip, {
|
86
|
-
variant: tooltipVariant,
|
87
|
-
children: /*#__PURE__*/_jsx(TextWrap, {
|
88
|
-
children: tooltipText
|
89
|
-
})
|
90
|
-
})]
|
91
|
-
})))]
|
92
|
-
});
|
93
|
-
};
|
94
|
-
export default OverflowTooltipWrapper;
|
34
|
+
})
|
35
|
+
}));
|
36
|
+
};
|
package/esm/Tooltip/Tooltip.d.ts
CHANGED
@@ -7,18 +7,18 @@ export interface TooltipProps extends DetailedHTMLProps<HTMLAttributes<HTMLDivEl
|
|
7
7
|
* Tooltips are floating labels that briefly explain the function of a user interface element. They can be triggered when merchants hover, focus, tap, or click.
|
8
8
|
*
|
9
9
|
* Use tooltips to identify or add a small amount of information to an element. Typically, tooltips are used to help users understand the meaning or purpose of icons, showing the full version of truncated text, or displaying the alt text for an image. Tooltips do not receive input focus.
|
10
|
-
* When writing tooltips, be short and concise
|
10
|
+
* When writing tooltips, be short and concise. When you need to add more than a single line of extra information, consider using inline dialogs instead.
|
11
11
|
*
|
12
12
|
* The position of tooltips is flexible and will change depending on how close the element is to the edge of the screen.
|
13
13
|
*
|
14
14
|
* ## Best practices
|
15
15
|
* Tooltips should:
|
16
16
|
*
|
17
|
-
* - Provide useful, additional information or clarification
|
18
|
-
* - Succinctly describe or expand on the element they point to
|
19
|
-
* - Not be used to communicate critical information, including errors in forms or other interaction feedback
|
20
|
-
* - Not contain any links or buttons
|
21
|
-
* - Be used sparingly. If you're building something that requires a lot of tooltips, work on clarifying the design and the language in the experience
|
17
|
+
* - Provide useful, additional information or clarification.
|
18
|
+
* - Succinctly describe or expand on the element they point to.
|
19
|
+
* - Not be used to communicate critical information, including errors in forms or other interaction feedback.
|
20
|
+
* - Not contain any links, inputs, or buttons.
|
21
|
+
* - Be used sparingly. If you're building something that requires a lot of tooltips, work on clarifying the design and the language in the experience.
|
22
22
|
*/
|
23
23
|
export declare const Tooltip: import("react").ForwardRefExoticComponent<Pick<TooltipProps, "key" | "id" | "color" | "translate" | "hidden" | "dir" | "slot" | "style" | "title" | "accessKey" | "draggable" | "lang" | "className" | "prefix" | "children" | "contentEditable" | "inputMode" | "tabIndex" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "contextMenu" | "placeholder" | "spellCheck" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "variant"> & import("react").RefAttributes<HTMLDivElement>>;
|
24
24
|
export default Tooltip;
|
package/esm/Tooltip/Tooltip.js
CHANGED
@@ -18,18 +18,18 @@ var VARIANT_CLASSNAMES = {
|
|
18
18
|
* Tooltips are floating labels that briefly explain the function of a user interface element. They can be triggered when merchants hover, focus, tap, or click.
|
19
19
|
*
|
20
20
|
* Use tooltips to identify or add a small amount of information to an element. Typically, tooltips are used to help users understand the meaning or purpose of icons, showing the full version of truncated text, or displaying the alt text for an image. Tooltips do not receive input focus.
|
21
|
-
* When writing tooltips, be short and concise
|
21
|
+
* When writing tooltips, be short and concise. When you need to add more than a single line of extra information, consider using inline dialogs instead.
|
22
22
|
*
|
23
23
|
* The position of tooltips is flexible and will change depending on how close the element is to the edge of the screen.
|
24
24
|
*
|
25
25
|
* ## Best practices
|
26
26
|
* Tooltips should:
|
27
27
|
*
|
28
|
-
* - Provide useful, additional information or clarification
|
29
|
-
* - Succinctly describe or expand on the element they point to
|
30
|
-
* - Not be used to communicate critical information, including errors in forms or other interaction feedback
|
31
|
-
* - Not contain any links or buttons
|
32
|
-
* - Be used sparingly. If you're building something that requires a lot of tooltips, work on clarifying the design and the language in the experience
|
28
|
+
* - Provide useful, additional information or clarification.
|
29
|
+
* - Succinctly describe or expand on the element they point to.
|
30
|
+
* - Not be used to communicate critical information, including errors in forms or other interaction feedback.
|
31
|
+
* - Not contain any links, inputs, or buttons.
|
32
|
+
* - Be used sparingly. If you're building something that requires a lot of tooltips, work on clarifying the design and the language in the experience.
|
33
33
|
*/
|
34
34
|
export var Tooltip = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
35
35
|
var className = _ref.className,
|