Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
9183e8a
up and running before checks
michael-odonovan Apr 8, 2026
a4293f7
Empty commit to trigger build
michael-odonovan Apr 8, 2026
9d88de2
package messup
michael-odonovan Apr 8, 2026
a673e14
try pulling netlify config in this repo
michael-odonovan Apr 8, 2026
7ca323b
vite build fix
michael-odonovan May 2, 2026
ce1cb08
playwright config adjustments
michael-odonovan May 2, 2026
7ccc85d
package.json script adjustments
michael-odonovan May 2, 2026
9831cb2
adjust tests
michael-odonovan May 2, 2026
45b091d
playwright url issue
michael-odonovan May 2, 2026
21e4494
dist folder fix
michael-odonovan May 2, 2026
070131c
Merge branch 'master' into 4973_CL_rebuild
michael-odonovan May 2, 2026
e05d40c
snaps
michael-odonovan May 2, 2026
282edf6
fixing playwright
michael-odonovan May 6, 2026
365fa40
reorder exported components into alphabetical order
michael-odonovan May 6, 2026
c686869
bank some work
michael-odonovan May 6, 2026
d60e648
fix implied & issue for Checkbox
michael-odonovan May 6, 2026
6f98b16
errant example delete
michael-odonovan May 6, 2026
ab48fea
Atom checks
michael-odonovan May 7, 2026
e4fd083
lint
michael-odonovan May 7, 2026
c70a346
Checking Atoms and finsessing layout
michael-odonovan May 8, 2026
1a6f469
package clean up
michael-odonovan May 8, 2026
066461d
snaps
michael-odonovan May 8, 2026
b65f966
more fixes
michael-odonovan May 8, 2026
e6b086d
cleanup and reimport playwright files
michael-odonovan May 8, 2026
0b209ea
more wrapper sorting
michael-odonovan May 8, 2026
baed1c2
fix Membership example
michael-odonovan May 8, 2026
f4b012a
test fixes
michael-odonovan May 8, 2026
ec41f98
test fixes - molecules and organisms
michael-odonovan May 11, 2026
efc74e2
test fixes
michael-odonovan May 12, 2026
17623fe
test fix
michael-odonovan May 13, 2026
8e06ce2
another fix try
michael-odonovan May 14, 2026
14a30bd
adjustments for running locally
michael-odonovan May 15, 2026
0049611
update some README notes
michael-odonovan May 15, 2026
c6b020c
revert playwright tests
michael-odonovan May 15, 2026
8f2487a
Atoms tests passing locally
michael-odonovan May 15, 2026
aa56be0
downgrade start-server-and-test
michael-odonovan May 15, 2026
2f6d8e7
fix start-server dependency
michael-odonovan May 15, 2026
1857271
update scripts and remove unneeded package
michael-odonovan May 15, 2026
f85edae
playwright fixes
michael-odonovan May 18, 2026
289d9f0
diff check and dynamicGalleries clear
michael-odonovan May 18, 2026
2e93757
Organisms good
michael-odonovan May 18, 2026
90c27c3
snaps
michael-odonovan May 18, 2026
cad8c35
Merge branch 'master' into 4973_CL_rebuild
michael-odonovan May 19, 2026
4453f62
UX tweaks and remote test fail
michael-odonovan May 20, 2026
6a276a0
cleanup Theme examples
michael-odonovan May 26, 2026
e501647
update README
michael-odonovan May 26, 2026
59a07a1
tweaks
michael-odonovan May 27, 2026
8f9b332
Readme stuff
michael-odonovan May 27, 2026
6458e5f
update readme and try another slider fix
michael-odonovan May 27, 2026
de3401e
update card example to fix merge
michael-odonovan May 27, 2026
cea748d
adjust Impact slider test again
michael-odonovan May 27, 2026
29ccd9c
Impact Slider fix
michael-odonovan May 27, 2026
5e070fe
cleanup ThemeExample
michael-odonovan May 28, 2026
0084862
manual check AmbientVid
michael-odonovan Jun 1, 2026
734faf9
Button extra manual checks
michael-odonovan Jun 1, 2026
53a1b97
ButtonWithStates xtra manual checks
michael-odonovan Jun 1, 2026
b4c99ea
manual checks Checkbox and Confetti
michael-odonovan Jun 1, 2026
158cd6f
atoms: manual checks complete, all tests passing
michael-odonovan Jun 2, 2026
090084e
cleanup
michael-odonovan Jun 2, 2026
c47679c
manual checks on Atoms all good and Logos sorting
michael-odonovan Jun 3, 2026
ce3972b
more cleanup of Atoms
michael-odonovan Jun 3, 2026
45294d4
cleanup Text example mess
michael-odonovan Jun 3, 2026
a71e792
add better comments
michael-odonovan Jun 3, 2026
90c02f3
Manual checks on Organisms
michael-odonovan Jun 4, 2026
9127159
molecules - more manual edits
michael-odonovan Jun 4, 2026
56540c5
update
michael-odonovan Jun 4, 2026
c741554
add more examples to Molecules
michael-odonovan Jun 5, 2026
f386ed7
Donate checks good
michael-odonovan Jun 5, 2026
1b09b1e
Clean up EmailSignUpExample
michael-odonovan Jun 7, 2026
3e6c5a2
more checks and refinements
michael-odonovan Jun 7, 2026
0c5f5c2
cleanup
michael-odonovan Jun 8, 2026
629241f
Header checks out
michael-odonovan Jun 8, 2026
3121a3a
cleanups
michael-odonovan Jun 8, 2026
f52efe6
update
michael-odonovan Jun 8, 2026
771a3b6
adjusting impactSlider test
michael-odonovan Jun 8, 2026
4c72341
Merge branch 'master' into 4973_CL_rebuild
michael-odonovan Jun 8, 2026
91f131d
snaps
michael-odonovan Jun 8, 2026
93de615
fix Internal mishap
michael-odonovan Jun 8, 2026
3880a8e
fix transient props / styled components
michael-odonovan Jun 8, 2026
f345b57
fix for svg
michael-odonovan Jun 8, 2026
7ecebad
more comments and simpler impact Slider solution?
michael-odonovan Jun 8, 2026
a9809ad
simplier comment
michael-odonovan Jun 9, 2026
136a677
Unbork HeroBanner styles
AndyEPhipps Jun 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,16 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*

