@noctuatech/uswds 0.0.33 → 0.0.35
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/assets/img/gog-logo.png +0 -0
- package/assets/img/wosb1.jpg +0 -0
- package/package.json +2 -4
- package/src/lib/checkbox/checkbox.element.ts +34 -9
- package/src/lib/checkbox/checkbox.stories.ts +2 -0
- package/src/lib/collection/collection-item/collection-item.element.ts +54 -0
- package/src/lib/collection/collection-item/collection-item.test.ts +15 -0
- package/src/lib/collection/collection.element.ts +24 -0
- package/src/lib/collection/collection.stories.ts +70 -0
- package/src/lib/collection/collection.test.ts +15 -0
- package/src/lib/define.ts +2 -0
- package/src/lib/radio/radio-option/radio-option.element.ts +9 -6
- package/src/lib/radio/radio.element.ts +22 -0
- package/src/lib/radio/radio.stories.ts +2 -7
- package/src/lib.ts +2 -0
- package/target/lib/checkbox/checkbox.element.d.ts +1 -0
- package/target/lib/checkbox/checkbox.element.js +40 -10
- package/target/lib/checkbox/checkbox.element.js.map +1 -1
- package/target/lib/checkbox/checkbox.stories.d.ts +1 -0
- package/target/lib/checkbox/checkbox.stories.js +2 -0
- package/target/lib/checkbox/checkbox.stories.js.map +1 -1
- package/target/lib/collection/collection-item/collection-item.element.d.ts +7 -0
- package/target/lib/collection/collection-item/collection-item.element.js +66 -0
- package/target/lib/collection/collection-item/collection-item.element.js.map +1 -0
- package/target/lib/collection/collection-item/collection-item.test.d.ts +1 -0
- package/target/lib/collection/collection-item/collection-item.test.js +11 -0
- package/target/lib/collection/collection-item/collection-item.test.js.map +1 -0
- package/target/lib/collection/collection.element.d.ts +7 -0
- package/target/lib/collection/collection.element.js +36 -0
- package/target/lib/collection/collection.element.js.map +1 -0
- package/target/lib/collection/collection.stories.d.ts +12 -0
- package/target/lib/collection/collection.stories.js +63 -0
- package/target/lib/collection/collection.stories.js.map +1 -0
- package/target/lib/collection/collection.test.d.ts +1 -0
- package/target/lib/collection/collection.test.js +11 -0
- package/target/lib/collection/collection.test.js.map +1 -0
- package/target/lib/define.d.ts +2 -0
- package/target/lib/define.js +2 -0
- package/target/lib/define.js.map +1 -1
- package/target/lib/radio/radio-option/radio-option.element.d.ts +1 -0
- package/target/lib/radio/radio-option/radio-option.element.js +15 -7
- package/target/lib/radio/radio-option/radio-option.element.js.map +1 -1
- package/target/lib/radio/radio.element.js +22 -0
- package/target/lib/radio/radio.element.js.map +1 -1
- package/target/lib/radio/radio.stories.d.ts +0 -1
- package/target/lib/radio/radio.stories.js +2 -4
- package/target/lib/radio/radio.stories.js.map +1 -1
- package/target/lib.d.ts +2 -0
- package/target/lib.js +2 -0
- package/target/lib.js.map +1 -1
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@noctuatech/uswds",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.35",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"workspaces": ["packages/**"],
|
|
6
6
|
"main": "./target/lib.js",
|
|
@@ -90,8 +90,6 @@
|
|
|
90
90
|
"wireit": "^0.14.9"
|
|
91
91
|
},
|
|
92
92
|
"lint-staged": {
|
|
93
|
-
"*": [
|
|
94
|
-
"biome check --write --no-errors-on-unmatched --files-ignore-unknown=true"
|
|
95
|
-
]
|
|
93
|
+
"*": ["biome check --write --no-errors-on-unmatched"]
|
|
96
94
|
}
|
|
97
95
|
}
|
|
@@ -49,11 +49,26 @@ declare global {
|
|
|
49
49
|
margin-right: 0.75rem;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
input:disabled + .checkbox {
|
|
53
|
+
background-color: #fff;
|
|
54
|
+
box-shadow: 0 0 0 2px #757575;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
input:disabled:is(:checked) + .checkbox {
|
|
58
|
+
background-color: #757575;
|
|
59
|
+
box-shadow: 0 0 0 2px #757575;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
:host([disabled]) label {
|
|
63
|
+
color: #757575;
|
|
64
|
+
cursor: not-allowed;
|
|
65
|
+
}
|
|
66
|
+
|
|
52
67
|
input:checked + .checkbox {
|
|
53
68
|
background-color: #005ea2;
|
|
54
69
|
box-shadow: 0 0 0 2px #005ea2;
|
|
55
70
|
}
|
|
56
|
-
|
|
71
|
+
|
|
57
72
|
input:checked + .checkbox::after {
|
|
58
73
|
content: " ";
|
|
59
74
|
display: block;
|
|
@@ -84,16 +99,15 @@ declare global {
|
|
|
84
99
|
height: 0;
|
|
85
100
|
}
|
|
86
101
|
|
|
87
|
-
.spacer {
|
|
88
|
-
height: 1.25rem;
|
|
89
|
-
width: 1.25rem;
|
|
90
|
-
margin-right: 0.75rem;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
102
|
:host([tiled]) label:has(input:checked) {
|
|
94
103
|
background-color: rgba(0, 94, 162, 0.1);
|
|
95
104
|
border-color: #005ea2;
|
|
96
105
|
}
|
|
106
|
+
|
|
107
|
+
:host([tiled]) label:has(input:checked:is(:disabled)) {
|
|
108
|
+
background-color: #fff;
|
|
109
|
+
border-color: #757575;
|
|
110
|
+
}
|
|
97
111
|
`,
|
|
98
112
|
html`
|
|
99
113
|
<label>
|
|
@@ -123,6 +137,9 @@ export class USACheckboxElement extends HTMLElement {
|
|
|
123
137
|
@attr()
|
|
124
138
|
accessor required = false;
|
|
125
139
|
|
|
140
|
+
@attr()
|
|
141
|
+
accessor disabled = false;
|
|
142
|
+
|
|
126
143
|
@attr({
|
|
127
144
|
observed: false,
|
|
128
145
|
})
|
|
@@ -133,13 +150,21 @@ export class USACheckboxElement extends HTMLElement {
|
|
|
133
150
|
#internals = this.attachInternals();
|
|
134
151
|
|
|
135
152
|
connectedCallback() {
|
|
136
|
-
this.#checkbox({
|
|
153
|
+
this.#checkbox({
|
|
154
|
+
checked: this.checked,
|
|
155
|
+
name: this.name,
|
|
156
|
+
disabled: this.disabled,
|
|
157
|
+
});
|
|
137
158
|
|
|
138
159
|
this.#syncFormState();
|
|
139
160
|
}
|
|
140
161
|
|
|
141
162
|
attributeChangedCallback() {
|
|
142
|
-
this.#checkbox({
|
|
163
|
+
this.#checkbox({
|
|
164
|
+
checked: this.checked,
|
|
165
|
+
name: this.name,
|
|
166
|
+
disabled: this.disabled,
|
|
167
|
+
});
|
|
143
168
|
|
|
144
169
|
this.#syncFormState();
|
|
145
170
|
}
|
|
@@ -17,6 +17,7 @@ const meta = {
|
|
|
17
17
|
value=${ifDefined(args.value)}
|
|
18
18
|
checked=${ifDefined(args.checked)}
|
|
19
19
|
?tiled=${args.tiled}
|
|
20
|
+
?disabled=${args.disabled}
|
|
20
21
|
>
|
|
21
22
|
Hello World
|
|
22
23
|
${when(
|
|
@@ -44,6 +45,7 @@ const meta = {
|
|
|
44
45
|
name: "toc",
|
|
45
46
|
value: "agree",
|
|
46
47
|
tiled: false,
|
|
48
|
+
disabled: false,
|
|
47
49
|
},
|
|
48
50
|
} satisfies Meta<USACheckboxElement & { description: string }>;
|
|
49
51
|
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { css, element, html } from "@joist/element";
|
|
2
|
+
|
|
3
|
+
declare global {
|
|
4
|
+
interface HTMLElementTagNameMap {
|
|
5
|
+
"usa-collection-item": USACollectionItemElement;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
@element({
|
|
10
|
+
tagName: "usa-collection-item",
|
|
11
|
+
shadowDom: [
|
|
12
|
+
css`
|
|
13
|
+
:host {
|
|
14
|
+
display: flex;
|
|
15
|
+
gap: 1rem;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.content {
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
slot[name="heading"]::slotted(*) {
|
|
24
|
+
font-size: 1.13rem;
|
|
25
|
+
line-height: 1.3;
|
|
26
|
+
margin-bottom: 0;
|
|
27
|
+
margin-top: 0;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.description {
|
|
31
|
+
margin-bottom: .5rem;
|
|
32
|
+
margin-top: .5rem;
|
|
33
|
+
}
|
|
34
|
+
`,
|
|
35
|
+
html`
|
|
36
|
+
<slot name="img"></slot>
|
|
37
|
+
|
|
38
|
+
<div class="content">
|
|
39
|
+
<div class="heading">
|
|
40
|
+
<slot name="heading"></slot>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<div class="description">
|
|
44
|
+
<slot name="description"></slot>
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
<div class="meta">
|
|
48
|
+
<slot name="meta"></slot>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
`,
|
|
52
|
+
],
|
|
53
|
+
})
|
|
54
|
+
export class USACollectionItemElement extends HTMLElement {}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import "./collection-item.element.js";
|
|
2
|
+
|
|
3
|
+
import { assert, fixture, html } from "@open-wc/testing";
|
|
4
|
+
|
|
5
|
+
import type { USACollectionItemElement } from "./collection-item.element.js";
|
|
6
|
+
|
|
7
|
+
describe("usa-collection-item", () => {
|
|
8
|
+
it("should be accessible", async () => {
|
|
9
|
+
const collectionItem = await fixture<USACollectionItemElement>(html`
|
|
10
|
+
<usa-collection-item>Hello World</usa-collection-item>
|
|
11
|
+
`);
|
|
12
|
+
|
|
13
|
+
return assert.isAccessible(collectionItem);
|
|
14
|
+
});
|
|
15
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { css, element, html } from "@joist/element";
|
|
2
|
+
|
|
3
|
+
declare global {
|
|
4
|
+
interface HTMLElementTagNameMap {
|
|
5
|
+
"usa-collection": USACollectionElement;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
@element({
|
|
10
|
+
tagName: "usa-collection",
|
|
11
|
+
shadowDom: [
|
|
12
|
+
css`
|
|
13
|
+
:host {
|
|
14
|
+
display: grid;
|
|
15
|
+
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
|
|
16
|
+
gap: 2rem;
|
|
17
|
+
}
|
|
18
|
+
`,
|
|
19
|
+
html`
|
|
20
|
+
<slot></slot>
|
|
21
|
+
`,
|
|
22
|
+
],
|
|
23
|
+
})
|
|
24
|
+
export class USACollectionElement extends HTMLElement {}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/web-components";
|
|
2
|
+
import { html } from "lit";
|
|
3
|
+
|
|
4
|
+
import type { USACollectionElement } from "./collection.element.js";
|
|
5
|
+
|
|
6
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
7
|
+
const meta = {
|
|
8
|
+
title: "usa-collection",
|
|
9
|
+
tags: ["autodocs"],
|
|
10
|
+
render(args) {
|
|
11
|
+
return html`
|
|
12
|
+
<usa-collection>
|
|
13
|
+
<usa-collection-item>
|
|
14
|
+
<h4 slot="heading">
|
|
15
|
+
<usa-link href="#">Gears of Government President's Award winners</usa-link>
|
|
16
|
+
</h4>
|
|
17
|
+
|
|
18
|
+
<div slot="description">
|
|
19
|
+
Today, the Administration announces the winners of the Gears of Government President’s Award. This program recognizes the contributions of individuals and teams across the federal workforce who make a profound difference in the lives of the American people.
|
|
20
|
+
</div>
|
|
21
|
+
</usa-collection-item>
|
|
22
|
+
|
|
23
|
+
<usa-collection-item>
|
|
24
|
+
<img height="80" width="80" src="/assets/img/gog-logo.png" slot="img"/>
|
|
25
|
+
|
|
26
|
+
<h4 slot="heading">
|
|
27
|
+
<usa-link href="#">Gears of Government President's Award winners</usa-link>
|
|
28
|
+
</h4>
|
|
29
|
+
|
|
30
|
+
<div slot="description">
|
|
31
|
+
Today, the Administration announces the winners of the Gears of Government President’s Award. This program recognizes the contributions of individuals and teams across the federal workforce who make a profound difference in the lives of the American people.
|
|
32
|
+
</div>
|
|
33
|
+
</usa-collection-item>
|
|
34
|
+
|
|
35
|
+
<usa-collection-item>
|
|
36
|
+
<h4 slot="heading">
|
|
37
|
+
<usa-link href="#">Women-owned small business dashboard</usa-link>
|
|
38
|
+
</h4>
|
|
39
|
+
|
|
40
|
+
<div slot="description">
|
|
41
|
+
In honor of National Women's Small Business Month, we've partnered with SBA's Office of Government Contracting and Business Development and Office of Program Performance, Analysis, and Evaluation to highlight the Women-Owned Small Businesses (WOSBs) data dashboard!
|
|
42
|
+
</div>
|
|
43
|
+
</usa-collection-item>
|
|
44
|
+
|
|
45
|
+
<usa-collection-item>
|
|
46
|
+
<img height="52" width="80" src="/assets/img/wosb1.jpg" slot="img"/>
|
|
47
|
+
|
|
48
|
+
<h4 slot="heading">
|
|
49
|
+
<usa-link href="#">Women-owned small business dashboard</usa-link>
|
|
50
|
+
</h4>
|
|
51
|
+
|
|
52
|
+
<div slot="description">
|
|
53
|
+
In honor of National Women's Small Business Month, we've partnered with SBA's Office of Government Contracting and Business Development and Office of Program Performance, Analysis, and Evaluation to highlight the Women-Owned Small Businesses (WOSBs) data dashboard!
|
|
54
|
+
</div>
|
|
55
|
+
</usa-collection-item>
|
|
56
|
+
</usa-collection>
|
|
57
|
+
`;
|
|
58
|
+
},
|
|
59
|
+
argTypes: {},
|
|
60
|
+
args: {},
|
|
61
|
+
} satisfies Meta<USACollectionElement>;
|
|
62
|
+
|
|
63
|
+
export default meta;
|
|
64
|
+
|
|
65
|
+
type Story = StoryObj<USACollectionElement>;
|
|
66
|
+
|
|
67
|
+
// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
|
|
68
|
+
export const Primary: Story = {
|
|
69
|
+
args: {},
|
|
70
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import "./collection.element.js";
|
|
2
|
+
|
|
3
|
+
import { assert, fixture, html } from "@open-wc/testing";
|
|
4
|
+
|
|
5
|
+
import type { USACollectionElement } from "./collection.element.js";
|
|
6
|
+
|
|
7
|
+
describe("usa-collection", () => {
|
|
8
|
+
it("should be accessible", async () => {
|
|
9
|
+
const collection = await fixture<USACollectionElement>(html`
|
|
10
|
+
<usa-collection>Hello World</usa-collection>
|
|
11
|
+
`);
|
|
12
|
+
|
|
13
|
+
return assert.isAccessible(collection);
|
|
14
|
+
});
|
|
15
|
+
});
|
package/src/lib/define.ts
CHANGED
|
@@ -30,3 +30,5 @@ import "./card/card-footer/card-footer.element.js";
|
|
|
30
30
|
import "./card/card-media/card-media.element.js";
|
|
31
31
|
import "./card/card-group/card-group.element.js";
|
|
32
32
|
import "./textarea/textarea.element.js";
|
|
33
|
+
import "./collection/collection.element.js";
|
|
34
|
+
import "./collection/collection-item/collection-item.element.js";
|
|
@@ -37,6 +37,9 @@ export class USARadioOptionElement extends HTMLElement {
|
|
|
37
37
|
@attr()
|
|
38
38
|
accessor value = "";
|
|
39
39
|
|
|
40
|
+
@attr()
|
|
41
|
+
accessor disabled = false;
|
|
42
|
+
|
|
40
43
|
#label = query("label");
|
|
41
44
|
#input = query("input");
|
|
42
45
|
#slot = query("slot");
|
|
@@ -52,7 +55,7 @@ export class USARadioOptionElement extends HTMLElement {
|
|
|
52
55
|
});
|
|
53
56
|
|
|
54
57
|
attributeChangedCallback() {
|
|
55
|
-
this.#input({ value: this.value });
|
|
58
|
+
this.#input({ value: this.value, disabled: this.disabled });
|
|
56
59
|
this.#slot({ name: this.value });
|
|
57
60
|
|
|
58
61
|
this.slot = this.value;
|
|
@@ -60,16 +63,16 @@ export class USARadioOptionElement extends HTMLElement {
|
|
|
60
63
|
|
|
61
64
|
@injected()
|
|
62
65
|
onInjected() {
|
|
63
|
-
const
|
|
66
|
+
const radioCtx = this.#radio();
|
|
64
67
|
|
|
65
|
-
|
|
68
|
+
radioCtx.addRadioOption(this.#label());
|
|
66
69
|
|
|
67
70
|
this.#input({
|
|
68
|
-
name:
|
|
69
|
-
checked:
|
|
71
|
+
name: radioCtx.name,
|
|
72
|
+
checked: radioCtx.value === this.value,
|
|
70
73
|
});
|
|
71
74
|
|
|
72
|
-
this.#observer.observe(
|
|
75
|
+
this.#observer.observe(radioCtx, {
|
|
73
76
|
attributeFilter: ["value", "name"],
|
|
74
77
|
});
|
|
75
78
|
}
|
|
@@ -61,6 +61,23 @@ declare global {
|
|
|
61
61
|
inset 0 0 0 2px #fff;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
+
label:has(input:checked:is(:disabled))::before {
|
|
65
|
+
background-color: #757575;
|
|
66
|
+
box-shadow:
|
|
67
|
+
0 0 0 2px #757575,
|
|
68
|
+
inset 0 0 0 2px #fff;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
label:has(input:disabled) {
|
|
72
|
+
cursor: not-allowed;
|
|
73
|
+
color: #757575 !important;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
label:has(input:disabled)::before {
|
|
77
|
+
background-color: #fff;
|
|
78
|
+
box-shadow: 0 0 0 2px #757575;
|
|
79
|
+
}
|
|
80
|
+
|
|
64
81
|
label:has(input:focus)::before {
|
|
65
82
|
outline: 0.25rem solid var(--usa-radio-focus-color);
|
|
66
83
|
outline-offset: 0.25rem;
|
|
@@ -83,6 +100,11 @@ declare global {
|
|
|
83
100
|
border-color: var(--usa-radio-active-color);
|
|
84
101
|
}
|
|
85
102
|
|
|
103
|
+
:host([tiled]) label:has(input:checked:is(:disabled)) {
|
|
104
|
+
background-color: #fff;
|
|
105
|
+
border-color: #757575;
|
|
106
|
+
}
|
|
107
|
+
|
|
86
108
|
slot {
|
|
87
109
|
display: flex;
|
|
88
110
|
}
|
|
@@ -23,17 +23,14 @@ const meta = {
|
|
|
23
23
|
|
|
24
24
|
<usa-radio-option value="frederick-douglass">
|
|
25
25
|
Frederick Douglass
|
|
26
|
-
|
|
27
|
-
args.description,
|
|
28
|
-
() => html`<usa-description>${args.description}</usa-description>`,
|
|
29
|
-
)}
|
|
26
|
+
<usa-description>This is optional text that can be used to describe the label in more detail.</usa-description>
|
|
30
27
|
</usa-radio-option>
|
|
31
28
|
|
|
32
29
|
<usa-radio-option value="booker-t-washington">
|
|
33
30
|
Booker T. Washington
|
|
34
31
|
</usa-radio-option>
|
|
35
32
|
|
|
36
|
-
<usa-radio-option value="george-washington-carver">
|
|
33
|
+
<usa-radio-option value="george-washington-carver" disabled>
|
|
37
34
|
George Washington Carver
|
|
38
35
|
</usa-radio-option>
|
|
39
36
|
</usa-radio>
|
|
@@ -42,8 +39,6 @@ const meta = {
|
|
|
42
39
|
argTypes: {},
|
|
43
40
|
args: {
|
|
44
41
|
tiled: true,
|
|
45
|
-
description:
|
|
46
|
-
"This is optional text that can be used to describe the label in more detail.",
|
|
47
42
|
},
|
|
48
43
|
} satisfies Meta<USARadioElement & { description: string }>;
|
|
49
44
|
|
package/src/lib.ts
CHANGED
|
@@ -30,3 +30,5 @@ export { USACardFooterElement } from "./lib/card/card-footer/card-footer.element
|
|
|
30
30
|
export { USACardImgElement } from "./lib/card/card-media/card-media.element.js";
|
|
31
31
|
export { USACardGroupElement } from "./lib/card/card-group/card-group.element.js";
|
|
32
32
|
export { USATextareaElement } from "./lib/textarea/textarea.element.js";
|
|
33
|
+
export { USACollectionElement } from "./lib/collection/collection.element.js";
|
|
34
|
+
export { USACollectionItemElement } from "./lib/collection/collection-item/collection-item.element.js";
|
|
@@ -10,6 +10,7 @@ export declare class USACheckboxElement extends HTMLElement {
|
|
|
10
10
|
accessor name: string;
|
|
11
11
|
accessor value: string;
|
|
12
12
|
accessor required: boolean;
|
|
13
|
+
accessor disabled: boolean;
|
|
13
14
|
accessor tiled: boolean;
|
|
14
15
|
connectedCallback(): void;
|
|
15
16
|
attributeChangedCallback(): void;
|
|
@@ -44,11 +44,26 @@ let USACheckboxElement = (() => {
|
|
|
44
44
|
margin-right: 0.75rem;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
+
input:disabled + .checkbox {
|
|
48
|
+
background-color: #fff;
|
|
49
|
+
box-shadow: 0 0 0 2px #757575;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
input:disabled:is(:checked) + .checkbox {
|
|
53
|
+
background-color: #757575;
|
|
54
|
+
box-shadow: 0 0 0 2px #757575;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
:host([disabled]) label {
|
|
58
|
+
color: #757575;
|
|
59
|
+
cursor: not-allowed;
|
|
60
|
+
}
|
|
61
|
+
|
|
47
62
|
input:checked + .checkbox {
|
|
48
63
|
background-color: #005ea2;
|
|
49
64
|
box-shadow: 0 0 0 2px #005ea2;
|
|
50
65
|
}
|
|
51
|
-
|
|
66
|
+
|
|
52
67
|
input:checked + .checkbox::after {
|
|
53
68
|
content: " ";
|
|
54
69
|
display: block;
|
|
@@ -79,16 +94,15 @@ let USACheckboxElement = (() => {
|
|
|
79
94
|
height: 0;
|
|
80
95
|
}
|
|
81
96
|
|
|
82
|
-
.spacer {
|
|
83
|
-
height: 1.25rem;
|
|
84
|
-
width: 1.25rem;
|
|
85
|
-
margin-right: 0.75rem;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
97
|
:host([tiled]) label:has(input:checked) {
|
|
89
98
|
background-color: rgba(0, 94, 162, 0.1);
|
|
90
99
|
border-color: #005ea2;
|
|
91
100
|
}
|
|
101
|
+
|
|
102
|
+
:host([tiled]) label:has(input:checked:is(:disabled)) {
|
|
103
|
+
background-color: #fff;
|
|
104
|
+
border-color: #757575;
|
|
105
|
+
}
|
|
92
106
|
`,
|
|
93
107
|
html `
|
|
94
108
|
<label>
|
|
@@ -120,6 +134,9 @@ let USACheckboxElement = (() => {
|
|
|
120
134
|
let _required_decorators;
|
|
121
135
|
let _required_initializers = [];
|
|
122
136
|
let _required_extraInitializers = [];
|
|
137
|
+
let _disabled_decorators;
|
|
138
|
+
let _disabled_initializers = [];
|
|
139
|
+
let _disabled_extraInitializers = [];
|
|
123
140
|
let _tiled_decorators;
|
|
124
141
|
let _tiled_initializers = [];
|
|
125
142
|
let _tiled_extraInitializers = [];
|
|
@@ -132,6 +149,7 @@ let USACheckboxElement = (() => {
|
|
|
132
149
|
_name_decorators = [attr()];
|
|
133
150
|
_value_decorators = [attr()];
|
|
134
151
|
_required_decorators = [attr()];
|
|
152
|
+
_disabled_decorators = [attr()];
|
|
135
153
|
_tiled_decorators = [attr({
|
|
136
154
|
observed: false,
|
|
137
155
|
})];
|
|
@@ -140,6 +158,7 @@ let USACheckboxElement = (() => {
|
|
|
140
158
|
__esDecorate(this, null, _name_decorators, { kind: "accessor", name: "name", static: false, private: false, access: { has: obj => "name" in obj, get: obj => obj.name, set: (obj, value) => { obj.name = value; } }, metadata: _metadata }, _name_initializers, _name_extraInitializers);
|
|
141
159
|
__esDecorate(this, null, _value_decorators, { kind: "accessor", name: "value", static: false, private: false, access: { has: obj => "value" in obj, get: obj => obj.value, set: (obj, value) => { obj.value = value; } }, metadata: _metadata }, _value_initializers, _value_extraInitializers);
|
|
142
160
|
__esDecorate(this, null, _required_decorators, { kind: "accessor", name: "required", static: false, private: false, access: { has: obj => "required" in obj, get: obj => obj.required, set: (obj, value) => { obj.required = value; } }, metadata: _metadata }, _required_initializers, _required_extraInitializers);
|
|
161
|
+
__esDecorate(this, null, _disabled_decorators, { kind: "accessor", name: "disabled", static: false, private: false, access: { has: obj => "disabled" in obj, get: obj => obj.disabled, set: (obj, value) => { obj.disabled = value; } }, metadata: _metadata }, _disabled_initializers, _disabled_extraInitializers);
|
|
143
162
|
__esDecorate(this, null, _tiled_decorators, { kind: "accessor", name: "tiled", static: false, private: false, access: { has: obj => "tiled" in obj, get: obj => obj.tiled, set: (obj, value) => { obj.tiled = value; } }, metadata: _metadata }, _tiled_initializers, _tiled_extraInitializers);
|
|
144
163
|
__esDecorate(this, null, _onCheckboxChange_decorators, { kind: "method", name: "onCheckboxChange", static: false, private: false, access: { has: obj => "onCheckboxChange" in obj, get: obj => obj.onCheckboxChange }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
145
164
|
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
@@ -159,17 +178,28 @@ let USACheckboxElement = (() => {
|
|
|
159
178
|
#required_accessor_storage = (__runInitializers(this, _value_extraInitializers), __runInitializers(this, _required_initializers, false));
|
|
160
179
|
get required() { return this.#required_accessor_storage; }
|
|
161
180
|
set required(value) { this.#required_accessor_storage = value; }
|
|
162
|
-
#
|
|
181
|
+
#disabled_accessor_storage = (__runInitializers(this, _required_extraInitializers), __runInitializers(this, _disabled_initializers, false));
|
|
182
|
+
get disabled() { return this.#disabled_accessor_storage; }
|
|
183
|
+
set disabled(value) { this.#disabled_accessor_storage = value; }
|
|
184
|
+
#tiled_accessor_storage = (__runInitializers(this, _disabled_extraInitializers), __runInitializers(this, _tiled_initializers, false));
|
|
163
185
|
get tiled() { return this.#tiled_accessor_storage; }
|
|
164
186
|
set tiled(value) { this.#tiled_accessor_storage = value; }
|
|
165
187
|
#checkbox = (__runInitializers(this, _tiled_extraInitializers), query("input"));
|
|
166
188
|
#internals = this.attachInternals();
|
|
167
189
|
connectedCallback() {
|
|
168
|
-
this.#checkbox({
|
|
190
|
+
this.#checkbox({
|
|
191
|
+
checked: this.checked,
|
|
192
|
+
name: this.name,
|
|
193
|
+
disabled: this.disabled,
|
|
194
|
+
});
|
|
169
195
|
this.#syncFormState();
|
|
170
196
|
}
|
|
171
197
|
attributeChangedCallback() {
|
|
172
|
-
this.#checkbox({
|
|
198
|
+
this.#checkbox({
|
|
199
|
+
checked: this.checked,
|
|
200
|
+
name: this.name,
|
|
201
|
+
disabled: this.disabled,
|
|
202
|
+
});
|
|
173
203
|
this.#syncFormState();
|
|
174
204
|
}
|
|
175
205
|
onCheckboxChange() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.element.js","sourceRoot":"","sources":["../../../src/lib/checkbox/checkbox.element.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"checkbox.element.js","sourceRoot":"","sources":["../../../src/lib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,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;YACrC,CAAC;YAED,IAAI,IAAI,CAAC,QAAQ,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;gBACvC,IAAI,CAAC,UAAU,CAAC,WAAW,CACzB,EAAE,YAAY,EAAE,IAAI,EAAE,EACtB,8CAA8C,EAC9C,IAAI,CAAC,SAAS,EAAE,CACjB,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;YAClC,CAAC;QACH,CAAC;;YAzEU,uDAAkB;;;;;SAAlB,kBAAkB"}
|
|
@@ -12,6 +12,7 @@ const meta = {
|
|
|
12
12
|
value=${ifDefined(args.value)}
|
|
13
13
|
checked=${ifDefined(args.checked)}
|
|
14
14
|
?tiled=${args.tiled}
|
|
15
|
+
?disabled=${args.disabled}
|
|
15
16
|
>
|
|
16
17
|
Hello World
|
|
17
18
|
${when(args.description, () => html `<usa-description>${args.description}</usa-description>`)}
|
|
@@ -36,6 +37,7 @@ const meta = {
|
|
|
36
37
|
name: "toc",
|
|
37
38
|
value: "agree",
|
|
38
39
|
tiled: false,
|
|
40
|
+
disabled: false,
|
|
39
41
|
},
|
|
40
42
|
};
|
|
41
43
|
export default meta;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.stories.js","sourceRoot":"","sources":["../../../src/lib/checkbox/checkbox.stories.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAE3B,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAI9C,kFAAkF;AAClF,MAAM,IAAI,GAAG;IACX,KAAK,EAAE,cAAc;IACrB,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,MAAM,CAAC,IAAI;QACT,OAAO,IAAI,CAAA;;e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M,OAAO,GAAU;IAC5B,IAAI,EAAE,EAAE;CACT,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { __esDecorate, __runInitializers } from "tslib";
|
|
2
|
+
import { css, element, html } from "@joist/element";
|
|
3
|
+
let USACollectionItemElement = (() => {
|
|
4
|
+
let _classDecorators = [element({
|
|
5
|
+
tagName: "usa-collection-item",
|
|
6
|
+
shadowDom: [
|
|
7
|
+
css `
|
|
8
|
+
:host {
|
|
9
|
+
display: flex;
|
|
10
|
+
gap: 1rem;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.content {
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
slot[name="heading"]::slotted(*) {
|
|
19
|
+
font-size: 1.13rem;
|
|
20
|
+
line-height: 1.3;
|
|
21
|
+
margin-bottom: 0;
|
|
22
|
+
margin-top: 0;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.description {
|
|
26
|
+
margin-bottom: .5rem;
|
|
27
|
+
margin-top: .5rem;
|
|
28
|
+
}
|
|
29
|
+
`,
|
|
30
|
+
html `
|
|
31
|
+
<slot name="img"></slot>
|
|
32
|
+
|
|
33
|
+
<div class="content">
|
|
34
|
+
<div class="heading">
|
|
35
|
+
<slot name="heading"></slot>
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
<div class="description">
|
|
39
|
+
<slot name="description"></slot>
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
<div class="meta">
|
|
43
|
+
<slot name="meta"></slot>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
`,
|
|
47
|
+
],
|
|
48
|
+
})];
|
|
49
|
+
let _classDescriptor;
|
|
50
|
+
let _classExtraInitializers = [];
|
|
51
|
+
let _classThis;
|
|
52
|
+
let _classSuper = HTMLElement;
|
|
53
|
+
var USACollectionItemElement = class extends _classSuper {
|
|
54
|
+
static { _classThis = this; }
|
|
55
|
+
static {
|
|
56
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
57
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
58
|
+
USACollectionItemElement = _classThis = _classDescriptor.value;
|
|
59
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
60
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
return USACollectionItemElement = _classThis;
|
|
64
|
+
})();
|
|
65
|
+
export { USACollectionItemElement };
|
|
66
|
+
//# sourceMappingURL=collection-item.element.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collection-item.element.js","sourceRoot":"","sources":["../../../../src/lib/collection/collection-item/collection-item.element.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;IAqDvC,wBAAwB;4BA7CpC,OAAO,CAAC;YACP,OAAO,EAAE,qBAAqB;YAC9B,SAAS,EAAE;gBACT,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;KAsBF;gBACD,IAAI,CAAA;;;;;;;;;;;;;;;;KAgBH;aACF;SACF,CAAC;;;;sBAC4C,WAAW;wCAAnB,SAAQ,WAAW;;;;YAAzD,6KAA4D;;;YAA/C,uDAAwB;;;;;SAAxB,wBAAwB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./collection-item.element.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import "./collection-item.element.js";
|
|
2
|
+
import { assert, fixture, html } from "@open-wc/testing";
|
|
3
|
+
describe("usa-collection-item", () => {
|
|
4
|
+
it("should be accessible", async () => {
|
|
5
|
+
const collectionItem = await fixture(html `
|
|
6
|
+
<usa-collection-item>Hello World</usa-collection-item>
|
|
7
|
+
`);
|
|
8
|
+
return assert.isAccessible(collectionItem);
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
//# sourceMappingURL=collection-item.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collection-item.test.js","sourceRoot":"","sources":["../../../../src/lib/collection/collection-item/collection-item.test.ts"],"names":[],"mappings":"AAAA,OAAO,8BAA8B,CAAC;AAEtC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAIzD,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;IACnC,EAAE,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;QACpC,MAAM,cAAc,GAAG,MAAM,OAAO,CAA2B,IAAI,CAAA;;KAElE,CAAC,CAAC;QAEH,OAAO,MAAM,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { __esDecorate, __runInitializers } from "tslib";
|
|
2
|
+
import { css, element, html } from "@joist/element";
|
|
3
|
+
let USACollectionElement = (() => {
|
|
4
|
+
let _classDecorators = [element({
|
|
5
|
+
tagName: "usa-collection",
|
|
6
|
+
shadowDom: [
|
|
7
|
+
css `
|
|
8
|
+
:host {
|
|
9
|
+
display: grid;
|
|
10
|
+
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
|
|
11
|
+
gap: 2rem;
|
|
12
|
+
}
|
|
13
|
+
`,
|
|
14
|
+
html `
|
|
15
|
+
<slot></slot>
|
|
16
|
+
`,
|
|
17
|
+
],
|
|
18
|
+
})];
|
|
19
|
+
let _classDescriptor;
|
|
20
|
+
let _classExtraInitializers = [];
|
|
21
|
+
let _classThis;
|
|
22
|
+
let _classSuper = HTMLElement;
|
|
23
|
+
var USACollectionElement = class extends _classSuper {
|
|
24
|
+
static { _classThis = this; }
|
|
25
|
+
static {
|
|
26
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
27
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
28
|
+
USACollectionElement = _classThis = _classDescriptor.value;
|
|
29
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
30
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
return USACollectionElement = _classThis;
|
|
34
|
+
})();
|
|
35
|
+
export { USACollectionElement };
|
|
36
|
+
//# sourceMappingURL=collection.element.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collection.element.js","sourceRoot":"","sources":["../../../src/lib/collection/collection.element.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;IAuBvC,oBAAoB;4BAfhC,OAAO,CAAC;YACP,OAAO,EAAE,gBAAgB;YACzB,SAAS,EAAE;gBACT,GAAG,CAAA;;;;;;KAMF;gBACD,IAAI,CAAA;;KAEH;aACF;SACF,CAAC;;;;sBACwC,WAAW;oCAAnB,SAAQ,WAAW;;;;YAArD,6KAAwD;;;YAA3C,uDAAoB;;;;;SAApB,oBAAoB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { StoryObj } from "@storybook/web-components";
|
|
2
|
+
import type { USACollectionElement } from "./collection.element.js";
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
tags: string[];
|
|
6
|
+
render(args: USACollectionElement): import("lit-html").TemplateResult<1>;
|
|
7
|
+
argTypes: {};
|
|
8
|
+
args: {};
|
|
9
|
+
};
|
|
10
|
+
export default meta;
|
|
11
|
+
type Story = StoryObj<USACollectionElement>;
|
|
12
|
+
export declare const Primary: Story;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { html } from "lit";
|
|
2
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
3
|
+
const meta = {
|
|
4
|
+
title: "usa-collection",
|
|
5
|
+
tags: ["autodocs"],
|
|
6
|
+
render(args) {
|
|
7
|
+
return html `
|
|
8
|
+
<usa-collection>
|
|
9
|
+
<usa-collection-item>
|
|
10
|
+
<h4 slot="heading">
|
|
11
|
+
<usa-link href="#">Gears of Government President's Award winners</usa-link>
|
|
12
|
+
</h4>
|
|
13
|
+
|
|
14
|
+
<div slot="description">
|
|
15
|
+
Today, the Administration announces the winners of the Gears of Government President’s Award. This program recognizes the contributions of individuals and teams across the federal workforce who make a profound difference in the lives of the American people.
|
|
16
|
+
</div>
|
|
17
|
+
</usa-collection-item>
|
|
18
|
+
|
|
19
|
+
<usa-collection-item>
|
|
20
|
+
<img height="80" width="80" src="/assets/img/gog-logo.png" slot="img"/>
|
|
21
|
+
|
|
22
|
+
<h4 slot="heading">
|
|
23
|
+
<usa-link href="#">Gears of Government President's Award winners</usa-link>
|
|
24
|
+
</h4>
|
|
25
|
+
|
|
26
|
+
<div slot="description">
|
|
27
|
+
Today, the Administration announces the winners of the Gears of Government President’s Award. This program recognizes the contributions of individuals and teams across the federal workforce who make a profound difference in the lives of the American people.
|
|
28
|
+
</div>
|
|
29
|
+
</usa-collection-item>
|
|
30
|
+
|
|
31
|
+
<usa-collection-item>
|
|
32
|
+
<h4 slot="heading">
|
|
33
|
+
<usa-link href="#">Women-owned small business dashboard</usa-link>
|
|
34
|
+
</h4>
|
|
35
|
+
|
|
36
|
+
<div slot="description">
|
|
37
|
+
In honor of National Women's Small Business Month, we've partnered with SBA's Office of Government Contracting and Business Development and Office of Program Performance, Analysis, and Evaluation to highlight the Women-Owned Small Businesses (WOSBs) data dashboard!
|
|
38
|
+
</div>
|
|
39
|
+
</usa-collection-item>
|
|
40
|
+
|
|
41
|
+
<usa-collection-item>
|
|
42
|
+
<img height="52" width="80" src="/assets/img/wosb1.jpg" slot="img"/>
|
|
43
|
+
|
|
44
|
+
<h4 slot="heading">
|
|
45
|
+
<usa-link href="#">Women-owned small business dashboard</usa-link>
|
|
46
|
+
</h4>
|
|
47
|
+
|
|
48
|
+
<div slot="description">
|
|
49
|
+
In honor of National Women's Small Business Month, we've partnered with SBA's Office of Government Contracting and Business Development and Office of Program Performance, Analysis, and Evaluation to highlight the Women-Owned Small Businesses (WOSBs) data dashboard!
|
|
50
|
+
</div>
|
|
51
|
+
</usa-collection-item>
|
|
52
|
+
</usa-collection>
|
|
53
|
+
`;
|
|
54
|
+
},
|
|
55
|
+
argTypes: {},
|
|
56
|
+
args: {},
|
|
57
|
+
};
|
|
58
|
+
export default meta;
|
|
59
|
+
// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
|
|
60
|
+
export const Primary = {
|
|
61
|
+
args: {},
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=collection.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collection.stories.js","sourceRoot":"","sources":["../../../src/lib/collection/collection.stories.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAI3B,kFAAkF;AAClF,MAAM,IAAI,GAAG;IACX,KAAK,EAAE,gBAAgB;IACvB,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,MAAM,CAAC,IAAI;QACT,OAAO,IAAI,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA8CV,CAAC;IACJ,CAAC;IACD,QAAQ,EAAE,EAAE;IACZ,IAAI,EAAE,EAAE;CAC4B,CAAC;AAEvC,eAAe,IAAI,CAAC;AAIpB,wFAAwF;AACxF,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE,EAAE;CACT,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./collection.element.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import "./collection.element.js";
|
|
2
|
+
import { assert, fixture, html } from "@open-wc/testing";
|
|
3
|
+
describe("usa-collection", () => {
|
|
4
|
+
it("should be accessible", async () => {
|
|
5
|
+
const collection = await fixture(html `
|
|
6
|
+
<usa-collection>Hello World</usa-collection>
|
|
7
|
+
`);
|
|
8
|
+
return assert.isAccessible(collection);
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
//# sourceMappingURL=collection.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collection.test.js","sourceRoot":"","sources":["../../../src/lib/collection/collection.test.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAC;AAEjC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAIzD,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,EAAE,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;QACpC,MAAM,UAAU,GAAG,MAAM,OAAO,CAAuB,IAAI,CAAA;;KAE1D,CAAC,CAAC;QAEH,OAAO,MAAM,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/target/lib/define.d.ts
CHANGED
|
@@ -30,3 +30,5 @@ import "./card/card-footer/card-footer.element.js";
|
|
|
30
30
|
import "./card/card-media/card-media.element.js";
|
|
31
31
|
import "./card/card-group/card-group.element.js";
|
|
32
32
|
import "./textarea/textarea.element.js";
|
|
33
|
+
import "./collection/collection.element.js";
|
|
34
|
+
import "./collection/collection-item/collection-item.element.js";
|
package/target/lib/define.js
CHANGED
|
@@ -30,4 +30,6 @@ import "./card/card-footer/card-footer.element.js";
|
|
|
30
30
|
import "./card/card-media/card-media.element.js";
|
|
31
31
|
import "./card/card-group/card-group.element.js";
|
|
32
32
|
import "./textarea/textarea.element.js";
|
|
33
|
+
import "./collection/collection.element.js";
|
|
34
|
+
import "./collection/collection-item/collection-item.element.js";
|
|
33
35
|
//# sourceMappingURL=define.js.map
|
package/target/lib/define.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"define.js","sourceRoot":"","sources":["../../src/lib/define.ts"],"names":[],"mappings":"AAAA,OAAO,4BAA4B,CAAC;AACpC,OAAO,0BAA0B,CAAC;AAClC,OAAO,4BAA4B,CAAC;AACpC,OAAO,gCAAgC,CAAC;AACxC,OAAO,sCAAsC,CAAC;AAC9C,OAAO,oCAAoC,CAAC;AAC5C,OAAO,+DAA+D,CAAC;AACvE,OAAO,wBAAwB,CAAC;AAChC,OAAO,0BAA0B,CAAC;AAClC,OAAO,oCAAoC,CAAC;AAC5C,OAAO,wBAAwB,CAAC;AAChC,OAAO,0BAA0B,CAAC;AAClC,OAAO,8CAA8C,CAAC;AACtD,OAAO,4BAA4B,CAAC;AACpC,OAAO,iDAAiD,CAAC;AACzD,OAAO,sBAAsB,CAAC;AAC9B,OAAO,kCAAkC,CAAC;AAC1C,OAAO,gCAAgC,CAAC;AACxC,OAAO,mDAAmD,CAAC;AAC3D,OAAO,sCAAsC,CAAC;AAC9C,OAAO,4CAA4C,CAAC;AACpD,OAAO,uCAAuC,CAAC;AAC/C,OAAO,0BAA0B,CAAC;AAClC,OAAO,4CAA4C,CAAC;AACpD,OAAO,gDAAgD,CAAC;AACxD,OAAO,wBAAwB,CAAC;AAChC,OAAO,2CAA2C,CAAC;AACnD,OAAO,uCAAuC,CAAC;AAC/C,OAAO,2CAA2C,CAAC;AACnD,OAAO,yCAAyC,CAAC;AACjD,OAAO,yCAAyC,CAAC;AACjD,OAAO,gCAAgC,CAAC"}
|
|
1
|
+
{"version":3,"file":"define.js","sourceRoot":"","sources":["../../src/lib/define.ts"],"names":[],"mappings":"AAAA,OAAO,4BAA4B,CAAC;AACpC,OAAO,0BAA0B,CAAC;AAClC,OAAO,4BAA4B,CAAC;AACpC,OAAO,gCAAgC,CAAC;AACxC,OAAO,sCAAsC,CAAC;AAC9C,OAAO,oCAAoC,CAAC;AAC5C,OAAO,+DAA+D,CAAC;AACvE,OAAO,wBAAwB,CAAC;AAChC,OAAO,0BAA0B,CAAC;AAClC,OAAO,oCAAoC,CAAC;AAC5C,OAAO,wBAAwB,CAAC;AAChC,OAAO,0BAA0B,CAAC;AAClC,OAAO,8CAA8C,CAAC;AACtD,OAAO,4BAA4B,CAAC;AACpC,OAAO,iDAAiD,CAAC;AACzD,OAAO,sBAAsB,CAAC;AAC9B,OAAO,kCAAkC,CAAC;AAC1C,OAAO,gCAAgC,CAAC;AACxC,OAAO,mDAAmD,CAAC;AAC3D,OAAO,sCAAsC,CAAC;AAC9C,OAAO,4CAA4C,CAAC;AACpD,OAAO,uCAAuC,CAAC;AAC/C,OAAO,0BAA0B,CAAC;AAClC,OAAO,4CAA4C,CAAC;AACpD,OAAO,gDAAgD,CAAC;AACxD,OAAO,wBAAwB,CAAC;AAChC,OAAO,2CAA2C,CAAC;AACnD,OAAO,uCAAuC,CAAC;AAC/C,OAAO,2CAA2C,CAAC;AACnD,OAAO,yCAAyC,CAAC;AACjD,OAAO,yCAAyC,CAAC;AACjD,OAAO,gCAAgC,CAAC;AACxC,OAAO,oCAAoC,CAAC;AAC5C,OAAO,yDAAyD,CAAC"}
|
|
@@ -34,14 +34,19 @@ let USARadioOptionElement = (() => {
|
|
|
34
34
|
let _value_decorators;
|
|
35
35
|
let _value_initializers = [];
|
|
36
36
|
let _value_extraInitializers = [];
|
|
37
|
+
let _disabled_decorators;
|
|
38
|
+
let _disabled_initializers = [];
|
|
39
|
+
let _disabled_extraInitializers = [];
|
|
37
40
|
let _onInjected_decorators;
|
|
38
41
|
var USARadioOptionElement = class extends _classSuper {
|
|
39
42
|
static { _classThis = this; }
|
|
40
43
|
static {
|
|
41
44
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
42
45
|
_value_decorators = [attr()];
|
|
46
|
+
_disabled_decorators = [attr()];
|
|
43
47
|
_onInjected_decorators = [injected()];
|
|
44
48
|
__esDecorate(this, null, _value_decorators, { kind: "accessor", name: "value", static: false, private: false, access: { has: obj => "value" in obj, get: obj => obj.value, set: (obj, value) => { obj.value = value; } }, metadata: _metadata }, _value_initializers, _value_extraInitializers);
|
|
49
|
+
__esDecorate(this, null, _disabled_decorators, { kind: "accessor", name: "disabled", static: false, private: false, access: { has: obj => "disabled" in obj, get: obj => obj.disabled, set: (obj, value) => { obj.disabled = value; } }, metadata: _metadata }, _disabled_initializers, _disabled_extraInitializers);
|
|
45
50
|
__esDecorate(this, null, _onInjected_decorators, { kind: "method", name: "onInjected", static: false, private: false, access: { has: obj => "onInjected" in obj, get: obj => obj.onInjected }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
46
51
|
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
47
52
|
USARadioOptionElement = _classThis = _classDescriptor.value;
|
|
@@ -51,7 +56,10 @@ let USARadioOptionElement = (() => {
|
|
|
51
56
|
#value_accessor_storage = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _value_initializers, ""));
|
|
52
57
|
get value() { return this.#value_accessor_storage; }
|
|
53
58
|
set value(value) { this.#value_accessor_storage = value; }
|
|
54
|
-
#
|
|
59
|
+
#disabled_accessor_storage = (__runInitializers(this, _value_extraInitializers), __runInitializers(this, _disabled_initializers, false));
|
|
60
|
+
get disabled() { return this.#disabled_accessor_storage; }
|
|
61
|
+
set disabled(value) { this.#disabled_accessor_storage = value; }
|
|
62
|
+
#label = (__runInitializers(this, _disabled_extraInitializers), query("label"));
|
|
55
63
|
#input = query("input");
|
|
56
64
|
#slot = query("slot");
|
|
57
65
|
#radio = inject(RADIO_CTX);
|
|
@@ -63,18 +71,18 @@ let USARadioOptionElement = (() => {
|
|
|
63
71
|
});
|
|
64
72
|
});
|
|
65
73
|
attributeChangedCallback() {
|
|
66
|
-
this.#input({ value: this.value });
|
|
74
|
+
this.#input({ value: this.value, disabled: this.disabled });
|
|
67
75
|
this.#slot({ name: this.value });
|
|
68
76
|
this.slot = this.value;
|
|
69
77
|
}
|
|
70
78
|
onInjected() {
|
|
71
|
-
const
|
|
72
|
-
|
|
79
|
+
const radioCtx = this.#radio();
|
|
80
|
+
radioCtx.addRadioOption(this.#label());
|
|
73
81
|
this.#input({
|
|
74
|
-
name:
|
|
75
|
-
checked:
|
|
82
|
+
name: radioCtx.name,
|
|
83
|
+
checked: radioCtx.value === this.value,
|
|
76
84
|
});
|
|
77
|
-
this.#observer.observe(
|
|
85
|
+
this.#observer.observe(radioCtx, {
|
|
78
86
|
attributeFilter: ["value", "name"],
|
|
79
87
|
});
|
|
80
88
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-option.element.js","sourceRoot":"","sources":["../../../../src/lib/radio/radio-option/radio-option.element.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEjE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;IAgC7B,qBAAqB;4BAxBjC,UAAU,CAAC;YACV,IAAI,EAAE,sBAAsB;SAC7B,CAAC,EACD,OAAO,CAAC;YACP,OAAO,EAAE,kBAAkB;YAC3B,SAAS,EAAE;gBACT,GAAG,CAAA;;;;;;KAMF;gBACD,IAAI,CAAA;;;;;;;;KAQH;aACF;SACF,CAAC;;;;sBACyC,WAAW
|
|
1
|
+
{"version":3,"file":"radio-option.element.js","sourceRoot":"","sources":["../../../../src/lib/radio/radio-option/radio-option.element.ts"],"names":[],"mappings":";AAAA,OAAO,E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ChB,OAAO,EAAE,KAAK,CAAC,KAAK,KAAK,IAAI,CAAC,KAAK;aACpC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,wBAAwB;YACtB,IAAI,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;YAC5D,IAAI,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;YAEjC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC;QACzB,CAAC;QAGD,UAAU;YACR,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;YAE/B,QAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;YAEvC,IAAI,CAAC,MAAM,CAAC;gBACV,IAAI,EAAE,QAAQ,CAAC,IAAI;gBACnB,OAAO,EAAE,QAAQ,CAAC,KAAK,KAAK,IAAI,CAAC,KAAK;aACvC,CAAC,CAAC;YAEH,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,EAAE;gBAC/B,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC;aACnC,CAAC,CAAC;QACL,CAAC;QAED,oBAAoB;YAClB,IAAI,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,CAAC;YAEvB,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,CAAC;QAC9B,CAAC;;;;SAhDU,qBAAqB"}
|
|
@@ -54,6 +54,23 @@ let USARadioElement = (() => {
|
|
|
54
54
|
inset 0 0 0 2px #fff;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
+
label:has(input:checked:is(:disabled))::before {
|
|
58
|
+
background-color: #757575;
|
|
59
|
+
box-shadow:
|
|
60
|
+
0 0 0 2px #757575,
|
|
61
|
+
inset 0 0 0 2px #fff;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
label:has(input:disabled) {
|
|
65
|
+
cursor: not-allowed;
|
|
66
|
+
color: #757575 !important;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
label:has(input:disabled)::before {
|
|
70
|
+
background-color: #fff;
|
|
71
|
+
box-shadow: 0 0 0 2px #757575;
|
|
72
|
+
}
|
|
73
|
+
|
|
57
74
|
label:has(input:focus)::before {
|
|
58
75
|
outline: 0.25rem solid var(--usa-radio-focus-color);
|
|
59
76
|
outline-offset: 0.25rem;
|
|
@@ -76,6 +93,11 @@ let USARadioElement = (() => {
|
|
|
76
93
|
border-color: var(--usa-radio-active-color);
|
|
77
94
|
}
|
|
78
95
|
|
|
96
|
+
:host([tiled]) label:has(input:checked:is(:disabled)) {
|
|
97
|
+
background-color: #fff;
|
|
98
|
+
border-color: #757575;
|
|
99
|
+
}
|
|
100
|
+
|
|
79
101
|
slot {
|
|
80
102
|
display: flex;
|
|
81
103
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio.element.js","sourceRoot":"","sources":["../../../src/lib/radio/radio.element.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEzE,OAAO,EAAE,SAAS,EAAuB,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"radio.element.js","sourceRoot":"","sources":["../../../src/lib/radio/radio.element.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEzE,OAAO,EAAE,SAAS,EAAuB,MAAM,cAAc,CAAC;IAmHjD,eAAe;4BA3G3B,UAAU,CAAC;YACV,I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I,CAAC,cAAc,EAAE,CAAC;QACxB,CAAC;QAED,cAAc,CAAC,EAAe;YAC5B,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC;YAE5B,IAAI,CAAC,cAAc,EAAE,CAAC;QACxB,CAAC;QAGD,QAAQ,CAAC,CAAQ;YACf,IAAI,CAAC,CAAC,MAAM,YAAY,gBAAgB,EAAE,CAAC;gBACzC,IAAI,CAAC,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;oBACrB,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;oBAE5B,IAAI,CAAC,cAAc,EAAE,CAAC;gBACxB,CAAC;YACH,CAAC;QACH,CAAC;QAED,cAAc;YACZ,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACzC,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;YAEhC,IAAI,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;gBACjC,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;gBAEtD,IAAI,CAAC,UAAU,CAAC,WAAW,CACzB,EAAE,YAAY,EAAE,IAAI,EAAE,EACtB,gDAAgD,EAChD,KAAK,IAAI,IAAI,CAAC,OAAO,EAAE,CACxB,CAAC;YACJ,CAAC;QACH,CAAC;;YAtDU,uDAAe;;;;;SAAf,eAAe"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { html } from "lit";
|
|
2
|
-
import { when } from "lit/directives/when.js";
|
|
3
2
|
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
4
3
|
const meta = {
|
|
5
4
|
title: "usa-radio",
|
|
@@ -19,14 +18,14 @@ const meta = {
|
|
|
19
18
|
|
|
20
19
|
<usa-radio-option value="frederick-douglass">
|
|
21
20
|
Frederick Douglass
|
|
22
|
-
|
|
21
|
+
<usa-description>This is optional text that can be used to describe the label in more detail.</usa-description>
|
|
23
22
|
</usa-radio-option>
|
|
24
23
|
|
|
25
24
|
<usa-radio-option value="booker-t-washington">
|
|
26
25
|
Booker T. Washington
|
|
27
26
|
</usa-radio-option>
|
|
28
27
|
|
|
29
|
-
<usa-radio-option value="george-washington-carver">
|
|
28
|
+
<usa-radio-option value="george-washington-carver" disabled>
|
|
30
29
|
George Washington Carver
|
|
31
30
|
</usa-radio-option>
|
|
32
31
|
</usa-radio>
|
|
@@ -35,7 +34,6 @@ const meta = {
|
|
|
35
34
|
argTypes: {},
|
|
36
35
|
args: {
|
|
37
36
|
tiled: true,
|
|
38
|
-
description: "This is optional text that can be used to describe the label in more detail.",
|
|
39
37
|
},
|
|
40
38
|
};
|
|
41
39
|
export default meta;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio.stories.js","sourceRoot":"","sources":["../../../src/lib/radio/radio.stories.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"radio.stories.js","sourceRoot":"","sources":["../../../src/lib/radio/radio.stories.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAK3B,kFAAkF;AAClF,MAAM,IAAI,GAAG;IACX,KAAK,EAAE,WAAW;IAClB,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,MAAM,CAAC,IAAI;QACT,OAAO,IAAI,CAAA;;;;iBAIE,IAAI,CAAC,KAAK;;;;;;;;;;;;;;;;;;;;;KAqBtB,CAAC;IACJ,CAAC;IACD,QAAQ,EAAE,EAAE;IACZ,IAAI,EAAE;QACJ,KAAK,EAAE,IAAI;KACZ;CACwD,CAAC;AAE5D,eAAe,IAAI,CAAC;AAIpB,wFAAwF;AACxF,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE,EAAE;CACT,CAAC"}
|
package/target/lib.d.ts
CHANGED
|
@@ -30,3 +30,5 @@ export { USACardFooterElement } from "./lib/card/card-footer/card-footer.element
|
|
|
30
30
|
export { USACardImgElement } from "./lib/card/card-media/card-media.element.js";
|
|
31
31
|
export { USACardGroupElement } from "./lib/card/card-group/card-group.element.js";
|
|
32
32
|
export { USATextareaElement } from "./lib/textarea/textarea.element.js";
|
|
33
|
+
export { USACollectionElement } from "./lib/collection/collection.element.js";
|
|
34
|
+
export { USACollectionItemElement } from "./lib/collection/collection-item/collection-item.element.js";
|
package/target/lib.js
CHANGED
|
@@ -30,4 +30,6 @@ export { USACardFooterElement } from "./lib/card/card-footer/card-footer.element
|
|
|
30
30
|
export { USACardImgElement } from "./lib/card/card-media/card-media.element.js";
|
|
31
31
|
export { USACardGroupElement } from "./lib/card/card-group/card-group.element.js";
|
|
32
32
|
export { USATextareaElement } from "./lib/textarea/textarea.element.js";
|
|
33
|
+
export { USACollectionElement } from "./lib/collection/collection.element.js";
|
|
34
|
+
export { USACollectionItemElement } from "./lib/collection/collection-item/collection-item.element.js";
|
|
33
35
|
//# sourceMappingURL=lib.js.map
|
package/target/lib.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib.js","sourceRoot":"","sources":["../src/lib.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,0BAA0B,EAAE,MAAM,mEAAmE,CAAC;AAC/G,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,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