@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,201 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = exports.Timestamp = exports.Timeout = exports.Positive = exports.Negative = exports.Inline = exports.Information = exports.Dismissible = exports.Caution = exports.Borderless = exports.Actions = void 0;
|
|
7
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _Notification = _interopRequireWildcard(require("./Notification"));
|
|
9
|
-
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); }
|
|
10
|
-
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; }
|
|
11
|
-
const meta = {
|
|
12
|
-
component: _Notification.default,
|
|
13
|
-
tags: ["autodocs"],
|
|
14
|
-
argTypes: {
|
|
15
|
-
borderless: {
|
|
16
|
-
control: {
|
|
17
|
-
type: "boolean"
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
children: {
|
|
21
|
-
control: {
|
|
22
|
-
type: "text"
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
inline: {
|
|
26
|
-
control: {
|
|
27
|
-
type: "boolean"
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
severity: {
|
|
31
|
-
control: {
|
|
32
|
-
type: "radio"
|
|
33
|
-
},
|
|
34
|
-
options: Object.values(_Notification.NotificationSeverity)
|
|
35
|
-
},
|
|
36
|
-
timestamp: {
|
|
37
|
-
control: {
|
|
38
|
-
type: "text"
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
title: {
|
|
42
|
-
control: {
|
|
43
|
-
type: "text"
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
args: {
|
|
48
|
-
borderless: false,
|
|
49
|
-
inline: false,
|
|
50
|
-
severity: _Notification.NotificationSeverity.INFORMATION
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
var _default = exports.default = meta;
|
|
54
|
-
/**
|
|
55
|
-
* The information severity should be used to convey an information message.
|
|
56
|
-
*/
|
|
57
|
-
const Information = exports.Information = {
|
|
58
|
-
name: "Information",
|
|
59
|
-
args: {
|
|
60
|
-
children: "Anyone with access can view your invited users.",
|
|
61
|
-
severity: "information",
|
|
62
|
-
title: "Permissions changed"
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* The caution severity should be used to convey information that is not critical but the user should be aware of.
|
|
68
|
-
*/
|
|
69
|
-
const Caution = exports.Caution = {
|
|
70
|
-
name: "Caution",
|
|
71
|
-
args: {
|
|
72
|
-
children: "Custom storage configuration is only supported on Ubuntu, CentOS and RHEL.",
|
|
73
|
-
severity: "caution",
|
|
74
|
-
title: "Blocked"
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* The negative severity should be used to convey information that is critical and the user should take action.
|
|
80
|
-
*/
|
|
81
|
-
const Negative = exports.Negative = {
|
|
82
|
-
name: "Negative",
|
|
83
|
-
args: {
|
|
84
|
-
children: "Node must be connected to a network.",
|
|
85
|
-
severity: "negative",
|
|
86
|
-
title: "Error"
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* The positive severity should be used to convey success or completion.
|
|
92
|
-
*/
|
|
93
|
-
const Positive = exports.Positive = {
|
|
94
|
-
name: "Positive",
|
|
95
|
-
args: {
|
|
96
|
-
children: "Code successfully reformatted.",
|
|
97
|
-
severity: "positive",
|
|
98
|
-
title: "Success"
|
|
99
|
-
}
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* When vertical space is limited, you can use the inline variant.
|
|
104
|
-
*/
|
|
105
|
-
const Inline = exports.Inline = {
|
|
106
|
-
name: "Inline",
|
|
107
|
-
args: {
|
|
108
|
-
children: "Not enough space.",
|
|
109
|
-
inline: true,
|
|
110
|
-
severity: "negative",
|
|
111
|
-
title: "Error:"
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* In cases where a notification sits inside another component, such as a table cell or a card, it may be useful to remove the outer border and highlight bar.
|
|
117
|
-
*/
|
|
118
|
-
const Borderless = exports.Borderless = {
|
|
119
|
-
name: "Borderless",
|
|
120
|
-
args: {
|
|
121
|
-
borderless: true,
|
|
122
|
-
children: "Only 8GB storage remaining.",
|
|
123
|
-
severity: "caution",
|
|
124
|
-
title: "Warning"
|
|
125
|
-
}
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
* Actions will appear below the notification message.
|
|
130
|
-
*/
|
|
131
|
-
const Actions = exports.Actions = {
|
|
132
|
-
name: "Actions",
|
|
133
|
-
args: {
|
|
134
|
-
actions: [{
|
|
135
|
-
label: "Action 1",
|
|
136
|
-
onClick: () => null
|
|
137
|
-
}, {
|
|
138
|
-
label: "Action 2",
|
|
139
|
-
onClick: () => null
|
|
140
|
-
}],
|
|
141
|
-
children: "Body lorem ipsum dolor sit amet consequiteor. Lorem ipsum dolor sit amet consequiteor.",
|
|
142
|
-
severity: "information",
|
|
143
|
-
title: "Title"
|
|
144
|
-
}
|
|
145
|
-
};
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* Notifications that can be dismissed should be given an onDismiss function.
|
|
149
|
-
*/
|
|
150
|
-
const Dismissible = exports.Dismissible = {
|
|
151
|
-
render: () => {
|
|
152
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
153
|
-
const [show, setShow] = (0, _react.useState)(true);
|
|
154
|
-
if (!show) {
|
|
155
|
-
return null;
|
|
156
|
-
}
|
|
157
|
-
return /*#__PURE__*/_react.default.createElement(_Notification.default, {
|
|
158
|
-
onDismiss: () => setShow(false),
|
|
159
|
-
title: "Dismissible"
|
|
160
|
-
}, "Click the dismiss button to get rid of me.");
|
|
161
|
-
},
|
|
162
|
-
name: "Dismissible"
|
|
163
|
-
};
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* Notifications can be automatically dismissed after a timeout interval.
|
|
167
|
-
*/
|
|
168
|
-
const Timeout = exports.Timeout = {
|
|
169
|
-
render: () => {
|
|
170
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
171
|
-
const [show, setShow] = (0, _react.useState)(true);
|
|
172
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
173
|
-
const [timer, setTimer] = (0, _react.useState)(0);
|
|
174
|
-
if (!show) {
|
|
175
|
-
return null;
|
|
176
|
-
}
|
|
177
|
-
return /*#__PURE__*/_react.default.createElement(_Notification.default, {
|
|
178
|
-
actions: [{
|
|
179
|
-
label: "Start timer",
|
|
180
|
-
onClick: () => setTimer(3000)
|
|
181
|
-
}],
|
|
182
|
-
onDismiss: () => setShow(false),
|
|
183
|
-
timeout: timer,
|
|
184
|
-
title: "Timeout"
|
|
185
|
-
}, "Click the action to start a 3 second timer.");
|
|
186
|
-
},
|
|
187
|
-
name: "Timeout"
|
|
188
|
-
};
|
|
189
|
-
|
|
190
|
-
/**
|
|
191
|
-
* For notifications in which recency is important, you can include a section for time.
|
|
192
|
-
*/
|
|
193
|
-
const Timestamp = exports.Timestamp = {
|
|
194
|
-
name: "Timestamp",
|
|
195
|
-
args: {
|
|
196
|
-
children: "Body lorem ipsum dolor sit amet consequiteor. Lorem ipsum dolor sit amet consequiteor.",
|
|
197
|
-
severity: "information",
|
|
198
|
-
timestamp: "1h ago",
|
|
199
|
-
title: "Title"
|
|
200
|
-
}
|
|
201
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { FC } from "react";
|
|
2
|
-
import { NotificationHelper, NotifyProviderProps } from "./types";
|
|
3
|
-
export declare const NotificationProvider: FC<NotifyProviderProps>;
|
|
4
|
-
export declare function useNotify(): NotificationHelper;
|
|
5
|
-
export declare const NotificationConsumer: FC;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export { NotificationConsumer, NotificationProvider, useNotify, } from "./NotificationProvider";
|
|
2
|
-
export { info, success, failure, queue } from "./messageBuilder";
|
|
3
|
-
export type { NotificationAction, NotificationType, QueuedNotification, NotificationHelper, } from "./types";
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { NotificationAction, NotificationType, QueuedNotification } from "./types";
|
|
2
|
-
import { ReactNode } from "react";
|
|
3
|
-
export declare const queue: (notification: NotificationType) => QueuedNotification;
|
|
4
|
-
export declare const info: (message: ReactNode, title?: string) => NotificationType;
|
|
5
|
-
export declare const success: (message: ReactNode, title?: string) => NotificationType;
|
|
6
|
-
export declare const failure: (title: string, error: unknown, message?: ReactNode, actions?: NotificationAction[]) => NotificationType;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
2
|
-
import { ValueOf } from "../../types";
|
|
3
|
-
import { NotificationSeverity } from "../Notification";
|
|
4
|
-
export interface NotifyProviderProps {
|
|
5
|
-
state?: {
|
|
6
|
-
queuedNotification: NotificationType | null;
|
|
7
|
-
};
|
|
8
|
-
pathname?: string;
|
|
9
|
-
children: ReactNode;
|
|
10
|
-
}
|
|
11
|
-
export interface NotificationAction {
|
|
12
|
-
label: string;
|
|
13
|
-
onClick: () => void;
|
|
14
|
-
}
|
|
15
|
-
export interface NotificationType {
|
|
16
|
-
actions?: NotificationAction[];
|
|
17
|
-
message: ReactNode;
|
|
18
|
-
title?: string;
|
|
19
|
-
type: ValueOf<typeof NotificationSeverity>;
|
|
20
|
-
}
|
|
21
|
-
export interface QueuedNotification {
|
|
22
|
-
state?: {
|
|
23
|
-
queuedNotification: NotificationType | null;
|
|
24
|
-
};
|
|
25
|
-
pathname?: string;
|
|
26
|
-
}
|
|
27
|
-
export interface NotificationHelper {
|
|
28
|
-
notification: NotificationType | null;
|
|
29
|
-
clear: () => void;
|
|
30
|
-
failure: (title: string, error: unknown, message?: ReactNode, actions?: NotificationAction[]) => NotificationType;
|
|
31
|
-
info: (message: ReactNode, title?: string) => NotificationType;
|
|
32
|
-
success: (message: ReactNode, title?: string) => NotificationType;
|
|
33
|
-
queue: (notification: NotificationType) => QueuedNotification;
|
|
34
|
-
setDeduplicated: (value: NotificationType) => NotificationType;
|
|
35
|
-
}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import type { HTMLProps } from "react";
|
|
2
|
-
import type { PropsWithSpread } from "../../types";
|
|
3
|
-
type BaseProps = {
|
|
4
|
-
/**
|
|
5
|
-
* Whether to scroll to the top of the list on page change.
|
|
6
|
-
*/
|
|
7
|
-
scrollToTop?: boolean;
|
|
8
|
-
/**
|
|
9
|
-
* The number of pages at which to truncate the pagination items.
|
|
10
|
-
*/
|
|
11
|
-
truncateThreshold?: number;
|
|
12
|
-
/**
|
|
13
|
-
* Whether the pagination is ceneterd on the page.
|
|
14
|
-
*/
|
|
15
|
-
centered?: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Whether to show the labels for forward and back buttons.
|
|
18
|
-
*/
|
|
19
|
-
showLabels?: boolean;
|
|
20
|
-
/**
|
|
21
|
-
* Whether forward button is disabled.
|
|
22
|
-
*/
|
|
23
|
-
forwardDisabled?: boolean;
|
|
24
|
-
/**
|
|
25
|
-
* Whether back button is disabled.
|
|
26
|
-
*/
|
|
27
|
-
backDisabled?: boolean;
|
|
28
|
-
/**
|
|
29
|
-
* Custom label for forward button.
|
|
30
|
-
*/
|
|
31
|
-
forwardLabel?: string;
|
|
32
|
-
/**
|
|
33
|
-
* Custom label for back button.
|
|
34
|
-
*/
|
|
35
|
-
backLabel?: string;
|
|
36
|
-
};
|
|
37
|
-
type NumberedPagination = BaseProps & {
|
|
38
|
-
/**
|
|
39
|
-
* The current page being viewed.<br>
|
|
40
|
-
* **Required for Numbered Pagination.**
|
|
41
|
-
*/
|
|
42
|
-
currentPage: number;
|
|
43
|
-
/**
|
|
44
|
-
* The number of items to show per page.<br>
|
|
45
|
-
* **Required for numbered pagination.**
|
|
46
|
-
*/
|
|
47
|
-
itemsPerPage: number;
|
|
48
|
-
/**
|
|
49
|
-
* Function to handle paginating the items.<br>
|
|
50
|
-
* **Required for numbered pagination.**
|
|
51
|
-
*/
|
|
52
|
-
paginate: (page: number) => void;
|
|
53
|
-
/**
|
|
54
|
-
* The total number of items.<br>
|
|
55
|
-
* **Required for numbered pagination.**
|
|
56
|
-
*/
|
|
57
|
-
totalItems: number;
|
|
58
|
-
/**
|
|
59
|
-
* Whether to hide the pagination items.
|
|
60
|
-
*/
|
|
61
|
-
hideNumbers?: boolean;
|
|
62
|
-
/**
|
|
63
|
-
* Function to handle page transition to a higher-numbered page for
|
|
64
|
-
* numbered pagination and to next page for buttons-only pagination.<br>
|
|
65
|
-
* _Called with page parameter for numbered pagination and_
|
|
66
|
-
* _with no parameter for buttons-only pagination._<br>
|
|
67
|
-
* **Required for buttons-only pagination.**
|
|
68
|
-
*/
|
|
69
|
-
onForward?: (page: number) => void;
|
|
70
|
-
/**
|
|
71
|
-
* Function to handle page transition to a lower-numbered page for
|
|
72
|
-
* numbered pagination and to next page for buttons-only pagination.<br>
|
|
73
|
-
* _Called with page parameter for numbered pagination and_
|
|
74
|
-
* _with no parameter for buttons-only pagination._<br>
|
|
75
|
-
* **Required for buttons-only pagination.**
|
|
76
|
-
*/
|
|
77
|
-
onBack?: (page: number) => void;
|
|
78
|
-
};
|
|
79
|
-
type ButtonsOnlyPagination = BaseProps & {
|
|
80
|
-
itemsPerPage?: never;
|
|
81
|
-
totalItems?: never;
|
|
82
|
-
currentPage?: never;
|
|
83
|
-
paginate?: never;
|
|
84
|
-
hideNumbers?: never;
|
|
85
|
-
onForward: () => void;
|
|
86
|
-
onBack: () => void;
|
|
87
|
-
};
|
|
88
|
-
export type Props = PropsWithSpread<NumberedPagination | ButtonsOnlyPagination, HTMLProps<HTMLElement>>;
|
|
89
|
-
/**
|
|
90
|
-
This is a [React](https://reactjs.org/) component for the Vanilla [Pagination](https://docs.vanillaframework.io/patterns/pagination/).
|
|
91
|
-
|
|
92
|
-
The pagination component should be used to navigate between pages of content. There are two types of pagination being provided:
|
|
93
|
-
|
|
94
|
-
* **Numbered Pagination:** used when the total number of items is known.<br />
|
|
95
|
-
Depending on the length provided, the pagination component will automatically scale.<br />
|
|
96
|
-
**Required props:** itemsPerPage, totalItems, paginate, currentPage.
|
|
97
|
-
|
|
98
|
-
* **Buttons-only Pagination:** used when the total number of items is unknown.<br />
|
|
99
|
-
**Required props:** onForward, onBack.
|
|
100
|
-
*/
|
|
101
|
-
declare const Pagination: ({ itemsPerPage, totalItems, paginate, currentPage, scrollToTop, truncateThreshold, centered, showLabels, hideNumbers, onForward, onBack, forwardDisabled, backDisabled, forwardLabel, backLabel, ...navProps }: Props) => JSX.Element;
|
|
102
|
-
export default Pagination;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import Pagination from "./Pagination";
|
|
3
|
-
declare const meta: Meta<typeof Pagination>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof Pagination>;
|
|
6
|
-
export declare const Default: Story;
|
|
7
|
-
export declare const TruncatedNumberedPagination: Story;
|
|
8
|
-
export declare const DisabledControlsNumberedPagination: Story;
|
|
9
|
-
export declare const CenteredNumberedPagination: Story;
|
|
10
|
-
export declare const DisabledPaginationItemsNumberedPagination: Story;
|
|
11
|
-
export declare const DefaultButtonsOnlyPagination: Story;
|
|
12
|
-
export declare const DefaultButtonLabelsButtonsOnlyPagination: Story;
|
|
13
|
-
export declare const CustomButtonLabelsButtonsOnlyPagination: Story;
|
|
14
|
-
export declare const CenteredButtonsOnlyPagination: Story;
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = exports.TruncatedNumberedPagination = exports.DisabledPaginationItemsNumberedPagination = exports.DisabledControlsNumberedPagination = exports.DefaultButtonsOnlyPagination = exports.DefaultButtonLabelsButtonsOnlyPagination = exports.Default = exports.CustomButtonLabelsButtonsOnlyPagination = exports.CenteredNumberedPagination = exports.CenteredButtonsOnlyPagination = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _Pagination = _interopRequireDefault(require("./Pagination"));
|
|
9
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
-
const meta = {
|
|
11
|
-
component: _Pagination.default,
|
|
12
|
-
tags: ["autodocs"]
|
|
13
|
-
};
|
|
14
|
-
var _default = exports.default = meta;
|
|
15
|
-
const Default = exports.Default = {
|
|
16
|
-
name: "Default",
|
|
17
|
-
args: {
|
|
18
|
-
itemsPerPage: 20,
|
|
19
|
-
totalItems: 100,
|
|
20
|
-
paginate: () => {},
|
|
21
|
-
currentPage: 3
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
const TruncatedNumberedPagination = exports.TruncatedNumberedPagination = {
|
|
25
|
-
render: () => /*#__PURE__*/_react.default.createElement(_Pagination.default, {
|
|
26
|
-
itemsPerPage: 10,
|
|
27
|
-
totalItems: 1000,
|
|
28
|
-
paginate: () => {},
|
|
29
|
-
currentPage: 34
|
|
30
|
-
}),
|
|
31
|
-
name: "Truncated (Numbered Pagination)"
|
|
32
|
-
};
|
|
33
|
-
const DisabledControlsNumberedPagination = exports.DisabledControlsNumberedPagination = {
|
|
34
|
-
render: () => /*#__PURE__*/_react.default.createElement(_Pagination.default, {
|
|
35
|
-
itemsPerPage: 20,
|
|
36
|
-
totalItems: 100,
|
|
37
|
-
paginate: () => {},
|
|
38
|
-
currentPage: 1
|
|
39
|
-
}),
|
|
40
|
-
name: "Disabled controls (Numbered Pagination)"
|
|
41
|
-
};
|
|
42
|
-
const CenteredNumberedPagination = exports.CenteredNumberedPagination = {
|
|
43
|
-
render: () => /*#__PURE__*/_react.default.createElement(_Pagination.default, {
|
|
44
|
-
itemsPerPage: 10,
|
|
45
|
-
totalItems: 50,
|
|
46
|
-
paginate: () => {},
|
|
47
|
-
currentPage: 1,
|
|
48
|
-
centered: true
|
|
49
|
-
}),
|
|
50
|
-
name: "Centered (Numbered Pagination)"
|
|
51
|
-
};
|
|
52
|
-
const DisabledPaginationItemsNumberedPagination = exports.DisabledPaginationItemsNumberedPagination = {
|
|
53
|
-
render: () => /*#__PURE__*/_react.default.createElement(_Pagination.default, {
|
|
54
|
-
itemsPerPage: 10,
|
|
55
|
-
totalItems: 50,
|
|
56
|
-
paginate: () => {},
|
|
57
|
-
currentPage: 1,
|
|
58
|
-
hideNumbers: true
|
|
59
|
-
}),
|
|
60
|
-
name: "Disabled pagination items (Numbered Pagination)"
|
|
61
|
-
};
|
|
62
|
-
const DefaultButtonsOnlyPagination = exports.DefaultButtonsOnlyPagination = {
|
|
63
|
-
render: () => /*#__PURE__*/_react.default.createElement(_Pagination.default, {
|
|
64
|
-
onForward: () => {},
|
|
65
|
-
onBack: () => {}
|
|
66
|
-
}),
|
|
67
|
-
name: "Default (Buttons-only Pagination)"
|
|
68
|
-
};
|
|
69
|
-
const DefaultButtonLabelsButtonsOnlyPagination = exports.DefaultButtonLabelsButtonsOnlyPagination = {
|
|
70
|
-
render: () => /*#__PURE__*/_react.default.createElement(_Pagination.default, {
|
|
71
|
-
onForward: () => {},
|
|
72
|
-
onBack: () => {},
|
|
73
|
-
showLabels: true
|
|
74
|
-
}),
|
|
75
|
-
name: "Default button labels (Buttons-only Pagination)"
|
|
76
|
-
};
|
|
77
|
-
const CustomButtonLabelsButtonsOnlyPagination = exports.CustomButtonLabelsButtonsOnlyPagination = {
|
|
78
|
-
render: () => /*#__PURE__*/_react.default.createElement(_Pagination.default, {
|
|
79
|
-
onForward: () => {},
|
|
80
|
-
onBack: () => {},
|
|
81
|
-
showLabels: true,
|
|
82
|
-
forwardLabel: "Custom forward label",
|
|
83
|
-
backLabel: "Custom back label"
|
|
84
|
-
}),
|
|
85
|
-
name: "Custom button labels (Buttons-only Pagination)"
|
|
86
|
-
};
|
|
87
|
-
const CenteredButtonsOnlyPagination = exports.CenteredButtonsOnlyPagination = {
|
|
88
|
-
render: () => /*#__PURE__*/_react.default.createElement(_Pagination.default, {
|
|
89
|
-
onForward: () => {},
|
|
90
|
-
onBack: () => {},
|
|
91
|
-
centered: true
|
|
92
|
-
}),
|
|
93
|
-
name: "Centered (Buttons-only Pagination)"
|
|
94
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { MouseEventHandler } from "react";
|
|
2
|
-
export declare enum Label {
|
|
3
|
-
Next = "Next page",
|
|
4
|
-
Previous = "Previous page"
|
|
5
|
-
}
|
|
6
|
-
export type PaginationDirection = "forward" | "back";
|
|
7
|
-
export type Props = {
|
|
8
|
-
/**
|
|
9
|
-
* The direction of the pagination.
|
|
10
|
-
*/
|
|
11
|
-
direction: PaginationDirection;
|
|
12
|
-
/**
|
|
13
|
-
* Whether the pagination button should be disabled.
|
|
14
|
-
*/
|
|
15
|
-
disabled?: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Function to handle clicking the pagination button.
|
|
18
|
-
*/
|
|
19
|
-
onClick: MouseEventHandler<HTMLButtonElement>;
|
|
20
|
-
/**
|
|
21
|
-
* Whether to show the label for button.
|
|
22
|
-
*/
|
|
23
|
-
showLabel?: boolean;
|
|
24
|
-
/**
|
|
25
|
-
* Custom label for button.
|
|
26
|
-
*/
|
|
27
|
-
label?: string;
|
|
28
|
-
};
|
|
29
|
-
declare const PaginationButton: ({ direction, onClick, disabled, showLabel, label, }: Props) => JSX.Element;
|
|
30
|
-
export default PaginationButton;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { MouseEventHandler } from "react";
|
|
2
|
-
export type Props = {
|
|
3
|
-
/**
|
|
4
|
-
* Whether the pagination item is active, i.e. the current page is this page.
|
|
5
|
-
*/
|
|
6
|
-
isActive?: boolean;
|
|
7
|
-
/**
|
|
8
|
-
* The page number.
|
|
9
|
-
*/
|
|
10
|
-
number: number;
|
|
11
|
-
/**
|
|
12
|
-
* Function to handle clicking the pagination item.
|
|
13
|
-
*/
|
|
14
|
-
onClick: MouseEventHandler<HTMLButtonElement>;
|
|
15
|
-
};
|
|
16
|
-
declare const PaginationItem: ({ number, onClick, isActive, }: Props) => JSX.Element;
|
|
17
|
-
export default PaginationItem;
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import type { PropsWithSpread } from "../../types";
|
|
3
|
-
import type { ComponentType, ElementType, HTMLProps, PropsWithChildren, ReactNode } from "react";
|
|
4
|
-
import type { ExclusiveProps } from "../../types";
|
|
5
|
-
export type LogoDefaultElement = HTMLProps<HTMLAnchorElement>;
|
|
6
|
-
type PanelLogo<L = LogoDefaultElement> = ReactNode | PropsWithSpread<{
|
|
7
|
-
/**
|
|
8
|
-
* The url of the icon image.
|
|
9
|
-
*/
|
|
10
|
-
icon: string;
|
|
11
|
-
/**
|
|
12
|
-
* The alt text for the icon image.
|
|
13
|
-
*/
|
|
14
|
-
iconAlt?: string;
|
|
15
|
-
/**
|
|
16
|
-
* The url of the name image.
|
|
17
|
-
*/
|
|
18
|
-
name: string;
|
|
19
|
-
/**
|
|
20
|
-
* The alt text for the name image.
|
|
21
|
-
*/
|
|
22
|
-
nameAlt?: string;
|
|
23
|
-
/**
|
|
24
|
-
* The element or component to use for displaying the logo e.g. `a` or `NavLink`.
|
|
25
|
-
* @default a
|
|
26
|
-
*/
|
|
27
|
-
component?: ElementType | ComponentType<L>;
|
|
28
|
-
}, L>;
|
|
29
|
-
type PanelToggle = {
|
|
30
|
-
/**
|
|
31
|
-
* The panel toggle label.
|
|
32
|
-
*/
|
|
33
|
-
label: string;
|
|
34
|
-
/**
|
|
35
|
-
* The function to call when clicking the panel toggle.
|
|
36
|
-
*/
|
|
37
|
-
onClick: () => void;
|
|
38
|
-
};
|
|
39
|
-
type LogoProps<L = LogoDefaultElement> = {
|
|
40
|
-
/**
|
|
41
|
-
* The panel logo content or attributes.
|
|
42
|
-
*/
|
|
43
|
-
logo?: PanelLogo<L>;
|
|
44
|
-
};
|
|
45
|
-
type TitleProps = {
|
|
46
|
-
/**
|
|
47
|
-
* The panel title.
|
|
48
|
-
*/
|
|
49
|
-
title: ReactNode;
|
|
50
|
-
/**
|
|
51
|
-
* Classes to apply to the title element.
|
|
52
|
-
*/
|
|
53
|
-
titleClassName?: string;
|
|
54
|
-
/**
|
|
55
|
-
* The element to use for the panel title e.g. `h1`.
|
|
56
|
-
* @default h4
|
|
57
|
-
*/
|
|
58
|
-
titleComponent?: ElementType;
|
|
59
|
-
/**
|
|
60
|
-
* An ID for the title element.
|
|
61
|
-
*/
|
|
62
|
-
titleId?: string;
|
|
63
|
-
};
|
|
64
|
-
type HeaderProps<L = LogoDefaultElement> = ExclusiveProps<{
|
|
65
|
-
/**
|
|
66
|
-
* This prop can be used to replace the header area of the panel when the default implementation is not sufficient.
|
|
67
|
-
*/
|
|
68
|
-
header: ReactNode;
|
|
69
|
-
}, {
|
|
70
|
-
/**
|
|
71
|
-
* Content that will be displayed in the controls area.
|
|
72
|
-
*/
|
|
73
|
-
controls?: ReactNode;
|
|
74
|
-
/**
|
|
75
|
-
* Classes that will be applied to the controls element.
|
|
76
|
-
*/
|
|
77
|
-
controlsClassName?: string;
|
|
78
|
-
/**
|
|
79
|
-
* Whether the header should be sticky.
|
|
80
|
-
*/
|
|
81
|
-
stickyHeader?: boolean;
|
|
82
|
-
/**
|
|
83
|
-
* The panel toggle attributes.
|
|
84
|
-
*/
|
|
85
|
-
toggle?: PanelToggle;
|
|
86
|
-
} & ExclusiveProps<LogoProps<L>, TitleProps>>;
|
|
87
|
-
export type Props<L = LogoDefaultElement> = {
|
|
88
|
-
/**
|
|
89
|
-
* The panel content.
|
|
90
|
-
*/
|
|
91
|
-
children?: PropsWithChildren["children"];
|
|
92
|
-
/**
|
|
93
|
-
* Classes that are applied to the content container (when using `wrapContent`).
|
|
94
|
-
*/
|
|
95
|
-
contentClassName?: string | null;
|
|
96
|
-
/**
|
|
97
|
-
* Classes that are applied to the top level panel element.
|
|
98
|
-
*/
|
|
99
|
-
className?: string | null;
|
|
100
|
-
/**
|
|
101
|
-
* Whether to use the dark theme.
|
|
102
|
-
*/
|
|
103
|
-
dark?: boolean;
|
|
104
|
-
/**
|
|
105
|
-
* Whether the panel should wrap the content in the `p-panel__content` element.
|
|
106
|
-
* @default true
|
|
107
|
-
*/
|
|
108
|
-
wrapContent?: boolean;
|
|
109
|
-
/**
|
|
110
|
-
* A ref to pass to the top level panel element.
|
|
111
|
-
*/
|
|
112
|
-
forwardRef?: React.Ref<HTMLDivElement> | null;
|
|
113
|
-
} & HeaderProps<L>;
|
|
114
|
-
/**
|
|
115
|
-
* This is a [React](https://reactjs.org/) component for panels in the
|
|
116
|
-
* [Vanilla](https://vanillaframework.io/docs/) layouts.
|
|
117
|
-
*
|
|
118
|
-
* The Panel component can be used in many areas of the application layout. It
|
|
119
|
-
* can be the child element of `AppAside`, `AppMain`, `AppNavigation`, `AppNavigationBar`
|
|
120
|
-
* and `AppStatus`.
|
|
121
|
-
*/
|
|
122
|
-
declare const Panel: <L = LogoDefaultElement>({ forwardRef, children, className, contentClassName, controlsClassName, controls, dark, header, logo, stickyHeader, title, titleClassName, titleComponent: TitleComponent, titleId, toggle, wrapContent, ...props }: Props<L>) => React.JSX.Element;
|
|
123
|
-
export default Panel;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import Panel from "./Panel";
|
|
3
|
-
declare const meta: Meta<typeof Panel>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof Panel>;
|
|
6
|
-
export declare const Default: Story;
|
|
7
|
-
export declare const Header: Story;
|
|
8
|
-
/**
|
|
9
|
-
* The logo may be provided as attributes to use the standard logo. If this is
|
|
10
|
-
* not sufficient the a `ReactNode` can be passed to the `logo` prop instead.
|
|
11
|
-
*/
|
|
12
|
-
export declare const Logo: Story;
|
|
13
|
-
/**
|
|
14
|
-
* If the default header does not meet your needs then a `ReactNode` can be
|
|
15
|
-
* passed to the `header` prop to replace the header.
|
|
16
|
-
*/
|
|
17
|
-
export declare const CustomHeader: Story;
|