@canonical/react-components 1.2.4 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/package.json +9 -6
- package/dist/components/Accordion/Accordion.d.ts +0 -46
- package/dist/components/Accordion/Accordion.stories.d.ts +0 -18
- package/dist/components/Accordion/Accordion.stories.js +0 -117
- package/dist/components/Accordion/AccordionSection/AccordionSection.d.ts +0 -34
- package/dist/components/Accordion/AccordionSection/index.d.ts +0 -2
- package/dist/components/Accordion/index.d.ts +0 -2
- package/dist/components/ActionButton/ActionButton.d.ts +0 -48
- package/dist/components/ActionButton/ActionButton.stories.d.ts +0 -7
- package/dist/components/ActionButton/ActionButton.stories.js +0 -36
- package/dist/components/ActionButton/index.d.ts +0 -2
- package/dist/components/ApplicationLayout/AppAside/AppAside.d.ts +0 -33
- package/dist/components/ApplicationLayout/AppAside/AppAside.stories.d.ts +0 -13
- package/dist/components/ApplicationLayout/AppAside/AppAside.stories.js +0 -116
- package/dist/components/ApplicationLayout/AppAside/index.d.ts +0 -2
- package/dist/components/ApplicationLayout/AppMain/AppMain.d.ts +0 -14
- package/dist/components/ApplicationLayout/AppMain/AppMain.stories.d.ts +0 -14
- package/dist/components/ApplicationLayout/AppMain/AppMain.stories.js +0 -45
- package/dist/components/ApplicationLayout/AppMain/index.d.ts +0 -2
- package/dist/components/ApplicationLayout/AppNavigation/AppNavigation.d.ts +0 -26
- package/dist/components/ApplicationLayout/AppNavigation/AppNavigation.stories.d.ts +0 -12
- package/dist/components/ApplicationLayout/AppNavigation/AppNavigation.stories.js +0 -104
- package/dist/components/ApplicationLayout/AppNavigation/index.d.ts +0 -2
- package/dist/components/ApplicationLayout/AppNavigationBar/AppNavigationBar.d.ts +0 -18
- package/dist/components/ApplicationLayout/AppNavigationBar/AppNavigationBar.stories.d.ts +0 -15
- package/dist/components/ApplicationLayout/AppNavigationBar/AppNavigationBar.stories.js +0 -52
- package/dist/components/ApplicationLayout/AppNavigationBar/index.d.ts +0 -2
- package/dist/components/ApplicationLayout/AppStatus/AppStatus.d.ts +0 -14
- package/dist/components/ApplicationLayout/AppStatus/AppStatus.stories.d.ts +0 -13
- package/dist/components/ApplicationLayout/AppStatus/AppStatus.stories.js +0 -41
- package/dist/components/ApplicationLayout/AppStatus/index.d.ts +0 -2
- package/dist/components/ApplicationLayout/Application/Application.d.ts +0 -15
- package/dist/components/ApplicationLayout/Application/Application.stories.d.ts +0 -6
- package/dist/components/ApplicationLayout/Application/Application.stories.js +0 -16
- package/dist/components/ApplicationLayout/Application/index.d.ts +0 -2
- package/dist/components/ApplicationLayout/ApplicationLayout.d.ts +0 -89
- package/dist/components/ApplicationLayout/ApplicationLayout.stories.d.ts +0 -24
- package/dist/components/ApplicationLayout/ApplicationLayout.stories.js +0 -232
- package/dist/components/ApplicationLayout/index.d.ts +0 -7
- package/dist/components/ArticlePagination/ArticlePagination.d.ts +0 -31
- package/dist/components/ArticlePagination/ArticlePagination.stories.d.ts +0 -6
- package/dist/components/ArticlePagination/ArticlePagination.stories.js +0 -22
- package/dist/components/ArticlePagination/index.d.ts +0 -2
- package/dist/components/Badge/Badge.d.ts +0 -34
- package/dist/components/Badge/Badge.stories.d.ts +0 -15
- package/dist/components/Badge/Badge.stories.js +0 -62
- package/dist/components/Badge/index.d.ts +0 -2
- package/dist/components/Button/Button.d.ts +0 -64
- package/dist/components/Button/Button.stories.d.ts +0 -32
- package/dist/components/Button/Button.stories.js +0 -180
- package/dist/components/Button/index.d.ts +0 -2
- package/dist/components/Card/Card.d.ts +0 -35
- package/dist/components/Card/Card.stories.d.ts +0 -33
- package/dist/components/Card/Card.stories.js +0 -51
- package/dist/components/Card/index.d.ts +0 -2
- package/dist/components/CheckboxInput/CheckableInput/CheckableInput.d.ts +0 -27
- package/dist/components/CheckboxInput/CheckableInput/index.d.ts +0 -2
- package/dist/components/CheckboxInput/CheckboxInput.d.ts +0 -9
- package/dist/components/CheckboxInput/CheckboxInput.stories.d.ts +0 -11
- package/dist/components/CheckboxInput/CheckboxInput.stories.js +0 -84
- package/dist/components/CheckboxInput/index.d.ts +0 -2
- package/dist/components/Chip/Chip.d.ts +0 -56
- package/dist/components/Chip/Chip.stories.d.ts +0 -9
- package/dist/components/Chip/Chip.stories.js +0 -45
- package/dist/components/Chip/index.d.ts +0 -2
- package/dist/components/Code/Code.d.ts +0 -13
- package/dist/components/Code/index.d.ts +0 -2
- package/dist/components/CodeSnippet/CodeSnippet.d.ts +0 -21
- package/dist/components/CodeSnippet/CodeSnippet.stories.d.ts +0 -45
- package/dist/components/CodeSnippet/CodeSnippet.stories.js +0 -279
- package/dist/components/CodeSnippet/CodeSnippetBlock.d.ts +0 -40
- package/dist/components/CodeSnippet/CodeSnippetDropdown.d.ts +0 -18
- package/dist/components/CodeSnippet/index.d.ts +0 -5
- package/dist/components/Col/Col.d.ts +0 -53
- package/dist/components/Col/Col.stories.d.ts +0 -11
- package/dist/components/Col/Col.stories.js +0 -154
- package/dist/components/Col/index.d.ts +0 -2
- package/dist/components/ConfirmationButton/ConfirmationButton.d.ts +0 -28
- package/dist/components/ConfirmationButton/ConfirmationButton.stories.d.ts +0 -9
- package/dist/components/ConfirmationButton/ConfirmationButton.stories.js +0 -108
- package/dist/components/ConfirmationButton/index.d.ts +0 -2
- package/dist/components/ConfirmationModal/ConfirmationModal.d.ts +0 -53
- package/dist/components/ConfirmationModal/ConfirmationModal.stories.d.ts +0 -18
- package/dist/components/ConfirmationModal/ConfirmationModal.stories.js +0 -135
- package/dist/components/ConfirmationModal/index.d.ts +0 -2
- package/dist/components/ContextualMenu/ContextualMenu.d.ts +0 -110
- package/dist/components/ContextualMenu/ContextualMenu.stories.d.ts +0 -13
- package/dist/components/ContextualMenu/ContextualMenu.stories.js +0 -107
- package/dist/components/ContextualMenu/ContextualMenuDropdown/ContextualMenuDropdown.d.ts +0 -43
- package/dist/components/ContextualMenu/ContextualMenuDropdown/index.d.ts +0 -2
- package/dist/components/ContextualMenu/index.d.ts +0 -3
- package/dist/components/EmptyState/EmptyState.d.ts +0 -25
- package/dist/components/EmptyState/EmptyState.stories.d.ts +0 -7
- package/dist/components/EmptyState/EmptyState.stories.js +0 -49
- package/dist/components/EmptyState/index.d.ts +0 -2
- package/dist/components/Field/Field.d.ts +0 -77
- package/dist/components/Field/index.d.ts +0 -2
- package/dist/components/Form/Form.d.ts +0 -21
- package/dist/components/Form/Form.stories.d.ts +0 -12
- package/dist/components/Form/Form.stories.js +0 -179
- package/dist/components/Form/index.d.ts +0 -2
- package/dist/components/FormikField/FormikField.d.ts +0 -25
- package/dist/components/FormikField/FormikField.stories.d.ts +0 -8
- package/dist/components/FormikField/FormikField.stories.js +0 -85
- package/dist/components/FormikField/index.d.ts +0 -1
- package/dist/components/Icon/Icon.d.ts +0 -59
- package/dist/components/Icon/Icon.stories.d.ts +0 -16
- package/dist/components/Icon/Icon.stories.js +0 -49
- package/dist/components/Icon/index.d.ts +0 -2
- package/dist/components/Input/Input.d.ts +0 -70
- package/dist/components/Input/Input.stories.d.ts +0 -14
- package/dist/components/Input/Input.stories.js +0 -148
- package/dist/components/Input/index.d.ts +0 -2
- package/dist/components/Label/Label.d.ts +0 -25
- package/dist/components/Label/index.d.ts +0 -2
- package/dist/components/Link/Link.d.ts +0 -31
- package/dist/components/Link/Link.stories.d.ts +0 -9
- package/dist/components/Link/Link.stories.js +0 -48
- package/dist/components/Link/index.d.ts +0 -2
- package/dist/components/List/List.d.ts +0 -36
- package/dist/components/List/List.stories.d.ts +0 -15
- package/dist/components/List/List.stories.js +0 -122
- package/dist/components/List/index.d.ts +0 -2
- package/dist/components/Loader/Loader.d.ts +0 -6
- package/dist/components/Loader/index.d.ts +0 -1
- package/dist/components/LoginPageLayout/LoginPageLayout.d.ts +0 -17
- package/dist/components/LoginPageLayout/LoginPageLayout.stories.d.ts +0 -9
- package/dist/components/LoginPageLayout/LoginPageLayout.stories.js +0 -58
- package/dist/components/LoginPageLayout/index.d.ts +0 -2
- package/dist/components/MainTable/MainTable.d.ts +0 -102
- package/dist/components/MainTable/MainTable.stories.d.ts +0 -15
- package/dist/components/MainTable/MainTable.stories.js +0 -553
- package/dist/components/MainTable/index.d.ts +0 -2
- package/dist/components/Modal/Modal.d.ts +0 -36
- package/dist/components/Modal/Modal.stories.d.ts +0 -6
- package/dist/components/Modal/Modal.stories.js +0 -57
- package/dist/components/Modal/index.d.ts +0 -2
- package/dist/components/ModularTable/ModularTable.d.ts +0 -105
- package/dist/components/ModularTable/ModularTable.stories.d.ts +0 -27
- package/dist/components/ModularTable/ModularTable.stories.js +0 -343
- package/dist/components/ModularTable/index.d.ts +0 -2
- package/dist/components/MultiSelect/FadeInDown/FadeInDown.d.ts +0 -10
- package/dist/components/MultiSelect/FadeInDown/index.d.ts +0 -1
- package/dist/components/MultiSelect/MultiSelect.d.ts +0 -57
- package/dist/components/MultiSelect/MultiSelect.stories.d.ts +0 -8
- package/dist/components/MultiSelect/MultiSelect.stories.js +0 -70
- package/dist/components/MultiSelect/index.d.ts +0 -1
- package/dist/components/Navigation/Navigation.d.ts +0 -66
- package/dist/components/Navigation/Navigation.stories.d.ts +0 -43
- package/dist/components/Navigation/Navigation.stories.js +0 -232
- package/dist/components/Navigation/NavigationLink/NavigationLink.d.ts +0 -10
- package/dist/components/Navigation/NavigationLink/index.d.ts +0 -1
- package/dist/components/Navigation/NavigationMenu/NavigationMenu.d.ts +0 -11
- package/dist/components/Navigation/NavigationMenu/index.d.ts +0 -1
- package/dist/components/Navigation/index.d.ts +0 -3
- package/dist/components/Navigation/types.d.ts +0 -64
- package/dist/components/Notification/Notification.d.ts +0 -110
- package/dist/components/Notification/Notification.stories.d.ts +0 -45
- package/dist/components/Notification/Notification.stories.js +0 -201
- package/dist/components/Notification/index.d.ts +0 -2
- package/dist/components/NotificationProvider/NotificationProvider.d.ts +0 -5
- package/dist/components/NotificationProvider/index.d.ts +0 -3
- package/dist/components/NotificationProvider/messageBuilder.d.ts +0 -6
- package/dist/components/NotificationProvider/types.d.ts +0 -35
- package/dist/components/Pagination/Pagination.d.ts +0 -102
- package/dist/components/Pagination/Pagination.stories.d.ts +0 -14
- package/dist/components/Pagination/Pagination.stories.js +0 -94
- package/dist/components/Pagination/PaginationButton/PaginationButton.d.ts +0 -30
- package/dist/components/Pagination/PaginationButton/index.d.ts +0 -2
- package/dist/components/Pagination/PaginationItem/PaginationItem.d.ts +0 -17
- package/dist/components/Pagination/PaginationItem/index.d.ts +0 -2
- package/dist/components/Pagination/index.d.ts +0 -2
- package/dist/components/Panel/Panel.d.ts +0 -123
- package/dist/components/Panel/Panel.stories.d.ts +0 -17
- package/dist/components/Panel/Panel.stories.js +0 -60
- package/dist/components/Panel/index.d.ts +0 -1
- package/dist/components/PasswordToggle/PasswordToggle.d.ts +0 -108
- package/dist/components/PasswordToggle/PasswordToggle.stories.d.ts +0 -12
- package/dist/components/PasswordToggle/PasswordToggle.stories.js +0 -74
- package/dist/components/PasswordToggle/index.d.ts +0 -2
- package/dist/components/RadioInput/RadioInput.d.ts +0 -9
- package/dist/components/RadioInput/RadioInput.stories.d.ts +0 -10
- package/dist/components/RadioInput/RadioInput.stories.js +0 -83
- package/dist/components/RadioInput/index.d.ts +0 -2
- package/dist/components/Row/Row.d.ts +0 -19
- package/dist/components/Row/Row.stories.d.ts +0 -9
- package/dist/components/Row/Row.stories.js +0 -29
- package/dist/components/Row/index.d.ts +0 -2
- package/dist/components/SearchAndFilter/FilterPanelSection/FilterPanelSection.d.ts +0 -25
- package/dist/components/SearchAndFilter/FilterPanelSection/index.d.ts +0 -1
- package/dist/components/SearchAndFilter/SearchAndFilter.d.ts +0 -33
- package/dist/components/SearchAndFilter/SearchAndFilter.stories.d.ts +0 -8
- package/dist/components/SearchAndFilter/SearchAndFilter.stories.js +0 -218
- package/dist/components/SearchAndFilter/index.d.ts +0 -2
- package/dist/components/SearchAndFilter/types.d.ts +0 -11
- package/dist/components/SearchAndFilter/utils.d.ts +0 -13
- package/dist/components/SearchBox/SearchBox.d.ts +0 -63
- package/dist/components/SearchBox/SearchBox.stories.d.ts +0 -14
- package/dist/components/SearchBox/SearchBox.stories.js +0 -106
- package/dist/components/SearchBox/index.d.ts +0 -2
- package/dist/components/Select/Select.d.ts +0 -71
- package/dist/components/Select/Select.stories.d.ts +0 -7
- package/dist/components/Select/Select.stories.js +0 -97
- package/dist/components/Select/index.d.ts +0 -2
- package/dist/components/SideNavigation/SideNavigation.d.ts +0 -50
- package/dist/components/SideNavigation/SideNavigation.stories.d.ts +0 -14
- package/dist/components/SideNavigation/SideNavigation.stories.js +0 -62
- package/dist/components/SideNavigation/SideNavigationBase/SideNavigationBase.d.ts +0 -31
- package/dist/components/SideNavigation/SideNavigationBase/index.d.ts +0 -1
- package/dist/components/SideNavigation/SideNavigationItem/SideNavigationItem.d.ts +0 -20
- package/dist/components/SideNavigation/SideNavigationItem/SideNavigationItem.stories.d.ts +0 -22
- package/dist/components/SideNavigation/SideNavigationItem/SideNavigationItem.stories.js +0 -70
- package/dist/components/SideNavigation/SideNavigationItem/index.d.ts +0 -1
- package/dist/components/SideNavigation/SideNavigationLink/SideNavigationLink.d.ts +0 -21
- package/dist/components/SideNavigation/SideNavigationLink/SideNavigationLink.stories.d.ts +0 -7
- package/dist/components/SideNavigation/SideNavigationLink/SideNavigationLink.stories.js +0 -32
- package/dist/components/SideNavigation/SideNavigationLink/index.d.ts +0 -1
- package/dist/components/SideNavigation/SideNavigationText/SideNavigationText.d.ts +0 -7
- package/dist/components/SideNavigation/SideNavigationText/SideNavigationText.stories.d.ts +0 -6
- package/dist/components/SideNavigation/SideNavigationText/SideNavigationText.stories.js +0 -25
- package/dist/components/SideNavigation/SideNavigationText/index.d.ts +0 -1
- package/dist/components/SideNavigation/index.d.ts +0 -5
- package/dist/components/Slider/Slider.d.ts +0 -62
- package/dist/components/Slider/Slider.stories.d.ts +0 -10
- package/dist/components/Slider/Slider.stories.js +0 -74
- package/dist/components/Slider/index.d.ts +0 -2
- package/dist/components/Spinner/Spinner.d.ts +0 -29
- package/dist/components/Spinner/Spinner.stories.d.ts +0 -8
- package/dist/components/Spinner/Spinner.stories.js +0 -28
- package/dist/components/Spinner/index.d.ts +0 -2
- package/dist/components/StatusLabel/StatusLabel.d.ts +0 -33
- package/dist/components/StatusLabel/StatusLabel.stories.d.ts +0 -10
- package/dist/components/StatusLabel/StatusLabel.stories.js +0 -61
- package/dist/components/StatusLabel/index.d.ts +0 -2
- package/dist/components/Strip/Strip.d.ts +0 -64
- package/dist/components/Strip/Strip.stories.d.ts +0 -12
- package/dist/components/Strip/Strip.stories.js +0 -130
- package/dist/components/Strip/index.d.ts +0 -2
- package/dist/components/SummaryButton/SummaryButton.d.ts +0 -29
- package/dist/components/SummaryButton/SummaryButton.stories.d.ts +0 -18
- package/dist/components/SummaryButton/SummaryButton.stories.js +0 -59
- package/dist/components/SummaryButton/index.d.ts +0 -2
- package/dist/components/Switch/Switch.d.ts +0 -17
- package/dist/components/Switch/Switch.stories.d.ts +0 -7
- package/dist/components/Switch/Switch.stories.js +0 -26
- package/dist/components/Switch/index.d.ts +0 -2
- package/dist/components/Table/Table.d.ts +0 -22
- package/dist/components/Table/index.d.ts +0 -2
- package/dist/components/TableCell/TableCell.d.ts +0 -26
- package/dist/components/TableCell/index.d.ts +0 -2
- package/dist/components/TableHeader/TableHeader.d.ts +0 -14
- package/dist/components/TableHeader/index.d.ts +0 -2
- package/dist/components/TablePagination/TablePagination.d.ts +0 -98
- package/dist/components/TablePagination/TablePagination.stories.d.ts +0 -14
- package/dist/components/TablePagination/TablePagination.stories.js +0 -330
- package/dist/components/TablePagination/TablePaginationControls/TablePaginationControls.d.ts +0 -24
- package/dist/components/TablePagination/TablePaginationControls/index.d.ts +0 -2
- package/dist/components/TablePagination/index.d.ts +0 -2
- package/dist/components/TablePagination/utils.d.ts +0 -27
- package/dist/components/TableRow/TableRow.d.ts +0 -10
- package/dist/components/TableRow/index.d.ts +0 -2
- package/dist/components/Tabs/Tabs.d.ts +0 -45
- package/dist/components/Tabs/Tabs.stories.d.ts +0 -11
- package/dist/components/Tabs/Tabs.stories.js +0 -56
- package/dist/components/Tabs/index.d.ts +0 -2
- package/dist/components/Textarea/Textarea.d.ts +0 -70
- package/dist/components/Textarea/Textarea.stories.d.ts +0 -7
- package/dist/components/Textarea/Textarea.stories.js +0 -62
- package/dist/components/Textarea/index.d.ts +0 -2
- package/dist/components/Tooltip/Tooltip.d.ts +0 -75
- package/dist/components/Tooltip/Tooltip.stories.d.ts +0 -12
- package/dist/components/Tooltip/Tooltip.stories.js +0 -71
- package/dist/components/Tooltip/index.d.ts +0 -2
- package/dist/enums.d.ts +0 -13
- package/dist/hooks/index.d.ts +0 -9
- package/dist/hooks/useId.d.ts +0 -4
- package/dist/hooks/useListener.d.ts +0 -11
- package/dist/hooks/useOnClickOutside.d.ts +0 -12
- package/dist/hooks/useOnEscapePressed.d.ts +0 -6
- package/dist/hooks/usePagination.d.ts +0 -19
- package/dist/hooks/usePrevious.d.ts +0 -7
- package/dist/hooks/useThrottle.d.ts +0 -9
- package/dist/hooks/useWindowFitment.d.ts +0 -54
- package/dist/index.d.ts +0 -132
- package/dist/types/index.d.ts +0 -38
- package/dist/utils.d.ts +0 -27
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
|
-
import type { WindowFitment } from "../../hooks";
|
|
3
|
-
import type { ClassName, ValueOf } from "../../types";
|
|
4
|
-
export type CSSPosition = "static" | "absolute" | "fixed" | "relative" | "sticky" | "initial" | "inherit";
|
|
5
|
-
export type PositionStyle = {
|
|
6
|
-
left: number;
|
|
7
|
-
pointerEvents?: string;
|
|
8
|
-
position: CSSPosition;
|
|
9
|
-
top: number;
|
|
10
|
-
};
|
|
11
|
-
export declare const position: {
|
|
12
|
-
readonly btmCenter: "btm-center";
|
|
13
|
-
readonly btmLeft: "btm-left";
|
|
14
|
-
readonly btmRight: "btm-right";
|
|
15
|
-
readonly left: "left";
|
|
16
|
-
readonly right: "right";
|
|
17
|
-
readonly topCenter: "top-center";
|
|
18
|
-
readonly topLeft: "top-left";
|
|
19
|
-
readonly topRight: "top-right";
|
|
20
|
-
};
|
|
21
|
-
export type Position = ValueOf<typeof position>;
|
|
22
|
-
export type Props = {
|
|
23
|
-
/**
|
|
24
|
-
* Whether the tooltip should adjust to fit in the screen.
|
|
25
|
-
*/
|
|
26
|
-
autoAdjust?: boolean;
|
|
27
|
-
/**
|
|
28
|
-
* Element on which to apply the tooltip.
|
|
29
|
-
*/
|
|
30
|
-
children: ReactNode;
|
|
31
|
-
/**
|
|
32
|
-
* An optional class to apply to the wrapping element.
|
|
33
|
-
*/
|
|
34
|
-
className?: ClassName;
|
|
35
|
-
/**
|
|
36
|
-
* Whether the tooltip should follow the mouse.
|
|
37
|
-
*/
|
|
38
|
-
followMouse?: boolean;
|
|
39
|
-
/**
|
|
40
|
-
* Message to display when the element is hovered.
|
|
41
|
-
*/
|
|
42
|
-
message?: ReactNode;
|
|
43
|
-
/**
|
|
44
|
-
* Position of the tooltip relative to the element.
|
|
45
|
-
*/
|
|
46
|
-
position?: Position;
|
|
47
|
-
/**
|
|
48
|
-
* An optional class to apply to the element that wraps the children.
|
|
49
|
-
*/
|
|
50
|
-
positionElementClassName?: string;
|
|
51
|
-
/**
|
|
52
|
-
* An optional class to apply to the tooltip message element.
|
|
53
|
-
*/
|
|
54
|
-
tooltipClassName?: string;
|
|
55
|
-
/**
|
|
56
|
-
* The z-index value of the tooltip message element.
|
|
57
|
-
*/
|
|
58
|
-
zIndex?: number;
|
|
59
|
-
/**
|
|
60
|
-
* Delay in ms after which Tooltip will appear (defaults to 350ms).
|
|
61
|
-
*/
|
|
62
|
-
delay?: number;
|
|
63
|
-
};
|
|
64
|
-
export declare const adjustForWindow: (position: Position, fitsWindow: WindowFitment) => Position;
|
|
65
|
-
/**
|
|
66
|
-
* This is the [React](https://reactjs.org/) component for Vanilla [Tooltips](https://vanillaframework.io/docs/patterns/tooltips).
|
|
67
|
-
*
|
|
68
|
-
* Tooltips are text labels that appear when the user hovers over, focuses on, or touches an element on the screen.
|
|
69
|
-
*
|
|
70
|
-
* They can be used to provide information about concepts/terms/actions that are not self-explanatory or well known.
|
|
71
|
-
*
|
|
72
|
-
* An alternative use of tooltips is to provide information on a disabled actionable element, e.g. for disabled buttons, providing information about why they are disabled.
|
|
73
|
-
*/
|
|
74
|
-
declare const Tooltip: ({ autoAdjust, children, className, followMouse, message, position, positionElementClassName, tooltipClassName, zIndex, delay, }: Props) => JSX.Element;
|
|
75
|
-
export default Tooltip;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import Tooltip from "./Tooltip";
|
|
3
|
-
declare const meta: Meta<typeof Tooltip>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof Tooltip>;
|
|
6
|
-
export declare const Default: Story;
|
|
7
|
-
export declare const FollowMouse: Story;
|
|
8
|
-
/**
|
|
9
|
-
* The tooltip elements are displayed inside a [Portal](https://reactjs.org/docs/portals.html) so that the tooltip is not constrained by its current position in the DOM.
|
|
10
|
-
* Sometimes however, you need to target the tooltip elements. This can be achieved by passing class names to the tooltip elements. You can also pass classes to the elements that trigger and position the tooltip.
|
|
11
|
-
*/
|
|
12
|
-
export declare const TargetingElements: Story;
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = exports.TargetingElements = exports.FollowMouse = exports.Default = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _Button = _interopRequireDefault(require("../Button"));
|
|
9
|
-
var _Tooltip = _interopRequireWildcard(require("./Tooltip"));
|
|
10
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
11
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
12
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
-
const Template = args => {
|
|
14
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
15
|
-
style: {
|
|
16
|
-
display: "flex",
|
|
17
|
-
justifyContent: "center",
|
|
18
|
-
padding: "3rem"
|
|
19
|
-
}
|
|
20
|
-
}, /*#__PURE__*/_react.default.createElement(_Tooltip.default, args, /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
21
|
-
className: "u-no-margin--bottom"
|
|
22
|
-
}, "Hover over me!")));
|
|
23
|
-
};
|
|
24
|
-
const meta = {
|
|
25
|
-
component: _Tooltip.default,
|
|
26
|
-
render: Template,
|
|
27
|
-
tags: ["autodocs"],
|
|
28
|
-
argTypes: {
|
|
29
|
-
position: {
|
|
30
|
-
control: {
|
|
31
|
-
type: "radio"
|
|
32
|
-
},
|
|
33
|
-
options: Object.values(_Tooltip.position)
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
var _default = exports.default = meta;
|
|
38
|
-
const Default = exports.Default = {
|
|
39
|
-
render: Template.bind({}),
|
|
40
|
-
name: "Default",
|
|
41
|
-
args: {
|
|
42
|
-
message: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "Tooltip", " ", /*#__PURE__*/_react.default.createElement("a", {
|
|
43
|
-
href: "#todo",
|
|
44
|
-
target: "_blank"
|
|
45
|
-
}, "Link1"))
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
const FollowMouse = exports.FollowMouse = {
|
|
49
|
-
render: Template.bind({}),
|
|
50
|
-
name: "Follow mouse",
|
|
51
|
-
args: {
|
|
52
|
-
followMouse: true,
|
|
53
|
-
message: "Tooltip message to display.",
|
|
54
|
-
position: "top-center"
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* The tooltip elements are displayed inside a [Portal](https://reactjs.org/docs/portals.html) so that the tooltip is not constrained by its current position in the DOM.
|
|
60
|
-
* Sometimes however, you need to target the tooltip elements. This can be achieved by passing class names to the tooltip elements. You can also pass classes to the elements that trigger and position the tooltip.
|
|
61
|
-
*/
|
|
62
|
-
const TargetingElements = exports.TargetingElements = {
|
|
63
|
-
render: Template.bind({}),
|
|
64
|
-
name: "Targeting elements",
|
|
65
|
-
args: {
|
|
66
|
-
className: "custom-wrapping-class",
|
|
67
|
-
positionElementClassName: "custom-position-class",
|
|
68
|
-
tooltipClassName: "custom-tooltip-class",
|
|
69
|
-
message: "Tooltip message to display."
|
|
70
|
-
}
|
|
71
|
-
};
|
package/dist/enums.d.ts
DELETED
package/dist/hooks/index.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export { useOnClickOutside, useClickOutside } from "./useOnClickOutside";
|
|
2
|
-
export { useId } from "./useId";
|
|
3
|
-
export { useListener } from "./useListener";
|
|
4
|
-
export { useOnEscapePressed } from "./useOnEscapePressed";
|
|
5
|
-
export { usePrevious } from "./usePrevious";
|
|
6
|
-
export { useThrottle } from "./useThrottle";
|
|
7
|
-
export { usePagination } from "./usePagination";
|
|
8
|
-
export { useWindowFitment } from "./useWindowFitment";
|
|
9
|
-
export type { WindowFitment } from "./useWindowFitment";
|
package/dist/hooks/useId.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A hook that handles attaching/removing listeners and smartly reattaching if
|
|
3
|
-
* any of the attributes change.
|
|
4
|
-
* @param targetNode The node to attach the listener to.
|
|
5
|
-
* @param callback The function to call from the listener.
|
|
6
|
-
* @param eventType The event name.
|
|
7
|
-
* @param shouldThrottle Whether the callback calls should be throttled.
|
|
8
|
-
* @param shouldListen When the listener should be active.
|
|
9
|
-
* @param options Native event listener options.
|
|
10
|
-
*/
|
|
11
|
-
export declare const useListener: (targetNode: Window | HTMLElement, callback: (...args: any[]) => any, eventType: string, shouldThrottle?: boolean, shouldListen?: boolean, options?: boolean | AddEventListenerOptions) => void;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { MutableRefObject, useRef } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* Handle clicks outside an element.
|
|
4
|
-
*/
|
|
5
|
-
export declare const useOnClickOutside: <E extends HTMLElement>(elementRef: ReturnType<typeof useRef<E | null>>, onClickOutside: () => void, { isEnabled }?: {
|
|
6
|
-
isEnabled: boolean;
|
|
7
|
-
}) => void;
|
|
8
|
-
/**
|
|
9
|
-
* Handle clicks outside an element.
|
|
10
|
-
* @returns A ref to pass to the element to handle clicks outside of.
|
|
11
|
-
*/
|
|
12
|
-
export declare const useClickOutside: <E extends HTMLElement>(onClickOutside: () => void) => MutableRefObject<E>;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A hook that handles pagination.
|
|
3
|
-
* @param data - The data array to paginate.
|
|
4
|
-
* @param {Object} options
|
|
5
|
-
* @param {number} [options.itemsPerPage] - Number of items per page. Returns all items if no value has been provided.
|
|
6
|
-
* @param {number} [options.initialPage=1] - Initial page number. Defaults to 1.
|
|
7
|
-
* @param {boolean} [options.autoResetPage=false] - Whether to reset the page number to 1 when the data changes.
|
|
8
|
-
*/
|
|
9
|
-
export declare function usePagination<D, I = number | null>(data: Array<D>, options?: {
|
|
10
|
-
itemsPerPage: I;
|
|
11
|
-
initialPage?: number;
|
|
12
|
-
autoResetPage?: boolean;
|
|
13
|
-
}): {
|
|
14
|
-
pageData: Array<D>;
|
|
15
|
-
currentPage: number;
|
|
16
|
-
paginate: (pageNumber: number) => void;
|
|
17
|
-
itemsPerPage: I;
|
|
18
|
-
totalItems: number;
|
|
19
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A hook to handle storing the previous value of anything.
|
|
3
|
-
* @param value - The value to watch.
|
|
4
|
-
* @param setInitial - Whether it should initialise with the current value.
|
|
5
|
-
* @return The previous value.
|
|
6
|
-
*/
|
|
7
|
-
export declare const usePrevious: <T>(value: T, setInitial?: boolean) => T;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare const THROTTLE_DELAY: number;
|
|
2
|
-
export type Callback = (...args: any[]) => any;
|
|
3
|
-
/**
|
|
4
|
-
* A hook to handle throttling calls to a function.
|
|
5
|
-
* @param callback The function to throttle.
|
|
6
|
-
* @param delay The throttle delay in ms.
|
|
7
|
-
* @return The callback function wrapped in the throttle.
|
|
8
|
-
*/
|
|
9
|
-
export declare const useThrottle: (callback: Callback, delay?: number) => Callback;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
export type WindowFitment = {
|
|
2
|
-
fromTop: {
|
|
3
|
-
fitsAbove: boolean;
|
|
4
|
-
fitsBelow: boolean;
|
|
5
|
-
spaceAbove: number;
|
|
6
|
-
spaceBelow: number;
|
|
7
|
-
};
|
|
8
|
-
fromBottom: {
|
|
9
|
-
fitsAbove: boolean;
|
|
10
|
-
fitsBelow: boolean;
|
|
11
|
-
spaceAbove: number;
|
|
12
|
-
spaceBelow: number;
|
|
13
|
-
};
|
|
14
|
-
fromLeft: {
|
|
15
|
-
fitsLeft: boolean;
|
|
16
|
-
fitsRight: boolean;
|
|
17
|
-
spaceLeft: number;
|
|
18
|
-
spaceRight: number;
|
|
19
|
-
};
|
|
20
|
-
fromRight: {
|
|
21
|
-
fitsLeft: boolean;
|
|
22
|
-
fitsRight: boolean;
|
|
23
|
-
spaceLeft: number;
|
|
24
|
-
spaceRight: number;
|
|
25
|
-
};
|
|
26
|
-
fromCenter: {
|
|
27
|
-
fitsLeft: boolean;
|
|
28
|
-
fitsRight: boolean;
|
|
29
|
-
fitsAbove: boolean;
|
|
30
|
-
fitsBelow: boolean;
|
|
31
|
-
spaceLeft: number;
|
|
32
|
-
spaceRight: number;
|
|
33
|
-
spaceAbove: number;
|
|
34
|
-
spaceBelow: number;
|
|
35
|
-
fitsCentered: {
|
|
36
|
-
fitsAbove: boolean;
|
|
37
|
-
fitsBelow: boolean;
|
|
38
|
-
fitsLeft: boolean;
|
|
39
|
-
fitsRight: boolean;
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
/**
|
|
44
|
-
* A hook to determine if an element fits on the window.
|
|
45
|
-
* @param targetNode The element to try and fit on the window.
|
|
46
|
-
* @param referenceNode The element to use to position the target.
|
|
47
|
-
* @param callback The function to call when updating fitment info.
|
|
48
|
-
* @param spacer An additional space to leave between the target and reference.
|
|
49
|
-
* @param shouldCheck Whether the fitment info should be being checked.
|
|
50
|
-
* @param fromMouse Whether the target should be being positioned in relation
|
|
51
|
-
* to the mouse. In this case refernceNode will be used to
|
|
52
|
-
* listen for mouseover events.
|
|
53
|
-
*/
|
|
54
|
-
export declare const useWindowFitment: (targetNode: HTMLElement, referenceNode: HTMLElement, callback: (fitsWindow: WindowFitment) => void, spacer?: number, shouldCheck?: boolean, fromMouse?: boolean) => void;
|
package/dist/index.d.ts
DELETED
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
export { default as Accordion } from "./components/Accordion";
|
|
2
|
-
export { default as ActionButton } from "./components/ActionButton";
|
|
3
|
-
export { default as ArticlePagination } from "./components/ArticlePagination";
|
|
4
|
-
export { default as ApplicationLayout } from "./components/ApplicationLayout";
|
|
5
|
-
export { default as AppAside } from "./components/ApplicationLayout/AppAside";
|
|
6
|
-
export { default as Application } from "./components/ApplicationLayout/Application";
|
|
7
|
-
export { default as AppMain } from "./components/ApplicationLayout/AppMain";
|
|
8
|
-
export { default as AppNavigation } from "./components/ApplicationLayout/AppNavigation";
|
|
9
|
-
export { default as AppNavigationBar } from "./components/ApplicationLayout/AppNavigationBar";
|
|
10
|
-
export { default as AppStatus } from "./components/ApplicationLayout/AppStatus";
|
|
11
|
-
export { default as Badge } from "./components/Badge";
|
|
12
|
-
export { default as Button, ButtonAppearance } from "./components/Button";
|
|
13
|
-
export { default as Card } from "./components/Card";
|
|
14
|
-
export { default as CheckboxInput } from "./components/CheckboxInput";
|
|
15
|
-
export { default as Chip } from "./components/Chip";
|
|
16
|
-
export { default as Code } from "./components/Code";
|
|
17
|
-
export { default as CodeSnippet, CodeSnippetBlockAppearance, } from "./components/CodeSnippet";
|
|
18
|
-
export { default as Col } from "./components/Col";
|
|
19
|
-
export { default as ConfirmationButton } from "./components/ConfirmationButton";
|
|
20
|
-
export { default as ConfirmationModal } from "./components/ConfirmationModal";
|
|
21
|
-
export { default as ContextualMenu } from "./components/ContextualMenu";
|
|
22
|
-
export { default as EmptyState } from "./components/EmptyState";
|
|
23
|
-
export { default as Field } from "./components/Field";
|
|
24
|
-
export { default as Form } from "./components/Form";
|
|
25
|
-
export { default as FormikField } from "./components/FormikField";
|
|
26
|
-
export { default as Icon, ICONS } from "./components/Icon";
|
|
27
|
-
export { default as Input } from "./components/Input";
|
|
28
|
-
export { default as Label } from "./components/Label";
|
|
29
|
-
export { default as Link } from "./components/Link";
|
|
30
|
-
export { default as List } from "./components/List";
|
|
31
|
-
export { default as Loader } from "./components/Loader";
|
|
32
|
-
export { default as MainTable } from "./components/MainTable";
|
|
33
|
-
export { default as ModularTable } from "./components/ModularTable";
|
|
34
|
-
export { default as Navigation } from "./components/Navigation";
|
|
35
|
-
export { default as Modal } from "./components/Modal";
|
|
36
|
-
export * from "./components/MultiSelect";
|
|
37
|
-
export { default as Notification, NotificationSeverity, } from "./components/Notification";
|
|
38
|
-
export { NotificationConsumer, NotificationProvider, useNotify, info, success, failure, queue, } from "./components/NotificationProvider";
|
|
39
|
-
export { default as LoginPageLayout } from "./components/LoginPageLayout";
|
|
40
|
-
export { default as Pagination } from "./components/Pagination";
|
|
41
|
-
export { default as Panel } from "./components/Panel";
|
|
42
|
-
export { default as PasswordToggle } from "./components/PasswordToggle";
|
|
43
|
-
export { default as RadioInput } from "./components/RadioInput";
|
|
44
|
-
export { default as Row } from "./components/Row";
|
|
45
|
-
export { default as SearchAndFilter } from "./components/SearchAndFilter";
|
|
46
|
-
export { default as SearchBox } from "./components/SearchBox";
|
|
47
|
-
export { default as Select } from "./components/Select";
|
|
48
|
-
export { default as SideNavigation } from "./components/SideNavigation";
|
|
49
|
-
export { default as SideNavigationItem } from "./components/SideNavigation/SideNavigationItem";
|
|
50
|
-
export { default as SideNavigationLink } from "./components/SideNavigation/SideNavigationLink";
|
|
51
|
-
export { default as SideNavigationText } from "./components/SideNavigation/SideNavigationText";
|
|
52
|
-
export { default as Slider } from "./components/Slider";
|
|
53
|
-
export { default as Switch } from "./components/Switch";
|
|
54
|
-
export { default as Spinner } from "./components/Spinner";
|
|
55
|
-
export { default as StatusLabel, StatusLabelAppearance, } from "./components/StatusLabel";
|
|
56
|
-
export { default as Strip } from "./components/Strip";
|
|
57
|
-
export { default as SummaryButton } from "./components/SummaryButton";
|
|
58
|
-
export { default as Table } from "./components/Table";
|
|
59
|
-
export { default as TableCell } from "./components/TableCell";
|
|
60
|
-
export { default as TableHeader } from "./components/TableHeader";
|
|
61
|
-
export { default as TableRow } from "./components/TableRow";
|
|
62
|
-
export { default as Tabs } from "./components/Tabs";
|
|
63
|
-
export { default as Textarea } from "./components/Textarea";
|
|
64
|
-
export { default as Tooltip } from "./components/Tooltip";
|
|
65
|
-
export { default as TablePagination } from "./components/TablePagination";
|
|
66
|
-
export { default as TablePaginationControls } from "./components/TablePagination/TablePaginationControls";
|
|
67
|
-
export type { AccordionProps } from "./components/Accordion";
|
|
68
|
-
export type { ActionButtonProps } from "./components/ActionButton";
|
|
69
|
-
export type { ArticlePaginationProps } from "./components/ArticlePagination";
|
|
70
|
-
export type { ApplicationLayoutProps } from "./components/ApplicationLayout";
|
|
71
|
-
export type { AppAsideProps } from "./components/ApplicationLayout/AppAside";
|
|
72
|
-
export type { ApplicationProps } from "./components/ApplicationLayout/Application";
|
|
73
|
-
export type { AppMainProps } from "./components/ApplicationLayout/AppMain";
|
|
74
|
-
export type { AppNavigationProps } from "./components/ApplicationLayout/AppNavigation";
|
|
75
|
-
export type { AppNavigationBarProps } from "./components/ApplicationLayout/AppNavigationBar";
|
|
76
|
-
export type { AppStatusProps } from "./components/ApplicationLayout/AppStatus";
|
|
77
|
-
export type { BadgeProps } from "./components/Badge";
|
|
78
|
-
export type { ButtonProps } from "./components/Button";
|
|
79
|
-
export type { CardProps } from "./components/Card";
|
|
80
|
-
export type { CheckboxInputProps } from "./components/CheckboxInput";
|
|
81
|
-
export type { ChipProps } from "./components/Chip";
|
|
82
|
-
export type { CodeProps } from "./components/Code";
|
|
83
|
-
export type { CodeSnippetProps, CodeSnippetBlockProps, CodeSnippetDropdownProps, } from "./components/CodeSnippet";
|
|
84
|
-
export type { ColProps, ColSize } from "./components/Col";
|
|
85
|
-
export type { ConfirmationButtonProps } from "./components/ConfirmationButton";
|
|
86
|
-
export type { ConfirmationModalProps } from "./components/ConfirmationModal";
|
|
87
|
-
export type { ContextualMenuProps, ContextualMenuDropdownProps, MenuLink, Position, } from "./components/ContextualMenu";
|
|
88
|
-
export type { EmptyStateProps } from "./components/EmptyState";
|
|
89
|
-
export type { FieldProps } from "./components/Field";
|
|
90
|
-
export type { FormProps } from "./components/Form";
|
|
91
|
-
export type { FormikFieldProps } from "./components/FormikField";
|
|
92
|
-
export type { IconProps } from "./components/Icon";
|
|
93
|
-
export type { InputProps } from "./components/Input";
|
|
94
|
-
export type { LabelProps } from "./components/Label";
|
|
95
|
-
export type { LinkProps } from "./components/Link";
|
|
96
|
-
export type { ListProps } from "./components/List";
|
|
97
|
-
export type { MainTableProps } from "./components/MainTable";
|
|
98
|
-
export type { ModularTableProps } from "./components/ModularTable";
|
|
99
|
-
export type { ModalProps } from "./components/Modal";
|
|
100
|
-
export type { GenerateLink, LogoProps, NavigationProps, NavItem, NavLink, NavLinkAnchor, NavLinkBase, NavLinkButton, } from "./components/Navigation";
|
|
101
|
-
export type { NotificationProps } from "./components/Notification";
|
|
102
|
-
export type { NotificationAction, NotificationType, QueuedNotification, NotificationHelper, } from "./components/NotificationProvider";
|
|
103
|
-
export type { LoginPageLayoutProps } from "./components/LoginPageLayout";
|
|
104
|
-
export type { PaginationProps } from "./components/Pagination";
|
|
105
|
-
export type { PanelProps } from "./components/Panel";
|
|
106
|
-
export type { RadioInputProps } from "./components/RadioInput";
|
|
107
|
-
export type { RowProps } from "./components/Row";
|
|
108
|
-
export type { SearchAndFilterProps } from "./components/SearchAndFilter";
|
|
109
|
-
export type { SearchBoxProps } from "./components/SearchBox";
|
|
110
|
-
export type { SelectProps } from "./components/Select";
|
|
111
|
-
export type { SideNavigationProps } from "./components/SideNavigation";
|
|
112
|
-
export type { SideNavigationItemProps } from "./components/SideNavigation/SideNavigationItem";
|
|
113
|
-
export type { SideNavigationLinkProps } from "./components/SideNavigation/SideNavigationLink";
|
|
114
|
-
export type { SideNavigationTextProps } from "./components/SideNavigation/SideNavigationText";
|
|
115
|
-
export type { SliderProps } from "./components/Slider";
|
|
116
|
-
export type { SpinnerProps } from "./components/Spinner";
|
|
117
|
-
export type { StatusLabelProps } from "./components/StatusLabel";
|
|
118
|
-
export type { StripProps } from "./components/Strip";
|
|
119
|
-
export type { SummaryButtonProps } from "./components/SummaryButton";
|
|
120
|
-
export type { TableProps } from "./components/Table";
|
|
121
|
-
export type { TableCellProps } from "./components/TableCell";
|
|
122
|
-
export type { TableHeaderProps } from "./components/TableHeader";
|
|
123
|
-
export type { TableRowProps } from "./components/TableRow";
|
|
124
|
-
export type { TabsProps } from "./components/Tabs";
|
|
125
|
-
export type { TextareaProps } from "./components/Textarea";
|
|
126
|
-
export type { TooltipProps } from "./components/Tooltip";
|
|
127
|
-
export type { TablePaginationProps } from "./components/TablePagination";
|
|
128
|
-
export { useOnClickOutside, useClickOutside, useId, useListener, useOnEscapePressed, usePagination, usePrevious, useThrottle, useWindowFitment, } from "./hooks";
|
|
129
|
-
export type { WindowFitment } from "./hooks";
|
|
130
|
-
export { isNavigationAnchor, isNavigationButton } from "./utils";
|
|
131
|
-
export type { ClassName, Headings, PropsWithSpread, SortDirection, SubComponentProps, TSFixMe, ValueOf, } from "./types";
|
|
132
|
-
export { Theme } from "./enums";
|
package/dist/types/index.d.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This type should be used for all className props in order to ensure
|
|
3
|
-
* consistency across components.
|
|
4
|
-
*/
|
|
5
|
-
export type ClassName = string | null;
|
|
6
|
-
/**
|
|
7
|
-
* The allowable heading levels.
|
|
8
|
-
*/
|
|
9
|
-
export type Headings = "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
10
|
-
/**
|
|
11
|
-
* This type can be used when defining props that also spread the props of
|
|
12
|
-
* something else. It ensures that the defined component props are never
|
|
13
|
-
* overwritten by the spread props.
|
|
14
|
-
*/
|
|
15
|
-
export type PropsWithSpread<P, H> = P & Omit<H, keyof P>;
|
|
16
|
-
/**
|
|
17
|
-
* The allowable sort directions e.g. for a sortable table.
|
|
18
|
-
*/
|
|
19
|
-
export type SortDirection = "none" | "ascending" | "descending";
|
|
20
|
-
/**
|
|
21
|
-
* This type can be used when passing props to a sub component. It makes all
|
|
22
|
-
* component props optional.
|
|
23
|
-
*/
|
|
24
|
-
export type SubComponentProps<P> = Partial<P> & {
|
|
25
|
-
[prop: string]: unknown;
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* This type is simply an alias for the 'any' type and should be used sparingly,
|
|
29
|
-
* if at all.
|
|
30
|
-
*/
|
|
31
|
-
export type TSFixMe = any;
|
|
32
|
-
/**
|
|
33
|
-
* This type allows for converting an object const into an enum-like construct,
|
|
34
|
-
* e.g. value: ValueOf<typeof EnumLike> will only allow value to be a value
|
|
35
|
-
* defined in EnumLike.
|
|
36
|
-
*/
|
|
37
|
-
export type ValueOf<T> = T[keyof T];
|
|
38
|
-
export type ExclusiveProps<A, B> = (A & Partial<Record<keyof B, never>>) | (B & Partial<Record<keyof A, never>>);
|
package/dist/utils.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { NavLink, NavLinkAnchor, NavLinkButton } from "./components/Navigation";
|
|
2
|
-
import { ReactNode } from "react";
|
|
3
|
-
export declare const IS_DEV: boolean;
|
|
4
|
-
/**
|
|
5
|
-
* Find substring and wrap in <strong /> tag
|
|
6
|
-
* @param {string} str - The string to search
|
|
7
|
-
* @param {string} subString - The substring to find
|
|
8
|
-
* @return {Obj} newStr - Object with text and match bool
|
|
9
|
-
*/
|
|
10
|
-
export declare const highlightSubString: (str?: string, subString?: string) => {
|
|
11
|
-
text: string;
|
|
12
|
-
match: boolean;
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* Whether a navigation item is an anchor.
|
|
16
|
-
* @param link - The navigation item.
|
|
17
|
-
*/
|
|
18
|
-
export declare const isNavigationAnchor: (link: NavLink) => link is NavLinkAnchor;
|
|
19
|
-
/**
|
|
20
|
-
* Whether a navigation item is a button.
|
|
21
|
-
* @param link - The navigation item.
|
|
22
|
-
*/
|
|
23
|
-
export declare const isNavigationButton: (link: NavLink) => link is NavLinkButton;
|
|
24
|
-
/**
|
|
25
|
-
* A typeguard for whether an element is a ReactNode.
|
|
26
|
-
*/
|
|
27
|
-
export declare const isReactNode: (element: unknown) => element is ReactNode;
|