@noctuatech/uswds 0.0.26 → 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.
Files changed (253) hide show
  1. package/package.json +5 -5
  2. package/src/lib/file-input/file-input-preview/file-input-preview.element.ts +11 -2
  3. package/src/lib/file-input/file-input.element.ts +15 -15
  4. package/assets/uswds.min.js +0 -1
  5. package/target/lib/accordion/accordion.element.d.ts +0 -19
  6. package/target/lib/accordion/accordion.element.js +0 -166
  7. package/target/lib/accordion/accordion.element.js.map +0 -1
  8. package/target/lib/accordion/accordion.stories.d.ts +0 -12
  9. package/target/lib/accordion/accordion.stories.js +0 -42
  10. package/target/lib/accordion/accordion.stories.js.map +0 -1
  11. package/target/lib/accordion/accordion.test.d.ts +0 -1
  12. package/target/lib/accordion/accordion.test.js +0 -113
  13. package/target/lib/accordion/accordion.test.js.map +0 -1
  14. package/target/lib/alert/alert-types.d.ts +0 -7
  15. package/target/lib/alert/alert-types.js +0 -25
  16. package/target/lib/alert/alert-types.js.map +0 -1
  17. package/target/lib/alert/alert.element.d.ts +0 -11
  18. package/target/lib/alert/alert.element.js +0 -122
  19. package/target/lib/alert/alert.element.js.map +0 -1
  20. package/target/lib/alert/alert.stories.d.ts +0 -11
  21. package/target/lib/alert/alert.stories.js +0 -56
  22. package/target/lib/alert/alert.stories.js.map +0 -1
  23. package/target/lib/alert/alert.test.d.ts +0 -1
  24. package/target/lib/alert/alert.test.js +0 -20
  25. package/target/lib/alert/alert.test.js.map +0 -1
  26. package/target/lib/button/button.element.d.ts +0 -20
  27. package/target/lib/button/button.element.js +0 -263
  28. package/target/lib/button/button.element.js.map +0 -1
  29. package/target/lib/button/button.stories.d.ts +0 -12
  30. package/target/lib/button/button.stories.js +0 -22
  31. package/target/lib/button/button.stories.js.map +0 -1
  32. package/target/lib/button/button.test.d.ts +0 -1
  33. package/target/lib/button/button.test.js +0 -14
  34. package/target/lib/button/button.test.js.map +0 -1
  35. package/target/lib/card/card-body/card-body.element.d.ts +0 -7
  36. package/target/lib/card/card-body/card-body.element.js +0 -35
  37. package/target/lib/card/card-body/card-body.element.js.map +0 -1
  38. package/target/lib/card/card-footer/card-footer.element.d.ts +0 -7
  39. package/target/lib/card/card-footer/card-footer.element.js +0 -33
  40. package/target/lib/card/card-footer/card-footer.element.js.map +0 -1
  41. package/target/lib/card/card-group/card-group.element.d.ts +0 -8
  42. package/target/lib/card/card-group/card-group.element.js +0 -51
  43. package/target/lib/card/card-group/card-group.element.js.map +0 -1
  44. package/target/lib/card/card-header/card-header.element.d.ts +0 -7
  45. package/target/lib/card/card-header/card-header.element.js +0 -43
  46. package/target/lib/card/card-header/card-header.element.js.map +0 -1
  47. package/target/lib/card/card-media/card-media.element.d.ts +0 -8
  48. package/target/lib/card/card-media/card-media.element.js +0 -71
  49. package/target/lib/card/card-media/card-media.element.js.map +0 -1
  50. package/target/lib/card/card.element.d.ts +0 -9
  51. package/target/lib/card/card.element.js +0 -79
  52. package/target/lib/card/card.element.js.map +0 -1
  53. package/target/lib/card/card.stories.d.ts +0 -12
  54. package/target/lib/card/card.stories.js +0 -126
  55. package/target/lib/card/card.stories.js.map +0 -1
  56. package/target/lib/card/card.test.d.ts +0 -6
  57. package/target/lib/card/card.test.js +0 -33
  58. package/target/lib/card/card.test.js.map +0 -1
  59. package/target/lib/checkbox/checkbox.element.d.ts +0 -17
  60. package/target/lib/checkbox/checkbox.element.js +0 -206
  61. package/target/lib/checkbox/checkbox.element.js.map +0 -1
  62. package/target/lib/checkbox/checkbox.stories.d.ts +0 -31
  63. package/target/lib/checkbox/checkbox.stories.js +0 -46
  64. package/target/lib/checkbox/checkbox.stories.js.map +0 -1
  65. package/target/lib/checkbox/checkbox.test.d.ts +0 -1
  66. package/target/lib/checkbox/checkbox.test.js +0 -52
  67. package/target/lib/checkbox/checkbox.test.js.map +0 -1
  68. package/target/lib/config/config.element.d.ts +0 -6
  69. package/target/lib/config/config.element.js +0 -53
  70. package/target/lib/config/config.element.js.map +0 -1
  71. package/target/lib/config/config.test.d.ts +0 -1
  72. package/target/lib/config/config.test.js +0 -11
  73. package/target/lib/config/config.test.js.map +0 -1
  74. package/target/lib/define.d.ts +0 -32
  75. package/target/lib/define.js +0 -33
  76. package/target/lib/define.js.map +0 -1
  77. package/target/lib/description/description.element.d.ts +0 -7
  78. package/target/lib/description/description.element.js +0 -34
  79. package/target/lib/description/description.element.js.map +0 -1
  80. package/target/lib/description/description.test.d.ts +0 -1
  81. package/target/lib/description/description.test.js +0 -11
  82. package/target/lib/description/description.test.js.map +0 -1
  83. package/target/lib/file-input/file-input-preview/file-input-preview.element.d.ts +0 -12
  84. package/target/lib/file-input/file-input-preview/file-input-preview.element.js +0 -144
  85. package/target/lib/file-input/file-input-preview/file-input-preview.element.js.map +0 -1
  86. package/target/lib/file-input/file-input-preview/file-input-preview.test.d.ts +0 -2
  87. package/target/lib/file-input/file-input-preview/file-input-preview.test.js +0 -67
  88. package/target/lib/file-input/file-input-preview/file-input-preview.test.js.map +0 -1
  89. package/target/lib/file-input/file-input.element.d.ts +0 -16
  90. package/target/lib/file-input/file-input.element.js +0 -182
  91. package/target/lib/file-input/file-input.element.js.map +0 -1
  92. package/target/lib/file-input/file-input.stories.d.ts +0 -12
  93. package/target/lib/file-input/file-input.stories.js +0 -34
  94. package/target/lib/file-input/file-input.stories.js.map +0 -1
  95. package/target/lib/file-input/file-input.test.d.ts +0 -1
  96. package/target/lib/file-input/file-input.test.js +0 -37
  97. package/target/lib/file-input/file-input.test.js.map +0 -1
  98. package/target/lib/icon/icon-types.d.ts +0 -2
  99. package/target/lib/icon/icon-types.js +0 -262
  100. package/target/lib/icon/icon-types.js.map +0 -1
  101. package/target/lib/icon/icon.element.d.ts +0 -13
  102. package/target/lib/icon/icon.element.js +0 -72
  103. package/target/lib/icon/icon.element.js.map +0 -1
  104. package/target/lib/icon/icon.stories.d.ts +0 -12
  105. package/target/lib/icon/icon.stories.js +0 -39
  106. package/target/lib/icon/icon.stories.js.map +0 -1
  107. package/target/lib/input/input.element.d.ts +0 -24
  108. package/target/lib/input/input.element.js +0 -235
  109. package/target/lib/input/input.element.js.map +0 -1
  110. package/target/lib/input/input.stories.d.ts +0 -12
  111. package/target/lib/input/input.stories.js +0 -25
  112. package/target/lib/input/input.stories.js.map +0 -1
  113. package/target/lib/input/input.test.d.ts +0 -1
  114. package/target/lib/input/input.test.js +0 -50
  115. package/target/lib/input/input.test.js.map +0 -1
  116. package/target/lib/input-mask/format.d.ts +0 -15
  117. package/target/lib/input-mask/format.js +0 -47
  118. package/target/lib/input-mask/format.js.map +0 -1
  119. package/target/lib/input-mask/input-mask.element.d.ts +0 -12
  120. package/target/lib/input-mask/input-mask.element.js +0 -106
  121. package/target/lib/input-mask/input-mask.element.js.map +0 -1
  122. package/target/lib/input-mask/input-mask.stories.d.ts +0 -14
  123. package/target/lib/input-mask/input-mask.stories.js +0 -30
  124. package/target/lib/input-mask/input-mask.stories.js.map +0 -1
  125. package/target/lib/input-mask/input-mask.test.d.ts +0 -2
  126. package/target/lib/input-mask/input-mask.test.js +0 -89
  127. package/target/lib/input-mask/input-mask.test.js.map +0 -1
  128. package/target/lib/input-mask/maskable.element.d.ts +0 -5
  129. package/target/lib/input-mask/maskable.element.js +0 -2
  130. package/target/lib/input-mask/maskable.element.js.map +0 -1
  131. package/target/lib/link/link.element.d.ts +0 -13
  132. package/target/lib/link/link.element.js +0 -93
  133. package/target/lib/link/link.element.js.map +0 -1
  134. package/target/lib/link/link.stories.d.ts +0 -16
  135. package/target/lib/link/link.stories.js +0 -23
  136. package/target/lib/link/link.stories.js.map +0 -1
  137. package/target/lib/modal/modal-close/modal-close.element.d.ts +0 -8
  138. package/target/lib/modal/modal-close/modal-close.element.js +0 -76
  139. package/target/lib/modal/modal-close/modal-close.element.js.map +0 -1
  140. package/target/lib/modal/modal-close/modal-close.test.d.ts +0 -1
  141. package/target/lib/modal/modal-close/modal-close.test.js +0 -11
  142. package/target/lib/modal/modal-close/modal-close.test.js.map +0 -1
  143. package/target/lib/modal/modal-heading/modal-heading.element.d.ts +0 -7
  144. package/target/lib/modal/modal-heading/modal-heading.element.js +0 -50
  145. package/target/lib/modal/modal-heading/modal-heading.element.js.map +0 -1
  146. package/target/lib/modal/modal-heading/modal-heading.test.d.ts +0 -1
  147. package/target/lib/modal/modal-heading/modal-heading.test.js +0 -11
  148. package/target/lib/modal/modal-heading/modal-heading.test.js.map +0 -1
  149. package/target/lib/modal/modal.element.d.ts +0 -13
  150. package/target/lib/modal/modal.element.js +0 -91
  151. package/target/lib/modal/modal.element.js.map +0 -1
  152. package/target/lib/modal/modal.stories.d.ts +0 -12
  153. package/target/lib/modal/modal.stories.js +0 -34
  154. package/target/lib/modal/modal.stories.js.map +0 -1
  155. package/target/lib/modal/modal.test.d.ts +0 -3
  156. package/target/lib/modal/modal.test.js +0 -21
  157. package/target/lib/modal/modal.test.js.map +0 -1
  158. package/target/lib/radio/context.d.ts +0 -7
  159. package/target/lib/radio/context.js +0 -3
  160. package/target/lib/radio/context.js.map +0 -1
  161. package/target/lib/radio/radio-option/radio-option.element.d.ts +0 -12
  162. package/target/lib/radio/radio-option/radio-option.element.js +0 -89
  163. package/target/lib/radio/radio-option/radio-option.element.js.map +0 -1
  164. package/target/lib/radio/radio-option/radio-option.test.d.ts +0 -2
  165. package/target/lib/radio/radio-option/radio-option.test.js +0 -15
  166. package/target/lib/radio/radio-option/radio-option.test.js.map +0 -1
  167. package/target/lib/radio/radio.element.d.ts +0 -17
  168. package/target/lib/radio/radio.element.js +0 -169
  169. package/target/lib/radio/radio.element.js.map +0 -1
  170. package/target/lib/radio/radio.stories.d.ts +0 -17
  171. package/target/lib/radio/radio.stories.js +0 -46
  172. package/target/lib/radio/radio.stories.js.map +0 -1
  173. package/target/lib/radio/radio.test.d.ts +0 -2
  174. package/target/lib/radio/radio.test.js +0 -143
  175. package/target/lib/radio/radio.test.js.map +0 -1
  176. package/target/lib/select/context.d.ts +0 -6
  177. package/target/lib/select/context.js +0 -3
  178. package/target/lib/select/context.js.map +0 -1
  179. package/target/lib/select/select-option/select-option.element.d.ts +0 -14
  180. package/target/lib/select/select-option/select-option.element.js +0 -74
  181. package/target/lib/select/select-option/select-option.element.js.map +0 -1
  182. package/target/lib/select/select.element.d.ts +0 -17
  183. package/target/lib/select/select.element.js +0 -141
  184. package/target/lib/select/select.element.js.map +0 -1
  185. package/target/lib/select/select.stories.d.ts +0 -12
  186. package/target/lib/select/select.stories.js +0 -26
  187. package/target/lib/select/select.stories.js.map +0 -1
  188. package/target/lib/select/select.test.d.ts +0 -2
  189. package/target/lib/select/select.test.js +0 -105
  190. package/target/lib/select/select.test.js.map +0 -1
  191. package/target/lib/services/http.service.d.ts +0 -3
  192. package/target/lib/services/http.service.js +0 -24
  193. package/target/lib/services/http.service.js.map +0 -1
  194. package/target/lib/services/icon.service.d.ts +0 -4
  195. package/target/lib/services/icon.service.js +0 -60
  196. package/target/lib/services/icon.service.js.map +0 -1
  197. package/target/lib/services/icon.service.test.d.ts +0 -1
  198. package/target/lib/services/icon.service.test.js +0 -52
  199. package/target/lib/services/icon.service.test.js.map +0 -1
  200. package/target/lib/side-nav/side-nav-item/side-nav-item.element.d.ts +0 -8
  201. package/target/lib/side-nav/side-nav-item/side-nav-item.element.js +0 -107
  202. package/target/lib/side-nav/side-nav-item/side-nav-item.element.js.map +0 -1
  203. package/target/lib/side-nav/side-nav.element.d.ts +0 -8
  204. package/target/lib/side-nav/side-nav.element.js +0 -47
  205. package/target/lib/side-nav/side-nav.element.js.map +0 -1
  206. package/target/lib/side-nav/side-nav.stories.d.ts +0 -12
  207. package/target/lib/side-nav/side-nav.stories.js +0 -55
  208. package/target/lib/side-nav/side-nav.stories.js.map +0 -1
  209. package/target/lib/side-nav/side-nav.test.d.ts +0 -3
  210. package/target/lib/side-nav/side-nav.test.js +0 -93
  211. package/target/lib/side-nav/side-nav.test.js.map +0 -1
  212. package/target/lib/step-indicator/step/step.element.d.ts +0 -10
  213. package/target/lib/step-indicator/step/step.element.js +0 -151
  214. package/target/lib/step-indicator/step/step.element.js.map +0 -1
  215. package/target/lib/step-indicator/step-indicator.element.d.ts +0 -8
  216. package/target/lib/step-indicator/step-indicator.element.js +0 -48
  217. package/target/lib/step-indicator/step-indicator.element.js.map +0 -1
  218. package/target/lib/step-indicator/step-indicator.stories.d.ts +0 -21
  219. package/target/lib/step-indicator/step-indicator.stories.js +0 -45
  220. package/target/lib/step-indicator/step-indicator.stories.js.map +0 -1
  221. package/target/lib/step-indicator/step-indicator.test.d.ts +0 -2
  222. package/target/lib/step-indicator/step-indicator.test.js +0 -18
  223. package/target/lib/step-indicator/step-indicator.test.js.map +0 -1
  224. package/target/lib/summary-box/summary-box.element.d.ts +0 -7
  225. package/target/lib/summary-box/summary-box.element.js +0 -40
  226. package/target/lib/summary-box/summary-box.element.js.map +0 -1
  227. package/target/lib/summary-box/summary-box.stories.d.ts +0 -12
  228. package/target/lib/summary-box/summary-box.stories.js +0 -17
  229. package/target/lib/summary-box/summary-box.stories.js.map +0 -1
  230. package/target/lib/summary-box/summary-box.test.d.ts +0 -1
  231. package/target/lib/summary-box/summary-box.test.js +0 -11
  232. package/target/lib/summary-box/summary-box.test.js.map +0 -1
  233. package/target/lib/tag/tag.element.d.ts +0 -10
  234. package/target/lib/tag/tag.element.js +0 -57
  235. package/target/lib/tag/tag.element.js.map +0 -1
  236. package/target/lib/tag/tag.stories.d.ts +0 -19
  237. package/target/lib/tag/tag.stories.js +0 -25
  238. package/target/lib/tag/tag.stories.js.map +0 -1
  239. package/target/lib/tag/tag.test.d.ts +0 -1
  240. package/target/lib/tag/tag.test.js +0 -11
  241. package/target/lib/tag/tag.test.js.map +0 -1
  242. package/target/lib/textarea/textarea.element.d.ts +0 -19
  243. package/target/lib/textarea/textarea.element.js +0 -171
  244. package/target/lib/textarea/textarea.element.js.map +0 -1
  245. package/target/lib/textarea/textarea.stories.d.ts +0 -12
  246. package/target/lib/textarea/textarea.stories.js +0 -17
  247. package/target/lib/textarea/textarea.stories.js.map +0 -1
  248. package/target/lib/textarea/textarea.test.d.ts +0 -1
  249. package/target/lib/textarea/textarea.test.js +0 -50
  250. package/target/lib/textarea/textarea.test.js.map +0 -1
  251. package/target/lib.d.ts +0 -32
  252. package/target/lib.js +0 -33
  253. package/target/lib.js.map +0 -1
