@solexllc/usx-react 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (359) hide show
  1. package/README.md +45 -0
  2. package/dist/index.cjs +6017 -0
  3. package/dist/index.js +6015 -0
  4. package/package.json +48 -0
  5. package/src/components/accordion/Accordion.jsx +170 -0
  6. package/src/components/accordion/accordion.django.html +47 -0
  7. package/src/components/accordion/accordion.html +304 -0
  8. package/src/components/accordion/config.json +31 -0
  9. package/src/components/alert/Alert.tsx +88 -0
  10. package/src/components/alert/alert.django.html +45 -0
  11. package/src/components/alert/alert.html +192 -0
  12. package/src/components/alert/config.json +70 -0
  13. package/src/components/attribution/Attribution.tsx +40 -0
  14. package/src/components/attribution/attribution.django.html +21 -0
  15. package/src/components/attribution/attribution.html +26 -0
  16. package/src/components/attribution/config.json +32 -0
  17. package/src/components/avatar/Avatar.tsx +85 -0
  18. package/src/components/avatar/avatar.django.html +27 -0
  19. package/src/components/avatar/avatar.html +101 -0
  20. package/src/components/avatar/config.json +59 -0
  21. package/src/components/avatar-group/AvatarGroup.tsx +43 -0
  22. package/src/components/avatar-group/avatar-group.django.html +8 -0
  23. package/src/components/avatar-group/avatar-group.html +208 -0
  24. package/src/components/avatar-group/config.json +60 -0
  25. package/src/components/back-to-top/BackToTop.tsx +60 -0
  26. package/src/components/back-to-top/back-to-top.django.html +38 -0
  27. package/src/components/back-to-top/back-to-top.html +107 -0
  28. package/src/components/back-to-top/config.json +44 -0
  29. package/src/components/banner/Banner.tsx +111 -0
  30. package/src/components/banner/banner.django.html +80 -0
  31. package/src/components/banner/banner.html +411 -0
  32. package/src/components/banner/config.json +47 -0
  33. package/src/components/block/Block.tsx +78 -0
  34. package/src/components/block/block.django.html +26 -0
  35. package/src/components/block/block.html +162 -0
  36. package/src/components/block/config.json +88 -0
  37. package/src/components/breadcrumb/Breadcrumb.tsx +83 -0
  38. package/src/components/breadcrumb/breadcrumb.django.html +24 -0
  39. package/src/components/breadcrumb/breadcrumb.html +108 -0
  40. package/src/components/breadcrumb/config.json +74 -0
  41. package/src/components/button/Button.tsx +121 -0
  42. package/src/components/button/button.django.html +58 -0
  43. package/src/components/button/button.html +363 -0
  44. package/src/components/button/config.json +103 -0
  45. package/src/components/button-group/ButtonGroup.tsx +33 -0
  46. package/src/components/button-group/button-group.django.html +9 -0
  47. package/src/components/button-group/button-group.html +159 -0
  48. package/src/components/button-group/config.json +25 -0
  49. package/src/components/calendar-date/CalendarDate.tsx +40 -0
  50. package/src/components/calendar-date/calendar-date.django.html +8 -0
  51. package/src/components/calendar-date/calendar-date.html +17 -0
  52. package/src/components/calendar-date/config.json +17 -0
  53. package/src/components/card/Card.tsx +137 -0
  54. package/src/components/card/card.django.html +40 -0
  55. package/src/components/card/card.html +67 -0
  56. package/src/components/card/config.json +115 -0
  57. package/src/components/card-group/CardGroup.tsx +23 -0
  58. package/src/components/card-group/card-group.django.html +6 -0
  59. package/src/components/card-group/card-group.html +164 -0
  60. package/src/components/card-group/config.json +21 -0
  61. package/src/components/carousel/Carousel.tsx +101 -0
  62. package/src/components/carousel/carousel.django.html +41 -0
  63. package/src/components/carousel/carousel.html +64 -0
  64. package/src/components/carousel/config.json +38 -0
  65. package/src/components/character-count/CharacterCount.tsx +77 -0
  66. package/src/components/character-count/character-count.django.html +19 -0
  67. package/src/components/character-count/character-count.html +110 -0
  68. package/src/components/character-count/config.json +78 -0
  69. package/src/components/checkbox/Checkbox.tsx +90 -0
  70. package/src/components/checkbox/checkbox.django.html +16 -0
  71. package/src/components/checkbox/checkbox.html +266 -0
  72. package/src/components/checkbox/config.json +71 -0
  73. package/src/components/checkbox-group/CheckboxGroup.tsx +67 -0
  74. package/src/components/checkbox-group/checkbox-group.django.html +12 -0
  75. package/src/components/checkbox-group/checkbox-group.html +36 -0
  76. package/src/components/checkbox-group/config.json +50 -0
  77. package/src/components/clickable/Clickable.tsx +78 -0
  78. package/src/components/clickable/clickable.django.html +5 -0
  79. package/src/components/clickable/clickable.html +133 -0
  80. package/src/components/clickable/config.json +26 -0
  81. package/src/components/code/Code.tsx +60 -0
  82. package/src/components/code/code.django.html +21 -0
  83. package/src/components/code/code.html +71 -0
  84. package/src/components/code/config.json +40 -0
  85. package/src/components/collection/Collection.tsx +99 -0
  86. package/src/components/collection/collection.django.html +48 -0
  87. package/src/components/collection/collection.html +384 -0
  88. package/src/components/collection/config.json +60 -0
  89. package/src/components/combobox/Combobox.tsx +114 -0
  90. package/src/components/combobox/combobox.django.html +61 -0
  91. package/src/components/combobox/combobox.html +509 -0
  92. package/src/components/combobox/config.json +80 -0
  93. package/src/components/copy-to-clipboard/CopyToClipboard.tsx +48 -0
  94. package/src/components/copy-to-clipboard/config.json +30 -0
  95. package/src/components/copy-to-clipboard/copy-to-clipboard.django.html +16 -0
  96. package/src/components/copy-to-clipboard/copy-to-clipboard.html +68 -0
  97. package/src/components/date-picker/DatePicker.jsx +83 -0
  98. package/src/components/date-picker/config.json +71 -0
  99. package/src/components/date-picker/date-picker.django.html +67 -0
  100. package/src/components/date-picker/date-picker.html +104 -0
  101. package/src/components/date-range-picker/DateRangePicker.jsx +113 -0
  102. package/src/components/date-range-picker/config.json +92 -0
  103. package/src/components/date-range-picker/date-range-picker.django.html +66 -0
  104. package/src/components/date-range-picker/date-range-picker.html +190 -0
  105. package/src/components/error-message/ErrorMessage.tsx +23 -0
  106. package/src/components/error-message/config.json +19 -0
  107. package/src/components/error-message/error-message.django.html +2 -0
  108. package/src/components/error-message/error-message.html +2 -0
  109. package/src/components/eyebrow/Eyebrow.tsx +15 -0
  110. package/src/components/eyebrow/config.json +15 -0
  111. package/src/components/eyebrow/eyebrow.django.html +4 -0
  112. package/src/components/eyebrow/eyebrow.html +4 -0
  113. package/src/components/fieldset/Fieldset.tsx +54 -0
  114. package/src/components/fieldset/config.json +47 -0
  115. package/src/components/fieldset/fieldset.django.html +22 -0
  116. package/src/components/fieldset/fieldset.html +17 -0
  117. package/src/components/file-input/FileInput.jsx +174 -0
  118. package/src/components/file-input/config.json +80 -0
  119. package/src/components/file-input/file-input.django.html +57 -0
  120. package/src/components/file-input/file-input.html +258 -0
  121. package/src/components/file-list/FileList.jsx +105 -0
  122. package/src/components/file-list/config.json +43 -0
  123. package/src/components/file-list/file-list.django.html +30 -0
  124. package/src/components/file-list/file-list.html +61 -0
  125. package/src/components/footer/Footer.tsx +365 -0
  126. package/src/components/footer/config.json +83 -0
  127. package/src/components/footer/footer.django.html +260 -0
  128. package/src/components/footer/footer.html +392 -0
  129. package/src/components/form-group/FormGroup.tsx +26 -0
  130. package/src/components/form-group/config.json +22 -0
  131. package/src/components/form-group/form-group.django.html +4 -0
  132. package/src/components/form-group/form-group.html +17 -0
  133. package/src/components/header/Branding.tsx +101 -0
  134. package/src/components/header/Header.tsx +229 -0
  135. package/src/components/header/HeaderBranding.jsx +4 -0
  136. package/src/components/header/config.json +58 -0
  137. package/src/components/header/header.django.html +194 -0
  138. package/src/components/header/header.html +823 -0
  139. package/src/components/hero/Hero.tsx +64 -0
  140. package/src/components/hero/config.json +70 -0
  141. package/src/components/hero/hero.django.html +22 -0
  142. package/src/components/hero/hero.html +75 -0
  143. package/src/components/hint/Hint.tsx +23 -0
  144. package/src/components/hint/config.json +19 -0
  145. package/src/components/hint/hint.django.html +2 -0
  146. package/src/components/hint/hint.html +2 -0
  147. package/src/components/icon/Icon.tsx +46 -0
  148. package/src/components/icon/config.json +60 -0
  149. package/src/components/icon/icon.django.html +26 -0
  150. package/src/components/icon/icon.html +289 -0
  151. package/src/components/icon/icons_list.json +247 -0
  152. package/src/components/icon-list/IconList.tsx +59 -0
  153. package/src/components/icon-list/config.json +86 -0
  154. package/src/components/icon-list/icon-list.django.html +17 -0
  155. package/src/components/icon-list/icon-list.html +227 -0
  156. package/src/components/identifier/Identifier.tsx +193 -0
  157. package/src/components/identifier/config.json +133 -0
  158. package/src/components/identifier/identifier.django.html +99 -0
  159. package/src/components/identifier/identifier.html +737 -0
  160. package/src/components/image/Image.tsx +106 -0
  161. package/src/components/image/config.json +64 -0
  162. package/src/components/image/image.django.html +62 -0
  163. package/src/components/image/image.html +53 -0
  164. package/src/components/in-page-nav/InPageNav.jsx +76 -0
  165. package/src/components/in-page-nav/config.json +69 -0
  166. package/src/components/in-page-nav/in-page-nav.django.html +28 -0
  167. package/src/components/in-page-nav/in-page-nav.html +183 -0
  168. package/src/components/indicator/Indicator.tsx +32 -0
  169. package/src/components/indicator/README.md +1 -0
  170. package/src/components/indicator/config.json +19 -0
  171. package/src/components/indicator/indicator.django.html +10 -0
  172. package/src/components/indicator/indicator.html +42 -0
  173. package/src/components/input/Input.tsx +85 -0
  174. package/src/components/input/config.json +73 -0
  175. package/src/components/input/input.django.html +55 -0
  176. package/src/components/input/input.html +59 -0
  177. package/src/components/label/Label.tsx +42 -0
  178. package/src/components/label/config.json +39 -0
  179. package/src/components/label/label.django.html +23 -0
  180. package/src/components/label/label.html +23 -0
  181. package/src/components/language-selector/LanguageSelector.jsx +224 -0
  182. package/src/components/language-selector/config.json +107 -0
  183. package/src/components/language-selector/language-selector.django.html +40 -0
  184. package/src/components/language-selector/language-selector.html +85 -0
  185. package/src/components/layout/Layout.tsx +131 -0
  186. package/src/components/layout/config.json +36 -0
  187. package/src/components/layout/layout.django.html +28 -0
  188. package/src/components/layout/layout.html +29 -0
  189. package/src/components/legend/Legend.tsx +34 -0
  190. package/src/components/legend/config.json +27 -0
  191. package/src/components/legend/legend.django.html +11 -0
  192. package/src/components/legend/legend.html +12 -0
  193. package/src/components/link/Link.tsx +45 -0
  194. package/src/components/link/config.json +39 -0
  195. package/src/components/link/link.django.html +8 -0
  196. package/src/components/link/link.html +47 -0
  197. package/src/components/list/List.tsx +82 -0
  198. package/src/components/list/_list-items.django.html +17 -0
  199. package/src/components/list/config.json +25 -0
  200. package/src/components/list/list.django.html +11 -0
  201. package/src/components/list/list.html +26 -0
  202. package/src/components/memorable-date/MemorableDate.jsx +167 -0
  203. package/src/components/memorable-date/config.json +104 -0
  204. package/src/components/memorable-date/memorable-date.django.html +86 -0
  205. package/src/components/memorable-date/memorable-date.html +275 -0
  206. package/src/components/misc-banner/MiscBanner.tsx +112 -0
  207. package/src/components/misc-banner/config.json +57 -0
  208. package/src/components/misc-banner/misc-banner.django.html +63 -0
  209. package/src/components/misc-banner/misc-banner.html +191 -0
  210. package/src/components/modal/Modal.tsx +71 -0
  211. package/src/components/modal/config.json +57 -0
  212. package/src/components/modal/modal.django.html +43 -0
  213. package/src/components/modal/modal.html +222 -0
  214. package/src/components/page/Page.jsx +34 -0
  215. package/src/components/page/config.json +34 -0
  216. package/src/components/page/page.django.html +5 -0
  217. package/src/components/page/page.html +23 -0
  218. package/src/components/pagination/Pagination.tsx +112 -0
  219. package/src/components/pagination/config.json +135 -0
  220. package/src/components/pagination/container/PaginationContainer.tsx +38 -0
  221. package/src/components/pagination/navigation/PaginationNavigation.tsx +219 -0
  222. package/src/components/pagination/navigation/pagination-navigation.django.html +64 -0
  223. package/src/components/pagination/pagination.django.html +48 -0
  224. package/src/components/pagination/pagination.html +613 -0
  225. package/src/components/pagination/step-options/PaginationStepOptions.tsx +43 -0
  226. package/src/components/pagination/step-options/pagination-step-options.django.html +7 -0
  227. package/src/components/pagination/summary/PaginationSummary.tsx +33 -0
  228. package/src/components/pagination/summary/pagination-summary.django.html +12 -0
  229. package/src/components/process-list/ProcessList.tsx +52 -0
  230. package/src/components/process-list/config.json +15 -0
  231. package/src/components/process-list/process-list.django.html +15 -0
  232. package/src/components/process-list/process-list.html +90 -0
  233. package/src/components/prose/Prose.tsx +32 -0
  234. package/src/components/prose/config.json +28 -0
  235. package/src/components/prose/prose.django.html +35 -0
  236. package/src/components/prose/prose.html +91 -0
  237. package/src/components/radio-buttons/RadioButtons.tsx +82 -0
  238. package/src/components/radio-buttons/config.json +57 -0
  239. package/src/components/radio-buttons/radio-buttons.django.html +28 -0
  240. package/src/components/radio-buttons/radio-buttons.html +189 -0
  241. package/src/components/range-slider/RangeSlider.jsx +84 -0
  242. package/src/components/range-slider/config.json +89 -0
  243. package/src/components/range-slider/range-slider.django.html +65 -0
  244. package/src/components/range-slider/range-slider.html +106 -0
  245. package/src/components/required/Required.tsx +25 -0
  246. package/src/components/required/config.json +20 -0
  247. package/src/components/required/required.django.html +2 -0
  248. package/src/components/required/required.html +6 -0
  249. package/src/components/search/Search.tsx +92 -0
  250. package/src/components/search/config.json +69 -0
  251. package/src/components/search/search.django.html +59 -0
  252. package/src/components/search/search.html +76 -0
  253. package/src/components/section/Section.tsx +28 -0
  254. package/src/components/section/config.json +27 -0
  255. package/src/components/section/section.django.html +5 -0
  256. package/src/components/section/section.html +16 -0
  257. package/src/components/select/Select.tsx +107 -0
  258. package/src/components/select/config.json +80 -0
  259. package/src/components/select/select.django.html +64 -0
  260. package/src/components/select/select.html +62 -0
  261. package/src/components/sidenav/SideNav.tsx +74 -0
  262. package/src/components/sidenav/config.json +45 -0
  263. package/src/components/sidenav/sidenav.django.html +29 -0
  264. package/src/components/sidenav/sidenav.html +84 -0
  265. package/src/components/site-alert/SiteAlert.tsx +101 -0
  266. package/src/components/site-alert/config.json +62 -0
  267. package/src/components/site-alert/site-alert.django.html +34 -0
  268. package/src/components/site-alert/site-alert.html +312 -0
  269. package/src/components/skipnav/Skipnav.tsx +41 -0
  270. package/src/components/skipnav/config.json +29 -0
  271. package/src/components/skipnav/skipnav.django.html +11 -0
  272. package/src/components/skipnav/skipnav.html +1 -0
  273. package/src/components/spinner/Spinner.tsx +46 -0
  274. package/src/components/spinner/config.json +44 -0
  275. package/src/components/spinner/spinner.django.html +8 -0
  276. package/src/components/spinner/spinner.html +219 -0
  277. package/src/components/status/Status.tsx +28 -0
  278. package/src/components/status/config.json +47 -0
  279. package/src/components/status/status.django.html +2 -0
  280. package/src/components/status/status.html +31 -0
  281. package/src/components/step-indicator/StepIndicator.tsx +80 -0
  282. package/src/components/step-indicator/config.json +54 -0
  283. package/src/components/step-indicator/step-indicator.django.html +29 -0
  284. package/src/components/step-indicator/step-indicator.html +243 -0
  285. package/src/components/summary-box/SummaryBox.tsx +41 -0
  286. package/src/components/summary-box/config.json +30 -0
  287. package/src/components/summary-box/summary-box.django.html +19 -0
  288. package/src/components/summary-box/summary-box.html +210 -0
  289. package/src/components/swap/Swap.tsx +47 -0
  290. package/src/components/swap/config.json +61 -0
  291. package/src/components/swap/swap.django.html +14 -0
  292. package/src/components/swap/swap.html +163 -0
  293. package/src/components/switch/Switch.tsx +73 -0
  294. package/src/components/switch/config.json +55 -0
  295. package/src/components/switch/switch.django.html +28 -0
  296. package/src/components/switch/switch.html +56 -0
  297. package/src/components/table/Table.tsx +334 -0
  298. package/src/components/table/TableBody.tsx +253 -0
  299. package/src/components/table/TableCell.tsx +37 -0
  300. package/src/components/table/TableContext.tsx +87 -0
  301. package/src/components/table/TableFoot.tsx +68 -0
  302. package/src/components/table/TableGroup.tsx +69 -0
  303. package/src/components/table/TableHead.tsx +139 -0
  304. package/src/components/table/TableRow.tsx +56 -0
  305. package/src/components/table/__pycache__/table_helper.cpython-312.pyc +0 -0
  306. package/src/components/table/config.json +297 -0
  307. package/src/components/table/hooks/useRowDetails.ts +34 -0
  308. package/src/components/table/hooks/useTableGroups.ts +61 -0
  309. package/src/components/table/hooks/useTableSelect.ts +82 -0
  310. package/src/components/table/hooks/useTableSort.ts +60 -0
  311. package/src/components/table/table-body.django.html +68 -0
  312. package/src/components/table/table-detail-row.django.html +14 -0
  313. package/src/components/table/table-foot.django.html +31 -0
  314. package/src/components/table/table-group.django.html +40 -0
  315. package/src/components/table/table-head.django.html +85 -0
  316. package/src/components/table/table-row.django.html +98 -0
  317. package/src/components/table/table.django.html +60 -0
  318. package/src/components/table/table.html +1186 -0
  319. package/src/components/table/table_helper.py +298 -0
  320. package/src/components/table/types.ts +68 -0
  321. package/src/components/tag/Tag.tsx +75 -0
  322. package/src/components/tag/config.json +54 -0
  323. package/src/components/tag/tag.django.html +39 -0
  324. package/src/components/tag/tag.html +45 -0
  325. package/src/components/tag-group/TagGroup.tsx +35 -0
  326. package/src/components/tag-group/config.json +24 -0
  327. package/src/components/tag-group/tag-group.django.html +11 -0
  328. package/src/components/tag-group/tag-group.html +36 -0
  329. package/src/components/task-list/TaskList.tsx +40 -0
  330. package/src/components/task-list/config.json +41 -0
  331. package/src/components/task-list/task-list.django.html +21 -0
  332. package/src/components/task-list/task-list.html +24 -0
  333. package/src/components/text-area/TextArea.tsx +78 -0
  334. package/src/components/text-area/config.json +78 -0
  335. package/src/components/text-area/text-area.django.html +53 -0
  336. package/src/components/text-area/text-area.html +59 -0
  337. package/src/components/theme-picker/ThemePicker.tsx +106 -0
  338. package/src/components/theme-picker/config.json +39 -0
  339. package/src/components/theme-picker/theme-picker.django.html +32 -0
  340. package/src/components/theme-picker/theme-picker.html +67 -0
  341. package/src/components/time-picker/TimePicker.jsx +87 -0
  342. package/src/components/time-picker/config.json +76 -0
  343. package/src/components/time-picker/time-picker.django.html +67 -0
  344. package/src/components/time-picker/time-picker.html +123 -0
  345. package/src/components/toggle/Toggle.tsx +80 -0
  346. package/src/components/toggle/config.json +69 -0
  347. package/src/components/toggle/toggle.django.html +19 -0
  348. package/src/components/toggle/toggle.html +85 -0
  349. package/src/components/tooltip/Tooltip.tsx +33 -0
  350. package/src/components/tooltip/config.json +33 -0
  351. package/src/components/tooltip/tooltip.django.html +5 -0
  352. package/src/components/tooltip/tooltip.html +57 -0
  353. package/src/components/villain/Villain.tsx +47 -0
  354. package/src/components/villain/config.json +44 -0
  355. package/src/components/villain/villain.django.html +19 -0
  356. package/src/components/villain/villain.html +39 -0
  357. package/src/declarations.d.ts +1 -0
  358. package/src/index.js +82 -0
  359. package/src/styles/core.scss +12 -0
