@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,180 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = exports.Small = exports.PositiveDisabled = exports.Positive = exports.NegativeDisabled = exports.Negative = exports.LinkDisabled = exports.Link = exports.Inline = exports.IconWithTooltip = exports.IconText = exports.Icon = exports.Dense = exports.DefaultDisabled = exports.Default = exports.BrandDisabled = exports.Brand = exports.BaseDisabled = exports.Base = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _Tooltip = _interopRequireDefault(require("../Tooltip"));
|
|
9
|
-
var _Button = _interopRequireWildcard(require("./Button"));
|
|
10
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
11
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
12
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
-
const meta = {
|
|
14
|
-
component: _Button.default,
|
|
15
|
-
tags: ["autodocs"],
|
|
16
|
-
argTypes: {
|
|
17
|
-
children: {
|
|
18
|
-
control: {
|
|
19
|
-
type: "text"
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
appearance: {
|
|
23
|
-
control: {
|
|
24
|
-
options: _Button.ButtonAppearance,
|
|
25
|
-
type: "select"
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
args: {
|
|
30
|
-
children: "Click me!",
|
|
31
|
-
appearance: _Button.ButtonAppearance.DEFAULT
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
var _default = exports.default = meta;
|
|
35
|
-
const Default = exports.Default = {
|
|
36
|
-
name: "Default",
|
|
37
|
-
args: {
|
|
38
|
-
children: "Button"
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
const DefaultDisabled = exports.DefaultDisabled = {
|
|
42
|
-
name: "Default disabled",
|
|
43
|
-
args: {
|
|
44
|
-
children: "Button",
|
|
45
|
-
disabled: true
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
const Base = exports.Base = {
|
|
49
|
-
name: "Base",
|
|
50
|
-
args: {
|
|
51
|
-
children: "Base button",
|
|
52
|
-
appearance: "base"
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
const BaseDisabled = exports.BaseDisabled = {
|
|
56
|
-
name: "Base disabled",
|
|
57
|
-
args: {
|
|
58
|
-
children: "Base button disabled",
|
|
59
|
-
appearance: "base",
|
|
60
|
-
disabled: true
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
const Link = exports.Link = {
|
|
64
|
-
name: "Link",
|
|
65
|
-
args: {
|
|
66
|
-
children: "Link button",
|
|
67
|
-
appearance: "base",
|
|
68
|
-
element: "a",
|
|
69
|
-
href: "#test"
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
const LinkDisabled = exports.LinkDisabled = {
|
|
73
|
-
name: "Link disabled",
|
|
74
|
-
args: {
|
|
75
|
-
children: "Link button disabled",
|
|
76
|
-
appearance: "base",
|
|
77
|
-
element: "a",
|
|
78
|
-
href: "#test",
|
|
79
|
-
disabled: true
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
const Positive = exports.Positive = {
|
|
83
|
-
name: "Positive",
|
|
84
|
-
args: {
|
|
85
|
-
children: "Positive button",
|
|
86
|
-
appearance: "positive"
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
const PositiveDisabled = exports.PositiveDisabled = {
|
|
90
|
-
name: "Positive disabled",
|
|
91
|
-
args: {
|
|
92
|
-
children: "Positive button disabled",
|
|
93
|
-
appearance: "positive",
|
|
94
|
-
disabled: true
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
const Negative = exports.Negative = {
|
|
98
|
-
name: "Negative",
|
|
99
|
-
args: {
|
|
100
|
-
children: "Negative button",
|
|
101
|
-
appearance: "negative"
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
const NegativeDisabled = exports.NegativeDisabled = {
|
|
105
|
-
name: "Negative disabled",
|
|
106
|
-
args: {
|
|
107
|
-
children: "Negative button disabled",
|
|
108
|
-
appearance: "negative",
|
|
109
|
-
disabled: true
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
const Brand = exports.Brand = {
|
|
113
|
-
name: "Brand",
|
|
114
|
-
args: {
|
|
115
|
-
children: "Brand button",
|
|
116
|
-
appearance: "brand"
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
const BrandDisabled = exports.BrandDisabled = {
|
|
120
|
-
name: "Brand disabled",
|
|
121
|
-
args: {
|
|
122
|
-
children: "Brand button disabled",
|
|
123
|
-
appearance: "brand",
|
|
124
|
-
disabled: true
|
|
125
|
-
}
|
|
126
|
-
};
|
|
127
|
-
const Inline = exports.Inline = {
|
|
128
|
-
render: () => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("span", null, "Everything you need to get started with Vanilla."), /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
129
|
-
appearance: "neutral",
|
|
130
|
-
inline: true
|
|
131
|
-
}, "Inline button")),
|
|
132
|
-
name: "Inline"
|
|
133
|
-
};
|
|
134
|
-
const Dense = exports.Dense = {
|
|
135
|
-
render: () => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("span", null, "Everything you need to get started with Vanilla."), /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
136
|
-
dense: true
|
|
137
|
-
}, "Dense button")),
|
|
138
|
-
name: "Dense"
|
|
139
|
-
};
|
|
140
|
-
const Small = exports.Small = {
|
|
141
|
-
render: () => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
142
|
-
small: true
|
|
143
|
-
}, "Small button"), /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
144
|
-
small: true,
|
|
145
|
-
dense: true
|
|
146
|
-
}, "Small dense button")),
|
|
147
|
-
name: "Small"
|
|
148
|
-
};
|
|
149
|
-
const Icon = exports.Icon = {
|
|
150
|
-
name: "Icon",
|
|
151
|
-
args: {
|
|
152
|
-
children: /*#__PURE__*/_react.default.createElement("i", {
|
|
153
|
-
className: "p-icon--plus"
|
|
154
|
-
}),
|
|
155
|
-
hasIcon: true
|
|
156
|
-
}
|
|
157
|
-
};
|
|
158
|
-
const IconText = exports.IconText = {
|
|
159
|
-
name: "Icon & text",
|
|
160
|
-
args: {
|
|
161
|
-
children: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("i", {
|
|
162
|
-
className: "p-icon--plus"
|
|
163
|
-
}), " ", /*#__PURE__*/_react.default.createElement("span", null, "Button with icon & text")),
|
|
164
|
-
hasIcon: true
|
|
165
|
-
}
|
|
166
|
-
};
|
|
167
|
-
const IconWithTooltip = exports.IconWithTooltip = {
|
|
168
|
-
name: "Disabled with tooltip",
|
|
169
|
-
args: {
|
|
170
|
-
children: "Disabled button with a tooltip",
|
|
171
|
-
disabled: true
|
|
172
|
-
},
|
|
173
|
-
render: args => /*#__PURE__*/_react.default.createElement("div", {
|
|
174
|
-
style: {
|
|
175
|
-
paddingTop: "3rem"
|
|
176
|
-
}
|
|
177
|
-
}, /*#__PURE__*/_react.default.createElement(_Tooltip.default, {
|
|
178
|
-
message: "This button is disabled"
|
|
179
|
-
}, /*#__PURE__*/_react.default.createElement(_Button.default, args)))
|
|
180
|
-
};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { HTMLProps, ReactNode } from "react";
|
|
2
|
-
import type { ClassName, PropsWithSpread } from "../../types";
|
|
3
|
-
export type Props = PropsWithSpread<{
|
|
4
|
-
/**
|
|
5
|
-
* The content of the card.
|
|
6
|
-
*/
|
|
7
|
-
children?: ReactNode;
|
|
8
|
-
/**
|
|
9
|
-
* Optional class(es) to pass to the wrapping div element.
|
|
10
|
-
*/
|
|
11
|
-
className?: ClassName;
|
|
12
|
-
/**
|
|
13
|
-
* Whether the card should have highlighted styling.
|
|
14
|
-
*/
|
|
15
|
-
highlighted?: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Whether the card should have overlay styling.
|
|
18
|
-
*/
|
|
19
|
-
overlay?: boolean;
|
|
20
|
-
/**
|
|
21
|
-
* The path to a thumbnail image.
|
|
22
|
-
*/
|
|
23
|
-
thumbnail?: string;
|
|
24
|
-
/**
|
|
25
|
-
* The title of the card.
|
|
26
|
-
*/
|
|
27
|
-
title?: ReactNode;
|
|
28
|
-
}, HTMLProps<HTMLDivElement>>;
|
|
29
|
-
/**
|
|
30
|
-
* This is a [React](https://reactjs.org/) component for the Vanilla [Card](https://docs.vanillaframework.io/patterns/card/).
|
|
31
|
-
*
|
|
32
|
-
* There are four card styles available to use in Vanilla: default, header, highlighted and overlay. Our card component will expand to fill the full width of its parent container.
|
|
33
|
-
*/
|
|
34
|
-
declare const Card: ({ children, className, highlighted, overlay, thumbnail, title, ...props }: Props) => JSX.Element;
|
|
35
|
-
export default Card;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import type { Meta } from "@storybook/react";
|
|
3
|
-
import Card from "./";
|
|
4
|
-
declare const meta: Meta<typeof Card>;
|
|
5
|
-
export default meta;
|
|
6
|
-
export declare const Default: {
|
|
7
|
-
args: {
|
|
8
|
-
title: string;
|
|
9
|
-
children: string;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
export declare const Header: {
|
|
13
|
-
args: {
|
|
14
|
-
title: string;
|
|
15
|
-
thumbnail: string;
|
|
16
|
-
children: string;
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
export declare const Highlighted: {
|
|
20
|
-
args: {
|
|
21
|
-
highlighted: boolean;
|
|
22
|
-
title: string;
|
|
23
|
-
children: string;
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
export declare const Overlay: {
|
|
27
|
-
args: {
|
|
28
|
-
title: string;
|
|
29
|
-
overlay: boolean;
|
|
30
|
-
children: string;
|
|
31
|
-
};
|
|
32
|
-
render: (args: any) => React.JSX.Element;
|
|
33
|
-
};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = exports.Overlay = exports.Highlighted = exports.Header = exports.Default = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _ = _interopRequireDefault(require("./"));
|
|
9
|
-
var _Col = _interopRequireDefault(require("../Col"));
|
|
10
|
-
var _Row = _interopRequireDefault(require("../Row"));
|
|
11
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
-
const meta = {
|
|
13
|
-
component: _.default,
|
|
14
|
-
tags: ["autodocs"]
|
|
15
|
-
};
|
|
16
|
-
var _default = exports.default = meta;
|
|
17
|
-
const Default = exports.Default = {
|
|
18
|
-
args: {
|
|
19
|
-
title: "We'd love to have you join us as a partner.",
|
|
20
|
-
children: "If you are an independent software vendor or bundle author, it's easy to apply. You can find out more below."
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
const Header = exports.Header = {
|
|
24
|
-
args: {
|
|
25
|
-
title: "Raspberry Pi2 and Pi3",
|
|
26
|
-
thumbnail: "https://assets.ubuntu.com/v1/dca2e4c4-raspberry-logo.png",
|
|
27
|
-
children: "For fun, for education and for profit, the RPi makes device development personal and entertaining. With support for both the Pi2 and the new Pi3, Ubuntu Core supports the world’s most beloved board."
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
const Highlighted = exports.Highlighted = {
|
|
31
|
-
args: {
|
|
32
|
-
...Default.args,
|
|
33
|
-
highlighted: true
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
const Overlay = exports.Overlay = {
|
|
37
|
-
args: {
|
|
38
|
-
title: "Web browsing",
|
|
39
|
-
overlay: true,
|
|
40
|
-
children: "Renowned for speed and security, Ubuntu and Firefox make browsing\nthe web a pleasure again. Ubuntu also includes Chrome, Opera and\nother browsers that can be installed from the Ubuntu Software\nCentre."
|
|
41
|
-
},
|
|
42
|
-
render: args => /*#__PURE__*/_react.default.createElement("section", {
|
|
43
|
-
className: "p-strip--image is-light",
|
|
44
|
-
style: {
|
|
45
|
-
backgroundImage: "url('https://assets.ubuntu.com/v1/0a98afcd-screenshot_desktop.jpg')"
|
|
46
|
-
}
|
|
47
|
-
}, /*#__PURE__*/_react.default.createElement(_Row.default, null, /*#__PURE__*/_react.default.createElement(_Col.default, {
|
|
48
|
-
size: 6,
|
|
49
|
-
emptyLarge: 7
|
|
50
|
-
}, /*#__PURE__*/_react.default.createElement(_.default, args))))
|
|
51
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { HTMLProps } from "react";
|
|
2
|
-
import type { ReactNode } from "react";
|
|
3
|
-
import type { PropsWithSpread } from "../../../types";
|
|
4
|
-
export type Props = PropsWithSpread<{
|
|
5
|
-
/**
|
|
6
|
-
* The type of the input element.
|
|
7
|
-
*/
|
|
8
|
-
inputType: "radio" | "checkbox";
|
|
9
|
-
/**
|
|
10
|
-
* The label for the input element.
|
|
11
|
-
*/
|
|
12
|
-
label: ReactNode;
|
|
13
|
-
/**
|
|
14
|
-
* Optional class(es) to pass to the label element.
|
|
15
|
-
*/
|
|
16
|
-
labelClassName?: string;
|
|
17
|
-
/**
|
|
18
|
-
* Whether the input element should display in indeterminate state.
|
|
19
|
-
*/
|
|
20
|
-
indeterminate?: boolean;
|
|
21
|
-
/**
|
|
22
|
-
* Ensures the input and the label text are properly aligned with other inline text.
|
|
23
|
-
*/
|
|
24
|
-
inline?: boolean;
|
|
25
|
-
}, Omit<HTMLProps<HTMLInputElement>, "type">>;
|
|
26
|
-
declare const CheckableInput: ({ inputType, label, labelClassName, indeterminate, inline, ...checkboxProps }: Props) => JSX.Element;
|
|
27
|
-
export default CheckableInput;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { CheckableInputProps } from "./CheckableInput";
|
|
2
|
-
export type Props = Omit<CheckableInputProps, "inputType">;
|
|
3
|
-
/**
|
|
4
|
-
* This is a [React](https://reactjs.org/) component for the Vanilla [Checkbox input](https://docs.vanillaframework.io/base/forms#checkbox).
|
|
5
|
-
*
|
|
6
|
-
* Use the checkbox component to select one or more options.
|
|
7
|
-
*/
|
|
8
|
-
declare const CheckboxInput: ({ label, indeterminate, ...checkboxProps }: Props) => JSX.Element;
|
|
9
|
-
export default CheckboxInput;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import CheckboxInput from "./CheckboxInput";
|
|
3
|
-
declare const meta: Meta<typeof CheckboxInput>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof CheckboxInput>;
|
|
6
|
-
export declare const Default: Story;
|
|
7
|
-
export declare const Children: Story;
|
|
8
|
-
export declare const Disabled: Story;
|
|
9
|
-
export declare const Required: Story;
|
|
10
|
-
export declare const Inline: Story;
|
|
11
|
-
export declare const Indeterminate: Story;
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = exports.Required = exports.Inline = exports.Indeterminate = exports.Disabled = exports.Default = exports.Children = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _CheckboxInput = _interopRequireDefault(require("./CheckboxInput"));
|
|
9
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
-
const meta = {
|
|
11
|
-
component: _CheckboxInput.default,
|
|
12
|
-
tags: ["autodocs"],
|
|
13
|
-
argTypes: {
|
|
14
|
-
label: {
|
|
15
|
-
control: {
|
|
16
|
-
type: "text"
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
disabled: {
|
|
20
|
-
control: {
|
|
21
|
-
type: "boolean"
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
required: {
|
|
25
|
-
control: {
|
|
26
|
-
type: "boolean"
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
inline: {
|
|
30
|
-
control: {
|
|
31
|
-
type: "boolean"
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
indeterminate: {
|
|
35
|
-
control: {
|
|
36
|
-
type: "boolean"
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
args: {
|
|
41
|
-
label: "CheckboxInput"
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
var _default = exports.default = meta;
|
|
45
|
-
const Default = exports.Default = {
|
|
46
|
-
name: "Default"
|
|
47
|
-
};
|
|
48
|
-
const Children = exports.Children = {
|
|
49
|
-
render: () => /*#__PURE__*/_react.default.createElement(_CheckboxInput.default, {
|
|
50
|
-
label: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "I agree to", /*#__PURE__*/_react.default.createElement("a", {
|
|
51
|
-
href: "http://ubuntu.com/legal"
|
|
52
|
-
}, "Terms and Conditions")),
|
|
53
|
-
name: "CheckboxInput"
|
|
54
|
-
}),
|
|
55
|
-
name: "Label with child elements"
|
|
56
|
-
};
|
|
57
|
-
const Disabled = exports.Disabled = {
|
|
58
|
-
render: () => /*#__PURE__*/_react.default.createElement(_CheckboxInput.default, {
|
|
59
|
-
label: "Disabled",
|
|
60
|
-
disabled: true
|
|
61
|
-
}),
|
|
62
|
-
name: "Disabled"
|
|
63
|
-
};
|
|
64
|
-
const Required = exports.Required = {
|
|
65
|
-
render: () => /*#__PURE__*/_react.default.createElement(_CheckboxInput.default, {
|
|
66
|
-
label: "Required",
|
|
67
|
-
required: true
|
|
68
|
-
}),
|
|
69
|
-
name: "Required"
|
|
70
|
-
};
|
|
71
|
-
const Inline = exports.Inline = {
|
|
72
|
-
render: () => /*#__PURE__*/_react.default.createElement(_CheckboxInput.default, {
|
|
73
|
-
label: "Inline",
|
|
74
|
-
inline: true
|
|
75
|
-
}),
|
|
76
|
-
name: "Inline"
|
|
77
|
-
};
|
|
78
|
-
const Indeterminate = exports.Indeterminate = {
|
|
79
|
-
render: () => /*#__PURE__*/_react.default.createElement(_CheckboxInput.default, {
|
|
80
|
-
label: "Indeterminate",
|
|
81
|
-
indeterminate: true
|
|
82
|
-
}),
|
|
83
|
-
name: "Indeterminate"
|
|
84
|
-
};
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import type { MouseEvent, HTMLProps } from "react";
|
|
2
|
-
import { ValueOf, PropsWithSpread } from "../../types";
|
|
3
|
-
export declare enum Label {
|
|
4
|
-
Dismiss = "Dismiss"
|
|
5
|
-
}
|
|
6
|
-
export declare const ChipType: {
|
|
7
|
-
readonly CAUTION: "caution";
|
|
8
|
-
readonly INFORMATION: "information";
|
|
9
|
-
readonly NEGATIVE: "negative";
|
|
10
|
-
readonly POSITIVE: "positive";
|
|
11
|
-
};
|
|
12
|
-
export type Props = PropsWithSpread<{
|
|
13
|
-
/**
|
|
14
|
-
* The appearance of the chip.
|
|
15
|
-
*/
|
|
16
|
-
appearance?: ValueOf<typeof ChipType>;
|
|
17
|
-
/**
|
|
18
|
-
* The lead for the chip.
|
|
19
|
-
*/
|
|
20
|
-
lead?: string;
|
|
21
|
-
/**
|
|
22
|
-
* Function for handling chip div click event.
|
|
23
|
-
*/
|
|
24
|
-
onClick?: (event: MouseEvent<HTMLButtonElement> | {
|
|
25
|
-
lead: string;
|
|
26
|
-
value: string;
|
|
27
|
-
}) => void;
|
|
28
|
-
/**
|
|
29
|
-
* Function for handling dismissing a chip.
|
|
30
|
-
*/
|
|
31
|
-
onDismiss?: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
32
|
-
/**
|
|
33
|
-
* Whether the chip is selected.
|
|
34
|
-
*/
|
|
35
|
-
selected?: boolean;
|
|
36
|
-
/**
|
|
37
|
-
* A substring to emphasise if it is part of the chip's value,
|
|
38
|
-
* e.g. "sit" => poSITive
|
|
39
|
-
*/
|
|
40
|
-
subString?: string;
|
|
41
|
-
/**
|
|
42
|
-
* Whether to wrap the value in quotation marks.
|
|
43
|
-
*/
|
|
44
|
-
quoteValue?: boolean;
|
|
45
|
-
/**
|
|
46
|
-
* The value of the chip.
|
|
47
|
-
*/
|
|
48
|
-
value: string;
|
|
49
|
-
}, HTMLProps<HTMLButtonElement>>;
|
|
50
|
-
/**
|
|
51
|
-
* This is a [React](https://reactjs.org/) component for the Vanilla [Chip](https://vanillaframework.io/docs/patterns/chip).
|
|
52
|
-
*
|
|
53
|
-
* It can be used to display a small value attached to a component.
|
|
54
|
-
*/
|
|
55
|
-
declare const Chip: ({ appearance, lead, onClick, onDismiss, quoteValue, selected, subString, value, ...props }: Props) => JSX.Element;
|
|
56
|
-
export default Chip;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import Chip from "./Chip";
|
|
3
|
-
declare const meta: Meta<typeof Chip>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof Chip>;
|
|
6
|
-
export declare const Default: Story;
|
|
7
|
-
export declare const LeadValue: Story;
|
|
8
|
-
export declare const Appearance: Story;
|
|
9
|
-
export declare const Dismissible: Story;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = exports.LeadValue = exports.Dismissible = exports.Default = exports.Appearance = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _Chip = _interopRequireDefault(require("./Chip"));
|
|
9
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
-
const meta = {
|
|
11
|
-
component: _Chip.default,
|
|
12
|
-
tags: ["autodocs"]
|
|
13
|
-
};
|
|
14
|
-
var _default = exports.default = meta;
|
|
15
|
-
const Default = exports.Default = {
|
|
16
|
-
name: "Default",
|
|
17
|
-
args: {
|
|
18
|
-
value: "Default"
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
const LeadValue = exports.LeadValue = {
|
|
22
|
-
render: () => /*#__PURE__*/_react.default.createElement(_Chip.default, {
|
|
23
|
-
lead: "Owner",
|
|
24
|
-
value: "Bob"
|
|
25
|
-
}),
|
|
26
|
-
name: "Lead-value"
|
|
27
|
-
};
|
|
28
|
-
const Appearance = exports.Appearance = {
|
|
29
|
-
render: () => /*#__PURE__*/_react.default.createElement(_Chip.default, {
|
|
30
|
-
lead: "Type",
|
|
31
|
-
value: "Positive",
|
|
32
|
-
appearance: "positive"
|
|
33
|
-
}),
|
|
34
|
-
name: "Appearance"
|
|
35
|
-
};
|
|
36
|
-
const Dismissible = exports.Dismissible = {
|
|
37
|
-
render: () => /*#__PURE__*/_react.default.createElement(_Chip.default, {
|
|
38
|
-
lead: "Owner",
|
|
39
|
-
value: "Bob",
|
|
40
|
-
onDismiss: () => {
|
|
41
|
-
console.log("onDismiss called");
|
|
42
|
-
}
|
|
43
|
-
}),
|
|
44
|
-
name: "Dismissible"
|
|
45
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { ClassName } from "../../types";
|
|
2
|
-
export type Props = {
|
|
3
|
-
children: string;
|
|
4
|
-
className?: ClassName;
|
|
5
|
-
inline?: boolean;
|
|
6
|
-
copyable?: boolean;
|
|
7
|
-
numbered?: boolean;
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* @deprecated Code component is deprecated. Use CodeSnippet component or inline `<code>` instead.
|
|
11
|
-
*/
|
|
12
|
-
declare const Code: ({ children, className, inline, copyable, numbered, ...props }: Props) => JSX.Element;
|
|
13
|
-
export default Code;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { HTMLProps } from "react";
|
|
2
|
-
import type { Props as CodeSnippetBlockProps } from "./CodeSnippetBlock";
|
|
3
|
-
import type { ClassName, PropsWithSpread } from "../../types";
|
|
4
|
-
export type Props = PropsWithSpread<{
|
|
5
|
-
/**
|
|
6
|
-
* Optional class(es) to pass to the wrapping div element.
|
|
7
|
-
*/
|
|
8
|
-
className?: ClassName;
|
|
9
|
-
/**
|
|
10
|
-
* A list of code blocks to display.
|
|
11
|
-
*/
|
|
12
|
-
blocks: CodeSnippetBlockProps[];
|
|
13
|
-
}, HTMLProps<HTMLDivElement>>;
|
|
14
|
-
/**
|
|
15
|
-
* This is a [React](https://reactjs.org/) component for the Vanilla [Code snippet](https://docs.vanillaframework.io/base/code#code-snippet).
|
|
16
|
-
*
|
|
17
|
-
* #### Blocks
|
|
18
|
-
*
|
|
19
|
-
* A single `CodeSnippet` component can render multiple separate code blocks. Blocks are provided as an array via the `blocks` prop. Each block object defines values of props for each code block of the snippet.
|
|
20
|
-
*/
|
|
21
|
-
export default function CodeSnippet({ className, blocks, ...props }: Props): JSX.Element;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import CodeSnippet from "./CodeSnippet";
|
|
3
|
-
declare const meta: Meta<typeof CodeSnippet>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof CodeSnippet>;
|
|
6
|
-
export declare const Default: Story;
|
|
7
|
-
/**
|
|
8
|
-
* Use the `title` prop to add a title to a code block.
|
|
9
|
-
*/
|
|
10
|
-
export declare const Title: Story;
|
|
11
|
-
/**
|
|
12
|
-
* Pass an array of `blocks` to render multiple code blocks (for example input and output) within a single code snippet.
|
|
13
|
-
*/
|
|
14
|
-
export declare const MultipleBlocks: Story;
|
|
15
|
-
/**
|
|
16
|
-
* Use `appearance` to control the visual aspects of the code block. `"numbered"` appearance will add line numbers in the code blocks.
|
|
17
|
-
* Values of `"linuxPrompt"`, `"windowsPrompt"`, `"url"` will add a relevant icon in the code block.
|
|
18
|
-
*/
|
|
19
|
-
export declare const Appearance: Story;
|
|
20
|
-
/**
|
|
21
|
-
* Set `wrapLines` prop to `true` to enable line wrapping inside the code block.
|
|
22
|
-
*/
|
|
23
|
-
export declare const WrapLines: Story;
|
|
24
|
-
/**
|
|
25
|
-
* 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.
|
|
26
|
-
*
|
|
27
|
-
* With the `options` being an array of option properties compatible with the `Select` options (`[{ label: string, value: string | number }]`).
|
|
28
|
-
*/
|
|
29
|
-
export declare const Dropdown: Story;
|
|
30
|
-
/**
|
|
31
|
-
* Multiple dropdowns can be passed in if needed.
|
|
32
|
-
*/
|
|
33
|
-
export declare const Dropdowns: Story;
|
|
34
|
-
/**
|
|
35
|
-
* If multiple dropdowns may overlap with long title you can use `stacked` variant, by setting the relevant property on code block options.
|
|
36
|
-
*/
|
|
37
|
-
export declare const DropdownsStacked: Story;
|
|
38
|
-
/**
|
|
39
|
-
* 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.
|
|
40
|
-
*/
|
|
41
|
-
export declare const Content: Story;
|
|
42
|
-
/**
|
|
43
|
-
* 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).
|
|
44
|
-
*/
|
|
45
|
-
export declare const JsxCodeElements: Story;
|