@thecb/components 3.7.0-beta.2 → 4.0.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.
Files changed (70) hide show
  1. package/.storybook/main.js +1 -1
  2. package/.storybook/page.js +2 -0
  3. package/dist/index.cjs.js +170 -146
  4. package/package.json +2 -2
  5. package/src/components/atoms/alert/Alert.js +53 -35
  6. package/src/components/atoms/breadcrumb/Breadcrumb.js +4 -1
  7. package/src/components/atoms/button-with-action/ButtonWithAction.js +2 -2
  8. package/src/components/atoms/checkbox/Checkbox.js +1 -0
  9. package/src/components/atoms/checkbox-list/CheckboxList.js +3 -1
  10. package/src/components/atoms/display-card/DisplayCard.js +4 -2
  11. package/src/components/atoms/dropdown/Dropdown.js +4 -4
  12. package/src/components/atoms/dropdown/Dropdown.stories.js +10 -33
  13. package/src/components/atoms/form-layouts/FormInput.js +7 -4
  14. package/src/components/atoms/form-layouts/FormLayouts.stories.js +5 -5
  15. package/src/components/atoms/hamburger-button/HamburgerButton.js +4 -3
  16. package/src/components/atoms/icons/AccountsIconSmall.js +6 -13
  17. package/src/components/atoms/icons/icons.stories.js +1 -1
  18. package/src/components/atoms/layouts/Box.styled.js +1 -0
  19. package/src/components/atoms/layouts/Cluster.styled.js +5 -1
  20. package/src/components/atoms/layouts/Sidebar.styled.js +7 -1
  21. package/src/components/atoms/radio-button/RadioButton.js +1 -0
  22. package/src/components/atoms/radio-button/RadioButton.stories.js +26 -61
  23. package/src/components/atoms/toggle-switch/ToggleSwitch.js +1 -0
  24. package/src/components/atoms/toggle-switch/ToggleSwitch.stories.js +10 -51
  25. package/src/components/molecules/editable-list/EditableList.js +11 -8
  26. package/src/components/molecules/nav-menu/NavMenuDesktop.js +2 -1
  27. package/src/components/molecules/nav-menu/NavMenuMobile.js +7 -1
  28. package/src/components/molecules/obligation/Obligation.js +9 -7
  29. package/src/components/molecules/obligation/modules/PaymentDetailsActions.js +23 -23
  30. package/src/components/molecules/pagination/Pagination.js +20 -4
  31. package/src/components/molecules/radio-section/RadioSection.js +7 -3
  32. package/src/deprecated/components/radio-button/radio-button.js +5 -1
  33. package/src/deprecated/icons/IconInvalid.js +7 -31
  34. package/src/deprecated/icons/IconNeutral.js +5 -4
  35. package/src/deprecated/icons/IconValid.js +8 -33
  36. package/src/util/general.js +10 -1
  37. package/src/components/molecules/content/Content.js +0 -20
  38. package/src/components/molecules/content/Content.theme.js +0 -60
  39. package/src/components/molecules/content/blocks/accordion-block/AccordionBlock.js +0 -108
  40. package/src/components/molecules/content/blocks/accordion-block/index.js +0 -3
  41. package/src/components/molecules/content/blocks/article-block/ArticleBlock.js +0 -58
  42. package/src/components/molecules/content/blocks/article-block/index.js +0 -3
  43. package/src/components/molecules/content/blocks/attached-file-block/AttachedFileBlock.js +0 -60
  44. package/src/components/molecules/content/blocks/attached-file-block/index.js +0 -3
  45. package/src/components/molecules/content/blocks/featured-content-block/FeaturedContentBlock.js +0 -0
  46. package/src/components/molecules/content/blocks/featured-content-block/index.js +0 -0
  47. package/src/components/molecules/content/blocks/hero-block/HeroBlock.js +0 -54
  48. package/src/components/molecules/content/blocks/hero-block/index.js +0 -3
  49. package/src/components/molecules/content/blocks/highlight-block/HighlightBlock.js +0 -42
  50. package/src/components/molecules/content/blocks/highlight-block/index.js +0 -3
  51. package/src/components/molecules/content/blocks/index.js +0 -33
  52. package/src/components/molecules/content/blocks/info-block/InfoBlock.js +0 -15
  53. package/src/components/molecules/content/blocks/info-block/index.js +0 -3
  54. package/src/components/molecules/content/blocks/location-block/LocationBlock.js +0 -228
  55. package/src/components/molecules/content/blocks/location-block/index.js +0 -3
  56. package/src/components/molecules/content/blocks/related-links-block/RelatedLinksBlock.js +0 -35
  57. package/src/components/molecules/content/blocks/related-links-block/index.js +0 -3
  58. package/src/components/molecules/content/blocks/screendoor-block/ScreendoorBlock.js +0 -57
  59. package/src/components/molecules/content/blocks/screendoor-block/ScreendoorForm.styled.js +0 -314
  60. package/src/components/molecules/content/blocks/screendoor-block/index.js +0 -3
  61. package/src/components/molecules/content/blocks/tagline-block/TaglineBlock.js +0 -45
  62. package/src/components/molecules/content/blocks/tagline-block/index.js +0 -3
  63. package/src/components/molecules/content/blocks/task-block/TaskBlock.js +0 -40
  64. package/src/components/molecules/content/blocks/task-block/index.js +0 -3
  65. package/src/components/molecules/content/blocks/text-block/TextBlock.js +0 -40
  66. package/src/components/molecules/content/blocks/text-block/index.js +0 -3
  67. package/src/components/molecules/content/header/Header.js +0 -283
  68. package/src/components/molecules/content/header/Header.theme.js +0 -11
  69. package/src/components/molecules/content/header/index.js +0 -3
  70. package/src/components/molecules/content/index.js +0 -3
