@coopdigital/react 0.19.4 → 0.19.5
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/Pill/Pill.d.ts +2 -2
- package/dist/components/Pill/Pill.js +1 -1
- package/dist/components/Squircle/Squircle.d.ts +2 -2
- package/dist/components/Squircle/Squircle.js +1 -1
- package/dist/types/colors.d.ts +2 -2
- package/package.json +3 -3
- package/src/components/Pill/Pill.tsx +3 -3
- package/src/components/Squircle/Squircle.tsx +3 -3
- package/src/types/colors.ts +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AnchorHTMLAttributes, ForwardRefExoticComponent, HTMLAttributes, JSX } from "react";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import { Darks,
|
|
3
|
+
import { Darks, OfferRed, Tints } from "../../types/colors";
|
|
4
4
|
export interface PillProps extends HTMLAttributes<HTMLAnchorElement> {
|
|
5
5
|
/** **(Optional)** Specifies the custom element to override default `a` or `span`. */
|
|
6
6
|
as?: React.FC<AnchorHTMLAttributes<HTMLElement>> | ForwardRefExoticComponent<any> | string;
|
|
@@ -9,7 +9,7 @@ export interface PillProps extends HTMLAttributes<HTMLAnchorElement> {
|
|
|
9
9
|
/** **(Optional)** Specifies what text Pill should display on the badge. */
|
|
10
10
|
badge?: string;
|
|
11
11
|
/** **(Optional)** Specifies the badge background color from the available options. */
|
|
12
|
-
badgeBackground?: Darks |
|
|
12
|
+
badgeBackground?: Darks | OfferRed;
|
|
13
13
|
/** **(Optional)** Represents the content inside the Pill component. It can be any valid JSX or string. */
|
|
14
14
|
children?: React.ReactNode;
|
|
15
15
|
/** **(Optional)** Receives any className to be applied to Pill component. */
|
|
@@ -5,7 +5,7 @@ import React from 'react';
|
|
|
5
5
|
import { bgPropToClass } from '../../utils/index.js';
|
|
6
6
|
|
|
7
7
|
const Pill = (_a) => {
|
|
8
|
-
var { as, background = "tint-grey", badge, badgeBackground = "
|
|
8
|
+
var { as, background = "tint-grey", badge, badgeBackground = "offer-red", children, className = "", href, size = "md" } = _a, props = __rest(_a, ["as", "background", "badge", "badgeBackground", "children", "className", "href", "size"]);
|
|
9
9
|
let element = href ? "a" : "span";
|
|
10
10
|
if (as) {
|
|
11
11
|
element = as;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { HTMLAttributes, JSX } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { BrandBlue, Green, OfferRed } from "../../types/colors";
|
|
3
3
|
export interface SquircleProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
4
|
/** **(Optional)** Specifies the background color of the Squircle. */
|
|
5
|
-
background?:
|
|
5
|
+
background?: OfferRed | BrandBlue | Green;
|
|
6
6
|
/** **(Optional)** Represents the content inside the Squircle component. It can be any valid JSX or string. */
|
|
7
7
|
children?: React.ReactNode;
|
|
8
8
|
/** **(Optional)** Receives any className to be applied to Squircle component. */
|
|
@@ -3,7 +3,7 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
3
3
|
import { bgPropToClass } from '../../utils/index.js';
|
|
4
4
|
|
|
5
5
|
const Squircle = (_a) => {
|
|
6
|
-
var { background = "
|
|
6
|
+
var { background = "offer-red", children, className, size = "lg" } = _a, props = __rest(_a, ["background", "children", "className", "size"]);
|
|
7
7
|
const componentProps = Object.assign({ className: `coop-squircle ${bgPropToClass(background, className)} ${className !== null && className !== void 0 ? className : ""}`, "data-size": size.length && size !== "lg" ? size : undefined }, props);
|
|
8
8
|
return (jsx("figure", Object.assign({}, componentProps, { children: jsx("figcaption", { children: children }) })));
|
|
9
9
|
};
|
package/dist/types/colors.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export type Greys = "dark-grey" | "mid-dark-grey" | "mid-grey" | "mid-light-grey
|
|
|
5
5
|
export type White = "white";
|
|
6
6
|
export type Black = "black";
|
|
7
7
|
export type None = "none";
|
|
8
|
-
export type
|
|
9
|
-
export type
|
|
8
|
+
export type BrandBlue = "brand-blue";
|
|
9
|
+
export type OfferRed = "offer-red";
|
|
10
10
|
export type Green = "green";
|
|
11
11
|
export type Blue = "blue";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coopdigital/react",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.19.
|
|
4
|
+
"version": "0.19.5",
|
|
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.
|
|
53
|
+
"@coopdigital/styles": "^0.16.5",
|
|
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": "
|
|
78
|
+
"gitHead": "75fa676ceb3961f9de1052ebf2b80af2ab8a1663"
|
|
79
79
|
}
|
|
@@ -4,7 +4,7 @@ import clsx from "clsx"
|
|
|
4
4
|
import React from "react"
|
|
5
5
|
|
|
6
6
|
import { bgPropToClass } from "../../../src/utils"
|
|
7
|
-
import { Darks,
|
|
7
|
+
import { Darks, OfferRed, Tints } from "../../types/colors"
|
|
8
8
|
|
|
9
9
|
export interface PillProps extends HTMLAttributes<HTMLAnchorElement> {
|
|
10
10
|
/** **(Optional)** Specifies the custom element to override default `a` or `span`. */
|
|
@@ -15,7 +15,7 @@ export interface PillProps extends HTMLAttributes<HTMLAnchorElement> {
|
|
|
15
15
|
/** **(Optional)** Specifies what text Pill should display on the badge. */
|
|
16
16
|
badge?: string
|
|
17
17
|
/** **(Optional)** Specifies the badge background color from the available options. */
|
|
18
|
-
badgeBackground?: Darks |
|
|
18
|
+
badgeBackground?: Darks | OfferRed
|
|
19
19
|
/** **(Optional)** Represents the content inside the Pill component. It can be any valid JSX or string. */
|
|
20
20
|
children?: React.ReactNode
|
|
21
21
|
/** **(Optional)** Receives any className to be applied to Pill component. */
|
|
@@ -30,7 +30,7 @@ export const Pill = ({
|
|
|
30
30
|
as,
|
|
31
31
|
background = "tint-grey",
|
|
32
32
|
badge,
|
|
33
|
-
badgeBackground = "
|
|
33
|
+
badgeBackground = "offer-red",
|
|
34
34
|
children,
|
|
35
35
|
className = "",
|
|
36
36
|
href,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { HTMLAttributes, JSX } from "react"
|
|
2
2
|
|
|
3
3
|
import { bgPropToClass } from "../../../src/utils"
|
|
4
|
-
import {
|
|
4
|
+
import { BrandBlue, Green, OfferRed } from "../../types/colors"
|
|
5
5
|
|
|
6
6
|
export interface SquircleProps extends HTMLAttributes<HTMLDivElement> {
|
|
7
7
|
/** **(Optional)** Specifies the background color of the Squircle. */
|
|
8
|
-
background?:
|
|
8
|
+
background?: OfferRed | BrandBlue | Green
|
|
9
9
|
/** **(Optional)** Represents the content inside the Squircle component. It can be any valid JSX or string. */
|
|
10
10
|
children?: React.ReactNode
|
|
11
11
|
/** **(Optional)** Receives any className to be applied to Squircle component. */
|
|
@@ -15,7 +15,7 @@ export interface SquircleProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
export const Squircle = ({
|
|
18
|
-
background = "
|
|
18
|
+
background = "offer-red",
|
|
19
19
|
children,
|
|
20
20
|
className,
|
|
21
21
|
size = "lg",
|
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"
|