@sproutsocial/racine 22.5.1 → 23.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/README.md +3 -3
- package/__flow__/Toast/Toast.flow.js +4 -0
- package/commonjs/Avatar/Avatar.js +24 -16
- package/commonjs/Badge/Badge.js +20 -13
- package/commonjs/Banner/Banner.js +35 -25
- package/commonjs/Box/Box.js +7 -2
- package/commonjs/Breadcrumb/Breadcrumb.js +36 -23
- package/commonjs/Button/Button.js +11 -3
- package/commonjs/Card/Card.js +25 -18
- package/commonjs/Card/subComponents.js +32 -15
- package/commonjs/CharacterCounter/CharacterCounter.js +7 -3
- package/commonjs/ChartLegend/ChartLegend.js +10 -3
- package/commonjs/ChartLegend/useChartLabels.js +12 -10
- package/commonjs/Checkbox/Checkbox.js +55 -45
- package/commonjs/Checkbox/styles.js +20 -17
- package/commonjs/Collapsible/Collapsible.js +22 -16
- package/commonjs/DatePicker/DateRangePicker/DateRangePicker.js +26 -16
- package/commonjs/DatePicker/DateRangePicker/StatefulDateRangePicker.js +7 -2
- package/commonjs/DatePicker/SingleDatePicker/SingleDatePicker.js +24 -14
- package/commonjs/DatePicker/SingleDatePicker/StatefulSingleDatePicker.js +7 -2
- package/commonjs/DatePicker/common.js +8 -6
- package/commonjs/Drawer/Drawer.js +160 -113
- package/commonjs/EmptyState/EmptyState.js +44 -31
- package/commonjs/Fieldset/Fieldset.js +31 -14
- package/commonjs/FormField/FormField.js +37 -31
- package/commonjs/Icon/Icon.js +35 -30
- package/commonjs/Image/Image.js +5 -3
- package/commonjs/Indicator/Indicator.js +12 -6
- package/commonjs/Input/Input.js +57 -51
- package/commonjs/KeyboardKey/KeyboardKey.js +12 -3
- package/commonjs/Label/Label.js +15 -9
- package/commonjs/Link/Link.js +10 -3
- package/commonjs/Listbox/Listbox.js +16 -13
- package/commonjs/Loader/Loader.js +9 -3
- package/commonjs/LoaderButton/LoaderButton.js +28 -18
- package/commonjs/Menu/Menu.js +128 -107
- package/commonjs/Menu/utils/descendants.js +6 -6
- package/commonjs/Message/Message.js +79 -59
- package/commonjs/Modal/Modal.js +54 -31
- package/commonjs/Modal/styles.js +8 -4
- package/commonjs/Numeral/Numeral.js +46 -13
- package/commonjs/Numeral/index.js +12 -3
- package/commonjs/PartnerLogo/PartnerLogo.js +22 -12
- package/commonjs/Radio/Radio.js +28 -22
- package/commonjs/SegmentedControl/SegmentedControl.js +38 -24
- package/commonjs/Select/Select.js +32 -25
- package/commonjs/SpotIllustration/SpotIllustration.js +13 -5
- package/commonjs/Stack/Stack.js +15 -8
- package/commonjs/Switch/Switch.js +14 -7
- package/commonjs/Table/Table.js +65 -45
- package/commonjs/TableCell/TableCell.js +6 -3
- package/commonjs/TableHeaderCell/TableHeaderCell.js +20 -12
- package/commonjs/TableRowAccordion/TableRowAccordion.js +35 -29
- package/commonjs/Tabs/Tabs.js +37 -30
- package/commonjs/Text/Text.js +10 -3
- package/commonjs/Textarea/Textarea.js +37 -32
- package/commonjs/ThemeProvider/index.js +8 -5
- package/commonjs/Toast/Toast.js +127 -91
- package/commonjs/Toast/index.js +15 -15
- package/commonjs/Toast/styles.js +56 -30
- package/commonjs/ToggleHint/ToggleHint.js +11 -5
- package/commonjs/Token/Token.js +39 -25
- package/commonjs/TokenInput/TokenInput.js +55 -47
- package/commonjs/TokenInput/TokenScreenReaderStatus.js +5 -3
- package/commonjs/Tooltip/Tooltip.js +34 -27
- package/dist/types/Avatar/Avatar.d.ts.map +1 -1
- package/dist/types/Badge/BadgeTypes.d.ts +0 -1
- package/dist/types/Badge/BadgeTypes.d.ts.map +1 -1
- package/dist/types/Badge/styles.d.ts +1 -1
- package/dist/types/Badge/styles.d.ts.map +1 -1
- package/dist/types/Box/BoxTypes.d.ts +0 -1
- package/dist/types/Box/BoxTypes.d.ts.map +1 -1
- package/dist/types/Box/styles.d.ts +1 -1
- package/dist/types/Box/styles.d.ts.map +1 -1
- package/dist/types/Button/Button.d.ts +1 -1
- package/dist/types/Button/Button.d.ts.map +1 -1
- package/dist/types/Card/subComponents.d.ts.map +1 -1
- package/dist/types/Card/utils.d.ts +0 -2
- package/dist/types/Card/utils.d.ts.map +1 -1
- package/dist/types/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/types/Collapsible/styles.d.ts +2 -3
- package/dist/types/Collapsible/styles.d.ts.map +1 -1
- package/dist/types/DatePicker/DateRangePicker/DateRangePickerTypes.d.ts +0 -1
- package/dist/types/DatePicker/DateRangePicker/DateRangePickerTypes.d.ts.map +1 -1
- package/dist/types/DatePicker/SingleDatePicker/SingleDatePickerTypes.d.ts +0 -1
- package/dist/types/DatePicker/SingleDatePicker/SingleDatePickerTypes.d.ts.map +1 -1
- package/dist/types/DatePicker/common.d.ts.map +1 -1
- package/dist/types/DatePicker/styles.d.ts +0 -1
- package/dist/types/DatePicker/styles.d.ts.map +1 -1
- package/dist/types/Drawer/Drawer.d.ts.map +1 -1
- package/dist/types/Drawer/DrawerTypes.d.ts +6 -3
- package/dist/types/Drawer/DrawerTypes.d.ts.map +1 -1
- package/dist/types/Drawer/styles.d.ts +0 -1
- package/dist/types/Drawer/styles.d.ts.map +1 -1
- package/dist/types/Fieldset/styles.d.ts +0 -1
- package/dist/types/Fieldset/styles.d.ts.map +1 -1
- package/dist/types/Icon/styles.d.ts +1 -1
- package/dist/types/Icon/styles.d.ts.map +1 -1
- package/dist/types/Image/Image.d.ts.map +1 -1
- package/dist/types/Input/Input.d.ts.map +1 -1
- package/dist/types/Input/styles.d.ts +3 -3
- package/dist/types/Input/styles.d.ts.map +1 -1
- package/dist/types/Listbox/ListboxTypes.d.ts +1 -1
- package/dist/types/Listbox/ListboxTypes.d.ts.map +1 -1
- package/dist/types/Loader/LoaderTypes.d.ts +0 -1
- package/dist/types/Loader/LoaderTypes.d.ts.map +1 -1
- package/dist/types/Menu/MenuTypes.d.ts +4 -4
- package/dist/types/Menu/MenuTypes.d.ts.map +1 -1
- package/dist/types/Menu/styles.d.ts +0 -1
- package/dist/types/Menu/styles.d.ts.map +1 -1
- package/dist/types/Menu/utils/descendants.d.ts.map +1 -1
- package/dist/types/Menu/utils/hooks.d.ts +0 -2
- package/dist/types/Menu/utils/hooks.d.ts.map +1 -1
- package/dist/types/Message/Message.d.ts +1 -1
- package/dist/types/Message/Message.d.ts.map +1 -1
- package/dist/types/Message/styles.d.ts +0 -2
- package/dist/types/Message/styles.d.ts.map +1 -1
- package/dist/types/Modal/styles.d.ts +3 -3
- package/dist/types/Modal/styles.d.ts.map +1 -1
- package/dist/types/Numeral/Numeral.d.ts +3 -1
- package/dist/types/Numeral/Numeral.d.ts.map +1 -1
- package/dist/types/Numeral/__tests__/features/testNumeral.d.ts.map +1 -1
- package/dist/types/Numeral/index.d.ts +2 -1
- package/dist/types/Numeral/index.d.ts.map +1 -1
- package/dist/types/Radio/Radio.d.ts.map +1 -1
- package/dist/types/Radio/styles.d.ts +3 -3
- package/dist/types/Radio/styles.d.ts.map +1 -1
- package/dist/types/SegmentedControl/styles.d.ts +0 -1
- package/dist/types/SegmentedControl/styles.d.ts.map +1 -1
- package/dist/types/Select/Select.d.ts.map +1 -1
- package/dist/types/Skeleton/Skeleton.d.ts +0 -1
- package/dist/types/Skeleton/Skeleton.d.ts.map +1 -1
- package/dist/types/StatefulStory.d.ts +0 -1
- package/dist/types/StatefulStory.d.ts.map +1 -1
- package/dist/types/TableHeaderCell/TableHeaderCell.d.ts.map +1 -1
- package/dist/types/TableHeaderCell/styles.d.ts +1 -1
- package/dist/types/TableHeaderCell/styles.d.ts.map +1 -1
- package/dist/types/Tabs/Tabs.d.ts.map +1 -1
- package/dist/types/Textarea/Textarea.d.ts.map +1 -1
- package/dist/types/ThemeProvider/index.d.ts +1 -1
- package/dist/types/ThemeProvider/index.d.ts.map +1 -1
- package/dist/types/Toast/Toast.d.ts +22 -2
- package/dist/types/Toast/Toast.d.ts.map +1 -1
- package/dist/types/Toast/ToastTypes.d.ts +27 -13
- package/dist/types/Toast/ToastTypes.d.ts.map +1 -1
- package/dist/types/Toast/index.d.ts +2 -4
- package/dist/types/Toast/index.d.ts.map +1 -1
- package/dist/types/Toast/styles.d.ts +10 -16
- package/dist/types/Toast/styles.d.ts.map +1 -1
- package/dist/types/TokenInput/TokenInput.d.ts +1 -1
- package/dist/types/TokenInput/TokenInput.d.ts.map +1 -1
- package/dist/types/Tooltip/TooltipTypes.d.ts +2 -2
- package/dist/types/Tooltip/TooltipTypes.d.ts.map +1 -1
- package/dist/types/Tooltip/styles.d.ts +0 -1
- package/dist/types/Tooltip/styles.d.ts.map +1 -1
- package/dist/types/themes/dark/theme.d.ts +2 -2
- package/dist/types/themes/dark/theme.d.ts.map +1 -1
- package/dist/types/utils/hooks.d.ts.map +1 -1
- package/dist/types/utils/react-testing-library.d.ts +109 -169
- package/dist/types/utils/react-testing-library.d.ts.map +1 -1
- package/dist/types/utils/responsiveProps/index.d.ts.map +1 -1
- package/lib/Avatar/Avatar.js +25 -16
- package/lib/Badge/Badge.js +22 -13
- package/lib/Banner/Banner.js +37 -25
- package/lib/Box/Box.js +8 -2
- package/lib/Breadcrumb/Breadcrumb.js +37 -23
- package/lib/Button/Button.js +11 -3
- package/lib/Card/Card.js +17 -8
- package/lib/Card/subComponents.js +35 -15
- package/lib/CharacterCounter/CharacterCounter.js +7 -3
- package/lib/ChartLegend/ChartLegend.js +11 -3
- package/lib/ChartLegend/useChartLabels.js +13 -10
- package/lib/Checkbox/Checkbox.js +56 -45
- package/lib/Checkbox/styles.js +20 -17
- package/lib/Collapsible/Collapsible.js +22 -16
- package/lib/DatePicker/DateRangePicker/DateRangePicker.js +29 -16
- package/lib/DatePicker/DateRangePicker/StatefulDateRangePicker.js +8 -2
- package/lib/DatePicker/SingleDatePicker/SingleDatePicker.js +27 -14
- package/lib/DatePicker/SingleDatePicker/StatefulSingleDatePicker.js +8 -2
- package/lib/DatePicker/common.js +8 -6
- package/lib/Drawer/Drawer.js +159 -111
- package/lib/EmptyState/EmptyState.js +46 -31
- package/lib/Fieldset/Fieldset.js +33 -14
- package/lib/FormField/FormField.js +38 -31
- package/lib/Icon/Icon.js +36 -30
- package/lib/Image/Image.js +5 -3
- package/lib/Indicator/Indicator.js +13 -6
- package/lib/Input/Input.js +57 -49
- package/lib/KeyboardKey/KeyboardKey.js +12 -3
- package/lib/Label/Label.js +16 -9
- package/lib/Link/Link.js +11 -3
- package/lib/Listbox/Listbox.js +17 -13
- package/lib/Loader/Loader.js +9 -3
- package/lib/LoaderButton/LoaderButton.js +30 -18
- package/lib/Menu/Menu.js +128 -104
- package/lib/Menu/utils/descendants.js +5 -4
- package/lib/Message/Message.js +80 -59
- package/lib/Modal/Modal.js +56 -31
- package/lib/Modal/styles.js +8 -2
- package/lib/Numeral/Numeral.js +48 -12
- package/lib/Numeral/index.js +2 -1
- package/lib/PartnerLogo/PartnerLogo.js +22 -12
- package/lib/Radio/Radio.js +29 -22
- package/lib/SegmentedControl/SegmentedControl.js +40 -24
- package/lib/Select/Select.js +33 -25
- package/lib/SpotIllustration/SpotIllustration.js +13 -5
- package/lib/Stack/Stack.js +17 -8
- package/lib/Switch/Switch.js +15 -7
- package/lib/Table/Table.js +65 -43
- package/lib/TableCell/TableCell.js +5 -2
- package/lib/TableHeaderCell/TableHeaderCell.js +20 -11
- package/lib/TableRowAccordion/TableRowAccordion.js +35 -28
- package/lib/Tabs/Tabs.js +37 -30
- package/lib/Text/Text.js +11 -3
- package/lib/Textarea/Textarea.js +37 -30
- package/lib/ThemeProvider/index.js +8 -3
- package/lib/Toast/Toast.js +130 -90
- package/lib/Toast/index.js +3 -5
- package/lib/Toast/styles.js +55 -26
- package/lib/ToggleHint/ToggleHint.js +12 -5
- package/lib/Token/Token.js +42 -25
- package/lib/TokenInput/TokenInput.js +56 -47
- package/lib/TokenInput/TokenScreenReaderStatus.js +5 -3
- package/lib/Tooltip/Tooltip.js +34 -27
- package/package.json +40 -36
- package/commonjs/Drawer/SlideTransition.js +0 -47
- package/commonjs/Popout/Popout.js +0 -313
- package/commonjs/Popout/PopoutTypes.js +0 -5
- package/commonjs/Popout/index.js +0 -30
- package/commonjs/Popout/styles.js +0 -13
- package/dist/types/Drawer/SlideTransition.d.ts +0 -15
- package/dist/types/Drawer/SlideTransition.d.ts.map +0 -1
- package/dist/types/Popout/Popout.d.ts +0 -14
- package/dist/types/Popout/Popout.d.ts.map +0 -1
- package/dist/types/Popout/PopoutTypes.d.ts +0 -90
- package/dist/types/Popout/PopoutTypes.d.ts.map +0 -1
- package/dist/types/Popout/index.d.ts +0 -5
- package/dist/types/Popout/index.d.ts.map +0 -1
- package/dist/types/Popout/styles.d.ts +0 -2
- package/dist/types/Popout/styles.d.ts.map +0 -1
- package/lib/Drawer/SlideTransition.js +0 -38
- package/lib/Popout/Popout.js +0 -303
- package/lib/Popout/PopoutTypes.js +0 -1
- package/lib/Popout/index.js +0 -4
- package/lib/Popout/styles.js +0 -6
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
1
2
|
var _excluded = ["value", "children", "disabled"],
|
|
2
3
|
_excluded2 = ["selectedValue", "label", "onChange", "children"];
|
|
3
|
-
function
|
|
4
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
7
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
8
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
4
9
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
5
10
|
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."); }
|
|
6
11
|
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); }
|
|
@@ -13,6 +18,8 @@ import * as React from "react";
|
|
|
13
18
|
import { useState, useContext } from "react";
|
|
14
19
|
import Box from "../Box";
|
|
15
20
|
import { SegmentedControlContainer, SegmentedControlItemContainer, SegmentedControlLabel } from "./styles";
|
|
21
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
23
|
var nameCounter = 0;
|
|
17
24
|
var idCounter = 0;
|
|
18
25
|
var SegmentedControlContext = /*#__PURE__*/React.createContext(null);
|
|
@@ -34,24 +41,27 @@ var SegmentedControlItem = function SegmentedControlItem(_ref) {
|
|
|
34
41
|
_useState2 = _slicedToArray(_useState, 1),
|
|
35
42
|
id = _useState2[0];
|
|
36
43
|
var isChecked = value === selectedValue;
|
|
37
|
-
return /*#__PURE__*/
|
|
44
|
+
return /*#__PURE__*/_jsxs(SegmentedControlItemContainer, _objectSpread(_objectSpread({
|
|
38
45
|
"data-segmentedcontrol-isactive": isChecked,
|
|
39
46
|
"data-qa-segmentedcontrol-item": value,
|
|
40
47
|
"data-qa-segmentedcontrol-ischecked": isChecked === true,
|
|
41
48
|
disabled: disabled
|
|
42
|
-
}, rest),
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
49
|
+
}, rest), {}, {
|
|
50
|
+
children: [/*#__PURE__*/_jsx("input", {
|
|
51
|
+
type: "radio",
|
|
52
|
+
id: id,
|
|
53
|
+
name: name,
|
|
54
|
+
value: value,
|
|
55
|
+
checked: isChecked,
|
|
56
|
+
onChange: onChange,
|
|
57
|
+
disabled: disabled
|
|
58
|
+
}), /*#__PURE__*/_jsx(SegmentedControlLabel, {
|
|
59
|
+
as: "label",
|
|
60
|
+
htmlFor: id,
|
|
61
|
+
isActive: isChecked,
|
|
62
|
+
children: children
|
|
63
|
+
})]
|
|
64
|
+
}));
|
|
55
65
|
};
|
|
56
66
|
var SegmentedControl = function SegmentedControl(_ref2) {
|
|
57
67
|
var selectedValue = _ref2.selectedValue,
|
|
@@ -62,19 +72,25 @@ var SegmentedControl = function SegmentedControl(_ref2) {
|
|
|
62
72
|
var _useState3 = useState("Racine-segmented-control-".concat(nameCounter++)),
|
|
63
73
|
_useState4 = _slicedToArray(_useState3, 1),
|
|
64
74
|
name = _useState4[0];
|
|
65
|
-
return /*#__PURE__*/
|
|
75
|
+
return /*#__PURE__*/_jsx(SegmentedControlContext.Provider, {
|
|
66
76
|
value: {
|
|
67
77
|
name: name,
|
|
68
78
|
selectedValue: selectedValue,
|
|
69
79
|
onChange: onChange
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
80
|
+
},
|
|
81
|
+
children: /*#__PURE__*/_jsxs(SegmentedControlContainer, _objectSpread(_objectSpread({
|
|
82
|
+
forwardedAs: "fieldset",
|
|
83
|
+
"data-qa-segmentedcontrol": label,
|
|
84
|
+
"data-qa-segmentedcontrol-value": selectedValue
|
|
85
|
+
}, rest), {}, {
|
|
86
|
+
children: [/*#__PURE__*/_jsx("legend", {
|
|
87
|
+
children: label
|
|
88
|
+
}), /*#__PURE__*/_jsx(Box, {
|
|
89
|
+
display: "flex",
|
|
90
|
+
children: children
|
|
91
|
+
})]
|
|
92
|
+
}))
|
|
93
|
+
});
|
|
78
94
|
};
|
|
79
95
|
SegmentedControlItem.displayName = "SegmentedControl.Item";
|
|
80
96
|
SegmentedControl.Item = SegmentedControlItem;
|
package/lib/Select/Select.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
var _excluded = ["id", "name", "children", "defaultValue", "value", "required", "isInvalid", "onChange", "autoFocus", "disabled", "ariaLabel", "ariaDescribedby", "size", "qa", "inputProps"];
|
|
2
2
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
3
|
-
function
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
5
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
5
6
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
6
7
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
@@ -19,6 +20,8 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
19
20
|
import * as React from "react";
|
|
20
21
|
import Icon from "../Icon";
|
|
21
22
|
import Container, { Arrow } from "./styles";
|
|
23
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
25
|
var Select = /*#__PURE__*/function (_React$Component) {
|
|
23
26
|
_inherits(Select, _React$Component);
|
|
24
27
|
function Select() {
|
|
@@ -58,33 +61,38 @@ var Select = /*#__PURE__*/function (_React$Component) {
|
|
|
58
61
|
_this$props$inputProp = _this$props.inputProps,
|
|
59
62
|
inputProps = _this$props$inputProp === void 0 ? {} : _this$props$inputProp,
|
|
60
63
|
rest = _objectWithoutProperties(_this$props, _excluded);
|
|
61
|
-
return /*#__PURE__*/
|
|
64
|
+
return /*#__PURE__*/_jsxs(Container, _objectSpread(_objectSpread({
|
|
62
65
|
invalid: isInvalid,
|
|
63
66
|
disabled: disabled,
|
|
64
67
|
size: size
|
|
65
|
-
}, rest),
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
68
|
+
}, rest), {}, {
|
|
69
|
+
children: [/*#__PURE__*/_jsx("select", _objectSpread(_objectSpread(_objectSpread({
|
|
70
|
+
id: id,
|
|
71
|
+
name: name,
|
|
72
|
+
"aria-label": ariaLabel,
|
|
73
|
+
"aria-describedby": ariaDescribedby,
|
|
74
|
+
defaultValue: defaultValue,
|
|
75
|
+
value: value,
|
|
76
|
+
required: required,
|
|
77
|
+
autoFocus: autoFocus,
|
|
78
|
+
disabled: disabled,
|
|
79
|
+
onChange: this.handleChange,
|
|
80
|
+
"data-qa-select": name || "",
|
|
81
|
+
"data-qa-select-value": value || "unselected",
|
|
82
|
+
"data-qa-select-isrequired": required === true,
|
|
83
|
+
"data-qa-select-isdisabled": disabled === true
|
|
84
|
+
}, qa), inputProps), {}, {
|
|
85
|
+
children: children
|
|
86
|
+
})), /*#__PURE__*/_jsx(Arrow, {
|
|
87
|
+
size: size,
|
|
88
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
89
|
+
name: "chevron-down-outline",
|
|
90
|
+
fixedWidth: true,
|
|
91
|
+
size: this.props.size === "small" ? "small" : "medium",
|
|
92
|
+
"aria-hidden": true
|
|
93
|
+
})
|
|
94
|
+
})]
|
|
95
|
+
}));
|
|
88
96
|
}
|
|
89
97
|
}]);
|
|
90
98
|
return Select;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
1
2
|
var _excluded = ["name", "customFill", "height", "width"];
|
|
2
|
-
function
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
3
8
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
9
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
5
10
|
import React from "react";
|
|
@@ -7,6 +12,7 @@ import styled from "styled-components";
|
|
|
7
12
|
// eslint-disable-next-line no-restricted-syntax
|
|
8
13
|
|
|
9
14
|
import { ViewBoxes } from "@sproutsocial/seeds-illustrations";
|
|
15
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
16
|
var StyledSVG = styled.svg.withConfig({
|
|
11
17
|
displayName: "SpotIllustration__StyledSVG",
|
|
12
18
|
componentId: "sc-1j3815-0"
|
|
@@ -25,16 +31,18 @@ var SpotIllustration = function SpotIllustration(_ref) {
|
|
|
25
31
|
var viewBoxCoordinates = (viewBox === null || viewBox === void 0 ? void 0 : viewBox.split(" ")) || [];
|
|
26
32
|
var defaultWidth = viewBoxCoordinates[2];
|
|
27
33
|
var defaultHeight = viewBoxCoordinates[3];
|
|
28
|
-
return /*#__PURE__*/
|
|
34
|
+
return /*#__PURE__*/_jsx(StyledSVG, _objectSpread(_objectSpread({
|
|
29
35
|
role: "img",
|
|
30
36
|
width: width ? width : defaultWidth,
|
|
31
37
|
height: height ? height : defaultHeight,
|
|
32
38
|
viewBox: viewBox,
|
|
33
39
|
focusable: false,
|
|
34
40
|
customFill: customFill
|
|
35
|
-
}, svgProps),
|
|
36
|
-
|
|
37
|
-
|
|
41
|
+
}, svgProps), {}, {
|
|
42
|
+
children: /*#__PURE__*/_jsx("use", {
|
|
43
|
+
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
44
|
+
xlinkHref: "#seeds-svgs_".concat(name)
|
|
45
|
+
})
|
|
38
46
|
}));
|
|
39
47
|
};
|
|
40
48
|
export default SpotIllustration;
|
package/lib/Stack/Stack.js
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
1
2
|
var _excluded = ["children", "space", "align", "direction"];
|
|
2
|
-
function
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
3
8
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
9
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
5
10
|
import * as React from "react";
|
|
6
11
|
import { Children } from "react";
|
|
7
12
|
import { normalizeResponsiveProp } from "../utils/responsiveProps";
|
|
8
13
|
import Box from "../Box";
|
|
14
|
+
import { createElement as _createElement } from "react";
|
|
15
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
16
|
var stackStyles = {
|
|
10
17
|
horizontal: {
|
|
11
18
|
left: {
|
|
@@ -87,14 +94,16 @@ var Stack = function Stack(_ref) {
|
|
|
87
94
|
// styled system can pass numbers that map to theme values and TS doesn't like it
|
|
88
95
|
childMarginProps[opposite][i] = 0;
|
|
89
96
|
});
|
|
90
|
-
return /*#__PURE__*/
|
|
97
|
+
return /*#__PURE__*/_jsx(Box, _objectSpread(_objectSpread(_objectSpread({
|
|
91
98
|
display: "flex"
|
|
92
|
-
}, styleProps, rest),
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
99
|
+
}, styleProps), rest), {}, {
|
|
100
|
+
children: stackItems.map(function (item, i) {
|
|
101
|
+
return /*#__PURE__*/_createElement(Box, _objectSpread(_objectSpread({
|
|
102
|
+
flexBasis: childFlexBasis
|
|
103
|
+
}, i !== 0 ? childMarginProps : {}), {}, {
|
|
104
|
+
key: i
|
|
105
|
+
}), item);
|
|
106
|
+
})
|
|
98
107
|
}));
|
|
99
108
|
};
|
|
100
109
|
export default Stack;
|
package/lib/Switch/Switch.js
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
1
2
|
var _excluded = ["onClick", "loading", "checked", "disabled"];
|
|
2
|
-
function
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
3
8
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
9
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
5
10
|
import * as React from "react";
|
|
6
11
|
import Icon from "../Icon";
|
|
7
12
|
import { StyledSwitchButton } from "./styles";
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
14
|
/**
|
|
9
15
|
* @link https://seeds.sproutsocial.com/components/switch/
|
|
10
16
|
*
|
|
@@ -31,17 +37,19 @@ var Switch = function Switch(_ref) {
|
|
|
31
37
|
onClick(e, !checked);
|
|
32
38
|
}
|
|
33
39
|
};
|
|
34
|
-
return /*#__PURE__*/
|
|
40
|
+
return /*#__PURE__*/_jsx(StyledSwitchButton, _objectSpread(_objectSpread({
|
|
35
41
|
type: "button",
|
|
36
42
|
role: "switch",
|
|
37
43
|
"aria-checked": checked,
|
|
38
44
|
disabled: disabled,
|
|
39
45
|
onClick: handleClick,
|
|
40
46
|
className: loading ? "loading" : ""
|
|
41
|
-
}, rest),
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
47
|
+
}, rest), {}, {
|
|
48
|
+
children: checked ? /*#__PURE__*/_jsx(Icon, {
|
|
49
|
+
"aria-hidden": true,
|
|
50
|
+
size: "mini",
|
|
51
|
+
name: "check-solid"
|
|
52
|
+
}) : null
|
|
53
|
+
}));
|
|
46
54
|
};
|
|
47
55
|
export default Switch;
|
package/lib/Table/Table.js
CHANGED
|
@@ -3,22 +3,32 @@ var _excluded = ["head", "rows", "onSort", "sortId", "sortDirection", "rowRender
|
|
|
3
3
|
_excluded3 = ["children"],
|
|
4
4
|
_excluded4 = ["children"],
|
|
5
5
|
_excluded5 = ["children"];
|
|
6
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
6
7
|
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; }
|
|
7
8
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
8
|
-
function
|
|
9
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
10
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
11
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
12
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
13
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
9
14
|
import * as React from "react";
|
|
10
15
|
import TableCell from "../TableCell";
|
|
11
16
|
import TableHeaderCell from "../TableHeaderCell";
|
|
12
17
|
import Container from "./styles";
|
|
18
|
+
import { createElement as _createElement } from "react";
|
|
19
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
21
|
var renderTableRow = function renderTableRow(row) {
|
|
14
|
-
return /*#__PURE__*/
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
return /*#__PURE__*/_jsx("tbody", {
|
|
23
|
+
"data-qa-table-row": "",
|
|
24
|
+
children: /*#__PURE__*/_jsx("tr", {
|
|
25
|
+
children: row.cells.map(function (td) {
|
|
26
|
+
return /*#__PURE__*/_createElement(TableCell, _objectSpread(_objectSpread({}, td), {}, {
|
|
27
|
+
key: td.id
|
|
28
|
+
}));
|
|
29
|
+
})
|
|
30
|
+
})
|
|
31
|
+
}, row.id);
|
|
22
32
|
};
|
|
23
33
|
|
|
24
34
|
/**
|
|
@@ -37,59 +47,71 @@ export var Table = function Table(_ref) {
|
|
|
37
47
|
color = _ref.color,
|
|
38
48
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
39
49
|
if (children) {
|
|
40
|
-
return /*#__PURE__*/
|
|
41
|
-
"data-qa-table": ""
|
|
42
|
-
|
|
50
|
+
return /*#__PURE__*/_jsx(Container, _objectSpread(_objectSpread({}, rest), {}, {
|
|
51
|
+
"data-qa-table": "",
|
|
52
|
+
children: children
|
|
53
|
+
}));
|
|
43
54
|
}
|
|
44
|
-
return /*#__PURE__*/
|
|
55
|
+
return /*#__PURE__*/_jsxs(Container, _objectSpread(_objectSpread({}, rest), {}, {
|
|
45
56
|
"data-qa-table": ""
|
|
46
57
|
// TODO: fix this type since `color` should be valid here. TS can't resolve the correct type.
|
|
47
58
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
48
59
|
// @ts-ignore
|
|
49
60
|
,
|
|
50
|
-
color: color
|
|
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
|
-
|
|
61
|
+
color: color,
|
|
62
|
+
children: [/*#__PURE__*/_jsx("colgroup", {
|
|
63
|
+
children: head.map(function (_ref2) {
|
|
64
|
+
var id = _ref2.id,
|
|
65
|
+
_ref2$colSpan = _ref2.colSpan,
|
|
66
|
+
colSpan = _ref2$colSpan === void 0 ? 1 : _ref2$colSpan;
|
|
67
|
+
return /*#__PURE__*/_jsx("col", {
|
|
68
|
+
span: colSpan
|
|
69
|
+
}, id);
|
|
70
|
+
})
|
|
71
|
+
}), head.length > 0 && /*#__PURE__*/_jsx("thead", {
|
|
72
|
+
"data-qa-table-header": "",
|
|
73
|
+
children: /*#__PURE__*/_jsx("tr", {
|
|
74
|
+
children: head.map(function (_ref3) {
|
|
75
|
+
var color = _ref3.color,
|
|
76
|
+
th = _objectWithoutProperties(_ref3, _excluded2);
|
|
77
|
+
return /*#__PURE__*/_createElement(TableHeaderCell, _objectSpread(_objectSpread({}, th), {}, {
|
|
78
|
+
key: th.id,
|
|
79
|
+
onSort: onSort,
|
|
80
|
+
sortId: sortId,
|
|
81
|
+
sortDirection: sortDirection
|
|
82
|
+
// TODO: fix this type since `color` should be valid here. TS can't resolve the correct type.
|
|
83
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
84
|
+
// @ts-ignore
|
|
85
|
+
,
|
|
86
|
+
color: color
|
|
87
|
+
}));
|
|
88
|
+
})
|
|
89
|
+
})
|
|
90
|
+
}), rows.map(function (row) {
|
|
91
|
+
return rowRender ? rowRender(row) : renderTableRow(row);
|
|
92
|
+
})]
|
|
77
93
|
}));
|
|
78
94
|
};
|
|
79
95
|
export var TableHead = function TableHead(_ref4) {
|
|
80
96
|
var children = _ref4.children,
|
|
81
97
|
props = _objectWithoutProperties(_ref4, _excluded3);
|
|
82
|
-
return /*#__PURE__*/
|
|
98
|
+
return /*#__PURE__*/_jsx("thead", _objectSpread(_objectSpread({}, props), {}, {
|
|
99
|
+
children: children
|
|
100
|
+
}));
|
|
83
101
|
};
|
|
84
102
|
export var TableBody = function TableBody(_ref5) {
|
|
85
103
|
var children = _ref5.children,
|
|
86
104
|
props = _objectWithoutProperties(_ref5, _excluded4);
|
|
87
|
-
return /*#__PURE__*/
|
|
105
|
+
return /*#__PURE__*/_jsx("tbody", _objectSpread(_objectSpread({}, props), {}, {
|
|
106
|
+
children: children
|
|
107
|
+
}));
|
|
88
108
|
};
|
|
89
109
|
export var TableRow = function TableRow(_ref6) {
|
|
90
110
|
var children = _ref6.children,
|
|
91
111
|
props = _objectWithoutProperties(_ref6, _excluded5);
|
|
92
|
-
return /*#__PURE__*/
|
|
112
|
+
return /*#__PURE__*/_jsx("tr", _objectSpread(_objectSpread({}, props), {}, {
|
|
113
|
+
children: children
|
|
114
|
+
}));
|
|
93
115
|
};
|
|
94
116
|
TableHead.displayName = "Table.TableHead";
|
|
95
117
|
TableBody.displayName = "Table.TableBody";
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
2
|
var _excluded = ["id", "content", "colSpan", "width", "align", "scope", "children", "color"];
|
|
3
|
-
function
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
4
6
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
5
7
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
6
8
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
@@ -17,6 +19,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
|
17
19
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
18
20
|
import * as React from "react";
|
|
19
21
|
import Container from "./styles";
|
|
22
|
+
import { createElement as _createElement } from "react";
|
|
20
23
|
/**
|
|
21
24
|
* The table cell component is for rendering table cells and is meant to be used with the table component.
|
|
22
25
|
*/
|
|
@@ -39,7 +42,7 @@ export var TableCell = /*#__PURE__*/function (_React$Component) {
|
|
|
39
42
|
children = _this$props.children,
|
|
40
43
|
color = _this$props.color,
|
|
41
44
|
rest = _objectWithoutProperties(_this$props, _excluded);
|
|
42
|
-
return /*#__PURE__*/
|
|
45
|
+
return /*#__PURE__*/_createElement(Container, _objectSpread(_objectSpread({}, rest), {}, {
|
|
43
46
|
// If the `scope` property is passed we must render the element as a <th>
|
|
44
47
|
as: scope ? "th" : "td",
|
|
45
48
|
scope: scope ? scope : undefined,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
var _excluded = ["id", "content", "colSpan", "width", "align", "isSortable", "sortId", "sortDirection", "children", "shouldTruncate", "onSort", "onClick", "color"];
|
|
2
2
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
3
|
-
function
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
5
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
5
6
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
6
7
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
@@ -20,6 +21,9 @@ import * as React from "react";
|
|
|
20
21
|
import Icon from "../Icon";
|
|
21
22
|
import Container, { SortIcon, UnstyledButton } from "./styles";
|
|
22
23
|
import { SORT_DIRECTIONS } from "./constants";
|
|
24
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
25
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
26
|
+
import { createElement as _createElement } from "react";
|
|
23
27
|
export var TableHeaderCell = /*#__PURE__*/function (_React$Component) {
|
|
24
28
|
_inherits(TableHeaderCell, _React$Component);
|
|
25
29
|
function TableHeaderCell() {
|
|
@@ -37,11 +41,13 @@ export var TableHeaderCell = /*#__PURE__*/function (_React$Component) {
|
|
|
37
41
|
} else if (isSorted && sortDirection === SORT_DIRECTIONS.DESC) {
|
|
38
42
|
iconName = "caret-down-solid";
|
|
39
43
|
}
|
|
40
|
-
return /*#__PURE__*/
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
return /*#__PURE__*/_jsx(SortIcon, {
|
|
45
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
46
|
+
size: "mini",
|
|
47
|
+
name: iconName,
|
|
48
|
+
"aria-label": ariaSortDirection
|
|
49
|
+
})
|
|
50
|
+
});
|
|
45
51
|
});
|
|
46
52
|
// @ts-note: If this is set to an HTMLButtonElement event, then the `Container` freaks out
|
|
47
53
|
_defineProperty(_assertThisInitialized(_this), "handleClick", function (e) {
|
|
@@ -88,7 +94,7 @@ export var TableHeaderCell = /*#__PURE__*/function (_React$Component) {
|
|
|
88
94
|
onClick: this.handleClick
|
|
89
95
|
} : {};
|
|
90
96
|
var scope = colSpan ? "colgroup" : "col";
|
|
91
|
-
return /*#__PURE__*/
|
|
97
|
+
return /*#__PURE__*/_createElement(Container, _objectSpread(_objectSpread({}, rest), {}, {
|
|
92
98
|
key: id,
|
|
93
99
|
alignment: align || "left",
|
|
94
100
|
sortable: isSortable,
|
|
@@ -105,10 +111,13 @@ export var TableHeaderCell = /*#__PURE__*/function (_React$Component) {
|
|
|
105
111
|
,
|
|
106
112
|
color: color,
|
|
107
113
|
"aria-sort": ariaSort
|
|
108
|
-
}), isSortable ? /*#__PURE__*/
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
114
|
+
}), isSortable ? /*#__PURE__*/_jsx(UnstyledButton, _objectSpread(_objectSpread({}, buttonProps), {}, {
|
|
115
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
116
|
+
"aria-live": "polite",
|
|
117
|
+
role: "status",
|
|
118
|
+
children: [children || content, !children && this.getSortIcon(id === sortId, ariaSort)]
|
|
119
|
+
})
|
|
120
|
+
})) : children || content);
|
|
112
121
|
}
|
|
113
122
|
}]);
|
|
114
123
|
return TableHeaderCell;
|