+ News article +
+
- diff --git a/.gitignore b/.gitignore index 354fe60fa..3bde20174 100644 --- a/.gitignore +++ b/.gitignore @@ -25,8 +25,11 @@ npm-debug.log* yarn-debug.log* yarn-error.log* +checklist.md + .idea .vscode +.src-old # testing /coverage @@ -34,3 +37,4 @@ yarn-error.log* /test-results/ /playwright-report/ /playwright/.cache/ + diff --git a/.nvmrc b/.nvmrc index 9e15be387..6bb900519 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v16.20.0 +v22.22.3 diff --git a/README.md b/README.md index 4767a06ab..18922a478 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,22 @@ -Comic Relief React Component Library + +Comic Relief Component Library -------------- [](https://github.com/comicrelief/component-library/actions) [](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 ``` @@ -35,7 +43,7 @@ $ yarn install To start the dev build and server: ``` -$ yarn styleguide +$ yarn dev ``` To test: diff --git a/babel.config.js b/babel.config.js index 0f8518bde..befa8ee62 100644 --- a/babel.config.js +++ b/babel.config.js @@ -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 { diff --git a/docs/installation.md b/docs/installation.md deleted file mode 100644 index d7669703f..000000000 --- a/docs/installation.md +++ /dev/null @@ -1,12 +0,0 @@ -### How to use components - -CR-CL has a dependency of Styled-components. - -#### Install the package -`yarn add @comicrelief/component-library` - -#### Wrap your app with the ThemeProvider and crTheme -`import { ThemeProvider, crTheme } from '@comicrelief/component-library';` - -#### Import components -`import { HeroBanner } from '@comicrelief/component-library';` diff --git a/docs/introduction.md b/docs/introduction.md deleted file mode 100644 index 30fa5407e..000000000 --- a/docs/introduction.md +++ /dev/null @@ -1,3 +0,0 @@ -## Comic Relief React Component Library - -This component library is build using styleguidist, documenting the layouts, design patterns and components used across our sites and products. \ No newline at end of file diff --git a/docs/utils.md b/docs/utils.md deleted file mode 100644 index 28306c26c..000000000 --- a/docs/utils.md +++ /dev/null @@ -1,71 +0,0 @@ -## hideVisually - -`import { hideVisually } from '@comicrelief/component-library';` - -How to use in your styled component -`export const Component = styled.span'${hideVisually};';` - -## allowListed - -`import { allowListed } from '@comicrelief/component-library';` - -`allowListed(url)` - -Check if a url is allowListed. Used to check links and change link target. - -## zIndex - -`import { zIndex } from '@comicrelief/component-library';` - -How to use in your styled component -`export const Component = styled.span'${zIndex('high')};';` - -## spacing - -`import { spacing } from '@comicrelief/component-library';` - -Default spacing scale - -| Name | Size | -| :--- | :-----: | -| none | 0 | -| xsm | 0.25rem | -| sm | 0.25rem | -| md | 1rem | -| l | 2rem | -| xl | 4rem | -| xxl | 8rem | -| xxxl | 16rem | - -How to use in your styled component: - -`padding: ${spacing('md)'} ${spacing('l)'};';` - -## allBreakpoints, and { breakpointValues } within allBreakpoints - -| S | M | L | Nav | XL | -|:----:|------:| ------:| -----:| ------:| -| 0 | 740 | 1024 | 1150 | 1440 | - -## Usage within Component Library itself -#### media queries (no need to import): -`@media ${({ theme }) => theme.allBreakpoints('M')} {` - -### screen sizes: -`import { breakpointValues } from '../../../theme/shared/allBreakpoints';` - -`max-width: ${breakpointValues.M}px;` - -### Usage within Component Library: -`import { breakpointValues } from '@comicrelief/component-library/src/theme/shared/allBreakpoints';` - -`max-width: ${breakpointValues.M}px);` - - -## containers from containers.js -| small | medium | large | -|:-------:|--------:| ------:| -| 800px | 1200px | 1440px | - -### Note: These are used in a max-width context: -`max-width: ${containers.small}` diff --git a/index.html b/index.html new file mode 100644 index 000000000..9ffc7a842 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + +
+ + +
-
+
-
+First paragraph
-Second paragraph
-Third and final paragraph
-Only child P
-Paragraph
-Paragraph
-Paragraph, last child
-A preceding paragraph
-A preceding paragraph
-Proceeding paragraph
-Paragraph, last child
-A preceding paragraph
-A preceding paragraph
-Proceeding paragraph
-Paragraph, last child
-family: {fontConfig['h1'].family}
+mobileColor: blue
+font size (S / M / L breakpoints): {fontConfig['h1'].small.fontSize} / {fontConfig['h1'].medium.fontSize} / {fontConfig['h1'].large.fontSize}
+line height (S / M / L breakpoints): {fontConfig['h1'].small.lineHeight} / {fontConfig['h1'].medium.lineHeight} / {fontConfig['h1'].large.lineHeight}
+family: {fontConfig['h2'].family}
+mobileColor: green
+font size (S / M / L breakpoints): {fontConfig['h2'].small.fontSize} / {fontConfig['h2'].medium.fontSize} / {fontConfig['h2'].large.fontSize}
+line height (S / M / L breakpoints): {fontConfig['h2'].small.lineHeight} / {fontConfig['h2'].medium.lineHeight} / {fontConfig['h2'].large.lineHeight}
+family: {fontConfig['h3'].family}
+mobileColor: red
+font size (S / M / L breakpoints): {fontConfig['h3'].small.fontSize} / {fontConfig['h3'].medium.fontSize} / {fontConfig['h3'].large.fontSize}
+line height (S / M / L breakpoints): {fontConfig['h3'].small.lineHeight} / {fontConfig['h3'].medium.lineHeight} / {fontConfig['h3'].large.lineHeight}
+family: {fontConfig['span'].family}
+font size (S / M / L breakpoints): {fontConfig['h4'].small.fontSize} / {fontConfig['h4'].medium.fontSize} / {fontConfig['h4'].large.fontSize}
+line height (S / M / L breakpoints): {fontConfig['h4'].small.lineHeight} / {fontConfig['h4'].medium.lineHeight} / {fontConfig['h4'].large.lineHeight}
+family: {fontConfig['p'].family}
+font size (S / M / L breakpoints): {fontConfig['p'].small.fontSize} / {fontConfig['p'].medium.fontSize} / {fontConfig['p'].large.fontSize}
+line height (S / M / L breakpoints): {fontConfig['p'].small.lineHeight} / {fontConfig['p'].medium.lineHeight} / {fontConfig['p'].large.lineHeight}
+family: {fontConfig['h5'].family}
+font size (S / M / L breakpoints): {fontConfig['h5'].small.fontSize} / {fontConfig['h5'].medium.fontSize} / {fontConfig['h5'].large.fontSize}
+line height (S / M / L breakpoints): {fontConfig['h5'].small.lineHeight} / {fontConfig['h5'].medium.lineHeight} / {fontConfig['h5'].large.lineHeight}
+family: {fontConfig['h6'].family}
+font size (S / M / L breakpoints): {fontConfig['h6'].small.fontSize} / {fontConfig['h6'].medium.fontSize} / {fontConfig['h6'].large.fontSize}
+line height (S / M / L breakpoints): {fontConfig['h6'].small.lineHeight} / {fontConfig['h6'].medium.lineHeight} / {fontConfig['h6'].large.lineHeight}
+First paragraph
+Second paragraph
+Third and final paragraph
+Only child paragraph
+Paragraph
+Paragraph
+Paragraph, last child
+A preceding paragraph
+A preceding paragraph
+Proceeding paragraph
+Paragraph, last child
+A preceding paragraph
+A preceding paragraph
+Proceeding paragraph
+Paragraph, last child
+
- Load @@ -61,30 +431,30 @@ exports[`handles data structure correctly 1`] = `
Load @@ -150,26 +518,24 @@ exports[`handles data structure correctly 1`] = `
Load @@ -197,30 +563,30 @@ exports[`handles data structure correctly 1`] = `
Load of text here
Load @@ -371,30 +1133,30 @@ exports[`renders 2 columns layout correctly 1`] = `
Load @@ -460,26 +1220,24 @@ exports[`renders 2 columns layout correctly 1`] = `
Load @@ -507,30 +1265,30 @@ exports[`renders 2 columns layout correctly 1`] = `
Load of text here
Load @@ -681,30 +1815,30 @@ exports[`renders carousel mode correctly 1`] = `
Load @@ -770,26 +1902,24 @@ exports[`renders carousel mode correctly 1`] = `
Load @@ -817,30 +1947,30 @@ exports[`renders carousel mode correctly 1`] = `
Load of text here
Load @@ -991,30 +2497,30 @@ exports[`renders correctly with data prop 1`] = `
Load @@ -1080,26 +2584,24 @@ exports[`renders correctly with data prop 1`] = `
Load @@ -1127,30 +2629,30 @@ exports[`renders correctly with data prop 1`] = `
Load of text here
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
`} - /> - } - rightCopy={ -Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
`} - /> - } -/>; -``` diff --git a/src/components/Molecules/DoubleCopy/DoubleCopy.test.js b/src/components/Molecules/DoubleCopy/DoubleCopy.test.js index 8905c7dc1..c02d4b0bf 100644 --- a/src/components/Molecules/DoubleCopy/DoubleCopy.test.js +++ b/src/components/Molecules/DoubleCopy/DoubleCopy.test.js @@ -6,7 +6,8 @@ import DoubleCopy from './DoubleCopy'; import RichText from '../../Atoms/RichText/RichText'; it('renders correctly', () => { - const content = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
'; + const content = + 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
'; const tree = renderWithTheme(Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
", - } - } - /> -Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
", - } - } - /> -Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
", + } + } + /> +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
", + } + } + /> +
@@ -334,9 +279,6 @@ exports[`renders "Half Height Media" Hero Banner correctly 1`] = `
font-family: 'Anton',Impact,sans-serif;
font-weight: 400;
text-transform: uppercase;
- -webkit-letter-spacing: 0;
- -moz-letter-spacing: 0;
- -ms-letter-spacing: 0;
letter-spacing: 0;
font-size: 2rem;
line-height: 2rem;
@@ -355,9 +297,6 @@ exports[`renders "Half Height Media" Hero Banner correctly 1`] = `
font-family: 'Montserrat',Helvetica,Arial,sans-serif;
font-weight: 400;
text-transform: inherit;
- -webkit-letter-spacing: 0;
- -moz-letter-spacing: 0;
- -ms-letter-spacing: 0;
letter-spacing: 0;
font-size: 1rem;
line-height: 1.25rem;
@@ -389,18 +328,10 @@ exports[`renders "Half Height Media" Hero Banner correctly 1`] = `
.c0 {
width: 100%;
height: auto;
- display: -webkit-box;
- display: -webkit-flex;
- display: -ms-flexbox;
display: flex;
position: relative;
- -webkit-flex-direction: column;
- -ms-flex-direction: column;
flex-direction: column;
background: #86E4E9;
- -webkit-box-pack: center;
- -webkit-justify-content: center;
- -ms-flex-pack: center;
justify-content: center;
padding: 0rem 0 2rem;
}
@@ -409,19 +340,17 @@ exports[`renders "Half Height Media" Hero Banner correctly 1`] = `
width: 100%;
max-width: none;
position: relative;
- display: -webkit-box;
- display: -webkit-flex;
- display: -ms-flexbox;
display: flex;
- -webkit-flex-direction: column;
- -ms-flex-direction: column;
flex-direction: column;
- -webkit-align-items: center;
- -webkit-box-align: center;
- -ms-flex-align: center;
align-items: center;
}
+.c1:hover button[data-play-pause],
+.c1:focus-within button[data-play-pause] {
+ opacity: 0.8;
+ transition-delay: 0s;
+}
+
.c2 {
width: 100%;
height: 100%;
@@ -432,9 +361,6 @@ exports[`renders "Half Height Media" Hero Banner correctly 1`] = `
height: 100%;
left: 0;
right: 0;
- display: -webkit-box;
- display: -webkit-flex;
- display: -ms-flexbox;
display: flex;
width: calc(100% - (2 * 1rem));
margin: -2rem 1rem 0;
@@ -452,56 +378,47 @@ exports[`renders "Half Height Media" Hero Banner correctly 1`] = `
.c6 {
width: 100%;
height: 100%;
- display: -webkit-box;
- display: -webkit-flex;
- display: -ms-flexbox;
display: flex;
- -webkit-align-items: center;
- -webkit-box-align: center;
- -ms-flex-align: center;
align-items: center;
border-radius: 1rem;
}
-@media (min-width:740px) {
+@media (min-width: 740px) {
.c8 {
font-size: 2.5rem;
line-height: 2.5rem;
}
}
-@media (min-width:1024px) {
+@media (min-width: 1024px) {
.c8 {
font-size: 3rem;
line-height: 3rem;
}
}
-@media (min-width:740px) {
+@media (min-width: 740px) {
.c9 {
font-size: 1rem;
line-height: 1.25rem;
}
}
-@media (min-width:1024px) {
+@media (min-width: 1024px) {
.c9 {
font-size: 1.125rem;
line-height: 1.375rem;
}
}
-@media (min-width:1024px) {
+@media (min-width: 1024px) {
.c0 {
padding: 0rem 2rem 2rem;
- -webkit-align-items: center;
- -webkit-box-align: center;
- -ms-flex-align: center;
align-items: center;
}
}
-@media (min-width:1024px) {
+@media (min-width: 1024px) {
.c1 {
width: 100%;
max-width: 1500px;
@@ -511,16 +428,9 @@ exports[`renders "Half Height Media" Hero Banner correctly 1`] = `
height: auto;
min-height: 450px;
}
-
- .c1:hover button[data-play-pause],
- .c1:focus-within button[data-play-pause] {
- opacity: 0.8;
- -webkit-transition-delay: 0s;
- transition-delay: 0s;
- }
}
-@media (min-width:1024px) {
+@media (min-width: 1024px) {
.c2 {
position: absolute;
top: 0;
@@ -530,30 +440,24 @@ exports[`renders "Half Height Media" Hero Banner correctly 1`] = `
.c2 img {
object-position: top center;
height: 100%;
- -webkit-transform: scale(1.02);
- -ms-transform: scale(1.02);
transform: scale(1.02);
- -webkit-transition: -webkit-transform 0.4s cubic-bezier(0.68,-1.15,0.265,2.35);
- -webkit-transition: transform 0.4s cubic-bezier(0.68,-1.15,0.265,2.35);
transition: transform 0.4s cubic-bezier(0.68,-1.15,0.265,2.35);
min-height: 450px;
}
- .c2:has(+ div a:hover) > div > img {
- -webkit-transform: scale(1.04);
- -ms-transform: scale(1.04);
+ .c2:has(+ div a:hover) >div>img {
transform: scale(1.04);
}
}
-@media (min-width:740px) {
+@media (min-width: 740px) {
.c5 {
margin: -2rem 2rem 0rem;
width: calc(100% - (2 * 2rem));
}
}
-@media (min-width:1024px) {
+@media (min-width: 1024px) {
.c5 {
position: relative;
top: auto;
@@ -561,44 +465,32 @@ exports[`renders "Half Height Media" Hero Banner correctly 1`] = `
height: 100%;
width: 100%;
max-width: 1200px;
- display: -webkit-box;
- display: -webkit-flex;
- display: -ms-flexbox;
display: flex;
- -webkit-align-items: center;
- -webkit-box-align: center;
- -ms-flex-align: center;
align-items: center;
margin: 0 auto;
- -webkit-box-pack: end;
- -webkit-justify-content: flex-end;
- -ms-flex-pack: end;
justify-content: flex-end;
height: auto;
min-height: 450px;
}
}
-@media (min-width:1024px) {
+@media (min-width: 1024px) {
.c7 {
padding: 2rem;
}
}
-@media (min-width:1024px) {
+@media (min-width: 1024px) {
.c7 {
width: 92%;
}
}
-@media (min-width:1024px) {
+@media (min-width: 1024px) {
.c6 {
height: auto;
width: 50%;
margin: 2rem 0;
- -webkit-box-pack: start;
- -webkit-justify-content: flex-start;
- -ms-flex-pack: start;
justify-content: flex-start;
}
}
@@ -614,18 +506,16 @@ exports[`renders "Half Height Media" Hero Banner correctly 1`] = `
>
@@ -662,9 +552,6 @@ exports[`renders "Text Banner" Hero Banner correctly 1`] = `
font-family: 'Anton',Impact,sans-serif;
font-weight: 400;
text-transform: uppercase;
- -webkit-letter-spacing: 0;
- -moz-letter-spacing: 0;
- -ms-letter-spacing: 0;
letter-spacing: 0;
font-size: 2rem;
line-height: 2rem;
@@ -683,9 +570,6 @@ exports[`renders "Text Banner" Hero Banner correctly 1`] = `
font-family: 'Montserrat',Helvetica,Arial,sans-serif;
font-weight: 400;
text-transform: inherit;
- -webkit-letter-spacing: 0;
- -moz-letter-spacing: 0;
- -ms-letter-spacing: 0;
letter-spacing: 0;
font-size: 1rem;
line-height: 1.25rem;
@@ -703,18 +587,10 @@ exports[`renders "Text Banner" Hero Banner correctly 1`] = `
.c0 {
width: 100%;
height: auto;
- display: -webkit-box;
- display: -webkit-flex;
- display: -ms-flexbox;
display: flex;
position: relative;
- -webkit-flex-direction: column;
- -ms-flex-direction: column;
flex-direction: column;
background: #86E4E9;
- -webkit-box-pack: center;
- -webkit-justify-content: center;
- -ms-flex-pack: center;
justify-content: center;
padding: 0rem 0 2rem;
padding: 0rem 1rem 2rem;
@@ -724,27 +600,22 @@ exports[`renders "Text Banner" Hero Banner correctly 1`] = `
width: 100%;
max-width: none;
position: relative;
- display: -webkit-box;
- display: -webkit-flex;
- display: -ms-flexbox;
display: flex;
- -webkit-flex-direction: column;
- -ms-flex-direction: column;
flex-direction: column;
- -webkit-align-items: center;
- -webkit-box-align: center;
- -ms-flex-align: center;
align-items: center;
}
+.c1:hover button[data-play-pause],
+.c1:focus-within button[data-play-pause] {
+ opacity: 0.8;
+ transition-delay: 0s;
+}
+
.c2 {
position: relative;
height: 100%;
left: 0;
right: 0;
- display: -webkit-box;
- display: -webkit-flex;
- display: -ms-flexbox;
display: flex;
width: calc(100% - (2 * 1rem));
margin: 0;
@@ -764,63 +635,54 @@ exports[`renders "Text Banner" Hero Banner correctly 1`] = `
.c3 {
width: 100%;
height: 100%;
- display: -webkit-box;
- display: -webkit-flex;
- display: -ms-flexbox;
display: flex;
- -webkit-align-items: center;
- -webkit-box-align: center;
- -ms-flex-align: center;
align-items: center;
border-radius: 1rem;
}
-@media (min-width:740px) {
+@media (min-width: 740px) {
.c5 {
font-size: 2.5rem;
line-height: 2.5rem;
}
}
-@media (min-width:1024px) {
+@media (min-width: 1024px) {
.c5 {
font-size: 3rem;
line-height: 3rem;
}
}
-@media (min-width:740px) {
+@media (min-width: 740px) {
.c6 {
font-size: 1rem;
line-height: 1.25rem;
}
}
-@media (min-width:1024px) {
+@media (min-width: 1024px) {
.c6 {
font-size: 1.125rem;
line-height: 1.375rem;
}
}
-@media (min-width:740px) {
+@media (min-width: 740px) {
.c0 {
padding-left: 2rem;
padding-right: 2rem;
}
}
-@media (min-width:1024px) {
+@media (min-width: 1024px) {
.c0 {
padding: 0rem 2rem 2rem;
- -webkit-align-items: center;
- -webkit-box-align: center;
- -ms-flex-align: center;
align-items: center;
}
}
-@media (min-width:1024px) {
+@media (min-width: 1024px) {
.c1 {
width: 100%;
max-width: 1500px;
@@ -828,65 +690,46 @@ exports[`renders "Text Banner" Hero Banner correctly 1`] = `
overflow: hidden;
box-shadow: rgba(0,0,0,0.15) 0px 0px 1rem;
}
-
- .c1:hover button[data-play-pause],
- .c1:focus-within button[data-play-pause] {
- opacity: 0.8;
- -webkit-transition-delay: 0s;
- transition-delay: 0s;
- }
}
-@media (min-width:740px) {
+@media (min-width: 740px) {
.c2 {
margin: 0;
width: 100%;
}
}
-@media (min-width:1024px) {
+@media (min-width: 1024px) {
.c2 {
position: relative;
top: auto;
left: auto;
height: 100%;
width: 100%;
- display: -webkit-box;
- display: -webkit-flex;
- display: -ms-flexbox;
display: flex;
- -webkit-align-items: center;
- -webkit-box-align: center;
- -ms-flex-align: center;
align-items: center;
margin: 0 auto;
- -webkit-box-pack: center;
- -webkit-justify-content: center;
- -ms-flex-pack: center;
justify-content: center;
}
}
-@media (min-width:740px) {
+@media (min-width: 740px) {
.c4 {
padding: 4rem 11%;
}
}
-@media (min-width:1024px) {
+@media (min-width: 1024px) {
.c4 {
width: 100%;
}
}
-@media (min-width:1024px) {
+@media (min-width: 1024px) {
.c3 {
height: auto;
width: 100%;
margin: 0;
- -webkit-box-pack: start;
- -webkit-justify-content: flex-start;
- -ms-flex-pack: start;
justify-content: flex-start;
}
}
@@ -928,9 +771,6 @@ exports[`renders "Text Banner" Hero Banner correctly 2`] = `
font-family: 'Anton',Impact,sans-serif;
font-weight: 400;
text-transform: uppercase;
- -webkit-letter-spacing: 0;
- -moz-letter-spacing: 0;
- -ms-letter-spacing: 0;
letter-spacing: 0;
font-size: 2rem;
line-height: 2rem;
@@ -945,9 +785,6 @@ exports[`renders "Text Banner" Hero Banner correctly 2`] = `
font-family: 'Montserrat',Helvetica,Arial,sans-serif;
font-weight: 400;
text-transform: inherit;
- -webkit-letter-spacing: 0;
- -moz-letter-spacing: 0;
- -ms-letter-spacing: 0;
letter-spacing: 0;
font-size: 1rem;
line-height: 1.25rem;
@@ -989,18 +826,10 @@ exports[`renders "Text Banner" Hero Banner correctly 2`] = `
.c0 {
width: 100%;
height: auto;
- display: -webkit-box;
- display: -webkit-flex;
- display: -ms-flexbox;
display: flex;
position: relative;
- -webkit-flex-direction: column;
- -ms-flex-direction: column;
flex-direction: column;
background: #86E4E9;
- -webkit-box-pack: center;
- -webkit-justify-content: center;
- -ms-flex-pack: center;
justify-content: center;
padding: 2rem 0 2rem;
}
@@ -1009,19 +838,17 @@ exports[`renders "Text Banner" Hero Banner correctly 2`] = `
width: 100%;
max-width: none;
position: relative;
- display: -webkit-box;
- display: -webkit-flex;
- display: -ms-flexbox;
display: flex;
- -webkit-flex-direction: column;
- -ms-flex-direction: column;
flex-direction: column;
- -webkit-align-items: center;
- -webkit-box-align: center;
- -ms-flex-align: center;
align-items: center;
}
+.c1:hover button[data-play-pause],
+.c1:focus-within button[data-play-pause] {
+ opacity: 0.8;
+ transition-delay: 0s;
+}
+
.c2 {
width: 100%;
height: 100%;
@@ -1032,9 +859,6 @@ exports[`renders "Text Banner" Hero Banner correctly 2`] = `
height: 100%;
left: 0;
right: 0;
- display: -webkit-box;
- display: -webkit-flex;
- display: -ms-flexbox;
display: flex;
width: calc(100% - (2 * 1rem));
margin: -2rem 1rem 0;
@@ -1052,13 +876,7 @@ exports[`renders "Text Banner" Hero Banner correctly 2`] = `
.c6 {
width: 100%;
height: 100%;
- display: -webkit-box;
- display: -webkit-flex;
- display: -ms-flexbox;
display: flex;
- -webkit-align-items: center;
- -webkit-box-align: center;
- -ms-flex-align: center;
align-items: center;
border-radius: 1rem;
}
@@ -1083,45 +901,42 @@ exports[`renders "Text Banner" Hero Banner correctly 2`] = `
object-position: top right;
}
-@media (min-width:740px) {
+@media (min-width: 740px) {
.c8 {
font-size: 2.5rem;
line-height: 2.5rem;
}
}
-@media (min-width:1024px) {
+@media (min-width: 1024px) {
.c8 {
font-size: 3rem;
line-height: 3rem;
}
}
-@media (min-width:740px) {
+@media (min-width: 740px) {
.c9 {
font-size: 1rem;
line-height: 1.25rem;
}
}
-@media (min-width:1024px) {
+@media (min-width: 1024px) {
.c9 {
font-size: 1.125rem;
line-height: 1.375rem;
}
}
-@media (min-width:1024px) {
+@media (min-width: 1024px) {
.c0 {
padding: 2rem 2rem 2rem;
- -webkit-align-items: center;
- -webkit-box-align: center;
- -ms-flex-align: center;
align-items: center;
}
}
-@media (min-width:1024px) {
+@media (min-width: 1024px) {
.c1 {
width: 100%;
max-width: 1500px;
@@ -1132,16 +947,9 @@ exports[`renders "Text Banner" Hero Banner correctly 2`] = `
min-height: 600px;
max-height: 750px;
}
-
- .c1:hover button[data-play-pause],
- .c1:focus-within button[data-play-pause] {
- opacity: 0.8;
- -webkit-transition-delay: 0s;
- transition-delay: 0s;
- }
}
-@media (min-width:1024px) {
+@media (min-width: 1024px) {
.c2 {
position: absolute;
top: 0;
@@ -1151,29 +959,23 @@ exports[`renders "Text Banner" Hero Banner correctly 2`] = `
.c2 img {
object-position: top center;
height: 100%;
- -webkit-transform: scale(1.02);
- -ms-transform: scale(1.02);
transform: scale(1.02);
- -webkit-transition: -webkit-transform 0.4s cubic-bezier(0.68,-1.15,0.265,2.35);
- -webkit-transition: transform 0.4s cubic-bezier(0.68,-1.15,0.265,2.35);
transition: transform 0.4s cubic-bezier(0.68,-1.15,0.265,2.35);
}
- .c2:has(+ div a:hover) > div > img {
- -webkit-transform: scale(1.04);
- -ms-transform: scale(1.04);
+ .c2:has(+ div a:hover) >div>img {
transform: scale(1.04);
}
}
-@media (min-width:740px) {
+@media (min-width: 740px) {
.c5 {
margin: -2rem 2rem 0rem;
width: calc(100% - (2 * 2rem));
}
}
-@media (min-width:1024px) {
+@media (min-width: 1024px) {
.c5 {
position: relative;
top: auto;
@@ -1181,18 +983,9 @@ exports[`renders "Text Banner" Hero Banner correctly 2`] = `
height: 100%;
width: 100%;
max-width: 1200px;
- display: -webkit-box;
- display: -webkit-flex;
- display: -ms-flexbox;
display: flex;
- -webkit-align-items: center;
- -webkit-box-align: center;
- -ms-flex-align: center;
align-items: center;
margin: 0 auto;
- -webkit-box-pack: start;
- -webkit-justify-content: flex-start;
- -ms-flex-pack: start;
justify-content: flex-start;
height: 75vh;
min-height: 600px;
@@ -1200,31 +993,28 @@ exports[`renders "Text Banner" Hero Banner correctly 2`] = `
}
}
-@media (min-width:1024px) {
+@media (min-width: 1024px) {
.c7 {
padding: 2rem;
}
}
-@media (min-width:1024px) {
+@media (min-width: 1024px) {
.c7 {
width: 92%;
}
}
-@media (min-width:1024px) {
+@media (min-width: 1024px) {
.c6 {
height: auto;
width: 50%;
margin: 2rem 0;
- -webkit-box-pack: end;
- -webkit-justify-content: flex-end;
- -ms-flex-pack: end;
justify-content: flex-end;
}
}
-@media (min-width:1024px) {
+@media (min-width: 1024px) {
.c10 {
margin: 1.5rem;
width: 160px;
@@ -1233,10 +1023,6 @@ exports[`renders "Text Banner" Hero Banner correctly 2`] = `
}
}
-@media (min-width:1024px) {
-
-}
-
@@ -1292,13 +1076,11 @@ exports[`renders "Text Banner" Hero Banner correctly 2`] = `
>
+ Type a city name (min 2 chars) and click Search or press Enter. Try “lon”, “man”, or “xyz” to see no results. +
++ Selected: {selected.name}, {selected.country} +
+ )} + ++ This example's lookup handler always throws — showing how errors surface to the user. +
++ Try searching for “xyz” to see the custom no-results message. +
+
-
+
@@ -354,9 +310,6 @@ exports[`renders Promo correctly end position 1`] = `
font-family: 'Anton',Impact,sans-serif;
font-weight: 400;
text-transform: uppercase;
- -webkit-letter-spacing: 0;
- -moz-letter-spacing: 0;
- -ms-letter-spacing: 0;
letter-spacing: 0;
font-size: 2rem;
line-height: 2rem;
@@ -382,9 +335,6 @@ exports[`renders Promo correctly end position 1`] = `
font-family: 'Montserrat',Helvetica,Arial,sans-serif;
font-weight: 400;
text-transform: inherit;
- -webkit-letter-spacing: 0;
- -moz-letter-spacing: 0;
- -ms-letter-spacing: 0;
letter-spacing: 0;
font-size: 1rem;
line-height: 1.25rem;
@@ -401,39 +351,14 @@ exports[`renders Promo correctly end position 1`] = `
line-height: inherit;
}
-.c2 {
- display: block;
- width: 100%;
- height: 100%;
- position: relative;
-}
-
-.c3 {
- width: 100%;
- height: 100%;
- display: block;
- object-fit: cover;
-}
-
.c9 {
- display: -webkit-inline-box;
- display: -webkit-inline-flex;
- display: -ms-inline-flexbox;
display: inline-flex;
position: relative;
- -webkit-text-decoration: none;
text-decoration: none;
- -webkit-transition: all 0.2s;
transition: all 0.2s;
height: 2.5rem;
width: 100%;
- -webkit-box-pack: center;
- -webkit-justify-content: center;
- -ms-flex-pack: center;
justify-content: center;
- -webkit-align-items: center;
- -webkit-box-align: center;
- -ms-flex-align: center;
align-items: center;
border: none;
cursor: pointer;
@@ -444,9 +369,6 @@ exports[`renders Promo correctly end position 1`] = `
font-family: 'Montserrat',Helvetica,Arial,sans-serif;
font-weight: 700;
text-transform: inherit;
- -webkit-letter-spacing: 0;
- -moz-letter-spacing: 0;
- -ms-letter-spacing: 0;
letter-spacing: 0;
font-size: 1rem;
line-height: 1.25rem;
@@ -465,19 +387,27 @@ exports[`renders Promo correctly end position 1`] = `
opacity: 0.5;
}
+.c2 {
+ display: block;
+ width: 100%;
+ height: 100%;
+ position: relative;
+}
+
+.c3 {
+ width: 100%;
+ height: 100%;
+ display: block;
+ object-fit: cover;
+}
+
.c0 {
width: 100%;
- display: -webkit-box;
- display: -webkit-flex;
- display: -ms-flexbox;
display: flex;
position: relative;
- -webkit-flex-direction: column;
- -ms-flex-direction: column;
flex-direction: column;
overflow: hidden;
background: #274084;
- -webkit-clip-path: polygon(0 0,100% 0,100% 90%,0 101%);
clip-path: polygon(0 0,100% 0,100% 90%,0 101%);
border-radius: 0 0 0 2rem;
}
@@ -489,18 +419,9 @@ exports[`renders Promo correctly end position 1`] = `
left: 0;
right: 0;
margin: 0 auto;
- display: -webkit-box;
- display: -webkit-flex;
- display: -ms-flexbox;
display: flex;
- -webkit-align-items: center;
- -webkit-box-align: center;
- -ms-flex-align: center;
align-items: center;
position: relative;
- -webkit-box-pack: end;
- -webkit-justify-content: flex-end;
- -ms-flex-pack: end;
justify-content: flex-end;
}
@@ -522,31 +443,25 @@ exports[`renders Promo correctly end position 1`] = `
.c5 {
width: 100%;
height: 100%;
- display: -webkit-box;
- display: -webkit-flex;
- display: -ms-flexbox;
display: flex;
- -webkit-align-items: center;
- -webkit-box-align: center;
- -ms-flex-align: center;
align-items: center;
}
-@media (min-width:740px) {
+@media (min-width: 740px) {
.c7 {
font-size: 2.5rem;
line-height: 2.5rem;
}
}
-@media (min-width:1024px) {
+@media (min-width: 1024px) {
.c7 {
font-size: 3rem;
line-height: 3rem;
}
}
-@media (min-width:740px) {
+@media (min-width: 740px) {
.c7 {
font-size: 4rem;
line-height: 4rem;
@@ -554,7 +469,7 @@ exports[`renders Promo correctly end position 1`] = `
}
}
-@media (min-width:1024px) {
+@media (min-width: 1024px) {
.c7 {
font-size: 5rem;
line-height: 5rem;
@@ -562,83 +477,80 @@ exports[`renders Promo correctly end position 1`] = `
}
}
-@media (min-width:740px) {
+@media (min-width: 740px) {
.c8 {
font-size: 1rem;
line-height: 1.25rem;
}
}
-@media (min-width:1024px) {
+@media (min-width: 1024px) {
.c8 {
font-size: 1.125rem;
line-height: 1.375rem;
}
}
-@media (min-width:740px) {
+@media (min-width: 740px) {
.c9 {
font-size: 1rem;
line-height: 1.25rem;
}
}
-@media (min-width:1024px) {
+@media (min-width: 1024px) {
.c9 {
font-size: 1.125rem;
line-height: 1.375rem;
}
}
-@media (min-width:740px) {
+@media (min-width: 740px) {
.c9 {
width: auto;
}
}
-@media (min-width:1024px) {
+@media (min-width: 1024px) {
.c9 {
width: auto;
}
}
-@media (min-width:1024px) {
+@media (min-width: 1024px) {
.c0 {
- -webkit-flex-direction: row;
- -ms-flex-direction: row;
flex-direction: row;
}
}
-@media (min-width:1024px) {
+@media (min-width: 1024px) {
.c0 {
- -webkit-clip-path: polygon(0 0,100% 0,100% 85%,0% 101%);
clip-path: polygon(0 0,100% 0,100% 85%,0% 101%);
border-radius: 0 0 0 4rem;
}
}
-@media (min-width:1024px) {
+@media (min-width: 1024px) {
.c4 {
min-height: calc(100vh - 90px);
}
}
-@media (min-width:1024px) {
+@media (min-width: 1024px) {
.c6 {
width: 100%;
padding: 8rem 1.5rem;
}
}
-@media (min-width:1024px) {
+@media (min-width: 1024px) {
.c1 {
height: 100%;
position: absolute;
}
}
-@media (min-width:1024px) {
+@media (min-width: 1024px) {
.c5 {
width: 50%;
position: absolute;
@@ -657,18 +569,16 @@ exports[`renders Promo correctly end position 1`] = `
>
diff --git a/src/components/Molecules/QuoteSlice/QuoteSlice.js b/src/components/Molecules/QuoteSlice/QuoteSlice.js
index 1fe47ce1e..8a837222a 100644
--- a/src/components/Molecules/QuoteSlice/QuoteSlice.js
+++ b/src/components/Molecules/QuoteSlice/QuoteSlice.js
@@ -62,10 +62,10 @@ const QuoteSlice = ({
return (
Longer heading text should automatically use a smaller font size for a better fit.
+Sorry, there appears to be a problem. Please enter the school's details manually.
; + } + + return ( ++ Share with: +
+- Share with: -
-Renders null when no nodes are provided.
+ The animation is scroll-triggered via IntersectionObserver in production. + Click Replay to remount and re-run it here. +
+
+ Hello! Comic Relief uses cookies to help make this website better and improve our services. You can learn more about
+
-
- Hello! Comic Relief uses cookies to help make this website better and improve our services. You can learn more about
-
- our use of cookies
-
- . We also use optional cookies for marketing purposes:
-
-
- Accept
-
- Or click
-
- here
-
- to deny these.
-
+ + Accept + + Or click + + here + + to deny these. +
+
Image banner (widget right), custom padding + background
+ Image banner (widget left), monthly title/subtitle + amount text overrides, hidden moneybuys
+ Text-only widget (no image), custom widget background + text colour, hidden moneybuys
+ Text-only widget (no image), with the usual moneybuys, standard colours
+ Text-only widget (no image), with giving selector (single vs monthly)
+ Different "Other amount" copy for single vs monthly
+ Image banner with Ambient Video (looping)
+ Image banner with Ambient Video (no loop)
+
By agreeing to subscribe to our emails and clicking the button to sign up, you are consenting to the terms of our Privacy Policy. You can unsubscribe at any time.
", } } /> @@ -744,7 +624,6 @@ exports[`Image banner left orientation renders correctly 1`] = ` >By agreeing to subscribe to our emails and clicking the button to sign up, you are consenting to the terms of our Privacy Policy. You can unsubscribe at any time.
", } } /> @@ -1507,7 +1266,6 @@ exports[`Image banner renders correctly 1`] = ` >By agreeing to subscribe to our emails and clicking the button to sign up, you are consenting to the terms of our Privacy Policy. You can unsubscribe at any time.
", } } /> @@ -2270,7 +1908,6 @@ exports[`Text-only email widget renders correctly 1`] = ` >By agreeing to subscribe to our emails and clicking the button to sign up, you are consenting to the terms of our Privacy Policy. You can unsubscribe at any time.
", } } /> @@ -3033,7 +2550,6 @@ exports[`Text-only email widget with copyColor renders correctly 1`] = ` >Get regular email updates and info on what we're up to!
" /> ); const privacyCopy = ( diff --git a/src/components/Organisms/EmailSignUp/_EmailSignUp.js b/src/components/Organisms/EmailSignUp/_EmailSignUp.js index bedb5d3e9..1493ab9ab 100644 --- a/src/components/Organisms/EmailSignUp/_EmailSignUp.js +++ b/src/components/Organisms/EmailSignUp/_EmailSignUp.js @@ -47,9 +47,9 @@ const EmailSignUp = ({ return (Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
", } } @@ -422,7 +343,7 @@ exports[`renders correctly 1`] = ` -Standard footer
- - -Overrides allowList functionality for external usage
- - -Adding an additionalLegalLine to the top of the footer, add FR logo
- -> -``` diff --git a/src/components/Organisms/Footer/Footer.style.js b/src/components/Organisms/Footer/Footer.style.js index b9e809603..367b21ea3 100644 --- a/src/components/Organisms/Footer/Footer.style.js +++ b/src/components/Organisms/Footer/Footer.style.js @@ -77,7 +77,7 @@ const FooterCopyright = styled.div` const Brand = styled(Link)` color: transparent; border: 0; - :hover { + &:hover { border: 0; } `; diff --git a/src/components/Organisms/Footer/FooterExample.jsx b/src/components/Organisms/Footer/FooterExample.jsx new file mode 100644 index 000000000..ce0825542 --- /dev/null +++ b/src/components/Organisms/Footer/FooterExample.jsx @@ -0,0 +1,42 @@ +import React from 'react'; +import Footer from './Footer'; +import data from './data/data'; +import footerCopy from './data/footerCopy'; + +export function FooterExample1() { + return ( + <> +
diff --git a/src/components/Molecules/InfoBanner/InfoBanner.md b/src/components/Molecules/InfoBanner/InfoBanner.md
deleted file mode 100644
index bd19fcabf..000000000
--- a/src/components/Molecules/InfoBanner/InfoBanner.md
+++ /dev/null
@@ -1,21 +0,0 @@
-Info Banner Example:
-
-```js
-const title = 'Hello There';
-const amount = '£ 2,000,000';
-const theme = 'Be happy';
-const themeLink = 'cr.com';
-const startDate = '1st June 2010';
-const endDate = '1st June 2020';
-const country = 'Uk';
-
-