@coopdigital/react 0.16.0 → 0.18.0
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/README.md +2 -2
- package/dist/components/Icon/AddIcon.d.ts +6 -0
- package/dist/components/Icon/ArrowDownIcon.d.ts +6 -0
- package/dist/components/Icon/ArrowLeftIcon.d.ts +6 -0
- package/dist/components/Icon/ArrowRightIcon.d.ts +6 -0
- package/dist/components/Icon/ArrowUpIcon.d.ts +6 -0
- package/dist/components/Icon/AvatarAltIcon.d.ts +6 -0
- package/dist/components/Icon/AvatarIcon.d.ts +6 -0
- package/dist/components/Icon/BasketIcon.d.ts +6 -0
- package/dist/components/Icon/CalendarIcon.d.ts +6 -0
- package/dist/components/Icon/ChevronDownIcon.d.ts +6 -0
- package/dist/components/Icon/ChevronLeftIcon.d.ts +6 -0
- package/dist/components/Icon/ChevronRightIcon.d.ts +6 -0
- package/dist/components/Icon/ChevronUpIcon.d.ts +6 -0
- package/dist/components/Icon/ClockIcon.d.ts +6 -0
- package/dist/components/Icon/CloseAltIcon.d.ts +6 -0
- package/dist/components/Icon/CloseIcon.d.ts +6 -0
- package/dist/components/Icon/CoopCardIcon.d.ts +6 -0
- package/dist/components/Icon/CoopIcon.d.ts +6 -0
- package/dist/components/Icon/CoopLocationIcon.d.ts +6 -0
- package/dist/components/Icon/DownloadIcon.d.ts +6 -0
- package/dist/components/Icon/HomeIcon.d.ts +6 -0
- package/dist/components/Icon/InformationIcon.d.ts +6 -0
- package/dist/components/Icon/LocationIcon.d.ts +6 -0
- package/dist/components/Icon/MailIcon.d.ts +6 -0
- package/dist/components/Icon/MenuIcon.d.ts +6 -0
- package/dist/components/Icon/MessageIcon.d.ts +6 -0
- package/dist/components/Icon/MinusIcon.d.ts +6 -0
- package/dist/components/Icon/OpenNewIcon.d.ts +6 -0
- package/dist/components/Icon/PencilIcon.d.ts +6 -0
- package/dist/components/Icon/PhoneIcon.d.ts +6 -0
- package/dist/components/Icon/QuestionIcon.d.ts +6 -0
- package/dist/components/Icon/ScooterIcon.d.ts +6 -0
- package/dist/components/Icon/SearchIcon.d.ts +6 -0
- package/dist/components/Icon/SettingsIcon.d.ts +6 -0
- package/dist/components/Icon/TickAltIcon.d.ts +6 -0
- package/dist/components/Icon/TickIcon.d.ts +6 -0
- package/dist/components/Icon/VanIcon.d.ts +6 -0
- package/dist/components/Icon/WarningIcon.d.ts +6 -0
- package/dist/components/Icon/WriteIcon.d.ts +6 -0
- package/dist/components/Icon/index.d.ts +39 -13
- package/dist/components/RootSVG/RootSVG.d.ts +1 -2
- package/dist/components/RootSVG/RootSVG.js +2 -2
- package/package.json +4 -3
- package/src/components/Icon/AddIcon.tsx +30 -0
- package/src/components/Icon/ArrowDownIcon.tsx +27 -0
- package/src/components/Icon/ArrowLeftIcon.tsx +27 -0
- package/src/components/Icon/ArrowRightIcon.tsx +27 -0
- package/src/components/Icon/ArrowUpIcon.tsx +27 -0
- package/src/components/Icon/AvatarAltIcon.tsx +34 -0
- package/src/components/Icon/AvatarIcon.tsx +30 -0
- package/src/components/Icon/BasketIcon.tsx +30 -0
- package/src/components/Icon/CalendarIcon.tsx +30 -0
- package/src/components/Icon/ChevronDownIcon.tsx +26 -0
- package/src/components/Icon/ChevronLeftIcon.tsx +26 -0
- package/src/components/Icon/ChevronRightIcon.tsx +26 -0
- package/src/components/Icon/ChevronUpIcon.tsx +26 -0
- package/src/components/Icon/ClockIcon.tsx +30 -0
- package/src/components/Icon/CloseAltIcon.tsx +34 -0
- package/src/components/Icon/CloseIcon.tsx +30 -0
- package/src/components/Icon/CoopCardIcon.tsx +27 -0
- package/src/components/Icon/CoopIcon.tsx +27 -0
- package/src/components/Icon/CoopLocationIcon.tsx +34 -0
- package/src/components/Icon/DownloadIcon.tsx +31 -0
- package/src/components/Icon/HomeIcon.tsx +34 -0
- package/src/components/Icon/InformationIcon.tsx +30 -0
- package/src/components/Icon/LocationIcon.tsx +30 -0
- package/src/components/Icon/MailIcon.tsx +26 -0
- package/src/components/Icon/MenuIcon.tsx +26 -0
- package/src/components/Icon/MessageIcon.tsx +26 -0
- package/src/components/Icon/MinusIcon.tsx +26 -0
- package/src/components/Icon/OpenNewIcon.tsx +30 -0
- package/src/components/Icon/PencilIcon.tsx +26 -0
- package/src/components/Icon/PhoneIcon.tsx +26 -0
- package/src/components/Icon/QuestionIcon.tsx +30 -0
- package/src/components/Icon/ScooterIcon.tsx +42 -0
- package/src/components/Icon/SearchIcon.tsx +30 -0
- package/src/components/Icon/SettingsIcon.tsx +26 -0
- package/src/components/Icon/TickAltIcon.tsx +30 -0
- package/src/components/Icon/TickIcon.tsx +26 -0
- package/src/components/Icon/VanIcon.tsx +26 -0
- package/src/components/Icon/WarningIcon.tsx +30 -0
- package/src/components/Icon/WriteIcon.tsx +38 -0
- package/src/components/Icon/index.tsx +39 -36
- package/src/components/RootSVG/RootSVG.tsx +2 -22
- package/dist/components/Icon/template.d.ts +0 -11
- package/src/components/Icon/template.tsx +0 -29
package/README.md
CHANGED
|
@@ -33,8 +33,8 @@ npm install @coopdigital/react @coopdigital/styles
|
|
|
33
33
|
Import the components that you need, along with the main stylesheet and the corresponding component styles:
|
|
34
34
|
```
|
|
35
35
|
import { Pill } from "@coopdigital/react"
|
|
36
|
-
import "@coopdigital/styles/
|
|
37
|
-
import "@coopdigital/styles/
|
|
36
|
+
import "@coopdigital/styles/main.css"
|
|
37
|
+
import "@coopdigital/styles/components/Pill.css"
|
|
38
38
|
```
|
|
39
39
|
|
|
40
40
|
Alternatively if your project uses SASS you can import the source stylesheets:
|
|
@@ -1,13 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export
|
|
1
|
+
export { AddIcon } from "./AddIcon";
|
|
2
|
+
export { ArrowDownIcon } from "./ArrowDownIcon";
|
|
3
|
+
export { ArrowLeftIcon } from "./ArrowLeftIcon";
|
|
4
|
+
export { ArrowRightIcon } from "./ArrowRightIcon";
|
|
5
|
+
export { ArrowUpIcon } from "./ArrowUpIcon";
|
|
6
|
+
export { AvatarAltIcon } from "./AvatarAltIcon";
|
|
7
|
+
export { AvatarIcon } from "./AvatarIcon";
|
|
8
|
+
export { BasketIcon } from "./BasketIcon";
|
|
9
|
+
export { CalendarIcon } from "./CalendarIcon";
|
|
10
|
+
export { ChevronDownIcon } from "./ChevronDownIcon";
|
|
11
|
+
export { ChevronLeftIcon } from "./ChevronLeftIcon";
|
|
12
|
+
export { ChevronRightIcon } from "./ChevronRightIcon";
|
|
13
|
+
export { ChevronUpIcon } from "./ChevronUpIcon";
|
|
14
|
+
export { ClockIcon } from "./ClockIcon";
|
|
15
|
+
export { CloseAltIcon } from "./CloseAltIcon";
|
|
16
|
+
export { CloseIcon } from "./CloseIcon";
|
|
17
|
+
export { CoopCardIcon } from "./CoopCardIcon";
|
|
18
|
+
export { CoopIcon } from "./CoopIcon";
|
|
19
|
+
export { CoopLocationIcon } from "./CoopLocationIcon";
|
|
20
|
+
export { DownloadIcon } from "./DownloadIcon";
|
|
21
|
+
export { HomeIcon } from "./HomeIcon";
|
|
22
|
+
export { InformationIcon } from "./InformationIcon";
|
|
23
|
+
export { LocationIcon } from "./LocationIcon";
|
|
24
|
+
export { MailIcon } from "./MailIcon";
|
|
25
|
+
export { MenuIcon } from "./MenuIcon";
|
|
26
|
+
export { MessageIcon } from "./MessageIcon";
|
|
27
|
+
export { MinusIcon } from "./MinusIcon";
|
|
28
|
+
export { OpenNewIcon } from "./OpenNewIcon";
|
|
29
|
+
export { PencilIcon } from "./PencilIcon";
|
|
30
|
+
export { PhoneIcon } from "./PhoneIcon";
|
|
31
|
+
export { QuestionIcon } from "./QuestionIcon";
|
|
32
|
+
export { ScooterIcon } from "./ScooterIcon";
|
|
33
|
+
export { SearchIcon } from "./SearchIcon";
|
|
34
|
+
export { SettingsIcon } from "./SettingsIcon";
|
|
35
|
+
export { TickAltIcon } from "./TickAltIcon";
|
|
36
|
+
export { TickIcon } from "./TickIcon";
|
|
37
|
+
export { VanIcon } from "./VanIcon";
|
|
38
|
+
export { WarningIcon } from "./WarningIcon";
|
|
39
|
+
export { WriteIcon } from "./WriteIcon";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
|
|
3
3
|
const RootSVG = () => {
|
|
4
|
-
return (
|
|
4
|
+
return (jsx("svg", { height: "0", width: "0", xmlns: "http://www.w3.org/2000/svg", children: jsx("defs", { children: jsx("clipPath", { clipPathUnits: "objectBoundingBox", id: "squircle", children: jsx("path", { d: "M0,0.5 C0,0.165,0.165,0,0.5,0 S1,0.165,1,0.5 S0.835,1,0.5,1 S0,0.835,0,0.5" }) }) }) }));
|
|
5
5
|
};
|
|
6
6
|
|
|
7
7
|
export { RootSVG, RootSVG as default };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coopdigital/react",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.18.0",
|
|
5
5
|
"private": false,
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"test:e2e:ui": "npx playwright test --ui",
|
|
35
35
|
"test:e2e:ci": "npx playwright test --shard=$CI_NODE_INDEX/$CI_NODE_TOTAL",
|
|
36
36
|
"build": "tsx scripts build",
|
|
37
|
+
"build:icons": "tsx scripts build-icons",
|
|
37
38
|
"build:storybook": "storybook build --disable-telemetry && npm run storybook:fix-paths",
|
|
38
39
|
"storybook": "storybook dev -p 6006",
|
|
39
40
|
"storybook:playwright": "storybook dev -p 9000",
|
|
@@ -44,7 +45,7 @@
|
|
|
44
45
|
"description": "",
|
|
45
46
|
"devDependencies": {
|
|
46
47
|
"@axe-core/playwright": "^4.10.1",
|
|
47
|
-
"@coopdigital/styles": "^0.15.
|
|
48
|
+
"@coopdigital/styles": "^0.15.2",
|
|
48
49
|
"@playwright/test": "^1.51.1",
|
|
49
50
|
"@storybook/addon-a11y": "^8.6.12",
|
|
50
51
|
"@storybook/addon-essentials": "^8.6.12",
|
|
@@ -66,5 +67,5 @@
|
|
|
66
67
|
"react": "^19.0.0",
|
|
67
68
|
"react-dom": "^19.0.0"
|
|
68
69
|
},
|
|
69
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "0fa78c25e19ac1c1dc6af564c570e94646e71bc4"
|
|
70
71
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type SVGProps, useId } from "react"
|
|
2
|
+
|
|
3
|
+
interface IconProps extends SVGProps<SVGSVGElement> {
|
|
4
|
+
alt?: string
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export const AddIcon = ({ alt, className, ...props }: IconProps) => {
|
|
8
|
+
const id = useId()
|
|
9
|
+
const componentProps = {
|
|
10
|
+
"aria-labelledby": alt ? id : undefined,
|
|
11
|
+
className: `coop-icon ${className ?? ""}`.trim(),
|
|
12
|
+
fill: "none",
|
|
13
|
+
role: alt ? "img" : undefined,
|
|
14
|
+
viewBox: "0 0 32 32",
|
|
15
|
+
...props,
|
|
16
|
+
}
|
|
17
|
+
return (
|
|
18
|
+
<svg {...componentProps}>
|
|
19
|
+
{alt ? <title id={id}>{alt}</title> : null}
|
|
20
|
+
<path
|
|
21
|
+
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"
|
|
22
|
+
fill="currentColor"
|
|
23
|
+
/>
|
|
24
|
+
<path
|
|
25
|
+
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"
|
|
26
|
+
fill="currentColor"
|
|
27
|
+
/>
|
|
28
|
+
</svg>
|
|
29
|
+
)
|
|
30
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type SVGProps, useId } from "react"
|
|
2
|
+
|
|
3
|
+
interface IconProps extends SVGProps<SVGSVGElement> {
|
|
4
|
+
alt?: string
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export const ArrowDownIcon = ({ alt, className, ...props }: IconProps) => {
|
|
8
|
+
const id = useId()
|
|
9
|
+
const componentProps = {
|
|
10
|
+
"aria-labelledby": alt ? id : undefined,
|
|
11
|
+
className: `coop-icon ${className ?? ""}`.trim(),
|
|
12
|
+
fill: "none",
|
|
13
|
+
role: alt ? "img" : undefined,
|
|
14
|
+
viewBox: "0 0 32 32",
|
|
15
|
+
...props,
|
|
16
|
+
}
|
|
17
|
+
return (
|
|
18
|
+
<svg {...componentProps}>
|
|
19
|
+
{alt ? <title id={id}>{alt}</title> : null}
|
|
20
|
+
<path d="M15 28.66V3a1 1 0 0 1 2 0v25.66a1 1 0 0 1-2 0" fill="currentColor" />
|
|
21
|
+
<path
|
|
22
|
+
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"
|
|
23
|
+
fill="currentColor"
|
|
24
|
+
/>
|
|
25
|
+
</svg>
|
|
26
|
+
)
|
|
27
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type SVGProps, useId } from "react"
|
|
2
|
+
|
|
3
|
+
interface IconProps extends SVGProps<SVGSVGElement> {
|
|
4
|
+
alt?: string
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export const ArrowLeftIcon = ({ alt, className, ...props }: IconProps) => {
|
|
8
|
+
const id = useId()
|
|
9
|
+
const componentProps = {
|
|
10
|
+
"aria-labelledby": alt ? id : undefined,
|
|
11
|
+
className: `coop-icon ${className ?? ""}`.trim(),
|
|
12
|
+
fill: "none",
|
|
13
|
+
role: alt ? "img" : undefined,
|
|
14
|
+
viewBox: "0 0 32 32",
|
|
15
|
+
...props,
|
|
16
|
+
}
|
|
17
|
+
return (
|
|
18
|
+
<svg {...componentProps}>
|
|
19
|
+
{alt ? <title id={id}>{alt}</title> : null}
|
|
20
|
+
<path d="M3.34 17H29a1 1 0 0 0 0-2H3.34a1 1 0 0 0 0 2" fill="currentColor" />
|
|
21
|
+
<path
|
|
22
|
+
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"
|
|
23
|
+
fill="currentColor"
|
|
24
|
+
/>
|
|
25
|
+
</svg>
|
|
26
|
+
)
|
|
27
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type SVGProps, useId } from "react"
|
|
2
|
+
|
|
3
|
+
interface IconProps extends SVGProps<SVGSVGElement> {
|
|
4
|
+
alt?: string
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export const ArrowRightIcon = ({ alt, className, ...props }: IconProps) => {
|
|
8
|
+
const id = useId()
|
|
9
|
+
const componentProps = {
|
|
10
|
+
"aria-labelledby": alt ? id : undefined,
|
|
11
|
+
className: `coop-icon ${className ?? ""}`.trim(),
|
|
12
|
+
fill: "none",
|
|
13
|
+
role: alt ? "img" : undefined,
|
|
14
|
+
viewBox: "0 0 32 32",
|
|
15
|
+
...props,
|
|
16
|
+
}
|
|
17
|
+
return (
|
|
18
|
+
<svg {...componentProps}>
|
|
19
|
+
{alt ? <title id={id}>{alt}</title> : null}
|
|
20
|
+
<path d="M28.7 15H3a1 1 0 0 0 0 2h25.7a1 1 0 0 0 0-2" fill="currentColor" />
|
|
21
|
+
<path
|
|
22
|
+
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"
|
|
23
|
+
fill="currentColor"
|
|
24
|
+
/>
|
|
25
|
+
</svg>
|
|
26
|
+
)
|
|
27
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type SVGProps, useId } from "react"
|
|
2
|
+
|
|
3
|
+
interface IconProps extends SVGProps<SVGSVGElement> {
|
|
4
|
+
alt?: string
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export const ArrowUpIcon = ({ alt, className, ...props }: IconProps) => {
|
|
8
|
+
const id = useId()
|
|
9
|
+
const componentProps = {
|
|
10
|
+
"aria-labelledby": alt ? id : undefined,
|
|
11
|
+
className: `coop-icon ${className ?? ""}`.trim(),
|
|
12
|
+
fill: "none",
|
|
13
|
+
role: alt ? "img" : undefined,
|
|
14
|
+
viewBox: "0 0 32 32",
|
|
15
|
+
...props,
|
|
16
|
+
}
|
|
17
|
+
return (
|
|
18
|
+
<svg {...componentProps}>
|
|
19
|
+
{alt ? <title id={id}>{alt}</title> : null}
|
|
20
|
+
<path d="M17 3.34V29a1 1 0 0 1-2 0V3.34a1 1 0 0 1 2 0" fill="currentColor" />
|
|
21
|
+
<path
|
|
22
|
+
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"
|
|
23
|
+
fill="currentColor"
|
|
24
|
+
/>
|
|
25
|
+
</svg>
|
|
26
|
+
)
|
|
27
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type SVGProps, useId } from "react"
|
|
2
|
+
|
|
3
|
+
interface IconProps extends SVGProps<SVGSVGElement> {
|
|
4
|
+
alt?: string
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export const AvatarAltIcon = ({ alt, className, ...props }: IconProps) => {
|
|
8
|
+
const id = useId()
|
|
9
|
+
const componentProps = {
|
|
10
|
+
"aria-labelledby": alt ? id : undefined,
|
|
11
|
+
className: `coop-icon ${className ?? ""}`.trim(),
|
|
12
|
+
fill: "none",
|
|
13
|
+
role: alt ? "img" : undefined,
|
|
14
|
+
viewBox: "0 0 32 32",
|
|
15
|
+
...props,
|
|
16
|
+
}
|
|
17
|
+
return (
|
|
18
|
+
<svg {...componentProps}>
|
|
19
|
+
{alt ? <title id={id}>{alt}</title> : null}
|
|
20
|
+
<path
|
|
21
|
+
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"
|
|
22
|
+
fill="currentColor"
|
|
23
|
+
/>
|
|
24
|
+
<path
|
|
25
|
+
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"
|
|
26
|
+
fill="currentColor"
|
|
27
|
+
/>
|
|
28
|
+
<path
|
|
29
|
+
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"
|
|
30
|
+
fill="currentColor"
|
|
31
|
+
/>
|
|
32
|
+
</svg>
|
|
33
|
+
)
|
|
34
|
+
}
|