@codeforamerica/marcomms-design-system 1.0.0 → 1.1.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 (92) hide show
  1. package/dist/styles.css +1 -1
  2. package/package.json +2 -1
  3. package/src/components/accordion.js +141 -0
  4. package/src/components/accordion.stories.js +56 -0
  5. package/src/components/avatar.js +62 -0
  6. package/src/components/avatar.stories.js +27 -0
  7. package/src/components/banner.js +152 -0
  8. package/src/components/banner.stories.js +115 -0
  9. package/src/components/bar.js +102 -0
  10. package/src/components/bar.stories.js +22 -0
  11. package/src/components/blob.js +119 -0
  12. package/src/components/blob.stories.js +64 -0
  13. package/src/components/box.js +55 -0
  14. package/src/components/box.stories.js +24 -0
  15. package/src/components/breadcrumbs.js +80 -0
  16. package/src/components/breadcrumbs.stories.js +27 -0
  17. package/src/components/button.js +167 -0
  18. package/src/components/button.scss +162 -0
  19. package/src/components/button.stories.js +49 -0
  20. package/src/components/callout.js +62 -0
  21. package/src/components/callout.stories.js +20 -0
  22. package/src/components/card.js +403 -0
  23. package/src/components/card.stories.js +170 -0
  24. package/src/components/carousel.js +182 -0
  25. package/src/components/carousel.stories.js +61 -0
  26. package/src/components/cta.js +99 -0
  27. package/src/components/cta.stories.js +22 -0
  28. package/src/components/details.scss +71 -0
  29. package/src/components/details.stories.js +27 -0
  30. package/src/components/flexible-layout.js +126 -0
  31. package/src/components/flexible-layout.stories.js +48 -0
  32. package/src/components/form-elements.scss +305 -0
  33. package/src/components/form-elements.stories.js +134 -0
  34. package/src/components/icon.js +41 -0
  35. package/src/components/icon.scss +31 -0
  36. package/src/components/icon.stories.js +16 -0
  37. package/src/components/label.js +63 -0
  38. package/src/components/label.stories.js +29 -0
  39. package/src/components/link-list.scss +80 -0
  40. package/src/components/link-list.stories.js +52 -0
  41. package/src/components/loader.scss +24 -0
  42. package/src/components/loader.stories.js +12 -0
  43. package/src/components/logo-card.js +93 -0
  44. package/src/components/logo-card.stories.js +48 -0
  45. package/src/components/nav.js +99 -0
  46. package/src/components/nav.stories.js +40 -0
  47. package/src/components/page-nav.js +171 -0
  48. package/src/components/page-nav.stories.js +112 -0
  49. package/src/components/pager.js +98 -0
  50. package/src/components/pager.stories.js +30 -0
  51. package/src/components/pagination.js +116 -0
  52. package/src/components/pagination.stories.js +30 -0
  53. package/src/components/person-card.js +240 -0
  54. package/src/components/person-card.stories.js +58 -0
  55. package/src/components/pill.js +33 -0
  56. package/src/components/pill.stories.js +23 -0
  57. package/src/components/promo.js +83 -0
  58. package/src/components/promo.stories.js +37 -0
  59. package/src/components/pullquote.js +42 -0
  60. package/src/components/pullquote.stories.js +16 -0
  61. package/src/components/quote.js +84 -0
  62. package/src/components/quote.stories.js +23 -0
  63. package/src/components/reveal.js +83 -0
  64. package/src/components/reveal.stories.js +40 -0
  65. package/src/components/slide.js +121 -0
  66. package/src/components/slide.stories.js +53 -0
  67. package/src/components/social-icon.js +233 -0
  68. package/src/components/social-icon.stories.js +36 -0
  69. package/src/components/stat.js +92 -0
  70. package/src/components/stat.stories.js +28 -0
  71. package/src/components/tab-list.js +114 -0
  72. package/src/components/tab-list.stories.js +18 -0
  73. package/src/components/tab.js +95 -0
  74. package/src/components/tab.stories.js +29 -0
  75. package/src/components/tile.js +150 -0
  76. package/src/components/tile.stories.js +41 -0
  77. package/src/components/transcript.js +44 -0
  78. package/src/components/transcript.stories.js +167 -0
  79. package/src/core/base.scss +86 -0
  80. package/src/core/colors.mdx +100 -0
  81. package/src/core/grid.mdx +14 -0
  82. package/src/core/grid.scss +295 -0
  83. package/src/core/helpers.scss +111 -0
  84. package/src/core/layout.scss +79 -0
  85. package/src/core/reset.scss +53 -0
  86. package/src/core/tokens.scss +251 -0
  87. package/src/core/typography.mdx +66 -0
  88. package/src/core/typography.scss +426 -0
  89. package/src/shared/common.js +15 -0
  90. package/src/shared/layout.js +14 -0
  91. package/src/shared/typography.js +111 -0
  92. package/src/styles.scss +15 -0
