@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,179 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.Validation = exports.Stacked = exports.Required = exports.Inline = exports.Fieldset = exports.Disabled = exports.Default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _Form = _interopRequireDefault(require("./Form"));
|
|
9
|
+
var _Input = _interopRequireDefault(require("../Input"));
|
|
10
|
+
var _Select = _interopRequireDefault(require("../Select"));
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
const meta = {
|
|
13
|
+
component: _Form.default,
|
|
14
|
+
tags: ["autodocs"],
|
|
15
|
+
argTypes: {
|
|
16
|
+
children: {
|
|
17
|
+
control: {
|
|
18
|
+
disable: true
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
var _default = exports.default = meta;
|
|
24
|
+
const Default = exports.Default = {
|
|
25
|
+
name: "Default",
|
|
26
|
+
args: {
|
|
27
|
+
children: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Input.default, {
|
|
28
|
+
type: "text",
|
|
29
|
+
id: "exampleInputEmail12",
|
|
30
|
+
placeholder: "example@canonical.com",
|
|
31
|
+
label: "Email address"
|
|
32
|
+
}), /*#__PURE__*/_react.default.createElement(_Input.default, {
|
|
33
|
+
type: "password",
|
|
34
|
+
id: "exampleInputPassword12",
|
|
35
|
+
placeholder: "******",
|
|
36
|
+
label: "Password"
|
|
37
|
+
}), /*#__PURE__*/_react.default.createElement(_Input.default, {
|
|
38
|
+
type: "file",
|
|
39
|
+
id: "exampleInputFile2",
|
|
40
|
+
label: "File input"
|
|
41
|
+
}), /*#__PURE__*/_react.default.createElement(_Input.default, {
|
|
42
|
+
type: "checkbox",
|
|
43
|
+
id: "CheckMe2",
|
|
44
|
+
label: "I agree to receive information about Canonical’s products and services."
|
|
45
|
+
}))
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
const Fieldset = exports.Fieldset = {
|
|
49
|
+
render: () => /*#__PURE__*/_react.default.createElement(_Form.default, null, /*#__PURE__*/_react.default.createElement("fieldset", null, /*#__PURE__*/_react.default.createElement(_Input.default, {
|
|
50
|
+
placeholder: "Joe",
|
|
51
|
+
id: "list-input-12",
|
|
52
|
+
type: "text",
|
|
53
|
+
label: "First name"
|
|
54
|
+
}), /*#__PURE__*/_react.default.createElement(_Input.default, {
|
|
55
|
+
placeholder: "Bloggs",
|
|
56
|
+
id: "list-input-22",
|
|
57
|
+
type: "text",
|
|
58
|
+
label: "Last name"
|
|
59
|
+
}), /*#__PURE__*/_react.default.createElement(_Input.default, {
|
|
60
|
+
placeholder: "example@canonical.com",
|
|
61
|
+
id: "list-input-32",
|
|
62
|
+
type: "text",
|
|
63
|
+
label: "Email address"
|
|
64
|
+
}))),
|
|
65
|
+
name: "Fieldset"
|
|
66
|
+
};
|
|
67
|
+
const Inline = exports.Inline = {
|
|
68
|
+
render: () => /*#__PURE__*/_react.default.createElement(_Form.default, {
|
|
69
|
+
inline: true
|
|
70
|
+
}, /*#__PURE__*/_react.default.createElement(_Input.default, {
|
|
71
|
+
type: "text",
|
|
72
|
+
id: "username-inline2",
|
|
73
|
+
className: "p-form__control",
|
|
74
|
+
label: "Username",
|
|
75
|
+
help: "30 characters or fewer."
|
|
76
|
+
}), /*#__PURE__*/_react.default.createElement(_Input.default, {
|
|
77
|
+
type: "text",
|
|
78
|
+
id: "address-inline22",
|
|
79
|
+
"aria-invalid": "true",
|
|
80
|
+
label: "Email address",
|
|
81
|
+
error: "Please enter a valid email address."
|
|
82
|
+
})),
|
|
83
|
+
name: "Inline"
|
|
84
|
+
};
|
|
85
|
+
const Stacked = exports.Stacked = {
|
|
86
|
+
render: () => /*#__PURE__*/_react.default.createElement(_Form.default, {
|
|
87
|
+
stacked: true
|
|
88
|
+
}, /*#__PURE__*/_react.default.createElement(_Input.default, {
|
|
89
|
+
type: "text",
|
|
90
|
+
id: "full-name-stacked2",
|
|
91
|
+
label: "Full name",
|
|
92
|
+
stacked: true
|
|
93
|
+
}), /*#__PURE__*/_react.default.createElement(_Input.default, {
|
|
94
|
+
type: "text",
|
|
95
|
+
id: "username-stacked2",
|
|
96
|
+
label: "Username",
|
|
97
|
+
stacked: true,
|
|
98
|
+
help: "30 characters or fewer."
|
|
99
|
+
}), /*#__PURE__*/_react.default.createElement(_Input.default, {
|
|
100
|
+
type: "text",
|
|
101
|
+
id: "username-stacked-error2",
|
|
102
|
+
label: "Email address",
|
|
103
|
+
stacked: true,
|
|
104
|
+
error: "This field is required"
|
|
105
|
+
}), /*#__PURE__*/_react.default.createElement(_Input.default, {
|
|
106
|
+
type: "text",
|
|
107
|
+
id: "address-optional-stacked2",
|
|
108
|
+
label: "Address line 1",
|
|
109
|
+
stacked: true
|
|
110
|
+
}), /*#__PURE__*/_react.default.createElement(_Input.default, {
|
|
111
|
+
type: "text",
|
|
112
|
+
id: "address-optional-stacked3",
|
|
113
|
+
label: "Address line 2",
|
|
114
|
+
stacked: true
|
|
115
|
+
})),
|
|
116
|
+
name: "Stacked"
|
|
117
|
+
};
|
|
118
|
+
const Disabled = exports.Disabled = {
|
|
119
|
+
render: () => /*#__PURE__*/_react.default.createElement(_Form.default, null, /*#__PURE__*/_react.default.createElement(_Input.default, {
|
|
120
|
+
label: "Email address",
|
|
121
|
+
type: "text",
|
|
122
|
+
id: "disabled-input2",
|
|
123
|
+
placeholder: "example@canonical.com",
|
|
124
|
+
disabled: true
|
|
125
|
+
})),
|
|
126
|
+
name: "Disabled"
|
|
127
|
+
};
|
|
128
|
+
const Validation = exports.Validation = {
|
|
129
|
+
render: () => /*#__PURE__*/_react.default.createElement(_Form.default, null, /*#__PURE__*/_react.default.createElement(_Input.default, {
|
|
130
|
+
type: "text",
|
|
131
|
+
id: "exampleTextInputError2",
|
|
132
|
+
placeholder: "example@canonical.com",
|
|
133
|
+
label: "Email address",
|
|
134
|
+
error: "This field is required."
|
|
135
|
+
}), /*#__PURE__*/_react.default.createElement(_Input.default, {
|
|
136
|
+
type: "text",
|
|
137
|
+
id: "exampleTextInputCaution2",
|
|
138
|
+
placeholder: "14",
|
|
139
|
+
label: "Mail configuration ID",
|
|
140
|
+
caution: "No validation is performed in preview mode."
|
|
141
|
+
}), /*#__PURE__*/_react.default.createElement(_Input.default, {
|
|
142
|
+
type: "text",
|
|
143
|
+
id: "exampleTextInputSuccess2",
|
|
144
|
+
placeholder: "**** **** **** ****",
|
|
145
|
+
label: "Card number",
|
|
146
|
+
success: "Verified."
|
|
147
|
+
}), /*#__PURE__*/_react.default.createElement(_Select.default, {
|
|
148
|
+
id: "exampleSelectInputError3",
|
|
149
|
+
defaultValue: "",
|
|
150
|
+
options: [{
|
|
151
|
+
value: "",
|
|
152
|
+
disabled: true,
|
|
153
|
+
label: "--Select an option--"
|
|
154
|
+
}, {
|
|
155
|
+
value: "1",
|
|
156
|
+
label: "Cosmic Cuttlefish"
|
|
157
|
+
}, {
|
|
158
|
+
value: "2",
|
|
159
|
+
label: "Bionic Beaver"
|
|
160
|
+
}, {
|
|
161
|
+
value: "3",
|
|
162
|
+
label: "Xenial Xerus"
|
|
163
|
+
}],
|
|
164
|
+
label: "Ubuntu releases",
|
|
165
|
+
error: "You need to select an OS to complete your install."
|
|
166
|
+
})),
|
|
167
|
+
name: "Validation"
|
|
168
|
+
};
|
|
169
|
+
const Required = exports.Required = {
|
|
170
|
+
render: () => /*#__PURE__*/_react.default.createElement(_Form.default, null, /*#__PURE__*/_react.default.createElement(_Input.default, {
|
|
171
|
+
type: "text",
|
|
172
|
+
id: "exampleTextInputError3",
|
|
173
|
+
placeholder: "e.g joe@bloggs.com",
|
|
174
|
+
error: "This field is required.",
|
|
175
|
+
label: "Email address",
|
|
176
|
+
required: true
|
|
177
|
+
})),
|
|
178
|
+
name: "Required"
|
|
179
|
+
};
|
|
@@ -10,7 +10,6 @@ var _Select = _interopRequireDefault(require("../Select"));
|
|
|
10
10
|
var _formik = require("formik");
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
12
|
const meta = {
|
|
13
|
-
title: "FormikField",
|
|
14
13
|
component: _FormikField.default,
|
|
15
14
|
tags: ["autodocs"]
|
|
16
15
|
};
|
|
@@ -48,7 +48,9 @@ export type Props = PropsWithSpread<{
|
|
|
48
48
|
name: ValueOf<typeof ICONS> | string;
|
|
49
49
|
}, HTMLProps<HTMLElement>>;
|
|
50
50
|
/**
|
|
51
|
-
* Icon
|
|
51
|
+
* This is a [React](https://reactjs.org/) component for the Vanilla [Icon](https://docs.vanillaframework.io/patterns/icons/).
|
|
52
|
+
*
|
|
53
|
+
* Icons provide visual context and enhance usability.
|
|
52
54
|
*
|
|
53
55
|
* @param name One of built-in Vanilla icons or a name of a custom icon that follows `p-icon--{name}` convention.
|
|
54
56
|
* @returns Icon
|
|
@@ -42,7 +42,9 @@ const ICONS = exports.ICONS = {
|
|
|
42
42
|
email: "email"
|
|
43
43
|
};
|
|
44
44
|
/**
|
|
45
|
-
* Icon
|
|
45
|
+
* This is a [React](https://reactjs.org/) component for the Vanilla [Icon](https://docs.vanillaframework.io/patterns/icons/).
|
|
46
|
+
*
|
|
47
|
+
* Icons provide visual context and enhance usability.
|
|
46
48
|
*
|
|
47
49
|
* @param name One of built-in Vanilla icons or a name of a custom icon that follows `p-icon--{name}` convention.
|
|
48
50
|
* @returns Icon
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import Icon from "./Icon";
|
|
3
|
+
import "./Icon.stories.scss";
|
|
4
|
+
declare const meta: Meta<typeof Icon>;
|
|
5
|
+
export default meta;
|
|
6
|
+
type Story = StoryObj<typeof Icon>;
|
|
7
|
+
export declare const Base: Story;
|
|
8
|
+
export declare const Default: Story;
|
|
9
|
+
/**
|
|
10
|
+
* To use custom icons that are not included in Vanilla you need to provide your own icon styling following the `.p-icon--{name}` convention.
|
|
11
|
+
*/
|
|
12
|
+
export declare const Custom: Story;
|
|
13
|
+
/**
|
|
14
|
+
* To use custom icons that provide the name of the social media icon following the `.p-icon--{name}` convention.
|
|
15
|
+
*/
|
|
16
|
+
export declare const Social: Story;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.Social = exports.Default = exports.Custom = exports.Base = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _Icon = _interopRequireWildcard(require("./Icon"));
|
|
9
|
+
require("./Icon.stories.scss");
|
|
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 _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
const meta = {
|
|
14
|
+
component: _Icon.default,
|
|
15
|
+
tags: ["autodocs"]
|
|
16
|
+
};
|
|
17
|
+
var _default = exports.default = meta;
|
|
18
|
+
const Base = exports.Base = {
|
|
19
|
+
name: "Base",
|
|
20
|
+
args: {
|
|
21
|
+
name: "facebook"
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
const Default = exports.Default = {
|
|
25
|
+
render: () => /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
26
|
+
name: _Icon.ICONS.plus
|
|
27
|
+
}),
|
|
28
|
+
name: "Default"
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* To use custom icons that are not included in Vanilla you need to provide your own icon styling following the `.p-icon--{name}` convention.
|
|
33
|
+
*/
|
|
34
|
+
const Custom = exports.Custom = {
|
|
35
|
+
render: () => /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
36
|
+
name: "custom"
|
|
37
|
+
}),
|
|
38
|
+
name: "Custom"
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* To use custom icons that provide the name of the social media icon following the `.p-icon--{name}` convention.
|
|
43
|
+
*/
|
|
44
|
+
const Social = exports.Social = {
|
|
45
|
+
render: () => /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
46
|
+
name: _Icon.ICONS.facebook
|
|
47
|
+
}),
|
|
48
|
+
name: "Social"
|
|
49
|
+
};
|
|
@@ -61,5 +61,10 @@ export type Props = PropsWithSpread<{
|
|
|
61
61
|
*/
|
|
62
62
|
wrapperClassName?: string;
|
|
63
63
|
}, InputHTMLAttributes<HTMLInputElement>>;
|
|
64
|
+
/**
|
|
65
|
+
* This is a [React](https://reactjs.org/) component for the Vanilla [Input](https://docs.vanillaframework.io/base/forms/#input).
|
|
66
|
+
*
|
|
67
|
+
* An input field where the user can enter data, which can vary in many ways, depending on the type attribute.
|
|
68
|
+
*/
|
|
64
69
|
declare const Input: ({ caution, className, error, help, helpClassName, id, label, labelClassName, required, stacked, success, takeFocus, takeFocusDelay, type, wrapperClassName, ...inputProps }: Props) => JSX.Element;
|
|
65
70
|
export default Input;
|
|
@@ -17,6 +17,11 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
17
17
|
* The props for the Input component.
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
+
/**
|
|
21
|
+
* This is a [React](https://reactjs.org/) component for the Vanilla [Input](https://docs.vanillaframework.io/base/forms/#input).
|
|
22
|
+
*
|
|
23
|
+
* An input field where the user can enter data, which can vary in many ways, depending on the type attribute.
|
|
24
|
+
*/
|
|
20
25
|
const Input = _ref => {
|
|
21
26
|
let {
|
|
22
27
|
caution,
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import Input from "./Input";
|
|
3
|
+
declare const meta: Meta<typeof Input>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Input>;
|
|
6
|
+
export declare const TextInput: Story;
|
|
7
|
+
export declare const Stacked: Story;
|
|
8
|
+
export declare const Disabled: Story;
|
|
9
|
+
export declare const Error: Story;
|
|
10
|
+
export declare const Success: Story;
|
|
11
|
+
export declare const Caution: Story;
|
|
12
|
+
export declare const Required: Story;
|
|
13
|
+
export declare const Checkbox: Story;
|
|
14
|
+
export declare const RadioButton: Story;
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.TextInput = exports.Success = exports.Stacked = exports.Required = exports.RadioButton = exports.Error = exports.Disabled = exports.Checkbox = exports.Caution = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _Input = _interopRequireDefault(require("./Input"));
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
const meta = {
|
|
11
|
+
component: _Input.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
|
+
helpClassName: {
|
|
30
|
+
control: {
|
|
31
|
+
type: "text"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
label: {
|
|
35
|
+
control: {
|
|
36
|
+
type: "text"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
success: {
|
|
40
|
+
control: {
|
|
41
|
+
type: "text"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
id: {
|
|
45
|
+
control: {
|
|
46
|
+
disable: true
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
placeholder: {
|
|
50
|
+
control: {
|
|
51
|
+
type: "text"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
var _default = exports.default = meta;
|
|
57
|
+
const TextInput = exports.TextInput = {
|
|
58
|
+
name: "Text input",
|
|
59
|
+
args: {
|
|
60
|
+
type: "text",
|
|
61
|
+
id: "exampleTextInput2",
|
|
62
|
+
placeholder: "example@canonical.com",
|
|
63
|
+
label: "Email address",
|
|
64
|
+
help: "Additional description for the field",
|
|
65
|
+
helpClassName: "u-no-margin--bottom"
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
const Stacked = exports.Stacked = {
|
|
69
|
+
render: () => /*#__PURE__*/_react.default.createElement(_Input.default, {
|
|
70
|
+
type: "text",
|
|
71
|
+
id: "exampleTextInput3",
|
|
72
|
+
placeholder: "example@canonical.com",
|
|
73
|
+
stacked: true,
|
|
74
|
+
label: "Email address"
|
|
75
|
+
}),
|
|
76
|
+
name: "Stacked"
|
|
77
|
+
};
|
|
78
|
+
const Disabled = exports.Disabled = {
|
|
79
|
+
render: () => /*#__PURE__*/_react.default.createElement(_Input.default, {
|
|
80
|
+
type: "text",
|
|
81
|
+
id: "exampleTextInput4",
|
|
82
|
+
placeholder: "example@canonical.com",
|
|
83
|
+
disabled: true,
|
|
84
|
+
label: "Email address"
|
|
85
|
+
}),
|
|
86
|
+
name: "Disabled"
|
|
87
|
+
};
|
|
88
|
+
const Error = exports.Error = {
|
|
89
|
+
render: () => /*#__PURE__*/_react.default.createElement(_Input.default, {
|
|
90
|
+
type: "text",
|
|
91
|
+
id: "exampleTextInput5",
|
|
92
|
+
placeholder: "example@canonical.com",
|
|
93
|
+
error: "This field is required.",
|
|
94
|
+
label: "Email address"
|
|
95
|
+
}),
|
|
96
|
+
name: "Error"
|
|
97
|
+
};
|
|
98
|
+
const Success = exports.Success = {
|
|
99
|
+
render: () => /*#__PURE__*/_react.default.createElement(_Input.default, {
|
|
100
|
+
type: "text",
|
|
101
|
+
id: "exampleTextInput6",
|
|
102
|
+
placeholder: "example@canonical.com",
|
|
103
|
+
success: "Verified.",
|
|
104
|
+
label: "Email address"
|
|
105
|
+
}),
|
|
106
|
+
name: "Success"
|
|
107
|
+
};
|
|
108
|
+
const Caution = exports.Caution = {
|
|
109
|
+
render: () => /*#__PURE__*/_react.default.createElement(_Input.default, {
|
|
110
|
+
type: "text",
|
|
111
|
+
id: "exampleTextInput7",
|
|
112
|
+
placeholder: "example@canonical.com",
|
|
113
|
+
caution: "No validation is performed in preview mode.",
|
|
114
|
+
label: "Email address"
|
|
115
|
+
}),
|
|
116
|
+
name: "Caution"
|
|
117
|
+
};
|
|
118
|
+
const Required = exports.Required = {
|
|
119
|
+
render: () => /*#__PURE__*/_react.default.createElement(_Input.default, {
|
|
120
|
+
type: "text",
|
|
121
|
+
id: "exampleTextInput8",
|
|
122
|
+
placeholder: "example@canonical.com",
|
|
123
|
+
required: true,
|
|
124
|
+
label: "Email address"
|
|
125
|
+
}),
|
|
126
|
+
name: "Required"
|
|
127
|
+
};
|
|
128
|
+
const Checkbox = exports.Checkbox = {
|
|
129
|
+
render: () => /*#__PURE__*/_react.default.createElement(_Input.default, {
|
|
130
|
+
type: "checkbox",
|
|
131
|
+
id: "checkExample12",
|
|
132
|
+
defaultChecked: true,
|
|
133
|
+
label: "HTML"
|
|
134
|
+
}),
|
|
135
|
+
name: "Checkbox"
|
|
136
|
+
};
|
|
137
|
+
const RadioButton = exports.RadioButton = {
|
|
138
|
+
render: () => /*#__PURE__*/_react.default.createElement(_Input.default, {
|
|
139
|
+
label: "Linux",
|
|
140
|
+
type: "radio",
|
|
141
|
+
name: "RadioOptions",
|
|
142
|
+
id: "Radio12",
|
|
143
|
+
defaultValue: "option1",
|
|
144
|
+
defaultChecked: true,
|
|
145
|
+
help: "Ubuntu"
|
|
146
|
+
}),
|
|
147
|
+
name: "Radio button"
|
|
148
|
+
};
|
|
@@ -22,5 +22,10 @@ export type Props = PropsWithSpread<{
|
|
|
22
22
|
*/
|
|
23
23
|
top?: boolean;
|
|
24
24
|
}, HTMLProps<HTMLAnchorElement>>;
|
|
25
|
+
/**
|
|
26
|
+
* This is a [React](https://reactjs.org/) component for the Vanilla [Link](https://docs.vanillaframework.io/patterns/links/).
|
|
27
|
+
*
|
|
28
|
+
* Links are used to embed actions or pathways to more information, allowing users to click their way from page to page.
|
|
29
|
+
*/
|
|
25
30
|
declare const Link: ({ children, className, href, inverted, soft, top, ...props }: Props) => JSX.Element;
|
|
26
31
|
export default Link;
|
|
@@ -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 the Vanilla [Link](https://docs.vanillaframework.io/patterns/links/).
|
|
13
|
+
*
|
|
14
|
+
* Links are used to embed actions or pathways to more information, allowing users to click their way from page to page.
|
|
15
|
+
*/
|
|
11
16
|
const Link = _ref => {
|
|
12
17
|
let {
|
|
13
18
|
children,
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import Link from "./Link";
|
|
3
|
+
declare const meta: Meta<typeof Link>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Link>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const Soft: Story;
|
|
8
|
+
export declare const Inverted: Story;
|
|
9
|
+
export declare const BackToTop: Story;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.Soft = exports.Inverted = exports.Default = exports.BackToTop = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _Link = _interopRequireDefault(require("./Link"));
|
|
9
|
+
var _Strip = _interopRequireDefault(require("../Strip"));
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
const meta = {
|
|
12
|
+
component: _Link.default,
|
|
13
|
+
tags: ["autodocs"],
|
|
14
|
+
argTypes: {
|
|
15
|
+
children: {
|
|
16
|
+
control: {
|
|
17
|
+
type: "text"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
var _default = exports.default = meta;
|
|
23
|
+
const Default = exports.Default = {
|
|
24
|
+
name: "Default",
|
|
25
|
+
args: {
|
|
26
|
+
children: "Fast, secure and simple, Ubuntu powers millions of PCs worldwide"
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
const Soft = exports.Soft = {
|
|
30
|
+
render: () => /*#__PURE__*/_react.default.createElement(_Link.default, {
|
|
31
|
+
soft: true
|
|
32
|
+
}, "Learn about MAAS"),
|
|
33
|
+
name: "Soft"
|
|
34
|
+
};
|
|
35
|
+
const Inverted = exports.Inverted = {
|
|
36
|
+
render: () => /*#__PURE__*/_react.default.createElement(_Strip.default, {
|
|
37
|
+
type: "dark"
|
|
38
|
+
}, /*#__PURE__*/_react.default.createElement(_Link.default, {
|
|
39
|
+
inverted: true
|
|
40
|
+
}, "Package & publish your app")),
|
|
41
|
+
name: "Inverted"
|
|
42
|
+
};
|
|
43
|
+
const BackToTop = exports.BackToTop = {
|
|
44
|
+
render: () => /*#__PURE__*/_react.default.createElement(_Link.default, {
|
|
45
|
+
top: true
|
|
46
|
+
}, "Back to top"),
|
|
47
|
+
name: "Back to top"
|
|
48
|
+
};
|
|
@@ -27,5 +27,10 @@ export type Props = {
|
|
|
27
27
|
stretch?: boolean;
|
|
28
28
|
ticked?: boolean;
|
|
29
29
|
} & Omit<HTMLProps<HTMLOListElement>, "type">;
|
|
30
|
+
/**
|
|
31
|
+
* This is a [React](https://reactjs.org/) component for the Vanilla [List](https://docs.vanillaframework.io/patterns/lists/).
|
|
32
|
+
*
|
|
33
|
+
* If you want to display lists in a way that is more visually distinctive than the standard `<ol>` and `<ul>`, we have 7 list styles at your disposal.
|
|
34
|
+
*/
|
|
30
35
|
declare const List: ({ className, detailed, divided, inline, isDark, items, middot, stretch, split, stepped, ticked, ...props }: Props) => JSX.Element;
|
|
31
36
|
export default List;
|
|
@@ -63,6 +63,12 @@ const generateItems = _ref => {
|
|
|
63
63
|
}, liProps), body, middot ? " " : null);
|
|
64
64
|
});
|
|
65
65
|
};
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* This is a [React](https://reactjs.org/) component for the Vanilla [List](https://docs.vanillaframework.io/patterns/lists/).
|
|
69
|
+
*
|
|
70
|
+
* If you want to display lists in a way that is more visually distinctive than the standard `<ol>` and `<ul>`, we have 7 list styles at your disposal.
|
|
71
|
+
*/
|
|
66
72
|
const List = _ref2 => {
|
|
67
73
|
let {
|
|
68
74
|
className,
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import List from "./List";
|
|
3
|
+
declare const meta: Meta<typeof List>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof List>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const Ticked: Story;
|
|
8
|
+
export declare const HorizontalDivider: Story;
|
|
9
|
+
export declare const TickedWithHorizontalDivider: Story;
|
|
10
|
+
export declare const Inline: Story;
|
|
11
|
+
export declare const Middot: Story;
|
|
12
|
+
export declare const Stretch: Story;
|
|
13
|
+
export declare const VerticalStepped: Story;
|
|
14
|
+
export declare const HorizontalStepped: Story;
|
|
15
|
+
export declare const Split: Story;
|