@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
|
@@ -54,6 +54,11 @@ export type Props = PropsWithSpread<{
|
|
|
54
54
|
*/
|
|
55
55
|
wrapperClassName?: string;
|
|
56
56
|
}, InputHTMLAttributes<HTMLInputElement>>;
|
|
57
|
+
/**
|
|
58
|
+
* This is a [React](https://reactjs.org/) component for the Vanilla [Password Toggle](https://docs.vanillaframework.io/base/forms/#password-toggle).
|
|
59
|
+
*
|
|
60
|
+
* It can be used when an input needs to obscure its value, whilst giving the user a way to reveal it if needed.
|
|
61
|
+
*/
|
|
57
62
|
declare const PasswordToggle: React.ForwardRefExoticComponent<{
|
|
58
63
|
/**
|
|
59
64
|
* The content for caution validation.
|
|
@@ -21,6 +21,11 @@ let Label = exports.Label = /*#__PURE__*/function (Label) {
|
|
|
21
21
|
/**
|
|
22
22
|
* The props for the Password Toggle component.
|
|
23
23
|
*/
|
|
24
|
+
/**
|
|
25
|
+
* This is a [React](https://reactjs.org/) component for the Vanilla [Password Toggle](https://docs.vanillaframework.io/base/forms/#password-toggle).
|
|
26
|
+
*
|
|
27
|
+
* It can be used when an input needs to obscure its value, whilst giving the user a way to reveal it if needed.
|
|
28
|
+
*/
|
|
24
29
|
const PasswordToggle = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
25
30
|
let {
|
|
26
31
|
caution,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import PasswordToggle from "./PasswordToggle";
|
|
3
|
+
declare const meta: Meta<typeof PasswordToggle>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof PasswordToggle>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const ReadOnly: Story;
|
|
8
|
+
export declare const Error: Story;
|
|
9
|
+
export declare const Success: Story;
|
|
10
|
+
export declare const Caution: Story;
|
|
11
|
+
export declare const Help: Story;
|
|
12
|
+
export declare const Disabled: Story;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.Success = exports.ReadOnly = exports.Help = exports.Error = exports.Disabled = exports.Default = exports.Caution = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _PasswordToggle = _interopRequireDefault(require("./PasswordToggle"));
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
const meta = {
|
|
11
|
+
component: _PasswordToggle.default,
|
|
12
|
+
tags: ["autodocs"]
|
|
13
|
+
};
|
|
14
|
+
var _default = exports.default = meta;
|
|
15
|
+
const Default = exports.Default = {
|
|
16
|
+
render: () => /*#__PURE__*/_react.default.createElement(_PasswordToggle.default, {
|
|
17
|
+
id: "examplePassword1",
|
|
18
|
+
label: "Password"
|
|
19
|
+
}),
|
|
20
|
+
name: "Default"
|
|
21
|
+
};
|
|
22
|
+
const ReadOnly = exports.ReadOnly = {
|
|
23
|
+
render: () => /*#__PURE__*/_react.default.createElement(_PasswordToggle.default, {
|
|
24
|
+
id: "examplePassword2",
|
|
25
|
+
label: "Password",
|
|
26
|
+
readOnly: true,
|
|
27
|
+
defaultValue: "password"
|
|
28
|
+
}),
|
|
29
|
+
name: "Read only"
|
|
30
|
+
};
|
|
31
|
+
const Error = exports.Error = {
|
|
32
|
+
render: () => /*#__PURE__*/_react.default.createElement(_PasswordToggle.default, {
|
|
33
|
+
error: "This field is required.",
|
|
34
|
+
id: "examplePassword3",
|
|
35
|
+
label: "Password",
|
|
36
|
+
defaultValue: "password"
|
|
37
|
+
}),
|
|
38
|
+
name: "Error"
|
|
39
|
+
};
|
|
40
|
+
const Success = exports.Success = {
|
|
41
|
+
render: () => /*#__PURE__*/_react.default.createElement(_PasswordToggle.default, {
|
|
42
|
+
success: "Strong password",
|
|
43
|
+
id: "examplePassword4",
|
|
44
|
+
label: "Password",
|
|
45
|
+
defaultValue: "password"
|
|
46
|
+
}),
|
|
47
|
+
name: "Success"
|
|
48
|
+
};
|
|
49
|
+
const Caution = exports.Caution = {
|
|
50
|
+
render: () => /*#__PURE__*/_react.default.createElement(_PasswordToggle.default, {
|
|
51
|
+
caution: "Weak password",
|
|
52
|
+
id: "examplePassword5",
|
|
53
|
+
label: "Password",
|
|
54
|
+
defaultValue: "password"
|
|
55
|
+
}),
|
|
56
|
+
name: "Caution"
|
|
57
|
+
};
|
|
58
|
+
const Help = exports.Help = {
|
|
59
|
+
render: () => /*#__PURE__*/_react.default.createElement(_PasswordToggle.default, {
|
|
60
|
+
help: "Enter a secure password",
|
|
61
|
+
id: "examplePassword6",
|
|
62
|
+
label: "Password"
|
|
63
|
+
}),
|
|
64
|
+
name: "Help"
|
|
65
|
+
};
|
|
66
|
+
const Disabled = exports.Disabled = {
|
|
67
|
+
render: () => /*#__PURE__*/_react.default.createElement(_PasswordToggle.default, {
|
|
68
|
+
disabled: true,
|
|
69
|
+
id: "examplePassword7",
|
|
70
|
+
label: "Password",
|
|
71
|
+
defaultValue: "password"
|
|
72
|
+
}),
|
|
73
|
+
name: "Disabled"
|
|
74
|
+
};
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import type { CheckableInputProps } from "../CheckboxInput/CheckableInput";
|
|
2
2
|
export type Props = Omit<CheckableInputProps, "inputType">;
|
|
3
|
+
/**
|
|
4
|
+
* This is a [React](https://reactjs.org/) component for the Vanilla [Radio input](https://docs.vanillaframework.io/base/forms#radio-button).
|
|
5
|
+
*
|
|
6
|
+
* Use radio buttons to select one of the given set of options.
|
|
7
|
+
*/
|
|
3
8
|
declare const RadioInput: ({ label, ...radioProps }: Props) => JSX.Element;
|
|
4
9
|
export default RadioInput;
|
|
@@ -8,6 +8,11 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
8
8
|
var _CheckableInput = _interopRequireDefault(require("../CheckboxInput/CheckableInput"));
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
10
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
11
|
+
/**
|
|
12
|
+
* This is a [React](https://reactjs.org/) component for the Vanilla [Radio input](https://docs.vanillaframework.io/base/forms#radio-button).
|
|
13
|
+
*
|
|
14
|
+
* Use radio buttons to select one of the given set of options.
|
|
15
|
+
*/
|
|
11
16
|
const RadioInput = _ref => {
|
|
12
17
|
let {
|
|
13
18
|
label,
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import RadioInput from "./RadioInput";
|
|
3
|
+
declare const meta: Meta<typeof RadioInput>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof RadioInput>;
|
|
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;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.Required = exports.Inline = exports.Disabled = exports.Default = exports.Children = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _RadioInput = _interopRequireDefault(require("./RadioInput"));
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
const meta = {
|
|
11
|
+
component: _RadioInput.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: "RadioInput"
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
var _default = exports.default = meta;
|
|
45
|
+
const Default = exports.Default = {
|
|
46
|
+
render: () => /*#__PURE__*/_react.default.createElement(_RadioInput.default, {
|
|
47
|
+
label: "RadioInput"
|
|
48
|
+
}),
|
|
49
|
+
name: "Default"
|
|
50
|
+
};
|
|
51
|
+
const Children = exports.Children = {
|
|
52
|
+
render: () => /*#__PURE__*/_react.default.createElement(_RadioInput.default, {
|
|
53
|
+
label: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "I agree to", /*#__PURE__*/_react.default.createElement("a", {
|
|
54
|
+
href: "http://ubuntu.com/legal"
|
|
55
|
+
}, "Terms and Conditions")),
|
|
56
|
+
name: "RadioInput"
|
|
57
|
+
}),
|
|
58
|
+
name: "Children"
|
|
59
|
+
};
|
|
60
|
+
const Disabled = exports.Disabled = {
|
|
61
|
+
render: () => /*#__PURE__*/_react.default.createElement(_RadioInput.default, {
|
|
62
|
+
label: "Disabled",
|
|
63
|
+
name: "RadioInput",
|
|
64
|
+
disabled: true
|
|
65
|
+
}),
|
|
66
|
+
name: "Disabled"
|
|
67
|
+
};
|
|
68
|
+
const Required = exports.Required = {
|
|
69
|
+
render: () => /*#__PURE__*/_react.default.createElement(_RadioInput.default, {
|
|
70
|
+
label: "Required",
|
|
71
|
+
name: "RadioInput",
|
|
72
|
+
required: true
|
|
73
|
+
}),
|
|
74
|
+
name: "Required"
|
|
75
|
+
};
|
|
76
|
+
const Inline = exports.Inline = {
|
|
77
|
+
render: () => /*#__PURE__*/_react.default.createElement(_RadioInput.default, {
|
|
78
|
+
label: "Inline",
|
|
79
|
+
name: "RadioInput",
|
|
80
|
+
inline: true
|
|
81
|
+
}),
|
|
82
|
+
name: "Inline"
|
|
83
|
+
};
|
|
@@ -10,5 +10,10 @@ export type Props = PropsWithSpread<{
|
|
|
10
10
|
*/
|
|
11
11
|
className?: ClassName;
|
|
12
12
|
}, HTMLProps<HTMLDivElement>>;
|
|
13
|
+
/**
|
|
14
|
+
* This is a [React](https://reactjs.org/) component for use within the Vanilla [Grid](https://docs.vanillaframework.io/patterns/grid/).
|
|
15
|
+
*
|
|
16
|
+
* Vanilla has a responsive grid using a combination of rows and columns.
|
|
17
|
+
*/
|
|
13
18
|
declare const Row: ({ children, className, ...props }: Props) => JSX.Element;
|
|
14
19
|
export default Row;
|
|
@@ -8,6 +8,11 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
10
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
11
|
+
/**
|
|
12
|
+
* This is a [React](https://reactjs.org/) component for use within the Vanilla [Grid](https://docs.vanillaframework.io/patterns/grid/).
|
|
13
|
+
*
|
|
14
|
+
* Vanilla has a responsive grid using a combination of rows and columns.
|
|
15
|
+
*/
|
|
11
16
|
const Row = _ref => {
|
|
12
17
|
let {
|
|
13
18
|
children,
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import Row from "./Row";
|
|
3
|
+
declare const meta: Meta<typeof Row>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Row>;
|
|
6
|
+
/**
|
|
7
|
+
* See [Col](?path=/docs/components-col--docs) for grid details.
|
|
8
|
+
*/
|
|
9
|
+
export declare const Default: Story;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.Default = void 0;
|
|
7
|
+
var _Row = _interopRequireDefault(require("./Row"));
|
|
8
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
+
const meta = {
|
|
10
|
+
component: _Row.default,
|
|
11
|
+
tags: ["autodocs"],
|
|
12
|
+
argTypes: {
|
|
13
|
+
children: {
|
|
14
|
+
control: {
|
|
15
|
+
type: "text"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
var _default = exports.default = meta;
|
|
21
|
+
/**
|
|
22
|
+
* See [Col](?path=/docs/components-col--docs) for grid details.
|
|
23
|
+
*/
|
|
24
|
+
const Default = exports.Default = {
|
|
25
|
+
name: "Default",
|
|
26
|
+
args: {
|
|
27
|
+
children: "children..."
|
|
28
|
+
}
|
|
29
|
+
};
|
|
@@ -26,5 +26,8 @@ export type Props = {
|
|
|
26
26
|
*/
|
|
27
27
|
onExpandChange?: () => void;
|
|
28
28
|
};
|
|
29
|
+
/**
|
|
30
|
+
* This component allows searching and filtering of large datasets.
|
|
31
|
+
*/
|
|
29
32
|
declare const SearchAndFilter: ({ existingSearchData, filterPanelData, returnSearchData, onPanelToggle, onExpandChange, ...props }: Props) => JSX.Element;
|
|
30
33
|
export default SearchAndFilter;
|
|
@@ -20,6 +20,9 @@ let Label = exports.Label = /*#__PURE__*/function (Label) {
|
|
|
20
20
|
Label["SearchAndFilter"] = "Search and filter";
|
|
21
21
|
return Label;
|
|
22
22
|
}({});
|
|
23
|
+
/**
|
|
24
|
+
* This component allows searching and filtering of large datasets.
|
|
25
|
+
*/
|
|
23
26
|
const SearchAndFilter = _ref => {
|
|
24
27
|
let {
|
|
25
28
|
existingSearchData = [],
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import SearchAndFilter from "./SearchAndFilter";
|
|
3
|
+
declare const meta: Meta<typeof SearchAndFilter>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof SearchAndFilter>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const WithDataSet: Story;
|
|
8
|
+
export declare const WithExistingSearchData: Story;
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.WithExistingSearchData = exports.WithDataSet = exports.Default = void 0;
|
|
7
|
+
var _SearchAndFilter = _interopRequireDefault(require("./SearchAndFilter"));
|
|
8
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
+
const meta = {
|
|
10
|
+
component: _SearchAndFilter.default,
|
|
11
|
+
tags: ["autodocs"]
|
|
12
|
+
};
|
|
13
|
+
var _default = exports.default = meta;
|
|
14
|
+
const Default = exports.Default = {
|
|
15
|
+
name: "Default",
|
|
16
|
+
args: {
|
|
17
|
+
returnSearchData: () => {},
|
|
18
|
+
filterPanelData: [{
|
|
19
|
+
id: 0,
|
|
20
|
+
heading: "Cloud",
|
|
21
|
+
chips: [{
|
|
22
|
+
lead: "Cloud",
|
|
23
|
+
value: "Google"
|
|
24
|
+
}, {
|
|
25
|
+
lead: "Cloud",
|
|
26
|
+
value: "AWS"
|
|
27
|
+
}, {
|
|
28
|
+
lead: "Cloud",
|
|
29
|
+
value: "Azure"
|
|
30
|
+
}]
|
|
31
|
+
}, {
|
|
32
|
+
id: 1,
|
|
33
|
+
heading: "Region",
|
|
34
|
+
chips: [{
|
|
35
|
+
lead: "Region",
|
|
36
|
+
value: "us-east1"
|
|
37
|
+
}, {
|
|
38
|
+
lead: "Region",
|
|
39
|
+
value: "us-north2"
|
|
40
|
+
}, {
|
|
41
|
+
lead: "Region",
|
|
42
|
+
value: "us-south3"
|
|
43
|
+
}, {
|
|
44
|
+
lead: "Region",
|
|
45
|
+
value: "us-north4"
|
|
46
|
+
}, {
|
|
47
|
+
lead: "Region",
|
|
48
|
+
value: "us-east5"
|
|
49
|
+
}, {
|
|
50
|
+
lead: "Region",
|
|
51
|
+
value: "us-south6"
|
|
52
|
+
}, {
|
|
53
|
+
lead: "Region",
|
|
54
|
+
value: "us-east7"
|
|
55
|
+
}, {
|
|
56
|
+
lead: "Region",
|
|
57
|
+
value: "us-east8"
|
|
58
|
+
}, {
|
|
59
|
+
lead: "Region",
|
|
60
|
+
value: "us-east9"
|
|
61
|
+
}, {
|
|
62
|
+
lead: "Region",
|
|
63
|
+
value: "us-east10"
|
|
64
|
+
}]
|
|
65
|
+
}, {
|
|
66
|
+
id: 2,
|
|
67
|
+
heading: "Owner",
|
|
68
|
+
chips: [{
|
|
69
|
+
lead: "Owner",
|
|
70
|
+
value: "foo"
|
|
71
|
+
}, {
|
|
72
|
+
lead: "Owner",
|
|
73
|
+
value: "bar"
|
|
74
|
+
}, {
|
|
75
|
+
lead: "Owner",
|
|
76
|
+
value: "baz"
|
|
77
|
+
}]
|
|
78
|
+
}]
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
const WithDataSet = exports.WithDataSet = {
|
|
82
|
+
name: "With data set",
|
|
83
|
+
args: {
|
|
84
|
+
filterPanelData: [{
|
|
85
|
+
id: 0,
|
|
86
|
+
heading: "Cloud",
|
|
87
|
+
chips: [{
|
|
88
|
+
lead: "Cloud",
|
|
89
|
+
value: "Google"
|
|
90
|
+
}, {
|
|
91
|
+
lead: "Cloud",
|
|
92
|
+
value: "AWS"
|
|
93
|
+
}, {
|
|
94
|
+
lead: "Cloud",
|
|
95
|
+
value: "Azure"
|
|
96
|
+
}]
|
|
97
|
+
}, {
|
|
98
|
+
id: 1,
|
|
99
|
+
heading: "Region",
|
|
100
|
+
chips: [{
|
|
101
|
+
lead: "Region",
|
|
102
|
+
value: "us-east1"
|
|
103
|
+
}, {
|
|
104
|
+
lead: "Region",
|
|
105
|
+
value: "us-north2"
|
|
106
|
+
}, {
|
|
107
|
+
lead: "Region",
|
|
108
|
+
value: "us-south3"
|
|
109
|
+
}, {
|
|
110
|
+
lead: "Region",
|
|
111
|
+
value: "us-north4"
|
|
112
|
+
}, {
|
|
113
|
+
lead: "Region",
|
|
114
|
+
value: "us-east5"
|
|
115
|
+
}, {
|
|
116
|
+
lead: "Region",
|
|
117
|
+
value: "us-south6"
|
|
118
|
+
}, {
|
|
119
|
+
lead: "Region",
|
|
120
|
+
value: "us-east7"
|
|
121
|
+
}, {
|
|
122
|
+
lead: "Region",
|
|
123
|
+
value: "us-east8"
|
|
124
|
+
}, {
|
|
125
|
+
lead: "Region",
|
|
126
|
+
value: "us-east9"
|
|
127
|
+
}, {
|
|
128
|
+
lead: "Region",
|
|
129
|
+
value: "us-east10"
|
|
130
|
+
}]
|
|
131
|
+
}, {
|
|
132
|
+
id: 2,
|
|
133
|
+
heading: "Owner",
|
|
134
|
+
chips: [{
|
|
135
|
+
lead: "Owner",
|
|
136
|
+
value: "foo"
|
|
137
|
+
}, {
|
|
138
|
+
lead: "Owner",
|
|
139
|
+
value: "bar"
|
|
140
|
+
}, {
|
|
141
|
+
lead: "Owner",
|
|
142
|
+
value: "baz"
|
|
143
|
+
}]
|
|
144
|
+
}],
|
|
145
|
+
returnSearchData: () => {}
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
const WithExistingSearchData = exports.WithExistingSearchData = {
|
|
149
|
+
name: "With existing search data",
|
|
150
|
+
args: {
|
|
151
|
+
existingSearchData: [{
|
|
152
|
+
lead: "Cloud",
|
|
153
|
+
value: "Google"
|
|
154
|
+
}],
|
|
155
|
+
filterPanelData: [{
|
|
156
|
+
id: 0,
|
|
157
|
+
heading: "Cloud",
|
|
158
|
+
chips: [{
|
|
159
|
+
lead: "Cloud",
|
|
160
|
+
value: "Google"
|
|
161
|
+
}, {
|
|
162
|
+
lead: "Cloud",
|
|
163
|
+
value: "AWS"
|
|
164
|
+
}, {
|
|
165
|
+
lead: "Cloud",
|
|
166
|
+
value: "Azure"
|
|
167
|
+
}]
|
|
168
|
+
}, {
|
|
169
|
+
id: 1,
|
|
170
|
+
heading: "Region",
|
|
171
|
+
chips: [{
|
|
172
|
+
lead: "Region",
|
|
173
|
+
value: "us-east1"
|
|
174
|
+
}, {
|
|
175
|
+
lead: "Region",
|
|
176
|
+
value: "us-north2"
|
|
177
|
+
}, {
|
|
178
|
+
lead: "Region",
|
|
179
|
+
value: "us-south3"
|
|
180
|
+
}, {
|
|
181
|
+
lead: "Region",
|
|
182
|
+
value: "us-north4"
|
|
183
|
+
}, {
|
|
184
|
+
lead: "Region",
|
|
185
|
+
value: "us-east5"
|
|
186
|
+
}, {
|
|
187
|
+
lead: "Region",
|
|
188
|
+
value: "us-south6"
|
|
189
|
+
}, {
|
|
190
|
+
lead: "Region",
|
|
191
|
+
value: "us-east7"
|
|
192
|
+
}, {
|
|
193
|
+
lead: "Region",
|
|
194
|
+
value: "us-east8"
|
|
195
|
+
}, {
|
|
196
|
+
lead: "Region",
|
|
197
|
+
value: "us-east9"
|
|
198
|
+
}, {
|
|
199
|
+
lead: "Region",
|
|
200
|
+
value: "us-east10"
|
|
201
|
+
}]
|
|
202
|
+
}, {
|
|
203
|
+
id: 2,
|
|
204
|
+
heading: "Owner",
|
|
205
|
+
chips: [{
|
|
206
|
+
lead: "Owner",
|
|
207
|
+
value: "foo"
|
|
208
|
+
}, {
|
|
209
|
+
lead: "Owner",
|
|
210
|
+
value: "bar"
|
|
211
|
+
}, {
|
|
212
|
+
lead: "Owner",
|
|
213
|
+
value: "baz"
|
|
214
|
+
}]
|
|
215
|
+
}],
|
|
216
|
+
returnSearchData: () => {}
|
|
217
|
+
}
|
|
218
|
+
};
|
|
@@ -50,5 +50,10 @@ export type Props = PropsWithSpread<{
|
|
|
50
50
|
*/
|
|
51
51
|
value?: string;
|
|
52
52
|
}, HTMLProps<HTMLInputElement>>;
|
|
53
|
+
/**
|
|
54
|
+
* This is a [React](https://reactjs.org/) component for the Vanilla [SearchBox](https://docs.vanillaframework.io/patterns/search-box/).
|
|
55
|
+
*
|
|
56
|
+
* Search boxes enable search functionality on a page and are typically used in a navigation bar. SearchBox elements should be wrapped within a form element that handles its own submit action.
|
|
57
|
+
*/
|
|
53
58
|
declare const SearchBox: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
54
59
|
export default SearchBox;
|
|
@@ -16,6 +16,11 @@ let Label = exports.Label = /*#__PURE__*/function (Label) {
|
|
|
16
16
|
Label["Search"] = "Search";
|
|
17
17
|
return Label;
|
|
18
18
|
}({});
|
|
19
|
+
/**
|
|
20
|
+
* This is a [React](https://reactjs.org/) component for the Vanilla [SearchBox](https://docs.vanillaframework.io/patterns/search-box/).
|
|
21
|
+
*
|
|
22
|
+
* Search boxes enable search functionality on a page and are typically used in a navigation bar. SearchBox elements should be wrapped within a form element that handles its own submit action.
|
|
23
|
+
*/
|
|
19
24
|
const SearchBox = /*#__PURE__*/_react.default.forwardRef((_ref, forwardedRef) => {
|
|
20
25
|
let {
|
|
21
26
|
autocomplete = "on",
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import SearchBox from "./SearchBox";
|
|
3
|
+
declare const meta: Meta<typeof SearchBox>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof SearchBox>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const Disabled: Story;
|
|
8
|
+
/**
|
|
9
|
+
* If you wish to control the value of the input via external state you can set
|
|
10
|
+
the `externallyControlled` prop and provide an `onChange` method to update the
|
|
11
|
+
state and the `value` from state.
|
|
12
|
+
*/
|
|
13
|
+
export declare const ExternalState: Story;
|
|
14
|
+
export declare const Navigation: Story;
|