@@ -133,6 +134,40 @@ Default.args = {
),
};
+export const CardWithHeader = (args) => (
+
+
+
+
+ November 7, 2018
+ Order #12931820
+
+
+ Total
+ $623.98
+
+
+
+
+ Main content goes here.
+
+
+
+
+
+
+);
+
+CardWithHeader.args = {
+ background: SageTokens.COLOR_SLIDERS.GREY_200,
+};
+
+CardWithHeader.argTypes = {
+ ...selectArgs({
+ background: SageTokens.COLOR_SLIDERS
+ }),
+};
+
export const InteractiveCard = () => (
diff --git a/packages/sage-react/lib/Card/CardHeader.jsx b/packages/sage-react/lib/Card/CardHeader.jsx
new file mode 100644
index 0000000000..35dd84c5ab
--- /dev/null
+++ b/packages/sage-react/lib/Card/CardHeader.jsx
@@ -0,0 +1,44 @@
+import React from 'react';
+import PropTypes, { oneOfType } from 'prop-types';
+import { SageTokens } from '../configs';
+
+export const CardHeader = ({ background, children, ...rest }) => {
+ const { style } = rest;
+ const styles = style || {};
+
+ const hasCustomBackground = background
+ && !Object.values(SageTokens.COLOR_SLIDERS).includes(background);
+
+ if (hasCustomBackground) {
+ styles['--sage-card-background'] = background;
+ }
+
+ return (
+ x).join(' ')
+ }
+ {...rest}
+ style={styles}
+ >
+ {children}
+
+ );
+};
+
+CardHeader.defaultProps = {
+ background: SageTokens.COLOR_SLIDERS.GREY_200,
+ children: null,
+};
+
+CardHeader.propTypes = {
+ background: oneOfType([
+ PropTypes.string,
+ PropTypes.oneOf(Object.values(SageTokens.COLOR_SLIDERS)),
+ ]),
+ children: PropTypes.node,
+};