@sproutsocial/racine 11.1.2 → 11.3.0-beta.1
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/__flow__/Input/index.js +116 -67
- package/__flow__/Input/index.stories.js +33 -0
- package/__flow__/Input/index.test.js +199 -1
- package/__flow__/Input/styles.js +1 -1
- 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 +67 -29
- package/commonjs/Input/styles.js +3 -3
- 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/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 +60 -28
- package/lib/Input/styles.js +3 -3
- 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/package.json +1 -1
package/lib/Card/styles.js
CHANGED
|
@@ -3,7 +3,7 @@ import Button from "../Button";
|
|
|
3
3
|
import Box from "../Box";
|
|
4
4
|
var Container = styled(Box).withConfig({
|
|
5
5
|
displayName: "styles__Container",
|
|
6
|
-
componentId: "p098yi-0"
|
|
6
|
+
componentId: "sc-p098yi-0"
|
|
7
7
|
})(["width:100%;border-radius:", ";position:relative;z-index:0;::after{content:\"\";top:0;left:0;position:absolute;border-radius:", ";z-index:-1;width:100%;height:100%;opacity:0;box-shadow:", ";transition:opacity ", " ", ";}&:hover{&::after{opacity:1;}}[role=\"button\"],[type=\"button\"],a{position:relative;}"], function (props) {
|
|
8
8
|
return props.theme.radii.outer;
|
|
9
9
|
}, function (props) {
|
|
@@ -17,6 +17,6 @@ var Container = styled(Box).withConfig({
|
|
|
17
17
|
});
|
|
18
18
|
var ClickableArea = styled(Button).withConfig({
|
|
19
19
|
displayName: "styles__ClickableArea",
|
|
20
|
-
componentId: "p098yi-1"
|
|
20
|
+
componentId: "sc-p098yi-1"
|
|
21
21
|
})(["position:absolute !important;top:0;bottom:0;left:0;right:0;width:100%;"]);
|
|
22
22
|
export { Container, ClickableArea };
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
var _excluded = ["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; }
|
|
@@ -21,7 +23,7 @@ var CharacterCounter = /*#__PURE__*/function (_React$Component) {
|
|
|
21
23
|
_proto.render = function render() {
|
|
22
24
|
var _this$props = this.props,
|
|
23
25
|
size = _this$props.size,
|
|
24
|
-
rest = _objectWithoutPropertiesLoose(_this$props,
|
|
26
|
+
rest = _objectWithoutPropertiesLoose(_this$props, _excluded);
|
|
25
27
|
|
|
26
28
|
var remaining = this.props.maxValue - this.props.currentValue;
|
|
27
29
|
return (
|
|
@@ -2,7 +2,7 @@ import styled, { css } from "styled-components";
|
|
|
2
2
|
import { COMMON } from "../utils/system-props";
|
|
3
3
|
var Container = styled.div.withConfig({
|
|
4
4
|
displayName: "styles__Container",
|
|
5
|
-
componentId: "do9szx-0"
|
|
5
|
+
componentId: "sc-do9szx-0"
|
|
6
6
|
})(["font-family:", ";", ";font-weight:", ";line-height:1;font-variant-numeric:tabular-nums;color:", ";", " ", ""], function (props) {
|
|
7
7
|
return props.theme.fontFamily;
|
|
8
8
|
}, function (props) {
|
package/lib/ChartLegend/index.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
var _excluded = ["legendLabels", "stacked", "theme"];
|
|
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; }
|
|
@@ -32,7 +34,7 @@ var ChartLegend = function ChartLegend(props) {
|
|
|
32
34
|
stacked = props.stacked,
|
|
33
35
|
_props$theme = props.theme,
|
|
34
36
|
theme = _props$theme === void 0 ? "compare" : _props$theme,
|
|
35
|
-
rest = _objectWithoutPropertiesLoose(props,
|
|
37
|
+
rest = _objectWithoutPropertiesLoose(props, _excluded);
|
|
36
38
|
|
|
37
39
|
return /*#__PURE__*/React.createElement(Container, _extends({
|
|
38
40
|
inline: !stacked,
|
|
@@ -2,13 +2,13 @@ import styled, { css } from "styled-components";
|
|
|
2
2
|
import { COMMON, LAYOUT } from "../utils/system-props";
|
|
3
3
|
export var Label = styled.span.withConfig({
|
|
4
4
|
displayName: "styles__Label",
|
|
5
|
-
componentId: "se0ijc-0"
|
|
5
|
+
componentId: "sc-se0ijc-0"
|
|
6
6
|
})(["display:flex;align-items:center;color:", ";white-space:nowrap;text-transform:capitalize;"], function (props) {
|
|
7
7
|
return props.theme.colors.text.subtext;
|
|
8
8
|
});
|
|
9
9
|
export var Swatch = styled.span.withConfig({
|
|
10
10
|
displayName: "styles__Swatch",
|
|
11
|
-
componentId: "se0ijc-1"
|
|
11
|
+
componentId: "sc-se0ijc-1"
|
|
12
12
|
})(["margin-right:", ";width:", ";height:", ";border-radius:4px;", ""], function (props) {
|
|
13
13
|
return props.theme.space[300];
|
|
14
14
|
}, function (props) {
|
|
@@ -18,7 +18,7 @@ export var Swatch = styled.span.withConfig({
|
|
|
18
18
|
}, COMMON);
|
|
19
19
|
var Container = styled.div.withConfig({
|
|
20
20
|
displayName: "styles__Container",
|
|
21
|
-
componentId: "se0ijc-2"
|
|
21
|
+
componentId: "sc-se0ijc-2"
|
|
22
22
|
})(["", " ", " ", ""], function (props) {
|
|
23
23
|
return props.inline && css(["display:flex;justify-content:center;", " + ", "{margin-left:", ";}"], Label, Label, function (props) {
|
|
24
24
|
return props.theme.space[450];
|
package/lib/Checkbox/index.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
var _excluded = ["id", "value", "name", "label", "checked", "disabled", "indeterminate", "onChange", "ariaLabel", "appearance", "qa", "tabIndex", "inputProps"];
|
|
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; }
|
|
@@ -63,7 +65,7 @@ var Checkbox = /*#__PURE__*/function (_React$Component) {
|
|
|
63
65
|
tabIndex = _this$props.tabIndex,
|
|
64
66
|
_this$props$inputProp = _this$props.inputProps,
|
|
65
67
|
inputProps = _this$props$inputProp === void 0 ? {} : _this$props$inputProp,
|
|
66
|
-
rest = _objectWithoutPropertiesLoose(_this$props,
|
|
68
|
+
rest = _objectWithoutPropertiesLoose(_this$props, _excluded);
|
|
67
69
|
|
|
68
70
|
var isPill = appearance === "pill"; // TODO: Refactor pill checkboxes to use fewer elements for performance gains
|
|
69
71
|
|
package/lib/Collapsible/index.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
var _excluded = ["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; }
|
|
@@ -48,7 +51,7 @@ var determineMaxHeight = function determineMaxHeight(isHidden, openHeight, compu
|
|
|
48
51
|
|
|
49
52
|
var Trigger = function Trigger(_ref2) {
|
|
50
53
|
var children = _ref2.children,
|
|
51
|
-
rest = _objectWithoutPropertiesLoose(_ref2,
|
|
54
|
+
rest = _objectWithoutPropertiesLoose(_ref2, _excluded);
|
|
52
55
|
|
|
53
56
|
var _useContext = useContext(CollapsibleContext),
|
|
54
57
|
isOpen = _useContext.isOpen,
|
|
@@ -62,7 +65,7 @@ var Trigger = function Trigger(_ref2) {
|
|
|
62
65
|
|
|
63
66
|
var Panel = function Panel(_ref3) {
|
|
64
67
|
var children = _ref3.children,
|
|
65
|
-
rest = _objectWithoutPropertiesLoose(_ref3,
|
|
68
|
+
rest = _objectWithoutPropertiesLoose(_ref3, _excluded2);
|
|
66
69
|
|
|
67
70
|
var _useContext2 = useContext(CollapsibleContext),
|
|
68
71
|
isOpen = _useContext2.isOpen,
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
var _excluded = ["startDate", "endDate", "onDatesChange"];
|
|
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,7 +13,7 @@ var DateRangePicker = function DateRangePicker(_ref) {
|
|
|
11
13
|
var startDate = _ref.startDate,
|
|
12
14
|
endDate = _ref.endDate,
|
|
13
15
|
onDatesChange = _ref.onDatesChange,
|
|
14
|
-
rest = _objectWithoutPropertiesLoose(_ref,
|
|
16
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
15
17
|
|
|
16
18
|
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(ReactDatesCssOverrides, null), /*#__PURE__*/React.createElement(DayPickerRangeController, _extends({
|
|
17
19
|
startDate: startDate,
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
var _excluded = ["onDateChange", "date"];
|
|
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; }
|
|
@@ -10,7 +12,7 @@ import { commonDatePickerProps } from "./common";
|
|
|
10
12
|
var SingleDatePicker = function SingleDatePicker(_ref) {
|
|
11
13
|
var onDateChange = _ref.onDateChange,
|
|
12
14
|
date = _ref.date,
|
|
13
|
-
rest = _objectWithoutPropertiesLoose(_ref,
|
|
15
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
14
16
|
|
|
15
17
|
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(ReactDatesCssOverrides, null), /*#__PURE__*/React.createElement(DayPickerSingleDateController, _extends({
|
|
16
18
|
date: date,
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
var _excluded = ["startDate", "endDate", "onDatesChange", "onFocusChange"];
|
|
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; }
|
|
@@ -10,7 +12,7 @@ export var StatefulDateRangePicker = function StatefulDateRangePicker(_ref) {
|
|
|
10
12
|
endDate = _ref.endDate,
|
|
11
13
|
onDatesChange = _ref.onDatesChange,
|
|
12
14
|
onFocusChange = _ref.onFocusChange,
|
|
13
|
-
rest = _objectWithoutPropertiesLoose(_ref,
|
|
15
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
14
16
|
|
|
15
17
|
var _useState = useState({
|
|
16
18
|
startDate: startDate,
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
var _excluded = ["date", "onDateChange"];
|
|
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; }
|
|
@@ -7,7 +9,7 @@ import SingleDatePicker from "./SingleDatePicker";
|
|
|
7
9
|
export var StatefulSingleDatePicker = function StatefulSingleDatePicker(_ref) {
|
|
8
10
|
var date = _ref.date,
|
|
9
11
|
onDateChange = _ref.onDateChange,
|
|
10
|
-
rest = _objectWithoutPropertiesLoose(_ref,
|
|
12
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
11
13
|
|
|
12
14
|
var _useState = useState(date),
|
|
13
15
|
stateDate = _useState[0],
|
package/lib/DatePicker/styles.js
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
var _templateObject;
|
|
2
|
-
|
|
3
|
-
function _taggedTemplateLiteralLoose(strings, raw) { if (!raw) { raw = strings.slice(0); } strings.raw = raw; return strings; }
|
|
4
|
-
|
|
5
1
|
import styled, { createGlobalStyle, css } from "styled-components";
|
|
6
2
|
import moment from "moment";
|
|
7
3
|
import Box from "../Box";
|
|
@@ -56,7 +52,7 @@ var shouldHaveRightPill = function shouldHaveRightPill(modifiers, day) {
|
|
|
56
52
|
|
|
57
53
|
export var CalendarDay = styled(Box).withConfig({
|
|
58
54
|
displayName: "styles__CalendarDay",
|
|
59
|
-
componentId: "fso9yi-0"
|
|
55
|
+
componentId: "sc-fso9yi-0"
|
|
60
56
|
})(["", ";"], function (_ref) {
|
|
61
57
|
var modifiers = _ref.modifiers,
|
|
62
58
|
day = _ref.day,
|
|
@@ -72,7 +68,7 @@ export var CalendarDay = styled(Box).withConfig({
|
|
|
72
68
|
return css(["color:", ";", ";"], theme.colors.text.subtext, disabled);
|
|
73
69
|
}
|
|
74
70
|
});
|
|
75
|
-
export var ReactDatesCssOverrides = createGlobalStyle(
|
|
71
|
+
export var ReactDatesCssOverrides = createGlobalStyle([".DayPicker{box-sizing:content-box;font-weight:", ";font-family:", ";&_transitionContainer{height:228px !important;}&_weekHeader{color:", ";border-bottom:1px solid ", ";top:26px;width:230px;&_ul{padding-left:10px;}}&_weekHeaders__horizontal{margin-left:0}&_weekHeader_li{", " color:", ";font-weight:", ";margin:0;}&__horizontal{box-shadow:none;background:", ";}}.CalendarDay{background-color:transparent;&__selected,&__selected_span,&:hover{background-color:transparent;}&__default{color:", ";}&__default,&__default:hover{border:none;color:", ";}}.CalendarMonth{", " background:", ";padding:0 15px;&_caption{", " color:", ";padding-top:0;background:", ";strong{font-weight:", ";}}&_table{line-height:21.333px;tr{vertical-align:middle;}td{padding:0;border-bottom:none;}}}.CalendarMonthGrid{background:", ";}.DayPickerNavigation_button__horizontal{color:", ";top:-4px;padding:7px 8px;position:absolute;line-height:0.78;border-radius:9999px;border:none;background:", ";&:nth-child(1){left:22px;}&:nth-child(2){right:22px;}&:hover{background:", ";}}"], function (_ref2) {
|
|
76
72
|
var theme = _ref2.theme;
|
|
77
73
|
return theme.fontWeights.normal;
|
|
78
74
|
}, function (props) {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
var _excluded = ["isVisible", "children", "width", "direction"];
|
|
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
|
import * as React from "react";
|
|
@@ -8,7 +10,7 @@ export var SlideTransition = function SlideTransition(_ref) {
|
|
|
8
10
|
children = _ref.children,
|
|
9
11
|
width = _ref.width,
|
|
10
12
|
direction = _ref.direction,
|
|
11
|
-
rest = _objectWithoutPropertiesLoose(_ref,
|
|
13
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
12
14
|
|
|
13
15
|
var offset = width * (direction === "left" ? -1 : 1);
|
|
14
16
|
var transitions = useTransition(isVisible, null, {
|
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"];
|
|
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; }
|
|
@@ -8,6 +10,22 @@ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || func
|
|
|
8
10
|
|
|
9
11
|
import * as React from "react";
|
|
10
12
|
import Container, { Accessory } from "./styles";
|
|
13
|
+
import Button from "../Button";
|
|
14
|
+
import Icon from "../Icon";
|
|
15
|
+
var InputContext = /*#__PURE__*/React.createContext({});
|
|
16
|
+
|
|
17
|
+
var ClearButton = function ClearButton() {
|
|
18
|
+
var _React$useContext = React.useContext(InputContext),
|
|
19
|
+
handleClear = _React$useContext.handleClear,
|
|
20
|
+
clearButtonLabel = _React$useContext.clearButtonLabel;
|
|
21
|
+
|
|
22
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
23
|
+
onClick: handleClear
|
|
24
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
25
|
+
name: "circlex",
|
|
26
|
+
title: clearButtonLabel || "Clear"
|
|
27
|
+
}));
|
|
28
|
+
};
|
|
11
29
|
|
|
12
30
|
var Input = /*#__PURE__*/function (_React$Component) {
|
|
13
31
|
_inheritsLoose(Input, _React$Component);
|
|
@@ -22,39 +40,31 @@ var Input = /*#__PURE__*/function (_React$Component) {
|
|
|
22
40
|
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
|
|
23
41
|
|
|
24
42
|
_this.handleBlur = function (e) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
43
|
+
return _this.props.onBlur == null ? void 0 : _this.props.onBlur(e);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
_this.handleClear = function (e) {
|
|
47
|
+
return _this.props.onClear == null ? void 0 : _this.props.onClear(e);
|
|
28
48
|
};
|
|
29
49
|
|
|
30
50
|
_this.handleChange = function (e) {
|
|
31
|
-
|
|
32
|
-
_this.props.onChange(e, e.currentTarget.value);
|
|
33
|
-
}
|
|
51
|
+
return _this.props.onChange == null ? void 0 : _this.props.onChange(e, e.currentTarget.value);
|
|
34
52
|
};
|
|
35
53
|
|
|
36
54
|
_this.handleFocus = function (e) {
|
|
37
|
-
|
|
38
|
-
_this.props.onFocus(e);
|
|
39
|
-
}
|
|
55
|
+
return _this.props.onFocus == null ? void 0 : _this.props.onFocus(e);
|
|
40
56
|
};
|
|
41
57
|
|
|
42
58
|
_this.handleKeyDown = function (e) {
|
|
43
|
-
|
|
44
|
-
_this.props.onKeyDown(e, e.currentTarget.value);
|
|
45
|
-
}
|
|
59
|
+
return _this.props.onKeyDown == null ? void 0 : _this.props.onKeyDown(e, e.currentTarget.value);
|
|
46
60
|
};
|
|
47
61
|
|
|
48
62
|
_this.handleKeyUp = function (e) {
|
|
49
|
-
|
|
50
|
-
_this.props.onKeyUp(e, e.currentTarget.value);
|
|
51
|
-
}
|
|
63
|
+
return _this.props.onKeyUp == null ? void 0 : _this.props.onKeyUp(e, e.currentTarget.value);
|
|
52
64
|
};
|
|
53
65
|
|
|
54
66
|
_this.handlePaste = function (e) {
|
|
55
|
-
|
|
56
|
-
_this.props.onPaste(e, e.currentTarget.value);
|
|
57
|
-
}
|
|
67
|
+
return _this.props.onPaste == null ? void 0 : _this.props.onPaste(e, e.currentTarget.value);
|
|
58
68
|
};
|
|
59
69
|
|
|
60
70
|
return _this;
|
|
@@ -63,6 +73,8 @@ var Input = /*#__PURE__*/function (_React$Component) {
|
|
|
63
73
|
var _proto = Input.prototype;
|
|
64
74
|
|
|
65
75
|
_proto.render = function render() {
|
|
76
|
+
var _elementAfter$type;
|
|
77
|
+
|
|
66
78
|
var _this$props = this.props,
|
|
67
79
|
autoComplete = _this$props.autoComplete,
|
|
68
80
|
autoFocus = _this$props.autoFocus,
|
|
@@ -81,9 +93,11 @@ var Input = /*#__PURE__*/function (_React$Component) {
|
|
|
81
93
|
maxLength = _this$props.maxLength,
|
|
82
94
|
ariaLabel = _this$props.ariaLabel,
|
|
83
95
|
ariaDescribedby = _this$props.ariaDescribedby,
|
|
96
|
+
clearButtonLabel = _this$props.clearButtonLabel,
|
|
84
97
|
innerRef = _this$props.innerRef,
|
|
85
98
|
onBlur = _this$props.onBlur,
|
|
86
99
|
onChange = _this$props.onChange,
|
|
100
|
+
onClear = _this$props.onClear,
|
|
87
101
|
onFocus = _this$props.onFocus,
|
|
88
102
|
onKeyDown = _this$props.onKeyDown,
|
|
89
103
|
onKeyUp = _this$props.onKeyUp,
|
|
@@ -93,25 +107,38 @@ var Input = /*#__PURE__*/function (_React$Component) {
|
|
|
93
107
|
_this$props$qa = _this$props.qa,
|
|
94
108
|
qa = _this$props$qa === void 0 ? {} : _this$props$qa,
|
|
95
109
|
appearance = _this$props.appearance,
|
|
96
|
-
rest = _objectWithoutPropertiesLoose(_this$props,
|
|
110
|
+
rest = _objectWithoutPropertiesLoose(_this$props, _excluded); // Convert autoComplete from a boolean prop to a string value.
|
|
111
|
+
|
|
97
112
|
|
|
98
113
|
var autoCompleteValue = undefined;
|
|
99
114
|
|
|
100
115
|
if (autoComplete !== undefined) {
|
|
101
116
|
autoCompleteValue = autoComplete ? "on" : "off";
|
|
102
|
-
}
|
|
117
|
+
} // Add default elemBefore and elemAfter elements if type is search.
|
|
118
|
+
|
|
103
119
|
|
|
120
|
+
var elementBefore = type === "search" && !elemBefore ? /*#__PURE__*/React.createElement(Icon, {
|
|
121
|
+
name: "search",
|
|
122
|
+
ariaHidden: true
|
|
123
|
+
}) : elemBefore; // Do not add a ClearButton if no onClear callback is provided or if an elemAfter prop was passed.
|
|
124
|
+
|
|
125
|
+
var elementAfter = type === "search" && onClear && !elemAfter ? /*#__PURE__*/React.createElement(ClearButton, null) : elemAfter;
|
|
104
126
|
return /*#__PURE__*/React.createElement(Container, _extends({
|
|
105
|
-
hasBeforeElement: !!
|
|
106
|
-
hasAfterElement: !!
|
|
127
|
+
hasBeforeElement: !!elementBefore,
|
|
128
|
+
hasAfterElement: !!elementAfter,
|
|
107
129
|
disabled: disabled,
|
|
108
130
|
invalid: !!isInvalid,
|
|
109
131
|
warning: hasWarning,
|
|
110
132
|
appearance: appearance // $FlowIssue - upgrade v0.112.0
|
|
111
133
|
|
|
112
|
-
}, rest),
|
|
134
|
+
}, rest), /*#__PURE__*/React.createElement(InputContext.Provider, {
|
|
135
|
+
value: {
|
|
136
|
+
handleClear: this.handleClear,
|
|
137
|
+
clearButtonLabel: clearButtonLabel
|
|
138
|
+
}
|
|
139
|
+
}, elementBefore && /*#__PURE__*/React.createElement(Accessory, {
|
|
113
140
|
before: true
|
|
114
|
-
},
|
|
141
|
+
}, elementBefore), /*#__PURE__*/React.createElement("input", _extends({
|
|
115
142
|
"aria-invalid": !!isInvalid,
|
|
116
143
|
"aria-label": ariaLabel,
|
|
117
144
|
"aria-describedby": ariaDescribedby,
|
|
@@ -136,9 +163,12 @@ var Input = /*#__PURE__*/function (_React$Component) {
|
|
|
136
163
|
"data-qa-input": name || "",
|
|
137
164
|
"data-qa-input-isdisabled": disabled === true,
|
|
138
165
|
"data-qa-input-isrequired": required === true
|
|
139
|
-
}, qa, inputProps)),
|
|
140
|
-
after: true
|
|
141
|
-
|
|
166
|
+
}, qa, inputProps)), elementAfter && /*#__PURE__*/React.createElement(Accessory, {
|
|
167
|
+
after: true // Used for positioning. This logic will detect if the element is a ClearButton,
|
|
168
|
+
// regardless of whether it was manually passed as elemAfter or automatically added to a search Input.
|
|
169
|
+
,
|
|
170
|
+
isClearButton: (elementAfter == null ? void 0 : (_elementAfter$type = elementAfter.type) == null ? void 0 : _elementAfter$type.prototype) === Input.ClearButton.prototype
|
|
171
|
+
}, elementAfter)));
|
|
142
172
|
};
|
|
143
173
|
|
|
144
174
|
return Input;
|
|
@@ -151,4 +181,6 @@ Input.defaultProps = {
|
|
|
151
181
|
size: "default",
|
|
152
182
|
appearance: "primary"
|
|
153
183
|
};
|
|
154
|
-
|
|
184
|
+
Input.ClearButton = ClearButton;
|
|
185
|
+
Input.ClearButton.displayName = "Input.ClearButton";
|
|
186
|
+
export default Input;
|