@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
@@ -1,32 +1,32 @@
1
1
  import type { HTMLAttributes, JSX } from "react"
2
2
 
3
+ import clsx from "clsx"
4
+
3
5
  interface SkipNavLink {
4
6
  href: string
5
7
  label: string
6
8
  }
7
9
 
8
10
  export interface SkipNavProps extends HTMLAttributes<HTMLDivElement> {
9
- /** **(Optional)** Receives any className to be applied to Skip Nav component. */
11
+ /** **(Optional)** Specify additional CSS classes to be applied to the component. */
10
12
  className?: string
11
- /** **(Optional)** Specifies if the component is visible straight away or only when pressing 'Tab'. */
13
+ /** **(Optional)** Specify whether the SkipNav is visible immediately or only when tabbing. Useful for testing purposes only. */
12
14
  isVisible?: boolean
13
- /** **(Optional)** Specifies the links that are going to be shown on the Skip Nav.
14
- * It is an `array` of items and each item should have `href` and `label` information.
15
- *
16
- * Defaults to a single link anchored to `#main` */
15
+ /** **(Optional)** Specify links to show in the SkipNav.
16
+ * Each item needs a `href` and `label`. Defaults to a single link anchored to `#main`. */
17
17
  links?: SkipNavLink[]
18
18
  }
19
19
 
20
20
  const defaultLinks = [{ href: "#main", label: "Skip to main content" }]
21
21
 
22
22
  export const SkipNav = ({
23
- className = "",
23
+ className,
24
24
  isVisible = false,
25
25
  links = defaultLinks,
26
26
  ...props
27
27
  }: SkipNavProps): JSX.Element => {
28
28
  const componentProps = {
29
- className: `coop-skip-nav ${className}`,
29
+ className: clsx("coop-skip-nav", className),
30
30
  ...props,
31
31
  }
32
32
  const navLinks = links.length > 0 ? links : defaultLinks
@@ -1,28 +1,30 @@
1
1
  import type { HTMLAttributes, JSX } from "react"
2
2
 
3
+ import clsx from "clsx"
4
+
3
5
  import { bgPropToClass } from "../../../src/utils"
4
- import { CoopBlue, Green, OffersRed } from "../../types/colors"
6
+ import { BrandBlue, Green, OfferRed } from "../../types/colors"
5
7
 
6
8
  export interface SquircleProps extends HTMLAttributes<HTMLDivElement> {
7
- /** **(Optional)** Specifies the background color of the Squircle. */
8
- background?: OffersRed | CoopBlue | Green
9
- /** **(Optional)** Represents the content inside the Squircle component. It can be any valid JSX or string. */
9
+ /** **(Optional)** Specify the Squircle background color. */
10
+ background?: OfferRed | BrandBlue | Green
11
+ /** **(Optional)** Main content inside the component. It can be any valid JSX or string. */
10
12
  children?: React.ReactNode
11
- /** **(Optional)** Receives any className to be applied to Squircle component. */
13
+ /** **(Optional)** Specify additional CSS classes to be applied to the component. */
12
14
  className?: string
13
- /** **(Optional)** Specifies what should be the Squircle size */
15
+ /** **(Optional)** Specify the Squircle size. */
14
16
  size?: "sm" | "md" | "lg"
15
17
  }
16
18
 
17
19
  export const Squircle = ({
18
- background = "offers-red",
20
+ background = "offer-red",
19
21
  children,
20
22
  className,
21
23
  size = "lg",
22
24
  ...props
23
25
  }: SquircleProps): JSX.Element => {
24
26
  const componentProps = {
25
- className: `coop-squircle ${bgPropToClass(background, className)} ${className ?? ""}`,
27
+ className: clsx("coop-squircle", bgPropToClass(background, className), className),
26
28
  "data-size": size.length && size !== "lg" ? size : undefined,
27
29
  ...props,
28
30
  }
@@ -8,16 +8,16 @@ import type { Black, Darks, Greys, Lights, Tints, White } from "../../types/colo
8
8
  import { bgPropToClass } from "../../../src/utils"
9
9
 
10
10
  export interface TagProps extends HTMLAttributes<HTMLAnchorElement> {
11
- /** **(Optional)** Specifies the custom element to override default `a` or `span`. */
11
+ /** **(Optional)** Specify a custom element to override default `a` or `span`. */
12
12
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
13
13
  as?: React.FC<AnchorHTMLAttributes<HTMLElement>> | ForwardRefExoticComponent<any> | string
14
- /** **(Optional)** Specifies the Tag background color from the available options. */
14
+ /** **(Optional)** Specify the Tag background color. */
15
15
  background?: Lights | Darks | Tints | Greys | White | Black
16
- /** **(Optional)** Represents the content inside the Tag component. It can be any valid JSX or string. */
16
+ /** **(Optional)** Main content inside the component. It can be any valid JSX or string. */
17
17
  children?: React.ReactNode
18
- /** **(Optional)** Receives any className to be applied to Tag component. */
18
+ /** **(Optional)** Specify additional CSS classes to be applied to the component. */
19
19
  className?: string
20
- /** **(Optional)** Specifies the URL that the Tag component will link to when clicked. */
20
+ /** **(Optional)** Specify the URL that the Tag component will link to when clicked. */
21
21
  href?: string
22
22
  }
23
23
 
@@ -25,7 +25,7 @@ export const Tag = ({
25
25
  as,
26
26
  background = "tint-grey",
27
27
  children,
28
- className = "",
28
+ className,
29
29
  href,
30
30
  ...props
31
31
  }: TagProps): JSX.Element => {
@@ -35,7 +35,7 @@ export type Greys = "dark-grey" | "mid-dark-grey" | "mid-grey" | "mid-light-grey
35
35
  export type White = "white"
36
36
  export type Black = "black"
37
37
  export type None = "none"
38
- export type CoopBlue = "coop-blue"
39
- export type OffersRed = "offers-red"
38
+ export type BrandBlue = "brand-blue"
39
+ export type OfferRed = "offer-red"
40
40
  export type Green = "green"
41
41
  export type Blue = "blue"