@pedidopago/ui 1.2.5 → 1.3.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 (66) hide show
  1. package/dist/components/Card/card.test.tsx.d.ts +2 -0
  2. package/dist/components/Card/card.test.tsx.d.ts.map +1 -0
  3. package/dist/components/Card/card.test.tsx.js +41 -0
  4. package/dist/components/Card/index.d.ts +2 -2
  5. package/dist/components/Card/index.d.ts.map +1 -1
  6. package/dist/components/Card/index.js +25 -69
  7. package/dist/components/Card/styles.d.ts +2 -52
  8. package/dist/components/Card/styles.d.ts.map +1 -1
  9. package/dist/components/Card/styles.js +7 -80
  10. package/dist/components/Card/types.d.ts +12 -37
  11. package/dist/components/Card/types.d.ts.map +1 -1
  12. package/dist/components/DateInput/styles.d.ts +1 -1
  13. package/dist/components/Flex/styles.d.ts +1 -0
  14. package/dist/components/Flex/styles.d.ts.map +1 -1
  15. package/dist/components/Grid/styles.d.ts +1 -0
  16. package/dist/components/Grid/styles.d.ts.map +1 -1
  17. package/dist/components/Input/index.d.ts.map +1 -1
  18. package/dist/components/Input/index.js +15 -1
  19. package/dist/components/Modal/index.d.ts +2 -2
  20. package/dist/components/Modal/index.d.ts.map +1 -1
  21. package/dist/components/Modal/index.js +43 -20
  22. package/dist/components/Modal/styles.d.ts +15 -2
  23. package/dist/components/Modal/styles.d.ts.map +1 -1
  24. package/dist/components/Modal/styles.js +25 -7
  25. package/dist/components/Modal/types.d.ts +6 -5
  26. package/dist/components/Modal/types.d.ts.map +1 -1
  27. package/dist/components/MultipleSelect/components/SelectArea/Label.js +1 -1
  28. package/dist/components/Select/index.d.ts.map +1 -1
  29. package/dist/components/Select/index.js +52 -28
  30. package/dist/components/Select/styles.d.ts +13 -0
  31. package/dist/components/Select/styles.d.ts.map +1 -1
  32. package/dist/components/Select/styles.js +22 -4
  33. package/dist/components/Select/types.d.ts +2 -0
  34. package/dist/components/Select/types.d.ts.map +1 -1
  35. package/dist/components/Spinner/styles.d.ts +1 -0
  36. package/dist/components/Spinner/styles.d.ts.map +1 -1
  37. package/dist/components/Table/styles.d.ts.map +1 -1
  38. package/dist/components/Table/styles.js +56 -8
  39. package/dist/components/Tag/styles.d.ts +3 -0
  40. package/dist/components/Tag/styles.d.ts.map +1 -1
  41. package/dist/components/Tooltip/index.d.ts.map +1 -1
  42. package/dist/components/Tooltip/index.js +10 -26
  43. package/dist/components/Tooltip/styles.d.ts.map +1 -1
  44. package/dist/components/Tooltip/styles.js +13 -20
  45. package/dist/components/Tooltip/types.d.ts +1 -1
  46. package/dist/components/Tooltip/types.d.ts.map +1 -1
  47. package/dist/components/Tooltip/util.d.ts +0 -4
  48. package/dist/components/Tooltip/util.d.ts.map +1 -1
  49. package/dist/components/Tooltip/util.js +1 -87
  50. package/dist/components/Typography/index.js +1 -1
  51. package/dist/components/Typography/styles.d.ts +1 -1
  52. package/dist/index.d.ts +8 -7
  53. package/dist/index.d.ts.map +1 -1
  54. package/dist/index.js +30 -21
  55. package/dist/shared/hooks/useDisableBodyScroll.js +2 -2
  56. package/dist/shared/hooks/useWindowSize.d.ts +5 -0
  57. package/dist/shared/hooks/useWindowSize.d.ts.map +1 -0
  58. package/dist/shared/hooks/useWindowSize.js +46 -0
  59. package/dist/shared/theme/hooks/useTheme.d.ts +1 -0
  60. package/dist/shared/theme/hooks/useTheme.d.ts.map +1 -1
  61. package/dist/shared/theme/theme.d.ts +1 -0
  62. package/dist/shared/theme/theme.d.ts.map +1 -1
  63. package/dist/shared/theme/theme.js +1 -0
  64. package/dist/utils/getColorValue.d.ts +1 -9
  65. package/dist/utils/getColorValue.d.ts.map +1 -1
  66. package/package.json +1 -1
