@noctuatech/uswds 1.2.1 → 1.3.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/package.json +55 -20
- package/src/lib/accordion/accordion.element.ts +19 -19
- package/src/lib/breadcrumbs/breadcrumb/breadcrumb.element.ts +8 -10
- package/src/lib/breadcrumbs/breadcrumbs.stories.ts +3 -3
- package/src/lib/button/button.element.ts +2 -2
- package/src/lib/checkbox/checkbox.element.ts +23 -32
- package/src/lib/combo-box/combo-box.element.ts +14 -24
- package/src/lib/file-input/file-input-preview/file-input-preview.element.ts +26 -25
- package/src/lib/file-input/file-input.element.ts +28 -43
- package/src/lib/input/input.element.ts +9 -18
- package/src/lib/modal/modal-heading/modal-heading.element.ts +1 -1
- package/src/lib/modal/modal.element.ts +1 -1
- package/src/lib/radio/radio.element.ts +5 -3
- package/src/lib/range-slider/range-slider.element.ts +2 -2
- package/src/lib/search/search.element.ts +2 -2
- package/src/lib/select/select.element.ts +10 -19
- package/src/lib/textarea/textarea.element.ts +10 -19
- package/target/lib/accordion/accordion.element.d.ts +1 -2
- package/target/lib/accordion/accordion.element.js +9 -7
- package/target/lib/accordion/accordion.element.js.map +1 -1
- package/target/lib/breadcrumbs/breadcrumb/breadcrumb.element.d.ts +0 -2
- package/target/lib/breadcrumbs/breadcrumb/breadcrumb.element.js +7 -6
- package/target/lib/breadcrumbs/breadcrumb/breadcrumb.element.js.map +1 -1
- package/target/lib/breadcrumbs/breadcrumbs.stories.js +1 -1
- package/target/lib/button/button.element.js +1 -1
- package/target/lib/checkbox/checkbox.element.js +2 -2
- package/target/lib/checkbox/checkbox.element.js.map +1 -1
- package/target/lib/combo-box/combo-box.element.js +2 -2
- package/target/lib/combo-box/combo-box.element.js.map +1 -1
- package/target/lib/file-input/file-input-preview/file-input-preview.element.d.ts +3 -5
- package/target/lib/file-input/file-input-preview/file-input-preview.element.js +29 -19
- package/target/lib/file-input/file-input-preview/file-input-preview.element.js.map +1 -1
- package/target/lib/file-input/file-input.element.d.ts +2 -2
- package/target/lib/file-input/file-input.element.js +20 -22
- package/target/lib/file-input/file-input.element.js.map +1 -1
- package/target/lib/input/input.element.js +2 -2
- package/target/lib/input/input.element.js.map +1 -1
- package/target/lib/modal/modal-heading/modal-heading.element.js +1 -1
- package/target/lib/modal/modal.element.js +1 -1
- package/target/lib/radio/radio.element.js +1 -1
- package/target/lib/radio/radio.element.js.map +1 -1
- package/target/lib/range-slider/range-slider.element.js +1 -1
- package/target/lib/search/search.element.js +1 -1
- package/target/lib/select/select.element.js +2 -2
- package/target/lib/select/select.element.js.map +1 -1
- package/target/lib/textarea/textarea.element.js +2 -2
- package/target/lib/textarea/textarea.element.js.map +1 -1
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import
|
|
1
|
+
import '@joist/templating/define.js';
|
|
2
2
|
|
|
3
|
-
import { attr, css, element, html, listen, query } from
|
|
4
|
-
import { effect } from
|
|
5
|
-
import { bind } from
|
|
3
|
+
import { attr, css, element, html, listen, query } from '@joist/element';
|
|
4
|
+
import { effect } from '@joist/observable';
|
|
5
|
+
import { bind } from '@joist/templating';
|
|
6
6
|
|
|
7
7
|
declare global {
|
|
8
8
|
interface HTMLElementTagNameMap {
|
|
9
|
-
|
|
9
|
+
'usa-file-input': USAFileInputElement;
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
@element({
|
|
14
|
-
tagName:
|
|
14
|
+
tagName: 'usa-file-input',
|
|
15
15
|
shadowDom: [
|
|
16
16
|
css`
|
|
17
17
|
* {
|
|
@@ -19,9 +19,6 @@ declare global {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
:host {
|
|
22
|
-
--usa-input-radius: 0;
|
|
23
|
-
--usa-input-bg-color: #d9e8f6;
|
|
24
|
-
|
|
25
22
|
display: block;
|
|
26
23
|
max-width: 30rem;
|
|
27
24
|
position: relative;
|
|
@@ -64,7 +61,7 @@ declare global {
|
|
|
64
61
|
|
|
65
62
|
.box {
|
|
66
63
|
border: 1px dashed #adadad;
|
|
67
|
-
border-radius:
|
|
64
|
+
border-radius: 0;
|
|
68
65
|
display: flex;
|
|
69
66
|
font-size: 0.93rem;
|
|
70
67
|
position: relative;
|
|
@@ -84,22 +81,20 @@ declare global {
|
|
|
84
81
|
<slot class="label"></slot>
|
|
85
82
|
|
|
86
83
|
<div class="container">
|
|
87
|
-
<input type="file" tabindex="0"/>
|
|
84
|
+
<input type="file" tabindex="0" />
|
|
88
85
|
|
|
89
86
|
<j-if bind="filesVisible">
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
<usa-file-input-preview $.files="files">
|
|
87
|
+
<template>
|
|
88
|
+
<j-props>
|
|
89
|
+
<usa-file-input-preview $.files="files" part="preview" exportparts="heading, item">
|
|
93
90
|
Selected file <usa-link>Change file</usa-link>
|
|
94
91
|
</usa-file-input-preview>
|
|
95
92
|
</j-props>
|
|
96
93
|
</template>
|
|
97
94
|
|
|
98
95
|
<template else>
|
|
99
|
-
<div class="box">
|
|
100
|
-
<slot name="description">
|
|
101
|
-
Drag file here or <usa-link>choose from folder</usa-link>
|
|
102
|
-
</slot>
|
|
96
|
+
<div class="box" part="input">
|
|
97
|
+
<slot name="description"> Drag file here or <usa-link>choose from folder</usa-link> </slot>
|
|
103
98
|
</div>
|
|
104
99
|
</template>
|
|
105
100
|
</j-if>
|
|
@@ -112,13 +107,13 @@ export class USAFileInputElement extends HTMLElement {
|
|
|
112
107
|
static formAssociated = true;
|
|
113
108
|
|
|
114
109
|
@attr()
|
|
115
|
-
accessor name =
|
|
110
|
+
accessor name = '';
|
|
116
111
|
|
|
117
112
|
@attr()
|
|
118
113
|
accessor multiple = true;
|
|
119
114
|
|
|
120
115
|
@attr()
|
|
121
|
-
accessor accept =
|
|
116
|
+
accessor accept = '';
|
|
122
117
|
|
|
123
118
|
@attr()
|
|
124
119
|
accessor required = false;
|
|
@@ -126,11 +121,11 @@ export class USAFileInputElement extends HTMLElement {
|
|
|
126
121
|
@bind()
|
|
127
122
|
accessor files: FileList | null = null;
|
|
128
123
|
|
|
129
|
-
@bind()
|
|
124
|
+
@bind((i) => !!i.files?.length)
|
|
130
125
|
accessor filesVisible = false;
|
|
131
126
|
|
|
132
127
|
#internals = this.attachInternals();
|
|
133
|
-
#input = query(
|
|
128
|
+
#input = query('input');
|
|
134
129
|
|
|
135
130
|
attributeChangedCallback() {
|
|
136
131
|
this.#input({
|
|
@@ -145,11 +140,7 @@ export class USAFileInputElement extends HTMLElement {
|
|
|
145
140
|
const input = this.#input();
|
|
146
141
|
|
|
147
142
|
if (input.validationMessage) {
|
|
148
|
-
this.#internals.setValidity(
|
|
149
|
-
{ customError: true },
|
|
150
|
-
input.validationMessage,
|
|
151
|
-
input,
|
|
152
|
-
);
|
|
143
|
+
this.#internals.setValidity({ customError: true }, input.validationMessage, input);
|
|
153
144
|
}
|
|
154
145
|
}
|
|
155
146
|
|
|
@@ -168,39 +159,34 @@ export class USAFileInputElement extends HTMLElement {
|
|
|
168
159
|
this.#internals.setFormValue(formData);
|
|
169
160
|
|
|
170
161
|
if (input.validationMessage) {
|
|
171
|
-
this.#internals.setValidity(
|
|
172
|
-
{ customError: true },
|
|
173
|
-
input.validationMessage,
|
|
174
|
-
input,
|
|
175
|
-
);
|
|
162
|
+
this.#internals.setValidity({ customError: true }, input.validationMessage, input);
|
|
176
163
|
} else {
|
|
177
164
|
this.#internals.setValidity({});
|
|
178
165
|
}
|
|
179
166
|
}
|
|
180
167
|
|
|
181
|
-
@listen(
|
|
168
|
+
@listen('change')
|
|
182
169
|
onInputChange() {
|
|
183
170
|
const input = this.#input();
|
|
184
171
|
|
|
185
172
|
this.files = input.files;
|
|
186
|
-
this.filesVisible = !!input.files?.length;
|
|
187
173
|
|
|
188
|
-
this.dispatchEvent(new Event(
|
|
174
|
+
this.dispatchEvent(new Event('change'));
|
|
189
175
|
}
|
|
190
176
|
|
|
191
|
-
@listen(
|
|
177
|
+
@listen('dragenter')
|
|
192
178
|
onDragEnter() {
|
|
193
|
-
this.classList.add(
|
|
179
|
+
this.classList.add('dragenter');
|
|
194
180
|
}
|
|
195
181
|
|
|
196
|
-
@listen(
|
|
182
|
+
@listen('dragleave')
|
|
197
183
|
onDragLeave() {
|
|
198
|
-
this.classList.remove(
|
|
184
|
+
this.classList.remove('dragenter');
|
|
199
185
|
}
|
|
200
186
|
|
|
201
|
-
@listen(
|
|
187
|
+
@listen('drop')
|
|
202
188
|
onDrop(e: DragEvent) {
|
|
203
|
-
this.classList.remove(
|
|
189
|
+
this.classList.remove('dragenter');
|
|
204
190
|
|
|
205
191
|
if (e.dataTransfer?.items) {
|
|
206
192
|
e.preventDefault();
|
|
@@ -208,7 +194,7 @@ export class USAFileInputElement extends HTMLElement {
|
|
|
208
194
|
const data = new DataTransfer();
|
|
209
195
|
|
|
210
196
|
for (const item of e.dataTransfer.items) {
|
|
211
|
-
if (item.kind ===
|
|
197
|
+
if (item.kind === 'file') {
|
|
212
198
|
const file = item.getAsFile();
|
|
213
199
|
|
|
214
200
|
if (file) {
|
|
@@ -218,7 +204,6 @@ export class USAFileInputElement extends HTMLElement {
|
|
|
218
204
|
}
|
|
219
205
|
|
|
220
206
|
this.files = data.files;
|
|
221
|
-
this.filesVisible = !!this.files?.length;
|
|
222
207
|
}
|
|
223
208
|
}
|
|
224
209
|
}
|
|
@@ -18,15 +18,6 @@ declare global {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
:host {
|
|
21
|
-
--usa-input-bg-color: #fff;
|
|
22
|
-
--usa-input-border-color: #5c5c5c;
|
|
23
|
-
--usa-input-text-color: #1b1b1b;
|
|
24
|
-
--usa-input-focus-color: #2491ff;
|
|
25
|
-
--usa-input-disabled-bg-color: #fff;
|
|
26
|
-
--usa-input-disabled-border-color: #757575;
|
|
27
|
-
--usa-input-disabled-text-color: #757575;
|
|
28
|
-
--usa-input-radius: 0;
|
|
29
|
-
|
|
30
21
|
font-size: 1.06rem;
|
|
31
22
|
line-height: 1.3;
|
|
32
23
|
display: block;
|
|
@@ -37,12 +28,12 @@ declare global {
|
|
|
37
28
|
}
|
|
38
29
|
|
|
39
30
|
input {
|
|
40
|
-
background-color:
|
|
31
|
+
background-color: #fff;
|
|
41
32
|
border-width: 1px;
|
|
42
|
-
border-color:
|
|
33
|
+
border-color: #5c5c5c;
|
|
43
34
|
border-style: solid;
|
|
44
|
-
border-radius:
|
|
45
|
-
color:
|
|
35
|
+
border-radius: 0;
|
|
36
|
+
color: #1b1b1b;
|
|
46
37
|
display: block;
|
|
47
38
|
height: 2.5rem;
|
|
48
39
|
line-height: 1.3;
|
|
@@ -53,14 +44,14 @@ declare global {
|
|
|
53
44
|
}
|
|
54
45
|
|
|
55
46
|
input:not(:disabled):focus {
|
|
56
|
-
outline: 0.25rem solid
|
|
47
|
+
outline: 0.25rem solid #2491ff;
|
|
57
48
|
outline-offset: 0;
|
|
58
49
|
}
|
|
59
50
|
|
|
60
51
|
input:disabled {
|
|
61
|
-
background-color:
|
|
62
|
-
border-color:
|
|
63
|
-
color:
|
|
52
|
+
background-color: #fff;
|
|
53
|
+
border-color: #757575;
|
|
54
|
+
color: #757575;
|
|
64
55
|
}
|
|
65
56
|
|
|
66
57
|
slot[name="detail"]::slotted(*) {
|
|
@@ -98,7 +89,7 @@ declare global {
|
|
|
98
89
|
|
|
99
90
|
<slot></slot>
|
|
100
91
|
|
|
101
|
-
<input tabindex="0" />
|
|
92
|
+
<input tabindex="0" part="input" />
|
|
102
93
|
</label>
|
|
103
94
|
`,
|
|
104
95
|
],
|
|
@@ -31,9 +31,11 @@ declare global {
|
|
|
31
31
|
--usa-radio-focus-color: var(--usa-input-focus-color);
|
|
32
32
|
--usa-input-radius: 0;
|
|
33
33
|
|
|
34
|
-
display:
|
|
34
|
+
display: flex;
|
|
35
|
+
flex-direction: column;
|
|
36
|
+
gap: 1rem;
|
|
35
37
|
max-width: 30rem;
|
|
36
|
-
|
|
38
|
+
margin-bottom: 1.5rem;
|
|
37
39
|
}
|
|
38
40
|
|
|
39
41
|
label {
|
|
@@ -97,7 +99,7 @@ declare global {
|
|
|
97
99
|
:host([tiled]) label {
|
|
98
100
|
background-color: var(--usa-input-bg-color);
|
|
99
101
|
border: 2px solid var(--usa-input-border-color);
|
|
100
|
-
border-radius:
|
|
102
|
+
border-radius: 0.25rem;
|
|
101
103
|
color: var(--usa-input-text-color);
|
|
102
104
|
padding: 0.75rem 1rem 0.75rem 0.75rem;
|
|
103
105
|
}
|
|
@@ -40,11 +40,11 @@ declare global {
|
|
|
40
40
|
`,
|
|
41
41
|
html`
|
|
42
42
|
<form>
|
|
43
|
-
<usa-input>
|
|
43
|
+
<usa-input exportparts="input">
|
|
44
44
|
<slot></slot>
|
|
45
45
|
</usa-input>
|
|
46
46
|
|
|
47
|
-
<usa-button type="submit">Search</usa-button>
|
|
47
|
+
<usa-button type="submit" exportparts="button,link">Search</usa-button>
|
|
48
48
|
</form>
|
|
49
49
|
`,
|
|
50
50
|
],
|
|
@@ -18,15 +18,6 @@ declare global {
|
|
|
18
18
|
shadowDom: [
|
|
19
19
|
css`
|
|
20
20
|
:host {
|
|
21
|
-
--usa-input-bg-color: #fff;
|
|
22
|
-
--usa-input-border-color: #5c5c5c;
|
|
23
|
-
--usa-input-text-color: #1b1b1b;
|
|
24
|
-
--usa-input-focus-color: #2491ff;
|
|
25
|
-
--usa-input-disabled-bg-color: #fff;
|
|
26
|
-
--usa-input-disabled-border-color: #757575;
|
|
27
|
-
--usa-input-disabled-text-color: #757575;
|
|
28
|
-
--usa-input-radius: 0;
|
|
29
|
-
|
|
30
21
|
display: block;
|
|
31
22
|
line-height: 1.3;
|
|
32
23
|
position: relative;
|
|
@@ -39,11 +30,11 @@ declare global {
|
|
|
39
30
|
font-size: 1.06rem;
|
|
40
31
|
appearance: none;
|
|
41
32
|
border-width: 1px;
|
|
42
|
-
border-color:
|
|
33
|
+
border-color: #5c5c5c;
|
|
43
34
|
border-style: solid;
|
|
44
|
-
border-radius:
|
|
45
|
-
color:
|
|
46
|
-
background-color:
|
|
35
|
+
border-radius: 0;
|
|
36
|
+
color: #1b1b1b;
|
|
37
|
+
background-color: #fff;
|
|
47
38
|
display: block;
|
|
48
39
|
height: 2.5rem;
|
|
49
40
|
margin-top: 0.5rem;
|
|
@@ -52,14 +43,14 @@ declare global {
|
|
|
52
43
|
}
|
|
53
44
|
|
|
54
45
|
select:not(:disabled):focus {
|
|
55
|
-
outline: 0.25rem solid
|
|
46
|
+
outline: 0.25rem solid #2491ff;
|
|
56
47
|
outline-offset: 0;
|
|
57
48
|
}
|
|
58
49
|
|
|
59
50
|
select:disabled {
|
|
60
|
-
background-color:
|
|
61
|
-
border-color:
|
|
62
|
-
color:
|
|
51
|
+
background-color: #fff;
|
|
52
|
+
border-color: #757575;
|
|
53
|
+
color: #757575;
|
|
63
54
|
}
|
|
64
55
|
|
|
65
56
|
usa-icon {
|
|
@@ -74,11 +65,11 @@ declare global {
|
|
|
74
65
|
<usa-icon icon="unfold_more"></usa-icon>
|
|
75
66
|
|
|
76
67
|
<label>
|
|
77
|
-
<div class="label">
|
|
68
|
+
<div class="label" part="label">
|
|
78
69
|
<slot></slot>
|
|
79
70
|
</div>
|
|
80
71
|
|
|
81
|
-
<select></select>
|
|
72
|
+
<select part="select"></select>
|
|
82
73
|
</label>
|
|
83
74
|
`,
|
|
84
75
|
],
|
|
@@ -16,15 +16,6 @@ declare global {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
:host {
|
|
19
|
-
--usa-input-bg-color: #fff;
|
|
20
|
-
--usa-input-border-color: #5c5c5c;
|
|
21
|
-
--usa-input-text-color: #1b1b1b;
|
|
22
|
-
--usa-input-focus-color: #2491ff;
|
|
23
|
-
--usa-input-disabled-bg-color: #fff;
|
|
24
|
-
--usa-input-disabled-border-color: #757575;
|
|
25
|
-
--usa-input-disabled-text-color: #757575;
|
|
26
|
-
--usa-input-radius: 0;
|
|
27
|
-
|
|
28
19
|
font-size: 1.06rem;
|
|
29
20
|
line-height: 1.3;
|
|
30
21
|
display: flex;
|
|
@@ -40,14 +31,14 @@ declare global {
|
|
|
40
31
|
textarea {
|
|
41
32
|
font-family: inherit;
|
|
42
33
|
font-size: inherit;
|
|
43
|
-
border-radius:
|
|
44
|
-
color:
|
|
34
|
+
border-radius: 0;
|
|
35
|
+
color: #1b1b1b;
|
|
45
36
|
display: block;
|
|
46
37
|
padding: .5rem;
|
|
47
38
|
border-width: 1px;
|
|
48
|
-
border-color:
|
|
39
|
+
border-color: #5c5c5c;
|
|
49
40
|
border-style: solid;
|
|
50
|
-
background-color:
|
|
41
|
+
background-color: #fff;
|
|
51
42
|
-webkit-appearance: none;
|
|
52
43
|
-moz-appearance: none;
|
|
53
44
|
appearance: none;
|
|
@@ -57,22 +48,22 @@ declare global {
|
|
|
57
48
|
}
|
|
58
49
|
|
|
59
50
|
textarea:not(:disabled):focus {
|
|
60
|
-
outline: 0.25rem solid
|
|
51
|
+
outline: 0.25rem solid #2491ff;
|
|
61
52
|
outline-offset: 0;
|
|
62
53
|
}
|
|
63
54
|
|
|
64
55
|
textarea:disabled {
|
|
65
|
-
background-color:
|
|
66
|
-
border-color:
|
|
67
|
-
color:
|
|
56
|
+
background-color: #fff;
|
|
57
|
+
border-color: #757575;
|
|
58
|
+
color: #757575;
|
|
68
59
|
}
|
|
69
60
|
`,
|
|
70
61
|
html`
|
|
71
|
-
<label for="textarea">
|
|
62
|
+
<label for="textarea" part="label">
|
|
72
63
|
<slot></slot>
|
|
73
64
|
</label>
|
|
74
65
|
|
|
75
|
-
<textarea id="textarea"></textarea>
|
|
66
|
+
<textarea id="textarea" part="textarea"></textarea>
|
|
76
67
|
`,
|
|
77
68
|
],
|
|
78
69
|
})
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import "@joist/templating/define.js";
|
|
1
2
|
import { USAAccordionToggleEvent } from "./events.js";
|
|
2
3
|
declare global {
|
|
3
4
|
interface HTMLElementTagNameMap {
|
|
@@ -5,10 +6,8 @@ declare global {
|
|
|
5
6
|
}
|
|
6
7
|
}
|
|
7
8
|
export declare class USAAccordionElement extends HTMLElement {
|
|
8
|
-
#private;
|
|
9
9
|
accessor name: string;
|
|
10
10
|
accessor open: boolean;
|
|
11
|
-
attributeChangedCallback(): void;
|
|
12
11
|
onClick(e: Event): void;
|
|
13
12
|
onAccordionToggle(e: USAAccordionToggleEvent): void;
|
|
14
13
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { __esDecorate, __runInitializers } from "tslib";
|
|
2
|
-
import
|
|
2
|
+
import "@joist/templating/define.js";
|
|
3
|
+
import { attr, css, element, html, listen } from "@joist/element";
|
|
4
|
+
import { bind } from "@joist/templating";
|
|
3
5
|
import { USAAccordionToggleEvent } from "./events.js";
|
|
4
6
|
let USAAccordionElement = (() => {
|
|
5
7
|
let _classDecorators = [element({
|
|
@@ -10,7 +12,7 @@ let USAAccordionElement = (() => {
|
|
|
10
12
|
},
|
|
11
13
|
shadowDom: [
|
|
12
14
|
css `*{box-sizing:border-box}:host{display:block}:host(:not(:first-child)) summary{margin-top:.5rem}summary{align-items:center;border:0;border-radius:0;box-shadow:none;justify-content:normal;text-align:left;padding:0;color:#1b1b1b;background-color:#f0f0f0;cursor:pointer;display:flex;font-weight:700;margin:0;padding:1rem 1.25rem 1rem 1.25rem;text-decoration:none;width:100%}summary::-webkit-details-marker{display:none}slot[name=heading]{display:block;flex:1 1 auto}slot[name=heading]::slotted(*){margin:0}.content{padding-bottom:1.5rem;padding-left:1rem;padding-top:1.5rem}usa-icon[icon=remove]{display:none}details[open] usa-icon[icon=add]{display:none}details[open] usa-icon[icon=remove]{display:block}summary:hover{background-color:#e6e6e6}summary:focus{outline:.25rem solid #2491ff;outline-offset:0}`,
|
|
13
|
-
html `<details><summary><slot name="heading"></slot><usa-icon icon="add"></usa-icon><usa-icon icon="remove"></usa-icon></summary><div class="content"><slot></slot></div></details>`,
|
|
15
|
+
html `<j-props><details $.open="open"><summary><slot name="heading"></slot><usa-icon icon="add"></usa-icon><usa-icon icon="remove"></usa-icon></summary><div class="content"><slot></slot></div></details></j-props>`,
|
|
14
16
|
],
|
|
15
17
|
})];
|
|
16
18
|
let _classDescriptor;
|
|
@@ -31,7 +33,7 @@ let USAAccordionElement = (() => {
|
|
|
31
33
|
static {
|
|
32
34
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
33
35
|
_name_decorators = [attr()];
|
|
34
|
-
_open_decorators = [attr()];
|
|
36
|
+
_open_decorators = [attr(), bind()];
|
|
35
37
|
_onClick_decorators = [listen("click", "summary")];
|
|
36
38
|
_onAccordionToggle_decorators = [listen("usa::accordion::toggle", () => document.body)];
|
|
37
39
|
__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);
|
|
@@ -49,10 +51,6 @@ let USAAccordionElement = (() => {
|
|
|
49
51
|
#open_accessor_storage = (__runInitializers(this, _name_extraInitializers), __runInitializers(this, _open_initializers, false));
|
|
50
52
|
get open() { return this.#open_accessor_storage; }
|
|
51
53
|
set open(value) { this.#open_accessor_storage = value; }
|
|
52
|
-
#details = (__runInitializers(this, _open_extraInitializers), query("details"));
|
|
53
|
-
attributeChangedCallback() {
|
|
54
|
-
this.#details({ open: this.open });
|
|
55
|
-
}
|
|
56
54
|
onClick(e) {
|
|
57
55
|
e.preventDefault();
|
|
58
56
|
this.dispatchEvent(new USAAccordionToggleEvent(!this.open));
|
|
@@ -65,6 +63,10 @@ let USAAccordionElement = (() => {
|
|
|
65
63
|
this.open = e.open;
|
|
66
64
|
}
|
|
67
65
|
}
|
|
66
|
+
constructor() {
|
|
67
|
+
super(...arguments);
|
|
68
|
+
__runInitializers(this, _open_extraInitializers);
|
|
69
|
+
}
|
|
68
70
|
};
|
|
69
71
|
return USAAccordionElement = _classThis;
|
|
70
72
|
})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion.element.js","sourceRoot":"","sources":["../../../src/lib/accordion/accordion.element.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"accordion.element.js","sourceRoot":"","sources":["../../../src/lib/accordion/accordion.element.ts"],"names":[],"mappings":";AAAA,OAAO,6BAA6B,CAAC;AAErC,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;IAyGzC,mBAAmB;4BAjG/B,OAAO,CAAC;YACP,OAAO,EAAE,eAAe;YACxB,aAAa,EAAE;gBACb,IAAI,EAAE,MAAM;gBACZ,cAAc,EAAE,IAAI;aACrB;YACD,SAAS,EAAE;gBACT,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAuEF;gBACD,IAAI,CAAA;;;;;;;;;;;;;;;KAeH;aACF;SACF,CAAC;;;;sBACuC,WAAW;;;;;;;;;;mCAAnB,SAAQ,WAAW;;;;gCACjD,IAAI,EAAE;gCAGN,IAAI,EAAE,EACN,IAAI,EAAE;mCAGN,MAAM,CAAC,OAAO,EAAE,SAAS,CAAC;6CAO1B,MAAM,CAAC,wBAAwB,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC;YAbtD,iKAAS,IAAI,6BAAJ,IAAI,mFAAM;YAInB,iKAAS,IAAI,6BAAJ,IAAI,mFAAS;YAGtB,wKAAA,OAAO,6DAIN;YAGD,sMAAA,iBAAiB,6DAMhB;YAtBH,6KAuBC;;;YAvBY,uDAAmB;;QAE9B,0BAFW,mDAAmB,8CAEd,EAAE,GAAC;QAAnB,IAAS,IAAI,0CAAM;QAAnB,IAAS,IAAI,gDAAM;QAInB,wHAAgB,KAAK,GAAC;QAAtB,IAAS,IAAI,0CAAS;QAAtB,IAAS,IAAI,gDAAS;QAGtB,OAAO,CAAC,CAAQ;YACd,CAAC,CAAC,cAAc,EAAE,CAAC;YAEnB,IAAI,CAAC,aAAa,CAAC,IAAI,uBAAuB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC9D,CAAC;QAGD,iBAAiB,CAAC,CAA0B;YAC1C,IAAI,CAAC,CAAC,MAAM,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,EAAE,CAAC;gBAChC,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,MAAM,KAAK,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC;YAC1C,CAAC;iBAAM,IAAI,CAAC,CAAC,MAAM,KAAK,IAAI,EAAE,CAAC;gBAC7B,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC;YACrB,CAAC;QACH,CAAC;;;;;;;;SAtBU,mBAAmB"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { __esDecorate, __runInitializers } from "tslib";
|
|
2
|
-
import { attr, css, element, html
|
|
2
|
+
import { attr, css, element, html } from "@joist/element";
|
|
3
|
+
import { bind } from "@joist/templating";
|
|
3
4
|
let USABreadcrumbElement = (() => {
|
|
4
5
|
let _classDecorators = [element({
|
|
5
6
|
tagName: "usa-breadcrumb",
|
|
6
7
|
shadowDom: [
|
|
7
8
|
css `:host{position:relative;right:auto;display:inline;max-width:unset;padding-right:1.5rem}:host(:last-child) usa-icon{display:none}a[href]{color:#005ea2;display:inline;text-decoration:underline}usa-icon{height:1rem;width:1.5rem;position:absolute;top:.075rem}`,
|
|
8
|
-
html `<a><slot></slot></a><usa-icon icon="navigate_next"></usa-icon>`,
|
|
9
|
+
html `<j-props><a $.href="href"><slot></slot></a></j-props><usa-icon icon="navigate_next"></usa-icon>`,
|
|
9
10
|
],
|
|
10
11
|
})];
|
|
11
12
|
let _classDescriptor;
|
|
@@ -22,7 +23,7 @@ let USABreadcrumbElement = (() => {
|
|
|
22
23
|
static { _classThis = this; }
|
|
23
24
|
static {
|
|
24
25
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
25
|
-
_href_decorators = [attr()];
|
|
26
|
+
_href_decorators = [attr(), bind()];
|
|
26
27
|
_role_decorators = [attr()];
|
|
27
28
|
__esDecorate(this, null, _href_decorators, { kind: "accessor", name: "href", static: false, private: false, access: { has: obj => "href" in obj, get: obj => obj.href, set: (obj, value) => { obj.href = value; } }, metadata: _metadata }, _href_initializers, _href_extraInitializers);
|
|
28
29
|
__esDecorate(this, null, _role_decorators, { kind: "accessor", name: "role", static: false, private: false, access: { has: obj => "role" in obj, get: obj => obj.role, set: (obj, value) => { obj.role = value; } }, metadata: _metadata }, _role_initializers, _role_extraInitializers);
|
|
@@ -37,9 +38,9 @@ let USABreadcrumbElement = (() => {
|
|
|
37
38
|
#role_accessor_storage = (__runInitializers(this, _href_extraInitializers), __runInitializers(this, _role_initializers, "listitem"));
|
|
38
39
|
get role() { return this.#role_accessor_storage; }
|
|
39
40
|
set role(value) { this.#role_accessor_storage = value; }
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
constructor() {
|
|
42
|
+
super(...arguments);
|
|
43
|
+
__runInitializers(this, _role_extraInitializers);
|
|
43
44
|
}
|
|
44
45
|
};
|
|
45
46
|
return USABreadcrumbElement = _classThis;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"breadcrumb.element.js","sourceRoot":"","sources":["../../../../src/lib/breadcrumbs/breadcrumb/breadcrumb.element.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"breadcrumb.element.js","sourceRoot":"","sources":["../../../../src/lib/breadcrumbs/breadcrumb/breadcrumb.element.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;IAgD5B,oBAAoB;4BAxChC,OAAO,CAAC;YACP,OAAO,EAAE,gBAAgB;YACzB,SAAS,EAAE;gBACT,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;KAyBF;gBACD,IAAI,CAAA;;;;;;;;KAQH;aACF;SACF,CAAC;;;;sBACwC,WAAW;;;;;;;oCAAnB,SAAQ,WAAW;;;;gCAClD,IAAI,EAAE,EACN,IAAI,EAAE;gCAGN,IAAI,EAAE;YAFP,iKAAS,IAAI,6BAAJ,IAAI,mFAAM;YAGnB,iKAAS,IAAI,6BAAJ,IAAI,mFAAc;YAN7B,6KAOC;;;YAPY,uDAAoB;;QAG/B,qEAAgB,EAAE,EAAC;QAAnB,IAAS,IAAI,0CAAM;QAAnB,IAAS,IAAI,gDAAM;QAGnB,wHAAgB,UAAU,GAAC;QAA3B,IAAS,IAAI,0CAAc;QAA3B,IAAS,IAAI,gDAAc;;;;;;;;SANhB,oBAAoB"}
|
|
@@ -4,7 +4,7 @@ const meta = {
|
|
|
4
4
|
title: "usa-breadcrumbs",
|
|
5
5
|
tags: ["autodocs"],
|
|
6
6
|
render(args) {
|
|
7
|
-
return html `<usa-breadcrumbs ?wrap="${args.wrap}"><usa-breadcrumb href="/">Home</usa-breadcrumb><usa-breadcrumb href="/">Federal Contracting</usa-breadcrumb><usa-breadcrumb href="/">Contracting assistance programs</usa-breadcrumb><usa-breadcrumb>Economically disadvantaged women-owned small business federal contracting program</usa-breadcrumb></usa-breadcrumbs>`;
|
|
7
|
+
return html `<usa-breadcrumbs ?wrap="${args.wrap}"><usa-breadcrumb href="/home">Home</usa-breadcrumb><usa-breadcrumb href="/federal-contracting">Federal Contracting</usa-breadcrumb><usa-breadcrumb href="/contracting-assistance-programs">Contracting assistance programs</usa-breadcrumb><usa-breadcrumb>Economically disadvantaged women-owned small business federal contracting program</usa-breadcrumb></usa-breadcrumbs>`;
|
|
8
8
|
},
|
|
9
9
|
argTypes: {
|
|
10
10
|
wrap: {
|
|
@@ -18,7 +18,7 @@ let USAButtonElement = (() => {
|
|
|
18
18
|
},
|
|
19
19
|
shadowDom: [
|
|
20
20
|
css `:host{display:inline-block;border-top-right-radius:.25rem;border-bottom-right-radius:.25rem;border-top-left-radius:.25rem;border-bottom-left-radius:.25rem;overflow:hidden}a,button{box-sizing:border-box;font-size:1.06rem;line-height:.9;color:#fff;background-color:#005ea2;-webkit-appearance:none;-moz-appearance:none;appearance:none;align-items:center;border:0;cursor:pointer;-moz-column-gap:0.5rem;column-gap:.5rem;display:inline-flex;font-weight:700;justify-content:center;padding:.75rem 1.25rem;text-align:center;text-decoration:none;width:100%;height:100%;cursor:pointer}@media all and (min-width:30em){:host{width:auto}}:is(button,a):visited{color:#fff}:is(button,a):hover{color:#fff;background-color:#1a4480;border-bottom:0;text-decoration:none}:is(button,a):active{color:#fff;background-color:#162e51}:is(button,a):not([disabled]):focus{outline-offset:0.25rem}:is(button,a):disabled{color:#454545;background-color:#c9c9c9;cursor:not-allowed;opacity:1}:is(button,a):disabled:active,:is(button,a):disabled:focus,:is(button,a):disabled:hover{color:#454545;background-color:#c9c9c9}:is(button,a):focus{outline:.25rem solid #2491ff;outline-offset:0}:host([variant=secondary]) :is(button,a){color:#fff;background-color:#d83933}:host([variant=secondary]) :is(button,a):hover{background-color:#b50909}:host([variant=secondary]) :is(button,a):active{background-color:#8b0a03}:host([variant=cool]) :is(button,a){color:#1b1b1b;background-color:#00bde3}:host([variant=cool]) :is(button,a):hover{background-color:#28a0cb}:host([variant=cool]) :is(button,a):active{color:#fff;background-color:#07648d}:host([variant=warm]) :is(button,a){color:#1b1b1b;background-color:#fa9441}:host([variant=warm]) :is(button,a):hover{color:#fff;background-color:#c05600}:host([variant=warm]) :is(button,a):active{color:#fff;background-color:#775540}:host([variant=outline]) :is(button,a){background-color:transparent;box-shadow:inset 0 0 0 2px #005ea2;color:#005ea2}:host([variant=outline]) :is(button,a):hover{box-shadow:inset 0 0 0 2px #1a4480;color:#1a4480}:host([variant=outline]) :is(button,a):active{box-shadow:inset 0 0 0 2px #162e51;color:#162e51}`,
|
|
21
|
-
html `<j-if bind="href"><template><j-props><a $href="href" $disabled="disabled" $target="target"><slot></slot></a></j-props></template><template else><j-props><button tabindex="0" $type="type" $disabled="disabled" $value="value"><slot></slot></button></j-props></template></j-if>`,
|
|
21
|
+
html `<j-if bind="href"><template><j-props><a part="link" $href="href" $disabled="disabled" $target="target"><slot></slot></a></j-props></template><template else><j-props><button tabindex="0" part="button" $type="type" $disabled="disabled" $value="value"><slot></slot></button></j-props></template></j-if>`,
|
|
22
22
|
],
|
|
23
23
|
})];
|
|
24
24
|
let _classDescriptor;
|
|
@@ -4,8 +4,8 @@ let USACheckboxElement = (() => {
|
|
|
4
4
|
let _classDecorators = [element({
|
|
5
5
|
tagName: "usa-checkbox",
|
|
6
6
|
shadowDom: [
|
|
7
|
-
css `*{box-sizing:border-box}:host{
|
|
8
|
-
html `<label><input type="checkbox" tabindex="0"><div class="checkbox"></div><div class="title"><slot></slot></div></label>`,
|
|
7
|
+
css `*{box-sizing:border-box}:host{display:inline-block;max-width:30rem;position:relative}:host([tiled]) label{background-color:#fff;border:2px solid #5c5c5c;border-radius:.25rem;color:#1b1b1b;padding:.75rem 1rem .75rem .75rem}label{display:inline-flex;cursor:pointer;font-size:1.06rem;line-height:1.3;width:100%}.checkbox{background:#fff;box-shadow:0 0 0 2px #1b1b1b;display:flex;align-items:center;justify-content:center;height:1.25rem;min-width:1.25rem;max-width:1.25rem;border-radius:2px;position:relative;margin-right:.75rem}input:disabled+.checkbox{background-color:#fff;box-shadow:0 0 0 2px #757575}input:disabled:is(:checked)+.checkbox{background-color:#757575;box-shadow:0 0 0 2px #757575}:host([disabled]) label{color:#757575;cursor:not-allowed}input:checked+.checkbox{background-color:#005ea2;box-shadow:0 0 0 2px #005ea2}input:checked+.checkbox::after{content:" ";display:block;height:1rem;width:.5rem;border-right:4px solid #fff;border-bottom:4px solid #fff;transform:rotate(45deg) scale(.65)}input{position:absolute}input:focus+.checkbox{outline:.25rem solid #2491ff;outline-offset:0.25rem}.description{display:block;font-size:.93rem;margin-top:.5rem}.break{flex-basis:100%;height:0}:host([tiled]) label:has(input:checked){background-color:rgba(0,94,162,.1);border-color:#005ea2}:host([tiled]) label:has(input:checked:is(:disabled)){background-color:#fff;border-color:#757575}`,
|
|
8
|
+
html `<label><input type="checkbox" tabindex="0"><div class="checkbox" part="checkbox"></div><div class="title" part="title"><slot></slot></div></label>`,
|
|
9
9
|
],
|
|
10
10
|
})];
|
|
11
11
|
let _classDescriptor;
|
|
@@ -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/checkbox/checkbox.element.ts"],"names":[],"mappings":"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"}
|