grommet 2.30.0 → 2.31.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/components/Anchor/Anchor.js +3 -2
- package/components/Button/Badge.js +42 -43
- package/components/Button/Button.js +15 -12
- package/components/Button/StyledButton.js +4 -2
- package/components/Button/StyledButtonKind.js +5 -3
- package/components/Button/index.d.ts +2 -0
- package/components/Button/propTypes.js +1 -0
- package/components/CheckBox/index.d.ts +1 -1
- package/components/Data/DataForm.js +40 -34
- package/components/DataView/DataView.js +1 -1
- package/components/DateInput/DateInput.js +2 -1
- package/components/FormField/FormField.js +0 -1
- package/components/MaskedInput/MaskedInput.js +3 -2
- package/components/MaskedInput/StyledMaskedInput.js +2 -1
- package/components/Notification/Notification.js +7 -3
- package/components/PageHeader/PageHeader.js +6 -4
- package/components/Pagination/StyledPageControl.js +3 -1
- package/components/Paragraph/Paragraph.js +2 -2
- package/components/Paragraph/stories/All.js +5 -1
- package/components/SelectMultiple/SelectMultiple.js +11 -10
- package/components/SelectMultiple/SelectMultipleContainer.js +16 -13
- package/components/SelectMultiple/stories/Help.js +49 -0
- package/components/Text/Text.js +2 -2
- package/components/TextInput/StyledTextInput.js +2 -1
- package/components/TextInput/TextInput.js +3 -2
- package/es6/components/Anchor/Anchor.js +4 -3
- package/es6/components/Button/Badge.js +43 -44
- package/es6/components/Button/Button.js +16 -13
- package/es6/components/Button/StyledButton.js +5 -3
- package/es6/components/Button/StyledButtonKind.js +6 -4
- package/es6/components/Button/index.d.ts +2 -0
- package/es6/components/Button/propTypes.js +2 -1
- package/es6/components/CheckBox/index.d.ts +1 -1
- package/es6/components/Data/DataForm.js +40 -34
- package/es6/components/DataView/DataView.js +1 -1
- package/es6/components/DateInput/DateInput.js +2 -1
- package/es6/components/FormField/FormField.js +0 -1
- package/es6/components/MaskedInput/MaskedInput.js +4 -3
- package/es6/components/MaskedInput/StyledMaskedInput.js +2 -1
- package/es6/components/Notification/Notification.js +7 -3
- package/es6/components/PageHeader/PageHeader.js +6 -4
- package/es6/components/Pagination/StyledPageControl.js +3 -1
- package/es6/components/Paragraph/Paragraph.js +2 -2
- package/es6/components/Paragraph/stories/All.js +5 -1
- package/es6/components/SelectMultiple/SelectMultiple.js +11 -10
- package/es6/components/SelectMultiple/SelectMultipleContainer.js +16 -13
- package/es6/components/SelectMultiple/stories/Help.js +42 -0
- package/es6/components/Text/Text.js +2 -2
- package/es6/components/TextInput/StyledTextInput.js +2 -1
- package/es6/components/TextInput/TextInput.js +4 -3
- package/es6/themes/base.d.ts +3 -0
- package/es6/themes/base.js +6 -0
- package/es6/utils/icon.js +7 -0
- package/es6/utils/index.js +1 -0
- package/es6/utils/styles.js +10 -0
- package/grommet.min.js +1 -1
- package/grommet.min.js.map +1 -1
- package/package.json +30 -30
- package/themes/base.d.ts +3 -0
- package/themes/base.js +6 -0
- package/utils/icon.js +12 -0
- package/utils/index.js +6 -0
- package/utils/styles.js +12 -1
|
@@ -4,7 +4,6 @@ exports.__esModule = true;
|
|
|
4
4
|
exports.SelectMultipleContainer = void 0;
|
|
5
5
|
var _react = _interopRequireWildcard(require("react"));
|
|
6
6
|
var _styledComponents = require("styled-components");
|
|
7
|
-
var _FormUp = require("grommet-icons/icons/FormUp");
|
|
8
7
|
var _utils = require("../../utils");
|
|
9
8
|
var _defaultProps = require("../../default-props");
|
|
10
9
|
var _Box = require("../Box");
|
|
@@ -32,6 +31,7 @@ var SelectMultipleContainer = /*#__PURE__*/(0, _react.forwardRef)(function (_ref
|
|
|
32
31
|
_ref$emptySearchMessa = _ref.emptySearchMessage,
|
|
33
32
|
emptySearchMessage = _ref$emptySearchMessa === void 0 ? 'No matches found' : _ref$emptySearchMessa,
|
|
34
33
|
help = _ref.help,
|
|
34
|
+
icon = _ref.icon,
|
|
35
35
|
id = _ref.id,
|
|
36
36
|
labelKey = _ref.labelKey,
|
|
37
37
|
limit = _ref.limit,
|
|
@@ -264,21 +264,26 @@ var SelectMultipleContainer = /*#__PURE__*/(0, _react.forwardRef)(function (_ref
|
|
|
264
264
|
value: value,
|
|
265
265
|
valueKey: valueKey
|
|
266
266
|
});
|
|
267
|
+
var helpContent;
|
|
268
|
+
if (help) {
|
|
269
|
+
if (typeof help === 'string') helpContent = /*#__PURE__*/_react["default"].createElement(_Box.Box, {
|
|
270
|
+
flex: false,
|
|
271
|
+
pad: "xsmall"
|
|
272
|
+
}, /*#__PURE__*/_react["default"].createElement(_Text.Text, {
|
|
273
|
+
size: "small"
|
|
274
|
+
}, help));else helpContent = /*#__PURE__*/_react["default"].createElement(_Box.Box, {
|
|
275
|
+
flex: false
|
|
276
|
+
}, help);
|
|
277
|
+
}
|
|
267
278
|
if (showSelectedInline) summaryContent = /*#__PURE__*/_react["default"].createElement(_Box.Box, {
|
|
268
279
|
direction: "row",
|
|
269
280
|
justify: "between",
|
|
270
281
|
flex: false
|
|
271
|
-
}, summaryContent, /*#__PURE__*/_react["default"].createElement(_Button.Button, {
|
|
282
|
+
}, summaryContent, /*#__PURE__*/_react["default"].createElement(_Box.Box, null, /*#__PURE__*/_react["default"].createElement(_Button.Button, {
|
|
283
|
+
fill: "vertical",
|
|
272
284
|
onClick: onClose,
|
|
273
285
|
a11yTitle: "Close Select"
|
|
274
|
-
},
|
|
275
|
-
fill: true,
|
|
276
|
-
alignSelf: "start",
|
|
277
|
-
pad: {
|
|
278
|
-
right: 'small',
|
|
279
|
-
top: 'small'
|
|
280
|
-
}
|
|
281
|
-
}, /*#__PURE__*/_react["default"].createElement(_FormUp.FormUp, null))));
|
|
286
|
+
}, icon)));
|
|
282
287
|
return /*#__PURE__*/_react["default"].createElement(_Keyboard.Keyboard, {
|
|
283
288
|
onEnter: onSelectOption,
|
|
284
289
|
onSpace: onSelectOption,
|
|
@@ -313,9 +318,7 @@ var SelectMultipleContainer = /*#__PURE__*/(0, _react.forwardRef)(function (_ref
|
|
|
313
318
|
setActiveIndex(-1);
|
|
314
319
|
onSearch(nextSearch);
|
|
315
320
|
}
|
|
316
|
-
}))), /*#__PURE__*/_react["default"].createElement(
|
|
317
|
-
flex: false
|
|
318
|
-
}, help), /*#__PURE__*/_react["default"].createElement(_StyledSelect.OptionsContainer, {
|
|
321
|
+
}))), helpContent, /*#__PURE__*/_react["default"].createElement(_StyledSelect.OptionsContainer, {
|
|
319
322
|
role: "listbox",
|
|
320
323
|
tabIndex: "0",
|
|
321
324
|
ref: optionsRef,
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports["default"] = exports.Help = void 0;
|
|
5
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
6
|
+
var _grommet = require("grommet");
|
|
7
|
+
var _SelectMultiple = require("../SelectMultiple");
|
|
8
|
+
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); }
|
|
9
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
10
|
+
var options = ['Apple', 'Orange', 'Banana', 'Grape', 'Melon', 'Strawberry', 'Kiwi', 'Mango', 'Raspberry', 'Rhubarb'];
|
|
11
|
+
var Help = function Help() {
|
|
12
|
+
var _useState = (0, _react.useState)([]),
|
|
13
|
+
valueMultiple = _useState[0],
|
|
14
|
+
setValueMultiple = _useState[1];
|
|
15
|
+
return (
|
|
16
|
+
/*#__PURE__*/
|
|
17
|
+
// Uncomment <Grommet> lines when using outside of storybook
|
|
18
|
+
// <Grommet theme={...}>
|
|
19
|
+
_react["default"].createElement(_grommet.Box, {
|
|
20
|
+
fill: true,
|
|
21
|
+
align: "center",
|
|
22
|
+
pad: "large",
|
|
23
|
+
gap: "large"
|
|
24
|
+
}, /*#__PURE__*/_react["default"].createElement(_SelectMultiple.SelectMultiple, {
|
|
25
|
+
value: valueMultiple,
|
|
26
|
+
placeholder: "Select",
|
|
27
|
+
options: options,
|
|
28
|
+
help: "something helpful",
|
|
29
|
+
onChange: function onChange(_ref) {
|
|
30
|
+
var value = _ref.value;
|
|
31
|
+
return setValueMultiple(value);
|
|
32
|
+
}
|
|
33
|
+
}))
|
|
34
|
+
// </Grommet>
|
|
35
|
+
);
|
|
36
|
+
};
|
|
37
|
+
exports.Help = Help;
|
|
38
|
+
Help.parameters = {
|
|
39
|
+
chromatic: {
|
|
40
|
+
disable: true
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
Help.args = {
|
|
44
|
+
full: true
|
|
45
|
+
};
|
|
46
|
+
var _default = {
|
|
47
|
+
title: 'Input/SelectMultiple/Help'
|
|
48
|
+
};
|
|
49
|
+
exports["default"] = _default;
|
package/components/Text/Text.js
CHANGED
|
@@ -66,9 +66,9 @@ var Text = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
66
66
|
size: size
|
|
67
67
|
}, rest, {
|
|
68
68
|
ref: textRef
|
|
69
|
-
}), /*#__PURE__*/_react["default"].createElement(_TextContext.TextContext.Provider, {
|
|
69
|
+
}), children !== undefined ? /*#__PURE__*/_react["default"].createElement(_TextContext.TextContext.Provider, {
|
|
70
70
|
value: textContextValue
|
|
71
|
-
}, children));
|
|
71
|
+
}, children) : undefined);
|
|
72
72
|
if (tipProp || textTruncated) {
|
|
73
73
|
// place the text content in a tip if truncate === 'tip'
|
|
74
74
|
// and the text has been truncated
|
|
@@ -5,6 +5,7 @@ exports.StyledTextInputContainer = exports.StyledTextInput = exports.StyledSugge
|
|
|
5
5
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
6
6
|
var _utils = require("../../utils");
|
|
7
7
|
var _defaultProps = require("../../default-props");
|
|
8
|
+
var _styles = require("../../utils/styles");
|
|
8
9
|
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); }
|
|
9
10
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
10
11
|
var getPlainStyle = function getPlainStyle(plain) {
|
|
@@ -19,7 +20,7 @@ var StyledTextInput = _styledComponents["default"].input.withConfig({
|
|
|
19
20
|
})(["", " ", " ", " ", " ", " ", " ", ";"], _utils.inputStyle, function (props) {
|
|
20
21
|
return getPlainStyle(props.plain);
|
|
21
22
|
}, function (props) {
|
|
22
|
-
return props.icon &&
|
|
23
|
+
return props.icon && _styles.inputPadForIcon;
|
|
23
24
|
}, function (props) {
|
|
24
25
|
return props.disabled && (0, _utils.disabledStyle)(props.theme.textInput.disabled && props.theme.textInput.disabled.opacity);
|
|
25
26
|
}, function (props) {
|
|
@@ -351,12 +351,13 @@ var TextInput = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
351
351
|
// otherwise we only listen to onDown on the input element itself,
|
|
352
352
|
// primarily for tests.
|
|
353
353
|
|
|
354
|
+
var textInputIcon = (0, _utils.useSizedIcon)(icon, rest.size, theme);
|
|
354
355
|
return /*#__PURE__*/_react["default"].createElement(_StyledTextInput.StyledTextInputContainer, {
|
|
355
356
|
plain: plain
|
|
356
|
-
}, showStyledPlaceholder && /*#__PURE__*/_react["default"].createElement(_StyledTextInput.StyledPlaceholder, null, placeholder),
|
|
357
|
+
}, showStyledPlaceholder && /*#__PURE__*/_react["default"].createElement(_StyledTextInput.StyledPlaceholder, null, placeholder), textInputIcon && /*#__PURE__*/_react["default"].createElement(_StyledTextInput.StyledIcon, {
|
|
357
358
|
reverse: reverse,
|
|
358
359
|
theme: theme
|
|
359
|
-
},
|
|
360
|
+
}, textInputIcon), /*#__PURE__*/_react["default"].createElement(_Keyboard.Keyboard, _extends({
|
|
360
361
|
target: focus ? 'document' : undefined
|
|
361
362
|
}, keyboardProps), /*#__PURE__*/_react["default"].createElement(_StyledTextInput.StyledTextInput, _extends({
|
|
362
363
|
"aria-label": a11yTitle,
|
|
@@ -4,7 +4,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
4
4
|
import React, { cloneElement, forwardRef, useCallback, useContext, useEffect, useState } from 'react';
|
|
5
5
|
import { ThemeContext } from 'styled-components';
|
|
6
6
|
import { defaultProps } from '../../default-props';
|
|
7
|
-
import { findButtonParent, normalizeColor } from '../../utils';
|
|
7
|
+
import { findButtonParent, normalizeColor, useSizedIcon } from '../../utils';
|
|
8
8
|
import { Box } from '../Box';
|
|
9
9
|
import { StyledAnchor } from './StyledAnchor';
|
|
10
10
|
import { AnchorPropTypes } from './propTypes';
|
|
@@ -55,8 +55,9 @@ var Anchor = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
55
55
|
color: normalizeColor(color || ((_theme$anchor = theme.anchor) == null ? void 0 : (_theme$anchor$size = _theme$anchor.size) == null ? void 0 : (_theme$anchor$size2 = _theme$anchor$size[sizeProp || size]) == null ? void 0 : _theme$anchor$size2.color) || theme.anchor.color, theme)
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
|
-
var
|
|
59
|
-
var
|
|
58
|
+
var anchorIcon = useSizedIcon(coloredIcon, sizeProp || size, theme);
|
|
59
|
+
var first = reverse ? label : anchorIcon;
|
|
60
|
+
var second = reverse ? anchorIcon : label;
|
|
60
61
|
return /*#__PURE__*/React.createElement(StyledAnchor, _extends({}, rest, {
|
|
61
62
|
ref: ref,
|
|
62
63
|
"aria-label": ariaLabel || a11yTitle,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useContext, useRef
|
|
1
|
+
import React, { useContext, useRef } from 'react';
|
|
2
2
|
import styled, { ThemeContext } from 'styled-components';
|
|
3
3
|
import { parseMetricToNum } from '../../utils';
|
|
4
4
|
import { useLayoutEffect } from '../../utils/use-isomorphic-layout-effect';
|
|
@@ -15,21 +15,13 @@ export var Badge = function Badge(_ref) {
|
|
|
15
15
|
var children = _ref.children,
|
|
16
16
|
content = _ref.content;
|
|
17
17
|
var theme = useContext(ThemeContext);
|
|
18
|
+
var containerRef = useRef();
|
|
18
19
|
var contentRef = useRef();
|
|
19
20
|
var stackRef = useRef();
|
|
20
21
|
var defaultBadgeDimension = typeof content === 'boolean' || content && content.value && typeof content.value === 'boolean' ? // empty badge should be smaller. this value was chosen as a default
|
|
21
22
|
// after experimenting with various values
|
|
22
23
|
parseMetricToNum(theme.button.badge.size.medium) / 2 + "px" : theme.button.badge.size.medium;
|
|
23
24
|
|
|
24
|
-
// size should drive height, match width to height by default
|
|
25
|
-
// allow width to grow when content is wide
|
|
26
|
-
var _useState = useState(defaultBadgeDimension),
|
|
27
|
-
height = _useState[0],
|
|
28
|
-
setHeight = _useState[1];
|
|
29
|
-
var _useState2 = useState(height),
|
|
30
|
-
width = _useState2[0],
|
|
31
|
-
setWidth = _useState2[1];
|
|
32
|
-
|
|
33
25
|
// scale badge to fit its contents, leaving space horizontally
|
|
34
26
|
// that is proportional to vertical space
|
|
35
27
|
useLayoutEffect(function () {
|
|
@@ -37,26 +29,38 @@ export var Badge = function Badge(_ref) {
|
|
|
37
29
|
// can change (because pad is responsive, etc.). we want to recalculate
|
|
38
30
|
// width since badge offset is reliant on its dimensions.
|
|
39
31
|
var onResize = function onResize() {
|
|
40
|
-
if (
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
32
|
+
if (containerRef != null && containerRef.current) {
|
|
33
|
+
containerRef.current.style.minHeight = '';
|
|
34
|
+
containerRef.current.style.minWidth = '';
|
|
35
|
+
if (contentRef != null && contentRef.current) {
|
|
36
|
+
if (typeof content === 'number' || typeof content === 'object' && content.value) {
|
|
37
|
+
containerRef.current.style.minHeight = defaultBadgeDimension;
|
|
38
|
+
containerRef.current.style.minWidth = defaultBadgeDimension;
|
|
39
|
+
var _contentRef$current$g = contentRef.current.getBoundingClientRect(),
|
|
40
|
+
contentHeight = _contentRef$current$g.height,
|
|
41
|
+
contentWidth = _contentRef$current$g.width;
|
|
45
42
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
43
|
+
// only adjust the width if contentHeight > 0
|
|
44
|
+
// jest returns 0 for all getBoundingClientRect values,
|
|
45
|
+
// so this ensures snapshots are closer to correct values
|
|
46
|
+
if (contentHeight) {
|
|
47
|
+
// height of content includes extra space around font from
|
|
48
|
+
// line-height. account for this extra space with 2.5 multiplier
|
|
49
|
+
// to add proportional horizontal space
|
|
50
|
+
var height = defaultBadgeDimension;
|
|
51
|
+
var width = defaultBadgeDimension;
|
|
52
|
+
var verticalSpace = (parseMetricToNum(height) - contentHeight) * 2.5;
|
|
53
|
+
containerRef.current.style.minHeight = height;
|
|
54
|
+
containerRef.current.style.minWidth = Math.max(parseMetricToNum(width), Math.ceil(contentWidth + verticalSpace)) + "px";
|
|
55
|
+
}
|
|
56
|
+
} else {
|
|
57
|
+
// caller has provided custom JSX
|
|
58
|
+
containerRef.current.style.minHeight = contentRef.current.getBoundingClientRect().width;
|
|
59
|
+
containerRef.current.style.minWidth = contentRef.current.getBoundingClientRect().height;
|
|
55
60
|
}
|
|
56
61
|
} else {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
setHeight(contentRef.current.getBoundingClientRect().height + "px");
|
|
62
|
+
containerRef.current.style.minHeight = defaultBadgeDimension;
|
|
63
|
+
containerRef.current.style.minWidth = defaultBadgeDimension;
|
|
60
64
|
}
|
|
61
65
|
}
|
|
62
66
|
};
|
|
@@ -65,26 +69,26 @@ export var Badge = function Badge(_ref) {
|
|
|
65
69
|
return function () {
|
|
66
70
|
window.removeEventListener('resize', onResize);
|
|
67
71
|
};
|
|
68
|
-
}, [content,
|
|
72
|
+
}, [content, defaultBadgeDimension]);
|
|
69
73
|
|
|
70
74
|
// offset the badge so it overlaps content
|
|
71
75
|
useLayoutEffect(function () {
|
|
72
|
-
if (stackRef && stackRef.current) {
|
|
76
|
+
if (stackRef != null && stackRef.current) {
|
|
73
77
|
// when badge has content, offset should be 50%.
|
|
74
78
|
// when badge is empty, offset by a smaller amount to keep the badge
|
|
75
79
|
// closer to the content. this value was chosen as a reasonable default
|
|
76
80
|
// after testing with various grommet icons.
|
|
77
|
-
var
|
|
78
|
-
|
|
79
|
-
right: "-" + Math.round(parseMetricToNum(width) / divisor) + "px",
|
|
80
|
-
top: "-" + Math.round(parseMetricToNum(height) / divisor) + "px"
|
|
81
|
-
};
|
|
81
|
+
var offset = typeof content === 'boolean' || content && content.value === true ? '25%' : '50%';
|
|
82
|
+
|
|
82
83
|
// second child of Stack is the div that receives absolute positioning
|
|
83
84
|
// and contains our badge content
|
|
84
|
-
stackRef.current.children[1].style.top =
|
|
85
|
-
stackRef.current.children[1].style.right =
|
|
85
|
+
stackRef.current.children[1].style.top = 0;
|
|
86
|
+
stackRef.current.children[1].style.right = 0;
|
|
87
|
+
// eslint-disable-next-line max-len
|
|
88
|
+
stackRef.current.children[1].style.transform = "translate(" + offset + ", -" + offset + ")";
|
|
89
|
+
stackRef.current.children[1].style.transformOrigin = '100% 0%';
|
|
86
90
|
}
|
|
87
|
-
}, [content
|
|
91
|
+
}, [content]);
|
|
88
92
|
var value;
|
|
89
93
|
if (typeof content === 'number') value = content;else if (typeof content === 'object') value = content.value;
|
|
90
94
|
var badge;
|
|
@@ -99,18 +103,13 @@ export var Badge = function Badge(_ref) {
|
|
|
99
103
|
}, value > max ? max + "+" : value);
|
|
100
104
|
}
|
|
101
105
|
badge = /*#__PURE__*/React.createElement(StyledBadgeContainer, {
|
|
106
|
+
ref: containerRef,
|
|
102
107
|
align: "center",
|
|
103
108
|
background: content.background || theme.button.badge.container.background,
|
|
104
109
|
flex: false,
|
|
105
|
-
height: {
|
|
106
|
-
min: height
|
|
107
|
-
},
|
|
108
110
|
justify: "center",
|
|
109
111
|
round: true,
|
|
110
|
-
pad: !(typeof value === 'boolean' || typeof content === 'boolean') ? theme.button.badge.container.pad : undefined
|
|
111
|
-
width: {
|
|
112
|
-
min: width
|
|
113
|
-
}
|
|
112
|
+
pad: !(typeof value === 'boolean' || typeof content === 'boolean') ? theme.button.badge.container.pad : undefined
|
|
114
113
|
}, badge);
|
|
115
114
|
// caller has provided their own JSX and we will just render that
|
|
116
115
|
} else badge = /*#__PURE__*/React.createElement(Box, {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
var _excluded = ["active", "align", "aria-label", "badge", "color", "children", "disabled", "icon", "focusIndicator", "gap", "fill", "href", "justify", "kind", "label", "onBlur", "onClick", "onFocus", "onMouseOut", "onMouseOver", "plain", "primary", "reverse", "secondary", "selected", "size", "tip", "type", "a11yTitle", "as"];
|
|
1
|
+
var _excluded = ["active", "align", "aria-label", "badge", "color", "children", "disabled", "icon", "focusIndicator", "gap", "fill", "href", "justify", "kind", "label", "onBlur", "onClick", "onFocus", "onMouseOut", "onMouseOver", "pad", "plain", "primary", "reverse", "secondary", "selected", "size", "tip", "type", "a11yTitle", "as"];
|
|
2
2
|
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); }
|
|
3
3
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
4
4
|
import React, { cloneElement, Children, forwardRef, useContext, useMemo, useState, useCallback } from 'react';
|
|
5
5
|
import { ThemeContext } from 'styled-components';
|
|
6
|
-
import { backgroundAndTextColors, colorIsDark, findButtonParent, normalizeBackground, normalizeColor } from '../../utils';
|
|
6
|
+
import { backgroundAndTextColors, colorIsDark, findButtonParent, useSizedIcon, normalizeBackground, normalizeColor } from '../../utils';
|
|
7
7
|
import { defaultProps } from '../../default-props';
|
|
8
8
|
import { ButtonPropTypes } from './propTypes';
|
|
9
9
|
import { Box } from '../Box';
|
|
@@ -132,7 +132,7 @@ var getPropertyColor = function getPropertyColor(property, paths, theme, kind, p
|
|
|
132
132
|
return result;
|
|
133
133
|
};
|
|
134
134
|
var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
135
|
-
var _theme$button$kind;
|
|
135
|
+
var _theme$button$kind, _theme$button2, _theme$button2$badge;
|
|
136
136
|
var active = _ref.active,
|
|
137
137
|
_ref$align = _ref.align,
|
|
138
138
|
align = _ref$align === void 0 ? 'center' : _ref$align,
|
|
@@ -155,6 +155,7 @@ var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
155
155
|
_onFocus = _ref.onFocus,
|
|
156
156
|
onMouseOut = _ref.onMouseOut,
|
|
157
157
|
onMouseOver = _ref.onMouseOver,
|
|
158
|
+
pad = _ref.pad,
|
|
158
159
|
plain = _ref.plain,
|
|
159
160
|
primary = _ref.primary,
|
|
160
161
|
reverseProp = _ref.reverse,
|
|
@@ -245,14 +246,6 @@ var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
245
246
|
}
|
|
246
247
|
return result;
|
|
247
248
|
}, [active, disabled, kind, kindObj, plain, selected]);
|
|
248
|
-
if (skeleton) {
|
|
249
|
-
var _theme$text, _theme$button$size;
|
|
250
|
-
return /*#__PURE__*/React.createElement(Skeleton, _extends({
|
|
251
|
-
ref: ref,
|
|
252
|
-
height: ((_theme$text = theme.text[size || 'medium']) == null ? void 0 : _theme$text.height) || size,
|
|
253
|
-
a11yTitle: a11yTitle
|
|
254
|
-
}, rest, (_theme$button$size = theme.button.size) == null ? void 0 : _theme$button$size[size || 'medium'], theme.button.skeleton));
|
|
255
|
-
}
|
|
256
249
|
|
|
257
250
|
// only used when theme does not have button.default
|
|
258
251
|
var isDarkBackground = function isDarkBackground() {
|
|
@@ -294,6 +287,15 @@ var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
294
287
|
color: _iconColor
|
|
295
288
|
});
|
|
296
289
|
}
|
|
290
|
+
buttonIcon = useSizedIcon(buttonIcon, size, theme);
|
|
291
|
+
if (skeleton) {
|
|
292
|
+
var _theme$text, _theme$button$size;
|
|
293
|
+
return /*#__PURE__*/React.createElement(Skeleton, _extends({
|
|
294
|
+
ref: ref,
|
|
295
|
+
height: ((_theme$text = theme.text[size || 'medium']) == null ? void 0 : _theme$text.height) || size,
|
|
296
|
+
a11yTitle: a11yTitle
|
|
297
|
+
}, rest, (_theme$button$size = theme.button.size) == null ? void 0 : _theme$button$size[size || 'medium'], theme.button.skeleton));
|
|
298
|
+
}
|
|
297
299
|
var reverse = reverseProp != null ? reverseProp : (_theme$button$kind = theme.button[kind]) == null ? void 0 : _theme$button$kind.reverse;
|
|
298
300
|
var domTag = !as && href ? 'a' : as;
|
|
299
301
|
var first = reverse ? label : buttonIcon;
|
|
@@ -324,7 +326,7 @@ var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
324
326
|
// (!kind && icon && !label) is necessary because for old button logic,
|
|
325
327
|
// if button has icon but not label, it will be considered "plain",
|
|
326
328
|
// so no border or background will be applied
|
|
327
|
-
var innerBadge = !background && !border || !kind && icon && !label;
|
|
329
|
+
var innerBadge = ((_theme$button2 = theme.button) == null ? void 0 : (_theme$button2$badge = _theme$button2.badge) == null ? void 0 : _theme$button2$badge.align) !== 'container' && (!background && !border || !kind && icon && !label);
|
|
328
330
|
if (badgeProp && innerBadge) {
|
|
329
331
|
contents = /*#__PURE__*/React.createElement(Badge, {
|
|
330
332
|
content: badgeProp
|
|
@@ -362,6 +364,7 @@ var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
362
364
|
},
|
|
363
365
|
onMouseOver: onMouseOverButton,
|
|
364
366
|
onMouseOut: onMouseOutButton,
|
|
367
|
+
pad: pad,
|
|
365
368
|
plain: plain || Children.count(children) > 0,
|
|
366
369
|
primary: primary,
|
|
367
370
|
sizeProp: size,
|
|
@@ -396,7 +399,7 @@ var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
396
399
|
},
|
|
397
400
|
onMouseOver: onMouseOverButton,
|
|
398
401
|
onMouseOut: onMouseOutButton,
|
|
399
|
-
pad: !plain,
|
|
402
|
+
pad: pad || !plain,
|
|
400
403
|
plain: typeof plain !== 'undefined' ? plain : Children.count(children) > 0 || icon && !label,
|
|
401
404
|
primary: primary,
|
|
402
405
|
sizeProp: size,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
|
-
import { activeStyle, backgroundStyle, disabledStyle, focusStyle, unfocusStyle, genericStyles, getHoverIndicatorStyle, normalizeColor } from '../../utils';
|
|
2
|
+
import { activeStyle, backgroundStyle, disabledStyle, edgeStyle, focusStyle, unfocusStyle, genericStyles, getHoverIndicatorStyle, normalizeColor } from '../../utils';
|
|
3
3
|
import { defaultProps } from '../../default-props';
|
|
4
4
|
var radiusStyle = function radiusStyle(props) {
|
|
5
5
|
// border.radius shouldn't impact an only-icon rendering.
|
|
@@ -71,7 +71,7 @@ var disabledButtonStyle = function disabledButtonStyle(props) {
|
|
|
71
71
|
var StyledButton = styled.button.withConfig({
|
|
72
72
|
displayName: "StyledButton",
|
|
73
73
|
componentId: "sc-323bzc-0"
|
|
74
|
-
})(["display:inline-block;box-sizing:border-box;cursor:pointer;font:inherit;text-decoration:none;margin:0;background:transparent;overflow:visible;text-transform:none;", " ", " ", " ", " ", " ", " ", " &:focus{", "}&:focus:not(:focus-visible){", "}", " ", " ", " ", " ", ""], genericStyles, function (props) {
|
|
74
|
+
})(["display:inline-block;box-sizing:border-box;cursor:pointer;font:inherit;text-decoration:none;margin:0;background:transparent;overflow:visible;text-transform:none;", " ", " ", " ", " ", " ", " ", " &:focus{", "}&:focus:not(:focus-visible){", "}", " ", " ", " ", " ", " ", ""], genericStyles, function (props) {
|
|
75
75
|
return props.plain && plainStyle(props);
|
|
76
76
|
}, function (props) {
|
|
77
77
|
return !props.plain && basicStyle(props);
|
|
@@ -92,7 +92,9 @@ var StyledButton = styled.button.withConfig({
|
|
|
92
92
|
}, function (props) {
|
|
93
93
|
return props.hasIcon && !props.hasLabel && "\n line-height: 0;\n ";
|
|
94
94
|
}, function (props) {
|
|
95
|
-
return props.pad && props.hasIcon && !props.hasLabel && "\n padding: " + props.theme.global.edgeSize.small + ";\n ";
|
|
95
|
+
return props.pad === true && props.hasIcon && !props.hasLabel && "\n padding: " + props.theme.global.edgeSize.small + ";\n ";
|
|
96
|
+
}, function (props) {
|
|
97
|
+
return !props.plain && props.pad && edgeStyle('padding', props.pad, false, undefined, props.theme);
|
|
96
98
|
}, function (props) {
|
|
97
99
|
return props.theme.button && props.theme.button.extend;
|
|
98
100
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
|
-
import { activeStyle, disabledStyle, focusStyle, unfocusStyle, genericStyles, kindPartStyles, parseMetricToNum } from '../../utils';
|
|
2
|
+
import { activeStyle, disabledStyle, edgeStyle, focusStyle, unfocusStyle, genericStyles, kindPartStyles, parseMetricToNum } from '../../utils';
|
|
3
3
|
import { defaultProps } from '../../default-props';
|
|
4
4
|
var radiusStyle = function radiusStyle(props) {
|
|
5
5
|
var size = props.sizeProp;
|
|
@@ -13,7 +13,7 @@ var radiusStyle = function radiusStyle(props) {
|
|
|
13
13
|
var fontStyle = function fontStyle(props) {
|
|
14
14
|
var size = props.sizeProp || 'medium';
|
|
15
15
|
var data = props.theme.text[size];
|
|
16
|
-
return css(["font-size:", ";line-height:", ";"], data.size, data.height);
|
|
16
|
+
return css(["font-size:", ";line-height:", ";"], data.size, props.hasIcon && !props.hasLabel ? 0 : data.height);
|
|
17
17
|
};
|
|
18
18
|
var padFromTheme = function padFromTheme(size, theme, themeObj, kind, iconOnly) {
|
|
19
19
|
var _themeObj$size, _themeObj$size$size, _themeObj$size$size$i, _themeObj$size3, _themeObj$size3$size, _themeObj$size3$size$;
|
|
@@ -160,7 +160,7 @@ var fillStyle = function fillStyle(fillContainer) {
|
|
|
160
160
|
return undefined;
|
|
161
161
|
};
|
|
162
162
|
var plainStyle = function plainStyle(props) {
|
|
163
|
-
return css(["outline:none;border:none;padding:0;text-align:inherit;color:inherit;", ""], props.icon && "\n > svg {\n display: flex;\n align-self: center;\n vertical-align: middle;\n }\n ");
|
|
163
|
+
return css(["outline:none;border:none;padding:0;text-align:inherit;color:inherit;", " ", ""], props.icon && "\n > svg {\n display: flex;\n align-self: center;\n vertical-align: middle;\n }\n ", props.hasIcon && !props.hasLabel && "line-height: 0;");
|
|
164
164
|
};
|
|
165
165
|
var StyledButtonKind = styled.button.withConfig({
|
|
166
166
|
// don't let kind attribute leak to DOM
|
|
@@ -171,7 +171,7 @@ var StyledButtonKind = styled.button.withConfig({
|
|
|
171
171
|
}).withConfig({
|
|
172
172
|
displayName: "StyledButtonKind",
|
|
173
173
|
componentId: "sc-1vhfpnt-0"
|
|
174
|
-
})(["display:inline-block;box-sizing:border-box;cursor:pointer;font:inherit;text-decoration:none;margin:0;background:transparent;overflow:visible;text-transform:none;", " ", " ", " ", " ", " ", " ", " ", " &:focus{", "}&:focus:not(:focus-visible){", "}", " ", " ", ""], genericStyles, function (props) {
|
|
174
|
+
})(["display:inline-block;box-sizing:border-box;cursor:pointer;font:inherit;text-decoration:none;margin:0;background:transparent;overflow:visible;text-transform:none;", " ", " ", " ", " ", " ", " ", " ", " ", " &:focus{", "}&:focus:not(:focus-visible){", "}", " ", " ", ""], genericStyles, function (props) {
|
|
175
175
|
return props.plain && plainStyle(props);
|
|
176
176
|
}, function (props) {
|
|
177
177
|
return !props.disabled && props.active && activeStyle;
|
|
@@ -179,6 +179,8 @@ var StyledButtonKind = styled.button.withConfig({
|
|
|
179
179
|
return !props.plain && basicStyle(props);
|
|
180
180
|
}, function (props) {
|
|
181
181
|
return !props.plain && kindStyle(props);
|
|
182
|
+
}, function (props) {
|
|
183
|
+
return !props.plain && props.pad && edgeStyle('padding', props.pad, false, undefined, props.theme);
|
|
182
184
|
}, function (props) {
|
|
183
185
|
return !props.plain && props.align && "\n text-align: " + props.align + ";\n ";
|
|
184
186
|
}, function (props) {
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
HoverIndicatorType,
|
|
11
11
|
MarginType,
|
|
12
12
|
Omit,
|
|
13
|
+
PadType,
|
|
13
14
|
PolymorphicType,
|
|
14
15
|
} from '../../utils';
|
|
15
16
|
|
|
@@ -60,6 +61,7 @@ export interface ButtonProps {
|
|
|
60
61
|
icon?: JSX.Element;
|
|
61
62
|
kind?: string;
|
|
62
63
|
label?: React.ReactNode;
|
|
64
|
+
pad?: PadType;
|
|
63
65
|
plain?: boolean;
|
|
64
66
|
primary?: boolean;
|
|
65
67
|
reverse?: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
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); }
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { backgroundPropType, genericProps, colorPropType, hoverIndicatorPropType } from '../../utils/general-prop-types';
|
|
3
|
+
import { backgroundPropType, genericProps, colorPropType, hoverIndicatorPropType, padPropType } from '../../utils/general-prop-types';
|
|
4
4
|
var PropType = {};
|
|
5
5
|
if (process.env.NODE_ENV !== 'production') {
|
|
6
6
|
PropType = _extends({}, genericProps, {
|
|
@@ -23,6 +23,7 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
23
23
|
justify: PropTypes.oneOf(['around', 'between', 'center', 'end', 'evenly', 'start', 'stretch']),
|
|
24
24
|
label: PropTypes.node,
|
|
25
25
|
onClick: PropTypes.func,
|
|
26
|
+
pad: padPropType,
|
|
26
27
|
plain: PropTypes.bool,
|
|
27
28
|
primary: PropTypes.bool,
|
|
28
29
|
reverse: PropTypes.bool,
|
|
@@ -252,42 +252,48 @@ export var DataForm = function DataForm(_ref) {
|
|
|
252
252
|
useEffect(function () {
|
|
253
253
|
return setFormValue(viewToFormValue(view));
|
|
254
254
|
}, [view]);
|
|
255
|
+
var content = children;
|
|
256
|
+
if (footer !== false || pad) {
|
|
257
|
+
content = /*#__PURE__*/React.createElement(Box, {
|
|
258
|
+
fill: "vertical"
|
|
259
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
260
|
+
flex: true,
|
|
261
|
+
overflow: "auto",
|
|
262
|
+
pad: {
|
|
263
|
+
horizontal: pad,
|
|
264
|
+
top: pad
|
|
265
|
+
}
|
|
266
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
267
|
+
flex: false
|
|
268
|
+
}, content)), footer !== false && updateOn === 'submit' && /*#__PURE__*/React.createElement(Footer, {
|
|
269
|
+
flex: false,
|
|
270
|
+
margin: {
|
|
271
|
+
top: 'small'
|
|
272
|
+
},
|
|
273
|
+
pad: {
|
|
274
|
+
horizontal: pad,
|
|
275
|
+
bottom: pad
|
|
276
|
+
},
|
|
277
|
+
gap: "small"
|
|
278
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
279
|
+
label: format({
|
|
280
|
+
id: 'dataForm.submit',
|
|
281
|
+
messages: messages == null ? void 0 : messages.dataForm
|
|
282
|
+
}),
|
|
283
|
+
type: "submit",
|
|
284
|
+
primary: true
|
|
285
|
+
}), /*#__PURE__*/React.createElement(HideableButton, _extends({
|
|
286
|
+
label: format({
|
|
287
|
+
id: 'dataForm.reset',
|
|
288
|
+
messages: messages == null ? void 0 : messages.dataForm
|
|
289
|
+
}),
|
|
290
|
+
type: "reset",
|
|
291
|
+
onClick: onReset
|
|
292
|
+
}, !changed ? hideButtonProps : {}))));
|
|
293
|
+
}
|
|
255
294
|
return /*#__PURE__*/React.createElement(MaxForm, _extends({}, rest, {
|
|
256
295
|
value: formValue,
|
|
257
296
|
onSubmit: updateOn === 'submit' ? onSubmit : undefined,
|
|
258
297
|
onChange: onChange
|
|
259
|
-
}),
|
|
260
|
-
fill: "vertical"
|
|
261
|
-
}, /*#__PURE__*/React.createElement(Box, {
|
|
262
|
-
flex: true,
|
|
263
|
-
overflow: "auto",
|
|
264
|
-
pad: {
|
|
265
|
-
horizontal: pad,
|
|
266
|
-
top: pad
|
|
267
|
-
}
|
|
268
|
-
}, children), footer !== false && updateOn === 'submit' && /*#__PURE__*/React.createElement(Footer, {
|
|
269
|
-
flex: false,
|
|
270
|
-
margin: {
|
|
271
|
-
top: 'small'
|
|
272
|
-
},
|
|
273
|
-
pad: {
|
|
274
|
-
horizontal: pad,
|
|
275
|
-
bottom: pad
|
|
276
|
-
},
|
|
277
|
-
gap: "small"
|
|
278
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
279
|
-
label: format({
|
|
280
|
-
id: 'dataForm.submit',
|
|
281
|
-
messages: messages == null ? void 0 : messages.dataForm
|
|
282
|
-
}),
|
|
283
|
-
type: "submit",
|
|
284
|
-
primary: true
|
|
285
|
-
}), /*#__PURE__*/React.createElement(HideableButton, _extends({
|
|
286
|
-
label: format({
|
|
287
|
-
id: 'dataForm.reset',
|
|
288
|
-
messages: messages == null ? void 0 : messages.dataForm
|
|
289
|
-
}),
|
|
290
|
-
type: "reset",
|
|
291
|
-
onClick: onReset
|
|
292
|
-
}, !changed ? hideButtonProps : {})))));
|
|
298
|
+
}), content);
|
|
293
299
|
};
|
|
@@ -44,7 +44,7 @@ export var DataView = function DataView(_ref) {
|
|
|
44
44
|
id: id,
|
|
45
45
|
name: "_view",
|
|
46
46
|
showSelectedInline: true,
|
|
47
|
-
placeholder: noForm ? 'Select view
|
|
47
|
+
placeholder: noForm ? 'Select view' : undefined,
|
|
48
48
|
options: names,
|
|
49
49
|
value: view == null ? void 0 : view.name
|
|
50
50
|
}, rest));
|
|
@@ -34,6 +34,7 @@ var getReference = function getReference(value) {
|
|
|
34
34
|
return adjustedDate;
|
|
35
35
|
};
|
|
36
36
|
var DateInput = /*#__PURE__*/forwardRef(function (_ref, refArg) {
|
|
37
|
+
var _theme$icon, _theme$dateInput$icon;
|
|
37
38
|
var buttonProps = _ref.buttonProps,
|
|
38
39
|
calendarProps = _ref.calendarProps,
|
|
39
40
|
defaultValue = _ref.defaultValue,
|
|
@@ -58,7 +59,7 @@ var DateInput = /*#__PURE__*/forwardRef(function (_ref, refArg) {
|
|
|
58
59
|
var announce = useContext(AnnounceContext);
|
|
59
60
|
var _useContext = useContext(MessageContext),
|
|
60
61
|
formatMessage = _useContext.format;
|
|
61
|
-
var iconSize = theme.
|
|
62
|
+
var iconSize = ((_theme$icon = theme.icon) == null ? void 0 : _theme$icon.matchSize) && rest.size || ((_theme$dateInput$icon = theme.dateInput.icon) == null ? void 0 : _theme$dateInput$icon.size) || 'medium';
|
|
62
63
|
var _useContext2 = useContext(FormContext),
|
|
63
64
|
useFormInput = _useContext2.useFormInput;
|
|
64
65
|
var ref = useForwardedRef(refArg);
|