@coopdigital/react 0.19.4 → 0.19.6

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.
Files changed (160) hide show
  1. package/dist/components/AlertBanner/AlertBanner.d.ts +3 -3
  2. package/dist/components/AlertBanner/AlertBanner.js +3 -2
  3. package/dist/components/Author/Author.d.ts +4 -4
  4. package/dist/components/Author/Author.js +3 -2
  5. package/dist/components/Button/Button.d.ts +10 -10
  6. package/dist/components/Button/Button.js +3 -2
  7. package/dist/components/Card/Card.d.ts +14 -14
  8. package/dist/components/Card/Card.js +1 -1
  9. package/dist/components/Expandable/Expandable.d.ts +4 -4
  10. package/dist/components/Expandable/Expandable.js +4 -2
  11. package/dist/components/Icon/AddIcon.d.ts +1 -1
  12. package/dist/components/Icon/AddIcon.js +4 -3
  13. package/dist/components/Icon/ArrowDownIcon.d.ts +1 -1
  14. package/dist/components/Icon/ArrowDownIcon.js +4 -3
  15. package/dist/components/Icon/ArrowLeftIcon.d.ts +1 -1
  16. package/dist/components/Icon/ArrowLeftIcon.js +4 -3
  17. package/dist/components/Icon/ArrowRightIcon.d.ts +1 -1
  18. package/dist/components/Icon/ArrowRightIcon.js +4 -3
  19. package/dist/components/Icon/ArrowUpIcon.d.ts +1 -1
  20. package/dist/components/Icon/ArrowUpIcon.js +4 -3
  21. package/dist/components/Icon/AvatarAltIcon.d.ts +1 -1
  22. package/dist/components/Icon/AvatarAltIcon.js +4 -3
  23. package/dist/components/Icon/AvatarIcon.d.ts +1 -1
  24. package/dist/components/Icon/AvatarIcon.js +4 -3
  25. package/dist/components/Icon/BasketIcon.d.ts +1 -1
  26. package/dist/components/Icon/BasketIcon.js +4 -3
  27. package/dist/components/Icon/CalendarIcon.d.ts +1 -1
  28. package/dist/components/Icon/CalendarIcon.js +4 -3
  29. package/dist/components/Icon/ChevronDownIcon.d.ts +1 -1
  30. package/dist/components/Icon/ChevronDownIcon.js +4 -3
  31. package/dist/components/Icon/ChevronLeftIcon.d.ts +1 -1
  32. package/dist/components/Icon/ChevronLeftIcon.js +4 -3
  33. package/dist/components/Icon/ChevronRightIcon.d.ts +1 -1
  34. package/dist/components/Icon/ChevronRightIcon.js +4 -3
  35. package/dist/components/Icon/ChevronUpIcon.d.ts +1 -1
  36. package/dist/components/Icon/ChevronUpIcon.js +4 -3
  37. package/dist/components/Icon/ClockIcon.d.ts +1 -1
  38. package/dist/components/Icon/ClockIcon.js +4 -3
  39. package/dist/components/Icon/CloseAltIcon.d.ts +1 -1
  40. package/dist/components/Icon/CloseAltIcon.js +4 -3
  41. package/dist/components/Icon/CloseIcon.d.ts +1 -1
  42. package/dist/components/Icon/CloseIcon.js +4 -3
  43. package/dist/components/Icon/CoopCardIcon.d.ts +1 -1
  44. package/dist/components/Icon/CoopCardIcon.js +4 -3
  45. package/dist/components/Icon/CoopIcon.d.ts +1 -1
  46. package/dist/components/Icon/CoopIcon.js +4 -3
  47. package/dist/components/Icon/CoopLocationIcon.d.ts +1 -1
  48. package/dist/components/Icon/CoopLocationIcon.js +4 -3
  49. package/dist/components/Icon/DownloadIcon.d.ts +1 -1
  50. package/dist/components/Icon/DownloadIcon.js +4 -3
  51. package/dist/components/Icon/HomeIcon.d.ts +1 -1
  52. package/dist/components/Icon/HomeIcon.js +4 -3
  53. package/dist/components/Icon/InformationIcon.d.ts +1 -1
  54. package/dist/components/Icon/InformationIcon.js +4 -3
  55. package/dist/components/Icon/LoadingIcon.d.ts +1 -1
  56. package/dist/components/Icon/LoadingIcon.js +4 -3
  57. package/dist/components/Icon/LocationIcon.d.ts +1 -1
  58. package/dist/components/Icon/LocationIcon.js +4 -3
  59. package/dist/components/Icon/MailIcon.d.ts +1 -1
  60. package/dist/components/Icon/MailIcon.js +4 -3
  61. package/dist/components/Icon/MenuIcon.d.ts +1 -1
  62. package/dist/components/Icon/MenuIcon.js +4 -3
  63. package/dist/components/Icon/MessageIcon.d.ts +1 -1
  64. package/dist/components/Icon/MessageIcon.js +4 -3
  65. package/dist/components/Icon/MinusIcon.d.ts +1 -1
  66. package/dist/components/Icon/MinusIcon.js +4 -3
  67. package/dist/components/Icon/OpenNewIcon.d.ts +1 -1
  68. package/dist/components/Icon/OpenNewIcon.js +4 -3
  69. package/dist/components/Icon/PencilIcon.d.ts +1 -1
  70. package/dist/components/Icon/PencilIcon.js +4 -3
  71. package/dist/components/Icon/PhoneIcon.d.ts +1 -1
  72. package/dist/components/Icon/PhoneIcon.js +4 -3
  73. package/dist/components/Icon/QuestionIcon.d.ts +1 -1
  74. package/dist/components/Icon/QuestionIcon.js +4 -3
  75. package/dist/components/Icon/ScooterIcon.d.ts +1 -1
  76. package/dist/components/Icon/ScooterIcon.js +4 -3
  77. package/dist/components/Icon/SearchIcon.d.ts +1 -1
  78. package/dist/components/Icon/SearchIcon.js +4 -3
  79. package/dist/components/Icon/SettingsIcon.d.ts +1 -1
  80. package/dist/components/Icon/SettingsIcon.js +4 -3
  81. package/dist/components/Icon/TickAltIcon.d.ts +1 -1
  82. package/dist/components/Icon/TickAltIcon.js +4 -3
  83. package/dist/components/Icon/TickIcon.d.ts +1 -1
  84. package/dist/components/Icon/TickIcon.js +4 -3
  85. package/dist/components/Icon/VanIcon.d.ts +1 -1
  86. package/dist/components/Icon/VanIcon.js +4 -3
  87. package/dist/components/Icon/WarningIcon.d.ts +1 -1
  88. package/dist/components/Icon/WarningIcon.js +4 -3
  89. package/dist/components/Icon/WriteIcon.d.ts +1 -1
  90. package/dist/components/Icon/WriteIcon.js +4 -3
  91. package/dist/components/Image/Image.d.ts +5 -5
  92. package/dist/components/Pill/Pill.d.ts +10 -10
  93. package/dist/components/Pill/Pill.js +1 -1
  94. package/dist/components/RootSVG/RootSVG.js +1 -1
  95. package/dist/components/SearchBox/SearchBox.d.ts +10 -10
  96. package/dist/components/SearchBox/SearchBox.js +2 -1
  97. package/dist/components/Signpost/Signpost.d.ts +6 -6
  98. package/dist/components/Signpost/Signpost.js +3 -2
  99. package/dist/components/SkipNav/SkipNav.d.ts +4 -6
  100. package/dist/components/SkipNav/SkipNav.js +3 -2
  101. package/dist/components/Squircle/Squircle.d.ts +6 -6
  102. package/dist/components/Squircle/Squircle.js +3 -2
  103. package/dist/components/Tag/Tag.d.ts +5 -5
  104. package/dist/components/Tag/Tag.js +1 -1
  105. package/dist/types/colors.d.ts +2 -2
  106. package/package.json +3 -3
  107. package/src/components/AlertBanner/AlertBanner.tsx +7 -5
  108. package/src/components/Author/Author.tsx +8 -6
  109. package/src/components/Button/Button.tsx +13 -12
  110. package/src/components/Card/Card.tsx +17 -18
  111. package/src/components/Expandable/Expandable.tsx +12 -14
  112. package/src/components/Icon/AddIcon.tsx +6 -5
  113. package/src/components/Icon/ArrowDownIcon.tsx +6 -5
  114. package/src/components/Icon/ArrowLeftIcon.tsx +6 -5
  115. package/src/components/Icon/ArrowRightIcon.tsx +6 -5
  116. package/src/components/Icon/ArrowUpIcon.tsx +6 -5
  117. package/src/components/Icon/AvatarAltIcon.tsx +7 -6
  118. package/src/components/Icon/AvatarIcon.tsx +6 -5
  119. package/src/components/Icon/BasketIcon.tsx +6 -5
  120. package/src/components/Icon/CalendarIcon.tsx +6 -5
  121. package/src/components/Icon/ChevronDownIcon.tsx +5 -4
  122. package/src/components/Icon/ChevronLeftIcon.tsx +5 -4
  123. package/src/components/Icon/ChevronRightIcon.tsx +5 -4
  124. package/src/components/Icon/ChevronUpIcon.tsx +5 -4
  125. package/src/components/Icon/ClockIcon.tsx +6 -5
  126. package/src/components/Icon/CloseAltIcon.tsx +7 -6
  127. package/src/components/Icon/CloseIcon.tsx +6 -5
  128. package/src/components/Icon/CoopCardIcon.tsx +5 -4
  129. package/src/components/Icon/CoopIcon.tsx +5 -4
  130. package/src/components/Icon/CoopLocationIcon.tsx +7 -6
  131. package/src/components/Icon/DownloadIcon.tsx +10 -6
  132. package/src/components/Icon/HomeIcon.tsx +7 -6
  133. package/src/components/Icon/InformationIcon.tsx +6 -5
  134. package/src/components/Icon/LoadingIcon.tsx +5 -4
  135. package/src/components/Icon/LocationIcon.tsx +6 -5
  136. package/src/components/Icon/MailIcon.tsx +5 -4
  137. package/src/components/Icon/MenuIcon.tsx +5 -4
  138. package/src/components/Icon/MessageIcon.tsx +5 -4
  139. package/src/components/Icon/MinusIcon.tsx +5 -4
  140. package/src/components/Icon/OpenNewIcon.tsx +6 -5
  141. package/src/components/Icon/PencilIcon.tsx +5 -4
  142. package/src/components/Icon/PhoneIcon.tsx +5 -4
  143. package/src/components/Icon/QuestionIcon.tsx +6 -5
  144. package/src/components/Icon/ScooterIcon.tsx +7 -6
  145. package/src/components/Icon/SearchIcon.tsx +6 -5
  146. package/src/components/Icon/SettingsIcon.tsx +5 -4
  147. package/src/components/Icon/TickAltIcon.tsx +6 -5
  148. package/src/components/Icon/TickIcon.tsx +5 -4
  149. package/src/components/Icon/VanIcon.tsx +5 -4
  150. package/src/components/Icon/WarningIcon.tsx +6 -5
  151. package/src/components/Icon/WriteIcon.tsx +8 -7
  152. package/src/components/Image/Image.tsx +5 -5
  153. package/src/components/Pill/Pill.tsx +12 -12
  154. package/src/components/RootSVG/RootSVG.tsx +1 -1
  155. package/src/components/SearchBox/SearchBox.tsx +12 -11
  156. package/src/components/Signpost/Signpost.tsx +11 -11
  157. package/src/components/SkipNav/SkipNav.tsx +8 -8
  158. package/src/components/Squircle/Squircle.tsx +10 -8
  159. package/src/components/Tag/Tag.tsx +6 -6
  160. package/src/types/colors.ts +2 -2
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@coopdigital/react",
3
3
  "type": "module",
