@sproutsocial/racine 11.4.0 → 11.4.2-input-beta.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/CHANGELOG.md +8 -0
- package/__flow__/Input/index.js +34 -9
- package/__flow__/Input/index.stories.js +14 -0
- package/__flow__/Input/index.test.js +18 -0
- package/__flow__/utils/index.js +23 -0
- package/commonjs/Avatar/index.js +7 -4
- package/commonjs/Badge/index.js +3 -1
- package/commonjs/Badge/styles.js +1 -1
- package/commonjs/Banner/index.js +3 -1
- package/commonjs/Banner/styles.js +1 -1
- package/commonjs/Box/styles.js +1 -1
- package/commonjs/Breadcrumb/index.js +5 -2
- package/commonjs/Button/index.js +3 -1
- package/commonjs/Card/index.js +3 -1
- package/commonjs/Card/styles.js +3 -3
- package/commonjs/CharacterCounter/index.js +3 -1
- package/commonjs/CharacterCounter/styles.js +1 -1
- package/commonjs/ChartLegend/index.js +3 -1
- package/commonjs/ChartLegend/styles.js +3 -3
- package/commonjs/Checkbox/index.js +3 -1
- package/commonjs/Checkbox/styles.js +1 -1
- package/commonjs/Collapsible/index.js +5 -2
- package/commonjs/DatePicker/DateRangePicker.js +3 -1
- package/commonjs/DatePicker/SingleDatePicker.js +3 -1
- package/commonjs/DatePicker/StatefulDateRangePicker.js +3 -1
- package/commonjs/DatePicker/StatefulSingleDatePicker.js +3 -1
- package/commonjs/DatePicker/common.js +1 -1
- package/commonjs/DatePicker/styles.js +2 -6
- package/commonjs/Drawer/SlideTransition.js +3 -1
- package/commonjs/Drawer/index.js +9 -4
- package/commonjs/Drawer/styles.js +2 -2
- package/commonjs/EmptyState/index.js +3 -1
- package/commonjs/Fieldset/index.js +7 -3
- package/commonjs/FormField/index.js +3 -1
- package/commonjs/Icon/index.js +5 -2
- package/commonjs/Icon/styles.js +1 -1
- package/commonjs/Image/index.js +3 -1
- package/commonjs/Image/styles.js +1 -1
- package/commonjs/Indicator/index.js +3 -1
- package/commonjs/Input/index.js +32 -18
- package/commonjs/Input/styles.js +2 -2
- package/commonjs/KeyboardKey/index.js +3 -1
- package/commonjs/Label/index.js +4 -2
- package/commonjs/Link/index.js +3 -1
- package/commonjs/Link/styles.js +1 -1
- package/commonjs/Listbox/index.js +7 -4
- package/commonjs/Loader/index.js +3 -1
- package/commonjs/Loader/styles.js +2 -2
- package/commonjs/LoaderButton/index.js +3 -1
- package/commonjs/Menu/constants.js +1 -1
- package/commonjs/Menu/descendants.js +10 -7
- package/commonjs/Menu/hooks.js +1 -1
- package/commonjs/Menu/index.js +22 -16
- package/commonjs/Menu/styles.js +2 -2
- package/commonjs/Message/index.js +3 -1
- package/commonjs/Message/styles.js +1 -1
- package/commonjs/Modal/index.js +7 -3
- package/commonjs/Modal/styles.js +4 -6
- package/commonjs/Numeral/constants.js +1 -1
- package/commonjs/Numeral/index.js +3 -1
- package/commonjs/Numeral/styles.js +3 -3
- package/commonjs/OverflowList/styles.js +1 -1
- package/commonjs/Popout/index.js +7 -3
- package/commonjs/Popout/styles.js +1 -1
- package/commonjs/Radio/index.js +3 -1
- package/commonjs/Radio/styles.js +4 -4
- package/commonjs/SegmentedControl/index.js +5 -2
- package/commonjs/Select/index.js +3 -1
- package/commonjs/Stack/index.js +3 -1
- package/commonjs/Switch/index.js +3 -1
- package/commonjs/Switch/styles.js +1 -1
- package/commonjs/Table/index.js +10 -5
- package/commonjs/TableCell/index.js +3 -1
- package/commonjs/TableHeaderCell/index.js +3 -1
- package/commonjs/TableRowAccordion/index.js +3 -1
- package/commonjs/Tabs/index.js +5 -2
- package/commonjs/Tabs/styles.js +4 -4
- package/commonjs/Text/index.js +3 -1
- package/commonjs/Text/styles.js +1 -1
- package/commonjs/Textarea/index.js +3 -1
- package/commonjs/Toast/index.js +15 -15
- package/commonjs/Toast/styles.js +4 -7
- package/commonjs/ToggleHint/index.js +3 -1
- package/commonjs/Token/index.js +3 -1
- package/commonjs/Token/styles.js +1 -1
- package/commonjs/TokenInput/index.js +3 -1
- package/commonjs/Tooltip/index.js +5 -2
- package/commonjs/Tooltip/styles.js +1 -1
- package/commonjs/VisuallyHidden/index.js +1 -1
- package/commonjs/index.js +1 -1
- package/commonjs/themes/dark/decorative-palettes.js +1 -1
- package/commonjs/themes/dark/theme.js +1 -1
- package/commonjs/themes/light/decorative-palettes.js +1 -1
- package/commonjs/themes/light/theme.js +1 -1
- package/commonjs/utils/hooks.js +3 -2
- package/commonjs/utils/index.js +29 -2
- package/commonjs/utils/mixins.js +1 -1
- package/commonjs/utils/system-props.js +1 -1
- package/dist/themes/dark/dark.scss +5 -5
- package/dist/themes/light/light.scss +95 -95
- package/lib/Avatar/index.js +7 -4
- package/lib/Badge/index.js +3 -1
- package/lib/Badge/styles.js +1 -1
- package/lib/Banner/index.js +3 -1
- package/lib/Banner/styles.js +1 -1
- package/lib/Box/styles.js +1 -1
- package/lib/Breadcrumb/index.js +5 -2
- package/lib/Button/index.js +3 -1
- package/lib/Card/index.js +3 -1
- package/lib/Card/styles.js +2 -2
- package/lib/CharacterCounter/index.js +3 -1
- package/lib/CharacterCounter/styles.js +1 -1
- package/lib/ChartLegend/index.js +3 -1
- package/lib/ChartLegend/styles.js +3 -3
- package/lib/Checkbox/index.js +3 -1
- package/lib/Collapsible/index.js +5 -2
- package/lib/DatePicker/DateRangePicker.js +3 -1
- package/lib/DatePicker/SingleDatePicker.js +3 -1
- package/lib/DatePicker/StatefulDateRangePicker.js +3 -1
- package/lib/DatePicker/StatefulSingleDatePicker.js +3 -1
- package/lib/DatePicker/styles.js +2 -6
- package/lib/Drawer/SlideTransition.js +3 -1
- package/lib/Drawer/index.js +9 -4
- package/lib/Drawer/styles.js +2 -2
- package/lib/EmptyState/index.js +3 -1
- package/lib/Fieldset/index.js +7 -3
- package/lib/FormField/index.js +3 -1
- package/lib/Icon/index.js +5 -2
- package/lib/Icon/styles.js +1 -1
- package/lib/Image/index.js +3 -1
- package/lib/Image/styles.js +1 -1
- package/lib/Indicator/index.js +3 -1
- package/lib/Input/index.js +31 -18
- package/lib/Input/styles.js +2 -2
- package/lib/KeyboardKey/index.js +3 -1
- package/lib/Label/index.js +4 -2
- package/lib/Link/index.js +3 -1
- package/lib/Link/styles.js +1 -1
- package/lib/Listbox/index.js +6 -3
- package/lib/Loader/index.js +3 -1
- package/lib/Loader/styles.js +2 -2
- package/lib/LoaderButton/index.js +3 -1
- package/lib/Menu/descendants.js +5 -2
- package/lib/Menu/index.js +20 -16
- package/lib/Menu/styles.js +2 -2
- package/lib/Message/index.js +3 -1
- package/lib/Modal/index.js +7 -3
- package/lib/Modal/styles.js +3 -5
- package/lib/Numeral/index.js +3 -1
- package/lib/Numeral/styles.js +2 -2
- package/lib/OverflowList/styles.js +1 -1
- package/lib/Popout/index.js +7 -3
- package/lib/Popout/styles.js +1 -1
- package/lib/Radio/index.js +3 -1
- package/lib/Radio/styles.js +4 -4
- package/lib/SegmentedControl/index.js +5 -2
- package/lib/Select/index.js +3 -1
- package/lib/Stack/index.js +3 -1
- package/lib/Switch/index.js +3 -1
- package/lib/Switch/styles.js +1 -1
- package/lib/Table/index.js +9 -4
- package/lib/TableCell/index.js +3 -1
- package/lib/TableHeaderCell/index.js +3 -1
- package/lib/TableRowAccordion/index.js +3 -1
- package/lib/Tabs/index.js +5 -2
- package/lib/Tabs/styles.js +3 -3
- package/lib/Text/index.js +3 -1
- package/lib/Text/styles.js +1 -1
- package/lib/Textarea/index.js +3 -1
- package/lib/Toast/index.js +14 -14
- package/lib/Toast/styles.js +3 -7
- package/lib/ToggleHint/index.js +3 -1
- package/lib/Token/index.js +3 -1
- package/lib/Token/styles.js +1 -1
- package/lib/TokenInput/index.js +3 -1
- package/lib/Tooltip/index.js +5 -2
- package/lib/Tooltip/styles.js +1 -1
- package/lib/VisuallyHidden/index.js +1 -1
- package/lib/utils/index.js +24 -0
- package/package.json +1 -1
package/lib/Drawer/index.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
var _excluded = ["title", "children", "render"],
|
|
2
|
+
_excluded2 = ["children"],
|
|
3
|
+
_excluded3 = ["id", "style", "offset", "direction", "children", "disableCloseOnClickOutside", "onClose", "zIndex", "closeTargets"],
|
|
4
|
+
_excluded4 = ["children", "closeButtonLabel", "direction", "disableCloseOnClickOutside", "id", "isOpen", "offset", "onClose", "zIndex", "closeTargets"];
|
|
5
|
+
|
|
1
6
|
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; }
|
|
2
7
|
|
|
3
8
|
function _extends() { _extends = Object.assign || 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); }
|
|
@@ -53,7 +58,7 @@ var DrawerHeader = function DrawerHeader(_ref) {
|
|
|
53
58
|
title = _ref$title === void 0 ? "" : _ref$title,
|
|
54
59
|
children = _ref.children,
|
|
55
60
|
render = _ref.render,
|
|
56
|
-
rest = _objectWithoutPropertiesLoose(_ref,
|
|
61
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
57
62
|
|
|
58
63
|
var drawerContext = useContext(DrawerContext);
|
|
59
64
|
|
|
@@ -79,7 +84,7 @@ var DrawerHeader = function DrawerHeader(_ref) {
|
|
|
79
84
|
|
|
80
85
|
var DrawerContent = function DrawerContent(_ref2) {
|
|
81
86
|
var children = _ref2.children,
|
|
82
|
-
rest = _objectWithoutPropertiesLoose(_ref2,
|
|
87
|
+
rest = _objectWithoutPropertiesLoose(_ref2, _excluded2);
|
|
83
88
|
|
|
84
89
|
return (
|
|
85
90
|
/*#__PURE__*/
|
|
@@ -102,7 +107,7 @@ var Drawer = function Drawer(_ref3) {
|
|
|
102
107
|
onClose = _ref3.onClose,
|
|
103
108
|
zIndex = _ref3.zIndex,
|
|
104
109
|
closeTargets = _ref3.closeTargets,
|
|
105
|
-
rest = _objectWithoutPropertiesLoose(_ref3,
|
|
110
|
+
rest = _objectWithoutPropertiesLoose(_ref3, _excluded3);
|
|
106
111
|
|
|
107
112
|
var drawerRef = useRef(null);
|
|
108
113
|
useEffect(function () {
|
|
@@ -174,7 +179,7 @@ var DrawerContainer = function DrawerContainer(_ref4) {
|
|
|
174
179
|
zIndex = _ref4$zIndex === void 0 ? 7 : _ref4$zIndex,
|
|
175
180
|
_ref4$closeTargets = _ref4.closeTargets,
|
|
176
181
|
closeTargets = _ref4$closeTargets === void 0 ? [] : _ref4$closeTargets,
|
|
177
|
-
rest = _objectWithoutPropertiesLoose(_ref4,
|
|
182
|
+
rest = _objectWithoutPropertiesLoose(_ref4, _excluded4);
|
|
178
183
|
|
|
179
184
|
return /*#__PURE__*/React.createElement(Portal, {
|
|
180
185
|
id: id
|
package/lib/Drawer/styles.js
CHANGED
|
@@ -3,11 +3,11 @@ import { COMMON } from "../utils/system-props";
|
|
|
3
3
|
import Box from "../Box";
|
|
4
4
|
export var Content = styled(Box).withConfig({
|
|
5
5
|
displayName: "styles__Content",
|
|
6
|
-
componentId: "bo5voc-0"
|
|
6
|
+
componentId: "sc-bo5voc-0"
|
|
7
7
|
})(["overflow-y:auto;"]);
|
|
8
8
|
var Container = styled.div.withConfig({
|
|
9
9
|
displayName: "styles__Container",
|
|
10
|
-
componentId: "bo5voc-1"
|
|
10
|
+
componentId: "sc-bo5voc-1"
|
|
11
11
|
})(["display:flex;flex-direction:column;position:fixed;top:0;height:100%;width:", "px;background-color:", ";box-shadow:", ";filter:blur(0);", " ", ""], function (props) {
|
|
12
12
|
return props.width;
|
|
13
13
|
}, function (props) {
|
package/lib/EmptyState/index.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
var _excluded = ["media", "headline", "subtext", "primaryAction", "secondaryAction"];
|
|
2
|
+
|
|
1
3
|
function _extends() { _extends = Object.assign || 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
4
|
|
|
3
5
|
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; }
|
|
@@ -12,7 +14,7 @@ var EmptyState = function EmptyState(_ref) {
|
|
|
12
14
|
subtext = _ref.subtext,
|
|
13
15
|
primaryAction = _ref.primaryAction,
|
|
14
16
|
secondaryAction = _ref.secondaryAction,
|
|
15
|
-
rest = _objectWithoutPropertiesLoose(_ref,
|
|
17
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
16
18
|
|
|
17
19
|
return (
|
|
18
20
|
/*#__PURE__*/
|
package/lib/Fieldset/index.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
var _excluded = ["layout", "label", "helperText", "children"],
|
|
2
|
+
_excluded2 = ["children"],
|
|
3
|
+
_excluded3 = ["children"];
|
|
4
|
+
|
|
1
5
|
function _extends() { _extends = Object.assign || 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
6
|
|
|
3
7
|
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; }
|
|
@@ -16,7 +20,7 @@ var Fieldset = function Fieldset(_ref) {
|
|
|
16
20
|
label = _ref.label,
|
|
17
21
|
helperText = _ref.helperText,
|
|
18
22
|
children = _ref.children,
|
|
19
|
-
rest = _objectWithoutPropertiesLoose(_ref,
|
|
23
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
20
24
|
|
|
21
25
|
return (
|
|
22
26
|
/*#__PURE__*/
|
|
@@ -39,7 +43,7 @@ var Fieldset = function Fieldset(_ref) {
|
|
|
39
43
|
|
|
40
44
|
var FieldsetLegend = function FieldsetLegend(_ref2) {
|
|
41
45
|
var children = _ref2.children,
|
|
42
|
-
rest = _objectWithoutPropertiesLoose(_ref2,
|
|
46
|
+
rest = _objectWithoutPropertiesLoose(_ref2, _excluded2);
|
|
43
47
|
|
|
44
48
|
return /*#__PURE__*/React.createElement(Text, _extends({
|
|
45
49
|
as: "legend",
|
|
@@ -52,7 +56,7 @@ var FieldsetLegend = function FieldsetLegend(_ref2) {
|
|
|
52
56
|
|
|
53
57
|
var FieldsetHelperText = function FieldsetHelperText(_ref3) {
|
|
54
58
|
var children = _ref3.children,
|
|
55
|
-
rest = _objectWithoutPropertiesLoose(_ref3,
|
|
59
|
+
rest = _objectWithoutPropertiesLoose(_ref3, _excluded3);
|
|
56
60
|
|
|
57
61
|
return /*#__PURE__*/React.createElement(Text, _extends({
|
|
58
62
|
as: "p",
|
package/lib/FormField/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"no babel-plugin-flow-react-proptypes";
|
|
2
2
|
|
|
3
|
+
var _excluded = ["children", "error", "helperText", "id", "isInvalid", "label", "mb", "qa", "isLabelHidden"];
|
|
4
|
+
|
|
3
5
|
function _extends() { _extends = Object.assign || 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); }
|
|
4
6
|
|
|
5
7
|
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; }
|
|
@@ -27,7 +29,7 @@ var FormField = function FormField(_ref) {
|
|
|
27
29
|
qa = _ref.qa,
|
|
28
30
|
_ref$isLabelHidden = _ref.isLabelHidden,
|
|
29
31
|
isLabelHidden = _ref$isLabelHidden === void 0 ? false : _ref$isLabelHidden,
|
|
30
|
-
rest = _objectWithoutPropertiesLoose(_ref,
|
|
32
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
31
33
|
|
|
32
34
|
var _useState = useState(identifier || "FormField-" + idCounter++),
|
|
33
35
|
id = _useState[0];
|
package/lib/Icon/index.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
var _excluded = ["name", "size", "fixedWidth", "ariaLabel"],
|
|
2
|
+
_excluded2 = ["activeName", "inactiveName", "isActive", "size", "fixedWidth", "ariaLabel"];
|
|
3
|
+
|
|
1
4
|
function _extends() { _extends = Object.assign || 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
5
|
|
|
3
6
|
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; }
|
|
@@ -16,7 +19,7 @@ var Icon = function Icon(_ref) {
|
|
|
16
19
|
_ref$fixedWidth = _ref.fixedWidth,
|
|
17
20
|
fixedWidth = _ref$fixedWidth === void 0 ? false : _ref$fixedWidth,
|
|
18
21
|
ariaLabel = _ref.ariaLabel,
|
|
19
|
-
rest = _objectWithoutPropertiesLoose(_ref,
|
|
22
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
20
23
|
|
|
21
24
|
var iconName = deprecatedIcons[name] || name;
|
|
22
25
|
var iconViewBox = iconViewBoxes[iconName];
|
|
@@ -57,7 +60,7 @@ var IconToggle = function IconToggle(_ref2) {
|
|
|
57
60
|
_ref2$fixedWidth = _ref2.fixedWidth,
|
|
58
61
|
fixedWidth = _ref2$fixedWidth === void 0 ? false : _ref2$fixedWidth,
|
|
59
62
|
ariaLabel = _ref2.ariaLabel,
|
|
60
|
-
rest = _objectWithoutPropertiesLoose(_ref2,
|
|
63
|
+
rest = _objectWithoutPropertiesLoose(_ref2, _excluded2);
|
|
61
64
|
|
|
62
65
|
return (
|
|
63
66
|
/*#__PURE__*/
|
package/lib/Icon/styles.js
CHANGED
|
@@ -19,7 +19,7 @@ var Container = styled.span.attrs({
|
|
|
19
19
|
className: "Icon"
|
|
20
20
|
}).withConfig({
|
|
21
21
|
displayName: "styles__Container",
|
|
22
|
-
componentId: "x0vwa5-0"
|
|
22
|
+
componentId: "sc-x0vwa5-0"
|
|
23
23
|
})(["display:inline-block;color:inherit;vertical-align:middle;", " ", " ", ""], function (props) {
|
|
24
24
|
return stylesForSize(sizes[props.iconSize], props.fixedWidth);
|
|
25
25
|
}, COMMON, verticalAlign);
|
package/lib/Image/index.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
var _excluded = ["alt", "title", "onClick", "onError", "onLoad", "src", "qa"];
|
|
2
|
+
|
|
1
3
|
function _extends() { _extends = Object.assign || 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
4
|
|
|
3
5
|
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; }
|
|
@@ -85,7 +87,7 @@ var Image = /*#__PURE__*/function (_React$Component) {
|
|
|
85
87
|
onLoad = _this$props.onLoad,
|
|
86
88
|
src = _this$props.src,
|
|
87
89
|
qa = _this$props.qa,
|
|
88
|
-
rest = _objectWithoutPropertiesLoose(_this$props,
|
|
90
|
+
rest = _objectWithoutPropertiesLoose(_this$props, _excluded);
|
|
89
91
|
|
|
90
92
|
return /*#__PURE__*/React.createElement(ImageContainer, _extends({
|
|
91
93
|
isLoading: !this.state.didLoad,
|
package/lib/Image/styles.js
CHANGED
|
@@ -5,7 +5,7 @@ var ImageContainer = styled.img.attrs({
|
|
|
5
5
|
className: "Image"
|
|
6
6
|
}).withConfig({
|
|
7
7
|
displayName: "styles__ImageContainer",
|
|
8
|
-
componentId: "ub2idf-0"
|
|
8
|
+
componentId: "sc-ub2idf-0"
|
|
9
9
|
})(["display:block;", " ", " ", ""], function (props) {
|
|
10
10
|
return props.isLoading && css(["visibility:hidden;"]);
|
|
11
11
|
}, COMMON, LAYOUT);
|
package/lib/Indicator/index.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
var _excluded = ["tooltip"];
|
|
2
|
+
|
|
1
3
|
function _extends() { _extends = Object.assign || 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
4
|
|
|
3
5
|
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; }
|
|
@@ -22,7 +24,7 @@ var Indicator = /*#__PURE__*/function (_React$Component) {
|
|
|
22
24
|
_proto.render = function render() {
|
|
23
25
|
var _this$props = this.props,
|
|
24
26
|
tooltip = _this$props.tooltip,
|
|
25
|
-
rest = _objectWithoutPropertiesLoose(_this$props,
|
|
27
|
+
rest = _objectWithoutPropertiesLoose(_this$props, _excluded);
|
|
26
28
|
|
|
27
29
|
return /*#__PURE__*/React.createElement(Container, _extends({
|
|
28
30
|
"data-tip": tooltip,
|
package/lib/Input/index.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
var _excluded = ["autoComplete", "autoFocus", "disabled", "readOnly", "isInvalid", "hasWarning", "id", "name", "placeholder", "type", "required", "value", "elemBefore", "elemAfter", "maxLength", "ariaLabel", "ariaDescribedby", "clearButtonLabel", "innerRef", "onBlur", "onChange", "onClear", "onFocus", "onKeyDown", "onKeyUp", "onPaste", "inputProps", "qa", "appearance", "size"];
|
|
2
|
+
|
|
1
3
|
function _extends() { _extends = Object.assign || 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
4
|
|
|
3
5
|
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; }
|
|
@@ -11,6 +13,7 @@ import Container, { Accessory } from "./styles";
|
|
|
11
13
|
import Button from "../Button";
|
|
12
14
|
import Icon from "../Icon";
|
|
13
15
|
import styled from "styled-components";
|
|
16
|
+
import { mergeRefs } from "../utils";
|
|
14
17
|
var InputContext = /*#__PURE__*/React.createContext({});
|
|
15
18
|
var StyledButton = styled(Button).withConfig({
|
|
16
19
|
displayName: "Input__StyledButton",
|
|
@@ -75,32 +78,27 @@ var isClearButton = function isClearButton(elem) {
|
|
|
75
78
|
var Input = /*#__PURE__*/function (_React$Component) {
|
|
76
79
|
_inheritsLoose(Input, _React$Component);
|
|
77
80
|
|
|
78
|
-
function Input() {
|
|
81
|
+
function Input(props) {
|
|
79
82
|
var _this;
|
|
80
83
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
|
|
84
|
+
_this = _React$Component.call(this, props) || this;
|
|
85
|
+
_this.inputRef = /*#__PURE__*/React.createRef();
|
|
86
86
|
|
|
87
87
|
_this.handleBlur = function (e) {
|
|
88
88
|
return _this.props.onBlur == null ? void 0 : _this.props.onBlur(e);
|
|
89
89
|
};
|
|
90
90
|
|
|
91
91
|
_this.handleClear = function (e) {
|
|
92
|
-
|
|
93
|
-
if (typeof _this.props.innerRef === "object") {
|
|
94
|
-
var _this$props$innerRef$;
|
|
95
|
-
|
|
96
|
-
(_this$props$innerRef$ = _this.props.innerRef.current) == null ? void 0 : _this$props$innerRef$.focus();
|
|
97
|
-
}
|
|
92
|
+
var _this$inputRef, _this$inputRef$curren;
|
|
98
93
|
|
|
94
|
+
(_this$inputRef = _this.inputRef) == null ? void 0 : (_this$inputRef$curren = _this$inputRef.current) == null ? void 0 : _this$inputRef$curren.focus();
|
|
99
95
|
_this.props.onClear == null ? void 0 : _this.props.onClear(e);
|
|
100
96
|
};
|
|
101
97
|
|
|
102
98
|
_this.handleChange = function (e) {
|
|
103
|
-
|
|
99
|
+
_this.props.onChange == null ? void 0 : _this.props.onChange(e, e.currentTarget.value);
|
|
100
|
+
|
|
101
|
+
_this.updateState(e.currentTarget.value);
|
|
104
102
|
};
|
|
105
103
|
|
|
106
104
|
_this.handleFocus = function (e) {
|
|
@@ -119,6 +117,22 @@ var Input = /*#__PURE__*/function (_React$Component) {
|
|
|
119
117
|
return _this.props.onPaste == null ? void 0 : _this.props.onPaste(e, e.currentTarget.value);
|
|
120
118
|
};
|
|
121
119
|
|
|
120
|
+
_this.updateState = function (value) {
|
|
121
|
+
var hasValue = value !== "";
|
|
122
|
+
var hadValue = _this.state.hasValue; // Only update state if the value has changed to avoid unnecessary renders.
|
|
123
|
+
|
|
124
|
+
if (hasValue !== hadValue) {
|
|
125
|
+
_this.setState({
|
|
126
|
+
hasValue: hasValue
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
_this.state = {
|
|
132
|
+
// tracking hasValue in state allows us to hide ClearButton when there is no value to clear
|
|
133
|
+
// for both controlled and uncontrolled inputs.
|
|
134
|
+
hasValue: !!props.value
|
|
135
|
+
};
|
|
122
136
|
return _this;
|
|
123
137
|
}
|
|
124
138
|
|
|
@@ -158,7 +172,7 @@ var Input = /*#__PURE__*/function (_React$Component) {
|
|
|
158
172
|
qa = _this$props$qa === void 0 ? {} : _this$props$qa,
|
|
159
173
|
appearance = _this$props.appearance,
|
|
160
174
|
size = _this$props.size,
|
|
161
|
-
rest = _objectWithoutPropertiesLoose(_this$props,
|
|
175
|
+
rest = _objectWithoutPropertiesLoose(_this$props, _excluded); // Convert autoComplete from a boolean prop to a string value.
|
|
162
176
|
|
|
163
177
|
|
|
164
178
|
var autoCompleteValue = undefined;
|
|
@@ -187,7 +201,7 @@ var Input = /*#__PURE__*/function (_React$Component) {
|
|
|
187
201
|
}, rest), /*#__PURE__*/React.createElement(InputContext.Provider, {
|
|
188
202
|
value: {
|
|
189
203
|
handleClear: this.handleClear,
|
|
190
|
-
hasValue:
|
|
204
|
+
hasValue: this.state.hasValue,
|
|
191
205
|
clearButtonLabel: clearButtonLabel,
|
|
192
206
|
onClear: onClear,
|
|
193
207
|
size: size
|
|
@@ -215,7 +229,7 @@ var Input = /*#__PURE__*/function (_React$Component) {
|
|
|
215
229
|
onKeyDown: this.handleKeyDown,
|
|
216
230
|
onKeyUp: this.handleKeyUp,
|
|
217
231
|
onPaste: this.handlePaste,
|
|
218
|
-
ref: innerRef,
|
|
232
|
+
ref: mergeRefs([innerRef, this.inputRef]),
|
|
219
233
|
"data-qa-input": name || "",
|
|
220
234
|
"data-qa-input-isdisabled": disabled === true,
|
|
221
235
|
"data-qa-input-isrequired": required === true
|
|
@@ -233,8 +247,7 @@ Input.defaultProps = {
|
|
|
233
247
|
disabled: false,
|
|
234
248
|
type: "text",
|
|
235
249
|
size: "default",
|
|
236
|
-
appearance: "primary"
|
|
237
|
-
innerRef: /*#__PURE__*/React.createRef()
|
|
250
|
+
appearance: "primary"
|
|
238
251
|
};
|
|
239
252
|
Input.ClearButton = ClearButton;
|
|
240
253
|
Input.ClearButton.displayName = "Input.ClearButton";
|
package/lib/Input/styles.js
CHANGED
|
@@ -3,7 +3,7 @@ import { COMMON } from "../utils/system-props";
|
|
|
3
3
|
import { focusRing } from "../utils/mixins";
|
|
4
4
|
var Container = styled.div.withConfig({
|
|
5
5
|
displayName: "styles__Container",
|
|
6
|
-
componentId: "uozj0s-0"
|
|
6
|
+
componentId: "sc-uozj0s-0"
|
|
7
7
|
})(["box-sizing:border-box;position:relative;input{box-sizing:border-box;width:100%;border:1px solid transparent;border-radius:", ";background-color:", ";color:", ";outline:none;transition:border-color ", " ", ",box-shadow ", " ", ";font-family:", ";font-weight:", ";appearance:none;line-height:16px;margin:0;padding:", ";font-size:", ";&::-ms-clear{display:none;}&::-webkit-search-cancel-button{appearance:none;}&:focus{", "}&:not(output):not(:focus):-moz-ui-invalid{box-shadow:none;}&:placeholder{color:", ";}", " ", "}", " ", " ", " ", " ", ""], function (props) {
|
|
8
8
|
return props.theme.radii[500];
|
|
9
9
|
}, function (props) {
|
|
@@ -67,7 +67,7 @@ var Container = styled.div.withConfig({
|
|
|
67
67
|
}, COMMON);
|
|
68
68
|
export var Accessory = styled.div.withConfig({
|
|
69
69
|
displayName: "styles__Accessory",
|
|
70
|
-
componentId: "uozj0s-1"
|
|
70
|
+
componentId: "sc-uozj0s-1"
|
|
71
71
|
})(["position:absolute;top:50%;transform:translateY(-50%);color:", ";display:flex;align-items:center;", ";", ";"], function (props) {
|
|
72
72
|
return props.theme.colors.icon.base;
|
|
73
73
|
}, function (props) {
|
package/lib/KeyboardKey/index.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
var _excluded = ["children"];
|
|
2
|
+
|
|
1
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; }
|
|
2
4
|
|
|
3
5
|
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
|
|
@@ -20,7 +22,7 @@ var KeyboardKey = /*#__PURE__*/function (_React$Component) {
|
|
|
20
22
|
_proto.render = function render() {
|
|
21
23
|
var _this$props = this.props,
|
|
22
24
|
children = _this$props.children,
|
|
23
|
-
rest = _objectWithoutPropertiesLoose(_this$props,
|
|
25
|
+
rest = _objectWithoutPropertiesLoose(_this$props, _excluded);
|
|
24
26
|
|
|
25
27
|
return /*#__PURE__*/React.createElement(Container, rest, /*#__PURE__*/React.createElement("kbd", {
|
|
26
28
|
"data-qa-keyboardkey": children
|
package/lib/Label/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"no babel-plugin-flow-react-proptypes";
|
|
2
2
|
|
|
3
|
+
var _excluded = ["as"];
|
|
4
|
+
|
|
3
5
|
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
|
|
4
6
|
|
|
5
7
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
@@ -15,7 +17,7 @@ import Text from "../Text";
|
|
|
15
17
|
var LabelBase = function LabelBase(_ref) {
|
|
16
18
|
var _ref$as = _ref.as,
|
|
17
19
|
as = _ref$as === void 0 ? "label" : _ref$as,
|
|
18
|
-
rest = _objectWithoutPropertiesLoose(_ref,
|
|
20
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
19
21
|
|
|
20
22
|
return /*#__PURE__*/React.createElement(Text, _extends({}, rest, {
|
|
21
23
|
as: as
|
|
@@ -24,7 +26,7 @@ var LabelBase = function LabelBase(_ref) {
|
|
|
24
26
|
|
|
25
27
|
var StyledLabel = styled(LabelBase).withConfig({
|
|
26
28
|
displayName: "Label__StyledLabel",
|
|
27
|
-
componentId: "rqdi0a-0"
|
|
29
|
+
componentId: "sc-rqdi0a-0"
|
|
28
30
|
})(["display:flex;align-items:center;"]);
|
|
29
31
|
|
|
30
32
|
var Label = /*#__PURE__*/function (_React$Component) {
|
package/lib/Link/index.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
var _excluded = ["href", "external", "children", "disabled", "onClick", "as", "underline", "qa"];
|
|
2
|
+
|
|
1
3
|
function _extends() { _extends = Object.assign || 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
4
|
|
|
3
5
|
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; }
|
|
@@ -15,7 +17,7 @@ var Link = function Link(_ref) {
|
|
|
15
17
|
underline = _ref.underline,
|
|
16
18
|
_ref$qa = _ref.qa,
|
|
17
19
|
qa = _ref$qa === void 0 ? {} : _ref$qa,
|
|
18
|
-
rest = _objectWithoutPropertiesLoose(_ref,
|
|
20
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
19
21
|
|
|
20
22
|
if (!href && external) {
|
|
21
23
|
console.warn("Warning: external prop cannot be set without a href declaration");
|
package/lib/Link/styles.js
CHANGED
|
@@ -4,7 +4,7 @@ import Text from "../Text";
|
|
|
4
4
|
import { TYPOGRAPHY, COMMON, FLEXBOX } from "../utils/system-props";
|
|
5
5
|
var Container = styled(Text).withConfig({
|
|
6
6
|
displayName: "styles__Container",
|
|
7
|
-
componentId: "adcw4a-0"
|
|
7
|
+
componentId: "sc-adcw4a-0"
|
|
8
8
|
})(["border:0;font-family:", ";text-decoration:", ";appearance:none;cursor:pointer;", " font-weight:", ";color:", ";&:hover{color:", ";text-decoration:underline;}&:active{color:", ";}&:focus{", "}&:focus:active{box-shadow:none;}", " ", " ", " ", " ", ""], function (props) {
|
|
9
9
|
return props.theme.fontFamily;
|
|
10
10
|
}, function (props) {
|
package/lib/Listbox/index.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
var _excluded = ["role", "children"],
|
|
2
|
+
_excluded2 = ["children"];
|
|
3
|
+
|
|
1
4
|
function _extends() { _extends = Object.assign || 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
5
|
|
|
3
6
|
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; }
|
|
@@ -12,7 +15,7 @@ export var Listbox = function Listbox(_ref) {
|
|
|
12
15
|
var _ref$role = _ref.role,
|
|
13
16
|
role = _ref$role === void 0 ? MENU_ROLES.LISTBOX : _ref$role,
|
|
14
17
|
children = _ref.children,
|
|
15
|
-
rest = _objectWithoutPropertiesLoose(_ref,
|
|
18
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
16
19
|
|
|
17
20
|
return /*#__PURE__*/React.createElement(Menu, _extends({}, rest, {
|
|
18
21
|
role: role
|
|
@@ -25,7 +28,7 @@ export var Listbox = function Listbox(_ref) {
|
|
|
25
28
|
|
|
26
29
|
export var ListboxButtonContainer = styled(MenuButton).withConfig({
|
|
27
30
|
displayName: "Listbox__ListboxButtonContainer",
|
|
28
|
-
componentId: "c9mfi8-0"
|
|
31
|
+
componentId: "sc-c9mfi8-0"
|
|
29
32
|
})(["position:relative;width:100%;border:1px solid ", ";border-radius:", ";background-color:", ";color:", ";cursor:", ";outline:none;appearance:none;transition:border-color ", " ", ",box-shadow ", " ", ";font-family:", ";font-weight:", ";text-align:left;margin:0;&:active{transform:none;}padding:", ";font-size:", ";", ""], function (props) {
|
|
30
33
|
return props.theme.colors.form.border.base;
|
|
31
34
|
}, function (props) {
|
|
@@ -79,7 +82,7 @@ export var ListboxButtonContainer = styled(MenuButton).withConfig({
|
|
|
79
82
|
});
|
|
80
83
|
export var ListboxButton = function ListboxButton(_ref2) {
|
|
81
84
|
var children = _ref2.children,
|
|
82
|
-
restProps = _objectWithoutPropertiesLoose(_ref2,
|
|
85
|
+
restProps = _objectWithoutPropertiesLoose(_ref2, _excluded2);
|
|
83
86
|
|
|
84
87
|
return /*#__PURE__*/React.createElement(ListboxButtonContainer, _extends({}, restProps, {
|
|
85
88
|
popoutProps: _extends({
|
package/lib/Loader/index.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
var _excluded = ["text", "size", "delay", "color", "qa"];
|
|
2
|
+
|
|
1
3
|
function _extends() { _extends = Object.assign || 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
4
|
|
|
3
5
|
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; }
|
|
@@ -25,7 +27,7 @@ var Loader = /*#__PURE__*/function (_React$Component) {
|
|
|
25
27
|
delay = _this$props.delay,
|
|
26
28
|
color = _this$props.color,
|
|
27
29
|
qa = _this$props.qa,
|
|
28
|
-
rest = _objectWithoutPropertiesLoose(_this$props,
|
|
30
|
+
rest = _objectWithoutPropertiesLoose(_this$props, _excluded);
|
|
29
31
|
|
|
30
32
|
return /*#__PURE__*/React.createElement(Container, _extends({
|
|
31
33
|
small: size === "small",
|
package/lib/Loader/styles.js
CHANGED
|
@@ -19,7 +19,7 @@ var Container = styled.div.attrs({
|
|
|
19
19
|
className: "Loader"
|
|
20
20
|
}).withConfig({
|
|
21
21
|
displayName: "styles__Container",
|
|
22
|
-
componentId: "zj8x0q-0"
|
|
22
|
+
componentId: "sc-zj8x0q-0"
|
|
23
23
|
})(["position:relative;margin:0 auto;overflow:hidden;&:after{position:absolute;top:50%;left:50%;border-style:solid;border-radius:50%;content:\"\";transition:opacity 250ms;animation:", ";}", " ", " ", ""], function (props) {
|
|
24
24
|
return props.delay ? css(["", " 2.25s infinite linear,", " 2s 1"], spin, delay) : css(["", " 2.25s infinite linear"], spin);
|
|
25
25
|
}, function (props) {
|
|
@@ -29,6 +29,6 @@ var Container = styled.div.attrs({
|
|
|
29
29
|
}, COMMON);
|
|
30
30
|
export var Text = styled.div.withConfig({
|
|
31
31
|
displayName: "styles__Text",
|
|
32
|
-
componentId: "zj8x0q-1"
|
|
32
|
+
componentId: "sc-zj8x0q-1"
|
|
33
33
|
})(["", ""], visuallyHidden);
|
|
34
34
|
export default Container;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
var _excluded = ["appearance", "isLoading", "disabled", "loaderLabel", "children"];
|
|
2
|
+
|
|
1
3
|
function _extends() { _extends = Object.assign || 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
4
|
|
|
3
5
|
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; }
|
|
@@ -38,7 +40,7 @@ export var LoaderButton = function LoaderButton(_ref) {
|
|
|
38
40
|
disabled = _ref.disabled,
|
|
39
41
|
loaderLabel = _ref.loaderLabel,
|
|
40
42
|
children = _ref.children,
|
|
41
|
-
rest = _objectWithoutPropertiesLoose(_ref,
|
|
43
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
42
44
|
|
|
43
45
|
var isLoading = Boolean(_isLoading);
|
|
44
46
|
return /*#__PURE__*/React.createElement(Button, _extends({
|
package/lib/Menu/descendants.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
var _excluded = ["context", "element"],
|
|
2
|
+
_excluded2 = ["element"];
|
|
3
|
+
|
|
1
4
|
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; }
|
|
2
5
|
|
|
3
6
|
function _extends() { _extends = Object.assign || 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); }
|
|
@@ -91,7 +94,7 @@ export function createDescendantContext(name, initialValue) {
|
|
|
91
94
|
export function useDescendant(_ref, indexProp) {
|
|
92
95
|
var context = _ref.context,
|
|
93
96
|
element = _ref.element,
|
|
94
|
-
rest = _objectWithoutPropertiesLoose(_ref,
|
|
97
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
95
98
|
|
|
96
99
|
var _useState = useState(),
|
|
97
100
|
forceUpdate = _useState[1];
|
|
@@ -125,7 +128,7 @@ export function DescendantProvider(_ref2) {
|
|
|
125
128
|
set = _ref2.set;
|
|
126
129
|
var registerDescendant = useCallback(function (_ref3) {
|
|
127
130
|
var element = _ref3.element,
|
|
128
|
-
rest = _objectWithoutPropertiesLoose(_ref3,
|
|
131
|
+
rest = _objectWithoutPropertiesLoose(_ref3, _excluded2);
|
|
129
132
|
|
|
130
133
|
if (!element) {
|
|
131
134
|
return;
|
package/lib/Menu/index.js
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import _styled from "styled-components";
|
|
2
|
+
var _excluded = ["id", "index", "as", "children", "role", "elemBefore", "elemAfter", "value", "onKeyPress", "onClick", "selected", "disabled", "indeterminate", "label"],
|
|
3
|
+
_excluded2 = ["children", "title", "titleAs", "disabled"],
|
|
4
|
+
_excluded3 = ["children", "role", "multiselect", "innerRef"],
|
|
5
|
+
_excluded4 = ["role", "children", "onChange", "value", "multiselect", "innerRef"],
|
|
6
|
+
_excluded5 = ["content", "popoutProps", "children", "onClick", "closeOnItemClick", "id", "placement"];
|
|
2
7
|
|
|
3
8
|
function _extends() { _extends = Object.assign || 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); }
|
|
4
9
|
|
|
@@ -67,7 +72,7 @@ export var MenuItem = function MenuItem(_ref) {
|
|
|
67
72
|
disabled = _ref.disabled,
|
|
68
73
|
indeterminate = _ref.indeterminate,
|
|
69
74
|
labelProp = _ref.label,
|
|
70
|
-
props = _objectWithoutPropertiesLoose(_ref,
|
|
75
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
71
76
|
|
|
72
77
|
var _useContext = useContext(MenuContext),
|
|
73
78
|
menuRole = _useContext.role,
|
|
@@ -227,21 +232,13 @@ export var MenuRadio = function MenuRadio(props) {
|
|
|
227
232
|
role: MENU_ITEM_ROLES.RADIO
|
|
228
233
|
}, props));
|
|
229
234
|
};
|
|
230
|
-
|
|
231
|
-
var _StyledText = styled(Text).withConfig({
|
|
232
|
-
displayName: "Menu___StyledText",
|
|
233
|
-
componentId: "sc-1p3rdnp-0"
|
|
234
|
-
})(["", ""], function (p) {
|
|
235
|
-
return p._css;
|
|
236
|
-
});
|
|
237
|
-
|
|
238
235
|
export var MenuGroup = function MenuGroup(_ref2) {
|
|
239
236
|
var children = _ref2.children,
|
|
240
237
|
title = _ref2.title,
|
|
241
238
|
titleAs = _ref2.titleAs,
|
|
242
239
|
_ref2$disabled = _ref2.disabled,
|
|
243
240
|
isDisabled = _ref2$disabled === void 0 ? false : _ref2$disabled,
|
|
244
|
-
props = _objectWithoutPropertiesLoose(_ref2,
|
|
241
|
+
props = _objectWithoutPropertiesLoose(_ref2, _excluded2);
|
|
245
242
|
|
|
246
243
|
return /*#__PURE__*/React.createElement(React.Fragment, null, title && /*#__PURE__*/React.createElement(Box, {
|
|
247
244
|
pl: 400,
|
|
@@ -254,7 +251,7 @@ export var MenuGroup = function MenuGroup(_ref2) {
|
|
|
254
251
|
fontWeight: 600,
|
|
255
252
|
mt: 350,
|
|
256
253
|
color: "text.headline",
|
|
257
|
-
_css: isDisabled && disabled
|
|
254
|
+
$_css: isDisabled && disabled
|
|
258
255
|
}, title)), /*#__PURE__*/React.createElement(Box, _extends({}, props, {
|
|
259
256
|
p: 300,
|
|
260
257
|
role: "group"
|
|
@@ -309,7 +306,7 @@ var MenuItems = function MenuItems(_ref3) {
|
|
|
309
306
|
role = _ref3.role,
|
|
310
307
|
multiselect = _ref3.multiselect,
|
|
311
308
|
innerRef = _ref3.innerRef,
|
|
312
|
-
props = _objectWithoutPropertiesLoose(_ref3,
|
|
309
|
+
props = _objectWithoutPropertiesLoose(_ref3, _excluded3);
|
|
313
310
|
|
|
314
311
|
var _useMenuKeyDown = useMenuKeyDown(),
|
|
315
312
|
handleKeyDown = _useMenuKeyDown.handleKeyDown,
|
|
@@ -337,7 +334,7 @@ export var Menu = function Menu(_ref4) {
|
|
|
337
334
|
value = _ref4.value,
|
|
338
335
|
multiselect = _ref4.multiselect,
|
|
339
336
|
innerRef = _ref4.innerRef,
|
|
340
|
-
props = _objectWithoutPropertiesLoose(_ref4,
|
|
337
|
+
props = _objectWithoutPropertiesLoose(_ref4, _excluded4);
|
|
341
338
|
|
|
342
339
|
var _useDescendants = useDescendants(),
|
|
343
340
|
descendants = _useDescendants[0],
|
|
@@ -397,7 +394,7 @@ Menu.Divider.displayName = "Menu.Divider";
|
|
|
397
394
|
Menu.FilterInput.displayName = "Menu.FilterInput";
|
|
398
395
|
var CustomPopoutContent = styled(Popout.Content).withConfig({
|
|
399
396
|
displayName: "Menu__CustomPopoutContent",
|
|
400
|
-
componentId: "sc-1p3rdnp-
|
|
397
|
+
componentId: "sc-1p3rdnp-0"
|
|
401
398
|
})(["padding:0;margin-left:0;margin-right:0;"]);
|
|
402
399
|
export var MenuButton = function MenuButton(_ref5) {
|
|
403
400
|
var content = _ref5.content,
|
|
@@ -410,7 +407,7 @@ export var MenuButton = function MenuButton(_ref5) {
|
|
|
410
407
|
id = _ref5$id === void 0 ? uniqueId("MenuButton-") : _ref5$id,
|
|
411
408
|
_ref5$placement = _ref5.placement,
|
|
412
409
|
placement = _ref5$placement === void 0 ? "bottom" : _ref5$placement,
|
|
413
|
-
props = _objectWithoutPropertiesLoose(_ref5,
|
|
410
|
+
props = _objectWithoutPropertiesLoose(_ref5, _excluded5);
|
|
414
411
|
|
|
415
412
|
var _useState3 = useState(false),
|
|
416
413
|
isOpen = _useState3[0],
|
|
@@ -451,4 +448,11 @@ export var MenuButton = function MenuButton(_ref5) {
|
|
|
451
448
|
}
|
|
452
449
|
}), children)));
|
|
453
450
|
};
|
|
454
|
-
export default Menu;
|
|
451
|
+
export default Menu;
|
|
452
|
+
|
|
453
|
+
var _StyledText = styled(Text).withConfig({
|
|
454
|
+
displayName: "Menu___StyledText",
|
|
455
|
+
componentId: "sc-1p3rdnp-1"
|
|
456
|
+
})(["", ""], function (p) {
|
|
457
|
+
return p.$_css;
|
|
458
|
+
});
|
package/lib/Menu/styles.js
CHANGED
|
@@ -3,7 +3,7 @@ import Box from "../Box";
|
|
|
3
3
|
import { disabled, focusRing } from "../utils/mixins";
|
|
4
4
|
export var MenuItemContainer = styled(Box).withConfig({
|
|
5
5
|
displayName: "styles__MenuItemContainer",
|
|
6
|
-
componentId: "fjvae4-0"
|
|
6
|
+
componentId: "sc-fjvae4-0"
|
|
7
7
|
})(["", ";width:100%;border-radius:", ";background-color:", ";border:none;text-align:left;color:", ";font-family:", ";font-weight:", ";padding:", ";list-style-type:none;outline:0;", ";", " ", " ", " ", " ", ""], function (props) {
|
|
8
8
|
return !props.hidden && css(["display:block;"]);
|
|
9
9
|
}, function (props) {
|
|
@@ -43,5 +43,5 @@ export var MenuItemContainer = styled(Box).withConfig({
|
|
|
43
43
|
});
|
|
44
44
|
export var MenuItemsContainer = styled(Box).withConfig({
|
|
45
45
|
displayName: "styles__MenuItemsContainer",
|
|
46
|
-
componentId: "fjvae4-1"
|
|
46
|
+
componentId: "sc-fjvae4-1"
|
|
47
47
|
})(["list-style-type:none;&:focus{", "}"], focusRing);
|