@canonical/react-components 0.58.0 → 0.59.1
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/dist/components/Accordion/Accordion.d.ts +5 -0
- package/dist/components/Accordion/Accordion.js +6 -0
- package/dist/components/Accordion/Accordion.stories.d.ts +18 -0
- package/dist/components/Accordion/Accordion.stories.js +117 -0
- package/dist/components/ActionButton/ActionButton.d.ts +7 -0
- package/dist/components/ActionButton/ActionButton.js +7 -0
- package/dist/components/ActionButton/ActionButton.stories.d.ts +7 -0
- package/dist/components/ActionButton/ActionButton.stories.js +36 -0
- package/dist/components/ApplicationLayout/AppAside/AppAside.d.ts +33 -0
- package/dist/components/ApplicationLayout/AppAside/AppAside.js +33 -0
- package/dist/components/ApplicationLayout/AppAside/AppAside.stories.d.ts +13 -0
- package/dist/components/ApplicationLayout/AppAside/AppAside.stories.js +116 -0
- package/dist/components/ApplicationLayout/AppAside/index.d.ts +2 -0
- package/dist/components/ApplicationLayout/AppAside/index.js +13 -0
- package/dist/components/ApplicationLayout/AppMain/AppMain.d.ts +14 -0
- package/dist/components/ApplicationLayout/AppMain/AppMain.js +25 -0
- package/dist/components/ApplicationLayout/AppMain/AppMain.stories.d.ts +14 -0
- package/dist/components/ApplicationLayout/AppMain/AppMain.stories.js +45 -0
- package/dist/components/ApplicationLayout/AppMain/index.d.ts +2 -0
- package/dist/components/ApplicationLayout/AppMain/index.js +13 -0
- package/dist/components/ApplicationLayout/AppNavigation/AppNavigation.d.ts +26 -0
- package/dist/components/ApplicationLayout/AppNavigation/AppNavigation.js +35 -0
- package/dist/components/ApplicationLayout/AppNavigation/AppNavigation.stories.d.ts +12 -0
- package/dist/components/ApplicationLayout/AppNavigation/AppNavigation.stories.js +104 -0
- package/dist/components/ApplicationLayout/AppNavigation/index.d.ts +2 -0
- package/dist/components/ApplicationLayout/AppNavigation/index.js +13 -0
- package/dist/components/ApplicationLayout/AppNavigationBar/AppNavigationBar.d.ts +18 -0
- package/dist/components/ApplicationLayout/AppNavigationBar/AppNavigationBar.js +28 -0
- package/dist/components/ApplicationLayout/AppNavigationBar/AppNavigationBar.stories.d.ts +15 -0
- package/dist/components/ApplicationLayout/AppNavigationBar/AppNavigationBar.stories.js +52 -0
- package/dist/components/ApplicationLayout/AppNavigationBar/index.d.ts +2 -0
- package/dist/components/ApplicationLayout/AppNavigationBar/index.js +13 -0
- package/dist/components/ApplicationLayout/AppStatus/AppStatus.d.ts +14 -0
- package/dist/components/ApplicationLayout/AppStatus/AppStatus.js +25 -0
- package/dist/components/ApplicationLayout/AppStatus/AppStatus.stories.d.ts +13 -0
- package/dist/components/ApplicationLayout/AppStatus/AppStatus.stories.js +41 -0
- package/dist/components/ApplicationLayout/AppStatus/index.d.ts +2 -0
- package/dist/components/ApplicationLayout/AppStatus/index.js +13 -0
- package/dist/components/ApplicationLayout/Application/Application.d.ts +15 -0
- package/dist/components/ApplicationLayout/Application/Application.js +26 -0
- package/dist/components/ApplicationLayout/Application/Application.stories.d.ts +6 -0
- package/dist/components/ApplicationLayout/Application/Application.stories.js +16 -0
- package/dist/components/ApplicationLayout/Application/index.d.ts +2 -0
- package/dist/components/ApplicationLayout/Application/index.js +13 -0
- package/dist/components/ApplicationLayout/ApplicationLayout.d.ts +89 -0
- package/dist/components/ApplicationLayout/ApplicationLayout.js +118 -0
- package/dist/components/ApplicationLayout/ApplicationLayout.stories.d.ts +24 -0
- package/dist/components/ApplicationLayout/ApplicationLayout.stories.js +232 -0
- package/dist/components/ApplicationLayout/index.d.ts +7 -0
- package/dist/components/ApplicationLayout/index.js +55 -0
- package/dist/components/ArticlePagination/ArticlePagination.d.ts +5 -0
- package/dist/components/ArticlePagination/ArticlePagination.js +5 -0
- package/dist/components/ArticlePagination/ArticlePagination.stories.d.ts +6 -0
- package/dist/components/ArticlePagination/ArticlePagination.stories.js +22 -0
- package/dist/components/Badge/Badge.d.ts +5 -0
- package/dist/components/Badge/Badge.js +6 -0
- package/dist/components/Badge/Badge.stories.d.ts +15 -0
- package/dist/components/Badge/Badge.stories.js +62 -0
- package/dist/components/Button/Button.d.ts +3 -1
- package/dist/components/Button/Button.js +3 -1
- package/dist/components/Button/Button.stories.d.ts +32 -0
- package/dist/components/Button/Button.stories.js +180 -0
- package/dist/components/Card/Card.stories.js +0 -1
- package/dist/components/CheckboxInput/CheckboxInput.d.ts +5 -0
- package/dist/components/CheckboxInput/CheckboxInput.js +5 -0
- package/dist/components/CheckboxInput/CheckboxInput.stories.d.ts +11 -0
- package/dist/components/CheckboxInput/CheckboxInput.stories.js +84 -0
- package/dist/components/Chip/Chip.d.ts +5 -0
- package/dist/components/Chip/Chip.js +5 -0
- package/dist/components/Chip/Chip.stories.d.ts +9 -0
- package/dist/components/Chip/Chip.stories.js +45 -0
- package/dist/components/CodeSnippet/CodeSnippet.d.ts +7 -0
- package/dist/components/CodeSnippet/CodeSnippet.js +7 -0
- package/dist/components/CodeSnippet/CodeSnippet.stories.d.ts +45 -0
- package/dist/components/CodeSnippet/CodeSnippet.stories.js +279 -0
- package/dist/components/Col/Col.d.ts +5 -0
- package/dist/components/Col/Col.js +5 -0
- package/dist/components/Col/Col.stories.d.ts +11 -0
- package/dist/components/Col/Col.stories.js +154 -0
- package/dist/components/ConfirmationButton/ConfirmationButton.d.ts +3 -0
- package/dist/components/ConfirmationButton/ConfirmationButton.js +3 -0
- package/dist/components/ConfirmationButton/ConfirmationButton.stories.d.ts +9 -0
- package/dist/components/ConfirmationButton/ConfirmationButton.stories.js +108 -0
- package/dist/components/ConfirmationModal/ConfirmationModal.d.ts +3 -0
- package/dist/components/ConfirmationModal/ConfirmationModal.js +3 -0
- package/dist/components/ConfirmationModal/ConfirmationModal.stories.d.ts +18 -0
- package/dist/components/ConfirmationModal/ConfirmationModal.stories.js +135 -0
- package/dist/components/ContextualMenu/ContextualMenu.d.ts +3 -20
- package/dist/components/ContextualMenu/ContextualMenu.js +3 -20
- package/dist/components/ContextualMenu/ContextualMenu.stories.d.ts +13 -0
- package/dist/components/ContextualMenu/ContextualMenu.stories.js +107 -0
- package/dist/components/EmptyState/EmptyState.d.ts +3 -0
- package/dist/components/EmptyState/EmptyState.js +3 -0
- package/dist/components/EmptyState/EmptyState.stories.d.ts +7 -0
- package/dist/components/EmptyState/EmptyState.stories.js +49 -0
- package/dist/components/Form/Form.d.ts +5 -0
- package/dist/components/Form/Form.js +5 -0
- package/dist/components/Form/Form.stories.d.ts +12 -0
- package/dist/components/Form/Form.stories.js +179 -0
- package/dist/components/FormikField/FormikField.stories.js +0 -1
- package/dist/components/Icon/Icon.d.ts +3 -1
- package/dist/components/Icon/Icon.js +3 -1
- package/dist/components/Icon/Icon.stories.d.ts +16 -0
- package/dist/components/Icon/Icon.stories.js +49 -0
- package/dist/components/Input/Input.d.ts +5 -0
- package/dist/components/Input/Input.js +5 -0
- package/dist/components/Input/Input.stories.d.ts +14 -0
- package/dist/components/Input/Input.stories.js +148 -0
- package/dist/components/Link/Link.d.ts +5 -0
- package/dist/components/Link/Link.js +5 -0
- package/dist/components/Link/Link.stories.d.ts +9 -0
- package/dist/components/Link/Link.stories.js +48 -0
- package/dist/components/List/List.d.ts +5 -0
- package/dist/components/List/List.js +6 -0
- package/dist/components/List/List.stories.d.ts +15 -0
- package/dist/components/List/List.stories.js +122 -0
- package/dist/components/LoginPageLayout/LoginPageLayout.d.ts +4 -0
- package/dist/components/LoginPageLayout/LoginPageLayout.js +4 -0
- package/dist/components/LoginPageLayout/LoginPageLayout.stories.d.ts +9 -0
- package/dist/components/LoginPageLayout/LoginPageLayout.stories.js +58 -0
- package/dist/components/MainTable/MainTable.d.ts +3 -0
- package/dist/components/MainTable/MainTable.js +4 -0
- package/dist/components/MainTable/MainTable.stories.d.ts +15 -0
- package/dist/components/MainTable/MainTable.stories.js +553 -0
- package/dist/components/Modal/Modal.d.ts +5 -0
- package/dist/components/Modal/Modal.js +5 -0
- package/dist/components/Modal/Modal.stories.d.ts +6 -0
- package/dist/components/Modal/Modal.stories.js +57 -0
- package/dist/components/ModularTable/ModularTable.d.ts +52 -0
- package/dist/components/ModularTable/ModularTable.js +53 -0
- package/dist/components/ModularTable/ModularTable.stories.d.ts +27 -0
- package/dist/components/ModularTable/ModularTable.stories.js +343 -0
- package/dist/components/MultiSelect/MultiSelect.stories.d.ts +5 -64
- package/dist/components/MultiSelect/MultiSelect.stories.js +0 -1
- package/dist/components/Navigation/Navigation.d.ts +8 -0
- package/dist/components/Navigation/Navigation.js +9 -0
- package/dist/components/Navigation/Navigation.stories.d.ts +43 -0
- package/dist/components/Navigation/Navigation.stories.js +232 -0
- package/dist/components/Notification/Notification.d.ts +25 -0
- package/dist/components/Notification/Notification.js +25 -0
- package/dist/components/Notification/Notification.stories.d.ts +45 -0
- package/dist/components/Notification/Notification.stories.js +201 -0
- package/dist/components/Pagination/Pagination.d.ts +12 -0
- package/dist/components/Pagination/Pagination.js +12 -0
- package/dist/components/Pagination/Pagination.stories.d.ts +14 -0
- package/dist/components/Pagination/Pagination.stories.js +94 -0
- package/dist/components/PasswordToggle/PasswordToggle.d.ts +5 -0
- package/dist/components/PasswordToggle/PasswordToggle.js +5 -0
- package/dist/components/PasswordToggle/PasswordToggle.stories.d.ts +12 -0
- package/dist/components/PasswordToggle/PasswordToggle.stories.js +74 -0
- package/dist/components/RadioInput/RadioInput.d.ts +5 -0
- package/dist/components/RadioInput/RadioInput.js +5 -0
- package/dist/components/RadioInput/RadioInput.stories.d.ts +10 -0
- package/dist/components/RadioInput/RadioInput.stories.js +83 -0
- package/dist/components/Row/Row.d.ts +5 -0
- package/dist/components/Row/Row.js +5 -0
- package/dist/components/Row/Row.stories.d.ts +9 -0
- package/dist/components/Row/Row.stories.js +29 -0
- package/dist/components/SearchAndFilter/SearchAndFilter.d.ts +3 -0
- package/dist/components/SearchAndFilter/SearchAndFilter.js +3 -0
- package/dist/components/SearchAndFilter/SearchAndFilter.stories.d.ts +8 -0
- package/dist/components/SearchAndFilter/SearchAndFilter.stories.js +218 -0
- package/dist/components/SearchBox/SearchBox.d.ts +5 -0
- package/dist/components/SearchBox/SearchBox.js +5 -0
- package/dist/components/SearchBox/SearchBox.stories.d.ts +14 -0
- package/dist/components/SearchBox/SearchBox.stories.js +106 -0
- package/dist/components/Select/Select.d.ts +5 -0
- package/dist/components/Select/Select.js +6 -0
- package/dist/components/Select/Select.stories.d.ts +7 -0
- package/dist/components/Select/Select.stories.js +97 -0
- package/dist/components/Slider/Slider.d.ts +6 -0
- package/dist/components/Slider/Slider.js +6 -0
- package/dist/components/Slider/Slider.stories.d.ts +10 -0
- package/dist/components/Slider/Slider.stories.js +74 -0
- package/dist/components/Spinner/Spinner.d.ts +3 -0
- package/dist/components/Spinner/Spinner.js +3 -0
- package/dist/components/Spinner/Spinner.stories.d.ts +8 -0
- package/dist/components/Spinner/Spinner.stories.js +28 -0
- package/dist/components/StatusLabel/StatusLabel.d.ts +3 -1
- package/dist/components/StatusLabel/StatusLabel.js +3 -1
- package/dist/components/StatusLabel/StatusLabel.stories.d.ts +10 -0
- package/dist/components/StatusLabel/StatusLabel.stories.js +61 -0
- package/dist/components/Strip/Strip.d.ts +5 -0
- package/dist/components/Strip/Strip.js +5 -0
- package/dist/components/Strip/Strip.stories.d.ts +12 -0
- package/dist/components/Strip/Strip.stories.js +130 -0
- package/dist/components/SummaryButton/SummaryButton.d.ts +3 -0
- package/dist/components/SummaryButton/SummaryButton.js +3 -0
- package/dist/components/SummaryButton/SummaryButton.stories.d.ts +18 -0
- package/dist/components/SummaryButton/SummaryButton.stories.js +59 -0
- package/dist/components/Switch/Switch.d.ts +3 -0
- package/dist/components/Switch/Switch.js +3 -0
- package/dist/components/Switch/Switch.stories.d.ts +7 -0
- package/dist/components/Switch/Switch.stories.js +26 -0
- package/dist/components/TablePagination/TablePagination.d.ts +21 -0
- package/dist/components/TablePagination/TablePagination.js +21 -0
- package/dist/components/TablePagination/TablePagination.stories.d.ts +10 -0
- package/dist/components/TablePagination/TablePagination.stories.js +302 -0
- package/dist/components/Tabs/Tabs.d.ts +5 -0
- package/dist/components/Tabs/Tabs.js +5 -0
- package/dist/components/Tabs/Tabs.stories.d.ts +11 -0
- package/dist/components/Tabs/Tabs.stories.js +56 -0
- package/dist/components/Textarea/Textarea.d.ts +5 -0
- package/dist/components/Textarea/Textarea.js +5 -0
- package/dist/components/Textarea/Textarea.stories.d.ts +7 -0
- package/dist/components/Textarea/Textarea.stories.js +62 -0
- package/dist/components/Tooltip/Tooltip.d.ts +7 -11
- package/dist/components/Tooltip/Tooltip.js +7 -11
- package/dist/components/Tooltip/Tooltip.stories.d.ts +12 -0
- package/dist/components/Tooltip/Tooltip.stories.js +71 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +56 -0
- package/package.json +18 -15
|
@@ -37,5 +37,10 @@ export type Props = PropsWithSpread<{
|
|
|
37
37
|
*/
|
|
38
38
|
titleElement?: AccordionHeadings;
|
|
39
39
|
}, HTMLProps<HTMLElement>>;
|
|
40
|
+
/**
|
|
41
|
+
* This is a [React](https://reactjs.org/) component for the Vanilla [Accordion](https://docs.vanillaframework.io/patterns/accordion/).
|
|
42
|
+
*
|
|
43
|
+
* The sidebar accordion, used in listing pages or as navigation, can hold multiple navigation items or to be used as a filter for content.
|
|
44
|
+
*/
|
|
40
45
|
declare const Accordion: ({ className, expanded, externallyControlled, onExpandedChange, sections, titleElement, ...asideProps }: Props) => JSX.Element;
|
|
41
46
|
export default Accordion;
|
|
@@ -24,6 +24,12 @@ const generateSections = (sections, setExpanded, expanded, titleElement) => sect
|
|
|
24
24
|
titleElement: titleElement
|
|
25
25
|
}, props));
|
|
26
26
|
});
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* This is a [React](https://reactjs.org/) component for the Vanilla [Accordion](https://docs.vanillaframework.io/patterns/accordion/).
|
|
30
|
+
*
|
|
31
|
+
* The sidebar accordion, used in listing pages or as navigation, can hold multiple navigation items or to be used as a filter for content.
|
|
32
|
+
*/
|
|
27
33
|
const Accordion = _ref2 => {
|
|
28
34
|
let {
|
|
29
35
|
className,
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import Accordion from "./Accordion";
|
|
3
|
+
declare const meta: Meta<typeof Accordion>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Accordion>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
/**
|
|
8
|
+
* The expanded accordion section can be controlled by external state.
|
|
9
|
+
*/
|
|
10
|
+
export declare const ExternalState: Story;
|
|
11
|
+
/**
|
|
12
|
+
* `titleElement` prop can be used to define heading element for section titles.
|
|
13
|
+
*/
|
|
14
|
+
export declare const Headings: Story;
|
|
15
|
+
/**
|
|
16
|
+
* The `title` prop can be a `ReactNode`, allowing a higher degree of customisation of the section titles.
|
|
17
|
+
*/
|
|
18
|
+
export declare const CustomHeadings: Story;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.Headings = exports.ExternalState = exports.Default = exports.CustomHeadings = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _Accordion = _interopRequireDefault(require("./Accordion"));
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
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 && Object.prototype.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 meta = {
|
|
13
|
+
component: _Accordion.default,
|
|
14
|
+
tags: ["autodocs"],
|
|
15
|
+
argTypes: {
|
|
16
|
+
sections: {
|
|
17
|
+
control: {
|
|
18
|
+
disable: true
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
externallyControlled: {
|
|
22
|
+
control: {
|
|
23
|
+
disable: true
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
var _default = exports.default = meta;
|
|
29
|
+
const Default = exports.Default = {
|
|
30
|
+
name: "Default",
|
|
31
|
+
args: {
|
|
32
|
+
sections: [{
|
|
33
|
+
title: "Advanced topics",
|
|
34
|
+
content: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("p", null, "Charm bundles"), /*#__PURE__*/_react.default.createElement("p", null, "Machine authentication"), /*#__PURE__*/_react.default.createElement("p", null, "Migrating models"), /*#__PURE__*/_react.default.createElement("p", null, "Using storage"), /*#__PURE__*/_react.default.createElement("p", null, "Working with actions"), /*#__PURE__*/_react.default.createElement("p", null, "Working with resources"), /*#__PURE__*/_react.default.createElement("p", null, "Cloud image metadata"), /*#__PURE__*/_react.default.createElement("p", null, "Tools"))
|
|
35
|
+
}, {
|
|
36
|
+
title: "Networking",
|
|
37
|
+
content: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("p", null, "Working offline"), /*#__PURE__*/_react.default.createElement("p", null, "Fan container networking"), /*#__PURE__*/_react.default.createElement("p", null, "Network spaces"))
|
|
38
|
+
}, {
|
|
39
|
+
title: "Miscellaneous",
|
|
40
|
+
content: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("p", null, "Juju GUI"), /*#__PURE__*/_react.default.createElement("p", null, "CentOS support"), /*#__PURE__*/_react.default.createElement("p", null, "Collecting Juju metrics"))
|
|
41
|
+
}]
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* The expanded accordion section can be controlled by external state.
|
|
47
|
+
*/
|
|
48
|
+
const ExternalState = exports.ExternalState = {
|
|
49
|
+
render: () => {
|
|
50
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
51
|
+
const [expandedSection, setExpandedSection] = (0, _react.useState)();
|
|
52
|
+
return /*#__PURE__*/_react.default.createElement(_Accordion.default, {
|
|
53
|
+
expanded: expandedSection,
|
|
54
|
+
externallyControlled: true,
|
|
55
|
+
onExpandedChange: setExpandedSection,
|
|
56
|
+
sections: [{
|
|
57
|
+
title: "Advanced topics",
|
|
58
|
+
key: "advanced-topics",
|
|
59
|
+
content: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("p", null, "Charm bundles"), /*#__PURE__*/_react.default.createElement("p", null, "Machine authentication"), /*#__PURE__*/_react.default.createElement("p", null, "Migrating models"), /*#__PURE__*/_react.default.createElement("p", null, "Using storage"), /*#__PURE__*/_react.default.createElement("p", null, "Working with actions"), /*#__PURE__*/_react.default.createElement("p", null, "Working with resources"), /*#__PURE__*/_react.default.createElement("p", null, "Cloud image metadata"), /*#__PURE__*/_react.default.createElement("p", null, "Tools"))
|
|
60
|
+
}, {
|
|
61
|
+
title: "Networking",
|
|
62
|
+
key: "networking",
|
|
63
|
+
content: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("p", null, "Working offline"), /*#__PURE__*/_react.default.createElement("p", null, "Fan container networking"), /*#__PURE__*/_react.default.createElement("p", null, "Network spaces"))
|
|
64
|
+
}, {
|
|
65
|
+
title: "Miscellaneous",
|
|
66
|
+
key: "miscellaneous",
|
|
67
|
+
content: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("p", null, "Juju GUI"), /*#__PURE__*/_react.default.createElement("p", null, "CentOS support"), /*#__PURE__*/_react.default.createElement("p", null, "Collecting Juju metrics"))
|
|
68
|
+
}]
|
|
69
|
+
});
|
|
70
|
+
},
|
|
71
|
+
name: "External state"
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* `titleElement` prop can be used to define heading element for section titles.
|
|
76
|
+
*/
|
|
77
|
+
const Headings = exports.Headings = {
|
|
78
|
+
name: "Headings",
|
|
79
|
+
args: {
|
|
80
|
+
sections: [{
|
|
81
|
+
title: "Advanced topics",
|
|
82
|
+
content: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("p", null, "Charm bundles"), /*#__PURE__*/_react.default.createElement("p", null, "Machine authentication"), /*#__PURE__*/_react.default.createElement("p", null, "Migrating models"), /*#__PURE__*/_react.default.createElement("p", null, "Using storage"), /*#__PURE__*/_react.default.createElement("p", null, "Working with actions"), /*#__PURE__*/_react.default.createElement("p", null, "Working with resources"), /*#__PURE__*/_react.default.createElement("p", null, "Cloud image metadata"), /*#__PURE__*/_react.default.createElement("p", null, "Tools"))
|
|
83
|
+
}, {
|
|
84
|
+
title: "Networking",
|
|
85
|
+
content: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("p", null, "Working offline"), /*#__PURE__*/_react.default.createElement("p", null, "Fan container networking"), /*#__PURE__*/_react.default.createElement("p", null, "Network spaces"))
|
|
86
|
+
}, {
|
|
87
|
+
title: "Miscellaneous",
|
|
88
|
+
content: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("p", null, "Juju GUI"), /*#__PURE__*/_react.default.createElement("p", null, "CentOS support"), /*#__PURE__*/_react.default.createElement("p", null, "Collecting Juju metrics"))
|
|
89
|
+
}],
|
|
90
|
+
titleElement: "h3"
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* The `title` prop can be a `ReactNode`, allowing a higher degree of customisation of the section titles.
|
|
96
|
+
*/
|
|
97
|
+
const CustomHeadings = exports.CustomHeadings = {
|
|
98
|
+
args: {
|
|
99
|
+
sections: [{
|
|
100
|
+
title: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "Advanced topics", " ", /*#__PURE__*/_react.default.createElement("span", {
|
|
101
|
+
className: "u-text--muted p-text--small"
|
|
102
|
+
}, "optional")),
|
|
103
|
+
content: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("p", null, "Charm bundles"), /*#__PURE__*/_react.default.createElement("p", null, "Machine authentication"), /*#__PURE__*/_react.default.createElement("p", null, "Migrating models"), /*#__PURE__*/_react.default.createElement("p", null, "Using storage"), /*#__PURE__*/_react.default.createElement("p", null, "Working with actions"), /*#__PURE__*/_react.default.createElement("p", null, "Working with resources"), /*#__PURE__*/_react.default.createElement("p", null, "Cloud image metadata"), /*#__PURE__*/_react.default.createElement("p", null, "Tools"))
|
|
104
|
+
}, {
|
|
105
|
+
title: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "Networking", " ", /*#__PURE__*/_react.default.createElement("span", {
|
|
106
|
+
className: "u-text--muted p-text--small"
|
|
107
|
+
}, "optional")),
|
|
108
|
+
content: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("p", null, "Working offline"), /*#__PURE__*/_react.default.createElement("p", null, "Fan container networking"), /*#__PURE__*/_react.default.createElement("p", null, "Network spaces"))
|
|
109
|
+
}, {
|
|
110
|
+
title: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "Miscellaneous", " ", /*#__PURE__*/_react.default.createElement("span", {
|
|
111
|
+
className: "u-text--muted p-text--small"
|
|
112
|
+
}, "optional")),
|
|
113
|
+
content: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("p", null, "Juju GUI"), /*#__PURE__*/_react.default.createElement("p", null, "CentOS support"), /*#__PURE__*/_react.default.createElement("p", null, "Collecting Juju metrics"))
|
|
114
|
+
}],
|
|
115
|
+
titleElement: "h3"
|
|
116
|
+
}
|
|
117
|
+
};
|
|
@@ -37,5 +37,12 @@ export type Props = PropsWithSpread<{
|
|
|
37
37
|
*/
|
|
38
38
|
success?: boolean;
|
|
39
39
|
}, ButtonHTMLAttributes<HTMLButtonElement>>;
|
|
40
|
+
/**
|
|
41
|
+
* This is a not an existing Vanilla component. It can be used to display submitting states for forms or other actions.
|
|
42
|
+
*
|
|
43
|
+
* ActionButton accepts the props from
|
|
44
|
+
* [Button](?path=/docs/components-button--docs) in addition to those in the
|
|
45
|
+
* props table:
|
|
46
|
+
*/
|
|
40
47
|
declare const ActionButton: ({ appearance, children, className, disabled, inline, loading, success, ...buttonProps }: Props) => JSX.Element;
|
|
41
48
|
export default ActionButton;
|
|
@@ -18,6 +18,13 @@ let Label = exports.Label = /*#__PURE__*/function (Label) {
|
|
|
18
18
|
Label["SUCCESS"] = "Action completed";
|
|
19
19
|
return Label;
|
|
20
20
|
}({});
|
|
21
|
+
/**
|
|
22
|
+
* This is a not an existing Vanilla component. It can be used to display submitting states for forms or other actions.
|
|
23
|
+
*
|
|
24
|
+
* ActionButton accepts the props from
|
|
25
|
+
* [Button](?path=/docs/components-button--docs) in addition to those in the
|
|
26
|
+
* props table:
|
|
27
|
+
*/
|
|
21
28
|
const ActionButton = _ref => {
|
|
22
29
|
let {
|
|
23
30
|
appearance,
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import ActionButton from "./ActionButton";
|
|
3
|
+
declare const meta: Meta<typeof ActionButton>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof ActionButton>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const Loading: Story;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.Loading = exports.Default = void 0;
|
|
7
|
+
var _ActionButton = _interopRequireDefault(require("./ActionButton"));
|
|
8
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
+
const meta = {
|
|
10
|
+
component: _ActionButton.default,
|
|
11
|
+
tags: ["autodocs"],
|
|
12
|
+
argTypes: {
|
|
13
|
+
children: {
|
|
14
|
+
control: {
|
|
15
|
+
type: "text"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
var _default = exports.default = meta;
|
|
21
|
+
const Default = exports.Default = {
|
|
22
|
+
name: "Default",
|
|
23
|
+
args: {
|
|
24
|
+
appearance: "positive",
|
|
25
|
+
children: "Click me!"
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
const Loading = exports.Loading = {
|
|
29
|
+
name: "Loading",
|
|
30
|
+
args: {
|
|
31
|
+
appearance: "positive",
|
|
32
|
+
loading: true,
|
|
33
|
+
disabled: true,
|
|
34
|
+
children: "Click me!"
|
|
35
|
+
}
|
|
36
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { PropsWithSpread } from "../../../types";
|
|
3
|
+
import { type HTMLProps, type PropsWithChildren } from "react";
|
|
4
|
+
export type Props = PropsWithSpread<{
|
|
5
|
+
/**
|
|
6
|
+
* Whether the aside panel should be collapsed. Toggling this state will animate
|
|
7
|
+
* the panel open or closed.
|
|
8
|
+
*/
|
|
9
|
+
collapsed?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* The panel content.
|
|
12
|
+
*/
|
|
13
|
+
children?: PropsWithChildren["children"];
|
|
14
|
+
/**
|
|
15
|
+
* A ref that will be passed to the wrapping `<aside>` element.
|
|
16
|
+
*/
|
|
17
|
+
forwardRef?: React.Ref<HTMLElement> | null;
|
|
18
|
+
/**
|
|
19
|
+
* Whether the aside panel should be narrow.
|
|
20
|
+
*/
|
|
21
|
+
narrow?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Whether the aside panel should be pinned. When pinned the panel will appear
|
|
24
|
+
* beside the main content, instead of above it.
|
|
25
|
+
*/
|
|
26
|
+
pinned?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Whether the aside panel should be wide.
|
|
29
|
+
*/
|
|
30
|
+
wide?: boolean;
|
|
31
|
+
}, HTMLProps<HTMLElement>>;
|
|
32
|
+
declare const AppAside: ({ children, className, collapsed, narrow, forwardRef, pinned, wide, ...props }: Props) => React.JSX.Element;
|
|
33
|
+
export default AppAside;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
11
|
+
const AppAside = _ref => {
|
|
12
|
+
let {
|
|
13
|
+
children,
|
|
14
|
+
className,
|
|
15
|
+
collapsed,
|
|
16
|
+
narrow,
|
|
17
|
+
forwardRef,
|
|
18
|
+
pinned,
|
|
19
|
+
wide,
|
|
20
|
+
...props
|
|
21
|
+
} = _ref;
|
|
22
|
+
return /*#__PURE__*/_react.default.createElement("aside", _extends({
|
|
23
|
+
className: (0, _classnames.default)("l-aside", className, {
|
|
24
|
+
"is-collapsed": collapsed,
|
|
25
|
+
"is-narrow": narrow,
|
|
26
|
+
"is-pinned": pinned,
|
|
27
|
+
"is-wide": wide
|
|
28
|
+
})
|
|
29
|
+
}, props, {
|
|
30
|
+
ref: forwardRef
|
|
31
|
+
}), children);
|
|
32
|
+
};
|
|
33
|
+
var _default = exports.default = AppAside;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import AppAside from "./AppAside";
|
|
3
|
+
declare const meta: Meta<typeof AppAside>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof AppAside>;
|
|
6
|
+
/**
|
|
7
|
+
* In most common cases an `AppAside` should contain a `<Panel>` to display the
|
|
8
|
+
* content as intended in the application layout.
|
|
9
|
+
*
|
|
10
|
+
* `AppAside` should be a direct child of an `<Application>` or passed to the
|
|
11
|
+
* application layout `<ApplicationLayout aside={<AppAside .../>}>`.
|
|
12
|
+
*/
|
|
13
|
+
export declare const Default: Story;
|
|
@@ -0,0 +1,116 @@
|
|
|
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 _Application = _interopRequireDefault(require("../Application"));
|
|
9
|
+
var _AppMain = _interopRequireDefault(require("../AppMain"));
|
|
10
|
+
var _Button = _interopRequireDefault(require("../../Button"));
|
|
11
|
+
var _Col = _interopRequireDefault(require("../../Col"));
|
|
12
|
+
var _Form = _interopRequireDefault(require("../../Form"));
|
|
13
|
+
var _Icon = _interopRequireDefault(require("../../Icon"));
|
|
14
|
+
var _Input = _interopRequireDefault(require("../../Input"));
|
|
15
|
+
var _Panel = _interopRequireDefault(require("../../Panel"));
|
|
16
|
+
var _Row = _interopRequireDefault(require("../../Row"));
|
|
17
|
+
var _AppAside = _interopRequireDefault(require("./AppAside"));
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
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); }
|
|
20
|
+
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 && Object.prototype.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; }
|
|
21
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } /* eslint-disable react-hooks/rules-of-hooks */
|
|
22
|
+
const meta = {
|
|
23
|
+
component: _AppAside.default,
|
|
24
|
+
tags: ["autodocs"],
|
|
25
|
+
argTypes: {
|
|
26
|
+
children: {
|
|
27
|
+
control: false
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
var _default = exports.default = meta;
|
|
32
|
+
/**
|
|
33
|
+
* In most common cases an `AppAside` should contain a `<Panel>` to display the
|
|
34
|
+
* content as intended in the application layout.
|
|
35
|
+
*
|
|
36
|
+
* `AppAside` should be a direct child of an `<Application>` or passed to the
|
|
37
|
+
* application layout `<ApplicationLayout aside={<AppAside .../>}>`.
|
|
38
|
+
*/
|
|
39
|
+
const Default = exports.Default = {
|
|
40
|
+
render: args => {
|
|
41
|
+
const [pinned, setPinned] = (0, _react.useState)(false);
|
|
42
|
+
const [width, setWidth] = (0, _react.useState)(null);
|
|
43
|
+
const [collapsed, setCollapsed] = (0, _react.useState)(false);
|
|
44
|
+
return /*#__PURE__*/_react.default.createElement(_Application.default, null, /*#__PURE__*/_react.default.createElement(_AppMain.default, null, /*#__PURE__*/_react.default.createElement("p", null, "Scroll to the right to see the panel."), /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
45
|
+
onClick: () => setCollapsed(false)
|
|
46
|
+
}, "Open"), /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
47
|
+
onClick: () => setWidth("narrow")
|
|
48
|
+
}, "Narrow"), /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
49
|
+
onClick: () => setWidth(null)
|
|
50
|
+
}, "Default"), /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
51
|
+
onClick: () => setWidth("wide")
|
|
52
|
+
}, "Wide")), /*#__PURE__*/_react.default.createElement(_AppAside.default, _extends({}, args, {
|
|
53
|
+
pinned: pinned,
|
|
54
|
+
wide: width === "wide",
|
|
55
|
+
narrow: width === "narrow",
|
|
56
|
+
collapsed: collapsed
|
|
57
|
+
}), /*#__PURE__*/_react.default.createElement(_Panel.default, {
|
|
58
|
+
controls: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
59
|
+
onClick: () => setPinned(!pinned),
|
|
60
|
+
dense: true,
|
|
61
|
+
className: "u-no-margin--bottom"
|
|
62
|
+
}, "Pin"), /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
63
|
+
appearance: "base",
|
|
64
|
+
className: "u-no-margin--bottom",
|
|
65
|
+
hasIcon: true,
|
|
66
|
+
onClick: () => setCollapsed(!collapsed)
|
|
67
|
+
}, /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
68
|
+
name: "close"
|
|
69
|
+
}, "Close"))),
|
|
70
|
+
title: "App aside"
|
|
71
|
+
}, /*#__PURE__*/_react.default.createElement(_Form.default, {
|
|
72
|
+
stacked: true
|
|
73
|
+
}, /*#__PURE__*/_react.default.createElement(_Input.default, {
|
|
74
|
+
label: "Full name",
|
|
75
|
+
type: "text",
|
|
76
|
+
name: "fullName",
|
|
77
|
+
autoComplete: "name",
|
|
78
|
+
stacked: true
|
|
79
|
+
}), /*#__PURE__*/_react.default.createElement(_Input.default, {
|
|
80
|
+
label: "Username",
|
|
81
|
+
type: "text",
|
|
82
|
+
name: "username-stacked",
|
|
83
|
+
autoComplete: "username",
|
|
84
|
+
"aria-describedby": "exampleHelpTextMessage",
|
|
85
|
+
stacked: true,
|
|
86
|
+
help: "30 characters or fewer."
|
|
87
|
+
}), /*#__PURE__*/_react.default.createElement(_Input.default, {
|
|
88
|
+
type: "text",
|
|
89
|
+
label: "Email address",
|
|
90
|
+
"aria-invalid": "true",
|
|
91
|
+
name: "username-stackederror",
|
|
92
|
+
autoComplete: "email",
|
|
93
|
+
required: true,
|
|
94
|
+
error: "This field is required.",
|
|
95
|
+
stacked: true
|
|
96
|
+
}), /*#__PURE__*/_react.default.createElement(_Input.default, {
|
|
97
|
+
label: "Address line 1",
|
|
98
|
+
type: "text",
|
|
99
|
+
name: "address-optional-stacked",
|
|
100
|
+
autoComplete: "address-line1",
|
|
101
|
+
stacked: true
|
|
102
|
+
}), /*#__PURE__*/_react.default.createElement(_Input.default, {
|
|
103
|
+
label: "Address line 2",
|
|
104
|
+
type: "text",
|
|
105
|
+
name: "address-optional-stacked",
|
|
106
|
+
autoComplete: "address-line3",
|
|
107
|
+
stacked: true
|
|
108
|
+
}), /*#__PURE__*/_react.default.createElement(_Row.default, null, /*#__PURE__*/_react.default.createElement(_Col.default, {
|
|
109
|
+
size: 12
|
|
110
|
+
}, /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
111
|
+
appearance: "positive",
|
|
112
|
+
className: "u-float-right",
|
|
113
|
+
name: "add-details"
|
|
114
|
+
}, "Add details")))))));
|
|
115
|
+
}
|
|
116
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "default", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _AppAside.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _AppAside = _interopRequireDefault(require("./AppAside"));
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { HTMLProps, PropsWithChildren } from "react";
|
|
3
|
+
export type Props = {
|
|
4
|
+
/**
|
|
5
|
+
* The main content.
|
|
6
|
+
*/
|
|
7
|
+
children?: PropsWithChildren["children"];
|
|
8
|
+
} & HTMLProps<HTMLDivElement>;
|
|
9
|
+
/**
|
|
10
|
+
* This is a [React](https://reactjs.org/) component for main content area in the Vanilla
|
|
11
|
+
* [Application Layout](https://vanillaframework.io/docs/layouts/application).
|
|
12
|
+
*/
|
|
13
|
+
declare const AppMain: ({ children, className, ...props }: Props) => React.JSX.Element;
|
|
14
|
+
export default AppMain;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
11
|
+
/**
|
|
12
|
+
* This is a [React](https://reactjs.org/) component for main content area in the Vanilla
|
|
13
|
+
* [Application Layout](https://vanillaframework.io/docs/layouts/application).
|
|
14
|
+
*/
|
|
15
|
+
const AppMain = _ref => {
|
|
16
|
+
let {
|
|
17
|
+
children,
|
|
18
|
+
className,
|
|
19
|
+
...props
|
|
20
|
+
} = _ref;
|
|
21
|
+
return /*#__PURE__*/_react.default.createElement("main", _extends({
|
|
22
|
+
className: (0, _classnames.default)("l-main", className)
|
|
23
|
+
}, props), children);
|
|
24
|
+
};
|
|
25
|
+
var _default = exports.default = AppMain;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import AppMain from "./AppMain";
|
|
3
|
+
declare const meta: Meta<typeof AppMain>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof AppMain>;
|
|
6
|
+
/**
|
|
7
|
+
* In most common cases an `AppMain` should contain a `<Panel>` to display the
|
|
8
|
+
* content as intended in the application layout.
|
|
9
|
+
*
|
|
10
|
+
* `AppMain` should be a direct child of an `<Application>` or when using `ApplicationLayout`
|
|
11
|
+
* it will automatically wrap the component's children.
|
|
12
|
+
*/
|
|
13
|
+
export declare const Default: Story;
|
|
14
|
+
export declare const Content: Story;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.Default = exports.Content = void 0;
|
|
7
|
+
var _Application = _interopRequireDefault(require("../Application"));
|
|
8
|
+
var _Button = _interopRequireDefault(require("../../Button"));
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
10
|
+
var _Panel = _interopRequireDefault(require("../../Panel"));
|
|
11
|
+
var _AppMain = _interopRequireDefault(require("./AppMain"));
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
const meta = {
|
|
14
|
+
component: _AppMain.default,
|
|
15
|
+
tags: ["autodocs"]
|
|
16
|
+
};
|
|
17
|
+
var _default = exports.default = meta;
|
|
18
|
+
/**
|
|
19
|
+
* In most common cases an `AppMain` should contain a `<Panel>` to display the
|
|
20
|
+
* content as intended in the application layout.
|
|
21
|
+
*
|
|
22
|
+
* `AppMain` should be a direct child of an `<Application>` or when using `ApplicationLayout`
|
|
23
|
+
* it will automatically wrap the component's children.
|
|
24
|
+
*/
|
|
25
|
+
const Default = exports.Default = {
|
|
26
|
+
args: {
|
|
27
|
+
children: "AppMain"
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
const Content = exports.Content = {
|
|
31
|
+
render: args => {
|
|
32
|
+
return /*#__PURE__*/_react.default.createElement(_Application.default, null, /*#__PURE__*/_react.default.createElement(_AppMain.default, args, /*#__PURE__*/_react.default.createElement(_Panel.default, {
|
|
33
|
+
controls: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
34
|
+
appearance: "positive",
|
|
35
|
+
onClick: () => {},
|
|
36
|
+
className: "u-no-margin--bottom"
|
|
37
|
+
}, "Add"), /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
38
|
+
appearance: "negative",
|
|
39
|
+
onClick: () => {},
|
|
40
|
+
className: "u-no-margin--bottom"
|
|
41
|
+
}, "Delete")),
|
|
42
|
+
title: "App main"
|
|
43
|
+
}, /*#__PURE__*/_react.default.createElement("p", null, "App main content."), /*#__PURE__*/_react.default.createElement("p", null, "Scroll to the right to see the controls."))));
|
|
44
|
+
}
|
|
45
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "default", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _AppMain.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _AppMain = _interopRequireDefault(require("./AppMain"));
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { PropsWithSpread } from "../../../types";
|
|
3
|
+
import type { HTMLProps, PropsWithChildren } from "react";
|
|
4
|
+
export type Props = PropsWithSpread<{
|
|
5
|
+
/**
|
|
6
|
+
* Whether the navigation panel should be collapsed.
|
|
7
|
+
*/
|
|
8
|
+
collapsed?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* The navigation drawer content.
|
|
11
|
+
*/
|
|
12
|
+
children?: PropsWithChildren["children"];
|
|
13
|
+
/**
|
|
14
|
+
* Whether the navigation panel should be pinned.
|
|
15
|
+
*/
|
|
16
|
+
pinned?: boolean;
|
|
17
|
+
}, HTMLProps<HTMLDivElement>>;
|
|
18
|
+
/**
|
|
19
|
+
* This is a [React](https://reactjs.org/) component for the navigation panel in the Vanilla
|
|
20
|
+
* [Application Layout](https://vanillaframework.io/docs/layouts/application).
|
|
21
|
+
*
|
|
22
|
+
* This component is used to display the left navigation panel. It should be
|
|
23
|
+
* used alongside [`AppNavigationBar`](/docs/components-applicationlayout-appnavigationbar--docs).
|
|
24
|
+
*/
|
|
25
|
+
declare const AppNavigation: ({ children, className, collapsed, pinned, ...props }: Props) => React.JSX.Element;
|
|
26
|
+
export default AppNavigation;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
11
|
+
/**
|
|
12
|
+
* This is a [React](https://reactjs.org/) component for the navigation panel in the Vanilla
|
|
13
|
+
* [Application Layout](https://vanillaframework.io/docs/layouts/application).
|
|
14
|
+
*
|
|
15
|
+
* This component is used to display the left navigation panel. It should be
|
|
16
|
+
* used alongside [`AppNavigationBar`](/docs/components-applicationlayout-appnavigationbar--docs).
|
|
17
|
+
*/
|
|
18
|
+
const AppNavigation = _ref => {
|
|
19
|
+
let {
|
|
20
|
+
children,
|
|
21
|
+
className,
|
|
22
|
+
collapsed,
|
|
23
|
+
pinned,
|
|
24
|
+
...props
|
|
25
|
+
} = _ref;
|
|
26
|
+
return /*#__PURE__*/_react.default.createElement("header", _extends({
|
|
27
|
+
className: (0, _classnames.default)("l-navigation", className, {
|
|
28
|
+
"is-collapsed": collapsed,
|
|
29
|
+
"is-pinned": pinned
|
|
30
|
+
})
|
|
31
|
+
}, props), /*#__PURE__*/_react.default.createElement("div", {
|
|
32
|
+
className: "l-navigation__drawer"
|
|
33
|
+
}, children));
|
|
34
|
+
};
|
|
35
|
+
var _default = exports.default = AppNavigation;
|