@@ -1,57 +0,0 @@
1
- import React from "react";
2
- import { Box, Heading } from "@thecb/components";
3
- import { ScreendoorFormContent } from "./ScreendoorForm.styled.js";
4
- import { Fragment } from "react";
5
- import { Helmet } from "react-helmet";
6
- import { FONT_WEIGHT_REGULAR } from "../../../../constants/style_constants.js";
7
-
8
- const injectScreendoorScript = (projectId, { scriptTags }) => {
9
- Promise.all(
10
- scriptTags.map(script => new Promise(resolve => (script.onload = resolve)))
11
- ).then(() => {
12
- const script = document.createElement("script");
13
-
14
- script.innerHTML = `
15
- // Uncomment this line and set it to the CSS class that your website uses for buttons:
16
- FormRenderer.BUTTON_CLASS = 'btn themePrimaryButton';
17
-
18
- // Uncomment this line if you want respondents to be able to access a permalink to their draft:
19
- // FormRenderer.addPlugin('BookmarkDraft');
20
-
21
- new FormRenderer({"project_id":"${projectId}"});
22
- `;
23
-
24
- document.body.appendChild(script);
25
- });
26
- };
27
-
28
- const ScreendoorBlock = ({ title, screendoorProjectId }) => (
29
- <Fragment>
30
- <Helmet
31
- onChangeClientState={(_, addedTags) =>
32
- injectScreendoorScript(screendoorProjectId, addedTags)
33
- }
34
- >
35
- <script src="//code.jquery.com/jquery-2.2.3.min.js"></script>
36
- <link
37
- href="//d3q1ytufopwvkq.cloudfront.net/1/formrenderer.css"
38
- rel="stylesheet"
39
- />
40
- <link
41
- rel="stylesheet"
42
- href="https://unpkg.com/leaflet@1.6.0/dist/leaflet.css"
43
- />
44
- <script src="//d3q1ytufopwvkq.cloudfront.net/1/formrenderer.js"></script>
45
- </Helmet>
46
- <Box padding="24px 0" background="white">
47
- <Heading variant="h4" weight={FONT_WEIGHT_REGULAR}>
48
- {title}
49
- </Heading>
50
- <Box padding="0">
51
- <ScreendoorFormContent data-formrenderer></ScreendoorFormContent>
52
- </Box>
53
- </Box>
54
- </Fragment>
55
- );
56
-
57
- export default ScreendoorBlock;
@@ -1,314 +0,0 @@
1
- import styled from "styled-components";
2
- import { constants } from "@thecb/components";
3
-
4
- export const ScreendoorFormContent = styled.form`
5
- background-color: ${constants.colors.WHITE};
6
- box-sizing: border-box;
7
- font-family: Source Sans Pro;
8
- margin: 5rem auto;
9
- max-width: 100%;
10
- width: 47rem;
11
- padding: 0;
12
-
13
- label:not(.themePrimaryButton), th, .fr_bottom, .fr_text, .fr_units {
14
- color: ${constants.colors.STORM_GREY};
15
- font-size: 0.875rem;
16
- line-height: 1.125rem;
17
- font-weight: ${constants.fontWeights.FONT_WEIGHT_REGULAR};
18
- margin: 0.25rem 0;
19
- word-break: break-word;
20
- font-family: Source Sans Pro;
21
-
22
- &::first-letter {
23
- text-transform: uppercase;
24
- }
25
- }
26
-
27
- a {
28
- font-size: 1.125rem;
29
- font-weight: 400;
30
- color: #27A9E1;
31
- line-height: 1rem;
32
- }
33
-
34
- h3 {
35
- font-size: 1.25rem;
36
- font-weight: 400;
37
- font-family: Source Sans Pro;
38
- color: ${constants.colors.BRIGHT_GREY};
39
- line-height: 1.5rem;
40
- letter-spacing: 0.29px;
41
- margin: 3rem 0 1rem;
42
- }
43
-
44
- input[type="text"], input[type="email"], input[type="password"], textarea {
45
- border: 1px solid ${constants.colors.GHOST_GREY};
46
- border-radius: 2px;
47
- height: 3rem;
48
- width: 100%;
49
- padding: 1rem;
50
- min-width: 60px;
51
- margin: 0;
52
- box-sizing: border-box;
53
- position: relative;
54
- font-size: 1.1rem;
55
- line-height: 2rem;
56
- font-weight: ${constants.fontWeights.FONT_WEIGHT_REGULAR};
57
- background-color: ${constants.colors.WHITE};
58
- color: ${constants.colors.MINESHAFT_GREY};
59
- box-shadow: none;
60
-
61
- &:focus {
62
- border: 1px solid ${constants.colors.CURIOUS_BLUE};
63
- }
64
- }
65
-
66
- select {
67
- display: inline-block;
68
- position: relative;
69
- box-sizing: border-box;
70
- padding: 0.75rem 1.75rem 0.75rem 1rem;
71
- line-height: 1.5rem;
72
- border: 1px solid ${constants.colors.GHOST_GREY};
73
- box-shadow: none;
74
- background-color: ${constants.colors.WHITE};
75
- height: 3rem;
76
- width: 100%;
77
- min-width: auto;
78
- border-radius: 2px;
79
- border-width: 1px;
80
- appearance: none;
81
- background-color: ${constants.colors.WHITE};
82
- background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20version%3D%221.2%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20overflow%3D%22visible%22%20preserveAspectRatio%3D%22none%22%20viewBox%3D%220%200%2014%2010%22%20height%3D%228%22%20width%3D%2212%22%3E%3Cg%20transform%3D%22translate%281%201%29%22%3E%3Cg%20fill-rule%3D%22evenodd%22%20fill%3D%22none%22%20id%3D%22Symbols_1548197283918%22%3E%3Cg%20fill%3D%22%23333%22%20transform%3D%22translate%28-155%20-22%29%22%20id%3D%22Dropdown%2FClosed_1548197283918%22%3E%3Cpolygon%20points%3D%22165.59%2022.59%20161%2027.17%20156.41%2022.59%20155%2024%20161%2030%20167%2024%22%20id%3D%22Path_1548197283918%22%20vector-effect%3D%22non-scaling-stroke%22%3E%3C%2Fpolygon%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E');
83
- background-repeat: no-repeat, repeat;
84
- background-position: right .7em top 50%, 0 0;
85
- background-size: .65em auto, 100%;
86
- color: ${constants.colors.MINESHAFT_GREY};
87
- font-size: 1.1rem;
88
- }
89
- }
90
-
91
- .fr_description {
92
- font-size: 1rem;
93
- font-weight: 400;
94
- font-family: Source Sans Pro;
95
- color: ${constants.colors.REGENT_GREY};
96
- line-height: 1.5rem;
97
- font-style: italic;
98
- }
99
-
100
- .fr_field_wrapper {
101
- position: relative;
102
- clear: both;
103
- }
104
-
105
- .fr_map_wrapper {
106
- width: 100%;
107
- height: 15rem;
108
- position: relative;
109
- }
110
-
111
- .fr_map_map {
112
- width: 100%;
113
- height: 13.5rem;
114
- }
115
-
116
- .fr_field_wrapper {
117
- .fr_option {
118
- margin: 0.625rem 0;
119
- line-height: 1.5rem;
120
-
121
- input[type="text"] {
122
- padding: 0.25rem 0.75rem;
123
- font-size: 0.75rem;
124
- line-height: 1rem;
125
- height: 1.5rem;
126
- margin-left: 0.5rem;
127
- float: left;
128
- }
129
-
130
- &::before, &::after {
131
- display: table;
132
- content: " ";
133
- }
134
-
135
- &::after {
136
- clear: both;
137
- }
138
- }
139
-
140
- label.fr_option {
141
- display: block;
142
- }
143
-
144
- .fr_option label {
145
- display: inline-block;
146
- margin: 0;
147
- float: left;
148
- }
149
-
150
- label.fr_option, .fr_option label {
151
- position: relative;
152
- line-height: 1.5rem;
153
-
154
- input[type="radio"] /*, input[type="checkbox"]*/ {
155
- appearance: none;
156
- position: absolute;
157
- top: 0;
158
- left: 0;
159
- height: 1rem;
160
- width: 1rem;
161
- background-color: ${constants.colors.BOSTON_BLUE};
162
- border-radius: 0.5rem;
163
- margin: 0.25rem;
164
-
165
- &:not(:checked) {
166
- display: none;
167
- }
168
- }
169
- }
170
- }
171
-
172
- .fr_response_field_radio {
173
- label.fr_option::before, .fr_option label::before {
174
- border-radius: 0.75rem;
175
- box-sizing: border-box;
176
- content: "";
177
- display: inline-block;
178
- height: 1.5rem;
179
- width: 1.5rem;
180
- border: 1px solid ${constants.colors.GHOST_GREY};
181
- float: left;
182
- min-width: 1.5rem;
183
- min-height: 1.5rem;
184
- margin-right: 0.75rem;
185
- }
186
- }
187
-
188
- .fr_response_field_checkboxes, .fr_response_field_confirm {
189
- label.fr_option, .fr_option label {
190
- input[type="checkbox"] {
191
- /* top: 0.25rem; */
192
- margin-right: 0.75rem;
193
- appearance: none;
194
- display: block;
195
- width: 1rem;
196
- height: 1rem;
197
- border-radius: 0.125rem;
198
- box-sizing: border-box;
199
- content: "";
200
- display: inline-block;
201
- height: 1.5rem;
202
- width: 1.5rem;
203
- border: 1px solid ${constants.colors.GHOST_GREY};
204
- float: left;
205
- min-width: 1.5rem;
206
- min-height: 1.5rem;
207
- margin: 0 0.75rem 0 0;
208
- outline: none;
209
-
210
- &:checked {
211
- background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20aria-hidden%3D%22true%22%20focusable%3D%22false%22%20data-prefix%3D%22fas%22%20data-icon%3D%22check%22%20class%3D%22svg-inline--fa%20fa-check%20fa-w-16%22%20role%3D%22img%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20512%20512%22%3E%3Cpath%20fill%3D%22%23357FB8%22%20d%3D%22M173.898%20439.404l-166.4-166.4c-9.997-9.997-9.997-26.206%200-36.204l36.203-36.204c9.997-9.998%2026.207-9.998%2036.204%200L192%20312.69%20432.095%2072.596c9.997-9.997%2026.207-9.997%2036.204%200l36.203%2036.204c9.997%209.997%209.997%2026.206%200%2036.204l-294.4%20294.401c-9.998%209.997-26.207%209.997-36.204-.001z%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E');
212
- background-repeat: no-repeat, repeat;
213
- background-size: 85%;
214
- background-position: center;
215
- }
216
- }
217
- }
218
- }
219
-
220
- .fr_response_field_paragraph textarea.size_medium {
221
- width: 100%;
222
- }
223
-
224
- .leaflet-container .leaflet-control-attribution a {
225
- color: #404040;
226
- }
227
-
228
- .fr_map_clear, .fr_map_toolbar, .leaflet-container .leaflet-control-attribution a {
229
- font-size: 0.9rem;
230
- line-height: 1.5rem;
231
- }
232
-
233
- .fr_bottom_l {
234
- padding-right: 1rem;
235
- }
236
-
237
- .js-add-row {
238
- background: linear-gradient( to right, ${constants.colors.GREY_CHATEAU} 50%, rgba(255,255,255,0) 0% ), linear-gradient(${constants.colors.GREY_CHATEAU} 50%,rgba(255,255,255,0) 0%), linear-gradient(to right,${constants.colors.GREY_CHATEAU} 50%,rgba(255,255,255,0) 0%), linear-gradient(${constants.colors.GREY_CHATEAU} 50%,rgba(255,255,255,0) 0%);
239
- background-position: top,right,bottom,left;
240
- background-repeat: repeat-x,repeat-y;
241
- background-size: 0.625rem 1px,1px 0.625rem;
242
- min-height: 3rem;
243
- min-width: auto;
244
- border-radius: 0.25rem;
245
- border-width: 0px;
246
- display: flex;
247
- justify-content: center;
248
- align-items: center;
249
- font-size: 0.875rem;
250
- font-weight: 700;
251
- font-family: Source Sans Pro;
252
- color: ${constants.colors.REGENT_GREY};
253
- line-height: 1.5rem;
254
- text-align: center;
255
- padding: 2px;
256
- }
257
-
258
- .js-remove-row {
259
- display: inline-block;
260
- background: ${constants.colors.GHOST_GREY};
261
- width: 0.75rem;
262
- height: 0.75rem;
263
- line-height: 0.625rem;
264
- font-weight: 600;
265
- color: ${constants.colors.WHITE};
266
- border-radius: 0.375rem;
267
- }
268
-
269
- .fr_pagination a {
270
- line-height: 1.25rem;
271
- }
272
-
273
- .fr_error_alert_bar {
274
- background-color: ${constants.colors.RAZZMATAZZ_RED};
275
- }
276
-
277
- .fr_response_field.error input, .fr_response_field.error textarea {
278
- border-color: ${constants.colors.RAZZMATAZZ_RED};
279
- }
280
-
281
- .fr_error {
282
- color: ${constants.colors.RAZZMATAZZ_RED};
283
- }
284
-
285
- @media (max-width: 768px) {
286
- .fr_bottom_l, .fr_bottom_r {
287
- display: block;
288
- }
289
-
290
- .fr_bottom_l {
291
- padding: 1rem 0;
292
- }
293
-
294
- .fr_bottom_r {
295
- padding: 0;
296
- }
297
-
298
- .btn {
299
- padding: 1rem;
300
- display: block;
301
- margin: 1rem 0;
302
- width: 100%;
303
-
304
- &::last-child {
305
- margin-bottom: 0;
306
- }
307
- }
308
-
309
- .fr_response_field_text input.size_medium {
310
- width: 100%;
311
- min-width: 100px;
312
- }
313
- }
314
- `;
@@ -1,3 +0,0 @@
1
- import ScreendoorBlock from "./ScreendoorBlock";
2
-
3
- export default ScreendoorBlock;
@@ -1,45 +0,0 @@
1
- import React from "react";
2
- import { Box, Cluster, Stack, Heading, Paragraph } from "@thecb/components";
3
-
4
- const TaglineBlock = ({
5
- themeValues,
6
- title = "",
7
- description = "",
8
- //variant = "placeholder",
9
- ...rest
10
- }) => {
11
- console.log("what is description", description);
12
- console.log("tagline rest", rest);
13
- const paragraphs =
14
- description
15
- ?.split("\n")
16
- .filter(string => string !== "")
17
- .map((string, index) => (
18
- <Box padding="0" key={`p-${index}`}>
19
- <Paragraph
20
- key={`paragraph-${index}`}
21
- variant="pL"
22
- color={themeValues.darkText}
23
- >
24
- {string}
25
- </Paragraph>
26
- </Box>
27
- )) ?? [];
28
-
29
- return (
30
- <Box padding="64px 32px" minWidth="100%" background="white">
31
- <Cluster justify="center" align="center" minWidth="100%" childGap="32px">
32
- <Box padding="0" maxWidth="300px">
33
- <Heading variant="h2" color={themeValues.darkText}>
34
- {title}
35
- </Heading>
36
- </Box>
37
- <Box padding="0" maxWidth="625px">
38
- <Stack childGap="16px">{paragraphs}</Stack>
39
- </Box>
40
- </Cluster>
41
- </Box>
42
- );
43
- };
44
-
45
- export default TaglineBlock;
@@ -1,3 +0,0 @@
1
- import TaglineBlock from "./TaglineBlock";
2
-
3
- export default TaglineBlock;
@@ -1,40 +0,0 @@
1
- import React from "react";
2
-
3
- import {
4
- Box,
5
- Stack,
6
- Cluster,
7
- Heading,
8
- Paragraph,
9
- ButtonWithLink
10
- } from "@thecb/components";
11
- import { FONT_WEIGHT_SEMIBOLD } from "../../../../constants/style_constants";
12
-
13
- const TaskBlock = ({ themeValues, headline, text, callToAction, url }) => (
14
- <Box
15
- padding="24px 16px"
16
- boxShadow={`inset 0px 3px 0px 0px rgb(21, 116, 157),
17
- 0px 2px 4px 0px rgba(41, 42, 51, 0.4);`}
18
- borderRadius="4px"
19
- background="#ffffff"
20
- maxWidth="47.5rem"
21
- >
22
- <Stack childGap="1.5rem">
23
- <Heading
24
- variant="h3"
25
- color={themeValues.darkText}
26
- weight={FONT_WEIGHT_SEMIBOLD}
27
- >
28
- {headline}
29
- </Heading>
30
- <Paragraph color={themeValues.darkText}>{text}</Paragraph>
31
- <Box padding="0" minWidth="100%">
32
- <Cluster justify="flex-end" align="center">
33
- <ButtonWithLink variant="secondary" url={url} text={callToAction} />
34
- </Cluster>
35
- </Box>
36
- </Stack>
37
- </Box>
38
- );
39
-
40
- export default TaskBlock;
@@ -1,3 +0,0 @@
1
- import TaskBlock from "./TaskBlock";
2
-
3
- export default TaskBlock;
@@ -1,40 +0,0 @@
1
- import React from "react";
2
- import { Box, Stack, Paragraph } from "@thecb/components";
3
-
4
- const TextBlock = ({
5
- themeValues,
6
- textContent = ""
7
- //variant = "placeholder"
8
- }) => {
9
- const paragraphs =
10
- textContent
11
- ?.split("\n")
12
- .filter(string => string !== "")
13
- .map((string, index) => (
14
- <Box padding="0">
15
- <Paragraph
16
- key={`paragraph-${index}`}
17
- variant="pL"
18
- color={themeValues.darkText}
19
- >
20
- {string}
21
- </Paragraph>
22
- </Box>
23
- )) ?? [];
24
- return (
25
- <Box
26
- minWidth="100%"
27
- minHeight="500px"
28
- padding={"32px 24px"}
29
- background="white"
30
- >
31
- <Stack childGap="24px">
32
- <Box padding="0">
33
- <Stack>{paragraphs}</Stack>
34
- </Box>
35
- </Stack>
36
- </Box>
37
- );
38
- };
39
-
40
- export default TextBlock;
@@ -1,3 +0,0 @@
1
- import TextBlock from "./TextBlock";
2
-
3
- export default TextBlock;