@@ -0,0 +1,2 @@
1
+ import '@testing-library/jest-dom';
2
+ //# sourceMappingURL=card.test.tsx.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"card.test.tsx.d.ts","sourceRoot":"","sources":["../../../src/components/Card/card.test.tsx.tsx"],"names":[],"mappings":"AAEA,OAAO,2BAA2B,CAAC"}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+
3
+ var _testUtils = require("../../shared/tests/test-utils");
4
+
5
+ require("@testing-library/jest-dom");
6
+
7
+ var _ = require(".");
8
+
9
+ var _jsxRuntime = require("react/jsx-runtime");
10
+
11
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
12
+
13
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
14
+
15
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
16
+
17
+ var setup = function setup(props) {
18
+ var utils = (0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Card, _objectSpread({}, props)));
19
+ return utils;
20
+ };
21
+
22
+ describe('Card', function () {
23
+ it('Should render a empty card', function () {
24
+ var _setup = setup({}),
25
+ container = _setup.container;
26
+
27
+ expect(container).toBeInTheDocument();
28
+ }); // it('Should render a card with outlined', () => {
29
+ // const { container } = setup({ outlined: true });
30
+ // expect(container).toBeInTheDocument();
31
+ // });
32
+
33
+ it('Should render a card with padding', function () {
34
+ var _setup2 = setup({
35
+ cardPadding: '32px'
36
+ }),
37
+ container = _setup2.container;
38
+
39
+ expect(container).toBeInTheDocument();
40
+ });
41
+ });
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
- import { cardI } from './types';
3
- export declare function Card({ title, subtitle, media, supporingText, tooltip, icon, outlined, expand, expandedHeight, titleColor, hover, active, padding, children, btPrimary, btSecondary, btColumn, }: cardI): JSX.Element;
2
+ import { ICard } from './types';
3
+ export declare function Card({ cardPadding, borderRadius, variant, boxShadow, bgColor, children, }: ICard): JSX.Element;
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Card/index.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGhC,wBAAgB,IAAI,CAAC,EACnB,KAAK,EACL,QAAQ,EACR,KAAK,EACL,aAAa,EACb,OAAO,EACP,IAAI,EACJ,QAAQ,EACR,MAAM,EACN,cAAc,EACd,UAAU,EACV,KAAK,EACL,MAAM,EACN,OAAO,EACP,QAAQ,EACR,SAAS,EACT,WAAW,EACX,QAAQ,GACT,EAAE,KAAK,eAkCP"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Card/index.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,wBAAgB,IAAI,CAAC,EACnB,WAAoB,EACpB,YAAuB,EACvB,OAAiB,EACjB,SAA2B,EAC3B,OAAO,EACP,QAAQ,GACT,EAAE,KAAK,eAmBP"}
@@ -5,79 +5,35 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.Card = Card;
7
7
 
8
- var _styles = require("./styles");
9
-
10
- var _Expansion = require("./Expansion");
11
-
12
- var _Icon = _interopRequireDefault(require("../Icon"));
8
+ var _theme = require("../../shared/theme");
13
9
 
14
- var _Tooltip = _interopRequireDefault(require("../Tooltip"));
15
-
16
- var _ButtonCard = require("./ButtonCard");
10
+ var _styles = require("./styles");
17
11
 
18
12
  var _jsxRuntime = require("react/jsx-runtime");
19
13
 
