@pedidopago/ui 1.2.5 → 1.3.2

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 (122) hide show
  1. package/dist/components/Alert/alert.test.js +8 -8
  2. package/dist/components/Alert/index.d.ts +2 -2
  3. package/dist/components/Alert/index.d.ts.map +1 -1
  4. package/dist/components/Alert/index.js +7 -26
  5. package/dist/components/Alert/styles.d.ts +0 -12
  6. package/dist/components/Alert/styles.d.ts.map +1 -1
  7. package/dist/components/Alert/styles.js +4 -22
  8. package/dist/components/Alert/types.d.ts +5 -22
  9. package/dist/components/Alert/types.d.ts.map +1 -1
  10. package/dist/components/Button/index.d.ts.map +1 -1
  11. package/dist/components/Button/index.js +11 -2
  12. package/dist/components/Button/styles.js +1 -1
  13. package/dist/components/Button/types.d.ts +1 -0
  14. package/dist/components/Button/types.d.ts.map +1 -1
  15. package/dist/components/Card/card.test.tsx.d.ts +2 -0
  16. package/dist/components/Card/card.test.tsx.d.ts.map +1 -0
  17. package/dist/components/Card/card.test.tsx.js +41 -0
  18. package/dist/components/Card/index.d.ts +2 -2
  19. package/dist/components/Card/index.d.ts.map +1 -1
  20. package/dist/components/Card/index.js +25 -69
  21. package/dist/components/Card/styles.d.ts +2 -52
  22. package/dist/components/Card/styles.d.ts.map +1 -1
  23. package/dist/components/Card/styles.js +7 -80
  24. package/dist/components/Card/types.d.ts +12 -37
  25. package/dist/components/Card/types.d.ts.map +1 -1
  26. package/dist/components/DateInput/DateInput-example.d.ts +2 -2
  27. package/dist/components/DateInput/DateInput-example.d.ts.map +1 -1
  28. package/dist/components/DateInput/DateInput-example.js +10 -15
  29. package/dist/components/DateInput/dateInput.test.js +4 -4
  30. package/dist/components/DateInput/index.d.ts +2 -2
  31. package/dist/components/DateInput/index.d.ts.map +1 -1
  32. package/dist/components/DateInput/index.js +65 -136
  33. package/dist/components/DateInput/styles.d.ts +7 -29
  34. package/dist/components/DateInput/styles.d.ts.map +1 -1
  35. package/dist/components/DateInput/styles.js +15 -19
  36. package/dist/components/DateInput/types.d.ts +7 -14
  37. package/dist/components/DateInput/types.d.ts.map +1 -1
  38. package/dist/components/DatePicker/datepicker.test.js +8 -8
  39. package/dist/components/DatePicker/index.d.ts.map +1 -1
  40. package/dist/components/DatePicker/index.js +4 -8
  41. package/dist/components/DatePicker/types.d.ts +3 -4
  42. package/dist/components/DatePicker/types.d.ts.map +1 -1
  43. package/dist/components/Flex/styles.d.ts +1 -0
  44. package/dist/components/Flex/styles.d.ts.map +1 -1
  45. package/dist/components/Grid/styles.d.ts +1 -0
  46. package/dist/components/Grid/styles.d.ts.map +1 -1
  47. package/dist/components/Input/index.d.ts.map +1 -1
  48. package/dist/components/Input/index.js +15 -2
  49. package/dist/components/Input/styles.d.ts +1 -0
  50. package/dist/components/Input/styles.d.ts.map +1 -1
  51. package/dist/components/Input/styles.js +34 -33
  52. package/dist/components/Label/index.d.ts +2 -2
  53. package/dist/components/Label/index.d.ts.map +1 -1
  54. package/dist/components/Label/index.js +12 -23
  55. package/dist/components/Label/label.test.d.ts +2 -0
  56. package/dist/components/Label/label.test.d.ts.map +1 -0
  57. package/dist/components/Label/label.test.js +105 -0
  58. package/dist/components/Label/styles.js +1 -1
  59. package/dist/components/Label/types.d.ts +5 -6
  60. package/dist/components/Label/types.d.ts.map +1 -1
  61. package/dist/components/Modal/index.d.ts +2 -2
  62. package/dist/components/Modal/index.d.ts.map +1 -1
  63. package/dist/components/Modal/index.js +43 -20
  64. package/dist/components/Modal/styles.d.ts +15 -2
  65. package/dist/components/Modal/styles.d.ts.map +1 -1
  66. package/dist/components/Modal/styles.js +25 -7
  67. package/dist/components/Modal/types.d.ts +6 -5
  68. package/dist/components/Modal/types.d.ts.map +1 -1
  69. package/dist/components/MultipleSelect/components/SelectArea/Label.js +1 -1
  70. package/dist/components/Select/index.d.ts.map +1 -1
  71. package/dist/components/Select/index.js +61 -31
  72. package/dist/components/Select/styles.d.ts +13 -0
  73. package/dist/components/Select/styles.d.ts.map +1 -1
  74. package/dist/components/Select/styles.js +22 -4
  75. package/dist/components/Select/types.d.ts +2 -0
  76. package/dist/components/Select/types.d.ts.map +1 -1
  77. package/dist/components/Spinner/styles.d.ts +1 -0
  78. package/dist/components/Spinner/styles.d.ts.map +1 -1
  79. package/dist/components/Table/index.d.ts.map +1 -1
  80. package/dist/components/Table/index.js +13 -3
  81. package/dist/components/Table/styles.d.ts.map +1 -1
  82. package/dist/components/Table/styles.js +53 -8
  83. package/dist/components/Tag/styles.d.ts +3 -0
  84. package/dist/components/Tag/styles.d.ts.map +1 -1
  85. package/dist/components/Toast/components/Toast.d.ts.map +1 -1
  86. package/dist/components/Toast/components/Toast.js +6 -7
  87. package/dist/components/Toast/contexts/ToastProvider.d.ts.map +1 -1
  88. package/dist/components/Toast/contexts/ToastProvider.js +3 -1
  89. package/dist/components/Toast/toast.test.js +10 -10
  90. package/dist/components/Toast/types.d.ts +8 -15
  91. package/dist/components/Toast/types.d.ts.map +1 -1
  92. package/dist/components/Tooltip/components/TooltipLabel.d.ts +4 -0
  93. package/dist/components/Tooltip/components/TooltipLabel.d.ts.map +1 -0
  94. package/dist/components/Tooltip/components/TooltipLabel.js +59 -0
  95. package/dist/components/Tooltip/index.d.ts +2 -2
  96. package/dist/components/Tooltip/index.d.ts.map +1 -1
  97. package/dist/components/Tooltip/index.js +85 -84
  98. package/dist/components/Tooltip/styles.d.ts +6 -14
  99. package/dist/components/Tooltip/styles.d.ts.map +1 -1
  100. package/dist/components/Tooltip/styles.js +9 -38
  101. package/dist/components/Tooltip/types.d.ts +17 -19
  102. package/dist/components/Tooltip/types.d.ts.map +1 -1
  103. package/dist/components/Tooltip/util.d.ts +0 -4
  104. package/dist/components/Tooltip/util.d.ts.map +1 -1
  105. package/dist/components/Tooltip/util.js +1 -87
  106. package/dist/components/Typography/index.js +1 -1
  107. package/dist/components/Typography/styles.d.ts +3 -3
  108. package/dist/index.d.ts +8 -7
  109. package/dist/index.d.ts.map +1 -1
  110. package/dist/index.js +30 -21
  111. package/dist/shared/hooks/useDisableBodyScroll.js +2 -2
  112. package/dist/shared/hooks/useWindowSize.d.ts +5 -0
  113. package/dist/shared/hooks/useWindowSize.d.ts.map +1 -0
  114. package/dist/shared/hooks/useWindowSize.js +46 -0
  115. package/dist/shared/theme/hooks/useTheme.d.ts +1 -0
  116. package/dist/shared/theme/hooks/useTheme.d.ts.map +1 -1
  117. package/dist/shared/theme/theme.d.ts +1 -0
  118. package/dist/shared/theme/theme.d.ts.map +1 -1
  119. package/dist/shared/theme/theme.js +1 -0
  120. package/dist/utils/getColorValue.d.ts +1 -9
  121. package/dist/utils/getColorValue.d.ts.map +1 -1
  122. package/package.json +1 -1
