@oaknational/oak-components 3.14.4 → 3.15.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.
@@ -4679,13 +4679,13 @@ var StyledAccordionButton$2 = styled__default.default(InternalAccordionButton)(t
4679
4679
  * Internal accordion component that handles the accordion logic
4680
4680
  */
4681
4681
  var Accordion$2 = function (_a) {
4682
- var children = _a.children, id = _a.id, selectAllChecked = _a.selectAllChecked, subheading = _a.subheading, handleToggleSelectAll = _a.handleToggleSelectAll, styleProps = tslib.__rest(_a, ["children", "id", "selectAllChecked", "subheading", "handleToggleSelectAll"]);
4682
+ var children = _a.children, id = _a.id, selectAllChecked = _a.selectAllChecked, subheading = _a.subheading, _b = _a.showCheckbox, showCheckbox = _b === void 0 ? true : _b, handleToggleSelectAll = _a.handleToggleSelectAll, styleProps = tslib.__rest(_a, ["children", "id", "selectAllChecked", "subheading", "showCheckbox", "handleToggleSelectAll"]);
4683
4683
  var isOpen = useAccordionContext().isOpen;
4684
4684
  return (React__default.default.createElement(OakFlex, tslib.__assign({ "$bt": "border-solid-s", "$bb": isOpen ? "border-solid-none" : "border-solid-s", "$borderColor": "border-neutral-lighter", "$pv": "spacing-12", "$flexDirection": "column", "$width": "100%" }, styleProps),
4685
4685
  React__default.default.createElement(OakFlex, { "$alignItems": "center", "$width": "100%" },
4686
4686
  React__default.default.createElement(OakFlex, { "$alignItems": "center", "$width": "100%", "$gap": "spacing-16" },
4687
- React__default.default.createElement(OakBox, { id: "select-all-wrapper", "$pa": "spacing-8", onClick: handleToggleSelectAll },
4688
- React__default.default.createElement(OakCheckBox, { onChange: function () { return undefined; }, checked: selectAllChecked, id: "select-all", name: "select-all", value: "", "aria-labelledby": "resources-accordion-heading" })),
4687
+ showCheckbox ? (React__default.default.createElement(OakBox, { id: "select-all-wrapper", "$pa": "spacing-8", onClick: handleToggleSelectAll },
4688
+ React__default.default.createElement(OakCheckBox, { onChange: function () { return undefined; }, checked: selectAllChecked, id: "select-all", name: "select-all", value: "", "aria-labelledby": "resources-accordion-heading" }))) : null,
4689
4689
  React__default.default.createElement(StyledAccordionButton$2, { "$justifyContent": "space-between", "$flexGrow": 1, id: id, "$alignItems": "center", "$mr": "spacing-12" },
4690
4690
  React__default.default.createElement(OakFlex, { "$justifyContent": "center", "$alignItems": "center", "$gap": "spacing-12" },
4691
4691
  React__default.default.createElement(OakFlex, { "$flexDirection": "column", "$justifyContent": "center", "$alignItems": "start" },
@@ -6859,9 +6859,15 @@ var MultipleIcons = function (_a) {
6859
6859
  return (React__default.default.createElement(OakFlex, { "$background": "bg-decorative5-main", "$pa": "spacing-12", "$alignItems": "center", "$flexDirection": "column", "$gap": "spacing-16", "$justifyContent": "center" }, iconName.map(function (name, index) { return (React__default.default.createElement(OakFlex, { key: "".concat(name, "-").concat(index), "$position": "relative", "$alignContent": "center", "$alignItems": "center", "$justifyContent": "center" },
6860
6860
  React__default.default.createElement(OakIcon, { iconName: name, "$width": "spacing-40", "$height": "spacing-40", "$mr": index < iconName.length - 1 ? "spacing-8" : "spacing-0" }))); })));
6861
6861
  };
6862
- var LabelContainer = styled__default.default("label")(templateObject_1$j || (templateObject_1$j = tslib.__makeTemplateObject(["\n flex: 1;\n cursor: pointer;\n display: flex;\n\n &:has(input:disabled) {\n cursor: default;\n #resource-card-title {\n text-decoration: none;\n }\n }\n"], ["\n flex: 1;\n cursor: pointer;\n display: flex;\n\n &:has(input:disabled) {\n cursor: default;\n #resource-card-title {\n text-decoration: none;\n }\n }\n"])));
6863
- var Container = styled__default.default(OakFlex)(templateObject_2$8 || (templateObject_2$8 = tslib.__makeTemplateObject(["\n &:has(input:focus-visible) {\n box-shadow:\n ", ",\n ", ";\n }\n\n @media (hover: hover) {\n &:hover:not(:has(input:disabled), :active) {\n background: ", ";\n #resource-card-title {\n text-decoration: underline;\n }\n }\n\n &:active:not(:has(input:disabled)) {\n #resource-card-title {\n text-decoration: underline;\n }\n }\n }\n"], ["\n &:has(input:focus-visible) {\n box-shadow:\n ", ",\n ", ";\n }\n\n @media (hover: hover) {\n &:hover:not(:has(input:disabled), :active) {\n background: ", ";\n #resource-card-title {\n text-decoration: underline;\n }\n }\n\n &:active:not(:has(input:disabled)) {\n #resource-card-title {\n text-decoration: underline;\n }\n }\n }\n"])), parseDropShadow("drop-shadow-centered-lemon"), parseDropShadow("drop-shadow-centered-grey"), function (props) {
6864
- return props.$hoverBackground ? parseColor(props.$hoverBackground) : null;
6862
+ var LabelContainer = styled__default.default("label")(templateObject_1$j || (templateObject_1$j = tslib.__makeTemplateObject(["\n flex: 1;\n cursor: ", ";\n display: flex;\n\n &:has(input:disabled) {\n cursor: default;\n #resource-card-title {\n text-decoration: none;\n }\n }\n"], ["\n flex: 1;\n cursor: ", ";\n display: flex;\n\n &:has(input:disabled) {\n cursor: default;\n #resource-card-title {\n text-decoration: none;\n }\n }\n"])), function (props) { return (props.$showSelectionControl ? "pointer" : "default"); });
6863
+ var Container = styled__default.default(OakFlex)(templateObject_2$8 || (templateObject_2$8 = tslib.__makeTemplateObject(["\n &:has(input:focus-visible) {\n box-shadow:\n ", ",\n ", ";\n }\n\n @media (hover: hover) {\n &:hover:not(:has(input:disabled), :active) {\n background: ", ";\n #resource-card-title {\n text-decoration: ", ";\n }\n }\n\n &:hover:active:not(:has(input:disabled)) {\n #resource-card-title {\n text-decoration: ", ";\n }\n }\n }\n"], ["\n &:has(input:focus-visible) {\n box-shadow:\n ", ",\n ", ";\n }\n\n @media (hover: hover) {\n &:hover:not(:has(input:disabled), :active) {\n background: ", ";\n #resource-card-title {\n text-decoration: ", ";\n }\n }\n\n &:hover:active:not(:has(input:disabled)) {\n #resource-card-title {\n text-decoration: ", ";\n }\n }\n }\n"])), parseDropShadow("drop-shadow-centered-lemon"), parseDropShadow("drop-shadow-centered-grey"), function (props) {
6864
+ return props.$showSelectionControl
6865
+ ? parseColor("bg-btn-secondary-hover")
6866
+ : parseColor("bg-primary");
6867
+ }, function (props) {
6868
+ return props.$showSelectionControl ? "underline" : "none";
6869
+ }, function (props) {
6870
+ return props.$showSelectionControl ? "underline" : "none";
6865
6871
  });
6866
6872
  /**
6867
6873
  * Resource cards present a downloadable/shareable resource with metadata and a selectable control.
@@ -6875,7 +6881,7 @@ var Container = styled__default.default(OakFlex)(templateObject_2$8 || (template
6875
6881
  var OakResourceCard = function (props) {
6876
6882
  var _a;
6877
6883
  var radioContext = React.useContext(RadioContext);
6878
- var title = props.title, fileSize = props.fileSize, description = props.description, iconName = props.iconName, value = props.value, _b = props.disabled, disabled = _b === void 0 ? false : _b, defaultChecked = props.defaultChecked, checked = props.checked, onChange = props.onChange, onFocus = props.onFocus, onBlur = props.onBlur, onHovered = props.onHovered, _c = props.isRadio, isRadio = _c === void 0 ? false : _c, dataTestId = props["data-testid"], _d = props.isEditable, isEditable = _d === void 0 ? false : _d, rest = tslib.__rest(props, ["title", "fileSize", "description", "iconName", "value", "disabled", "defaultChecked", "checked", "onChange", "onFocus", "onBlur", "onHovered", "isRadio", "data-testid", "isEditable"]);
6884
+ var title = props.title, fileSize = props.fileSize, description = props.description, iconName = props.iconName, value = props.value, _b = props.disabled, disabled = _b === void 0 ? false : _b, defaultChecked = props.defaultChecked, checked = props.checked, onChange = props.onChange, onFocus = props.onFocus, onBlur = props.onBlur, onHovered = props.onHovered, _c = props.showSelectionControl, showSelectionControl = _c === void 0 ? true : _c, _d = props.isRadio, isRadio = _d === void 0 ? false : _d, dataTestId = props["data-testid"], _e = props.isEditable, isEditable = _e === void 0 ? false : _e, rest = tslib.__rest(props, ["title", "fileSize", "description", "iconName", "value", "disabled", "defaultChecked", "checked", "onChange", "onFocus", "onBlur", "onHovered", "showSelectionControl", "isRadio", "data-testid", "isEditable"]);
6879
6885
  var checkboxSize = "spacing-24";
6880
6886
  var checkedBorderColor = "border-primary";
6881
6887
  var disabledColor = "text-disabled";
@@ -6894,8 +6900,8 @@ var OakResourceCard = function (props) {
6894
6900
  onChange === null || onChange === void 0 ? void 0 : onChange(event);
6895
6901
  };
6896
6902
  var isMultipleIcon = Array.isArray(iconName);
6897
- return (React__default.default.createElement(Container, { "data-testid": dataTestId, "$background": "bg-primary", "$ba": "border-solid-m", "$borderRadius": "border-radius-s", "$overflow": "hidden", "$hoverBackground": "bg-btn-secondary-hover", "$color": "text-primary", "$width": "100%" },
6898
- React__default.default.createElement(LabelContainer, null,
6903
+ return (React__default.default.createElement(Container, { "data-testid": dataTestId, "$background": "bg-primary", "$ba": "border-solid-m", "$borderRadius": "border-radius-s", "$overflow": "hidden", "$showSelectionControl": showSelectionControl, "$color": "text-primary", "$width": "100%" },
6904
+ React__default.default.createElement(LabelContainer, { "$showSelectionControl": showSelectionControl },
6899
6905
  React__default.default.createElement(OakFlex, { "$alignItems": "stretch", "$flexGrow": 1 },
6900
6906
  isMultipleIcon ? (React__default.default.createElement(MultipleIcons, { iconName: iconName })) : (React__default.default.createElement(SingleIcon, { iconName: iconName })),
6901
6907
  React__default.default.createElement(OakFlex, { "$flexGrow": 1, "$flexDirection": "column", "$justifyContent": "center", "$gap": "spacing-4", "$pv": "spacing-12", "$ph": "spacing-16" },
@@ -6906,8 +6912,8 @@ var OakResourceCard = function (props) {
6906
6912
  isEditable && (React__default.default.createElement(OakTagFunctional, { "$alignSelf": "flex-end", "$font": "heading-light-7", label: "Editable", "$background": "bg-decorative2-main" }))))),
6907
6913
  React__default.default.createElement(OakFlex, null,
6908
6914
  React__default.default.createElement(OakFlex, { "$alignItems": "center", "$pr": "spacing-16" },
6909
- isRadio && (React__default.default.createElement(InternalRadioWrapper, { checked: isChecked, size: checkboxSize, disabled: anyDisabled, radioBorderColor: checkedBorderColor, internalRadio: React__default.default.createElement(InternalRadio, tslib.__assign({}, rest, { id: props.id, name: (_a = props.name) !== null && _a !== void 0 ? _a : radioContext.name, value: value, disabled: anyDisabled, onHovered: onHovered, onChange: handleRadioChange, onFocus: onFocus, onBlur: onBlur, defaultChecked: defaultChecked, checked: radioChecked })) })),
6910
- !isRadio && (React__default.default.createElement(InternalCheckBoxWrapper, { size: checkboxSize, internalCheckbox: React__default.default.createElement(InternalCheckBoxHoverFocus, tslib.__assign({ name: radioContext.name, value: value, "$width": checkboxSize, "$height": checkboxSize, "$ba": "border-solid-m", "$borderRadius": "border-radius-xs", "$borderColor": "text-primary", "$checkedBackground": currentCheckedBackgroundFill, "$checkedBorderColor": currentCheckedBorderColor, "$uncheckedBorderColor": "border-neutral", "$hoverBorderRadius": "border-radius-xs", onHovered: onHovered, onChange: onChange, onFocus: onFocus, onBlur: onBlur, defaultChecked: defaultChecked, checked: checked, disabled: anyDisabled }, rest)), iconPadding: "spacing-0" })))))));
6915
+ showSelectionControl && isRadio && (React__default.default.createElement(InternalRadioWrapper, { checked: isChecked, size: checkboxSize, disabled: anyDisabled, radioBorderColor: checkedBorderColor, internalRadio: React__default.default.createElement(InternalRadio, tslib.__assign({}, rest, { id: props.id, name: (_a = props.name) !== null && _a !== void 0 ? _a : radioContext.name, value: value, disabled: anyDisabled, onHovered: onHovered, onChange: handleRadioChange, onFocus: onFocus, onBlur: onBlur, defaultChecked: defaultChecked, checked: radioChecked })) })),
6916
+ showSelectionControl && !isRadio && (React__default.default.createElement(InternalCheckBoxWrapper, { size: checkboxSize, internalCheckbox: React__default.default.createElement(InternalCheckBoxHoverFocus, tslib.__assign({ name: radioContext.name, value: value, "$width": checkboxSize, "$height": checkboxSize, "$ba": "border-solid-m", "$borderRadius": "border-radius-xs", "$borderColor": "text-primary", "$checkedBackground": currentCheckedBackgroundFill, "$checkedBorderColor": currentCheckedBorderColor, "$uncheckedBorderColor": "border-neutral", "$hoverBorderRadius": "border-radius-xs", onHovered: onHovered, onChange: onChange, onFocus: onFocus, onBlur: onBlur, defaultChecked: defaultChecked, checked: checked, disabled: anyDisabled }, rest)), iconPadding: "spacing-0" })))))));
6911
6917
  };
6912
6918
  var templateObject_1$j, templateObject_2$8;
6913
6919
 
@@ -3621,6 +3621,10 @@ type OakResourcesAccordionProps = {
3621
3621
  * Whether the accordion starts in the open state, defaults to false
3622
3622
  */
3623
3623
  initialOpen?: boolean;
3624
+ /**
3625
+ * Whether to show the select all checkbox
3626
+ */
3627
+ showCheckbox?: boolean;
3624
3628
  } & FlexStyleProps & OakBoxProps & ColorStyleProps;
3625
3629
  /**
3626
3630
  * OakResourcesAccordion renamed from OakDownloadsAccordion.
@@ -4453,6 +4457,12 @@ type OakResourceCardProps = BaseCheckBoxProps & {
4453
4457
  * The icon used to represent the resource type.
4454
4458
  */
4455
4459
  iconName: IconName | IconName[];
4460
+ /**
4461
+ * Whether to show the selection control (checkbox or radio button).
4462
+ *
4463
+ * @default true
4464
+ */
4465
+ showSelectionControl?: boolean;
4456
4466
  /**
4457
4467
  * If true, renders the selection control as a radio button instead of a checkbox.
4458
4468
  *
@@ -33,9 +33,15 @@ var MultipleIcons = function (_a) {
33
33
  return (React.createElement(OakFlex, { "$background": "bg-decorative5-main", "$pa": "spacing-12", "$alignItems": "center", "$flexDirection": "column", "$gap": "spacing-16", "$justifyContent": "center" }, iconName.map(function (name, index) { return (React.createElement(OakFlex, { key: "".concat(name, "-").concat(index), "$position": "relative", "$alignContent": "center", "$alignItems": "center", "$justifyContent": "center" },
34
34
  React.createElement(OakIcon, { iconName: name, "$width": "spacing-40", "$height": "spacing-40", "$mr": index < iconName.length - 1 ? "spacing-8" : "spacing-0" }))); })));
35
35
  };
36
- var LabelContainer = styled("label")(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex: 1;\n cursor: pointer;\n display: flex;\n\n &:has(input:disabled) {\n cursor: default;\n #resource-card-title {\n text-decoration: none;\n }\n }\n"], ["\n flex: 1;\n cursor: pointer;\n display: flex;\n\n &:has(input:disabled) {\n cursor: default;\n #resource-card-title {\n text-decoration: none;\n }\n }\n"])));
37
- var Container = styled(OakFlex)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n &:has(input:focus-visible) {\n box-shadow:\n ", ",\n ", ";\n }\n\n @media (hover: hover) {\n &:hover:not(:has(input:disabled), :active) {\n background: ", ";\n #resource-card-title {\n text-decoration: underline;\n }\n }\n\n &:active:not(:has(input:disabled)) {\n #resource-card-title {\n text-decoration: underline;\n }\n }\n }\n"], ["\n &:has(input:focus-visible) {\n box-shadow:\n ", ",\n ", ";\n }\n\n @media (hover: hover) {\n &:hover:not(:has(input:disabled), :active) {\n background: ", ";\n #resource-card-title {\n text-decoration: underline;\n }\n }\n\n &:active:not(:has(input:disabled)) {\n #resource-card-title {\n text-decoration: underline;\n }\n }\n }\n"])), parseDropShadow("drop-shadow-centered-lemon"), parseDropShadow("drop-shadow-centered-grey"), function (props) {
38
- return props.$hoverBackground ? parseColor(props.$hoverBackground) : null;
36
+ var LabelContainer = styled("label")(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex: 1;\n cursor: ", ";\n display: flex;\n\n &:has(input:disabled) {\n cursor: default;\n #resource-card-title {\n text-decoration: none;\n }\n }\n"], ["\n flex: 1;\n cursor: ", ";\n display: flex;\n\n &:has(input:disabled) {\n cursor: default;\n #resource-card-title {\n text-decoration: none;\n }\n }\n"])), function (props) { return (props.$showSelectionControl ? "pointer" : "default"); });
37
+ var Container = styled(OakFlex)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n &:has(input:focus-visible) {\n box-shadow:\n ", ",\n ", ";\n }\n\n @media (hover: hover) {\n &:hover:not(:has(input:disabled), :active) {\n background: ", ";\n #resource-card-title {\n text-decoration: ", ";\n }\n }\n\n &:hover:active:not(:has(input:disabled)) {\n #resource-card-title {\n text-decoration: ", ";\n }\n }\n }\n"], ["\n &:has(input:focus-visible) {\n box-shadow:\n ", ",\n ", ";\n }\n\n @media (hover: hover) {\n &:hover:not(:has(input:disabled), :active) {\n background: ", ";\n #resource-card-title {\n text-decoration: ", ";\n }\n }\n\n &:hover:active:not(:has(input:disabled)) {\n #resource-card-title {\n text-decoration: ", ";\n }\n }\n }\n"])), parseDropShadow("drop-shadow-centered-lemon"), parseDropShadow("drop-shadow-centered-grey"), function (props) {
38
+ return props.$showSelectionControl
39
+ ? parseColor("bg-btn-secondary-hover")
40
+ : parseColor("bg-primary");
41
+ }, function (props) {
42
+ return props.$showSelectionControl ? "underline" : "none";
43
+ }, function (props) {
44
+ return props.$showSelectionControl ? "underline" : "none";
39
45
  });
40
46
  /**
41
47
  * Resource cards present a downloadable/shareable resource with metadata and a selectable control.
@@ -49,7 +55,7 @@ var Container = styled(OakFlex)(templateObject_2 || (templateObject_2 = __makeTe
49
55
  var OakResourceCard = function (props) {
50
56
  var _a;
51
57
  var radioContext = useContext(RadioContext);
52
- var title = props.title, fileSize = props.fileSize, description = props.description, iconName = props.iconName, value = props.value, _b = props.disabled, disabled = _b === void 0 ? false : _b, defaultChecked = props.defaultChecked, checked = props.checked, onChange = props.onChange, onFocus = props.onFocus, onBlur = props.onBlur, onHovered = props.onHovered, _c = props.isRadio, isRadio = _c === void 0 ? false : _c, dataTestId = props["data-testid"], _d = props.isEditable, isEditable = _d === void 0 ? false : _d, rest = __rest(props, ["title", "fileSize", "description", "iconName", "value", "disabled", "defaultChecked", "checked", "onChange", "onFocus", "onBlur", "onHovered", "isRadio", "data-testid", "isEditable"]);
58
+ var title = props.title, fileSize = props.fileSize, description = props.description, iconName = props.iconName, value = props.value, _b = props.disabled, disabled = _b === void 0 ? false : _b, defaultChecked = props.defaultChecked, checked = props.checked, onChange = props.onChange, onFocus = props.onFocus, onBlur = props.onBlur, onHovered = props.onHovered, _c = props.showSelectionControl, showSelectionControl = _c === void 0 ? true : _c, _d = props.isRadio, isRadio = _d === void 0 ? false : _d, dataTestId = props["data-testid"], _e = props.isEditable, isEditable = _e === void 0 ? false : _e, rest = __rest(props, ["title", "fileSize", "description", "iconName", "value", "disabled", "defaultChecked", "checked", "onChange", "onFocus", "onBlur", "onHovered", "showSelectionControl", "isRadio", "data-testid", "isEditable"]);
53
59
  var checkboxSize = "spacing-24";
54
60
  var checkedBorderColor = "border-primary";
55
61
  var disabledColor = "text-disabled";
@@ -68,8 +74,8 @@ var OakResourceCard = function (props) {
68
74
  onChange === null || onChange === void 0 ? void 0 : onChange(event);
69
75
  };
70
76
  var isMultipleIcon = Array.isArray(iconName);
71
- return (React.createElement(Container, { "data-testid": dataTestId, "$background": "bg-primary", "$ba": "border-solid-m", "$borderRadius": "border-radius-s", "$overflow": "hidden", "$hoverBackground": "bg-btn-secondary-hover", "$color": "text-primary", "$width": "100%" },
72
- React.createElement(LabelContainer, null,
77
+ return (React.createElement(Container, { "data-testid": dataTestId, "$background": "bg-primary", "$ba": "border-solid-m", "$borderRadius": "border-radius-s", "$overflow": "hidden", "$showSelectionControl": showSelectionControl, "$color": "text-primary", "$width": "100%" },
78
+ React.createElement(LabelContainer, { "$showSelectionControl": showSelectionControl },
73
79
  React.createElement(OakFlex, { "$alignItems": "stretch", "$flexGrow": 1 },
74
80
  isMultipleIcon ? (React.createElement(MultipleIcons, { iconName: iconName })) : (React.createElement(SingleIcon, { iconName: iconName })),
75
81
  React.createElement(OakFlex, { "$flexGrow": 1, "$flexDirection": "column", "$justifyContent": "center", "$gap": "spacing-4", "$pv": "spacing-12", "$ph": "spacing-16" },
@@ -80,8 +86,8 @@ var OakResourceCard = function (props) {
80
86
  isEditable && (React.createElement(OakTagFunctional, { "$alignSelf": "flex-end", "$font": "heading-light-7", label: "Editable", "$background": "bg-decorative2-main" }))))),
81
87
  React.createElement(OakFlex, null,
82
88
  React.createElement(OakFlex, { "$alignItems": "center", "$pr": "spacing-16" },
83
- isRadio && (React.createElement(InternalRadioWrapper, { checked: isChecked, size: checkboxSize, disabled: anyDisabled, radioBorderColor: checkedBorderColor, internalRadio: React.createElement(InternalRadio, __assign({}, rest, { id: props.id, name: (_a = props.name) !== null && _a !== void 0 ? _a : radioContext.name, value: value, disabled: anyDisabled, onHovered: onHovered, onChange: handleRadioChange, onFocus: onFocus, onBlur: onBlur, defaultChecked: defaultChecked, checked: radioChecked })) })),
84
- !isRadio && (React.createElement(InternalCheckBoxWrapper, { size: checkboxSize, internalCheckbox: React.createElement(InternalCheckBoxHoverFocus, __assign({ name: radioContext.name, value: value, "$width": checkboxSize, "$height": checkboxSize, "$ba": "border-solid-m", "$borderRadius": "border-radius-xs", "$borderColor": "text-primary", "$checkedBackground": currentCheckedBackgroundFill, "$checkedBorderColor": currentCheckedBorderColor, "$uncheckedBorderColor": "border-neutral", "$hoverBorderRadius": "border-radius-xs", onHovered: onHovered, onChange: onChange, onFocus: onFocus, onBlur: onBlur, defaultChecked: defaultChecked, checked: checked, disabled: anyDisabled }, rest)), iconPadding: "spacing-0" })))))));
89
+ showSelectionControl && isRadio && (React.createElement(InternalRadioWrapper, { checked: isChecked, size: checkboxSize, disabled: anyDisabled, radioBorderColor: checkedBorderColor, internalRadio: React.createElement(InternalRadio, __assign({}, rest, { id: props.id, name: (_a = props.name) !== null && _a !== void 0 ? _a : radioContext.name, value: value, disabled: anyDisabled, onHovered: onHovered, onChange: handleRadioChange, onFocus: onFocus, onBlur: onBlur, defaultChecked: defaultChecked, checked: radioChecked })) })),
90
+ showSelectionControl && !isRadio && (React.createElement(InternalCheckBoxWrapper, { size: checkboxSize, internalCheckbox: React.createElement(InternalCheckBoxHoverFocus, __assign({ name: radioContext.name, value: value, "$width": checkboxSize, "$height": checkboxSize, "$ba": "border-solid-m", "$borderRadius": "border-radius-xs", "$borderColor": "text-primary", "$checkedBackground": currentCheckedBackgroundFill, "$checkedBorderColor": currentCheckedBorderColor, "$uncheckedBorderColor": "border-neutral", "$hoverBorderRadius": "border-radius-xs", onHovered: onHovered, onChange: onChange, onFocus: onFocus, onBlur: onBlur, defaultChecked: defaultChecked, checked: checked, disabled: anyDisabled }, rest)), iconPadding: "spacing-0" })))))));
85
91
  };
86
92
  var templateObject_1, templateObject_2;
87
93
 
@@ -19,13 +19,13 @@ var StyledAccordionButton = styled(InternalAccordionButton)(templateObject_1 ||
19
19
  * Internal accordion component that handles the accordion logic
20
20
  */
21
21
  var Accordion = function (_a) {
22
- var children = _a.children, id = _a.id, selectAllChecked = _a.selectAllChecked, subheading = _a.subheading, handleToggleSelectAll = _a.handleToggleSelectAll, styleProps = __rest(_a, ["children", "id", "selectAllChecked", "subheading", "handleToggleSelectAll"]);
22
+ var children = _a.children, id = _a.id, selectAllChecked = _a.selectAllChecked, subheading = _a.subheading, _b = _a.showCheckbox, showCheckbox = _b === void 0 ? true : _b, handleToggleSelectAll = _a.handleToggleSelectAll, styleProps = __rest(_a, ["children", "id", "selectAllChecked", "subheading", "showCheckbox", "handleToggleSelectAll"]);
23
23
  var isOpen = useAccordionContext().isOpen;
24
24
  return (React.createElement(OakFlex, __assign({ "$bt": "border-solid-s", "$bb": isOpen ? "border-solid-none" : "border-solid-s", "$borderColor": "border-neutral-lighter", "$pv": "spacing-12", "$flexDirection": "column", "$width": "100%" }, styleProps),
25
25
  React.createElement(OakFlex, { "$alignItems": "center", "$width": "100%" },
26
26
  React.createElement(OakFlex, { "$alignItems": "center", "$width": "100%", "$gap": "spacing-16" },
27
- React.createElement(OakBox, { id: "select-all-wrapper", "$pa": "spacing-8", onClick: handleToggleSelectAll },
28
- React.createElement(OakCheckBox, { onChange: function () { return undefined; }, checked: selectAllChecked, id: "select-all", name: "select-all", value: "", "aria-labelledby": "resources-accordion-heading" })),
27
+ showCheckbox ? (React.createElement(OakBox, { id: "select-all-wrapper", "$pa": "spacing-8", onClick: handleToggleSelectAll },
28
+ React.createElement(OakCheckBox, { onChange: function () { return undefined; }, checked: selectAllChecked, id: "select-all", name: "select-all", value: "", "aria-labelledby": "resources-accordion-heading" }))) : null,
29
29
  React.createElement(StyledAccordionButton, { "$justifyContent": "space-between", "$flexGrow": 1, id: id, "$alignItems": "center", "$mr": "spacing-12" },
30
30
  React.createElement(OakFlex, { "$justifyContent": "center", "$alignItems": "center", "$gap": "spacing-12" },
31
31
  React.createElement(OakFlex, { "$flexDirection": "column", "$justifyContent": "center", "$alignItems": "start" },
@@ -3621,6 +3621,10 @@ type OakResourcesAccordionProps = {
3621
3621
  * Whether the accordion starts in the open state, defaults to false
3622
3622
  */
3623
3623
  initialOpen?: boolean;
3624
+ /**
3625
+ * Whether to show the select all checkbox
3626
+ */
3627
+ showCheckbox?: boolean;
3624
3628
  } & FlexStyleProps & OakBoxProps & ColorStyleProps;
3625
3629
  /**
3626
3630
  * OakResourcesAccordion renamed from OakDownloadsAccordion.
@@ -4453,6 +4457,12 @@ type OakResourceCardProps = BaseCheckBoxProps & {
4453
4457
  * The icon used to represent the resource type.
4454
4458
  */
4455
4459
  iconName: IconName | IconName[];
4460
+ /**
4461
+ * Whether to show the selection control (checkbox or radio button).
4462
+ *
4463
+ * @default true
4464
+ */
4465
+ showSelectionControl?: boolean;
4456
4466
  /**
4457
4467
  * If true, renders the selection control as a radio button instead of a checkbox.
4458
4468
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oaknational/oak-components",
3
- "version": "3.14.4",
3
+ "version": "3.15.0",
4
4
  "licence": "MIT",
5
5
  "packageManager": "pnpm@11.2.0",
6
6
  "description": "Shared components for Oak applications",