venice-ui 2.4.2 → 2.4.3

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.
@@ -8,9 +8,12 @@ const react_1 = __importDefault(require("react"));
8
8
  const Card_styles_1 = require("./Card.styles");
9
9
  const ElementHeader_1 = require("../ElementHeader");
10
10
  const Theme_1 = require("../../Theme");
11
- const Card = ({ children, title, actionLabel, theme = Theme_1.mainTheme, iconColor = theme.textColor, iconHoverColor = theme.action, handleClick, handleBack, height, options, shadow = true, headerDivader = false, actionDisabled = false, }) => {
11
+ const Card = ({ children, title, actionLabel, theme = Theme_1.mainTheme, iconColor = theme.textColor, iconHoverColor = theme.action, handleClick, handleBack, height, options, shadow = true, headerDivader = false, actionDisabled = false, customHeader, }) => {
12
+ const hasHeader = !!title || !!actionLabel || !!customHeader;
12
13
  return (react_1.default.createElement(Card_styles_1.CardElement, { height: height, shadow: shadow },
13
- (title || actionLabel) && (react_1.default.createElement(ElementHeader_1.ElementHeader, { title: title, actionLabel: actionLabel, handleClick: handleClick, handleBack: handleBack, options: options, theme: theme, iconColor: iconColor, iconHoverColor: iconHoverColor, bottomDivader: headerDivader, actionDisabled: actionDisabled })),
14
- react_1.default.createElement(Card_styles_1.CardContent, { soloMode: !title && !actionLabel }, children)));
14
+ customHeader
15
+ ? customHeader
16
+ : (title || actionLabel) && (react_1.default.createElement(ElementHeader_1.ElementHeader, { title: title, actionLabel: actionLabel, handleClick: handleClick, handleBack: handleBack, options: options, theme: theme, iconColor: iconColor, iconHoverColor: iconHoverColor, bottomDivader: headerDivader, actionDisabled: actionDisabled })),
17
+ react_1.default.createElement(Card_styles_1.CardContent, { soloMode: !hasHeader }, children)));
15
18
  };
16
19
  exports.Card = Card;
@@ -2,8 +2,11 @@ import React from 'react';
2
2
  import { CardContent, CardElement } from './Card.styles';
3
3
  import { ElementHeader } from '../ElementHeader';
4
4
  import { mainTheme } from '../../Theme';
5
- export const Card = ({ children, title, actionLabel, theme = mainTheme, iconColor = theme.textColor, iconHoverColor = theme.action, handleClick, handleBack, height, options, shadow = true, headerDivader = false, actionDisabled = false, }) => {
5
+ export const Card = ({ children, title, actionLabel, theme = mainTheme, iconColor = theme.textColor, iconHoverColor = theme.action, handleClick, handleBack, height, options, shadow = true, headerDivader = false, actionDisabled = false, customHeader, }) => {
6
+ const hasHeader = !!title || !!actionLabel || !!customHeader;
6
7
  return (React.createElement(CardElement, { height: height, shadow: shadow },
7
- (title || actionLabel) && (React.createElement(ElementHeader, { title: title, actionLabel: actionLabel, handleClick: handleClick, handleBack: handleBack, options: options, theme: theme, iconColor: iconColor, iconHoverColor: iconHoverColor, bottomDivader: headerDivader, actionDisabled: actionDisabled })),
8
- React.createElement(CardContent, { soloMode: !title && !actionLabel }, children)));
8
+ customHeader
9
+ ? customHeader
10
+ : (title || actionLabel) && (React.createElement(ElementHeader, { title: title, actionLabel: actionLabel, handleClick: handleClick, handleBack: handleBack, options: options, theme: theme, iconColor: iconColor, iconHoverColor: iconHoverColor, bottomDivader: headerDivader, actionDisabled: actionDisabled })),
11
+ React.createElement(CardContent, { soloMode: !hasHeader }, children)));
9
12
  };
@@ -2,6 +2,7 @@ import React, { FC } from 'react';
2
2
  import { IAction } from '../../types';
3
3
  interface ICardProps {
4
4
  children: React.ReactNode;
5
+ customHeader?: React.ReactNode;
5
6
  title?: string;
6
7
  actionLabel?: string;
7
8
  handleClick?: () => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "venice-ui",
3
- "version": "2.4.2",
3
+ "version": "2.4.3",
4
4
  "description": "Component library",
5
5
  "main": "index.js",
6
6
  "module": "./dist/esm/index.js",