@noctuatech/uswds 0.0.28 → 0.0.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/uswds.min.js +1 -0
- package/package.json +1 -1
- package/src/lib/button/button.element.ts +24 -33
- package/src/lib/file-input/file-input-preview/file-input-preview.test.ts +2 -2
- package/src/lib/file-input/file-input.element.ts +58 -20
- package/src/lib/input/input.element.ts +39 -19
- package/src/lib/input/input.stories.ts +1 -1
- package/src/lib/textarea/textarea.element.ts +4 -1
- package/target/lib/accordion/accordion.element.d.ts +19 -0
- package/target/lib/accordion/accordion.element.js +166 -0
- package/target/lib/accordion/accordion.element.js.map +1 -0
- package/target/lib/accordion/accordion.stories.d.ts +12 -0
- package/target/lib/accordion/accordion.stories.js +42 -0
- package/target/lib/accordion/accordion.stories.js.map +1 -0
- package/target/lib/accordion/accordion.test.d.ts +1 -0
- package/target/lib/accordion/accordion.test.js +113 -0
- package/target/lib/accordion/accordion.test.js.map +1 -0
- package/target/lib/alert/alert-types.d.ts +7 -0
- package/target/lib/alert/alert-types.js +25 -0
- package/target/lib/alert/alert-types.js.map +1 -0
- package/target/lib/alert/alert.element.d.ts +11 -0
- package/target/lib/alert/alert.element.js +122 -0
- package/target/lib/alert/alert.element.js.map +1 -0
- package/target/lib/alert/alert.stories.d.ts +11 -0
- package/target/lib/alert/alert.stories.js +56 -0
- package/target/lib/alert/alert.stories.js.map +1 -0
- package/target/lib/alert/alert.test.d.ts +1 -0
- package/target/lib/alert/alert.test.js +20 -0
- package/target/lib/alert/alert.test.js.map +1 -0
- package/target/lib/button/button.element.d.ts +19 -0
- package/target/lib/button/button.element.js +253 -0
- package/target/lib/button/button.element.js.map +1 -0
- package/target/lib/button/button.stories.d.ts +12 -0
- package/target/lib/button/button.stories.js +22 -0
- package/target/lib/button/button.stories.js.map +1 -0
- package/target/lib/button/button.test.d.ts +1 -0
- package/target/lib/button/button.test.js +14 -0
- package/target/lib/button/button.test.js.map +1 -0
- package/target/lib/card/card-body/card-body.element.d.ts +7 -0
- package/target/lib/card/card-body/card-body.element.js +35 -0
- package/target/lib/card/card-body/card-body.element.js.map +1 -0
- package/target/lib/card/card-footer/card-footer.element.d.ts +7 -0
- package/target/lib/card/card-footer/card-footer.element.js +33 -0
- package/target/lib/card/card-footer/card-footer.element.js.map +1 -0
- package/target/lib/card/card-group/card-group.element.d.ts +8 -0
- package/target/lib/card/card-group/card-group.element.js +51 -0
- package/target/lib/card/card-group/card-group.element.js.map +1 -0
- package/target/lib/card/card-header/card-header.element.d.ts +7 -0
- package/target/lib/card/card-header/card-header.element.js +43 -0
- package/target/lib/card/card-header/card-header.element.js.map +1 -0
- package/target/lib/card/card-media/card-media.element.d.ts +8 -0
- package/target/lib/card/card-media/card-media.element.js +71 -0
- package/target/lib/card/card-media/card-media.element.js.map +1 -0
- package/target/lib/card/card.element.d.ts +9 -0
- package/target/lib/card/card.element.js +79 -0
- package/target/lib/card/card.element.js.map +1 -0
- package/target/lib/card/card.stories.d.ts +12 -0
- package/target/lib/card/card.stories.js +126 -0
- package/target/lib/card/card.stories.js.map +1 -0
- package/target/lib/card/card.test.d.ts +6 -0
- package/target/lib/card/card.test.js +33 -0
- package/target/lib/card/card.test.js.map +1 -0
- package/target/lib/checkbox/checkbox.element.d.ts +17 -0
- package/target/lib/checkbox/checkbox.element.js +206 -0
- package/target/lib/checkbox/checkbox.element.js.map +1 -0
- package/target/lib/checkbox/checkbox.stories.d.ts +31 -0
- package/target/lib/checkbox/checkbox.stories.js +46 -0
- package/target/lib/checkbox/checkbox.stories.js.map +1 -0
- package/target/lib/checkbox/checkbox.test.d.ts +1 -0
- package/target/lib/checkbox/checkbox.test.js +52 -0
- package/target/lib/checkbox/checkbox.test.js.map +1 -0
- package/target/lib/config/config.element.d.ts +6 -0
- package/target/lib/config/config.element.js +53 -0
- package/target/lib/config/config.element.js.map +1 -0
- package/target/lib/config/config.test.d.ts +1 -0
- package/target/lib/config/config.test.js +11 -0
- package/target/lib/config/config.test.js.map +1 -0
- package/target/lib/define.d.ts +32 -0
- package/target/lib/define.js +33 -0
- package/target/lib/define.js.map +1 -0
- package/target/lib/description/description.element.d.ts +7 -0
- package/target/lib/description/description.element.js +34 -0
- package/target/lib/description/description.element.js.map +1 -0
- package/target/lib/description/description.test.d.ts +1 -0
- package/target/lib/description/description.test.js +11 -0
- package/target/lib/description/description.test.js.map +1 -0
- package/target/lib/file-input/file-input-preview/file-input-preview.element.d.ts +12 -0
- package/target/lib/file-input/file-input-preview/file-input-preview.element.js +153 -0
- package/target/lib/file-input/file-input-preview/file-input-preview.element.js.map +1 -0
- package/target/lib/file-input/file-input-preview/file-input-preview.test.d.ts +2 -0
- package/target/lib/file-input/file-input-preview/file-input-preview.test.js +67 -0
- package/target/lib/file-input/file-input-preview/file-input-preview.test.js.map +1 -0
- package/target/lib/file-input/file-input.element.d.ts +19 -0
- package/target/lib/file-input/file-input.element.js +217 -0
- package/target/lib/file-input/file-input.element.js.map +1 -0
- package/target/lib/file-input/file-input.stories.d.ts +12 -0
- package/target/lib/file-input/file-input.stories.js +34 -0
- package/target/lib/file-input/file-input.stories.js.map +1 -0
- package/target/lib/file-input/file-input.test.d.ts +1 -0
- package/target/lib/file-input/file-input.test.js +37 -0
- package/target/lib/file-input/file-input.test.js.map +1 -0
- package/target/lib/icon/icon-types.d.ts +2 -0
- package/target/lib/icon/icon-types.js +262 -0
- package/target/lib/icon/icon-types.js.map +1 -0
- package/target/lib/icon/icon.element.d.ts +13 -0
- package/target/lib/icon/icon.element.js +72 -0
- package/target/lib/icon/icon.element.js.map +1 -0
- package/target/lib/icon/icon.stories.d.ts +12 -0
- package/target/lib/icon/icon.stories.js +39 -0
- package/target/lib/icon/icon.stories.js.map +1 -0
- package/target/lib/input/input.element.d.ts +25 -0
- package/target/lib/input/input.element.js +254 -0
- package/target/lib/input/input.element.js.map +1 -0
- package/target/lib/input/input.stories.d.ts +12 -0
- package/target/lib/input/input.stories.js +25 -0
- package/target/lib/input/input.stories.js.map +1 -0
- package/target/lib/input/input.test.d.ts +1 -0
- package/target/lib/input/input.test.js +50 -0
- package/target/lib/input/input.test.js.map +1 -0
- package/target/lib/input-mask/format.d.ts +15 -0
- package/target/lib/input-mask/format.js +47 -0
- package/target/lib/input-mask/format.js.map +1 -0
- package/target/lib/input-mask/input-mask.element.d.ts +12 -0
- package/target/lib/input-mask/input-mask.element.js +106 -0
- package/target/lib/input-mask/input-mask.element.js.map +1 -0
- package/target/lib/input-mask/input-mask.stories.d.ts +14 -0
- package/target/lib/input-mask/input-mask.stories.js +30 -0
- package/target/lib/input-mask/input-mask.stories.js.map +1 -0
- package/target/lib/input-mask/input-mask.test.d.ts +2 -0
- package/target/lib/input-mask/input-mask.test.js +89 -0
- package/target/lib/input-mask/input-mask.test.js.map +1 -0
- package/target/lib/input-mask/maskable.element.d.ts +5 -0
- package/target/lib/input-mask/maskable.element.js +2 -0
- package/target/lib/input-mask/maskable.element.js.map +1 -0
- package/target/lib/link/link.element.d.ts +13 -0
- package/target/lib/link/link.element.js +93 -0
- package/target/lib/link/link.element.js.map +1 -0
- package/target/lib/link/link.stories.d.ts +16 -0
- package/target/lib/link/link.stories.js +23 -0
- package/target/lib/link/link.stories.js.map +1 -0
- package/target/lib/modal/modal-close/modal-close.element.d.ts +8 -0
- package/target/lib/modal/modal-close/modal-close.element.js +76 -0
- package/target/lib/modal/modal-close/modal-close.element.js.map +1 -0
- package/target/lib/modal/modal-close/modal-close.test.d.ts +1 -0
- package/target/lib/modal/modal-close/modal-close.test.js +11 -0
- package/target/lib/modal/modal-close/modal-close.test.js.map +1 -0
- package/target/lib/modal/modal-heading/modal-heading.element.d.ts +7 -0
- package/target/lib/modal/modal-heading/modal-heading.element.js +50 -0
- package/target/lib/modal/modal-heading/modal-heading.element.js.map +1 -0
- package/target/lib/modal/modal-heading/modal-heading.test.d.ts +1 -0
- package/target/lib/modal/modal-heading/modal-heading.test.js +11 -0
- package/target/lib/modal/modal-heading/modal-heading.test.js.map +1 -0
- package/target/lib/modal/modal.element.d.ts +13 -0
- package/target/lib/modal/modal.element.js +91 -0
- package/target/lib/modal/modal.element.js.map +1 -0
- package/target/lib/modal/modal.stories.d.ts +12 -0
- package/target/lib/modal/modal.stories.js +34 -0
- package/target/lib/modal/modal.stories.js.map +1 -0
- package/target/lib/modal/modal.test.d.ts +3 -0
- package/target/lib/modal/modal.test.js +21 -0
- package/target/lib/modal/modal.test.js.map +1 -0
- package/target/lib/radio/context.d.ts +7 -0
- package/target/lib/radio/context.js +3 -0
- package/target/lib/radio/context.js.map +1 -0
- package/target/lib/radio/radio-option/radio-option.element.d.ts +12 -0
- package/target/lib/radio/radio-option/radio-option.element.js +89 -0
- package/target/lib/radio/radio-option/radio-option.element.js.map +1 -0
- package/target/lib/radio/radio-option/radio-option.test.d.ts +2 -0
- package/target/lib/radio/radio-option/radio-option.test.js +15 -0
- package/target/lib/radio/radio-option/radio-option.test.js.map +1 -0
- package/target/lib/radio/radio.element.d.ts +17 -0
- package/target/lib/radio/radio.element.js +169 -0
- package/target/lib/radio/radio.element.js.map +1 -0
- package/target/lib/radio/radio.stories.d.ts +17 -0
- package/target/lib/radio/radio.stories.js +46 -0
- package/target/lib/radio/radio.stories.js.map +1 -0
- package/target/lib/radio/radio.test.d.ts +2 -0
- package/target/lib/radio/radio.test.js +143 -0
- package/target/lib/radio/radio.test.js.map +1 -0
- package/target/lib/select/context.d.ts +6 -0
- package/target/lib/select/context.js +3 -0
- package/target/lib/select/context.js.map +1 -0
- package/target/lib/select/select-option/select-option.element.d.ts +14 -0
- package/target/lib/select/select-option/select-option.element.js +74 -0
- package/target/lib/select/select-option/select-option.element.js.map +1 -0
- package/target/lib/select/select.element.d.ts +17 -0
- package/target/lib/select/select.element.js +141 -0
- package/target/lib/select/select.element.js.map +1 -0
- package/target/lib/select/select.stories.d.ts +12 -0
- package/target/lib/select/select.stories.js +26 -0
- package/target/lib/select/select.stories.js.map +1 -0
- package/target/lib/select/select.test.d.ts +2 -0
- package/target/lib/select/select.test.js +105 -0
- package/target/lib/select/select.test.js.map +1 -0
- package/target/lib/services/http.service.d.ts +3 -0
- package/target/lib/services/http.service.js +24 -0
- package/target/lib/services/http.service.js.map +1 -0
- package/target/lib/services/icon.service.d.ts +4 -0
- package/target/lib/services/icon.service.js +60 -0
- package/target/lib/services/icon.service.js.map +1 -0
- package/target/lib/services/icon.service.test.d.ts +1 -0
- package/target/lib/services/icon.service.test.js +52 -0
- package/target/lib/services/icon.service.test.js.map +1 -0
- package/target/lib/side-nav/side-nav-item/side-nav-item.element.d.ts +8 -0
- package/target/lib/side-nav/side-nav-item/side-nav-item.element.js +107 -0
- package/target/lib/side-nav/side-nav-item/side-nav-item.element.js.map +1 -0
- package/target/lib/side-nav/side-nav.element.d.ts +8 -0
- package/target/lib/side-nav/side-nav.element.js +47 -0
- package/target/lib/side-nav/side-nav.element.js.map +1 -0
- package/target/lib/side-nav/side-nav.stories.d.ts +12 -0
- package/target/lib/side-nav/side-nav.stories.js +55 -0
- package/target/lib/side-nav/side-nav.stories.js.map +1 -0
- package/target/lib/side-nav/side-nav.test.d.ts +3 -0
- package/target/lib/side-nav/side-nav.test.js +93 -0
- package/target/lib/side-nav/side-nav.test.js.map +1 -0
- package/target/lib/step-indicator/step/step.element.d.ts +10 -0
- package/target/lib/step-indicator/step/step.element.js +151 -0
- package/target/lib/step-indicator/step/step.element.js.map +1 -0
- package/target/lib/step-indicator/step-indicator.element.d.ts +8 -0
- package/target/lib/step-indicator/step-indicator.element.js +48 -0
- package/target/lib/step-indicator/step-indicator.element.js.map +1 -0
- package/target/lib/step-indicator/step-indicator.stories.d.ts +21 -0
- package/target/lib/step-indicator/step-indicator.stories.js +45 -0
- package/target/lib/step-indicator/step-indicator.stories.js.map +1 -0
- package/target/lib/step-indicator/step-indicator.test.d.ts +2 -0
- package/target/lib/step-indicator/step-indicator.test.js +18 -0
- package/target/lib/step-indicator/step-indicator.test.js.map +1 -0
- package/target/lib/summary-box/summary-box.element.d.ts +7 -0
- package/target/lib/summary-box/summary-box.element.js +40 -0
- package/target/lib/summary-box/summary-box.element.js.map +1 -0
- package/target/lib/summary-box/summary-box.stories.d.ts +12 -0
- package/target/lib/summary-box/summary-box.stories.js +17 -0
- package/target/lib/summary-box/summary-box.stories.js.map +1 -0
- package/target/lib/summary-box/summary-box.test.d.ts +1 -0
- package/target/lib/summary-box/summary-box.test.js +11 -0
- package/target/lib/summary-box/summary-box.test.js.map +1 -0
- package/target/lib/tag/tag.element.d.ts +10 -0
- package/target/lib/tag/tag.element.js +57 -0
- package/target/lib/tag/tag.element.js.map +1 -0
- package/target/lib/tag/tag.stories.d.ts +19 -0
- package/target/lib/tag/tag.stories.js +25 -0
- package/target/lib/tag/tag.stories.js.map +1 -0
- package/target/lib/tag/tag.test.d.ts +1 -0
- package/target/lib/tag/tag.test.js +11 -0
- package/target/lib/tag/tag.test.js.map +1 -0
- package/target/lib/textarea/textarea.element.d.ts +19 -0
- package/target/lib/textarea/textarea.element.js +174 -0
- package/target/lib/textarea/textarea.element.js.map +1 -0
- package/target/lib/textarea/textarea.stories.d.ts +12 -0
- package/target/lib/textarea/textarea.stories.js +17 -0
- package/target/lib/textarea/textarea.stories.js.map +1 -0
- package/target/lib/textarea/textarea.test.d.ts +1 -0
- package/target/lib/textarea/textarea.test.js +50 -0
- package/target/lib/textarea/textarea.test.js.map +1 -0
- package/target/lib.d.ts +32 -0
- package/target/lib.js +33 -0
- package/target/lib.js.map +1 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { __esDecorate, __runInitializers } from "tslib";
|
|
2
|
+
import { attr, css, element, html } from "@joist/element";
|
|
3
|
+
let USAStepIndicatorElement = (() => {
|
|
4
|
+
let _classDecorators = [element({
|
|
5
|
+
tagName: "usa-step-indicator",
|
|
6
|
+
shadowDom: [
|
|
7
|
+
css `
|
|
8
|
+
:host {
|
|
9
|
+
display: flex;
|
|
10
|
+
gap: 2px;
|
|
11
|
+
counter-reset: usa-step-indicator 0;
|
|
12
|
+
padding-top: 1rem;
|
|
13
|
+
margin-bottom: 1rem;
|
|
14
|
+
}
|
|
15
|
+
`,
|
|
16
|
+
html `<slot></slot>`,
|
|
17
|
+
],
|
|
18
|
+
})];
|
|
19
|
+
let _classDescriptor;
|
|
20
|
+
let _classExtraInitializers = [];
|
|
21
|
+
let _classThis;
|
|
22
|
+
let _classSuper = HTMLElement;
|
|
23
|
+
let _role_decorators;
|
|
24
|
+
let _role_initializers = [];
|
|
25
|
+
let _role_extraInitializers = [];
|
|
26
|
+
var USAStepIndicatorElement = class extends _classSuper {
|
|
27
|
+
static { _classThis = this; }
|
|
28
|
+
static {
|
|
29
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
30
|
+
_role_decorators = [attr()];
|
|
31
|
+
__esDecorate(this, null, _role_decorators, { kind: "accessor", name: "role", static: false, private: false, access: { has: obj => "role" in obj, get: obj => obj.role, set: (obj, value) => { obj.role = value; } }, metadata: _metadata }, _role_initializers, _role_extraInitializers);
|
|
32
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
33
|
+
USAStepIndicatorElement = _classThis = _classDescriptor.value;
|
|
34
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
35
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
36
|
+
}
|
|
37
|
+
#role_accessor_storage = __runInitializers(this, _role_initializers, "list");
|
|
38
|
+
get role() { return this.#role_accessor_storage; }
|
|
39
|
+
set role(value) { this.#role_accessor_storage = value; }
|
|
40
|
+
constructor() {
|
|
41
|
+
super(...arguments);
|
|
42
|
+
__runInitializers(this, _role_extraInitializers);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
return USAStepIndicatorElement = _classThis;
|
|
46
|
+
})();
|
|
47
|
+
export { USAStepIndicatorElement };
|
|
48
|
+
//# sourceMappingURL=step-indicator.element.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-indicator.element.js","sourceRoot":"","sources":["../../../src/lib/step-indicator/step-indicator.element.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;IAuB7C,uBAAuB;4BAfnC,OAAO,CAAC;YACP,OAAO,EAAE,oBAAoB;YAC7B,SAAS,EAAE;gBACT,GAAG,CAAA;;;;;;;;KAQF;gBACD,IAAI,CAAA,eAAe;aACpB;SACF,CAAC;;;;sBAC2C,WAAW;;;;uCAAnB,SAAQ,WAAW;;;;gCACrD,IAAI,EAAE;YACP,iKAAS,IAAI,6BAAJ,IAAI,mFAAU;YAFzB,6KAGC;;;YAHY,uDAAuB;;QAElC,qEAAgB,MAAM,EAAC;QAAvB,IAAS,IAAI,0CAAU;QAAvB,IAAS,IAAI,gDAAU;;;;;;;;SAFZ,uBAAuB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { StoryObj } from "@storybook/web-components";
|
|
2
|
+
import type { USAStepIndicatorElement } from "./step-indicator.element.js";
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
tags: string[];
|
|
6
|
+
render(args: USAStepIndicatorElement & {
|
|
7
|
+
counter: string;
|
|
8
|
+
}): import("lit-html").TemplateResult<1>;
|
|
9
|
+
argTypes: {
|
|
10
|
+
counter: {
|
|
11
|
+
control: "select";
|
|
12
|
+
options: (string | null)[];
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
args: {
|
|
16
|
+
counter: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export default meta;
|
|
20
|
+
type Story = StoryObj<USAStepIndicatorElement>;
|
|
21
|
+
export declare const Primary: Story;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { html } from "lit";
|
|
2
|
+
import { ifDefined } from "lit/directives/if-defined.js";
|
|
3
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
4
|
+
const meta = {
|
|
5
|
+
title: "usa-step-indicator",
|
|
6
|
+
tags: ["autodocs"],
|
|
7
|
+
render(args) {
|
|
8
|
+
return html `
|
|
9
|
+
<usa-step-indicator>
|
|
10
|
+
<usa-step state="complete" counter=${ifDefined(args.counter)}>
|
|
11
|
+
Personal information
|
|
12
|
+
</usa-step>
|
|
13
|
+
|
|
14
|
+
<usa-step state="complete" counter=${ifDefined(args.counter)}>
|
|
15
|
+
Household status
|
|
16
|
+
</usa-step>
|
|
17
|
+
|
|
18
|
+
<usa-step state="current" counter=${ifDefined(args.counter)}>
|
|
19
|
+
Supporting documents
|
|
20
|
+
</usa-step>
|
|
21
|
+
|
|
22
|
+
<usa-step counter=${ifDefined(args.counter)}>Signature</usa-step>
|
|
23
|
+
|
|
24
|
+
<usa-step counter=${ifDefined(args.counter)}>
|
|
25
|
+
Review and submit
|
|
26
|
+
</usa-step>
|
|
27
|
+
</usa-step-indicator>
|
|
28
|
+
`;
|
|
29
|
+
},
|
|
30
|
+
argTypes: {
|
|
31
|
+
counter: {
|
|
32
|
+
control: "select",
|
|
33
|
+
options: ["on", "small", null],
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
args: {
|
|
37
|
+
counter: "on",
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
export default meta;
|
|
41
|
+
// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
|
|
42
|
+
export const Primary = {
|
|
43
|
+
args: {},
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=step-indicator.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-indicator.stories.js","sourceRoot":"","sources":["../../../src/lib/step-indicator/step-indicator.stories.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAIzD,kFAAkF;AAClF,MAAM,IAAI,GAAG;IACX,KAAK,EAAE,oBAAoB;IAC3B,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,MAAM,CAAC,IAAI;QACT,OAAO,IAAI,CAAA;;6CAE8B,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC;;;;6CAIvB,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC;;;;4CAIxB,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC;;;;4BAIvC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC;;4BAEvB,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC;;;;KAI9C,CAAC;IACJ,CAAC;IACD,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EAAE,QAAQ;YACjB,OAAO,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC;SAC/B;KACF;IACD,IAAI,EAAE;QACJ,OAAO,EAAE,IAAI;KACd;CAC4D,CAAC;AAEhE,eAAe,IAAI,CAAC;AAIpB,wFAAwF;AACxF,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE,EAAE;CACT,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import "./step-indicator.element.js";
|
|
2
|
+
import "./step/step.element.js";
|
|
3
|
+
import { assert, fixture, html } from "@open-wc/testing";
|
|
4
|
+
describe("usa-step-indicator", () => {
|
|
5
|
+
it("should be accessible", async () => {
|
|
6
|
+
const stepIndicator = await fixture(html `
|
|
7
|
+
<usa-step-indicator>
|
|
8
|
+
<usa-step state="complete" counter="on">Personal information</usa-step>
|
|
9
|
+
<usa-step state="complete" counter="on">Household status</usa-step>
|
|
10
|
+
<usa-step state="current" counter="on">Supporting documents</usa-step>
|
|
11
|
+
<usa-step counter="on">Signature</usa-step>
|
|
12
|
+
<usa-step counter="on">Review and submit</usa-step>
|
|
13
|
+
</usa-step-indicator>
|
|
14
|
+
`);
|
|
15
|
+
return assert.isAccessible(stepIndicator);
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
//# sourceMappingURL=step-indicator.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-indicator.test.js","sourceRoot":"","sources":["../../../src/lib/step-indicator/step-indicator.test.ts"],"names":[],"mappings":"AAAA,OAAO,6BAA6B,CAAC;AACrC,OAAO,wBAAwB,CAAC;AAEhC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAIzD,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAClC,EAAE,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;QACpC,MAAM,aAAa,GAAG,MAAM,OAAO,CAA0B,IAAI,CAAA;;;;;;;;KAQhE,CAAC,CAAC;QAEH,OAAO,MAAM,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { __esDecorate, __runInitializers } from "tslib";
|
|
2
|
+
import { css, element, html } from "@joist/element";
|
|
3
|
+
let USASummaryBoxElement = (() => {
|
|
4
|
+
let _classDecorators = [element({
|
|
5
|
+
tagName: "usa-summary-box",
|
|
6
|
+
shadowDom: [
|
|
7
|
+
css `
|
|
8
|
+
:host {
|
|
9
|
+
font-size: 1.06rem;
|
|
10
|
+
line-height: 1.5;
|
|
11
|
+
color: #1b1b1b;
|
|
12
|
+
background-color: #e7f6f8;
|
|
13
|
+
border-radius: 0.25rem;
|
|
14
|
+
border: 1px #99deea solid;
|
|
15
|
+
padding: 1.5rem;
|
|
16
|
+
position: relative;
|
|
17
|
+
display: block;
|
|
18
|
+
}
|
|
19
|
+
`,
|
|
20
|
+
html ` <slot></slot> `,
|
|
21
|
+
],
|
|
22
|
+
})];
|
|
23
|
+
let _classDescriptor;
|
|
24
|
+
let _classExtraInitializers = [];
|
|
25
|
+
let _classThis;
|
|
26
|
+
let _classSuper = HTMLElement;
|
|
27
|
+
var USASummaryBoxElement = class extends _classSuper {
|
|
28
|
+
static { _classThis = this; }
|
|
29
|
+
static {
|
|
30
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
31
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
32
|
+
USASummaryBoxElement = _classThis = _classDescriptor.value;
|
|
33
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
34
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
return USASummaryBoxElement = _classThis;
|
|
38
|
+
})();
|
|
39
|
+
export { USASummaryBoxElement };
|
|
40
|
+
//# sourceMappingURL=summary-box.element.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"summary-box.element.js","sourceRoot":"","sources":["../../../src/lib/summary-box/summary-box.element.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;IA2BvC,oBAAoB;4BAnBhC,OAAO,CAAC;YACP,OAAO,EAAE,iBAAiB;YAC1B,SAAS,EAAE;gBACT,GAAG,CAAA;;;;;;;;;;;;KAYF;gBACD,IAAI,CAAA,iBAAiB;aACtB;SACF,CAAC;;;;sBACwC,WAAW;oCAAnB,SAAQ,WAAW;;;;YAArD,6KAAwD;;;YAA3C,uDAAoB;;;;;SAApB,oBAAoB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { StoryObj } from "@storybook/web-components";
|
|
2
|
+
import type { USASummaryBoxElement } from "./summary-box.element.js";
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
tags: string[];
|
|
6
|
+
render(args: USASummaryBoxElement): import("lit-html").TemplateResult<1>;
|
|
7
|
+
argTypes: {};
|
|
8
|
+
args: {};
|
|
9
|
+
};
|
|
10
|
+
export default meta;
|
|
11
|
+
type Story = StoryObj<USASummaryBoxElement>;
|
|
12
|
+
export declare const Primary: Story;
|
|
@@ -0,0 +1,17 @@
|
|
|
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-summary-box",
|
|
5
|
+
tags: ["autodocs"],
|
|
6
|
+
render(args) {
|
|
7
|
+
return html `<usa-summary-box> Hello World </usa-summary-box>`;
|
|
8
|
+
},
|
|
9
|
+
argTypes: {},
|
|
10
|
+
args: {},
|
|
11
|
+
};
|
|
12
|
+
export default meta;
|
|
13
|
+
// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
|
|
14
|
+
export const Primary = {
|
|
15
|
+
args: {},
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=summary-box.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"summary-box.stories.js","sourceRoot":"","sources":["../../../src/lib/summary-box/summary-box.stories.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAI3B,kFAAkF;AAClF,MAAM,IAAI,GAAG;IACX,KAAK,EAAE,iBAAiB;IACxB,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,MAAM,CAAC,IAAI;QACT,OAAO,IAAI,CAAA,kDAAkD,CAAC;IAChE,CAAC;IACD,QAAQ,EAAE,EAAE;IACZ,IAAI,EAAE,EAAE;CAC4B,CAAC;AAEvC,eAAe,IAAI,CAAC;AAIpB,wFAAwF;AACxF,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE,EAAE;CACT,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./summary-box.element.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import "./summary-box.element.js";
|
|
2
|
+
import { assert, fixture, html } from "@open-wc/testing";
|
|
3
|
+
describe("usa-summary-box", () => {
|
|
4
|
+
it("should be accessible", async () => {
|
|
5
|
+
const summaryBox = await fixture(html `
|
|
6
|
+
<usa-summary-box>Hello World</usa-summary-box>
|
|
7
|
+
`);
|
|
8
|
+
return assert.isAccessible(summaryBox);
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
//# sourceMappingURL=summary-box.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"summary-box.test.js","sourceRoot":"","sources":["../../../src/lib/summary-box/summary-box.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"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
interface HTMLElementTagNameMap {
|
|
3
|
+
"usa-tag": USATagElement;
|
|
4
|
+
}
|
|
5
|
+
}
|
|
6
|
+
export declare const TAG_VARIANTS: readonly ["default", "big"];
|
|
7
|
+
export type TagVariant = (typeof TAG_VARIANTS)[number];
|
|
8
|
+
export declare class USATagElement extends HTMLElement {
|
|
9
|
+
accessor variant: TagVariant;
|
|
10
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { __esDecorate, __runInitializers } from "tslib";
|
|
2
|
+
import { attr, css, element, html } from "@joist/element";
|
|
3
|
+
export const TAG_VARIANTS = ["default", "big"];
|
|
4
|
+
let USATagElement = (() => {
|
|
5
|
+
let _classDecorators = [element({
|
|
6
|
+
tagName: "usa-tag",
|
|
7
|
+
shadowDom: [
|
|
8
|
+
css `
|
|
9
|
+
:host {
|
|
10
|
+
font-size: 0.93rem;
|
|
11
|
+
color: #fff;
|
|
12
|
+
text-transform: uppercase;
|
|
13
|
+
background-color: #5c5c5c;
|
|
14
|
+
border-radius: 2px;
|
|
15
|
+
margin-right: 0.25rem;
|
|
16
|
+
padding: 1px 0.5rem;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
:host([variant="big"]) {
|
|
20
|
+
padding-left: 0.5rem;
|
|
21
|
+
padding-right: 0.5rem;
|
|
22
|
+
font-size: 1.06rem;
|
|
23
|
+
}
|
|
24
|
+
`,
|
|
25
|
+
html `<slot></slot>`,
|
|
26
|
+
],
|
|
27
|
+
})];
|
|
28
|
+
let _classDescriptor;
|
|
29
|
+
let _classExtraInitializers = [];
|
|
30
|
+
let _classThis;
|
|
31
|
+
let _classSuper = HTMLElement;
|
|
32
|
+
let _variant_decorators;
|
|
33
|
+
let _variant_initializers = [];
|
|
34
|
+
let _variant_extraInitializers = [];
|
|
35
|
+
var USATagElement = class extends _classSuper {
|
|
36
|
+
static { _classThis = this; }
|
|
37
|
+
static {
|
|
38
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
39
|
+
_variant_decorators = [attr()];
|
|
40
|
+
__esDecorate(this, null, _variant_decorators, { kind: "accessor", name: "variant", static: false, private: false, access: { has: obj => "variant" in obj, get: obj => obj.variant, set: (obj, value) => { obj.variant = value; } }, metadata: _metadata }, _variant_initializers, _variant_extraInitializers);
|
|
41
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
42
|
+
USATagElement = _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
|
+
#variant_accessor_storage = __runInitializers(this, _variant_initializers, "default");
|
|
47
|
+
get variant() { return this.#variant_accessor_storage; }
|
|
48
|
+
set variant(value) { this.#variant_accessor_storage = value; }
|
|
49
|
+
constructor() {
|
|
50
|
+
super(...arguments);
|
|
51
|
+
__runInitializers(this, _variant_extraInitializers);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
return USATagElement = _classThis;
|
|
55
|
+
})();
|
|
56
|
+
export { USATagElement };
|
|
57
|
+
//# sourceMappingURL=tag.element.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag.element.js","sourceRoot":"","sources":["../../../src/lib/tag/tag.element.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAQ1D,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,SAAS,EAAE,KAAK,CAAU,CAAC;IA2B3C,aAAa;4BAvBzB,OAAO,CAAC;YACP,OAAO,EAAE,SAAS;YAClB,SAAS,EAAE;gBACT,GAAG,CAAA;;;;;;;;;;;;;;;;KAgBF;gBACD,IAAI,CAAA,eAAe;aACpB;SACF,CAAC;;;;sBACiC,WAAW;;;;6BAAnB,SAAQ,WAAW;;;;mCAC3C,IAAI,EAAE;YACP,0KAAS,OAAO,6BAAP,OAAO,yFAAyB;YAF3C,6KAGC;;;YAHY,uDAAa;;QAExB,2EAA+B,SAAS,EAAC;QAAzC,IAAS,OAAO,6CAAyB;QAAzC,IAAS,OAAO,mDAAyB;;;;;;;;SAF9B,aAAa"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { StoryObj } from "@storybook/web-components";
|
|
2
|
+
import { type USATagElement } from "./tag.element.js";
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
tags: string[];
|
|
6
|
+
render(args: USATagElement): import("lit-html").TemplateResult<1>;
|
|
7
|
+
argTypes: {
|
|
8
|
+
variant: {
|
|
9
|
+
control: "select";
|
|
10
|
+
options: readonly ["default", "big"];
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
args: {
|
|
14
|
+
variant: "default";
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export default meta;
|
|
18
|
+
type Story = StoryObj<USATagElement>;
|
|
19
|
+
export declare const Primary: Story;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { html } from "lit";
|
|
2
|
+
import { TAG_VARIANTS } from "./tag.element.js";
|
|
3
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
4
|
+
const meta = {
|
|
5
|
+
title: "usa-tag",
|
|
6
|
+
tags: ["autodocs"],
|
|
7
|
+
render(args) {
|
|
8
|
+
return html `<usa-tag variant=${args.variant}>Hello World</usa-tag>`;
|
|
9
|
+
},
|
|
10
|
+
argTypes: {
|
|
11
|
+
variant: {
|
|
12
|
+
control: "select",
|
|
13
|
+
options: TAG_VARIANTS,
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
args: {
|
|
17
|
+
variant: "default",
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
export default meta;
|
|
21
|
+
// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
|
|
22
|
+
export const Primary = {
|
|
23
|
+
args: {},
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=tag.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag.stories.js","sourceRoot":"","sources":["../../../src/lib/tag/tag.stories.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAE3B,OAAO,EAAE,YAAY,EAAsB,MAAM,kBAAkB,CAAC;AAEpE,kFAAkF;AAClF,MAAM,IAAI,GAAG;IACX,KAAK,EAAE,SAAS;IAChB,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,MAAM,CAAC,IAAI;QACT,OAAO,IAAI,CAAA,oBAAoB,IAAI,CAAC,OAAO,wBAAwB,CAAC;IACtE,CAAC;IACD,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EAAE,QAAQ;YACjB,OAAO,EAAE,YAAY;SACtB;KACF;IACD,IAAI,EAAE;QACJ,OAAO,EAAE,SAAS;KACnB;CAC4B,CAAC;AAEhC,eAAe,IAAI,CAAC;AAIpB,wFAAwF;AACxF,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE,EAAE;CACT,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./tag.element.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import "./tag.element.js";
|
|
2
|
+
import { assert, fixture, html } from "@open-wc/testing";
|
|
3
|
+
describe("usa-tag", () => {
|
|
4
|
+
it("should be accessible", async () => {
|
|
5
|
+
const tag = await fixture(html `
|
|
6
|
+
<usa-tag>Hello World</usa-tag>
|
|
7
|
+
`);
|
|
8
|
+
return assert.isAccessible(tag);
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
//# sourceMappingURL=tag.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag.test.js","sourceRoot":"","sources":["../../../src/lib/tag/tag.test.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAE1B,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAIzD,QAAQ,CAAC,SAAS,EAAE,GAAG,EAAE;IACvB,EAAE,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;QACpC,MAAM,GAAG,GAAG,MAAM,OAAO,CAAgB,IAAI,CAAA;;KAE5C,CAAC,CAAC;QAEH,OAAO,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
interface HTMLElementTagNameMap {
|
|
3
|
+
"usa-textarea": USATextareaElement;
|
|
4
|
+
}
|
|
5
|
+
}
|
|
6
|
+
export declare class USATextareaElement extends HTMLElement {
|
|
7
|
+
#private;
|
|
8
|
+
static formAssociated: boolean;
|
|
9
|
+
accessor name: string;
|
|
10
|
+
accessor autocomplete: AutoFill;
|
|
11
|
+
accessor placeholder: string;
|
|
12
|
+
accessor required: boolean;
|
|
13
|
+
accessor value: string;
|
|
14
|
+
onReady(): void;
|
|
15
|
+
connectedCallback(): void;
|
|
16
|
+
onChange(): void;
|
|
17
|
+
onInputChange(): void;
|
|
18
|
+
attributeChangedCallback(attr: string): void;
|
|
19
|
+
}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { __esDecorate, __runInitializers } from "tslib";
|
|
2
|
+
import { attr, css, element, html, listen, query, ready } from "@joist/element";
|
|
3
|
+
import { effect, observe } from "@joist/observable";
|
|
4
|
+
let USATextareaElement = (() => {
|
|
5
|
+
let _classDecorators = [element({
|
|
6
|
+
tagName: "usa-textarea",
|
|
7
|
+
shadowDom: [
|
|
8
|
+
css `
|
|
9
|
+
* {
|
|
10
|
+
box-sizing: border-box;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
:host {
|
|
14
|
+
font-size: 1.06rem;
|
|
15
|
+
line-height: 1.3;
|
|
16
|
+
display: block;
|
|
17
|
+
font-weight: 400;
|
|
18
|
+
max-width: 30rem;
|
|
19
|
+
margin-bottom: 1.5rem;
|
|
20
|
+
position: relative;
|
|
21
|
+
height: calc(6lh + .5rem);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
textarea {
|
|
25
|
+
font-family: inherit;
|
|
26
|
+
font-size: inherit;
|
|
27
|
+
border-radius: 0;
|
|
28
|
+
color: #1b1b1b;
|
|
29
|
+
display: block;
|
|
30
|
+
margin-top: .5rem;
|
|
31
|
+
max-width: 30rem;
|
|
32
|
+
padding: .5rem;
|
|
33
|
+
border-width: 1px;
|
|
34
|
+
border-color: #5c5c5c;
|
|
35
|
+
border-style: solid;
|
|
36
|
+
-webkit-appearance: none;
|
|
37
|
+
-moz-appearance: none;
|
|
38
|
+
appearance: none;
|
|
39
|
+
width: 100%;
|
|
40
|
+
height: 100%;
|
|
41
|
+
resize: none;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
textarea:not(:disabled):focus {
|
|
45
|
+
outline: 0.25rem solid #2491ff;
|
|
46
|
+
outline-offset: 0;
|
|
47
|
+
}
|
|
48
|
+
`,
|
|
49
|
+
html `
|
|
50
|
+
<label>
|
|
51
|
+
<slot></slot>
|
|
52
|
+
|
|
53
|
+
<textarea></textarea>
|
|
54
|
+
</label>
|
|
55
|
+
`,
|
|
56
|
+
],
|
|
57
|
+
})];
|
|
58
|
+
let _classDescriptor;
|
|
59
|
+
let _classExtraInitializers = [];
|
|
60
|
+
let _classThis;
|
|
61
|
+
let _classSuper = HTMLElement;
|
|
62
|
+
let _instanceExtraInitializers = [];
|
|
63
|
+
let _name_decorators;
|
|
64
|
+
let _name_initializers = [];
|
|
65
|
+
let _name_extraInitializers = [];
|
|
66
|
+
let _autocomplete_decorators;
|
|
67
|
+
let _autocomplete_initializers = [];
|
|
68
|
+
let _autocomplete_extraInitializers = [];
|
|
69
|
+
let _placeholder_decorators;
|
|
70
|
+
let _placeholder_initializers = [];
|
|
71
|
+
let _placeholder_extraInitializers = [];
|
|
72
|
+
let _required_decorators;
|
|
73
|
+
let _required_initializers = [];
|
|
74
|
+
let _required_extraInitializers = [];
|
|
75
|
+
let _value_decorators;
|
|
76
|
+
let _value_initializers = [];
|
|
77
|
+
let _value_extraInitializers = [];
|
|
78
|
+
let _onReady_decorators;
|
|
79
|
+
let _onChange_decorators;
|
|
80
|
+
let _onInputChange_decorators;
|
|
81
|
+
var USATextareaElement = class extends _classSuper {
|
|
82
|
+
static { _classThis = this; }
|
|
83
|
+
static {
|
|
84
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
85
|
+
_name_decorators = [attr()];
|
|
86
|
+
_autocomplete_decorators = [attr()];
|
|
87
|
+
_placeholder_decorators = [attr()];
|
|
88
|
+
_required_decorators = [attr()];
|
|
89
|
+
_value_decorators = [attr({
|
|
90
|
+
reflect: false,
|
|
91
|
+
}), observe()];
|
|
92
|
+
_onReady_decorators = [ready()];
|
|
93
|
+
_onChange_decorators = [effect()];
|
|
94
|
+
_onInputChange_decorators = [listen("input")];
|
|
95
|
+
__esDecorate(this, null, _name_decorators, { kind: "accessor", name: "name", static: false, private: false, access: { has: obj => "name" in obj, get: obj => obj.name, set: (obj, value) => { obj.name = value; } }, metadata: _metadata }, _name_initializers, _name_extraInitializers);
|
|
96
|
+
__esDecorate(this, null, _autocomplete_decorators, { kind: "accessor", name: "autocomplete", static: false, private: false, access: { has: obj => "autocomplete" in obj, get: obj => obj.autocomplete, set: (obj, value) => { obj.autocomplete = value; } }, metadata: _metadata }, _autocomplete_initializers, _autocomplete_extraInitializers);
|
|
97
|
+
__esDecorate(this, null, _placeholder_decorators, { kind: "accessor", name: "placeholder", static: false, private: false, access: { has: obj => "placeholder" in obj, get: obj => obj.placeholder, set: (obj, value) => { obj.placeholder = value; } }, metadata: _metadata }, _placeholder_initializers, _placeholder_extraInitializers);
|
|
98
|
+
__esDecorate(this, null, _required_decorators, { kind: "accessor", name: "required", static: false, private: false, access: { has: obj => "required" in obj, get: obj => obj.required, set: (obj, value) => { obj.required = value; } }, metadata: _metadata }, _required_initializers, _required_extraInitializers);
|
|
99
|
+
__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);
|
|
100
|
+
__esDecorate(this, null, _onReady_decorators, { kind: "method", name: "onReady", static: false, private: false, access: { has: obj => "onReady" in obj, get: obj => obj.onReady }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
101
|
+
__esDecorate(this, null, _onChange_decorators, { kind: "method", name: "onChange", static: false, private: false, access: { has: obj => "onChange" in obj, get: obj => obj.onChange }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
102
|
+
__esDecorate(this, null, _onInputChange_decorators, { kind: "method", name: "onInputChange", static: false, private: false, access: { has: obj => "onInputChange" in obj, get: obj => obj.onInputChange }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
103
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
104
|
+
USATextareaElement = _classThis = _classDescriptor.value;
|
|
105
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
106
|
+
}
|
|
107
|
+
static formAssociated = true;
|
|
108
|
+
#name_accessor_storage = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _name_initializers, ""));
|
|
109
|
+
get name() { return this.#name_accessor_storage; }
|
|
110
|
+
set name(value) { this.#name_accessor_storage = value; }
|
|
111
|
+
#autocomplete_accessor_storage = (__runInitializers(this, _name_extraInitializers), __runInitializers(this, _autocomplete_initializers, "on"));
|
|
112
|
+
get autocomplete() { return this.#autocomplete_accessor_storage; }
|
|
113
|
+
set autocomplete(value) { this.#autocomplete_accessor_storage = value; }
|
|
114
|
+
#placeholder_accessor_storage = (__runInitializers(this, _autocomplete_extraInitializers), __runInitializers(this, _placeholder_initializers, ""));
|
|
115
|
+
get placeholder() { return this.#placeholder_accessor_storage; }
|
|
116
|
+
set placeholder(value) { this.#placeholder_accessor_storage = value; }
|
|
117
|
+
#required_accessor_storage = (__runInitializers(this, _placeholder_extraInitializers), __runInitializers(this, _required_initializers, false));
|
|
118
|
+
get required() { return this.#required_accessor_storage; }
|
|
119
|
+
set required(value) { this.#required_accessor_storage = value; }
|
|
120
|
+
#value_accessor_storage = (__runInitializers(this, _required_extraInitializers), __runInitializers(this, _value_initializers, ""));
|
|
121
|
+
get value() { return this.#value_accessor_storage; }
|
|
122
|
+
set value(value) { this.#value_accessor_storage = value; }
|
|
123
|
+
#internals = (__runInitializers(this, _value_extraInitializers), this.attachInternals());
|
|
124
|
+
#input = query("textarea");
|
|
125
|
+
onReady() {
|
|
126
|
+
const input = this.#input();
|
|
127
|
+
input.autofocus = this.autofocus;
|
|
128
|
+
}
|
|
129
|
+
connectedCallback() {
|
|
130
|
+
this.#syncFormState();
|
|
131
|
+
}
|
|
132
|
+
onChange() {
|
|
133
|
+
const input = this.#input();
|
|
134
|
+
if (input.value !== this.value) {
|
|
135
|
+
input.value = this.value;
|
|
136
|
+
}
|
|
137
|
+
this.#syncFormState();
|
|
138
|
+
}
|
|
139
|
+
onInputChange() {
|
|
140
|
+
const input = this.#input();
|
|
141
|
+
this.value = input.value;
|
|
142
|
+
}
|
|
143
|
+
attributeChangedCallback(attr) {
|
|
144
|
+
const input = this.#input();
|
|
145
|
+
switch (attr) {
|
|
146
|
+
case "autocomplete":
|
|
147
|
+
input.autocomplete = this.autocomplete;
|
|
148
|
+
break;
|
|
149
|
+
case "placeholder":
|
|
150
|
+
input.placeholder = this.placeholder;
|
|
151
|
+
break;
|
|
152
|
+
case "name":
|
|
153
|
+
input.name = this.name;
|
|
154
|
+
break;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
#syncFormState() {
|
|
158
|
+
const input = this.#input();
|
|
159
|
+
this.#internals.setFormValue(input.value);
|
|
160
|
+
if (this.required && !input.value) {
|
|
161
|
+
this.#internals.setValidity({ valueMissing: true }, "Required", input);
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
this.#internals.setValidity({});
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
static {
|
|
168
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
return USATextareaElement = _classThis;
|
|
172
|
+
})();
|
|
173
|
+
export { USATextareaElement };
|
|
174
|
+
//# sourceMappingURL=textarea.element.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textarea.element.js","sourceRoot":"","sources":["../../../src/lib/textarea/textarea.element.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { StoryObj } from "@storybook/web-components";
|
|
2
|
+
import type { USATextareaElement } from "./textarea.element.js";
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
tags: string[];
|
|
6
|
+
render(args: USATextareaElement): import("lit-html").TemplateResult<1>;
|
|
7
|
+
argTypes: {};
|
|
8
|
+
args: {};
|
|
9
|
+
};
|
|
10
|
+
export default meta;
|
|
11
|
+
type Story = StoryObj<USATextareaElement>;
|
|
12
|
+
export declare const Primary: Story;
|
|
@@ -0,0 +1,17 @@
|
|
|
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-textarea",
|
|
5
|
+
tags: ["autodocs"],
|
|
6
|
+
render(args) {
|
|
7
|
+
return html `<usa-textarea>Hello World</usa-textarea>`;
|
|
8
|
+
},
|
|
9
|
+
argTypes: {},
|
|
10
|
+
args: {},
|
|
11
|
+
};
|
|
12
|
+
export default meta;
|
|
13
|
+
// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
|
|
14
|
+
export const Primary = {
|
|
15
|
+
args: {},
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=textarea.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textarea.stories.js","sourceRoot":"","sources":["../../../src/lib/textarea/textarea.stories.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAI3B,kFAAkF;AAClF,MAAM,IAAI,GAAG;IACX,KAAK,EAAE,cAAc;IACrB,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,MAAM,CAAC,IAAI;QACT,OAAO,IAAI,CAAA,0CAA0C,CAAC;IACxD,CAAC;IACD,QAAQ,EAAE,EAAE;IACZ,IAAI,EAAE,EAAE;CAC0B,CAAC;AAErC,eAAe,IAAI,CAAC;AAIpB,wFAAwF;AACxF,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE,EAAE;CACT,CAAC"}
|