@comicrelief/component-library 8.80.0 → 8.82.0

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@comicrelief/component-library",
3
3
  "author": "Comic Relief Engineering Team",
4
- "version": "8.80.0",
4
+ "version": "8.82.0",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.es.js",
7
7
  "files": [
@@ -0,0 +1,72 @@
1
+ import React, { useCallback } from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import Arrow from '../../Atoms/Icons/Arrow';
4
+ import {
5
+ Grid,
6
+ ButtonCard,
7
+ CardTopWrapper,
8
+ ArrowWrapper,
9
+ HeadingContentWrapper,
10
+ HeadingIconWrapper,
11
+ CardHeading,
12
+ CardBlurb
13
+ } from './ExpandedButton.style';
14
+
15
+ function ExpandedButton({ options = [], selectedId, onSelect }) {
16
+ const handleClick = useCallback(id => {
17
+ if (onSelect) {
18
+ onSelect(id);
19
+ }
20
+ }, [onSelect]);
21
+
22
+ return (
23
+ <>
24
+ <Grid data-testid="expanded-button-grid">
25
+ {options.map(option => (
26
+ <ButtonCard
27
+ key={option.id}
28
+ onClick={() => handleClick(option.id)}
29
+ $isSelected={selectedId === option.id}
30
+ data-test={`expanded-button-${option.id}`}
31
+ >
32
+
33
+ <CardTopWrapper data-testid="expanded-button-card-top-wrapper">
34
+
35
+ <HeadingContentWrapper data-testid="expanded-button-heading-content-wrapper">
36
+ {option.icon && (
37
+ <HeadingIconWrapper data-testid="expanded-button-heading-icon-wrapper">
38
+ <img src={option.icon} alt="" data-testid="expanded-button-heading-icon-img" />
39
+ </HeadingIconWrapper>
40
+ )}
41
+ <CardHeading data-testid="expanded-button-card-heading">{option.title}</CardHeading>
42
+ </HeadingContentWrapper>
43
+
44
+ <ArrowWrapper data-testid="expanded-button-arrow-wrapper">
45
+ <Arrow colour="black" data-testid="expanded-button-arrow" />
46
+ </ArrowWrapper>
47
+
48
+ </CardTopWrapper>
49
+
50
+ <CardBlurb data-testid="expanded-button-card-blurb">{option.description}</CardBlurb>
51
+
52
+ </ButtonCard>
53
+ ))}
54
+ </Grid>
55
+ </>
56
+ );
57
+ }
58
+
59
+ ExpandedButton.propTypes = {
60
+ options: PropTypes.arrayOf(
61
+ PropTypes.shape({
62
+ id: PropTypes.string.isRequired,
63
+ title: PropTypes.string.isRequired,
64
+ description: PropTypes.string.isRequired,
65
+ icon: PropTypes.string
66
+ })
67
+ ),
68
+ selectedId: PropTypes.string,
69
+ onSelect: PropTypes.func
70
+ };
71
+
72
+ export default ExpandedButton;
@@ -0,0 +1,106 @@
1
+ import styled from 'styled-components';
2
+ import crTheme from '../../../theme/crTheme/theme';
3
+ import Text from '../../Atoms/Text/Text';
4
+
5
+ const Grid = styled.div`
6
+ display: flex;
7
+ width: 100%;
8
+ margin: 0 auto;
9
+ flex-direction: column;
10
+ gap: 0.5rem;
11
+ @media ${crTheme.allBreakpoints('M')} {
12
+ gap: 1rem;
13
+ }
14
+ `;
15
+
16
+ const ButtonCard = styled.button`
17
+ display: flex;
18
+ flex-direction: column;
19
+ padding: 1rem;
20
+ background: ${crTheme.color('white')};
21
+ border: 1px solid ${crTheme.color('grey')};
22
+ border-radius: 8px;
23
+ cursor: pointer;
24
+ flex: 1;
25
+ text-align: left;
26
+ transition: all linear 0.2s;
27
+ width: 100%;
28
+
29
+ &:hover {
30
+ background-color: ${crTheme.color('grey_medium')};
31
+ }
32
+
33
+ @media ${crTheme.allBreakpoints('M')} {
34
+ padding: 1rem;
35
+ }
36
+ `;
37
+
38
+ const CardTopWrapper = styled.div`
39
+ margin: 0 0 8px 0;
40
+ display: flex;
41
+ flex-direction: row;
42
+ align-items: flex-start;
43
+ justify-content: space-between;
44
+ gap: 0.5rem;
45
+ `;
46
+
47
+ const HeadingContentWrapper = styled.div`
48
+ display: flex;
49
+ align-items: flex-start;
50
+ `;
51
+
52
+ const HeadingIconWrapper = styled.span`
53
+ margin-right: 0.5rem;
54
+ display: inline-flex;
55
+ align-items: center;
56
+ justify-content: center;
57
+
58
+ svg {
59
+ width: auto;
60
+ height: auto;
61
+ }
62
+ `;
63
+
64
+ const CardHeading = styled.h3`
65
+ font-family: 'Montserrat', sans-serif;
66
+ font-weight: 700;
67
+ line-height: 20px;
68
+ color: ${crTheme.color('black')};
69
+ font-size: 14px;
70
+ @media ${crTheme.allBreakpoints('M')} {
71
+ font-size: 16px;
72
+ }
73
+ `;
74
+
75
+ const ArrowWrapper = styled.div`
76
+ display: flex;
77
+ align-items: center;
78
+ justify-content: center;
79
+ width: 18px;
80
+ height: 18px;
81
+ transform: rotate(45deg);
82
+ flex-shrink: 0;
83
+
84
+ svg {
85
+ width: auto;
86
+ height: auto;
87
+ }
88
+ `;
89
+
90
+ const CardBlurb = styled(Text)`
91
+ font-size: 14px;
92
+ @media ${crTheme.allBreakpoints('M')} {
93
+ font-size: 16px;
94
+ }
95
+ `;
96
+
97
+ export {
98
+ Grid,
99
+ ButtonCard,
100
+ CardTopWrapper,
101
+ ArrowWrapper,
102
+ HeadingContentWrapper,
103
+ HeadingIconWrapper,
104
+ CardHeading,
105
+ CardBlurb
106
+ };
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ import 'jest-styled-components';
3
+ import renderWithTheme from '../../../../tests/hoc/shallowWithTheme';
4
+ import ExpandedButton from './ExpandedButton';
5
+
6
+ const options = [
7
+ {
8
+ id: 'option-one',
9
+ title: 'Option one',
10
+ description: 'The first option description',
11
+ icon: 'https://example.com/icon.svg'
12
+ },
13
+ {
14
+ id: 'option-two',
15
+ title: 'Option two',
16
+ description: 'The second option description'
17
+ }
18
+ ];
19
+
20
+ it('renders correctly', () => {
21
+ const tree = renderWithTheme(
22
+ <ExpandedButton options={options} selectedId="option-one" onSelect={() => {}} />
23
+ ).toJSON();
24
+
25
+ expect(tree).toMatchSnapshot();
26
+ });
@@ -0,0 +1,64 @@
1
+ import React, { useState, useEffect } from 'react';
2
+ import ExpandedButton from './ExpandedButton';
3
+ import CalendarIcon from '../../../data/expanded-button-icons/calendar.svg';
4
+ import HeartHandIcon from '../../../data/expanded-button-icons/heart-hand.svg';
5
+ import CupcakeIcon from '../../../data/expanded-button-icons/cupcake.svg';
6
+ import styled from 'styled-components';
7
+
8
+ const ExpandedButtonExampleWrapper = styled.div`
9
+ margin-bottom: 50px;
10
+ `;
11
+
12
+ export default function ExpandedButtonExample() {
13
+ const [selectedId, setSelectedId] = useState('monthly');
14
+
15
+ useEffect(() => {
16
+ console.log('Selected option:', selectedId);
17
+ }, [selectedId]);
18
+
19
+ const baseOptions = [
20
+ {
21
+ id: 'monthly',
22
+ title: 'Set up a regular gift',
23
+ description: 'Your monthly gift could make a lasting impact where it matters most.'
24
+ },
25
+ {
26
+ id: 'single',
27
+ title: 'Make a one off donation',
28
+ description: 'Help fund life-changing projects in the UK and around the world.'
29
+ },
30
+ {
31
+ id: 'payin',
32
+ title: 'Pay in your fundraising money',
33
+ description: 'You\'re amazing and we thank you! Let\'s start paying in all of your fantastic work!'
34
+ }
35
+ ];
36
+
37
+ const icons = [CalendarIcon, HeartHandIcon, CupcakeIcon];
38
+
39
+ const optionsWithIcons = baseOptions.map((option, index) => ({
40
+ ...option,
41
+ icon: icons[index]
42
+ }));
43
+
44
+ return (
45
+ <>
46
+ <ExpandedButtonExampleWrapper data-testid="expanded-button-example-wrapper">
47
+ <h3>Expanded Button with icons</h3>
48
+ <ExpandedButton
49
+ options={optionsWithIcons}
50
+ selectedId={selectedId}
51
+ onSelect={setSelectedId}
52
+ />
53
+ </ExpandedButtonExampleWrapper>
54
+ <ExpandedButtonExampleWrapper data-testid="expanded-button-example-wrapper">
55
+ <h3>Expanded Button without icons</h3>
56
+ <ExpandedButton
57
+ options={baseOptions}
58
+ selectedId={selectedId}
59
+ onSelect={setSelectedId}
60
+ />
61
+ </ExpandedButtonExampleWrapper>
62
+ </>
63
+ );
64
+ }
@@ -0,0 +1,251 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`renders correctly 1`] = `
4
+ .c7 {
5
+ transform: rotate(-90deg);
6
+ fill: #000000;
7
+ }
8
+
9
+ .c8 {
10
+ font-family: 'Montserrat',Helvetica,Arial,sans-serif;
11
+ font-weight: 400;
12
+ text-transform: inherit;
13
+ letter-spacing: 0;
14
+ font-size: 1rem;
15
+ line-height: 1.25rem;
16
+ }
17
+
18
+ .c8 span {
19
+ font-size: inherit;
20
+ line-height: inherit;
21
+ }
22
+
23
+ .c0 {
24
+ display: flex;
25
+ width: 100%;
26
+ margin: 0 auto;
27
+ flex-direction: column;
28
+ gap: 0.5rem;
29
+ }
30
+
31
+ .c1 {
32
+ display: flex;
33
+ flex-direction: column;
34
+ padding: 1rem;
35
+ background: #FFFFFF;
36
+ border: 1px solid #969598;
37
+ border-radius: 8px;
38
+ cursor: pointer;
39
+ flex: 1;
40
+ text-align: left;
41
+ transition: all linear 0.2s;
42
+ width: 100%;
43
+ }
44
+
45
+ .c1:hover {
46
+ background-color: #E1E2E3;
47
+ }
48
+
49
+ .c2 {
50
+ margin: 0 0 8px 0;
51
+ display: flex;
52
+ flex-direction: row;
53
+ align-items: flex-start;
54
+ justify-content: space-between;
55
+ gap: 0.5rem;
56
+ }
57
+
58
+ .c3 {
59
+ display: flex;
60
+ align-items: flex-start;
61
+ }
62
+
63
+ .c4 {
64
+ margin-right: 0.5rem;
65
+ display: inline-flex;
66
+ align-items: center;
67
+ justify-content: center;
68
+ }
69
+
70
+ .c4 svg {
71
+ width: auto;
72
+ height: auto;
73
+ }
74
+
75
+ .c5 {
76
+ font-family: 'Montserrat',sans-serif;
77
+ font-weight: 700;
78
+ line-height: 20px;
79
+ color: #000000;
80
+ font-size: 14px;
81
+ }
82
+
83
+ .c6 {
84
+ display: flex;
85
+ align-items: center;
86
+ justify-content: center;
87
+ width: 18px;
88
+ height: 18px;
89
+ transform: rotate(45deg);
90
+ flex-shrink: 0;
91
+ }
92
+
93
+ .c6 svg {
94
+ width: auto;
95
+ height: auto;
96
+ }
97
+
98
+ .c9 {
99
+ font-size: 14px;
100
+ }
101
+
102
+ @media (min-width: 1024px) {
103
+ .c7 {
104
+ fill: #000000;
105
+ }
106
+ }
107
+
108
+ @media (min-width: 740px) {
109
+ .c8 {
110
+ font-size: 1rem;
111
+ line-height: 1.25rem;
112
+ }
113
+ }
114
+
115
+ @media (min-width: 1024px) {
116
+ .c8 {
117
+ font-size: 1.125rem;
118
+ line-height: 1.375rem;
119
+ }
120
+ }
121
+
122
+ @media (min-width: 740px) {
123
+ .c0 {
124
+ gap: 1rem;
125
+ }
126
+ }
127
+
128
+ @media (min-width: 740px) {
129
+ .c1 {
130
+ padding: 1rem;
131
+ }
132
+ }
133
+
134
+ @media (min-width: 740px) {
135
+ .c5 {
136
+ font-size: 16px;
137
+ }
138
+ }
139
+
140
+ @media (min-width: 740px) {
141
+ .c9 {
142
+ font-size: 16px;
143
+ }
144
+ }
145
+
146
+ <div
147
+ className="c0"
148
+ data-testid="expanded-button-grid"
149
+ >
150
+ <button
151
+ className="c1"
152
+ data-test="expanded-button-option-one"
153
+ onClick={[Function]}
154
+ >
155
+ <div
156
+ className="c2"
157
+ data-testid="expanded-button-card-top-wrapper"
158
+ >
159
+ <div
160
+ className="c3"
161
+ data-testid="expanded-button-heading-content-wrapper"
162
+ >
163
+ <span
164
+ className="c4"
165
+ data-testid="expanded-button-heading-icon-wrapper"
166
+ >
167
+ <img
168
+ alt=""
169
+ data-testid="expanded-button-heading-icon-img"
170
+ src="https://example.com/icon.svg"
171
+ />
172
+ </span>
173
+ <h3
174
+ className="c5"
175
+ data-testid="expanded-button-card-heading"
176
+ >
177
+ Option one
178
+ </h3>
179
+ </div>
180
+ <div
181
+ className="c6"
182
+ data-testid="expanded-button-arrow-wrapper"
183
+ >
184
+ <svg
185
+ className="c7"
186
+ data-testid="expanded-button-arrow"
187
+ height={24}
188
+ viewBox="0 0 15 15"
189
+ width={24}
190
+ xmlns="http://www.w3.org/2000/svg"
191
+ >
192
+ <path
193
+ d="M9.58496 1.3501C9.1395 0.88346 8.40641 0.883488 7.96094 1.3501C7.52803 1.80361 7.5281 2.53033 7.96094 2.98389L11.1582 6.3335H1.13672C0.48748 6.3335 0 6.87834 0 7.50049C2.15408e-05 8.12262 0.487494 8.66748 1.13672 8.66748H11.1582L7.96094 12.0171C7.52806 12.4706 7.52899 13.1974 7.96191 13.6509C8.18163 13.8804 8.47556 14.0005 8.77344 14.0005C9.07114 14.0004 9.36533 13.8809 9.58496 13.6509L14.6758 8.31689L14.6748 8.31592L14.6875 8.30322L14.6865 8.30225C14.6954 8.29227 14.7044 8.28494 14.71 8.27783C14.7117 8.27557 14.7133 8.27298 14.7148 8.271C14.7485 8.23215 14.7824 8.18937 14.8135 8.14111L14.8154 8.13818C14.8354 8.1067 14.8493 8.07854 14.8564 8.06396L14.8652 8.04639L14.8662 8.04443L14.8672 8.04346C14.8672 8.04346 14.868 8.0407 14.8691 8.03857C14.8709 8.03524 14.8758 8.02683 14.8799 8.01904L14.8802 8.01851C14.8888 8.00212 14.9034 7.97435 14.917 7.93994V7.93799C14.9303 7.90387 14.9391 7.87297 14.9443 7.854C14.9469 7.8447 14.9498 7.83579 14.9512 7.83057C14.9527 7.82466 14.9535 7.82292 14.9541 7.8208C14.9541 7.8208 14.9542 7.81765 14.9551 7.81494L14.958 7.80615L14.9586 7.80434C14.9631 7.78973 14.9718 7.76131 14.9785 7.72705V7.7251C15.0066 7.57717 15.0066 7.42472 14.9785 7.27686V7.2749L14.958 7.1958L14.9551 7.18604L14.9531 7.18018L14.9512 7.17236C14.9497 7.16652 14.9481 7.15689 14.9453 7.14697C14.9398 7.12707 14.9307 7.09666 14.917 7.06201C14.9032 7.027 14.8885 6.99825 14.8799 6.98193C14.8758 6.97415 14.8709 6.96574 14.8691 6.9624L14.8564 6.93701C14.849 6.92189 14.8351 6.89384 14.8154 6.86279L14.8145 6.86084L14.7529 6.77393C14.7316 6.74671 14.7094 6.72141 14.6875 6.69775C14.6837 6.69353 14.6802 6.68867 14.6758 6.68408L9.58496 1.3501Z"
194
+ />
195
+ </svg>
196
+ </div>
197
+ </div>
198
+ <span
199
+ className="c8 c9"
200
+ data-testid="expanded-button-card-blurb"
201
+ >
202
+ The first option description
203
+ </span>
204
+ </button>
205
+ <button
206
+ className="c1"
207
+ data-test="expanded-button-option-two"
208
+ onClick={[Function]}
209
+ >
210
+ <div
211
+ className="c2"
212
+ data-testid="expanded-button-card-top-wrapper"
213
+ >
214
+ <div
215
+ className="c3"
216
+ data-testid="expanded-button-heading-content-wrapper"
217
+ >
218
+ <h3
219
+ className="c5"
220
+ data-testid="expanded-button-card-heading"
221
+ >
222
+ Option two
223
+ </h3>
224
+ </div>
225
+ <div
226
+ className="c6"
227
+ data-testid="expanded-button-arrow-wrapper"
228
+ >
229
+ <svg
230
+ className="c7"
231
+ data-testid="expanded-button-arrow"
232
+ height={24}
233
+ viewBox="0 0 15 15"
234
+ width={24}
235
+ xmlns="http://www.w3.org/2000/svg"
236
+ >
237
+ <path
238
+ d="M9.58496 1.3501C9.1395 0.88346 8.40641 0.883488 7.96094 1.3501C7.52803 1.80361 7.5281 2.53033 7.96094 2.98389L11.1582 6.3335H1.13672C0.48748 6.3335 0 6.87834 0 7.50049C2.15408e-05 8.12262 0.487494 8.66748 1.13672 8.66748H11.1582L7.96094 12.0171C7.52806 12.4706 7.52899 13.1974 7.96191 13.6509C8.18163 13.8804 8.47556 14.0005 8.77344 14.0005C9.07114 14.0004 9.36533 13.8809 9.58496 13.6509L14.6758 8.31689L14.6748 8.31592L14.6875 8.30322L14.6865 8.30225C14.6954 8.29227 14.7044 8.28494 14.71 8.27783C14.7117 8.27557 14.7133 8.27298 14.7148 8.271C14.7485 8.23215 14.7824 8.18937 14.8135 8.14111L14.8154 8.13818C14.8354 8.1067 14.8493 8.07854 14.8564 8.06396L14.8652 8.04639L14.8662 8.04443L14.8672 8.04346C14.8672 8.04346 14.868 8.0407 14.8691 8.03857C14.8709 8.03524 14.8758 8.02683 14.8799 8.01904L14.8802 8.01851C14.8888 8.00212 14.9034 7.97435 14.917 7.93994V7.93799C14.9303 7.90387 14.9391 7.87297 14.9443 7.854C14.9469 7.8447 14.9498 7.83579 14.9512 7.83057C14.9527 7.82466 14.9535 7.82292 14.9541 7.8208C14.9541 7.8208 14.9542 7.81765 14.9551 7.81494L14.958 7.80615L14.9586 7.80434C14.9631 7.78973 14.9718 7.76131 14.9785 7.72705V7.7251C15.0066 7.57717 15.0066 7.42472 14.9785 7.27686V7.2749L14.958 7.1958L14.9551 7.18604L14.9531 7.18018L14.9512 7.17236C14.9497 7.16652 14.9481 7.15689 14.9453 7.14697C14.9398 7.12707 14.9307 7.09666 14.917 7.06201C14.9032 7.027 14.8885 6.99825 14.8799 6.98193C14.8758 6.97415 14.8709 6.96574 14.8691 6.9624L14.8564 6.93701C14.849 6.92189 14.8351 6.89384 14.8154 6.86279L14.8145 6.86084L14.7529 6.77393C14.7316 6.74671 14.7094 6.72141 14.6875 6.69775C14.6837 6.69353 14.6802 6.68867 14.6758 6.68408L9.58496 1.3501Z"
239
+ />
240
+ </svg>
241
+ </div>
242
+ </div>
243
+ <span
244
+ className="c8 c9"
245
+ data-testid="expanded-button-card-blurb"
246
+ >
247
+ The second option description
248
+ </span>
249
+ </button>
250
+ </div>
251
+ `;
@@ -0,0 +1,5 @@
1
+ <svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M9.24023 16.6191C9.36949 16.6191 9.49551 16.6712 9.58691 16.7627C9.6783 16.8541 9.73047 16.9801 9.73047 17.1094C9.73047 17.2387 9.67832 17.3647 9.58691 17.4561C9.49553 17.5475 9.36951 17.5996 9.24023 17.5996C9.11093 17.5996 8.98492 17.5474 8.89355 17.4561C8.80215 17.3647 8.75 17.2387 8.75 17.1094C8.75 16.9801 8.80217 16.8541 8.89355 16.7627C8.98496 16.6712 9.11097 16.6191 9.24023 16.6191Z" fill="#E52630"/>
3
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M9.24023 9.33691C9.42688 9.33701 9.59706 9.44299 9.67969 9.61035L10.3838 11.0352L11.957 11.2646C12.1417 11.2916 12.2949 11.4211 12.3525 11.5986C12.4101 11.7761 12.3622 11.9713 12.2285 12.1016L11.0898 13.21L11.3594 14.7773C11.391 14.9614 11.3152 15.1481 11.1641 15.2578C11.0786 15.3199 10.9767 15.3516 10.875 15.3516C10.7971 15.3515 10.719 15.3325 10.6475 15.2949L9.23926 14.5537L7.83301 15.2949C7.66786 15.3817 7.46747 15.3674 7.31641 15.2578C7.16529 15.1481 7.0895 14.9614 7.12109 14.7773L7.38965 13.21L6.25098 12.1016C6.11723 11.9712 6.06926 11.7753 6.12695 11.5977C6.18479 11.4203 6.33875 11.2915 6.52344 11.2646L8.0957 11.0352L8.7998 9.61035C8.88243 9.44289 9.05346 9.33691 9.24023 9.33691ZM8.8623 11.7012C8.7909 11.8459 8.65282 11.9464 8.49316 11.9697L7.64746 12.0918L8.25977 12.6885C8.37506 12.8011 8.42756 12.9632 8.40039 13.1221L8.25586 13.9629L9.01172 13.5664C9.08314 13.5289 9.16183 13.5098 9.24023 13.5098C9.31854 13.5098 9.39737 13.5289 9.46875 13.5664L10.2227 13.9629L10.0791 13.1221C10.052 12.9631 10.1053 12.8011 10.2207 12.6885L10.832 12.0918L9.9873 11.9697C9.82755 11.9465 9.68965 11.8459 9.61816 11.7012L9.24023 10.9355L8.8623 11.7012Z" fill="#E52630"/>
4
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M15.0215 0.681641C15.766 0.681641 16.3711 1.28676 16.3711 2.03125V2.40039H17.209C17.9104 2.40039 18.4805 2.97047 18.4805 3.67188V4.11914H18.9277C19.6291 4.11914 20.1992 4.68922 20.1992 5.39062V18.0469C20.1992 18.7483 19.6291 19.3184 18.9277 19.3184H2.99023C2.28883 19.3184 1.71875 18.7483 1.71875 18.0469V17.5996H1.27148C0.570084 17.5996 0 17.0295 0 16.3281V3.67188C0 2.97047 0.570084 2.40039 1.27148 2.40039H2.10938V2.03125C2.10938 1.28676 2.7145 0.681641 3.45898 0.681641C4.20347 0.681641 4.80859 1.28676 4.80859 2.03125V2.40039H7.89062V2.03125C7.89062 1.28676 8.49575 0.681641 9.24023 0.681641C9.98472 0.681641 10.5898 1.28676 10.5898 2.03125V2.40039H13.6719V2.03125C13.6719 1.28676 14.277 0.681641 15.0215 0.681641ZM18.4805 16.3281C18.4805 17.0295 17.9104 17.5996 17.209 17.5996H10.998C10.7271 17.5996 10.5078 17.3803 10.5078 17.1094C10.5078 16.8384 10.7271 16.6191 10.998 16.6191H17.209C17.3691 16.6191 17.5 16.4883 17.5 16.3281V8.06836H0.980469V16.3281C0.980469 16.4883 1.11132 16.6191 1.27148 16.6191H7.48242C7.7534 16.6191 7.97266 16.8384 7.97266 17.1094C7.97266 17.3803 7.7534 17.5996 7.48242 17.5996H2.69922V18.0469C2.69922 18.207 2.83007 18.3379 2.99023 18.3379H18.9277C19.0879 18.3379 19.2188 18.207 19.2188 18.0469V5.39062C19.2188 5.23046 19.0879 5.09961 18.9277 5.09961H18.4805V16.3281ZM1.27148 3.38086C1.11132 3.38086 0.980469 3.51171 0.980469 3.67188V7.08789H17.5V3.67188C17.5 3.51171 17.3691 3.38086 17.209 3.38086H16.3711V3.75C16.3711 4.49449 15.766 5.09961 15.0215 5.09961C14.277 5.09961 13.6719 4.49449 13.6719 3.75V3.38086H10.5898V3.75C10.5898 4.49449 9.98472 5.09961 9.24023 5.09961C8.49575 5.09961 7.89062 4.49449 7.89062 3.75V3.38086H4.80859V3.75C4.80859 4.49449 4.20347 5.09961 3.45898 5.09961C2.7145 5.09961 2.10938 4.49449 2.10938 3.75V3.38086H1.27148ZM3.45898 1.66211C3.25574 1.66211 3.08984 1.828 3.08984 2.03125V3.75C3.08984 3.95325 3.25574 4.11914 3.45898 4.11914C3.66223 4.11914 3.82812 3.95325 3.82812 3.75V2.03125C3.82812 1.828 3.66223 1.66211 3.45898 1.66211ZM9.24023 1.66211C9.03699 1.66211 8.87109 1.828 8.87109 2.03125V3.75C8.87109 3.95325 9.03699 4.11914 9.24023 4.11914C9.44348 4.11914 9.60938 3.95325 9.60938 3.75V2.03125C9.60938 1.828 9.44348 1.66211 9.24023 1.66211ZM15.0215 1.66211C14.8182 1.66211 14.6523 1.828 14.6523 2.03125V3.75C14.6523 3.95325 14.8182 4.11914 15.0215 4.11914C15.2247 4.11914 15.3906 3.95325 15.3906 3.75V2.03125C15.3906 1.828 15.2247 1.66211 15.0215 1.66211Z" fill="#E52630"/>
5
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg width="20" height="21" viewBox="0 0 20 21" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M10.1992 16.1415C10.4753 16.1415 10.6992 16.3654 10.6992 16.6415V16.6434C10.6991 16.9195 10.4753 17.1434 10.1992 17.1434C9.92326 17.1432 9.69923 16.9194 9.69915 16.6434V16.6415C9.69915 16.3655 9.92322 16.1417 10.1992 16.1415Z" fill="#E52630"/>
3
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M5.97259 0.244035C6.1137 0.00692771 6.42091 -0.0705775 6.65814 0.0702065C6.89522 0.211415 6.97295 0.517557 6.83196 0.754777C6.70814 0.962907 6.65813 1.11666 6.65423 1.26259C6.65259 1.326 6.66157 1.39926 6.68353 1.48622C7.54278 1.23036 8.50233 1.55669 9.01263 2.34853L9.10052 2.49794C9.13789 2.56811 9.16956 2.64018 9.19818 2.71278C9.47262 2.46443 9.68939 2.16527 9.82318 1.76454L9.85345 1.6288C9.87229 1.48398 9.857 1.31631 9.81439 1.15712L9.81341 1.15614C9.77057 0.993941 9.72747 0.747149 9.81243 0.513566C9.86092 0.380393 9.95348 0.248541 10.1025 0.159074C10.2457 0.073157 10.3983 0.0517875 10.5273 0.0575112C10.7677 0.0682301 11.0242 0.174659 11.2783 0.315324C11.5457 0.463435 11.8682 0.682831 12.2538 0.983292C13.3977 1.87448 14.0354 2.82375 14.0898 3.77431C14.0914 3.80211 14.0902 3.82981 14.0908 3.85732C14.6705 4.09216 15.1549 4.55463 15.3925 5.13271C15.6309 5.71284 15.6066 6.37597 15.2402 6.99696C16.6986 7.81408 17.7025 9.39355 17.4618 11.1747C17.6723 11.2914 17.8639 11.4349 18.0224 11.6073C18.4378 12.0594 18.614 12.6915 18.332 13.372L16.1904 18.537L16.0449 18.8778C15.8898 19.2246 15.7035 19.5831 15.4589 19.8778C15.1138 20.2935 14.6354 20.6024 13.9726 20.6024H6.42767C5.76481 20.6024 5.28648 20.2936 4.94134 19.8778C4.61525 19.4849 4.39306 18.979 4.20989 18.538L2.06829 13.372C1.78586 12.6914 1.96225 12.0595 2.37786 11.6073C2.54542 11.4251 2.7499 11.2751 2.97454 11.1552C2.80095 10.2911 2.94973 9.52589 3.33587 8.8954C3.77718 8.17499 4.49732 7.67962 5.27337 7.3954C5.33947 7.37116 5.40992 7.3491 5.48236 7.32509C5.35769 6.42685 5.46582 5.72391 5.77728 5.1581C5.8083 5.10177 5.84268 5.04843 5.87689 4.99599C5.78433 4.91121 5.69858 4.81693 5.62103 4.71376L5.53509 4.59071C4.99885 3.75955 5.1342 2.68627 5.80364 2.01161C5.70044 1.74891 5.64849 1.49294 5.65521 1.23622C5.66524 0.856351 5.80052 0.533317 5.97259 0.244035ZM5.24212 12.0683C4.92503 11.8574 4.50685 11.7806 4.09075 11.8339C3.67031 11.8878 3.31438 12.0665 3.11419 12.2841C2.9357 12.4783 2.87281 12.7025 2.99114 12.9882L2.99212 12.9892L5.13275 18.1542L5.27142 18.4765C5.40922 18.7836 5.54758 19.0424 5.71087 19.2392C5.90979 19.4788 6.12457 19.6024 6.42767 19.6024H7.3222L5.87689 13.2919C5.87251 13.2727 5.86921 13.2529 5.86712 13.2333C5.80221 12.6231 5.54422 12.2692 5.24212 12.0683ZM12.1181 11.7626C11.3346 11.7626 10.6993 12.3975 10.6992 13.1806V14.8573C10.699 15.1333 10.4752 15.3573 10.1992 15.3573C9.92331 15.3571 9.6993 15.1332 9.69915 14.8573V13.1806C9.69896 12.3972 9.06525 11.7626 8.28216 11.7626C7.51523 11.7626 6.89143 12.3726 6.86712 13.1347L8.34759 19.6024H9.69915V18.4247C9.69934 18.1489 9.92333 17.9249 10.1992 17.9247C10.4752 17.9247 10.699 18.1487 10.6992 18.4247V19.6024H12.0517L13.5322 13.1337C13.5073 12.3721 12.8847 11.7626 12.1181 11.7626ZM16.3085 11.8339C15.8926 11.7806 15.4751 11.8576 15.1581 12.0683C14.8561 12.2691 14.5981 12.623 14.5331 13.2333L14.5224 13.2919L13.0771 19.6024H13.9726C14.2756 19.6024 14.4905 19.4787 14.6894 19.2392C14.9068 18.9771 15.0796 18.6051 15.2665 18.1552L17.4081 12.9892C17.5265 12.7033 17.4647 12.4785 17.2861 12.2841C17.0858 12.0663 16.7291 11.8878 16.3085 11.8339ZM13.8749 4.86318C13.6406 5.35706 13.2327 5.77837 12.7206 6.11122C11.8214 6.69555 10.3962 7.1053 9.06732 7.43739C7.85847 7.73948 6.72411 7.9797 5.9345 8.22743L5.6181 8.33388L5.38958 8.42665C4.8702 8.65775 4.44622 8.99701 4.18841 9.41786C3.95878 9.79292 3.84424 10.2634 3.93743 10.8466C3.94621 10.8454 3.95502 10.8438 3.9638 10.8427C4.56695 10.7654 5.23894 10.865 5.79583 11.2352C6.00169 11.3722 6.18466 11.543 6.33978 11.745C6.78026 11.1499 7.48549 10.7626 8.28216 10.7626C9.06475 10.7626 9.75744 11.1365 10.1992 11.7128C10.6412 11.1361 11.3354 10.7626 12.1181 10.7626C12.9146 10.7626 13.619 11.1502 14.0595 11.745C14.2146 11.5429 14.3985 11.3722 14.6044 11.2352C15.1612 10.8652 15.8325 10.7654 16.4355 10.8427C16.4521 10.8448 16.4686 10.8481 16.4853 10.8505C16.5719 9.54458 15.7742 8.35774 14.5683 7.77138C14.1152 8.16802 13.5607 8.52152 12.9951 8.83193C12.3141 9.20557 11.5856 9.53738 10.9531 9.82509C10.7018 9.9391 10.4052 9.82824 10.2909 9.57704C10.1767 9.32584 10.288 9.02941 10.539 8.91493C11.1762 8.62511 11.8707 8.30775 12.5136 7.95497C13.1604 7.6 13.7238 7.22526 14.1122 6.83193L14.2714 6.65028C14.5965 6.22788 14.5971 5.82751 14.4677 5.51259C14.3576 5.24478 14.1412 5.01274 13.8749 4.86318ZM10.8417 1.21864C10.8697 1.43857 10.8706 1.68259 10.8154 1.9247L10.7714 2.08193C10.4946 2.91063 9.97105 3.43734 9.39837 3.82216C9.30046 3.88795 9.1998 3.94818 9.09954 4.00673C9.0912 4.01186 9.0828 4.01674 9.07415 4.02138C8.8943 4.12536 8.71406 4.22077 8.539 4.30849C8.24791 4.45434 7.9912 4.57538 7.73529 4.71278C7.23119 4.98345 6.86656 5.2532 6.65325 5.64052C6.48525 5.94575 6.38329 6.37935 6.45599 7.04677C7.18158 6.85928 8.02155 6.66848 8.82513 6.46767C10.1796 6.12919 11.4391 5.75195 12.1757 5.27333C12.846 4.83776 13.1202 4.33435 13.0917 3.83193C13.0613 3.30006 12.6854 2.58714 11.6396 1.77235C11.304 1.51082 11.0413 1.33381 10.8417 1.21864ZM8.17181 2.89052C7.85212 2.39444 7.19079 2.25132 6.69427 2.57118C6.19892 2.891 6.05614 3.55327 6.37591 4.04872L6.46868 4.17177C6.49942 4.20711 6.53297 4.23902 6.56732 4.26943C6.79138 4.09928 7.02852 3.95712 7.26165 3.83193C7.53297 3.68625 7.8319 3.54513 8.09173 3.41493C8.17169 3.37487 8.24862 3.33229 8.32513 3.29189C8.30147 3.1534 8.25298 3.01669 8.17181 2.89052Z" fill="#E52630"/>
4
+ </svg>
@@ -0,0 +1,6 @@
1
+ <svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M2.10645 11.2881C2.39152 11.2885 2.62305 11.5205 2.62305 11.8057C2.62285 12.0907 2.3914 12.3218 2.10645 12.3223C1.82111 12.3223 1.58906 12.091 1.58887 11.8057C1.58887 11.5202 1.82099 11.2881 2.10645 11.2881Z" fill="#E52630"/>
3
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M2.89941 9.7002C3.43916 9.7002 3.90364 10.0279 4.10449 10.4941H6.83789C7.33542 10.4941 7.82702 10.6233 8.25977 10.8672L10.3574 12.0469C10.3986 12.07 10.4465 12.083 10.4941 12.083H13.0654C14.0076 12.083 14.7743 12.849 14.7744 13.791C14.7744 13.8262 14.7708 13.8618 14.7686 13.8965L18.333 12.6719C19.1107 12.3939 19.9827 12.6953 20.3584 13.3906C20.862 14.3228 20.4266 15.3858 19.541 15.7451L19.54 15.7441L12.1328 19.0059L12.1338 19.0068C11.4559 19.3147 10.7343 19.4707 9.99023 19.4707C9.05088 19.4707 8.12861 19.2147 7.32324 18.7314L5.24609 17.4854C4.95953 17.3136 4.50169 17.1902 4.08105 17.1299C3.87048 17.5727 3.42168 17.8818 2.89941 17.8818H0.517578C0.232152 17.8818 0.00030278 17.6506 0 17.3652V10.2178C0 9.93216 0.231965 9.7002 0.517578 9.7002H2.89941ZM4.21094 16.1025C4.73969 16.1763 5.34269 16.3374 5.77832 16.5986L7.85547 17.8447C8.50004 18.2316 9.23833 18.4365 9.99023 18.4365C10.5866 18.4365 11.1645 18.3107 11.708 18.0635C11.7228 18.057 13.5733 17.2427 15.4219 16.4287C16.3497 16.0202 17.2777 15.6111 17.9736 15.3047C18.3214 15.1516 18.6115 15.0239 18.8145 14.9346C18.9157 14.89 18.9955 14.855 19.0498 14.8311L19.1279 14.7969L19.1318 14.7949L19.1367 14.793C19.1367 14.793 19.1389 14.7922 19.1416 14.791C19.1441 14.79 19.1481 14.7877 19.1523 14.7861C19.4842 14.6515 19.6511 14.2558 19.4492 13.8818C19.3251 13.6524 18.9902 13.534 18.6787 13.6465L18.6768 13.6475C18.6691 13.6501 18.3693 13.7534 17.9219 13.9072L14.6035 15.0479C14.3775 15.1255 14.1886 15.19 14.0566 15.2354C13.9908 15.258 13.9386 15.2759 13.9033 15.2881C13.8859 15.2941 13.8724 15.2996 13.8633 15.3027C13.86 15.3038 13.8566 15.304 13.8545 15.3047C13.6126 15.4312 13.3412 15.5 13.0654 15.5H9.02832C8.74311 15.4998 8.51198 15.2675 8.51172 14.9824C8.51186 14.6971 8.743 14.4661 9.02832 14.4658H13.0654C13.4366 14.4658 13.74 14.161 13.7402 13.791C13.74 13.4194 13.437 13.1172 13.0654 13.1172H10.4941C10.2692 13.1172 10.0463 13.0585 9.85059 12.9482L7.75293 11.7686C7.47454 11.6117 7.15795 11.5283 6.83789 11.5283H4.21094V16.1025ZM1.03418 16.8477H2.89941C3.05115 16.8477 3.17534 16.7246 3.17676 16.5732V11.0117C3.17676 10.859 3.05204 10.7344 2.89941 10.7344H1.03418V16.8477Z" fill="#E52630"/>
4
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M14.4756 0.879883C16.29 0.879883 17.5701 2.39254 17.5703 4.19434C17.5703 5.34126 17.0467 6.27657 16.1309 7.26953C15.4468 8.01118 14.5336 8.79631 13.4385 9.73242L12.2842 10.7227C12.187 10.8068 12.0658 10.8486 11.9453 10.8486C11.8249 10.8485 11.7046 10.8066 11.6074 10.7227C11.1165 10.2971 10.6503 9.90559 10.2129 9.53809C9.77563 9.17073 9.36622 8.82631 8.98926 8.49805C8.33033 7.92424 7.76608 7.39368 7.32031 6.85742L7.13574 6.62695C6.96288 6.39991 7.00646 6.07569 7.2334 5.90234C7.46035 5.7291 7.78466 5.77233 7.95801 5.99902C8.36074 6.5265 8.91971 7.06377 9.60938 7.66699C10.2813 8.25465 11.0629 8.89437 11.9443 9.64941C13.4038 8.39276 14.5471 7.45689 15.332 6.61719C16.1286 5.76506 16.5361 5.0326 16.5361 4.19434C16.536 2.88104 15.6414 1.91406 14.4756 1.91406C13.7108 1.91411 13.1956 2.36177 12.8643 2.82812C12.699 3.06071 12.5816 3.29421 12.5059 3.47168C12.4681 3.56009 12.4409 3.63442 12.4229 3.68652C12.4139 3.71257 12.4077 3.73396 12.4033 3.74805C12.399 3.76194 12.3965 3.76953 12.3965 3.76953C12.3343 3.99305 12.1306 4.1473 11.8984 4.14746C11.6661 4.14746 11.4614 3.99258 11.3994 3.76855C11.1387 2.85666 10.3755 1.91428 9.32129 1.91406C8.41011 1.91406 7.64083 2.5127 7.36523 3.45312C7.28499 3.72713 6.9977 3.88404 6.72363 3.80371C6.44961 3.72334 6.29264 3.43627 6.37305 3.16211L6.45703 2.90918C6.92275 1.67145 8.02112 0.879883 9.32129 0.879883C10.4482 0.880013 11.3181 1.4956 11.8975 2.41211C12.478 1.49336 13.3499 0.879925 14.4756 0.879883Z" fill="#E52630"/>
5
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M6.83203 4.37891C7.1171 4.37936 7.34863 4.61131 7.34863 4.89648C7.34818 5.18127 7.11682 5.41263 6.83203 5.41309C6.54685 5.41309 6.31491 5.18155 6.31445 4.89648C6.31445 4.61103 6.54657 4.37891 6.83203 4.37891ZM6.44141 4.97266L6.44238 4.97656C6.44707 4.99914 6.45356 5.02099 6.46191 5.04199C6.4531 5.01979 6.44599 4.99664 6.44141 4.97266Z" fill="#E52630"/>
6
+ </svg>
@@ -1,47 +1,48 @@
1
1
  import React from 'react';
