@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.
- package/dist/styles.css +1 -1
- package/package.json +2 -1
- package/src/components/accordion.js +141 -0
- package/src/components/accordion.stories.js +56 -0
- package/src/components/avatar.js +62 -0
- package/src/components/avatar.stories.js +27 -0
- package/src/components/banner.js +152 -0
- package/src/components/banner.stories.js +115 -0
- package/src/components/bar.js +102 -0
- package/src/components/bar.stories.js +22 -0
- package/src/components/blob.js +119 -0
- package/src/components/blob.stories.js +64 -0
- package/src/components/box.js +55 -0
- package/src/components/box.stories.js +24 -0
- package/src/components/breadcrumbs.js +80 -0
- package/src/components/breadcrumbs.stories.js +27 -0
- package/src/components/button.js +167 -0
- package/src/components/button.scss +162 -0
- package/src/components/button.stories.js +49 -0
- package/src/components/callout.js +62 -0
- package/src/components/callout.stories.js +20 -0
- package/src/components/card.js +403 -0
- package/src/components/card.stories.js +170 -0
- package/src/components/carousel.js +182 -0
- package/src/components/carousel.stories.js +61 -0
- package/src/components/cta.js +99 -0
- package/src/components/cta.stories.js +22 -0
- package/src/components/details.scss +71 -0
- package/src/components/details.stories.js +27 -0
- package/src/components/flexible-layout.js +126 -0
- package/src/components/flexible-layout.stories.js +48 -0
- package/src/components/form-elements.scss +305 -0
- package/src/components/form-elements.stories.js +134 -0
- package/src/components/icon.js +41 -0
- package/src/components/icon.scss +31 -0
- package/src/components/icon.stories.js +16 -0
- package/src/components/label.js +63 -0
- package/src/components/label.stories.js +29 -0
- package/src/components/link-list.scss +80 -0
- package/src/components/link-list.stories.js +52 -0
- package/src/components/loader.scss +24 -0
- package/src/components/loader.stories.js +12 -0
- package/src/components/logo-card.js +93 -0
- package/src/components/logo-card.stories.js +48 -0
- package/src/components/nav.js +99 -0
- package/src/components/nav.stories.js +40 -0
- package/src/components/page-nav.js +171 -0
- package/src/components/page-nav.stories.js +112 -0
- package/src/components/pager.js +98 -0
- package/src/components/pager.stories.js +30 -0
- package/src/components/pagination.js +116 -0
- package/src/components/pagination.stories.js +30 -0
- package/src/components/person-card.js +240 -0
- package/src/components/person-card.stories.js +58 -0
- package/src/components/pill.js +33 -0
- package/src/components/pill.stories.js +23 -0
- package/src/components/promo.js +83 -0
- package/src/components/promo.stories.js +37 -0
- package/src/components/pullquote.js +42 -0
- package/src/components/pullquote.stories.js +16 -0
- package/src/components/quote.js +84 -0
- package/src/components/quote.stories.js +23 -0
- package/src/components/reveal.js +83 -0
- package/src/components/reveal.stories.js +40 -0
- package/src/components/slide.js +121 -0
- package/src/components/slide.stories.js +53 -0
- package/src/components/social-icon.js +233 -0
- package/src/components/social-icon.stories.js +36 -0
- package/src/components/stat.js +92 -0
- package/src/components/stat.stories.js +28 -0
- package/src/components/tab-list.js +114 -0
- package/src/components/tab-list.stories.js +18 -0
- package/src/components/tab.js +95 -0
- package/src/components/tab.stories.js +29 -0
- package/src/components/tile.js +150 -0
- package/src/components/tile.stories.js +41 -0
- package/src/components/transcript.js +44 -0
- package/src/components/transcript.stories.js +167 -0
- package/src/core/base.scss +86 -0
- package/src/core/colors.mdx +100 -0
- package/src/core/grid.mdx +14 -0
- package/src/core/grid.scss +295 -0
- package/src/core/helpers.scss +111 -0
- package/src/core/layout.scss +79 -0
- package/src/core/reset.scss +53 -0
- package/src/core/tokens.scss +251 -0
- package/src/core/typography.mdx +66 -0
- package/src/core/typography.scss +426 -0
- package/src/shared/common.js +15 -0
- package/src/shared/layout.js +14 -0
- package/src/shared/typography.js +111 -0
- package/src/styles.scss +15 -0
|
@@ -0,0 +1,152 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { LitElement, html, css } from "lit";
|
|
2
|
+
import { commonStyles } from "../shared/common";
|
|
3
|
+
|
|
4
|
+
class Bar extends LitElement {
|
|
5
|
+
static properties = {
|
|
6
|
+
theme: {},
|
|
7
|
+
};
|
|
8
|
+
static styles = [
|
|
9
|
+
commonStyles,
|
|
10
|
+
css`
|
|
11
|
+
:host {
|
|
12
|
+
--bg-color: var(--purple-80);
|
|
13
|
+
--text-color: var(--white);
|
|
14
|
+
--link-color: var(--white);
|
|
15
|
+
--link-hover-color: var(--white);
|
|
16
|
+
--scrollbar-color: var(--white);
|
|
17
|
+
--spacing: var(--spacing-layout-half);
|
|
18
|
+
|
|
19
|
+
display: block;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.bar {
|
|
23
|
+
background-color: var(--bg-color);
|
|
24
|
+
color: var(--text-color);
|
|
25
|
+
|
|
26
|
+
a {
|
|
27
|
+
color: var(--link-color);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
a:hover {
|
|
31
|
+
color: var(--link-hover-color);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.content {
|
|
36
|
+
display: flex;
|
|
37
|
+
column-gap: var(--spacing);
|
|
38
|
+
justify-content: center;
|
|
39
|
+
overflow-x: auto;
|
|
40
|
+
overflow-y: hidden;
|
|
41
|
+
padding-bottom: var(--spacing-layout-half);
|
|
42
|
+
padding-top: var(--spacing-layout-half);
|
|
43
|
+
scrollbar-color: var(--scrollbar-color) var(--bg-color);
|
|
44
|
+
scrollbar-width: thin;
|
|
45
|
+
|
|
46
|
+
&::before,
|
|
47
|
+
&::after {
|
|
48
|
+
content: "";
|
|
49
|
+
flex-basis: calc(var(--outer-margin) - var(--spacing));
|
|
50
|
+
flex-shrink: 0;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.content.is-overflowing {
|
|
55
|
+
justify-content: start;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
::slotted(*) {
|
|
59
|
+
max-width: none !important;
|
|
60
|
+
white-space: nowrap !important;
|
|
61
|
+
}
|
|
62
|
+
`,
|
|
63
|
+
];
|
|
64
|
+
|
|
65
|
+
// Check if the content is overflowing and add a class
|
|
66
|
+
|
|
67
|
+
firstUpdated() {
|
|
68
|
+
const content = this.shadowRoot.querySelector('.content');
|
|
69
|
+
const toggleOverflowClass = elem => {
|
|
70
|
+
elem.classList.toggle('is-overflowing', elem.scrollWidth > elem.clientWidth);
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
if ('ResizeObserver' in window) {
|
|
74
|
+
new ResizeObserver(entries => {
|
|
75
|
+
toggleOverflowClass(entries[0].target);
|
|
76
|
+
}).observe(content);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if ('MutationObserver' in window) {
|
|
80
|
+
new MutationObserver(() => {
|
|
81
|
+
toggleOverflowClass(content);
|
|
82
|
+
}).observe(content, { childList: true });
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// Initial check
|
|
86
|
+
toggleOverflowClass(content);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
render() {
|
|
90
|
+
return html`
|
|
91
|
+
<div class="bar">
|
|
92
|
+
<div class="content">
|
|
93
|
+
<slot></slot>
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
`;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
if (!customElements.get("cfa-bar")) {
|
|
101
|
+
customElements.define("cfa-bar", Bar);
|
|
102
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { html } from "lit-html";
|
|
2
|
+
import "./bar";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: "Molecules/Bar",
|
|
6
|
+
argTypes: {
|
|
7
|
+
content: { type: "string" },
|
|
8
|
+
},
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: "fullscreen",
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const Template = ({ content }) => html`
|
|
15
|
+
<cfa-bar .innerHTML="${content}"> </cfa-bar>
|
|
16
|
+
`;
|
|
17
|
+
|
|
18
|
+
export const Default = Template.bind({});
|
|
19
|
+
Default.args = {
|
|
20
|
+
content:
|
|
21
|
+
'<ul class="ul ul--inline small"><li class="strong">Find out about: </li><li><a href="#">Easy and Free State Filing for IRS Direct Filers</a></li><li><a href="#">Bloomberg: Texts can improve access to food assistance</a></li><li><a href="#">Benefits Enrollment Field Guide</a></li></ul>',
|
|
22
|
+
};
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { LitElement, html, css } from "lit";
|
|
2
|
+
import { commonStyles } from "../shared/common";
|
|
3
|
+
|
|
4
|
+
class Blob extends LitElement {
|
|
5
|
+
static properties = {
|
|
6
|
+
color: {},
|
|
7
|
+
shape: {},
|
|
8
|
+
styles: {},
|
|
9
|
+
};
|
|
10
|
+
static styles = [
|
|
11
|
+
commonStyles,
|
|
12
|
+
css`
|
|
13
|
+
:host {
|
|
14
|
+
--color: var(--blue-20);
|
|
15
|
+
|
|
16
|
+
display: block;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.blob,
|
|
20
|
+
svg {
|
|
21
|
+
height: 100%;
|
|
22
|
+
width: 100%;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
svg path {
|
|
26
|
+
fill: var(--color, #fff);
|
|
27
|
+
}
|
|
28
|
+
`,
|
|
29
|
+
];
|
|
30
|
+
constructor() {
|
|
31
|
+
super();
|
|
32
|
+
this.shape = "1";
|
|
33
|
+
}
|
|
34
|
+
blobTemplate() {
|
|
35
|
+
let svg;
|
|
36
|
+
switch (this.shape) {
|
|
37
|
+
case "1":
|
|
38
|
+
svg = html`<svg
|
|
39
|
+
width="628"
|
|
40
|
+
height="577"
|
|
41
|
+
viewBox="0 0 628 577"
|
|
42
|
+
fill="none"
|
|
43
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
44
|
+
>
|
|
45
|
+
<path
|
|
46
|
+
fill-rule="evenodd"
|
|
47
|
+
clip-rule="evenodd"
|
|
48
|
+
d="M304.482 3.44206C399.413 -5.50752 504.225 1.17063 567.446 72.5295C633.526 147.115 639.549 256.491 613.992 352.793C589.57 444.814 526.084 523.087 438.164 559.679C355.477 594.092 265.039 570.416 184.315 531.621C103.504 492.784 22.0294 438.546 3.59029 350.826C-14.5863 264.355 39.2746 183.666 97.1329 116.868C151.394 54.223 221.956 11.2221 304.482 3.44206Z"
|
|
49
|
+
/>
|
|
50
|
+
</svg>`;
|
|
51
|
+
break;
|
|
52
|
+
case "2":
|
|
53
|
+
svg = html`<svg
|
|
54
|
+
width="580"
|
|
55
|
+
height="592"
|
|
56
|
+
viewBox="0 0 580 592"
|
|
57
|
+
fill="none"
|
|
58
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
59
|
+
>
|
|
60
|
+
<path
|
|
61
|
+
d="M238.814 591.215C210.461 592.077 182.849 587.767 155.66 580.979C60.4457 557.059 4.05766 489.933 0.460672 390.376C-2.50155 306.442 8.71258 223.693 37.2769 144.499C73.2468 44.6185 170.894 -12.5948 276.159 2.81295C358.996 14.9883 437.177 39.3389 499.172 100.108C588.039 187.167 604.437 293.512 544.346 402.767C514.618 456.855 477.59 505.988 426.386 541.544C369.892 580.656 304.723 587.767 238.814 591.215Z"
|
|
62
|
+
/>
|
|
63
|
+
</svg>`;
|
|
64
|
+
break;
|
|
65
|
+
case "3":
|
|
66
|
+
svg = html`<svg
|
|
67
|
+
width="620"
|
|
68
|
+
height="613"
|
|
69
|
+
viewBox="0 0 620 613"
|
|
70
|
+
fill="none"
|
|
71
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
72
|
+
>
|
|
73
|
+
<path
|
|
74
|
+
fill-rule="evenodd"
|
|
75
|
+
clip-rule="evenodd"
|
|
76
|
+
d="M619.142 301.769C615.581 212.393 536.92 153.752 466.654 98.7402C397.998 44.9883 323.934 -10.5844 236.421 2.12929C141.656 15.8965 53.9975 76.8338 15.687 164.256C-20.6955 247.277 16.2818 336.243 54.5575 417.127C92.4807 497.265 137.965 580.831 224.139 604.752C314.166 629.742 409.183 593.817 484.092 536.359C559.738 478.336 622.883 395.641 619.142 301.769Z"
|
|
77
|
+
/>
|
|
78
|
+
</svg>`;
|
|
79
|
+
break;
|
|
80
|
+
case "4":
|
|
81
|
+
svg = html`<svg
|
|
82
|
+
width="656"
|
|
83
|
+
height="566"
|
|
84
|
+
viewBox="0 0 656 566"
|
|
85
|
+
fill="none"
|
|
86
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
87
|
+
>
|
|
88
|
+
<path
|
|
89
|
+
fill-rule="evenodd"
|
|
90
|
+
clip-rule="evenodd"
|
|
91
|
+
d="M332.011 564.695C235.808 569.34 135.091 552.4 71.2946 488.381C4.66596 421.518 -10.0767 327.738 8.2158 239.764C27.3773 147.61 73.5054 52.3693 169.88 14.2546C263.181 -22.6447 364.8 21.5179 455.491 62.8734C540.631 101.698 627.337 150.367 649.771 233.088C672.265 316.032 626.78 399.503 564.43 464.569C505.684 525.875 422.382 560.331 332.011 564.695Z"
|
|
92
|
+
/>
|
|
93
|
+
</svg>`;
|
|
94
|
+
break;
|
|
95
|
+
default:
|
|
96
|
+
svg = html`<svg
|
|
97
|
+
width="628"
|
|
98
|
+
height="577"
|
|
99
|
+
viewBox="0 0 628 577"
|
|
100
|
+
fill="none"
|
|
101
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
102
|
+
>
|
|
103
|
+
<path
|
|
104
|
+
fill-rule="evenodd"
|
|
105
|
+
clip-rule="evenodd"
|
|
106
|
+
d="M304.482 3.44206C399.413 -5.50752 504.225 1.17063 567.446 72.5295C633.526 147.115 639.549 256.491 613.992 352.793C589.57 444.814 526.084 523.087 438.164 559.679C355.477 594.092 265.039 570.416 184.315 531.621C103.504 492.784 22.0294 438.546 3.59029 350.826C-14.5863 264.355 39.2746 183.666 97.1329 116.868C151.394 54.223 221.956 11.2221 304.482 3.44206Z"
|
|
107
|
+
/>
|
|
108
|
+
</svg>`;
|
|
109
|
+
}
|
|
110
|
+
return svg;
|
|
111
|
+
}
|
|
112
|
+
render() {
|
|
113
|
+
return html` <div class="blob">${this.blobTemplate()}</div> `;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
if (!customElements.get("cfa-blob")) {
|
|
118
|
+
customElements.define("cfa-blob", Blob);
|
|
119
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { html } from "lit-html";
|
|
2
|
+
import "./blob";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: "Atoms/Blob",
|
|
6
|
+
argTypes: {
|
|
7
|
+
shape: {
|
|
8
|
+
options: ["1", "2", "3", "4"],
|
|
9
|
+
control: { type: "inline-radio" },
|
|
10
|
+
},
|
|
11
|
+
color: {
|
|
12
|
+
options: [
|
|
13
|
+
"white",
|
|
14
|
+
"gray-20",
|
|
15
|
+
"gray-40",
|
|
16
|
+
"gray-60",
|
|
17
|
+
"gray-80",
|
|
18
|
+
"sand-20",
|
|
19
|
+
"sand-40",
|
|
20
|
+
"sand-60",
|
|
21
|
+
"sand-80",
|
|
22
|
+
"purple-20",
|
|
23
|
+
"purple-40",
|
|
24
|
+
"purple-60",
|
|
25
|
+
"purple-80",
|
|
26
|
+
"red-20",
|
|
27
|
+
"red-40",
|
|
28
|
+
"red-60",
|
|
29
|
+
"red-80",
|
|
30
|
+
"green-20",
|
|
31
|
+
"green-40",
|
|
32
|
+
"green-60",
|
|
33
|
+
"green-80",
|
|
34
|
+
"blue-20",
|
|
35
|
+
"blue-40",
|
|
36
|
+
"blue-60",
|
|
37
|
+
"blue-80",
|
|
38
|
+
"yellow-20",
|
|
39
|
+
"yellow-40",
|
|
40
|
+
"yellow-60",
|
|
41
|
+
"yellow-80",
|
|
42
|
+
],
|
|
43
|
+
control: { type: "select" },
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const Template = ({ color, shape }) => html`
|
|
49
|
+
<cfa-blob
|
|
50
|
+
color="${color}"
|
|
51
|
+
shape="${shape}"
|
|
52
|
+
style="
|
|
53
|
+
height: var(--spacing-layout-6, 10rem);
|
|
54
|
+
width: var(--spacing-layout-6, 10rem);
|
|
55
|
+
"
|
|
56
|
+
>
|
|
57
|
+
</cfa-blob>
|
|
58
|
+
`;
|
|
59
|
+
|
|
60
|
+
export const Default = Template.bind({});
|
|
61
|
+
Default.args = {
|
|
62
|
+
color: "purple-40",
|
|
63
|
+
shape: "1",
|
|
64
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { LitElement, html, css } from "lit";
|
|
2
|
+
import { commonStyles } from "../shared/common";
|
|
3
|
+
|
|
4
|
+
class Box extends LitElement {
|
|
5
|
+
static properties = {
|
|
6
|
+
theme: {},
|
|
7
|
+
};
|
|
8
|
+
static styles = [
|
|
9
|
+
commonStyles,
|
|
10
|
+
css`
|
|
11
|
+
:host {
|
|
12
|
+
--bg-color: var(--white);
|
|
13
|
+
--padding: var(--spacing-component-4);
|
|
14
|
+
--shadow: var(--shadow-small);
|
|
15
|
+
--text-color: var(--black);
|
|
16
|
+
|
|
17
|
+
display: flex;
|
|
18
|
+
flex: 1;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.box {
|
|
22
|
+
background-color: var(--bg-color);
|
|
23
|
+
box-shadow: var(--shadow);
|
|
24
|
+
color: var(--text-color, #000);
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-direction: column;
|
|
27
|
+
gap: var(--spacing-layout-half);
|
|
28
|
+
padding: var(--padding);
|
|
29
|
+
width: 100%;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.box--rounded {
|
|
33
|
+
border-radius: var(--spacing-layout-half, 0.5rem);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
::slotted(*) {
|
|
37
|
+
--spacing: var(--spacing-layout-half);
|
|
38
|
+
|
|
39
|
+
max-width: 100%;
|
|
40
|
+
}
|
|
41
|
+
`,
|
|
42
|
+
];
|
|
43
|
+
|
|
44
|
+
render() {
|
|
45
|
+
return html`
|
|
46
|
+
<div class="box ${this.theme ? "box--" + this.theme : ""}">
|
|
47
|
+
<slot />
|
|
48
|
+
</div>
|
|
49
|
+
`;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (!customElements.get("cfa-box")) {
|
|
54
|
+
customElements.define("cfa-box", Box);
|
|
55
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { html } from "lit-html";
|
|
2
|
+
import "./box";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: "Molecules/Box",
|
|
6
|
+
argTypes: {
|
|
7
|
+
theme: {
|
|
8
|
+
defaultValue: "default",
|
|
9
|
+
options: ["default", "rounded"],
|
|
10
|
+
control: { type: "radio" },
|
|
11
|
+
},
|
|
12
|
+
content: { type: "string" },
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const Template = ({ theme, content }) => html`
|
|
17
|
+
<cfa-box theme="${theme}" .innerHTML="${content}"> </cfa-box>
|
|
18
|
+
`;
|
|
19
|
+
|
|
20
|
+
export const Default = Template.bind({});
|
|
21
|
+
Default.args = {
|
|
22
|
+
content:
|
|
23
|
+
"<p>We deploy <em>human-centered technology</em>, the kind that respects you from the start, meets you where you are, and provides an <strong>easy, positive experience</strong>.<p><a>Learn more</a></p>",
|
|
24
|
+
};
|