@sproutsocial/racine 22.5.0 → 23.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/__flow__/Toast/Toast.flow.js +4 -0
- package/__flow__/types/theme.flow.js +1 -0
- package/commonjs/Avatar/Avatar.js +24 -16
- package/commonjs/Badge/Badge.js +20 -13
- package/commonjs/Banner/Banner.js +35 -25
- package/commonjs/Box/Box.js +7 -2
- package/commonjs/Breadcrumb/Breadcrumb.js +36 -23
- package/commonjs/Button/Button.js +11 -3
- package/commonjs/Card/Card.js +25 -18
- package/commonjs/Card/subComponents.js +32 -15
- package/commonjs/CharacterCounter/CharacterCounter.js +7 -3
- package/commonjs/ChartLegend/ChartLegend.js +10 -3
- package/commonjs/ChartLegend/useChartLabels.js +12 -10
- package/commonjs/Checkbox/Checkbox.js +55 -45
- package/commonjs/Checkbox/styles.js +20 -17
- package/commonjs/Collapsible/Collapsible.js +22 -16
- package/commonjs/DatePicker/DateRangePicker/DateRangePicker.js +26 -16
- package/commonjs/DatePicker/DateRangePicker/StatefulDateRangePicker.js +7 -2
- package/commonjs/DatePicker/SingleDatePicker/SingleDatePicker.js +24 -14
- package/commonjs/DatePicker/SingleDatePicker/StatefulSingleDatePicker.js +7 -2
- package/commonjs/DatePicker/common.js +8 -6
- package/commonjs/Drawer/Drawer.js +160 -113
- package/commonjs/EmptyState/EmptyState.js +44 -31
- package/commonjs/Fieldset/Fieldset.js +31 -14
- package/commonjs/FormField/FormField.js +37 -31
- package/commonjs/Icon/Icon.js +35 -30
- package/commonjs/Image/Image.js +5 -3
- package/commonjs/Indicator/Indicator.js +12 -6
- package/commonjs/Input/Input.js +57 -51
- package/commonjs/KeyboardKey/KeyboardKey.js +12 -3
- package/commonjs/Label/Label.js +15 -9
- package/commonjs/Link/Link.js +10 -3
- package/commonjs/Listbox/Listbox.js +16 -13
- package/commonjs/Loader/Loader.js +9 -3
- package/commonjs/LoaderButton/LoaderButton.js +28 -18
- package/commonjs/Menu/Menu.js +128 -107
- package/commonjs/Menu/utils/descendants.js +6 -6
- package/commonjs/Message/Message.js +79 -59
- package/commonjs/Modal/Modal.js +54 -31
- package/commonjs/Modal/styles.js +8 -4
- package/commonjs/Numeral/Numeral.js +27 -11
- package/commonjs/PartnerLogo/PartnerLogo.js +22 -12
- package/commonjs/Radio/Radio.js +28 -22
- package/commonjs/SegmentedControl/SegmentedControl.js +38 -24
- package/commonjs/Select/Select.js +32 -25
- package/commonjs/SpotIllustration/SpotIllustration.js +13 -5
- package/commonjs/Stack/Stack.js +15 -8
- package/commonjs/Switch/Switch.js +14 -7
- package/commonjs/Table/Table.js +65 -45
- package/commonjs/TableCell/TableCell.js +6 -3
- package/commonjs/TableHeaderCell/TableHeaderCell.js +20 -12
- package/commonjs/TableRowAccordion/TableRowAccordion.js +35 -29
- package/commonjs/Tabs/Tabs.js +37 -30
- package/commonjs/Text/Text.js +10 -3
- package/commonjs/Textarea/Textarea.js +37 -32
- package/commonjs/ThemeProvider/index.js +8 -5
- package/commonjs/Toast/Toast.js +127 -91
- package/commonjs/Toast/index.js +15 -15
- package/commonjs/Toast/styles.js +56 -30
- package/commonjs/ToggleHint/ToggleHint.js +11 -5
- package/commonjs/Token/Token.js +39 -25
- package/commonjs/TokenInput/TokenInput.js +55 -47
- package/commonjs/TokenInput/TokenScreenReaderStatus.js +5 -3
- package/commonjs/Tooltip/Tooltip.js +34 -27
- package/commonjs/themes/light/theme.js +1 -0
- package/dist/types/Drawer/Drawer.d.ts.map +1 -1
- package/dist/types/Drawer/DrawerTypes.d.ts +6 -3
- package/dist/types/Drawer/DrawerTypes.d.ts.map +1 -1
- package/dist/types/Listbox/ListboxTypes.d.ts +1 -1
- package/dist/types/Listbox/ListboxTypes.d.ts.map +1 -1
- package/dist/types/Menu/MenuTypes.d.ts +4 -4
- package/dist/types/Menu/MenuTypes.d.ts.map +1 -1
- package/dist/types/Message/MessageTypes.d.ts +1 -1
- package/dist/types/Message/MessageTypes.d.ts.map +1 -1
- package/dist/types/ThemeProvider/index.d.ts +1 -1
- package/dist/types/ThemeProvider/index.d.ts.map +1 -1
- package/dist/types/Toast/Toast.d.ts +23 -2
- package/dist/types/Toast/Toast.d.ts.map +1 -1
- package/dist/types/Toast/ToastTypes.d.ts +27 -13
- package/dist/types/Toast/ToastTypes.d.ts.map +1 -1
- package/dist/types/Toast/index.d.ts +2 -4
- package/dist/types/Toast/index.d.ts.map +1 -1
- package/dist/types/Toast/styles.d.ts +11 -15
- package/dist/types/Toast/styles.d.ts.map +1 -1
- package/dist/types/Tooltip/TooltipTypes.d.ts +2 -2
- package/dist/types/Tooltip/TooltipTypes.d.ts.map +1 -1
- package/dist/types/themes/dark/theme.d.ts +2 -0
- package/dist/types/themes/dark/theme.d.ts.map +1 -1
- package/dist/types/themes/light/theme.d.ts +3 -0
- package/dist/types/themes/light/theme.d.ts.map +1 -1
- package/dist/types/utils/react-testing-library.d.ts +61 -121
- package/dist/types/utils/react-testing-library.d.ts.map +1 -1
- package/lib/Avatar/Avatar.js +25 -16
- package/lib/Badge/Badge.js +22 -13
- package/lib/Banner/Banner.js +37 -25
- package/lib/Box/Box.js +8 -2
- package/lib/Breadcrumb/Breadcrumb.js +37 -23
- package/lib/Button/Button.js +11 -3
- package/lib/Card/Card.js +17 -8
- package/lib/Card/subComponents.js +35 -15
- package/lib/CharacterCounter/CharacterCounter.js +7 -3
- package/lib/ChartLegend/ChartLegend.js +11 -3
- package/lib/ChartLegend/useChartLabels.js +13 -10
- package/lib/Checkbox/Checkbox.js +56 -45
- package/lib/Checkbox/styles.js +20 -17
- package/lib/Collapsible/Collapsible.js +22 -16
- package/lib/DatePicker/DateRangePicker/DateRangePicker.js +29 -16
- package/lib/DatePicker/DateRangePicker/StatefulDateRangePicker.js +8 -2
- package/lib/DatePicker/SingleDatePicker/SingleDatePicker.js +27 -14
- package/lib/DatePicker/SingleDatePicker/StatefulSingleDatePicker.js +8 -2
- package/lib/DatePicker/common.js +8 -6
- package/lib/Drawer/Drawer.js +159 -111
- package/lib/EmptyState/EmptyState.js +46 -31
- package/lib/Fieldset/Fieldset.js +33 -14
- package/lib/FormField/FormField.js +38 -31
- package/lib/Icon/Icon.js +36 -30
- package/lib/Image/Image.js +5 -3
- package/lib/Indicator/Indicator.js +13 -6
- package/lib/Input/Input.js +57 -49
- package/lib/KeyboardKey/KeyboardKey.js +12 -3
- package/lib/Label/Label.js +16 -9
- package/lib/Link/Link.js +11 -3
- package/lib/Listbox/Listbox.js +17 -13
- package/lib/Loader/Loader.js +9 -3
- package/lib/LoaderButton/LoaderButton.js +30 -18
- package/lib/Menu/Menu.js +128 -104
- package/lib/Menu/utils/descendants.js +5 -4
- package/lib/Message/Message.js +80 -59
- package/lib/Modal/Modal.js +56 -31
- package/lib/Modal/styles.js +8 -2
- package/lib/Numeral/Numeral.js +30 -11
- package/lib/PartnerLogo/PartnerLogo.js +22 -12
- package/lib/Radio/Radio.js +29 -22
- package/lib/SegmentedControl/SegmentedControl.js +40 -24
- package/lib/Select/Select.js +33 -25
- package/lib/SpotIllustration/SpotIllustration.js +13 -5
- package/lib/Stack/Stack.js +17 -8
- package/lib/Switch/Switch.js +15 -7
- package/lib/Table/Table.js +65 -43
- package/lib/TableCell/TableCell.js +5 -2
- package/lib/TableHeaderCell/TableHeaderCell.js +20 -11
- package/lib/TableRowAccordion/TableRowAccordion.js +35 -28
- package/lib/Tabs/Tabs.js +37 -30
- package/lib/Text/Text.js +11 -3
- package/lib/Textarea/Textarea.js +37 -30
- package/lib/ThemeProvider/index.js +8 -3
- package/lib/Toast/Toast.js +130 -90
- package/lib/Toast/index.js +3 -5
- package/lib/Toast/styles.js +55 -26
- package/lib/ToggleHint/ToggleHint.js +12 -5
- package/lib/Token/Token.js +42 -25
- package/lib/TokenInput/TokenInput.js +56 -47
- package/lib/TokenInput/TokenScreenReaderStatus.js +5 -3
- package/lib/Tooltip/Tooltip.js +34 -27
- package/lib/themes/light/theme.js +1 -0
- package/package.json +37 -33
- package/commonjs/Drawer/SlideTransition.js +0 -47
- package/commonjs/Popout/Popout.js +0 -313
- package/commonjs/Popout/PopoutTypes.js +0 -5
- package/commonjs/Popout/index.js +0 -30
- package/commonjs/Popout/styles.js +0 -13
- package/dist/types/Drawer/SlideTransition.d.ts +0 -15
- package/dist/types/Drawer/SlideTransition.d.ts.map +0 -1
- package/dist/types/Popout/Popout.d.ts +0 -14
- package/dist/types/Popout/Popout.d.ts.map +0 -1
- package/dist/types/Popout/PopoutTypes.d.ts +0 -90
- package/dist/types/Popout/PopoutTypes.d.ts.map +0 -1
- package/dist/types/Popout/index.d.ts +0 -5
- package/dist/types/Popout/index.d.ts.map +0 -1
- package/dist/types/Popout/styles.d.ts +0 -2
- package/dist/types/Popout/styles.d.ts.map +0 -1
- package/lib/Drawer/SlideTransition.js +0 -38
- package/lib/Popout/Popout.js +0 -303
- package/lib/Popout/PopoutTypes.js +0 -1
- package/lib/Popout/index.js +0 -4
- package/lib/Popout/styles.js +0 -6
|
@@ -11,11 +11,16 @@ var _DayPickerSingleDateController = _interopRequireDefault(require("react-dates
|
|
|
11
11
|
var _styles = require("../styles");
|
|
12
12
|
var _common = require("../common");
|
|
13
13
|
var _VisuallyHidden = require("../../VisuallyHidden");
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
15
|
var _excluded = ["onDateChange", "setStatusText", "date", "focused", "onFocusChange", "initialVisibleMonth", "numberOfMonths", "onBlur"];
|
|
15
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
17
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
17
18
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
18
|
-
function
|
|
19
|
+
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; }
|
|
20
|
+
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; }
|
|
21
|
+
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; }
|
|
22
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
23
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
19
24
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
20
25
|
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."); }
|
|
21
26
|
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); }
|
|
@@ -55,18 +60,23 @@ var SingleDatePicker = function SingleDatePicker(_ref) {
|
|
|
55
60
|
});
|
|
56
61
|
onBlur === null || onBlur === void 0 || onBlur(event);
|
|
57
62
|
}, [onBlur, onFocusChange]);
|
|
58
|
-
return /*#__PURE__*/
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
63
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
64
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.ReactDatesCssOverrides, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_VisuallyHidden.VisuallyHidden, {
|
|
65
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
66
|
+
role: "status",
|
|
67
|
+
children: statusText
|
|
68
|
+
})
|
|
69
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_DayPickerSingleDateController.default, _objectSpread(_objectSpread({}, _common.commonDatePickerProps), {}, {
|
|
70
|
+
date: date,
|
|
71
|
+
numberOfMonths: numberOfMonths,
|
|
72
|
+
onDateChange: onDateChange,
|
|
73
|
+
initialVisibleMonth: initialVisibleMonth || null,
|
|
74
|
+
focused: focused,
|
|
75
|
+
onBlur: wrappedOnBlur,
|
|
76
|
+
onFocusChange: onFocusChange,
|
|
77
|
+
onPrevMonthClick: handleMonthClick,
|
|
78
|
+
onNextMonthClick: handleMonthClick
|
|
79
|
+
}, rest))]
|
|
80
|
+
});
|
|
71
81
|
};
|
|
72
82
|
var _default = exports.default = /*#__PURE__*/_react.default.memo(SingleDatePicker);
|
|
@@ -7,11 +7,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.StatefulSingleDatePicker = void 0;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _SingleDatePicker = _interopRequireDefault(require("./SingleDatePicker"));
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
11
|
var _excluded = ["date", "onDateChange"];
|
|
11
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
13
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
13
14
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
|
-
function
|
|
15
|
+
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; }
|
|
16
|
+
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; }
|
|
17
|
+
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; }
|
|
18
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
19
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
15
20
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
16
21
|
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."); }
|
|
17
22
|
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); }
|
|
@@ -32,7 +37,7 @@ var StatefulSingleDatePicker = exports.StatefulSingleDatePicker = function State
|
|
|
32
37
|
onDateChange && onDateChange(date);
|
|
33
38
|
setDate(date);
|
|
34
39
|
};
|
|
35
|
-
return /*#__PURE__*/
|
|
40
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_SingleDatePicker.default, _objectSpread({
|
|
36
41
|
date: stateDate,
|
|
37
42
|
onDateChange: handleDateChange
|
|
38
43
|
}, rest));
|
|
@@ -9,6 +9,7 @@ require("react-dates/lib/css/_datepicker.css");
|
|
|
9
9
|
var _react = _interopRequireDefault(require("react"));
|
|
10
10
|
var _Icon = _interopRequireDefault(require("../Icon"));
|
|
11
11
|
var _styles = require("./styles");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
14
|
var iconNames = {
|
|
14
15
|
left: "arrow-left-solid",
|
|
@@ -16,7 +17,7 @@ var iconNames = {
|
|
|
16
17
|
};
|
|
17
18
|
var CalendarNavButton = exports.CalendarNavButton = function CalendarNavButton(_ref) {
|
|
18
19
|
var type = _ref.type;
|
|
19
|
-
return /*#__PURE__*/
|
|
20
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
20
21
|
size: "mini",
|
|
21
22
|
name: iconNames[type],
|
|
22
23
|
"aria-hidden": true
|
|
@@ -25,17 +26,18 @@ var CalendarNavButton = exports.CalendarNavButton = function CalendarNavButton(_
|
|
|
25
26
|
var commonDatePickerProps = exports.commonDatePickerProps = {
|
|
26
27
|
hideKeyboardShortcutsPanel: true,
|
|
27
28
|
daySize: 30,
|
|
28
|
-
navPrev: /*#__PURE__*/
|
|
29
|
+
navPrev: /*#__PURE__*/(0, _jsxRuntime.jsx)(CalendarNavButton, {
|
|
29
30
|
type: "left"
|
|
30
31
|
}),
|
|
31
|
-
navNext: /*#__PURE__*/
|
|
32
|
+
navNext: /*#__PURE__*/(0, _jsxRuntime.jsx)(CalendarNavButton, {
|
|
32
33
|
type: "right"
|
|
33
34
|
}),
|
|
34
35
|
renderDayContents: function renderDayContents(day, modifiers) {
|
|
35
|
-
return /*#__PURE__*/
|
|
36
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.CalendarDay, {
|
|
36
37
|
day: day,
|
|
37
|
-
modifiers: modifiers
|
|
38
|
-
|
|
38
|
+
modifiers: modifiers,
|
|
39
|
+
children: day.format("D")
|
|
40
|
+
});
|
|
39
41
|
},
|
|
40
42
|
initialVisibleMonth: null
|
|
41
43
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
@@ -8,30 +7,54 @@ exports.default = void 0;
|
|
|
8
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
8
|
var React = _react;
|
|
10
9
|
var _reactFocusLock = _interopRequireDefault(require("react-focus-lock"));
|
|
11
|
-
var
|
|
10
|
+
var _web = require("@react-spring/web");
|
|
11
|
+
var _seedsMotionUnitless = require("@sproutsocial/seeds-motion/dist/seeds-motion-unitless");
|
|
12
12
|
var _Box = _interopRequireDefault(require("../Box"));
|
|
13
13
|
var _Button = _interopRequireDefault(require("../Button"));
|
|
14
14
|
var _Icon = _interopRequireDefault(require("../Icon"));
|
|
15
15
|
var _Text = _interopRequireDefault(require("../Text"));
|
|
16
16
|
var _Portal = _interopRequireDefault(require("../Portal"));
|
|
17
|
-
var _SlideTransition = require("./SlideTransition");
|
|
18
17
|
var _styles = _interopRequireWildcard(require("./styles"));
|
|
18
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
19
|
var _excluded = ["title", "id", "children", "render"],
|
|
20
20
|
_excluded2 = ["children"],
|
|
21
|
-
_excluded3 = ["id", "
|
|
21
|
+
_excluded3 = ["id", "offset", "direction", "children", "disableCloseOnClickOutside", "onClose", "zIndex", "closeTargets", "width", "focusLockExemptCheck", "isOpen"],
|
|
22
22
|
_excluded4 = ["children", "closeButtonLabel", "direction", "disableCloseOnClickOutside", "id", "isOpen", "offset", "onClose", "zIndex", "closeTargets", "width"];
|
|
23
23
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
24
24
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
25
25
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
26
|
+
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); }
|
|
27
|
+
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; }
|
|
28
|
+
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; }
|
|
26
29
|
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; }
|
|
27
30
|
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; }
|
|
28
31
|
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; }
|
|
29
32
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
30
|
-
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); }
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
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); } // eslint-disable-next-line import/no-deprecated
|
|
34
|
+
var useSlideTransition = function useSlideTransition(_ref) {
|
|
35
|
+
var isVisible = _ref.isVisible,
|
|
36
|
+
width = _ref.width,
|
|
37
|
+
direction = _ref.direction;
|
|
38
|
+
var offset = width * (direction === "left" ? -1 : 1);
|
|
39
|
+
return (0, _web.useTransition)(isVisible, {
|
|
40
|
+
from: {
|
|
41
|
+
opacity: 0,
|
|
42
|
+
x: offset
|
|
43
|
+
},
|
|
44
|
+
enter: {
|
|
45
|
+
opacity: 1,
|
|
46
|
+
x: 0
|
|
47
|
+
},
|
|
48
|
+
leave: {
|
|
49
|
+
opacity: 0,
|
|
50
|
+
x: offset
|
|
51
|
+
},
|
|
52
|
+
config: {
|
|
53
|
+
duration: _seedsMotionUnitless.MOTION_DURATION_MEDIUM * 1000
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
var AnimatedDrawer = (0, _web.animated)(_styles.default);
|
|
35
58
|
var doesRefContainEventTarget = function doesRefContainEventTarget(ref, event) {
|
|
36
59
|
return ref.current && event.target instanceof Node && ref.current.contains(event.target);
|
|
37
60
|
};
|
|
@@ -47,65 +70,65 @@ var DrawerCloseButton = function DrawerCloseButton(props) {
|
|
|
47
70
|
closeButtonLabel: closeButtonLabel
|
|
48
71
|
})) !== null && _props$render !== void 0 ? _props$render : null;
|
|
49
72
|
}
|
|
50
|
-
return /*#__PURE__*/
|
|
73
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, _objectSpread(_objectSpread({
|
|
51
74
|
appearance: "pill",
|
|
52
75
|
"aria-label": closeButtonLabel,
|
|
53
76
|
onClick: onClose
|
|
54
|
-
}, props),
|
|
55
|
-
|
|
56
|
-
|
|
77
|
+
}, props), {}, {
|
|
78
|
+
children: props.children || /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
79
|
+
"aria-hidden": true,
|
|
80
|
+
name: "x-outline"
|
|
81
|
+
})
|
|
57
82
|
}));
|
|
58
83
|
};
|
|
59
|
-
var DrawerHeader = function DrawerHeader(
|
|
60
|
-
var
|
|
61
|
-
title =
|
|
62
|
-
|
|
63
|
-
id =
|
|
64
|
-
children =
|
|
65
|
-
render =
|
|
66
|
-
rest = _objectWithoutProperties(
|
|
84
|
+
var DrawerHeader = function DrawerHeader(_ref2) {
|
|
85
|
+
var _ref2$title = _ref2.title,
|
|
86
|
+
title = _ref2$title === void 0 ? "" : _ref2$title,
|
|
87
|
+
_ref2$id = _ref2.id,
|
|
88
|
+
id = _ref2$id === void 0 ? undefined : _ref2$id,
|
|
89
|
+
children = _ref2.children,
|
|
90
|
+
render = _ref2.render,
|
|
91
|
+
rest = _objectWithoutProperties(_ref2, _excluded);
|
|
67
92
|
var drawerContext = (0, _react.useContext)(DrawerContext);
|
|
68
93
|
if (render) {
|
|
69
94
|
return render(drawerContext);
|
|
70
95
|
}
|
|
71
|
-
return /*#__PURE__*/
|
|
96
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, _objectSpread(_objectSpread({
|
|
72
97
|
display: "flex",
|
|
73
98
|
flex: "0 0 auto",
|
|
74
99
|
justifyContent: "space-between",
|
|
75
100
|
alignItems: "center",
|
|
76
101
|
pt: 400,
|
|
77
102
|
px: 450
|
|
78
|
-
}, rest),
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
103
|
+
}, rest), {}, {
|
|
104
|
+
children: children || /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
|
|
105
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.default, {
|
|
106
|
+
as: "h2",
|
|
107
|
+
fontSize: 400,
|
|
108
|
+
fontWeight: "semibold",
|
|
109
|
+
color: "text.headline",
|
|
110
|
+
id: id,
|
|
111
|
+
children: title
|
|
112
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(DrawerCloseButton, {})]
|
|
113
|
+
})
|
|
114
|
+
}));
|
|
85
115
|
};
|
|
86
|
-
var DrawerContent = function DrawerContent(
|
|
87
|
-
var children =
|
|
88
|
-
rest = _objectWithoutProperties(
|
|
89
|
-
return /*#__PURE__*/
|
|
116
|
+
var DrawerContent = function DrawerContent(_ref3) {
|
|
117
|
+
var children = _ref3.children,
|
|
118
|
+
rest = _objectWithoutProperties(_ref3, _excluded2);
|
|
119
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Content, _objectSpread(_objectSpread({
|
|
90
120
|
height: "100%",
|
|
91
121
|
p: 450,
|
|
92
122
|
color: "text.body"
|
|
93
|
-
}, rest),
|
|
123
|
+
}, rest), {}, {
|
|
124
|
+
children: children
|
|
125
|
+
}));
|
|
94
126
|
};
|
|
95
|
-
var
|
|
96
|
-
var
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
children = _ref3.children,
|
|
101
|
-
disableCloseOnClickOutside = _ref3.disableCloseOnClickOutside,
|
|
102
|
-
onClose = _ref3.onClose,
|
|
103
|
-
zIndex = _ref3.zIndex,
|
|
104
|
-
closeTargets = _ref3.closeTargets,
|
|
105
|
-
width = _ref3.width,
|
|
106
|
-
focusLockExemptCheck = _ref3.focusLockExemptCheck,
|
|
107
|
-
rest = _objectWithoutProperties(_ref3, _excluded3);
|
|
108
|
-
var drawerRef = (0, _react.useRef)(null);
|
|
127
|
+
var useCloseOnBodyClick = function useCloseOnBodyClick(_ref4) {
|
|
128
|
+
var ref = _ref4.ref,
|
|
129
|
+
disableCloseOnClickOutside = _ref4.disableCloseOnClickOutside,
|
|
130
|
+
onClose = _ref4.onClose,
|
|
131
|
+
closeTargets = _ref4.closeTargets;
|
|
109
132
|
(0, _react.useEffect)(function () {
|
|
110
133
|
var documentBody = document.body;
|
|
111
134
|
if (!documentBody) {
|
|
@@ -117,7 +140,7 @@ var Drawer = function Drawer(_ref3) {
|
|
|
117
140
|
}
|
|
118
141
|
};
|
|
119
142
|
var bodyClick = function bodyClick(event) {
|
|
120
|
-
if (!doesRefContainEventTarget(
|
|
143
|
+
if (!doesRefContainEventTarget(ref, event) && !disableCloseOnClickOutside) {
|
|
121
144
|
onClose();
|
|
122
145
|
}
|
|
123
146
|
};
|
|
@@ -153,75 +176,99 @@ var Drawer = function Drawer(_ref3) {
|
|
|
153
176
|
});
|
|
154
177
|
}
|
|
155
178
|
};
|
|
156
|
-
}, [onClose, disableCloseOnClickOutside, closeTargets]);
|
|
157
|
-
|
|
158
|
-
|
|
179
|
+
}, [onClose, disableCloseOnClickOutside, closeTargets, ref]);
|
|
180
|
+
};
|
|
181
|
+
var Drawer = function Drawer(_ref5) {
|
|
182
|
+
var id = _ref5.id,
|
|
183
|
+
offset = _ref5.offset,
|
|
184
|
+
direction = _ref5.direction,
|
|
185
|
+
children = _ref5.children,
|
|
186
|
+
disableCloseOnClickOutside = _ref5.disableCloseOnClickOutside,
|
|
187
|
+
onClose = _ref5.onClose,
|
|
188
|
+
zIndex = _ref5.zIndex,
|
|
189
|
+
closeTargets = _ref5.closeTargets,
|
|
190
|
+
width = _ref5.width,
|
|
191
|
+
focusLockExemptCheck = _ref5.focusLockExemptCheck,
|
|
192
|
+
isOpen = _ref5.isOpen,
|
|
193
|
+
rest = _objectWithoutProperties(_ref5, _excluded3);
|
|
194
|
+
var ref = (0, _react.useRef)(null);
|
|
195
|
+
useCloseOnBodyClick({
|
|
196
|
+
ref: ref,
|
|
197
|
+
disableCloseOnClickOutside: disableCloseOnClickOutside,
|
|
198
|
+
onClose: onClose,
|
|
199
|
+
closeTargets: closeTargets
|
|
200
|
+
});
|
|
201
|
+
var transition = useSlideTransition({
|
|
202
|
+
isVisible: isOpen,
|
|
203
|
+
width: width,
|
|
204
|
+
direction: direction
|
|
205
|
+
});
|
|
206
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFocusLock.default, {
|
|
159
207
|
autoFocus: true,
|
|
160
208
|
returnFocus: true,
|
|
161
209
|
whiteList: focusLockExemptCheck ? function (e) {
|
|
162
210
|
return !focusLockExemptCheck(e);
|
|
163
|
-
} : undefined
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
211
|
+
} : undefined,
|
|
212
|
+
children: transition(function (style, isVisible) {
|
|
213
|
+
return isVisible ? /*#__PURE__*/(0, _jsxRuntime.jsx)(AnimatedDrawer, _objectSpread(_objectSpread({
|
|
214
|
+
ref: ref,
|
|
215
|
+
style: _objectSpread(_objectSpread({}, style), {}, {
|
|
216
|
+
zIndex: zIndex
|
|
217
|
+
}),
|
|
218
|
+
width: width,
|
|
219
|
+
offset: offset,
|
|
220
|
+
direction: direction,
|
|
221
|
+
"data-qa-drawer": id,
|
|
222
|
+
role: "dialog"
|
|
223
|
+
}, rest), {}, {
|
|
224
|
+
children: children
|
|
225
|
+
})) : null;
|
|
226
|
+
})
|
|
227
|
+
}, id);
|
|
173
228
|
};
|
|
174
|
-
var DrawerContainer = function DrawerContainer(
|
|
175
|
-
var children =
|
|
176
|
-
closeButtonLabel =
|
|
177
|
-
|
|
178
|
-
direction =
|
|
179
|
-
|
|
180
|
-
disableCloseOnClickOutside =
|
|
181
|
-
id =
|
|
182
|
-
isOpen =
|
|
183
|
-
|
|
184
|
-
offset =
|
|
185
|
-
onClose =
|
|
186
|
-
|
|
187
|
-
zIndex =
|
|
188
|
-
|
|
189
|
-
closeTargets =
|
|
190
|
-
|
|
191
|
-
width =
|
|
192
|
-
rest = _objectWithoutProperties(
|
|
193
|
-
return /*#__PURE__*/
|
|
194
|
-
id: id
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
onClose: onClose,
|
|
218
|
-
zIndex: zIndex,
|
|
219
|
-
closeTargets: closeTargets,
|
|
220
|
-
width: width,
|
|
221
|
-
"data-qa-drawer": id || "",
|
|
222
|
-
"data-qa-drawer-isopen": isOpen === true
|
|
223
|
-
}, rest), children);
|
|
224
|
-
})));
|
|
229
|
+
var DrawerContainer = function DrawerContainer(_ref6) {
|
|
230
|
+
var children = _ref6.children,
|
|
231
|
+
closeButtonLabel = _ref6.closeButtonLabel,
|
|
232
|
+
_ref6$direction = _ref6.direction,
|
|
233
|
+
direction = _ref6$direction === void 0 ? "right" : _ref6$direction,
|
|
234
|
+
_ref6$disableCloseOnC = _ref6.disableCloseOnClickOutside,
|
|
235
|
+
disableCloseOnClickOutside = _ref6$disableCloseOnC === void 0 ? false : _ref6$disableCloseOnC,
|
|
236
|
+
id = _ref6.id,
|
|
237
|
+
isOpen = _ref6.isOpen,
|
|
238
|
+
_ref6$offset = _ref6.offset,
|
|
239
|
+
offset = _ref6$offset === void 0 ? 0 : _ref6$offset,
|
|
240
|
+
onClose = _ref6.onClose,
|
|
241
|
+
_ref6$zIndex = _ref6.zIndex,
|
|
242
|
+
zIndex = _ref6$zIndex === void 0 ? 7 : _ref6$zIndex,
|
|
243
|
+
_ref6$closeTargets = _ref6.closeTargets,
|
|
244
|
+
closeTargets = _ref6$closeTargets === void 0 ? [] : _ref6$closeTargets,
|
|
245
|
+
_ref6$width = _ref6.width,
|
|
246
|
+
width = _ref6$width === void 0 ? 600 : _ref6$width,
|
|
247
|
+
rest = _objectWithoutProperties(_ref6, _excluded4);
|
|
248
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Portal.default, {
|
|
249
|
+
id: id,
|
|
250
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(DrawerContext.Provider, {
|
|
251
|
+
value: {
|
|
252
|
+
onClose: onClose,
|
|
253
|
+
closeButtonLabel: closeButtonLabel
|
|
254
|
+
},
|
|
255
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Drawer, _objectSpread(_objectSpread({
|
|
256
|
+
isOpen: isOpen,
|
|
257
|
+
id: id,
|
|
258
|
+
offset: offset,
|
|
259
|
+
direction: direction,
|
|
260
|
+
disableCloseOnClickOutside: disableCloseOnClickOutside,
|
|
261
|
+
onClose: onClose,
|
|
262
|
+
zIndex: zIndex,
|
|
263
|
+
closeTargets: closeTargets,
|
|
264
|
+
width: width,
|
|
265
|
+
"data-qa-drawer": id || "",
|
|
266
|
+
"data-qa-drawer-isopen": isOpen
|
|
267
|
+
}, rest), {}, {
|
|
268
|
+
children: children
|
|
269
|
+
}))
|
|
270
|
+
})
|
|
271
|
+
});
|
|
225
272
|
};
|
|
226
273
|
DrawerHeader.displayName = "Drawer.Header";
|
|
227
274
|
DrawerContent.displayName = "Drawer.Content";
|
|
@@ -8,11 +8,16 @@ exports.default = void 0;
|
|
|
8
8
|
var React = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _Box = _interopRequireDefault(require("../Box"));
|
|
10
10
|
var _Text = _interopRequireDefault(require("../Text"));
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
12
|
var _excluded = ["media", "headline", "subtext", "primaryAction", "secondaryAction"]; // eslint-disable-next-line import/no-deprecated
|
|
12
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
14
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
14
15
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
15
|
-
function
|
|
16
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
17
|
+
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; }
|
|
18
|
+
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; }
|
|
19
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
20
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
16
21
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
17
22
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
18
23
|
var EmptyState = function EmptyState(_ref) {
|
|
@@ -22,38 +27,46 @@ var EmptyState = function EmptyState(_ref) {
|
|
|
22
27
|
primaryAction = _ref.primaryAction,
|
|
23
28
|
secondaryAction = _ref.secondaryAction,
|
|
24
29
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
25
|
-
return /*#__PURE__*/
|
|
30
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, _objectSpread(_objectSpread({
|
|
26
31
|
maxWidth: "400px",
|
|
27
32
|
mx: "auto",
|
|
28
33
|
"data-qa-emptystate": headline
|
|
29
|
-
}, rest),
|
|
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
|
-
|
|
34
|
+
}, rest), {}, {
|
|
35
|
+
children: [media && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
36
|
+
display: "flex",
|
|
37
|
+
flexDirection: "column",
|
|
38
|
+
justifyContent: "center",
|
|
39
|
+
mb: 450,
|
|
40
|
+
children: media
|
|
41
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Text.default, {
|
|
42
|
+
as: "div",
|
|
43
|
+
textAlign: "center",
|
|
44
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.default, {
|
|
45
|
+
as: "p",
|
|
46
|
+
m: 0,
|
|
47
|
+
color: "text.headline",
|
|
48
|
+
fontWeight: "semibold",
|
|
49
|
+
fontSize: 400,
|
|
50
|
+
children: headline
|
|
51
|
+
}), subtext && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.default, {
|
|
52
|
+
as: "p",
|
|
53
|
+
color: "text.subtext",
|
|
54
|
+
fontSize: 200,
|
|
55
|
+
mb: 0,
|
|
56
|
+
mt: 400,
|
|
57
|
+
children: subtext
|
|
58
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
59
|
+
mt: primaryAction || secondaryAction ? 450 : 0,
|
|
60
|
+
children: [primaryAction && /*#__PURE__*/React.cloneElement(primaryAction, {
|
|
61
|
+
appearance: "primary"
|
|
62
|
+
}), secondaryAction && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
63
|
+
mt: 400,
|
|
64
|
+
children: /*#__PURE__*/React.cloneElement(secondaryAction, {
|
|
65
|
+
appearance: "unstyled"
|
|
66
|
+
})
|
|
67
|
+
})]
|
|
68
|
+
})]
|
|
69
|
+
})]
|
|
70
|
+
}));
|
|
58
71
|
};
|
|
59
72
|
var _default = exports.default = EmptyState;
|