checklist.md

.idea
.vscode
.src-old

# testing
/coverage
/tests_output
/test-results/
/playwright-report/
/playwright/.cache/

2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v16.20.0
v18.20.0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per other comment re: Node 22+

18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
Comic Relief React Component Library

Comic Relief Components Library

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's stick with component (singular) to match the package name

--------------

[![GitHub Actions](https://github.com/comicrelief/component-library/actions/workflows/main.yml/badge.svg)](https://github.com/comicrelief/component-library/actions)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)

React components to be shared across Comic Relief applications
### Recent Rebuild Notes (June 2026):
- No more markdown importing Javascript faff in example files, just simple React component examples.
- Only exception is the code examples visible below each of the components - they are built using a Vite-specific import feature:
```import buttonExampleSrc from '../components/Atoms/Button/ButtonExample.jsx?raw';```
- Styled-Components 5 => Styled Components 6 - slight syntax change. Previously usage of nested selector / "&" usage in nested CSS was assumed. It now needs to be explicit (like normal native CSS).
- Removed _TriggerConfetti.js file. I couldn't find any usage, was likely a private helper no longer needed.

### Use

CR-CL has a dependency of Styled-components.
### General Usage
#### Main Dependencies
- Vite
- Styled Components

#### Install the package
```
Expand All @@ -35,7 +43,7 @@ $ yarn install

To start the dev build and server:
```
$ yarn styleguide
$ yarn dev
```

To test:
Expand Down
8 changes: 5 additions & 3 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
module.exports = function (api) {
api.cache(true);

const presets = [['react-app', { absoluteRuntime: false }]];
const presets = [
['@babel/preset-env', { targets: { node: 'current' } }],
['@babel/preset-react', { runtime: 'automatic' }]
];
const plugins = [
['babel-plugin-styled-components'],
['import', { libraryName: 'lodash', libraryDirectory: '', camel2DashComponentName: false }]
['babel-plugin-styled-components']
];

return {
Expand Down
12 changes: 0 additions & 12 deletions docs/installation.md

This file was deleted.

3 changes: 0 additions & 3 deletions docs/introduction.md

This file was deleted.

71 changes: 0 additions & 71 deletions docs/utils.md

This file was deleted.

12 changes: 12 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Component Library</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>
6 changes: 6 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[build]
command = "yarn build:preview"
publish = "dist"

[build.environment]
NODE_VERSION = "18"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we bump this to 22+, as per discussions today?

125 changes: 58 additions & 67 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,19 @@
"name": "@comicrelief/component-library",
"author": "Comic Relief Engineering Team",
"version": "0.0.0-see.readme.for.semantic.release.process",
"main": "dist/index.js",
"main": "dist/index.cjs.js",
"module": "dist/index.es.js",
"files": [
"dist"
],
"license": "ISC",
"repository": {
"type": "git",
"url": "https://github.com/comicrelief/component-library.git"
},
"jest": {
"verbose": true,
"testEnvironment": "jsdom",
"testPathIgnorePatterns": [
"<rootDir>/playwright/",
"<rootDir>/dist/",
Expand All @@ -16,93 +25,75 @@
"^axios$": "axios/dist/node/axios.cjs"
}
},
"module": "dist/index.js",
"repository": {
"type": "git",
"url": "https://github.com/comicrelief/component-library.git"
"scripts": {
"dev": "vite",
"build": "vite build",
"build:preview": "vite build --config vite.preview.config.mjs",
"preview": "vite preview",
"test:unit": "jest",
"test:unit:update": "jest -u",
"serve:preview": "vite preview --config vite.preview.config.mjs --port 4173",
"test:e2e": "playwright test --project=chromium",
"test:e2e--h": "playwright test --project=chromium --headed",
"test:e2e:ci": "playwright test --project=chromium",
"test:e2e:local": "playwright test --project=chromium; yarn playwright show-report",
"test:e2e:mac": "playwright test --project=chromium; yarn playwright show-report",
"test:e2e:mac:atoms": "playwright test playwright/components/atoms --project=chromium; yarn playwright show-report",
"test:e2e:mac:molecules": "playwright test playwright/components/molecules --project=chromium; yarn playwright show-report",
"test:e2e:mac:organisms": "playwright test playwright/components/organisms --project=chromium; yarn playwright show-report",
"test:e2e:mac:organisms:impactSlider:": "playwright test playwright/components/organisms/impactSlider.spec.js --project=chromium; yarn playwright show-report",
"lint": "eslint src",
"lint-fix": "yarn lint --fix"
},
"peerDependencies": {
"react": ">=18",
"react-dom": ">=18",
"styled-components": ">=6"
},
"dependencies": {
"@babel/cli": "^7.21.5",
"@hookform/resolvers": "^3.9.0",
"@splidejs/react-splide": "^0.7.12",
"axios": "^1.7.2",
"babel-plugin-import": "^1.13.8",
"axios": "^1.7.7",
"lazysizes": "^5.3.2",
"lodash": "^4.17.11",
"moment": "^2.29.4",
"lodash": "^4.17.21",
"moment": "^2.30.1",
"prop-types": "^15.8.1",
"pure-react-carousel": "1.30.1",
"react": "^17.0.2",
"react-canvas-confetti": "^1.4.0",
"pure-react-carousel": "^1.30.1",
"react-canvas-confetti": "^2.0.7",
"react-currency-format": "^1.1.0",
"react-dom": "^17.0.2",
"react-hook-form": "^7.52.1",
"react-hook-form": "^7.53.2",
"react-modal": "^3.16.1",
"react-range-slider-input": "^3.0.7",
"react-responsive": "^9.0.2",
"react-scripts": "4.0.3",
"react-spinners": "^0.11.0",
"react-responsive": "^10.0.0",
"react-spinners": "^0.14.1",
"react-uid": "^2.3.3",
"styled-components": "^5.3.11",
"youtube-player": "^5.6.0",
"yup": "^1.4.0"
},
"resolutions": {
"react-scripts/workbox-webpack-plugin/workbox-build/@surma/rollup-plugin-off-main-thread/ejs": "3.1.10",
"loader-utils": "2.0.3",
"unset-value": "2.0.1",
"shell-quote": "1.7.3",
"ansi-html": "0.0.9",
"semver": "7.5.2",
"braces": "3.0.3",
"node-forge": "1.3.2",
"nth-check": "2.0.1"
},
"scripts": {
"build": "rm -rf dist && NODE_ENV=production babel src --out-dir dist --copy-files --ignore __tests__,spec.js,test.js",
"test:unit": "yarn run jest",
"test:unit:update": "yarn jest -u",
"styleguide": "cross-env FAST_REFRESH=false styleguidist server",
"styleguide:build": "styleguidist build",
"test:e2e": "playwright test --project=chromium",
"test:e2e--h": "playwright test --project=chromium --headed",
"test:e2e:ci": "NODE_ENV=development; start-server-and-test styleguide http://localhost:6060 test:e2e",
"test:e2e:local": "export NODE_ENV=development; start-server-and-test styleguide http://localhost:6060 test:e2e",
"lint": "eslint src",
"lint-fix": "yarn lint --fix",
"build-pr": "rm -rf dist && NODE_ENV=development BABEL_ENV=development yarn babel src --out-dir dist --copy-files --ignore __tests__,spec.js,test.js",
"postinstall": "yarn build-pr"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@babel/core": "^7.24.0",
"@babel/preset-env": "^7.24.0",
"@babel/preset-react": "^7.24.0",
"@playwright/test": "^1.38.1",
"cross-env": "^7.0.3",
"ejs": "^3.1.10",
"@vitejs/plugin-react": "^4.3.1",
"babel-jest": "^29.7.0",
"babel-plugin-styled-components": "^2.1.4",
"dotenv": "^17.4.2",
"eslint": "^7.32.0",
"eslint-config-airbnb": "^18.2.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^4.6.0",
"jest": "^26.1.0",
"jest-styled-components": "^7.1.1",
"npm-run-all": "^4.1.5",
"prettier": "^2.8.8",
"react-styleguidist": "^11.1.7",
"react-test-renderer": "^17.0.2",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jest-styled-components": "^7.4.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-test-renderer": "^18.3.1",
"semantic-release": "^17.4.6",
"start-server-and-test": "^2.0.4"
"styled-components": "^6.1.13",
"vite": "^5.4.10",
"vite-plugin-dts": "^4.3.0"
}
}
11 changes: 7 additions & 4 deletions playwright.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ module.exports = defineConfig({
},
reporter: [
['list'],
['html', { open: 'never' }]
['html', { open: 'never' }],
['json', { outputFile: '/tmp/pw-progress.json' }]
],
use: {
baseURL: 'http://localhost:4173',
actionTimeout: 0,
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry'
Expand All @@ -37,6 +39,7 @@ module.exports = defineConfig({
name: 'chromium',
use: {
...devices['Desktop Chrome'],
channel: process.platform === 'darwin' ? 'chrome' : undefined,
viewport: {
// Match our widest nav:
width: 1300,
Expand All @@ -48,9 +51,9 @@ module.exports = defineConfig({

/* Run your local dev server before starting the tests */
webServer: {
command: 'yarn styleguide',
port: '6060',
command: 'yarn build:preview && yarn serve:preview',
url: 'http://localhost:4173',
timeout: 120000,
reuseExistingServer: true
reuseExistingServer: !process.env.CI
}
});
Loading
Loading