@cruk/chakra-components 4.0.0-dev.6 → 4.0.0-dev.8

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 CHANGED
@@ -1,7 +1,7 @@
1
- # CRUK Chakra Components 🎨
2
-
3
1
  ![Logo](.github/assets/logo.png)
4
2
 
3
+ # CRUK Chakra Components 🎨
4
+
5
5
  A [Chakra UI v2](https://v2.chakra-ui.com/docs/) based component library that provides styled components following the [Cancer Research UK Helix design system](https://zeroheight.com/721bd94bd/p/074a6c-helix-design-system---cancer-research-uk) 🧬.
6
6
  It is a Work In Progress.
7
7
 
@@ -18,15 +18,11 @@ It is a Work In Progress.
18
18
 
19
19
  Depending on your project, you might install the library in the project root directory, or in `client`:
20
20
 
21
- ## Install the package
22
-
23
21
  ```bash
22
+ # Install the package
24
23
  npm install @cruk/chakra-components
25
- ```
26
-
27
- ## Install peer dependencies (if you don't already have them)
28
24
 
29
- ```bash
25
+ # Install peer dependencies (if you don't already have them)
30
26
  npm install @chakra-ui/react @emotion/react @emotion/styled framer-motion
31
27
  ```
32
28
 
@@ -36,7 +32,7 @@ npm install @chakra-ui/react @emotion/react @emotion/styled framer-motion
36
32
 
37
33
  Once added to the project, you can use the `ChakraBaseProvider` to wrap your application and provide styled based on the `crukBrand` theme.
38
34
 
39
- `````typescript
35
+ ```typescript
40
36
  import type { AppProps } from "next/app";
41
37
  import { ChakraBaseProvider, crukBrand } from "@cruk/chakra-components";
42
38
 
@@ -47,7 +43,7 @@ const App = ({ Component, pageProps }: AppProps) => (
47
43
  );
48
44
 
49
45
  export default App;
50
- ```js
46
+ ```
51
47
 
52
48
  - 📖 [Styling documentation](https://super-succotash-wg8qmo1.pages.github.io/styling)
53
49
  - 📖 [Theming documentation](https://super-succotash-wg8qmo1.pages.github.io/theming)
@@ -58,32 +54,28 @@ export default App;
58
54
 
59
55
  After cloning the repository, install the dependencies:
60
56
 
61
- ````bash
57
+ ```bash
62
58
  # Clone and setup
63
59
  git clone https://github.com/CRUKorg/cruk-chakra-components
64
60
  cd cruk-chakra-components
65
61
  npm ci
66
62
 
67
63
  # Start Storybook
68
- Ensure your npm v matches repo and run story book
69
- ```bash
70
- nvm use && npm run storybook
71
- `````
64
+ npm run storybook
65
+ ```
72
66
 
73
67
  ### Quick Test
74
68
 
75
- Ensure right version of node and run tests.
76
-
77
69
  ```bash
78
- nvm use && npm run test # Unit tests
79
- nvm use && npm run test-ct # Component tests
70
+ npm run test # Unit tests
71
+ npm run test-ct # Component tests
80
72
  ```
81
73
 
82
74
  ## Deployment and Releases 🚀
83
75
 
84
76
  ### Release Process
85
77
 
86
- This library uses [semantic-release](https://github.com/semantic-release/semantic-release) to automate versioning and package publishing based on **pull request titles** and **commit content**.
78
+ This library uses [semantic-release](https://github.com/semantic-release/semantic-release) with **GitHub PR labels** to automate versioning and package publishing.
87
79
 
88
80
  #### Branch Strategy
89
81
 
@@ -92,54 +84,33 @@ This library uses [semantic-release](https://github.com/semantic-release/semanti
92
84
 
93
85
  #### Release Requirements
94
86
 
95
- **Important:** Only pull requests with `RELEASE` in the title will trigger a release. The version type (major/minor/patch) is determined by the commit content within that PR.
87
+ **Important:** Only pull requests with the `release` label will trigger a release. The version type is determined by additional labels.
96
88
 
97
89
  #### Creating a Release
98
90
 
99
- 1. **Create your pull request with `RELEASE` in the title:**
91
+ 1. **Create your pull request and add labels:**
100
92
 
101
- ```none
102
- RELEASE: Add new Button component
103
- RELEASE: Fix accessibility issues
104
- Feature update - RELEASE v2.1.0
105
- ```
93
+ **Required label:**
94
+ - `release` - Must be present to trigger any release
106
95
 
107
- 1. **Use conventional commit messages** within your PR to determine the release type:
96
+ **Version labels (choose one):**
97
+ - `breaking` or `major` - Major release (v1.0.0 → v2.0.0)
98
+ - `minor` - Minor release (v1.0.0 → v1.1.0)
99
+ - `patch` - Patch release (v1.0.0 → v1.0.1)
108
100
 
109
- **Patch Release** (v1.0.0 v1.0.1):
101
+ If only the `release` label is present, it defaults to a patch release.
110
102
 
111
- ```none
112
- fix: resolve Button focus state issue
113
- docs: update component documentation
114
- test: add missing unit tests
115
- refactor: improve component structure
116
- ```
103
+ 2. **For main branch releases: Obtain ServiceNow approval**
117
104
 
118
- **Minor Release** (v1.0.0 v1.1.0):
105
+ **Important:** All releases to the `main` branch require an approved ServiceNow change request before merging. This is mandatory for production deployments.
119
106
 
120
- ```none
107
+ 3. **Merge your PR** to the appropriate branch:
121
108
 
122
- feat: add new Button variant
123
- feature: implement dark mode support
109
+ - Merge to `dev` for prerelease versions (no ServiceNow required)
110
+ - Merge to `main` for standard releases (ServiceNow approval required)
124
111
 
125
- ```
126
-
127
- **Major Release** (v1.0.0 → v2.0.0):
128
-
129
- ```none
130
-
131
- feat: redesign Button component API
132
-
133
- BREAKING CHANGE: The Button component no longer accepts 'size' prop, use 'buttonSize' instead.
134
-
135
- ```
136
-
137
- 1. **Merge your PR** to the appropriate branch:
138
- - Merge to `dev` for prerelease versions
139
- - Merge to `main` for standard releases
140
-
141
- 2. The semantic-release system will automatically:
142
- - Analyse the PR title and commit content
112
+ 4. The semantic-release system will automatically:
113
+ - Read the PR labels
143
114
  - Determine the appropriate version bump
144
115
  - Generate release notes
145
116
  - Publish to npm
@@ -148,24 +119,17 @@ This library uses [semantic-release](https://github.com/semantic-release/semanti
148
119
  #### Examples
149
120
 
150
121
  ✅ **Will trigger a minor release:**
151
-
152
- - PR title: "RELEASE: Add new components"
153
- - Contains commit: "feat: add new Button variant"
122
+ - Labels: `release`, `minor`
154
123
 
155
124
  ✅ **Will trigger a patch release:**
156
-
157
- - PR title: "RELEASE: Bug fixes"
158
- - Contains commit: "fix: resolve styling issue"
125
+ - Labels: `release`, `patch`
126
+ - Labels: `release` (defaults to patch)
159
127
 
160
128
  ✅ **Will trigger a major release:**
161
-
162
- - PR title: "RELEASE: Breaking API changes"
163
- - Contains commit with: "BREAKING CHANGE: removed deprecated props"
129
+ - Labels: `release`, `breaking`
164
130
 
165
131
  ❌ **Will NOT trigger any release:**
166
-
167
- - PR title: "Add new components" (missing "RELEASE")
168
- - Even with commits like "feat: new component"
132
+ - No `release` label present
169
133
 
170
134
  #### Manual Release
171
135
 
@@ -175,12 +139,12 @@ If needed, you can manually trigger a release:
175
139
  npm run release
176
140
  ```
177
141
 
178
- ### Resources 📖
142
+ ## Resources 📖
179
143
 
180
144
  - [Component Examples (Storybook)](https://helix-components.cms.app.crnet.org)
181
145
  - [Full Documentation (Style guide, Theming, Testing and more)](https://super-succotash-wg8qmo1.pages.github.io/)
182
146
  - [Need help? Message us on Slack](https://cruk.slack.com/archives/C07BNR9FY4E)
183
147
 
184
- #### 📄 Licence
148
+ ## 📄 Licence
185
149
 
186
150
  MIT © Cancer Research UK
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("react/jsx-runtime"),r=require("@chakra-ui/react");const t=r.forwardRef(((t,n)=>{const{children:o,...u}=t;return e.jsxs(r.Table,{ref:n,...u,children:[o," "]})}));Object.defineProperty(exports,"TableContainer",{enumerable:!0,get:function(){return r.TableContainer}}),Object.defineProperty(exports,"Tbody",{enumerable:!0,get:function(){return r.Tbody}}),Object.defineProperty(exports,"Td",{enumerable:!0,get:function(){return r.Td}}),Object.defineProperty(exports,"Th",{enumerable:!0,get:function(){return r.Th}}),Object.defineProperty(exports,"Thead",{enumerable:!0,get:function(){return r.Thead}}),Object.defineProperty(exports,"Tr",{enumerable:!0,get:function(){return r.Tr}}),exports.Table=t;
1
+ "use strict";var e=require("react/jsx-runtime"),r=require("@chakra-ui/react");const t=r.forwardRef(((t,n)=>{const{children:o,...u}=t;return e.jsx(r.Table,{ref:n,...u,children:o})}));Object.defineProperty(exports,"TableContainer",{enumerable:!0,get:function(){return r.TableContainer}}),Object.defineProperty(exports,"Tbody",{enumerable:!0,get:function(){return r.Tbody}}),Object.defineProperty(exports,"Td",{enumerable:!0,get:function(){return r.Td}}),Object.defineProperty(exports,"Th",{enumerable:!0,get:function(){return r.Th}}),Object.defineProperty(exports,"Thead",{enumerable:!0,get:function(){return r.Thead}}),Object.defineProperty(exports,"Tr",{enumerable:!0,get:function(){return r.Tr}}),exports.Table=t;
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/Table/index.tsx"],"sourcesContent":[null],"names":["Table","forwardRef","props","ref","children","rest","_jsxs","ChakraTable"],"mappings":"8EAkBM,MAAAA,EAAQC,EAAUA,YAAsB,CAACC,EAAOC,KACpD,MAAMC,SAAEA,KAAaC,GAASH,EAC9B,OACEI,OAACC,EAAAA,MAAW,CAACJ,IAAKA,KAASE,YACxBD,EAAU,MACC"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/Table/index.tsx"],"sourcesContent":[null],"names":["Table","forwardRef","props","ref","children","rest","_jsx","jsx","ChakraTable"],"mappings":"8EAkBM,MAAAA,EAAQC,EAAUA,YAAsB,CAACC,EAAOC,KACpD,MAAMC,SAAEA,KAAaC,GAASH,EAC9B,OACEI,EAAAC,IAACC,EAAWR,MAAA,CAACG,IAAKA,KAASE,EAAID,SAC5BA,GACW"}
@@ -1,2 +1,2 @@
1
- import{jsxs as r}from"react/jsx-runtime";import{forwardRef as e,Table as a}from"@chakra-ui/react";export{TableContainer,Tbody,Td,Th,Thead,Tr}from"@chakra-ui/react";const t=e(((e,t)=>{const{children:o,...c}=e;return r(a,{ref:t,...c,children:[o," "]})}));export{t as Table};
1
+ import{jsx as r}from"react/jsx-runtime";import{forwardRef as e,Table as a}from"@chakra-ui/react";export{TableContainer,Tbody,Td,Th,Thead,Tr}from"@chakra-ui/react";const t=e(((e,t)=>{const{children:o,...c}=e;return r(a,{ref:t,...c,children:o})}));export{t as Table};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/Table/index.tsx"],"sourcesContent":[null],"names":["Table","forwardRef","props","ref","children","rest","_jsxs","ChakraTable"],"mappings":"oKAkBM,MAAAA,EAAQC,GAAgC,CAACC,EAAOC,KACpD,MAAMC,SAAEA,KAAaC,GAASH,EAC9B,OACEI,EAACC,EAAW,CAACJ,IAAKA,KAASE,YACxBD,EAAU,MACC"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/Table/index.tsx"],"sourcesContent":[null],"names":["Table","forwardRef","props","ref","children","rest","_jsx","ChakraTable"],"mappings":"mKAkBM,MAAAA,EAAQC,GAAgC,CAACC,EAAOC,KACpD,MAAMC,SAAEA,KAAaC,GAASH,EAC9B,OACEI,EAACC,EAAW,CAACJ,IAAKA,KAASE,EAAID,SAC5BA,GACW"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cruk/chakra-components",
3
- "version": "4.0.0-dev.6",
3
+ "version": "4.0.0-dev.8",
4
4
  "description": "Chakra UI v2 based components for CRUK applications",
5
5
  "license": "MIT",
6
6
  "sideEffects": false,
@@ -67,6 +67,7 @@
67
67
  "@axe-core/playwright": "^4.10.1",
68
68
  "@chromatic-com/storybook": "^3.2.5",
69
69
  "@eslint/js": "^9.21.0",
70
+ "@octokit/rest": "^22.0.0",
70
71
  "@playwright/experimental-ct-react": "^1.51.0",
71
72
  "@rollup/plugin-commonjs": "^28.0.2",
72
73
  "@rollup/plugin-node-resolve": "^16.0.0",
@@ -74,8 +75,9 @@
74
75
  "@rollup/plugin-typescript": "^12.1.2",
75
76
  "@semantic-release/changelog": "^6.0.3",
76
77
  "@semantic-release/commit-analyzer": "^13.0.1",
78
+ "@semantic-release/exec": "^7.1.0",
77
79
  "@semantic-release/git": "^10.0.1",
78
- "@semantic-release/github": "^11.0.1",
80
+ "@semantic-release/github": "^11.0.5",
79
81
  "@semantic-release/npm": "^12.0.1",
80
82
  "@semantic-release/release-notes-generator": "^14.0.3",
81
83
  "@storybook/addon-a11y": "^8.6.1",