@coopdigital/react 1.32.1 → 1.32.3
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.
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ChevronDownIcon } from "../icons/ChevronDownIcon.js";
|
|
2
|
+
import { hasUserBg } from "../../utils/classes.js";
|
|
2
3
|
import { useSlots } from "../../hooks/useSlots.js";
|
|
3
4
|
import clsx from "clsx";
|
|
4
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -10,7 +11,7 @@ const componentSlots = {
|
|
|
10
11
|
const Expandable = ({ children, className, ref, ...props }) => {
|
|
11
12
|
const slots = useSlots(componentSlots, children);
|
|
12
13
|
const componentProps = {
|
|
13
|
-
className: clsx("coop-expandable", className),
|
|
14
|
+
className: clsx("coop-expandable", !hasUserBg(className) && "bg-tint-grey", className),
|
|
14
15
|
...props
|
|
15
16
|
};
|
|
16
17
|
return /* @__PURE__ */ jsxs("details", {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coopdigital/react",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.32.
|
|
4
|
+
"version": "1.32.3",
|
|
5
5
|
"private": false,
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -77,11 +77,11 @@
|
|
|
77
77
|
"devDependencies": {
|
|
78
78
|
"@axe-core/playwright": "^4.14.0",
|
|
79
79
|
"@playwright/test": "^1.64.1",
|
|
80
|
-
"@storybook/addon-a11y": "^10.6.
|
|
81
|
-
"@storybook/addon-docs": "^10.6.
|
|
82
|
-
"@storybook/addon-links": "^10.6.
|
|
83
|
-
"@storybook/addon-onboarding": "^10.6.
|
|
84
|
-
"@storybook/react-vite": "^10.6.
|
|
80
|
+
"@storybook/addon-a11y": "^10.6.5",
|
|
81
|
+
"@storybook/addon-docs": "^10.6.5",
|
|
82
|
+
"@storybook/addon-links": "^10.6.5",
|
|
83
|
+
"@storybook/addon-onboarding": "^10.6.5",
|
|
84
|
+
"@storybook/react-vite": "^10.6.5",
|
|
85
85
|
"@testing-library/jest-dom": "^7.0.1",
|
|
86
86
|
"@testing-library/react": "^16.3.3",
|
|
87
87
|
"@types/react": "^19.3.0",
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"react-hook-form": "^7.91.0",
|
|
94
94
|
"resize-observer-polyfill": "^1.5.1",
|
|
95
95
|
"serve": "^14.2.6",
|
|
96
|
-
"storybook": "^10.6.
|
|
96
|
+
"storybook": "^10.6.5",
|
|
97
97
|
"storybook-addon-tag-badges": "^3.1.0"
|
|
98
98
|
},
|
|
99
99
|
"peerDependencies": {
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
"storybook": "$storybook"
|
|
118
118
|
},
|
|
119
119
|
"dependencies": {
|
|
120
|
-
"@coopdigital/styles": "^1.23.
|
|
120
|
+
"@coopdigital/styles": "^1.23.2",
|
|
121
121
|
"@radix-ui/react-popover": "^1.3.1",
|
|
122
122
|
"clsx": "^2.1.1",
|
|
123
123
|
"date-fns": "^4.4.0",
|
|
@@ -126,5 +126,5 @@
|
|
|
126
126
|
"merge-refs": "^2.0.0",
|
|
127
127
|
"react-day-picker": "^10.0.2"
|
|
128
128
|
},
|
|
129
|
-
"gitHead": "
|
|
129
|
+
"gitHead": "100e32ce5eebb15f5a9de71ee15bbb5ef4a9b926"
|
|
130
130
|
}
|
|
@@ -4,6 +4,7 @@ import clsx from "clsx"
|
|
|
4
4
|
|
|
5
5
|
import { ChevronDownIcon } from "@/components/icons"
|
|
6
6
|
import { useSlots } from "@/hooks/useSlots"
|
|
7
|
+
import { hasUserBg } from "@/utils"
|
|
7
8
|
|
|
8
9
|
export interface ExpandableProps extends DetailsHTMLAttributes<HTMLDetailsElement> {
|
|
9
10
|
/** Content inside the component.
|
|
@@ -39,7 +40,7 @@ const Expandable = ({ children, className, ref, ...props }: ExpandableProps): JS
|
|
|
39
40
|
const slots = useSlots(componentSlots, children)
|
|
40
41
|
|
|
41
42
|
const componentProps = {
|
|
42
|
-
className: clsx("coop-expandable", className),
|
|
43
|
+
className: clsx("coop-expandable", !hasUserBg(className) && "bg-tint-grey", className),
|
|
43
44
|
...props,
|
|
44
45
|
}
|
|
45
46
|
|