@ringcentral/juno 2.12.3 → 2.13.1

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.
@@ -12,6 +12,7 @@ exports.hoverTransition = function (_a) {
12
12
  });
13
13
  };
14
14
  exports.CardHoverActionsStyle = function () {
15
- return foundation_1.css(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n position: absolute;\n right: 0;\n top: 0;\n padding: ", ";\n transition: ", ";\n "], ["\n position: absolute;\n right: 0;\n top: 0;\n padding: ", ";\n transition: ", ";\n "])), foundation_1.spacing(4), exports.hoverTransition);
15
+ return foundation_1.css(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n position: absolute;\n right: 0;\n top: 0;\n padding: ", ";\n transition: ", ";\n ", "\n z-index: 1;\n "], ["\n position: absolute;\n right: 0;\n top: 0;\n padding: ", ";\n transition: ", ";\n ",
16
+ "\n z-index: 1;\n "])), foundation_1.spacing(4), exports.hoverTransition, '' /* make sure `CardHoverActions` would not be covered by `CardActionArea` */);
16
17
  };
17
18
  var templateObject_1;
@@ -4,7 +4,13 @@ var tslib_1 = require("tslib");
4
4
  var foundation_1 = require("../../../foundation");
5
5
  var utils_1 = require("../utils");
6
6
  exports.DialogStyle = function (props) {
7
- var size = props.size;
8
- return foundation_1.css(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n .", " {\n max-width: ", ";\n }\n "], ["\n .", " {\n max-width: ", ";\n }\n "])), utils_1.RcDialogClasses.paper, utils_1.RcDialogMaxWidths[size]);
7
+ var size = props.size, theme = props.theme, fullScreen = props.fullScreen;
8
+ return foundation_1.css(templateObject_2 || (templateObject_2 = tslib_1.__makeTemplateObject(["\n .", " {\n max-width: ", ";\n }\n\n ", "\n "], ["\n .", " {\n max-width: ", ";\n }\n\n "
9
+ // make sure `fullScreen` can work correctly when `maxWidth` is `xs`
10
+ ,
11
+ "\n "])), utils_1.RcDialogClasses.paper, utils_1.RcDialogMaxWidths[size],
12
+ // make sure `fullScreen` can work correctly when `maxWidth` is `xs`
13
+ !fullScreen && foundation_1.css(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n .", " {\n max-width: ", ";\n\n &.", " {\n ", " {\n max-width: calc(100% - 64px);\n }\n }\n }\n "], ["\n .", " {\n max-width: ", ";\n\n &.", " {\n ",
14
+ " {\n max-width: calc(100% - 64px);\n }\n }\n }\n "])), utils_1.RcDialogClasses.paperWidthXs, foundation_1.px(Math.max(theme.breakpoints.values.xs, 400)), utils_1.RcDialogClasses.paperScrollBody, theme.breakpoints.down(Math.max(theme.breakpoints.values.xs, 400) + 32 * 2)));
9
15
  };
10
- var templateObject_1;
16
+ var templateObject_1, templateObject_2;
@@ -1,7 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var foundation_1 = require("../../../foundation");
4
- exports.RcDialogClasses = foundation_1.RcClasses(['paper', 'root', 'paperFullScreen'], 'RcDialog');
4
+ exports.RcDialogClasses = foundation_1.RcClasses([
5
+ 'paper',
6
+ 'root',
7
+ 'paperFullScreen',
8
+ 'paperWidthXs',
9
+ 'paperScrollBody',
10
+ 'paperFullScreen',
11
+ ], 'RcDialog');
5
12
  exports.RcDialogMaxWidths = {
6
13
  xsmall: '272px',
7
14
  small: null,
@@ -10,6 +10,7 @@ export var hoverTransition = function (_a) {
10
10
  });
11
11
  };
12
12
  export var CardHoverActionsStyle = function () {
13
- return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: absolute;\n right: 0;\n top: 0;\n padding: ", ";\n transition: ", ";\n "], ["\n position: absolute;\n right: 0;\n top: 0;\n padding: ", ";\n transition: ", ";\n "])), spacing(4), hoverTransition);
13
+ return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: absolute;\n right: 0;\n top: 0;\n padding: ", ";\n transition: ", ";\n ", "\n z-index: 1;\n "], ["\n position: absolute;\n right: 0;\n top: 0;\n padding: ", ";\n transition: ", ";\n ",
14
+ "\n z-index: 1;\n "])), spacing(4), hoverTransition, '' /* make sure `CardHoverActions` would not be covered by `CardActionArea` */);
14
15
  };
