@cruk/chakra-components 3.0.1 → 3.0.3
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,4 +1,5 @@
|
|
|
1
1
|

|
|
2
|
+
|
|
2
3
|
# CRUK Chakra Components 🎨
|
|
3
4
|
|
|
4
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) 🧬.
|
|
@@ -27,8 +28,8 @@ npm install @chakra-ui/react @emotion/react @emotion/styled framer-motion
|
|
|
27
28
|
|
|
28
29
|
**NOTE:** Not all projects use `npm` as their package managers, use whichever is appropriate for your project.
|
|
29
30
|
|
|
30
|
-
|
|
31
31
|
### Basic Setup
|
|
32
|
+
|
|
32
33
|
Once added to the project, you can use the `ChakraBaseProvider` to wrap your application and provide styled based on the `crukBrand` theme.
|
|
33
34
|
|
|
34
35
|
```typescript
|
|
@@ -44,7 +45,6 @@ const App = ({ Component, pageProps }: AppProps) => (
|
|
|
44
45
|
export default App;
|
|
45
46
|
```
|
|
46
47
|
|
|
47
|
-
|
|
48
48
|
- 📖 [Styling documentation](https://super-succotash-wg8qmo1.pages.github.io/styling)
|
|
49
49
|
- 📖 [Theming documentation](https://super-succotash-wg8qmo1.pages.github.io/theming)
|
|
50
50
|
|
|
@@ -53,6 +53,7 @@ export default App;
|
|
|
53
53
|
### Development Setup
|
|
54
54
|
|
|
55
55
|
After cloning the repository, install the dependencies:
|
|
56
|
+
|
|
56
57
|
```bash
|
|
57
58
|
# Clone and setup
|
|
58
59
|
git clone https://github.com/CRUKorg/cruk-chakra-components
|
|
@@ -64,6 +65,7 @@ npm run storybook
|
|
|
64
65
|
```
|
|
65
66
|
|
|
66
67
|
### Quick Test
|
|
68
|
+
|
|
67
69
|
```bash
|
|
68
70
|
npm run test # Unit tests
|
|
69
71
|
npm run test-ct # Component tests
|
|
@@ -73,55 +75,87 @@ npm run test-ct # Component tests
|
|
|
73
75
|
|
|
74
76
|
### Release Process
|
|
75
77
|
|
|
76
|
-
This library uses [semantic-release](https://github.com/semantic-release/semantic-release) to automate versioning and package publishing
|
|
78
|
+
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**.
|
|
77
79
|
|
|
78
80
|
#### Branch Strategy
|
|
79
81
|
|
|
80
82
|
- `dev` branch: Configured as a prerelease branch with the `dev` prerelease tag
|
|
81
83
|
- `main` branch: Configured as a regular release branch
|
|
82
84
|
|
|
83
|
-
####
|
|
85
|
+
#### Release Requirements
|
|
84
86
|
|
|
85
|
-
|
|
87
|
+
**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.
|
|
88
|
+
|
|
89
|
+
#### Creating a Release
|
|
90
|
+
|
|
91
|
+
1. **Create your pull request with `RELEASE` in the title:**
|
|
86
92
|
|
|
87
|
-
1. Create a commit with the appropriate type and include `RELEASE` in the message:
|
|
88
|
-
```
|
|
89
|
-
feat: add new Button variant *RELEASE*
|
|
90
|
-
```
|
|
91
|
-
or
|
|
92
93
|
```
|
|
93
|
-
|
|
94
|
+
RELEASE: Add new Button component
|
|
95
|
+
RELEASE: Fix accessibility issues
|
|
96
|
+
Feature update - RELEASE v2.1.0
|
|
94
97
|
```
|
|
95
98
|
|
|
96
|
-
2.
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
99
|
+
2. **Use conventional commit messages** within your PR to determine the release type:
|
|
100
|
+
|
|
101
|
+
**Patch Release** (v1.0.0 → v1.0.1):
|
|
102
|
+
|
|
103
|
+
```
|
|
104
|
+
fix: resolve Button focus state issue
|
|
105
|
+
docs: update component documentation
|
|
106
|
+
test: add missing unit tests
|
|
107
|
+
refactor: improve component structure
|
|
100
108
|
```
|
|
101
109
|
|
|
102
|
-
|
|
110
|
+
**Minor Release** (v1.0.0 → v1.1.0):
|
|
103
111
|
|
|
104
|
-
|
|
112
|
+
```
|
|
113
|
+
feat: add new Button variant
|
|
114
|
+
feature: implement dark mode support
|
|
115
|
+
```
|
|
105
116
|
|
|
106
|
-
|
|
117
|
+
**Major Release** (v1.0.0 → v2.0.0):
|
|
107
118
|
|
|
108
|
-
1. Create a commit that includes `BREAKING CHANGE:` or `BREAKING CHANGES:` in the commit message body and include `RELEASE`:
|
|
109
119
|
```
|
|
110
|
-
feat: redesign Button component API
|
|
111
|
-
|
|
120
|
+
feat: redesign Button component API
|
|
121
|
+
|
|
112
122
|
BREAKING CHANGE: The Button component no longer accepts 'size' prop, use 'buttonSize' instead.
|
|
113
123
|
```
|
|
114
124
|
|
|
115
|
-
|
|
125
|
+
3. **Merge your PR** to the appropriate branch:
|
|
116
126
|
|
|
117
|
-
|
|
118
|
-
-
|
|
119
|
-
|
|
120
|
-
|
|
127
|
+
- Merge to `dev` for prerelease versions
|
|
128
|
+
- Merge to `main` for standard releases
|
|
129
|
+
|
|
130
|
+
4. The semantic-release system will automatically:
|
|
131
|
+
- Analyse the PR title and commit content
|
|
132
|
+
- Determine the appropriate version bump
|
|
121
133
|
- Generate release notes
|
|
122
134
|
- Publish to npm
|
|
123
135
|
- Create a GitHub release
|
|
124
136
|
|
|
137
|
+
#### Examples
|
|
138
|
+
|
|
139
|
+
✅ **Will trigger a minor release:**
|
|
140
|
+
|
|
141
|
+
- PR title: "RELEASE: Add new components"
|
|
142
|
+
- Contains commit: "feat: add new Button variant"
|
|
143
|
+
|
|
144
|
+
✅ **Will trigger a patch release:**
|
|
145
|
+
|
|
146
|
+
- PR title: "RELEASE: Bug fixes"
|
|
147
|
+
- Contains commit: "fix: resolve styling issue"
|
|
148
|
+
|
|
149
|
+
✅ **Will trigger a major release:**
|
|
150
|
+
|
|
151
|
+
- PR title: "RELEASE: Breaking API changes"
|
|
152
|
+
- Contains commit with: "BREAKING CHANGE: removed deprecated props"
|
|
153
|
+
|
|
154
|
+
❌ **Will NOT trigger any release:**
|
|
155
|
+
|
|
156
|
+
- PR title: "Add new components" (missing "RELEASE")
|
|
157
|
+
- Even with commits like "feat: new component"
|
|
158
|
+
|
|
125
159
|
#### Manual Release
|
|
126
160
|
|
|
127
161
|
If needed, you can manually trigger a release:
|
|
@@ -131,9 +165,11 @@ npm run release
|
|
|
131
165
|
```
|
|
132
166
|
|
|
133
167
|
## Resources 📖
|
|
168
|
+
|
|
134
169
|
- [Component Examples (Storybook)](https://helix-components.cms.app.crnet.org)
|
|
135
170
|
- [Full Documentation (Style guide, Theming, Testing and more)](https://super-succotash-wg8qmo1.pages.github.io/)
|
|
136
171
|
- [Need help? Message us on Slack](https://cruk.slack.com/archives/C07BNR9FY4E)
|
|
137
172
|
|
|
138
173
|
## 📄 Licence
|
|
174
|
+
|
|
139
175
|
MIT © Cancer Research UK
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/Link/index.tsx"],"sourcesContent":[null],"names":["getIconFromFileType","pdf","PdfIcon","default","Inline","forwardRef","props","ref","variant","linkIcon","children","rest","_jsx","jsx","ChakraLink","size","base","lg","_jsxs","jsxs","Flex","alignItems","Icon","as","mr","boxSize","Footer","File","fileType","entryType","fileSize","FileIcon","_Fragment","Fragment","Text","ml","color","toUpperCase","Link","target","restProps","linkContents","linkTitle","title","linkProps","rel","undefined"],"mappings":"mJAsCA,MAAMA,EAAoC,CACxCC,IAAKC,EAAOC,SAGRC,EAASC,EAAUA,YAAiB,CAACC,EAAOC,KAChD,MAAMC,QAAEA,EAAOC,SAAEA,EAAQC,SAAEA,KAAaC,GAASL,EACjD,OACEM,EAAAC,IAACC,OAAU,CACTC,KAAM,CAAEC,KAAM,KAAMC,GAAI,MACxBV,IAAKA,KACDI,EACJH,QAASA,EAAOE,SAGfD,EACCS,EAACC,KAAAC,QAAKC,WAAYf,EAAMe,YAAc,aAAYX,SAAA,CAChDE,MAACU,EAAAA,KAAI,CAAA,cAAa,OAAOC,GAAId,EAAUe,GAAI,EAAGC,QAAS,IACvDb,EAAAA,IAAO,OAAA,CAAAF,SAAAA,UAKA,IAIXgB,EAASrB,EAAUA,YAAiB,CAACC,EAAOC,IAChDK,EAACC,IAAAC,OAAW,CAAAP,IAAKA,KAASD,MAGtBqB,EAAOtB,EAAUA,YAAqB,CAACC,EAAOC,KAClD,MAAMqB,SAAEA,EAAQC,UAAEA,EAASC,SAAEA,EAAQpB,SAAEA,KAAaC,GAASL,EACvDyB,EAAW/B,EAAoB4B,GACrC,OACEV,EACEC,KAAAa,EAAAC,SAAA,CAAAvB,SAAA,CAAAQ,EAAAA,KAACJ,EAAAA,KAAW,CAAAC,KAAM,CAAEC,KAAM,KAAMC,GAAI,MAAQV,IAAKA,KAASI,YACzC,0BAAdkB,GAAyCE,GACxCnB,EAAAC,IAACkB,EAAQ,CAACP,GAAG,kBAAgB,SAE9Bd,KAEFkB,GACCV,EAAAA,KAACgB,EAAAA,KAAI,CAACX,GAAG,OAAOY,GAAG,IAAIC,MAAM,6BACzBR,GAAUS,cACXP,EAAW,KAAKA,EAASO,gBAAkB,YAG/C,IAIDC,EAAOjC,EAAUA,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/Link/index.tsx"],"sourcesContent":[null],"names":["getIconFromFileType","pdf","PdfIcon","default","Inline","forwardRef","props","ref","variant","linkIcon","children","rest","_jsx","jsx","ChakraLink","size","base","lg","_jsxs","jsxs","Flex","alignItems","Icon","as","mr","boxSize","Footer","File","fileType","entryType","fileSize","FileIcon","_Fragment","Fragment","Text","ml","color","toUpperCase","Link","target","restProps","linkContents","linkTitle","title","linkProps","rel","undefined"],"mappings":"mJAsCA,MAAMA,EAAoC,CACxCC,IAAKC,EAAOC,SAGRC,EAASC,EAAUA,YAAiB,CAACC,EAAOC,KAChD,MAAMC,QAAEA,EAAOC,SAAEA,EAAQC,SAAEA,KAAaC,GAASL,EACjD,OACEM,EAAAC,IAACC,OAAU,CACTC,KAAM,CAAEC,KAAM,KAAMC,GA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,IACnB,IAAK,SACH,OAAOhC,MAACc,EAAW,IAAAkB,IACrB,QACE,OAAOhC,MAACR,EAAW,IAAAwC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/Link/index.tsx"],"sourcesContent":[null],"names":["getIconFromFileType","pdf","PdfIcon","Inline","forwardRef","props","ref","variant","linkIcon","children","rest","_jsx","ChakraLink","size","base","lg","_jsxs","Flex","alignItems","Icon","as","mr","boxSize","Footer","File","fileType","entryType","fileSize","FileIcon","_Fragment","Text","ml","color","toUpperCase","Link","target","restProps","linkContents","linkTitle","title","linkProps","rel","undefined"],"mappings":"uQAsCA,MAAMA,EAAoC,CACxCC,IAAKC,GAGDC,EAASC,GAA2B,CAACC,EAAOC,KAChD,MAAMC,QAAEA,EAAOC,SAAEA,EAAQC,SAAEA,KAAaC,GAASL,EACjD,OACEM,EAACC,EAAU,CACTC,KAAM,CAAEC,KAAM,KAAMC,GAAI,MACxBT,IAAKA,KACDI,EACJH,QAASA,EAAOE,SAGfD,EACCQ,EAACC,GAAKC,WAAYb,EAAMa,YAAc,aAAYT,SAAA,CAChDE,EAACQ,EAAI,CAAA,cAAa,OAAOC,GAAIZ,EAAUa,GAAI,EAAGC,QAAS,IACvDX,EAAO,OAAA,CAAAF,SAAAA,UAKA,IAIXc,EAASnB,GAA2B,CAACC,EAAOC,IAChDK,EAACC,EAAW,CAAAN,IAAKA,KAASD,MAGtBmB,EAAOpB,GAA+B,CAACC,EAAOC,KAClD,MAAMmB,SAAEA,EAAQC,UAAEA,EAASC,SAAEA,EAAQlB,SAAEA,KAAaC,GAASL,EACvDuB,EAAW5B,EAAoByB,GACrC,OACET,EACEa,EAAA,CAAApB,SAAA,CAAAO,EAACJ,EAAW,CAAAC,KAAM,CAAEC,KAAM,KAAMC,GAAI,MAAQT,IAAKA,KAASI,YACzC,0BAAdgB,GAAyCE,GACxCjB,EAACiB,EAAQ,CAACP,GAAG,kBAAgB,SAE9BZ,KAEFgB,GACCT,EAACc,EAAI,CAACV,GAAG,OAAOW,GAAG,IAAIC,MAAM,6BACzBP,GAAUQ,cACXN,EAAW,KAAKA,EAASM,gBAAkB,YAG/C,IAIDC,EAAO9B,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/Link/index.tsx"],"sourcesContent":[null],"names":["getIconFromFileType","pdf","PdfIcon","Inline","forwardRef","props","ref","variant","linkIcon","children","rest","_jsx","ChakraLink","size","base","lg","_jsxs","Flex","alignItems","Icon","as","mr","boxSize","Footer","File","fileType","entryType","fileSize","FileIcon","_Fragment","Text","ml","color","toUpperCase","Link","target","restProps","linkContents","linkTitle","title","linkProps","rel","undefined"],"mappings":"uQAsCA,MAAMA,EAAoC,CACxCC,IAAKC,GAGDC,EAASC,GAA2B,CAACC,EAAOC,KAChD,MAAMC,QAAEA,EAAOC,SAAEA,EAAQC,SAAEA,KAAaC,GAASL,EACjD,OACEM,EAACC,EAAU,CACTC,KAAM,CAAEC,KAAM,KAAMC,GAAI,MACxBT,IAAKA,KACDI,EACJH,QAASA,EAAOE,SAGfD,EACCQ,EAACC,GAAKC,WAAYb,EAAMa,YAAc,aAAYT,SAAA,CAChDE,EAACQ,EAAI,CAAA,cAAa,OAAOC,GAAIZ,EAAUa,GAAI,EAAGC,QAAS,IACvDX,EAAO,OAAA,CAAAF,SAAAA,UAKA,IAIXc,EAASnB,GAA2B,CAACC,EAAOC,IAChDK,EAACC,EAAW,CAAAN,IAAKA,KAASD,MAGtBmB,EAAOpB,GAA+B,CAACC,EAAOC,KAClD,MAAMmB,SAAEA,EAAQC,UAAEA,EAASC,SAAEA,EAAQlB,SAAEA,KAAaC,GAASL,EACvDuB,EAAW5B,EAAoByB,GACrC,OACET,EACEa,EAAA,CAAApB,SAAA,CAAAO,EAACJ,EAAW,CAAAC,KAAM,CAAEC,KAAM,KAAMC,GAAI,MAAQT,IAAKA,KAASI,YACzC,0BAAdgB,GAAyCE,GACxCjB,EAACiB,EAAQ,CAACP,GAAG,kBAAgB,SAE9BZ,KAEFgB,GACCT,EAACc,EAAI,CAACV,GAAG,OAAOW,GAAG,IAAIC,MAAM,6BACzBP,GAAUQ,cACXN,EAAW,KAAKA,EAASM,gBAAkB,YAG/C,IAIDC,EAAO9B,GAAqC,CAACC,EAAOC,KACxD,MAAM6B,OAAEA,EAAM5B,QAAEA,KAAY6B,GAAc/B,EACpCgC,EACsB,iBAAnBhC,EAAMI,SAAwBJ,EAAMI,SAAW,OAClD6B,EAAYjC,EAAMkC,OAASF,EAI3BG,EAAY,IACbJ,EACHG,MAJW,WAAXJ,EAAsB,GAAGG,yBAAmCA,EAK5DhC,MACAC,UACA4B,SACA,mBAAoB5B,EACpBkC,IAAgB,WAAXN,EAAsB,2BAAwBO,GAGrD,OAAQnC,GACN,IAAK,OACH,OAAOI,EAACa,EAAS,IAAAgB,IACnB,IAAK,SACH,OAAO7B,EAACY,EAAW,IAAAiB,IACrB,QACE,OAAO7B,EAACR,EAAW,IAAAqC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -106,7 +106,12 @@ interface LinkProps extends LinkProps$1 {
|
|
|
106
106
|
variant?: LinkVariants;
|
|
107
107
|
linkIcon?: ComponentWithAs<"svg", IconProps$1>;
|
|
108
108
|
}
|
|
109
|
-
|
|
109
|
+
interface FileLinkProps extends LinkProps {
|
|
110
|
+
entryType?: string;
|
|
111
|
+
fileType?: string;
|
|
112
|
+
fileSize?: string;
|
|
113
|
+
}
|
|
114
|
+
declare const Link: ComponentWithAs<"a" | "p", FileLinkProps>;
|
|
110
115
|
|
|
111
116
|
type CardProps = CardProps$1 & {
|
|
112
117
|
image?: ImageProps$1;
|