@noctuatech/uswds 1.3.16 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +9 -10
- package/src/lib/accordion/accordion.element.ts +5 -5
- package/src/lib/accordion/accordion.stories.ts +13 -16
- package/src/lib/alert/alert.element.ts +2 -2
- package/src/lib/alert/alert.stories.ts +1 -1
- package/src/lib/breadcrumbs/breadcrumb/breadcrumb.element.ts +2 -2
- package/src/lib/breadcrumbs/breadcrumbs.stories.ts +10 -8
- package/src/lib/button/button.element.ts +7 -7
- package/src/lib/button/button.stories.ts +1 -1
- package/src/lib/button-group/button-group.stories.ts +5 -5
- package/src/lib/card/card.stories.ts +18 -20
- package/src/lib/checkbox/checkbox.element.ts +3 -3
- package/src/lib/checkbox/checkbox.stories.ts +1 -1
- package/src/lib/collection/collection.stories.ts +20 -12
- package/src/lib/combo-box/combo-box-option/combo-box-option.element.ts +17 -16
- package/src/lib/combo-box/combo-box.stories.ts +6 -6
- package/src/lib/file-input/file-input-preview/file-input-preview.element.ts +8 -8
- package/src/lib/file-input/file-input.element.ts +7 -7
- package/src/lib/file-input/file-input.stories.ts +1 -1
- package/src/lib/icon/icon.stories.ts +7 -9
- package/src/lib/in-page-nav/in-page-nav-item/in-page-nav-item.element.ts +3 -3
- package/src/lib/in-page-nav/in-page-nav.stories.ts +461 -25
- package/src/lib/input/input.element.ts +3 -3
- package/src/lib/input/input.stories.ts +12 -10
- package/src/lib/input-mask/input-mask.stories.ts +1 -1
- package/src/lib/link/link.element.ts +3 -3
- package/src/lib/link/link.stories.ts +7 -7
- package/src/lib/modal/modal.stories.ts +1 -1
- package/src/lib/pagination/pagination-no/pagination-no.element.ts +3 -3
- package/src/lib/pagination/pagination.stories.ts +11 -15
- package/src/lib/process-list/process-list.stories.ts +42 -42
- package/src/lib/radio/radio.stories.ts +12 -20
- package/src/lib/range-slider/range-slider.element.ts +5 -5
- package/src/lib/range-slider/range-slider.stories.ts +5 -5
- package/src/lib/search/search.stories.ts +7 -7
- package/src/lib/select/select-option/select-option.element.ts +11 -10
- package/src/lib/select/select.element.test.ts +2 -1
- package/src/lib/select/select.element.ts +4 -4
- package/src/lib/select/select.stories.ts +5 -5
- package/src/lib/side-nav/side-nav.stories.ts +5 -5
- package/src/lib/step-indicator/step-indicator.stories.ts +13 -21
- package/src/lib/summary-box/summary-box.stories.ts +5 -5
- package/src/lib/tag/tag.stories.ts +7 -7
- package/src/lib/templating.ts +12 -0
- package/src/lib/textarea/textarea.element.ts +5 -5
- package/src/lib/textarea/textarea.stories.ts +1 -1
- package/target/lib/accordion/accordion.element.d.ts +1 -1
- package/target/lib/accordion/accordion.element.js +2 -2
- package/target/lib/accordion/accordion.element.js.map +1 -1
- package/target/lib/accordion/accordion.stories.d.ts +2 -2
- package/target/lib/accordion/accordion.stories.js +4 -4
- package/target/lib/accordion/accordion.stories.js.map +1 -1
- package/target/lib/alert/alert.element.js +1 -1
- package/target/lib/alert/alert.stories.d.ts +1 -1
- package/target/lib/breadcrumbs/breadcrumb/breadcrumb.element.js +1 -1
- package/target/lib/breadcrumbs/breadcrumbs.stories.d.ts +2 -2
- package/target/lib/breadcrumbs/breadcrumbs.stories.js +5 -5
- package/target/lib/breadcrumbs/breadcrumbs.stories.js.map +1 -1
- package/target/lib/button/button.element.d.ts +1 -1
- package/target/lib/button/button.element.js +2 -2
- package/target/lib/button/button.element.js.map +1 -1
- package/target/lib/button/button.stories.d.ts +1 -1
- package/target/lib/button-group/button-group.stories.d.ts +2 -2
- package/target/lib/button-group/button-group.stories.js +3 -3
- package/target/lib/card/card.stories.d.ts +2 -2
- package/target/lib/card/card.stories.js +3 -3
- package/target/lib/card/card.stories.js.map +1 -1
- package/target/lib/checkbox/checkbox.element.d.ts +1 -1
- package/target/lib/checkbox/checkbox.element.js +2 -2
- package/target/lib/checkbox/checkbox.element.js.map +1 -1
- package/target/lib/checkbox/checkbox.stories.d.ts +1 -1
- package/target/lib/collection/collection.stories.d.ts +2 -2
- package/target/lib/collection/collection.stories.js +3 -3
- package/target/lib/collection/collection.stories.js.map +1 -1
- package/target/lib/combo-box/combo-box-option/combo-box-option.element.d.ts +1 -1
- package/target/lib/combo-box/combo-box-option/combo-box-option.element.js +10 -9
- package/target/lib/combo-box/combo-box-option/combo-box-option.element.js.map +1 -1
- package/target/lib/combo-box/combo-box.stories.d.ts +2 -2
- package/target/lib/combo-box/combo-box.stories.js +3 -3
- package/target/lib/file-input/file-input-preview/file-input-preview.element.d.ts +1 -1
- package/target/lib/file-input/file-input-preview/file-input-preview.element.js +2 -2
- 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 +1 -1
- package/target/lib/file-input/file-input.element.js +2 -2
- package/target/lib/file-input/file-input.element.js.map +1 -1
- package/target/lib/file-input/file-input.stories.d.ts +1 -1
- package/target/lib/icon/icon.stories.d.ts +2 -2
- package/target/lib/icon/icon.stories.js +4 -4
- package/target/lib/icon/icon.stories.js.map +1 -1
- package/target/lib/in-page-nav/in-page-nav-item/in-page-nav-item.element.d.ts +1 -1
- package/target/lib/in-page-nav/in-page-nav-item/in-page-nav-item.element.js +2 -2
- package/target/lib/in-page-nav/in-page-nav-item/in-page-nav-item.element.js.map +1 -1
- package/target/lib/in-page-nav/in-page-nav.stories.d.ts +2 -2
- package/target/lib/in-page-nav/in-page-nav.stories.js +3 -3
- package/target/lib/in-page-nav/in-page-nav.stories.js.map +1 -1
- package/target/lib/input/input.element.d.ts +1 -1
- package/target/lib/input/input.element.js +3 -3
- package/target/lib/input/input.element.js.map +1 -1
- package/target/lib/input/input.stories.d.ts +2 -2
- package/target/lib/input/input.stories.js +3 -3
- package/target/lib/input/input.stories.js.map +1 -1
- package/target/lib/input-mask/input-mask.stories.d.ts +1 -1
- package/target/lib/link/link.element.d.ts +1 -1
- package/target/lib/link/link.element.js +2 -2
- package/target/lib/link/link.element.js.map +1 -1
- package/target/lib/link/link.stories.d.ts +2 -2
- package/target/lib/link/link.stories.js +5 -5
- package/target/lib/modal/modal.stories.d.ts +1 -1
- package/target/lib/pagination/pagination-no/pagination-no.element.d.ts +1 -1
- package/target/lib/pagination/pagination-no/pagination-no.element.js +2 -2
- package/target/lib/pagination/pagination-no/pagination-no.element.js.map +1 -1
- package/target/lib/pagination/pagination.stories.d.ts +2 -2
- package/target/lib/pagination/pagination.stories.js +3 -3
- package/target/lib/pagination/pagination.stories.js.map +1 -1
- package/target/lib/process-list/process-list.stories.d.ts +2 -2
- package/target/lib/process-list/process-list.stories.js +3 -3
- package/target/lib/process-list/process-list.stories.js.map +1 -1
- package/target/lib/radio/radio.stories.d.ts +2 -2
- package/target/lib/radio/radio.stories.js +3 -3
- package/target/lib/radio/radio.stories.js.map +1 -1
- package/target/lib/range-slider/range-slider.element.d.ts +1 -1
- package/target/lib/range-slider/range-slider.element.js +2 -2
- package/target/lib/range-slider/range-slider.element.js.map +1 -1
- package/target/lib/range-slider/range-slider.stories.d.ts +2 -2
- package/target/lib/range-slider/range-slider.stories.js +3 -3
- package/target/lib/search/search.stories.d.ts +2 -2
- package/target/lib/search/search.stories.js +4 -4
- package/target/lib/select/select-option/select-option.element.d.ts +1 -1
- package/target/lib/select/select-option/select-option.element.js +10 -9
- package/target/lib/select/select-option/select-option.element.js.map +1 -1
- package/target/lib/select/select.element.d.ts +1 -1
- package/target/lib/select/select.element.js +3 -3
- package/target/lib/select/select.element.js.map +1 -1
- package/target/lib/select/select.element.test.d.ts +1 -1
- package/target/lib/select/select.element.test.js +1 -1
- package/target/lib/select/select.element.test.js.map +1 -1
- package/target/lib/select/select.stories.d.ts +2 -2
- package/target/lib/select/select.stories.js +3 -3
- package/target/lib/side-nav/side-nav.stories.d.ts +2 -2
- package/target/lib/side-nav/side-nav.stories.js +3 -3
- package/target/lib/step-indicator/step-indicator.stories.d.ts +2 -2
- package/target/lib/step-indicator/step-indicator.stories.js +7 -7
- package/target/lib/step-indicator/step-indicator.stories.js.map +1 -1
- package/target/lib/summary-box/summary-box.stories.d.ts +2 -2
- package/target/lib/summary-box/summary-box.stories.js +3 -3
- package/target/lib/tag/tag.stories.d.ts +2 -2
- package/target/lib/tag/tag.stories.js +6 -6
- package/target/lib/templating.d.ts +1 -0
- package/target/lib/templating.js +17 -0
- package/target/lib/templating.js.map +1 -0
- package/target/lib/textarea/textarea.element.d.ts +1 -1
- package/target/lib/textarea/textarea.element.js +2 -2
- package/target/lib/textarea/textarea.element.js.map +1 -1
- package/target/lib/textarea/textarea.stories.d.ts +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import '
|
|
1
|
+
import '../templating.js';
|
|
2
2
|
|
|
3
3
|
import { attr, css, element, html, listen, query } from '@joist/element';
|
|
4
4
|
import { effect } from '@joist/observable';
|
|
@@ -92,7 +92,7 @@ declare global {
|
|
|
92
92
|
|
|
93
93
|
<slot></slot>
|
|
94
94
|
|
|
95
|
-
<
|
|
95
|
+
<usa-bind
|
|
96
96
|
props="
|
|
97
97
|
autocomplete,
|
|
98
98
|
autofocus,
|
|
@@ -111,7 +111,7 @@ declare global {
|
|
|
111
111
|
"
|
|
112
112
|
>
|
|
113
113
|
<input tabindex="0" part="input" />
|
|
114
|
-
</
|
|
114
|
+
</usa-bind>
|
|
115
115
|
</label>
|
|
116
116
|
`,
|
|
117
117
|
],
|
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from
|
|
2
|
-
import { html } from
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/web-components-vite';
|
|
2
|
+
import { html } from 'lit';
|
|
3
3
|
|
|
4
|
-
import type { USATextInputElement } from
|
|
4
|
+
import type { USATextInputElement } from './input.element.js';
|
|
5
5
|
|
|
6
6
|
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
7
7
|
const meta = {
|
|
8
|
-
title:
|
|
9
|
-
tags: [
|
|
8
|
+
title: 'usa-input',
|
|
9
|
+
tags: ['autodocs'],
|
|
10
10
|
render() {
|
|
11
11
|
return html`
|
|
12
|
-
<form
|
|
13
|
-
e
|
|
12
|
+
<form
|
|
13
|
+
@submit=${(e: Event) => {
|
|
14
|
+
e.preventDefault();
|
|
14
15
|
|
|
15
|
-
|
|
16
|
+
const data = new FormData(e.target as HTMLFormElement);
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
console.log(Array.from(data.entries()));
|
|
19
|
+
}}
|
|
20
|
+
>
|
|
19
21
|
<usa-input name="fname" autocomplete="off" detail="pfx">
|
|
20
22
|
<usa-icon icon="credit_card" slot="detail"></usa-icon>
|
|
21
23
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import '
|
|
1
|
+
import '../templating.js';
|
|
2
2
|
|
|
3
3
|
import { attr, css, element, html, query } from '@joist/element';
|
|
4
4
|
import { bind } from '@joist/templating';
|
|
@@ -27,11 +27,11 @@ declare global {
|
|
|
27
27
|
}
|
|
28
28
|
`,
|
|
29
29
|
html`
|
|
30
|
-
<
|
|
30
|
+
<usa-bind props="href,target,title">
|
|
31
31
|
<a>
|
|
32
32
|
<slot></slot>
|
|
33
33
|
</a>
|
|
34
|
-
</
|
|
34
|
+
</usa-bind>
|
|
35
35
|
`,
|
|
36
36
|
],
|
|
37
37
|
})
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from
|
|
2
|
-
import { html } from
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/web-components-vite';
|
|
2
|
+
import { html } from 'lit';
|
|
3
3
|
|
|
4
|
-
import type { USALinkElement } from
|
|
4
|
+
import type { USALinkElement } from './link.element.js';
|
|
5
5
|
|
|
6
6
|
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
7
7
|
const meta = {
|
|
8
|
-
title:
|
|
9
|
-
tags: [
|
|
8
|
+
title: 'usa-link',
|
|
9
|
+
tags: ['autodocs'],
|
|
10
10
|
render(args) {
|
|
11
11
|
return html`<usa-link href="${args.href}">Hello World</usa-link>`;
|
|
12
12
|
},
|
|
13
13
|
argTypes: {
|
|
14
14
|
href: {
|
|
15
|
-
type:
|
|
15
|
+
type: 'string',
|
|
16
16
|
},
|
|
17
17
|
},
|
|
18
18
|
args: {},
|
|
@@ -25,6 +25,6 @@ type Story = StoryObj<USALinkElement>;
|
|
|
25
25
|
// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
|
|
26
26
|
export const Primary: Story = {
|
|
27
27
|
args: {
|
|
28
|
-
href:
|
|
28
|
+
href: 'www.google.com',
|
|
29
29
|
},
|
|
30
30
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import '
|
|
1
|
+
import '../../templating.js';
|
|
2
2
|
|
|
3
3
|
import { attr, css, element, html } from '@joist/element';
|
|
4
4
|
import { bind } from '@joist/templating';
|
|
@@ -41,11 +41,11 @@ declare global {
|
|
|
41
41
|
}
|
|
42
42
|
`,
|
|
43
43
|
html`
|
|
44
|
-
<
|
|
44
|
+
<usa-bind props="href">
|
|
45
45
|
<a>
|
|
46
46
|
<slot></slot>
|
|
47
47
|
</a>
|
|
48
|
-
</
|
|
48
|
+
</usa-bind>
|
|
49
49
|
`,
|
|
50
50
|
],
|
|
51
51
|
})
|
|
@@ -1,31 +1,29 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from
|
|
2
|
-
import { html } from
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/web-components-vite';
|
|
2
|
+
import { html } from 'lit';
|
|
3
3
|
|
|
4
|
-
import type { USAPaginationElement } from
|
|
4
|
+
import type { USAPaginationElement } from './pagination.element.js';
|
|
5
5
|
|
|
6
6
|
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
7
7
|
const meta = {
|
|
8
|
-
title:
|
|
9
|
-
tags: [
|
|
8
|
+
title: 'usa-pagination',
|
|
9
|
+
tags: ['autodocs'],
|
|
10
10
|
render(args) {
|
|
11
11
|
return html`
|
|
12
12
|
<usa-pagination>
|
|
13
13
|
<usa-pagination-item>
|
|
14
|
-
<usa-link href="#">
|
|
15
|
-
<usa-icon icon="navigate_before"></usa-icon> Previous
|
|
16
|
-
</usa-link>
|
|
14
|
+
<usa-link href="#"> <usa-icon icon="navigate_before"></usa-icon> Previous </usa-link>
|
|
17
15
|
</usa-pagination-item>
|
|
18
|
-
|
|
16
|
+
|
|
19
17
|
<usa-pagination-item>
|
|
20
18
|
<usa-pagination-no>1</usa-pagination-no>
|
|
21
19
|
</usa-pagination-item>
|
|
22
20
|
|
|
23
21
|
<usa-pagination-item>...</usa-pagination-item>
|
|
24
|
-
|
|
22
|
+
|
|
25
23
|
<usa-pagination-item>
|
|
26
24
|
<usa-pagination-no>9</usa-pagination-no>
|
|
27
25
|
</usa-pagination-item>
|
|
28
|
-
|
|
26
|
+
|
|
29
27
|
<usa-pagination-item>
|
|
30
28
|
<usa-pagination-no active>10</usa-pagination-no>
|
|
31
29
|
</usa-pagination-item>
|
|
@@ -39,11 +37,9 @@ const meta = {
|
|
|
39
37
|
<usa-pagination-item>
|
|
40
38
|
<usa-pagination-no>24</usa-pagination-no>
|
|
41
39
|
</usa-pagination-item>
|
|
42
|
-
|
|
40
|
+
|
|
43
41
|
<usa-pagination-item>
|
|
44
|
-
<usa-link href="#">
|
|
45
|
-
Next <usa-icon icon="navigate_next"></usa-icon>
|
|
46
|
-
</usa-link>
|
|
42
|
+
<usa-link href="#"> Next <usa-icon icon="navigate_next"></usa-icon> </usa-link>
|
|
47
43
|
</usa-pagination-item>
|
|
48
44
|
</usa-pagination>
|
|
49
45
|
`;
|
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from
|
|
2
|
-
import { html } from
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/web-components-vite';
|
|
2
|
+
import { html } from 'lit';
|
|
3
3
|
|
|
4
|
-
import type { USAProcessListElement } from
|
|
4
|
+
import type { USAProcessListElement } from './process-list.element.js';
|
|
5
5
|
|
|
6
6
|
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
7
7
|
const meta = {
|
|
8
|
-
title:
|
|
9
|
-
tags: [
|
|
8
|
+
title: 'usa-process-list',
|
|
9
|
+
tags: ['autodocs'],
|
|
10
10
|
render() {
|
|
11
11
|
return html`
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
<
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
<
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
12
|
+
<usa-process-list>
|
|
13
|
+
<usa-process-list-item>
|
|
14
|
+
<span slot="count">1</span>
|
|
15
|
+
<h4 slot="title">Start a process</h4>
|
|
16
|
+
|
|
17
|
+
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi commodo, ipsum sed pharetra gravida, orci
|
|
18
|
+
magna rhoncus neque.
|
|
19
|
+
|
|
20
|
+
<ul>
|
|
21
|
+
<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</li>
|
|
22
|
+
<li>
|
|
23
|
+
Morbi commodo, ipsum sed pharetra gravida, orci magna rhoncus neque, id pulvinar odio lorem non turpis.
|
|
24
|
+
</li>
|
|
25
|
+
<li>Nullam sit amet enim. Suspendisse id velit vitae ligula volutpat condimentum.</li>
|
|
26
|
+
<li>Aliquam erat volutpat. Sed quis velit.</li>
|
|
27
|
+
</ul>
|
|
28
|
+
</usa-process-list-item>
|
|
29
|
+
|
|
30
|
+
<usa-process-list-item>
|
|
31
|
+
<span slot="count">2</span>
|
|
32
|
+
<h4 slot="title">Proceed to the second step</h4>
|
|
33
|
+
|
|
34
|
+
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi commodo, ipsum sed pharetra gravida, orci
|
|
35
|
+
magna rhoncus neque, id pulvinar odio lorem non turpis. Nullam sit amet enim. Suspendisse id velit vitae
|
|
36
|
+
ligula volutpat condimentum. Aliquam erat volutpat. Sed quis velit. Nulla facilisi. Nulla libero. Vivamus
|
|
37
|
+
pharetra posuere sapien.
|
|
38
|
+
</usa-process-list-item>
|
|
39
|
+
|
|
40
|
+
<usa-process-list-item>
|
|
41
|
+
<span slot="count">3</span>
|
|
42
|
+
<h4 slot="title">Complete the step-by-step process</h4>
|
|
43
|
+
|
|
44
|
+
Nullam sit amet enim. Suspendisse id velit vitae ligula volutpat condimentum. Aliquam erat volutpat. Sed quis
|
|
45
|
+
velit. Nulla facilisi. Nulla libero. Vivamus pharetra posuere sapien.
|
|
46
|
+
</usa-process-list-item>
|
|
47
|
+
</usa-process-list>
|
|
48
|
+
`;
|
|
49
49
|
},
|
|
50
50
|
argTypes: {},
|
|
51
51
|
args: {},
|
|
@@ -1,37 +1,29 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from
|
|
2
|
-
import { html } from
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/web-components-vite';
|
|
2
|
+
import { html } from 'lit';
|
|
3
3
|
|
|
4
|
-
import type { USARadioElement } from
|
|
4
|
+
import type { USARadioElement } from './radio.element.js';
|
|
5
5
|
|
|
6
6
|
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
7
7
|
const meta = {
|
|
8
|
-
title:
|
|
9
|
-
tags: [
|
|
8
|
+
title: 'usa-radio',
|
|
9
|
+
tags: ['autodocs'],
|
|
10
10
|
render(args) {
|
|
11
11
|
return html`
|
|
12
|
-
<usa-radio
|
|
13
|
-
name="historical-figures"
|
|
14
|
-
value="frederick-douglass"
|
|
15
|
-
?tiled=${args.tiled}
|
|
16
|
-
>
|
|
12
|
+
<usa-radio name="historical-figures" value="frederick-douglass" ?tiled=${args.tiled}>
|
|
17
13
|
<legend>Select one historical figure</legend>
|
|
18
14
|
|
|
19
|
-
<usa-radio-option value="sojourner-truth">
|
|
20
|
-
Sojourner Truth
|
|
21
|
-
</usa-radio-option>
|
|
15
|
+
<usa-radio-option value="sojourner-truth"> Sojourner Truth </usa-radio-option>
|
|
22
16
|
|
|
23
17
|
<usa-radio-option value="frederick-douglass">
|
|
24
18
|
Frederick Douglass
|
|
25
|
-
<usa-description
|
|
19
|
+
<usa-description
|
|
20
|
+
>This is optional text that can be used to describe the label in more detail.</usa-description
|
|
21
|
+
>
|
|
26
22
|
</usa-radio-option>
|
|
27
23
|
|
|
28
|
-
<usa-radio-option value="booker-t-washington">
|
|
29
|
-
Booker T. Washington
|
|
30
|
-
</usa-radio-option>
|
|
24
|
+
<usa-radio-option value="booker-t-washington"> Booker T. Washington </usa-radio-option>
|
|
31
25
|
|
|
32
|
-
<usa-radio-option value="george-washington-carver" disabled>
|
|
33
|
-
George Washington Carver
|
|
34
|
-
</usa-radio-option>
|
|
26
|
+
<usa-radio-option value="george-washington-carver" disabled> George Washington Carver </usa-radio-option>
|
|
35
27
|
</usa-radio>
|
|
36
28
|
`;
|
|
37
29
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import '
|
|
1
|
+
import '../templating.js';
|
|
2
2
|
|
|
3
3
|
import { attr, css, element, html, listen, query } from '@joist/element';
|
|
4
4
|
import { effect } from '@joist/observable';
|
|
@@ -59,15 +59,15 @@ declare global {
|
|
|
59
59
|
}
|
|
60
60
|
`,
|
|
61
61
|
html`
|
|
62
|
-
<
|
|
62
|
+
<usa-bind attrs="for:name">
|
|
63
63
|
<label part="label">
|
|
64
64
|
<slot></slot>
|
|
65
65
|
</label>
|
|
66
|
-
</
|
|
66
|
+
</usa-bind>
|
|
67
67
|
|
|
68
|
-
<
|
|
68
|
+
<usa-bind props="id:name,name,value,min,max,step">
|
|
69
69
|
<input type="range" part="input" />
|
|
70
|
-
</
|
|
70
|
+
</usa-bind>
|
|
71
71
|
`,
|
|
72
72
|
],
|
|
73
73
|
})
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from
|
|
2
|
-
import { html } from
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/web-components-vite';
|
|
2
|
+
import { html } from 'lit';
|
|
3
3
|
|
|
4
|
-
import type { USARangeSliderElement } from
|
|
4
|
+
import type { USARangeSliderElement } from './range-slider.element.js';
|
|
5
5
|
|
|
6
6
|
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
7
7
|
const meta = {
|
|
8
|
-
title:
|
|
9
|
-
tags: [
|
|
8
|
+
title: 'usa-range-slider',
|
|
9
|
+
tags: ['autodocs'],
|
|
10
10
|
render(args) {
|
|
11
11
|
return html`<usa-range-slider name="test" value="50">Hello World</usa-range-slider>`;
|
|
12
12
|
},
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from
|
|
2
|
-
import { html } from
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/web-components-vite';
|
|
2
|
+
import { html } from 'lit';
|
|
3
3
|
|
|
4
|
-
import type { USASearchElement } from
|
|
5
|
-
import type { USASearchEvent } from
|
|
4
|
+
import type { USASearchElement } from './search.element.js';
|
|
5
|
+
import type { USASearchEvent } from './search.event.js';
|
|
6
6
|
|
|
7
7
|
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
8
8
|
const meta = {
|
|
9
|
-
title:
|
|
10
|
-
tags: [
|
|
9
|
+
title: 'usa-search',
|
|
10
|
+
tags: ['autodocs'],
|
|
11
11
|
render() {
|
|
12
12
|
function onSubmit(e: USASearchEvent) {
|
|
13
13
|
e.preventDefault();
|
|
14
14
|
|
|
15
|
-
console.log(
|
|
15
|
+
console.log('SUBMIT', e.value);
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
return html`<usa-search @usa::search=${onSubmit}>Search</usa-search>`;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { inject, injectable, injected } from
|
|
2
|
-
import { attr, css, element, html, listen } from
|
|
1
|
+
import { inject, injectable, injected } from '@joist/di';
|
|
2
|
+
import { attr, css, element, html, listen } from '@joist/element';
|
|
3
3
|
|
|
4
|
-
import { SELECT_CONTEXT } from
|
|
4
|
+
import { SELECT_CONTEXT } from '../context.js';
|
|
5
5
|
|
|
6
6
|
declare global {
|
|
7
7
|
interface HTMLElementTagNameMap {
|
|
8
|
-
|
|
8
|
+
'usa-select-option': USASelecOptionElement;
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
@element({
|
|
13
|
-
tagName:
|
|
13
|
+
tagName: 'usa-select-option',
|
|
14
|
+
dependsOn: ['usa-select'],
|
|
14
15
|
shadowDom: [
|
|
15
16
|
css`
|
|
16
17
|
:host {
|
|
@@ -21,13 +22,13 @@ declare global {
|
|
|
21
22
|
],
|
|
22
23
|
})
|
|
23
24
|
@injectable({
|
|
24
|
-
name:
|
|
25
|
+
name: 'usa-select-option-ctx',
|
|
25
26
|
})
|
|
26
27
|
export class USASelecOptionElement extends HTMLElement {
|
|
27
28
|
@attr()
|
|
28
|
-
accessor value =
|
|
29
|
+
accessor value = '';
|
|
29
30
|
|
|
30
|
-
readonly option = document.createElement(
|
|
31
|
+
readonly option = document.createElement('option');
|
|
31
32
|
|
|
32
33
|
#select = inject(SELECT_CONTEXT);
|
|
33
34
|
|
|
@@ -51,11 +52,11 @@ export class USASelecOptionElement extends HTMLElement {
|
|
|
51
52
|
|
|
52
53
|
this.#observer.observe(select, {
|
|
53
54
|
attributes: true,
|
|
54
|
-
attributeFilter: [
|
|
55
|
+
attributeFilter: ['value'],
|
|
55
56
|
});
|
|
56
57
|
}
|
|
57
58
|
|
|
58
|
-
@listen(
|
|
59
|
+
@listen('slotchange')
|
|
59
60
|
onSlotChange() {
|
|
60
61
|
this.option.textContent = this.textContent;
|
|
61
62
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import './select.element.js';
|
|
2
1
|
import './select-option/select-option.element.js';
|
|
2
|
+
import './select.element.js';
|
|
3
3
|
|
|
4
4
|
import { assert, fixture, html } from '@open-wc/testing';
|
|
5
5
|
import { userEvent } from '@testing-library/user-event';
|
|
6
|
+
|
|
6
7
|
import { USASelectElement } from './select.element.js';
|
|
7
8
|
|
|
8
9
|
describe('usa-select', () => {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import '
|
|
1
|
+
import '../templating.js';
|
|
2
2
|
|
|
3
3
|
import { injectable } from '@joist/di';
|
|
4
4
|
import { attr, css, element, html, listen, query } from '@joist/element';
|
|
5
5
|
import { bind } from '@joist/templating';
|
|
6
|
+
import { effect } from '@joist/observable';
|
|
6
7
|
|
|
7
8
|
import { SELECT_CONTEXT, type SelectContainer } from './context.js';
|
|
8
|
-
import { effect } from '@joist/observable';
|
|
9
9
|
|
|
10
10
|
declare global {
|
|
11
11
|
interface HTMLElementTagNameMap {
|
|
@@ -73,9 +73,9 @@ declare global {
|
|
|
73
73
|
<slot></slot>
|
|
74
74
|
</div>
|
|
75
75
|
|
|
76
|
-
<
|
|
76
|
+
<usa-bind props="value,name,required,disabled">
|
|
77
77
|
<select part="select"></select>
|
|
78
|
-
</
|
|
78
|
+
</usa-bind>
|
|
79
79
|
</label>
|
|
80
80
|
`,
|
|
81
81
|
],
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from
|
|
2
|
-
import { html } from
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/web-components-vite';
|
|
2
|
+
import { html } from 'lit';
|
|
3
3
|
|
|
4
|
-
import type { USASelectElement } from
|
|
4
|
+
import type { USASelectElement } from './select.element.js';
|
|
5
5
|
|
|
6
6
|
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
7
7
|
const meta = {
|
|
8
|
-
title:
|
|
9
|
-
tags: [
|
|
8
|
+
title: 'usa-select',
|
|
9
|
+
tags: ['autodocs'],
|
|
10
10
|
render() {
|
|
11
11
|
return html`
|
|
12
12
|
<usa-select value="third">
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from
|
|
2
|
-
import { html } from
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/web-components-vite';
|
|
2
|
+
import { html } from 'lit';
|
|
3
3
|
|
|
4
|
-
import type { USASideNavElement } from
|
|
4
|
+
import type { USASideNavElement } from './side-nav.element.js';
|
|
5
5
|
|
|
6
6
|
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
7
7
|
const meta = {
|
|
8
|
-
title:
|
|
9
|
-
tags: [
|
|
8
|
+
title: 'usa-side-nav',
|
|
9
|
+
tags: ['autodocs'],
|
|
10
10
|
render() {
|
|
11
11
|
return html`
|
|
12
12
|
<usa-side-nav>
|
|
@@ -1,44 +1,36 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from
|
|
2
|
-
import { html } from
|
|
3
|
-
import { ifDefined } from
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/web-components-vite';
|
|
2
|
+
import { html } from 'lit';
|
|
3
|
+
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
4
4
|
|
|
5
|
-
import type { USAStepIndicatorElement } from
|
|
5
|
+
import type { USAStepIndicatorElement } from './step-indicator.element.js';
|
|
6
6
|
|
|
7
7
|
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
8
8
|
const meta = {
|
|
9
|
-
title:
|
|
10
|
-
tags: [
|
|
9
|
+
title: 'usa-step-indicator',
|
|
10
|
+
tags: ['autodocs'],
|
|
11
11
|
render(args) {
|
|
12
12
|
return html`
|
|
13
13
|
<usa-step-indicator>
|
|
14
|
-
<usa-step state="complete" counter=${ifDefined(args.counter)}>
|
|
15
|
-
Personal information
|
|
16
|
-
</usa-step>
|
|
14
|
+
<usa-step state="complete" counter=${ifDefined(args.counter)}> Personal information </usa-step>
|
|
17
15
|
|
|
18
|
-
<usa-step state="complete" counter=${ifDefined(args.counter)}>
|
|
19
|
-
Household status
|
|
20
|
-
</usa-step>
|
|
16
|
+
<usa-step state="complete" counter=${ifDefined(args.counter)}> Household status </usa-step>
|
|
21
17
|
|
|
22
|
-
<usa-step state="current" counter=${ifDefined(args.counter)}>
|
|
23
|
-
Supporting documents
|
|
24
|
-
</usa-step>
|
|
18
|
+
<usa-step state="current" counter=${ifDefined(args.counter)}> Supporting documents </usa-step>
|
|
25
19
|
|
|
26
20
|
<usa-step counter=${ifDefined(args.counter)}>Signature</usa-step>
|
|
27
21
|
|
|
28
|
-
<usa-step counter=${ifDefined(args.counter)}>
|
|
29
|
-
Review and submit
|
|
30
|
-
</usa-step>
|
|
22
|
+
<usa-step counter=${ifDefined(args.counter)}> Review and submit </usa-step>
|
|
31
23
|
</usa-step-indicator>
|
|
32
24
|
`;
|
|
33
25
|
},
|
|
34
26
|
argTypes: {
|
|
35
27
|
counter: {
|
|
36
|
-
control:
|
|
37
|
-
options: [
|
|
28
|
+
control: 'select',
|
|
29
|
+
options: ['on', 'small', null],
|
|
38
30
|
},
|
|
39
31
|
},
|
|
40
32
|
args: {
|
|
41
|
-
counter:
|
|
33
|
+
counter: 'on',
|
|
42
34
|
},
|
|
43
35
|
} satisfies Meta<USAStepIndicatorElement & { counter: string }>;
|
|
44
36
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from
|
|
2
|
-
import { html } from
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/web-components-vite';
|
|
2
|
+
import { html } from 'lit';
|
|
3
3
|
|
|
4
|
-
import type { USASummaryBoxElement } from
|
|
4
|
+
import type { USASummaryBoxElement } from './summary-box.element.js';
|
|
5
5
|
|
|
6
6
|
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
7
7
|
const meta = {
|
|
8
|
-
title:
|
|
9
|
-
tags: [
|
|
8
|
+
title: 'usa-summary-box',
|
|
9
|
+
tags: ['autodocs'],
|
|
10
10
|
render() {
|
|
11
11
|
return html`<usa-summary-box> Hello World </usa-summary-box>`;
|
|
12
12
|
},
|