@@ -1,113 +0,0 @@
1
- import "./accordion.element.js";
2
- import { assert, fixture, html } from "@open-wc/testing";
3
- describe("usa-accordion", () => {
4
- it("should be accessible", async () => {
5
- const accordion = await fixture(html `
6
- <usa-accordion id="first" name="ammendment">
7
- <h4 slot="heading">First Ammendment</h4>
8
-
9
- <div class="content">
10
- Congress shall make no law respecting an establishment of religion, or
11
- prohibiting the free exercise thereof; or abridging the freedom of
12
- speech, or of the press; or the right of the people peaceably to
13
- assemble, and to petition the Government for a redress of grievances.
14
- </div>
15
- </usa-accordion>
16
- `);
17
- return assert.isAccessible(accordion);
18
- });
19
- it("should toggle the open state when clicked", async () => {
20
- const accordion = await fixture(html `
21
- <usa-accordion id="first" name="ammendment">
22
- <h4 slot="heading">First Ammendment</h4>
23
-
24
- <div class="content">
25
- Congress shall make no law respecting an establishment of religion, or
26
- prohibiting the free exercise thereof; or abridging the freedom of
27
- speech, or of the press; or the right of the people peaceably to
28
- assemble, and to petition the Government for a redress of grievances.
29
- </div>
30
- </usa-accordion>
31
- `);
32
- const heading = accordion.querySelector("h4");
33
- const content = accordion.querySelector(".content");
34
- heading?.click();
35
- assert.isTrue(content?.checkVisibility());
36
- });
37
- it("should toggle the open state when clicked", async () => {
38
- const accordion = await fixture(html `
39
- <usa-accordion id="first" name="ammendment">
40
- <h4 slot="heading">First Ammendment</h4>
41
-
42
- <div class="content">
43
- Congress shall make no law respecting an establishment of religion, or
44
- prohibiting the free exercise thereof; or abridging the freedom of
45
- speech, or of the press; or the right of the people peaceably to
46
- assemble, and to petition the Government for a redress of grievances.
47
- </div>
48
- </usa-accordion>
49
- `);
50
- const heading = accordion.querySelector("h4");
51
- const content = accordion.querySelector(".content");
52
- assert.isFalse(content?.checkVisibility());
53
- heading?.click();
54
- assert.isTrue(content.checkVisibility());
55
- });
56
- it("should only allow a single accordion in a group to be open", async () => {
57
- const el = await fixture(html `
58
- <section>
59
- <usa-accordion name="ammendment">
60
- <h4 slot="heading">First Ammendment</h4>
61
- <div class="content">Content for First</div>
62
- </usa-accordion>
63
-
64
- <usa-accordion name="ammendment">
65
- <h4 slot="heading">Second Ammendment</h4>
66
- <div class="content">Content for Second</div>
67
- </usa-accordion>
68
-
69
- <usa-accordion name="ammendment">
70
- <h4 slot="heading">Third Ammendment</h4>
71
- <div class="content">Content for Third</div>
72
- </usa-accordion>
73
- </section>
74
- `);
75
- const headings = el.querySelectorAll("h4");
76
- const content = Array.from(el.querySelectorAll(".content"));
77
- headings[0].click();
78
- assert.deepEqual(content.map((el) => el.checkVisibility()), [true, false, false]);
79
- headings[1].click();
80
- assert.deepEqual(content.map((el) => el.checkVisibility()), [false, true, false]);
81
- headings[2].click();
82
- assert.deepEqual(content.map((el) => el.checkVisibility()), [false, false, true]);
83
- });
84
- it("should not close accordion not in the same group", async () => {
85
- const el = await fixture(html `
86
- <section>
87
- <usa-accordion name="ammendment">
88
- <h4 slot="heading">First Ammendment</h4>
89
- <div class="content">Content for First</div>
90
- </usa-accordion>
91
-
92
- <usa-accordion name="ammendment">
93
- <h4 slot="heading">Second Ammendment</h4>
94
- <div class="content">Content for Second</div>
95
- </usa-accordion>
96
-
97
- <usa-accordion name="different">
98
- <h4 slot="heading">Third Ammendment</h4>
99
- <div class="content">Content for Third</div>
100
- </usa-accordion>
101
- </section>
102
- `);
103
- const headings = el.querySelectorAll("h4");
104
- const content = Array.from(el.querySelectorAll(".content"));
105
- headings[0].click();
106
- assert.deepEqual(content.map((el) => el.checkVisibility()), [true, false, false]);
107
- headings[1].click();
108
- assert.deepEqual(content.map((el) => el.checkVisibility()), [false, true, false]);
109
- headings[2].click();
110
- assert.deepEqual(content.map((el) => el.checkVisibility()), [false, true, true]);
111
- });
112
- });
113
-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AAM,OAAO,CAAC,IAAI,CAAA;;;;;;;;;;;;;;;;;KAiB5B,CAAC,CAAC;QAEH,MAAM,QAAQ,GAAG,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;QAC3C,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,gBAAgB,CAAiB,UAAU,CAAC,CAAC,CAAC;QAE5E,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;QAEpB,MAAM,CAAC,SAAS,CACd,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,eAAe,EAAE,CAAC,EACzC,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,CACrB,CAAC;QAEF,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;QAEpB,MAAM,CAAC,SAAS,CACd,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,eAAe,EAAE,CAAC,EACzC,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,CACrB,CAAC;QAEF,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;QAEpB,MAAM,CAAC,SAAS,CACd,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,eAAe,EAAE,CAAC,EACzC,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,CACpB,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,7 +0,0 @@
1
- import type { USAIcon } from "../icon/icon-types.js";
2
- export declare const USA_ALERT_TYPES: readonly ["info", "warning", "success", "error", "emergency"];
3
- export type USAAlertType = (typeof USA_ALERT_TYPES)[number];
4
- export interface USAAlert {
5
- icon: USAIcon;
6
- }
7
- export declare const USA_ALERT_CONFIG: Record<USAAlertType, USAAlert>;
@@ -1,25 +0,0 @@
1
- export const USA_ALERT_TYPES = [
2
- "info",
3
- "warning",
4
- "success",
5
- "error",
6
- "emergency",
7
- ];
8
- export const USA_ALERT_CONFIG = {
9
- info: {
10
- icon: "info",
11
- },
12
- warning: {
13
- icon: "warning",
14
- },
15
- success: {
16
- icon: "check_circle",
17
- },
18
- error: {
19
- icon: "error",
20
- },
21
- emergency: {
22
- icon: "error",
23
- },
24
- };
25
- //# sourceMappingURL=alert-types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"alert-types.js","sourceRoot":"","sources":["../../../src/lib/alert/alert-types.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,MAAM;IACN,SAAS;IACT,SAAS;IACT,OAAO;IACP,WAAW;CACH,CAAC;AAQX,MAAM,CAAC,MAAM,gBAAgB,GAAmC;IAC9D,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM;KACb;IACD,OAAO,EAAE;QACP,IAAI,EAAE,SAAS;KAChB;IACD,OAAO,EAAE;QACP,IAAI,EAAE,cAAc;KACrB;IACD,KAAK,EAAE;QACL,IAAI,EAAE,OAAO;KACd;IACD,SAAS,EAAE;QACT,IAAI,EAAE,OAAO;KACd;CACF,CAAC"}
@@ -1,11 +0,0 @@
1
- import { type USAAlertType } from "./alert-types.js";
2
- declare global {
3
- interface HTMLElementTagNameMap {
4
- "usa-alert": USAAlertElement;
5
- }
6
- }
7
- export declare class USAAlertElement extends HTMLElement {
8
- #private;
9
- accessor type: USAAlertType;
10
- attributeChangedCallback(): void;
11
- }
@@ -1,122 +0,0 @@
1
- import { __esDecorate, __runInitializers } from "tslib";
2
- import { attr, css, element, html, query } from "@joist/element";
3
- import { USA_ALERT_CONFIG } from "./alert-types.js";
4
- let USAAlertElement = (() => {
5
- let _classDecorators = [element({
6
- tagName: "usa-alert",
7
- shadowDomOpts: {
8
- mode: "open",
9
- delegatesFocus: true,
10
- },
11
- shadowDom: [
12
- css `
13
- :host {
14
- display: block;
15
- border-left: 0.5rem solid #adadad;
16
- padding: 1rem 1.2rem;
17
- color: #1b1b1b;
18
- margin-bottom: 1rem;
19
- }
20
-
21
- :host([type="info"]) {
22
- border-left-color: #00bde3;
23
- background-color: #e7f6f8;
24
- }
25
-
26
- :host([type="warning"]) {
27
- background-color: #faf3d1;
28
- border-left-color: #ffbe2e;
29
- }
30
-
31
- :host([type="success"]) {
32
- background-color: #ecf3ec;
33
- border-left-color: #00a91c;
34
- }
35
-
36
- :host([type="error"]) {
37
- background-color: #f4e3db;
38
- border-left-color: #d54309;
39
- }
40
-
41
- :host([type="emergency"]) {
42
- background-color: #9c3d10;
43
- border-left-color: #9c3d10;
44
- color: #fff;
45
- }
46
-
47
- :host([type="emergency"]) ::slotted(*) {
48
- color: #fff;
49
- }
50
-
51
- .alert-heading {
52
- display: grid;
53
- grid-template-columns: auto 1fr;
54
- align-items: center;
55
- }
56
-
57
- usa-icon {
58
- margin: -0.28rem 0.75rem 0 0;
59
- }
60
-
61
- #heading::slotted(*) {
62
- font-family:
63
- Source Sans Pro Web,
64
- Helvetica Neue,
65
- Helvetica,
66
- Roboto,
67
- Arial,
68
- sans-serif;
69
- font-size: 1.33rem;
70
- line-height: 0.9;
71
- margin-top: 0;
72
- margin-bottom: 0.5rem;
73
- }
74
- `,
75
- html `
76
- <div class="alert-heading">
77
- <usa-icon icon="check_circle"></usa-icon>
78
-
79
- <div>
80
- <slot id="heading" name="heading"></slot>
81
- </div>
82
-
83
- <div class="spacer"></div>
84
-
85
- <div>
86
- <slot></slot>
87
- </div>
88
- </div>
89
- `,
90
- ],
91
- })];
92
- let _classDescriptor;
93
- let _classExtraInitializers = [];
94
- let _classThis;
95
- let _classSuper = HTMLElement;
96
- let _type_decorators;
97
- let _type_initializers = [];
98
- let _type_extraInitializers = [];
99
- var USAAlertElement = class extends _classSuper {
100
- static { _classThis = this; }
101
- static {
102
- const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
103
- _type_decorators = [attr()];
104
- __esDecorate(this, null, _type_decorators, { kind: "accessor", name: "type", static: false, private: false, access: { has: obj => "type" in obj, get: obj => obj.type, set: (obj, value) => { obj.type = value; } }, metadata: _metadata }, _type_initializers, _type_extraInitializers);
105
- __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
106
- USAAlertElement = _classThis = _classDescriptor.value;
107
- if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
108
- __runInitializers(_classThis, _classExtraInitializers);
109
- }
110
- #type_accessor_storage = __runInitializers(this, _type_initializers, "info");
111
- get type() { return this.#type_accessor_storage; }
112
- set type(value) { this.#type_accessor_storage = value; }
113
- #icon = (__runInitializers(this, _type_extraInitializers), query("usa-icon"));
114
- attributeChangedCallback() {
115
- const icon = this.#icon();
116
- icon.icon = USA_ALERT_CONFIG[this.type].icon;
117
- }
118
- };
119
- return USAAlertElement = _classThis;
120
- })();
121
- export { USAAlertElement };
122
- //# sourceMappingURL=alert.element.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"alert.element.js","sourceRoot":"","sources":["../../../src/lib/alert/alert.element.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEjE,OAAO,EAAqB,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;IA+F1D,eAAe;4BAvF3B,OAAO,CAAC;YACP,OAAO,EAAE,WAAW;YACpB,aAAa,EAAE;gBACb,IAAI,EAAE,MAAM;gBACZ,cAAc,EAAE,IAAI;aACrB;YACD,SAAS,EAAE;gBACT,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA8DF;gBACD,IAAI,CAAA;;;;;;;;;;;;;;KAcH;aACF;SACF,CAAC;;;;sBACmC,WAAW;;;;+BAAnB,SAAQ,WAAW;;;;gCAC7C,IAAI,EAAE;YACP,iKAAS,IAAI,6BAAJ,IAAI,mFAAwB;YAFvC,6KAWC;;;YAXY,uDAAe;;QAE1B,qEAA8B,MAAM,EAAC;QAArC,IAAS,IAAI,0CAAwB;QAArC,IAAS,IAAI,gDAAwB;QAErC,KAAK,sDAAG,KAAK,CAAC,UAAU,CAAC,EAAC;QAE1B,wBAAwB;YACtB,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;YAE1B,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC;QAC/C,CAAC;;;;SAVU,eAAe"}
@@ -1,11 +0,0 @@
1
- import type { StoryObj } from "@storybook/web-components";
2
- import type { USAAlertElement } from "./alert.element.js";
3
- declare const meta: {
4
- title: string;
5
- tags: string[];
6
- argTypes: {};
7
- args: {};
8
- };
9
- export default meta;
10
- type Story = StoryObj<USAAlertElement>;
11
- export declare const Primary: Story;
@@ -1,56 +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-alert",
5
- tags: ["autodocs"],
6
- argTypes: {},
7
- args: {},
8
- };
9
- export default meta;
10
- // More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
11
- export const Primary = {
12
- render() {
13
- return html `
14
- <usa-alert type="info">
15
- <h3 slot="heading">Informative status</h3>
16
-
17
- Lorem ipsum dolor sit amet,&nbsp;
18
- <usa-link href="#">consectetur adipiscing</usa-link>&nbsp;elit, sed do
19
- eiusmod.
20
- </usa-alert>
21
-
22
- <usa-alert type="warning">
23
- <h3 slot="heading">Warning status</h3>
24
-
25
- Lorem ipsum dolor sit amet,&nbsp;
26
- <usa-link href="#">consectetur adipiscing</usa-link>&nbsp;elit, sed do
27
- eiusmod.
28
- </usa-alert>
29
-
30
- <usa-alert type="success">
31
- <h3 slot="heading">Success status</h3>
32
-
33
- Lorem ipsum dolor sit amet,&nbsp;
34
- <usa-link href="#">consectetur adipiscing</usa-link>&nbsp;elit, sed do
35
- eiusmod.
36
- </usa-alert>
37
-
38
- <usa-alert type="error">
39
- <h3 slot="heading">Error status</h3>
40
-
41
- Lorem ipsum dolor sit amet,&nbsp;
42
- <usa-link href="#">consectetur adipiscing</usa-link>&nbsp;elit, sed do
43
- eiusmod.
44
- </usa-alert>
45
-
46
- <usa-alert type="emergency">
47
- <h3 slot="heading">Emergency status</h3>
48
-
49
- Lorem ipsum dolor sit amet,&nbsp;
50
- <usa-link href="#">consectetur adipiscing</usa-link>&nbsp;elit, sed do
51
- eiusmod.
52
- </usa-alert>
53
- `;
54
- },
55
- };
56
- //# sourceMappingURL=alert.stories.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"alert.stories.js","sourceRoot":"","sources":["../../../src/lib/alert/alert.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,QAAQ,EAAE,EAAE;IACZ,IAAI,EAAE,EAAE;CACuB,CAAC;AAElC,eAAe,IAAI,CAAC;AAIpB,wFAAwF;AACxF,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,MAAM;QACJ,OAAO,IAAI,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAwCV,CAAC;IACJ,CAAC;CACF,CAAC"}
@@ -1 +0,0 @@
1
- import "./alert.element.js";
@@ -1,20 +0,0 @@
1
- import "./alert.element.js";
2
- import { assert, fixture, html } from "@open-wc/testing";
3
- import { USA_ALERT_TYPES } from "./alert-types.js";
4
- describe("usa-alert", () => {
5
- for (const alert of USA_ALERT_TYPES) {
6
- it(`should be accessible: ${alert}`, async () => {
7
- const form = await fixture(html `
8
- <usa-alert type=${alert}>
9
- <h3 slot="heading">Status</h3>
10
-
11
- Lorem ipsum dolor sit amet,&nbsp;
12
- <usa-link href="#">consectetur adipiscing</usa-link>&nbsp;elit, sed do
13
- eiusmod.
14
- </usa-alert>
15
- `);
16
- return assert.isAccessible(form);
17
- });
18
- }
19
- });
20
- //# sourceMappingURL=alert.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"alert.test.js","sourceRoot":"","sources":["../../../src/lib/alert/alert.test.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,CAAC;AAE5B,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAEzD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnD,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IACzB,KAAK,MAAM,KAAK,IAAI,eAAe,EAAE,CAAC;QACpC,EAAE,CAAC,yBAAyB,KAAK,EAAE,EAAE,KAAK,IAAI,EAAE;YAC9C,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,IAAI,CAAA;0BACX,KAAK;;;;;;;OAOxB,CAAC,CAAC;YAEH,OAAO,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;QACnC,CAAC,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC,CAAC"}
@@ -1,20 +0,0 @@
1
- declare global {
2
- interface HTMLElementTagNameMap {
3
- "usa-button": USAButtonElement;
4
- }
5
- }
6
- export declare const BUTTON_VARIANTS: readonly ["primary", "secondary", "cool", "warm", "outline"];
7
- export type ButtonVariant = (typeof BUTTON_VARIANTS)[number];
8
- export declare class USAButtonElement extends HTMLElement {
9
- #private;
10
- static formAssociated: boolean;
11
- accessor type: "button" | "submit" | "reset";
12
- accessor disabled: boolean;
13
- accessor variant: ButtonVariant;
14
- accessor value: string;
15
- accessor tabIndex: number;
16
- onReady(): void;
17
- onKeyDown(e: KeyboardEvent): void;
18
- onInternalClick(): void;
19
- attributeChangedCallback(): void;
20
- }