@ringcentral/juno 2.21.2 → 2.22.1-hotfix.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.
Files changed (61) hide show
  1. package/components/Buttons/Button/Button.d.ts +12 -3
  2. package/components/Buttons/Button/Button.js +19 -11
  3. package/components/Buttons/Button/styles/StyledButton.js +11 -5
  4. package/components/Buttons/ButtonGroup/ButtonGroup.js +3 -3
  5. package/components/Buttons/IconButton/IconButton.d.ts +13 -4
  6. package/components/Buttons/IconButton/IconButton.js +20 -14
  7. package/components/Buttons/IconButton/styles/StyledIconButton.js +19 -7
  8. package/components/Buttons/IconButton/utils/IconButtonUtils.d.ts +1 -1
  9. package/components/Buttons/IconButton/utils/IconButtonUtils.js +8 -7
  10. package/components/Buttons/SplitButton/SplitButton.js +5 -5
  11. package/components/Buttons/SplitButton/styles/StyledSplitButton.js +3 -3
  12. package/components/Buttons/SplitButton/utils/SplitButtonUtils.js +8 -1
  13. package/components/Dialer/DialPad/DialPad.d.ts +2 -2
  14. package/components/Downshift/styles/DownshiftStyle.d.ts +2 -2
  15. package/components/Forms/Picker/DatePicker/styles/StyledDatePickerHeader.d.ts +2 -2
  16. package/components/Forms/Picker/DatePicker/styles/StyledYear.d.ts +1 -1
  17. package/components/Forms/Picker/TimePicker/styles/StyledSelectionItem.d.ts +1 -1
  18. package/components/Forms/Picker/TimePicker/styles/StyledTimeIconButton.d.ts +1 -1
  19. package/components/Forms/Picker/styles/PickerBaseIconButton.d.ts +1 -1
  20. package/components/Forms/Switch/Switch.js +13 -2
  21. package/components/Forms/Switch/styles/SwitchStyle.js +1 -1
  22. package/components/Forms/Switch/utils/SwitchUtils.js +1 -9
  23. package/components/Forms/TextField/styles/ClearIconButton.d.ts +2 -2
  24. package/components/List/ListItem/ListItem.d.ts +9 -3
  25. package/components/List/ListItem/ListItem.js +14 -10
  26. package/components/List/ListItem/styles/ListItemStyle.d.ts +2 -1
  27. package/components/List/ListItem/styles/ListItemStyle.js +16 -6
  28. package/components/Menu/MenuItem/MenuItem.d.ts +23 -5
  29. package/components/Menu/MenuItem/MenuItem.js +12 -8
  30. package/components/Menu/MenuItem/styles/MenuItemStyle.js +2 -2
  31. package/components/Menu/MenuOption/styles/StyledMenuOption.d.ts +1 -1
  32. package/components/Menu/SubMenu/SubMenu.d.ts +1 -1
  33. package/components/TablePagination/styles/TablePaginationStyle.d.ts +6 -4
  34. package/components/Text/Text.d.ts +1 -1
  35. package/es6/components/Buttons/Button/Button.js +19 -11
  36. package/es6/components/Buttons/Button/styles/StyledButton.js +12 -6
  37. package/es6/components/Buttons/ButtonGroup/ButtonGroup.js +4 -4
  38. package/es6/components/Buttons/IconButton/IconButton.js +20 -14
  39. package/es6/components/Buttons/IconButton/styles/StyledIconButton.js +20 -8
  40. package/es6/components/Buttons/IconButton/utils/IconButtonUtils.js +8 -7
  41. package/es6/components/Buttons/SplitButton/SplitButton.js +6 -6
  42. package/es6/components/Buttons/SplitButton/styles/StyledSplitButton.js +3 -3
  43. package/es6/components/Buttons/SplitButton/utils/SplitButtonUtils.js +8 -1
  44. package/es6/components/Forms/Switch/Switch.js +15 -4
  45. package/es6/components/Forms/Switch/styles/SwitchStyle.js +2 -2
  46. package/es6/components/Forms/Switch/utils/SwitchUtils.js +1 -9
  47. package/es6/components/List/ListItem/ListItem.js +14 -10
  48. package/es6/components/List/ListItem/styles/ListItemStyle.js +17 -7
  49. package/es6/components/Menu/MenuItem/MenuItem.js +12 -8
  50. package/es6/components/Menu/MenuItem/styles/MenuItemStyle.js +2 -2
  51. package/es6/foundation/styles/focusRing.js +11 -0
  52. package/es6/foundation/styles/index.js +1 -0
  53. package/es6/foundation/typings/BaseFocusVariant.js +0 -0
  54. package/foundation/styles/focusRing.d.ts +2 -0
  55. package/foundation/styles/focusRing.js +13 -0
  56. package/foundation/styles/index.d.ts +1 -0
  57. package/foundation/styles/index.js +1 -0
  58. package/foundation/typings/BaseFocusVariant.d.ts +7 -0
  59. package/foundation/typings/BaseFocusVariant.js +2 -0
  60. package/foundation/typings/index.d.ts +1 -0
  61. package/package.json +1 -1
