@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,61 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = exports.Positive = exports.Negative = exports.Information = exports.Default = exports.Caution = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _StatusLabel = _interopRequireWildcard(require("./StatusLabel"));
|
|
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
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
-
const meta = {
|
|
13
|
-
component: _StatusLabel.default,
|
|
14
|
-
tags: ["autodocs"],
|
|
15
|
-
argTypes: {
|
|
16
|
-
children: {
|
|
17
|
-
control: {
|
|
18
|
-
type: "text"
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
appearance: {
|
|
22
|
-
control: {
|
|
23
|
-
options: _StatusLabel.StatusLabelAppearance,
|
|
24
|
-
type: "select"
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
args: {
|
|
29
|
-
children: "Label",
|
|
30
|
-
appearance: _StatusLabel.StatusLabelAppearance.POSITIVE
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
var _default = exports.default = meta;
|
|
34
|
-
const Default = exports.Default = {
|
|
35
|
-
render: () => /*#__PURE__*/_react.default.createElement(_StatusLabel.default, null, "Default"),
|
|
36
|
-
name: "Default"
|
|
37
|
-
};
|
|
38
|
-
const Positive = exports.Positive = {
|
|
39
|
-
render: () => /*#__PURE__*/_react.default.createElement(_StatusLabel.default, {
|
|
40
|
-
appearance: "positive"
|
|
41
|
-
}, "Positive"),
|
|
42
|
-
name: "Positive"
|
|
43
|
-
};
|
|
44
|
-
const Caution = exports.Caution = {
|
|
45
|
-
render: () => /*#__PURE__*/_react.default.createElement(_StatusLabel.default, {
|
|
46
|
-
appearance: "caution"
|
|
47
|
-
}, "Caution"),
|
|
48
|
-
name: "Caution"
|
|
49
|
-
};
|
|
50
|
-
const Negative = exports.Negative = {
|
|
51
|
-
render: () => /*#__PURE__*/_react.default.createElement(_StatusLabel.default, {
|
|
52
|
-
appearance: "negative"
|
|
53
|
-
}, "Negative"),
|
|
54
|
-
name: "Negative"
|
|
55
|
-
};
|
|
56
|
-
const Information = exports.Information = {
|
|
57
|
-
render: () => /*#__PURE__*/_react.default.createElement(_StatusLabel.default, {
|
|
58
|
-
appearance: "information"
|
|
59
|
-
}, "Information"),
|
|
60
|
-
name: "Information"
|
|
61
|
-
};
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import type { ElementType, HTMLProps, ReactNode } from "react";
|
|
2
|
-
import type { ColSize } from "../Col/Col";
|
|
3
|
-
import type { ClassName, PropsWithSpread } from "../../types";
|
|
4
|
-
export type Props = PropsWithSpread<{
|
|
5
|
-
/**
|
|
6
|
-
* The content of the strip.
|
|
7
|
-
*/
|
|
8
|
-
children: ReactNode;
|
|
9
|
-
/**
|
|
10
|
-
* A background images for the strip.
|
|
11
|
-
*/
|
|
12
|
-
background?: string;
|
|
13
|
-
/**
|
|
14
|
-
* Whether the strip should display borders.
|
|
15
|
-
*/
|
|
16
|
-
bordered?: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* Optional classes for the strip.
|
|
19
|
-
*/
|
|
20
|
-
className?: ClassName;
|
|
21
|
-
/**
|
|
22
|
-
* The width of the column if `includeCol` has been set.
|
|
23
|
-
*/
|
|
24
|
-
colSize?: ColSize;
|
|
25
|
-
/**
|
|
26
|
-
* Whether the strip should be dark.
|
|
27
|
-
*/
|
|
28
|
-
dark?: boolean;
|
|
29
|
-
/**
|
|
30
|
-
* Whether the strip should be deep.
|
|
31
|
-
*/
|
|
32
|
-
deep?: boolean;
|
|
33
|
-
/**
|
|
34
|
-
* The base HTML element of the strip.
|
|
35
|
-
*/
|
|
36
|
-
element?: ElementType;
|
|
37
|
-
/**
|
|
38
|
-
* Whether the strip should wrap the content in a column.
|
|
39
|
-
*/
|
|
40
|
-
includeCol?: boolean;
|
|
41
|
-
/**
|
|
42
|
-
* Whether the strip should be light.
|
|
43
|
-
*/
|
|
44
|
-
light?: boolean;
|
|
45
|
-
/**
|
|
46
|
-
* Optional classes to apply to the row.
|
|
47
|
-
*/
|
|
48
|
-
rowClassName?: string;
|
|
49
|
-
/**
|
|
50
|
-
* Whether the strip should be shallow.
|
|
51
|
-
*/
|
|
52
|
-
shallow?: boolean;
|
|
53
|
-
/**
|
|
54
|
-
* The type of the strip (e.g. "accent" or "image").
|
|
55
|
-
*/
|
|
56
|
-
type?: string;
|
|
57
|
-
}, HTMLProps<HTMLElement>>;
|
|
58
|
-
/**
|
|
59
|
-
* This is a [React](https://reactjs.org/) component for the Vanilla [Strip](https://docs.vanillaframework.io/patterns/strip/).
|
|
60
|
-
*
|
|
61
|
-
* The strip pattern provides a full width strip container in which to wrap a row.
|
|
62
|
-
*/
|
|
63
|
-
declare const Strip: ({ background, bordered, children, className, colSize, dark, deep, includeCol, element: Component, light, rowClassName, shallow, type, ...props }: Props) => JSX.Element;
|
|
64
|
-
export default Strip;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import Strip from "./Strip";
|
|
3
|
-
declare const meta: Meta<typeof Strip>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof Strip>;
|
|
6
|
-
export declare const LightStrip: Story;
|
|
7
|
-
export declare const DarkStrip: Story;
|
|
8
|
-
export declare const AccentStrip: Story;
|
|
9
|
-
export declare const ImageStrip: Story;
|
|
10
|
-
export declare const BorderedStrip: Story;
|
|
11
|
-
export declare const DeepStrip: Story;
|
|
12
|
-
export declare const ShallowStrip: Story;
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = exports.ShallowStrip = exports.LightStrip = exports.ImageStrip = exports.DeepStrip = exports.DarkStrip = exports.BorderedStrip = exports.AccentStrip = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _Col = _interopRequireDefault(require("../Col"));
|
|
9
|
-
var _Row = _interopRequireDefault(require("../Row"));
|
|
10
|
-
var _Strip = _interopRequireDefault(require("./Strip"));
|
|
11
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
-
const meta = {
|
|
13
|
-
component: _Strip.default,
|
|
14
|
-
tags: ["autodocs"],
|
|
15
|
-
argTypes: {
|
|
16
|
-
children: {
|
|
17
|
-
control: {
|
|
18
|
-
disable: true
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
var _default = exports.default = meta;
|
|
24
|
-
const LightStrip = exports.LightStrip = {
|
|
25
|
-
name: "Light strip",
|
|
26
|
-
args: {
|
|
27
|
-
type: "light",
|
|
28
|
-
children: /*#__PURE__*/_react.default.createElement("p", null, "This is a light row")
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
const DarkStrip = exports.DarkStrip = {
|
|
32
|
-
render: () => /*#__PURE__*/_react.default.createElement(_Strip.default, {
|
|
33
|
-
type: "dark"
|
|
34
|
-
}, /*#__PURE__*/_react.default.createElement("p", null, "This is a dark row")),
|
|
35
|
-
name: "Dark strip"
|
|
36
|
-
};
|
|
37
|
-
const AccentStrip = exports.AccentStrip = {
|
|
38
|
-
render: () => /*#__PURE__*/_react.default.createElement(_Strip.default, {
|
|
39
|
-
type: "accent",
|
|
40
|
-
element: "section",
|
|
41
|
-
includeCol: false
|
|
42
|
-
}, /*#__PURE__*/_react.default.createElement(_Col.default, {
|
|
43
|
-
size: 8
|
|
44
|
-
}, /*#__PURE__*/_react.default.createElement("h1", null, "Still running Ubuntu 14.04 LTS?"), /*#__PURE__*/_react.default.createElement("p", null, "Learn how to maintain ongoing security compliance for your Ubuntu 14.04 LTS systems.")), /*#__PURE__*/_react.default.createElement(_Col.default, {
|
|
45
|
-
size: 4
|
|
46
|
-
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
47
|
-
src: "https://assets.ubuntu.com/v1/2217d1c8-Security.svg",
|
|
48
|
-
alt: "Placeholder"
|
|
49
|
-
}))),
|
|
50
|
-
name: "Accent strip"
|
|
51
|
-
};
|
|
52
|
-
const ImageStrip = exports.ImageStrip = {
|
|
53
|
-
render: () => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Strip.default, {
|
|
54
|
-
background: "https://assets.ubuntu.com/sites/ubuntu/latest/u/img/backgrounds/image-background-paper.png",
|
|
55
|
-
includeCol: false,
|
|
56
|
-
element: "section",
|
|
57
|
-
light: true,
|
|
58
|
-
rowClassName: "u-vertically-center",
|
|
59
|
-
type: "image"
|
|
60
|
-
}, /*#__PURE__*/_react.default.createElement(_Col.default, {
|
|
61
|
-
size: 8
|
|
62
|
-
}, /*#__PURE__*/_react.default.createElement("h1", null, "Get started with big software, fast"), /*#__PURE__*/_react.default.createElement("p", null, "conjure-up lets you summon up a big-software stack as a \u201Cspell\u201D \u2014 a model of the stack, combined with extra know-how to get you from an installed stack to a fully usable one. Start using your big software instead of learning how to deploy it.")), /*#__PURE__*/_react.default.createElement(_Col.default, {
|
|
63
|
-
size: 4,
|
|
64
|
-
className: "u-hide--small u-align--center"
|
|
65
|
-
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
66
|
-
src: "https://assets.ubuntu.com/v1/1abb8716-conjure-up-illustration.svg",
|
|
67
|
-
alt: "Placeholder"
|
|
68
|
-
}))), /*#__PURE__*/_react.default.createElement(_Strip.default, {
|
|
69
|
-
background: "https://assets.ubuntu.com/v1/9b68976e-Aubergine_suru_background_2.png",
|
|
70
|
-
dark: true,
|
|
71
|
-
includeCol: false,
|
|
72
|
-
element: "section",
|
|
73
|
-
type: "image"
|
|
74
|
-
}, /*#__PURE__*/_react.default.createElement(_Row.default, {
|
|
75
|
-
className: "u-vertically-center"
|
|
76
|
-
}, /*#__PURE__*/_react.default.createElement(_Col.default, {
|
|
77
|
-
size: 8
|
|
78
|
-
}, /*#__PURE__*/_react.default.createElement("h1", null, "We are Canonical"), /*#__PURE__*/_react.default.createElement("p", null, "It is our mission to make open source software available to people everywhere. We believe the best way to fuel innovation is to give the innovators the technology they need.")), /*#__PURE__*/_react.default.createElement(_Col.default, {
|
|
79
|
-
size: 4,
|
|
80
|
-
className: "u-hide--small u-align--center"
|
|
81
|
-
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
82
|
-
src: "https://assets.ubuntu.com/v1/9c74eb2d-logo-canonical-white.svg",
|
|
83
|
-
alt: "Placeholder"
|
|
84
|
-
}))))),
|
|
85
|
-
name: "Image strip"
|
|
86
|
-
};
|
|
87
|
-
const BorderedStrip = exports.BorderedStrip = {
|
|
88
|
-
render: () => /*#__PURE__*/_react.default.createElement(_Strip.default, {
|
|
89
|
-
bordered: true,
|
|
90
|
-
colSize: 8,
|
|
91
|
-
element: "section"
|
|
92
|
-
}, /*#__PURE__*/_react.default.createElement("h2", null, "The node lifecycle"), /*#__PURE__*/_react.default.createElement("p", null, "Each machine (\u201Cnode\u201D) managed by MAAS goes through a lifecycle \u2014 from its enlistment or onboarding to MAAS, through commissioning when we inventory and can setup firmware or other hardware-specific elements, then allocation to a user and deployment, and finally they are released back to the pool or retired altogether.")),
|
|
93
|
-
name: "Bordered strip"
|
|
94
|
-
};
|
|
95
|
-
const DeepStrip = exports.DeepStrip = {
|
|
96
|
-
render: () => /*#__PURE__*/_react.default.createElement(_Strip.default, {
|
|
97
|
-
deep: true,
|
|
98
|
-
includeCol: false,
|
|
99
|
-
element: "section",
|
|
100
|
-
type: "light",
|
|
101
|
-
rowClassName: "u-vertically-center"
|
|
102
|
-
}, /*#__PURE__*/_react.default.createElement(_Col.default, {
|
|
103
|
-
size: 8
|
|
104
|
-
}, /*#__PURE__*/_react.default.createElement("h2", null, "The fastest way to go from development to production in IoT"), /*#__PURE__*/_react.default.createElement("p", null, "Learn about how Ubuntu Core and snaps can help you build your connected devices.")), /*#__PURE__*/_react.default.createElement(_Col.default, {
|
|
105
|
-
size: 4,
|
|
106
|
-
className: "u-hide--small u-align--center"
|
|
107
|
-
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
108
|
-
src: "https://assets.ubuntu.com/v1/808a4e5b-iot.png?h=300",
|
|
109
|
-
alt: "Placeholder"
|
|
110
|
-
}))),
|
|
111
|
-
name: "Deep strip"
|
|
112
|
-
};
|
|
113
|
-
const ShallowStrip = exports.ShallowStrip = {
|
|
114
|
-
render: () => /*#__PURE__*/_react.default.createElement(_Strip.default, {
|
|
115
|
-
shallow: true,
|
|
116
|
-
includeCol: false,
|
|
117
|
-
element: "section",
|
|
118
|
-
type: "light",
|
|
119
|
-
rowClassName: "u-vertically-center"
|
|
120
|
-
}, /*#__PURE__*/_react.default.createElement(_Col.default, {
|
|
121
|
-
size: 8
|
|
122
|
-
}, /*#__PURE__*/_react.default.createElement("h2", null, "The fastest way to go from development to production in IoT"), /*#__PURE__*/_react.default.createElement("p", null, "Learn about how Ubuntu Core and snaps can help you build your connected devices.")), /*#__PURE__*/_react.default.createElement(_Col.default, {
|
|
123
|
-
size: 4,
|
|
124
|
-
className: "u-hide--small u-align--center"
|
|
125
|
-
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
126
|
-
src: "https://assets.ubuntu.com/v1/808a4e5b-iot.png?h=300",
|
|
127
|
-
alt: "Placeholder"
|
|
128
|
-
}))),
|
|
129
|
-
name: "Shallow strip"
|
|
130
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { MouseEventHandler } from "react";
|
|
2
|
-
import type { ClassName } from "../../types";
|
|
3
|
-
export type Props = {
|
|
4
|
-
/**
|
|
5
|
-
* Optional class(es) to pass to the wrapping element.
|
|
6
|
-
*/
|
|
7
|
-
className?: ClassName;
|
|
8
|
-
/**
|
|
9
|
-
* Whether the summary button is loading.
|
|
10
|
-
*/
|
|
11
|
-
isLoading?: boolean;
|
|
12
|
-
/**
|
|
13
|
-
* The label of the summary button.
|
|
14
|
-
*/
|
|
15
|
-
label: string;
|
|
16
|
-
/**
|
|
17
|
-
* Function to handle clicking the summary button.
|
|
18
|
-
*/
|
|
19
|
-
onClick: MouseEventHandler<HTMLButtonElement>;
|
|
20
|
-
/**
|
|
21
|
-
* The summary content.
|
|
22
|
-
*/
|
|
23
|
-
summary?: string;
|
|
24
|
-
};
|
|
25
|
-
/**
|
|
26
|
-
* `SummaryButton` is a component to render a short summary with an action button. It's initial use case is a summary of table contents with action to load more items.
|
|
27
|
-
*/
|
|
28
|
-
declare const SummaryButton: ({ className, isLoading, summary, label, onClick, }: Props) => JSX.Element;
|
|
29
|
-
export default SummaryButton;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import SummaryButton from "./SummaryButton";
|
|
3
|
-
declare const meta: Meta<typeof SummaryButton>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof SummaryButton>;
|
|
6
|
-
export declare const Default: Story;
|
|
7
|
-
/**
|
|
8
|
-
* Summary text is optional.
|
|
9
|
-
*/
|
|
10
|
-
export declare const ActionOnly: Story;
|
|
11
|
-
/**
|
|
12
|
-
* Action is optional as well. When `onClick` prop is not provided component will render just the summary text.
|
|
13
|
-
*/
|
|
14
|
-
export declare const SummaryOnly: Story;
|
|
15
|
-
/**
|
|
16
|
-
* When data is loaded asynchronusly `isLoading` prop should be set to `true` to shows a spinner animation in place of the action button.
|
|
17
|
-
*/
|
|
18
|
-
export declare const Loading: Story;
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = exports.SummaryOnly = exports.Loading = exports.Default = exports.ActionOnly = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _SummaryButton = _interopRequireDefault(require("./SummaryButton"));
|
|
9
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
-
const doNothing = () => {};
|
|
11
|
-
const meta = {
|
|
12
|
-
component: _SummaryButton.default,
|
|
13
|
-
tags: ["autodocs"]
|
|
14
|
-
};
|
|
15
|
-
var _default = exports.default = meta;
|
|
16
|
-
const Default = exports.Default = {
|
|
17
|
-
render: () => /*#__PURE__*/_react.default.createElement(_SummaryButton.default, {
|
|
18
|
-
summary: "Showing 15 out of 100 items.",
|
|
19
|
-
label: "Show more",
|
|
20
|
-
onClick: doNothing
|
|
21
|
-
}),
|
|
22
|
-
name: "Default"
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Summary text is optional.
|
|
27
|
-
*/
|
|
28
|
-
const ActionOnly = exports.ActionOnly = {
|
|
29
|
-
render: () => /*#__PURE__*/_react.default.createElement(_SummaryButton.default, {
|
|
30
|
-
label: "Show more items",
|
|
31
|
-
onClick: doNothing
|
|
32
|
-
}),
|
|
33
|
-
name: "Action only"
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Action is optional as well. When `onClick` prop is not provided component will render just the summary text.
|
|
38
|
-
*/
|
|
39
|
-
const SummaryOnly = exports.SummaryOnly = {
|
|
40
|
-
render: () => /*#__PURE__*/_react.default.createElement(_SummaryButton.default, {
|
|
41
|
-
summary: "Showing 100 out of 100 items.",
|
|
42
|
-
label: "Show more items",
|
|
43
|
-
onClick: doNothing
|
|
44
|
-
}),
|
|
45
|
-
name: "Summary only"
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* When data is loaded asynchronusly `isLoading` prop should be set to `true` to shows a spinner animation in place of the action button.
|
|
50
|
-
*/
|
|
51
|
-
const Loading = exports.Loading = {
|
|
52
|
-
render: () => /*#__PURE__*/_react.default.createElement(_SummaryButton.default, {
|
|
53
|
-
summary: "Showing 15 out of 100 items.",
|
|
54
|
-
label: "Show more",
|
|
55
|
-
isLoading: true,
|
|
56
|
-
onClick: doNothing
|
|
57
|
-
}),
|
|
58
|
-
name: "Loading"
|
|
59
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { HTMLProps, ReactNode } from "react";
|
|
2
|
-
import type { PropsWithSpread } from "../../types";
|
|
3
|
-
export type Props = PropsWithSpread<{
|
|
4
|
-
/**
|
|
5
|
-
* The label name for the switch
|
|
6
|
-
*/
|
|
7
|
-
label: ReactNode;
|
|
8
|
-
/**
|
|
9
|
-
* Whether the switch is disabled or not
|
|
10
|
-
*/
|
|
11
|
-
disabled?: boolean;
|
|
12
|
-
}, HTMLProps<HTMLInputElement>>;
|
|
13
|
-
/**
|
|
14
|
-
* This is a [React](https://reactjs.org/) component for the Vanilla [Switch](https://vanillaframework.io/docs/patterns/switch) component.
|
|
15
|
-
*/
|
|
16
|
-
export declare const Switch: ({ label, disabled, ...inputProps }: Props) => JSX.Element;
|
|
17
|
-
export default Switch;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import Switch from "./Switch";
|
|
3
|
-
declare const meta: Meta<typeof Switch>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof Switch>;
|
|
6
|
-
export declare const Default: Story;
|
|
7
|
-
export declare const Disabled: Story;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = exports.Disabled = exports.Default = void 0;
|
|
7
|
-
var _Switch = _interopRequireDefault(require("./Switch"));
|
|
8
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
-
const meta = {
|
|
10
|
-
component: _Switch.default,
|
|
11
|
-
tags: ["autodocs"]
|
|
12
|
-
};
|
|
13
|
-
var _default = exports.default = meta;
|
|
14
|
-
const Default = exports.Default = {
|
|
15
|
-
name: "Default",
|
|
16
|
-
args: {
|
|
17
|
-
label: "Switch"
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
const Disabled = exports.Disabled = {
|
|
21
|
-
name: "Disabled",
|
|
22
|
-
args: {
|
|
23
|
-
disabled: true,
|
|
24
|
-
label: "Disabled switch"
|
|
25
|
-
}
|
|
26
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { HTMLProps, ReactNode } from "react";
|
|
2
|
-
import type { ClassName, PropsWithSpread } from "../../types";
|
|
3
|
-
export type Props = PropsWithSpread<{
|
|
4
|
-
/**
|
|
5
|
-
* The content of the table.
|
|
6
|
-
*/
|
|
7
|
-
children?: ReactNode;
|
|
8
|
-
/**
|
|
9
|
-
* Optional class(es) to pass to the wrapping table element.
|
|
10
|
-
*/
|
|
11
|
-
className?: ClassName;
|
|
12
|
-
/**
|
|
13
|
-
* Whether the table can expand hidden cells.
|
|
14
|
-
*/
|
|
15
|
-
expanding?: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Whether the table should show card styling on smaller screens.
|
|
18
|
-
*/
|
|
19
|
-
responsive?: boolean;
|
|
20
|
-
}, HTMLProps<HTMLTableElement>>;
|
|
21
|
-
declare const Table: ({ children, className, expanding, responsive, ...props }: Props) => JSX.Element;
|
|
22
|
-
export default Table;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { HTMLProps, ReactNode } from "react";
|
|
2
|
-
import type { ClassName, PropsWithSpread } from "../../types";
|
|
3
|
-
export type Props = PropsWithSpread<{
|
|
4
|
-
/**
|
|
5
|
-
* The content of the table cell.
|
|
6
|
-
*/
|
|
7
|
-
children?: ReactNode;
|
|
8
|
-
/**
|
|
9
|
-
* Optional class(es) to pass to the wrapping td element.
|
|
10
|
-
*/
|
|
11
|
-
className?: ClassName;
|
|
12
|
-
/**
|
|
13
|
-
* Whether the cell is an expanded cell.
|
|
14
|
-
*/
|
|
15
|
-
expanding?: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Whether content of the cell should be able to overflow, e.g. a dropdown.
|
|
18
|
-
*/
|
|
19
|
-
hasOverflow?: boolean;
|
|
20
|
-
/**
|
|
21
|
-
* Whether the cell is currently hidden.
|
|
22
|
-
*/
|
|
23
|
-
hidden?: boolean;
|
|
24
|
-
}, HTMLProps<HTMLTableCellElement>>;
|
|
25
|
-
declare const TableCell: ({ children, className, hasOverflow, expanding, hidden, role, ...props }: Props) => JSX.Element;
|
|
26
|
-
export default TableCell;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { HTMLProps, ReactNode } from "react";
|
|
2
|
-
import { PropsWithSpread, SortDirection } from "../../types";
|
|
3
|
-
export type Props = PropsWithSpread<{
|
|
4
|
-
/**
|
|
5
|
-
* The content of the table header.
|
|
6
|
-
*/
|
|
7
|
-
children?: ReactNode;
|
|
8
|
-
/**
|
|
9
|
-
* The direction of sorting, if applicable.
|
|
10
|
-
*/
|
|
11
|
-
sort?: SortDirection;
|
|
12
|
-
}, HTMLProps<HTMLTableHeaderCellElement>>;
|
|
13
|
-
declare const TableHeader: ({ children, sort, ...props }: Props) => JSX.Element;
|
|
14
|
-
export default TableHeader;
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import React, { HTMLAttributes, PropsWithChildren, ReactNode } from "react";
|
|
2
|
-
import "./TablePagination.scss";
|
|
3
|
-
export type BasePaginationProps = {
|
|
4
|
-
/**
|
|
5
|
-
* list of data elements to be paginated. This component is un-opinionated about
|
|
6
|
-
* the structure of the data but it should be identical to the data structure
|
|
7
|
-
* required by the child table component
|
|
8
|
-
*/
|
|
9
|
-
data: unknown[];
|
|
10
|
-
/**
|
|
11
|
-
* prop name of the child table component that receives paginated data.
|
|
12
|
-
* default value is set to `rows`, which is the data prop for the `MainTable` component
|
|
13
|
-
*/
|
|
14
|
-
dataForwardProp?: string;
|
|
15
|
-
/**
|
|
16
|
-
* the name of the item associated to each row within the table.
|
|
17
|
-
*/
|
|
18
|
-
itemName?: string;
|
|
19
|
-
/**
|
|
20
|
-
* custom styling for the pagination container
|
|
21
|
-
*/
|
|
22
|
-
className?: string;
|
|
23
|
-
/**
|
|
24
|
-
* custom description to be displayed by the pagination
|
|
25
|
-
*/
|
|
26
|
-
description?: ReactNode;
|
|
27
|
-
/**
|
|
28
|
-
* custom per page limits express as an array of numbers.
|
|
29
|
-
*/
|
|
30
|
-
pageLimits?: number[];
|
|
31
|
-
/**
|
|
32
|
-
* place the pagination component above or below the table?
|
|
33
|
-
*/
|
|
34
|
-
position?: "above" | "below";
|
|
35
|
-
};
|
|
36
|
-
export type ExternalControlProps = BasePaginationProps & {
|
|
37
|
-
/**
|
|
38
|
-
* Whether the component will be controlled via external state.
|
|
39
|
-
*/
|
|
40
|
-
externallyControlled?: true;
|
|
41
|
-
/**
|
|
42
|
-
* the total number of items available within the data. This prop is only relevant
|
|
43
|
-
* and will be required if `externallyControlled` is set to `true`.
|
|
44
|
-
*/
|
|
45
|
-
totalItems: number;
|
|
46
|
-
/**
|
|
47
|
-
* the current page that's showing. This prop is only relevant and will be required
|
|
48
|
-
* if `externallyControlled` is set to `true`.
|
|
49
|
-
*/
|
|
50
|
-
currentPage: number;
|
|
51
|
-
/**
|
|
52
|
-
* size per page. This prop is only relevant and will be required if
|
|
53
|
-
* `externallyControlled` is set to `true`.
|
|
54
|
-
*/
|
|
55
|
-
pageSize: number;
|
|
56
|
-
/**
|
|
57
|
-
* callback indicating a page change event to the parent component.
|
|
58
|
-
* This prop is only relevant and will be required if `externallyControlled` is set
|
|
59
|
-
* to `true`.
|
|
60
|
-
*/
|
|
61
|
-
onPageChange: (page: number) => void;
|
|
62
|
-
/**
|
|
63
|
-
* callback indicating a page size change event to the parent component.
|
|
64
|
-
* This prop is only relevant and will be required if `externallyControlled` is set
|
|
65
|
-
* to `true`.
|
|
66
|
-
*/
|
|
67
|
-
onPageSizeChange: (pageSize: number) => void;
|
|
68
|
-
};
|
|
69
|
-
export type InternalControlProps = BasePaginationProps & {
|
|
70
|
-
/**
|
|
71
|
-
* Whether the component will be controlled via external state.
|
|
72
|
-
*/
|
|
73
|
-
externallyControlled?: false;
|
|
74
|
-
};
|
|
75
|
-
export type Props = PropsWithChildren<ExternalControlProps | InternalControlProps> & HTMLAttributes<HTMLDivElement>;
|
|
76
|
-
/**
|
|
77
|
-
This is an HOC [React](https://reactjs.org/) component for applying pagination to direct children components. This component is un-opinionated about
|
|
78
|
-
the structure of the input data and can be used with any child component that displays a list of data. However, the styling and behaviour of this component were designed
|
|
79
|
-
to work nicely with the `MainTable` component. To use this component, simply wrap a child component with it and provide the data that you want
|
|
80
|
-
to paginate to the `data` prop. This component will then pass the paged data to all <b>direct</b> child components via a child prop specified by `dataForwardProp`.
|
|
81
|
-
The component may be externally controlled, see following sections for detailed explanation.
|
|
82
|
-
|
|
83
|
-
#### Externally controlled pagination
|
|
84
|
-
|
|
85
|
-
For externally controlled mode, you will be responsible for the pagination logic and therefore the component will be purely presentational.
|
|
86
|
-
The pagination behaviour is controlled outside of this component. Note the data injection to child components is essentially a passthrough in this case.
|
|
87
|
-
To enable externally controlled mode for this component, set the `externallyControlled` prop to `true`. From there, it is your responsibility
|
|
88
|
-
to ensure that the following props `totalItems`, `currentPage`, `pageSize`, `onPageChange` and `onPageSizeChange` are set properly.
|
|
89
|
-
You can refer to the props table below on how to set these props.
|
|
90
|
-
|
|
91
|
-
#### Un-controlled pagination
|
|
92
|
-
|
|
93
|
-
In this mode, the component assumes that the input data is not paginated. The component will implement the pagination logic and apply it to the input data
|
|
94
|
-
then inject the paged data into direct child components. This is the default mode of operations for the component where `externallyControlled` prop is set
|
|
95
|
-
to `false`.
|
|
96
|
-
*/
|
|
97
|
-
declare const TablePagination: (props: Props) => React.JSX.Element;
|
|
98
|
-
export default TablePagination;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import TablePagination from "./TablePagination";
|
|
3
|
-
declare const meta: Meta<typeof TablePagination>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof TablePagination>;
|
|
6
|
-
export declare const Default: Story;
|
|
7
|
-
export declare const CustomPageLimit: Story;
|
|
8
|
-
export declare const CustomDisplayTitle: Story;
|
|
9
|
-
export declare const RenderAbove: Story;
|
|
10
|
-
export declare const RenderBelow: Story;
|
|
11
|
-
/** The table pagination controls can be used without wrapping MainTable by
|
|
12
|
-
* using the `TablePaginationControls` component.
|
|
13
|
-
*/
|
|
14
|
-
export declare const ControlsOnly: Story;
|