@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,157 @@
1
+ @use '../components/icon';
2
+
3
+ .cfa-button,
4
+ a.cfa-button,
5
+ .cfa-button > a,
6
+ .wp-block-button > * {
7
+ --bg-color: var(--white);
8
+ --border-color: transparent;
9
+ --font-family: var(--font-family-sans-serif);
10
+ --font-size: var(--font-size-base);
11
+ --hover-bg-color: var(--blue-20);
12
+ --hover-border-color: var(--border-color);
13
+ --line-height: var(--line-height-base);
14
+ --text-color: var(--purple-80);
15
+
16
+ background-color: var(--bg-color);
17
+ border: var(--hairline) solid var(--border-color);
18
+ border-radius: var(--rounded-corners);
19
+ box-shadow: var(--shadow-small);
20
+ color: var(--text-color);
21
+ cursor: pointer;
22
+ display: block;
23
+ font-family: var(--font-family);
24
+ font-size: var(--font-size);
25
+ font-weight: bold;
26
+ padding: var(--spacing-component-2) var(--spacing-component-3);
27
+ text-align: center;
28
+ text-decoration: none;
29
+ transition: background-color 0.5s, box-shadow 0.5s;
30
+
31
+ &:hover {
32
+ background-color: var(--hover-bg-color);
33
+ border-color: var(--hover-border-color);
34
+ box-shadow: var(--shadow-medium);
35
+ color: var(--text-color);
36
+ }
37
+ }
38
+
39
+ @media (max-width: 768px) {
40
+ .cfa-button,
41
+ a.cfa-button,
42
+ .cfa-button > a,
43
+ .wp-block-button > * {
44
+ width: 100%;
45
+
46
+ & + & {
47
+ margin-block-start: var(--spacing-layout-half);
48
+ }
49
+ }
50
+
51
+ .wp-block-button {
52
+ width: 100%;
53
+ }
54
+ }
55
+
56
+ @media (min-width: 768px) {
57
+ .cfa-button,
58
+ a.cfa-button,
59
+ .cfa-button > a,
60
+ .wp-block-button > * {
61
+ display: inline-block;
62
+
63
+ & {
64
+ margin-block: var(--spacing-component-2);
65
+ margin-inline-end: var(--spacing-component-2);
66
+ }
67
+ }
68
+ }
69
+
70
+ // Themes / variants
71
+
72
+ .cfa-button--primary,
73
+ a.cfa-button--primary,
74
+ .cfa-button--primary > a,
75
+ .wp-block-button.is-style-primary > * {
76
+ --bg-color: var(--red-60);
77
+ --hover-bg-color: var(--red-80);
78
+ --text-color: var(--white,);
79
+ }
80
+
81
+ .cfa-button--outline,
82
+ a.cfa-button--outline,
83
+ .cfa-button--outline > a,
84
+ .wp-block-button.is-style-outline > * {
85
+ --border-color: var(--black-20);
86
+ --bg-color: transparent;
87
+ }
88
+
89
+ .cfa-button--outline-white,
90
+ a.cfa-button--outline-white,
91
+ .cfa-button--outline-white > a,
92
+ .wp-block-button.is-style-outline-white > * {
93
+ --border-color: var(--white);
94
+ --bg-color: transparent;
95
+ --hover-bg-color: var(--black-20);
96
+ --shadow-color: var(--white-20);
97
+ --text-color: var(--white);
98
+ }
99
+
100
+ .cfa-button--prominent-link,
101
+ a.cfa-button--prominent-link,
102
+ .cfa-button--prominent-link > a,
103
+ .wp-block-button.is-style-prominent-link > * {
104
+ --accent-color: var(--purple-60);
105
+
106
+ background: unset;
107
+ box-shadow: unset;
108
+ color: inherit;
109
+ font-weight: bold;
110
+ padding: 0;
111
+ text-decoration: underline;
112
+ text-decoration-color: var(--accent-color);
113
+ text-decoration-thickness: var(--medium);
114
+ text-underline-offset: 0.4em;
115
+ transition: color 0.2s ease-in-out, border-color 0.2s ease-in-out;
116
+
117
+ &:hover {
118
+ --accent-color: var(--red-60);
119
+
120
+ background: unset;
121
+ box-shadow: unset;
122
+ }
123
+
124
+ &::after {
125
+ @include icon.icon;
126
+
127
+ content: "arrow_right_alt";
128
+ padding-inline-start: 0.1em;
129
+ text-decoration: none;
130
+ transition: transform 0.2s ease-in-out;
131
+ width: 1em;
132
+ }
133
+
134
+ &:hover::after {
135
+ transform: translateX(0.3em);
136
+ }
137
+
138
+ cfa-icon {
139
+ text-decoration: none;
140
+ }
141
+ }
142
+
143
+ // Sizes
144
+
145
+ .cfa-button--sm,
146
+ a.cfa-button--sm,
147
+ .cfa-button--sm > a {
148
+ --font-size: var(--font-size-small);
149
+ --line-height: var(--line-height-small);
150
+ }
151
+
152
+ .cfa-button--md,
153
+ a.cfa-button--md,
154
+ .cfa-button--md > a {
155
+ --font-size: var(--font-size-base);
156
+ --line-height: var(--line-height-base);
157
+ }
@@ -0,0 +1,49 @@
1
+ import { html } from "lit-html";
2
+ import "./button.scss";
3
+
4
+ export default {
5
+ title: "Atoms/Button",
6
+ argTypes: {
7
+ theme: {
8
+ options: ["default", "primary", "outline", "outline-white", "prominent-link"],
9
+ control: { type: "inline-radio" },
10
+ },
11
+ size: {
12
+ options: ["sm", "md"],
13
+ control: { type: "inline-radio" },
14
+ defaultValue: "md",
15
+ },
16
+ },
17
+ };
18
+
19
+ const Template = ({ theme, size }) => html`
20
+ <div class="cfa-button cfa-button--${theme} cfa-button--${size}">Submit</div>
21
+ `;
22
+
23
+ export const Default = Template.bind({});
24
+ Default.args = {
25
+ theme: "default",
26
+ };
27
+
28
+ export const Primary = Template.bind({});
29
+ Primary.args = {
30
+ theme: "primary",
31
+ };
32
+
33
+ export const Outline = Template.bind({});
34
+ Outline.args = {
35
+ theme: "outline",
36
+ };
37
+
38
+ export const OutlineWhite = Template.bind({});
39
+ OutlineWhite.args = {
40
+ theme: "outline-white",
41
+ };
42
+ OutlineWhite.parameters = {
43
+ backgrounds: { default: "purple" },
44
+ };
45
+
46
+ export const ProminentLink = Template.bind({});
47
+ ProminentLink.args = {
48
+ theme: "prominent-link",
49
+ };
@@ -0,0 +1,62 @@
1
+ import { LitElement, html, css } from "lit";
2
+ import { commonStyles } from "../shared/common";
3
+ import "./icon";
4
+
5
+ class CallOut extends LitElement {
6
+ static styles = [
7
+ commonStyles,
8
+ css`
9
+ :host {
10
+ --background: var(--white);
11
+ --icon-color: var(--purple-80);
12
+ --link-color: var(--base-link-color);
13
+ --link-hover-color: var(--base-link-hover-color);
14
+ --text-color: var(--black);
15
+
16
+ display: block;
17
+ }
18
+
19
+ .callout {
20
+ align-items: flex-start;
21
+ background: var(--background);
22
+ box-shadow: var(--shadow-medium);
23
+ color: var(--text-color);
24
+ display: flex;
25
+ flex-direction: row;
26
+ gap: var(--spacing-component-2);
27
+ padding: var(--spacing-component-3);
28
+ }
29
+
30
+ .icon {
31
+ color: var(--icon-color);
32
+ flex-direction: column;
33
+ flex-grow: 0;
34
+ font-size: var(--font-size-h3);
35
+ height: 100%;
36
+ margin-block-start: -0.075em;
37
+ margin-inline-end: var(--spacing-component-2);
38
+ }
39
+
40
+ .callout + .callout {
41
+ margin-top: var(--spacing-layout-half);
42
+ }
43
+ `,
44
+ ];
45
+
46
+ render() {
47
+ return html`
48
+ <div class="callout">
49
+ <div class="icon">
50
+ <cfa-icon>info</cfa-icon>
51
+ </div>
52
+ <div class="text">
53
+ <slot></slot>
54
+ </div>
55
+ </div>
56
+ `;
57
+ }
58
+ }
59
+
60
+ if (!customElements.get("cfa-callout")) {
61
+ customElements.define("cfa-callout", CallOut);
62
+ }
@@ -0,0 +1,20 @@
1
+ import { html } from "lit-html";
2
+ import "./callout";
3
+
4
+ export default {
5
+ title: "Molecules/CallOut",
6
+ argTypes: {
7
+ text: { type: "string" },
8
+ },
9
+ };
10
+
11
+ const Template = ({ text }) => html`
12
+ <cfa-callout>
13
+ <div .innerHTML="${text}"></div>
14
+ </cfa-callout>
15
+ `;
16
+
17
+ export const Default = Template.bind({});
18
+ Default.args = {
19
+ text: 'It’s not time to go back to “normal,” but to reimagine the status quo. <a href="#">Learn more</a>',
20
+ };