@codeforamerica/marcomms-design-system 1.1.4 → 1.2.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.
- package/dist/index.js +1 -1
- package/dist/styles.css +1 -1
- package/package.json +9 -23
- package/src/components/placeholder.js +25 -0
- package/src/components/placeholder.stories.js +10 -0
- package/src/components/slide.js +2 -1
- package/src/components/slide.stories.js +15 -19
- package/src/core/colors.mdx +1 -1
- package/src/core/grid.mdx +207 -4
- package/src/core/grid.scss +247 -605
- package/src/core/layout.scss +15 -4
- package/src/core/layout.stories.js +80 -0
- package/src/core/tokens.scss +36 -44
- package/src/core/typography.mdx +1 -1
- package/src/core/typography.scss +10 -9
- package/src/index.js +0 -3
- package/src/components/banner.js +0 -152
- package/src/components/banner.stories.js +0 -115
- package/src/components/cta.js +0 -99
- package/src/components/cta.stories.js +0 -22
- package/src/components/flexible-layout.js +0 -125
- package/src/components/flexible-layout.stories.js +0 -48
package/src/core/layout.scss
CHANGED
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
|
|
38
38
|
.stack {
|
|
39
39
|
--spacing: var(--spacing-layout-1);
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
|
|
41
|
+
display: flex;
|
|
42
|
+
flex-direction: column;
|
|
43
|
+
gap: var(--spacing);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
.stack-with-lines {
|
|
@@ -77,3 +77,14 @@
|
|
|
77
77
|
height: 100%;
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
+
|
|
81
|
+
// ======
|
|
82
|
+
|
|
83
|
+
.grid-lines {
|
|
84
|
+
background-image: linear-gradient(to bottom, var(--black-20) 1px, transparent 1px);
|
|
85
|
+
background-size: 100% var(--spacing-layout-half);
|
|
86
|
+
|
|
87
|
+
p, h1, h2, h3, h4, h5, h6, li, blockquote {
|
|
88
|
+
background-color: rgba(255,0,0,0.1);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { html } from "lit-html";
|
|
2
|
+
import "../components/card";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: "Core/Layout",
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const Default = () => html`
|
|
9
|
+
<div class="grid-lines">
|
|
10
|
+
<div class="container-fluid container-fluid--grid-test wrapper">
|
|
11
|
+
<div class="row">
|
|
12
|
+
<div class="col-xs-12 col-md-8">
|
|
13
|
+
<div>
|
|
14
|
+
<h1 class="eyebrow">Tax Benefits</h1>
|
|
15
|
+
<p class="display-1">Making tax filing simple, free, and accessible for all</p>
|
|
16
|
+
<p class="display-2">As much as $15 billion in federal tax benefits goes unclaimed every year.</p>
|
|
17
|
+
<p>
|
|
18
|
+
Ultimately, this is the result of a status quo that requires millions of Americans to spend time and money they don’t have to fulfill the prerequisite for receiving benefits: filing a tax return. Tax benefits are some of the largest, most effective anti-poverty tools in the United States, but under our current system, too many people miss out on the support they need.
|
|
19
|
+
</p>
|
|
20
|
+
<p class="h1">For too long, the status quo has been a tax filing system that stands in the way of getting flexible cash from tax benefits into people’s hands.</p>
|
|
21
|
+
<p>
|
|
22
|
+
Aside from the lucky few able to access nonprofit tax prep like the Volunteer Income Tax Assistance (VITA) Program, the system gives most people two options:
|
|
23
|
+
</p>
|
|
24
|
+
<ul>
|
|
25
|
+
<li>
|
|
26
|
+
Collectively pay billions of dollars each year to file their tax returns via commercial preparers
|
|
27
|
+
</li>
|
|
28
|
+
<li>
|
|
29
|
+
Not file altogether, thus missing out on billions of dollars in tax benefits for which they’re eligible.
|
|
30
|
+
</li>
|
|
31
|
+
</ul>
|
|
32
|
+
<p>
|
|
33
|
+
By streamlining and simplifying the tax filing process, we can help more people file their tax returns for free. Ultimately, simplified tax filing will deliver life-changing cash through tax benefits.
|
|
34
|
+
</p>
|
|
35
|
+
<hr>
|
|
36
|
+
<p>
|
|
37
|
+
Tax benefits are some of the largest, most effective anti-poverty tools in the United States, but under our current system, too many people miss out on the support they need.
|
|
38
|
+
</p>
|
|
39
|
+
<h2>What is flexible cash? Flexible cash—meaning money that individuals and families decide how to spend for themselves—is one of the best ways to empower people toward financial stability.</h2>
|
|
40
|
+
<p>
|
|
41
|
+
Flexible cash—meaning money that individuals and families decide how to spend for themselves—is one of the best ways to empower people toward financial stability.
|
|
42
|
+
</p>
|
|
43
|
+
<p class="small">
|
|
44
|
+
Cash support helps people provide for their basic needs, find and keep living wage jobs, and handle emergencies as they arise. Flexible cash has been distributed through the tax system via tax credits and stimulus payments.
|
|
45
|
+
</p>
|
|
46
|
+
<h3>We believe in government providing free and easy tax filing services.</h3>
|
|
47
|
+
<p>
|
|
48
|
+
Through the mindful use of technology, Code for America works to ensure all who are eligible for benefits distributed through the tax system actually can claim and receive them.
|
|
49
|
+
</p>
|
|
50
|
+
<p class="eyebrow-with-line">Our Approach</p>
|
|
51
|
+
<p class="large">
|
|
52
|
+
We believe in government providing free and easy tax filing services. To advance that goal, we build products that show what’s possible and enable government to deliver these simplified tax filing services.
|
|
53
|
+
</p>
|
|
54
|
+
<p>
|
|
55
|
+
In 2021, we launched GetCTC.
|
|
56
|
+
</p>
|
|
57
|
+
<p class="extra-large">
|
|
58
|
+
It's a free, easy tax filing tool that allowed 200,000 families to claim key tax benefits like the stimulus and expanded Child Tax Credit during the COVID-19 pandemic.
|
|
59
|
+
</p>
|
|
60
|
+
<p>
|
|
61
|
+
This helped spark a national movement to use government technology to advance access to tax benefits for families with low income—a movement that ultimately set the foundation for a historic new simplified filing tool: IRS Direct File.
|
|
62
|
+
</p>
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
<div class="col-xs-12 col-md-4 stack">
|
|
66
|
+
<div>
|
|
67
|
+
<p>
|
|
68
|
+
It's a free, easy tax filing tool that allowed 200,000 families to claim key tax benefits like the stimulus and expanded Child Tax Credit during the COVID-19 pandemic.
|
|
69
|
+
</p>
|
|
70
|
+
<p>
|
|
71
|
+
We believe in government providing free and easy tax filing services. To advance that goal, we build products that show what’s possible and enable government to deliver these simplified tax filing services. Code for America works to ensure all who are eligible for benefits distributed through the tax system actually can claim and receive them.
|
|
72
|
+
</p>
|
|
73
|
+
</div>
|
|
74
|
+
<cfa-card>
|
|
75
|
+
</cfa-card>
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
`;
|
package/src/core/tokens.scss
CHANGED
|
@@ -85,18 +85,18 @@
|
|
|
85
85
|
--spacing-layout-8: 12rem;
|
|
86
86
|
--spacing-layout-9: 13.5rem;
|
|
87
87
|
|
|
88
|
-
/* Component spacing (based on
|
|
88
|
+
/* Component spacing (based on fractions of layout spacing) */
|
|
89
89
|
|
|
90
90
|
--spacing-component-0: 0;
|
|
91
|
-
--spacing-component-1:
|
|
92
|
-
--spacing-component-2:
|
|
93
|
-
--spacing-component-3:
|
|
94
|
-
--spacing-component-4:
|
|
95
|
-
--spacing-component-5:
|
|
96
|
-
--spacing-component-6:
|
|
97
|
-
--spacing-component-7:
|
|
98
|
-
--spacing-component-8:
|
|
99
|
-
--spacing-component-9:
|
|
91
|
+
--spacing-component-1: calc(0.125 * var(--spacing-layout-1));
|
|
92
|
+
--spacing-component-2: calc(0.25 * var(--spacing-layout-1));
|
|
93
|
+
--spacing-component-3: calc(0.5 * var(--spacing-layout-1));
|
|
94
|
+
--spacing-component-4: calc(1 * var(--spacing-layout-1));
|
|
95
|
+
--spacing-component-5: calc(2 * var(--spacing-layout-1));
|
|
96
|
+
--spacing-component-6: calc(4 * var(--spacing-layout-1));
|
|
97
|
+
--spacing-component-7: calc(8 * var(--spacing-layout-1));
|
|
98
|
+
--spacing-component-8: calc(16 * var(--spacing-layout-1));
|
|
99
|
+
--spacing-component-9: calc(32 * var(--spacing-layout-1));
|
|
100
100
|
|
|
101
101
|
// =====
|
|
102
102
|
|
|
@@ -151,14 +151,6 @@
|
|
|
151
151
|
--font-size-large: var(--font-size-h3);
|
|
152
152
|
--font-size-small: 0.8rem;
|
|
153
153
|
|
|
154
|
-
// Font size aliases
|
|
155
|
-
--font-size-sm: var(--font-size-small);
|
|
156
|
-
--font-size-md: var(--font-size-base);
|
|
157
|
-
--font-size-lg: var(--font-size-large);
|
|
158
|
-
--font-size-xl: var(--font-size-extra-large);
|
|
159
|
-
--font-size-xxl: var(--font-size-display-2);
|
|
160
|
-
--font-size-xxxl: var(--font-size-display-1);
|
|
161
|
-
|
|
162
154
|
--font-weight-regular: 400;
|
|
163
155
|
--font-weight-bold: 700;
|
|
164
156
|
--font-weight-display-1: var(--font-weight-bold);
|
|
@@ -169,25 +161,25 @@
|
|
|
169
161
|
--font-weight-h4: var(--font-weight-bold);
|
|
170
162
|
--font-weight-eyebrow: var(--font-weight-bold);
|
|
171
163
|
|
|
172
|
-
--line-height-base:
|
|
173
|
-
--line-height-display-1:
|
|
174
|
-
--line-height-display-2:
|
|
175
|
-
--line-height-h1: 1.
|
|
176
|
-
--line-height-h2: 1.
|
|
177
|
-
--line-height-h3: 1
|
|
178
|
-
--line-height-h4: 1
|
|
179
|
-
--line-height-eyebrow:
|
|
180
|
-
--line-height-extra-large: var(--line-height-
|
|
181
|
-
--line-height-large: var(--line-height-
|
|
182
|
-
--line-height-small: 1
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
164
|
+
--line-height-base: var(--spacing-layout-1);
|
|
165
|
+
--line-height-display-1: calc(2.5 * var(--line-height-base));
|
|
166
|
+
--line-height-display-2: calc(2 * var(--line-height-base));
|
|
167
|
+
--line-height-h1: calc(1.5 * var(--line-height-base));
|
|
168
|
+
--line-height-h2: calc(1.5 * var(--line-height-base));
|
|
169
|
+
--line-height-h3: calc(1 * var(--line-height-base));
|
|
170
|
+
--line-height-h4: calc(1 * var(--line-height-base));
|
|
171
|
+
--line-height-eyebrow: calc(1 * var(--line-height-base));
|
|
172
|
+
--line-height-extra-large: calc(1.5 * var(--line-height-base));
|
|
173
|
+
--line-height-large: calc(1 * var(--line-height-base));
|
|
174
|
+
--line-height-small: calc(1 * var(--line-height-base));
|
|
175
|
+
|
|
176
|
+
// Line height aliases
|
|
177
|
+
--line-height-sm: var(--line-height-small);
|
|
178
|
+
--line-height-md: var(--line-height-base);
|
|
179
|
+
--line-height-lg: var(--line-height-large);
|
|
180
|
+
--line-height-xl: var(--line-height-extra-large);
|
|
181
|
+
--line-height-xxl: var(--line-height-display-2);
|
|
182
|
+
--line-height-xxxl: var(--line-height-display-1);
|
|
191
183
|
|
|
192
184
|
--letter-spacing-base: normal;
|
|
193
185
|
--letter-spacing-display-1: normal;
|
|
@@ -199,13 +191,13 @@
|
|
|
199
191
|
--letter-spacing-eyebrow: 0.1em;
|
|
200
192
|
--letter-spacing-small: normal;
|
|
201
193
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
194
|
+
// Letter spacing aliases
|
|
195
|
+
--letter-spacing-sm: var(--letter-spacing-small);
|
|
196
|
+
--letter-spacing-md: var(--letter-spacing-base);
|
|
197
|
+
--letter-spacing-lg: var(--letter-spacing-large);
|
|
198
|
+
--letter-spacing-xl: var(--letter-spacing-extra-large);
|
|
199
|
+
--letter-spacing-xxl: var(--letter-spacing-display-2);
|
|
200
|
+
--letter-spacing-xxxl: var(--letter-spacing-display-1);
|
|
209
201
|
|
|
210
202
|
--text-underline-offset: 0.3em;
|
|
211
203
|
|
package/src/core/typography.mdx
CHANGED
package/src/core/typography.scss
CHANGED
|
@@ -20,9 +20,9 @@ h1, h2, h3, h4, .h1, .h2, .h3, .h4, .display-1, .display-2 {
|
|
|
20
20
|
margin-block-start: var(--spacing, var(--spacing-layout-1, 1.5rem));
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
// Add
|
|
23
|
+
// Add two line spaces before headings
|
|
24
24
|
* + & {
|
|
25
|
-
--spacing: var(--spacing-layout-
|
|
25
|
+
--spacing: var(--spacing-layout-2);
|
|
26
26
|
|
|
27
27
|
margin-block-start: --spacing;
|
|
28
28
|
}
|
|
@@ -33,10 +33,13 @@ h1, h2, h3, h4, .h1, .h2, .h3, .h4, .display-1, .display-2 {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
// Reduce space after breadcrumbs and eyebrows
|
|
36
|
-
cfa-breadcrumbs +
|
|
37
|
-
.eyebrow + & {
|
|
36
|
+
cfa-breadcrumbs + & {
|
|
38
37
|
margin-block-start: var(--spacing-layout-half) !important;
|
|
39
38
|
}
|
|
39
|
+
|
|
40
|
+
.eyebrow + & {
|
|
41
|
+
margin-block-start: 0 !important;
|
|
42
|
+
}
|
|
40
43
|
}
|
|
41
44
|
|
|
42
45
|
h1, .h1, .display-1, .display-2 {
|
|
@@ -123,8 +126,7 @@ h4,
|
|
|
123
126
|
letter-spacing: var(--letter-spacing-small);
|
|
124
127
|
}
|
|
125
128
|
|
|
126
|
-
.eyebrow
|
|
127
|
-
.is-style-eyebrow /* WordPress support */ {
|
|
129
|
+
.eyebrow {
|
|
128
130
|
font-family: var(--font-family-sans-serif);
|
|
129
131
|
font-size: var(--font-size-eyebrow);
|
|
130
132
|
font-weight: var(--font-weight-eyebrow);
|
|
@@ -133,8 +135,7 @@ h4,
|
|
|
133
135
|
text-transform: uppercase;
|
|
134
136
|
}
|
|
135
137
|
|
|
136
|
-
.eyebrow-with-line
|
|
137
|
-
.is-style-eyebrow-with-line /* WordPress support */ {
|
|
138
|
+
.eyebrow-with-line {
|
|
138
139
|
align-items: center;
|
|
139
140
|
color: var(--text-color);
|
|
140
141
|
display: flex;
|
|
@@ -401,7 +402,7 @@ hr {
|
|
|
401
402
|
display: block;
|
|
402
403
|
font-size: 0;
|
|
403
404
|
height: var(--hairline);
|
|
404
|
-
margin-block: var(--spacing-layout-
|
|
405
|
+
margin-block: var(--spacing-layout-1);
|
|
405
406
|
opacity: 0.4;
|
|
406
407
|
}
|
|
407
408
|
|
package/src/index.js
CHANGED
package/src/components/banner.js
DELETED
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
import { LitElement, html, css } from "lit";
|
|
2
|
-
import { commonStyles } from "../shared/common";
|
|
3
|
-
|
|
4
|
-
class Banner extends LitElement {
|
|
5
|
-
static properties = {
|
|
6
|
-
accentColor: "",
|
|
7
|
-
backgroundColor: "",
|
|
8
|
-
linkUrl: "",
|
|
9
|
-
linkTarget: "",
|
|
10
|
-
visualType: "",
|
|
11
|
-
visualUrl: "",
|
|
12
|
-
visualThumbnailUrl: "",
|
|
13
|
-
visualAltText: "",
|
|
14
|
-
};
|
|
15
|
-
static styles = [
|
|
16
|
-
commonStyles,
|
|
17
|
-
css`
|
|
18
|
-
:host {
|
|
19
|
-
--accent-color: var(--white);
|
|
20
|
-
--background-color: var(--black);
|
|
21
|
-
--text-color: var(--white);
|
|
22
|
-
|
|
23
|
-
display: block;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
a {
|
|
27
|
-
align-items: center;
|
|
28
|
-
background-color: var(--background-color);
|
|
29
|
-
box-shadow: var(--shadow-medium);
|
|
30
|
-
color: var(--text-color);
|
|
31
|
-
display: grid;
|
|
32
|
-
grid-template-areas:
|
|
33
|
-
"visual"
|
|
34
|
-
"content";
|
|
35
|
-
grid-template-columns: auto;
|
|
36
|
-
grid-template-rows: var(--spacing-layout-8) auto;
|
|
37
|
-
text-decoration: none;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.blob {
|
|
41
|
-
fill: var(--accent-color);
|
|
42
|
-
grid-area: visual;
|
|
43
|
-
height: 100%;
|
|
44
|
-
width: 100%;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
picture {
|
|
48
|
-
grid-area: visual;
|
|
49
|
-
height: 100%;
|
|
50
|
-
width: 100%;
|
|
51
|
-
z-index: 1;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
picture img {
|
|
55
|
-
object-fit: cover;
|
|
56
|
-
object-position: center center;
|
|
57
|
-
height: 100%;
|
|
58
|
-
width: 100%;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
picture.illustration img {
|
|
62
|
-
object-fit: contain;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
.content {
|
|
66
|
-
padding: var(--spacing-layout-1, 1rem) var(--outer-margin, 1rem);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
@media (min-width: 768px) {
|
|
70
|
-
a {
|
|
71
|
-
grid-template-columns: 33% minmax(50%, var(--column-span-6)) auto;
|
|
72
|
-
grid-template-rows: auto;
|
|
73
|
-
grid-template-areas: "visual" "content";
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.content {
|
|
77
|
-
text-align: start;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
picture {
|
|
81
|
-
max-height: calc(var(--spacing-layout-1) * 12);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
@media (prefers-reduced-motion: no-preference) {
|
|
86
|
-
.blob path {
|
|
87
|
-
animation: float 10s ease-in-out infinite;
|
|
88
|
-
z-index: 0;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
@keyframes float {
|
|
93
|
-
0% {
|
|
94
|
-
transform: translatex(0) translatey(0) rotate(0);
|
|
95
|
-
}
|
|
96
|
-
50% {
|
|
97
|
-
transform: translatex(2px) translatey(-4px) rotate(4deg);
|
|
98
|
-
}
|
|
99
|
-
100% {
|
|
100
|
-
transform: translatex(0) translatey(0) rotate(0);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
`,
|
|
104
|
-
];
|
|
105
|
-
|
|
106
|
-
render() {
|
|
107
|
-
return html`
|
|
108
|
-
<a
|
|
109
|
-
href="${this.linkUrl ? this.linkUrl : "javascript:void(0)"}"
|
|
110
|
-
target="${this.linkTarget}"
|
|
111
|
-
style="
|
|
112
|
-
--accent-color: var(--${this.accentColor});
|
|
113
|
-
--background-color: var(--${this.backgroundColor});
|
|
114
|
-
"
|
|
115
|
-
>
|
|
116
|
-
${this.visualType == "illustration"
|
|
117
|
-
? html`
|
|
118
|
-
<svg
|
|
119
|
-
class="blob"
|
|
120
|
-
width="100%"
|
|
121
|
-
height="100%"
|
|
122
|
-
viewBox="0 400 991 404"
|
|
123
|
-
fill="none"
|
|
124
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
125
|
-
>
|
|
126
|
-
<path
|
|
127
|
-
fill-rule="evenodd"
|
|
128
|
-
clip-rule="evenodd"
|
|
129
|
-
d="M497.987 2.71228C593.074 -5.64211 690.176 4.03525 773.161 49.603C862.779 98.8136 944.454 170.47 976.005 265.197C1007.51 359.787 986.265 464.701 941.165 554.018C899.88 635.781 820.242 689.107 738.82 734.926C664.711 776.63 583.712 800.173 497.987 803.413C409.179 806.769 320.068 796.454 243.046 753.664C159.74 707.382 90.0067 640.005 51.1477 555.166C9.37056 463.956 -21.746 356.515 19.2012 264.956C59.2648 175.372 169.027 143.121 256.962 94.9565C334.013 52.7538 409.754 10.4645 497.987 2.71228Z"
|
|
130
|
-
/>
|
|
131
|
-
</svg>
|
|
132
|
-
`
|
|
133
|
-
: ""}
|
|
134
|
-
<picture class="${this.visualType}">
|
|
135
|
-
<source srcset="${this.visualUrl}" />
|
|
136
|
-
<img
|
|
137
|
-
src="${this.visualThumbnailUrl}"
|
|
138
|
-
alt="${this.visualAltText}"
|
|
139
|
-
loading="lazy"
|
|
140
|
-
/>
|
|
141
|
-
</picture>
|
|
142
|
-
<div class="content">
|
|
143
|
-
<slot></slot>
|
|
144
|
-
</div>
|
|
145
|
-
</a>
|
|
146
|
-
`;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
if (!customElements.get("cfa-banner")) {
|
|
151
|
-
customElements.define("cfa-banner", Banner);
|
|
152
|
-
}
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { html } from "lit-html";
|
|
2
|
-
import "./banner";
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
title: "Organisms/Banner",
|
|
6
|
-
argTypes: {
|
|
7
|
-
content: { type: "string" },
|
|
8
|
-
backgroundColor: {
|
|
9
|
-
defaultValue: "purple-80",
|
|
10
|
-
options: ["purple-80", "red-80", "green-80", "blue-80", "black"],
|
|
11
|
-
control: { type: "select" },
|
|
12
|
-
},
|
|
13
|
-
accentColor: {
|
|
14
|
-
defaultValue: "white",
|
|
15
|
-
options: [
|
|
16
|
-
"white",
|
|
17
|
-
"purple-40",
|
|
18
|
-
"red-40",
|
|
19
|
-
"blue-40",
|
|
20
|
-
"yelow-40",
|
|
21
|
-
"green-40",
|
|
22
|
-
],
|
|
23
|
-
control: { type: "select" },
|
|
24
|
-
},
|
|
25
|
-
linkUrl: { type: "string" },
|
|
26
|
-
linkTarget: {
|
|
27
|
-
defaultValue: "_self",
|
|
28
|
-
options: ["_self", "_blank"],
|
|
29
|
-
control: { type: "radio" },
|
|
30
|
-
},
|
|
31
|
-
visualType: {
|
|
32
|
-
defaultValue: "image",
|
|
33
|
-
options: ["image", "illustration"],
|
|
34
|
-
control: { type: "radio" },
|
|
35
|
-
},
|
|
36
|
-
visualUrl: { type: "string" },
|
|
37
|
-
visualAltText: { type: "string" },
|
|
38
|
-
},
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
const Template = ({
|
|
42
|
-
content,
|
|
43
|
-
backgroundColor,
|
|
44
|
-
accentColor,
|
|
45
|
-
linkUrl,
|
|
46
|
-
visualType,
|
|
47
|
-
visualUrl,
|
|
48
|
-
visualThumbnailUrl,
|
|
49
|
-
visualAltText,
|
|
50
|
-
}) => html`
|
|
51
|
-
<cfa-banner
|
|
52
|
-
.innerHTML="${content}"
|
|
53
|
-
backgroundColor="${backgroundColor}"
|
|
54
|
-
accentColor="${accentColor}"
|
|
55
|
-
linkUrl="${linkUrl}"
|
|
56
|
-
visualType="${visualType}"
|
|
57
|
-
visualUrl="${visualUrl}"
|
|
58
|
-
visualThumbnailUrl="${visualThumbnailUrl}"
|
|
59
|
-
visualAltText="${visualAltText}"
|
|
60
|
-
>
|
|
61
|
-
<a href="${linkUrl}"> ${content} </a>
|
|
62
|
-
</cfa-banner>
|
|
63
|
-
`;
|
|
64
|
-
|
|
65
|
-
export const BannerWithImage = Template.bind({});
|
|
66
|
-
BannerWithImage.args = {
|
|
67
|
-
content: `
|
|
68
|
-
<div class="stack" style="--spacing: var(--spacing-layout-half);">
|
|
69
|
-
<p class="h2">We’re showing what’s possible this holiday season</p>
|
|
70
|
-
<p>
|
|
71
|
-
But we can’t do it without you.<br>
|
|
72
|
-
Make your gift today for double the impact.
|
|
73
|
-
</p>
|
|
74
|
-
<span class="cfa-button cfa-button--primary">
|
|
75
|
-
Donate now
|
|
76
|
-
</span>
|
|
77
|
-
</div>
|
|
78
|
-
`,
|
|
79
|
-
backgroundColor: "purple-80",
|
|
80
|
-
accentColor: "white",
|
|
81
|
-
linkUrl:
|
|
82
|
-
"https://codeforamerica.org/programs/criminal-justice/automatic-record-clearance/",
|
|
83
|
-
visualType: "image",
|
|
84
|
-
visualUrl:
|
|
85
|
-
"https://files.codeforamerica.org/2022/06/28153627/Amanda_TED_3.png",
|
|
86
|
-
visualThumbnailUrl:
|
|
87
|
-
"https://files.codeforamerica.org/2022/06/28153627/Amanda_TED_3.png",
|
|
88
|
-
visualAltText: "Code for America CEO Amanda Renteria speaking at TED",
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
export const BannerWithIllustration = Template.bind({});
|
|
92
|
-
BannerWithIllustration.args = {
|
|
93
|
-
content: `
|
|
94
|
-
<div class="stack" style="--spacing: var(--spacing-layout-half);">
|
|
95
|
-
<p class="h2">We’re showing what’s possible this holiday season</p>
|
|
96
|
-
<p>
|
|
97
|
-
But we can’t do it without you.<br>
|
|
98
|
-
Make your gift today for double the impact.
|
|
99
|
-
</p>
|
|
100
|
-
<span class="cfa-button cfa-button--primary">
|
|
101
|
-
Donate now
|
|
102
|
-
</span>
|
|
103
|
-
</div>
|
|
104
|
-
`,
|
|
105
|
-
backgroundColor: "purple-80",
|
|
106
|
-
accentColor: "white",
|
|
107
|
-
linkUrl:
|
|
108
|
-
"https://codeforamerica.org/programs/criminal-justice/automatic-record-clearance/",
|
|
109
|
-
visualType: "illustration",
|
|
110
|
-
visualUrl:
|
|
111
|
-
"https://files.codeforamerica.org/2022/11/09191601/paperwork-with-laptop-1.png",
|
|
112
|
-
visualThumbnailUrl:
|
|
113
|
-
"https://files.codeforamerica.org/2022/11/09191601/paperwork-with-laptop-1.png",
|
|
114
|
-
visualAltText: "Illustration of hands, a laptop computer and paperwork",
|
|
115
|
-
};
|
package/src/components/cta.js
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { LitElement, html, css } from "lit";
|
|
2
|
-
import { commonStyles } from "../shared/common";
|
|
3
|
-
import "./blob";
|
|
4
|
-
|
|
5
|
-
class CTA extends LitElement {
|
|
6
|
-
static properties = {};
|
|
7
|
-
static styles = [
|
|
8
|
-
commonStyles,
|
|
9
|
-
css`
|
|
10
|
-
:host {
|
|
11
|
-
--bg-color: var(--purple-60);
|
|
12
|
-
--link-color: var(--white);
|
|
13
|
-
--link-hover-color: var(--white);
|
|
14
|
-
--spacing: var(--spacing-layout-1);
|
|
15
|
-
--text-color: var(--white);
|
|
16
|
-
|
|
17
|
-
background-color: var(--bg-color);
|
|
18
|
-
display: block;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
a {
|
|
22
|
-
color: var(--link-color);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
a:hover {
|
|
26
|
-
color: var(--link-hover-color);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.cta {
|
|
30
|
-
display: grid;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.cta > * {
|
|
34
|
-
grid-area: 1 / 1;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.content {
|
|
38
|
-
color: var(--text-color);
|
|
39
|
-
display: flex;
|
|
40
|
-
flex-direction: column;
|
|
41
|
-
gap: var(--spacing);
|
|
42
|
-
margin-inline: auto;
|
|
43
|
-
max-width: var(--column-span-8);
|
|
44
|
-
padding: var(--spacing-layout-4) var(--outer-margin);
|
|
45
|
-
position: relative;
|
|
46
|
-
spacing: var(--spacing-layout-2);
|
|
47
|
-
text-align: center;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.blob {
|
|
51
|
-
position: relative;
|
|
52
|
-
overflow: hidden;
|
|
53
|
-
height: 100%;
|
|
54
|
-
width: 100%;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
cfa-blob {
|
|
58
|
-
--color: var(--purple-80);
|
|
59
|
-
|
|
60
|
-
overflow: hidden;
|
|
61
|
-
position: absolute;
|
|
62
|
-
height: 120%;
|
|
63
|
-
width: 140%;
|
|
64
|
-
top: -10%;
|
|
65
|
-
left: -20%;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
@media (min-width: 768px) {
|
|
69
|
-
cfa-blob {
|
|
70
|
-
left: auto;
|
|
71
|
-
width: 100%;
|
|
72
|
-
height: 200%;
|
|
73
|
-
top: -50%;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
::slotted(*) {
|
|
78
|
-
margin-block: 0 !important;
|
|
79
|
-
}
|
|
80
|
-
`,
|
|
81
|
-
];
|
|
82
|
-
|
|
83
|
-
render() {
|
|
84
|
-
return html`
|
|
85
|
-
<div class="cta">
|
|
86
|
-
<div class="blob">
|
|
87
|
-
<cfa-blob></cfa-blob>
|
|
88
|
-
</div>
|
|
89
|
-
<div class="content">
|
|
90
|
-
<slot />
|
|
91
|
-
</div>
|
|
92
|
-
</div>
|
|
93
|
-
`;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
if (!customElements.get("cfa-cta")) {
|
|
98
|
-
customElements.define("cfa-cta", CTA);
|
|
99
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { html } from "lit-html";
|
|
2
|
-
import "./cta";
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
title: "Organisms/CTA",
|
|
6
|
-
argTypes: {
|
|
7
|
-
content: { type: "string" },
|
|
8
|
-
},
|
|
9
|
-
parameters: {
|
|
10
|
-
layout: "fullscreen",
|
|
11
|
-
},
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const Template = ({ content }) => html`
|
|
15
|
-
<cfa-cta .innerHTML="${content}"> </cfa-cta>
|
|
16
|
-
`;
|
|
17
|
-
|
|
18
|
-
export const Default = Template.bind({});
|
|
19
|
-
Default.args = {
|
|
20
|
-
content:
|
|
21
|
-
'<div class="h3">Is your state ready to transform food assistance delivery?</div><p>Let’s work together to improve government in meaningful ways.</p><div><a href="#" class="cfa-button cfa-button--white">Partner with us</a></div>',
|
|
22
|
-
};
|