@hyphen/hyphen-components 4.4.2 → 4.6.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.
- package/dist/components/Card/components/CardHeader/CardHeader.d.ts +2 -10
- package/dist/hyphen-components.cjs.development.js +21 -24
- package/dist/hyphen-components.cjs.development.js.map +1 -1
- package/dist/hyphen-components.cjs.production.min.js +1 -1
- package/dist/hyphen-components.cjs.production.min.js.map +1 -1
- package/dist/hyphen-components.esm.js +21 -24
- package/dist/hyphen-components.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Card/Card.stories.tsx +4 -2
- package/src/components/Card/components/CardHeader/CardHeader.tsx +34 -30
|
@@ -1,21 +1,13 @@
|
|
|
1
1
|
import { FC, ReactNode } from 'react';
|
|
2
2
|
import { BoxProps } from '../../../Box/Box';
|
|
3
3
|
export interface CardHeaderProps extends BoxProps {
|
|
4
|
-
/**
|
|
5
|
-
* contents of the Header
|
|
6
|
-
*/
|
|
7
|
-
children?: ReactNode;
|
|
8
|
-
/**
|
|
9
|
-
* Additional class names to add
|
|
10
|
-
*/
|
|
11
|
-
className?: string;
|
|
12
4
|
/**
|
|
13
5
|
* The title of the card
|
|
14
6
|
*/
|
|
15
7
|
title?: ReactNode;
|
|
16
8
|
/**
|
|
17
|
-
*
|
|
9
|
+
* Description of the card, or element below the title
|
|
18
10
|
*/
|
|
19
|
-
|
|
11
|
+
description?: ReactNode;
|
|
20
12
|
}
|
|
21
13
|
export declare const CardHeader: FC<CardHeaderProps>;
|
|
@@ -871,33 +871,30 @@ var Heading = function Heading(_ref) {
|
|
|
871
871
|
}, restProps), children);
|
|
872
872
|
};
|
|
873
873
|
|
|
874
|
-
var _excluded$F = ["
|
|
874
|
+
var _excluded$F = ["children", "title", "description"];
|
|
875
875
|
var CardHeader = function CardHeader(_ref) {
|
|
876
|
-
var
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
children = _ref$children === void 0 ? null : _ref$children,
|
|
880
|
-
_ref$className = _ref.className,
|
|
881
|
-
className = _ref$className === void 0 ? undefined : _ref$className,
|
|
882
|
-
_ref$display = _ref.display,
|
|
883
|
-
display = _ref$display === void 0 ? 'block' : _ref$display,
|
|
884
|
-
_ref$padding = _ref.padding,
|
|
885
|
-
padding = _ref$padding === void 0 ? '2xl' : _ref$padding,
|
|
886
|
-
_ref$title = _ref.title,
|
|
887
|
-
title = _ref$title === void 0 ? null : _ref$title,
|
|
876
|
+
var children = _ref.children,
|
|
877
|
+
title = _ref.title,
|
|
878
|
+
description = _ref.description,
|
|
888
879
|
restProps = _objectWithoutPropertiesLoose(_ref, _excluded$F);
|
|
889
|
-
var renderTitle = function renderTitle() {
|
|
890
|
-
return typeof title === 'string' ? React.createElement(Heading, {
|
|
891
|
-
size: "sm",
|
|
892
|
-
as: "h4"
|
|
893
|
-
}, title) : title;
|
|
894
|
-
};
|
|
895
880
|
return React.createElement(Box, _extends({
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
881
|
+
padding: "2xl",
|
|
882
|
+
direction: "row",
|
|
883
|
+
gap: "2xl",
|
|
884
|
+
width: "100",
|
|
885
|
+
justifyContent: "space-between"
|
|
886
|
+
}, restProps), React.createElement(Box, {
|
|
887
|
+
gap: "2xs"
|
|
888
|
+
}, title && React.createElement(React.Fragment, null, typeof title === 'string' ? React.createElement(Heading, {
|
|
889
|
+
size: "sm",
|
|
890
|
+
as: "h4"
|
|
891
|
+
}, title) : title), description && React.createElement(React.Fragment, null, typeof description === 'string' ? React.createElement(Box, {
|
|
892
|
+
fontSize: {
|
|
893
|
+
base: 'xs',
|
|
894
|
+
tablet: 'sm'
|
|
895
|
+
},
|
|
896
|
+
color: "secondary"
|
|
897
|
+
}, description) : description)), children);
|
|
901
898
|
};
|
|
902
899
|
|
|
903
900
|
var styles$r = {"card-section-border":"Card-module_card-section-border__OefDX"};
|