2
+ import styled from 'styled-components';
2
3
 
3
- const wrapperStyle = {
4
- display: 'flex',
5
- flexDirection: 'column',
6
- };
4
+ const ClExampleWrapper = styled.div`
5
+ display: flex;
6
+ flex-direction: column;
7
+ `;
7
8
 
8
- const sourceWrapperStyle = {
9
- marginTop: '1.5rem',
10
- borderRadius: '4px',
11
- overflow: 'hidden',
12
- border: '1px solid #333',
13
- };
9
+ const CodeWrapper = styled.div`
10
+ margin-top: 1.5rem;
11
+ border-radius: 4px;
12
+ overflow: hidden;
13
+ border: 1px solid #333;
14
+ `;
14
15
 
15
- const sourceLabelStyle = {
16
- background: '#2d2d2d',
17
- color: '#888',
18
- padding: '0.35rem 0.75rem',
19
- fontSize: '0.7rem',
20
- fontFamily: 'monospace',
21
- letterSpacing: '0.05em',
22
- textTransform: 'uppercase',
23
- };
16
+ const CodeLabel = styled.div`
17
+ background: #2d2d2d;
18
+ color: #888;
19
+ padding: 0.35rem 0.75rem;
20
+ font-size: 0.7rem;
21
+ font-family: monospace;
22
+ letter-spacing: 0.05em;
23
+ text-transform: uppercase;
24
+ `;
24
25
 
