@coopdigital/react 0.8.0 → 0.8.2

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/package.json CHANGED
@@ -1,15 +1,20 @@
1
1
  {
2
2
  "name": "@coopdigital/react",
3
3
  "type": "module",
4
- "version": "0.8.0",
5
- "main": "dist/index.js",
4
+ "version": "0.8.2",
6
5
  "private": false,
7
6
  "publishConfig": {
8
7
  "access": "public"
9
8
  },
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "default": "./dist/index.js"
13
+ }
14
+ },
10
15
  "files": [
11
16
  "dist",
12
- "src",
17
+ "src/**/*.{tsx,ts}",
13
18
  "!**/__{screenshots,tests}__",
14
19
  "!**/*.{stories,test}.*"
15
20
  ],
@@ -39,31 +44,28 @@
39
44
  "description": "",
40
45
  "devDependencies": {
41
46
  "@axe-core/playwright": "^4.10.1",
42
- "@coopdigital/styles": "^0.7.0",
47
+ "@coopdigital/styles": "^0.8.1",
43
48
  "@playwright/test": "^1.51.1",
44
- "@rollup/plugin-node-resolve": "^16.0.1",
45
- "@rollup/plugin-typescript": "^12.1.2",
46
- "@storybook/addon-a11y": "^8.6.7",
47
- "@storybook/addon-essentials": "^8.6.7",
48
- "@storybook/addon-interactions": "^8.6.7",
49
- "@storybook/addon-mdx-gfm": "^8.6.7",
50
- "@storybook/addon-onboarding": "^8.6.7",
51
- "@storybook/blocks": "^8.6.7",
52
- "@storybook/manager-api": "^8.6.7",
53
- "@storybook/react": "^8.6.7",
54
- "@storybook/react-vite": "^8.6.7",
55
- "@storybook/test": "^8.6.7",
56
- "@storybook/theming": "^8.6.7",
49
+ "@storybook/addon-a11y": "^8.6.11",
50
+ "@storybook/addon-essentials": "^8.6.11",
51
+ "@storybook/addon-interactions": "^8.6.11",
52
+ "@storybook/addon-mdx-gfm": "^8.6.11",
53
+ "@storybook/addon-onboarding": "^8.6.11",
54
+ "@storybook/blocks": "^8.6.11",
55
+ "@storybook/manager-api": "^8.6.11",
56
+ "@storybook/react": "^8.6.11",
57
+ "@storybook/react-vite": "^8.6.11",
58
+ "@storybook/test": "^8.6.11",
59
+ "@storybook/theming": "^8.6.11",
57
60
  "@testing-library/jest-dom": "^6.6.3",
58
61
  "@testing-library/react": "^16.2.0",
59
62
  "@types/react": "^19.0.12",
60
63
  "@types/react-dom": "^19.0.4",
61
- "rollup": "^4.36.0",
62
- "storybook": "^8.6.7"
64
+ "storybook": "^8.6.11"
63
65
  },
64
66
  "peerDependencies": {
65
67
  "react": "^19.0.0",
66
68
  "react-dom": "^19.0.0"
67
69
  },
68
- "gitHead": "0005324d74508d5df4479b54d79068555137e391"
70
+ "gitHead": "6e0b8a1a021138c3f9bd92e8aadd523c1cf4a2f5"
69
71
  }
