@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,15 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import MainTable from "./MainTable";
|
|
3
|
-
declare const meta: Meta<typeof MainTable>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof MainTable>;
|
|
6
|
-
export declare const Default: Story;
|
|
7
|
-
export declare const Sortable: Story;
|
|
8
|
-
export declare const Expanding: Story;
|
|
9
|
-
/**
|
|
10
|
-
* If the table cell may have overflowing content (such as contextual menu) use `hasOverflow` prop to avoid cropping it.
|
|
11
|
-
*/
|
|
12
|
-
export declare const Overflow: Story;
|
|
13
|
-
export declare const Responsive: Story;
|
|
14
|
-
export declare const Paginated: Story;
|
|
15
|
-
export declare const Empty: Story;
|
|
@@ -1,553 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = exports.Sortable = exports.Responsive = exports.Paginated = exports.Overflow = exports.Expanding = exports.Empty = exports.Default = void 0;
|
|
7
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _MainTable = _interopRequireDefault(require("./MainTable"));
|
|
9
|
-
var _Row = _interopRequireDefault(require("../Row"));
|
|
10
|
-
var _Col = _interopRequireDefault(require("../Col"));
|
|
11
|
-
var _ContextualMenu = _interopRequireDefault(require("../ContextualMenu"));
|
|
12
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
-
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); }
|
|
14
|
-
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; }
|
|
15
|
-
const meta = {
|
|
16
|
-
component: _MainTable.default,
|
|
17
|
-
tags: ["autodocs"],
|
|
18
|
-
argTypes: {
|
|
19
|
-
headers: {
|
|
20
|
-
control: {
|
|
21
|
-
disable: true
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
rows: {
|
|
25
|
-
control: {
|
|
26
|
-
disable: true
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
var _default = exports.default = meta;
|
|
32
|
-
const Default = exports.Default = {
|
|
33
|
-
name: "Default",
|
|
34
|
-
args: {
|
|
35
|
-
headers: [{
|
|
36
|
-
content: null
|
|
37
|
-
}, {
|
|
38
|
-
content: "Foundation Cloud"
|
|
39
|
-
}, {
|
|
40
|
-
content: "Foundation Cloud Plus"
|
|
41
|
-
}],
|
|
42
|
-
rows: [{
|
|
43
|
-
columns: [{
|
|
44
|
-
content: "Expert delivery of an Ubuntu OpenStack cloud",
|
|
45
|
-
role: "rowheader"
|
|
46
|
-
}, {
|
|
47
|
-
content: "Reference architecture"
|
|
48
|
-
}, {
|
|
49
|
-
content: "Custom architecture"
|
|
50
|
-
}]
|
|
51
|
-
}, {
|
|
52
|
-
columns: [{
|
|
53
|
-
content: "Workshop and training",
|
|
54
|
-
role: "rowheader"
|
|
55
|
-
}, {
|
|
56
|
-
content: "2-days"
|
|
57
|
-
}, {
|
|
58
|
-
content: "4-days"
|
|
59
|
-
}]
|
|
60
|
-
}, {
|
|
61
|
-
columns: [{
|
|
62
|
-
content: "One-time price",
|
|
63
|
-
role: "rowheader"
|
|
64
|
-
}, {
|
|
65
|
-
content: "$75,000"
|
|
66
|
-
}, {
|
|
67
|
-
content: "$150,000"
|
|
68
|
-
}]
|
|
69
|
-
}]
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
const Sortable = exports.Sortable = {
|
|
73
|
-
render: () => /*#__PURE__*/_react.default.createElement(_MainTable.default, {
|
|
74
|
-
headers: [{
|
|
75
|
-
content: "Status",
|
|
76
|
-
sortKey: "status"
|
|
77
|
-
}, {
|
|
78
|
-
content: "Cores",
|
|
79
|
-
sortKey: "cores",
|
|
80
|
-
className: "u-align--right"
|
|
81
|
-
}, {
|
|
82
|
-
content: "RAM",
|
|
83
|
-
sortKey: "ram",
|
|
84
|
-
className: "u-align--right"
|
|
85
|
-
}, {
|
|
86
|
-
content: "Disks",
|
|
87
|
-
sortKey: "disks",
|
|
88
|
-
className: "u-align--right"
|
|
89
|
-
}, {
|
|
90
|
-
content: "Networks",
|
|
91
|
-
className: "u-align--right"
|
|
92
|
-
}],
|
|
93
|
-
rows: [{
|
|
94
|
-
columns: [{
|
|
95
|
-
content: "Ready",
|
|
96
|
-
role: "rowheader"
|
|
97
|
-
}, {
|
|
98
|
-
content: 1,
|
|
99
|
-
className: "u-align--right"
|
|
100
|
-
}, {
|
|
101
|
-
content: "1 GiB",
|
|
102
|
-
className: "u-align--right"
|
|
103
|
-
}, {
|
|
104
|
-
content: 2,
|
|
105
|
-
className: "u-align--right"
|
|
106
|
-
}, {
|
|
107
|
-
content: 42,
|
|
108
|
-
className: "u-align--right"
|
|
109
|
-
}],
|
|
110
|
-
sortData: {
|
|
111
|
-
status: "ready",
|
|
112
|
-
cores: 2,
|
|
113
|
-
ram: 1,
|
|
114
|
-
disks: 2
|
|
115
|
-
}
|
|
116
|
-
}, {
|
|
117
|
-
columns: [{
|
|
118
|
-
content: "Idle",
|
|
119
|
-
role: "rowheader"
|
|
120
|
-
}, {
|
|
121
|
-
content: 1,
|
|
122
|
-
className: "u-align--right"
|
|
123
|
-
}, {
|
|
124
|
-
content: "1 GiB",
|
|
125
|
-
className: "u-align--right"
|
|
126
|
-
}, {
|
|
127
|
-
content: 2,
|
|
128
|
-
className: "u-align--right"
|
|
129
|
-
}, {
|
|
130
|
-
content: 23,
|
|
131
|
-
className: "u-align--right"
|
|
132
|
-
}],
|
|
133
|
-
sortData: {
|
|
134
|
-
status: "idle",
|
|
135
|
-
cores: 1,
|
|
136
|
-
ram: 1,
|
|
137
|
-
disks: 2
|
|
138
|
-
}
|
|
139
|
-
}, {
|
|
140
|
-
columns: [{
|
|
141
|
-
content: "Waiting",
|
|
142
|
-
role: "rowheader"
|
|
143
|
-
}, {
|
|
144
|
-
content: 8,
|
|
145
|
-
className: "u-align--right"
|
|
146
|
-
}, {
|
|
147
|
-
content: "3.9 GiB",
|
|
148
|
-
className: "u-align--right"
|
|
149
|
-
}, {
|
|
150
|
-
content: 3,
|
|
151
|
-
className: "u-align--right"
|
|
152
|
-
}, {
|
|
153
|
-
content: 0,
|
|
154
|
-
className: "u-align--right"
|
|
155
|
-
}],
|
|
156
|
-
sortData: {
|
|
157
|
-
status: "waiting",
|
|
158
|
-
cores: 8,
|
|
159
|
-
ram: 3.9,
|
|
160
|
-
disks: 3
|
|
161
|
-
}
|
|
162
|
-
}],
|
|
163
|
-
sortable: true
|
|
164
|
-
}),
|
|
165
|
-
name: "Sortable"
|
|
166
|
-
};
|
|
167
|
-
const Expanding = exports.Expanding = {
|
|
168
|
-
render: () => {
|
|
169
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
170
|
-
const [expandedRow, setExpandedRow] = (0, _react.useState)(1);
|
|
171
|
-
return /*#__PURE__*/_react.default.createElement(_MainTable.default, {
|
|
172
|
-
expanding: true,
|
|
173
|
-
headers: [{
|
|
174
|
-
content: "Name"
|
|
175
|
-
}, {
|
|
176
|
-
content: "Mac address"
|
|
177
|
-
}, {
|
|
178
|
-
content: "IP"
|
|
179
|
-
}, {
|
|
180
|
-
content: "Rack"
|
|
181
|
-
}, {
|
|
182
|
-
content: "Last seen"
|
|
183
|
-
}, {
|
|
184
|
-
content: "Actions",
|
|
185
|
-
className: "u-align--right"
|
|
186
|
-
}],
|
|
187
|
-
rows: [{
|
|
188
|
-
columns: [{
|
|
189
|
-
content: "Unknown",
|
|
190
|
-
role: "rowheader"
|
|
191
|
-
}, {
|
|
192
|
-
content: "2c:44:fd:80:3f:25"
|
|
193
|
-
}, {
|
|
194
|
-
content: "10.249.0.1"
|
|
195
|
-
}, {
|
|
196
|
-
content: "karura"
|
|
197
|
-
}, {
|
|
198
|
-
content: "Thu, 25 Oct. 2018 13:55:21"
|
|
199
|
-
}, {
|
|
200
|
-
content: /*#__PURE__*/_react.default.createElement("button", {
|
|
201
|
-
className: "u-toggle",
|
|
202
|
-
onClick: () => setExpandedRow(1)
|
|
203
|
-
}, "Show"),
|
|
204
|
-
className: "u-align--right"
|
|
205
|
-
}],
|
|
206
|
-
expanded: expandedRow === 1,
|
|
207
|
-
expandedContent: /*#__PURE__*/_react.default.createElement(_Row.default, null, /*#__PURE__*/_react.default.createElement(_Col.default, {
|
|
208
|
-
size: 8
|
|
209
|
-
}, /*#__PURE__*/_react.default.createElement("h4", null, "Expanding table cell"), /*#__PURE__*/_react.default.createElement("p", null, "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Consequuntur cum dicta beatae nostrum eligendi similique earum, dolorem fuga quis, sequi voluptates architecto ipsa dolorum eaque rem expedita inventore voluptas odit aspernatur alias molestias facere.")))
|
|
210
|
-
}, {
|
|
211
|
-
columns: [{
|
|
212
|
-
content: "Unknown",
|
|
213
|
-
role: "rowheader"
|
|
214
|
-
}, {
|
|
215
|
-
content: "52:54:00:3a:fe:e9"
|
|
216
|
-
}, {
|
|
217
|
-
content: "172.16.99.191"
|
|
218
|
-
}, {
|
|
219
|
-
content: "karura"
|
|
220
|
-
}, {
|
|
221
|
-
content: "Wed, 3 Oct. 2018 23:08:06"
|
|
222
|
-
}, {
|
|
223
|
-
content: /*#__PURE__*/_react.default.createElement("button", {
|
|
224
|
-
className: "u-toggle",
|
|
225
|
-
onClick: () => setExpandedRow(2)
|
|
226
|
-
}, "Show"),
|
|
227
|
-
className: "u-align--right"
|
|
228
|
-
}],
|
|
229
|
-
expanded: expandedRow === 2,
|
|
230
|
-
expandedContent: /*#__PURE__*/_react.default.createElement(_Row.default, null, /*#__PURE__*/_react.default.createElement(_Col.default, {
|
|
231
|
-
size: 8
|
|
232
|
-
}, /*#__PURE__*/_react.default.createElement("h4", null, "Expanding table cell"), /*#__PURE__*/_react.default.createElement("p", null, "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Consequuntur cum dicta beatae nostrum eligendi similique earum, dolorem fuga quis, sequi voluptates architecto ipsa dolorum eaque rem expedita inventore voluptas odit aspernatur alias molestias facere.")))
|
|
233
|
-
}, {
|
|
234
|
-
columns: [{
|
|
235
|
-
content: "Unknown",
|
|
236
|
-
role: "rowheader"
|
|
237
|
-
}, {
|
|
238
|
-
content: "52:54:00:74:c2:10"
|
|
239
|
-
}, {
|
|
240
|
-
content: "172.16.99.192"
|
|
241
|
-
}, {
|
|
242
|
-
content: "karura"
|
|
243
|
-
}, {
|
|
244
|
-
content: "Wed, 17 Oct. 2018 12:18:18"
|
|
245
|
-
}, {
|
|
246
|
-
content: /*#__PURE__*/_react.default.createElement("button", {
|
|
247
|
-
className: "u-toggle",
|
|
248
|
-
onClick: () => setExpandedRow(3)
|
|
249
|
-
}, "Show"),
|
|
250
|
-
className: "u-align--right"
|
|
251
|
-
}],
|
|
252
|
-
expanded: expandedRow === 3,
|
|
253
|
-
expandedContent: /*#__PURE__*/_react.default.createElement(_Row.default, null, /*#__PURE__*/_react.default.createElement(_Col.default, {
|
|
254
|
-
size: 8
|
|
255
|
-
}, /*#__PURE__*/_react.default.createElement("h4", null, "Expanding table cell"), /*#__PURE__*/_react.default.createElement("p", null, "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Consequuntur cum dicta beatae nostrum eligendi similique earum, dolorem fuga quis, sequi voluptates architecto ipsa dolorum eaque rem expedita inventore voluptas odit aspernatur alias molestias facere.")))
|
|
256
|
-
}]
|
|
257
|
-
});
|
|
258
|
-
},
|
|
259
|
-
name: "Expanding"
|
|
260
|
-
};
|
|
261
|
-
|
|
262
|
-
/**
|
|
263
|
-
* If the table cell may have overflowing content (such as contextual menu) use `hasOverflow` prop to avoid cropping it.
|
|
264
|
-
*/
|
|
265
|
-
const Overflow = exports.Overflow = {
|
|
266
|
-
render: () => {
|
|
267
|
-
return /*#__PURE__*/_react.default.createElement(_MainTable.default, {
|
|
268
|
-
headers: [{
|
|
269
|
-
content: "Name"
|
|
270
|
-
}, {
|
|
271
|
-
content: "Mac address"
|
|
272
|
-
}, {
|
|
273
|
-
content: "IP"
|
|
274
|
-
}, {
|
|
275
|
-
content: "Rack"
|
|
276
|
-
}, {
|
|
277
|
-
content: "Last seen"
|
|
278
|
-
}, {
|
|
279
|
-
content: "Actions",
|
|
280
|
-
className: "u-align--right"
|
|
281
|
-
}],
|
|
282
|
-
rows: [{
|
|
283
|
-
columns: [{
|
|
284
|
-
content: "Unknown",
|
|
285
|
-
role: "rowheader"
|
|
286
|
-
}, {
|
|
287
|
-
content: "2c:44:fd:80:3f:25"
|
|
288
|
-
}, {
|
|
289
|
-
content: "10.249.0.1"
|
|
290
|
-
}, {
|
|
291
|
-
content: "karura"
|
|
292
|
-
}, {
|
|
293
|
-
content: "Thu, 25 Oct. 2018 13:55:21"
|
|
294
|
-
}, {
|
|
295
|
-
content: /*#__PURE__*/_react.default.createElement(_ContextualMenu.default, {
|
|
296
|
-
links: [{
|
|
297
|
-
children: "Link 1",
|
|
298
|
-
onClick: () => {}
|
|
299
|
-
}, {
|
|
300
|
-
children: "Link 2",
|
|
301
|
-
onClick: () => {}
|
|
302
|
-
}],
|
|
303
|
-
hasToggleIcon: true,
|
|
304
|
-
position: "right"
|
|
305
|
-
}),
|
|
306
|
-
className: "u-align--right",
|
|
307
|
-
hasOverflow: true
|
|
308
|
-
}]
|
|
309
|
-
}, {
|
|
310
|
-
columns: [{
|
|
311
|
-
content: "Unknown",
|
|
312
|
-
role: "rowheader"
|
|
313
|
-
}, {
|
|
314
|
-
content: "52:54:00:3a:fe:e9"
|
|
315
|
-
}, {
|
|
316
|
-
content: "172.16.99.191"
|
|
317
|
-
}, {
|
|
318
|
-
content: "karura"
|
|
319
|
-
}, {
|
|
320
|
-
content: "Wed, 3 Oct. 2018 23:08:06"
|
|
321
|
-
}, {
|
|
322
|
-
content: /*#__PURE__*/_react.default.createElement(_ContextualMenu.default, {
|
|
323
|
-
links: [{
|
|
324
|
-
children: "Link 1",
|
|
325
|
-
onClick: () => {}
|
|
326
|
-
}, {
|
|
327
|
-
children: "Link 2",
|
|
328
|
-
onClick: () => {}
|
|
329
|
-
}],
|
|
330
|
-
hasToggleIcon: true,
|
|
331
|
-
position: "right"
|
|
332
|
-
}),
|
|
333
|
-
className: "u-align--right",
|
|
334
|
-
hasOverflow: true
|
|
335
|
-
}]
|
|
336
|
-
}, {
|
|
337
|
-
columns: [{
|
|
338
|
-
content: "Unknown",
|
|
339
|
-
role: "rowheader"
|
|
340
|
-
}, {
|
|
341
|
-
content: "52:54:00:74:c2:10"
|
|
342
|
-
}, {
|
|
343
|
-
content: "172.16.99.192"
|
|
344
|
-
}, {
|
|
345
|
-
content: "karura"
|
|
346
|
-
}, {
|
|
347
|
-
content: "Wed, 17 Oct. 2018 12:18:18"
|
|
348
|
-
}, {
|
|
349
|
-
content: /*#__PURE__*/_react.default.createElement(_ContextualMenu.default, {
|
|
350
|
-
links: [{
|
|
351
|
-
children: "Link 1",
|
|
352
|
-
onClick: () => {}
|
|
353
|
-
}, {
|
|
354
|
-
children: "Link 2",
|
|
355
|
-
onClick: () => {}
|
|
356
|
-
}],
|
|
357
|
-
hasToggleIcon: true,
|
|
358
|
-
position: "right"
|
|
359
|
-
}),
|
|
360
|
-
className: "u-align--right",
|
|
361
|
-
hasOverflow: true
|
|
362
|
-
}]
|
|
363
|
-
}]
|
|
364
|
-
});
|
|
365
|
-
},
|
|
366
|
-
name: "Overflow"
|
|
367
|
-
};
|
|
368
|
-
const Responsive = exports.Responsive = {
|
|
369
|
-
render: () => /*#__PURE__*/_react.default.createElement(_MainTable.default, {
|
|
370
|
-
headers: [{
|
|
371
|
-
content: /*#__PURE__*/_react.default.createElement("span", null, "Name", /*#__PURE__*/_react.default.createElement("i", {
|
|
372
|
-
className: "p-icon--information"
|
|
373
|
-
})),
|
|
374
|
-
heading: "Name"
|
|
375
|
-
}, {
|
|
376
|
-
content: "Users",
|
|
377
|
-
className: "u-align--right"
|
|
378
|
-
}, {
|
|
379
|
-
content: "Units",
|
|
380
|
-
className: "u-align--right"
|
|
381
|
-
}],
|
|
382
|
-
rows: [{
|
|
383
|
-
columns: [{
|
|
384
|
-
content: "Ready",
|
|
385
|
-
role: "rowheader"
|
|
386
|
-
}, {
|
|
387
|
-
content: 1,
|
|
388
|
-
className: "u-align--right"
|
|
389
|
-
}, {
|
|
390
|
-
content: "1 GiB",
|
|
391
|
-
className: "u-align--right"
|
|
392
|
-
}]
|
|
393
|
-
}, {
|
|
394
|
-
columns: [{
|
|
395
|
-
content: "Ready",
|
|
396
|
-
role: "rowheader"
|
|
397
|
-
}, {
|
|
398
|
-
content: 1,
|
|
399
|
-
className: "u-align--right"
|
|
400
|
-
}, {
|
|
401
|
-
content: "1 GiB",
|
|
402
|
-
className: "u-align--right"
|
|
403
|
-
}]
|
|
404
|
-
}, {
|
|
405
|
-
columns: [{
|
|
406
|
-
content: "Ready",
|
|
407
|
-
role: "rowheader"
|
|
408
|
-
}, {
|
|
409
|
-
content: 1,
|
|
410
|
-
className: "u-align--right"
|
|
411
|
-
}, {
|
|
412
|
-
content: "1 GiB",
|
|
413
|
-
className: "u-align--right"
|
|
414
|
-
}]
|
|
415
|
-
}],
|
|
416
|
-
responsive: true
|
|
417
|
-
}),
|
|
418
|
-
name: "Responsive"
|
|
419
|
-
};
|
|
420
|
-
const Paginated = exports.Paginated = {
|
|
421
|
-
render: () => /*#__PURE__*/_react.default.createElement(_MainTable.default, {
|
|
422
|
-
headers: [{
|
|
423
|
-
content: "Status"
|
|
424
|
-
}, {
|
|
425
|
-
content: "Cores"
|
|
426
|
-
}],
|
|
427
|
-
paginate: 5,
|
|
428
|
-
rows: [{
|
|
429
|
-
columns: [{
|
|
430
|
-
content: "Ready"
|
|
431
|
-
}, {
|
|
432
|
-
content: 1
|
|
433
|
-
}]
|
|
434
|
-
}, {
|
|
435
|
-
columns: [{
|
|
436
|
-
content: "Idle"
|
|
437
|
-
}, {
|
|
438
|
-
content: 4
|
|
439
|
-
}]
|
|
440
|
-
}, {
|
|
441
|
-
columns: [{
|
|
442
|
-
content: "Waiting"
|
|
443
|
-
}, {
|
|
444
|
-
content: 2
|
|
445
|
-
}]
|
|
446
|
-
}, {
|
|
447
|
-
columns: [{
|
|
448
|
-
content: "Ready"
|
|
449
|
-
}, {
|
|
450
|
-
content: 1
|
|
451
|
-
}]
|
|
452
|
-
}, {
|
|
453
|
-
columns: [{
|
|
454
|
-
content: "Idle"
|
|
455
|
-
}, {
|
|
456
|
-
content: 4
|
|
457
|
-
}]
|
|
458
|
-
}, {
|
|
459
|
-
columns: [{
|
|
460
|
-
content: "Waiting"
|
|
461
|
-
}, {
|
|
462
|
-
content: 2
|
|
463
|
-
}]
|
|
464
|
-
}, {
|
|
465
|
-
columns: [{
|
|
466
|
-
content: "Ready"
|
|
467
|
-
}, {
|
|
468
|
-
content: 1
|
|
469
|
-
}]
|
|
470
|
-
}, {
|
|
471
|
-
columns: [{
|
|
472
|
-
content: "Idle"
|
|
473
|
-
}, {
|
|
474
|
-
content: 4
|
|
475
|
-
}]
|
|
476
|
-
}, {
|
|
477
|
-
columns: [{
|
|
478
|
-
content: "Waiting"
|
|
479
|
-
}, {
|
|
480
|
-
content: 2
|
|
481
|
-
}]
|
|
482
|
-
}, {
|
|
483
|
-
columns: [{
|
|
484
|
-
content: "Ready"
|
|
485
|
-
}, {
|
|
486
|
-
content: 1
|
|
487
|
-
}]
|
|
488
|
-
}, {
|
|
489
|
-
columns: [{
|
|
490
|
-
content: "Idle"
|
|
491
|
-
}, {
|
|
492
|
-
content: 4
|
|
493
|
-
}]
|
|
494
|
-
}, {
|
|
495
|
-
columns: [{
|
|
496
|
-
content: "Waiting"
|
|
497
|
-
}, {
|
|
498
|
-
content: 2
|
|
499
|
-
}]
|
|
500
|
-
}, {
|
|
501
|
-
columns: [{
|
|
502
|
-
content: "Ready"
|
|
503
|
-
}, {
|
|
504
|
-
content: 1
|
|
505
|
-
}]
|
|
506
|
-
}, {
|
|
507
|
-
columns: [{
|
|
508
|
-
content: "Idle"
|
|
509
|
-
}, {
|
|
510
|
-
content: 4
|
|
511
|
-
}]
|
|
512
|
-
}, {
|
|
513
|
-
columns: [{
|
|
514
|
-
content: "Waiting"
|
|
515
|
-
}, {
|
|
516
|
-
content: 2
|
|
517
|
-
}]
|
|
518
|
-
}, {
|
|
519
|
-
columns: [{
|
|
520
|
-
content: "Ready"
|
|
521
|
-
}, {
|
|
522
|
-
content: 1
|
|
523
|
-
}]
|
|
524
|
-
}, {
|
|
525
|
-
columns: [{
|
|
526
|
-
content: "Idle"
|
|
527
|
-
}, {
|
|
528
|
-
content: 4
|
|
529
|
-
}]
|
|
530
|
-
}, {
|
|
531
|
-
columns: [{
|
|
532
|
-
content: "Waiting"
|
|
533
|
-
}, {
|
|
534
|
-
content: 2
|
|
535
|
-
}]
|
|
536
|
-
}]
|
|
537
|
-
}),
|
|
538
|
-
name: "Paginated"
|
|
539
|
-
};
|
|
540
|
-
const Empty = exports.Empty = {
|
|
541
|
-
render: () => /*#__PURE__*/_react.default.createElement(_MainTable.default, {
|
|
542
|
-
headers: [{
|
|
543
|
-
content: "Plan"
|
|
544
|
-
}, {
|
|
545
|
-
content: "Foundation Cloud"
|
|
546
|
-
}, {
|
|
547
|
-
content: "Foundation Cloud Plus"
|
|
548
|
-
}],
|
|
549
|
-
rows: [],
|
|
550
|
-
emptyStateMsg: "No data to display"
|
|
551
|
-
}),
|
|
552
|
-
name: "Empty"
|
|
553
|
-
};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { ReactElement } from "react";
|
|
2
|
-
import type { HTMLProps, ReactNode } from "react";
|
|
3
|
-
import { ClassName, PropsWithSpread } from "../../types";
|
|
4
|
-
export type Props = PropsWithSpread<{
|
|
5
|
-
/**
|
|
6
|
-
* Buttons to display underneath the main modal content.
|
|
7
|
-
*/
|
|
8
|
-
buttonRow?: ReactNode | null;
|
|
9
|
-
/**
|
|
10
|
-
* Optional class(es) to apply to the wrapping element.
|
|
11
|
-
*/
|
|
12
|
-
className?: ClassName;
|
|
13
|
-
/**
|
|
14
|
-
* The content of the modal.
|
|
15
|
-
*/
|
|
16
|
-
children: ReactNode;
|
|
17
|
-
/**
|
|
18
|
-
* Function to handle closing the modal.
|
|
19
|
-
*/
|
|
20
|
-
close?: () => void | null;
|
|
21
|
-
/**
|
|
22
|
-
* The title of the modal.
|
|
23
|
-
*/
|
|
24
|
-
title?: ReactNode | null;
|
|
25
|
-
/**
|
|
26
|
-
* Whether the button click event should propagate.
|
|
27
|
-
*/
|
|
28
|
-
shouldPropagateClickEvent?: boolean;
|
|
29
|
-
}, HTMLProps<HTMLDivElement>>;
|
|
30
|
-
/**
|
|
31
|
-
* This is a [React](https://reactjs.org/) component for the Vanilla [Modal](https://docs.vanillaframework.io/patterns/modal/).
|
|
32
|
-
*
|
|
33
|
-
* The modal component can be used to overlay an area of the screen which can contain a prompt, dialog or interaction.
|
|
34
|
-
*/
|
|
35
|
-
export declare const Modal: ({ buttonRow, children, className, close, title, shouldPropagateClickEvent, ...wrapperProps }: Props) => ReactElement;
|
|
36
|
-
export default Modal;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = exports.Default = void 0;
|
|
7
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _Modal = _interopRequireDefault(require("./Modal"));
|
|
9
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
11
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
12
|
-
const Template = args => {
|
|
13
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
14
|
-
style: {
|
|
15
|
-
height: "100vh",
|
|
16
|
-
position: "relative"
|
|
17
|
-
}
|
|
18
|
-
}, /*#__PURE__*/_react.default.createElement(_Modal.default, args));
|
|
19
|
-
};
|
|
20
|
-
const meta = {
|
|
21
|
-
component: _Modal.default,
|
|
22
|
-
render: Template,
|
|
23
|
-
tags: ["autodocs"],
|
|
24
|
-
argTypes: {
|
|
25
|
-
buttonRow: {
|
|
26
|
-
control: {
|
|
27
|
-
disable: true
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
children: {
|
|
31
|
-
control: {
|
|
32
|
-
disable: true
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
var _default = exports.default = meta;
|
|
38
|
-
const Default = exports.Default = {
|
|
39
|
-
render: () => {
|
|
40
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
41
|
-
const [modalOpen, setModalOpen] = (0, _react.useState)(true);
|
|
42
|
-
const closeHandler = () => setModalOpen(false);
|
|
43
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("button", {
|
|
44
|
-
onClick: () => setModalOpen(true)
|
|
45
|
-
}, "Open modal"), modalOpen ? /*#__PURE__*/_react.default.createElement(_Modal.default, {
|
|
46
|
-
close: closeHandler,
|
|
47
|
-
title: "Confirm delete",
|
|
48
|
-
buttonRow: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("button", {
|
|
49
|
-
className: "u-no-margin--bottom",
|
|
50
|
-
onClick: closeHandler
|
|
51
|
-
}, "Cancel"), /*#__PURE__*/_react.default.createElement("button", {
|
|
52
|
-
className: "p-button--negative u-no-margin--bottom"
|
|
53
|
-
}, "Delete"))
|
|
54
|
-
}, /*#__PURE__*/_react.default.createElement("p", null, "This will permanently delete the user \"Simon\".", /*#__PURE__*/_react.default.createElement("br", null), "You cannot undo this action.")) : null);
|
|
55
|
-
},
|
|
56
|
-
name: "Default"
|
|
57
|
-
};
|