@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,279 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = exports.WrapLines = exports.Title = exports.MultipleBlocks = exports.JsxCodeElements = exports.DropdownsStacked = exports.Dropdowns = exports.Dropdown = exports.Default = exports.Content = exports.Appearance = void 0;
|
|
7
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _CodeSnippet = _interopRequireDefault(require("./CodeSnippet"));
|
|
9
|
-
var _CodeSnippetBlock = require("./CodeSnippetBlock");
|
|
10
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
-
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); }
|
|
12
|
-
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; }
|
|
13
|
-
const meta = {
|
|
14
|
-
component: _CodeSnippet.default,
|
|
15
|
-
tags: ["autodocs"],
|
|
16
|
-
argTypes: {
|
|
17
|
-
className: {
|
|
18
|
-
control: {
|
|
19
|
-
type: "text"
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
var _default = exports.default = meta;
|
|
25
|
-
const Default = exports.Default = {
|
|
26
|
-
render: () => /*#__PURE__*/_react.default.createElement(_CodeSnippet.default, {
|
|
27
|
-
blocks: [{
|
|
28
|
-
code: "Mode: all Settings: maas_url=http://192.168.122.1:5240/MAAS"
|
|
29
|
-
}]
|
|
30
|
-
}),
|
|
31
|
-
name: "Default"
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Use the `title` prop to add a title to a code block.
|
|
36
|
-
*/
|
|
37
|
-
const Title = exports.Title = {
|
|
38
|
-
render: () => /*#__PURE__*/_react.default.createElement(_CodeSnippet.default, {
|
|
39
|
-
blocks: [{
|
|
40
|
-
title: "Output",
|
|
41
|
-
code: "Mode: all Settings: maas_url=http://192.168.122.1:5240/MAAS"
|
|
42
|
-
}]
|
|
43
|
-
}),
|
|
44
|
-
name: "Title"
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Pass an array of `blocks` to render multiple code blocks (for example input and output) within a single code snippet.
|
|
49
|
-
*/
|
|
50
|
-
const MultipleBlocks = exports.MultipleBlocks = {
|
|
51
|
-
render: () => /*#__PURE__*/_react.default.createElement(_CodeSnippet.default, {
|
|
52
|
-
blocks: [{
|
|
53
|
-
title: "JavaScript",
|
|
54
|
-
code: "console.log('Vanilla');"
|
|
55
|
-
}, {
|
|
56
|
-
title: "Output",
|
|
57
|
-
code: "Vanilla"
|
|
58
|
-
}]
|
|
59
|
-
}),
|
|
60
|
-
name: "Multiple blocks"
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Use `appearance` to control the visual aspects of the code block. `"numbered"` appearance will add line numbers in the code blocks.
|
|
65
|
-
* Values of `"linuxPrompt"`, `"windowsPrompt"`, `"url"` will add a relevant icon in the code block.
|
|
66
|
-
*/
|
|
67
|
-
const Appearance = exports.Appearance = {
|
|
68
|
-
render: () => /*#__PURE__*/_react.default.createElement(_CodeSnippet.default, {
|
|
69
|
-
blocks: [{
|
|
70
|
-
title: "Install on Linux",
|
|
71
|
-
appearance: _CodeSnippetBlock.CodeSnippetBlockAppearance.LINUX_PROMPT,
|
|
72
|
-
code: "snap install toto"
|
|
73
|
-
}, {
|
|
74
|
-
title: "Install on Windows",
|
|
75
|
-
appearance: _CodeSnippetBlock.CodeSnippetBlockAppearance.WINDOWS_PROMPT,
|
|
76
|
-
code: "snap install toto"
|
|
77
|
-
}, {
|
|
78
|
-
title: "Get from the Store",
|
|
79
|
-
appearance: _CodeSnippetBlock.CodeSnippetBlockAppearance.URL,
|
|
80
|
-
code: "http://snapcraft.io/toto"
|
|
81
|
-
}]
|
|
82
|
-
}),
|
|
83
|
-
name: "Appearance"
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Set `wrapLines` prop to `true` to enable line wrapping inside the code block.
|
|
88
|
-
*/
|
|
89
|
-
const WrapLines = exports.WrapLines = {
|
|
90
|
-
render: () => /*#__PURE__*/_react.default.createElement(_CodeSnippet.default, {
|
|
91
|
-
blocks: [{
|
|
92
|
-
appearance: _CodeSnippetBlock.CodeSnippetBlockAppearance.NUMBERED,
|
|
93
|
-
wrapLines: true,
|
|
94
|
-
code: "#!/bin/bash\nset -eu . $CONJURE_UP_SPELLSDIR/sdk/common.sh\nif [[ \"$JUJU_PROVIDERTYPE\" == \"lxd\" ]]; then\n debug \"Running pre-deploy for $CONJURE_UP_SPELL\"\n sed \"s/##MODEL##/$JUJU_MODEL/\" $(scriptPath)/lxd-profile.yaml | lxc profile edit \"juju-$JUJU_MODEL\" || exposeResult \"Failed to set profile\" $? \"false\"\nfi\nexposeResult \"Successful pre-deploy.\" 0 \"true\""
|
|
95
|
-
}]
|
|
96
|
-
}),
|
|
97
|
-
name: "Wrap lines"
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* Dropdown select menus can be added to the headers of code blocks to allow users to choose one of the options. The dropdowns options are passed via `dropdowns` property in the block options object.
|
|
102
|
-
*
|
|
103
|
-
* With the `options` being an array of option properties compatible with the `Select` options (`[{ label: string, value: string | number }]`).
|
|
104
|
-
*/
|
|
105
|
-
const Dropdown = exports.Dropdown = {
|
|
106
|
-
render: () => {
|
|
107
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
108
|
-
const [lang, setLang] = (0, _react.useState)("html");
|
|
109
|
-
const code = {
|
|
110
|
-
js: "console.log(\"Example 1\");",
|
|
111
|
-
css: ".p-heading--2 { color: red; }",
|
|
112
|
-
html: "<h1 class=\"p-heading--2\">How to use code snippets</h1>"
|
|
113
|
-
};
|
|
114
|
-
return /*#__PURE__*/_react.default.createElement(_CodeSnippet.default, {
|
|
115
|
-
blocks: [{
|
|
116
|
-
code: code[lang],
|
|
117
|
-
dropdowns: [{
|
|
118
|
-
options: [{
|
|
119
|
-
value: "js",
|
|
120
|
-
label: "JS"
|
|
121
|
-
}, {
|
|
122
|
-
value: "css",
|
|
123
|
-
label: "CSS"
|
|
124
|
-
}, {
|
|
125
|
-
value: "html",
|
|
126
|
-
label: "HTML"
|
|
127
|
-
}],
|
|
128
|
-
value: lang,
|
|
129
|
-
onChange: event => {
|
|
130
|
-
setLang(event.target.value);
|
|
131
|
-
}
|
|
132
|
-
}]
|
|
133
|
-
}]
|
|
134
|
-
});
|
|
135
|
-
},
|
|
136
|
-
name: "Dropdown"
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
* Multiple dropdowns can be passed in if needed.
|
|
141
|
-
*/
|
|
142
|
-
const Dropdowns = exports.Dropdowns = {
|
|
143
|
-
render: () => {
|
|
144
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
145
|
-
const [channel, setChannel] = (0, _react.useState)("stable");
|
|
146
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
147
|
-
const [snap, setSnap] = (0, _react.useState)("firefox");
|
|
148
|
-
const code = "sudo snap install ".concat(snap, " ").concat(channel === "stable" ? "" : "--" + channel);
|
|
149
|
-
return /*#__PURE__*/_react.default.createElement(_CodeSnippet.default, {
|
|
150
|
-
blocks: [{
|
|
151
|
-
title: "Install snap",
|
|
152
|
-
code: code,
|
|
153
|
-
dropdowns: [{
|
|
154
|
-
options: [{
|
|
155
|
-
value: "stable",
|
|
156
|
-
label: "stable"
|
|
157
|
-
}, {
|
|
158
|
-
value: "candidate",
|
|
159
|
-
label: "candidate"
|
|
160
|
-
}, {
|
|
161
|
-
value: "beta",
|
|
162
|
-
label: "beta"
|
|
163
|
-
}, {
|
|
164
|
-
value: "edge",
|
|
165
|
-
label: "edge"
|
|
166
|
-
}],
|
|
167
|
-
value: channel,
|
|
168
|
-
onChange: event => {
|
|
169
|
-
setChannel(event.target.value);
|
|
170
|
-
}
|
|
171
|
-
}, {
|
|
172
|
-
options: [{
|
|
173
|
-
value: "firefox",
|
|
174
|
-
label: "Firefox"
|
|
175
|
-
}, {
|
|
176
|
-
value: "gimp",
|
|
177
|
-
label: "Gimp"
|
|
178
|
-
}, {
|
|
179
|
-
value: "vlc",
|
|
180
|
-
label: "VLC"
|
|
181
|
-
}],
|
|
182
|
-
value: snap,
|
|
183
|
-
onChange: event => {
|
|
184
|
-
setSnap(event.target.value);
|
|
185
|
-
}
|
|
186
|
-
}]
|
|
187
|
-
}]
|
|
188
|
-
});
|
|
189
|
-
},
|
|
190
|
-
name: "Dropdowns"
|
|
191
|
-
};
|
|
192
|
-
|
|
193
|
-
/**
|
|
194
|
-
* If multiple dropdowns may overlap with long title you can use `stacked` variant, by setting the relevant property on code block options.
|
|
195
|
-
*/
|
|
196
|
-
const DropdownsStacked = exports.DropdownsStacked = {
|
|
197
|
-
render: () => {
|
|
198
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
199
|
-
const [channel, setChannel] = (0, _react.useState)("stable");
|
|
200
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
201
|
-
const [snap, setSnap] = (0, _react.useState)("firefox");
|
|
202
|
-
const code = "sudo snap install ".concat(snap, " ").concat(channel === "stable" ? "" : "--" + channel);
|
|
203
|
-
return /*#__PURE__*/_react.default.createElement(_CodeSnippet.default, {
|
|
204
|
-
blocks: [{
|
|
205
|
-
title: "Install Firefox, Gimp or VLC as a snap from different channels using command line",
|
|
206
|
-
code: code,
|
|
207
|
-
stacked: true,
|
|
208
|
-
dropdowns: [{
|
|
209
|
-
options: [{
|
|
210
|
-
value: "stable",
|
|
211
|
-
label: "stable"
|
|
212
|
-
}, {
|
|
213
|
-
value: "candidate",
|
|
214
|
-
label: "candidate"
|
|
215
|
-
}, {
|
|
216
|
-
value: "beta",
|
|
217
|
-
label: "beta"
|
|
218
|
-
}, {
|
|
219
|
-
value: "edge",
|
|
220
|
-
label: "edge"
|
|
221
|
-
}],
|
|
222
|
-
value: channel,
|
|
223
|
-
onChange: event => {
|
|
224
|
-
setChannel(event.target.value);
|
|
225
|
-
}
|
|
226
|
-
}, {
|
|
227
|
-
options: [{
|
|
228
|
-
value: "firefox",
|
|
229
|
-
label: "Firefox"
|
|
230
|
-
}, {
|
|
231
|
-
value: "gimp",
|
|
232
|
-
label: "Gimp"
|
|
233
|
-
}, {
|
|
234
|
-
value: "vlc",
|
|
235
|
-
label: "VLC"
|
|
236
|
-
}],
|
|
237
|
-
value: snap,
|
|
238
|
-
onChange: event => {
|
|
239
|
-
setSnap(event.target.value);
|
|
240
|
-
}
|
|
241
|
-
}]
|
|
242
|
-
}]
|
|
243
|
-
});
|
|
244
|
-
},
|
|
245
|
-
name: "DropdownsStacked"
|
|
246
|
-
};
|
|
247
|
-
|
|
248
|
-
/**
|
|
249
|
-
* Custom elements can be passed to a CodeBlock via the `content` prop. In these cases, a border will be added around the entire code snippet to visually associate the content with the code block.
|
|
250
|
-
*/
|
|
251
|
-
const Content = exports.Content = {
|
|
252
|
-
render: () => /*#__PURE__*/_react.default.createElement(_CodeSnippet.default, {
|
|
253
|
-
blocks: [{
|
|
254
|
-
title: "With embedded iframe",
|
|
255
|
-
code: "<iframe src='./iframe.html?viewMode=story&id=components-button--default&args='></iframe>",
|
|
256
|
-
content: /*#__PURE__*/_react.default.createElement("iframe", {
|
|
257
|
-
title: "iframe",
|
|
258
|
-
src: "./iframe.html?viewMode=story&id=components-button--default&args="
|
|
259
|
-
})
|
|
260
|
-
}]
|
|
261
|
-
}),
|
|
262
|
-
name: "Content"
|
|
263
|
-
};
|
|
264
|
-
|
|
265
|
-
/**
|
|
266
|
-
* It's possible to pass JSX instead of strings to the `code` parameter, either as a single element or an array (e.g. if you want to display line numbers).
|
|
267
|
-
*/
|
|
268
|
-
const JsxCodeElements = exports.JsxCodeElements = {
|
|
269
|
-
render: () => /*#__PURE__*/_react.default.createElement(_CodeSnippet.default, {
|
|
270
|
-
blocks: [{
|
|
271
|
-
code: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("strong", null, "snap"), "install", /*#__PURE__*/_react.default.createElement("a", {
|
|
272
|
-
href: "#test"
|
|
273
|
-
}, "toto"), /*#__PURE__*/_react.default.createElement("br", null), /*#__PURE__*/_react.default.createElement("strong", null, "apt"), "install", /*#__PURE__*/_react.default.createElement("a", {
|
|
274
|
-
href: "#test"
|
|
275
|
-
}, "toto"))
|
|
276
|
-
}]
|
|
277
|
-
}),
|
|
278
|
-
name: "JSX code elements"
|
|
279
|
-
};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
|
-
import type { Props as CodeSnippetDropdownProps } from "./CodeSnippetDropdown";
|
|
3
|
-
import type { ValueOf } from "../../types";
|
|
4
|
-
export declare const CodeSnippetBlockAppearance: {
|
|
5
|
-
readonly LINUX_PROMPT: "linuxPrompt";
|
|
6
|
-
readonly NUMBERED: "numbered";
|
|
7
|
-
readonly URL: "url";
|
|
8
|
-
readonly WINDOWS_PROMPT: "windowsPrompt";
|
|
9
|
-
};
|
|
10
|
-
export type Props = {
|
|
11
|
-
/**
|
|
12
|
-
* The appearance of the code block.
|
|
13
|
-
*/
|
|
14
|
-
appearance?: ValueOf<typeof CodeSnippetBlockAppearance>;
|
|
15
|
-
/**
|
|
16
|
-
* The code snippet to display.
|
|
17
|
-
*/
|
|
18
|
-
code: ReactNode;
|
|
19
|
-
/**
|
|
20
|
-
* Content to show below the code snippet.
|
|
21
|
-
*/
|
|
22
|
-
content?: ReactNode;
|
|
23
|
-
/**
|
|
24
|
-
* A list of dropdowns to display in the header.
|
|
25
|
-
*/
|
|
26
|
-
dropdowns?: CodeSnippetDropdownProps[];
|
|
27
|
-
/**
|
|
28
|
-
* Whether the title should display stacked on top of the dropdowns.
|
|
29
|
-
*/
|
|
30
|
-
stacked?: boolean;
|
|
31
|
-
/**
|
|
32
|
-
* The title of the code block.
|
|
33
|
-
*/
|
|
34
|
-
title?: string;
|
|
35
|
-
/**
|
|
36
|
-
* Whether to enable line wrapping inside the code block.
|
|
37
|
-
*/
|
|
38
|
-
wrapLines?: boolean;
|
|
39
|
-
};
|
|
40
|
-
export default function CodeSnippetBlock({ appearance, code, content, dropdowns, stacked, title, wrapLines, }: Props): JSX.Element;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { ChangeEventHandler, HTMLProps } from "react";
|
|
2
|
-
export type DropdownOptionProps = {
|
|
3
|
-
/**
|
|
4
|
-
* The label of the dropdown option.
|
|
5
|
-
*/
|
|
6
|
-
label: string;
|
|
7
|
-
} & HTMLProps<HTMLOptionElement>;
|
|
8
|
-
export type Props = {
|
|
9
|
-
/**
|
|
10
|
-
* Function for handling the select value changing.
|
|
11
|
-
*/
|
|
12
|
-
onChange: ChangeEventHandler<HTMLSelectElement>;
|
|
13
|
-
/**
|
|
14
|
-
* Options to pass to the select.
|
|
15
|
-
*/
|
|
16
|
-
options: DropdownOptionProps[];
|
|
17
|
-
} & HTMLProps<HTMLSelectElement>;
|
|
18
|
-
export default function CodeSnippetDropdown({ options, onChange, ...props }: Props): JSX.Element;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { default } from "./CodeSnippet";
|
|
2
|
-
export type { Props as CodeSnippetProps } from "./CodeSnippet";
|
|
3
|
-
export { CodeSnippetBlockAppearance } from "./CodeSnippetBlock";
|
|
4
|
-
export type { Props as CodeSnippetBlockProps } from "./CodeSnippetBlock";
|
|
5
|
-
export type { Props as CodeSnippetDropdownProps } from "./CodeSnippetDropdown";
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import type { ElementType, HTMLProps, ReactNode } from "react";
|
|
2
|
-
import type { ClassName, PropsWithSpread } from "../../types";
|
|
3
|
-
export type ColSize = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
|
4
|
-
export declare const colSizes: ColSize[];
|
|
5
|
-
export type Props = PropsWithSpread<{
|
|
6
|
-
/**
|
|
7
|
-
* The content of the column.
|
|
8
|
-
*/
|
|
9
|
-
children?: ReactNode;
|
|
10
|
-
/**
|
|
11
|
-
* Optional class(es) to pass to the wrapping element.
|
|
12
|
-
*/
|
|
13
|
-
className?: ClassName;
|
|
14
|
-
/**
|
|
15
|
-
* Optional element type to give the wrapper if not "div".
|
|
16
|
-
*/
|
|
17
|
-
element?: ElementType;
|
|
18
|
-
/**
|
|
19
|
-
* The number of columns to skip before starting on large screens.
|
|
20
|
-
*/
|
|
21
|
-
emptyLarge?: ColSize;
|
|
22
|
-
/**
|
|
23
|
-
* The number of columns to skip before starting on medium screens.
|
|
24
|
-
*/
|
|
25
|
-
emptyMedium?: ColSize;
|
|
26
|
-
/**
|
|
27
|
-
* The number of columns to skip before starting on small screens.
|
|
28
|
-
*/
|
|
29
|
-
emptySmall?: ColSize;
|
|
30
|
-
/**
|
|
31
|
-
* Override for the number of columns the content occupies on large screens.
|
|
32
|
-
*/
|
|
33
|
-
large?: ColSize;
|
|
34
|
-
/**
|
|
35
|
-
* Override for the number of columns the content occupies on medium screens.
|
|
36
|
-
*/
|
|
37
|
-
medium?: ColSize;
|
|
38
|
-
/**
|
|
39
|
-
* The number of columns the content occupies.
|
|
40
|
-
*/
|
|
41
|
-
size: ColSize;
|
|
42
|
-
/**
|
|
43
|
-
* Override for the number of columns the content occupies on small screens.
|
|
44
|
-
*/
|
|
45
|
-
small?: ColSize;
|
|
46
|
-
}, HTMLProps<HTMLElement>>;
|
|
47
|
-
/**
|
|
48
|
-
* This is a [React](https://reactjs.org/) component for use within the Vanilla [Grid](https://docs.vanillaframework.io/patterns/grid/).
|
|
49
|
-
*
|
|
50
|
-
* Vanilla has a responsive grid using a combination of rows and columns.
|
|
51
|
-
*/
|
|
52
|
-
declare const Col: ({ children, className, element: Component, emptyLarge, emptyMedium, emptySmall, large, medium, size, small, ...props }: Props) => JSX.Element;
|
|
53
|
-
export default Col;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Meta, StoryObj } from "@storybook/react";
|
|
3
|
-
import Col from "./Col";
|
|
4
|
-
declare const Template: (args: any) => React.JSX.Element;
|
|
5
|
-
declare const meta: Meta<typeof Template>;
|
|
6
|
-
export default meta;
|
|
7
|
-
type Story = StoryObj<typeof Col>;
|
|
8
|
-
export declare const Default: Story;
|
|
9
|
-
export declare const Grid: Story;
|
|
10
|
-
export declare const NestedColumns: Story;
|
|
11
|
-
export declare const EmptyColumns: Story;
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = exports.NestedColumns = exports.Grid = exports.EmptyColumns = exports.Default = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _Col = _interopRequireDefault(require("./Col"));
|
|
9
|
-
var _Row = _interopRequireDefault(require("../Row"));
|
|
10
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
-
const Template = args => {
|
|
12
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
13
|
-
className: "grid-demo"
|
|
14
|
-
}, /*#__PURE__*/_react.default.createElement(_Row.default, null, /*#__PURE__*/_react.default.createElement(_Col.default, args)));
|
|
15
|
-
};
|
|
16
|
-
const meta = {
|
|
17
|
-
component: _Col.default,
|
|
18
|
-
render: Template,
|
|
19
|
-
tags: ["autodocs"],
|
|
20
|
-
argTypes: {
|
|
21
|
-
children: {
|
|
22
|
-
control: {
|
|
23
|
-
type: "text"
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
size: {
|
|
27
|
-
control: {
|
|
28
|
-
type: "range",
|
|
29
|
-
min: 1,
|
|
30
|
-
max: 12,
|
|
31
|
-
step: 1
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
var _default = exports.default = meta;
|
|
37
|
-
const Default = exports.Default = {
|
|
38
|
-
name: "Default",
|
|
39
|
-
args: {
|
|
40
|
-
children: "Hi, I'm Col.",
|
|
41
|
-
size: 12
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
const Grid = exports.Grid = {
|
|
45
|
-
render: () => {
|
|
46
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
47
|
-
className: "grid-demo"
|
|
48
|
-
}, /*#__PURE__*/_react.default.createElement(_Row.default, null, /*#__PURE__*/_react.default.createElement(_Col.default, {
|
|
49
|
-
size: 12
|
|
50
|
-
}, /*#__PURE__*/_react.default.createElement("span", null, ".col-12"))), /*#__PURE__*/_react.default.createElement(_Row.default, null, /*#__PURE__*/_react.default.createElement(_Col.default, {
|
|
51
|
-
size: 11
|
|
52
|
-
}, /*#__PURE__*/_react.default.createElement("span", null, ".col-11")), /*#__PURE__*/_react.default.createElement(_Col.default, {
|
|
53
|
-
size: 1
|
|
54
|
-
}, /*#__PURE__*/_react.default.createElement("span", null, ".col-1"))), /*#__PURE__*/_react.default.createElement(_Row.default, null, /*#__PURE__*/_react.default.createElement(_Col.default, {
|
|
55
|
-
size: 10
|
|
56
|
-
}, /*#__PURE__*/_react.default.createElement("span", null, ".col-10")), /*#__PURE__*/_react.default.createElement(_Col.default, {
|
|
57
|
-
size: 2
|
|
58
|
-
}, /*#__PURE__*/_react.default.createElement("span", null, ".col-2"))), /*#__PURE__*/_react.default.createElement(_Row.default, null, /*#__PURE__*/_react.default.createElement(_Col.default, {
|
|
59
|
-
size: 9
|
|
60
|
-
}, /*#__PURE__*/_react.default.createElement("span", null, ".col-9")), /*#__PURE__*/_react.default.createElement(_Col.default, {
|
|
61
|
-
size: 3
|
|
62
|
-
}, /*#__PURE__*/_react.default.createElement("span", null, ".col-3"))), /*#__PURE__*/_react.default.createElement(_Row.default, null, /*#__PURE__*/_react.default.createElement(_Col.default, {
|
|
63
|
-
size: 8
|
|
64
|
-
}, /*#__PURE__*/_react.default.createElement("span", null, ".col-8")), /*#__PURE__*/_react.default.createElement(_Col.default, {
|
|
65
|
-
size: 4
|
|
66
|
-
}, /*#__PURE__*/_react.default.createElement("span", null, ".col-4"))), /*#__PURE__*/_react.default.createElement(_Row.default, null, /*#__PURE__*/_react.default.createElement(_Col.default, {
|
|
67
|
-
size: 7
|
|
68
|
-
}, /*#__PURE__*/_react.default.createElement("span", null, ".col-7")), /*#__PURE__*/_react.default.createElement(_Col.default, {
|
|
69
|
-
size: 5
|
|
70
|
-
}, /*#__PURE__*/_react.default.createElement("span", null, ".col-5"))), /*#__PURE__*/_react.default.createElement(_Row.default, null, /*#__PURE__*/_react.default.createElement(_Col.default, {
|
|
71
|
-
size: 6
|
|
72
|
-
}, /*#__PURE__*/_react.default.createElement("span", null, ".col-6")), /*#__PURE__*/_react.default.createElement(_Col.default, {
|
|
73
|
-
size: 6
|
|
74
|
-
}, /*#__PURE__*/_react.default.createElement("span", null, ".col-6"))), /*#__PURE__*/_react.default.createElement(_Row.default, null, /*#__PURE__*/_react.default.createElement(_Col.default, {
|
|
75
|
-
size: 5
|
|
76
|
-
}, /*#__PURE__*/_react.default.createElement("span", null, ".col-5")), /*#__PURE__*/_react.default.createElement(_Col.default, {
|
|
77
|
-
size: 7
|
|
78
|
-
}, /*#__PURE__*/_react.default.createElement("span", null, ".col-7"))), /*#__PURE__*/_react.default.createElement(_Row.default, null, /*#__PURE__*/_react.default.createElement(_Col.default, {
|
|
79
|
-
size: 4
|
|
80
|
-
}, /*#__PURE__*/_react.default.createElement("span", null, ".col-4")), /*#__PURE__*/_react.default.createElement(_Col.default, {
|
|
81
|
-
size: 8
|
|
82
|
-
}, /*#__PURE__*/_react.default.createElement("span", null, ".col-8"))), /*#__PURE__*/_react.default.createElement(_Row.default, null, /*#__PURE__*/_react.default.createElement(_Col.default, {
|
|
83
|
-
size: 3
|
|
84
|
-
}, /*#__PURE__*/_react.default.createElement("span", null, ".col-3")), /*#__PURE__*/_react.default.createElement(_Col.default, {
|
|
85
|
-
size: 9
|
|
86
|
-
}, /*#__PURE__*/_react.default.createElement("span", null, ".col-9"))), /*#__PURE__*/_react.default.createElement(_Row.default, null, /*#__PURE__*/_react.default.createElement(_Col.default, {
|
|
87
|
-
size: 2
|
|
88
|
-
}, /*#__PURE__*/_react.default.createElement("span", null, ".col-2")), /*#__PURE__*/_react.default.createElement(_Col.default, {
|
|
89
|
-
size: 10
|
|
90
|
-
}, /*#__PURE__*/_react.default.createElement("span", null, ".col-10"))), /*#__PURE__*/_react.default.createElement(_Row.default, null, /*#__PURE__*/_react.default.createElement(_Col.default, {
|
|
91
|
-
size: 1
|
|
92
|
-
}, /*#__PURE__*/_react.default.createElement("span", null, ".col-1")), /*#__PURE__*/_react.default.createElement(_Col.default, {
|
|
93
|
-
size: 11
|
|
94
|
-
}, /*#__PURE__*/_react.default.createElement("span", null, ".col-11"))));
|
|
95
|
-
},
|
|
96
|
-
name: "Grid"
|
|
97
|
-
};
|
|
98
|
-
const NestedColumns = exports.NestedColumns = {
|
|
99
|
-
render: () => {
|
|
100
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
101
|
-
className: "grid-demo"
|
|
102
|
-
}, /*#__PURE__*/_react.default.createElement(_Row.default, null, /*#__PURE__*/_react.default.createElement(_Col.default, {
|
|
103
|
-
small: 4,
|
|
104
|
-
medium: 6,
|
|
105
|
-
size: 12
|
|
106
|
-
}, "col-small-4 .col-medium-6 .col-12", /*#__PURE__*/_react.default.createElement(_Row.default, null, /*#__PURE__*/_react.default.createElement(_Col.default, {
|
|
107
|
-
small: 3,
|
|
108
|
-
medium: 3,
|
|
109
|
-
size: 9
|
|
110
|
-
}, "col-small-3 .col-medium-3 .col-9", /*#__PURE__*/_react.default.createElement(_Row.default, null, /*#__PURE__*/_react.default.createElement(_Col.default, {
|
|
111
|
-
small: 1,
|
|
112
|
-
medium: 1,
|
|
113
|
-
size: 2
|
|
114
|
-
}, "col-small-1 col-medium-1 col-2"), /*#__PURE__*/_react.default.createElement(_Col.default, {
|
|
115
|
-
small: 1,
|
|
116
|
-
medium: 1,
|
|
117
|
-
size: 3
|
|
118
|
-
}, "col-small-1 col-medium-1 col-2"), /*#__PURE__*/_react.default.createElement(_Col.default, {
|
|
119
|
-
small: 1,
|
|
120
|
-
medium: 1,
|
|
121
|
-
size: 3
|
|
122
|
-
}, "col-small-1 col-medium-1 col-2"))), /*#__PURE__*/_react.default.createElement(_Col.default, {
|
|
123
|
-
small: 1,
|
|
124
|
-
medium: 3,
|
|
125
|
-
size: 3
|
|
126
|
-
}, "col-small-2 col-medium-3 col-3")))));
|
|
127
|
-
},
|
|
128
|
-
name: "Nested columns"
|
|
129
|
-
};
|
|
130
|
-
const EmptyColumns = exports.EmptyColumns = {
|
|
131
|
-
render: () => {
|
|
132
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
133
|
-
className: "grid-demo"
|
|
134
|
-
}, /*#__PURE__*/_react.default.createElement(_Row.default, null, /*#__PURE__*/_react.default.createElement(_Col.default, {
|
|
135
|
-
size: 8
|
|
136
|
-
}, ".col-8"), /*#__PURE__*/_react.default.createElement(_Col.default, {
|
|
137
|
-
size: 4
|
|
138
|
-
}, ".col-4")), /*#__PURE__*/_react.default.createElement(_Row.default, null, /*#__PURE__*/_react.default.createElement(_Col.default, {
|
|
139
|
-
size: 7
|
|
140
|
-
}, ".col-7"), /*#__PURE__*/_react.default.createElement(_Col.default, {
|
|
141
|
-
size: 4
|
|
142
|
-
}, /*#__PURE__*/_react.default.createElement(_Row.default, null, /*#__PURE__*/_react.default.createElement(_Col.default, {
|
|
143
|
-
size: 3,
|
|
144
|
-
emptyLarge: 2
|
|
145
|
-
}, "col-3 col-start-large-2 inside col-4")))), /*#__PURE__*/_react.default.createElement(_Row.default, null, /*#__PURE__*/_react.default.createElement(_Col.default, {
|
|
146
|
-
size: 7
|
|
147
|
-
}, ".col-7"), /*#__PURE__*/_react.default.createElement(_Col.default, {
|
|
148
|
-
size: 4
|
|
149
|
-
}, /*#__PURE__*/_react.default.createElement(_Row.default, null, /*#__PURE__*/_react.default.createElement(_Col.default, {
|
|
150
|
-
size: 3
|
|
151
|
-
}, "col-3 inside col-4")))));
|
|
152
|
-
},
|
|
153
|
-
name: "Empty columns"
|
|
154
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { ReactElement } from "react";
|
|
2
|
-
import { PropsWithSpread, SubComponentProps } from "../../types";
|
|
3
|
-
import { ActionButtonProps } from "../ActionButton";
|
|
4
|
-
import { ConfirmationModalProps } from "../ConfirmationModal";
|
|
5
|
-
export type Props = PropsWithSpread<{
|
|
6
|
-
/**
|
|
7
|
-
* Additional props to pass to the confirmation modal.
|
|
8
|
-
*/
|
|
9
|
-
confirmationModalProps: SubComponentProps<ConfirmationModalProps>;
|
|
10
|
-
/**
|
|
11
|
-
* An optional text to be shown when hovering over the button.<br/>
|
|
12
|
-
* Defaults to the label of the confirm button in the modal.
|
|
13
|
-
*/
|
|
14
|
-
onHoverText?: string;
|
|
15
|
-
/**
|
|
16
|
-
* Whether to enable the SHIFT+Click shortcut to skip the confirmation modal and perform the action.
|
|
17
|
-
*/
|
|
18
|
-
shiftClickEnabled?: boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Whether to show a hint about the SHIFT+Click shortcut to skip the confirmation modal.
|
|
21
|
-
*/
|
|
22
|
-
showShiftClickHint?: boolean;
|
|
23
|
-
}, ActionButtonProps>;
|
|
24
|
-
/**
|
|
25
|
-
* `ConfirmationButton` is a specialised version of the [ActionButton](?path=/docs/actionbutton--default-story) component that uses a [ConfirmationModal](?path=/docs/confirmationmodal--default-story) to prompt a confirmation from the user before executing an action.
|
|
26
|
-
*/
|
|
27
|
-
export declare const ConfirmationButton: ({ confirmationModalProps, onHoverText, shiftClickEnabled, showShiftClickHint, ...actionButtonProps }: Props) => ReactElement;
|
|
28
|
-
export default ConfirmationButton;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import ConfirmationButton from "./ConfirmationButton";
|
|
3
|
-
declare const meta: Meta<typeof ConfirmationButton>;
|
|
4
|
-
export declare const Default: Story;
|
|
5
|
-
export default meta;
|
|
6
|
-
type Story = StoryObj<typeof ConfirmationButton>;
|
|
7
|
-
export declare const IconAndLabel: Story;
|
|
8
|
-
export declare const IconOnly: Story;
|
|
9
|
-
export declare const BaseAppearance: Story;
|