@@ -1,160 +0,0 @@
1
- import { Meta, ColorPalette, ColorItem } from "@storybook/blocks"
2
-
3
- export const compStyle = getComputedStyle(document.documentElement)
4
-
5
- <Meta title="Styles / Colours" />
6
-
7
- # Colours
8
-
9
- <br />
10
-
11
- ## Brand colours
12
-
13
- <br />
14
- <br />
15
-
16
- <ColorPalette>
17
- <ColorItem
18
- title="Co-op blue"
19
- subtitle="Co-op blue"
20
- colors={{ "--color-brand-coop": compStyle.getPropertyValue("--color-brand-coop") }}
21
- />
22
- <ColorItem
23
- title="Co-op deal red"
24
- subtitle="Co-op brand deals"
25
- colors={{ "--color-brand-deals": compStyle.getPropertyValue("--color-brand-deals") }}
26
- />
27
-
28
- <ColorItem
29
- title="Text colours"
30
- colors={{
31
- "--color-white": compStyle.getPropertyValue("--color-white"),
32
- "--color-text-alt": compStyle.getPropertyValue("--color-text-alt"),
33
- "--color-text": compStyle.getPropertyValue("--color-text"),
34
- "--color-black": compStyle.getPropertyValue("--color-black"),
35
- }}
36
- />
37
-
38
- <ColorItem
39
- title="Tint colours"
40
- colors={{
41
- "--color-tint-purple": compStyle.getPropertyValue("--color-tint-purple"),
42
- "--color-tint-pink": compStyle.getPropertyValue("--color-tint-pink"),
43
- "--color-tint-green": compStyle.getPropertyValue("--color-tint-green"),
44
- "--color-tint-orange": compStyle.getPropertyValue("--color-tint-orange"),
45
- "--color-tint-red": compStyle.getPropertyValue("--color-tint-red"),
46
- "--color-tint-yellow": compStyle.getPropertyValue("--color-tint-yellow"),
47
- "--color-tint-lilac": compStyle.getPropertyValue("--color-tint-lilac"),
48
- "--color-tint-blue": compStyle.getPropertyValue("--color-tint-blue"),
49
- }}
50
- />
51
-
52
- <ColorItem
53
- title="Light colours"
54
- colors={{
55
- "--color-light-purple": compStyle.getPropertyValue("--color-light-purple"),
56
- "--color-light-pink": compStyle.getPropertyValue("--color-light-pink"),
57
- "--color-light-green": compStyle.getPropertyValue("--color-light-green"),
58
- "--color-light-orange": compStyle.getPropertyValue("--color-light-orange"),
59
- "--color-light-red": compStyle.getPropertyValue("--color-light-red"),
60
- "--color-light-yellow": compStyle.getPropertyValue("--color-light-yellow"),
61
- "--color-light-lilac": compStyle.getPropertyValue("--color-light-lilac"),
62
- "--color-light-blue": compStyle.getPropertyValue("--color-light-blue"),
63
- }}
64
- />
65
-
66
- <ColorItem
67
- title="Dark colours"
68
- colors={{
69
- "--color-dark-purple": compStyle.getPropertyValue("--color-dark-purple"),
70
- "--color-dark-pink": compStyle.getPropertyValue("--color-dark-pink"),
71
- "--color-dark-green": compStyle.getPropertyValue("--color-dark-green"),
72
- "--color-dark-orange": compStyle.getPropertyValue("--color-dark-orange"),
73
- "--color-dark-red": compStyle.getPropertyValue("--color-dark-red"),
74
- "--color-dark-yellow": compStyle.getPropertyValue("--color-dark-yellow"),
75
- "--color-dark-lilac": compStyle.getPropertyValue("--color-dark-lilac"),
76
- "--color-navy": compStyle.getPropertyValue("--color-navy"),
77
- }}
78
- />
79
-
80
- <ColorItem
81
- title="Grey backgrounds"
82
- colors={{
83
- "--color-grey-neutral-light": compStyle.getPropertyValue("--color-grey-neutral-light"),
84
- "--color-grey-neutral-warm": compStyle.getPropertyValue("--color-grey-neutral-warm"),
85
- "--color-grey-neutral-cool": compStyle.getPropertyValue("--color-grey-neutral-cool"),
86
- "--color-grey-neutral-cool-light": compStyle.getPropertyValue(
87
- "--color-grey-neutral-cool-light"
88
- ),
89
- "--color-grey-mid-light": compStyle.getPropertyValue("--color-grey-mid-light"),
90
- "--color-grey-mid": compStyle.getPropertyValue("--color-grey-mid"),
91
- "--color-grey-dark": compStyle.getPropertyValue("--color-grey-dark"),
92
- }}
93
- />
94
-
95
- <br />
96
- <br />
97
- <br />
98
- <br />
99
- ## UI colors
100
-
101
- <br />
102
- ### Link
103
- <br />
104
- <ColorItem
105
- title="Link colours"
106
- colors={{
107
- "--color-link": compStyle.getPropertyValue("--color-link"),
108
- "--color-link-hover": compStyle.getPropertyValue("--color-link-hover"),
109
- "--color-link-active": compStyle.getPropertyValue("--color-link-active"),
110
- "--color-link-visited": compStyle.getPropertyValue("--color-link-visited"),
111
- "--color-link-focus": compStyle.getPropertyValue("--color-link-focus"),
112
- "--color-focus-ring": compStyle.getPropertyValue("--color-focus-ring"),
113
- }}
114
- />
115
-
116
- <br />
117
- ### Button
118
- <br />
119
- <ColorItem
120
- title="Primary green button"
121
- colors={{
122
- "--color-button-green-primary": compStyle.getPropertyValue("--color-button-green-primary"),
123
- "--color-button-green-primary-hover": compStyle.getPropertyValue(
124
- "--color-button-green-primary-hover"
125
- ),
126
- "--color-button-green-primary-active": compStyle.getPropertyValue(
127
- "--color-button-green-primary-active"
128
- ),
129
- }}
130
- />
131
- <ColorItem
132
- title="Blue button (default)"
133
- colors={{
134
- "--color-button / --color-button-blue": compStyle.getPropertyValue("--color-button-blue"),
135
- "--color-button-hover / --color-button-blue-hover": compStyle.getPropertyValue(
136
- "--color-button-blue-hover"
137
- ),
138
- "--color-button-active / --color-button-blue-active": compStyle.getPropertyValue(
139
- "--color-button-blue-active"
140
- ),
141
- }}
142
- />
143
- <ColorItem
144
- title="Grey button"
145
- colors={{
146
- "--color-button-grey": compStyle.getPropertyValue("--color-button-grey"),
147
- "--color-button-grey-hover": compStyle.getPropertyValue("--color-button-grey-hover"),
148
- "--color-button-grey-active": compStyle.getPropertyValue("--color-button-grey-active"),
149
- }}
150
- />
151
- <ColorItem
152
- title="White button"
153
- colors={{
154
- "--color-button-white": compStyle.getPropertyValue("--color-button-white"),
155
- "--color-button-white-hover": compStyle.getPropertyValue("--color-button-white-hover"),
156
- "--color-button-white-active": compStyle.getPropertyValue("--color-button-white-active"),
157
- }}
158
- />
159
-
160
- </ColorPalette>
@@ -1,119 +0,0 @@
1
- import { Meta, Unstyled } from "@storybook/blocks"
2
-
3
- <Meta title="Styles / Text" />
4
-
5
- export const SampleText = "Lorem ipsum dolor..."
6
-
7
- # Text
8
-
9
- <br />
10
-
11
- <Unstyled>
12
-
13
- ## Using Co-op Headline font
14
-
15
- <br />
16
-
17
- > <h1 className="coop-t-headline coop-t-headline-upper">h1: {SampleText}</h1>
18
- > <h2 className="coop-t-headline coop-t-headline-upper coop-t-headline-blue">h2: {SampleText}</h2>
19
- > <h3 className="coop-t-headline coop-t-headline-upper coop-t-headline-blue">h3: {SampleText}</h3>
20
- > <h4 className="coop-t-headline coop-t-headline-upper coop-t-headline-blue">h4: {SampleText}</h4>
21
- > <h5 className="coop-t-headline coop-t-headline-upper coop-t-headline-blue">h5: {SampleText}</h5>
22
- > <h6 className="coop-t-headline coop-t-headline-upper coop-t-headline-blue">h6: {SampleText}</h6>
23
-
24
- > ```jsx
25
- > <h1 className="coop-t-headline coop-t-headline-upper">h1: {SampleText}</h1>
26
- > <h2 className="coop-t-headline coop-t-headline-upper coop-t-headline-blue">h2: {SampleText}</h2>
27
- > <h3 className="coop-t-headline coop-t-headline-upper coop-t-headline-blue">h3: {SampleText}</h3>
28
- > <h4 className="coop-t-headline coop-t-headline-upper coop-t-headline-blue">h4: {SampleText}</h4>
29
- > <h5 className="coop-t-headline coop-t-headline-upper coop-t-headline-blue">h5: {SampleText}</h5>
30
- > <h6 className="coop-t-headline coop-t-headline-upper coop-t-headline-blue">h6: {SampleText}</h6>
31
- > ```
32
-
33
- <br />
34
-
35
- > <h1 className="coop-t-headline coop-t-headline-blue">h1: {SampleText}</h1>
36
- > <h2 className="coop-t-headline coop-t-headline-blue">h2: {SampleText}</h2>
37
- > <h3 className="coop-t-headline coop-t-headline-blue">h3: {SampleText}</h3>
38
- > <h4 className="coop-t-headline coop-t-headline-blue">h4: {SampleText}</h4>
39
- > <h5 className="coop-t-headline coop-t-headline-blue">h5: {SampleText}</h5>
40
- > <h6 className="coop-t-headline coop-t-headline-blue">h6: {SampleText}</h6>
41
-
42
- > ```jsx
43
- > <h1 className="coop-t-headline coop-t-headline-blue">h1: {SampleText}</h1>
44
- > <h2 className="coop-t-headline coop-t-headline-blue">h2: {SampleText}</h2>
45
- > <h3 className="coop-t-headline coop-t-headline-blue">h3: {SampleText}</h3>
46
- > <h4 className="coop-t-headline coop-t-headline-blue">h4: {SampleText}</h4>
47
- > <h5 className="coop-t-headline coop-t-headline-blue">h5: {SampleText}</h5>
48
- > <h6 className="coop-t-headline coop-t-headline-blue">h6: {SampleText}</h6>
49
- > ```
50
-
51
- <br />
52
- <br />
53
- <br />
54
- ## Using Primary font (Avenir Next)
55
- <br />
56
-
57
- > <h1>h1: {SampleText}</h1>
58
- > <h2>h2: {SampleText}</h2>
59
- > <h3>h3: {SampleText}</h3>
60
- > <h4>h4: {SampleText}</h4>
61
- > <h5>h5: {SampleText}</h5>
62
- > <h6>h6: {SampleText}</h6>
63
-
64
- > ```jsx
65
- > <h1>h1: {SampleText}</h1>
66
- > <h2>h2: {SampleText}</h2>
67
- > <h3>h3: {SampleText}</h3>
68
- > <h4>h4: {SampleText}</h4>
69
- > <h5>h5: {SampleText}</h5>
70
- > <h6>h6: {SampleText}</h6>
71
- > ```
72
-
73
- > <p class="coop-t-lead-p">Lead paragraph</p>
74
- > <hr />
75
- > <p>Paragraph text: {SampleText}</p>
76
- > <a href="">Link</a>
77
-
78
- > ```jsx
79
- > <p class="coop-t-lead-p">Lead paragraph</p>
80
- > <hr />
81
- > <p>Paragraph text: {SampleText}</p>
82
- > <a href="">Link</a>
83
- > ```
84
-
85
- > <p>Lists:</p>
86
- > <ul>
87
- > <li>Option 1</li>
88
- > <li>Option 1</li>
89
- > </ul>
90
- > <ol>
91
- > <li>Option 1</li>
92
- > <li>Option 1</li>
93
- > </ol>
94
-
95
- > ```jsx
96
- > <p>Lists:</p>
97
- > <ul>
98
- > <li>Option 1</li>
99
- > <li>Option 1</li>
100
- > </ul>
101
- > <ol>
102
- > <li>Option 1</li>
103
- > <li>Option 1</li>
104
- > </ol>
105
- > ```
106
-
107
- </Unstyled>
108
-
109
- <style>
110
- {`
111
- .toc-wrapper {
112
- display: none;
113
- }
114
- `}
115
- </style>
116
-
117
- ```
118
-
119
- ```
@@ -1,49 +0,0 @@
1
- import { Meta, Typeset } from "@storybook/blocks"
2
-
3
- <Meta title="Styles / Typography" />
4
-
5
- export const compStyle = getComputedStyle(document.documentElement)
6
-
7
- export const typography = {
8
- type: {
9
- primary: compStyle.getPropertyValue("--font-family"),
10
- headline: compStyle.getPropertyValue("--font-family-headline"),
11
- },
12
- weight: {
13
- regular: "400",
14
- medium: "500",
15
- demi: "600",
16
- bold: "700",
17
- },
18
- }
19
-
20
- export const SampleText = "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
21
- export const SampleTextUppercase = SampleText.toUpperCase()
22
-
23
- # Typography
24
-
25
- **Font:** Avenir Next ( as `--font-family`)<br />
26
- **Weights:** 400 (regular), 500 (medium), 600 (demi)
27
-
28
- <Typeset
29
- fontSizes={[10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 40, 46, 48, 56, 64, 82]}
30
- fontWeight={typography.weight.regular}
31
- sampleText={SampleText}
32
- fontFamily={typography.type.primary}
33
- />
34
-
35
- **Font:** Co-op Headline ( as `--font-family-headline`)<br />
36
- **Weights:** 700 (bold)
37
-
38
- <Typeset
39
- fontSizes={[18, 20, 22, 24, 26, 28, 30, 32, 40, 46, 48, 56, 64, 82]}
40
- fontWeight={typography.weight.bold}
41
- sampleText={SampleTextUppercase}
42
- fontFamily={typography.type.headline}
43
- />
44
-
45
- <p>
46
- <b>Note:</b>
47
- The type sizes shown above have been chosen as our standard type sizes.
48
- <br /> They are available as CSS variables, e.g. `--type-size-10`, `--type-size-12`, etc.
49
- </p>