@sproutsocial/racine 12.22.0 → 12.22.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/CHANGELOG.md +6 -0
- package/README.md +2 -0
- package/__flow__/Avatar/__tests__/features.test.js +98 -0
- package/__flow__/Banner/index.js +2 -1
- package/__flow__/CharacterCounter/index.test.js +1 -1
- package/__flow__/Collapsible/index.js +2 -2
- package/__flow__/Drawer/index.js +11 -0
- package/__flow__/Drawer/index.stories.js +2 -1
- package/__flow__/EmptyState/index.test.js +1 -1
- package/__flow__/Fieldset/index.js +1 -1
- package/__flow__/Indicator/index.js +1 -1
- package/__flow__/Input/index.js +2 -1
- package/__flow__/Link/index.js +2 -1
- package/__flow__/Link/index.test.js +2 -0
- package/__flow__/Listbox/index.stories.js +1 -0
- package/__flow__/Loader/index.js +1 -1
- package/__flow__/Modal/index.stories.js +1 -1
- package/__flow__/Numeral/tests/testNumeral.js +1 -0
- package/__flow__/Popout/index.js +1 -1
- package/__flow__/Portal/index.stories.js +7 -7
- package/__flow__/SegmentedControl/index.js +1 -1
- package/__flow__/Table/index.js +4 -4
- package/__flow__/TableCell/index.js +1 -1
- package/__flow__/TableHeaderCell/index.js +1 -1
- package/__flow__/Tabs/index.js +1 -1
- package/__flow__/Textarea/index.js +1 -1
- package/__flow__/Toast/index.js +1 -1
- package/__flow__/Toast/styles.js +1 -1
- package/__flow__/TokenInput/index.stories.js +4 -4
- package/__flow__/TokenInput/tests/default/pasting.test.js +6 -2
- package/__flow__/code-guidelines.mdx +244 -0
- package/__flow__/setupTests.js +1 -0
- package/__flow__/utils/a11yTest.js +1 -0
- package/__flow__/utils/system-props.js +1 -0
- package/commonjs/Avatar/index.js +19 -10
- package/commonjs/Badge/constants.js +3 -1
- package/commonjs/Badge/index.js +7 -3
- package/commonjs/Badge/styles.js +4 -2
- package/commonjs/Banner/index.js +9 -4
- package/commonjs/Banner/styles.js +5 -2
- package/commonjs/Box/index.js +5 -2
- package/commonjs/Box/styles.js +3 -1
- package/commonjs/Breadcrumb/index.js +12 -5
- package/commonjs/Breadcrumb/styles.js +3 -1
- package/commonjs/Button/index.js +7 -3
- package/commonjs/Button/styles.js +6 -3
- package/commonjs/Card/index.js +7 -3
- package/commonjs/Card/styles.js +3 -1
- package/commonjs/CharacterCounter/index.js +39 -22
- package/commonjs/CharacterCounter/styles.js +5 -2
- package/commonjs/ChartLegend/index.js +7 -3
- package/commonjs/ChartLegend/styles.js +5 -2
- package/commonjs/Checkbox/index.js +117 -97
- package/commonjs/Checkbox/styles.js +5 -2
- package/commonjs/Collapsible/index.js +27 -12
- package/commonjs/Collapsible/styles.js +4 -2
- package/commonjs/DatePicker/DateRangePicker.js +7 -3
- package/commonjs/DatePicker/SingleDatePicker.js +7 -3
- package/commonjs/DatePicker/StatefulDateRangePicker.js +19 -7
- package/commonjs/DatePicker/StatefulSingleDatePicker.js +16 -5
- package/commonjs/DatePicker/common.js +4 -2
- package/commonjs/DatePicker/index.js +15 -3
- package/commonjs/DatePicker/styles.js +5 -2
- package/commonjs/Drawer/SlideTransition.js +9 -5
- package/commonjs/Drawer/index.js +15 -7
- package/commonjs/Drawer/styles.js +5 -2
- package/commonjs/EmptyState/index.js +7 -3
- package/commonjs/Fieldset/index.js +10 -6
- package/commonjs/Fieldset/styles.js +5 -2
- package/commonjs/FormField/index.js +17 -6
- package/commonjs/Icon/deprecatedIcons.js +3 -1
- package/commonjs/Icon/index.js +9 -5
- package/commonjs/Icon/styles.js +6 -3
- package/commonjs/Image/index.js +78 -58
- package/commonjs/Image/styles.js +5 -2
- package/commonjs/Indicator/index.js +40 -23
- package/commonjs/Indicator/styles.js +4 -2
- package/commonjs/Input/index.js +156 -132
- package/commonjs/Input/styles.js +5 -2
- package/commonjs/KeyboardKey/index.js +30 -14
- package/commonjs/KeyboardKey/styles.js +3 -1
- package/commonjs/Label/index.js +32 -16
- package/commonjs/Link/constants.js +3 -1
- package/commonjs/Link/index.js +9 -4
- package/commonjs/Link/styles.js +5 -2
- package/commonjs/Listbox/index.js +15 -8
- package/commonjs/Loader/index.js +43 -26
- package/commonjs/Loader/styles.js +5 -2
- package/commonjs/LoaderButton/index.js +7 -3
- package/commonjs/Menu/constants.js +3 -1
- package/commonjs/Menu/descendants.js +35 -20
- package/commonjs/Menu/hooks.js +8 -8
- package/commonjs/Menu/index.flow.js +2 -1
- package/commonjs/Menu/index.js +44 -27
- package/commonjs/Menu/names.js +3 -1
- package/commonjs/Menu/styles.js +6 -3
- package/commonjs/Message/index.js +7 -3
- package/commonjs/Message/styles.js +4 -2
- package/commonjs/Modal/index.js +9 -5
- package/commonjs/Modal/styles.js +9 -5
- package/commonjs/Numeral/constants.js +3 -1
- package/commonjs/Numeral/index.js +16 -5
- package/commonjs/Numeral/styles.js +3 -1
- package/commonjs/Numeral/tests/testNumeral.js +16 -11
- package/commonjs/OverflowList/index.flow.js +2 -1
- package/commonjs/OverflowList/index.js +6 -3
- package/commonjs/OverflowList/styles.js +5 -2
- package/commonjs/PartnerLogo/index.js +9 -6
- package/commonjs/PartnerLogo/styles.js +5 -2
- package/commonjs/Popout/index.js +28 -13
- package/commonjs/Popout/styles.js +3 -1
- package/commonjs/Portal/index.js +50 -30
- package/commonjs/Radio/index.js +73 -56
- package/commonjs/Radio/styles.js +5 -2
- package/commonjs/SegmentedControl/index.js +21 -9
- package/commonjs/SegmentedControl/styles.js +5 -2
- package/commonjs/Select/index.js +78 -61
- package/commonjs/Select/styles.js +8 -5
- package/commonjs/Skeleton/index.js +4 -2
- package/commonjs/SpotIllustration/illustrationNames.js +3 -1
- package/commonjs/SpotIllustration/index.js +5 -3
- package/commonjs/Stack/index.js +7 -3
- package/commonjs/Switch/index.js +52 -35
- package/commonjs/Switch/styles.js +6 -3
- package/commonjs/Table/index.js +14 -10
- package/commonjs/Table/styles.js +3 -1
- package/commonjs/TableCell/index.js +39 -23
- package/commonjs/TableCell/styles.js +3 -1
- package/commonjs/TableHeaderCell/index.js +54 -37
- package/commonjs/TableHeaderCell/styles.js +5 -2
- package/commonjs/TableRowAccordion/index.js +61 -44
- package/commonjs/TableRowAccordion/styles.js +5 -2
- package/commonjs/Tabs/index.js +116 -90
- package/commonjs/Tabs/styles.js +8 -5
- package/commonjs/Text/index.js +7 -3
- package/commonjs/Text/styles.js +5 -2
- package/commonjs/Textarea/index.js +104 -87
- package/commonjs/Textarea/styles.js +5 -2
- package/commonjs/ThemeProvider/index.js +5 -2
- package/commonjs/Toast/index.js +7 -8
- package/commonjs/Toast/styles.js +5 -2
- package/commonjs/ToggleHint/index.js +43 -26
- package/commonjs/ToggleHint/styles.js +6 -3
- package/commonjs/Token/index.js +7 -3
- package/commonjs/Token/styles.js +5 -2
- package/commonjs/TokenInput/index.js +221 -192
- package/commonjs/TokenInput/styles.js +5 -2
- package/commonjs/TokenInput/util.js +5 -3
- package/commonjs/Tooltip/index.js +30 -14
- package/commonjs/Tooltip/styles.js +3 -1
- package/commonjs/VisuallyHidden/index.js +3 -1
- package/commonjs/dataviz/index.js +3 -1
- package/commonjs/index.js +451 -84
- package/commonjs/systemProps/background.js +3 -1
- package/commonjs/systemProps/border.js +3 -1
- package/commonjs/systemProps/color.js +3 -1
- package/commonjs/systemProps/custom.js +3 -1
- package/commonjs/systemProps/flexbox.js +3 -1
- package/commonjs/systemProps/grid.js +3 -1
- package/commonjs/systemProps/index.js +87 -15
- package/commonjs/systemProps/layout.js +3 -1
- package/commonjs/systemProps/position.js +3 -1
- package/commonjs/systemProps/shadow.js +3 -1
- package/commonjs/systemProps/space.js +3 -1
- package/commonjs/systemProps/systemProps.js +3 -1
- package/commonjs/systemProps/typography.js +3 -1
- package/commonjs/systemProps/variant.js +3 -1
- package/commonjs/themes/dark/dataviz-palette.js +3 -1
- package/commonjs/themes/dark/decorative-palettes.js +3 -1
- package/commonjs/themes/dark/theme.js +11 -7
- package/commonjs/themes/extendedThemes/sproutTheme/dark/theme.js +9 -5
- package/commonjs/themes/extendedThemes/sproutTheme/index.js +15 -4
- package/commonjs/themes/extendedThemes/sproutTheme/light/theme.js +8 -4
- package/commonjs/themes/light/dataviz-palette.js +3 -1
- package/commonjs/themes/light/decorative-palettes.js +3 -1
- package/commonjs/themes/light/literal-colors.js +3 -1
- package/commonjs/themes/light/theme.js +17 -13
- package/commonjs/utils/a11yTest.js +5 -2
- package/commonjs/utils/chartColors.js +3 -1
- package/commonjs/utils/constants.js +3 -1
- package/commonjs/utils/dataQaLabelQueries.js +26 -16
- package/commonjs/utils/hooks.js +39 -26
- package/commonjs/utils/index.js +18 -8
- package/commonjs/utils/innerText.js +4 -2
- package/commonjs/utils/mixins.js +3 -1
- package/commonjs/utils/react-testing-library.js +74 -18
- package/commonjs/utils/responsiveProps/index.js +16 -8
- package/commonjs/utils/system-props.js +6 -2
- package/commonjs/utils/useInteractiveColor.js +3 -1
- package/dist/themes/dark/theme.scss +0 -1
- package/dist/themes/extendedThemes/sproutTheme/dark/theme.scss +0 -1
- package/dist/themes/extendedThemes/sproutTheme/light/theme.scss +0 -1
- package/dist/themes/light/theme.scss +0 -1
- package/lib/Avatar/index.js +17 -11
- package/lib/Badge/index.js +5 -4
- package/lib/Badge/styles.js +3 -3
- package/lib/Banner/index.js +7 -5
- package/lib/Banner/styles.js +1 -1
- package/lib/Box/index.js +1 -1
- package/lib/Box/styles.js +1 -1
- package/lib/Breadcrumb/index.js +11 -7
- package/lib/Button/index.js +3 -2
- package/lib/Button/styles.js +4 -4
- package/lib/Card/index.js +3 -2
- package/lib/Card/styles.js +2 -2
- package/lib/CharacterCounter/index.js +36 -21
- package/lib/CharacterCounter/styles.js +1 -1
- package/lib/ChartLegend/index.js +5 -4
- package/lib/ChartLegend/styles.js +1 -1
- package/lib/Checkbox/index.js +114 -96
- package/lib/Checkbox/styles.js +5 -5
- package/lib/Collapsible/index.js +24 -12
- package/lib/Collapsible/styles.js +2 -2
- package/lib/DatePicker/DateRangePicker.js +4 -3
- package/lib/DatePicker/SingleDatePicker.js +4 -3
- package/lib/DatePicker/StatefulDateRangePicker.js +15 -6
- package/lib/DatePicker/StatefulSingleDatePicker.js +12 -4
- package/lib/DatePicker/common.js +3 -3
- package/lib/DatePicker/index.js +2 -2
- package/lib/DatePicker/styles.js +2 -2
- package/lib/Drawer/SlideTransition.js +4 -3
- package/lib/Drawer/index.js +17 -12
- package/lib/Drawer/styles.js +2 -2
- package/lib/EmptyState/index.js +4 -3
- package/lib/Fieldset/index.js +8 -7
- package/lib/Fieldset/styles.js +1 -1
- package/lib/FormField/index.js +17 -9
- package/lib/Icon/index.js +8 -7
- package/lib/Icon/styles.js +2 -2
- package/lib/Image/index.js +75 -57
- package/lib/Image/styles.js +1 -1
- package/lib/Indicator/index.js +38 -23
- package/lib/Indicator/styles.js +3 -3
- package/lib/Input/index.js +157 -135
- package/lib/Input/styles.js +2 -2
- package/lib/KeyboardKey/index.js +28 -14
- package/lib/KeyboardKey/styles.js +1 -1
- package/lib/Label/index.js +29 -15
- package/lib/Link/index.js +5 -3
- package/lib/Link/styles.js +3 -3
- package/lib/Listbox/index.js +14 -10
- package/lib/Loader/index.js +40 -25
- package/lib/Loader/styles.js +2 -2
- package/lib/LoaderButton/index.js +5 -4
- package/lib/Menu/descendants.js +30 -18
- package/lib/Menu/hooks.js +7 -9
- package/lib/Menu/index.flow.js +4 -4
- package/lib/Menu/index.js +54 -40
- package/lib/Menu/styles.js +3 -3
- package/lib/Message/index.js +6 -5
- package/lib/Message/styles.js +4 -4
- package/lib/Modal/index.js +9 -8
- package/lib/Modal/styles.js +6 -5
- package/lib/Numeral/index.js +15 -7
- package/lib/Numeral/styles.js +1 -1
- package/lib/Numeral/tests/testNumeral.js +15 -11
- package/lib/OverflowList/index.js +3 -3
- package/lib/OverflowList/styles.js +1 -1
- package/lib/PartnerLogo/index.js +8 -7
- package/lib/PartnerLogo/styles.js +1 -1
- package/lib/Popout/index.js +27 -15
- package/lib/Popout/styles.js +1 -1
- package/lib/Portal/index.js +47 -29
- package/lib/Radio/index.js +70 -55
- package/lib/Radio/styles.js +3 -3
- package/lib/SegmentedControl/index.js +18 -9
- package/lib/SegmentedControl/styles.js +3 -3
- package/lib/Select/index.js +76 -61
- package/lib/Select/styles.js +5 -5
- package/lib/Skeleton/index.js +2 -2
- package/lib/SpotIllustration/index.js +3 -3
- package/lib/Stack/index.js +4 -3
- package/lib/Switch/index.js +51 -36
- package/lib/Switch/styles.js +4 -4
- package/lib/Table/index.js +12 -11
- package/lib/Table/styles.js +1 -1
- package/lib/TableCell/index.js +36 -22
- package/lib/TableCell/styles.js +1 -1
- package/lib/TableHeaderCell/index.js +52 -37
- package/lib/TableHeaderCell/styles.js +1 -1
- package/lib/TableRowAccordion/index.js +60 -45
- package/lib/TableRowAccordion/styles.js +1 -1
- package/lib/Tabs/index.js +113 -89
- package/lib/Tabs/styles.js +5 -5
- package/lib/Text/index.js +3 -2
- package/lib/Text/styles.js +1 -1
- package/lib/Textarea/index.js +101 -86
- package/lib/Textarea/styles.js +2 -2
- package/lib/ThemeProvider/index.js +1 -1
- package/lib/Toast/index.js +6 -10
- package/lib/Toast/styles.js +4 -3
- package/lib/ToggleHint/index.js +41 -26
- package/lib/ToggleHint/styles.js +3 -3
- package/lib/Token/index.js +6 -5
- package/lib/Token/styles.js +3 -3
- package/lib/TokenInput/index.js +223 -196
- package/lib/TokenInput/styles.js +2 -2
- package/lib/TokenInput/util.js +2 -2
- package/lib/Tooltip/index.js +28 -14
- package/lib/Tooltip/styles.js +1 -1
- package/lib/VisuallyHidden/index.js +1 -1
- package/lib/dataviz/index.js +1 -1
- package/lib/index.js +64 -64
- package/lib/systemProps/index.js +14 -14
- package/lib/systemProps/systemProps.js +12 -12
- package/lib/themes/dark/theme.js +11 -9
- package/lib/themes/extendedThemes/sproutTheme/dark/theme.js +7 -5
- package/lib/themes/extendedThemes/sproutTheme/index.js +2 -2
- package/lib/themes/extendedThemes/sproutTheme/light/theme.js +6 -4
- package/lib/themes/light/theme.js +17 -15
- package/lib/types/theme.colors.flow.js +2 -2
- package/lib/types/theme.flow.js +2 -2
- package/lib/utils/a11yTest.js +3 -1
- package/lib/utils/dataQaLabelQueries.js +23 -15
- package/lib/utils/hooks.js +37 -26
- package/lib/utils/index.js +15 -7
- package/lib/utils/innerText.js +1 -1
- package/lib/utils/mixins.js +1 -1
- package/lib/utils/react-testing-library.js +11 -8
- package/lib/utils/responsiveProps/index.js +14 -8
- package/lib/utils/system-props.js +1 -0
- package/package.json +16 -27
- package/__flow__/Avatar/index.test.js +0 -23
package/lib/Drawer/index.js
CHANGED
|
@@ -2,19 +2,23 @@ var _excluded = ["title", "children", "render"],
|
|
|
2
2
|
_excluded2 = ["children"],
|
|
3
3
|
_excluded3 = ["id", "style", "offset", "direction", "children", "disableCloseOnClickOutside", "onClose", "zIndex", "closeTargets"],
|
|
4
4
|
_excluded4 = ["children", "closeButtonLabel", "direction", "disableCloseOnClickOutside", "id", "isOpen", "offset", "onClose", "zIndex", "closeTargets"];
|
|
5
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
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; }
|
|
5
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; }
|
|
6
10
|
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); }
|
|
7
11
|
import * as React from 'react';
|
|
8
12
|
import { useContext, useEffect, useRef } from 'react';
|
|
9
13
|
import FocusLock from 'react-focus-lock';
|
|
10
|
-
import { SlideTransition } from
|
|
11
|
-
import Container, { Content } from
|
|
14
|
+
import { SlideTransition } from "./SlideTransition";
|
|
15
|
+
import Container, { Content } from "./styles";
|
|
12
16
|
import { animated } from 'react-spring';
|
|
13
|
-
import Portal from
|
|
14
|
-
import Box from
|
|
15
|
-
import Text from
|
|
16
|
-
import Button from
|
|
17
|
-
import Icon from
|
|
17
|
+
import Portal from "../Portal";
|
|
18
|
+
import Box from "../Box";
|
|
19
|
+
import Text from "../Text";
|
|
20
|
+
import Button from "../Button";
|
|
21
|
+
import Icon from "../Icon";
|
|
18
22
|
|
|
19
23
|
// If ever we needed to make drawer width configurable, move this to a default prop
|
|
20
24
|
var DRAWER_WIDTH = 600;
|
|
@@ -50,7 +54,7 @@ var DrawerHeader = function DrawerHeader(_ref) {
|
|
|
50
54
|
title = _ref$title === void 0 ? '' : _ref$title,
|
|
51
55
|
children = _ref.children,
|
|
52
56
|
render = _ref.render,
|
|
53
|
-
rest =
|
|
57
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
54
58
|
var drawerContext = useContext(DrawerContext);
|
|
55
59
|
if (render) {
|
|
56
60
|
return render(drawerContext);
|
|
@@ -72,7 +76,7 @@ var DrawerHeader = function DrawerHeader(_ref) {
|
|
|
72
76
|
};
|
|
73
77
|
var DrawerContent = function DrawerContent(_ref2) {
|
|
74
78
|
var children = _ref2.children,
|
|
75
|
-
rest =
|
|
79
|
+
rest = _objectWithoutProperties(_ref2, _excluded2);
|
|
76
80
|
return (
|
|
77
81
|
/*#__PURE__*/
|
|
78
82
|
// $FlowIssue - upgrade v0.112.0
|
|
@@ -93,7 +97,7 @@ var Drawer = function Drawer(_ref3) {
|
|
|
93
97
|
onClose = _ref3.onClose,
|
|
94
98
|
zIndex = _ref3.zIndex,
|
|
95
99
|
closeTargets = _ref3.closeTargets,
|
|
96
|
-
rest =
|
|
100
|
+
rest = _objectWithoutProperties(_ref3, _excluded3);
|
|
97
101
|
var drawerRef = useRef(null);
|
|
98
102
|
useEffect(function () {
|
|
99
103
|
var documentBody = document.body;
|
|
@@ -139,6 +143,7 @@ var Drawer = function Drawer(_ref3) {
|
|
|
139
143
|
offset: offset,
|
|
140
144
|
direction: direction,
|
|
141
145
|
"data-qa-drawer": id
|
|
146
|
+
// $FlowIssue - upgrade v0.112.0
|
|
142
147
|
}, rest), children));
|
|
143
148
|
};
|
|
144
149
|
var DrawerContainer = function DrawerContainer(_ref4) {
|
|
@@ -157,7 +162,7 @@ var DrawerContainer = function DrawerContainer(_ref4) {
|
|
|
157
162
|
zIndex = _ref4$zIndex === void 0 ? 7 : _ref4$zIndex,
|
|
158
163
|
_ref4$closeTargets = _ref4.closeTargets,
|
|
159
164
|
closeTargets = _ref4$closeTargets === void 0 ? [] : _ref4$closeTargets,
|
|
160
|
-
rest =
|
|
165
|
+
rest = _objectWithoutProperties(_ref4, _excluded4);
|
|
161
166
|
return /*#__PURE__*/React.createElement(Portal, {
|
|
162
167
|
id: id
|
|
163
168
|
}, /*#__PURE__*/React.createElement(DrawerContext.Provider, {
|
|
@@ -176,7 +181,7 @@ var DrawerContainer = function DrawerContainer(_ref4) {
|
|
|
176
181
|
return isVisible && /*#__PURE__*/React.createElement(Drawer, _extends({
|
|
177
182
|
key: key,
|
|
178
183
|
id: id,
|
|
179
|
-
style:
|
|
184
|
+
style: _objectSpread(_objectSpread({}, style), {}, {
|
|
180
185
|
zIndex: zIndex
|
|
181
186
|
}),
|
|
182
187
|
offset: offset,
|
package/lib/Drawer/styles.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
import styled, { css } from 'styled-components';
|
|
3
|
-
import { COMMON } from
|
|
4
|
-
import Box from
|
|
3
|
+
import { COMMON } from "../utils/system-props";
|
|
4
|
+
import Box from "../Box";
|
|
5
5
|
export var Content = styled(Box).withConfig({
|
|
6
6
|
displayName: "styles__Content",
|
|
7
7
|
componentId: "sc-bo5voc-0"
|
package/lib/EmptyState/index.js
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
var _excluded = ["media", "headline", "subtext", "primaryAction", "secondaryAction"];
|
|
2
2
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
|
+
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; }
|
|
3
4
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
4
5
|
import * as React from 'react';
|
|
5
|
-
import Box from
|
|
6
|
-
import Text from
|
|
6
|
+
import Box from "../Box";
|
|
7
|
+
import Text from "../Text";
|
|
7
8
|
var EmptyState = function EmptyState(_ref) {
|
|
8
9
|
var media = _ref.media,
|
|
9
10
|
headline = _ref.headline,
|
|
10
11
|
subtext = _ref.subtext,
|
|
11
12
|
primaryAction = _ref.primaryAction,
|
|
12
13
|
secondaryAction = _ref.secondaryAction,
|
|
13
|
-
rest =
|
|
14
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
14
15
|
return (
|
|
15
16
|
/*#__PURE__*/
|
|
16
17
|
// $FlowIssue - upgrade v0.112.0
|
package/lib/Fieldset/index.js
CHANGED
|
@@ -2,11 +2,12 @@ var _excluded = ["layout", "label", "helperText", "children"],
|
|
|
2
2
|
_excluded2 = ["children"],
|
|
3
3
|
_excluded3 = ["children"];
|
|
4
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
|
+
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
|
import * as React from 'react';
|
|
7
|
-
import Box from
|
|
8
|
-
import Text from
|
|
9
|
-
import { ChildContainer } from
|
|
8
|
+
import Box from "../Box";
|
|
9
|
+
import Text from "../Text";
|
|
10
|
+
import { ChildContainer } from "./styles";
|
|
10
11
|
/**
|
|
11
12
|
* Fieldset Component
|
|
12
13
|
*/
|
|
@@ -16,7 +17,7 @@ var Fieldset = function Fieldset(_ref) {
|
|
|
16
17
|
label = _ref.label,
|
|
17
18
|
helperText = _ref.helperText,
|
|
18
19
|
children = _ref.children,
|
|
19
|
-
rest =
|
|
20
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
20
21
|
return (
|
|
21
22
|
/*#__PURE__*/
|
|
22
23
|
// $FlowIssue - upgrade v0.112.0
|
|
@@ -24,7 +25,7 @@ var Fieldset = function Fieldset(_ref) {
|
|
|
24
25
|
as: "fieldset",
|
|
25
26
|
border: "none",
|
|
26
27
|
p: 0,
|
|
27
|
-
"data-qa-fieldset":
|
|
28
|
+
"data-qa-fieldset": ""
|
|
28
29
|
}, rest), typeof label === 'string' ? /*#__PURE__*/React.createElement(Fieldset.Legend, null, label) : label, typeof helperText === 'string' ? /*#__PURE__*/React.createElement(Fieldset.HelperText, null, helperText) : helperText, /*#__PURE__*/React.createElement(Box, {
|
|
29
30
|
display: "flex",
|
|
30
31
|
flexDirection: layout === 'vertical' ? 'column' : 'row'
|
|
@@ -37,7 +38,7 @@ var Fieldset = function Fieldset(_ref) {
|
|
|
37
38
|
};
|
|
38
39
|
var FieldsetLegend = function FieldsetLegend(_ref2) {
|
|
39
40
|
var children = _ref2.children,
|
|
40
|
-
rest =
|
|
41
|
+
rest = _objectWithoutProperties(_ref2, _excluded2);
|
|
41
42
|
return /*#__PURE__*/React.createElement(Text, _extends({
|
|
42
43
|
as: "legend",
|
|
43
44
|
fontSize: 300,
|
|
@@ -48,7 +49,7 @@ var FieldsetLegend = function FieldsetLegend(_ref2) {
|
|
|
48
49
|
};
|
|
49
50
|
var FieldsetHelperText = function FieldsetHelperText(_ref3) {
|
|
50
51
|
var children = _ref3.children,
|
|
51
|
-
rest =
|
|
52
|
+
rest = _objectWithoutProperties(_ref3, _excluded3);
|
|
52
53
|
return /*#__PURE__*/React.createElement(Text, _extends({
|
|
53
54
|
as: "p",
|
|
54
55
|
fontSize: 200,
|
package/lib/Fieldset/styles.js
CHANGED
package/lib/FormField/index.js
CHANGED
|
@@ -2,16 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
var _excluded = ["children", "error", "helperText", "id", "isInvalid", "label", "mb", "qa", "isLabelHidden"];
|
|
4
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
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
6
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
7
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
8
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
9
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
10
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
|
+
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
12
|
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
13
|
import * as React from 'react';
|
|
7
14
|
import { useState } from 'react';
|
|
8
15
|
|
|
9
16
|
// Components
|
|
10
|
-
import Box from
|
|
11
|
-
import Label from
|
|
12
|
-
import Text from
|
|
13
|
-
import { VisuallyHidden } from
|
|
14
|
-
import { useTextContent } from
|
|
17
|
+
import Box from "../Box";
|
|
18
|
+
import Label from "../Label";
|
|
19
|
+
import Text from "../Text";
|
|
20
|
+
import { VisuallyHidden } from "../VisuallyHidden";
|
|
21
|
+
import { useTextContent } from "../utils/hooks";
|
|
15
22
|
var idCounter = 0;
|
|
16
23
|
var FormField = function FormField(_ref) {
|
|
17
24
|
var children = _ref.children,
|
|
@@ -26,10 +33,11 @@ var FormField = function FormField(_ref) {
|
|
|
26
33
|
qa = _ref.qa,
|
|
27
34
|
_ref$isLabelHidden = _ref.isLabelHidden,
|
|
28
35
|
isLabelHidden = _ref$isLabelHidden === void 0 ? false : _ref$isLabelHidden,
|
|
29
|
-
rest =
|
|
30
|
-
var _useState = useState(identifier || "FormField-"
|
|
31
|
-
|
|
32
|
-
|
|
36
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
37
|
+
var _useState = useState(identifier || "FormField-".concat(idCounter++)),
|
|
38
|
+
_useState2 = _slicedToArray(_useState, 1),
|
|
39
|
+
id = _useState2[0];
|
|
40
|
+
var errorId = "Error-".concat(id);
|
|
33
41
|
var containerText = useTextContent('');
|
|
34
42
|
var errorContainerText = useTextContent('');
|
|
35
43
|
return /*#__PURE__*/React.createElement(Box, _extends({}, rest, qa, {
|
package/lib/Icon/index.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
var _excluded = ["name", "size", "fixedWidth", "ariaLabel"],
|
|
2
2
|
_excluded2 = ["activeName", "inactiveName", "isActive", "size", "fixedWidth", "ariaLabel"];
|
|
3
3
|
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); }
|
|
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; }
|
|
4
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; }
|
|
5
6
|
import * as React from 'react';
|
|
6
7
|
import styled, { css } from 'styled-components';
|
|
7
|
-
import iconViewBoxes from
|
|
8
|
-
import Container from
|
|
9
|
-
import Box from
|
|
10
|
-
import deprecatedIcons from
|
|
8
|
+
import iconViewBoxes from "../IconViewBoxes";
|
|
9
|
+
import Container from "./styles";
|
|
10
|
+
import Box from "../Box";
|
|
11
|
+
import deprecatedIcons from "./deprecatedIcons";
|
|
11
12
|
var Icon = function Icon(_ref) {
|
|
12
13
|
var name = _ref.name,
|
|
13
14
|
_ref$size = _ref.size,
|
|
@@ -15,7 +16,7 @@ var Icon = function Icon(_ref) {
|
|
|
15
16
|
_ref$fixedWidth = _ref.fixedWidth,
|
|
16
17
|
fixedWidth = _ref$fixedWidth === void 0 ? false : _ref$fixedWidth,
|
|
17
18
|
ariaLabel = _ref.ariaLabel,
|
|
18
|
-
rest =
|
|
19
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
19
20
|
var iconName = deprecatedIcons[name] || name;
|
|
20
21
|
var iconViewBox = iconViewBoxes[iconName];
|
|
21
22
|
return /*#__PURE__*/React.createElement(Container, _extends({
|
|
@@ -31,7 +32,7 @@ var Icon = function Icon(_ref) {
|
|
|
31
32
|
focusable: false
|
|
32
33
|
}, /*#__PURE__*/React.createElement("use", {
|
|
33
34
|
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
34
|
-
xlinkHref: "#ssiconsvg-"
|
|
35
|
+
xlinkHref: "#ssiconsvg-".concat(iconName)
|
|
35
36
|
})));
|
|
36
37
|
};
|
|
37
38
|
var ToggleableIcon = styled(Icon).withConfig({
|
|
@@ -53,7 +54,7 @@ var IconToggle = function IconToggle(_ref2) {
|
|
|
53
54
|
_ref2$fixedWidth = _ref2.fixedWidth,
|
|
54
55
|
fixedWidth = _ref2$fixedWidth === void 0 ? false : _ref2$fixedWidth,
|
|
55
56
|
ariaLabel = _ref2.ariaLabel,
|
|
56
|
-
rest =
|
|
57
|
+
rest = _objectWithoutProperties(_ref2, _excluded2);
|
|
57
58
|
return (
|
|
58
59
|
/*#__PURE__*/
|
|
59
60
|
// $FlowIssue - upgrade v0.112.0
|
package/lib/Icon/styles.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import styled, { css } from 'styled-components';
|
|
3
|
-
import { COMMON } from
|
|
3
|
+
import { COMMON } from "../utils/system-props";
|
|
4
4
|
import { verticalAlign } from 'styled-system';
|
|
5
5
|
var sizes = {
|
|
6
6
|
mini: '12px',
|
|
@@ -12,7 +12,7 @@ var sizes = {
|
|
|
12
12
|
jumbo: '64px'
|
|
13
13
|
};
|
|
14
14
|
var stylesForSize = function stylesForSize(iconSize, fixedWidth) {
|
|
15
|
-
return css(["line-height:", ";&,.Icon-svg{height:", ";fill:currentColor;}", ""], iconSize, iconSize, fixedWidth && "\n &,\n & .Icon-svg {\n width: "
|
|
15
|
+
return css(["line-height:", ";&,.Icon-svg{height:", ";fill:currentColor;}", ""], iconSize, iconSize, fixedWidth && "\n &,\n & .Icon-svg {\n width: ".concat(iconSize, "\n }\n "));
|
|
16
16
|
};
|
|
17
17
|
var Container = styled.span.attrs({
|
|
18
18
|
className: 'Icon'
|
package/lib/Image/index.js
CHANGED
|
@@ -1,25 +1,37 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
1
2
|
var _excluded = ["alt", "title", "onClick", "onError", "onLoad", "src", "qa"];
|
|
2
3
|
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); }
|
|
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; }
|
|
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; }
|
|
4
|
-
function
|
|
6
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
7
|
+
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, descriptor.key, descriptor); } }
|
|
8
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
9
|
+
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); }
|
|
5
10
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
11
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
12
|
+
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); }
|
|
13
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
14
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
15
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
16
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
17
|
import * as React from 'react';
|
|
7
|
-
import ImageContainer from
|
|
18
|
+
import ImageContainer from "./styles";
|
|
8
19
|
var Image = /*#__PURE__*/function (_React$Component) {
|
|
9
|
-
|
|
20
|
+
_inherits(Image, _React$Component);
|
|
21
|
+
var _super = _createSuper(Image);
|
|
10
22
|
function Image() {
|
|
11
23
|
var _this;
|
|
24
|
+
_classCallCheck(this, Image);
|
|
12
25
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
13
26
|
args[_key] = arguments[_key];
|
|
14
27
|
}
|
|
15
|
-
_this =
|
|
16
|
-
_this
|
|
28
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
29
|
+
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
17
30
|
didError: false,
|
|
18
31
|
didLoad: false,
|
|
19
32
|
imageUrl: _this.props.src
|
|
20
|
-
};
|
|
21
|
-
_this
|
|
22
|
-
_this.onError = function () {
|
|
33
|
+
});
|
|
34
|
+
_defineProperty(_assertThisInitialized(_this), "onError", function () {
|
|
23
35
|
if (!_this.state.didError && _this.props.defaultImage) {
|
|
24
36
|
_this.setState({
|
|
25
37
|
didError: true,
|
|
@@ -27,68 +39,74 @@ var Image = /*#__PURE__*/function (_React$Component) {
|
|
|
27
39
|
});
|
|
28
40
|
}
|
|
29
41
|
_this.props.onError();
|
|
30
|
-
};
|
|
31
|
-
_this
|
|
42
|
+
});
|
|
43
|
+
_defineProperty(_assertThisInitialized(_this), "onLoad", function () {
|
|
32
44
|
_this.setState({
|
|
33
45
|
didLoad: true
|
|
34
46
|
});
|
|
35
47
|
_this.props.onLoad();
|
|
36
|
-
};
|
|
37
|
-
_this
|
|
48
|
+
});
|
|
49
|
+
_defineProperty(_assertThisInitialized(_this), "onClick", function () {
|
|
38
50
|
_this.props.onClick();
|
|
39
|
-
};
|
|
51
|
+
});
|
|
40
52
|
return _this;
|
|
41
53
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
this.
|
|
47
|
-
|
|
48
|
-
|
|
54
|
+
_createClass(Image, [{
|
|
55
|
+
key: "componentDidMount",
|
|
56
|
+
value: function componentDidMount() {
|
|
57
|
+
// eslint-disable-next-line react/no-did-mount-set-state
|
|
58
|
+
if (this.imageRef) {
|
|
59
|
+
this.setState({
|
|
60
|
+
didLoad: this.imageRef.complete
|
|
61
|
+
});
|
|
62
|
+
}
|
|
49
63
|
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
this.
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
64
|
+
}, {
|
|
65
|
+
key: "componentDidUpdate",
|
|
66
|
+
value: function componentDidUpdate(prevProps) {
|
|
67
|
+
if (this.props.src !== prevProps.src) {
|
|
68
|
+
this.setState({
|
|
69
|
+
didError: false,
|
|
70
|
+
didLoad: false,
|
|
71
|
+
imageUrl: this.props.src
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}, {
|
|
76
|
+
key: "render",
|
|
77
|
+
value: function render() {
|
|
78
|
+
var _this2 = this;
|
|
79
|
+
var _this$props = this.props,
|
|
80
|
+
alt = _this$props.alt,
|
|
81
|
+
title = _this$props.title,
|
|
82
|
+
onClick = _this$props.onClick,
|
|
83
|
+
onError = _this$props.onError,
|
|
84
|
+
onLoad = _this$props.onLoad,
|
|
85
|
+
src = _this$props.src,
|
|
86
|
+
qa = _this$props.qa,
|
|
87
|
+
rest = _objectWithoutProperties(_this$props, _excluded);
|
|
88
|
+
return /*#__PURE__*/React.createElement(ImageContainer, _extends({
|
|
89
|
+
isLoading: !this.state.didLoad,
|
|
90
|
+
ref: function ref(img) {
|
|
91
|
+
return _this2.imageRef = img;
|
|
92
|
+
},
|
|
93
|
+
onClick: this.onClick,
|
|
94
|
+
src: this.state.imageUrl,
|
|
95
|
+
onError: this.onError,
|
|
96
|
+
onLoad: this.onLoad,
|
|
97
|
+
alt: alt,
|
|
98
|
+
title: title,
|
|
99
|
+
"data-qa-image": title ? title : alt ? alt : '',
|
|
100
|
+
"data-qa-image-src": src || ''
|
|
101
|
+
}, qa, rest));
|
|
58
102
|
}
|
|
59
|
-
};
|
|
60
|
-
_proto.render = function render() {
|
|
61
|
-
var _this2 = this;
|
|
62
|
-
var _this$props = this.props,
|
|
63
|
-
alt = _this$props.alt,
|
|
64
|
-
title = _this$props.title,
|
|
65
|
-
onClick = _this$props.onClick,
|
|
66
|
-
onError = _this$props.onError,
|
|
67
|
-
onLoad = _this$props.onLoad,
|
|
68
|
-
src = _this$props.src,
|
|
69
|
-
qa = _this$props.qa,
|
|
70
|
-
rest = _objectWithoutPropertiesLoose(_this$props, _excluded);
|
|
71
|
-
return /*#__PURE__*/React.createElement(ImageContainer, _extends({
|
|
72
|
-
isLoading: !this.state.didLoad,
|
|
73
|
-
ref: function ref(img) {
|
|
74
|
-
return _this2.imageRef = img;
|
|
75
|
-
},
|
|
76
|
-
onClick: this.onClick,
|
|
77
|
-
src: this.state.imageUrl,
|
|
78
|
-
onError: this.onError,
|
|
79
|
-
onLoad: this.onLoad,
|
|
80
|
-
alt: alt,
|
|
81
|
-
title: title,
|
|
82
|
-
"data-qa-image": title ? title : alt ? alt : '',
|
|
83
|
-
"data-qa-image-src": src || ''
|
|
84
|
-
}, qa, rest));
|
|
85
|
-
};
|
|
103
|
+
}]);
|
|
86
104
|
return Image;
|
|
87
105
|
}(React.Component);
|
|
88
|
-
Image
|
|
106
|
+
_defineProperty(Image, "defaultProps", {
|
|
89
107
|
title: '',
|
|
90
108
|
onError: function onError() {},
|
|
91
109
|
onClick: function onClick() {},
|
|
92
110
|
onLoad: function onLoad() {}
|
|
93
|
-
};
|
|
111
|
+
});
|
|
94
112
|
export { Image as default };
|
package/lib/Image/styles.js
CHANGED
package/lib/Indicator/index.js
CHANGED
|
@@ -1,35 +1,50 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
1
2
|
var _excluded = ["tooltip"];
|
|
2
3
|
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); }
|
|
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; }
|
|
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; }
|
|
4
|
-
function
|
|
6
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
7
|
+
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, descriptor.key, descriptor); } }
|
|
8
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
9
|
+
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); }
|
|
5
10
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
11
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
12
|
+
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); }
|
|
13
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
14
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
15
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
16
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
17
|
import * as React from 'react';
|
|
7
|
-
import Icon from
|
|
8
|
-
import Container from
|
|
18
|
+
import Icon from "../Icon";
|
|
19
|
+
import Container from "./styles";
|
|
9
20
|
var Indicator = /*#__PURE__*/function (_React$Component) {
|
|
10
|
-
|
|
21
|
+
_inherits(Indicator, _React$Component);
|
|
22
|
+
var _super = _createSuper(Indicator);
|
|
11
23
|
function Indicator() {
|
|
12
|
-
|
|
24
|
+
_classCallCheck(this, Indicator);
|
|
25
|
+
return _super.apply(this, arguments);
|
|
13
26
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
_createClass(Indicator, [{
|
|
28
|
+
key: "render",
|
|
29
|
+
value: function render() {
|
|
30
|
+
var _this$props = this.props,
|
|
31
|
+
tooltip = _this$props.tooltip,
|
|
32
|
+
rest = _objectWithoutProperties(_this$props, _excluded);
|
|
33
|
+
return /*#__PURE__*/React.createElement(Container, _extends({
|
|
34
|
+
"data-tip": tooltip,
|
|
35
|
+
"data-qa-indicator": "",
|
|
36
|
+
"aria-label": tooltip,
|
|
37
|
+
tabIndex: 0
|
|
38
|
+
// $FlowIssue - upgrade v0.112.0
|
|
39
|
+
}, rest), tooltip && /*#__PURE__*/React.createElement("div", null, tooltip), /*#__PURE__*/React.createElement(Icon, {
|
|
40
|
+
name: "indicator",
|
|
41
|
+
size: "mini"
|
|
42
|
+
}));
|
|
43
|
+
}
|
|
44
|
+
}]);
|
|
30
45
|
return Indicator;
|
|
31
46
|
}(React.Component);
|
|
32
|
-
Indicator
|
|
47
|
+
_defineProperty(Indicator, "defaultProps", {
|
|
33
48
|
tooltip: ''
|
|
34
|
-
};
|
|
49
|
+
});
|
|
35
50
|
export { Indicator as default };
|
package/lib/Indicator/styles.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
import styled from 'styled-components';
|
|
3
|
-
import { COMMON } from
|
|
4
|
-
import { visuallyHidden } from
|
|
3
|
+
import { COMMON } from "../utils/system-props";
|
|
4
|
+
import { visuallyHidden } from "../utils/mixins";
|
|
5
5
|
var Container = styled.span.attrs({
|
|
6
6
|
className: 'Indicator'
|
|
7
7
|
}).withConfig({
|
|
@@ -13,6 +13,6 @@ var Container = styled.span.attrs({
|
|
|
13
13
|
return props.theme.space[400];
|
|
14
14
|
}, function (props) {
|
|
15
15
|
var _props$color;
|
|
16
|
-
return (_props$color = props.color)
|
|
16
|
+
return (_props$color = props.color) !== null && _props$color !== void 0 ? _props$color : props.theme.colors.icon.info;
|
|
17
17
|
}, visuallyHidden, COMMON);
|
|
18
18
|
export default Container;
|