@@ -23,14 +23,14 @@ var setup = function setup(props) {
23
23
  describe('Alert', function () {
24
24
  it('should it render the alert component', function () {
25
25
  var container = setup({
26
- message: 'test',
26
+ content: 'test',
27
27
  title: 'Test Toast'
28
28
  });
29
29
  expect(container.getByText('test')).toBeInTheDocument();
30
30
  });
31
31
  it('should it render the alert component in outlined variant', function () {
32
32
  var container = setup({
33
- message: 'test',
33
+ content: 'test',
34
34
  title: 'Test Toast',
35
35
  variant: 'outlined'
36
36
  });
@@ -38,7 +38,7 @@ describe('Alert', function () {
38
38
  });
39
39
  it('should it render the alert component in closable variant', function () {
40
40
  var container = setup({
41
- message: 'test',
41
+ content: 'test',
42
42
  title: 'Test Toast',
43
43
  variant: 'closable'
44
44
  });
@@ -46,7 +46,7 @@ describe('Alert', function () {
46
46
  });
47
47
  it('should it render the alert component in success type', function () {
48
48
  var container = setup({
49
- message: 'test',
49
+ content: 'test',
50
50
  title: 'Test Toast',
51
51
  type: 'success'
52
52
  });
@@ -54,7 +54,7 @@ describe('Alert', function () {
54
54
  });
55
55
  it('should it render the alert component in error type', function () {
56
56
  var container = setup({
57
- message: 'test',
57
+ content: 'test',
58
58
  title: 'Test Toast',
59
59
  type: 'error'
60
60
  });
@@ -62,7 +62,7 @@ describe('Alert', function () {
62
62
  });
63
63
  it('should it render the alert component in warning type', function () {
64
64
  var container = setup({
65
- message: 'test',
65
+ content: 'test',
66
66
  title: 'Test Toast',
67
67
  type: 'warning'
68
68
  });
@@ -70,7 +70,7 @@ describe('Alert', function () {
70
70
  });
71
71
  it('should it render the alert component in critical type', function () {
72
72
  var container = setup({
73
- message: 'test',
73
+ content: 'test',
74
74
  title: 'Test Toast',
75
75
  type: 'critical'
76
76
  });
@@ -81,7 +81,7 @@ describe('Alert', function () {
81
81
 
82
82
  var onClose = jest.fn();
83
83
  var container = setup({
84
- message: 'test',
84
+ content: 'test',
85
85
  title: 'Test Toast',
86
86
  variant: 'closable',
87
87
  onClose: onClose
@@ -1,5 +1,5 @@
1
1
  import { FC } from 'react';
2
- import { IAlertProps } from './types';
3
- declare const Alert: FC<IAlertProps>;
2
+ import { AlertProps } from './types';
3
+ declare const Alert: FC<AlertProps>;
4
4
  export default Alert;
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Alert/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAgB3B,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,QAAA,MAAM,KAAK,EAAE,EAAE,CAAC,WAAW,CAuD1B,CAAC;AAEF,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Alert/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAa3B,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,QAAA,MAAM,KAAK,EAAE,EAAE,CAAC,UAAU,CA6BzB,CAAC;AAEF,eAAe,KAAK,CAAC"}
@@ -16,14 +16,10 @@ var _jsxRuntime = require("react/jsx-runtime");
16
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
17
 
18
18
  var Alert = function Alert(_ref) {
19
- var buttonTitle = _ref.buttonTitle,
20
- onButtonClick = _ref.onButtonClick,
21
- message = _ref.message,
19
+ var title = _ref.title,
20
+ content = _ref.content,
21
+ maxWidth = _ref.maxWidth,
22
22
  onClose = _ref.onClose,
23
- title = _ref.title,
24
- fullWidth = _ref.fullWidth,
25
- isLoading = _ref.isLoading,
26
- children = _ref.children,
27
23
  _ref$icon = _ref.icon,
28
24
  icon = _ref$icon === void 0 ? 'info' : _ref$icon,
29
25
  _ref$type = _ref.type,
@@ -31,13 +27,11 @@ var Alert = function Alert(_ref) {
31
27
  _ref$variant = _ref.variant,
32
28
  variant = _ref$variant === void 0 ? 'filled' : _ref$variant;
33
29
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.StyledAlertContainer, {
34
- children: isLoading ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.StyledAlertSkeleton, {
35
- fullWidth: fullWidth
36
- }) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.StyledAlertWrapper, {
37
- haveContent: !!message || !!children,
30
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.StyledAlertWrapper, {
31
+ haveContent: !!content,
38
32
  variant: variant,
39
33
  type: type,
40
- fullWidth: fullWidth,
34
+ maxWidth: maxWidth,
41
35
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.StyledIconBox, {
42
36
  type: type,
43
37
  variant: variant,
@@ -52,20 +46,7 @@ var Alert = function Alert(_ref) {
52
46
  fontSize: "xs",
53
47
  fontWeight: "bold",
54
48
  children: title
55
- }), (children || message) && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
56
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
57
- fontSize: "xs",
58
- fontWeight: "400",
59
- children: message
60
- }), buttonTitle && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.StyledButtonRow, {
61
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.StyledButton, {
62
- onClick: function onClick() {
63
- return onButtonClick && onButtonClick();
64
- },
65
- children: buttonTitle
66
- })
67
- })]
68
- })]
49
+ }), content]
69
50
  }), variant === 'closable' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.StyledCloseIcon, {
70
51
  onClick: function onClick() {
71
52
  return onClose && onClose();
@@ -22,16 +22,4 @@ export declare const StyledCloseIcon: import("@emotion/styled").StyledComponent<
22
22
  theme?: import("@emotion/react").Theme | undefined;
23
23
  as?: import("react").ElementType<any> | undefined;
24
24
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
25
- export declare const StyledAlertSkeleton: import("@emotion/styled").StyledComponent<{
26
- theme?: import("@emotion/react").Theme | undefined;
27
- as?: import("react").ElementType<any> | undefined;
28
- } & IStyledAlert, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
29
- export declare const StyledButtonRow: 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 StyledButton: import("@emotion/styled").StyledComponent<{
34
- theme?: import("@emotion/react").Theme | undefined;
35
- as?: import("react").ElementType<any> | undefined;
36
- }, import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {}>;
37
25
  //# sourceMappingURL=styles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/components/Alert/styles.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,eAAO,MAAM,oBAAoB;;;yGAEhC,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;wHAmD7B,CAAC;AAEH,eAAO,MAAM,aAAa;;;;iBAA4C,OAAO;yGA0B3E,CAAC;AAEH,eAAO,MAAM,YAAY;;;wHASxB,CAAC;AAEF,eAAO,MAAM,eAAe;;;yGAS3B,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;wHA+B/B,CAAC;AAEF,eAAO,MAAM,eAAe;;;yGAK3B,CAAC;AAEF,eAAO,MAAM,YAAY;;;qHAAkB,CAAC"}
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/components/Alert/styles.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,eAAO,MAAM,oBAAoB;;;yGAEhC,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;wHAoD7B,CAAC;AAEH,eAAO,MAAM,aAAa;;;;iBAA4C,OAAO;yGA0B3E,CAAC;AAEH,eAAO,MAAM,YAAY;;;wHASxB,CAAC;AAEF,eAAO,MAAM,eAAe;;;yGAS3B,CAAC"}
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.StyledIconBox = exports.StyledColumn = exports.StyledCloseIcon = exports.StyledButtonRow = exports.StyledButton = exports.StyledAlertWrapper = exports.StyledAlertSkeleton = exports.StyledAlertContainer = void 0;
6
+ exports.StyledIconBox = exports.StyledColumn = exports.StyledCloseIcon = exports.StyledAlertWrapper = exports.StyledAlertContainer = void 0;
7
7
 
8
8
  var _react = require("@emotion/react");
9
9
 
@@ -11,7 +11,7 @@ var _styled = _interopRequireDefault(require("@emotion/styled"));
11
11
 
12
12
  var _colorCheck = require("../../utils/colorCheck");
13
13
 
14
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
14
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
15
15
 
16
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
17
 
@@ -25,7 +25,7 @@ var StyledAlertWrapper = _styled.default.div(function (props) {
25
25
  var buttonPrimaryColor = props.type !== 'default' && props.type ? props.theme.colors[props.type].default : props.theme.colors.neutral.neutral3;
26
26
  var buttonSecondaryColor = props.type !== 'default' && props.type ? props.theme.colorMode === 'dark' ? props.theme.colors[props.type].dark : props.theme.colors[props.type].blurred : props.theme.colors.neutral.neutral1;
27
27
  var secondaryColor = props.type !== 'default' && props.type ? props.theme.colorMode === 'dark' ? props.theme.colors[props.type].dark : props.theme.colors[props.type].blurred : props.theme.colorMode === 'dark' ? props.theme.colors.neutral.neutral6 : props.theme.colors.neutral.neutral1;
28
- return (0, _react.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n align-items: ", ";\n padding: 1rem;\n gap: 1rem;\n border-radius: 8px;\n max-width: ", ";\n background-color: ", ";\n border: ", ";\n color: ", ";\n\n & button {\n display: flex;\n align-items: center;\n justify-content: center;\n font-family: inherit;\n font-weight: 600;\n cursor: pointer;\n border-radius: 8px;\n padding: 8px 24px;\n background-color: ", ";\n border: ", ";\n color: ", ";\n }\n "])), props.haveContent ? 'flex-start' : 'center', props.fullWidth ? '100%' : '459px', props.variant === 'outlined' ? 'transparent' : secondaryColor, props.variant === 'outlined' ? "2px solid ".concat(secondaryColor, ";") : '', props.variant === 'outlined' ? props.theme.colors.neutral.neutral4 : '', props.variant === 'outlined' ? buttonSecondaryColor : 'transparent', props.variant !== 'outlined' ? "2px solid ".concat(buttonPrimaryColor) : '0', props.variant === 'outlined' ? buttonPrimaryColor : props.theme.colorMode === 'dark' ? props.theme.colors.neutral.white : props.theme.colors.neutral.black);
28
+ return (0, _react.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n align-items: ", ";\n padding: 1rem;\n gap: 1rem;\n border-radius: 8px;\n width: 100%;\n background-color: ", ";\n border: ", ";\n color: ", ";\n max-width: ", ";\n\n & button {\n display: flex;\n align-items: center;\n justify-content: center;\n font-family: inherit;\n font-weight: 600;\n cursor: pointer;\n border-radius: 8px;\n padding: 8px 24px;\n background-color: ", ";\n border: ", ";\n color: ", ";\n }\n "])), props.haveContent ? 'flex-start' : 'center', props.variant === 'outlined' ? 'transparent' : secondaryColor, props.variant === 'outlined' ? "2px solid ".concat(secondaryColor, ";") : '', props.variant === 'outlined' ? props.theme.colors.neutral.neutral4 : '', props.maxWidth ? "".concat(props.maxWidth, "px") : '', props.variant === 'outlined' ? buttonSecondaryColor : 'transparent', props.variant !== 'outlined' ? "2px solid ".concat(buttonPrimaryColor) : '0', props.variant === 'outlined' ? buttonPrimaryColor : props.theme.colorMode === 'dark' ? props.theme.colors.neutral.white : props.theme.colors.neutral.black);
29
29
  });
30
30
 
31
31
  exports.StyledAlertWrapper = StyledAlertWrapper;
@@ -47,22 +47,4 @@ var StyledCloseIcon = _styled.default.div(_templateObject5 || (_templateObject5
47
47
  return props.theme.colorMode === 'dark' ? props.theme.colors.neutral.white : props.theme.colors.neutral.black;
48
48
  });
49
49
 
50
- exports.StyledCloseIcon = StyledCloseIcon;
51
-
52
- var StyledAlertSkeleton = _styled.default.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n height: 104px;\n width: ", ";\n border-radius: 8px;\n background-color: ", ";\n overflow: hidden;\n\n &::after {\n content: '';\n inset: 0px;\n width: 100%;\n height: 100%;\n display: block;\n animation: 1.6s linear 0.5s infinite normal none running move;\n transform: translateX(-100%);\n background: linear-gradient(\n 90deg,\n transparent,\n ", ",\n transparent\n );\n }\n\n @keyframes move {\n 0% {\n transform: translateX(-100%);\n }\n 100% {\n transform: translateX(100%);\n }\n }\n"])), function (props) {
53
- return props.fullWidth ? '100%' : '459px';
54
- }, function (props) {
55
- return props.theme.colors.neutral.neutral1;
56
- }, function (props) {
57
- return props.theme.colors.neutral.neutral2;
58
- });
59
-
60
- exports.StyledAlertSkeleton = StyledAlertSkeleton;
61
-
62
- var StyledButtonRow = _styled.default.div(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n gap: 8px;\n flex-wrap: wrap;\n"])));
63
-
64
- exports.StyledButtonRow = StyledButtonRow;
65
-
66
- var StyledButton = _styled.default.button(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral([""])));
67
-
68
- exports.StyledButton = StyledButton;
50
+ exports.StyledCloseIcon = StyledCloseIcon;
@@ -1,7 +1,7 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { ExtendThemeProps } from 'src';
3
3
  import { IconName } from '../Icon/types';
4
- export declare type IAlertProps = {
4
+ export declare type AlertProps = {
5
5
  /**
6
6
  * The icon of the alert.
7
7
  * @default 'info'
@@ -20,32 +20,15 @@ export declare type IAlertProps = {
20
20
  /**
21
21
  * The message of the alert
22
22
  */
23
- message?: string;
24
- /**
25
- * The children of the alert
26
- * @default undefined
27
- */
28
- children?: ReactNode;
23
+ content?: ReactNode;
29
24
  /**
30
25
  * The title of the alert
31
26
  */
32
27
  title: string;
33
28
  /**
34
- * The title of the alert button
35
- */
36
- buttonTitle?: string;
37
- /**
38
- * The action of the alert button
39
- */
40
- onButtonClick?: () => void;
41
- /**
42
- * Whether the alert is loading
43
- */
44
- isLoading?: boolean;
45
- /**
46
- * Sets a full width alert
29
+ * Sets a max width to alert
47
30
  */
48
- fullWidth?: boolean;
31
+ maxWidth?: number;
49
32
  /**
50
33
  * Provides a callback that is called when the close button is clicked.
51
34
  * @description This props are available when variant is set to 'closable'
@@ -53,7 +36,7 @@ export declare type IAlertProps = {
53
36
  onClose?: () => void;
54
37
  };
55
38
  export declare type IStyledAlert = {
56
- fullWidth?: boolean;
39
+ maxWidth?: number;
57
40
  variant?: 'outlined' | 'filled' | 'closable';
58
41
  type?: 'default' | 'success' | 'warning' | 'error' | 'critical' | 'informative';
59
42
  theme?: ExtendThemeProps;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Alert/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,oBAAY,WAAW,GAAG;IACxB;;;OAGG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB;;;OAGG;IACH,OAAO,CAAC,EAAE,UAAU,GAAG,QAAQ,GAAG,UAAU,CAAC;IAC7C;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,UAAU,GAAG,aAAa,CAAC;IAChF;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC;AAEF,oBAAY,YAAY,GAAG;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,UAAU,GAAG,QAAQ,GAAG,UAAU,CAAC;IAC7C,IAAI,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,UAAU,GAAG,aAAa,CAAC;IAChF,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Alert/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,oBAAY,UAAU,GAAG;IACvB;;;OAGG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB;;;OAGG;IACH,OAAO,CAAC,EAAE,UAAU,GAAG,QAAQ,GAAG,UAAU,CAAC;IAC7C;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,UAAU,GAAG,aAAa,CAAC;IAChF;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC;AAEF,oBAAY,YAAY,GAAG;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,UAAU,GAAG,QAAQ,GAAG,UAAU,CAAC;IAC7C,IAAI,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,UAAU,GAAG,aAAa,CAAC;IAChF,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Button/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAOjD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAGvC,QAAA,MAAM,MAAM,EAAE,EAAE,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,GAAG,YAAY,CAkEtE,CAAC;AAEF,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Button/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAOjD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAGvC,QAAA,MAAM,MAAM,EAAE,EAAE,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,GAAG,YAAY,CAkFtE,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -17,7 +17,7 @@ var _Skeleton = _interopRequireDefault(require("../Skeleton"));
17
17
 
18
18
  var _jsxRuntime = require("react/jsx-runtime");
19
19
 
20
- var _excluded = ["children", "leftIcon", "rightIcon", "isLoading", "variant", "bgColor", "size", "fullWidth", "textColor", "type"];
20
+ var _excluded = ["children", "leftIcon", "rightIcon", "isLoading", "variant", "bgColor", "size", "fullWidth", "textColor", "type", "iconColor"];
21
21
 
22
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
23
 
@@ -47,13 +47,16 @@ var Button = function Button(_ref) {
47
47
  textColor = _ref$textColor === void 0 ? '' : _ref$textColor,
48
48
  _ref$type = _ref.type,
49
49
  type = _ref$type === void 0 ? 'button' : _ref$type,
50
+ _ref$iconColor = _ref.iconColor,
51
+ iconColor = _ref$iconColor === void 0 ? '' : _ref$iconColor,
50
52
  props = _objectWithoutProperties(_ref, _excluded);
51
53
 
52
54
  var _useTheme = (0, _index.useTheme)(),
53
55
  theme = _useTheme.theme;
54
56
 
55
57
  var parsedBgColor = (0, _getColorValue.getColorValue)(bgColor, theme, 'success.default');
56
- var parsedTextColor = (0, _getColorValue.getColorValue)(textColor, theme, 'text.default');
58
+ var parsedTextColor = (0, _getColorValue.getColorValue)(textColor, theme, 'neutral.white');
59
+ var parsedIconColor = (0, _getColorValue.getColorValue)(iconColor, theme, 'neutral.white');
57
60
 
58
61
  var getThemeHex = function getThemeHex(path, obj) {
59
62
  var separator = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '.';
@@ -79,6 +82,10 @@ var Button = function Button(_ref) {
79
82
  parsedTextColor = getThemeHex(parsedTextColor, theme);
80
83
  }
81
84
 
85
+ if (parsedIconColor.includes('.')) {
86
+ parsedIconColor = getThemeHex(parsedIconColor, theme);
87
+ }
88
+
82
89
  if (isLoading) {
83
90
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Skeleton.default, {
84
91
  width: 200,
@@ -100,6 +107,7 @@ var Button = function Button(_ref) {
100
107
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.IconContainer, {
101
108
  children: [leftIcon && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.IconWrapper, {
102
109
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
110
+ color: parsedIconColor,
103
111
  name: leftIcon,
104
112
  size: iconSize,
105
113
  "data-testid": "leftIconId"
@@ -107,6 +115,7 @@ var Button = function Button(_ref) {
107
115
  }), children, !leftIcon && rightIcon && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.IconWrapper, {
108
116
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
109
117
  name: rightIcon,
118
+ color: parsedIconColor,
110
119
  size: iconSize,
111
120
  "data-testid": "rightIconId"
112
121
  })
@@ -62,7 +62,7 @@ var Buttons = _styled.default.button(_templateObject || (_templateObject = _tagg
62
62
  return (0, _react.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n &:is(&:hover, &:focus):not(:disabled) {\n box-shadow: inset 0 0 40px 40px rgba(0, 0, 0, 0.2);\n }\n "])));
63
63
 
64
64
  case 'outline':
65
- return (0, _react.css)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n background-color: transparent;\n color: ", ";\n border: 3px ", " solid;\n box-shadow: none;\n &:is(&:hover, &:focus):not(:disabled) {\n filter: var(--button-brightness);\n }\n "])), button.bgColor || button.textColor || theme.colors.primary.default, button.bgColor || button.textColor || theme.colors.primary.default);
65
+ return (0, _react.css)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n background-color: transparent;\n color: ", ";\n border: 3px ", " solid;\n box-shadow: none;\n &:is(&:hover, &:focus):not(:disabled) {\n filter: var(--button-brightness);\n }\n "])), button.textColor || button.bgColor || theme.colors.primary.default, button.bgColor || button.textColor || theme.colors.primary.default);
66
66
 
67
67
  case 'ghost':
68
68
  return (0, _react.css)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n padding-inline: 0;\n background-color: transparent;\n color: ", ";\n &:is(&:hover, &:focus):not(:disabled) {\n filter: var(--button-brightness);\n }\n "])), button.bgColor || button.textColor || theme.colors.primary.default);
@@ -76,6 +76,7 @@ export interface IButtonProps {
76
76
  * @memberof IButtonProps
77
77
  */
78
78
  bgColor?: buttonColor;
79
+ iconColor?: GlobalColorsProps | string;
79
80
  /**
80
81
  * Property that makes the button take 100% of the width of the parent component.
81
82
  *
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Button/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,aAAK,aAAa,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,CAAC;AAC5D,aAAK,WAAW,GAAG,iBAAiB,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AACrD,aAAK,iBAAiB,CAAC,CAAC,GAAG,GAAG,IAAI;IAChC,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,EAAE,CAAC,EAAE,CAAC,CAAC;IACP,EAAE,CAAC,EAAE,CAAC,CAAC;IACP,EAAE,CAAC,EAAE,CAAC,CAAC;IACP,EAAE,CAAC,EAAE,CAAC,CAAC;IACP,GAAG,CAAC,EAAE,CAAC,CAAC;CACT,CAAC;AACF,aAAK,WAAW,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEpD,MAAM,WAAW,YAAY;IAC3B;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAEpB;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,QAAQ,CAAC;IAErB;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;IAEnB;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;IAExB;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IAEtB;;;;;;;;;OASG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;IAEjD;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,WAAW,CAAC;CACzB;AAED,oBAAY,aAAa,GAAG;IAC1B,MAAM,EAAE,YAAY,CAAC;CACtB,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Button/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,aAAK,aAAa,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,CAAC;AAC5D,aAAK,WAAW,GAAG,iBAAiB,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AACrD,aAAK,iBAAiB,CAAC,CAAC,GAAG,GAAG,IAAI;IAChC,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,EAAE,CAAC,EAAE,CAAC,CAAC;IACP,EAAE,CAAC,EAAE,CAAC,CAAC;IACP,EAAE,CAAC,EAAE,CAAC,CAAC;IACP,EAAE,CAAC,EAAE,CAAC,CAAC;IACP,GAAG,CAAC,EAAE,CAAC,CAAC;CACT,CAAC;AACF,aAAK,WAAW,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEpD,MAAM,WAAW,YAAY;IAC3B;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAEpB;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,QAAQ,CAAC;IAErB;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;IAEnB;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;IAExB;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,SAAS,CAAC,EAAE,iBAAiB,GAAG,MAAM,CAAC;IAEvC;;;;;;;;;OASG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;IAEjD;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,WAAW,CAAC;CACzB;AAED,oBAAY,aAAa,GAAG;IAC1B,MAAM,EAAE,YAAY,CAAC;CACtB,CAAC"}
@@ -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"}