@canonical/react-components 0.34.2 → 0.37.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.js +1 -1
- package/dist/components/ActionButton/ActionButton.js +1 -1
- package/dist/components/ArticlePagination/ArticlePagination.js +1 -1
- package/dist/components/Button/Button.d.ts +1 -0
- package/dist/components/Button/Button.js +2 -1
- package/dist/components/Card/Card.js +1 -1
- package/dist/components/CheckableInput/CheckableInput.js +1 -1
- package/dist/components/CheckboxInput/CheckboxInput.js +1 -1
- package/dist/components/Chip/Chip.js +1 -1
- package/dist/components/Code/Code.js +1 -1
- package/dist/components/CodeSnippet/CodeSnippet.js +1 -1
- package/dist/components/CodeSnippet/CodeSnippetBlock.js +1 -1
- package/dist/components/CodeSnippet/CodeSnippetDropdown.js +1 -1
- package/dist/components/Col/Col.js +1 -1
- package/dist/components/ContextualMenu/ContextualMenu.js +1 -2
- package/dist/components/ContextualMenu/ContextualMenuDropdown/ContextualMenuDropdown.js +1 -1
- package/dist/components/Field/Field.d.ts +5 -1
- package/dist/components/Field/Field.js +6 -1
- package/dist/components/Form/Form.js +1 -1
- package/dist/components/Icon/Icon.js +1 -1
- package/dist/components/Input/Input.d.ts +5 -1
- package/dist/components/Input/Input.js +4 -2
- package/dist/components/Label/Label.js +1 -1
- package/dist/components/Link/Link.js +1 -1
- package/dist/components/List/List.js +28 -17
- package/dist/components/MainTable/MainTable.js +98 -79
- package/dist/components/Modal/Modal.js +1 -1
- package/dist/components/ModularTable/ModularTable.js +1 -1
- package/dist/components/Navigation/Navigation.d.ts +57 -0
- package/dist/components/Navigation/Navigation.js +266 -0
- package/dist/components/Navigation/NavigationLink/NavigationLink.d.ts +11 -0
- package/dist/components/Navigation/NavigationLink/NavigationLink.js +57 -0
- package/dist/components/Navigation/NavigationLink/index.d.ts +1 -0
- package/dist/components/Navigation/NavigationLink/index.js +15 -0
- package/dist/components/Navigation/NavigationMenu/NavigationMenu.d.ts +11 -0
- package/dist/components/Navigation/NavigationMenu/NavigationMenu.js +97 -0
- package/dist/components/Navigation/NavigationMenu/index.d.ts +1 -0
- package/dist/components/Navigation/NavigationMenu/index.js +15 -0
- package/dist/components/Navigation/index.d.ts +3 -0
- package/dist/components/Navigation/index.js +15 -0
- package/dist/components/Navigation/types.d.ts +57 -0
- package/dist/components/Navigation/types.js +5 -0
- package/dist/components/Notification/Notification.js +1 -1
- package/dist/components/PasswordToggle/PasswordToggle.js +1 -1
- package/dist/components/RadioInput/RadioInput.js +1 -1
- package/dist/components/Row/Row.js +1 -1
- package/dist/components/SearchAndFilter/SearchAndFilter.js +12 -16
- package/dist/components/SearchBox/SearchBox.d.ts +6 -5
- package/dist/components/SearchBox/SearchBox.js +22 -8
- package/dist/components/Select/Select.js +1 -1
- package/dist/components/Slider/Slider.js +1 -1
- package/dist/components/Spinner/Spinner.js +1 -1
- package/dist/components/StatusLabel/StatusLabel.d.ts +31 -0
- package/dist/components/StatusLabel/StatusLabel.js +51 -0
- package/dist/components/StatusLabel/index.d.ts +2 -0
- package/dist/components/StatusLabel/index.js +25 -0
- package/dist/components/Strip/Strip.js +1 -1
- package/dist/components/Switch/Switch.js +1 -1
- package/dist/components/Table/Table.js +1 -1
- package/dist/components/TableCell/TableCell.js +1 -1
- package/dist/components/TableHeader/TableHeader.js +1 -1
- package/dist/components/TableRow/TableRow.js +1 -1
- package/dist/components/Tabs/Tabs.js +1 -1
- package/dist/components/Textarea/Textarea.js +1 -1
- package/dist/components/Tooltip/Tooltip.js +30 -1
- package/dist/hooks/index.d.ts +5 -2
- package/dist/hooks/index.js +26 -2
- package/dist/hooks/useClickOutside.d.ts +7 -0
- package/dist/hooks/useClickOutside.js +41 -0
- package/dist/hooks/useOnEscapePressed.d.ts +4 -0
- package/dist/hooks/useOnEscapePressed.js +27 -0
- package/dist/hooks/usePagination.d.ts +19 -0
- package/dist/hooks/usePagination.js +74 -0
- package/dist/index.d.ts +6 -2
- package/dist/index.js +34 -0
- package/dist/types/index.d.ts +13 -0
- package/dist/types/index.js +49 -1
- package/package.json +44 -42
|
@@ -34,7 +34,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
34
34
|
|
|
35
35
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
36
36
|
|
|
37
|
-
function _extends() { _extends = Object.assign
|
|
37
|
+
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); }
|
|
38
38
|
|
|
39
39
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
40
40
|
|
|
@@ -21,7 +21,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
21
21
|
|
|
22
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
23
|
|
|
24
|
-
function _extends() { _extends = Object.assign
|
|
24
|
+
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); }
|
|
25
25
|
|
|
26
26
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
27
27
|
|
|
@@ -13,7 +13,7 @@ var _excluded = ["className", "nextURL", "nextLabel", "previousURL", "previousLa
|
|
|
13
13
|
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
|
|
16
|
-
function _extends() { _extends = Object.assign
|
|
16
|
+
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); }
|
|
17
17
|
|
|
18
18
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
19
19
|
|
|
@@ -13,7 +13,7 @@ var _excluded = ["appearance", "children", "className", "dense", "disabled", "el
|
|
|
13
13
|
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
|
|
16
|
-
function _extends() { _extends = Object.assign
|
|
16
|
+
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); }
|
|
17
17
|
|
|
18
18
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
19
19
|
|
|
@@ -22,6 +22,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
22
22
|
var ButtonAppearance = {
|
|
23
23
|
BASE: "base",
|
|
24
24
|
BRAND: "brand",
|
|
25
|
+
DEFAULT: "",
|
|
25
26
|
LINK: "link",
|
|
26
27
|
NEGATIVE: "negative",
|
|
27
28
|
POSITIVE: "positive"
|
|
@@ -13,7 +13,7 @@ var _excluded = ["children", "className", "highlighted", "overlay", "thumbnail",
|
|
|
13
13
|
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
|
|
16
|
-
function _extends() { _extends = Object.assign
|
|
16
|
+
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); }
|
|
17
17
|
|
|
18
18
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
19
19
|
|
|
@@ -21,7 +21,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
21
21
|
|
|
22
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
23
|
|
|
24
|
-
function _extends() { _extends = Object.assign
|
|
24
|
+
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); }
|
|
25
25
|
|
|
26
26
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
27
27
|
|
|
@@ -13,7 +13,7 @@ var _excluded = ["label", "indeterminate"];
|
|
|
13
13
|
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
|
|
16
|
-
function _extends() { _extends = Object.assign
|
|
16
|
+
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); }
|
|
17
17
|
|
|
18
18
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
19
19
|
|
|
@@ -15,7 +15,7 @@ var _excluded = ["appearance", "lead", "onClick", "onDismiss", "quoteValue", "se
|
|
|
15
15
|
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
17
|
|
|
18
|
-
function _extends() { _extends = Object.assign
|
|
18
|
+
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); }
|
|
19
19
|
|
|
20
20
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
21
21
|
|
|
@@ -23,7 +23,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
23
23
|
|
|
24
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
25
|
|
|
26
|
-
function _extends() { _extends = Object.assign
|
|
26
|
+
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); }
|
|
27
27
|
|
|
28
28
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
29
29
|
|
|
@@ -15,7 +15,7 @@ var _excluded = ["className", "blocks"];
|
|
|
15
15
|
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
17
|
|
|
18
|
-
function _extends() { _extends = Object.assign
|
|
18
|
+
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); }
|
|
19
19
|
|
|
20
20
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
21
21
|
|
|
@@ -14,7 +14,7 @@ var _CodeSnippetDropdown = _interopRequireDefault(require("./CodeSnippetDropdown
|
|
|
14
14
|
|
|
15
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
16
|
|
|
17
|
-
function _extends() { _extends = Object.assign
|
|
17
|
+
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); }
|
|
18
18
|
|
|
19
19
|
var CodeSnippetBlockAppearance = {
|
|
20
20
|
LINUX_PROMPT: "linuxPrompt",
|
|
@@ -12,7 +12,7 @@ var _excluded = ["options", "onChange"],
|
|
|
12
12
|
|
|
13
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
14
|
|
|
15
|
-
function _extends() { _extends = Object.assign
|
|
15
|
+
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); }
|
|
16
16
|
|
|
17
17
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
18
18
|
|
|
@@ -13,7 +13,7 @@ var _excluded = ["children", "className", "element", "emptyLarge", "emptyMedium"
|
|
|
13
13
|
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
|
|
16
|
-
function _extends() { _extends = Object.assign
|
|
16
|
+
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); }
|
|
17
17
|
|
|
18
18
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
19
19
|
|
|
@@ -29,7 +29,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
29
29
|
|
|
30
30
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31
31
|
|
|
32
|
-
function _extends() { _extends = Object.assign
|
|
32
|
+
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); }
|
|
33
33
|
|
|
34
34
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
35
35
|
|
|
@@ -162,7 +162,6 @@ var ContextualMenu = function ContextualMenu(_ref) {
|
|
|
162
162
|
// Call the toggle callback, if supplied.
|
|
163
163
|
onToggleMenu && onToggleMenu(true); // When the menu opens then update the coordinates of the parent.
|
|
164
164
|
|
|
165
|
-
// When the menu opens then update the coordinates of the parent.
|
|
166
165
|
updatePositionCoords();
|
|
167
166
|
},
|
|
168
167
|
onClose: function onClose() {
|
|
@@ -36,7 +36,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
36
36
|
|
|
37
37
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
38
38
|
|
|
39
|
-
function _extends() { _extends = Object.assign
|
|
39
|
+
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); }
|
|
40
40
|
|
|
41
41
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
42
42
|
|
|
@@ -28,6 +28,10 @@ export declare type Props = {
|
|
|
28
28
|
* Help text to show below the field.
|
|
29
29
|
*/
|
|
30
30
|
help?: ReactNode;
|
|
31
|
+
/**
|
|
32
|
+
* Optional class(es) to pass to the help text element.
|
|
33
|
+
*/
|
|
34
|
+
helpClassName?: ReactNode;
|
|
31
35
|
/**
|
|
32
36
|
* An id to give to the help element.
|
|
33
37
|
*/
|
|
@@ -69,5 +73,5 @@ export declare type Props = {
|
|
|
69
73
|
*/
|
|
70
74
|
validationId?: string;
|
|
71
75
|
};
|
|
72
|
-
declare const Field: ({ caution, children, className, error, forId, help, helpId, isSelect, isTickElement, label, labelClassName, labelFirst, required, stacked, success, validationId, }: Props) => JSX.Element;
|
|
76
|
+
declare const Field: ({ caution, children, className, error, forId, help, helpClassName, helpId, isSelect, isTickElement, label, labelClassName, labelFirst, required, stacked, success, validationId, }: Props) => JSX.Element;
|
|
73
77
|
export default Field;
|
|
@@ -18,9 +18,10 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
18
18
|
var generateHelpText = function generateHelpText(_ref) {
|
|
19
19
|
var help = _ref.help,
|
|
20
20
|
helpId = _ref.helpId,
|
|
21
|
+
helpClassName = _ref.helpClassName,
|
|
21
22
|
isTickElement = _ref.isTickElement;
|
|
22
23
|
return help ? /*#__PURE__*/_react.default.createElement("p", {
|
|
23
|
-
className: (0, _classnames.default)("p-form-help-text", {
|
|
24
|
+
className: (0, _classnames.default)("p-form-help-text", helpClassName, {
|
|
24
25
|
"is-tick-element": isTickElement
|
|
25
26
|
}),
|
|
26
27
|
id: helpId
|
|
@@ -65,6 +66,7 @@ var generateContent = function generateContent(_ref2) {
|
|
|
65
66
|
labelFirst = _ref2.labelFirst,
|
|
66
67
|
labelNode = _ref2.labelNode,
|
|
67
68
|
help = _ref2.help,
|
|
69
|
+
helpClassName = _ref2.helpClassName,
|
|
68
70
|
error = _ref2.error,
|
|
69
71
|
caution = _ref2.caution,
|
|
70
72
|
success = _ref2.success,
|
|
@@ -78,6 +80,7 @@ var generateContent = function generateContent(_ref2) {
|
|
|
78
80
|
}, children) : children, !labelFirst && labelNode, generateHelpText({
|
|
79
81
|
helpId: helpId,
|
|
80
82
|
help: help,
|
|
83
|
+
helpClassName: helpClassName,
|
|
81
84
|
isTickElement: isTickElement
|
|
82
85
|
}), generateError(error, caution, success, validationId));
|
|
83
86
|
};
|
|
@@ -89,6 +92,7 @@ var Field = function Field(_ref3) {
|
|
|
89
92
|
error = _ref3.error,
|
|
90
93
|
forId = _ref3.forId,
|
|
91
94
|
help = _ref3.help,
|
|
95
|
+
helpClassName = _ref3.helpClassName,
|
|
92
96
|
helpId = _ref3.helpId,
|
|
93
97
|
isSelect = _ref3.isSelect,
|
|
94
98
|
isTickElement = _ref3.isTickElement,
|
|
@@ -108,6 +112,7 @@ var Field = function Field(_ref3) {
|
|
|
108
112
|
labelFirst: labelFirst,
|
|
109
113
|
labelNode: labelNode,
|
|
110
114
|
help: help,
|
|
115
|
+
helpClassName: helpClassName,
|
|
111
116
|
error: error,
|
|
112
117
|
caution: caution,
|
|
113
118
|
success: success,
|
|
@@ -13,7 +13,7 @@ var _excluded = ["children", "className", "inline", "stacked"];
|
|
|
13
13
|
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
|
|
16
|
-
function _extends() { _extends = Object.assign
|
|
16
|
+
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); }
|
|
17
17
|
|
|
18
18
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
19
19
|
|
|
@@ -13,7 +13,7 @@ var _excluded = ["className", "light", "name"];
|
|
|
13
13
|
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
|
|
16
|
-
function _extends() { _extends = Object.assign
|
|
16
|
+
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); }
|
|
17
17
|
|
|
18
18
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
19
19
|
|
|
@@ -20,6 +20,10 @@ export declare type Props = PropsWithSpread<{
|
|
|
20
20
|
* Help text to show below the field.
|
|
21
21
|
*/
|
|
22
22
|
help?: ReactNode;
|
|
23
|
+
/**
|
|
24
|
+
* Optional class(es) to pass to the help text element.
|
|
25
|
+
*/
|
|
26
|
+
helpClassName?: ReactNode;
|
|
23
27
|
/**
|
|
24
28
|
* The id of the input.
|
|
25
29
|
*/
|
|
@@ -53,5 +57,5 @@ export declare type Props = PropsWithSpread<{
|
|
|
53
57
|
*/
|
|
54
58
|
wrapperClassName?: string;
|
|
55
59
|
}, InputHTMLAttributes<HTMLInputElement>>;
|
|
56
|
-
declare const Input: ({ caution, className, error, help, id, label, labelClassName, required, stacked, success, takeFocus, type, wrapperClassName, ...inputProps }: Props) => JSX.Element;
|
|
60
|
+
declare const Input: ({ caution, className, error, help, helpClassName, id, label, labelClassName, required, stacked, success, takeFocus, type, wrapperClassName, ...inputProps }: Props) => JSX.Element;
|
|
57
61
|
export default Input;
|
|
@@ -19,7 +19,7 @@ var _RadioInput = _interopRequireDefault(require("../RadioInput"));
|
|
|
19
19
|
|
|
20
20
|
var _hooks = require("../../hooks");
|
|
21
21
|
|
|
22
|
-
var _excluded = ["caution", "className", "error", "help", "id", "label", "labelClassName", "required", "stacked", "success", "takeFocus", "type", "wrapperClassName"];
|
|
22
|
+
var _excluded = ["caution", "className", "error", "help", "helpClassName", "id", "label", "labelClassName", "required", "stacked", "success", "takeFocus", "type", "wrapperClassName"];
|
|
23
23
|
|
|
24
24
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
25
25
|
|
|
@@ -27,7 +27,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
27
27
|
|
|
28
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
29
|
|
|
30
|
-
function _extends() { _extends = Object.assign
|
|
30
|
+
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); }
|
|
31
31
|
|
|
32
32
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
33
33
|
|
|
@@ -44,6 +44,7 @@ var Input = function Input(_ref) {
|
|
|
44
44
|
className = _ref.className,
|
|
45
45
|
error = _ref.error,
|
|
46
46
|
help = _ref.help,
|
|
47
|
+
helpClassName = _ref.helpClassName,
|
|
47
48
|
id = _ref.id,
|
|
48
49
|
label = _ref.label,
|
|
49
50
|
labelClassName = _ref.labelClassName,
|
|
@@ -101,6 +102,7 @@ var Input = function Input(_ref) {
|
|
|
101
102
|
error: error,
|
|
102
103
|
forId: id,
|
|
103
104
|
help: help,
|
|
105
|
+
helpClassName: helpClassName,
|
|
104
106
|
helpId: helpId,
|
|
105
107
|
isTickElement: type === "checkbox" || type === "radio",
|
|
106
108
|
label: fieldLabel,
|
|
@@ -13,7 +13,7 @@ var _excluded = ["children", "className", "forId", "required"];
|
|
|
13
13
|
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
|
|
16
|
-
function _extends() { _extends = Object.assign
|
|
16
|
+
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); }
|
|
17
17
|
|
|
18
18
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
19
19
|
|
|
@@ -13,7 +13,7 @@ var _excluded = ["children", "className", "href", "inverted", "soft", "top"];
|
|
|
13
13
|
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
|
|
16
|
-
function _extends() { _extends = Object.assign
|
|
16
|
+
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); }
|
|
17
17
|
|
|
18
18
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
19
19
|
|
|
@@ -15,7 +15,7 @@ var _excluded = ["title", "className", "content", "titleElement"],
|
|
|
15
15
|
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
17
|
|
|
18
|
-
function _extends() { _extends = Object.assign
|
|
18
|
+
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); }
|
|
19
19
|
|
|
20
20
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
21
21
|
|
|
@@ -23,7 +23,12 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
23
23
|
|
|
24
24
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
25
25
|
|
|
26
|
-
var generateItems = function generateItems(
|
|
26
|
+
var generateItems = function generateItems(_ref) {
|
|
27
|
+
var items = _ref.items,
|
|
28
|
+
ticked = _ref.ticked,
|
|
29
|
+
inline = _ref.inline,
|
|
30
|
+
middot = _ref.middot,
|
|
31
|
+
stepped = _ref.stepped;
|
|
27
32
|
return items.map(function (item, i) {
|
|
28
33
|
var body;
|
|
29
34
|
var title;
|
|
@@ -72,23 +77,23 @@ var generateItems = function generateItems(items, ticked, inline, stepped) {
|
|
|
72
77
|
"is-ticked": ticked
|
|
73
78
|
}),
|
|
74
79
|
key: i
|
|
75
|
-
}, liProps), body);
|
|
80
|
+
}, liProps), body, middot ? " " : null);
|
|
76
81
|
});
|
|
77
82
|
};
|
|
78
83
|
|
|
79
|
-
var List = function List(
|
|
80
|
-
var className =
|
|
81
|
-
detailed =
|
|
82
|
-
divided =
|
|
83
|
-
inline =
|
|
84
|
-
isDark =
|
|
85
|
-
items =
|
|
86
|
-
middot =
|
|
87
|
-
stretch =
|
|
88
|
-
split =
|
|
89
|
-
stepped =
|
|
90
|
-
ticked =
|
|
91
|
-
props = _objectWithoutProperties(
|
|
84
|
+
var List = function List(_ref2) {
|
|
85
|
+
var className = _ref2.className,
|
|
86
|
+
detailed = _ref2.detailed,
|
|
87
|
+
divided = _ref2.divided,
|
|
88
|
+
inline = _ref2.inline,
|
|
89
|
+
isDark = _ref2.isDark,
|
|
90
|
+
items = _ref2.items,
|
|
91
|
+
middot = _ref2.middot,
|
|
92
|
+
stretch = _ref2.stretch,
|
|
93
|
+
split = _ref2.split,
|
|
94
|
+
stepped = _ref2.stepped,
|
|
95
|
+
ticked = _ref2.ticked,
|
|
96
|
+
props = _objectWithoutProperties(_ref2, _excluded3);
|
|
92
97
|
|
|
93
98
|
var Component = stepped ? "ol" : "ul";
|
|
94
99
|
return /*#__PURE__*/_react.default.createElement(Component, _extends({
|
|
@@ -103,7 +108,13 @@ var List = function List(_ref) {
|
|
|
103
108
|
"is-dark": isDark,
|
|
104
109
|
"is-split": split
|
|
105
110
|
})
|
|
106
|
-
}, props), generateItems(
|
|
111
|
+
}, props), generateItems({
|
|
112
|
+
items: items,
|
|
113
|
+
ticked: ticked,
|
|
114
|
+
inline: inline || middot || stretch,
|
|
115
|
+
middot: middot,
|
|
116
|
+
stepped: stepped
|
|
117
|
+
}));
|
|
107
118
|
};
|
|
108
119
|
|
|
109
120
|
var _default = List;
|