@@ -0,0 +1,426 @@
1
+ @use '../components/icon';
2
+
3
+ // =====
4
+
5
+ // Typography spacing
6
+
7
+ // Add a single space around paragraphs, blockquotes, and lists
8
+ p, ul, ol, blockquote {
9
+ & + * {
10
+ margin-block-start: var(--spacing, var(--spacing-layout-1, 1.5rem));
11
+ }
12
+ * + & {
13
+ margin-block-start: var(--spacing, var(--spacing-layout-1, 1.5rem));
14
+ }
15
+ }
16
+
17
+ h1, h2, h3, h4, .h1, .h2, .h3, .h4, .display-1, .display-2 {
18
+ // Add a single line space after headings
19
+ & + * {
20
+ margin-block-start: var(--spacing, var(--spacing-layout-1, 1.5rem));
21
+ }
22
+
23
+ // Add three line spaces before headings
24
+ * + & {
25
+ --spacing: var(--spacing-layout-3);
26
+
27
+ margin-block-start: --spacing;
28
+ }
29
+
30
+ // Only add a single space between headings and other headings
31
+ & + & {
32
+ --spacing: var(--spacing-layout-1);
33
+ }
34
+
35
+ // Reduce space after breadcrumbs and eyebrows
36
+ cfa-breadcrumbs + &,
37
+ .eyebrow + & {
38
+ margin-block-start: var(--spacing-layout-half) !important;
39
+ }
40
+ }
41
+
42
+ h1, .h1, .display-1, .display-2 {
43
+ text-wrap: balance;
44
+ }
45
+
46
+ // =====
47
+
48
+ // Font styles
49
+
50
+ .regular {
51
+ font-family: var(--font-family-base);
52
+ font-size: var(--font-size-base);
53
+ line-height: var(--line-height-base);
54
+ }
55
+
56
+ .display-1 {
57
+ font-family: var(--font-family-heading);
58
+ font-size: var(--font-size-display-1);
59
+ font-weight: bold;
60
+ line-height: var(--line-height-display-1);
61
+ letter-spacing: var(--letter-spacing-display-1);
62
+ }
63
+
64
+ .display-2 {
65
+ font-family: var(--font-family-heading);
66
+ font-size: var(--font-size-display-2);
67
+ font-weight: bold;
68
+ line-height: var(--line-height-display-2);
69
+ letter-spacing: var(--letter-spacing-display-2);
70
+ }
71
+
72
+ h1,
73
+ .h1 {
74
+ font-family: var(--font-family-heading);
75
+ font-size: var(--font-size-h1);
76
+ font-weight: bold;
77
+ line-height: var(--line-height-h1);
78
+ letter-spacing: var(--letter-spacing-h1);
79
+ }
80
+
81
+ h2,
82
+ .h2 {
83
+ font-family: var(--font-family-heading);
84
+ font-size: var(--font-size-h2);
85
+ font-weight: bold;
86
+ line-height: var(--line-height-h2);
87
+ letter-spacing: var(--letter-spacing-h2);
88
+ }
89
+
90
+ h3,
91
+ .h3 {
92
+ font-family: var(--font-family-heading);
93
+ font-size: var(--font-size-h3);
94
+ font-weight: bold;
95
+ line-height: var(--line-height-h3);
96
+ letter-spacing: var(--letter-spacing-h3);
97
+ }
98
+
99
+ h4,
100
+ .h4 {
101
+ font-family: var(--font-family-heading);
102
+ font-size: var(--font-size-h4);
103
+ font-weight: bold;
104
+ line-height: var(--line-height-h4);
105
+ letter-spacing: var(--letter-spacing-h4);
106
+ }
107
+
108
+ .extra-large {
109
+ font-size: var(--font-size-extra-large);
110
+ line-height: var(--line-height-extra-large);
111
+ letter-spacing: var(--letter-spacing-extra-large);
112
+ }
113
+
114
+ .large {
115
+ font-size: var(--font-size-large);
116
+ line-height: var(--line-height-large);
117
+ letter-spacing: var(--letter-spacing-large);
118
+ }
119
+
120
+ .small {
121
+ font-size: var(--font-size-small);
122
+ line-height: var(--line-height-small);
123
+ letter-spacing: var(--letter-spacing-small);
124
+ }
125
+
126
+ .eyebrow,
127
+ .is-style-eyebrow /* WordPress support */ {
128
+ font-family: var(--font-family-sans-serif);
129
+ font-size: var(--font-size-eyebrow);
130
+ font-weight: var(--font-weight-eyebrow);
131
+ letter-spacing: var(--letter-spacing-eyebrow);
132
+ line-height: var(--line-height-eyebrow);
133
+ text-transform: uppercase;
134
+ }
135
+
136
+ .eyebrow-with-line,
137
+ .is-style-eyebrow-with-line /* WordPress support */ {
138
+ align-items: center;
139
+ color: var(--text-color);
140
+ display: flex;
141
+ font-family: var(--font-family-eyebrow);
142
+ font-size: var(--font-size-eyebrow);
143
+ font-weight: var(--font-weight-eyebrow);
144
+ letter-spacing: var(--letter-spacing-eyebrow);
145
+ line-height: var(--line-height-eyebrow);
146
+ margin-block-end: var(--spacing-layout-half);
147
+ position: relative;
148
+ text-transform: uppercase;
149
+
150
+ &::after {
151
+ border-block-end: var(--hairline) solid currentColor;
152
+ content: "";
153
+ flex-grow: 1;
154
+ margin-left: var(--spacing-component-3);
155
+ }
156
+ }
157
+
158
+ .subtle {
159
+ opacity: 0.6;
160
+ }
161
+
162
+ .serif {
163
+ font-family: var(--font-family-serif);
164
+ }
165
+
166
+ .sans-serif {
167
+ font-family: var(--font-family-sans-serif);
168
+ }
169
+
170
+ i,
171
+ em,
172
+ .italic {
173
+ font-style: italic;
174
+ }
175
+
176
+ b,
177
+ strong,
178
+ .strong {
179
+ font-weight: bold;
180
+ }
181
+
182
+ .normal {
183
+ font-weight: normal;
184
+ }
185
+
186
+ .prominent-link,
187
+ a.prominent-link {
188
+ --accent-color: var(--purple-60);
189
+
190
+ font-weight: bold;
191
+ text-decoration: underline;
192
+ text-decoration-color: var(--accent-color);
193
+ text-decoration-thickness: var(--medium);
194
+ text-underline-offset: 0.4em;
195
+ transition: color 0.2s ease-in-out, border-color 0.2s ease-in-out;
196
+
197
+ &:hover {
198
+ --accent-color: var(--red-60);
199
+ }
200
+
201
+ &:not(:has(cfa-icon))::after {
202
+ @include icon.icon;
203
+
204
+ content: "arrow_right_alt";
205
+ display: inline-block;
206
+ padding-inline-start: 0.1em;
207
+ text-decoration: none;
208
+ transition: padding 0.2s ease-in-out;
209
+ width: 1em;
210
+ }
211
+
212
+ &:not(:has(cfa-icon)):hover::after {
213
+ padding-inline-start: 0.3em;
214
+ }
215
+
216
+ cfa-icon {
217
+ text-decoration: none;
218
+ }
219
+ }
220
+
221
+ .white-text,
222
+ .text-light /* fallback */ {
223
+ -moz-osx-font-smoothing: grayscale; // Sharper antialising for white text on a dark background
224
+ -webkit-font-smoothing: antialiased; // Sharper antialising for white text on a dark background
225
+ color: var(--white);
226
+ --link-color: var(--white);
227
+ --link-hover-color: var(--white);
228
+ }
229
+
230
+ // =====
231
+
232
+ // Highlights
233
+
234
+ .highlight {
235
+ text-decoration: underline;
236
+ text-decoration-color: var(--highlight-color, var(--yellow-20));
237
+ text-decoration-thickness: 0.4em;
238
+ text-decoration-skip-ink: none;
239
+ text-underline-offset: -0.2em;
240
+ word-wrap: break-word;
241
+ }
242
+
243
+ .highlight--yellow {
244
+ --highlight-color: var(--yellow-20);
245
+ }
246
+
247
+ .highlight--blue {
248
+ --highlight-color: var(--blue-20);
249
+ }
250
+
251
+ .highlight--green {
252
+ --highlight-color: var(--green-40);
253
+ }
254
+
255
+ .highlight--white {
256
+ --highlight-color: var(--white-20);
257
+ }
258
+
259
+ .highlight--purple {
260
+ --highlight-color: var(--purple-20);
261
+ }
262
+
263
+ // ======
264
+
265
+ // Lists
266
+
267
+ .ul,
268
+ .content ul {
269
+ list-style-type: disc;
270
+ padding-left: var(--spacing-layout-1);
271
+
272
+ & + *,
273
+ * + & {
274
+ margin-block-start: var(--spacing, var(--spacing-layout-1));
275
+ }
276
+
277
+ & > li {
278
+ margin-inline-start: 0;
279
+ padding-left: var(--spacing-component-2);
280
+ }
281
+
282
+ & > li + li {
283
+ margin-block-start: var(--spacing-layout-half);
284
+ }
285
+
286
+ & > li > ul {
287
+ margin-block-start: var(--spacing-layout-half);
288
+ }
289
+ }
290
+
291
+ .ol,
292
+ .content ol {
293
+ list-style-type: decimal;
294
+ padding-left: var(--spacing-layout-1);
295
+
296
+ & + *,
297
+ * + & {
298
+ margin-block-start: var(--spacing, var(--spacing-layout-1));
299
+ }
300
+
301
+ & > li {
302
+ margin-inline-start: 0;
303
+ padding-inline-start: var(--spacing-component-2);
304
+ }
305
+
306
+ & > li + li {
307
+ margin-block-start: var(--spacing-layout-half);
308
+ }
309
+
310
+ & > li > ul {
311
+ margin-block-start: var(--spacing-layout-half);
312
+ }
313
+ }
314
+
315
+ .ul--unstyled {
316
+ list-style: none;
317
+ padding: 0;
318
+
319
+ & > li {
320
+ margin-inline: 0;
321
+ padding: 0;
322
+ }
323
+ }
324
+
325
+ .ul--line-separators {
326
+ & > li + li::before {
327
+ border-block-start: 1px solid var(--gray-20);
328
+ width: 100%;
329
+ content: "";
330
+ display: block;
331
+ margin-block: var(--spacing-layout-half);
332
+ }
333
+ }
334
+
335
+ .ul--inline {
336
+ display: inline;
337
+ list-style: none;
338
+ padding-inline: 0 !important;
339
+
340
+ & > li {
341
+ display: inline-block;
342
+ margin-inline-end: var(--spacing-component-3);
343
+ padding: 0 !important;
344
+ }
345
+
346
+ li:last-child {
347
+ margin-inline-end: 0;
348
+ }
349
+
350
+ & > li + li {
351
+ margin-block-start: 0;
352
+ }
353
+ }
354
+
355
+ .ul--inline-with-separators {
356
+ @extend .ul--inline;
357
+
358
+ li {
359
+ margin-inline-end: 0;
360
+ }
361
+
362
+ & > li::after {
363
+ content: '•';
364
+ margin-inline: var(--spacing-component-2);
365
+ opacity: 0.5;
366
+ }
367
+
368
+ & > li:last-child::after {
369
+ content: '';
370
+ }
371
+ }
372
+
373
+ .ul--inline-with-line-separators {
374
+ @extend .ul--inline;
375
+
376
+ li {
377
+ margin-inline-end: 0;
378
+ }
379
+
380
+ & > li::after {
381
+ content: '|';
382
+ margin-inline: var(--spacing-component-2);
383
+ opacity: 0.5;
384
+ }
385
+
386
+ & > li:last-child::after {
387
+ content: '';
388
+ }
389
+ }
390
+
391
+ // ===
392
+
393
+ // Horizontal rule
394
+
395
+ hr {
396
+ --color: currentColor;
397
+
398
+ background-color: var(--color);
399
+ border: 0;
400
+ color: var(--color);
401
+ display: block;
402
+ font-size: 0;
403
+ height: var(--hairline);
404
+ margin-block: var(--spacing-layout-2);
405
+ opacity: 0.4;
406
+ }
407
+
408
+ // ===
409
+
410
+ // Icons
411
+
412
+ .icon {
413
+ -webkit-font-feature-settings: 'liga';
414
+ direction: ltr;
415
+ display: inline-block;
416
+ font-family: 'Material Symbols Rounded';
417
+ font-feature-settings: 'liga';
418
+ font-size: 1.4em;
419
+ font-style: normal;
420
+ font-weight: normal;
421
+ letter-spacing: normal;
422
+ text-transform: none;
423
+ vertical-align: middle;
424
+ white-space: nowrap;
425
+ word-wrap: normal;
426
+ }
@@ -0,0 +1,15 @@
1
+ import { css } from "lit";
2
+
3
+ export const commonStyles = css`
4
+ *,
5
+ *::before,
6
+ *::after {
7
+ box-sizing: border-box;
8
+ }
9
+
10
+ *:focus-visible,
11
+ *:target {
12
+ outline: var(--focus-outline);
13
+ position: relative;
14
+ }
15
+ `;
@@ -0,0 +1,14 @@
1
+ import { css } from "lit";
2
+
3
+ export const layoutStyles = css`
4
+ .wrapper {
5
+ box-sizing: border-box;
6
+ margin: 0 auto;
7
+ max-width: var(--grid-max-width);
8
+ }
9
+
10
+ .container-fluid {
11
+ margin-inline: auto;
12
+ padding-inline: var(--outer-margin);
13
+ }
14
+ `;
@@ -0,0 +1,111 @@
1
+ import { css } from "lit";
2
+
3
+ export const typographyStyles = css`
4
+ .serif {
5
+ font-family: var(--font-family-serif) !important;
6
+ }
7
+
8
+ .sans-serif {
9
+ font-family: var(--font-family-sans-serif) !important;
10
+ }
11
+
12
+ .normal {
13
+ font-weight: normal !important;
14
+ }
15
+
16
+ .strong {
17
+ font-weight: bold !important;
18
+ }
19
+
20
+ italic {
21
+ font-style: italic !important;
22
+ }
23
+
24
+ .display 1 {
25
+ font-family: var(--font-family-display-1);
26
+ font-size: var(--font-size-display-1);
27
+ font-weight: var(--font-weight-display-1);
28
+ letter-spacing: var(--letter-spacing-display-1);
29
+ line-height: var(--line-height-display-1);
30
+ }
31
+
32
+ .display-2 {
33
+ font-family: var(--font-family-display-2);
34
+ font-size: var(--font-size-display-2);
35
+ font-weight: var(--font-weight-display-2);
36
+ letter-spacing: var(--letter-spacing-display-2);
37
+ line-height: var(--line-height-display-2);
38
+ }
39
+
40
+ .h1 {
41
+ font-family: var(--font-family-h1);
42
+ font-size: var(--font-size-h1);
43
+ font-weight: var(--font-weight-h1);
44
+ letter-spacing: var(--letter-spacing-h1);
45
+ line-height: var(--line-height-h1);
46
+ }
47
+
48
+ .h2 {
49
+ font-family: var(--font-family-h2);
50
+ font-size: var(--font-size-h2);
51
+ font-weight: var(--font-weight-h2);
52
+ letter-spacing: var(--letter-spacing-h2);
53
+ line-height: var(--line-height-h2);
54
+ }
55
+
56
+ .h3 {
57
+ font-family: var(--font-family-h3);
58
+ font-size: var(--font-size-h3);
59
+ font-weight: var(--font-weight-h3);
60
+ letter-spacing: var(--letter-spacing-h3);
61
+ line-height: var(--line-height-h3);
62
+ }
63
+
64
+ .h4 {
65
+ font-family: var(--font-family-h4);
66
+ font-size: var(--font-size-h4);
67
+ font-weight: var(--font-weight-h4);
68
+ letter-spacing: var(--letter-spacing-h4);
69
+ line-height: var(--line-height-h4);
70
+ }
71
+
72
+ .eyebrow {
73
+ font-family: var(--font-family-eyebrow);
74
+ font-size: var(--font-size-eyebrow);
75
+ font-weight: var(--font-weight-eyebrow);
76
+ letter-spacing: var(--letter-spacing-eyebrow);
77
+ line-height: var(--line-height-eyebrow);
78
+ text-transform: uppercase;
79
+ }
80
+
81
+ .eyebrow-with-line {
82
+ align-items: center;
83
+ color: var(--text-color);
84
+ display: flex;
85
+ font-family: var(--font-family-eyebrow);
86
+ font-size: var(--font-size-eyebrow);
87
+ font-weight: var(--font-weight-eyebrow);
88
+ letter-spacing: var(--letter-spacing-eyebrow);
89
+ line-height: var(--line-height-eyebrow);
90
+ margin-block-end: var(--spacing-layout-half);
91
+ position: relative;
92
+ text-transform: uppercase;
93
+ }
94
+
95
+ .eyebrow-with-line::after {
96
+ border-block-end: var(--hairline) solid var(--text-color);
97
+ content: "";
98
+ flex-grow: 1;
99
+ margin-left: var(--spacing-component-3);
100
+ }
101
+
102
+ .small {
103
+ font-size: var(--font-size-small);
104
+ letter-spacing: var(--letter-spacing-small);
105
+ line-height: var(--line-height-small);
106
+ }
107
+
108
+ .subtle {
109
+ color: var(--text-color-subtle);
110
+ }
111
+ `;
@@ -0,0 +1,15 @@
1
+ @use './core/reset';
2
+ @use './core/tokens';
3
+ @use './core/base';
4
+ @use './core/grid';
5
+ @use './core/layout';
6
+ @use './core/typography';
7
+ @use './core/helpers';
8
+
9
+ // Include buttons, icons, and form styles
10
+ @use './components/button';
11
+ @use './components/details';
12
+ @use './components/form-elements';
13
+ @use './components/icon';
14
+ @use './components/loader';
15
+ @use './components/link-list';