25
- const preStyle = {
26
- background: '#1e1e1e',
27
- color: '#d4d4d4',
28
- padding: '1rem',
29
- overflowX: 'auto',
30
- fontSize: '0.75rem',
31
- lineHeight: '1.6',
32
- fontFamily: "'Fira Code', 'Consolas', 'Monaco', monospace",
33
- margin: 0,
34
- whiteSpace: 'pre',
35
- };
26
+ const CodeStyle = styled.div`
27
+ background: #1e1e1e;
28
+ color: #d4d4d4;
29
+ padding: 1rem;
30
+ overflow-x: auto;
31
+ font-size: 0.75rem;
32
+ line-height: 1.6;
33
+ font-family: Fira Code, Consolas, Monaco, monospace;
34
+ margin: 0;
35
+ white-space: pre;
36
+ `;
36
37
 
37
38
  export default function ExampleDisplay({ component, src }) {
38
39
  return (
39
- <div style={wrapperStyle}>
40
+ <ClExampleWrapper>
40
41
  <div>{component}</div>
41
- <div style={sourceWrapperStyle}>
42
- <div style={sourceLabelStyle}>source</div>
43
- <pre style={preStyle}>{src}</pre>
44
- </div>
45
- </div>
42
+ <CodeWrapper>
43
+ <CodeLabel>source</CodeLabel>
44
+ <CodeStyle>{src}</CodeStyle>
45
+ </CodeWrapper>
46
+ </ClExampleWrapper>
46
47
  );
47
48
  }