20
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
-
22
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
23
-
24
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
25
-
26
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
27
-
28
14
  function Card(_ref) {
29
- var title = _ref.title,
30
- subtitle = _ref.subtitle,
31
- media = _ref.media,
32
- supporingText = _ref.supporingText,
33
- tooltip = _ref.tooltip,
34
- icon = _ref.icon,
35
- outlined = _ref.outlined,
36
- expand = _ref.expand,
37
- expandedHeight = _ref.expandedHeight,
38
- titleColor = _ref.titleColor,
39
- hover = _ref.hover,
40
- active = _ref.active,
41
- padding = _ref.padding,
42
- children = _ref.children,
43
- btPrimary = _ref.btPrimary,
44
- btSecondary = _ref.btSecondary,
45
- btColumn = _ref.btColumn;
46
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.CardBody, {
47
- outlined: outlined,
48
- hover: hover,
49
- active: active,
50
- children: [media && /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
51
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Media, {
52
- src: media
53
- })
54
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.CardContent, {
55
- padding: padding,
56
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.HeaderCard, {
57
- children: [title && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Title, {
58
- color: titleColor,
59
- children: title
60
- }), icon && (tooltip ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.default, _objectSpread(_objectSpread({}, tooltip), {}, {
61
- children: icon && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
62
- name: icon
63
- })
64
- })) : icon && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
65
- name: icon
66
- }))]
67
- }), subtitle && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.SubtitleText, {
68
- children: subtitle
69
- }), supporingText && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.SupporingText, {
70
- children: supporingText
71
- }), expand ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Expansion.Expansion, {
72
- expandedHeight: expandedHeight,
73
- children: children
74
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Content, {
75
- children: children
76
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonCard.ButtonCardArea, {
77
- btPrimary: btPrimary,
78
- btSecondary: btSecondary,
79
- btColumn: btColumn
80
- })]
81
- })]
15
+ var _ref$cardPadding = _ref.cardPadding,
16
+ cardPadding = _ref$cardPadding === void 0 ? '10px' : _ref$cardPadding,
17
+ _ref$borderRadius = _ref.borderRadius,
18
+ borderRadius = _ref$borderRadius === void 0 ? '0.5rem' : _ref$borderRadius,
19
+ _ref$variant = _ref.variant,
20
+ variant = _ref$variant === void 0 ? 'solid' : _ref$variant,
21
+ _ref$boxShadow = _ref.boxShadow,
22
+ boxShadow = _ref$boxShadow === void 0 ? 'shadow.level1' : _ref$boxShadow,
23
+ bgColor = _ref.bgColor,
24
+ children = _ref.children;
25
+
26
+ var _useTheme = (0, _theme.useTheme)(),
27
+ theme = _useTheme.theme;
28
+
29
+ var splitBoxShadow = boxShadow && boxShadow.indexOf('shadow') > -1 ? boxShadow.split('.') : null;
30
+ var boxShadowValue = splitBoxShadow ? theme.shadow[splitBoxShadow[1]] : boxShadow;
31
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.CardBody, {
32
+ cardPadding: cardPadding,
33
+ borderRadius: borderRadius,
34
+ variant: variant,
35
+ boxShadow: boxShadowValue,
36
+ bgColor: bgColor,
37
+ children: children
82
38
  });
83
39
  }
@@ -1,57 +1,7 @@
1
1
  /// <reference types="react" />