@@ -0,0 +1,80 @@
1
+ {
2
+ "name": "file-input",
3
+ "template": "file-input/file-input.django.html",
4
+ "version": 1,
5
+ "default": {
6
+ "id": "file-input-single",
7
+ "name": "file-input-single",
8
+ "label": "Input accepts a single file"
9
+ },
10
+ "props": {
11
+ "id": {
12
+ "type": "string",
13
+ "default": "file-input-single",
14
+ "description": "id for the input. Label and hint ids are derived from this."
15
+ },
16
+ "name": {
17
+ "type": "string",
18
+ "description": "name attribute for the input. Defaults to id."
19
+ },
20
+ "label": {
21
+ "type": "string",
22
+ "description": "Label text for the field."
23
+ },
24
+ "hint": {
25
+ "type": "string",
26
+ "description": "Hint text displayed below the label."
27
+ },
28
+ "fileListHint": {
29
+ "type": "string",
30
+ "default": "Selected files",
31
+ "description": "Heading/hint text shown above the managed file list, passed to FileList's hint prop. React only."
32
+ },
33
+ "error": {
34
+ "type": "string",
35
+ "description": "Error message. Renders aria-describedby and error styling."
36
+ },
37
+ "disabled": {
38
+ "type": "boolean",
39
+ "default": false,
40
+ "description": "Disables the input."
41
+ },
42
+ "required": {
43
+ "type": "boolean",
44
+ "default": false,
45
+ "description": "Marks the field as required."
46
+ },
47
+ "accept": {
48
+ "type": "string",
49
+ "description": "Comma-separated list of accepted file types/extensions, e.g. \".pdf,.txt\"."
50
+ },
51
+ "multiple": {
52
+ "type": "boolean",
53
+ "default": false,
54
+ "description": "Allows selecting more than one file."
55
+ },
56
+ "manageIndividualFiles": {
57
+ "type": "boolean",
58
+ "default": false,
59
+ "description": "When multiple is true, selects files one at a time into a managed list where each file has its own Delete action (VA.gov file-input-multiple pattern). React only."
60
+ },
61
+ "invalidFileTypeMessage": {
62
+ "type": "string",
63
+ "description": "Custom error message shown when a selected file doesn't match `accept`. Sets data-errormessage."
64
+ },
65
+ "formGroup": {
66
+ "type": "boolean",
67
+ "default": true,
68
+ "description": "Whether to wrap the label/hint/error/control in a `.usa-form-group`. Set to `false` when composing inside another form group."
69
+ },
70
+ "className": {
71
+ "type": "string",
72
+ "default": "",
73
+ "description": "Additional classes for the usa-file-input."
74
+ },
75
+ "defaultFiles": {
76
+ "type": "array",
77
+ "description": "When manageIndividualFiles is true, seeds the managed file list with files that already exist on the server (no browser File object). Each entry is { name, size?, url? } — omit size to show no size, provide url to render the name as a download link. React only."
78
+ }
79
+ }
80
+ }
@@ -0,0 +1,57 @@
1
+ {# Django template for FileInput #}
2
+ {% load components %}
3
+ {% with formGroup|default_if_none:True as wrap_group %}
4
+ {% if wrap_group %}
5
+ {% form_group error=error %}
6
+ {% if label %}
7
+ {% label htmlFor=id required=required error=error %}{{ label }}{% endlabel %}
8
+ {% endif %}
9
+
10
+ {% if hint %}
11
+ {% hint id=id|add:"-hint" %}{{ hint }}{% endhint %}
12
+ {% endif %}
13
+
14
+ {% if error %}
15
+ {% error_message id=id|add:"-error" %}{{ error }}{% enderror_message %}
16
+ {% endif %}
17
+
18
+ <input
19
+ class="usa-file-input usx-file-input{% if className %} {{ className }}{% endif %}"
20
+ id="{{ id }}"
21
+ type="file"
22
+ name="{{ name|default:id }}"
23
+ {% if hint or error %} aria-describedby="{% if hint %}{{ id }}-hint{% endif %}{% if hint and error %} {% endif %}{% if error %}{{ id }}-error{% endif %}"{% endif %}
24
+ {% if accept %} accept="{{ accept }}"{% endif %}
25
+ {% if multiple %} multiple{% endif %}
26
+ {% if invalidFileTypeMessage %} data-errormessage="{{ invalidFileTypeMessage }}"{% endif %}
27
+ {% if disabled %} disabled{% endif %}
28
+ {% if required %} required{% endif %}
29
+ />
30
+ {% endform_group %}
31
+ {% else %}
32
+ {% if label %}
33
+ {% label htmlFor=id required=required error=error %}{{ label }}{% endlabel %}
34
+ {% endif %}
35
+
36
+ {% if hint %}
37
+ {% hint id=id|add:"-hint" %}{{ hint }}{% endhint %}
38
+ {% endif %}
39
+
40
+ {% if error %}
41
+ {% error_message id=id|add:"-error" %}{{ error }}{% enderror_message %}
42
+ {% endif %}
43
+
44
+ <input
45
+ class="usa-file-input usx-file-input{% if className %} {{ className }}{% endif %}"
46
+ id="{{ id }}"
47
+ type="file"
48
+ name="{{ name|default:id }}"
49
+ {% if hint or error %} aria-describedby="{% if hint %}{{ id }}-hint{% endif %}{% if hint and error %} {% endif %}{% if error %}{{ id }}-error{% endif %}"{% endif %}
50
+ {% if accept %} accept="{{ accept }}"{% endif %}
51
+ {% if multiple %} multiple{% endif %}
52
+ {% if invalidFileTypeMessage %} data-errormessage="{{ invalidFileTypeMessage }}"{% endif %}
53
+ {% if disabled %} disabled{% endif %}
54
+ {% if required %} required{% endif %}
55
+ />
56
+ {% endif %}
57
+ {% endwith %}
@@ -0,0 +1,258 @@
1
+ <!-- Default -->
2
+ <div class="usa-form-group usx-form-group">
3
+ <label class="usa-label usx-label" for="file-input-single">Input accepts a single file</label>
4
+ <input class="usa-file-input usx-file-input" id="file-input-single" type="file" name="file-input-single" />
5
+ </div>
6
+
7
+ <!-- AcceptSpecificTypes -->
8
+ <div class="usa-form-group usx-form-group">
9
+ <label class="usa-label usx-label" for="file-input-specific">Input accepts only specific file types</label>
10
+ <span class="usa-hint usx-hint" id="file-input-specific-hint">Select PDF or TXT files</span>
11
+ <input
12
+ class="usa-file-input usx-file-input"
13
+ id="file-input-specific"
14
+ type="file"
15
+ name="file-input-specific"
16
+ aria-describedby="file-input-specific-hint"
17
+ accept=".pdf,.txt"
18
+ data-errormessage="Only PDF or TXT files are accepted."
19
+ />
20
+ </div>
21
+
22
+ <!-- AcceptImages -->
23
+ <div class="usa-form-group usx-form-group">
24
+ <label class="usa-label usx-label" for="file-input-images">Input accepts any kind of image</label>
25
+ <span class="usa-hint usx-hint" id="file-input-images-hint">Select any type of image format</span>
26
+ <input
27
+ class="usa-file-input usx-file-input"
28
+ id="file-input-images"
29
+ type="file"
30
+ name="file-input-images"
31
+ aria-describedby="file-input-images-hint"
32
+ accept="image/*"
33
+ />
34
+ </div>
35
+
36
+ <!-- Multiple -->
37
+ <div class="usa-form-group usx-form-group">
38
+ <label class="usa-label usx-label" for="file-input-multiple">Input accepts multiple files</label>
39
+ <span class="usa-hint usx-hint" id="file-input-multiple-hint">Select one or more files</span>
40
+ <input
41
+ class="usa-file-input usx-file-input"
42
+ id="file-input-multiple"
43
+ type="file"
44
+ name="file-input-multiple"
45
+ aria-describedby="file-input-multiple-hint"
46
+ multiple
47
+ />
48
+ </div>
49
+
50
+ <!-- WithError -->
51
+ <div class="usa-form-group usx-form-group usa-form-group--error">
52
+ <label class="usa-label usx-label usa-label--error" for="file-input-error">Input has an error</label>
53
+ <span class="usa-hint usx-hint" id="file-input-error-hint">Select any valid file</span>
54
+ <span class="usa-error-message usx-error-message" id="file-input-error-error" role="alert">Display a helpful error message</span>
55
+ <input
56
+ class="usa-file-input usx-file-input"
57
+ id="file-input-error"
58
+ type="file"
59
+ name="file-input-error"
60
+ aria-describedby="file-input-error-hint file-input-error-error"
61
+ />
62
+ </div>
63
+
64
+ <!-- Disabled -->
65
+ <div class="usa-form-group usx-form-group">
66
+ <label class="usa-label usx-label" for="file-input-disabled">Disabled input</label>
67
+ <input class="usa-file-input usx-file-input" id="file-input-disabled" type="file" name="file-input-disabled" disabled />
68
+ </div>
69
+
70
+ <!-- ManagedMultiple (static snapshot; interactive Delete requires React) -->
71
+ <div class="usa-form-group usx-form-group">
72
+ <label class="usa-label usx-label" for="file-input-managed">Upload supporting documents</label>
73
+ <span class="usa-hint usx-hint" id="file-input-managed-hint">Select one or more files</span>
74
+ <div class="usx-file-input__add-only">
75
+ <input
76
+ class="usa-file-input usx-file-input"
77
+ id="file-input-managed"
78
+ type="file"
79
+ name="file-input-managed"
80
+ aria-describedby="file-input-managed-hint"
81
+ multiple
82
+ />
83
+ </div>
84
+ <div class="usx-file-input__list margin-top-1">
85
+ <span class="usa-hint usx-hint usx-file-input__list-heading">Selected files</span>
86
+ <ul class="usx-file-input__file-list">
87
+ <li class="usx-file-input__file-item">
88
+ <div class="usx-file-input__file-info">
89
+ <span class="usx-file-input__file-name">test1.jpg</span>
90
+ <span class="usx-file-input__file-size">JPG, 7 KB</span>
91
+ </div>
92
+ <button type="button" class="usa-button usx-button usa-button--secondary usx-file-input__delete-button">
93
+ <svg class="usa-icon usx-file-input__delete-icon" aria-hidden="true" focusable="false" role="img">
94
+ <use href="./img/sprite.svg#delete"></use>
95
+ </svg>
96
+ <span class="usx-file-input__delete-label">Delete</span>
97
+ </button>
98
+ </li>
99
+ <li class="usx-file-input__file-item">
100
+ <div class="usx-file-input__file-info">
101
+ <span class="usx-file-input__file-name">test2.jpg</span>
102
+ <span class="usx-file-input__file-size">JPG, 7 KB</span>
103
+ </div>
104
+ <button type="button" class="usa-button usx-button usa-button--secondary usx-file-input__delete-button">
105
+ <svg class="usa-icon usx-file-input__delete-icon" aria-hidden="true" focusable="false" role="img">
106
+ <use href="./img/sprite.svg#delete"></use>
107
+ </svg>
108
+ <span class="usx-file-input__delete-label">Delete</span>
109
+ </button>
110
+ </li>
111
+ </ul>
112
+ </div>
113
+ </div>
114
+
115
+ <!-- PreloadedDownloadable (static snapshot; interactive Delete requires React) -->
116
+ <div class="usa-form-group usx-form-group">
117
+ <label class="usa-label usx-label" for="file-input-preloaded-downloadable">Supporting documents</label>
118
+ <span class="usa-hint usx-hint" id="file-input-preloaded-downloadable-hint">Select one or more files</span>
119
+ <div class="usx-file-input__add-only">
120
+ <input
121
+ class="usa-file-input usx-file-input"
122
+ id="file-input-preloaded-downloadable"
123
+ type="file"
124
+ name="file-input-preloaded-downloadable"
125
+ aria-describedby="file-input-preloaded-downloadable-hint"
126
+ multiple
127
+ />
128
+ </div>
129
+ <div class="usx-file-input__list margin-top-1">
130
+ <span class="usa-hint usx-hint usx-file-input__list-heading">Selected files</span>
131
+ <ul class="usx-file-input__file-list">
132
+ <li class="usx-file-input__file-item">
133
+ <div class="usx-file-input__file-info">
134
+ <a class="usa-link usx-link usa-link--external usx-file-input__file-name" rel="noreferrer noopener" target="_blank" href="#">w2-2023.pdf</a>
135
+ <span class="usx-file-input__file-size">PDF, 240 KB</span>
136
+ </div>
137
+ <button type="button" class="usa-button usx-button usa-button--secondary usx-file-input__delete-button">
138
+ <svg class="usa-icon usx-file-input__delete-icon" aria-hidden="true" focusable="false" role="img">
139
+ <use href="./img/sprite.svg#delete"></use>
140
+ </svg>
141
+ <span class="usx-file-input__delete-label">Delete</span>
142
+ </button>
143
+ </li>
144
+ </ul>
145
+ </div>
146
+ </div>
147
+
148
+ <!-- PreloadedDisabled (static snapshot; fully locked, read-only record of already-submitted files) -->
149
+ <div class="usa-form-group usx-form-group">
150
+ <label class="usa-label usx-label" for="file-input-preloaded-disabled">Supporting documents</label>
151
+ <span class="usa-hint usx-hint" id="file-input-preloaded-disabled-hint">These files were submitted with your application</span>
152
+ <div class="usx-file-input__add-only">
153
+ <input
154
+ class="usa-file-input usx-file-input"
155
+ id="file-input-preloaded-disabled"
156
+ type="file"
157
+ name="file-input-preloaded-disabled"
158
+ aria-describedby="file-input-preloaded-disabled-hint"
159
+ multiple
160
+ disabled
161
+ />
162
+ </div>
163
+ <div class="usx-file-input__list margin-top-1">
164
+ <span class="usa-hint usx-hint usx-file-input__list-heading">Selected files</span>
165
+ <ul class="usx-file-input__file-list">
166
+ <li class="usx-file-input__file-item">
167
+ <div class="usx-file-input__file-info">
168
+ <a class="usa-link usx-link usa-link--external usx-file-input__file-name" rel="noreferrer noopener" target="_blank" href="#">w2-2023.pdf</a>
169
+ <span class="usx-file-input__file-size">PDF, 240 KB</span>
170
+ </div>
171
+ <button type="button" class="usa-button usx-button usa-button--secondary usx-file-input__delete-button" disabled>
172
+ <svg class="usa-icon usx-file-input__delete-icon" aria-hidden="true" focusable="false" role="img">
173
+ <use href="./img/sprite.svg#delete"></use>
174
+ </svg>
175
+ <span class="usx-file-input__delete-label">Delete</span>
176
+ </button>
177
+ </li>
178
+ </ul>
179
+ </div>
180
+ </div>
181
+
182
+ <!-- PreloadedNameOnly (static snapshot; a filename with no size or download link) -->
183
+ <div class="usa-form-group usx-form-group">
184
+ <label class="usa-label usx-label" for="file-input-preloaded-name-only">Supporting documents</label>
185
+ <span class="usa-hint usx-hint" id="file-input-preloaded-name-only-hint">Select one or more files</span>
186
+ <div class="usx-file-input__add-only">
187
+ <input
188
+ class="usa-file-input usx-file-input"
189
+ id="file-input-preloaded-name-only"
190
+ type="file"
191
+ name="file-input-preloaded-name-only"
192
+ aria-describedby="file-input-preloaded-name-only-hint"
193
+ multiple
194
+ />
195
+ </div>
196
+ <div class="usx-file-input__list margin-top-1">
197
+ <span class="usa-hint usx-hint usx-file-input__list-heading">Selected files</span>
198
+ <ul class="usx-file-input__file-list">
199
+ <li class="usx-file-input__file-item">
200
+ <div class="usx-file-input__file-info">
201
+ <span class="usx-file-input__file-name">government-id.jpg</span>
202
+ </div>
203
+ <button type="button" class="usa-button usx-button usa-button--secondary usx-file-input__delete-button">
204
+ <svg class="usa-icon usx-file-input__delete-icon" aria-hidden="true" focusable="false" role="img">
205
+ <use href="./img/sprite.svg#delete"></use>
206
+ </svg>
207
+ <span class="usx-file-input__delete-label">Delete</span>
208
+ </button>
209
+ </li>
210
+ </ul>
211
+ </div>
212
+ </div>
213
+
214
+ <!-- LongFileName (static snapshot; long filenames should wrap, not overflow, and never push the Delete button out of view — check on both desktop and mobile) -->
215
+ <div class="usa-form-group usx-form-group">
216
+ <label class="usa-label usx-label" for="file-input-long-file-name">Upload supporting documents</label>
217
+ <span class="usa-hint usx-hint" id="file-input-long-file-name-hint">Select one or more files</span>
218
+ <div class="usx-file-input__add-only">
219
+ <input
220
+ class="usa-file-input usx-file-input"
221
+ id="file-input-long-file-name"
222
+ type="file"
223
+ name="file-input-long-file-name"
224
+ aria-describedby="file-input-long-file-name-hint"
225
+ multiple
226
+ />
227
+ </div>
228
+ <div class="usx-file-input__list margin-top-1">
229
+ <span class="usa-hint usx-hint usx-file-input__list-heading">Selected files</span>
230
+ <ul class="usx-file-input__file-list">
231
+ <li class="usx-file-input__file-item">
232
+ <div class="usx-file-input__file-info">
233
+ <span class="usx-file-input__file-name">this-is-an-unusually-long-supporting-document-filename-used-to-verify-wrapping-behavior.pdf</span>
234
+ <span class="usx-file-input__file-size">PDF, 1.8 MB</span>
235
+ </div>
236
+ <button type="button" class="usa-button usx-button usa-button--secondary usx-file-input__delete-button">
237
+ <svg class="usa-icon usx-file-input__delete-icon" aria-hidden="true" focusable="false" role="img">
238
+ <use href="./img/sprite.svg#delete"></use>
239
+ </svg>
240
+ <span class="usx-file-input__delete-label">Delete</span>
241
+ </button>
242
+ </li>
243
+ <li class="usx-file-input__file-item">
244
+ <div class="usx-file-input__file-info">
245
+ <a class="usa-link usx-link usa-link--external usx-file-input__file-name" rel="noreferrer noopener" target="_blank" href="#">another-extremely-long-filename-for-a-downloadable-preloaded-file-to-check-the-download-icon-and-link-wrapping.pdf</a>
246
+ <span class="usx-file-input__file-size">PDF, 500 KB</span>
247
+ </div>
248
+ <button type="button" class="usa-button usx-button usa-button--secondary usx-file-input__delete-button">
249
+ <svg class="usa-icon usx-file-input__delete-icon" aria-hidden="true" focusable="false" role="img">
250
+ <use href="./img/sprite.svg#delete"></use>
251
+ </svg>
252
+ <span class="usx-file-input__delete-label">Delete</span>
253
+ </button>
254
+ </li>
255
+ </ul>
256
+ </div>
257
+ </div>
258
+
@@ -0,0 +1,105 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import Icon from '../icon/Icon';
4
+ import Link from '../link/Link';
5
+ import Button from '../button/Button';
6
+
7
+ // Matches VA.gov's "X KB"/"X MB" display for selected-file rows.
8
+ function formatFileSize(bytes) {
9
+ if (bytes < 1024) return `${bytes} B`;
10
+ const kb = bytes / 1024;
11
+ if (kb < 1024) return `${Math.round(kb)} KB`;
12
+ return `${(kb / 1024).toFixed(1)} MB`;
13
+ }
14
+
15
+ // e.g. "report.pdf" -> "PDF" — shown alongside the size, VA.gov-style.
16
+ function getFileExtension(name) {
17
+ const match = /\.([^.]+)$/.exec(name);
18
+ return match ? match[1].toUpperCase() : null;
19
+ }
20
+
21
+ // A row's display name/size can come from a real File (just added/changed in
22
+ // this session) or from a preloaded entry describing a file already on the
23
+ // server (no File object available) — normalize both shapes for rendering.
24
+ function getEntryDisplay(entry) {
25
+ if (entry.file) return { name: entry.file.name, size: entry.file.size, url: entry.url };
26
+ return { name: entry.name, size: entry.size, url: entry.url };
27
+ }
28
+
29
+ // A standalone list of files with a per-row Delete action — used by
30
+ // FileInput's managed-multiple mode (see FileInput.jsx), but reusable
31
+ // anywhere a parent already owns the file array.
32
+ export default function FileList({ files, hint = 'Selected files', onRemove = null, disabled = false, className = '' }) {
33
+ if (!files || files.length === 0) return null;
34
+
35
+ const lastEntry = getEntryDisplay(files[files.length - 1]);
36
+
37
+ return (
38
+ <div className={['usx-file-input__list', 'margin-top-1', className].filter(Boolean).join(' ')}>
39
+ <span className="usa-sr-only" aria-live="polite">
40
+ {`You have selected the file: ${lastEntry.name}.`}
41
+ </span>
42
+ {hint && <span className="usa-hint usx-hint usx-file-input__list-heading">{hint}</span>}
43
+ <ul className="usx-file-input__file-list">
44
+ {files.map((entry) => {
45
+ const { name, size, url } = getEntryDisplay(entry);
46
+ // A row's own onRemove takes priority over the component-level
47
+ // one — lets most rows share a single handler while specific
48
+ // rows (e.g. a preloaded file needing a server-side call) opt
49
+ // into their own.
50
+ const handleRemove = entry.onRemove || onRemove;
51
+ return (
52
+ <li key={entry.key} className="usx-file-input__file-item">
53
+ <div className="usx-file-input__file-info">
54
+ {url ? (
55
+ <Link href={url} external className="usx-file-input__file-name">
56
+ {name}
57
+ </Link>
58
+ ) : (
59
+ <span className="usx-file-input__file-name">{name}</span>
60
+ )}
61
+ {size != null && (
62
+ <span className="usx-file-input__file-size">
63
+ {[getFileExtension(name), formatFileSize(size)].filter(Boolean).join(', ')}
64
+ </span>
65
+ )}
66
+ </div>
67
+ {!disabled && handleRemove ? (
68
+ <Button
69
+ type="button"
70
+ variant="secondary"
71
+ className="usx-file-input__delete-button"
72
+ tooltip="Delete this file"
73
+ ghost={true}
74
+ disabled={disabled}
75
+ onClick={() => handleRemove(entry)}
76
+ >
77
+ <Icon name="delete" size={3} className="usx-file-input__delete-icon" />
78
+ {/* Visually hidden below the tablet breakpoint so the button becomes icon-only, see _file-input.scss */}
79
+ <span className="usx-file-input__delete-label">Delete</span>
80
+ </Button>
81
+ ) : null}
82
+ </li>
83
+ );
84
+ })}
85
+ </ul>
86
+ </div>
87
+ );
88
+ }
89
+
90
+ FileList.propTypes = {
91
+ files: PropTypes.arrayOf(
92
+ PropTypes.shape({
93
+ key: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
94
+ file: PropTypes.object,
95
+ name: PropTypes.string,
96
+ size: PropTypes.number,
97
+ url: PropTypes.string,
98
+ onRemove: PropTypes.func,
99
+ }),
100
+ ),
101
+ hint: PropTypes.node,
102
+ onRemove: PropTypes.func,
103
+ disabled: PropTypes.bool,
104
+ className: PropTypes.string,
105
+ };
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "file-list",
3
+ "template": "file-list/file-list.django.html",
4
+ "version": 1,
5
+ "default": {
6
+ "files": [
7
+ {
8
+ "key": 1,
9
+ "name": "test1.jpg",
10
+ "size": 7000
11
+ },
12
+ {
13
+ "key": 2,
14
+ "name": "test2.jpg",
15
+ "size": 7200
16
+ }
17
+ ]
18
+ },
19
+ "props": {
20
+ "files": {
21
+ "type": "array",
22
+ "description": "Files to render as rows. Each entry is { key, file?, name?, size?, url?, onRemove? } — key uniquely identifies the row; file is a browser File (name/size read from it); name/size describe entries with no File object (e.g. files already on the server); url renders the name as a download link; onRemove overrides the onRemove prop for just this row. React only."
23
+ },
24
+ "hint": {
25
+ "type": "string",
26
+ "default": "Selected files",
27
+ "description": "Heading/hint text shown above the file list."
28
+ },
29
+ "onRemove": {
30
+ "type": "function",
31
+ "description": "Called with the removed entry when its Delete button is clicked. Applies to every row unless that row provides its own onRemove, which takes priority. Omit both to hide every Delete button. React only."
32
+ },
33
+ "disabled": {
34
+ "type": "boolean",
35
+ "default": false,
36
+ "description": "Hides every row's Delete button."
37
+ },
38
+ "className": {
39
+ "type": "string",
40
+ "description": "Additional classes for the outer wrapper."
41
+ }
42
+ }
43
+ }
@@ -0,0 +1,30 @@
1
+ {# Django template for FileList (static preview — Delete buttons aren't wired up; the interactive managed list lives in FileInput's React mode) #}
2
+ {% load components %}
3
+
4
+ <div class="usx-file-input__list margin-top-1{% if className %} {{ className }}{% endif %}">
5
+ {% if hint %}
6
+ <span class="usa-hint usx-hint usx-file-input__list-heading">{{ hint }}</span>
7
+ {% endif %}
8
+ <ul class="usx-file-input__file-list">
9
+ {% for file in files %}
10
+ <li class="usx-file-input__file-item">
11
+ <div class="usx-file-input__file-info">
12
+ {% if file.url %}
13
+ <a class="usa-link usx-link usa-link--external usx-file-input__file-name" rel="noreferrer noopener" target="_blank" href="{{ file.url }}">{{ file.name }}</a>
14
+ {% else %}
15
+ <span class="usx-file-input__file-name">{{ file.name }}</span>
16
+ {% endif %}
17
+ {% if file.size %}
18
+ <span class="usx-file-input__file-size">{% with ext=file.name|file_extension %}{% if ext %}{{ ext }}, {% endif %}{% endwith %}{{ file.size }}</span>
19
+ {% endif %}
20
+ </div>
21
+ {% if not disabled %}
22
+ <button type="button" class="usa-button usx-button usa-button--secondary usx-file-input__delete-button">
23
+ {% icon name='delete' size=3 className='usx-file-input__delete-icon' %}{% endicon %}
24
+ <span class="usx-file-input__delete-label">Delete</span>
25
+ </button>
26
+ {% endif %}
27
+ </li>
28
+ {% endfor %}
29
+ </ul>
30
+ </div>
@@ -0,0 +1,61 @@
1
+ <!-- Default (static snapshot; interactive Delete requires React) -->
2
+ <div class="usx-file-input__list margin-top-1">
3
+ <span class="usa-hint usx-hint usx-file-input__list-heading">Selected files</span>
4
+ <ul class="usx-file-input__file-list">
5
+ <li class="usx-file-input__file-item">
6
+ <div class="usx-file-input__file-info">
7
+ <span class="usx-file-input__file-name">test1.jpg</span>
8
+ <span class="usx-file-input__file-size">JPG, 7 KB</span>
9
+ </div>
10
+ <button type="button" class="usa-button usx-button usa-button--secondary usx-file-input__delete-button">
11
+ <svg class="usa-icon usx-file-input__delete-icon" aria-hidden="true" focusable="false" role="img">
12
+ <use href="./img/sprite.svg#delete"></use>
13
+ </svg>
14
+ <span class="usx-file-input__delete-label">Delete</span>
15
+ </button>
16
+ </li>
17
+ <li class="usx-file-input__file-item">
18
+ <div class="usx-file-input__file-info">
19
+ <span class="usx-file-input__file-name">test2.jpg</span>
20
+ <span class="usx-file-input__file-size">JPG, 7 KB</span>
21
+ </div>
22
+ <button type="button" class="usa-button usx-button usa-button--secondary usx-file-input__delete-button">
23
+ <svg class="usa-icon usx-file-input__delete-icon" aria-hidden="true" focusable="false" role="img">
24
+ <use href="./img/sprite.svg#delete"></use>
25
+ </svg>
26
+ <span class="usx-file-input__delete-label">Delete</span>
27
+ </button>
28
+ </li>
29
+ </ul>
30
+ </div>
31
+
32
+ <!-- WithDownload -->
33
+ <div class="usx-file-input__list margin-top-1">
34
+ <span class="usa-hint usx-hint usx-file-input__list-heading">Selected files</span>
35
+ <ul class="usx-file-input__file-list">
36
+ <li class="usx-file-input__file-item">
37
+ <div class="usx-file-input__file-info">
38
+ <a class="usa-link usx-link usa-link--external usx-file-input__file-name" rel="noreferrer noopener" target="_blank" href="w2-2023.pdf">w2-2023.pdf</a>
39
+ <span class="usx-file-input__file-size">PDF, 240 KB</span>
40
+ </div>
41
+ <button type="button" class="usa-button usx-button usa-button--secondary usx-file-input__delete-button">
42
+ <svg class="usa-icon usx-file-input__delete-icon" aria-hidden="true" focusable="false" role="img">
43
+ <use href="./img/sprite.svg#delete"></use>
44
+ </svg>
45
+ <span class="usx-file-input__delete-label">Delete</span>
46
+ </button>
47
+ </li>
48
+ </ul>
49
+ </div>
50
+
51
+ <!-- Disabled -->
52
+ <div class="usx-file-input__list margin-top-1">
53
+ <span class="usa-hint usx-hint usx-file-input__list-heading">Selected files</span>
54
+ <ul class="usx-file-input__file-list">
55
+ <li class="usx-file-input__file-item">
56
+ <div class="usx-file-input__file-info">
57
+ <span class="usx-file-input__file-name">government-id.jpg</span>
58
+ </div>
59
+ </li>
60
+ </ul>
61
+ </div>