@sproutsocial/racine 12.21.2 → 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 +20 -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 +3 -3
- 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__/Input/styles.js +1 -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 +28 -13
- 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 +6 -3
- 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 +75 -57
- 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 +54 -36
- 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 +41 -24
- package/commonjs/TableCell/styles.js +3 -1
- package/commonjs/TableHeaderCell/index.js +56 -38
- package/commonjs/TableHeaderCell/styles.js +5 -2
- package/commonjs/TableRowAccordion/index.js +63 -45
- package/commonjs/TableRowAccordion/styles.js +5 -2
- package/commonjs/Tabs/index.js +118 -91
- 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 +45 -27
- 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 +25 -13
- 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 +3 -3
- 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 +72 -56
- 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 +53 -37
- 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 +38 -23
- package/lib/TableCell/styles.js +1 -1
- package/lib/TableHeaderCell/index.js +54 -38
- package/lib/TableHeaderCell/styles.js +1 -1
- package/lib/TableRowAccordion/index.js +62 -46
- package/lib/TableRowAccordion/styles.js +1 -1
- package/lib/Tabs/index.js +115 -90
- 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 +43 -27
- 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 +21 -35
- package/__flow__/Avatar/index.test.js +0 -23
package/lib/Tabs/index.js
CHANGED
|
@@ -1,92 +1,115 @@
|
|
|
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 = ["children", "id"],
|
|
2
3
|
_excluded2 = ["children", "qa"];
|
|
3
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; }
|
|
4
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; }
|
|
5
|
-
function
|
|
7
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
8
|
+
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); } }
|
|
9
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
10
|
+
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); }
|
|
6
11
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
12
|
+
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); }; }
|
|
13
|
+
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); }
|
|
14
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
15
|
+
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; } }
|
|
16
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
17
|
+
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; }
|
|
7
18
|
import * as React from 'react';
|
|
8
|
-
import Container, { TabItem, TabButton } from
|
|
19
|
+
import Container, { TabItem, TabButton } from "./styles";
|
|
9
20
|
var TabButtonContext = /*#__PURE__*/React.createContext({});
|
|
10
21
|
var TabItemButton = /*#__PURE__*/function (_React$Component) {
|
|
11
|
-
|
|
22
|
+
_inherits(TabItemButton, _React$Component);
|
|
23
|
+
var _super = _createSuper(TabItemButton);
|
|
12
24
|
function TabItemButton() {
|
|
13
25
|
var _this;
|
|
26
|
+
_classCallCheck(this, TabItemButton);
|
|
14
27
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
15
28
|
args[_key] = arguments[_key];
|
|
16
29
|
}
|
|
17
|
-
_this =
|
|
18
|
-
_this
|
|
19
|
-
_this.buttonRef = /*#__PURE__*/React.createRef();
|
|
30
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
31
|
+
_defineProperty(_assertThisInitialized(_this), "buttonRef", /*#__PURE__*/React.createRef());
|
|
20
32
|
return _this;
|
|
21
33
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
_proto.componentDidUpdate = function componentDidUpdate(prevProps) {
|
|
27
|
-
if (prevProps.id !== this.props.id) {
|
|
28
|
-
this.context.onTabUpdate(prevProps.id, this.props.id);
|
|
34
|
+
_createClass(TabItemButton, [{
|
|
35
|
+
key: "componentDidMount",
|
|
36
|
+
value: function componentDidMount() {
|
|
37
|
+
this.context.onTabMount(this.props.id, this.buttonRef);
|
|
29
38
|
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
39
|
+
}, {
|
|
40
|
+
key: "componentDidUpdate",
|
|
41
|
+
value: function componentDidUpdate(prevProps) {
|
|
42
|
+
if (prevProps.id !== this.props.id) {
|
|
43
|
+
this.context.onTabUpdate(prevProps.id, this.props.id);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}, {
|
|
47
|
+
key: "componentWillUnmount",
|
|
48
|
+
value: function componentWillUnmount() {
|
|
49
|
+
this.context.onTabUnmount(this.props.id);
|
|
50
|
+
}
|
|
51
|
+
}, {
|
|
52
|
+
key: "render",
|
|
53
|
+
value: function render() {
|
|
54
|
+
var _this$props = this.props,
|
|
55
|
+
children = _this$props.children,
|
|
56
|
+
id = _this$props.id,
|
|
57
|
+
rest = _objectWithoutProperties(_this$props, _excluded);
|
|
58
|
+
var _this$context = this.context,
|
|
59
|
+
selectedId = _this$context.selectedId,
|
|
60
|
+
onActivate = _this$context.onActivate,
|
|
61
|
+
fullWidth = _this$context.fullWidth;
|
|
62
|
+
var isSelected = selectedId === id;
|
|
63
|
+
return /*#__PURE__*/React.createElement(TabItem, {
|
|
64
|
+
key: id,
|
|
65
|
+
fullWidth: fullWidth,
|
|
66
|
+
isSelected: isSelected
|
|
67
|
+
}, /*#__PURE__*/React.createElement(TabButton, _extends({
|
|
68
|
+
innerRef: this.buttonRef,
|
|
69
|
+
id: id,
|
|
70
|
+
onClick: function onClick() {
|
|
71
|
+
return onActivate(id);
|
|
72
|
+
},
|
|
73
|
+
isSelected: isSelected,
|
|
74
|
+
tabIndex: isSelected ? 0 : -1,
|
|
75
|
+
fullWidth: fullWidth,
|
|
76
|
+
"data-qa-tab-button": id,
|
|
77
|
+
"data-qa-tab-button-state": isSelected
|
|
78
|
+
// $FlowIssue - upgrade v0.112.0
|
|
79
|
+
}, rest), children));
|
|
80
|
+
}
|
|
81
|
+
}]);
|
|
62
82
|
return TabItemButton;
|
|
63
83
|
}(React.Component);
|
|
64
|
-
TabItemButton
|
|
84
|
+
_defineProperty(TabItemButton, "contextType", TabButtonContext);
|
|
65
85
|
/**
|
|
66
86
|
* Render a group of buttons in a tab-heading style
|
|
67
|
-
*/
|
|
68
|
-
|
|
87
|
+
*/
|
|
88
|
+
var Tabs = /*#__PURE__*/function (_React$Component2) {
|
|
89
|
+
_inherits(Tabs, _React$Component2);
|
|
90
|
+
var _super2 = _createSuper(Tabs);
|
|
69
91
|
function Tabs() {
|
|
70
92
|
var _this2;
|
|
93
|
+
_classCallCheck(this, Tabs);
|
|
71
94
|
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
72
95
|
args[_key2] = arguments[_key2];
|
|
73
96
|
}
|
|
74
|
-
_this2 =
|
|
75
|
-
_this2
|
|
76
|
-
_this2
|
|
77
|
-
_this2
|
|
97
|
+
_this2 = _super2.call.apply(_super2, [this].concat(args));
|
|
98
|
+
_defineProperty(_assertThisInitialized(_this2), "buttonRefs", {});
|
|
99
|
+
_defineProperty(_assertThisInitialized(_this2), "tabList", []);
|
|
100
|
+
_defineProperty(_assertThisInitialized(_this2), "getSelectedId", function () {
|
|
78
101
|
return _this2.props.selectedId;
|
|
79
|
-
};
|
|
80
|
-
_this2
|
|
102
|
+
});
|
|
103
|
+
_defineProperty(_assertThisInitialized(_this2), "onActivate", function (id) {
|
|
81
104
|
return _this2.props.onSelect(id);
|
|
82
|
-
};
|
|
83
|
-
_this2
|
|
105
|
+
});
|
|
106
|
+
_defineProperty(_assertThisInitialized(_this2), "onTabMount", function (id, ref) {
|
|
84
107
|
if (!_this2.tabList.includes(id)) {
|
|
85
108
|
_this2.tabList.push(id);
|
|
86
109
|
_this2.buttonRefs[id] = ref;
|
|
87
110
|
}
|
|
88
|
-
};
|
|
89
|
-
_this2
|
|
111
|
+
});
|
|
112
|
+
_defineProperty(_assertThisInitialized(_this2), "onTabUpdate", function (previousId, newId) {
|
|
90
113
|
if (_this2.tabList.includes(previousId)) {
|
|
91
114
|
_this2.tabList = _this2.tabList.map(function (id) {
|
|
92
115
|
return id === previousId ? newId : id;
|
|
@@ -94,21 +117,21 @@ TabItemButton.contextType = TabButtonContext;
|
|
|
94
117
|
_this2.buttonRefs[newId] = _this2.buttonRefs[previousId];
|
|
95
118
|
_this2.buttonRefs[previousId] = undefined;
|
|
96
119
|
}
|
|
97
|
-
};
|
|
98
|
-
_this2
|
|
120
|
+
});
|
|
121
|
+
_defineProperty(_assertThisInitialized(_this2), "onTabUnmount", function (id) {
|
|
99
122
|
if (_this2.tabList.includes(id)) {
|
|
100
123
|
_this2.tabList = _this2.tabList.filter(function (currentId) {
|
|
101
124
|
return currentId !== id;
|
|
102
125
|
});
|
|
103
126
|
_this2.buttonRefs[id] = undefined;
|
|
104
127
|
}
|
|
105
|
-
};
|
|
106
|
-
_this2
|
|
128
|
+
});
|
|
129
|
+
_defineProperty(_assertThisInitialized(_this2), "selectNextTab", function (id) {
|
|
107
130
|
var buttonRef = _this2.buttonRefs[id];
|
|
108
131
|
_this2.props.onSelect(id);
|
|
109
132
|
buttonRef && buttonRef.current && buttonRef.current.focus && buttonRef.current.focus();
|
|
110
|
-
};
|
|
111
|
-
_this2
|
|
133
|
+
});
|
|
134
|
+
_defineProperty(_assertThisInitialized(_this2), "keyHandler", function (_ref) {
|
|
112
135
|
var keyCode = _ref.keyCode;
|
|
113
136
|
switch (keyCode) {
|
|
114
137
|
// left arrow
|
|
@@ -136,34 +159,36 @@ TabItemButton.contextType = TabButtonContext;
|
|
|
136
159
|
default:
|
|
137
160
|
break;
|
|
138
161
|
}
|
|
139
|
-
};
|
|
162
|
+
});
|
|
140
163
|
return _this2;
|
|
141
164
|
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
165
|
+
_createClass(Tabs, [{
|
|
166
|
+
key: "render",
|
|
167
|
+
value: function render() {
|
|
168
|
+
var _this$props2 = this.props,
|
|
169
|
+
children = _this$props2.children,
|
|
170
|
+
qa = _this$props2.qa,
|
|
171
|
+
rest = _objectWithoutProperties(_this$props2, _excluded2);
|
|
172
|
+
return (
|
|
173
|
+
/*#__PURE__*/
|
|
174
|
+
// $FlowIssue - upgrade v0.112.0
|
|
175
|
+
React.createElement(Container, _extends({
|
|
176
|
+
"data-qa-tabs": "",
|
|
177
|
+
onKeyUp: this.keyHandler
|
|
178
|
+
}, qa, rest), /*#__PURE__*/React.createElement(TabButtonContext.Provider, {
|
|
179
|
+
value: {
|
|
180
|
+
selectedId: this.getSelectedId(),
|
|
181
|
+
fullWidth: this.props.fullWidth,
|
|
182
|
+
onActivate: this.onActivate,
|
|
183
|
+
onTabMount: this.onTabMount,
|
|
184
|
+
onTabUpdate: this.onTabUpdate,
|
|
185
|
+
onTabUnmount: this.onTabUnmount
|
|
186
|
+
}
|
|
187
|
+
}, children))
|
|
188
|
+
);
|
|
189
|
+
}
|
|
190
|
+
}]);
|
|
166
191
|
return Tabs;
|
|
167
192
|
}(React.Component);
|
|
168
|
-
Tabs
|
|
193
|
+
_defineProperty(Tabs, "Button", TabItemButton);
|
|
169
194
|
export { Tabs as default };
|
package/lib/Tabs/styles.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
import styled, { css } from 'styled-components';
|
|
3
|
-
import { COMMON } from
|
|
4
|
-
import Button from
|
|
3
|
+
import { COMMON } from "../utils/system-props";
|
|
4
|
+
import Button from "../Button";
|
|
5
5
|
var Container = styled.ul.withConfig({
|
|
6
6
|
displayName: "styles__Container",
|
|
7
7
|
componentId: "sc-vnjuiu-0"
|
|
@@ -23,18 +23,18 @@ export var TabItem = styled.li.withConfig({
|
|
|
23
23
|
});
|
|
24
24
|
}, function (props) {
|
|
25
25
|
return props.isSelected && css(["box-shadow:", ";"], function (props) {
|
|
26
|
-
return "inset 0 -3px 0 0 "
|
|
26
|
+
return "inset 0 -3px 0 0 ".concat(props.theme.colors.button.primary.background.base);
|
|
27
27
|
});
|
|
28
28
|
}, function (props) {
|
|
29
29
|
return props.isSelected && css(["box-shadow:", ";"], function (props) {
|
|
30
|
-
return "inset 0 -3px 0 0 "
|
|
30
|
+
return "inset 0 -3px 0 0 ".concat(props.theme.colors.button.primary.background.hover);
|
|
31
31
|
});
|
|
32
32
|
});
|
|
33
33
|
export var TabButton = styled(Button).withConfig({
|
|
34
34
|
displayName: "styles__TabButton",
|
|
35
35
|
componentId: "sc-vnjuiu-2"
|
|
36
36
|
})(["padding:", ";color:", ";width:100%;", ";&:hover{", ";}&:active{transform:none;}"], function (props) {
|
|
37
|
-
return props.theme.space[350]
|
|
37
|
+
return "".concat(props.theme.space[350], " 0");
|
|
38
38
|
}, function (props) {
|
|
39
39
|
return props.theme.colors.text.headline;
|
|
40
40
|
}, function (props) {
|
package/lib/Text/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
var _excluded = ["fontSize", "children", "qa"];
|
|
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 Container from
|
|
6
|
+
import Container from "./styles";
|
|
6
7
|
import styled from 'styled-components';
|
|
7
8
|
var Headline = styled(Container).withConfig({
|
|
8
9
|
displayName: "Text__Headline",
|
|
@@ -70,7 +71,7 @@ var Text = function Text(_ref) {
|
|
|
70
71
|
var fontSize = _ref.fontSize,
|
|
71
72
|
children = _ref.children,
|
|
72
73
|
qa = _ref.qa,
|
|
73
|
-
rest =
|
|
74
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
74
75
|
var qaText = typeof children === 'string' ? children : undefined;
|
|
75
76
|
return (
|
|
76
77
|
/*#__PURE__*/
|
package/lib/Text/styles.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import styled, { css } from 'styled-components';
|
|
3
|
-
import { COMMON, LAYOUT, TYPOGRAPHY } from
|
|
3
|
+
import { COMMON, LAYOUT, TYPOGRAPHY } from "../utils/system-props";
|
|
4
4
|
var Container = styled.span.withConfig({
|
|
5
5
|
displayName: "styles__Container",
|
|
6
6
|
componentId: "sc-mmg963-0"
|
package/lib/Textarea/index.js
CHANGED
|
@@ -1,118 +1,133 @@
|
|
|
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 = ["autoFocus", "disabled", "readOnly", "isInvalid", "id", "name", "placeholder", "value", "enableSpellcheck", "enableResize", "required", "rows", "elemBefore", "elemAfter", "maxLength", "ariaLabel", "ariaDescribedby", "innerRef", "onBlur", "onChange", "onFocus", "onKeyDown", "onKeyUp", "qa", "inputProps"];
|
|
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 Container, { Accessory } from
|
|
18
|
+
import Container, { Accessory } from "./styles";
|
|
8
19
|
var Textarea = /*#__PURE__*/function (_React$Component) {
|
|
9
|
-
|
|
20
|
+
_inherits(Textarea, _React$Component);
|
|
21
|
+
var _super = _createSuper(Textarea);
|
|
10
22
|
function Textarea() {
|
|
11
23
|
var _this;
|
|
24
|
+
_classCallCheck(this, Textarea);
|
|
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), "handleBlur", function (e) {
|
|
17
30
|
if (_this.props.onBlur) {
|
|
18
31
|
_this.props.onBlur(e);
|
|
19
32
|
}
|
|
20
|
-
};
|
|
21
|
-
_this
|
|
33
|
+
});
|
|
34
|
+
_defineProperty(_assertThisInitialized(_this), "handleChange", function (e) {
|
|
22
35
|
if (_this.props.onChange) {
|
|
23
36
|
_this.props.onChange(e);
|
|
24
37
|
}
|
|
25
|
-
};
|
|
26
|
-
_this
|
|
38
|
+
});
|
|
39
|
+
_defineProperty(_assertThisInitialized(_this), "handleFocus", function (e) {
|
|
27
40
|
if (_this.props.onFocus) {
|
|
28
41
|
_this.props.onFocus(e);
|
|
29
42
|
}
|
|
30
|
-
};
|
|
31
|
-
_this
|
|
43
|
+
});
|
|
44
|
+
_defineProperty(_assertThisInitialized(_this), "handleKeyDown", function (e) {
|
|
32
45
|
if (_this.props.onKeyDown) {
|
|
33
46
|
_this.props.onKeyDown(e);
|
|
34
47
|
}
|
|
35
|
-
};
|
|
36
|
-
_this
|
|
48
|
+
});
|
|
49
|
+
_defineProperty(_assertThisInitialized(_this), "handleKeyUp", function (e) {
|
|
37
50
|
if (_this.props.onKeyUp) {
|
|
38
51
|
_this.props.onKeyUp(e);
|
|
39
52
|
}
|
|
40
|
-
};
|
|
53
|
+
});
|
|
41
54
|
return _this;
|
|
42
55
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
56
|
+
_createClass(Textarea, [{
|
|
57
|
+
key: "render",
|
|
58
|
+
value: function render() {
|
|
59
|
+
var _this$props = this.props,
|
|
60
|
+
autoFocus = _this$props.autoFocus,
|
|
61
|
+
disabled = _this$props.disabled,
|
|
62
|
+
readOnly = _this$props.readOnly,
|
|
63
|
+
isInvalid = _this$props.isInvalid,
|
|
64
|
+
id = _this$props.id,
|
|
65
|
+
name = _this$props.name,
|
|
66
|
+
placeholder = _this$props.placeholder,
|
|
67
|
+
value = _this$props.value,
|
|
68
|
+
enableSpellcheck = _this$props.enableSpellcheck,
|
|
69
|
+
enableResize = _this$props.enableResize,
|
|
70
|
+
required = _this$props.required,
|
|
71
|
+
rows = _this$props.rows,
|
|
72
|
+
elemBefore = _this$props.elemBefore,
|
|
73
|
+
elemAfter = _this$props.elemAfter,
|
|
74
|
+
maxLength = _this$props.maxLength,
|
|
75
|
+
ariaLabel = _this$props.ariaLabel,
|
|
76
|
+
ariaDescribedby = _this$props.ariaDescribedby,
|
|
77
|
+
innerRef = _this$props.innerRef,
|
|
78
|
+
onBlur = _this$props.onBlur,
|
|
79
|
+
onChange = _this$props.onChange,
|
|
80
|
+
onFocus = _this$props.onFocus,
|
|
81
|
+
onKeyDown = _this$props.onKeyDown,
|
|
82
|
+
onKeyUp = _this$props.onKeyUp,
|
|
83
|
+
_this$props$qa = _this$props.qa,
|
|
84
|
+
qa = _this$props$qa === void 0 ? {} : _this$props$qa,
|
|
85
|
+
_this$props$inputProp = _this$props.inputProps,
|
|
86
|
+
inputProps = _this$props$inputProp === void 0 ? {} : _this$props$inputProp,
|
|
87
|
+
rest = _objectWithoutProperties(_this$props, _excluded);
|
|
88
|
+
return /*#__PURE__*/React.createElement(Container, _extends({
|
|
89
|
+
hasBeforeElement: !!elemBefore,
|
|
90
|
+
hasAfterElement: !!elemAfter,
|
|
91
|
+
disabled: disabled,
|
|
92
|
+
invalid: isInvalid,
|
|
93
|
+
resizable: enableResize,
|
|
94
|
+
"data-qa-textarea": id,
|
|
95
|
+
"data-qa-textarea-isdisabled": disabled === true,
|
|
96
|
+
"data-qa-textarea-isrequired": required === true,
|
|
97
|
+
"data-qa-textarea-isinvalid": isInvalid === true
|
|
98
|
+
}, qa, rest), elemBefore && /*#__PURE__*/React.createElement(Accessory, {
|
|
99
|
+
before: true
|
|
100
|
+
}, elemBefore), /*#__PURE__*/React.createElement("textarea", _extends({
|
|
101
|
+
id: id,
|
|
102
|
+
"aria-label": ariaLabel,
|
|
103
|
+
"aria-describedby": ariaDescribedby,
|
|
104
|
+
"aria-invalid": isInvalid,
|
|
105
|
+
value: value,
|
|
106
|
+
name: name,
|
|
107
|
+
placeholder: placeholder,
|
|
108
|
+
rows: rows,
|
|
109
|
+
disabled: disabled,
|
|
110
|
+
readOnly: readOnly,
|
|
111
|
+
autoFocus: autoFocus,
|
|
112
|
+
spellCheck: enableSpellcheck,
|
|
113
|
+
required: required,
|
|
114
|
+
maxLength: maxLength,
|
|
115
|
+
onChange: this.handleChange,
|
|
116
|
+
onKeyUp: this.handleKeyUp,
|
|
117
|
+
onKeyDown: this.handleKeyDown,
|
|
118
|
+
onBlur: this.handleBlur,
|
|
119
|
+
onFocus: this.handleFocus,
|
|
120
|
+
ref: innerRef,
|
|
121
|
+
"data-qa-textarea-input": "",
|
|
122
|
+
"data-qa-input": name
|
|
123
|
+
}, inputProps)), elemAfter && /*#__PURE__*/React.createElement(Accessory, {
|
|
124
|
+
after: true
|
|
125
|
+
}, elemAfter));
|
|
126
|
+
}
|
|
127
|
+
}]);
|
|
113
128
|
return Textarea;
|
|
114
129
|
}(React.Component);
|
|
115
|
-
Textarea
|
|
130
|
+
_defineProperty(Textarea, "defaultProps", {
|
|
116
131
|
rows: 4
|
|
117
|
-
};
|
|
132
|
+
});
|
|
118
133
|
export { Textarea as default };
|
package/lib/Textarea/styles.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
import styled, { css } from 'styled-components';
|
|
3
|
-
import { COMMON } from
|
|
4
|
-
import { focusRing } from
|
|
3
|
+
import { COMMON } from "../utils/system-props";
|
|
4
|
+
import { focusRing } from "../utils/mixins";
|
|
5
5
|
var Container = styled.div.withConfig({
|
|
6
6
|
displayName: "styles__Container",
|
|
7
7
|
componentId: "sc-1hnc1wu-0"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { ThemeProvider as BaseThemeProvider } from 'styled-components';
|
|
4
|
-
import theme from
|
|
4
|
+
import theme from "../themes/light/theme";
|
|
5
5
|
var ThemeProvider = function ThemeProvider(props) {
|
|
6
6
|
return /*#__PURE__*/React.createElement(BaseThemeProvider, _extends({}, props, {
|
|
7
7
|
theme: props.theme || theme
|
package/lib/Toast/index.js
CHANGED
|
@@ -2,12 +2,12 @@ import _styled2 from "styled-components";
|
|
|
2
2
|
import _styled from "styled-components";
|
|
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
4
|
import * as React from 'react';
|
|
5
|
-
import Container, { GlobalToastStyles, CustomIcon } from
|
|
5
|
+
import Container, { GlobalToastStyles, CustomIcon } from "./styles";
|
|
6
6
|
import { toast as toastifyToast, ToastContainer as BaseToastContainer, cssTransition } from 'react-toastify';
|
|
7
7
|
import { MOTION_DURATION_MEDIUM, MOTION_DURATION_SLOW } from '@sproutsocial/seeds-motion/dist/seeds-motion-unitless';
|
|
8
|
-
import Icon from
|
|
9
|
-
import Box from
|
|
10
|
-
import Text from
|
|
8
|
+
import Icon from "../Icon";
|
|
9
|
+
import Box from "../Box";
|
|
10
|
+
import Text from "../Text";
|
|
11
11
|
var NoTransition = cssTransition({
|
|
12
12
|
duration: [0, 0],
|
|
13
13
|
collapseDuration: 0
|
|
@@ -59,9 +59,7 @@ export function toast(options) {
|
|
|
59
59
|
var IconBox = function IconBox(props) {
|
|
60
60
|
return /*#__PURE__*/React.createElement(_StyledBox, _extends({
|
|
61
61
|
display: "inline-block"
|
|
62
|
-
}, props
|
|
63
|
-
$_css: 'line-height: 1;'
|
|
64
|
-
}));
|
|
62
|
+
}, props));
|
|
65
63
|
};
|
|
66
64
|
var Toast = function Toast(_ref) {
|
|
67
65
|
var content = _ref.content,
|
|
@@ -103,9 +101,7 @@ export default ToastContainer;
|
|
|
103
101
|
var _StyledBox = _styled(Box).withConfig({
|
|
104
102
|
displayName: "Toast___StyledBox",
|
|
105
103
|
componentId: "sc-1vii3dq-0"
|
|
106
|
-
})([""
|
|
107
|
-
return p.$_css;
|
|
108
|
-
});
|
|
104
|
+
})(["line-height:1;"]);
|
|
109
105
|
var _StyledBox2 = _styled(Box).withConfig({
|
|
110
106
|
displayName: "Toast___StyledBox2",
|
|
111
107
|
componentId: "sc-1vii3dq-1"
|