@codeforamerica/marcomms-design-system 1.0.0 → 1.0.1

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 (91) hide show
  1. package/package.json +2 -1
  2. package/src/components/accordion.js +141 -0
  3. package/src/components/accordion.stories.js +56 -0
  4. package/src/components/avatar.js +62 -0
  5. package/src/components/avatar.stories.js +27 -0
  6. package/src/components/banner.js +152 -0
  7. package/src/components/banner.stories.js +115 -0
  8. package/src/components/bar.js +102 -0
  9. package/src/components/bar.stories.js +22 -0
  10. package/src/components/blob.js +119 -0
  11. package/src/components/blob.stories.js +64 -0
  12. package/src/components/box.js +55 -0
  13. package/src/components/box.stories.js +24 -0
  14. package/src/components/breadcrumbs.js +80 -0
  15. package/src/components/breadcrumbs.stories.js +27 -0
  16. package/src/components/button.js +167 -0
  17. package/src/components/button.scss +162 -0
  18. package/src/components/button.stories.js +49 -0
  19. package/src/components/callout.js +62 -0
  20. package/src/components/callout.stories.js +20 -0
  21. package/src/components/card.js +403 -0
  22. package/src/components/card.stories.js +170 -0
  23. package/src/components/carousel.js +182 -0
  24. package/src/components/carousel.stories.js +61 -0
  25. package/src/components/cta.js +99 -0
  26. package/src/components/cta.stories.js +22 -0
  27. package/src/components/details.scss +71 -0
  28. package/src/components/details.stories.js +27 -0
  29. package/src/components/flexible-layout.js +126 -0
  30. package/src/components/flexible-layout.stories.js +48 -0
  31. package/src/components/form-elements.scss +305 -0
  32. package/src/components/form-elements.stories.js +134 -0
  33. package/src/components/icon.js +41 -0
  34. package/src/components/icon.scss +31 -0
  35. package/src/components/icon.stories.js +16 -0
  36. package/src/components/label.js +63 -0
  37. package/src/components/label.stories.js +29 -0
  38. package/src/components/link-list.scss +80 -0
  39. package/src/components/link-list.stories.js +52 -0
  40. package/src/components/loader.scss +24 -0
  41. package/src/components/loader.stories.js +12 -0
  42. package/src/components/logo-card.js +93 -0
  43. package/src/components/logo-card.stories.js +48 -0
  44. package/src/components/nav.js +99 -0
  45. package/src/components/nav.stories.js +40 -0
  46. package/src/components/page-nav.js +171 -0
  47. package/src/components/page-nav.stories.js +112 -0
  48. package/src/components/pager.js +98 -0
  49. package/src/components/pager.stories.js +30 -0
  50. package/src/components/pagination.js +116 -0
  51. package/src/components/pagination.stories.js +30 -0
  52. package/src/components/person-card.js +240 -0
  53. package/src/components/person-card.stories.js +58 -0
  54. package/src/components/pill.js +33 -0
  55. package/src/components/pill.stories.js +23 -0
  56. package/src/components/promo.js +83 -0
  57. package/src/components/promo.stories.js +37 -0
  58. package/src/components/pullquote.js +42 -0
  59. package/src/components/pullquote.stories.js +16 -0
  60. package/src/components/quote.js +84 -0
  61. package/src/components/quote.stories.js +23 -0
  62. package/src/components/reveal.js +83 -0
  63. package/src/components/reveal.stories.js +40 -0
  64. package/src/components/slide.js +121 -0
  65. package/src/components/slide.stories.js +53 -0
  66. package/src/components/social-icon.js +233 -0
  67. package/src/components/social-icon.stories.js +36 -0
  68. package/src/components/stat.js +92 -0
  69. package/src/components/stat.stories.js +28 -0
  70. package/src/components/tab-list.js +114 -0
  71. package/src/components/tab-list.stories.js +18 -0
  72. package/src/components/tab.js +95 -0
  73. package/src/components/tab.stories.js +29 -0
  74. package/src/components/tile.js +150 -0
  75. package/src/components/tile.stories.js +41 -0
  76. package/src/components/transcript.js +44 -0
  77. package/src/components/transcript.stories.js +167 -0
  78. package/src/core/_base.scss +86 -0
  79. package/src/core/_grid.scss +295 -0
  80. package/src/core/_helpers.scss +111 -0
  81. package/src/core/_layout.scss +79 -0
  82. package/src/core/_reset.scss +53 -0
  83. package/src/core/_tokens.scss +251 -0
  84. package/src/core/_typography.scss +426 -0
  85. package/src/core/_wordpress.scss +27 -0
  86. package/src/core/colors.mdx +100 -0
  87. package/src/core/typography.mdx +66 -0
  88. package/src/shared/common.js +15 -0
  89. package/src/shared/layout.js +14 -0
  90. package/src/shared/typography.js +111 -0
  91. package/src/styles.scss +16 -0