15
16
  var templateObject_1;
@@ -1,8 +1,14 @@
1
1
  import { __makeTemplateObject } from "tslib";
2
- import { css } from '../../../foundation';
2
+ import { css, px } from '../../../foundation';
3
3
  import { RcDialogClasses, RcDialogMaxWidths } from '../utils';
4
4
  export var DialogStyle = function (props) {
5
- var size = props.size;
6
- return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .", " {\n max-width: ", ";\n }\n "], ["\n .", " {\n max-width: ", ";\n }\n "])), RcDialogClasses.paper, RcDialogMaxWidths[size]);
5
+ var size = props.size, theme = props.theme, fullScreen = props.fullScreen;
6
+ return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n .", " {\n max-width: ", ";\n }\n\n ", "\n "], ["\n .", " {\n max-width: ", ";\n }\n\n "
7
+ // make sure `fullScreen` can work correctly when `maxWidth` is `xs`
8
+ ,
9
+ "\n "])), RcDialogClasses.paper, RcDialogMaxWidths[size],
10
+ // make sure `fullScreen` can work correctly when `maxWidth` is `xs`
11
+ !fullScreen && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .", " {\n max-width: ", ";\n\n &.", " {\n ", " {\n max-width: calc(100% - 64px);\n }\n }\n }\n "], ["\n .", " {\n max-width: ", ";\n\n &.", " {\n ",
12
+ " {\n max-width: calc(100% - 64px);\n }\n }\n }\n "])), RcDialogClasses.paperWidthXs, px(Math.max(theme.breakpoints.values.xs, 400)), RcDialogClasses.paperScrollBody, theme.breakpoints.down(Math.max(theme.breakpoints.values.xs, 400) + 32 * 2)));
7
13
  };
8
- var templateObject_1;
14
+ var templateObject_1, templateObject_2;
@@ -1,5 +1,12 @@
1
1
  import { RcClasses } from '../../../foundation';
2
- export var RcDialogClasses = RcClasses(['paper', 'root', 'paperFullScreen'], 'RcDialog');
2
+ export var RcDialogClasses = RcClasses([
3
+ 'paper',
4
+ 'root',
5
+ 'paperFullScreen',
6
+ 'paperWidthXs',
7
+ 'paperScrollBody',
8
+ 'paperFullScreen',
9
+ ], 'RcDialog');
3
10
  export var RcDialogMaxWidths = {
4
11
  xsmall: '272px',
5
12
  small: null,
@@ -1,4 +1,3 @@
1
- import { SyntheticEvent } from 'react';
2
1
  import { RefOrElementOrCallback } from '../../utils';
3
2
  export declare type UseEventListenerAction = {
4
3
  listen: () => void;
@@ -12,5 +11,5 @@ export declare type UseEventListenerConfig = {
12
11
  */
13
12
  startImmediately?: boolean;
14
13
  };
15
- export declare function useEventListener<T = SyntheticEvent>(target: RefOrElementOrCallback | EventTarget, key: string, callback: (event?: T) => void, config?: UseEventListenerConfig): UseEventListenerAction;
16
- export declare function useEventListener<T = SyntheticEvent>(target: RefOrElementOrCallback | EventTarget, key: string, callback: (event?: T) => void, options?: AddEventListenerOptions | boolean, config?: UseEventListenerConfig): UseEventListenerAction;
14
+ export declare function useEventListener<T = Event>(target: RefOrElementOrCallback | EventTarget, key: string, callback: (event: T) => void, config?: UseEventListenerConfig): UseEventListenerAction;
15
+ export declare function useEventListener<T = Event>(target: RefOrElementOrCallback | EventTarget, key: string, callback: (event: T) => void, options?: AddEventListenerOptions | boolean, config?: UseEventListenerConfig): UseEventListenerAction;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ringcentral/juno",
3
- "version": "2.12.3",
3
+ "version": "2.13.1",
4
4
  "author": "RingCentral",
5
5
  "license": "MIT",
6
6
  "main": "./index.js",