4
- "version": "0.19.4",
4
+ "version": "0.19.6",
5
5
  "private": false,
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -50,7 +50,7 @@
50
50
  "description": "",
51
51
  "devDependencies": {
52
52
  "@axe-core/playwright": "^4.10.1",
53
- "@coopdigital/styles": "^0.16.4",
53
+ "@coopdigital/styles": "^0.16.6",
54
54
  "@playwright/test": "^1.52.0",
55
55
  "@storybook/addon-a11y": "^8.6.12",
56
56
  "@storybook/addon-essentials": "^8.6.12",
@@ -75,5 +75,5 @@
75
75
  "dependencies": {
76
76
  "clsx": "^2.1.1"
77
77
  },
78
- "gitHead": "7d7bc474a5da58c536c9579eec660106366f73ee"
78
+ "gitHead": "3f62473cc66936fb06440ba4794ae191e9d2ae6f"
79
79
  }
@@ -1,25 +1,27 @@
1
1
  import type { HTMLAttributes, JSX, ReactNode } from "react"
2
2
 
3
+ import clsx from "clsx"
4
+
3
5
  export interface AlertBannerProps extends HTMLAttributes<HTMLDivElement> {
4
6
  /** **(Optional)** Main content inside the banner. It can be any valid JSX or string. */
5
7
  children?: string | ReactNode
6
- /** **(Optional)** Additional CSS classes to be applied to the component. */
8
+ /** **(Optional)** Specify additional CSS classes to be applied to the component. */
7
9
  className?: string
8
- /** Main title of the banner, rendered as a `h2`. */
10
+ /** Specify the main title of the banner, rendered as a `h2`. */
9
11
  heading: string
10
- /** **(Optional)** Specify which banner variant to use. */
12
+ /** **(Optional)** Specify the AlertBanner variant. */
11
13
  variant?: "black" | "default"
12
14
  }
