@ndlib/component-library 0.0.106 → 0.0.108
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.
|
@@ -52,7 +52,7 @@ const DateDisplay = ({ date: dateString }) => {
|
|
|
52
52
|
mt: 1,
|
|
53
53
|
} }, { children: MONTH_LABELS[date.getMonth()] }))] })));
|
|
54
54
|
};
|
|
55
|
-
export const Card = ({ size, displayDate, headline, image, layout, onClick, raised, truncateHeadlineAfter, heading, headingStyles, headingIcon, headingAction, backgroundColor, sx, imageHeight: imageHeightProp, imageWidth: imageWidthProp, children, }) => {
|
|
55
|
+
export const Card = ({ size, displayDate, headline, image, alt, layout, onClick, raised, truncateHeadlineAfter, heading, headingStyles, headingIcon, headingAction, backgroundColor, sx, imageHeight: imageHeightProp, imageWidth: imageWidthProp, children, }) => {
|
|
56
56
|
const theme = useTheme();
|
|
57
57
|
const contentPaddingX = size === CARD_SIZE.SM ? 3 : 4;
|
|
58
58
|
const isVertical = !layout || layout === CARD_LAYOUT.VERTICAL;
|
|
@@ -77,7 +77,7 @@ export const Card = ({ size, displayDate, headline, image, layout, onClick, rais
|
|
|
77
77
|
borderColor: COLOR.ND_SKY_BLUE_DARK,
|
|
78
78
|
backgroundColor: COLOR.ND_SKY_BLUE,
|
|
79
79
|
}
|
|
80
|
-
: {} }, sx) }, { children: [image && (_jsx("img", { src: image, style: {
|
|
80
|
+
: {} }, sx) }, { children: [image && (_jsx("img", { src: image, alt: alt, style: {
|
|
81
81
|
width: imageWidth,
|
|
82
82
|
height: imageHeight,
|
|
83
83
|
} })), displayDate && _jsx(DateDisplay, { date: displayDate }), heading && (_jsxs(Row, Object.assign({ sx: Object.assign({ bg: COLOR.PRIMARY, color: COLOR.WHITE, width: '100%', px: contentPaddingX, py: 3, justifyContent: 'space-between', alignItems: 'center' }, headingStyles) }, { children: [_jsxs(Row, { children: [headingIcon && (_jsx(Icon, { icon: headingIcon, size: FONT_SIZE.LG, color: COLOR.WHITE, sx: { mr: 2 } })), _jsx(Heading, Object.assign({ size: HEADING_SIZE.SM, sx: {
|
|
@@ -11,7 +11,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import { createContext, useContext, useMemo } from 'react';
|
|
14
|
-
const DEFAULT_EXTERNAL_LINK_MATCHER = /[a-zA-Z0-9]
|
|
14
|
+
const DEFAULT_EXTERNAL_LINK_MATCHER = /[a-zA-Z0-9]*:(\/\/)?[^\s]*/g;
|
|
15
15
|
export const DefaultLink = (_a) => {
|
|
16
16
|
var { to } = _a, rest = __rest(_a, ["to"]);
|
|
17
17
|
return _jsx("a", Object.assign({ href: to }, rest));
|