@@ -14,10 +14,9 @@ import { RcMenuListContext } from '../MenuList/MenuListContext';
14
14
  import { RcSubMenuContext } from '../SubMenu/SubMenuContext';
15
15
  import { MenuItemStyle, StyledCheckIcon } from './styles';
16
16
  import { RcMenuItemClasses, RcMenuItemRippleClasses } from './utils';
17
- var _RcMenuItem = forwardRef(function (inProps, ref) {
17
+ var _RcMenuItem = forwardRef(function (props, ref) {
18
18
  var _a;
19
- var props = useThemeProps({ props: inProps, name: 'RcMenuItem' });
20
- var classesProp = props.classes, children = props.children, color = props.color, button = props.button, className = props.className, onMouseEnter = props.onMouseEnter, onClick = props.onClick, onFocus = props.onFocus, highlighted = props.highlighted, size = props.size, type = props.type, checked = props.checked, icon = props.icon, symbol = props.symbol, avatar = props.avatar, secondaryAction = props.secondaryAction, idRef = props.idRef, isSubMenuItem = props.isSubMenuItem, TouchRipplePropsProp = props.TouchRippleProps, title = props.title, focused = props.focused, rest = __rest(props, ["classes", "children", "color", "button", "className", "onMouseEnter", "onClick", "onFocus", "highlighted", "size", "type", "checked", "icon", "symbol", "avatar", "secondaryAction", "idRef", "isSubMenuItem", "TouchRippleProps", "title", "focused"]);
19
+ var classesProp = props.classes, children = props.children, color = props.color, button = props.button, className = props.className, onMouseEnter = props.onMouseEnter, onClick = props.onClick, onFocus = props.onFocus, highlighted = props.highlighted, size = props.size, type = props.type, checked = props.checked, icon = props.icon, symbol = props.symbol, avatar = props.avatar, secondaryAction = props.secondaryAction, idRef = props.idRef, isSubMenuItem = props.isSubMenuItem, TouchRipplePropsProp = props.TouchRippleProps, title = props.title, focused = props.focused, focusVariant = props.focusVariant, rest = __rest(props, ["classes", "children", "color", "button", "className", "onMouseEnter", "onClick", "onFocus", "highlighted", "size", "type", "checked", "icon", "symbol", "avatar", "secondaryAction", "idRef", "isSubMenuItem", "TouchRippleProps", "title", "focused", "focusVariant"]);
21
20
  var isCheckedType = type === 'checked';
22
21
  var menuItemId = useId('menu-item', true);
23
22
  var menuContext = useContext(RcMenuContext);
@@ -105,11 +104,16 @@ var _RcMenuItem = forwardRef(function (inProps, ref) {
105
104
  children,
106
105
  itemSubAction));
107
106
  });
108
- var RcMenuItem = styled(withTooltip(_RcMenuItem))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", ";\n"], ["\n ", ";\n"])), MenuItemStyle);
109
- RcMenuItem.defaultProps = {
110
- size: 'medium',
111
- button: true,
112
- };
107
+ var RcMenuItem = styled(withTooltip(_RcMenuItem)).attrs(function (inProps) {
108
+ var _a = useThemeProps({ props: inProps, name: 'RcMenuItem' }),
109
+ // @ts-ignore
110
+ theme = _a.theme,
111
+ // Omit className, prevent duplicate className
112
+ className = _a.className, _b = _a.size, size = _b === void 0 ? 'medium' : _b, _c = _a.button, button = _c === void 0 ? true : _c, _d = _a.focusVariant, focusVariant = _d === void 0 ? 'highlight' : _d, rest = __rest(_a, ["theme", "className", "size", "button", "focusVariant"]);
113
+ return __assign({ size: size,
114
+ button: button,
115
+ focusVariant: focusVariant }, rest);
116
+ })(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", ";\n"], ["\n ", ";\n"])), MenuItemStyle);
113
117
  RcMenuItem.displayName = 'RcMenuItem';
114
118
  export { RcMenuItem };
115
119
  var templateObject_1;
@@ -5,11 +5,11 @@ import { sharedListItemStyle } from '../../../List/ListItem/styles';
5
5
  import { RcMenuItemClasses, RcMenuItemLeftAndRightPaddings, RcMenuItemRippleClasses, RcMenuItemTopAndBottomPaddings, } from '../utils';
6
6
  export var StyledCheckIcon = styled(RcIcon)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: 22px;\n"], ["\n height: 22px;\n"])));
7
7
  export var MenuItemStyle = function (props) {
8
- var size = props.size, _a = props.color, color = _a === void 0 ? 'action.grayLight' : _a;
8
+ var size = props.size, _a = props.color, color = _a === void 0 ? 'action.grayLight' : _a, focusVariant = props.focusVariant;
9
9
  var topAndBottomPadding = RcMenuItemTopAndBottomPaddings[size];
10
10
  var leftAndRightPadding = RcMenuItemLeftAndRightPaddings[size];
11
11
  return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n outline: none;\n box-sizing: border-box;\n height: auto;\n min-height: 32px;\n min-width: 112px;\n padding-top: ", ";\n padding-bottom: ", ";\n\n ", ";\n\n .", " {\n padding-left: ", ";\n padding-right: ", ";\n }\n\n &.", " {\n padding-top: ", ";\n padding-bottom: ", ";\n min-height: auto;\n line-height: 22px;\n font-weight: 700;\n }\n "], ["\n outline: none;\n box-sizing: border-box;\n height: auto;\n min-height: 32px;\n min-width: 112px;\n padding-top: ", ";\n padding-bottom: ", ";\n\n ",
12
- ";\n\n .", " {\n padding-left: ", ";\n padding-right: ", ";\n }\n\n &.", " {\n padding-top: ", ";\n padding-bottom: ", ";\n min-height: auto;\n line-height: 22px;\n font-weight: 700;\n }\n "])), topAndBottomPadding, topAndBottomPadding, sharedListItemStyle(__assign(__assign({}, props), { color: color,
12
+ ";\n\n .", " {\n padding-left: ", ";\n padding-right: ", ";\n }\n\n &.", " {\n padding-top: ", ";\n padding-bottom: ", ";\n min-height: auto;\n line-height: 22px;\n font-weight: 700;\n }\n "])), topAndBottomPadding, topAndBottomPadding, sharedListItemStyle(__assign(__assign({}, props), { focusVariant: focusVariant, color: color,
13
13
  // in menuItem always be can hover
14
14
  canHover: true, mainClasses: RcMenuItemClasses, rippleClasses: RcMenuItemRippleClasses })), RcMenuItemClasses.gutters, leftAndRightPadding, leftAndRightPadding, RcMenuItemClasses.dense, spacing(1), spacing(1));
