@coopdigital/react 1.32.0 → 1.32.2

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.
@@ -4,14 +4,17 @@ import { jsx } from "react/jsx-runtime";
4
4
  // src/components/LoadingSpinner/LoadingSpinner.tsx
5
5
  const LoadingSpinner = ({ className, ref, stroke = "currentColor", strokeWidth = "1px", ...props }) => {
6
6
  const componentProps = {
7
- className: clsx("coop-loading-spinner", className),
7
+ className: clsx(className),
8
8
  stroke,
9
9
  strokeWidth,
10
10
  ...props
11
11
  };
12
- return /* @__PURE__ */ jsx(LoadingIcon, {
13
- ...componentProps,
14
- ref
12
+ return /* @__PURE__ */ jsx("span", {
13
+ className: "coop-loading-spinner",
14
+ children: /* @__PURE__ */ jsx(LoadingIcon, {
15
+ ...componentProps,
16
+ ref
17
+ })
15
18
  });
16
19
  };
17
20
  export { LoadingSpinner, LoadingSpinner as default };
@@ -1,4 +1,3 @@
1
- import { bgClassToColor, hasUserBg } from "../../utils/classes.js";
2
1
  import { useSlots } from "../../hooks/useSlots.js";
3
2
  import clsx from "clsx";
4
3
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -22,17 +21,13 @@ const PopoverContent = ({ align = "center", alignOffset = 0, asChild = false, av
22
21
  alignOffset,
23
22
  asChild,
24
23
  avoidCollisions,
25
- className: clsx("coop-popover", !hasUserBg(className) && "bg-tint-grey", className),
24
+ className: clsx("coop-popover", className),
26
25
  collisionPadding,
27
26
  side,
28
27
  sideOffset,
29
28
  style,
30
29
  ...props
31
30
  };
32
- componentProps.style = {
33
- ...style,
34
- "--popover-bg": `var(--color-${bgClassToColor(componentProps.className)})`
35
- };
36
31
  return /* @__PURE__ */ jsxs(RadixPopover.Content, {
37
32
  ref,
38
33
  ...componentProps,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@coopdigital/react",
3
3
  "type": "module",
4
- "version": "1.32.0",
4
+ "version": "1.32.2",
5
5
  "private": false,
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -117,7 +117,7 @@
117
117
  "storybook": "$storybook"
118
118
  },
119
119
  "dependencies": {
120
- "@coopdigital/styles": "^1.23.0",
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": "c826b0325c655154524a6627eb705bce9f84abae"
129
+ "gitHead": "cc124979d05d9b0bbeeade64e7a9b45adfa13ddb"
130
130
  }
@@ -44,10 +44,6 @@ const Expandable = ({ children, className, ref, ...props }: ExpandableProps): JS
44
44
  ...props,
45
45
  }
46
46
 
47
- // componentProps.style = {
48
- // "--bg": `var(--color-${bgClassToColor(componentProps.className)})`,
49
- // }
50
-
51
47
  return (
52
48
  <details {...componentProps} ref={ref}>
53
49
  {slots.ExpandableSummary}
@@ -19,13 +19,18 @@ export const LoadingSpinner = ({
19
19
  ...props
20
20
  }: LoadingSpinnerProps): JSX.Element => {
21
21
  const componentProps = {
22
- className: clsx("coop-loading-spinner", className),
22
+ className: clsx(className),
23
23
  stroke,
24
24
  strokeWidth,
25
25
  ...props,
26
26
  }
27
27
 
28
- return <LoadingIcon {...componentProps} ref={ref} />
28
+ // The wrapper rotates, not the SVG: a rotating SVG makes Chromium flash other transitions on the page
29
+ return (
30
+ <span className="coop-loading-spinner">
31
+ <LoadingIcon {...componentProps} ref={ref} />
32
+ </span>
33
+ )
29
34
  }
30
35
 
31
36
  export default LoadingSpinner
@@ -11,7 +11,6 @@ import * as RadixPopover from "@radix-ui/react-popover"
11
11
  import clsx from "clsx"
12
12
 
13
13
  import { useSlots } from "@/hooks/useSlots"
14
- import { bgClassToColor, hasUserBg } from "@/utils"
15
14
 
16
15
  export interface PopoverProps extends RadixPopoverProps {
17
16
  /** Content inside the component.
@@ -109,7 +108,7 @@ const PopoverContent = ({
109
108
  alignOffset,
110
109
  asChild,
111
110
  avoidCollisions,
112
- className: clsx("coop-popover", !hasUserBg(className) && "bg-tint-grey", className),
111
+ className: clsx("coop-popover", className),
113
112
  collisionPadding,
114
113
  side,
115
114
  sideOffset,
@@ -117,11 +116,6 @@ const PopoverContent = ({
117
116
  ...props,
118
117
  }
119
118
 
120
- componentProps.style = {
121
- ...style,
122
- "--popover-bg": `var(--color-${bgClassToColor(componentProps.className)})`,
123
- }
124
-
125
119
  return (
126
120
  <RadixPopover.Content ref={ref} {...componentProps}>
127
121
  {children}