@oaknational/oak-components 3.15.0 → 3.17.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/npm/cjs/index.js
CHANGED
|
@@ -936,6 +936,7 @@ var icons = {
|
|
|
936
936
|
strand: "v1776850533/icons/strand.svg",
|
|
937
937
|
plus: "v1781533362/icons/plus.svg",
|
|
938
938
|
hide: "v1785931149/icons/Icon_Hide_r1q6se.svg",
|
|
939
|
+
clock: "v1789035961/icons/clock.svg",
|
|
939
940
|
//learning cycle icons
|
|
940
941
|
"lc-explanation": "v1788336387/icons/lc-explanation.svg",
|
|
941
942
|
"lc-check-for-understanding": "v1788336388/icons/lc-check-for-understanding.svg",
|
|
@@ -4626,6 +4627,11 @@ var StyledOakFlex$2 = styled__default.default(OakFlex)(templateObject_6$5 || (te
|
|
|
4626
4627
|
var $cardOrientation = _a.$cardOrientation;
|
|
4627
4628
|
return getResponsiveCardOrientationStyles($cardOrientation);
|
|
4628
4629
|
});
|
|
4630
|
+
function boolAsDisplay(input) {
|
|
4631
|
+
if (input === undefined)
|
|
4632
|
+
return;
|
|
4633
|
+
return input ? "block" : "none";
|
|
4634
|
+
}
|
|
4629
4635
|
/**
|
|
4630
4636
|
* A highly customisable card component that displays a heading and takes a href at minimum.
|
|
4631
4637
|
*
|
|
@@ -4635,10 +4641,14 @@ var StyledOakFlex$2 = styled__default.default(OakFlex)(templateObject_6$5 || (te
|
|
|
4635
4641
|
* The image aspect ratio can be set to either 1:1 or 4:3.
|
|
4636
4642
|
*/
|
|
4637
4643
|
var OakCard = function (_a) {
|
|
4638
|
-
var _b = _a.as, as = _b === void 0 ? "div" : _b, heading = _a.heading, _c = _a.headingLevel, headingLevel = _c === void 0 ? "h3" : _c, href = _a.href, _d = _a.cardOrientation, cardOrientation = _d === void 0 ? "column" : _d, cardWidth = _a.cardWidth, imageSrc = _a.imageSrc, imageAlt = _a.imageAlt, _e = _a.aspectRatio, aspectRatio = _e === void 0 ? "1/1" : _e, subCopy = _a.subCopy, _f = _a.subCopyColor, subCopyColor = _f === void 0 ? "text-primary" : _f, tagName = _a.tagName, _g = _a.tagBackground, tagBackground = _g === void 0 ? "bg-decorative3-very-subdued" : _g, linkText = _a.linkText, _h = _a.linkIconName, linkIconName = _h === void 0 ? "arrow-right" : _h, _j = _a.hoverBackground, hoverBackground = _j === void 0 ? "bg-btn-secondary-hover" : _j, _k = _a.imageBackgroundColor, imageBackgroundColor = _k === void 0 ? "bg-neutral" : _k;
|
|
4644
|
+
var _b = _a.as, as = _b === void 0 ? "div" : _b, heading = _a.heading, _c = _a.headingLevel, headingLevel = _c === void 0 ? "h3" : _c, href = _a.href, _d = _a.cardOrientation, cardOrientation = _d === void 0 ? "column" : _d, cardWidth = _a.cardWidth, imageSrc = _a.imageSrc, imageAlt = _a.imageAlt, _e = _a.aspectRatio, aspectRatio = _e === void 0 ? "1/1" : _e, subCopy = _a.subCopy, _f = _a.subCopyColor, subCopyColor = _f === void 0 ? "text-primary" : _f, tagName = _a.tagName, _g = _a.tagBackground, tagBackground = _g === void 0 ? "bg-decorative3-very-subdued" : _g, linkText = _a.linkText, _h = _a.linkIconName, linkIconName = _h === void 0 ? "arrow-right" : _h, _j = _a.hoverBackground, hoverBackground = _j === void 0 ? "bg-btn-secondary-hover" : _j, _k = _a.imageBackgroundColor, imageBackgroundColor = _k === void 0 ? "bg-neutral" : _k, showImage = _a.showImage;
|
|
4645
|
+
var displayImage = Array.isArray(showImage)
|
|
4646
|
+
? showImage.map(function (value) { return boolAsDisplay(value); })
|
|
4647
|
+
: boolAsDisplay(showImage);
|
|
4639
4648
|
return (React__default.default.createElement(OakFocusIndicator, { as: as, "$background": "bg-primary", hoverBackground: hoverBackground, "$height": "100%", "$width": cardWidth, "$borderRadius": "border-radius-m2" },
|
|
4640
4649
|
React__default.default.createElement(StyledOakFlex$2, { as: "a", href: href, "$cardOrientation": cardOrientation, "$height": "100%", "$pa": "spacing-16", "$gap": "spacing-16" },
|
|
4641
|
-
imageSrc && (React__default.default.createElement(
|
|
4650
|
+
imageSrc && (React__default.default.createElement(OakBox, { "$display": displayImage },
|
|
4651
|
+
React__default.default.createElement(StyledOakImage, { src: imageSrc || "", alt: imageAlt || "", "$width": "auto", "$aspectRatio": aspectRatio, "$background": imageBackgroundColor, "$borderRadius": "border-radius-m2" }))),
|
|
4642
4652
|
React__default.default.createElement(CardContent, { "$flexDirection": "column", "$justifyContent": "space-between", "$gap": "spacing-16" },
|
|
4643
4653
|
React__default.default.createElement(OakFlex, { "$flexDirection": "column", "$gap": "spacing-16" },
|
|
4644
4654
|
React__default.default.createElement(OakHeading, { tag: headingLevel, "$font": "heading-6" }, heading),
|
package/dist/npm/cjs/types.d.ts
CHANGED
|
@@ -686,6 +686,7 @@ declare const icons: {
|
|
|
686
686
|
readonly strand: "v1776850533/icons/strand.svg";
|
|
687
687
|
readonly plus: "v1781533362/icons/plus.svg";
|
|
688
688
|
readonly hide: "v1785931149/icons/Icon_Hide_r1q6se.svg";
|
|
689
|
+
readonly clock: "v1789035961/icons/clock.svg";
|
|
689
690
|
readonly "lc-explanation": "v1788336387/icons/lc-explanation.svg";
|
|
690
691
|
readonly "lc-check-for-understanding": "v1788336388/icons/lc-check-for-understanding.svg";
|
|
691
692
|
readonly "lc-practice": "v1788336389/icons/lc-practice.svg";
|
|
@@ -3567,6 +3568,10 @@ type OakCardProps = {
|
|
|
3567
3568
|
* The background colour of the card on hover.
|
|
3568
3569
|
*/
|
|
3569
3570
|
hoverBackground?: OakUiRoleToken;
|
|
3571
|
+
/**
|
|
3572
|
+
* Whether to show the image or not
|
|
3573
|
+
*/
|
|
3574
|
+
showImage?: ResponsiveValues<boolean>;
|
|
3570
3575
|
};
|
|
3571
3576
|
/**
|
|
3572
3577
|
* A highly customisable card component that displays a heading and takes a href at minimum.
|
|
@@ -3576,7 +3581,7 @@ type OakCardProps = {
|
|
|
3576
3581
|
* The card can be oriented in a row or column layout and its width can be adjusted using spacing tokens.
|
|
3577
3582
|
* The image aspect ratio can be set to either 1:1 or 4:3.
|
|
3578
3583
|
*/
|
|
3579
|
-
declare const OakCard: ({ as, heading, headingLevel, href, cardOrientation, cardWidth, imageSrc, imageAlt, aspectRatio, subCopy, subCopyColor, tagName, tagBackground, linkText, linkIconName, hoverBackground, imageBackgroundColor, }: OakCardProps) => React$1.JSX.Element;
|
|
3584
|
+
declare const OakCard: ({ as, heading, headingLevel, href, cardOrientation, cardWidth, imageSrc, imageAlt, aspectRatio, subCopy, subCopyColor, tagName, tagBackground, linkText, linkIconName, hoverBackground, imageBackgroundColor, showImage, }: OakCardProps) => React$1.JSX.Element;
|
|
3580
3585
|
|
|
3581
3586
|
type OakBreadcrumb = {
|
|
3582
3587
|
text: string;
|
|
@@ -17,6 +17,13 @@ import { sizeStyle } from '../../../styles/utils/sizeStyle.js';
|
|
|
17
17
|
import { flexStyle } from '../../../styles/utils/flexStyle.js';
|
|
18
18
|
import { colorStyle } from '../../../styles/utils/colorStyle.js';
|
|
19
19
|
import { borderStyle } from '../../../styles/utils/borderStyle.js';
|
|
20
|
+
import { OakBox } from '../../layout-and-structure/OakBox/OakBox.js';
|
|
21
|
+
import '../../layout-and-structure/OakGrid/OakGrid.js';
|
|
22
|
+
import '../../layout-and-structure/OakGridArea/OakGridArea.js';
|
|
23
|
+
import '../../layout-and-structure/OakMaxWidth/OakMaxWidth.js';
|
|
24
|
+
import '../../layout-and-structure/OakAccordion/OakAccordion.js';
|
|
25
|
+
import '../../internal-components/InternalChevronAccordion/InternalChevronAccordion.js';
|
|
26
|
+
import '../../layout-and-structure/OakCollapsibleContent/OakCollapsibleContent.js';
|
|
20
27
|
|
|
21
28
|
var CardContent = styled(OakFlex)(templateObject_1 || (templateObject_1 = __makeTemplateObject([""], [""])));
|
|
22
29
|
var StyledOakImage = styled(OakImage)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", "\n ", "\n ", "\n\n img {\n border-radius: inherit;\n object-fit: cover;\n }\n"], ["\n ", "\n ", "\n ", "\n\n img {\n border-radius: inherit;\n object-fit: cover;\n }\n"])), sizeStyle, colorStyle, borderStyle);
|
|
@@ -36,6 +43,11 @@ var StyledOakFlex = styled(OakFlex)(templateObject_6 || (templateObject_6 = __ma
|
|
|
36
43
|
var $cardOrientation = _a.$cardOrientation;
|
|
37
44
|
return getResponsiveCardOrientationStyles($cardOrientation);
|
|
38
45
|
});
|
|
46
|
+
function boolAsDisplay(input) {
|
|
47
|
+
if (input === undefined)
|
|
48
|
+
return;
|
|
49
|
+
return input ? "block" : "none";
|
|
50
|
+
}
|
|
39
51
|
/**
|
|
40
52
|
* A highly customisable card component that displays a heading and takes a href at minimum.
|
|
41
53
|
*
|
|
@@ -45,10 +57,14 @@ var StyledOakFlex = styled(OakFlex)(templateObject_6 || (templateObject_6 = __ma
|
|
|
45
57
|
* The image aspect ratio can be set to either 1:1 or 4:3.
|
|
46
58
|
*/
|
|
47
59
|
var OakCard = function (_a) {
|
|
48
|
-
var _b = _a.as, as = _b === void 0 ? "div" : _b, heading = _a.heading, _c = _a.headingLevel, headingLevel = _c === void 0 ? "h3" : _c, href = _a.href, _d = _a.cardOrientation, cardOrientation = _d === void 0 ? "column" : _d, cardWidth = _a.cardWidth, imageSrc = _a.imageSrc, imageAlt = _a.imageAlt, _e = _a.aspectRatio, aspectRatio = _e === void 0 ? "1/1" : _e, subCopy = _a.subCopy, _f = _a.subCopyColor, subCopyColor = _f === void 0 ? "text-primary" : _f, tagName = _a.tagName, _g = _a.tagBackground, tagBackground = _g === void 0 ? "bg-decorative3-very-subdued" : _g, linkText = _a.linkText, _h = _a.linkIconName, linkIconName = _h === void 0 ? "arrow-right" : _h, _j = _a.hoverBackground, hoverBackground = _j === void 0 ? "bg-btn-secondary-hover" : _j, _k = _a.imageBackgroundColor, imageBackgroundColor = _k === void 0 ? "bg-neutral" : _k;
|
|
60
|
+
var _b = _a.as, as = _b === void 0 ? "div" : _b, heading = _a.heading, _c = _a.headingLevel, headingLevel = _c === void 0 ? "h3" : _c, href = _a.href, _d = _a.cardOrientation, cardOrientation = _d === void 0 ? "column" : _d, cardWidth = _a.cardWidth, imageSrc = _a.imageSrc, imageAlt = _a.imageAlt, _e = _a.aspectRatio, aspectRatio = _e === void 0 ? "1/1" : _e, subCopy = _a.subCopy, _f = _a.subCopyColor, subCopyColor = _f === void 0 ? "text-primary" : _f, tagName = _a.tagName, _g = _a.tagBackground, tagBackground = _g === void 0 ? "bg-decorative3-very-subdued" : _g, linkText = _a.linkText, _h = _a.linkIconName, linkIconName = _h === void 0 ? "arrow-right" : _h, _j = _a.hoverBackground, hoverBackground = _j === void 0 ? "bg-btn-secondary-hover" : _j, _k = _a.imageBackgroundColor, imageBackgroundColor = _k === void 0 ? "bg-neutral" : _k, showImage = _a.showImage;
|
|
61
|
+
var displayImage = Array.isArray(showImage)
|
|
62
|
+
? showImage.map(function (value) { return boolAsDisplay(value); })
|
|
63
|
+
: boolAsDisplay(showImage);
|
|
49
64
|
return (React.createElement(OakFocusIndicator, { as: as, "$background": "bg-primary", hoverBackground: hoverBackground, "$height": "100%", "$width": cardWidth, "$borderRadius": "border-radius-m2" },
|
|
50
65
|
React.createElement(StyledOakFlex, { as: "a", href: href, "$cardOrientation": cardOrientation, "$height": "100%", "$pa": "spacing-16", "$gap": "spacing-16" },
|
|
51
|
-
imageSrc && (React.createElement(
|
|
66
|
+
imageSrc && (React.createElement(OakBox, { "$display": displayImage },
|
|
67
|
+
React.createElement(StyledOakImage, { src: imageSrc || "", alt: imageAlt || "", "$width": "auto", "$aspectRatio": aspectRatio, "$background": imageBackgroundColor, "$borderRadius": "border-radius-m2" }))),
|
|
52
68
|
React.createElement(CardContent, { "$flexDirection": "column", "$justifyContent": "space-between", "$gap": "spacing-16" },
|
|
53
69
|
React.createElement(OakFlex, { "$flexDirection": "column", "$gap": "spacing-16" },
|
|
54
70
|
React.createElement(OakHeading, { tag: headingLevel, "$font": "heading-6" }, heading),
|
package/dist/npm/es/image-map.js
CHANGED
|
@@ -87,6 +87,7 @@ var icons = {
|
|
|
87
87
|
strand: "v1776850533/icons/strand.svg",
|
|
88
88
|
plus: "v1781533362/icons/plus.svg",
|
|
89
89
|
hide: "v1785931149/icons/Icon_Hide_r1q6se.svg",
|
|
90
|
+
clock: "v1789035961/icons/clock.svg",
|
|
90
91
|
//learning cycle icons
|
|
91
92
|
"lc-explanation": "v1788336387/icons/lc-explanation.svg",
|
|
92
93
|
"lc-check-for-understanding": "v1788336388/icons/lc-check-for-understanding.svg",
|
package/dist/npm/es/types.d.ts
CHANGED
|
@@ -686,6 +686,7 @@ declare const icons: {
|
|
|
686
686
|
readonly strand: "v1776850533/icons/strand.svg";
|
|
687
687
|
readonly plus: "v1781533362/icons/plus.svg";
|
|
688
688
|
readonly hide: "v1785931149/icons/Icon_Hide_r1q6se.svg";
|
|
689
|
+
readonly clock: "v1789035961/icons/clock.svg";
|
|
689
690
|
readonly "lc-explanation": "v1788336387/icons/lc-explanation.svg";
|
|
690
691
|
readonly "lc-check-for-understanding": "v1788336388/icons/lc-check-for-understanding.svg";
|
|
691
692
|
readonly "lc-practice": "v1788336389/icons/lc-practice.svg";
|
|
@@ -3567,6 +3568,10 @@ type OakCardProps = {
|
|
|
3567
3568
|
* The background colour of the card on hover.
|
|
3568
3569
|
*/
|
|
3569
3570
|
hoverBackground?: OakUiRoleToken;
|
|
3571
|
+
/**
|
|
3572
|
+
* Whether to show the image or not
|
|
3573
|
+
*/
|
|
3574
|
+
showImage?: ResponsiveValues<boolean>;
|
|
3570
3575
|
};
|
|
3571
3576
|
/**
|
|
3572
3577
|
* A highly customisable card component that displays a heading and takes a href at minimum.
|
|
@@ -3576,7 +3581,7 @@ type OakCardProps = {
|
|
|
3576
3581
|
* The card can be oriented in a row or column layout and its width can be adjusted using spacing tokens.
|
|
3577
3582
|
* The image aspect ratio can be set to either 1:1 or 4:3.
|
|
3578
3583
|
*/
|
|
3579
|
-
declare const OakCard: ({ as, heading, headingLevel, href, cardOrientation, cardWidth, imageSrc, imageAlt, aspectRatio, subCopy, subCopyColor, tagName, tagBackground, linkText, linkIconName, hoverBackground, imageBackgroundColor, }: OakCardProps) => React$1.JSX.Element;
|
|
3584
|
+
declare const OakCard: ({ as, heading, headingLevel, href, cardOrientation, cardWidth, imageSrc, imageAlt, aspectRatio, subCopy, subCopyColor, tagName, tagBackground, linkText, linkIconName, hoverBackground, imageBackgroundColor, showImage, }: OakCardProps) => React$1.JSX.Element;
|
|
3580
3585
|
|
|
3581
3586
|
type OakBreadcrumb = {
|
|
3582
3587
|
text: string;
|