@sproutsocial/racine 20.11.0 → 20.12.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__/LogoViewBoxes.js +2 -2
- package/commonjs/Input/Input.js +17 -3
- package/commonjs/LogoViewBoxes.js +2 -2
- package/commonjs/Menu/Menu.js +41 -37
- package/commonjs/Modal/styles.js +1 -1
- package/dist/logo.svg +1 -1
- package/dist/types/Input/Input.d.ts +1 -0
- package/dist/types/Input/Input.d.ts.map +1 -1
- package/dist/types/Listbox/Listbox.d.ts +1 -1
- package/dist/types/Menu/Menu.d.ts +1 -1
- package/dist/types/Menu/Menu.d.ts.map +1 -1
- package/lib/Input/Input.js +17 -3
- package/lib/LogoViewBoxes.js +2 -2
- package/lib/Menu/Menu.js +41 -37
- package/lib/Modal/styles.js +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 20.12.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- e83d2eb4f: - Update the default `Input` type for `MenuFilterInput` to 'search'
|
|
8
|
+
- Fix race condition bug which fails to update the `Input` value when using the clear button on search inputs
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- b3be51600: Remove whitespace from border of threads partner logo
|
|
13
|
+
- b52ca03cc: Fix border-radius for modals to use 8px instead of 6px
|
|
14
|
+
|
|
3
15
|
## 20.11.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
|
@@ -83,8 +83,8 @@ module.exports = {
|
|
|
83
83
|
"tableau-lockup-dark": "0 0 291 56",
|
|
84
84
|
"tableau-lockup": "0 0 291 56",
|
|
85
85
|
"tableau": "0 0 18 18",
|
|
86
|
-
"threads-dark": "0 0
|
|
87
|
-
"threads": "0 0
|
|
86
|
+
"threads-dark": "0 0 18 18",
|
|
87
|
+
"threads": "0 0 18 18",
|
|
88
88
|
"tiktok-dark": "0 0 140 159",
|
|
89
89
|
"tiktok": "0 0 140 159",
|
|
90
90
|
"tripadvisor-dark": "0 0 140 140",
|
package/commonjs/Input/Input.js
CHANGED
|
@@ -114,15 +114,19 @@ var Input = /*#__PURE__*/function (_React$Component) {
|
|
|
114
114
|
});
|
|
115
115
|
input.dispatchEvent(inputEvent);
|
|
116
116
|
|
|
117
|
-
//
|
|
118
|
-
input.focus();
|
|
119
|
-
_this.updateState('');
|
|
117
|
+
// call any onClear callback
|
|
120
118
|
(_this$props$onClear = (_this$props2 = _this.props).onClear) === null || _this$props$onClear === void 0 || _this$props$onClear.call(_this$props2, e);
|
|
119
|
+
|
|
120
|
+
// wait for next cycle to update focus
|
|
121
|
+
setTimeout(function () {
|
|
122
|
+
input.focus();
|
|
123
|
+
}, 0);
|
|
121
124
|
}
|
|
122
125
|
});
|
|
123
126
|
_defineProperty(_assertThisInitialized(_this), "handleChange", function (e) {
|
|
124
127
|
var _this$props$onChange, _this$props3;
|
|
125
128
|
(_this$props$onChange = (_this$props3 = _this.props).onChange) === null || _this$props$onChange === void 0 || _this$props$onChange.call(_this$props3, e, e.currentTarget.value);
|
|
129
|
+
// needed for uncontrolled inputs
|
|
126
130
|
_this.updateState(e.currentTarget.value);
|
|
127
131
|
});
|
|
128
132
|
_defineProperty(_assertThisInitialized(_this), "handleFocus", function (e) {
|
|
@@ -160,6 +164,16 @@ var Input = /*#__PURE__*/function (_React$Component) {
|
|
|
160
164
|
return _this;
|
|
161
165
|
}
|
|
162
166
|
_createClass(Input, [{
|
|
167
|
+
key: "componentDidUpdate",
|
|
168
|
+
value: function componentDidUpdate(_ref) {
|
|
169
|
+
var prevValue = _ref.value;
|
|
170
|
+
// Update hasValue state whenever props value changes
|
|
171
|
+
var value = this.props.value;
|
|
172
|
+
if (value !== prevValue) {
|
|
173
|
+
this.updateState(value || '');
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}, {
|
|
163
177
|
key: "render",
|
|
164
178
|
value: function render() {
|
|
165
179
|
var _this$props8 = this.props,
|
|
@@ -85,8 +85,8 @@ module.exports = {
|
|
|
85
85
|
"tableau-lockup-dark": "0 0 291 56",
|
|
86
86
|
"tableau-lockup": "0 0 291 56",
|
|
87
87
|
"tableau": "0 0 18 18",
|
|
88
|
-
"threads-dark": "0 0
|
|
89
|
-
"threads": "0 0
|
|
88
|
+
"threads-dark": "0 0 18 18",
|
|
89
|
+
"threads": "0 0 18 18",
|
|
90
90
|
"tiktok-dark": "0 0 140 159",
|
|
91
91
|
"tiktok": "0 0 140 159",
|
|
92
92
|
"tripadvisor-dark": "0 0 140 140",
|
package/commonjs/Menu/Menu.js
CHANGED
|
@@ -25,9 +25,10 @@ var _styles = require("./styles");
|
|
|
25
25
|
var _excluded = ["id", "index", "as", "children", "role", "elemBefore", "elemAfter", "value", "onKeyPress", "onClick", "selected", "disabled", "indeterminate", "label"],
|
|
26
26
|
_excluded2 = ["placement", "labelProps", "switchProps", "children", "id", "label"],
|
|
27
27
|
_excluded3 = ["children", "title", "titleAs", "disabled"],
|
|
28
|
-
_excluded4 = ["
|
|
29
|
-
_excluded5 = ["
|
|
30
|
-
_excluded6 = ["
|
|
28
|
+
_excluded4 = ["type"],
|
|
29
|
+
_excluded5 = ["children", "role", "multiselect", "innerRef"],
|
|
30
|
+
_excluded6 = ["role", "children", "onChange", "value", "multiselect", "innerRef", "footerContent"],
|
|
31
|
+
_excluded7 = ["content", "popoutProps", "children", "onClick", "closeOnItemClick", "id", "placement", "isOpen", "setIsOpen"];
|
|
31
32
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
32
33
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
33
34
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -350,8 +351,10 @@ var MenuDivider = function MenuDivider(props) {
|
|
|
350
351
|
}, props));
|
|
351
352
|
};
|
|
352
353
|
exports.MenuDivider = MenuDivider;
|
|
353
|
-
var MenuFilterInput = function MenuFilterInput(
|
|
354
|
-
|
|
354
|
+
var MenuFilterInput = function MenuFilterInput(_ref7) {
|
|
355
|
+
var _ref7$type = _ref7.type,
|
|
356
|
+
type = _ref7$type === void 0 ? 'search' : _ref7$type,
|
|
357
|
+
props = _objectWithoutProperties(_ref7, _excluded4);
|
|
355
358
|
var onChange = props.onChange,
|
|
356
359
|
onFocus = props.onFocus,
|
|
357
360
|
onBlur = props.onBlur;
|
|
@@ -377,18 +380,19 @@ var MenuFilterInput = function MenuFilterInput(props) {
|
|
|
377
380
|
});
|
|
378
381
|
}, [setState, onBlur]);
|
|
379
382
|
return /*#__PURE__*/React.createElement(_Input.default, _extends({}, props, {
|
|
383
|
+
type: type,
|
|
380
384
|
value: state.filterQuery,
|
|
381
385
|
onChange: handleOnChange,
|
|
382
386
|
onFocus: handleOnFocus,
|
|
383
387
|
onBlur: handleOnBlur
|
|
384
388
|
}));
|
|
385
389
|
};
|
|
386
|
-
var MenuItems = function MenuItems(
|
|
387
|
-
var children =
|
|
388
|
-
role =
|
|
389
|
-
multiselect =
|
|
390
|
-
innerRef =
|
|
391
|
-
props = _objectWithoutProperties(
|
|
390
|
+
var MenuItems = function MenuItems(_ref8) {
|
|
391
|
+
var children = _ref8.children,
|
|
392
|
+
role = _ref8.role,
|
|
393
|
+
multiselect = _ref8.multiselect,
|
|
394
|
+
innerRef = _ref8.innerRef,
|
|
395
|
+
props = _objectWithoutProperties(_ref8, _excluded5);
|
|
392
396
|
var _useMenuKeyDown = (0, _utils.useMenuKeyDown)(),
|
|
393
397
|
handleKeyDown = _useMenuKeyDown.handleKeyDown,
|
|
394
398
|
activeDescendent = _useMenuKeyDown.activeDescendent;
|
|
@@ -408,8 +412,8 @@ var MenuItems = function MenuItems(_ref7) {
|
|
|
408
412
|
overflow: "hidden"
|
|
409
413
|
}), children);
|
|
410
414
|
};
|
|
411
|
-
var MenuFooter = function MenuFooter(
|
|
412
|
-
var children =
|
|
415
|
+
var MenuFooter = function MenuFooter(_ref9) {
|
|
416
|
+
var children = _ref9.children;
|
|
413
417
|
var _useContext5 = (0, React.useContext)(_utils.MenuContext),
|
|
414
418
|
setState = _useContext5.setState;
|
|
415
419
|
var handleOnBlur = (0, React.useCallback)(function () {
|
|
@@ -427,16 +431,16 @@ var MenuFooter = function MenuFooter(_ref8) {
|
|
|
427
431
|
onFocus: handleOnFocus
|
|
428
432
|
}, children);
|
|
429
433
|
};
|
|
430
|
-
var Menu = function Menu(
|
|
431
|
-
var
|
|
432
|
-
role =
|
|
433
|
-
children =
|
|
434
|
-
onChange =
|
|
435
|
-
value =
|
|
436
|
-
multiselect =
|
|
437
|
-
innerRef =
|
|
438
|
-
footerContent =
|
|
439
|
-
props = _objectWithoutProperties(
|
|
434
|
+
var Menu = function Menu(_ref10) {
|
|
435
|
+
var _ref10$role = _ref10.role,
|
|
436
|
+
role = _ref10$role === void 0 ? _utils.MENU_ROLES.MENU : _ref10$role,
|
|
437
|
+
children = _ref10.children,
|
|
438
|
+
onChange = _ref10.onChange,
|
|
439
|
+
value = _ref10.value,
|
|
440
|
+
multiselect = _ref10.multiselect,
|
|
441
|
+
innerRef = _ref10.innerRef,
|
|
442
|
+
footerContent = _ref10.footerContent,
|
|
443
|
+
props = _objectWithoutProperties(_ref10, _excluded6);
|
|
440
444
|
var _useDescendants = (0, _utils.useDescendants)(),
|
|
441
445
|
_useDescendants2 = _slicedToArray(_useDescendants, 2),
|
|
442
446
|
descendants = _useDescendants2[0],
|
|
@@ -499,20 +503,20 @@ var CustomPopoutContent = (0, _styledComponents.default)(_Popout.default.Content
|
|
|
499
503
|
displayName: "Menu__CustomPopoutContent",
|
|
500
504
|
componentId: "sc-1jmjosz-2"
|
|
501
505
|
})(["padding:0;margin-left:0;margin-right:0;"]);
|
|
502
|
-
var MenuButton = function MenuButton(
|
|
503
|
-
var content =
|
|
504
|
-
popoutProps =
|
|
505
|
-
children =
|
|
506
|
-
_onClick =
|
|
507
|
-
|
|
508
|
-
closeOnItemClick =
|
|
509
|
-
|
|
510
|
-
id =
|
|
511
|
-
|
|
512
|
-
placement =
|
|
513
|
-
isOpen =
|
|
514
|
-
setIsOpen =
|
|
515
|
-
props = _objectWithoutProperties(
|
|
506
|
+
var MenuButton = function MenuButton(_ref11) {
|
|
507
|
+
var content = _ref11.content,
|
|
508
|
+
popoutProps = _ref11.popoutProps,
|
|
509
|
+
children = _ref11.children,
|
|
510
|
+
_onClick = _ref11.onClick,
|
|
511
|
+
_ref11$closeOnItemCli = _ref11.closeOnItemClick,
|
|
512
|
+
closeOnItemClick = _ref11$closeOnItemCli === void 0 ? true : _ref11$closeOnItemCli,
|
|
513
|
+
_ref11$id = _ref11.id,
|
|
514
|
+
id = _ref11$id === void 0 ? (0, _lodash.default)('MenuButton-') : _ref11$id,
|
|
515
|
+
_ref11$placement = _ref11.placement,
|
|
516
|
+
placement = _ref11$placement === void 0 ? 'bottom' : _ref11$placement,
|
|
517
|
+
isOpen = _ref11.isOpen,
|
|
518
|
+
setIsOpen = _ref11.setIsOpen,
|
|
519
|
+
props = _objectWithoutProperties(_ref11, _excluded7);
|
|
516
520
|
var _useState5 = (0, React.useState)(false),
|
|
517
521
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
518
522
|
isInternalShown = _useState6[0],
|
package/commonjs/Modal/styles.js
CHANGED
|
@@ -53,7 +53,7 @@ var Container = (0, _styledComponents.default)(ReactModalAdapter).withConfig({
|
|
|
53
53
|
}, _styledSystem.zIndex, function (props) {
|
|
54
54
|
return props.theme.colors.container.background.base;
|
|
55
55
|
}, function (props) {
|
|
56
|
-
return props.theme.radii[
|
|
56
|
+
return props.theme.radii[600];
|
|
57
57
|
}, function (props) {
|
|
58
58
|
return props.theme.shadows.medium;
|
|
59
59
|
}, function (props) {
|