13
15
 
14
16
  export const AlertBanner = ({
15
17
  children,
16
- className = "",
18
+ className,
17
19
  heading,
18
20
  variant = "default",
19
21
  ...props
20
22
  }: AlertBannerProps): JSX.Element => {
21
23
  const componentProps = {
22
- className: `coop-alert-banner ${className}`,
24
+ className: clsx("coop-alert-banner", className),
23
25
  "data-variant": variant,
24
26
  ...props,
25
27
  }
@@ -1,23 +1,25 @@
1
1
  import type { HTMLAttributes, JSX } from "react"
2
2
 
3
+ import clsx from "clsx"
4
+
3
5
  import { Image, ImageProps } from "../Image"
4
6
 
5
7
  export interface AuthorProps extends HTMLAttributes<HTMLDivElement> {
6
- /** **(Optional)** Specify the content author. */
8
+ /** **(Optional)** Specify the Author name. */
7
9
  author?: string
8
- /** **(Optional)** Additional CSS classes to be applied to the component. */
10
+ /** **(Optional)** Specify additional CSS classes to be applied to the component. */
9
11
  className?: string
10
- /** **(Optional)** Specify the date. Refer to Experience Library guidance on date formats. We advise using the following format (dd mmmm yyyy) eg: 1 January 2000. */
12
+ /** **(Optional)** Specify the date. Refer to Experience Library guidance on date formats. We advise using the following format (dd mmmm yyyy) eg: 1 January 2000. */
11
13
  date?: string
12
14
  /** **(Optional)** Specify the text that will prefix the date, e.g. "Published". */
13
15
  datePrefix?: string
14
- /** **(Optional)** Specify Image properties of the Author avatar. */
16
+ /** **(Optional)** Specify properties of the Author Image. */
15
17
  image?: ImageProps
16
18
  }
17
19
 
18
20
  export const Author = ({
19
21
  author = "Co-op team",
20
- className = "",
22
+ className,
21
23
  date,
22
24
  datePrefix = "",
23
25
  image = {
@@ -32,7 +34,7 @@ export const Author = ({
32
34
  }
33
35
 
34
36
  const componentProps = {
35
- className: `coop-author ${className}`,
37
+ className: clsx("coop-author", className),
36
38
  ...props,
37
39
  }
38
40
  return (
@@ -5,33 +5,34 @@ import type {
5
5
  JSX,
6
6
  } from "react"
7
7
 
8
+ import clsx from "clsx"
8
9
  import React, { useCallback, useState } from "react"
9
10
 
10
11
  import { LoadingIcon } from "../Icon"
11
12
 
12
13
  export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
13
- /** **(Optional)** Specifies the custom element to override default `a` or `button`. */
14
+ /** **(Optional)** Specify a custom element to override default `a` or `button`. */
14
15
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
15
16
  as?: React.FC<AnchorHTMLAttributes<HTMLElement>> | ForwardRefExoticComponent<any> | string
16
- /** **(Optional)** Represents the content inside the Button component. It can be any valid JSX or string. */
17
+ /** **(Optional)** Main content inside the component. It can be any valid JSX or string. */
17
18
  children?: React.ReactNode
18
- /** **(Optional)** Receives any className to be applied to Button component. */
19
+ /** **(Optional)** Specify additional CSS classes to be applied to the component. */
19
20
  className?: string
20
- /** **(Optional)** Specifies the URL that the Button component will link to when clicked. */
21
+ /** **(Optional)** Specify the URL that the Button component will link to when clicked. */
21
22
  href?: string
22
- /** **(Optional)** Specifies whether the Button should be disabled. This will not actually disable the button, just make it look disabled. Disabled buttons can be bad UX. */
23
+ /** **(Optional)** Specify whether the Button should be disabled. This will not actually disable the button, just make it look disabled. Refer to Experience Library guidance on disabled buttons and accessibility. */
23
24
  isDisabled?: boolean
24
- /** **(Optional)** Specifies whether the Button should be full width. */
25
+ /** **(Optional)** Specify whether the Button should be full width. Refer to Experience Library guidance on full width buttons. */
25
26
  isFullWidth?: boolean
26
- /** **(Optional)** Specifies whether the Button is loading. */
27
+ /** **(Optional)** Force the Button into a loading state. */
27
28
  isLoading?: boolean
28
- /** **(Optional)** Specifies loading text to show when the Button is in a pending state */
29
+ /** **(Optional)** Specify text to show when the Button is in a loading state. */
29
30
  loadingText?: string
30
31
  /** **(Optional)** Callback to run when the button is pressed. If this is an async function, it will be awaited and the button will be in a pending state until the promise is resolved. */
31
32
  onClick?: (event: React.MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => void
32
- /** **(Optional)** Specifies the Button size. */
33
+ /** **(Optional)** Specify the Button size. */
33
34
  size?: "sm" | "md" | "lg" | "xl"
34
- /** **(Optional)** Specifies the Button variant. */
35
+ /** **(Optional)** Specify the Button variant. */
35
36
  variant?:
36
37
  | "green"
37
38
  | "blue"
@@ -51,7 +52,7 @@ type OnClickHandler =
51
52
  export const Button = ({
52
53
  as,
53
54
  children,
54
- className = "",
55
+ className,
55
56
  href,
56
57
  isDisabled = false,
57
58
  isFullWidth = false,
@@ -87,7 +88,7 @@ export const Button = ({
87
88
  const componentProps = {
88
89
  "aria-disabled": isDisabled ? true : undefined,
89
90
  "aria-live": "assertive" as keyof ButtonHTMLAttributes<HTMLButtonElement>["aria-live"],
90
- className: `${variant == "text" ? "coop-link" : "coop-button"} ${className}`,
91
+ className: clsx(variant == "text" ? "coop-link" : "coop-button", className),
91
92
  "data-loading": isLoading || isPending ? true : undefined,
92
93
  "data-size": size.length && size !== "md" ? size : undefined,
93
94
  "data-variant": variant !== "text" ? variant : undefined,
@@ -5,40 +5,41 @@ import React from "react"
5
5
 
6
6
  import { bgPropToClass } from "../../../src/utils"
7
7
  import { Lights, Tints } from "../../types/colors"
8
+ import { ChevronRightIcon } from "../Icon"
8
9
  import { Image, ImageProps } from "../Image"
9
10
 
10
11
  export interface CardProps extends HTMLAttributes<HTMLDivElement> {
11
12
  //export interface CardProps {
12
- /** **(Optional)** Specifies the custom element to override default `a` */
13
+ /** **(Optional)** Specify a custom element to override default `a`. */
13
14
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
14
15
  as?: React.FC<AnchorHTMLAttributes<HTMLElement>> | ForwardRefExoticComponent<any> | string
15
- /** **(Optional)** Specifies the background color of the card. */
16
+ /** **(Optional)** Specify the Card background color. */
16
17
  background?: Tints
17
- /** **(Optional)** Represents the content inside the badge. */
18
+ /** **(Optional)** Specify text to display inside the badge. */
18
19
  badge?: React.ReactNode
19
20
  /** **(Optional)** Specify badge position relative to top right corner. */
20
21
  badgePosition?: "inset" | "popout"
21
- /** **(Optional)** Specifies if chevron will be visible. */
22
+ /** **(Optional)** Specify whether chevron is visible. */
22
23
  chevron?: boolean
23
- /** **(Optional)** Represents the content inside the Card component. It can be any valid JSX or string. */
24
+ /** **(Optional)** Main content inside the component. It can be any valid JSX or string. */
24
25
  children?: React.ReactNode
25
- /** **(Optional)** Receives any className to be applied to Card component. */
26
+ /** **(Optional)** Specify additional CSS classes to be applied to the component. */
26
27
  className?: string
27
- /** Specifies the heading of the Card */
28
+ /** Specify the Card heading. */
28
29
  heading: string
29
- /** **(Optional)** Specifies the heading level of the card's heading. */
30
+ /** **(Optional)** Specify the level of the Card heading. */
30
31
  headingLevel?: "h2" | "h3" | "h4" | "h5" | "h6"
31
- /** **(Optional)** Specifies the URL that the Card component will link to when clicked. */
32
+ /** **(Optional)** Specify the URL that the Card component will link to when clicked. */
32
33
  href?: string
33
- /** Specifies the image properties of the Card */
34
+ /** Specify properties of the Card Image. */
34
35
  image: ImageProps
35
- /** **(Optional)** Specifies the position of the image in the Card */
36
+ /** **(Optional)** Specify the position of the image in the Card. */
36
37
  imagePosition?: "left" | "right"
37
- /** **(Optional)** Specifies the label of the Card */
38
+ /** **(Optional)** Specify the Card label. */
38
39
  label?: string
39
- /** **(Optional)** Specifies the label background of the Card */
40
+ /** **(Optional)** Specify the background color of the Card label. */
40
41
  labelBackground?: Lights
41
- /** **(Optional)** Specifies the layout of the Card */
42
+ /** **(Optional)** Specify the layout of the Card. */
42
43
  layout?: "vertical" | "horizontal"
43
44
  }
44
45
 
@@ -65,7 +66,7 @@ export const Card = ({
65
66
  badgePosition = "inset",
66
67
  chevron = false,
67
68
  children,
68
- className = "",
69
+ className,
69
70
  heading,
70
71
  headingLevel = "h3",
71
72
  href,
@@ -116,9 +117,7 @@ export const Card = ({
116
117
  </div>
117
118
  {chevron && (
118
119
  <span aria-hidden="true" className="coop-card--icon" role="presentation">
119
- <svg viewBox="0 0 16 29">
120
- <path d="M2 28.1a1.6 1.6 0 0 1-1.2-2.7l11-10.9-11-11A1.6 1.6 0 1 1 3 1.5l12 12a1.6 1.6 0 0 1 0 2.2l-12 12c-.3.4-.7.5-1 .5z" />
121
- </svg>
120
+ <ChevronRightIcon />
122
121
  </span>
123
122
  )}
124
123
  </div>
@@ -4,22 +4,23 @@ import { clsx } from "clsx"
4
4
 
5
5
  import { bgPropToClass } from "../../../src/utils"
6
6
  import { None, Tints, White } from "../../types/colors"
7
+ import { ChevronDownIcon } from "../Icon"
7
8
 
8
9
  export interface ExpandableProps extends DetailsHTMLAttributes<HTMLDetailsElement> {
9
- /** **(Optional)** Specifies the Expandable background color from the available options. */
10
+ /** **(Optional)** Specify the Expandable background color. */
10
11
  background?: Tints | White | None
11
- /** Represents the content inside the Expandable component, only visible when expanded. It can be any valid JSX or string. */
12
+ /** Main content inside the component, only visible when it is open. It can be any valid JSX or string. */
12
13
  children: React.ReactNode
13
- /** **(Optional)** Receives any className to be applied to Expandable component. */
14
+ /** **(Optional)** Specify additional CSS classes to be applied to the component. */
14
15
  className?: string
15
- /** Specifies summary for this component. It can be any valid JSX or string. */
16
+ /** Specify the summary text to show when the Expandable is not open. */
16
17
  summary: React.ReactNode
17
18
  }
18
19
 
19
20
  export const Expandable = ({
20
21
  background = "tint-grey",
21
22
  children,
22
- className = "",
23
+ className,
23
24
  summary,
24
25
  ...props
25
26
  }: ExpandableProps): JSX.Element => {
@@ -31,15 +32,12 @@ export const Expandable = ({
31
32
  <details {...componentProps} style={{ "--background-color": `var(--color-${background})` }}>
32
33
  <summary>
33
34
  {summary}
34
- <svg fill="none" height="24" width="24" xmlns="http://www.w3.org/2000/svg">
35
- <path
36
- d="m20.25 9.75-6.22 6.22a.75.75 0 0 1-1.06 0L6.75 9.75"
37
- stroke="black"
38
- strokeLinecap="round"
39
- strokeLinejoin="round"
40
- strokeWidth="1.5"
41
- />
42
- </svg>
35
+ <ChevronDownIcon
36
+ className="coop-expandable--icon"
37
+ stroke="currentColor"
38
+ strokeWidth={2}
39
+ width="12"
40
+ />
43
41
  </summary>
44
42
  <div className="coop-expandable--content">{children}</div>
45
43
  </details>
@@ -1,16 +1,17 @@
1
+ import clsx from "clsx"
1
2
  import { type SVGProps, useId } from "react"
2
3
 
3
4
  interface IconProps extends SVGProps<SVGSVGElement> {
4
5
  alt?: string
5
6
  }
6
7
 
7
- export const AddIcon = ({ alt, className, ...props }: IconProps) => {
8
+ export const AddIcon = ({ alt, className, fill, ...props }: IconProps) => {
8
9
  const id = useId()
9
10
  const componentProps = {
10
11
  "aria-labelledby": alt ? id : undefined,
11
- className: `coop-icon ${className ?? ""}`.trim(),
12
+ className: clsx("coop-icon", className),
12
13
  "data-icon": "add",
13
- fill: "none",
14
+ fill: fill ?? "none",
14
15
  role: alt ? "img" : undefined,
15
16
  viewBox: "0 0 32 32",
16
17
  ...props,
@@ -20,11 +21,11 @@ export const AddIcon = ({ alt, className, ...props }: IconProps) => {
20
21
  {alt ? <title id={id}>{alt}</title> : null}
21
22
  <path
22
23
  d="M24.7 16.72a1 1 0 0 1-.7.28H8a1 1 0 1 1 0-2h16a1 1 0 0 1 1 1 1 1 0 0 1-.3.72"
23
- fill="currentColor"
24
+ fill={fill ?? "currentColor"}
24
25
  />
25
26
  <path
26
27
  d="M16.72 24.7a1 1 0 0 1-.72.3 1 1 0 0 1-1-1V8a1 1 0 0 1 2 0v16a1 1 0 0 1-.28.7"
27
- fill="currentColor"
28
+ fill={fill ?? "currentColor"}
28
29
  />
29
30
  </svg>
30
31
  )
@@ -1,16 +1,17 @@
1
+ import clsx from "clsx"
1
2
  import { type SVGProps, useId } from "react"
2
3
 
3
4
  interface IconProps extends SVGProps<SVGSVGElement> {
4
5
  alt?: string
5
6
  }
6
7
 
7
- export const ArrowDownIcon = ({ alt, className, ...props }: IconProps) => {
8
+ export const ArrowDownIcon = ({ alt, className, fill, ...props }: IconProps) => {
8
9
  const id = useId()
9
10
  const componentProps = {
10
11
  "aria-labelledby": alt ? id : undefined,
11
- className: `coop-icon ${className ?? ""}`.trim(),
12
+ className: clsx("coop-icon", className),
12
13
  "data-icon": "arrow-down",
13
- fill: "none",
14
+ fill: fill ?? "none",
14
15
  role: alt ? "img" : undefined,
15
16
  viewBox: "0 0 32 32",
16
17
  ...props,
@@ -18,10 +19,10 @@ export const ArrowDownIcon = ({ alt, className, ...props }: IconProps) => {
18
19
  return (
19
20
  <svg {...componentProps}>
20
21
  {alt ? <title id={id}>{alt}</title> : null}
21
- <path d="M15 28.66V3a1 1 0 0 1 2 0v25.66a1 1 0 0 1-2 0" fill="currentColor" />
22
+ <path d="M15 28.66V3a1 1 0 0 1 2 0v25.66a1 1 0 0 1-2 0" fill={fill ?? "currentColor"} />
22
23
  <path
23
24
  d="M3 17a1 1 0 0 1 .29-.71 1 1 0 0 1 1.42 0L16 27.58l11.29-11.29a1 1 0 0 1 1.42 0 1 1 0 0 1 0 1.41l-12 12a1 1 0 0 1-1.41 0l-12-12A1 1 0 0 1 3 17"
24
- fill="currentColor"
25
+ fill={fill ?? "currentColor"}
25
26
  />
26
27
  </svg>
27
28
  )
@@ -1,16 +1,17 @@
1
+ import clsx from "clsx"
1
2
  import { type SVGProps, useId } from "react"
2
3
 
3
4
  interface IconProps extends SVGProps<SVGSVGElement> {
4
5
  alt?: string
5
6
  }
6
7
 
7
- export const ArrowLeftIcon = ({ alt, className, ...props }: IconProps) => {
8
+ export const ArrowLeftIcon = ({ alt, className, fill, ...props }: IconProps) => {
8
9
  const id = useId()
9
10
  const componentProps = {
10
11
  "aria-labelledby": alt ? id : undefined,
11
- className: `coop-icon ${className ?? ""}`.trim(),
12
+ className: clsx("coop-icon", className),
12
13
  "data-icon": "arrow-left",
13
- fill: "none",
14
+ fill: fill ?? "none",
14
15
  role: alt ? "img" : undefined,
15
16
  viewBox: "0 0 32 32",
16
17
  ...props,
@@ -18,10 +19,10 @@ export const ArrowLeftIcon = ({ alt, className, ...props }: IconProps) => {
18
19
  return (
19
20
  <svg {...componentProps}>
20
21
  {alt ? <title id={id}>{alt}</title> : null}
21
- <path d="M3.34 17H29a1 1 0 0 0 0-2H3.34a1 1 0 0 0 0 2" fill="currentColor" />
22
+ <path d="M3.34 17H29a1 1 0 0 0 0-2H3.34a1 1 0 0 0 0 2" fill={fill ?? "currentColor"} />
22
23
  <path
23
24
  d="M15 29a1 1 0 0 0 .71-.29 1 1 0 0 0 0-1.42L5.12 16.71a1 1 0 0 1 0-1.42L15.71 4.71a1 1 0 0 0 0-1.42 1 1 0 0 0-1.41 0l-12 12a1 1 0 0 0 0 1.42l12 12a1 1 0 0 0 .7.29"
24
- fill="currentColor"
25
+ fill={fill ?? "currentColor"}
25
26
  />
26
27
  </svg>
27
28
  )
@@ -1,16 +1,17 @@
1
+ import clsx from "clsx"
1
2
  import { type SVGProps, useId } from "react"
2
3
 
3
4
  interface IconProps extends SVGProps<SVGSVGElement> {
4
5
  alt?: string
5
6
  }
6
7
 
7
- export const ArrowRightIcon = ({ alt, className, ...props }: IconProps) => {
8
+ export const ArrowRightIcon = ({ alt, className, fill, ...props }: IconProps) => {
8
9
  const id = useId()
9
10
  const componentProps = {
10
11
  "aria-labelledby": alt ? id : undefined,
11
- className: `coop-icon ${className ?? ""}`.trim(),
12
+ className: clsx("coop-icon", className),
12
13
  "data-icon": "arrow-right",
13
- fill: "none",
14
+ fill: fill ?? "none",
14
15
  role: alt ? "img" : undefined,
15
16
  viewBox: "0 0 32 32",
16
17
  ...props,
@@ -18,10 +19,10 @@ export const ArrowRightIcon = ({ alt, className, ...props }: IconProps) => {
18
19
  return (
19
20
  <svg {...componentProps}>
20
21
  {alt ? <title id={id}>{alt}</title> : null}
21
- <path d="M28.7 15H3a1 1 0 0 0 0 2h25.7a1 1 0 0 0 0-2" fill="currentColor" />
22
+ <path d="M28.7 15H3a1 1 0 0 0 0 2h25.7a1 1 0 0 0 0-2" fill={fill ?? "currentColor"} />
22
23
  <path
23
24
  d="M17 3a1 1 0 0 0-.7.3 1 1 0 0 0 0 1.4l10.6 10.6a1 1 0 0 1 0 1.4L16.3 27.3a1 1 0 0 0 0 1.4 1 1 0 0 0 1.4 0l12-12a1 1 0 0 0 0-1.4l-12-12A1 1 0 0 0 17 3"
24
- fill="currentColor"
25
+ fill={fill ?? "currentColor"}
25
26
  />
26
27
  </svg>
27
28
  )
@@ -1,16 +1,17 @@
1
+ import clsx from "clsx"
1
2
  import { type SVGProps, useId } from "react"
2
3
 
3
4
  interface IconProps extends SVGProps<SVGSVGElement> {
4
5
  alt?: string
5
6
  }
6
7
 
7
- export const ArrowUpIcon = ({ alt, className, ...props }: IconProps) => {
8
+ export const ArrowUpIcon = ({ alt, className, fill, ...props }: IconProps) => {
8
9
  const id = useId()
9
10
  const componentProps = {
10
11
  "aria-labelledby": alt ? id : undefined,
11
- className: `coop-icon ${className ?? ""}`.trim(),
12
+ className: clsx("coop-icon", className),
12
13
  "data-icon": "arrow-up",
13
- fill: "none",
14
+ fill: fill ?? "none",
14
15
  role: alt ? "img" : undefined,
15
16
  viewBox: "0 0 32 32",
16
17
  ...props,
@@ -18,10 +19,10 @@ export const ArrowUpIcon = ({ alt, className, ...props }: IconProps) => {
18
19
  return (
19
20
  <svg {...componentProps}>
20
21
  {alt ? <title id={id}>{alt}</title> : null}
21
- <path d="M17 3.34V29a1 1 0 0 1-2 0V3.34a1 1 0 0 1 2 0" fill="currentColor" />
22
+ <path d="M17 3.34V29a1 1 0 0 1-2 0V3.34a1 1 0 0 1 2 0" fill={fill ?? "currentColor"} />
22
23
  <path
23
24
  d="M29 15a1 1 0 0 1-.29.71 1 1 0 0 1-1.42 0L16 4.42 4.71 15.71a1 1 0 0 1-1.42 0 1 1 0 0 1 0-1.41l12-12a1 1 0 0 1 1.41 0l12 12a1 1 0 0 1 .3.7"
24
- fill="currentColor"
25
+ fill={fill ?? "currentColor"}
25
26
  />
26
27
  </svg>
27
28
  )
@@ -1,16 +1,17 @@
1
+ import clsx from "clsx"
1
2
  import { type SVGProps, useId } from "react"
2
3
 
3
4
  interface IconProps extends SVGProps<SVGSVGElement> {
4
5
  alt?: string
5
6
  }
6
7
 
7
- export const AvatarAltIcon = ({ alt, className, ...props }: IconProps) => {
8
+ export const AvatarAltIcon = ({ alt, className, fill, ...props }: IconProps) => {
8
9
  const id = useId()
9
10
  const componentProps = {
10
11
  "aria-labelledby": alt ? id : undefined,
11
- className: `coop-icon ${className ?? ""}`.trim(),
12
+ className: clsx("coop-icon", className),
12
13
  "data-icon": "avatar-alt",
13
- fill: "none",
14
+ fill: fill ?? "none",
14
15
  role: alt ? "img" : undefined,
15
16
  viewBox: "0 0 32 32",
16
17
  ...props,
@@ -20,15 +21,15 @@ export const AvatarAltIcon = ({ alt, className, ...props }: IconProps) => {
20
21
  {alt ? <title id={id}>{alt}</title> : null}
21
22
  <path
22
23
  d="M16 32a16 16 0 1 1 16-16 16 16 0 0 1-16 16m0-30a14 14 0 1 0 14 14A14 14 0 0 0 16 2"
23
- fill="currentColor"
24
+ fill={fill ?? "currentColor"}
24
25
  />
25
26
  <path
26
27
  d="M16 8a5 5 0 1 1-5 5 5 5 0 0 1 5-5m0-2a7 7 0 1 0 7 7 7 7 0 0 0-7-7"
27
- fill="currentColor"
28
+ fill={fill ?? "currentColor"}
28
29
  />
29
30
  <path
30
31
  d="M5.64 27.85a.7.7 0 0 1-.19 0 1 1 0 0 1-.79-1.17A10.7 10.7 0 0 1 15.16 18h1.68a10.7 10.7 0 0 1 10.5 8.67 1 1 0 0 1-.79 1.17 1 1 0 0 1-1.17-.84 8.72 8.72 0 0 0-8.54-7h-1.68a8.72 8.72 0 0 0-8.54 7 1 1 0 0 1-.98.85"
31
- fill="currentColor"
32
+ fill={fill ?? "currentColor"}
32
33
  />
33
34
  </svg>
34
35
  )
@@ -1,16 +1,17 @@
1
+ import clsx from "clsx"
1
2
  import { type SVGProps, useId } from "react"
2
3
 
3
4
  interface IconProps extends SVGProps<SVGSVGElement> {
4
5
  alt?: string
5
6
  }
6
7
 
7
- export const AvatarIcon = ({ alt, className, ...props }: IconProps) => {
8
+ export const AvatarIcon = ({ alt, className, fill, ...props }: IconProps) => {
8
9
  const id = useId()
9
10
  const componentProps = {
10
11
  "aria-labelledby": alt ? id : undefined,
11
- className: `coop-icon ${className ?? ""}`.trim(),
12
+ className: clsx("coop-icon", className),
12
13
  "data-icon": "avatar",
13
- fill: "none",
14
+ fill: fill ?? "none",
14
15
  role: alt ? "img" : undefined,
15
16
  viewBox: "0 0 32 32",
16
17
  ...props,
@@ -20,11 +21,11 @@ export const AvatarIcon = ({ alt, className, ...props }: IconProps) => {
20
21
  {alt ? <title id={id}>{alt}</title> : null}
21
22
  <path
22
23
  d="M16 31a18.24 18.24 0 0 1-12.64-5.1A1.19 1.19 0 0 1 3 24.86a12.31 12.31 0 0 1 12-10h2a12.31 12.31 0 0 1 12 10 1.19 1.19 0 0 1-.34 1.06A18.24 18.24 0 0 1 16 31M5.42 24.68a15.9 15.9 0 0 0 21.16 0A10 10 0 0 0 17 17.17h-2a10 10 0 0 0-9.58 7.51"
23
- fill="currentColor"
24
+ fill={fill ?? "currentColor"}
24
25
  />
25
26
  <path
26
27
  d="M15.94 3.33a5.77 5.77 0 1 1-5.72 5.77 5.75 5.75 0 0 1 5.72-5.77m0-2.31a8.08 8.08 0 1 0 8 8.08 8 8 0 0 0-8-8.08"
27
- fill="currentColor"
28
+ fill={fill ?? "currentColor"}
28
29
  />
29
30
  </svg>
30
31
  )
@@ -1,16 +1,17 @@
1
+ import clsx from "clsx"
1
2
  import { type SVGProps, useId } from "react"
2
3
 
3
4
  interface IconProps extends SVGProps<SVGSVGElement> {
4
5
  alt?: string
5
6
  }
6
7
 
7
- export const BasketIcon = ({ alt, className, ...props }: IconProps) => {
8
+ export const BasketIcon = ({ alt, className, fill, ...props }: IconProps) => {
8
9
  const id = useId()
9
10
  const componentProps = {
10
11
  "aria-labelledby": alt ? id : undefined,
11
- className: `coop-icon ${className ?? ""}`.trim(),
12
+ className: clsx("coop-icon", className),
12
13
  "data-icon": "basket",
13
- fill: "none",
14
+ fill: fill ?? "none",
14
15
  role: alt ? "img" : undefined,
15
16
  viewBox: "0 0 32 32",
16
17
  ...props,
@@ -20,11 +21,11 @@ export const BasketIcon = ({ alt, className, ...props }: IconProps) => {
20
21
  {alt ? <title id={id}>{alt}</title> : null}
21
22
  <path
22
23
  d="M16.07 26a1 1 0 0 0 1-1v-4.08a1 1 0 1 0-2 0V25a1 1 0 0 0 1 1M21.5 26h.17a1 1 0 0 0 1-.85l.68-4.07a1 1 0 0 0-.82-1.18 1 1 0 0 0-1.16.84l-.67 4.07a1 1 0 0 0 .8 1.19M10.43 26h.17a1 1 0 0 0 .82-1.18l-.68-4.07a1 1 0 0 0-1.15-.84 1 1 0 0 0-.82 1.18l.67 4.07a1 1 0 0 0 .99.84"
23
- fill="currentColor"
24
+ fill={fill ?? "currentColor"}
24
25
  />
25
26
  <path
26
27
  d="M31 10.7h-3.11l-8.25-8.4a1 1 0 0 0-1.41 0 1 1 0 0 0 0 1.44l6.83 7H6.85l6.8-6.93a1 1 0 0 0 0-1.44 1 1 0 0 0-1.42 0l-8.14 8.25a1 1 0 0 0 0 .08H1a1 1 0 0 0-1 1v5.1a1 1 0 0 0 1 1h1.23l1.88 11.36a1 1 0 0 0 1 .84H27a1 1 0 0 0 1-.84l1.88-11.34H31a1 1 0 0 0 1-1v-5.1a1 1 0 0 0-1-1.02M26.15 28H5.94L4.28 18h23.53ZM30 15.79H2v-3.06h28Z"
27
- fill="currentColor"
28
+ fill={fill ?? "currentColor"}
28
29
  />
29
30
  </svg>
30
31
  )
@@ -1,16 +1,17 @@
1
+ import clsx from "clsx"
1
2
  import { type SVGProps, useId } from "react"
2
3
 
3
4
  interface IconProps extends SVGProps<SVGSVGElement> {
4
5
  alt?: string
5
6
  }
6
7
 
7
- export const CalendarIcon = ({ alt, className, ...props }: IconProps) => {
8
+ export const CalendarIcon = ({ alt, className, fill, ...props }: IconProps) => {
8
9
  const id = useId()
9
10
  const componentProps = {
10
11
  "aria-labelledby": alt ? id : undefined,
11
- className: `coop-icon ${className ?? ""}`.trim(),
12
+ className: clsx("coop-icon", className),
12
13
  "data-icon": "calendar",
13
- fill: "none",
14
+ fill: fill ?? "none",
14
15
  role: alt ? "img" : undefined,
15
16
  viewBox: "0 0 32 32",
16
17
  ...props,
@@ -20,11 +21,11 @@ export const CalendarIcon = ({ alt, className, ...props }: IconProps) => {
20
21
  {alt ? <title id={id}>{alt}</title> : null}
21
22
  <path
22
23
  d="M31 2h-4V1a1 1 0 0 0-2 0v1H7V1a1 1 0 0 0-2 0v1H1a1 1 0 0 0-1 1v28a1 1 0 0 0 1 1h30a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1m-1 28H2V10h28Zm0-22H2V4h3v1a1 1 0 0 0 2 0V4h18v1a1 1 0 0 0 2 0V4h3Z"
23
- fill="currentColor"
24
+ fill={fill ?? "currentColor"}
24
25
  />
25
26
  <path
26
27
  d="M6 23v2a1 1 0 0 0 2 0v-1h7v1a1 1 0 0 0 2 0v-1h7v1a1 1 0 0 0 2 0V15a1 1 0 0 0-2 0v1h-7v-1a1 1 0 0 0-2 0v1H8v-1a1 1 0 0 0-2 0v8m18-1h-7v-4h7Zm-9-4v4H8v-4Z"
27
- fill="currentColor"
28
+ fill={fill ?? "currentColor"}
28
29
  />
29
30
  </svg>
30
31
  )
@@ -1,16 +1,17 @@
1
+ import clsx from "clsx"
1
2
  import { type SVGProps, useId } from "react"
2
3
 
3
4
  interface IconProps extends SVGProps<SVGSVGElement> {
4
5
  alt?: string
5
6
  }
6
7
 
7
- export const ChevronDownIcon = ({ alt, className, ...props }: IconProps) => {
8
+ export const ChevronDownIcon = ({ alt, className, fill, ...props }: IconProps) => {
8
9
  const id = useId()
9
10
  const componentProps = {
10
11
  "aria-labelledby": alt ? id : undefined,
11
- className: `coop-icon ${className ?? ""}`.trim(),
12
+ className: clsx("coop-icon", className),
12
13
  "data-icon": "chevron-down",
13
- fill: "none",
14
+ fill: fill ?? "none",
14
15
  role: alt ? "img" : undefined,
15
16
  viewBox: "0 0 32 32",
16
17
  ...props,
@@ -20,7 +21,7 @@ export const ChevronDownIcon = ({ alt, className, ...props }: IconProps) => {
20
21
  {alt ? <title id={id}>{alt}</title> : null}
21
22
  <path
22
23
  d="M31 9a1 1 0 0 0-.29-.71 1 1 0 0 0-1.42 0L16 21.59 2.71 8.3a1 1 0 0 0-1.42 0 1 1 0 0 0 0 1.41l14 14a1 1 0 0 0 1.41 0l14-14A1 1 0 0 0 31 9"
23
- fill="currentColor"
24
+ fill={fill ?? "currentColor"}
24
25
  />
25
26
  </svg>
26
27
  )