2
- import { BodyCard } from './types';
2
+ import { IBodyCard } from './types';
3
3
  export declare const CardBody: import("@emotion/styled").StyledComponent<{
4
4
  theme?: import("@emotion/react").Theme | undefined;
5
5
  as?: import("react").ElementType<any> | undefined;
6
- } & BodyCard, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
7
- export declare const CardContent: import("@emotion/styled").StyledComponent<{
8
- theme?: import("@emotion/react").Theme | undefined;
9
- as?: import("react").ElementType<any> | undefined;
10
- } & {
11
- padding?: string | undefined;
12
- }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
13
- export declare const HeaderCard: import("@emotion/styled").StyledComponent<{
14
- theme?: import("@emotion/react").Theme | undefined;
15
- as?: import("react").ElementType<any> | undefined;
16
- }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
17
- export declare const ChildrenBody: import("@emotion/styled").StyledComponent<{
18
- theme?: import("@emotion/react").Theme | undefined;
19
- as?: import("react").ElementType<any> | undefined;
20
- } & {
21
- expand: boolean;
22
- }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
23
- export declare const Title: import("@emotion/styled").StyledComponent<{
24
- theme?: import("@emotion/react").Theme | undefined;
25
- as?: import("react").ElementType<any> | undefined;
26
- } & {
27
- color?: string | undefined;
28
- }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
29
- export declare const Content: import("@emotion/styled").StyledComponent<{
30
- theme?: import("@emotion/react").Theme | undefined;
31
- as?: import("react").ElementType<any> | undefined;
32
- }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
33
- export declare const SubtitleText: import("@emotion/styled").StyledComponent<{
34
- theme?: import("@emotion/react").Theme | undefined;
35
- as?: import("react").ElementType<any> | undefined;
36
- }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, {}>;
37
- export declare const SupporingText: import("@emotion/styled").StyledComponent<{
38
- theme?: import("@emotion/react").Theme | undefined;
39
- as?: import("react").ElementType<any> | undefined;
40
- }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, {}>;
41
- export declare const Media: import("@emotion/styled").StyledComponent<{
42
- theme?: import("@emotion/react").Theme | undefined;
43
- as?: import("react").ElementType<any> | undefined;
44
- }, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
45
- export declare const SupText: import("@emotion/styled").StyledComponent<{
46
- theme?: import("@emotion/react").Theme | undefined;
47
- as?: import("react").ElementType<any> | undefined;
48
- }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
49
- export declare const IconArea: import("@emotion/styled").StyledComponent<{
50
- theme?: import("@emotion/react").Theme | undefined;
51
- as?: import("react").ElementType<any> | undefined;
52
- }, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
53
- export declare const ButtonArea: import("@emotion/styled").StyledComponent<{
54
- theme?: import("@emotion/react").Theme | undefined;
55
- as?: import("react").ElementType<any> | undefined;
56
- }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
6
+ } & IBodyCard, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
57
7
  //# sourceMappingURL=styles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/components/Card/styles.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,eAAO,MAAM,QAAQ;;;oHAiBpB,CAAC;AAEF,eAAO,MAAM,WAAW;;;;;yGAEvB,CAAC;AAEF,eAAO,MAAM,UAAU;;;yGAStB,CAAC;AACF,eAAO,MAAM,YAAY;;;;YAAwB,OAAO;yGAEvD,CAAC;AAEF,eAAO,MAAM,KAAK;;;;;yGAKjB,CAAC;AAEF,eAAO,MAAM,OAAO;;;yGAGnB,CAAC;AAEF,eAAO,MAAM,YAAY;;;qHAGxB,CAAC;AAEF,eAAO,MAAM,aAAa;;;qHAIzB,CAAC;AAEF,eAAO,MAAM,KAAK;;;gHAIjB,CAAC;AAEF,eAAO,MAAM,OAAO;;;yGAEnB,CAAC;AAEF,eAAO,MAAM,QAAQ;;;gHAKpB,CAAC;AAEF,eAAO,MAAM,UAAU;;;yGAItB,CAAC"}
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/components/Card/styles.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,eAAO,MAAM,QAAQ;;;qHAYnB,CAAC"}
@@ -3,93 +3,20 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.Title = exports.SupporingText = exports.SupText = exports.SubtitleText = exports.Media = exports.IconArea = exports.HeaderCard = exports.Content = exports.ChildrenBody = exports.CardContent = exports.CardBody = exports.ButtonArea = void 0;
6
+ exports.CardBody = void 0;
7
+
8
+ var _react = require("@emotion/react");
7
9
 
8
10
  var _styled = _interopRequireDefault(require("@emotion/styled"));
9
11
 
10
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12;
12
+ var _templateObject;
11
13
 
12
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
15
 
14
16
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
15
17
 
