@noctuatech/uswds 0.1.0 → 0.1.3
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/flags/alabama.svg +5 -0
- package/assets/flags/alaska.svg +14 -0
- package/assets/flags/arizona.svg +7 -0
- package/assets/flags/arkansas.svg +15 -0
- package/assets/flags/california.svg +8 -0
- package/assets/flags/colorado.svg +8 -0
- package/assets/flags/connecticut.svg +5 -0
- package/assets/flags/delaware.svg +7 -0
- package/assets/flags/florida.svg +5 -0
- package/assets/flags/georgia.svg +5 -0
- package/assets/flags/hawaii.svg +19 -0
- package/assets/flags/idaho.svg +5 -0
- package/assets/flags/illinois.svg +5 -0
- package/assets/flags/indiana.svg +15 -0
- package/assets/flags/iowa.svg +13 -0
- package/assets/flags/kansas.svg +5 -0
- package/assets/flags/kentucky.svg +16 -0
- package/assets/flags/louisiana.svg +14 -0
- package/assets/flags/maine.svg +12 -0
- package/assets/flags/maryland.svg +14 -0
- package/assets/flags/massachusetts.svg +15 -0
- package/assets/flags/michigan.svg +5 -0
- package/assets/flags/minnesota.svg +15 -0
- package/assets/flags/mississippi.svg +10 -0
- package/assets/flags/missouri.svg +16 -0
- package/assets/flags/montana.svg +11 -0
- package/assets/flags/nebraska.svg +13 -0
- package/assets/flags/nevada.svg +14 -0
- package/assets/flags/new_hampshire.svg +13 -0
- package/assets/flags/new_jersey.svg +13 -0
- package/assets/flags/new_mexico.svg +7 -0
- package/assets/flags/new_york.svg +13 -0
- package/assets/flags/north_carolina.svg +5 -0
- package/assets/flags/north_dakota.svg +13 -0
- package/assets/flags/ohio.svg +16 -0
- package/assets/flags/oklahoma.svg +12 -0
- package/assets/flags/oregon.svg +13 -0
- package/assets/flags/pennsylvania.svg +15 -0
- package/assets/flags/rhode_island.svg +13 -0
- package/assets/flags/south_carolina.svg +11 -0
- package/assets/flags/south_dakota.svg +15 -0
- package/assets/flags/tennessee.svg +13 -0
- package/assets/flags/texas.svg +8 -0
- package/assets/flags/utah.svg +9 -0
- package/assets/flags/vermont.svg +13 -0
- package/assets/flags/virginia.svg +5 -0
- package/assets/flags/washington.svg +5 -0
- package/assets/flags/west_virginia.svg +24 -0
- package/assets/flags/wisconsin.svg +5 -0
- package/assets/flags/wyoming.svg +5 -0
- package/package.json +13 -11
- package/src/lib/combo-box/combo-box-option/combo-box-option.element.ts +32 -13
- package/src/lib/combo-box/combo-box.element.ts +161 -43
- package/src/lib/combo-box/combo-box.stories.ts +202 -56
- package/src/lib/combo-box/combo-box.test.ts +140 -22
- package/target/lib/accordion/accordion.element.js +2 -86
- package/target/lib/accordion/accordion.stories.js +1 -26
- package/target/lib/accordion/accordion.test.js +5 -72
- package/target/lib/alert/alert.element.js +2 -71
- package/target/lib/alert/alert.stories.js +1 -41
- package/target/lib/alert/alert.test.js +1 -9
- package/target/lib/button/button.element.js +2 -142
- package/target/lib/button/button.stories.js +1 -6
- package/target/lib/button/button.test.js +1 -3
- package/target/lib/card/card-body/card-body.element.js +1 -8
- package/target/lib/card/card-footer/card-footer.element.js +1 -6
- package/target/lib/card/card-group/card-group.element.js +1 -12
- package/target/lib/card/card-header/card-header.element.js +1 -16
- package/target/lib/card/card-media/card-media.element.js +2 -33
- package/target/lib/card/card.element.js +1 -32
- package/target/lib/card/card.stories.js +2 -107
- package/target/lib/card/card.test.js +1 -20
- package/target/lib/checkbox/checkbox-group/checkbox-group.element.js +2 -10
- package/target/lib/checkbox/checkbox.element.js +2 -112
- package/target/lib/checkbox/checkbox.stories.js +2 -43
- package/target/lib/checkbox/checkbox.test.js +4 -28
- package/target/lib/collection/collection-item/collection-item.element.js +2 -40
- package/target/lib/collection/collection-item/collection-item.test.js +1 -3
- package/target/lib/collection/collection.element.js +2 -10
- package/target/lib/collection/collection.stories.js +1 -63
- package/target/lib/collection/collection.test.js +1 -3
- package/target/lib/combo-box/combo-box-option/combo-box-option.element.d.ts +0 -1
- package/target/lib/combo-box/combo-box-option/combo-box-option.element.js +21 -12
- package/target/lib/combo-box/combo-box-option/combo-box-option.element.js.map +1 -1
- package/target/lib/combo-box/combo-box.element.d.ts +9 -1
- package/target/lib/combo-box/combo-box.element.js +92 -86
- package/target/lib/combo-box/combo-box.element.js.map +1 -1
- package/target/lib/combo-box/combo-box.stories.js +1 -59
- package/target/lib/combo-box/combo-box.stories.js.map +1 -1
- package/target/lib/combo-box/combo-box.test.js +65 -22
- package/target/lib/combo-box/combo-box.test.js.map +1 -1
- package/target/lib/config/config.element.js +1 -5
- package/target/lib/config/config.test.js +1 -3
- package/target/lib/description/description.element.js +1 -7
- package/target/lib/description/description.test.js +1 -3
- package/target/lib/file-input/file-input-preview/file-input-preview.element.js +2 -61
- package/target/lib/file-input/file-input-preview/file-input-preview.test.js +5 -25
- package/target/lib/file-input/file-input.element.js +2 -82
- package/target/lib/file-input/file-input.stories.js +1 -13
- package/target/lib/file-input/file-input.test.js +2 -16
- package/target/lib/icon/icon.element.js +1 -14
- package/target/lib/icon/icon.stories.js +2 -13
- package/target/lib/input/input.element.js +2 -73
- package/target/lib/input/input.stories.js +2 -12
- package/target/lib/input/input.test.js +4 -24
- package/target/lib/input-mask/input-mask.element.js +1 -5
- package/target/lib/input-mask/input-mask.stories.js +1 -12
- package/target/lib/input-mask/input-mask.test.js +4 -24
- package/target/lib/link/link.element.js +2 -18
- package/target/lib/modal/modal-close/modal-close.element.js +2 -36
- package/target/lib/modal/modal-close/modal-close.test.js +1 -3
- package/target/lib/modal/modal-heading/modal-heading.element.js +2 -24
- package/target/lib/modal/modal-heading/modal-heading.test.js +1 -3
- package/target/lib/modal/modal.element.js +2 -33
- package/target/lib/modal/modal.stories.js +1 -18
- package/target/lib/modal/modal.test.js +1 -11
- package/target/lib/radio/radio-option/radio-option.element.js +2 -16
- package/target/lib/radio/radio-option/radio-option.test.js +1 -5
- package/target/lib/radio/radio.element.js +2 -98
- package/target/lib/radio/radio.stories.js +1 -26
- package/target/lib/radio/radio.test.js +5 -103
- package/target/lib/range-slider/range-slider.element.js +2 -52
- package/target/lib/range-slider/range-slider.test.js +3 -17
- package/target/lib/select/select-option/select-option.element.js +1 -5
- package/target/lib/select/select.element.js +2 -49
- package/target/lib/select/select.stories.js +1 -10
- package/target/lib/select/select.test.js +6 -64
- package/target/lib/side-nav/side-nav-item/side-nav-item.element.js +2 -67
- package/target/lib/side-nav/side-nav.element.js +1 -8
- package/target/lib/side-nav/side-nav.stories.js +1 -39
- package/target/lib/side-nav/side-nav.test.js +2 -78
- package/target/lib/step-indicator/step/step.element.js +2 -96
- package/target/lib/step-indicator/step-indicator.element.js +1 -9
- package/target/lib/step-indicator/step-indicator.stories.js +1 -21
- package/target/lib/step-indicator/step-indicator.test.js +1 -9
- package/target/lib/summary-box/summary-box.element.js +2 -14
- package/target/lib/summary-box/summary-box.stories.js +1 -1
- package/target/lib/summary-box/summary-box.test.js +1 -3
- package/target/lib/tag/tag.element.js +1 -22
- package/target/lib/tag/tag.stories.js +1 -1
- package/target/lib/tag/tag.test.js +1 -3
- package/target/lib/textarea/textarea.element.js +2 -49
- package/target/lib/textarea/textarea.test.js +4 -24
|
@@ -5,55 +5,8 @@ let USATextareaElement = (() => {
|
|
|
5
5
|
let _classDecorators = [element({
|
|
6
6
|
tagName: "usa-textarea",
|
|
7
7
|
shadowDom: [
|
|
8
|
-
css
|
|
9
|
-
|
|
10
|
-
box-sizing: border-box;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
:host {
|
|
14
|
-
font-size: 1.06rem;
|
|
15
|
-
line-height: 1.3;
|
|
16
|
-
display: flex;
|
|
17
|
-
flex-direction: column;
|
|
18
|
-
font-weight: 400;
|
|
19
|
-
margin-bottom: 1.5rem;
|
|
20
|
-
max-width: 30rem;
|
|
21
|
-
position: relative;
|
|
22
|
-
height: 9lh;
|
|
23
|
-
gap: 0.5rem;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
textarea {
|
|
27
|
-
font-family: inherit;
|
|
28
|
-
font-size: inherit;
|
|
29
|
-
border-radius: 0;
|
|
30
|
-
color: #1b1b1b;
|
|
31
|
-
display: block;
|
|
32
|
-
max-width: 30rem;
|
|
33
|
-
padding: .5rem;
|
|
34
|
-
border-width: 1px;
|
|
35
|
-
border-color: #5c5c5c;
|
|
36
|
-
border-style: solid;
|
|
37
|
-
-webkit-appearance: none;
|
|
38
|
-
-moz-appearance: none;
|
|
39
|
-
appearance: none;
|
|
40
|
-
width: 100%;
|
|
41
|
-
resize: none;
|
|
42
|
-
flex-grow: 1;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
textarea:not(:disabled):focus {
|
|
46
|
-
outline: 0.25rem solid #2491ff;
|
|
47
|
-
outline-offset: 0;
|
|
48
|
-
}
|
|
49
|
-
`,
|
|
50
|
-
html `
|
|
51
|
-
<label for="textarea">
|
|
52
|
-
<slot></slot>
|
|
53
|
-
</label>
|
|
54
|
-
|
|
55
|
-
<textarea id="textarea"></textarea>
|
|
56
|
-
`,
|
|
8
|
+
css `*{box-sizing:border-box}:host{font-size:1.06rem;line-height:1.3;display:flex;flex-direction:column;font-weight:400;margin-bottom:1.5rem;max-width:30rem;position:relative;height:9lh;gap:.5rem}textarea{font-family:inherit;font-size:inherit;border-radius:0;color:#1b1b1b;display:block;max-width:30rem;padding:.5rem;border-width:1px;border-color:#5c5c5c;border-style:solid;-webkit-appearance:none;-moz-appearance:none;appearance:none;width:100%;resize:none;flex-grow:1}textarea:not(:disabled):focus{outline:.25rem solid #2491ff;outline-offset:0}`,
|
|
9
|
+
html `<label for="textarea"><slot></slot></label> <textarea id="textarea"></textarea>`,
|
|
57
10
|
],
|
|
58
11
|
})];
|
|
59
12
|
let _classDescriptor;
|
|
@@ -3,30 +3,16 @@ import { assert, fixture, html } from "@open-wc/testing";
|
|
|
3
3
|
import { userEvent } from "@testing-library/user-event";
|
|
4
4
|
describe("usa-textarea", () => {
|
|
5
5
|
it("should be accessible", async () => {
|
|
6
|
-
const form = await fixture(html
|
|
7
|
-
<usa-textarea name="fname" value="Foo">Hello World</usa-textarea>
|
|
8
|
-
`);
|
|
6
|
+
const form = await fixture(html `<usa-textarea name="fname" value="Foo">Hello World</usa-textarea>`);
|
|
9
7
|
return assert.isAccessible(form);
|
|
10
8
|
});
|
|
11
9
|
it("should submit form with default values", async () => {
|
|
12
|
-
const form = await fixture(html
|
|
13
|
-
<form>
|
|
14
|
-
<usa-textarea name="fname" value="Foo">Hello World</usa-textarea>
|
|
15
|
-
|
|
16
|
-
<button>Submit</button>
|
|
17
|
-
</form>
|
|
18
|
-
`);
|
|
10
|
+
const form = await fixture(html `<form><usa-textarea name="fname" value="Foo">Hello World</usa-textarea><button>Submit</button></form>`);
|
|
19
11
|
const value = new FormData(form);
|
|
20
12
|
assert.equal(value.get("fname"), "Foo");
|
|
21
13
|
});
|
|
22
14
|
it("should update form value as input value changed", async () => {
|
|
23
|
-
const form = await fixture(html
|
|
24
|
-
<form>
|
|
25
|
-
<usa-textarea name="fname">Hello World</usa-textarea>
|
|
26
|
-
|
|
27
|
-
<button>Submit</button>
|
|
28
|
-
</form>
|
|
29
|
-
`);
|
|
15
|
+
const form = await fixture(html `<form><usa-textarea name="fname">Hello World</usa-textarea><button>Submit</button></form>`);
|
|
30
16
|
const input = form.querySelector("usa-textarea");
|
|
31
17
|
const nativeInput = input?.shadowRoot?.querySelector("textarea");
|
|
32
18
|
if (nativeInput) {
|
|
@@ -36,13 +22,7 @@ describe("usa-textarea", () => {
|
|
|
36
22
|
assert.equal(value.get("fname"), "Bar");
|
|
37
23
|
});
|
|
38
24
|
it("should not submit when not valid", async () => {
|
|
39
|
-
const form = await fixture(html
|
|
40
|
-
<form>
|
|
41
|
-
<usa-textarea name="fname" required>Hello World</usa-textarea>
|
|
42
|
-
|
|
43
|
-
<button>Submit</button>
|
|
44
|
-
</form>
|
|
45
|
-
`);
|
|
25
|
+
const form = await fixture(html `<form><usa-textarea name="fname" required>Hello World</usa-textarea><button>Submit</button></form>`);
|
|
46
26
|
assert.equal(form.checkValidity(), false);
|
|
47
27
|
});
|
|
48
28
|
});
|