@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.
- package/dist/components/AlertBanner/AlertBanner.d.ts +3 -3
- package/dist/components/AlertBanner/AlertBanner.js +3 -2
- package/dist/components/Author/Author.d.ts +4 -4
- package/dist/components/Author/Author.js +3 -2
- package/dist/components/Button/Button.d.ts +10 -10
- package/dist/components/Button/Button.js +3 -2
- package/dist/components/Card/Card.d.ts +14 -14
- package/dist/components/Card/Card.js +1 -1
- package/dist/components/Expandable/Expandable.d.ts +4 -4
- package/dist/components/Expandable/Expandable.js +4 -2
- package/dist/components/Icon/AddIcon.d.ts +1 -1
- package/dist/components/Icon/AddIcon.js +4 -3
- package/dist/components/Icon/ArrowDownIcon.d.ts +1 -1
- package/dist/components/Icon/ArrowDownIcon.js +4 -3
- package/dist/components/Icon/ArrowLeftIcon.d.ts +1 -1
- package/dist/components/Icon/ArrowLeftIcon.js +4 -3
- package/dist/components/Icon/ArrowRightIcon.d.ts +1 -1
- package/dist/components/Icon/ArrowRightIcon.js +4 -3
- package/dist/components/Icon/ArrowUpIcon.d.ts +1 -1
- package/dist/components/Icon/ArrowUpIcon.js +4 -3
- package/dist/components/Icon/AvatarAltIcon.d.ts +1 -1
- package/dist/components/Icon/AvatarAltIcon.js +4 -3
- package/dist/components/Icon/AvatarIcon.d.ts +1 -1
- package/dist/components/Icon/AvatarIcon.js +4 -3
- package/dist/components/Icon/BasketIcon.d.ts +1 -1
- package/dist/components/Icon/BasketIcon.js +4 -3
- package/dist/components/Icon/CalendarIcon.d.ts +1 -1
- package/dist/components/Icon/CalendarIcon.js +4 -3
- package/dist/components/Icon/ChevronDownIcon.d.ts +1 -1
- package/dist/components/Icon/ChevronDownIcon.js +4 -3
- package/dist/components/Icon/ChevronLeftIcon.d.ts +1 -1
- package/dist/components/Icon/ChevronLeftIcon.js +4 -3
- package/dist/components/Icon/ChevronRightIcon.d.ts +1 -1
- package/dist/components/Icon/ChevronRightIcon.js +4 -3
- package/dist/components/Icon/ChevronUpIcon.d.ts +1 -1
- package/dist/components/Icon/ChevronUpIcon.js +4 -3
- package/dist/components/Icon/ClockIcon.d.ts +1 -1
- package/dist/components/Icon/ClockIcon.js +4 -3
- package/dist/components/Icon/CloseAltIcon.d.ts +1 -1
- package/dist/components/Icon/CloseAltIcon.js +4 -3
- package/dist/components/Icon/CloseIcon.d.ts +1 -1
- package/dist/components/Icon/CloseIcon.js +4 -3
- package/dist/components/Icon/CoopCardIcon.d.ts +1 -1
- package/dist/components/Icon/CoopCardIcon.js +4 -3
- package/dist/components/Icon/CoopIcon.d.ts +1 -1
- package/dist/components/Icon/CoopIcon.js +4 -3
- package/dist/components/Icon/CoopLocationIcon.d.ts +1 -1
- package/dist/components/Icon/CoopLocationIcon.js +4 -3
- package/dist/components/Icon/DownloadIcon.d.ts +1 -1
- package/dist/components/Icon/DownloadIcon.js +4 -3
- package/dist/components/Icon/HomeIcon.d.ts +1 -1
- package/dist/components/Icon/HomeIcon.js +4 -3
- package/dist/components/Icon/InformationIcon.d.ts +1 -1
- package/dist/components/Icon/InformationIcon.js +4 -3
- package/dist/components/Icon/LoadingIcon.d.ts +1 -1
- package/dist/components/Icon/LoadingIcon.js +4 -3
- package/dist/components/Icon/LocationIcon.d.ts +1 -1
- package/dist/components/Icon/LocationIcon.js +4 -3
- package/dist/components/Icon/MailIcon.d.ts +1 -1
- package/dist/components/Icon/MailIcon.js +4 -3
- package/dist/components/Icon/MenuIcon.d.ts +1 -1
- package/dist/components/Icon/MenuIcon.js +4 -3
- package/dist/components/Icon/MessageIcon.d.ts +1 -1
- package/dist/components/Icon/MessageIcon.js +4 -3
- package/dist/components/Icon/MinusIcon.d.ts +1 -1
- package/dist/components/Icon/MinusIcon.js +4 -3
- package/dist/components/Icon/OpenNewIcon.d.ts +1 -1
- package/dist/components/Icon/OpenNewIcon.js +4 -3
- package/dist/components/Icon/PencilIcon.d.ts +1 -1
- package/dist/components/Icon/PencilIcon.js +4 -3
- package/dist/components/Icon/PhoneIcon.d.ts +1 -1
- package/dist/components/Icon/PhoneIcon.js +4 -3
- package/dist/components/Icon/QuestionIcon.d.ts +1 -1
- package/dist/components/Icon/QuestionIcon.js +4 -3
- package/dist/components/Icon/ScooterIcon.d.ts +1 -1
- package/dist/components/Icon/ScooterIcon.js +4 -3
- package/dist/components/Icon/SearchIcon.d.ts +1 -1
- package/dist/components/Icon/SearchIcon.js +4 -3
- package/dist/components/Icon/SettingsIcon.d.ts +1 -1
- package/dist/components/Icon/SettingsIcon.js +4 -3
- package/dist/components/Icon/TickAltIcon.d.ts +1 -1
- package/dist/components/Icon/TickAltIcon.js +4 -3
- package/dist/components/Icon/TickIcon.d.ts +1 -1
- package/dist/components/Icon/TickIcon.js +4 -3
- package/dist/components/Icon/VanIcon.d.ts +1 -1
- package/dist/components/Icon/VanIcon.js +4 -3
- package/dist/components/Icon/WarningIcon.d.ts +1 -1
- package/dist/components/Icon/WarningIcon.js +4 -3
- package/dist/components/Icon/WriteIcon.d.ts +1 -1
- package/dist/components/Icon/WriteIcon.js +4 -3
- package/dist/components/Image/Image.d.ts +5 -5
- package/dist/components/Pill/Pill.d.ts +10 -10
- package/dist/components/Pill/Pill.js +1 -1
- package/dist/components/RootSVG/RootSVG.js +1 -1
- package/dist/components/SearchBox/SearchBox.d.ts +10 -10
- package/dist/components/SearchBox/SearchBox.js +2 -1
- package/dist/components/Signpost/Signpost.d.ts +6 -6
- package/dist/components/Signpost/Signpost.js +3 -2
- package/dist/components/SkipNav/SkipNav.d.ts +4 -6
- package/dist/components/SkipNav/SkipNav.js +3 -2
- package/dist/components/Squircle/Squircle.d.ts +6 -6
- package/dist/components/Squircle/Squircle.js +3 -2
- package/dist/components/Tag/Tag.d.ts +5 -5
- package/dist/components/Tag/Tag.js +1 -1
- package/dist/types/colors.d.ts +2 -2
- package/package.json +3 -3
- package/src/components/AlertBanner/AlertBanner.tsx +7 -5
- package/src/components/Author/Author.tsx +8 -6
- package/src/components/Button/Button.tsx +13 -12
- package/src/components/Card/Card.tsx +17 -18
- package/src/components/Expandable/Expandable.tsx +12 -14
- package/src/components/Icon/AddIcon.tsx +6 -5
- package/src/components/Icon/ArrowDownIcon.tsx +6 -5
- package/src/components/Icon/ArrowLeftIcon.tsx +6 -5
- package/src/components/Icon/ArrowRightIcon.tsx +6 -5
- package/src/components/Icon/ArrowUpIcon.tsx +6 -5
- package/src/components/Icon/AvatarAltIcon.tsx +7 -6
- package/src/components/Icon/AvatarIcon.tsx +6 -5
- package/src/components/Icon/BasketIcon.tsx +6 -5
- package/src/components/Icon/CalendarIcon.tsx +6 -5
- package/src/components/Icon/ChevronDownIcon.tsx +5 -4
- package/src/components/Icon/ChevronLeftIcon.tsx +5 -4
- package/src/components/Icon/ChevronRightIcon.tsx +5 -4
- package/src/components/Icon/ChevronUpIcon.tsx +5 -4
- package/src/components/Icon/ClockIcon.tsx +6 -5
- package/src/components/Icon/CloseAltIcon.tsx +7 -6
- package/src/components/Icon/CloseIcon.tsx +6 -5
- package/src/components/Icon/CoopCardIcon.tsx +5 -4
- package/src/components/Icon/CoopIcon.tsx +5 -4
- package/src/components/Icon/CoopLocationIcon.tsx +7 -6
- package/src/components/Icon/DownloadIcon.tsx +10 -6
- package/src/components/Icon/HomeIcon.tsx +7 -6
- package/src/components/Icon/InformationIcon.tsx +6 -5
- package/src/components/Icon/LoadingIcon.tsx +5 -4
- package/src/components/Icon/LocationIcon.tsx +6 -5
- package/src/components/Icon/MailIcon.tsx +5 -4
- package/src/components/Icon/MenuIcon.tsx +5 -4
- package/src/components/Icon/MessageIcon.tsx +5 -4
- package/src/components/Icon/MinusIcon.tsx +5 -4
- package/src/components/Icon/OpenNewIcon.tsx +6 -5
- package/src/components/Icon/PencilIcon.tsx +5 -4
- package/src/components/Icon/PhoneIcon.tsx +5 -4
- package/src/components/Icon/QuestionIcon.tsx +6 -5
- package/src/components/Icon/ScooterIcon.tsx +7 -6
- package/src/components/Icon/SearchIcon.tsx +6 -5
- package/src/components/Icon/SettingsIcon.tsx +5 -4
- package/src/components/Icon/TickAltIcon.tsx +6 -5
- package/src/components/Icon/TickIcon.tsx +5 -4
- package/src/components/Icon/VanIcon.tsx +5 -4
- package/src/components/Icon/WarningIcon.tsx +6 -5
- package/src/components/Icon/WriteIcon.tsx +8 -7
- package/src/components/Image/Image.tsx +5 -5
- package/src/components/Pill/Pill.tsx +12 -12
- package/src/components/RootSVG/RootSVG.tsx +1 -1
- package/src/components/SearchBox/SearchBox.tsx +12 -11
- package/src/components/Signpost/Signpost.tsx +11 -11
- package/src/components/SkipNav/SkipNav.tsx +8 -8
- package/src/components/Squircle/Squircle.tsx +10 -8
- package/src/components/Tag/Tag.tsx +6 -6
- 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)**
|
|
11
|
+
/** **(Optional)** Specify additional CSS classes to be applied to the component. */
|
|
10
12
|
className?: string
|
|
11
|
-
/** **(Optional)**
|
|
13
|
+
/** **(Optional)** Specify whether the SkipNav is visible immediately or only when tabbing. Useful for testing purposes only. */
|
|
12
14
|
isVisible?: boolean
|
|
13
|
-
/** **(Optional)**
|
|
14
|
-
*
|
|
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:
|
|
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 {
|
|
6
|
+
import { BrandBlue, Green, OfferRed } from "../../types/colors"
|
|
5
7
|
|
|
6
8
|
export interface SquircleProps extends HTMLAttributes<HTMLDivElement> {
|
|
7
|
-
/** **(Optional)**
|
|
8
|
-
background?:
|
|
9
|
-
/** **(Optional)**
|
|
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)**
|
|
13
|
+
/** **(Optional)** Specify additional CSS classes to be applied to the component. */
|
|
12
14
|
className?: string
|
|
13
|
-
/** **(Optional)**
|
|
15
|
+
/** **(Optional)** Specify the Squircle size. */
|
|
14
16
|
size?: "sm" | "md" | "lg"
|
|
15
17
|
}
|
|
16
18
|
|
|
17
19
|
export const Squircle = ({
|
|
18
|
-
background = "
|
|
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:
|
|
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)**
|
|
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)**
|
|
14
|
+
/** **(Optional)** Specify the Tag background color. */
|
|
15
15
|
background?: Lights | Darks | Tints | Greys | White | Black
|
|
16
|
-
/** **(Optional)**
|
|
16
|
+
/** **(Optional)** Main content inside the component. It can be any valid JSX or string. */
|
|
17
17
|
children?: React.ReactNode
|
|
18
|
-
/** **(Optional)**
|
|
18
|
+
/** **(Optional)** Specify additional CSS classes to be applied to the component. */
|
|
19
19
|
className?: string
|
|
20
|
-
/** **(Optional)**
|
|
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 => {
|
package/src/types/colors.ts
CHANGED
|
@@ -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
|
|
39
|
-
export type
|
|
38
|
+
export type BrandBlue = "brand-blue"
|
|
39
|
+
export type OfferRed = "offer-red"
|
|
40
40
|
export type Green = "green"
|
|
41
41
|
export type Blue = "blue"
|