@@ -0,0 +1,100 @@
1
+ import { Meta, ColorPalette, ColorItem } from '@storybook/blocks';
2
+
3
+ <Meta title="Colors" />
4
+
5
+ <ColorPalette>
6
+ <ColorItem
7
+ title="Grayscale"
8
+ subtitle=""
9
+ colors={{
10
+ "white": "#fff",
11
+ "gray-20": "#ececec",
12
+ "gray-40": "#b4b4b4",
13
+ "gray-60": "#555555",
14
+ "gray-80": "#292929",
15
+ "black": "#000",
16
+ }}
17
+ />
18
+ <ColorItem
19
+ title="Transparent Black"
20
+ subtitle=""
21
+ colors={{
22
+ "black-10": "rgba(0,0,0,0.1)",
23
+ "black-20": "rgba(0,0,0,0.2)",
24
+ "black-40": "rgba(0,0,0,0.4)",
25
+ "black-60": "rgba(0,0,0,0.6)",
26
+ "black-80": "rgba(0,0,0,0.8)",
27
+ }}
28
+ />
29
+ <ColorItem
30
+ title="Transparent White"
31
+ subtitle=""
32
+ colors={{
33
+ "white-20": "rgba(255,255,255,0.2)",
34
+ "white-40": "rgba(255,255,255,0.4)",
35
+ "white-60": "rgba(255,255,255,0.6)",
36
+ "white-80": "rgba(255,255,255,0.8)",
37
+ }}
38
+ />
39
+ <ColorItem
40
+ title="Purple"
41
+ subtitle="Our primary brand color"
42
+ colors={{
43
+ "purple-10": "#f4f4fb",
44
+ "purple-20": "#dbdaf1",
45
+ "purple-40": "#ada9ff",
46
+ "purple-60": "#4b49b2",
47
+ "purple-80": "#2b1a78",
48
+ }}
49
+ />
50
+ <ColorItem
51
+ title="Red"
52
+ subtitle=""
53
+ colors={{
54
+ "red-20": "#fbdadc",
55
+ "red-40": "#ff999f",
56
+ "red-60": "#af121d",
57
+ "red-80": "#5c0a0f",
58
+ }}
59
+ />
60
+ <ColorItem
61
+ title="Blue"
62
+ subtitle=""
63
+ colors={{
64
+ "blue-20": "#e6ebf9",
65
+ "blue-40": "#b3c7ff",
66
+ "blue-60": "#7595f0",
67
+ "blue-80": "#172c68",
68
+ }}
69
+ />
70
+ <ColorItem
71
+ title="Yellow"
72
+ subtitle=""
73
+ colors={{
74
+ "yellow-20": "#ffebcc",
75
+ "yellow-40": "#ffd699",
76
+ "yellow-60": "#f2aa40",
77
+ "yellow-80": "#663d00",
78
+ }}
79
+ />
80
+ <ColorItem
81
+ title="Green"
82
+ subtitle=""
83
+ colors={{
84
+ "green-20": "#d6f5ed",
85
+ "green-40": "#adf0e0",
86
+ "green-60": "#39aa8e",
87
+ "green-80": "#004239",
88
+ }}
89
+ />
90
+ <ColorItem
91
+ title="Sand"
92
+ subtitle=""
93
+ colors={{
94
+ "sand-20": "#f5f0ed",
95
+ "sand-40": "#f8d5bf",
96
+ "sand-60": "#c19f8b",
97
+ "sand-80": "#3d3129",
98
+ }}
99
+ />
100
+ </ColorPalette>
@@ -0,0 +1,66 @@
1
+ import { Meta, Typeset } from '@storybook/blocks';
2
+
3
+ <Meta title="Typography" />
4
+
5
+ export const typography = {
6
+ type: {
7
+ serif: '"Source Serif 4"',
8
+ "sans-serif": '"Source Sans 3"',
9
+ },
10
+ weight: {
11
+ regular: '400',
12
+ bold: '700',
13
+ },
14
+ size: {
15
+ base: 20,
16
+ "display-1": 61,
17
+ "display-2": 49,
18
+ h1: 39,
19
+ h2: 31,
20
+ h3: 25,
21
+ h4: 20,
22
+ small: 16,
23
+ },
24
+ };
25
+
26
+ export const SampleText = 'We’ve been working for more than a decade with governments and communities across the country to break down barriers and find real solutions.';
27
+
28
+ # Typography
29
+
30
+ We use two font families on the Code for America website: **{typography.type.serif}** and **{typography.type["sans-serif"]}**. Our base font size is `20px` and our typography uses a _major third_ type scale.
31
+
32
+ ## Headings
33
+
34
+ Headings are set in **{typography.type.serif}**.
35
+
36
+ We have large _display_ sizes for headlines (`display-1` and `display-2`), and four standard heading levels (`h1` to `h4`).
37
+
38
+ <Typeset
39
+ fontSizes={[
40
+ Number(typography.size["display-1"]),
41
+ Number(typography.size["display-2"]),
42
+ Number(typography.size.h1),
43
+ Number(typography.size.h2),
44
+ Number(typography.size.h3),
45
+ Number(typography.size.h4),
46
+ ]}
47
+ fontWeight={typography.weight.bold}
48
+ sampleText={SampleText}
49
+ fontFamily={typography.type.serif}
50
+ />
51
+
52
+ ## Body text
53
+
54
+ Body text is set in **{typography.type["sans-serif"]}**. We have a size variations for variation in emphasis: `extra-large`, `large`, and `small`.
55
+
56
+ <Typeset
57
+ fontSizes={[
58
+ Number(typography.size.h2),
59
+ Number(typography.size.h3),
60
+ Number(typography.size.base),
61
+ Number(typography.size.small),
62
+ ]}
63
+ fontWeight={typography.weight.regular}
64
+ sampleText={SampleText}
65
+ fontFamily={typography.type["sans-serif"]}
66
+ />
@@ -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,16 @@
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
+ @use './core/wordpress';
9
+
10
+ // Include buttons, icons, and form styles
11
+ @use './components/button';
12
+ @use './components/details';
13
+ @use './components/form-elements';
14
+ @use './components/icon';
15
+ @use './components/loader';
16
+ @use './components/link-list';