15
15
  };
@@ -0,0 +1,11 @@
1
+ import { __makeTemplateObject } from "tslib";
2
+ import { css } from '../styled-components';
3
+ import { palette2 } from './newPalette';
4
+ var focusRingOffsetMap = {
5
+ normal: '2px',
6
+ inset: '-2px',
7
+ };
8
+ export var focusRing = function (variant) {
9
+ return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n outline-color: ", ";\n outline-width: 2px;\n outline-style: solid;\n outline-offset: ", ";\n "], ["\n outline-color: ", ";\n outline-width: 2px;\n outline-style: solid;\n outline-offset: ", ";\n "])), palette2('interactive', 'b02'), focusRingOffsetMap[variant]);
10
+ };
11
+ var templateObject_1;
@@ -4,6 +4,7 @@ export * from './ellipsis';
4
4
  export * from './fakeBorder';
5
5
  export * from './flexCenter';
6
6
  export * from './flexWidth';
7
+ export * from './focusRing';
7
8
  export * from './focusVisible';
8
9
  export * from './lineClamp';
9
10
  export * from './newPalette';
File without changes
@@ -0,0 +1,2 @@
1
+ export declare type FocusRingVariant = 'normal' | 'inset';
2
+ export declare const focusRing: (variant: FocusRingVariant) => import("styled-components").FlattenInterpolation<import("styled-components").ThemeProps<import("..").RcTheme>>[];
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var tslib_1 = require("tslib");
4
+ var styled_components_1 = require("../styled-components");
5
+ var newPalette_1 = require("./newPalette");
6
+ var focusRingOffsetMap = {
7
+ normal: '2px',
8
+ inset: '-2px',
9
+ };
10
+ exports.focusRing = function (variant) {
11
+ return styled_components_1.css(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n outline-color: ", ";\n outline-width: 2px;\n outline-style: solid;\n outline-offset: ", ";\n "], ["\n outline-color: ", ";\n outline-width: 2px;\n outline-style: solid;\n outline-offset: ", ";\n "])), newPalette_1.palette2('interactive', 'b02'), focusRingOffsetMap[variant]);
12
+ };
13
+ var templateObject_1;
@@ -4,6 +4,7 @@ export * from './ellipsis';
4
4
  export * from './fakeBorder';
5
5
  export * from './flexCenter';
6
6
  export * from './flexWidth';
7
+ export * from './focusRing';
7
8
  export * from './focusVisible';
8
9
  export * from './lineClamp';
9
10
  export * from './newPalette';
@@ -7,6 +7,7 @@ tslib_1.__exportStar(require("./ellipsis"), exports);
7
7
  tslib_1.__exportStar(require("./fakeBorder"), exports);
8
8
  tslib_1.__exportStar(require("./flexCenter"), exports);
9
9
  tslib_1.__exportStar(require("./flexWidth"), exports);
10
+ tslib_1.__exportStar(require("./focusRing"), exports);
10
11
  tslib_1.__exportStar(require("./focusVisible"), exports);
11
12
  tslib_1.__exportStar(require("./lineClamp"), exports);
12
13
  tslib_1.__exportStar(require("./newPalette"), exports);
@@ -0,0 +1,7 @@
1
+ declare type BaseFocusVariant = {
2
+ ripple: any;
3
+ focusRing: any;
4
+ highlight: any;
5
+ };
6
+ export declare type RcBaseFocusVariant<T extends keyof BaseFocusVariant> = keyof Pick<BaseFocusVariant, T>;
7
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,5 +1,6 @@
1
1
  export * from './BaseColor';
2
2
  export * from './BaseDirection';
3
+ export * from './BaseFocusVariant';
3
4
  export * from './BaseFormControlLabel';
4
5
  export * from './BaseLabelPlacement';
5
6
  export * from './BaseProps';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ringcentral/juno",
3
- "version": "2.21.2",
3
+ "version": "2.22.1-hotfix.0",
4
4
  "author": "RingCentral",
5
5
  "license": "MIT",
6
6
  "main": "./index.js",