16
- var CardBody = _styled.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background-color: ", ";\n border-radius: 8px;\n box-shadow: ", ";\n width: 100%;\n :hover {\n ", "\n }\n :active {\n ", "\n }\n"])), function (props) {
17
- return props.theme.colorMode === 'dark' ? props.theme.colors.neutral.neutral6 : props.theme.colors.neutral.white;
18
- }, function (_ref) {
19
- var theme = _ref.theme;
20
- return theme.colorMode === 'dark' ? "0px 16px 32px ".concat(theme.colors.neutral.black) : theme.shadow.level2;
21
- }, function (_ref2) {
22
- var hover = _ref2.hover;
23
- return hover;
24
- }, function (_ref3) {
25
- var active = _ref3.active;
26
- return active;
27
- });
28
-
29
- exports.CardBody = CardBody;
30
-
31
- var CardContent = _styled.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n padding: ", ";\n"])), function (_ref4) {
32
- var padding = _ref4.padding;
33
- return padding || 0;
34
- });
35
-
36
- exports.CardContent = CardContent;
37
-
38
- var HeaderCard = _styled.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n\n & svg {\n color: ", ";\n }\n"])), function (_ref5) {
39
- var theme = _ref5.theme;
40
- return theme.colorMode === 'dark' ? theme.colors.neutral.white : theme.colors.neutral.black;
41
- });
42
-
43
- exports.HeaderCard = HeaderCard;
44
-
45
- var ChildrenBody = _styled.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: ", ";\n"])), function (_ref6) {
46
- var expand = _ref6.expand;
47
- return !expand || 'none';
48
- });
49
-
50
- exports.ChildrenBody = ChildrenBody;
51
-
52
- var Title = _styled.default.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n color: ", ";\n font-size: 1.5rem;\n font-weight: bold;\n"])), function (_ref7) {
53
- var color = _ref7.color,
54
- theme = _ref7.theme;
55
- return color || theme.colorMode === 'dark' ? theme.colors.neutral.white : theme.colors.neutral.black;
56
- });
57
-
58
- exports.Title = Title;
59
-
60
- var Content = _styled.default.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n color: ", ";\n"])), function (_ref8) {
61
- var theme = _ref8.theme;
62
- return theme.colorMode === 'dark' ? theme.colors.neutral.white : theme.colors.neutral.black;
63
- });
64
-
65
- exports.Content = Content;
66
-
67
- var SubtitleText = _styled.default.p(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n color: ", ";\n"])), function (_ref9) {
68
- var theme = _ref9.theme;
69
- return theme.colorMode === 'dark' ? theme.colors.neutral.white : theme.colors.neutral.black;
18
+ var CardBody = _styled.default.div(function (props) {
19
+ return (0, _react.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding: ", ";\n border-radius: ", ";\n box-shadow: ", ";\n width: 100%;\n background-color: ", ";\n border: ", ";\n color: ", ";\n "])), props.cardPadding, props.borderRadius, props.variant === 'outlined' ? '' : props.boxShadow, props.variant === 'outlined' ? 'transparent' : props.bgColor, props.variant === 'outlined' ? "2px solid ".concat(props.theme.colors.neutral.neutral1) : '', props.theme.colors.neutral.black);
70
20
  });
71
21
 
72
- exports.SubtitleText = SubtitleText;
73
-
74
- var SupporingText = _styled.default.p(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n font-size: 12px;\n color: ", ";\n"])), function (_ref10) {
75
- var theme = _ref10.theme;
76
- return theme.colorMode === 'dark' ? theme.colors.neutral.white : theme.colors.neutral.black;
77
- });
78
-
79
- exports.SupporingText = SupporingText;
80
-
81
- var Media = _styled.default.img(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n width: 100%;\n border-top-left-radius: 8px;\n border-top-right-radius: 8px;\n"])));
82
-
83
- exports.Media = Media;
84
-
85
- var SupText = _styled.default.div(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n padding: 0 32px;\n"])));
86
-
87
- exports.SupText = SupText;
88
-
89
- var IconArea = _styled.default.img(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n width: 100px;\n height: 100px;\n object-fit: cover;\n border-radius: 50%;\n"])));
90
-
91
- exports.IconArea = IconArea;
92
-
93
- var ButtonArea = _styled.default.div(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n display: flex;\n justify-content: center;\n margin-top: 32px;\n"])));
94
-
95
- exports.ButtonArea = ButtonArea;
22
+ exports.CardBody = CardBody;
@@ -1,42 +1,17 @@
1
1
  import React from 'react';
2
- import { ThemeProps } from 'src';
3
- import { IButtonProps } from '../Button/types';
4
- import { IconName } from '../Icon/types';
5
- import { IInputProps, positionType } from '../Tooltip/types';
6
- import { CSSObject } from '@emotion/react';
7
- export declare type toolTipCard = {
8
- label: string;
9
- position: positionType;
10
- backgroundColor: string;
11
- };
12
- export interface BodyCard {
13
- outlined?: boolean;
14
- theme?: ThemeProps;
15
- hover?: CSSObject;
16
- active?: CSSObject;
2
+ export interface IBodyCard {
3
+ cardPadding?: string;
4
+ borderRadius?: string;
5
+ variant?: string;
6
+ boxShadow?: string;
7
+ bgColor?: string;
17
8
  }
18
- export interface Buttons {
19
- btPrimary?: IButtonProps;
20
- btSecondary?: IButtonProps;
21
- btColumn?: boolean;
22
- }
23
- export interface cardI {
24
- title?: string;
25
- subtitle?: string;
26
- media?: string;
27
- supporingText?: string;
28
- tooltip?: IInputProps;
29
- icon?: IconName;
30
- outlined?: boolean;
31
- expand?: boolean;
32
- expandedHeight?: string;
33
- titleColor?: string;
34
- hover?: CSSObject;
35
- active?: CSSObject;
36
- padding?: string;
9
+ export interface ICard {
10
+ cardPadding?: string;
37
11
  children?: React.ReactChild;
38
- btPrimary?: IButtonProps;
39
- btSecondary?: IButtonProps;
40
- btColumn?: boolean;
12
+ borderRadius?: string;
13
+ variant?: string;
14
+ boxShadow?: 'shadow.level1' | 'shadow.level2' | 'shadow.level3' | (string & {});
15
+ bgColor?: string;
41
16
  }
42
17
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Card/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,oBAAY,WAAW,GAAG;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,YAAY,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AACF,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB;AACD,MAAM,WAAW,OAAO;IACtB,SAAS,CAAC,EAAE,YAAY,CAAC;IACzB,WAAW,CAAC,EAAE,YAAY,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,KAAK;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC;IAC5B,SAAS,CAAC,EAAE,YAAY,CAAC;IACzB,WAAW,CAAC,EAAE,YAAY,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Card/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,WAAW,SAAS;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,KAAK;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,eAAe,GAAG,eAAe,GAAG,eAAe,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IAChF,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
@@ -265,7 +265,7 @@ export declare const CalendarText: import("@emotion/styled").StyledComponent<{
265
265
  } & import("../../@types").GenericStyledProps & import("react").ClassAttributes<HTMLParagraphElement> & import("react").HTMLAttributes<HTMLParagraphElement> & {
266
266
  variant?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p" | "span" | undefined;
267
267
  color?: import("../..").GlobalColorsProps | (string & {}) | undefined;
268
- fontSize?: number | "display" | "xxxs" | "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "xxxl" | "giant" | undefined;
268
+ fontSize?: number | "display" | "tiny" | "xxxs" | "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "xxxl" | "giant" | undefined;
269
269
  fontWeight?: "400" | "700" | "100" | "200" | "300" | "500" | "600" | "800" | "900" | "bold" | "normal" | undefined;
270
270
  fontStyle?: "inherit" | "initial" | "normal" | "italic" | "oblique" | undefined;
271
271
  lineHeight?: string | number | undefined;
@@ -5,6 +5,7 @@ export declare const StyledFlexContainer: import("@emotion/styled").StyledCompon
5
5
  } & import("./types").IFlexProps & {
6
6
  theme?: {
7
7
  fontSizes: {
8
+ tiny: string;
8
9
  xxxs: string;
9
10
  xxs: string;
10
11
  xs: string;
@@ -1 +1 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/components/Flex/styles.ts"],"names":[],"mappings":";AAKA,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yGAyZ9B,CAAC"}
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/components/Flex/styles.ts"],"names":[],"mappings":";AAKA,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yGAyZ9B,CAAC"}
@@ -5,6 +5,7 @@ export declare const GridComponent: import("@emotion/styled").StyledComponent<{
5
5
  } & import("./types").IGridProps & {
6
6
  theme?: {
7
7
  fontSizes: {
8
+ tiny: string;
8
9
  xxxs: string;
9
10
  xxs: string;
10
11
  xs: string;
@@ -1 +1 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/components/Grid/styles.ts"],"names":[],"mappings":";AAKA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yGA4azB,CAAC"}
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/components/Grid/styles.ts"],"names":[],"mappings":";AAKA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yGA4azB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Input/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,mBAAmB,EAAY,MAAM,OAAO,CAAC;AAoBlE,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,QAAA,MAAM,KAAK,sJAkFV,CAAC;AAGF,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Input/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,mBAAmB,EAKpB,MAAM,OAAO,CAAC;AAoBf,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,QAAA,MAAM,KAAK,sJA6FV,CAAC;AAGF,eAAe,KAAK,CAAC"}
@@ -40,6 +40,8 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
40
40
  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; }
41
41
 
42
42
  var Input = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
43
+ var _inputRef$current2;
44
+
43
45
  var placeholder = _ref.placeholder,
44
46
  type = _ref.type,
45
47
  disabled = _ref.disabled,
@@ -71,12 +73,23 @@ var Input = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
71
73
  setHiddenInfo(!hiddenInfo);
72
74
  }
73
75
 
76
+ var inputRef = (0, _react.useRef)(null);
77
+ (0, _react.useImperativeHandle)(ref, function () {
78
+ return inputRef.current;
79
+ });
80
+ (0, _react.useEffect)(function () {
81
+ var _inputRef$current;
82
+
83
+ ((_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.value) && setHasValueOnInput(true);
84
+ }, [(_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : _inputRef$current2.value]);
74
85
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.InputGroupElement, {
75
86
  hasValueOnInput: withIcon || placeholder || rest.value ? true : hasValueOnInput,
76
87
  alert: alert,
77
88
  withAddon: withAddon,
78
89
  hasDisabled: disabled,
79
90
  labelBackground: labelBackground,
91
+ className: rest.className,
92
+ style: rest.style,
80
93
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.InputColumn, {
81
94
  children: [withAddon && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.AddonElement, {
82
95
  alert: alert,
@@ -93,6 +106,7 @@ var Input = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
93
106
  children: [withIcon && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.InputIcon, {
94
107
  children: withIcon
95
108
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Input, _objectSpread(_objectSpread({
109
+ "data-input": "input",
96
110
  type: hiddenInfo ? 'password' : type,
97
111
  "aria-label": label,
98
112
  withIcon: withIcon,
@@ -100,7 +114,7 @@ var Input = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
100
114
  disabled: disabled,
101
115
  alert: alert,
102
116
  placeholder: placeholder,
103
- ref: ref
117
+ ref: inputRef
104
118
  }, rest), {}, {
105
119
  onChange: function onChange(e) {
106
120
  var _rest$onChange;
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
- import { IModalProps } from './types';
3
- export declare function Modal({ open, left, top, anchorX, anchorY, offsetX, offsetY, hideScrollBar, hideOverlay, maxWidth, maxHeight, onClose, children, }: IModalProps): JSX.Element;
2
+ import { ModalProps } from './types';
3
+ export declare function Modal({ open, left, top, anchorX, anchorY, offsetX, offsetY, hideScrollBar, hideOverlay, disableScrollOnOpen, maxWidth, maxHeight, onClose, ...rest }: ModalProps): JSX.Element;
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/index.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,wBAAgB,KAAK,CAAC,EACpB,IAAI,EACJ,IAAa,EACb,GAAY,EACZ,OAAkB,EAClB,OAAkB,EAClB,OAAe,EACf,OAAe,EACf,aAAqB,EACrB,WAAmB,EACnB,QAAQ,EACR,SAAS,EACT,OAAO,EACP,QAAQ,GACT,EAAE,WAAW,eA+Eb"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/index.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAMrC,wBAAgB,KAAK,CAAC,EACpB,IAAI,EACJ,IAAa,EACb,GAAY,EACZ,OAAkB,EAClB,OAAkB,EAClB,OAAe,EACf,OAAe,EACf,aAAqB,EACrB,WAAmB,EACnB,mBAA0B,EAC1B,QAAQ,EACR,SAAS,EACT,OAAO,EACP,GAAG,IAAI,EACR,EAAE,UAAU,eAiFZ"}
@@ -5,15 +5,33 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.Modal = Modal;
7
7
 
8
+ var _styles = require("./styles");
9
+
10
+ var _react = require("react");
11
+
8
12
  var _useDisableBodyScroll = require("../../shared/hooks/useDisableBodyScroll");
9
13
 
10
14
  var _useKeyPress = require("../../shared/hooks/useKeyPress");
11
15
 
12
- var _styles = require("./styles");
16
+ var _useWindowSize2 = require("src/shared/hooks/useWindowSize");
13
17
 
14
18
  var _jsxRuntime = require("react/jsx-runtime");
15
19
 
20
+ var _excluded = ["open", "left", "top", "anchorX", "anchorY", "offsetX", "offsetY", "hideScrollBar", "hideOverlay", "disableScrollOnOpen", "maxWidth", "maxHeight", "onClose"];
21
+
22
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
23
+
24
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
25
+
26
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
27
+
28
+ 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; }
29
+
30
+ 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; }
31
+
16
32
  function Modal(_ref) {
33
+ var _containerRef$current, _containerRef$current2;
34
+
17
35
  var open = _ref.open,
18
36
  _ref$left = _ref.left,
19
37
  left = _ref$left === void 0 ? '50vw' : _ref$left,
@@ -31,18 +49,21 @@ function Modal(_ref) {
31
49
  hideScrollBar = _ref$hideScrollBar === void 0 ? false : _ref$hideScrollBar,
32
50
  _ref$hideOverlay = _ref.hideOverlay,
33
51
  hideOverlay = _ref$hideOverlay === void 0 ? false : _ref$hideOverlay,
52
+ _ref$disableScrollOnO = _ref.disableScrollOnOpen,
53
+ disableScrollOnOpen = _ref$disableScrollOnO === void 0 ? true : _ref$disableScrollOnO,
34
54
  maxWidth = _ref.maxWidth,
35
55
  maxHeight = _ref.maxHeight,
36
56
  onClose = _ref.onClose,
37
- children = _ref.children;
38
- // TODO
39
- // Finalizar testes
40
- // Finalizar documentação Dialog
41
- // Finalizar testes do Dialog
57
+ rest = _objectWithoutProperties(_ref, _excluded);
58
+
59
+ var _useWindowSize = (0, _useWindowSize2.useWindowSize)(),
60
+ windowHeight = _useWindowSize.height;
61
+
62
+ var containerRef = (0, _react.useRef)(null);
42
63
  (0, _useKeyPress.useKeyPress)('Escape', function () {
43
64
  return onClose && onClose();
44
65
  });
45
- (0, _useDisableBodyScroll.useDisableBodyScroll)(open);
66
+ (0, _useDisableBodyScroll.useDisableBodyScroll)(open && disableScrollOnOpen);
46
67
 
47
68
  function getAnchorTranslate() {
48
69
  var percentageX = 0;
@@ -96,25 +117,27 @@ function Modal(_ref) {
96
117
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
97
118
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Overlay, {
98
119
  style: {
99
- // display: open ? 'block' : 'none',
100
120
  opacity: open && !hideOverlay ? 0.1 : 0,
101
121
  pointerEvents: open ? 'auto' : 'none'
102
122
  },
103
123
  onClick: function onClick() {
104
124
  return onClose();
105
125
  }
106
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Container, {
107
- style: {
108
- left: "calc(".concat(left, " + ").concat(offsetX, ")"),
109
- top: "calc(".concat(top, " + ").concat(offsetY, ")"),
110
- transform: "".concat(getAnchorTranslate(), " scale(").concat(open ? 1 : 0.8, ")"),
111
- opacity: open ? 1 : 0,
112
- pointerEvents: open ? 'auto' : 'none'
113
- },
114
- maxWidth: maxWidth,
115
- maxHeight: maxHeight,
116
- hideScrollBar: hideScrollBar,
117
- children: children
126
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.ModalContainer, {
127
+ ref: containerRef,
128
+ open: open,
129
+ maxWidth: typeof maxWidth === 'number' ? "".concat(maxWidth, "px") : maxWidth,
130
+ maxHeight: "".concat(windowHeight - (((_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : (_containerRef$current2 = _containerRef$current.getBoundingClientRect()) === null || _containerRef$current2 === void 0 ? void 0 : _containerRef$current2.y) || 0), "px"),
131
+ left: "calc(".concat(left, " + ").concat(offsetX, ")"),
132
+ top: "calc(".concat(top, " + ").concat(offsetY, ")"),
133
+ anchorTranslate: getAnchorTranslate(),
134
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.ModalElement, _objectSpread(_objectSpread({
135
+ open: open,
136
+ maxHeight: typeof maxHeight === 'number' ? "".concat(maxHeight, "px") : maxHeight,
137
+ hideScrollBar: hideScrollBar
138
+ }, rest), {}, {
139
+ children: rest.children
140
+ }))
118
141
  })]
119
142
  });
120
143
  }