@sproutsocial/racine 22.5.1 → 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 +12 -0
- 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 +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/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/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/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/package.json +37 -33
- package/commonjs/Drawer/SlideTransition.js +0 -47
- package/commonjs/Popout/Popout.js +0 -313
- package/commonjs/Popout/PopoutTypes.js +0 -5
- package/commonjs/Popout/index.js +0 -30
- package/commonjs/Popout/styles.js +0 -13
- package/dist/types/Drawer/SlideTransition.d.ts +0 -15
- package/dist/types/Drawer/SlideTransition.d.ts.map +0 -1
- package/dist/types/Popout/Popout.d.ts +0 -14
- package/dist/types/Popout/Popout.d.ts.map +0 -1
- package/dist/types/Popout/PopoutTypes.d.ts +0 -90
- package/dist/types/Popout/PopoutTypes.d.ts.map +0 -1
- package/dist/types/Popout/index.d.ts +0 -5
- package/dist/types/Popout/index.d.ts.map +0 -1
- package/dist/types/Popout/styles.d.ts +0 -2
- package/dist/types/Popout/styles.d.ts.map +0 -1
- package/lib/Drawer/SlideTransition.js +0 -38
- package/lib/Popout/Popout.js +0 -303
- package/lib/Popout/PopoutTypes.js +0 -1
- package/lib/Popout/index.js +0 -4
- package/lib/Popout/styles.js +0 -6
package/lib/Message/Message.js
CHANGED
|
@@ -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 = ["children", "density", "borderColor", "bg", "indentContent", "innerRef", "qa"];
|
|
2
|
-
function
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
3
8
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
9
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
5
10
|
import * as React from "react";
|
|
@@ -8,6 +13,7 @@ import Button from "../Button";
|
|
|
8
13
|
import Checkbox from "@sproutsocial/seeds-react-checkbox";
|
|
9
14
|
import Container, { MessageBody as StyledMessageBody, MessageFooter as StyledMessageFooter, MessageHeader as StyledMessageHeader, MessageMeta as StyledMessageMeta } from "./styles";
|
|
10
15
|
import { MESSAGE_DENSITIES } from "./constants";
|
|
16
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
17
|
var avatarSizeMap = function avatarSizeMap(density) {
|
|
12
18
|
switch (density) {
|
|
13
19
|
case MESSAGE_DENSITIES.LARGE:
|
|
@@ -40,101 +46,116 @@ var Message = function Message(_ref) {
|
|
|
40
46
|
innerRef = _ref.innerRef,
|
|
41
47
|
qa = _ref.qa,
|
|
42
48
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
43
|
-
return /*#__PURE__*/
|
|
49
|
+
return /*#__PURE__*/_jsx(MessageContext.Provider, {
|
|
44
50
|
value: {
|
|
45
51
|
density: density,
|
|
46
52
|
borderColor: borderColor,
|
|
47
53
|
indentContent: indentContent
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
54
|
+
},
|
|
55
|
+
children: /*#__PURE__*/_jsx(Container, _objectSpread(_objectSpread(_objectSpread({
|
|
56
|
+
borderColor: borderColor,
|
|
57
|
+
bg: bg,
|
|
58
|
+
ref: innerRef,
|
|
59
|
+
tabIndex: 0
|
|
60
|
+
}, qa), rest), {}, {
|
|
61
|
+
children: children
|
|
62
|
+
}))
|
|
63
|
+
});
|
|
55
64
|
};
|
|
56
65
|
var MessageBody = function MessageBody(props) {
|
|
57
|
-
return /*#__PURE__*/
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
66
|
+
return /*#__PURE__*/_jsx(MessageContext.Consumer, {
|
|
67
|
+
children: function children(_ref2) {
|
|
68
|
+
var density = _ref2.density,
|
|
69
|
+
borderColor = _ref2.borderColor,
|
|
70
|
+
indentContent = _ref2.indentContent;
|
|
71
|
+
return /*#__PURE__*/_jsx(StyledMessageBody, _objectSpread({
|
|
72
|
+
"data-qa-message-body": true,
|
|
73
|
+
density: density,
|
|
74
|
+
borderColor: borderColor,
|
|
75
|
+
indentContent: indentContent
|
|
76
|
+
}, props));
|
|
77
|
+
}
|
|
67
78
|
});
|
|
68
79
|
};
|
|
69
80
|
MessageBody.displayName = "Message.Body";
|
|
70
81
|
Message.Body = MessageBody;
|
|
71
82
|
var MessageHeader = function MessageHeader(props) {
|
|
72
|
-
return /*#__PURE__*/
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
83
|
+
return /*#__PURE__*/_jsx(MessageContext.Consumer, {
|
|
84
|
+
children: function children(_ref3) {
|
|
85
|
+
var density = _ref3.density,
|
|
86
|
+
borderColor = _ref3.borderColor;
|
|
87
|
+
return /*#__PURE__*/_jsx(StyledMessageHeader, _objectSpread({
|
|
88
|
+
density: density,
|
|
89
|
+
borderColor: borderColor
|
|
90
|
+
}, props));
|
|
91
|
+
}
|
|
79
92
|
});
|
|
80
93
|
};
|
|
81
94
|
MessageHeader.displayName = "Message.Header";
|
|
82
95
|
Message.Header = MessageHeader;
|
|
83
96
|
var MessageFooter = function MessageFooter(props) {
|
|
84
|
-
return /*#__PURE__*/
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
97
|
+
return /*#__PURE__*/_jsx(MessageContext.Consumer, {
|
|
98
|
+
children: function children(_ref4) {
|
|
99
|
+
var density = _ref4.density,
|
|
100
|
+
borderColor = _ref4.borderColor,
|
|
101
|
+
indentContent = _ref4.indentContent;
|
|
102
|
+
return /*#__PURE__*/_jsx(StyledMessageFooter, _objectSpread({
|
|
103
|
+
density: density,
|
|
104
|
+
borderColor: borderColor,
|
|
105
|
+
indentContent: indentContent
|
|
106
|
+
}, props));
|
|
107
|
+
}
|
|
93
108
|
});
|
|
94
109
|
};
|
|
95
110
|
MessageFooter.displayName = "Message.Footer";
|
|
96
111
|
Message.Footer = MessageFooter;
|
|
97
112
|
var MessageMeta = function MessageMeta(props) {
|
|
98
|
-
return /*#__PURE__*/
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
113
|
+
return /*#__PURE__*/_jsx(MessageContext.Consumer, {
|
|
114
|
+
children: function children(_ref5) {
|
|
115
|
+
var density = _ref5.density,
|
|
116
|
+
borderColor = _ref5.borderColor,
|
|
117
|
+
indentContent = _ref5.indentContent;
|
|
118
|
+
return /*#__PURE__*/_jsx(StyledMessageMeta, _objectSpread({
|
|
119
|
+
density: density,
|
|
120
|
+
borderColor: borderColor,
|
|
121
|
+
indentContent: indentContent
|
|
122
|
+
}, props));
|
|
123
|
+
}
|
|
107
124
|
});
|
|
108
125
|
};
|
|
109
126
|
MessageMeta.displayName = "Message.Meta";
|
|
110
127
|
Message.Meta = MessageMeta;
|
|
111
128
|
var MessageButton = function MessageButton(props) {
|
|
112
|
-
return /*#__PURE__*/
|
|
129
|
+
return /*#__PURE__*/_jsx(Button, _objectSpread(_objectSpread({}, props), {}, {
|
|
113
130
|
appearance: props.appearance || "pill"
|
|
114
131
|
}));
|
|
115
132
|
};
|
|
116
133
|
MessageButton.displayName = "Message.Button";
|
|
117
134
|
Message.Button = MessageButton;
|
|
118
135
|
var MessageAvatar = function MessageAvatar(props) {
|
|
119
|
-
return /*#__PURE__*/
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
136
|
+
return /*#__PURE__*/_jsx(MessageContext.Consumer, {
|
|
137
|
+
children: function children(_ref6) {
|
|
138
|
+
var density = _ref6.density;
|
|
139
|
+
return /*#__PURE__*/_jsx(Avatar, _objectSpread({
|
|
140
|
+
size: avatarSizeMap(density)
|
|
141
|
+
}, props));
|
|
142
|
+
}
|
|
124
143
|
});
|
|
125
144
|
};
|
|
126
145
|
MessageAvatar.displayName = "Message.Avatar";
|
|
127
146
|
Message.Avatar = MessageAvatar;
|
|
128
147
|
var MessageCheckbox = function MessageCheckbox(props) {
|
|
129
|
-
return /*#__PURE__*/
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
148
|
+
return /*#__PURE__*/_jsx(MessageContext.Consumer, {
|
|
149
|
+
children: function children(_ref7) {
|
|
150
|
+
var density = _ref7.density;
|
|
151
|
+
return /*#__PURE__*/_jsx(Checkbox, _objectSpread({
|
|
152
|
+
appearance: "pill"
|
|
153
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
154
|
+
// @ts-ignore - `density` is not a valid prop for `Checkbox`
|
|
155
|
+
,
|
|
156
|
+
density: density // @ts-notes - not sure what's intended here so address during refactor
|
|
157
|
+
}, props));
|
|
158
|
+
}
|
|
138
159
|
});
|
|
139
160
|
};
|
|
140
161
|
MessageCheckbox.displayName = "Message.Checkbox";
|
package/lib/Modal/Modal.js
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
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 = ["title", "subtitle", "children", "bordered"],
|
|
2
3
|
_excluded2 = ["children"],
|
|
3
4
|
_excluded3 = ["appElementSelector", "children", "isOpen", "label", "onClose", "closeButtonLabel", "width", "zIndex"];
|
|
4
|
-
function
|
|
5
|
+
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; }
|
|
6
|
+
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; }
|
|
7
|
+
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; }
|
|
8
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
9
|
+
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); }
|
|
5
10
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
6
11
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
7
12
|
import * as React from "react";
|
|
@@ -11,6 +16,8 @@ import Button from "../Button";
|
|
|
11
16
|
import Icon from "../Icon";
|
|
12
17
|
import Text from "../Text";
|
|
13
18
|
import { Container, Content, Header, Footer, Body } from "./styles";
|
|
19
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
21
|
var ModalContext = /*#__PURE__*/React.createContext({});
|
|
15
22
|
var ModalHeader = function ModalHeader(props) {
|
|
16
23
|
var title = props.title,
|
|
@@ -18,37 +25,48 @@ var ModalHeader = function ModalHeader(props) {
|
|
|
18
25
|
children = props.children,
|
|
19
26
|
bordered = props.bordered,
|
|
20
27
|
rest = _objectWithoutProperties(props, _excluded);
|
|
21
|
-
return /*#__PURE__*/
|
|
28
|
+
return /*#__PURE__*/_jsx(Header, _objectSpread(_objectSpread({
|
|
22
29
|
bordered: title || subtitle || bordered
|
|
23
|
-
}, rest),
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
}, rest), {}, {
|
|
31
|
+
children: children ? children : /*#__PURE__*/_jsxs(React.Fragment, {
|
|
32
|
+
children: [/*#__PURE__*/_jsxs(Box, {
|
|
33
|
+
children: [title && /*#__PURE__*/_jsx(Text, {
|
|
34
|
+
as: "h1",
|
|
35
|
+
fontSize: 400,
|
|
36
|
+
fontWeight: "semibold",
|
|
37
|
+
children: title
|
|
38
|
+
}), subtitle && /*#__PURE__*/_jsx(Text, {
|
|
39
|
+
as: "div",
|
|
40
|
+
fontSize: 200,
|
|
41
|
+
children: subtitle
|
|
42
|
+
})]
|
|
43
|
+
}), /*#__PURE__*/_jsx(Box, {
|
|
44
|
+
display: "flex",
|
|
45
|
+
alignItems: "center",
|
|
46
|
+
"justify-content": "flex-end",
|
|
47
|
+
children: /*#__PURE__*/_jsx(ModalCloseButton, {
|
|
48
|
+
ml: 400
|
|
49
|
+
})
|
|
50
|
+
})]
|
|
51
|
+
})
|
|
52
|
+
}));
|
|
37
53
|
};
|
|
38
54
|
var ModalCloseButton = function ModalCloseButton(props) {
|
|
39
55
|
var _useContext = useContext(ModalContext),
|
|
40
56
|
onClose = _useContext.onClose,
|
|
41
57
|
closeButtonLabel = _useContext.closeButtonLabel;
|
|
42
58
|
if (!onClose) return null;
|
|
43
|
-
return /*#__PURE__*/
|
|
59
|
+
return /*#__PURE__*/_jsx(Button, _objectSpread(_objectSpread({
|
|
44
60
|
onClick: onClose
|
|
45
|
-
}, props),
|
|
46
|
-
|
|
47
|
-
|
|
61
|
+
}, props), {}, {
|
|
62
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
63
|
+
name: "x-outline",
|
|
64
|
+
ariaLabel: closeButtonLabel
|
|
65
|
+
})
|
|
48
66
|
}));
|
|
49
67
|
};
|
|
50
68
|
var ModalFooter = function ModalFooter(props) {
|
|
51
|
-
return /*#__PURE__*/
|
|
69
|
+
return /*#__PURE__*/_jsx(Footer, _objectSpread({
|
|
52
70
|
borderTop: 500,
|
|
53
71
|
borderColor: "container.border.base"
|
|
54
72
|
}, props));
|
|
@@ -61,11 +79,13 @@ var ModalContent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
61
79
|
rest = _objectWithoutProperties(_ref, _excluded2);
|
|
62
80
|
var _useContext2 = useContext(ModalContext),
|
|
63
81
|
label = _useContext2.label;
|
|
64
|
-
return /*#__PURE__*/
|
|
82
|
+
return /*#__PURE__*/_jsx(Content, _objectSpread(_objectSpread({
|
|
65
83
|
"data-qa-modal": true,
|
|
66
84
|
"data-qa-label": label,
|
|
67
85
|
ref: ref
|
|
68
|
-
}, rest),
|
|
86
|
+
}, rest), {}, {
|
|
87
|
+
children: children
|
|
88
|
+
}));
|
|
69
89
|
});
|
|
70
90
|
|
|
71
91
|
/**
|
|
@@ -83,7 +103,7 @@ var Modal = function Modal(props) {
|
|
|
83
103
|
rest = _objectWithoutProperties(props, _excluded3);
|
|
84
104
|
var isCloseable = Boolean(onClose);
|
|
85
105
|
var appElement = appElementSelector && document ? document.querySelector(appElementSelector) : undefined;
|
|
86
|
-
return /*#__PURE__*/
|
|
106
|
+
return /*#__PURE__*/_jsx(Container, _objectSpread(_objectSpread({
|
|
87
107
|
appElement: appElement,
|
|
88
108
|
ariaHideApp: !!appElement,
|
|
89
109
|
isOpen: isOpen,
|
|
@@ -103,13 +123,18 @@ var Modal = function Modal(props) {
|
|
|
103
123
|
"qa-modal": "",
|
|
104
124
|
"qa-modal-isopen": isOpen
|
|
105
125
|
}
|
|
106
|
-
}, rest),
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
126
|
+
}, rest), {}, {
|
|
127
|
+
children: /*#__PURE__*/_jsxs(React.Fragment, {
|
|
128
|
+
children: [/*#__PURE__*/_jsx(Body, {}), /*#__PURE__*/_jsx(ModalContext.Provider, {
|
|
129
|
+
value: {
|
|
130
|
+
onClose: onClose,
|
|
131
|
+
closeButtonLabel: closeButtonLabel,
|
|
132
|
+
label: label
|
|
133
|
+
},
|
|
134
|
+
children: children
|
|
135
|
+
})]
|
|
136
|
+
})
|
|
137
|
+
}));
|
|
113
138
|
};
|
|
114
139
|
Modal.defaultProps = {
|
|
115
140
|
width: "800px",
|
package/lib/Modal/styles.js
CHANGED
|
@@ -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 = ["className"];
|
|
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";
|
|
@@ -10,6 +15,7 @@ import { COMMON } from "@sproutsocial/seeds-react-system-props";
|
|
|
10
15
|
import Box from "../Box";
|
|
11
16
|
|
|
12
17
|
// This is the max space allowed between the modal and the edge of the browser
|
|
18
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
19
|
var BODY_PADDING = "64px";
|
|
14
20
|
var ReactModalAdapter = function ReactModalAdapter(_ref) {
|
|
15
21
|
var _ref$className = _ref.className,
|
|
@@ -24,7 +30,7 @@ var ReactModalAdapter = function ReactModalAdapter(_ref) {
|
|
|
24
30
|
var overlayClassName = className.split(" ").map(function (className) {
|
|
25
31
|
return "".concat(className, " ").concat(className, "__Overlay");
|
|
26
32
|
}).join(" ");
|
|
27
|
-
return /*#__PURE__*/
|
|
33
|
+
return /*#__PURE__*/_jsx(ReactModal, _objectSpread({
|
|
28
34
|
portalClassName: className,
|
|
29
35
|
className: contentClassName,
|
|
30
36
|
overlayClassName: overlayClassName
|
package/lib/Numeral/Numeral.js
CHANGED
|
@@ -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 = ["number", "locale", "format", "currency", "abbreviate", "invalidNumberLabel", "precision", "qa"];
|
|
2
|
-
function
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
3
8
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
9
|
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."); }
|
|
5
10
|
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); }
|
|
@@ -15,6 +20,9 @@ import Tooltip from "../Tooltip";
|
|
|
15
20
|
import { VisuallyHidden } from "../VisuallyHidden";
|
|
16
21
|
import { DEFAULT_THRESHOLD, MEMO_CACHE_SIZE, COMPARE_OBJECTS, MAX_PRECISION, ABBREV_PRECISION, DefaultPrecisions } from "./constants";
|
|
17
22
|
import { AbbrContainer, Container } from "./styles";
|
|
23
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
25
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
26
|
var _getNumberFormatters = function _getNumberFormatters(options) {
|
|
19
27
|
var locale = options.locale,
|
|
20
28
|
format = options.format,
|
|
@@ -113,12 +121,18 @@ var Numeral = function Numeral(props) {
|
|
|
113
121
|
options = _normalizeArgs.options,
|
|
114
122
|
qa = _normalizeArgs.qa,
|
|
115
123
|
rest = _normalizeArgs.rest;
|
|
116
|
-
if (!isValidNumber(props.number)) return /*#__PURE__*/
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
124
|
+
if (!isValidNumber(props.number)) return /*#__PURE__*/_jsxs(_Fragment, {
|
|
125
|
+
children: [invalidNumberLabel &&
|
|
126
|
+
/*#__PURE__*/
|
|
127
|
+
// Give screen readers something useful to read off + hide the em dash
|
|
128
|
+
_jsx(VisuallyHidden, {
|
|
129
|
+
children: invalidNumberLabel
|
|
130
|
+
}), /*#__PURE__*/_jsx(Container, _objectSpread(_objectSpread({
|
|
131
|
+
"aria-hidden": true
|
|
132
|
+
}, qa), {}, {
|
|
133
|
+
children: EM_DASH
|
|
134
|
+
}))]
|
|
135
|
+
});
|
|
122
136
|
var formatters = getNumberFormatters(options);
|
|
123
137
|
var fullText = formatters.standard.format(value);
|
|
124
138
|
if (canAbbreviate) {
|
|
@@ -130,11 +144,16 @@ var Numeral = function Numeral(props) {
|
|
|
130
144
|
// The following check is necessary because each locale may have differing thresholds
|
|
131
145
|
// for which abbreviation begins.
|
|
132
146
|
if (abbreviatedText !== fullText) {
|
|
133
|
-
return /*#__PURE__*/
|
|
134
|
-
content: fullText
|
|
135
|
-
|
|
147
|
+
return /*#__PURE__*/_jsx(Tooltip, {
|
|
148
|
+
content: fullText,
|
|
149
|
+
children: /*#__PURE__*/_jsx(AbbrContainer, _objectSpread(_objectSpread(_objectSpread({}, qa), rest), {}, {
|
|
150
|
+
children: abbreviatedText
|
|
151
|
+
}))
|
|
152
|
+
});
|
|
136
153
|
}
|
|
137
154
|
}
|
|
138
|
-
return /*#__PURE__*/
|
|
155
|
+
return /*#__PURE__*/_jsx(Container, _objectSpread(_objectSpread(_objectSpread({}, qa), rest), {}, {
|
|
156
|
+
children: fullText
|
|
157
|
+
}));
|
|
139
158
|
};
|
|
140
159
|
export default Numeral;
|
|
@@ -1,11 +1,17 @@
|
|
|
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 = ["partnerName", "backgroundType", "logoType", "height", "width", "size", "aria-label", "svgProps"];
|
|
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";
|
|
6
11
|
import { useTheme } from "styled-components";
|
|
7
12
|
import Container from "./styles";
|
|
8
13
|
import { ViewBoxes } from "@sproutsocial/seeds-partner-logos";
|
|
14
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
15
|
var whichLogo = function whichLogo(_ref, mode) {
|
|
10
16
|
var backgroundType = _ref.backgroundType,
|
|
11
17
|
logoType = _ref.logoType,
|
|
@@ -43,8 +49,8 @@ var PartnerLogo = function PartnerLogo(_ref2) {
|
|
|
43
49
|
var viewBoxCoordinates = (logoViewBox === null || logoViewBox === void 0 ? void 0 : logoViewBox.split(" ")) || [];
|
|
44
50
|
var defaultWidth = viewBoxCoordinates[2];
|
|
45
51
|
var defaultHeight = viewBoxCoordinates[3];
|
|
46
|
-
return /*#__PURE__*/
|
|
47
|
-
,
|
|
52
|
+
return /*#__PURE__*/_jsx(Container //we add pixels here because view box coordinates are numbers
|
|
53
|
+
, _objectSpread(_objectSpread({
|
|
48
54
|
height: height ? height : defaultHeight + "px",
|
|
49
55
|
width: width ? width : defaultWidth + "px",
|
|
50
56
|
logoSize: size,
|
|
@@ -52,14 +58,18 @@ var PartnerLogo = function PartnerLogo(_ref2) {
|
|
|
52
58
|
role: "img",
|
|
53
59
|
"aria-label": ariaLabel,
|
|
54
60
|
"data-qa-logo": partnerName
|
|
55
|
-
}, rest),
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
}, rest), {}, {
|
|
62
|
+
children: /*#__PURE__*/_jsx("svg", _objectSpread(_objectSpread({
|
|
63
|
+
className: "logo-svg",
|
|
64
|
+
viewBox: logoViewBox,
|
|
65
|
+
focusable: false,
|
|
66
|
+
"data-qa-logo-svg": "".concat(partnerName, "-svg")
|
|
67
|
+
}, svgProps), {}, {
|
|
68
|
+
children: /*#__PURE__*/_jsx("use", {
|
|
69
|
+
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
70
|
+
xlinkHref: "#seeds-svgs_".concat(logo)
|
|
71
|
+
})
|
|
72
|
+
}))
|
|
73
|
+
}));
|
|
64
74
|
};
|
|
65
75
|
export default PartnerLogo;
|
package/lib/Radio/Radio.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
var _excluded = ["id", "value", "name", "label", "checked", "disabled", "onChange", "onFocus", "onBlur", "ariaLabel", "qa", "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"); } }
|
|
@@ -18,6 +19,8 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
18
19
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
19
20
|
import * as React from "react";
|
|
20
21
|
import Container, { Input, InputWrapper, LabelText } from "./styles";
|
|
22
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
23
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
24
|
/**
|
|
22
25
|
* Primitive Radio Element
|
|
23
26
|
*/
|
|
@@ -66,33 +69,37 @@ var Radio = /*#__PURE__*/function (_React$Component) {
|
|
|
66
69
|
qa = _this$props$qa === void 0 ? {} : _this$props$qa,
|
|
67
70
|
color = _this$props.color,
|
|
68
71
|
rest = _objectWithoutProperties(_this$props, _excluded);
|
|
69
|
-
return /*#__PURE__*/
|
|
72
|
+
return /*#__PURE__*/_jsxs(Container, _objectSpread(_objectSpread({
|
|
70
73
|
as: label && "label"
|
|
71
74
|
// TODO: fix this type since `color` should be valid here. TS can't resolve the correct type.
|
|
72
75
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
73
76
|
// @ts-ignore
|
|
74
77
|
,
|
|
75
78
|
color: color
|
|
76
|
-
}, rest),
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
79
|
+
}, rest), {}, {
|
|
80
|
+
children: [/*#__PURE__*/_jsx(InputWrapper, {
|
|
81
|
+
checked: checked,
|
|
82
|
+
disabled: disabled,
|
|
83
|
+
children: /*#__PURE__*/_jsx(Input, _objectSpread({
|
|
84
|
+
type: "radio",
|
|
85
|
+
id: id,
|
|
86
|
+
"aria-label": ariaLabel,
|
|
87
|
+
value: value,
|
|
88
|
+
name: name,
|
|
89
|
+
checked: checked,
|
|
90
|
+
disabled: disabled,
|
|
91
|
+
onChange: this.handleChange,
|
|
92
|
+
onFocus: this.handleFocus,
|
|
93
|
+
onBlur: this.handleBlur,
|
|
94
|
+
"data-qa-radio": name || "",
|
|
95
|
+
"data-qa-radio-ischecked": checked === true,
|
|
96
|
+
"data-qa-radio-isdisabled": disabled === true
|
|
97
|
+
}, qa))
|
|
98
|
+
}), label && /*#__PURE__*/_jsx(LabelText, {
|
|
99
|
+
disabled: disabled,
|
|
100
|
+
children: label
|
|
101
|
+
})]
|
|
102
|
+
}));
|
|
96
103
|
}
|
|
97
104
|
}]);
|
|
98
105
|
return Radio;
|