@canonical/react-components 0.59.0 → 0.60.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/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/ApplicationLayout.d.ts +3 -3
- package/dist/components/ApplicationLayout/ApplicationLayout.js +4 -4
- package/dist/components/ApplicationLayout/ApplicationLayout.stories.d.ts +5 -0
- package/dist/components/ApplicationLayout/ApplicationLayout.stories.js +16 -2
- 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 +13 -1
- 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 +16 -4
- package/dist/components/ConfirmationModal/ConfirmationModal.js +8 -3
- 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/package.json +14 -14
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.Navigation = exports.ExternalState = exports.Disabled = exports.Default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _SearchBox = _interopRequireDefault(require("./SearchBox"));
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
const meta = {
|
|
11
|
+
component: _SearchBox.default,
|
|
12
|
+
tags: ["autodocs"]
|
|
13
|
+
};
|
|
14
|
+
var _default = exports.default = meta;
|
|
15
|
+
const Default = exports.Default = {
|
|
16
|
+
name: "Default"
|
|
17
|
+
};
|
|
18
|
+
const Disabled = exports.Disabled = {
|
|
19
|
+
render: () => /*#__PURE__*/_react.default.createElement(_SearchBox.default, {
|
|
20
|
+
disabled: true
|
|
21
|
+
}),
|
|
22
|
+
name: "Disabled"
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* If you wish to control the value of the input via external state you can set
|
|
27
|
+
the `externallyControlled` prop and provide an `onChange` method to update the
|
|
28
|
+
state and the `value` from state.
|
|
29
|
+
*/
|
|
30
|
+
const ExternalState = exports.ExternalState = {
|
|
31
|
+
render: () => /*#__PURE__*/_react.default.createElement(_SearchBox.default, {
|
|
32
|
+
externallyControlled: true,
|
|
33
|
+
shouldRefocusAfterReset: true,
|
|
34
|
+
onChange: () => {},
|
|
35
|
+
value: "..."
|
|
36
|
+
}),
|
|
37
|
+
name: "External state"
|
|
38
|
+
};
|
|
39
|
+
const Navigation = exports.Navigation = {
|
|
40
|
+
render: () => /*#__PURE__*/_react.default.createElement("header", {
|
|
41
|
+
id: "navigation",
|
|
42
|
+
className: "p-navigation"
|
|
43
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
44
|
+
className: "p-navigation__row--full-width"
|
|
45
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
46
|
+
className: "p-navigation__banner"
|
|
47
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
48
|
+
className: "p-navigation__logo"
|
|
49
|
+
}, /*#__PURE__*/_react.default.createElement("a", {
|
|
50
|
+
className: "p-navigation__item",
|
|
51
|
+
href: "#test"
|
|
52
|
+
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
53
|
+
className: "p-navigation__image",
|
|
54
|
+
src: "https://assets.ubuntu.com/v1/5d6da5c4-logo-canonical-aubergine.svg",
|
|
55
|
+
alt: "",
|
|
56
|
+
width: "95"
|
|
57
|
+
}))), /*#__PURE__*/_react.default.createElement("a", {
|
|
58
|
+
href: "#navigation",
|
|
59
|
+
className: "p-navigation__toggle--open",
|
|
60
|
+
title: "menu"
|
|
61
|
+
}, "Menu"), /*#__PURE__*/_react.default.createElement("a", {
|
|
62
|
+
href: "#navigation-closed",
|
|
63
|
+
className: "p-navigation__toggle--close",
|
|
64
|
+
title: "close menu"
|
|
65
|
+
}, "Close menu")), /*#__PURE__*/_react.default.createElement("nav", {
|
|
66
|
+
className: "p-navigation__nav"
|
|
67
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
68
|
+
className: "u-off-screen"
|
|
69
|
+
}, /*#__PURE__*/_react.default.createElement("a", {
|
|
70
|
+
href: "#main-content"
|
|
71
|
+
}, "Jump to main content")), /*#__PURE__*/_react.default.createElement("ul", {
|
|
72
|
+
className: "p-navigation__items",
|
|
73
|
+
role: "menu"
|
|
74
|
+
}, /*#__PURE__*/_react.default.createElement("li", {
|
|
75
|
+
className: "p-navigation__item",
|
|
76
|
+
role: "menuitem"
|
|
77
|
+
}, /*#__PURE__*/_react.default.createElement("a", {
|
|
78
|
+
href: "#test",
|
|
79
|
+
className: "p-navigation__link"
|
|
80
|
+
}, "Products")), /*#__PURE__*/_react.default.createElement("li", {
|
|
81
|
+
className: "p-navigation__item",
|
|
82
|
+
role: "menuitem"
|
|
83
|
+
}, /*#__PURE__*/_react.default.createElement("a", {
|
|
84
|
+
href: "#test",
|
|
85
|
+
className: "p-navigation__link"
|
|
86
|
+
}, "Services")), /*#__PURE__*/_react.default.createElement("li", {
|
|
87
|
+
className: "p-navigation__item",
|
|
88
|
+
role: "menuitem"
|
|
89
|
+
}, /*#__PURE__*/_react.default.createElement("a", {
|
|
90
|
+
href: "#test",
|
|
91
|
+
className: "p-navigation__link"
|
|
92
|
+
}, "Partners")), /*#__PURE__*/_react.default.createElement("li", {
|
|
93
|
+
className: "p-navigation__item",
|
|
94
|
+
role: "menuitem"
|
|
95
|
+
}, /*#__PURE__*/_react.default.createElement("a", {
|
|
96
|
+
href: "#test",
|
|
97
|
+
className: "p-navigation__link"
|
|
98
|
+
}, "About")), /*#__PURE__*/_react.default.createElement("li", {
|
|
99
|
+
className: "p-navigation__item",
|
|
100
|
+
role: "menuitem"
|
|
101
|
+
}, /*#__PURE__*/_react.default.createElement("a", {
|
|
102
|
+
href: "#test",
|
|
103
|
+
className: "p-navigation__link"
|
|
104
|
+
}, "Partners"))), /*#__PURE__*/_react.default.createElement(_SearchBox.default, null)))),
|
|
105
|
+
name: "Navigation"
|
|
106
|
+
};
|
|
@@ -62,5 +62,10 @@ export type Props = PropsWithSpread<{
|
|
|
62
62
|
*/
|
|
63
63
|
wrapperClassName?: ClassName;
|
|
64
64
|
}, SelectHTMLAttributes<HTMLSelectElement>>;
|
|
65
|
+
/**
|
|
66
|
+
* This is a [React](https://reactjs.org/) component for the Vanilla [Select](https://docs.vanillaframework.io/base/forms/#select).
|
|
67
|
+
*
|
|
68
|
+
* Use the Select component to create a drop-down list.
|
|
69
|
+
*/
|
|
65
70
|
declare const Select: ({ caution, className, error, help, id, label, labelClassName, onChange, options, required, stacked, success, takeFocus, wrapperClassName, ...selectProps }: Props) => JSX.Element;
|
|
66
71
|
export default Select;
|
|
@@ -26,6 +26,12 @@ const generateOptions = options => options === null || options === void 0 ? void
|
|
|
26
26
|
key: "".concat(value) || label
|
|
27
27
|
}, props), label);
|
|
28
28
|
});
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* This is a [React](https://reactjs.org/) component for the Vanilla [Select](https://docs.vanillaframework.io/base/forms/#select).
|
|
32
|
+
*
|
|
33
|
+
* Use the Select component to create a drop-down list.
|
|
34
|
+
*/
|
|
29
35
|
const Select = _ref2 => {
|
|
30
36
|
let {
|
|
31
37
|
caution,
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import Select from "./Select";
|
|
3
|
+
declare const meta: Meta<typeof Select>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Select>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const SelectMultiple: Story;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.SelectMultiple = exports.Default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _Select = _interopRequireDefault(require("./Select"));
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
const meta = {
|
|
11
|
+
component: _Select.default,
|
|
12
|
+
tags: ["autodocs"],
|
|
13
|
+
argTypes: {
|
|
14
|
+
caution: {
|
|
15
|
+
control: {
|
|
16
|
+
type: "text"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
error: {
|
|
20
|
+
control: {
|
|
21
|
+
type: "text"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
help: {
|
|
25
|
+
control: {
|
|
26
|
+
type: "text"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
label: {
|
|
30
|
+
control: {
|
|
31
|
+
type: "text"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
success: {
|
|
35
|
+
control: {
|
|
36
|
+
type: "text"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
id: {
|
|
40
|
+
control: {
|
|
41
|
+
disable: true
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
options: {
|
|
45
|
+
control: {
|
|
46
|
+
disable: true
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
var _default = exports.default = meta;
|
|
52
|
+
const Default = exports.Default = {
|
|
53
|
+
name: "Select",
|
|
54
|
+
args: {
|
|
55
|
+
name: "exampleSelect",
|
|
56
|
+
id: "exampleSelect2",
|
|
57
|
+
defaultValue: "",
|
|
58
|
+
options: [{
|
|
59
|
+
value: "",
|
|
60
|
+
disabled: true,
|
|
61
|
+
label: "Select an option"
|
|
62
|
+
}, {
|
|
63
|
+
value: "1",
|
|
64
|
+
label: "Cosmic Cuttlefish"
|
|
65
|
+
}, {
|
|
66
|
+
value: "2",
|
|
67
|
+
label: "Bionic Beaver"
|
|
68
|
+
}, {
|
|
69
|
+
value: "3",
|
|
70
|
+
label: "Xenial Xerus"
|
|
71
|
+
}],
|
|
72
|
+
label: "Ubuntu releases"
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
const SelectMultiple = exports.SelectMultiple = {
|
|
76
|
+
render: () => /*#__PURE__*/_react.default.createElement(_Select.default, {
|
|
77
|
+
name: "exampleSelectMulti",
|
|
78
|
+
id: "exampleSelectMulti2",
|
|
79
|
+
options: [{
|
|
80
|
+
value: "",
|
|
81
|
+
disabled: true,
|
|
82
|
+
label: "Select..."
|
|
83
|
+
}, {
|
|
84
|
+
value: "1",
|
|
85
|
+
label: "Cosmic Cuttlefish"
|
|
86
|
+
}, {
|
|
87
|
+
value: "2",
|
|
88
|
+
label: "Bionic Beaver"
|
|
89
|
+
}, {
|
|
90
|
+
value: "3",
|
|
91
|
+
label: "Xenial Xerus"
|
|
92
|
+
}],
|
|
93
|
+
label: "Ubuntu releases",
|
|
94
|
+
multiple: true
|
|
95
|
+
}),
|
|
96
|
+
name: "Select multiple"
|
|
97
|
+
};
|
|
@@ -52,5 +52,11 @@ export type Props = PropsWithSpread<{
|
|
|
52
52
|
*/
|
|
53
53
|
showInput?: boolean;
|
|
54
54
|
}, HTMLProps<HTMLInputElement>>;
|
|
55
|
+
/**
|
|
56
|
+
* This is the [React](https://reactjs.org/) component for the Vanilla [Slider](https://vanillaframework.io/docs/patterns/slider).
|
|
57
|
+
*
|
|
58
|
+
* Sliders should be used to let a user specify a numeric value between a defined
|
|
59
|
+
minimum and maximum value, however the precise value is not especially important.
|
|
60
|
+
*/
|
|
55
61
|
export declare const Slider: ({ caution, disabled, error, help, id, inputDisabled, label, max, min, onChange, required, showInput, ...inputProps }: Props) => JSX.Element;
|
|
56
62
|
export default Slider;
|
|
@@ -12,6 +12,12 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
12
12
|
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); }
|
|
13
13
|
const FILLED_COLOR = exports.FILLED_COLOR = "#0066CC";
|
|
14
14
|
const EMPTY_COLOR = exports.EMPTY_COLOR = "#D9D9D9";
|
|
15
|
+
/**
|
|
16
|
+
* This is the [React](https://reactjs.org/) component for the Vanilla [Slider](https://vanillaframework.io/docs/patterns/slider).
|
|
17
|
+
*
|
|
18
|
+
* Sliders should be used to let a user specify a numeric value between a defined
|
|
19
|
+
minimum and maximum value, however the precise value is not especially important.
|
|
20
|
+
*/
|
|
15
21
|
const Slider = _ref => {
|
|
16
22
|
var _navigator;
|
|
17
23
|
let {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import Slider from "./Slider";
|
|
3
|
+
declare const meta: Meta<typeof Slider>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Slider>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
/**
|
|
8
|
+
* You can also optionally provide a numeric representation of the slider value.
|
|
9
|
+
*/
|
|
10
|
+
export declare const WithInput: Story;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.WithInput = exports.Default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _Slider = _interopRequireDefault(require("./Slider"));
|
|
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
|
+
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); }
|
|
13
|
+
const Template = args => {
|
|
14
|
+
const [selectedValue, setSelectedValue] = (0, _react.useState)(50);
|
|
15
|
+
return /*#__PURE__*/_react.default.createElement(_Slider.default, _extends({}, args, {
|
|
16
|
+
onChange: e => setSelectedValue(Number(e.target.value)),
|
|
17
|
+
value: selectedValue
|
|
18
|
+
}));
|
|
19
|
+
};
|
|
20
|
+
const meta = {
|
|
21
|
+
component: _Slider.default,
|
|
22
|
+
render: Template,
|
|
23
|
+
tags: ["autodocs"],
|
|
24
|
+
argTypes: {
|
|
25
|
+
caution: {
|
|
26
|
+
control: {
|
|
27
|
+
type: "text"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
error: {
|
|
31
|
+
control: {
|
|
32
|
+
type: "text"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
help: {
|
|
36
|
+
control: {
|
|
37
|
+
type: "text"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
label: {
|
|
41
|
+
control: {
|
|
42
|
+
type: "text"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
var _default = exports.default = meta;
|
|
48
|
+
const Default = exports.Default = {
|
|
49
|
+
render: Template.bind({}),
|
|
50
|
+
name: "Default",
|
|
51
|
+
args: {
|
|
52
|
+
disabled: false,
|
|
53
|
+
label: "Volume",
|
|
54
|
+
max: 100,
|
|
55
|
+
min: 0,
|
|
56
|
+
showInput: false
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* You can also optionally provide a numeric representation of the slider value.
|
|
62
|
+
*/
|
|
63
|
+
const WithInput = exports.WithInput = {
|
|
64
|
+
render: Template.bind({}),
|
|
65
|
+
name: "With input",
|
|
66
|
+
args: {
|
|
67
|
+
disabled: false,
|
|
68
|
+
inputDisabled: false,
|
|
69
|
+
label: "Volume",
|
|
70
|
+
max: 100,
|
|
71
|
+
min: 0,
|
|
72
|
+
showInput: true
|
|
73
|
+
}
|
|
74
|
+
};
|
|
@@ -22,5 +22,8 @@ export type Props = {
|
|
|
22
22
|
*/
|
|
23
23
|
ariaLive?: "assertive" | "off" | "polite";
|
|
24
24
|
} & HTMLProps<HTMLSpanElement>;
|
|
25
|
+
/**
|
|
26
|
+
* This is a [React](https://reactjs.org/) component for the Vanilla [Spin](https://docs.vanillaframework.io/settings/animation-settings/#spin) animation.
|
|
27
|
+
*/
|
|
25
28
|
declare const Spinner: ({ className, text, isLight, ariaLive, role, ...props }: Props) => JSX.Element;
|
|
26
29
|
export default Spinner;
|
|
@@ -9,6 +9,9 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
11
|
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); }
|
|
12
|
+
/**
|
|
13
|
+
* This is a [React](https://reactjs.org/) component for the Vanilla [Spin](https://docs.vanillaframework.io/settings/animation-settings/#spin) animation.
|
|
14
|
+
*/
|
|
12
15
|
const Spinner = _ref => {
|
|
13
16
|
let {
|
|
14
17
|
className,
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import Spinner from "./Spinner";
|
|
3
|
+
declare const meta: Meta<typeof Spinner>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Spinner>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const Text: Story;
|
|
8
|
+
export declare const Assertive: Story;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.Text = exports.Default = exports.Assertive = void 0;
|
|
7
|
+
var _Spinner = _interopRequireDefault(require("./Spinner"));
|
|
8
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
+
const meta = {
|
|
10
|
+
component: _Spinner.default,
|
|
11
|
+
tags: ["autodocs"]
|
|
12
|
+
};
|
|
13
|
+
var _default = exports.default = meta;
|
|
14
|
+
const Default = exports.Default = {
|
|
15
|
+
name: "Default"
|
|
16
|
+
};
|
|
17
|
+
const Text = exports.Text = {
|
|
18
|
+
name: "Text",
|
|
19
|
+
args: {
|
|
20
|
+
text: "Loading..."
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
const Assertive = exports.Assertive = {
|
|
24
|
+
name: "Assertive",
|
|
25
|
+
args: {
|
|
26
|
+
ariaLive: "assertive"
|
|
27
|
+
}
|
|
28
|
+
};
|
|
@@ -25,7 +25,9 @@ export type Props = PropsWithSpread<{
|
|
|
25
25
|
className?: ClassName;
|
|
26
26
|
}, HTMLProps<HTMLDivElement>>;
|
|
27
27
|
/**
|
|
28
|
-
*
|
|
28
|
+
* This is a [React](https://reactjs.org/) component for the Vanilla [Label](https://vanillaframework.io/docs/patterns/labels).
|
|
29
|
+
*
|
|
30
|
+
* Labels are static elements which you can apply to signify status, tags or any other information you find useful.
|
|
29
31
|
*/
|
|
30
32
|
declare const StatusLabel: ({ appearance, children, className, ...labelProps }: Props) => JSX.Element;
|
|
31
33
|
export default StatusLabel;
|
|
@@ -21,7 +21,9 @@ const StatusLabelAppearance = exports.StatusLabelAppearance = {
|
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
24
|
+
* This is a [React](https://reactjs.org/) component for the Vanilla [Label](https://vanillaframework.io/docs/patterns/labels).
|
|
25
|
+
*
|
|
26
|
+
* Labels are static elements which you can apply to signify status, tags or any other information you find useful.
|
|
25
27
|
*/
|
|
26
28
|
const StatusLabel = _ref => {
|
|
27
29
|
let {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import StatusLabel from "./StatusLabel";
|
|
3
|
+
declare const meta: Meta<typeof StatusLabel>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof StatusLabel>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const Positive: Story;
|
|
8
|
+
export declare const Caution: Story;
|
|
9
|
+
export declare const Negative: Story;
|
|
10
|
+
export declare const Information: Story;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.Positive = exports.Negative = exports.Information = exports.Default = exports.Caution = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _StatusLabel = _interopRequireWildcard(require("./StatusLabel"));
|
|
9
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
10
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && 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; }
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
const meta = {
|
|
13
|
+
component: _StatusLabel.default,
|
|
14
|
+
tags: ["autodocs"],
|
|
15
|
+
argTypes: {
|
|
16
|
+
children: {
|
|
17
|
+
control: {
|
|
18
|
+
type: "text"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
appearance: {
|
|
22
|
+
control: {
|
|
23
|
+
options: _StatusLabel.StatusLabelAppearance,
|
|
24
|
+
type: "select"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
args: {
|
|
29
|
+
children: "Label",
|
|
30
|
+
appearance: _StatusLabel.StatusLabelAppearance.POSITIVE
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
var _default = exports.default = meta;
|
|
34
|
+
const Default = exports.Default = {
|
|
35
|
+
render: () => /*#__PURE__*/_react.default.createElement(_StatusLabel.default, null, "Default"),
|
|
36
|
+
name: "Default"
|
|
37
|
+
};
|
|
38
|
+
const Positive = exports.Positive = {
|
|
39
|
+
render: () => /*#__PURE__*/_react.default.createElement(_StatusLabel.default, {
|
|
40
|
+
appearance: "positive"
|
|
41
|
+
}, "Positive"),
|
|
42
|
+
name: "Positive"
|
|
43
|
+
};
|
|
44
|
+
const Caution = exports.Caution = {
|
|
45
|
+
render: () => /*#__PURE__*/_react.default.createElement(_StatusLabel.default, {
|
|
46
|
+
appearance: "caution"
|
|
47
|
+
}, "Caution"),
|
|
48
|
+
name: "Caution"
|
|
49
|
+
};
|
|
50
|
+
const Negative = exports.Negative = {
|
|
51
|
+
render: () => /*#__PURE__*/_react.default.createElement(_StatusLabel.default, {
|
|
52
|
+
appearance: "negative"
|
|
53
|
+
}, "Negative"),
|
|
54
|
+
name: "Negative"
|
|
55
|
+
};
|
|
56
|
+
const Information = exports.Information = {
|
|
57
|
+
render: () => /*#__PURE__*/_react.default.createElement(_StatusLabel.default, {
|
|
58
|
+
appearance: "information"
|
|
59
|
+
}, "Information"),
|
|
60
|
+
name: "Information"
|
|
61
|
+
};
|
|
@@ -55,5 +55,10 @@ export type Props = PropsWithSpread<{
|
|
|
55
55
|
*/
|
|
56
56
|
type?: string;
|
|
57
57
|
}, HTMLProps<HTMLElement>>;
|
|
58
|
+
/**
|
|
59
|
+
* This is a [React](https://reactjs.org/) component for the Vanilla [Strip](https://docs.vanillaframework.io/patterns/strip/).
|
|
60
|
+
*
|
|
61
|
+
* The strip pattern provides a full width strip container in which to wrap a row.
|
|
62
|
+
*/
|
|
58
63
|
declare const Strip: ({ background, bordered, children, className, colSize, dark, deep, includeCol, element: Component, light, rowClassName, shallow, type, ...props }: Props) => JSX.Element;
|
|
59
64
|
export default Strip;
|
|
@@ -10,6 +10,11 @@ var _Col = _interopRequireDefault(require("../Col"));
|
|
|
10
10
|
var _Row = _interopRequireDefault(require("../Row"));
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
12
|
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); }
|
|
13
|
+
/**
|
|
14
|
+
* This is a [React](https://reactjs.org/) component for the Vanilla [Strip](https://docs.vanillaframework.io/patterns/strip/).
|
|
15
|
+
*
|
|
16
|
+
* The strip pattern provides a full width strip container in which to wrap a row.
|
|
17
|
+
*/
|
|
13
18
|
const Strip = _ref => {
|
|
14
19
|
let {
|
|
15
20
|
background,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import Strip from "./Strip";
|
|
3
|
+
declare const meta: Meta<typeof Strip>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Strip>;
|
|
6
|
+
export declare const LightStrip: Story;
|
|
7
|
+
export declare const DarkStrip: Story;
|
|
8
|
+
export declare const AccentStrip: Story;
|
|
9
|
+
export declare const ImageStrip: Story;
|
|
10
|
+
export declare const BorderedStrip: Story;
|
|
11
|
+
export declare const DeepStrip: Story;
|
|
12
|
+
export declare const ShallowStrip: Story;
|