@@ -114,6 +114,8 @@ import LookupExample from '../components/Molecules/Lookup/LookupExample.jsx';
114
114
  import lookupExampleSrc from '../components/Molecules/Lookup/LookupExample.jsx?raw';
115
115
  import LogoLinkedExample from '../components/Molecules/LogoLinked/LogoLinkedExample.jsx';
116
116
  import logoLinkedExampleSrc from '../components/Molecules/LogoLinked/LogoLinkedExample.jsx?raw';
117
+ import ExpandedButtonExample from '../components/Molecules/ExpandedButton/ExpandedButtonExample.jsx';
118
+ import expandedButtonExampleSrc from '../components/Molecules/ExpandedButton/ExpandedButtonExample.jsx?raw';
117
119
 
118
120
  // Organism examples
119
121
  import { FooterExample1, FooterExample2, FooterExample3 } from '../components/Organisms/Footer/FooterExample.jsx';
@@ -190,6 +192,7 @@ export const molecules = [
190
192
  { name: 'Descriptor', demo: demo(DescriptorExample, descriptorExampleSrc) },
191
193
  { name: 'DoubleCopy', demo: demo(DoubleCopyExample, doubleCopyExampleSrc) },
192
194
  { name: 'EmailSignUp', demo: demo(MoleculeEmailSignUpExample, moleculeEmailSignUpExampleSrc) },
195
+ { name: 'ExpandedButton', demo: demo(ExpandedButtonExample, expandedButtonExampleSrc) },
193
196
  { name: 'HeroBanner', demo: demo(HeroBannerExample, heroBannerExampleSrc) },
194
197
  { name: 'InfoBanner', demo: demo(InfoBannerExample, infoBannerExampleSrc) },
195
198
  { name: 'LogoLinked', demo: demo(LogoLinkedExample, logoLinkedExampleSrc) },