@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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@noctuatech/uswds",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"workspaces": [
|
|
6
6
|
"packages/**"
|
|
@@ -104,19 +104,18 @@
|
|
|
104
104
|
"license": "ISC",
|
|
105
105
|
"description": "",
|
|
106
106
|
"dependencies": {
|
|
107
|
-
"@joist/di": "^4.2.4-next.
|
|
108
|
-
"@joist/element": "^4.2.4-next.
|
|
109
|
-
"@joist/observable": "^4.2.4-next.
|
|
110
|
-
"@joist/templating": "^4.2.4-next.
|
|
107
|
+
"@joist/di": "^4.2.4-next.17",
|
|
108
|
+
"@joist/element": "^4.2.4-next.17",
|
|
109
|
+
"@joist/observable": "^4.2.4-next.17",
|
|
110
|
+
"@joist/templating": "^4.2.4-next.17",
|
|
111
111
|
"tslib": "2.8.1"
|
|
112
112
|
},
|
|
113
113
|
"devDependencies": {
|
|
114
114
|
"@11ty/eleventy": "^3.0.0",
|
|
115
|
-
"@chromatic-com/storybook": "^4.0.
|
|
115
|
+
"@chromatic-com/storybook": "^4.0.1",
|
|
116
116
|
"@open-wc/testing": "^4.0.0",
|
|
117
|
-
"@storybook/addon-docs": "^9.0.
|
|
118
|
-
"@storybook/web-components": "^9.0.
|
|
119
|
-
"@storybook/web-components-vite": "^9.0.4",
|
|
117
|
+
"@storybook/addon-docs": "^9.0.16",
|
|
118
|
+
"@storybook/web-components-vite": "^9.0.16",
|
|
120
119
|
"@testing-library/dom": "^10.4.0",
|
|
121
120
|
"@testing-library/user-event": "^14.6.1",
|
|
122
121
|
"@types/mocha": "^10.0.7",
|
|
@@ -132,7 +131,7 @@
|
|
|
132
131
|
"mocha": "^11.0.0",
|
|
133
132
|
"plop": "^4.0.1",
|
|
134
133
|
"prettier": "^3.5.3",
|
|
135
|
-
"storybook": "^9.0.
|
|
134
|
+
"storybook": "^9.0.16",
|
|
136
135
|
"typescript": "^5.8.0",
|
|
137
136
|
"wireit": "^0.14.9"
|
|
138
137
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import '
|
|
1
|
+
import '../templating.js';
|
|
2
2
|
|
|
3
3
|
import { attr, css, element, html, listen } from '@joist/element';
|
|
4
4
|
import { bind } from '@joist/templating';
|
|
@@ -79,21 +79,21 @@ declare global {
|
|
|
79
79
|
}
|
|
80
80
|
`,
|
|
81
81
|
html`
|
|
82
|
-
<
|
|
82
|
+
<usa-bind props="open">
|
|
83
83
|
<details>
|
|
84
84
|
<summary>
|
|
85
85
|
<slot name="heading"></slot>
|
|
86
86
|
|
|
87
|
-
<
|
|
87
|
+
<usa-bind props="icon">
|
|
88
88
|
<usa-icon></usa-icon>
|
|
89
|
-
</
|
|
89
|
+
</usa-bind>
|
|
90
90
|
</summary>
|
|
91
91
|
|
|
92
92
|
<div class="content">
|
|
93
93
|
<slot></slot>
|
|
94
94
|
</div>
|
|
95
95
|
</details>
|
|
96
|
-
</
|
|
96
|
+
</usa-bind>
|
|
97
97
|
`,
|
|
98
98
|
],
|
|
99
99
|
})
|
|
@@ -1,43 +1,40 @@
|
|
|
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 { USAAccordionElement } from
|
|
4
|
+
import type { USAAccordionElement } from './accordion.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-accordion',
|
|
9
|
+
tags: ['autodocs'],
|
|
10
10
|
render(args) {
|
|
11
11
|
return html`
|
|
12
12
|
<usa-accordion id="first" name="${args.name}">
|
|
13
13
|
<h4 slot="heading">First Ammendment</h4>
|
|
14
14
|
|
|
15
|
-
Congress shall make no law respecting an establishment of religion, or
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
assemble, and to petition the Government for a redress of grievances.
|
|
15
|
+
Congress shall make no law respecting an establishment of religion, or prohibiting the free exercise thereof; or
|
|
16
|
+
abridging the freedom of speech, or of the press; or the right of the people peaceably to assemble, and to
|
|
17
|
+
petition the Government for a redress of grievances.
|
|
19
18
|
</usa-accordion>
|
|
20
19
|
|
|
21
20
|
<usa-accordion id="second" name="${args.name}">
|
|
22
21
|
<h4 slot="heading">Second Ammendment</h4>
|
|
23
22
|
|
|
24
|
-
A well regulated Militia, being necessary to the security of a free
|
|
25
|
-
|
|
26
|
-
infringed.
|
|
23
|
+
A well regulated Militia, being necessary to the security of a free State, the right of the people to keep and
|
|
24
|
+
bear Arms, shall not be infringed.
|
|
27
25
|
</usa-accordion>
|
|
28
26
|
|
|
29
27
|
<usa-accordion id="third" name="${args.name}">
|
|
30
28
|
<h4 slot="heading">Third Ammendment</h4>
|
|
31
29
|
|
|
32
|
-
No Soldier shall, in time of peace be quartered in any house, without
|
|
33
|
-
|
|
34
|
-
prescribed by law.
|
|
30
|
+
No Soldier shall, in time of peace be quartered in any house, without the consent of the Owner, nor in time of
|
|
31
|
+
war, but in a manner to be prescribed by law.
|
|
35
32
|
</usa-accordion>
|
|
36
33
|
`;
|
|
37
34
|
},
|
|
38
35
|
argTypes: {},
|
|
39
36
|
args: {
|
|
40
|
-
name:
|
|
37
|
+
name: 'ammendment',
|
|
41
38
|
},
|
|
42
39
|
} satisfies Meta<USAAccordionElement>;
|
|
43
40
|
|
|
@@ -1,26 +1,28 @@
|
|
|
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 { USABreadcrumbsElement } from
|
|
4
|
+
import type { USABreadcrumbsElement } from './breadcrumbs.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-breadcrumbs',
|
|
9
|
+
tags: ['autodocs'],
|
|
10
10
|
render(args) {
|
|
11
11
|
return html`
|
|
12
12
|
<usa-breadcrumbs ?wrap=${args.wrap}>
|
|
13
13
|
<usa-breadcrumb href="/home">Home</usa-breadcrumb>
|
|
14
14
|
<usa-breadcrumb href="/federal-contracting">Federal Contracting</usa-breadcrumb>
|
|
15
15
|
<usa-breadcrumb href="/contracting-assistance-programs">Contracting assistance programs</usa-breadcrumb>
|
|
16
|
-
<usa-breadcrumb
|
|
16
|
+
<usa-breadcrumb
|
|
17
|
+
>Economically disadvantaged women-owned small business federal contracting program</usa-breadcrumb
|
|
18
|
+
>
|
|
17
19
|
</usa-breadcrumbs>
|
|
18
20
|
`;
|
|
19
21
|
},
|
|
20
22
|
argTypes: {
|
|
21
23
|
wrap: {
|
|
22
|
-
type:
|
|
23
|
-
control:
|
|
24
|
+
type: 'boolean',
|
|
25
|
+
control: 'boolean',
|
|
24
26
|
},
|
|
25
27
|
},
|
|
26
28
|
args: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import '
|
|
1
|
+
import '../templating.js';
|
|
2
2
|
|
|
3
3
|
import { attr, css, element, html, listen } from '@joist/element';
|
|
4
4
|
import { bind } from '@joist/templating';
|
|
@@ -163,23 +163,23 @@ export type ButtonVariant = (typeof BUTTON_VARIANTS)[number];
|
|
|
163
163
|
}
|
|
164
164
|
`,
|
|
165
165
|
html`
|
|
166
|
-
<
|
|
166
|
+
<usa-if bind="href">
|
|
167
167
|
<template>
|
|
168
|
-
<
|
|
168
|
+
<usa-bind props="href,target">
|
|
169
169
|
<a part="link">
|
|
170
170
|
<slot></slot>
|
|
171
171
|
</a>
|
|
172
|
-
</
|
|
172
|
+
</usa-bind>
|
|
173
173
|
</template>
|
|
174
174
|
|
|
175
175
|
<template else>
|
|
176
|
-
<
|
|
176
|
+
<usa-bind props="value,type,disabled">
|
|
177
177
|
<button tabindex="0" part="button">
|
|
178
178
|
<slot></slot>
|
|
179
179
|
</button>
|
|
180
|
-
</
|
|
180
|
+
</usa-bind>
|
|
181
181
|
</template>
|
|
182
|
-
</
|
|
182
|
+
</usa-if>
|
|
183
183
|
`,
|
|
184
184
|
],
|
|
185
185
|
})
|
|
@@ -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 { USAButtonGroupElement } from
|
|
4
|
+
import type { USAButtonGroupElement } from './button-group.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-button-group',
|
|
9
|
+
tags: ['autodocs'],
|
|
10
10
|
render() {
|
|
11
11
|
return html`
|
|
12
12
|
<usa-button-group>
|
|
@@ -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 { USACardElement } from
|
|
4
|
+
import type { USACardElement } from './card.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-card',
|
|
9
|
+
tags: ['autodocs'],
|
|
10
10
|
argTypes: {},
|
|
11
11
|
args: {},
|
|
12
12
|
} satisfies Meta<USACardElement>;
|
|
@@ -24,8 +24,8 @@ export const Primary: Story = {
|
|
|
24
24
|
<usa-card-header>Card</usa-card-header>
|
|
25
25
|
|
|
26
26
|
<usa-card-body>
|
|
27
|
-
Lorem ipsum dolor sit amet consectetur adipisicing elit. Facilis
|
|
28
|
-
|
|
27
|
+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Facilis earum tenetur quo cupiditate, eaque qui
|
|
28
|
+
officia recusandae.
|
|
29
29
|
</usa-card-body>
|
|
30
30
|
|
|
31
31
|
<usa-card-footer>
|
|
@@ -41,8 +41,8 @@ export const Primary: Story = {
|
|
|
41
41
|
<usa-card-header>Card with media</usa-card-header>
|
|
42
42
|
|
|
43
43
|
<usa-card-body>
|
|
44
|
-
Lorem ipsum dolor sit amet consectetur adipisicing elit. Facilis
|
|
45
|
-
|
|
44
|
+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Facilis earum tenetur quo cupiditate, eaque qui
|
|
45
|
+
officia recusandae.
|
|
46
46
|
</usa-card-body>
|
|
47
47
|
|
|
48
48
|
<usa-card-footer>
|
|
@@ -58,8 +58,8 @@ export const Primary: Story = {
|
|
|
58
58
|
</usa-card-media>
|
|
59
59
|
|
|
60
60
|
<usa-card-body>
|
|
61
|
-
Lorem ipsum dolor sit amet consectetur adipisicing elit. Tempore
|
|
62
|
-
|
|
61
|
+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Tempore possimus similique nemo odit doloremque
|
|
62
|
+
laudantium?
|
|
63
63
|
</usa-card-body>
|
|
64
64
|
|
|
65
65
|
<usa-card-footer>
|
|
@@ -75,11 +75,9 @@ export const Primary: Story = {
|
|
|
75
75
|
<usa-card-header>Inset media</usa-card-header>
|
|
76
76
|
|
|
77
77
|
<usa-card-body>
|
|
78
|
-
Etiam vitae sodales metus. Fusce id orci dignissim, efficitur risus
|
|
79
|
-
eget,
|
|
80
|
-
|
|
81
|
-
parturient montes, nascetur ridiculus mus. Mauris mattis tellus
|
|
82
|
-
bibendum aliquet malesuada.
|
|
78
|
+
Etiam vitae sodales metus. Fusce id orci dignissim, efficitur risus eget, tempus odio. Donec lectus ante,
|
|
79
|
+
auctor eget cursus sed, convallis quis magna. Orci varius natoque penatibus et magnis dis parturient montes,
|
|
80
|
+
nascetur ridiculus mus. Mauris mattis tellus bibendum aliquet malesuada.
|
|
83
81
|
</usa-card-body>
|
|
84
82
|
|
|
85
83
|
<usa-card-footer>
|
|
@@ -103,8 +101,8 @@ export const Flag: Story = {
|
|
|
103
101
|
<usa-card-header>Card with media</usa-card-header>
|
|
104
102
|
|
|
105
103
|
<usa-card-body>
|
|
106
|
-
Lorem ipsum dolor sit amet consectetur adipisicing elit. Facilis
|
|
107
|
-
|
|
104
|
+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Facilis earum tenetur quo cupiditate, eaque qui
|
|
105
|
+
officia recusandae.
|
|
108
106
|
</usa-card-body>
|
|
109
107
|
|
|
110
108
|
<usa-card-footer>
|
|
@@ -120,8 +118,8 @@ export const Flag: Story = {
|
|
|
120
118
|
<usa-card-header>Card with media</usa-card-header>
|
|
121
119
|
|
|
122
120
|
<usa-card-body>
|
|
123
|
-
Lorem ipsum dolor sit amet consectetur adipisicing elit. Facilis
|
|
124
|
-
|
|
121
|
+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Facilis earum tenetur quo cupiditate, eaque qui
|
|
122
|
+
officia recusandae.
|
|
125
123
|
</usa-card-body>
|
|
126
124
|
|
|
127
125
|
<usa-card-footer>
|
|
@@ -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 { bind } from '@joist/templating';
|
|
@@ -116,10 +116,10 @@ declare global {
|
|
|
116
116
|
`,
|
|
117
117
|
html`
|
|
118
118
|
<label>
|
|
119
|
-
<
|
|
119
|
+
<usa-bind props="checked,required,disabled" target="input">
|
|
120
120
|
<input type="checkbox" tabindex="0" />
|
|
121
121
|
<div class="checkbox" part="checkbox"></div>
|
|
122
|
-
</
|
|
122
|
+
</usa-bind>
|
|
123
123
|
|
|
124
124
|
<div class="title" part="title">
|
|
125
125
|
<slot></slot>
|
|
@@ -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 { USACollectionElement } from
|
|
4
|
+
import type { USACollectionElement } from './collection.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-collection',
|
|
9
|
+
tags: ['autodocs'],
|
|
10
10
|
render() {
|
|
11
11
|
return html`
|
|
12
12
|
<usa-collection>
|
|
@@ -16,7 +16,9 @@ const meta = {
|
|
|
16
16
|
</h4>
|
|
17
17
|
|
|
18
18
|
<div slot="description">
|
|
19
|
-
Today, the Administration announces the winners of the Gears of Government President's Award. This program
|
|
19
|
+
Today, the Administration announces the winners of the Gears of Government President's Award. This program
|
|
20
|
+
recognizes the contributions of individuals and teams across the federal workforce who make a profound
|
|
21
|
+
difference in the lives of the American people.
|
|
20
22
|
</div>
|
|
21
23
|
|
|
22
24
|
<usa-tag slot="tags" type="new">NEW</usa-tag>
|
|
@@ -25,14 +27,16 @@ const meta = {
|
|
|
25
27
|
</usa-collection-item>
|
|
26
28
|
|
|
27
29
|
<usa-collection-item>
|
|
28
|
-
<img height="80" width="80" src="./img/gog-logo.png" slot="img"/>
|
|
30
|
+
<img height="80" width="80" src="./img/gog-logo.png" slot="img" />
|
|
29
31
|
|
|
30
32
|
<h4 slot="heading">
|
|
31
33
|
<usa-link href="#">Gears of Government President's Award winners</usa-link>
|
|
32
34
|
</h4>
|
|
33
35
|
|
|
34
36
|
<div slot="description">
|
|
35
|
-
Today, the Administration announces the winners of the Gears of Government President's Award. This program
|
|
37
|
+
Today, the Administration announces the winners of the Gears of Government President's Award. This program
|
|
38
|
+
recognizes the contributions of individuals and teams across the federal workforce who make a profound
|
|
39
|
+
difference in the lives of the American people.
|
|
36
40
|
</div>
|
|
37
41
|
|
|
38
42
|
<usa-tag slot="tags" type="new">NEW</usa-tag>
|
|
@@ -46,7 +50,9 @@ const meta = {
|
|
|
46
50
|
</h4>
|
|
47
51
|
|
|
48
52
|
<div slot="description">
|
|
49
|
-
In honor of National Women's Small Business Month, we've partnered with SBA's Office of Government
|
|
53
|
+
In honor of National Women's Small Business Month, we've partnered with SBA's Office of Government
|
|
54
|
+
Contracting and Business Development and Office of Program Performance, Analysis, and Evaluation to
|
|
55
|
+
highlight the Women-Owned Small Businesses (WOSBs) data dashboard!
|
|
50
56
|
</div>
|
|
51
57
|
|
|
52
58
|
<usa-tag slot="tags" type="new">NEW</usa-tag>
|
|
@@ -55,14 +61,16 @@ const meta = {
|
|
|
55
61
|
</usa-collection-item>
|
|
56
62
|
|
|
57
63
|
<usa-collection-item>
|
|
58
|
-
<img height="52" width="80" src="./img/wosb1.jpg" slot="img"/>
|
|
64
|
+
<img height="52" width="80" src="./img/wosb1.jpg" slot="img" />
|
|
59
65
|
|
|
60
66
|
<h4 slot="heading">
|
|
61
67
|
<usa-link href="#">Women-owned small business dashboard</usa-link>
|
|
62
68
|
</h4>
|
|
63
|
-
|
|
69
|
+
|
|
64
70
|
<div slot="description">
|
|
65
|
-
In honor of National Women's Small Business Month, we've partnered with SBA's Office of Government
|
|
71
|
+
In honor of National Women's Small Business Month, we've partnered with SBA's Office of Government
|
|
72
|
+
Contracting and Business Development and Office of Program Performance, Analysis, and Evaluation to
|
|
73
|
+
highlight the Women-Owned Small Businesses (WOSBs) data dashboard!
|
|
66
74
|
</div>
|
|
67
75
|
|
|
68
76
|
<usa-tag slot="tags" type="new">NEW</usa-tag>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { inject, injectable } from
|
|
2
|
-
import { attr, css, element, html, query } from
|
|
1
|
+
import { inject, injectable } from '@joist/di';
|
|
2
|
+
import { attr, css, element, html, query } from '@joist/element';
|
|
3
3
|
|
|
4
|
-
import { COMBO_BOX_CTX } from
|
|
4
|
+
import { COMBO_BOX_CTX } from '../context.js';
|
|
5
5
|
|
|
6
6
|
declare global {
|
|
7
7
|
interface HTMLElementTagNameMap {
|
|
8
|
-
|
|
8
|
+
'usa-combo-box-option': USAComboBoxOptionElement;
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
|
|
@@ -16,33 +16,34 @@ const listTemplate = html`
|
|
|
16
16
|
`;
|
|
17
17
|
|
|
18
18
|
@injectable({
|
|
19
|
-
name:
|
|
19
|
+
name: 'usa-combo-box-option-ctx',
|
|
20
20
|
})
|
|
21
21
|
@element({
|
|
22
|
-
tagName:
|
|
22
|
+
tagName: 'usa-combo-box-option',
|
|
23
|
+
dependsOn: ['usa-combo-box'],
|
|
23
24
|
shadowDom: [
|
|
24
25
|
css`
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
:host {
|
|
27
|
+
display: flex;
|
|
28
|
+
align-items: center;
|
|
29
|
+
gap: 0.5rem;
|
|
30
|
+
padding: 0.5rem;
|
|
31
|
+
}
|
|
31
32
|
`,
|
|
32
33
|
html`<slot></slot>`,
|
|
33
34
|
],
|
|
34
35
|
})
|
|
35
36
|
export class USAComboBoxOptionElement extends HTMLElement {
|
|
36
37
|
@attr()
|
|
37
|
-
accessor value =
|
|
38
|
+
accessor value = '';
|
|
38
39
|
|
|
39
40
|
#listItem = listTemplate.createNode() as HTMLElement;
|
|
40
|
-
#li = query(
|
|
41
|
-
#slot = query(
|
|
41
|
+
#li = query('li', this.#listItem);
|
|
42
|
+
#slot = query('slot', this.#listItem);
|
|
42
43
|
#ctx = inject(COMBO_BOX_CTX);
|
|
43
44
|
|
|
44
45
|
attributeChangedCallback() {
|
|
45
|
-
const value = this.value.split(
|
|
46
|
+
const value = this.value.split(' ').join('-').toLocaleLowerCase();
|
|
46
47
|
|
|
47
48
|
this.#li().dataset.value = this.value;
|
|
48
49
|
|
|
@@ -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 { USAComboBoxElement } from
|
|
4
|
+
import type { USAComboBoxElement } from './combo-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-combo-box',
|
|
9
|
+
tags: ['autodocs'],
|
|
10
10
|
argTypes: {},
|
|
11
11
|
args: {},
|
|
12
12
|
} satisfies Meta<USAComboBoxElement>;
|
|
@@ -278,7 +278,7 @@ export const WithImages: Story = {
|
|
|
278
278
|
<usa-combo-box-option value="Wisconsin">
|
|
279
279
|
<img loading="lazy" src="./flags/wisconsin.svg" alt="Wisconsin" height="20" /> Wisconsin
|
|
280
280
|
</usa-combo-box-option>
|
|
281
|
-
|
|
281
|
+
|
|
282
282
|
<usa-combo-box-option value="Wyoming">
|
|
283
283
|
<img loading="lazy" src="./flags/wyoming.svg" alt="Wyoming" height="20" /> Wyoming
|
|
284
284
|
</usa-combo-box-option>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import '
|
|
1
|
+
import '../../templating.js';
|
|
2
2
|
|
|
3
3
|
import { css, element, html } from '@joist/element';
|
|
4
4
|
import { observe } from '@joist/observable';
|
|
@@ -72,25 +72,25 @@ declare global {
|
|
|
72
72
|
html`
|
|
73
73
|
<slot class="preview-heading" part="heading"></slot>
|
|
74
74
|
|
|
75
|
-
<
|
|
75
|
+
<usa-for bind="fileEntries" key="src">
|
|
76
76
|
<template>
|
|
77
77
|
<div class="preview-item" part="item">
|
|
78
|
-
<
|
|
78
|
+
<usa-if bind="each.value.isImage">
|
|
79
79
|
<template>
|
|
80
|
-
<
|
|
80
|
+
<usa-bind props="src:each.value.src">
|
|
81
81
|
<img height="40" width="40" aria-hidden="true" />
|
|
82
|
-
</
|
|
82
|
+
</usa-bind>
|
|
83
83
|
</template>
|
|
84
84
|
|
|
85
85
|
<template else>
|
|
86
86
|
<usa-icon icon="file_present"></usa-icon>
|
|
87
87
|
</template>
|
|
88
|
-
</
|
|
88
|
+
</usa-if>
|
|
89
89
|
|
|
90
|
-
<
|
|
90
|
+
<usa-val bind="each.value.file.name"></usa-val>
|
|
91
91
|
</div>
|
|
92
92
|
</template>
|
|
93
|
-
</
|
|
93
|
+
</usa-for>
|
|
94
94
|
`,
|
|
95
95
|
],
|
|
96
96
|
})
|
|
@@ -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';
|
|
@@ -82,17 +82,17 @@ declare global {
|
|
|
82
82
|
</label>
|
|
83
83
|
|
|
84
84
|
<div class="container">
|
|
85
|
-
<
|
|
85
|
+
<usa-bind props="name,multiple,accept,required,files">
|
|
86
86
|
<input id="file-input" type="file" tabindex="0" />
|
|
87
|
-
</
|
|
87
|
+
</usa-bind>
|
|
88
88
|
|
|
89
|
-
<
|
|
89
|
+
<usa-if bind="files.length">
|
|
90
90
|
<template>
|
|
91
|
-
<
|
|
91
|
+
<usa-bind props="files">
|
|
92
92
|
<usa-file-input-preview part="preview" exportparts="heading, item">
|
|
93
93
|
Selected file <usa-link>Change file</usa-link>
|
|
94
94
|
</usa-file-input-preview>
|
|
95
|
-
</
|
|
95
|
+
</usa-bind>
|
|
96
96
|
</template>
|
|
97
97
|
|
|
98
98
|
<template id="test" else>
|
|
@@ -100,7 +100,7 @@ declare global {
|
|
|
100
100
|
<slot name="description"> Drag file here or <usa-link>choose from folder</usa-link> </slot>
|
|
101
101
|
</div>
|
|
102
102
|
</template>
|
|
103
|
-
</
|
|
103
|
+
</usa-if>
|
|
104
104
|
</div>
|
|
105
105
|
`,
|
|
106
106
|
],
|