@sproutsocial/racine 22.5.0 → 23.0.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 +23 -0
- package/__flow__/Toast/Toast.flow.js +4 -0
- package/__flow__/types/theme.flow.js +1 -0
- package/commonjs/Avatar/Avatar.js +24 -16
- package/commonjs/Badge/Badge.js +20 -13
- package/commonjs/Banner/Banner.js +35 -25
- package/commonjs/Box/Box.js +7 -2
- package/commonjs/Breadcrumb/Breadcrumb.js +36 -23
- package/commonjs/Button/Button.js +11 -3
- package/commonjs/Card/Card.js +25 -18
- package/commonjs/Card/subComponents.js +32 -15
- package/commonjs/CharacterCounter/CharacterCounter.js +7 -3
- package/commonjs/ChartLegend/ChartLegend.js +10 -3
- package/commonjs/ChartLegend/useChartLabels.js +12 -10
- package/commonjs/Checkbox/Checkbox.js +55 -45
- package/commonjs/Checkbox/styles.js +20 -17
- package/commonjs/Collapsible/Collapsible.js +22 -16
- package/commonjs/DatePicker/DateRangePicker/DateRangePicker.js +26 -16
- package/commonjs/DatePicker/DateRangePicker/StatefulDateRangePicker.js +7 -2
- package/commonjs/DatePicker/SingleDatePicker/SingleDatePicker.js +24 -14
- package/commonjs/DatePicker/SingleDatePicker/StatefulSingleDatePicker.js +7 -2
- package/commonjs/DatePicker/common.js +8 -6
- package/commonjs/Drawer/Drawer.js +160 -113
- package/commonjs/EmptyState/EmptyState.js +44 -31
- package/commonjs/Fieldset/Fieldset.js +31 -14
- package/commonjs/FormField/FormField.js +37 -31
- package/commonjs/Icon/Icon.js +35 -30
- package/commonjs/Image/Image.js +5 -3
- package/commonjs/Indicator/Indicator.js +12 -6
- package/commonjs/Input/Input.js +57 -51
- package/commonjs/KeyboardKey/KeyboardKey.js +12 -3
- package/commonjs/Label/Label.js +15 -9
- package/commonjs/Link/Link.js +10 -3
- package/commonjs/Listbox/Listbox.js +16 -13
- package/commonjs/Loader/Loader.js +9 -3
- package/commonjs/LoaderButton/LoaderButton.js +28 -18
- package/commonjs/Menu/Menu.js +128 -107
- package/commonjs/Menu/utils/descendants.js +6 -6
- package/commonjs/Message/Message.js +79 -59
- package/commonjs/Modal/Modal.js +54 -31
- package/commonjs/Modal/styles.js +8 -4
- package/commonjs/Numeral/Numeral.js +27 -11
- package/commonjs/PartnerLogo/PartnerLogo.js +22 -12
- package/commonjs/Radio/Radio.js +28 -22
- package/commonjs/SegmentedControl/SegmentedControl.js +38 -24
- package/commonjs/Select/Select.js +32 -25
- package/commonjs/SpotIllustration/SpotIllustration.js +13 -5
- package/commonjs/Stack/Stack.js +15 -8
- package/commonjs/Switch/Switch.js +14 -7
- package/commonjs/Table/Table.js +65 -45
- package/commonjs/TableCell/TableCell.js +6 -3
- package/commonjs/TableHeaderCell/TableHeaderCell.js +20 -12
- package/commonjs/TableRowAccordion/TableRowAccordion.js +35 -29
- package/commonjs/Tabs/Tabs.js +37 -30
- package/commonjs/Text/Text.js +10 -3
- package/commonjs/Textarea/Textarea.js +37 -32
- package/commonjs/ThemeProvider/index.js +8 -5
- package/commonjs/Toast/Toast.js +127 -91
- package/commonjs/Toast/index.js +15 -15
- package/commonjs/Toast/styles.js +56 -30
- package/commonjs/ToggleHint/ToggleHint.js +11 -5
- package/commonjs/Token/Token.js +39 -25
- package/commonjs/TokenInput/TokenInput.js +55 -47
- package/commonjs/TokenInput/TokenScreenReaderStatus.js +5 -3
- package/commonjs/Tooltip/Tooltip.js +34 -27
- package/commonjs/themes/light/theme.js +1 -0
- package/dist/types/Drawer/Drawer.d.ts.map +1 -1
- package/dist/types/Drawer/DrawerTypes.d.ts +6 -3
- package/dist/types/Drawer/DrawerTypes.d.ts.map +1 -1
- package/dist/types/Listbox/ListboxTypes.d.ts +1 -1
- package/dist/types/Listbox/ListboxTypes.d.ts.map +1 -1
- package/dist/types/Menu/MenuTypes.d.ts +4 -4
- package/dist/types/Menu/MenuTypes.d.ts.map +1 -1
- package/dist/types/Message/MessageTypes.d.ts +1 -1
- package/dist/types/Message/MessageTypes.d.ts.map +1 -1
- package/dist/types/ThemeProvider/index.d.ts +1 -1
- package/dist/types/ThemeProvider/index.d.ts.map +1 -1
- package/dist/types/Toast/Toast.d.ts +23 -2
- package/dist/types/Toast/Toast.d.ts.map +1 -1
- package/dist/types/Toast/ToastTypes.d.ts +27 -13
- package/dist/types/Toast/ToastTypes.d.ts.map +1 -1
- package/dist/types/Toast/index.d.ts +2 -4
- package/dist/types/Toast/index.d.ts.map +1 -1
- package/dist/types/Toast/styles.d.ts +11 -15
- package/dist/types/Toast/styles.d.ts.map +1 -1
- package/dist/types/Tooltip/TooltipTypes.d.ts +2 -2
- package/dist/types/Tooltip/TooltipTypes.d.ts.map +1 -1
- package/dist/types/themes/dark/theme.d.ts +2 -0
- package/dist/types/themes/dark/theme.d.ts.map +1 -1
- package/dist/types/themes/light/theme.d.ts +3 -0
- package/dist/types/themes/light/theme.d.ts.map +1 -1
- package/dist/types/utils/react-testing-library.d.ts +61 -121
- package/dist/types/utils/react-testing-library.d.ts.map +1 -1
- package/lib/Avatar/Avatar.js +25 -16
- package/lib/Badge/Badge.js +22 -13
- package/lib/Banner/Banner.js +37 -25
- package/lib/Box/Box.js +8 -2
- package/lib/Breadcrumb/Breadcrumb.js +37 -23
- package/lib/Button/Button.js +11 -3
- package/lib/Card/Card.js +17 -8
- package/lib/Card/subComponents.js +35 -15
- package/lib/CharacterCounter/CharacterCounter.js +7 -3
- package/lib/ChartLegend/ChartLegend.js +11 -3
- package/lib/ChartLegend/useChartLabels.js +13 -10
- package/lib/Checkbox/Checkbox.js +56 -45
- package/lib/Checkbox/styles.js +20 -17
- package/lib/Collapsible/Collapsible.js +22 -16
- package/lib/DatePicker/DateRangePicker/DateRangePicker.js +29 -16
- package/lib/DatePicker/DateRangePicker/StatefulDateRangePicker.js +8 -2
- package/lib/DatePicker/SingleDatePicker/SingleDatePicker.js +27 -14
- package/lib/DatePicker/SingleDatePicker/StatefulSingleDatePicker.js +8 -2
- package/lib/DatePicker/common.js +8 -6
- package/lib/Drawer/Drawer.js +159 -111
- package/lib/EmptyState/EmptyState.js +46 -31
- package/lib/Fieldset/Fieldset.js +33 -14
- package/lib/FormField/FormField.js +38 -31
- package/lib/Icon/Icon.js +36 -30
- package/lib/Image/Image.js +5 -3
- package/lib/Indicator/Indicator.js +13 -6
- package/lib/Input/Input.js +57 -49
- package/lib/KeyboardKey/KeyboardKey.js +12 -3
- package/lib/Label/Label.js +16 -9
- package/lib/Link/Link.js +11 -3
- package/lib/Listbox/Listbox.js +17 -13
- package/lib/Loader/Loader.js +9 -3
- package/lib/LoaderButton/LoaderButton.js +30 -18
- package/lib/Menu/Menu.js +128 -104
- package/lib/Menu/utils/descendants.js +5 -4
- package/lib/Message/Message.js +80 -59
- package/lib/Modal/Modal.js +56 -31
- package/lib/Modal/styles.js +8 -2
- package/lib/Numeral/Numeral.js +30 -11
- package/lib/PartnerLogo/PartnerLogo.js +22 -12
- package/lib/Radio/Radio.js +29 -22
- package/lib/SegmentedControl/SegmentedControl.js +40 -24
- package/lib/Select/Select.js +33 -25
- package/lib/SpotIllustration/SpotIllustration.js +13 -5
- package/lib/Stack/Stack.js +17 -8
- package/lib/Switch/Switch.js +15 -7
- package/lib/Table/Table.js +65 -43
- package/lib/TableCell/TableCell.js +5 -2
- package/lib/TableHeaderCell/TableHeaderCell.js +20 -11
- package/lib/TableRowAccordion/TableRowAccordion.js +35 -28
- package/lib/Tabs/Tabs.js +37 -30
- package/lib/Text/Text.js +11 -3
- package/lib/Textarea/Textarea.js +37 -30
- package/lib/ThemeProvider/index.js +8 -3
- package/lib/Toast/Toast.js +130 -90
- package/lib/Toast/index.js +3 -5
- package/lib/Toast/styles.js +55 -26
- package/lib/ToggleHint/ToggleHint.js +12 -5
- package/lib/Token/Token.js +42 -25
- package/lib/TokenInput/TokenInput.js +56 -47
- package/lib/TokenInput/TokenScreenReaderStatus.js +5 -3
- package/lib/Tooltip/Tooltip.js +34 -27
- package/lib/themes/light/theme.js +1 -0
- package/package.json +37 -33
- package/commonjs/Drawer/SlideTransition.js +0 -47
- package/commonjs/Popout/Popout.js +0 -313
- package/commonjs/Popout/PopoutTypes.js +0 -5
- package/commonjs/Popout/index.js +0 -30
- package/commonjs/Popout/styles.js +0 -13
- package/dist/types/Drawer/SlideTransition.d.ts +0 -15
- package/dist/types/Drawer/SlideTransition.d.ts.map +0 -1
- package/dist/types/Popout/Popout.d.ts +0 -14
- package/dist/types/Popout/Popout.d.ts.map +0 -1
- package/dist/types/Popout/PopoutTypes.d.ts +0 -90
- package/dist/types/Popout/PopoutTypes.d.ts.map +0 -1
- package/dist/types/Popout/index.d.ts +0 -5
- package/dist/types/Popout/index.d.ts.map +0 -1
- package/dist/types/Popout/styles.d.ts +0 -2
- package/dist/types/Popout/styles.d.ts.map +0 -1
- package/lib/Drawer/SlideTransition.js +0 -38
- package/lib/Popout/Popout.js +0 -303
- package/lib/Popout/PopoutTypes.js +0 -1
- package/lib/Popout/index.js +0 -4
- package/lib/Popout/styles.js +0 -6
package/lib/Icon/Icon.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
var _excluded = ["name", "size", "fixedWidth", "ariaLabel", "color", "svgProps"],
|
|
2
2
|
_excluded2 = ["activeName", "inactiveName", "isActive", "size", "fixedWidth", "ariaLabel"];
|
|
3
3
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
5
4
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
6
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
6
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -17,6 +16,8 @@ import { includes } from "../utils";
|
|
|
17
16
|
import { LogoNamesWithoutVariants as PartnerLogoNames } from "@sproutsocial/seeds-partner-logos";
|
|
18
17
|
import Container from "./styles";
|
|
19
18
|
import { ExternalViewBoxes, GeneralViewBoxes, SproutViewBoxes, ExternalIconNames } from "@sproutsocial/seeds-icons";
|
|
19
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
21
|
var AllViewboxes = _objectSpread(_objectSpread(_objectSpread({}, ExternalViewBoxes), GeneralViewBoxes), SproutViewBoxes);
|
|
21
22
|
var Icon = function Icon(_ref) {
|
|
22
23
|
var name = _ref.name,
|
|
@@ -37,11 +38,11 @@ var Icon = function Icon(_ref) {
|
|
|
37
38
|
logoType: "symbol",
|
|
38
39
|
svgProps: svgProps
|
|
39
40
|
};
|
|
40
|
-
return /*#__PURE__*/
|
|
41
|
+
return /*#__PURE__*/_jsx(PartnerLogo
|
|
41
42
|
// ariaLabel needs to be overridable by aria-label prop in ...rest
|
|
42
|
-
,
|
|
43
|
+
, _objectSpread(_objectSpread({
|
|
43
44
|
"aria-label": ariaLabel
|
|
44
|
-
}, rest, logoProps));
|
|
45
|
+
}, rest), logoProps));
|
|
45
46
|
}
|
|
46
47
|
var defaultVariant = size === "mini" ? "solid" : "outline";
|
|
47
48
|
var iconName =
|
|
@@ -51,23 +52,26 @@ var Icon = function Icon(_ref) {
|
|
|
51
52
|
// else use name as is
|
|
52
53
|
name;
|
|
53
54
|
var iconViewBox = AllViewboxes[iconName];
|
|
54
|
-
return /*#__PURE__*/
|
|
55
|
+
return /*#__PURE__*/_jsx(Container, _objectSpread(_objectSpread({
|
|
55
56
|
iconSize: size,
|
|
56
57
|
fixedWidth: !!fixedWidth,
|
|
57
|
-
key: iconName,
|
|
58
58
|
role: "img",
|
|
59
59
|
"aria-label": ariaLabel,
|
|
60
60
|
"data-qa-icon": iconName,
|
|
61
61
|
color: color
|
|
62
|
-
}, rest),
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
62
|
+
}, rest), {}, {
|
|
63
|
+
children: /*#__PURE__*/_jsx("svg", _objectSpread(_objectSpread({
|
|
64
|
+
className: "Icon-svg",
|
|
65
|
+
viewBox: iconViewBox,
|
|
66
|
+
focusable: false,
|
|
67
|
+
"data-qa-icon-svg": "".concat(iconName, "-svg")
|
|
68
|
+
}, svgProps), {}, {
|
|
69
|
+
children: /*#__PURE__*/_jsx("use", {
|
|
70
|
+
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
71
|
+
xlinkHref: "#seeds-svgs_".concat(iconName)
|
|
72
|
+
})
|
|
73
|
+
}))
|
|
74
|
+
}), iconName);
|
|
71
75
|
};
|
|
72
76
|
var ToggleableIcon = styled(Icon).withConfig({
|
|
73
77
|
displayName: "Icon__ToggleableIcon",
|
|
@@ -89,24 +93,26 @@ var IconToggle = function IconToggle(_ref2) {
|
|
|
89
93
|
fixedWidth = _ref2$fixedWidth === void 0 ? false : _ref2$fixedWidth,
|
|
90
94
|
ariaLabel = _ref2.ariaLabel,
|
|
91
95
|
rest = _objectWithoutProperties(_ref2, _excluded2);
|
|
92
|
-
return /*#__PURE__*/
|
|
96
|
+
return /*#__PURE__*/_jsxs(Box, _objectSpread(_objectSpread({
|
|
93
97
|
as: "span",
|
|
94
98
|
position: "relative",
|
|
95
99
|
display: "inline-flex"
|
|
96
|
-
}, rest),
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
100
|
+
}, rest), {}, {
|
|
101
|
+
children: [/*#__PURE__*/_jsx(ToggleableIcon, {
|
|
102
|
+
active: isActive,
|
|
103
|
+
name: activeName,
|
|
104
|
+
size: size,
|
|
105
|
+
fixedWidth: fixedWidth,
|
|
106
|
+
"aria-label": ariaLabel,
|
|
107
|
+
"aria-hidden": !isActive
|
|
108
|
+
}), /*#__PURE__*/_jsx(ToggleableIcon, {
|
|
109
|
+
active: !isActive,
|
|
110
|
+
name: inactiveName,
|
|
111
|
+
size: size,
|
|
112
|
+
fixedWidth: fixedWidth,
|
|
113
|
+
"aria-label": ariaLabel,
|
|
114
|
+
"aria-hidden": isActive
|
|
115
|
+
})]
|
|
110
116
|
}));
|
|
111
117
|
};
|
|
112
118
|
IconToggle.displayName = "Icon.Toggle";
|
package/lib/Image/Image.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
var _excluded = ["alt", "title", "onClick", "onError", "onLoad", "src", "qa"];
|
|
2
2
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
3
|
-
function
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
5
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
5
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; }
|
|
6
7
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
@@ -18,6 +19,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
18
19
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
19
20
|
import * as React from "react";
|
|
20
21
|
import ImageContainer from "./styles";
|
|
22
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
21
23
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
22
24
|
var noop = function noop() {};
|
|
23
25
|
var Image = /*#__PURE__*/function (_React$Component) {
|
|
@@ -89,7 +91,7 @@ var Image = /*#__PURE__*/function (_React$Component) {
|
|
|
89
91
|
src = _this$props.src,
|
|
90
92
|
qa = _this$props.qa,
|
|
91
93
|
rest = _objectWithoutProperties(_this$props, _excluded);
|
|
92
|
-
return /*#__PURE__*/
|
|
94
|
+
return /*#__PURE__*/_jsx(ImageContainer, _objectSpread(_objectSpread({
|
|
93
95
|
isLoading: !this.state.didLoad,
|
|
94
96
|
ref: function ref(img) {
|
|
95
97
|
return _this2.imageRef = img;
|
|
@@ -104,7 +106,7 @@ var Image = /*#__PURE__*/function (_React$Component) {
|
|
|
104
106
|
title: title,
|
|
105
107
|
"data-qa-image": title ? title : alt ? alt : "",
|
|
106
108
|
"data-qa-image-src": src || ""
|
|
107
|
-
}, qa, rest));
|
|
109
|
+
}, qa), rest));
|
|
108
110
|
}
|
|
109
111
|
}]);
|
|
110
112
|
return Image;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
var _excluded = ["tooltip"];
|
|
2
2
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
3
|
-
function
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
5
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
5
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; }
|
|
6
7
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
@@ -19,6 +20,8 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
19
20
|
import * as React from "react";
|
|
20
21
|
import Icon from "../Icon";
|
|
21
22
|
import Container from "./styles";
|
|
23
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
25
|
var Indicator = /*#__PURE__*/function (_React$Component) {
|
|
23
26
|
_inherits(Indicator, _React$Component);
|
|
24
27
|
function Indicator() {
|
|
@@ -31,15 +34,19 @@ var Indicator = /*#__PURE__*/function (_React$Component) {
|
|
|
31
34
|
var _this$props = this.props,
|
|
32
35
|
tooltip = _this$props.tooltip,
|
|
33
36
|
rest = _objectWithoutProperties(_this$props, _excluded);
|
|
34
|
-
return /*#__PURE__*/
|
|
37
|
+
return /*#__PURE__*/_jsxs(Container, _objectSpread(_objectSpread({
|
|
35
38
|
"data-tip": tooltip,
|
|
36
39
|
"data-qa-indicator": "",
|
|
37
40
|
"aria-label": tooltip,
|
|
38
41
|
tabIndex: 0
|
|
39
|
-
}, rest),
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
}, rest), {}, {
|
|
43
|
+
children: [tooltip && /*#__PURE__*/_jsx("div", {
|
|
44
|
+
children: tooltip
|
|
45
|
+
}), /*#__PURE__*/_jsx(Icon, {
|
|
46
|
+
name: "circle-fill-solid",
|
|
47
|
+
size: "mini",
|
|
48
|
+
"aria-hidden": true
|
|
49
|
+
})]
|
|
43
50
|
}));
|
|
44
51
|
}
|
|
45
52
|
}]);
|
package/lib/Input/Input.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
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
2
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
3
|
-
function
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
5
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
5
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; }
|
|
6
7
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
@@ -26,7 +27,8 @@ import Container, { Accessory } from "./styles";
|
|
|
26
27
|
|
|
27
28
|
// Using Context so that Input's Input.ClearButton-specific props can be passed to Input.ClearButton,
|
|
28
29
|
// regardless of whether it is manually included as elemAfter or automatically included for type="search" Inputs.
|
|
29
|
-
|
|
30
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
31
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
30
32
|
var InputContext = /*#__PURE__*/React.createContext({});
|
|
31
33
|
var StyledButton = styled(Button).withConfig({
|
|
32
34
|
displayName: "Input__StyledButton",
|
|
@@ -57,18 +59,19 @@ var ClearButton = function ClearButton() {
|
|
|
57
59
|
var py = inputSize === "small" ? 100 : undefined;
|
|
58
60
|
var px = inputSize === "small" ? 200 : undefined;
|
|
59
61
|
var buttonSize = inputSize === "small" ? "default" : inputSize;
|
|
60
|
-
return /*#__PURE__*/
|
|
62
|
+
return /*#__PURE__*/_jsx(StyledButton, {
|
|
61
63
|
onClick: handleClear,
|
|
62
64
|
size: buttonSize,
|
|
63
65
|
py: py,
|
|
64
66
|
px: px,
|
|
65
67
|
title: clearButtonLabel || "Clear",
|
|
66
68
|
ariaLabel: clearButtonLabel || "Clear",
|
|
67
|
-
color: "icon.base"
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
color: "icon.base",
|
|
70
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
71
|
+
name: "circle-x-outline",
|
|
72
|
+
"aria-hidden": true
|
|
73
|
+
})
|
|
74
|
+
});
|
|
72
75
|
};
|
|
73
76
|
ClearButton.displayName = "Input.ClearButton";
|
|
74
77
|
|
|
@@ -210,15 +213,15 @@ var Input = /*#__PURE__*/function (_React$Component) {
|
|
|
210
213
|
}
|
|
211
214
|
|
|
212
215
|
// Add default elemBefore and elemAfter elements if type is search.
|
|
213
|
-
var elementBefore = type === "search" && !elemBefore ? /*#__PURE__*/
|
|
216
|
+
var elementBefore = type === "search" && !elemBefore ? /*#__PURE__*/_jsx(Icon, {
|
|
214
217
|
name: "magnifying-glass-outline",
|
|
215
218
|
"aria-hidden": true,
|
|
216
219
|
color: "icon.base"
|
|
217
220
|
}) : elemBefore;
|
|
218
221
|
|
|
219
222
|
// Do not add a ClearButton if an elemAfter prop was passed.
|
|
220
|
-
var elementAfter = type === "search" && !elemAfter ? /*#__PURE__*/
|
|
221
|
-
return /*#__PURE__*/
|
|
223
|
+
var elementAfter = type === "search" && !elemAfter ? /*#__PURE__*/_jsx(ClearButton, {}) : elemAfter;
|
|
224
|
+
return /*#__PURE__*/_jsx(Container, _objectSpread(_objectSpread({
|
|
222
225
|
hasBeforeElement: !!elementBefore,
|
|
223
226
|
hasAfterElement: !!elementAfter,
|
|
224
227
|
disabled: disabled,
|
|
@@ -226,44 +229,49 @@ var Input = /*#__PURE__*/function (_React$Component) {
|
|
|
226
229
|
warning: hasWarning,
|
|
227
230
|
appearance: appearance,
|
|
228
231
|
size: size
|
|
229
|
-
}, rest),
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
232
|
+
}, rest), {}, {
|
|
233
|
+
children: /*#__PURE__*/_jsxs(InputContext.Provider, {
|
|
234
|
+
value: {
|
|
235
|
+
handleClear: this.handleClear,
|
|
236
|
+
hasValue: this.state.hasValue,
|
|
237
|
+
clearButtonLabel: clearButtonLabel,
|
|
238
|
+
size: size
|
|
239
|
+
},
|
|
240
|
+
children: [elementBefore && /*#__PURE__*/_jsx(Accessory, {
|
|
241
|
+
before: true,
|
|
242
|
+
children: elementBefore
|
|
243
|
+
}), /*#__PURE__*/_jsx("input", _objectSpread(_objectSpread({
|
|
244
|
+
"aria-invalid": !!isInvalid,
|
|
245
|
+
"aria-label": ariaLabel,
|
|
246
|
+
"aria-describedby": ariaDescribedby,
|
|
247
|
+
autoComplete: autoCompleteValue,
|
|
248
|
+
autoFocus: autoFocus,
|
|
249
|
+
disabled: disabled,
|
|
250
|
+
readOnly: readOnly,
|
|
251
|
+
id: id,
|
|
252
|
+
name: name,
|
|
253
|
+
placeholder: placeholder,
|
|
254
|
+
type: type,
|
|
255
|
+
required: required,
|
|
256
|
+
value: value,
|
|
257
|
+
maxLength: maxLength,
|
|
258
|
+
onBlur: this.handleBlur,
|
|
259
|
+
onChange: this.handleChange,
|
|
260
|
+
onFocus: this.handleFocus,
|
|
261
|
+
onKeyDown: this.handleKeyDown,
|
|
262
|
+
onKeyUp: this.handleKeyUp,
|
|
263
|
+
onPaste: this.handlePaste,
|
|
264
|
+
ref: mergeRefs([innerRef !== null && innerRef !== void 0 ? innerRef : null, this.inputRef]),
|
|
265
|
+
"data-qa-input": name || "",
|
|
266
|
+
"data-qa-input-isdisabled": disabled === true,
|
|
267
|
+
"data-qa-input-isrequired": required === true
|
|
268
|
+
}, qa), inputProps)), elementAfter && /*#__PURE__*/_jsx(Accessory, {
|
|
269
|
+
after: true,
|
|
270
|
+
isClearButton: isClearButton(elementAfter),
|
|
271
|
+
children: elementAfter
|
|
272
|
+
})]
|
|
273
|
+
})
|
|
274
|
+
}));
|
|
267
275
|
}
|
|
268
276
|
}]);
|
|
269
277
|
return Input;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
2
|
var _excluded = ["children"];
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3
6
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
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; }
|
|
5
8
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
@@ -17,6 +20,7 @@ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Objec
|
|
|
17
20
|
import * as React from "react";
|
|
18
21
|
import Text from "../Text";
|
|
19
22
|
import Container from "./styles";
|
|
23
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
24
|
var KeyboardKey = /*#__PURE__*/function (_React$Component) {
|
|
21
25
|
_inherits(KeyboardKey, _React$Component);
|
|
22
26
|
function KeyboardKey() {
|
|
@@ -29,9 +33,14 @@ var KeyboardKey = /*#__PURE__*/function (_React$Component) {
|
|
|
29
33
|
var _this$props = this.props,
|
|
30
34
|
children = _this$props.children,
|
|
31
35
|
rest = _objectWithoutProperties(_this$props, _excluded);
|
|
32
|
-
return /*#__PURE__*/
|
|
33
|
-
"
|
|
34
|
-
|
|
36
|
+
return /*#__PURE__*/_jsx(Container, _objectSpread(_objectSpread({}, rest), {}, {
|
|
37
|
+
children: /*#__PURE__*/_jsx("kbd", {
|
|
38
|
+
"data-qa-keyboardkey": children,
|
|
39
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
40
|
+
children: children
|
|
41
|
+
})
|
|
42
|
+
})
|
|
43
|
+
}));
|
|
35
44
|
}
|
|
36
45
|
}]);
|
|
37
46
|
return KeyboardKey;
|
package/lib/Label/Label.js
CHANGED
|
@@ -3,8 +3,6 @@ var _excluded = ["as"];
|
|
|
3
3
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
4
4
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
5
5
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
6
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
6
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
9
7
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
10
8
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
@@ -12,17 +10,23 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
12
10
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
13
11
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
14
12
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
15
|
-
function
|
|
13
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
14
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
15
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
16
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
17
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
16
18
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
17
19
|
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; }
|
|
18
20
|
import * as React from "react";
|
|
19
21
|
import styled from "styled-components";
|
|
20
22
|
import Text from "../Text";
|
|
23
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
25
|
var LabelBase = function LabelBase(_ref) {
|
|
22
26
|
var _ref$as = _ref.as,
|
|
23
27
|
as = _ref$as === void 0 ? "label" : _ref$as,
|
|
24
28
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
25
|
-
return /*#__PURE__*/
|
|
29
|
+
return /*#__PURE__*/_jsx(Text, _objectSpread(_objectSpread({}, rest), {}, {
|
|
26
30
|
as: as
|
|
27
31
|
}));
|
|
28
32
|
};
|
|
@@ -45,15 +49,18 @@ var Label = /*#__PURE__*/function (_React$Component) {
|
|
|
45
49
|
htmlFor = _this$props.htmlFor,
|
|
46
50
|
required = _this$props.required,
|
|
47
51
|
children = _this$props.children;
|
|
48
|
-
return /*#__PURE__*/
|
|
52
|
+
return /*#__PURE__*/_jsxs(StyledLabel, _objectSpread(_objectSpread({
|
|
49
53
|
fontSize: 200,
|
|
50
54
|
fontWeight: "semibold",
|
|
51
55
|
color: "text.headline",
|
|
52
56
|
"data-qa-label": htmlFor
|
|
53
|
-
}, this.props),
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
+
}, this.props), {}, {
|
|
58
|
+
children: [children, required && /*#__PURE__*/_jsx(Text, {
|
|
59
|
+
ml: 100,
|
|
60
|
+
"aria-hidden": true,
|
|
61
|
+
children: "*"
|
|
62
|
+
})]
|
|
63
|
+
}));
|
|
57
64
|
}
|
|
58
65
|
}]);
|
|
59
66
|
return Label;
|
package/lib/Link/Link.js
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
1
2
|
var _excluded = ["href", "external", "children", "disabled", "onClick", "as", "underline", "qa"];
|
|
2
|
-
function
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
3
8
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
9
|
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; }
|
|
5
10
|
import * as React from "react";
|
|
6
11
|
import Container from "./styles";
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
13
|
var Link = function Link(_ref) {
|
|
8
14
|
var href = _ref.href,
|
|
9
15
|
external = _ref.external,
|
|
@@ -21,7 +27,7 @@ var Link = function Link(_ref) {
|
|
|
21
27
|
console.warn("Warning: external prop cannot be set without a href declaration");
|
|
22
28
|
}
|
|
23
29
|
var type = as || (href ? "a" : "button");
|
|
24
|
-
return /*#__PURE__*/
|
|
30
|
+
return /*#__PURE__*/_jsx(Container, _objectSpread(_objectSpread(_objectSpread({
|
|
25
31
|
href: href,
|
|
26
32
|
target: external ? "_blank" : undefined,
|
|
27
33
|
type: type === "button" ? "button" : undefined,
|
|
@@ -33,6 +39,8 @@ var Link = function Link(_ref) {
|
|
|
33
39
|
underline: underline,
|
|
34
40
|
"data-qa-link": "",
|
|
35
41
|
"data-qa-link-isdisabled": disabled === true
|
|
36
|
-
}, qa, rest),
|
|
42
|
+
}, qa), rest), {}, {
|
|
43
|
+
children: children
|
|
44
|
+
}));
|
|
37
45
|
};
|
|
38
46
|
export default Link;
|
package/lib/Listbox/Listbox.js
CHANGED
|
@@ -6,7 +6,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
6
6
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
7
7
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
8
8
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
9
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
10
9
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
11
10
|
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
11
|
import * as React from "react";
|
|
@@ -15,14 +14,17 @@ import { MENU_ROLES } from "../Menu/utils/constants";
|
|
|
15
14
|
import { Arrow } from "../Select/styles";
|
|
16
15
|
import Icon from "../Icon";
|
|
17
16
|
import Menu, { MenuButton } from "../Menu";
|
|
17
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
19
|
export var Listbox = function Listbox(_ref) {
|
|
19
20
|
var _ref$role = _ref.role,
|
|
20
21
|
role = _ref$role === void 0 ? MENU_ROLES.LISTBOX : _ref$role,
|
|
21
22
|
children = _ref.children,
|
|
22
23
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
23
|
-
return /*#__PURE__*/
|
|
24
|
-
role: role
|
|
25
|
-
|
|
24
|
+
return /*#__PURE__*/_jsx(Menu, _objectSpread(_objectSpread({}, rest), {}, {
|
|
25
|
+
role: role,
|
|
26
|
+
children: children
|
|
27
|
+
}));
|
|
26
28
|
};
|
|
27
29
|
|
|
28
30
|
/**
|
|
@@ -83,17 +85,19 @@ export var ListboxButtonContainer = styled(MenuButton).withConfig({
|
|
|
83
85
|
export var ListboxButton = function ListboxButton(_ref2) {
|
|
84
86
|
var children = _ref2.children,
|
|
85
87
|
restProps = _objectWithoutProperties(_ref2, _excluded2);
|
|
86
|
-
return /*#__PURE__*/
|
|
88
|
+
return /*#__PURE__*/_jsxs(ListboxButtonContainer, _objectSpread(_objectSpread({}, restProps), {}, {
|
|
87
89
|
popoutProps: _objectSpread({
|
|
88
90
|
placement: "bottom-start"
|
|
89
|
-
}, restProps.popoutProps || {})
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
91
|
+
}, restProps.popoutProps || {}),
|
|
92
|
+
children: [children, /*#__PURE__*/_jsx(Arrow, {
|
|
93
|
+
size: restProps.size,
|
|
94
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
95
|
+
name: "chevron-down-outline",
|
|
96
|
+
fixedWidth: true,
|
|
97
|
+
"aria-hidden": true
|
|
98
|
+
})
|
|
99
|
+
})]
|
|
100
|
+
}));
|
|
97
101
|
};
|
|
98
102
|
Listbox.Option = Listbox.Item = Menu.Item;
|
|
99
103
|
Listbox.Checkbox = Menu.Checkbox;
|
package/lib/Loader/Loader.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
var _excluded = ["text", "size", "delay", "color", "qa"];
|
|
2
2
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
3
|
-
function
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
5
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
5
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; }
|
|
6
7
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
@@ -18,6 +19,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
18
19
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
19
20
|
import * as React from "react";
|
|
20
21
|
import Container, { Text } from "./styles";
|
|
22
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
21
23
|
var Loader = /*#__PURE__*/function (_React$Component) {
|
|
22
24
|
_inherits(Loader, _React$Component);
|
|
23
25
|
function Loader() {
|
|
@@ -34,12 +36,16 @@ var Loader = /*#__PURE__*/function (_React$Component) {
|
|
|
34
36
|
color = _this$props.color,
|
|
35
37
|
qa = _this$props.qa,
|
|
36
38
|
rest = _objectWithoutProperties(_this$props, _excluded);
|
|
37
|
-
return /*#__PURE__*/
|
|
39
|
+
return /*#__PURE__*/_jsx(Container, _objectSpread(_objectSpread(_objectSpread({
|
|
38
40
|
small: size === "small",
|
|
39
41
|
dark: color === "dark",
|
|
40
42
|
delay: delay,
|
|
41
43
|
"data-qa-loader": ""
|
|
42
|
-
}, qa, rest),
|
|
44
|
+
}, qa), rest), {}, {
|
|
45
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
46
|
+
children: text || "Loading"
|
|
47
|
+
})
|
|
48
|
+
}));
|
|
43
49
|
}
|
|
44
50
|
}]);
|
|
45
51
|
return Loader;
|