@sproutsocial/racine 20.5.0 → 20.7.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 +57 -0
- package/__flow__/EnumLogoNames.flow.js +1 -1
- package/__flow__/Listbox/Listbox.flow.js +1 -0
- package/__flow__/LogoViewBoxes.js +2 -0
- package/__flow__/Menu/Menu.flow.js +25 -0
- package/commonjs/Listbox/Listbox.js +1 -0
- package/commonjs/LogoViewBoxes.js +2 -0
- package/commonjs/Menu/Menu.js +67 -15
- package/commonjs/Menu/styles.js +6 -1
- package/commonjs/Menu/utils/hooks.js +1 -1
- package/commonjs/logoNames.js +1 -1
- package/dist/logo.svg +1 -1
- package/dist/logoList.js +1 -1
- package/dist/types/EnumLogoNames.d.ts +1 -1
- package/dist/types/EnumLogoNames.d.ts.map +1 -1
- package/dist/types/Listbox/Listbox.d.ts +4 -0
- package/dist/types/Listbox/Listbox.d.ts.map +1 -1
- package/dist/types/Menu/Menu.d.ts +9 -1
- package/dist/types/Menu/Menu.d.ts.map +1 -1
- package/dist/types/Menu/MenuTypes.d.ts +13 -0
- package/dist/types/Menu/MenuTypes.d.ts.map +1 -1
- package/dist/types/Menu/styles.d.ts.map +1 -1
- package/dist/types/Menu/utils/hooks.d.ts.map +1 -1
- package/dist/types/PartnerLogo/PartnerLogoTypes.d.ts +1 -1
- package/dist/types/PartnerLogo/PartnerLogoTypes.d.ts.map +1 -1
- package/dist/types/logoNames.d.ts +1 -1
- package/dist/types/logoNames.d.ts.map +1 -1
- package/lib/Listbox/Listbox.js +1 -0
- package/lib/LogoViewBoxes.js +2 -0
- package/lib/Menu/Menu.js +65 -14
- package/lib/Menu/styles.js +6 -1
- package/lib/Menu/utils/hooks.js +1 -1
- package/lib/logoNames.js +1 -1
- package/package.json +2 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,62 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 20.7.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 0c09b39cc: Adding Threads logo in light and dark versions
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- 7989c088f: Fix `Menu` keyboard functionality to not select disabled menu item
|
|
12
|
+
|
|
13
|
+
## 20.6.0
|
|
14
|
+
|
|
15
|
+
### Minor Changes
|
|
16
|
+
|
|
17
|
+
- 75ca2857b: Adds Menu.Switch subcomponent to Menu and Listbox
|
|
18
|
+
|
|
19
|
+
- Including a Switch in a Menu by passing it as a Menu.Item's children or elemAfter is not accessible for keyboard users.
|
|
20
|
+
- The new Menu.Switch component allows a consumer to use a Switch in a Menu while retaining keyboard accessibility.
|
|
21
|
+
- Like the Menu.Checkbox and Menu.Radio subcomponents, Menu.Switch should be used in place of a Menu.Item, not as a Menu.Item's children, elemBefore, or elemAfter.
|
|
22
|
+
- The placement of the Switch, i.e., in `elemBefore` or `elemAfter`, is determined by the `placement` prop.
|
|
23
|
+
- The text that serves as a label for the Switch can be passed into Menu.Switch as the `children` or `label` prop. Menu will handle programmatically associating the text with the Switch. You should not wrap the text in a Label component.
|
|
24
|
+
- Listbox is a variant of Menu; the same changes and guidelines apply to Listbox.
|
|
25
|
+
|
|
26
|
+
Simplified example migration:
|
|
27
|
+
|
|
28
|
+
### Before
|
|
29
|
+
|
|
30
|
+
```javascript
|
|
31
|
+
<Menu>
|
|
32
|
+
<Menu.Item>
|
|
33
|
+
<Label htmlFor="switch-id">Switch label</Label>
|
|
34
|
+
<Switch id="switch-id" onClick={handleClick} checked={selected} />
|
|
35
|
+
</Menu.Item>
|
|
36
|
+
</Menu>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### After
|
|
40
|
+
|
|
41
|
+
```javascript
|
|
42
|
+
<Menu>
|
|
43
|
+
<Menu.Switch
|
|
44
|
+
id="switch-id"
|
|
45
|
+
placement="after"
|
|
46
|
+
onClick={handleClick}
|
|
47
|
+
selected={selected}
|
|
48
|
+
>
|
|
49
|
+
Switch label
|
|
50
|
+
</Menu.Switch>
|
|
51
|
+
</Menu>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
- bc2935791: Add X (Twitter) logo to partner logos
|
|
55
|
+
|
|
56
|
+
### Patch Changes
|
|
57
|
+
|
|
58
|
+
- bc2935791: Upgrade @babel/traverse
|
|
59
|
+
|
|
3
60
|
## 20.5.0
|
|
4
61
|
|
|
5
62
|
### Minor Changes
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @flow
|
|
2
|
-
export type EnumLogoNames = "adobe-experience-manager" | "android" | "apple-app-store" | "apple" | "bigcommerce" | "bitly" | "bynder" | "canva" | "dropbox" | "facebook-audience-network" | "facebook" | "facebook-groups" | "facebook-shops" | "feedly" | "github" | "glassdoor" | "google-analytics" | "google-business-messages" | "google-drive" | "google-my-business" | "google-play-store" | "hubspot" | "instagram" | "linkedin-audience-network" | "linkedin" | "marketo" | "messenger" | "microsoft-dynamics" | "pinterest" | "reddit" | "salesforce-cloud" | "salesforce" | "shopify" | "slack" | "sproutsocial" | "tableau" | "tiktok" | "tripadvisor" | "tumblr" | "twitter-audience-network" | "twitter" | "whatsapp" | "woocommerce" | "x-twitter" | "yelp" | "youtube" | "zendesk";
|
|
2
|
+
export type EnumLogoNames = "adobe-experience-manager" | "android" | "apple-app-store" | "apple" | "bigcommerce" | "bitly" | "bynder" | "canva" | "dropbox" | "facebook-audience-network" | "facebook" | "facebook-groups" | "facebook-shops" | "feedly" | "github" | "glassdoor" | "google-analytics" | "google-business-messages" | "google-drive" | "google-my-business" | "google-play-store" | "hubspot" | "instagram" | "linkedin-audience-network" | "linkedin" | "marketo" | "messenger" | "microsoft-dynamics" | "pinterest" | "reddit" | "salesforce-cloud" | "salesforce" | "shopify" | "slack" | "sproutsocial" | "tableau" | "threads" | "tiktok" | "tripadvisor" | "tumblr" | "twitter-audience-network" | "twitter" | "whatsapp" | "woocommerce" | "x-twitter" | "yelp" | "youtube" | "zendesk";
|
|
@@ -25,6 +25,7 @@ declare class Listbox extends React.Component<TypeListboxProps> {
|
|
|
25
25
|
static Checkbox: typeof Menu.Checkbox,
|
|
26
26
|
static Radio: typeof Menu.Radio,
|
|
27
27
|
static Group: typeof Menu.Group,
|
|
28
|
+
static Switch: typeof Menu.Switch,
|
|
28
29
|
static Divider: typeof Menu.Divider,
|
|
29
30
|
static FilterInput: typeof Menu.FilterInput,
|
|
30
31
|
}
|
|
@@ -83,6 +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 24 24",
|
|
87
|
+
"threads": "0 0 24 24",
|
|
86
88
|
"tiktok-dark": "0 0 140 159",
|
|
87
89
|
"tiktok": "0 0 140 159",
|
|
88
90
|
"tripadvisor-dark": "0 0 140 140",
|
|
@@ -6,6 +6,8 @@ import Button from "../Button/index.flow";
|
|
|
6
6
|
import Popout from "../Popout/index.flow";
|
|
7
7
|
import type { TypeInputProps } from "../Input/index.flow";
|
|
8
8
|
import type { EnumPlacements } from "../Popout/index.flow";
|
|
9
|
+
import type { TypeSwitchProps } from "../Switch/index.flow";
|
|
10
|
+
import type { TypeTextProps } from "../Text/index.flow";
|
|
9
11
|
import type { TypeTheme } from "../types/theme.flow";
|
|
10
12
|
import type { TypeWithDisplayName } from "../types/shared.flow";
|
|
11
13
|
import type { TypeStyledComponentsCommonProps } from "../types/styled-components.flow";
|
|
@@ -65,6 +67,27 @@ export type TypeMenuItemProps = {
|
|
|
65
67
|
alignItems?: string,
|
|
66
68
|
...
|
|
67
69
|
};
|
|
70
|
+
export type TypeMenuItemSwitchProps = {
|
|
71
|
+
...TypeMenuItemProps,
|
|
72
|
+
/** Determines whether the Switch will be rendered as elemBefore or elemAfter. */
|
|
73
|
+
placement: 'before' | 'after',
|
|
74
|
+
/** Pass any valid Text props except children to the label.
|
|
75
|
+
* children is omitted because Menu.Switch's children is rendered as the label's children.*/
|
|
76
|
+
labelProps?: {
|
|
77
|
+
...TypeTextProps,
|
|
78
|
+
children: void,
|
|
79
|
+
...
|
|
80
|
+
},
|
|
81
|
+
/** Pass any valid Switch props except onClick to the Switch.
|
|
82
|
+
* onClick is omitted because it would only be triggered when the Switch itself is clicked with a mouse.
|
|
83
|
+
* The top-level onClick prop, which will be triggered for a click or keypress anywhere on the Menu Item, should be used instead. */
|
|
84
|
+
switchProps?: {
|
|
85
|
+
...TypeSwitchProps,
|
|
86
|
+
onClick: void,
|
|
87
|
+
...
|
|
88
|
+
},
|
|
89
|
+
...
|
|
90
|
+
};
|
|
68
91
|
export type TypeMenuGroupProps = {
|
|
69
92
|
children: React.Node,
|
|
70
93
|
/** If provided, a visible title will be rendered for the group. */
|
|
@@ -101,6 +124,7 @@ declare export var MenuGroup: TypeWithDisplayName<React.StatelessFunctionalCompo
|
|
|
101
124
|
declare export var MenuItem: TypeWithDisplayName<React.StatelessFunctionalComponent<TypeMenuItemProps>>;
|
|
102
125
|
declare export var MenuCheckbox: TypeWithDisplayName<React.StatelessFunctionalComponent<TypeMenuItemProps>>;
|
|
103
126
|
declare export var MenuRadio: TypeWithDisplayName<React.StatelessFunctionalComponent<TypeMenuItemProps>>;
|
|
127
|
+
declare export var MenuSwitch: TypeWithDisplayName<React.StatelessFunctionalComponent<TypeMenuItemSwitchProps>>;
|
|
104
128
|
declare export var MenuDivider: TypeWithDisplayName<React.StatelessFunctionalComponent<any>>;
|
|
105
129
|
declare var MenuFilterInput: TypeWithDisplayName<React.StatelessFunctionalComponent<TypeInputProps>>;
|
|
106
130
|
declare class Menu extends React.Component<TypeMenuProps> {
|
|
@@ -108,6 +132,7 @@ declare class Menu extends React.Component<TypeMenuProps> {
|
|
|
108
132
|
static Item: typeof MenuItem,
|
|
109
133
|
static Checkbox: typeof MenuCheckbox,
|
|
110
134
|
static Radio: typeof MenuRadio,
|
|
135
|
+
static Switch: typeof MenuSwitch,
|
|
111
136
|
static Divider: typeof MenuDivider,
|
|
112
137
|
static FilterInput: typeof MenuFilterInput,
|
|
113
138
|
}
|
|
@@ -110,6 +110,7 @@ exports.ListboxButton = ListboxButton;
|
|
|
110
110
|
Listbox.Option = Listbox.Item = _Menu.default.Item;
|
|
111
111
|
Listbox.Checkbox = _Menu.default.Checkbox;
|
|
112
112
|
Listbox.Radio = _Menu.default.Radio;
|
|
113
|
+
Listbox.Switch = _Menu.default.Switch;
|
|
113
114
|
Listbox.Group = _Menu.default.Group;
|
|
114
115
|
Listbox.Divider = _Menu.default.Divider;
|
|
115
116
|
Listbox.FilterInput = _Menu.default.FilterInput;
|
|
@@ -85,6 +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 24 24",
|
|
89
|
+
"threads": "0 0 24 24",
|
|
88
90
|
"tiktok-dark": "0 0 140 159",
|
|
89
91
|
"tiktok": "0 0 140 159",
|
|
90
92
|
"tripadvisor-dark": "0 0 140 140",
|
package/commonjs/Menu/Menu.js
CHANGED
|
@@ -4,7 +4,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.default = exports.MenuRadio = exports.MenuItem = exports.MenuGroup = exports.MenuDivider = exports.MenuCheckbox = exports.MenuButton = exports.Menu = void 0;
|
|
7
|
+
exports.default = exports.MenuSwitch = exports.MenuRadio = exports.MenuItem = exports.MenuGroup = exports.MenuDivider = exports.MenuCheckbox = exports.MenuButton = exports.Menu = void 0;
|
|
8
8
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
9
9
|
var React = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _lodash = _interopRequireDefault(require("lodash.uniqueid"));
|
|
@@ -18,14 +18,16 @@ var _Icon = _interopRequireDefault(require("../Icon"));
|
|
|
18
18
|
var _Input = _interopRequireDefault(require("../Input"));
|
|
19
19
|
var _Popout = _interopRequireDefault(require("../Popout"));
|
|
20
20
|
var _Radio = _interopRequireDefault(require("../Radio"));
|
|
21
|
+
var _Switch = _interopRequireDefault(require("../Switch"));
|
|
21
22
|
var _Text = _interopRequireDefault(require("../Text"));
|
|
22
23
|
var _utils = require("./utils");
|
|
23
24
|
var _styles = require("./styles");
|
|
24
25
|
var _excluded = ["id", "index", "as", "children", "role", "elemBefore", "elemAfter", "value", "onKeyPress", "onClick", "selected", "disabled", "indeterminate", "label"],
|
|
25
|
-
_excluded2 = ["
|
|
26
|
-
_excluded3 = ["children", "
|
|
27
|
-
_excluded4 = ["
|
|
28
|
-
_excluded5 = ["
|
|
26
|
+
_excluded2 = ["placement", "labelProps", "switchProps", "children", "id", "label"],
|
|
27
|
+
_excluded3 = ["children", "title", "titleAs", "disabled"],
|
|
28
|
+
_excluded4 = ["children", "role", "multiselect", "innerRef"],
|
|
29
|
+
_excluded5 = ["role", "children", "onChange", "value", "multiselect", "innerRef", "footerContent"],
|
|
30
|
+
_excluded6 = ["content", "popoutProps", "children", "onClick", "closeOnItemClick", "id", "placement"];
|
|
29
31
|
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); }
|
|
30
32
|
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; }
|
|
31
33
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -246,6 +248,52 @@ var MenuRadio = function MenuRadio(props) {
|
|
|
246
248
|
}, props));
|
|
247
249
|
};
|
|
248
250
|
exports.MenuRadio = MenuRadio;
|
|
251
|
+
var MenuSwitch = function MenuSwitch(props) {
|
|
252
|
+
var _useContext3 = (0, React.useContext)(_utils.MenuContext),
|
|
253
|
+
menuValue = _useContext3.value;
|
|
254
|
+
var placement = props.placement,
|
|
255
|
+
_props$labelProps = props.labelProps,
|
|
256
|
+
labelProps = _props$labelProps === void 0 ? {} : _props$labelProps,
|
|
257
|
+
_props$switchProps = props.switchProps,
|
|
258
|
+
switchProps = _props$switchProps === void 0 ? {} : _props$switchProps,
|
|
259
|
+
children = props.children,
|
|
260
|
+
id = props.id,
|
|
261
|
+
label = props.label,
|
|
262
|
+
rest = _objectWithoutProperties(props, _excluded2);
|
|
263
|
+
var menuItemId = (0, React.useMemo)(function () {
|
|
264
|
+
return id || (0, _lodash.default)('MenuItem-');
|
|
265
|
+
}, [id]);
|
|
266
|
+
var labelId = "".concat(menuItemId, "-label");
|
|
267
|
+
var switchElement = /*#__PURE__*/React.createElement(_Switch.default, _extends({
|
|
268
|
+
id: "".concat(menuItemId, "-switch"),
|
|
269
|
+
checked: props.selected || isValueSelected(menuValue, props.value),
|
|
270
|
+
"aria-hidden": "true",
|
|
271
|
+
tabIndex: -1,
|
|
272
|
+
"aria-labelledby": labelId
|
|
273
|
+
}, placement === 'before' ? {
|
|
274
|
+
mr: 300
|
|
275
|
+
} : {
|
|
276
|
+
ml: 300
|
|
277
|
+
}, switchProps, {
|
|
278
|
+
// This prop is passed after switchProps to disallow overrides.
|
|
279
|
+
onClick: noop
|
|
280
|
+
}));
|
|
281
|
+
var menuItemProps = _objectSpread({
|
|
282
|
+
id: menuItemId,
|
|
283
|
+
label: label,
|
|
284
|
+
elemBefore: placement === 'before' ? switchElement : undefined,
|
|
285
|
+
// Empty fragment prevents a check icon in elemAfter when the switch is checked. Can be overridden.
|
|
286
|
+
elemAfter: placement === 'before' ? /*#__PURE__*/React.createElement(React.Fragment, null) : switchElement
|
|
287
|
+
}, rest);
|
|
288
|
+
return /*#__PURE__*/React.createElement(MenuItem, menuItemProps, /*#__PURE__*/React.createElement(_Text.default, _extends({
|
|
289
|
+
id: labelId
|
|
290
|
+
}, labelProps, {
|
|
291
|
+
// This prop is passed after labelProps to disallow overrides.
|
|
292
|
+
// Fall back to the label prop if children is falsy.
|
|
293
|
+
children: children || label
|
|
294
|
+
})));
|
|
295
|
+
};
|
|
296
|
+
exports.MenuSwitch = MenuSwitch;
|
|
249
297
|
var MenuTitle = (0, _styledComponents.default)(_Text.default).withConfig({
|
|
250
298
|
displayName: "Menu__MenuTitle",
|
|
251
299
|
componentId: "sc-1jmjosz-0"
|
|
@@ -274,8 +322,10 @@ var MenuGroup = function MenuGroup(_ref6) {
|
|
|
274
322
|
titleAs = _ref6.titleAs,
|
|
275
323
|
_ref6$disabled = _ref6.disabled,
|
|
276
324
|
isDisabled = _ref6$disabled === void 0 ? false : _ref6$disabled,
|
|
277
|
-
props = _objectWithoutProperties(_ref6,
|
|
278
|
-
var menuTitleId = (0,
|
|
325
|
+
props = _objectWithoutProperties(_ref6, _excluded3);
|
|
326
|
+
var menuTitleId = (0, React.useMemo)(function () {
|
|
327
|
+
return (0, _lodash.default)('menu-title-');
|
|
328
|
+
}, []);
|
|
279
329
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Box.default, _extends({
|
|
280
330
|
p: 300,
|
|
281
331
|
role: "group",
|
|
@@ -305,9 +355,9 @@ var MenuFilterInput = function MenuFilterInput(props) {
|
|
|
305
355
|
var onChange = props.onChange,
|
|
306
356
|
onFocus = props.onFocus,
|
|
307
357
|
onBlur = props.onBlur;
|
|
308
|
-
var
|
|
309
|
-
state =
|
|
310
|
-
setState =
|
|
358
|
+
var _useContext4 = (0, React.useContext)(_utils.MenuContext),
|
|
359
|
+
state = _useContext4.state,
|
|
360
|
+
setState = _useContext4.setState;
|
|
311
361
|
var handleOnChange = (0, React.useCallback)(function (event, value) {
|
|
312
362
|
onChange && onChange(event, value);
|
|
313
363
|
setState({
|
|
@@ -338,7 +388,7 @@ var MenuItems = function MenuItems(_ref7) {
|
|
|
338
388
|
role = _ref7.role,
|
|
339
389
|
multiselect = _ref7.multiselect,
|
|
340
390
|
innerRef = _ref7.innerRef,
|
|
341
|
-
props = _objectWithoutProperties(_ref7,
|
|
391
|
+
props = _objectWithoutProperties(_ref7, _excluded4);
|
|
342
392
|
var _useMenuKeyDown = (0, _utils.useMenuKeyDown)(),
|
|
343
393
|
handleKeyDown = _useMenuKeyDown.handleKeyDown,
|
|
344
394
|
activeDescendent = _useMenuKeyDown.activeDescendent;
|
|
@@ -360,8 +410,8 @@ var MenuItems = function MenuItems(_ref7) {
|
|
|
360
410
|
};
|
|
361
411
|
var MenuFooter = function MenuFooter(_ref8) {
|
|
362
412
|
var children = _ref8.children;
|
|
363
|
-
var
|
|
364
|
-
setState =
|
|
413
|
+
var _useContext5 = (0, React.useContext)(_utils.MenuContext),
|
|
414
|
+
setState = _useContext5.setState;
|
|
365
415
|
var handleOnBlur = (0, React.useCallback)(function () {
|
|
366
416
|
setState({
|
|
367
417
|
isFooterFocused: false
|
|
@@ -386,7 +436,7 @@ var Menu = function Menu(_ref9) {
|
|
|
386
436
|
multiselect = _ref9.multiselect,
|
|
387
437
|
innerRef = _ref9.innerRef,
|
|
388
438
|
footerContent = _ref9.footerContent,
|
|
389
|
-
props = _objectWithoutProperties(_ref9,
|
|
439
|
+
props = _objectWithoutProperties(_ref9, _excluded5);
|
|
390
440
|
var _useDescendants = (0, _utils.useDescendants)(),
|
|
391
441
|
_useDescendants2 = _slicedToArray(_useDescendants, 2),
|
|
392
442
|
descendants = _useDescendants2[0],
|
|
@@ -434,6 +484,7 @@ MenuGroup.displayName = 'Menu.Group';
|
|
|
434
484
|
MenuItem.displayName = 'Menu.Item';
|
|
435
485
|
MenuCheckbox.displayName = 'Menu.Checkbox';
|
|
436
486
|
MenuRadio.displayName = 'Menu.Radio';
|
|
487
|
+
MenuSwitch.displayName = 'Menu.Switch';
|
|
437
488
|
MenuDivider.displayName = 'Menu.Divider';
|
|
438
489
|
MenuFilterInput.displayName = 'Menu.FilterInput';
|
|
439
490
|
Menu.displayName = 'Menu';
|
|
@@ -441,6 +492,7 @@ Menu.Group = MenuGroup;
|
|
|
441
492
|
Menu.Item = MenuItem;
|
|
442
493
|
Menu.Checkbox = MenuCheckbox;
|
|
443
494
|
Menu.Radio = MenuRadio;
|
|
495
|
+
Menu.Switch = MenuSwitch;
|
|
444
496
|
Menu.Divider = MenuDivider;
|
|
445
497
|
Menu.FilterInput = MenuFilterInput;
|
|
446
498
|
var CustomPopoutContent = (0, _styledComponents.default)(_Popout.default.Content).withConfig({
|
|
@@ -458,7 +510,7 @@ var MenuButton = function MenuButton(_ref10) {
|
|
|
458
510
|
id = _ref10$id === void 0 ? (0, _lodash.default)('MenuButton-') : _ref10$id,
|
|
459
511
|
_ref10$placement = _ref10.placement,
|
|
460
512
|
placement = _ref10$placement === void 0 ? 'bottom' : _ref10$placement,
|
|
461
|
-
props = _objectWithoutProperties(_ref10,
|
|
513
|
+
props = _objectWithoutProperties(_ref10, _excluded6);
|
|
462
514
|
var _useState5 = (0, React.useState)(false),
|
|
463
515
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
464
516
|
isOpen = _useState6[0],
|
package/commonjs/Menu/styles.js
CHANGED
|
@@ -8,13 +8,14 @@ exports.MenuItemsContainer = exports.MenuItemContainer = void 0;
|
|
|
8
8
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
9
9
|
var _mixins = require("../utils/mixins");
|
|
10
10
|
var _Box = _interopRequireDefault(require("../Box"));
|
|
11
|
+
var _styles = require("../Switch/styles");
|
|
11
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
13
|
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); }
|
|
13
14
|
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; }
|
|
14
15
|
var MenuItemContainer = (0, _styledComponents.default)(_Box.default).withConfig({
|
|
15
16
|
displayName: "styles__MenuItemContainer",
|
|
16
17
|
componentId: "sc-168zlb1-0"
|
|
17
|
-
})(["", ";width:100%;border-radius:", ";background-color:", ";border:none;text-align:left;color:", ";font-family:", ";font-weight:", ";padding:", ";list-style-type:none;outline:0;", ";", " ", " ", " ", " ", ""], function (props) {
|
|
18
|
+
})(["", ";width:100%;border-radius:", ";background-color:", ";border:none;text-align:left;color:", ";font-family:", ";font-weight:", ";padding:", ";list-style-type:none;outline:0;", ";", " ", " ", "{", "}", " ", " ", ""], function (props) {
|
|
18
19
|
return !props.hidden && (0, _styledComponents.css)(["display:block;"]);
|
|
19
20
|
}, function (props) {
|
|
20
21
|
return props.theme.radii[500];
|
|
@@ -40,6 +41,10 @@ var MenuItemContainer = (0, _styledComponents.default)(_Box.default).withConfig(
|
|
|
40
41
|
}, props.theme.colors.listItem.background.selected, function (props) {
|
|
41
42
|
return props.theme.colors.text.inverse;
|
|
42
43
|
});
|
|
44
|
+
}, _styles.StyledSwitchButton, function (props) {
|
|
45
|
+
return props.active && !props.disabled && (0, _styledComponents.css)(["border-color:", ";"], function (props) {
|
|
46
|
+
return props.theme.colors.container.border.base;
|
|
47
|
+
});
|
|
43
48
|
}, function (props) {
|
|
44
49
|
return !props.disabled && (0, _styledComponents.css)(["&:focus,&:hover{color:", ";background-color:", ";.Icon-svg{color:unset;}}"], function (props) {
|
|
45
50
|
return props.theme.colors.text.body;
|
|
@@ -142,7 +142,7 @@ function useMenuKeyDown() {
|
|
|
142
142
|
// eslint-disable-next-line no-fallthrough
|
|
143
143
|
case 'Enter':
|
|
144
144
|
var selected = items[selectionIndex];
|
|
145
|
-
if (selected) {
|
|
145
|
+
if (selected && !selected.disabled) {
|
|
146
146
|
event.preventDefault();
|
|
147
147
|
var func = selectCallbacks.current[selected.index];
|
|
148
148
|
(func === null || func === void 0 ? void 0 : func.call) && func();
|
package/commonjs/logoNames.js
CHANGED
|
@@ -4,5 +4,5 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var _default = ["adobe-experience-manager", "android", "apple-app-store", "apple", "bigcommerce", "bitly", "bynder", "canva", "dropbox", "facebook-audience-network", "facebook", "facebook-groups", "facebook-shops", "feedly", "github", "glassdoor", "google-analytics", "google-business-messages", "google-drive", "google-my-business", "google-play-store", "hubspot", "instagram", "linkedin-audience-network", "linkedin", "marketo", "messenger", "microsoft-dynamics", "pinterest", "reddit", "salesforce-cloud", "salesforce", "shopify", "slack", "sproutsocial", "tableau", "tiktok", "tripadvisor", "tumblr", "twitter-audience-network", "twitter", "whatsapp", "woocommerce", "x-twitter", "yelp", "youtube", "zendesk"];
|
|
7
|
+
var _default = ["adobe-experience-manager", "android", "apple-app-store", "apple", "bigcommerce", "bitly", "bynder", "canva", "dropbox", "facebook-audience-network", "facebook", "facebook-groups", "facebook-shops", "feedly", "github", "glassdoor", "google-analytics", "google-business-messages", "google-drive", "google-my-business", "google-play-store", "hubspot", "instagram", "linkedin-audience-network", "linkedin", "marketo", "messenger", "microsoft-dynamics", "pinterest", "reddit", "salesforce-cloud", "salesforce", "shopify", "slack", "sproutsocial", "tableau", "threads", "tiktok", "tripadvisor", "tumblr", "twitter-audience-network", "twitter", "whatsapp", "woocommerce", "x-twitter", "yelp", "youtube", "zendesk"];
|
|
8
8
|
exports.default = _default;
|