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