@noctuatech/uswds 0.0.27 → 0.0.28
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 +5 -5
- package/src/lib/file-input/file-input-preview/file-input-preview.element.ts +11 -2
- package/src/lib/file-input/file-input.element.ts +9 -7
- package/assets/uswds.min.js +0 -1
- package/target/lib/accordion/accordion.element.d.ts +0 -19
- package/target/lib/accordion/accordion.element.js +0 -166
- package/target/lib/accordion/accordion.element.js.map +0 -1
- package/target/lib/accordion/accordion.stories.d.ts +0 -12
- package/target/lib/accordion/accordion.stories.js +0 -42
- package/target/lib/accordion/accordion.stories.js.map +0 -1
- package/target/lib/accordion/accordion.test.d.ts +0 -1
- package/target/lib/accordion/accordion.test.js +0 -113
- package/target/lib/accordion/accordion.test.js.map +0 -1
- package/target/lib/alert/alert-types.d.ts +0 -7
- package/target/lib/alert/alert-types.js +0 -25
- package/target/lib/alert/alert-types.js.map +0 -1
- package/target/lib/alert/alert.element.d.ts +0 -11
- package/target/lib/alert/alert.element.js +0 -122
- package/target/lib/alert/alert.element.js.map +0 -1
- package/target/lib/alert/alert.stories.d.ts +0 -11
- package/target/lib/alert/alert.stories.js +0 -56
- package/target/lib/alert/alert.stories.js.map +0 -1
- package/target/lib/alert/alert.test.d.ts +0 -1
- package/target/lib/alert/alert.test.js +0 -20
- package/target/lib/alert/alert.test.js.map +0 -1
- package/target/lib/button/button.element.d.ts +0 -20
- package/target/lib/button/button.element.js +0 -263
- package/target/lib/button/button.element.js.map +0 -1
- package/target/lib/button/button.stories.d.ts +0 -12
- package/target/lib/button/button.stories.js +0 -22
- package/target/lib/button/button.stories.js.map +0 -1
- package/target/lib/button/button.test.d.ts +0 -1
- package/target/lib/button/button.test.js +0 -14
- package/target/lib/button/button.test.js.map +0 -1
- package/target/lib/card/card-body/card-body.element.d.ts +0 -7
- package/target/lib/card/card-body/card-body.element.js +0 -35
- package/target/lib/card/card-body/card-body.element.js.map +0 -1
- package/target/lib/card/card-footer/card-footer.element.d.ts +0 -7
- package/target/lib/card/card-footer/card-footer.element.js +0 -33
- package/target/lib/card/card-footer/card-footer.element.js.map +0 -1
- package/target/lib/card/card-group/card-group.element.d.ts +0 -8
- package/target/lib/card/card-group/card-group.element.js +0 -51
- package/target/lib/card/card-group/card-group.element.js.map +0 -1
- package/target/lib/card/card-header/card-header.element.d.ts +0 -7
- package/target/lib/card/card-header/card-header.element.js +0 -43
- package/target/lib/card/card-header/card-header.element.js.map +0 -1
- package/target/lib/card/card-media/card-media.element.d.ts +0 -8
- package/target/lib/card/card-media/card-media.element.js +0 -71
- package/target/lib/card/card-media/card-media.element.js.map +0 -1
- package/target/lib/card/card.element.d.ts +0 -9
- package/target/lib/card/card.element.js +0 -79
- package/target/lib/card/card.element.js.map +0 -1
- package/target/lib/card/card.stories.d.ts +0 -12
- package/target/lib/card/card.stories.js +0 -126
- package/target/lib/card/card.stories.js.map +0 -1
- package/target/lib/card/card.test.d.ts +0 -6
- package/target/lib/card/card.test.js +0 -33
- package/target/lib/card/card.test.js.map +0 -1
- package/target/lib/checkbox/checkbox.element.d.ts +0 -17
- package/target/lib/checkbox/checkbox.element.js +0 -206
- package/target/lib/checkbox/checkbox.element.js.map +0 -1
- package/target/lib/checkbox/checkbox.stories.d.ts +0 -31
- package/target/lib/checkbox/checkbox.stories.js +0 -46
- package/target/lib/checkbox/checkbox.stories.js.map +0 -1
- package/target/lib/checkbox/checkbox.test.d.ts +0 -1
- package/target/lib/checkbox/checkbox.test.js +0 -52
- package/target/lib/checkbox/checkbox.test.js.map +0 -1
- package/target/lib/config/config.element.d.ts +0 -6
- package/target/lib/config/config.element.js +0 -53
- package/target/lib/config/config.element.js.map +0 -1
- package/target/lib/config/config.test.d.ts +0 -1
- package/target/lib/config/config.test.js +0 -11
- package/target/lib/config/config.test.js.map +0 -1
- package/target/lib/define.d.ts +0 -32
- package/target/lib/define.js +0 -33
- package/target/lib/define.js.map +0 -1
- package/target/lib/description/description.element.d.ts +0 -7
- package/target/lib/description/description.element.js +0 -34
- package/target/lib/description/description.element.js.map +0 -1
- package/target/lib/description/description.test.d.ts +0 -1
- package/target/lib/description/description.test.js +0 -11
- package/target/lib/description/description.test.js.map +0 -1
- package/target/lib/file-input/file-input-preview/file-input-preview.element.d.ts +0 -12
- package/target/lib/file-input/file-input-preview/file-input-preview.element.js +0 -144
- package/target/lib/file-input/file-input-preview/file-input-preview.element.js.map +0 -1
- package/target/lib/file-input/file-input-preview/file-input-preview.test.d.ts +0 -2
- package/target/lib/file-input/file-input-preview/file-input-preview.test.js +0 -67
- package/target/lib/file-input/file-input-preview/file-input-preview.test.js.map +0 -1
- package/target/lib/file-input/file-input.element.d.ts +0 -16
- package/target/lib/file-input/file-input.element.js +0 -172
- package/target/lib/file-input/file-input.element.js.map +0 -1
- package/target/lib/file-input/file-input.stories.d.ts +0 -12
- package/target/lib/file-input/file-input.stories.js +0 -34
- package/target/lib/file-input/file-input.stories.js.map +0 -1
- package/target/lib/file-input/file-input.test.d.ts +0 -1
- package/target/lib/file-input/file-input.test.js +0 -37
- package/target/lib/file-input/file-input.test.js.map +0 -1
- package/target/lib/icon/icon-types.d.ts +0 -2
- package/target/lib/icon/icon-types.js +0 -262
- package/target/lib/icon/icon-types.js.map +0 -1
- package/target/lib/icon/icon.element.d.ts +0 -13
- package/target/lib/icon/icon.element.js +0 -72
- package/target/lib/icon/icon.element.js.map +0 -1
- package/target/lib/icon/icon.stories.d.ts +0 -12
- package/target/lib/icon/icon.stories.js +0 -39
- package/target/lib/icon/icon.stories.js.map +0 -1
- package/target/lib/input/input.element.d.ts +0 -24
- package/target/lib/input/input.element.js +0 -235
- package/target/lib/input/input.element.js.map +0 -1
- package/target/lib/input/input.stories.d.ts +0 -12
- package/target/lib/input/input.stories.js +0 -25
- package/target/lib/input/input.stories.js.map +0 -1
- package/target/lib/input/input.test.d.ts +0 -1
- package/target/lib/input/input.test.js +0 -50
- package/target/lib/input/input.test.js.map +0 -1
- package/target/lib/input-mask/format.d.ts +0 -15
- package/target/lib/input-mask/format.js +0 -47
- package/target/lib/input-mask/format.js.map +0 -1
- package/target/lib/input-mask/input-mask.element.d.ts +0 -12
- package/target/lib/input-mask/input-mask.element.js +0 -106
- package/target/lib/input-mask/input-mask.element.js.map +0 -1
- package/target/lib/input-mask/input-mask.stories.d.ts +0 -14
- package/target/lib/input-mask/input-mask.stories.js +0 -30
- package/target/lib/input-mask/input-mask.stories.js.map +0 -1
- package/target/lib/input-mask/input-mask.test.d.ts +0 -2
- package/target/lib/input-mask/input-mask.test.js +0 -89
- package/target/lib/input-mask/input-mask.test.js.map +0 -1
- package/target/lib/input-mask/maskable.element.d.ts +0 -5
- package/target/lib/input-mask/maskable.element.js +0 -2
- package/target/lib/input-mask/maskable.element.js.map +0 -1
- package/target/lib/link/link.element.d.ts +0 -13
- package/target/lib/link/link.element.js +0 -93
- package/target/lib/link/link.element.js.map +0 -1
- package/target/lib/link/link.stories.d.ts +0 -16
- package/target/lib/link/link.stories.js +0 -23
- package/target/lib/link/link.stories.js.map +0 -1
- package/target/lib/modal/modal-close/modal-close.element.d.ts +0 -8
- package/target/lib/modal/modal-close/modal-close.element.js +0 -76
- package/target/lib/modal/modal-close/modal-close.element.js.map +0 -1
- package/target/lib/modal/modal-close/modal-close.test.d.ts +0 -1
- package/target/lib/modal/modal-close/modal-close.test.js +0 -11
- package/target/lib/modal/modal-close/modal-close.test.js.map +0 -1
- package/target/lib/modal/modal-heading/modal-heading.element.d.ts +0 -7
- package/target/lib/modal/modal-heading/modal-heading.element.js +0 -50
- package/target/lib/modal/modal-heading/modal-heading.element.js.map +0 -1
- package/target/lib/modal/modal-heading/modal-heading.test.d.ts +0 -1
- package/target/lib/modal/modal-heading/modal-heading.test.js +0 -11
- package/target/lib/modal/modal-heading/modal-heading.test.js.map +0 -1
- package/target/lib/modal/modal.element.d.ts +0 -13
- package/target/lib/modal/modal.element.js +0 -91
- package/target/lib/modal/modal.element.js.map +0 -1
- package/target/lib/modal/modal.stories.d.ts +0 -12
- package/target/lib/modal/modal.stories.js +0 -34
- package/target/lib/modal/modal.stories.js.map +0 -1
- package/target/lib/modal/modal.test.d.ts +0 -3
- package/target/lib/modal/modal.test.js +0 -21
- package/target/lib/modal/modal.test.js.map +0 -1
- package/target/lib/radio/context.d.ts +0 -7
- package/target/lib/radio/context.js +0 -3
- package/target/lib/radio/context.js.map +0 -1
- package/target/lib/radio/radio-option/radio-option.element.d.ts +0 -12
- package/target/lib/radio/radio-option/radio-option.element.js +0 -89
- package/target/lib/radio/radio-option/radio-option.element.js.map +0 -1
- package/target/lib/radio/radio-option/radio-option.test.d.ts +0 -2
- package/target/lib/radio/radio-option/radio-option.test.js +0 -15
- package/target/lib/radio/radio-option/radio-option.test.js.map +0 -1
- package/target/lib/radio/radio.element.d.ts +0 -17
- package/target/lib/radio/radio.element.js +0 -169
- package/target/lib/radio/radio.element.js.map +0 -1
- package/target/lib/radio/radio.stories.d.ts +0 -17
- package/target/lib/radio/radio.stories.js +0 -46
- package/target/lib/radio/radio.stories.js.map +0 -1
- package/target/lib/radio/radio.test.d.ts +0 -2
- package/target/lib/radio/radio.test.js +0 -143
- package/target/lib/radio/radio.test.js.map +0 -1
- package/target/lib/select/context.d.ts +0 -6
- package/target/lib/select/context.js +0 -3
- package/target/lib/select/context.js.map +0 -1
- package/target/lib/select/select-option/select-option.element.d.ts +0 -14
- package/target/lib/select/select-option/select-option.element.js +0 -74
- package/target/lib/select/select-option/select-option.element.js.map +0 -1
- package/target/lib/select/select.element.d.ts +0 -17
- package/target/lib/select/select.element.js +0 -141
- package/target/lib/select/select.element.js.map +0 -1
- package/target/lib/select/select.stories.d.ts +0 -12
- package/target/lib/select/select.stories.js +0 -26
- package/target/lib/select/select.stories.js.map +0 -1
- package/target/lib/select/select.test.d.ts +0 -2
- package/target/lib/select/select.test.js +0 -105
- package/target/lib/select/select.test.js.map +0 -1
- package/target/lib/services/http.service.d.ts +0 -3
- package/target/lib/services/http.service.js +0 -24
- package/target/lib/services/http.service.js.map +0 -1
- package/target/lib/services/icon.service.d.ts +0 -4
- package/target/lib/services/icon.service.js +0 -60
- package/target/lib/services/icon.service.js.map +0 -1
- package/target/lib/services/icon.service.test.d.ts +0 -1
- package/target/lib/services/icon.service.test.js +0 -52
- package/target/lib/services/icon.service.test.js.map +0 -1
- package/target/lib/side-nav/side-nav-item/side-nav-item.element.d.ts +0 -8
- package/target/lib/side-nav/side-nav-item/side-nav-item.element.js +0 -107
- package/target/lib/side-nav/side-nav-item/side-nav-item.element.js.map +0 -1
- package/target/lib/side-nav/side-nav.element.d.ts +0 -8
- package/target/lib/side-nav/side-nav.element.js +0 -47
- package/target/lib/side-nav/side-nav.element.js.map +0 -1
- package/target/lib/side-nav/side-nav.stories.d.ts +0 -12
- package/target/lib/side-nav/side-nav.stories.js +0 -55
- package/target/lib/side-nav/side-nav.stories.js.map +0 -1
- package/target/lib/side-nav/side-nav.test.d.ts +0 -3
- package/target/lib/side-nav/side-nav.test.js +0 -93
- package/target/lib/side-nav/side-nav.test.js.map +0 -1
- package/target/lib/step-indicator/step/step.element.d.ts +0 -10
- package/target/lib/step-indicator/step/step.element.js +0 -151
- package/target/lib/step-indicator/step/step.element.js.map +0 -1
- package/target/lib/step-indicator/step-indicator.element.d.ts +0 -8
- package/target/lib/step-indicator/step-indicator.element.js +0 -48
- package/target/lib/step-indicator/step-indicator.element.js.map +0 -1
- package/target/lib/step-indicator/step-indicator.stories.d.ts +0 -21
- package/target/lib/step-indicator/step-indicator.stories.js +0 -45
- package/target/lib/step-indicator/step-indicator.stories.js.map +0 -1
- package/target/lib/step-indicator/step-indicator.test.d.ts +0 -2
- package/target/lib/step-indicator/step-indicator.test.js +0 -18
- package/target/lib/step-indicator/step-indicator.test.js.map +0 -1
- package/target/lib/summary-box/summary-box.element.d.ts +0 -7
- package/target/lib/summary-box/summary-box.element.js +0 -40
- package/target/lib/summary-box/summary-box.element.js.map +0 -1
- package/target/lib/summary-box/summary-box.stories.d.ts +0 -12
- package/target/lib/summary-box/summary-box.stories.js +0 -17
- package/target/lib/summary-box/summary-box.stories.js.map +0 -1
- package/target/lib/summary-box/summary-box.test.d.ts +0 -1
- package/target/lib/summary-box/summary-box.test.js +0 -11
- package/target/lib/summary-box/summary-box.test.js.map +0 -1
- package/target/lib/tag/tag.element.d.ts +0 -10
- package/target/lib/tag/tag.element.js +0 -57
- package/target/lib/tag/tag.element.js.map +0 -1
- package/target/lib/tag/tag.stories.d.ts +0 -19
- package/target/lib/tag/tag.stories.js +0 -25
- package/target/lib/tag/tag.stories.js.map +0 -1
- package/target/lib/tag/tag.test.d.ts +0 -1
- package/target/lib/tag/tag.test.js +0 -11
- package/target/lib/tag/tag.test.js.map +0 -1
- package/target/lib/textarea/textarea.element.d.ts +0 -19
- package/target/lib/textarea/textarea.element.js +0 -171
- package/target/lib/textarea/textarea.element.js.map +0 -1
- package/target/lib/textarea/textarea.stories.d.ts +0 -12
- package/target/lib/textarea/textarea.stories.js +0 -17
- package/target/lib/textarea/textarea.stories.js.map +0 -1
- package/target/lib/textarea/textarea.test.d.ts +0 -1
- package/target/lib/textarea/textarea.test.js +0 -50
- package/target/lib/textarea/textarea.test.js.map +0 -1
- package/target/lib.d.ts +0 -32
- package/target/lib.js +0 -33
- package/target/lib.js.map +0 -1
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { __esDecorate, __runInitializers } from "tslib";
|
|
2
|
-
import { attr, css, element, html } from "@joist/element";
|
|
3
|
-
let USAModalCloseElement = (() => {
|
|
4
|
-
let _classDecorators = [element({
|
|
5
|
-
tagName: "usa-modal-close",
|
|
6
|
-
shadowDom: [
|
|
7
|
-
css `
|
|
8
|
-
* {
|
|
9
|
-
box-sizing: border-box;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
:host {
|
|
13
|
-
display: block;
|
|
14
|
-
position: absolute;
|
|
15
|
-
top: 1rem;
|
|
16
|
-
right: 1rem;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
button {
|
|
20
|
-
display: flex;
|
|
21
|
-
align-items: center;
|
|
22
|
-
justify-content: center;
|
|
23
|
-
background: none;
|
|
24
|
-
border: none;
|
|
25
|
-
cursor: pointer;
|
|
26
|
-
height: 100%;
|
|
27
|
-
width: 100%;
|
|
28
|
-
border-radius: 100%;
|
|
29
|
-
padding: 0;
|
|
30
|
-
margin: 0;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
button:focus {
|
|
34
|
-
outline: 0.25rem solid #2491ff;
|
|
35
|
-
outline-offset: 0;
|
|
36
|
-
}
|
|
37
|
-
`,
|
|
38
|
-
html `
|
|
39
|
-
<button aria-label="close modal">
|
|
40
|
-
<usa-icon icon="close"></usa-icon>
|
|
41
|
-
</button>
|
|
42
|
-
`,
|
|
43
|
-
],
|
|
44
|
-
})];
|
|
45
|
-
let _classDescriptor;
|
|
46
|
-
let _classExtraInitializers = [];
|
|
47
|
-
let _classThis;
|
|
48
|
-
let _classSuper = HTMLElement;
|
|
49
|
-
let _modalAction_decorators;
|
|
50
|
-
let _modalAction_initializers = [];
|
|
51
|
-
let _modalAction_extraInitializers = [];
|
|
52
|
-
var USAModalCloseElement = class extends _classSuper {
|
|
53
|
-
static { _classThis = this; }
|
|
54
|
-
static {
|
|
55
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
56
|
-
_modalAction_decorators = [attr({
|
|
57
|
-
name: "modal-action",
|
|
58
|
-
})];
|
|
59
|
-
__esDecorate(this, null, _modalAction_decorators, { kind: "accessor", name: "modalAction", static: false, private: false, access: { has: obj => "modalAction" in obj, get: obj => obj.modalAction, set: (obj, value) => { obj.modalAction = value; } }, metadata: _metadata }, _modalAction_initializers, _modalAction_extraInitializers);
|
|
60
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
61
|
-
USAModalCloseElement = _classThis = _classDescriptor.value;
|
|
62
|
-
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
63
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
64
|
-
}
|
|
65
|
-
#modalAction_accessor_storage = __runInitializers(this, _modalAction_initializers, "close");
|
|
66
|
-
get modalAction() { return this.#modalAction_accessor_storage; }
|
|
67
|
-
set modalAction(value) { this.#modalAction_accessor_storage = value; }
|
|
68
|
-
constructor() {
|
|
69
|
-
super(...arguments);
|
|
70
|
-
__runInitializers(this, _modalAction_extraInitializers);
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
return USAModalCloseElement = _classThis;
|
|
74
|
-
})();
|
|
75
|
-
export { USAModalCloseElement };
|
|
76
|
-
//# sourceMappingURL=modal-close.element.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"modal-close.element.js","sourceRoot":"","sources":["../../../../src/lib/modal/modal-close/modal-close.element.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;IAiD7C,oBAAoB;4BAzChC,OAAO,CAAC;YACP,OAAO,EAAE,iBAAiB;YAC1B,SAAS,EAAE;gBACT,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA8BF;gBACD,IAAI,CAAA;;;;KAIH;aACF;SACF,CAAC;;;;sBACwC,WAAW;;;;oCAAnB,SAAQ,WAAW;;;;uCAClD,IAAI,CAAC;oBACJ,IAAI,EAAE,cAAc;iBACrB,CAAC;YACF,sLAAS,WAAW,6BAAX,WAAW,iGAAW;YAJjC,6KAKC;;;YALY,uDAAoB;;QAI/B,mFAAuB,OAAO,EAAC;QAA/B,IAAS,WAAW,iDAAW;QAA/B,IAAS,WAAW,uDAAW;;;;;;;;SAJpB,oBAAoB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "./modal-close.element.js";
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import "./modal-close.element.js";
|
|
2
|
-
import { assert, fixture, html } from "@open-wc/testing";
|
|
3
|
-
describe("usa-modal-close", () => {
|
|
4
|
-
it("should be accessible", async () => {
|
|
5
|
-
const modalClose = await fixture(html `
|
|
6
|
-
<usa-modal-close>Hello World</usa-modal-close>
|
|
7
|
-
`);
|
|
8
|
-
return assert.isAccessible(modalClose);
|
|
9
|
-
});
|
|
10
|
-
});
|
|
11
|
-
//# sourceMappingURL=modal-close.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"modal-close.test.js","sourceRoot":"","sources":["../../../../src/lib/modal/modal-close/modal-close.test.ts"],"names":[],"mappings":"AAAA,OAAO,0BAA0B,CAAC;AAElC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAIzD,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC/B,EAAE,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;QACpC,MAAM,UAAU,GAAG,MAAM,OAAO,CAAuB,IAAI,CAAA;;KAE1D,CAAC,CAAC;QAEH,OAAO,MAAM,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { __esDecorate, __runInitializers } from "tslib";
|
|
2
|
-
import { css, element, html } from "@joist/element";
|
|
3
|
-
let USAModalHeadingElement = (() => {
|
|
4
|
-
let _classDecorators = [element({
|
|
5
|
-
tagName: "usa-modal-heading",
|
|
6
|
-
shadowDom: [
|
|
7
|
-
css `
|
|
8
|
-
:host {
|
|
9
|
-
font-family:
|
|
10
|
-
Merriweather Web,
|
|
11
|
-
Georgia,
|
|
12
|
-
Cambria,
|
|
13
|
-
Times New Roman,
|
|
14
|
-
Times,
|
|
15
|
-
serif !important;
|
|
16
|
-
|
|
17
|
-
font-size: 1.22rem;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
h2 {
|
|
21
|
-
margin-top: 0;
|
|
22
|
-
line-height: 1.4;
|
|
23
|
-
font-size: 1.45rem;
|
|
24
|
-
}
|
|
25
|
-
`,
|
|
26
|
-
html `
|
|
27
|
-
<h2>
|
|
28
|
-
<slot></slot>
|
|
29
|
-
</h2>
|
|
30
|
-
`,
|
|
31
|
-
],
|
|
32
|
-
})];
|
|
33
|
-
let _classDescriptor;
|
|
34
|
-
let _classExtraInitializers = [];
|
|
35
|
-
let _classThis;
|
|
36
|
-
let _classSuper = HTMLElement;
|
|
37
|
-
var USAModalHeadingElement = class extends _classSuper {
|
|
38
|
-
static { _classThis = this; }
|
|
39
|
-
static {
|
|
40
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
41
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
42
|
-
USAModalHeadingElement = _classThis = _classDescriptor.value;
|
|
43
|
-
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
44
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
return USAModalHeadingElement = _classThis;
|
|
48
|
-
})();
|
|
49
|
-
export { USAModalHeadingElement };
|
|
50
|
-
//# sourceMappingURL=modal-heading.element.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"modal-heading.element.js","sourceRoot":"","sources":["../../../../src/lib/modal/modal-heading/modal-heading.element.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;IAqCvC,sBAAsB;4BA7BlC,OAAO,CAAC;YACP,OAAO,EAAE,mBAAmB;YAC5B,SAAS,EAAE;gBACT,GAAG,CAAA;;;;;;;;;;;;;;;;;;KAkBF;gBACD,IAAI,CAAA;;;;KAIH;aACF;SACF,CAAC;;;;sBAC0C,WAAW;sCAAnB,SAAQ,WAAW;;;;YAAvD,6KAA0D;;;YAA7C,uDAAsB;;;;;SAAtB,sBAAsB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "./modal-heading.element.js";
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import "./modal-heading.element.js";
|
|
2
|
-
import { assert, fixture, html } from "@open-wc/testing";
|
|
3
|
-
describe("usa-modal-heading", () => {
|
|
4
|
-
it("should be accessible", async () => {
|
|
5
|
-
const modalHeading = await fixture(html `
|
|
6
|
-
<usa-modal-heading>Hello World</usa-modal-heading>
|
|
7
|
-
`);
|
|
8
|
-
return assert.isAccessible(modalHeading);
|
|
9
|
-
});
|
|
10
|
-
});
|
|
11
|
-
//# sourceMappingURL=modal-heading.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"modal-heading.test.js","sourceRoot":"","sources":["../../../../src/lib/modal/modal-heading/modal-heading.test.ts"],"names":[],"mappings":"AAAA,OAAO,4BAA4B,CAAC;AAEpC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAIzD,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,EAAE,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;QACpC,MAAM,YAAY,GAAG,MAAM,OAAO,CAAyB,IAAI,CAAA;;KAE9D,CAAC,CAAC;QAEH,OAAO,MAAM,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;IAC3C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
declare global {
|
|
2
|
-
interface HTMLElementTagNameMap {
|
|
3
|
-
"usa-modal": USAModalElement;
|
|
4
|
-
}
|
|
5
|
-
}
|
|
6
|
-
export declare class USAModalElement extends HTMLElement {
|
|
7
|
-
#private;
|
|
8
|
-
modalAction: null | string;
|
|
9
|
-
openModal(): void;
|
|
10
|
-
closeModal(): void;
|
|
11
|
-
onGlobalModalAction(e: Event): void;
|
|
12
|
-
onModalAction(e: Event): void;
|
|
13
|
-
}
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { __esDecorate, __runInitializers } from "tslib";
|
|
2
|
-
import { css, element, html, listen, query } from "@joist/element";
|
|
3
|
-
let USAModalElement = (() => {
|
|
4
|
-
let _classDecorators = [element({
|
|
5
|
-
tagName: "usa-modal",
|
|
6
|
-
shadowDom: [
|
|
7
|
-
css `
|
|
8
|
-
* {
|
|
9
|
-
box-sizing: border-box;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
:host {
|
|
13
|
-
display: contents;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
dialog {
|
|
17
|
-
border: none;
|
|
18
|
-
font-size: 1.06rem;
|
|
19
|
-
line-height: 1.5;
|
|
20
|
-
border-radius: 0.5rem;
|
|
21
|
-
background: #fff;
|
|
22
|
-
color: #1b1b1b;
|
|
23
|
-
max-width: 30rem;
|
|
24
|
-
padding-top: 4rem;
|
|
25
|
-
padding-left: 4rem;
|
|
26
|
-
padding-right: 4rem;
|
|
27
|
-
padding-bottom: 2rem;
|
|
28
|
-
width: 100%;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
::backdrop {
|
|
32
|
-
background: rgba(0, 0, 0, 0.7);
|
|
33
|
-
}
|
|
34
|
-
`,
|
|
35
|
-
html `
|
|
36
|
-
<dialog>
|
|
37
|
-
<slot></slot>
|
|
38
|
-
</dialog>
|
|
39
|
-
`,
|
|
40
|
-
],
|
|
41
|
-
})];
|
|
42
|
-
let _classDescriptor;
|
|
43
|
-
let _classExtraInitializers = [];
|
|
44
|
-
let _classThis;
|
|
45
|
-
let _classSuper = HTMLElement;
|
|
46
|
-
let _instanceExtraInitializers = [];
|
|
47
|
-
let _onGlobalModalAction_decorators;
|
|
48
|
-
let _onModalAction_decorators;
|
|
49
|
-
var USAModalElement = class extends _classSuper {
|
|
50
|
-
static { _classThis = this; }
|
|
51
|
-
static {
|
|
52
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
53
|
-
_onGlobalModalAction_decorators = [listen("click", () => document.body)];
|
|
54
|
-
_onModalAction_decorators = [listen("click", (host) => host)];
|
|
55
|
-
__esDecorate(this, null, _onGlobalModalAction_decorators, { kind: "method", name: "onGlobalModalAction", static: false, private: false, access: { has: obj => "onGlobalModalAction" in obj, get: obj => obj.onGlobalModalAction }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
56
|
-
__esDecorate(this, null, _onModalAction_decorators, { kind: "method", name: "onModalAction", static: false, private: false, access: { has: obj => "onModalAction" in obj, get: obj => obj.onModalAction }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
57
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
58
|
-
USAModalElement = _classThis = _classDescriptor.value;
|
|
59
|
-
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
60
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
61
|
-
}
|
|
62
|
-
modalAction = (__runInitializers(this, _instanceExtraInitializers), null);
|
|
63
|
-
#dialog = query("dialog");
|
|
64
|
-
openModal() {
|
|
65
|
-
const dialog = this.#dialog();
|
|
66
|
-
dialog.showModal();
|
|
67
|
-
}
|
|
68
|
-
closeModal() {
|
|
69
|
-
const dialog = this.#dialog();
|
|
70
|
-
dialog.close();
|
|
71
|
-
}
|
|
72
|
-
onGlobalModalAction(e) {
|
|
73
|
-
if (e.target instanceof Element) {
|
|
74
|
-
const modalTarget = e.target.getAttribute("modal-target");
|
|
75
|
-
if (modalTarget === this.id) {
|
|
76
|
-
this.openModal();
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
onModalAction(e) {
|
|
81
|
-
if (e.target instanceof Element) {
|
|
82
|
-
this.modalAction = e.target.getAttribute("modal-action");
|
|
83
|
-
this.closeModal();
|
|
84
|
-
this.dispatchEvent(new Event("usa::modal::close"));
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
return USAModalElement = _classThis;
|
|
89
|
-
})();
|
|
90
|
-
export { USAModalElement };
|
|
91
|
-
//# sourceMappingURL=modal.element.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"modal.element.js","sourceRoot":"","sources":["../../../src/lib/modal/modal.element.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;IA8CtD,eAAe;4BAtC3B,OAAO,CAAC;YACP,OAAO,EAAE,WAAW;YACpB,SAAS,EAAE;gBACT,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;KA2BF;gBACD,IAAI,CAAA;;;;KAIH;aACF;SACF,CAAC;;;;sBACmC,WAAW;;;;+BAAnB,SAAQ,WAAW;;;;+CAiB7C,MAAM,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC;yCAWpC,MAAM,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC;YAVhC,4MAAA,mBAAmB,6DAQlB;YAGD,0LAAA,aAAa,6DAQZ;YArCH,6KAsCC;;;YAtCY,uDAAe;;QAC1B,WAAW,IADA,mDAAe,EACG,IAAI,EAAC;QAElC,OAAO,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC;QAE1B,SAAS;YACP,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;YAE9B,MAAM,CAAC,SAAS,EAAE,CAAC;QACrB,CAAC;QAED,UAAU;YACR,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;YAE9B,MAAM,CAAC,KAAK,EAAE,CAAC;QACjB,CAAC;QAGD,mBAAmB,CAAC,CAAQ;YAC1B,IAAI,CAAC,CAAC,MAAM,YAAY,OAAO,EAAE,CAAC;gBAChC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC;gBAE1D,IAAI,WAAW,KAAK,IAAI,CAAC,EAAE,EAAE,CAAC;oBAC5B,IAAI,CAAC,SAAS,EAAE,CAAC;gBACnB,CAAC;YACH,CAAC;QACH,CAAC;QAGD,aAAa,CAAC,CAAQ;YACpB,IAAI,CAAC,CAAC,MAAM,YAAY,OAAO,EAAE,CAAC;gBAChC,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC;gBAEzD,IAAI,CAAC,UAAU,EAAE,CAAC;gBAElB,IAAI,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAC;YACrD,CAAC;QACH,CAAC;;;;SArCU,eAAe"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { StoryObj } from "@storybook/web-components";
|
|
2
|
-
import type { USAModalElement } from "./modal.element.js";
|
|
3
|
-
declare const meta: {
|
|
4
|
-
title: string;
|
|
5
|
-
tags: string[];
|
|
6
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
7
|
-
argTypes: {};
|
|
8
|
-
args: {};
|
|
9
|
-
};
|
|
10
|
-
export default meta;
|
|
11
|
-
type Story = StoryObj<USAModalElement>;
|
|
12
|
-
export declare const Primary: Story;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { html } from "lit";
|
|
2
|
-
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
3
|
-
const meta = {
|
|
4
|
-
title: "usa-modal",
|
|
5
|
-
tags: ["autodocs"],
|
|
6
|
-
render() {
|
|
7
|
-
return html `
|
|
8
|
-
<usa-button modal-target="mymodal">Open Modal</usa-button>
|
|
9
|
-
|
|
10
|
-
<usa-modal id="mymodal">
|
|
11
|
-
<usa-modal-close></usa-modal-close>
|
|
12
|
-
|
|
13
|
-
<usa-modal-heading>
|
|
14
|
-
Are you sure you want to continue?
|
|
15
|
-
</usa-modal-heading>
|
|
16
|
-
|
|
17
|
-
<usa-input placeholder="foo@email.com" autofocus>
|
|
18
|
-
Enter your email to continue
|
|
19
|
-
</usa-input>
|
|
20
|
-
|
|
21
|
-
<usa-button modal-action="confirm">Yes I am sure</usa-button>
|
|
22
|
-
<usa-button modal-action="cancel" variant="outline">Cancel</usa-button>
|
|
23
|
-
</usa-modal>
|
|
24
|
-
`;
|
|
25
|
-
},
|
|
26
|
-
argTypes: {},
|
|
27
|
-
args: {},
|
|
28
|
-
};
|
|
29
|
-
export default meta;
|
|
30
|
-
// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
|
|
31
|
-
export const Primary = {
|
|
32
|
-
args: {},
|
|
33
|
-
};
|
|
34
|
-
//# sourceMappingURL=modal.stories.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"modal.stories.js","sourceRoot":"","sources":["../../../src/lib/modal/modal.stories.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAI3B,kFAAkF;AAClF,MAAM,IAAI,GAAG;IACX,KAAK,EAAE,WAAW;IAClB,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,MAAM;QACJ,OAAO,IAAI,CAAA;;;;;;;;;;;;;;;;;KAiBV,CAAC;IACJ,CAAC;IACD,QAAQ,EAAE,EAAE;IACZ,IAAI,EAAE,EAAE;CACuB,CAAC;AAElC,eAAe,IAAI,CAAC;AAIpB,wFAAwF;AACxF,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE,EAAE;CACT,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import "./modal.element.js";
|
|
2
|
-
import "./modal-heading/modal-heading.element.js";
|
|
3
|
-
import "./modal-close/modal-close.element.js";
|
|
4
|
-
import { assert, fixture, html } from "@open-wc/testing";
|
|
5
|
-
describe("usa-modal", () => {
|
|
6
|
-
it("should be accessible", async () => {
|
|
7
|
-
const modal = await fixture(html `
|
|
8
|
-
<usa-modal open>
|
|
9
|
-
<usa-modal-close></usa-modal-close>
|
|
10
|
-
|
|
11
|
-
<usa-modal-heading>
|
|
12
|
-
Are you sure you want to continue?
|
|
13
|
-
</usa-modal-heading>
|
|
14
|
-
|
|
15
|
-
<p>This is some other example of content</p>
|
|
16
|
-
</usa-modal>
|
|
17
|
-
`);
|
|
18
|
-
return assert.isAccessible(modal);
|
|
19
|
-
});
|
|
20
|
-
});
|
|
21
|
-
//# sourceMappingURL=modal.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"modal.test.js","sourceRoot":"","sources":["../../../src/lib/modal/modal.test.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,CAAC;AAC5B,OAAO,0CAA0C,CAAC;AAClD,OAAO,sCAAsC,CAAC;AAE9C,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAIzD,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IACzB,EAAE,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;QACpC,MAAM,KAAK,GAAG,MAAM,OAAO,CAAkB,IAAI,CAAA;;;;;;;;;;KAUhD,CAAC,CAAC;QAEH,OAAO,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/lib/radio/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAQxC,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,WAAW,CAAiB,WAAW,CAAC,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
declare global {
|
|
2
|
-
interface HTMLElementTagNameMap {
|
|
3
|
-
"usa-radio-option": USARadioOptionElement;
|
|
4
|
-
}
|
|
5
|
-
}
|
|
6
|
-
export declare class USARadioOptionElement extends HTMLElement {
|
|
7
|
-
#private;
|
|
8
|
-
accessor value: string;
|
|
9
|
-
attributeChangedCallback(): void;
|
|
10
|
-
onInjected(): void;
|
|
11
|
-
disconnectedCallback(): void;
|
|
12
|
-
}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { __esDecorate, __runInitializers } from "tslib";
|
|
2
|
-
import { attr, css, element, html, query } from "@joist/element";
|
|
3
|
-
import { inject, injectable, injected } from "@joist/di";
|
|
4
|
-
import { RADIO_CTX } from "../context.js";
|
|
5
|
-
let USARadioOptionElement = (() => {
|
|
6
|
-
let _classDecorators = [injectable({
|
|
7
|
-
name: "usa-radio-option-ctx",
|
|
8
|
-
}), element({
|
|
9
|
-
tagName: "usa-radio-option",
|
|
10
|
-
shadowDom: [
|
|
11
|
-
css `
|
|
12
|
-
:host {
|
|
13
|
-
display: flex;
|
|
14
|
-
flex-direction: column;
|
|
15
|
-
margin-top: 0.05rem;
|
|
16
|
-
}
|
|
17
|
-
`,
|
|
18
|
-
html `
|
|
19
|
-
<!-- This label will be moved to the shadow dom of its parent -->
|
|
20
|
-
<label>
|
|
21
|
-
<input type="radio" tabindex="0" />
|
|
22
|
-
<slot name="reserved"></slot>
|
|
23
|
-
</label>
|
|
24
|
-
|
|
25
|
-
<slot></slot>
|
|
26
|
-
`,
|
|
27
|
-
],
|
|
28
|
-
})];
|
|
29
|
-
let _classDescriptor;
|
|
30
|
-
let _classExtraInitializers = [];
|
|
31
|
-
let _classThis;
|
|
32
|
-
let _classSuper = HTMLElement;
|
|
33
|
-
let _instanceExtraInitializers = [];
|
|
34
|
-
let _value_decorators;
|
|
35
|
-
let _value_initializers = [];
|
|
36
|
-
let _value_extraInitializers = [];
|
|
37
|
-
let _onInjected_decorators;
|
|
38
|
-
var USARadioOptionElement = class extends _classSuper {
|
|
39
|
-
static { _classThis = this; }
|
|
40
|
-
static {
|
|
41
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
42
|
-
_value_decorators = [attr()];
|
|
43
|
-
_onInjected_decorators = [injected()];
|
|
44
|
-
__esDecorate(this, null, _value_decorators, { kind: "accessor", name: "value", static: false, private: false, access: { has: obj => "value" in obj, get: obj => obj.value, set: (obj, value) => { obj.value = value; } }, metadata: _metadata }, _value_initializers, _value_extraInitializers);
|
|
45
|
-
__esDecorate(this, null, _onInjected_decorators, { kind: "method", name: "onInjected", static: false, private: false, access: { has: obj => "onInjected" in obj, get: obj => obj.onInjected }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
46
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
47
|
-
USARadioOptionElement = _classThis = _classDescriptor.value;
|
|
48
|
-
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
49
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
50
|
-
}
|
|
51
|
-
#value_accessor_storage = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _value_initializers, ""));
|
|
52
|
-
get value() { return this.#value_accessor_storage; }
|
|
53
|
-
set value(value) { this.#value_accessor_storage = value; }
|
|
54
|
-
#label = (__runInitializers(this, _value_extraInitializers), query("label"));
|
|
55
|
-
#input = query("input");
|
|
56
|
-
#slot = query("slot");
|
|
57
|
-
#radio = inject(RADIO_CTX);
|
|
58
|
-
#observer = new MutationObserver(() => {
|
|
59
|
-
const input = this.#input();
|
|
60
|
-
const radio = this.#radio();
|
|
61
|
-
input.name = radio.name;
|
|
62
|
-
input.checked = radio.value === this.value;
|
|
63
|
-
});
|
|
64
|
-
attributeChangedCallback() {
|
|
65
|
-
const input = this.#input();
|
|
66
|
-
const slot = this.#slot();
|
|
67
|
-
this.slot = this.value;
|
|
68
|
-
slot.name = this.value;
|
|
69
|
-
input.value = this.value;
|
|
70
|
-
}
|
|
71
|
-
onInjected() {
|
|
72
|
-
const input = this.#input();
|
|
73
|
-
const radio = this.#radio();
|
|
74
|
-
radio.addRadioOption(this.#label());
|
|
75
|
-
input.name = radio.name;
|
|
76
|
-
input.checked = radio.value === this.value;
|
|
77
|
-
this.#observer.observe(radio, {
|
|
78
|
-
attributeFilter: ["value", "name"],
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
disconnectedCallback() {
|
|
82
|
-
this.#label().remove();
|
|
83
|
-
this.#observer.disconnect();
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
return USARadioOptionElement = _classThis;
|
|
87
|
-
})();
|
|
88
|
-
export { USARadioOptionElement };
|
|
89
|
-
//# sourceMappingURL=radio-option.element.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"radio-option.element.js","sourceRoot":"","sources":["../../../../src/lib/radio/radio-option/radio-option.element.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEjE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;IAgC7B,qBAAqB;4BAxBjC,UAAU,CAAC;YACV,IAAI,EAAE,sBAAsB;SAC7B,CAAC,EACD,OAAO,CAAC;YACP,OAAO,EAAE,kBAAkB;YAC3B,SAAS,EAAE;gBACT,GAAG,CAAA;;;;;;KAMF;gBACD,IAAI,CAAA;;;;;;;;KAQH;aACF;SACF,CAAC;;;;sBACyC,WAAW;;;;;;qCAAnB,SAAQ,WAAW;;;;iCACnD,IAAI,EAAE;sCA0BN,QAAQ,EAAE;YAzBX,oKAAS,KAAK,6BAAL,KAAK,qFAAM;YA0BpB,iLAAA,UAAU,6DAYT;YAxCH,6KA+CC;;;YA/CY,uDAAqB;;QAEhC,2BAFW,mDAAqB,+CAEf,EAAE,GAAC;QAApB,IAAS,KAAK,2CAAM;QAApB,IAAS,KAAK,iDAAM;QAEpB,MAAM,uDAAG,KAAK,CAAC,OAAO,CAAC,EAAC;QACxB,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;QACxB,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;QACtB,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;QAE3B,SAAS,GAAG,IAAI,gBAAgB,CAAC,GAAG,EAAE;YACpC,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;YAC5B,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;YAE5B,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;YACxB,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,KAAK,KAAK,IAAI,CAAC,KAAK,CAAC;QAC7C,CAAC,CAAC,CAAC;QAEH,wBAAwB;YACtB,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;YAC5B,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;YAE1B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC;YAEvB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC;YACvB,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QAC3B,CAAC;QAGD,UAAU;YACR,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;YAC5B,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;YAE5B,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;YAEpC,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;YACxB,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,KAAK,KAAK,IAAI,CAAC,KAAK,CAAC;YAE3C,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,EAAE;gBAC5B,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC;aACnC,CAAC,CAAC;QACL,CAAC;QAED,oBAAoB;YAClB,IAAI,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,CAAC;YAEvB,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,CAAC;QAC9B,CAAC;;;;SA9CU,qBAAqB"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import "../radio.element.js";
|
|
2
|
-
import "./radio-option.element.js";
|
|
3
|
-
import { assert, fixture, html } from "@open-wc/testing";
|
|
4
|
-
describe("usa-radio-option", () => {
|
|
5
|
-
it("should map value to slot", async () => {
|
|
6
|
-
const radio = await fixture(html `
|
|
7
|
-
<usa-radio>
|
|
8
|
-
<usa-radio-option value="first">First</usa-radio-option>
|
|
9
|
-
</usa-radio>
|
|
10
|
-
`);
|
|
11
|
-
const option = radio.querySelectorAll("usa-radio-option");
|
|
12
|
-
assert.equal(option[0].value, option[0].slot);
|
|
13
|
-
});
|
|
14
|
-
});
|
|
15
|
-
//# sourceMappingURL=radio-option.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"radio-option.test.js","sourceRoot":"","sources":["../../../../src/lib/radio/radio-option/radio-option.test.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAC7B,OAAO,2BAA2B,CAAC;AAEnC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAIzD,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAChC,EAAE,CAAC,0BAA0B,EAAE,KAAK,IAAI,EAAE;QACxC,MAAM,KAAK,GAAG,MAAM,OAAO,CAAwB,IAAI,CAAA;;;;KAItD,CAAC,CAAC;QAEH,MAAM,MAAM,GAAG,KAAK,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,CAAC;QAE1D,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { type RadioContainer } from "./context.js";
|
|
2
|
-
declare global {
|
|
3
|
-
interface HTMLElementTagNameMap {
|
|
4
|
-
"usa-radio": USARadioElement;
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
export declare class USARadioElement extends HTMLElement implements RadioContainer {
|
|
8
|
-
#private;
|
|
9
|
-
static formAssociated: boolean;
|
|
10
|
-
accessor value: string;
|
|
11
|
-
accessor name: string;
|
|
12
|
-
accessor required: boolean;
|
|
13
|
-
accessor tiled: boolean;
|
|
14
|
-
connectedCallback(): void;
|
|
15
|
-
addRadioOption(el: HTMLElement): void;
|
|
16
|
-
onChange(e: Event): void;
|
|
17
|
-
}
|