@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,50 @@
1
+ {
2
+ "name": "checkbox-group",
3
+ "template": "checkbox-group/checkbox-group.django.html",
4
+ "version": 1,
5
+ "props": {
6
+ "id": {
7
+ "type": "string",
8
+ "description": "Base ID for the checkbox group. Each checkbox's ID will be this base plus the option's value or index."
9
+ },
10
+ "tile": {
11
+ "type": "boolean",
12
+ "description": "Render each checkbox as a tile when true",
13
+ "default": false
14
+ },
15
+ "small": {
16
+ "type": "boolean",
17
+ "description": "Render compact/small checkboxes when true",
18
+ "default": false
19
+ },
20
+ "legend": {
21
+ "type": "string",
22
+ "description": "Legend text for the fieldset"
23
+ },
24
+ "required": {
25
+ "type": "boolean",
26
+ "description": "Whether the fieldset is required",
27
+ "default": false
28
+ },
29
+ "hint": {
30
+ "type": "string",
31
+ "description": "Group-level hint text, rendered after the legend"
32
+ },
33
+ "error": {
34
+ "type": "string",
35
+ "description": "Group-level error message, rendered after the hint"
36
+ },
37
+ "name": {
38
+ "type": "string",
39
+ "description": "Name attribute shared by the checkbox inputs"
40
+ },
41
+ "options": {
42
+ "type": "array",
43
+ "description": "Array of option objects: {id, value, label, description, checked, disabled}"
44
+ },
45
+ "className": {
46
+ "type": "string",
47
+ "description": "Additional classes to apply to the wrapper"
48
+ }
49
+ }
50
+ }
@@ -0,0 +1,78 @@
1
+ import React, { ElementType, AnchorHTMLAttributes, ButtonHTMLAttributes, ReactNode } from 'react';
2
+ import classNames from 'classnames';
3
+
4
+ // ── Sub-component helpers ────────────────────────────────────────────────────
5
+
6
+ interface SubProps {
7
+ children?: ReactNode;
8
+ className?: string;
9
+ as?: ElementType;
10
+ [key: string]: unknown;
11
+ }
12
+
13
+ function ClickableLink({
14
+ children,
15
+ className,
16
+ as: Tag = 'span',
17
+ colorChange = false,
18
+ bgColorChange = false,
19
+ ...rest
20
+ }: SubProps & { colorChange?: boolean; bgColorChange?: boolean }) {
21
+ const classes = classNames(
22
+ 'usx-clickable__link',
23
+ colorChange && 'usx-clickable__color-on-hover',
24
+ bgColorChange && 'usx-clickable__bg-color-on-hover',
25
+ className,
26
+ );
27
+ return <Tag className={classes} {...rest}>{children}</Tag>;
28
+ }
29
+
30
+ function ClickableColorChange({ children, className, as: Tag = 'span', ...rest }: SubProps) {
31
+ return (
32
+ <Tag className={classNames('usx-clickable__color-on-hover', className)} {...rest}>
33
+ {children}
34
+ </Tag>
35
+ );
36
+ }
37
+
38
+ function ClickableBgColorChange({ children, className, as: Tag = 'span', ...rest }: SubProps) {
39
+ return (
40
+ <Tag className={classNames('usx-clickable__bg-color-on-hover', className)} {...rest}>
41
+ {children}
42
+ </Tag>
43
+ );
44
+ }
45
+
46
+ // ── Root component ───────────────────────────────────────────────────────────
47
+
48
+ type AnchorProps = { href: string } & AnchorHTMLAttributes<HTMLAnchorElement>;
49
+ type ButtonProps = { href?: undefined } & ButtonHTMLAttributes<HTMLButtonElement>;
50
+
51
+ export type ClickableProps = (AnchorProps | ButtonProps) & {
52
+ className?: string;
53
+ children?: ReactNode;
54
+ };
55
+
56
+ function Clickable({ className, children, ...rest }: ClickableProps) {
57
+ const classes = classNames('usx-clickable', className);
58
+
59
+ if ('href' in rest && rest.href !== undefined) {
60
+ return (
61
+ <a className={classes} {...(rest as AnchorHTMLAttributes<HTMLAnchorElement>)}>
62
+ {children}
63
+ </a>
64
+ );
65
+ }
66
+
67
+ return (
68
+ <button type="button" className={classes} {...(rest as ButtonHTMLAttributes<HTMLButtonElement>)}>
69
+ {children}
70
+ </button>
71
+ );
72
+ }
73
+
74
+ Clickable.Link = ClickableLink;
75
+ Clickable.ColorChange = ClickableColorChange;
76
+ Clickable.BgColorChange = ClickableBgColorChange;
77
+
78
+ export default Clickable;
@@ -0,0 +1,5 @@
1
+ <a
2
+ class="usx-clickable{% if className %} {{ className }}{% endif %}"
3
+ href="{{ href }}"
4
+ {% if id %}id="{{ id }}"{% endif %}
5
+ >{{ children|safe }}</a>
@@ -0,0 +1,133 @@
1
+ <h3 class="site-preview-heading">Single Clickable</h3>
2
+ <a class="usx-clickable display-flex flex-column padding-2 border" href="https://google.com">
3
+ Everything taking up space in this box is clickable, but only the text below
4
+ appears as a link.<br />
5
+ <span class="usx-clickable__link">I look clickable</span>
6
+ </a>
7
+
8
+ <h3 class="site-preview-heading margin-top-5">Multiple Clickables</h3>
9
+ <div class="grid-row grid-gap-6 bg-base-lighter padding-2">
10
+ <div class="grid-col-12 display-flex flex-justify-center tablet:grid-col-4">
11
+ <a class="usx-clickable display-flex padding-1 flex-column flex-align-center" href="https://google.com">
12
+ <div class="font-heading-2xl text-secondary" style="text-align: center;">
13
+ #1
14
+ </div>
15
+ <span class="usx-clickable__link">Choose this door</span>
16
+ </a>
17
+ </div>
18
+ <div class="grid-col-12 display-flex flex-justify-center tablet:grid-col-4">
19
+ <a class="usx-clickable display-flex padding-1 flex-column flex-align-center" href="https://google.com">
20
+ <div class="font-heading-2xl text-secondary" style="text-align: center;">
21
+ #2
22
+ </div>
23
+ <span class="usx-clickable__link">Choose this door</span>
24
+ </a>
25
+ </div>
26
+ <div class="grid-col-12 display-flex flex-justify-center tablet:grid-col-4">
27
+ <a class="usx-clickable display-flex padding-1 flex-column flex-align-center" href="https://google.com">
28
+ <div class="font-heading-2xl text-secondary" style="text-align: center;">
29
+ #3
30
+ </div>
31
+ <span class="usx-clickable__link">Choose this door</span>
32
+ </a>
33
+ </div>
34
+ </div>
35
+
36
+ <h3 class="site-preview-heading margin-top-5">With Color Change</h3>
37
+ <div class="grid-row grid-gap-6 bg-base-lighter padding-2">
38
+ <div class="grid-col-12 display-flex flex-justify-center tablet:grid-col-4">
39
+ <a class="usx-clickable display-flex flex-align-center" href="https://google.com">
40
+ <svg class="usa-icon usa-icon--size-3 usx-clickable__color-on-hover" aria-hidden="true" focusable="false" role="img">
41
+ <use href="./img/sprite.svg#tornado"></use>
42
+ </svg>
43
+ <span class="margin-left-1 usx-clickable__link">Auntie Em!</span>
44
+ </a>
45
+ </div>
46
+ <div class="grid-col-12 display-flex flex-justify-center margin-top-2 tablet:margin-top-0 tablet:grid-col-4">
47
+ <a class="usx-clickable display-flex flex-align-center" href="https://google.com">
48
+ <svg class="usa-icon usa-icon--size-3 usx-clickable__color-on-hover" aria-hidden="true" focusable="false" role="img">
49
+ <use href="./img/sprite.svg#my_location"></use>
50
+ </svg>
51
+ <span class="margin-left-1 usx-clickable__link">We're not in Kansas anymore</span>
52
+ </a>
53
+ </div>
54
+ <div class="grid-col-12 display-flex flex-justify-center margin-top-2 tablet:margin-top-0 tablet:grid-col-4">
55
+ <a class="usx-clickable display-flex flex-align-center" href="https://google.com">
56
+ <svg class="usa-icon usa-icon--size-3 usx-clickable__color-on-hover" aria-hidden="true" focusable="false" role="img">
57
+ <use href="./img/sprite.svg#pets"></use>
58
+ </svg>
59
+ <span class="margin-left-1 usx-clickable__link">Oh, Todo!</span>
60
+ </a>
61
+ </div>
62
+ </div>
63
+
64
+
65
+ <h3 class="site-preview-heading margin-top-5">Read John's Story</h3>
66
+ <div class="usx-block usx-block--callout usx-border-primary">
67
+ <div class="usx-block__content usx-border-info maxw-tablet margin-0">
68
+ <p class="font-serif-lg maxw-tablet margin-0">
69
+ ❝We found this wand shop that had the best wands, and we were
70
+ like, "We have to go here!" So we went there.❞
71
+ </p>
72
+ <div class="usx-block__attribution">
73
+ <div class="usx-attribution">
74
+ <span class="usx-attribution__content">
75
+ <span class="usx-attribution__primary">John Doe</span>
76
+ <span class="usx-attribution__secondary">Under Secretary for the Department of Magic and Mystical Affairs</span>
77
+ </span>
78
+ </div>
79
+ </div>
80
+ </div>
81
+ </div>
82
+ <a class="usx-clickable display-flex flex-align-center margin-1 usx-width-fit" href="https://google.com">
83
+ <span class="usx-circle bg-black text-white usx-clickable__bg-color-on-hover display-flex flex-align-center flex-justify-center width-4 height-4">
84
+ <svg class="usa-icon usa-icon--size-3" aria-hidden="true" focusable="false" role="img">
85
+ <use href="./img/sprite.svg#arrow_forward"></use>
86
+ </svg>
87
+ </span>
88
+ <span class="margin-left-1 usx-clickable__link">Read John's Story</span>
89
+ </a>
90
+
91
+ <h3 class="site-preview-heading margin-top-5">Read John's Story inside blockquote</h3>
92
+ <a class="usx-clickable display-flex usx-block usx-block--callout usx-border-primary" href="https://google.com">
93
+ <div class="usx-block__content usx-border-info maxw-tablet margin-0">
94
+ <p class="font-serif-lg maxw-tablet margin-0">
95
+ ❝We found this wand shop that had the best wands, and we were
96
+ like, "We have to go here!" So we went there.❞
97
+ </p>
98
+ <div class="usx-block__attribution">
99
+ <div class="usx-attribution">
100
+ <span class="usx-attribution__content">
101
+ <span class="usx-attribution__primary">John Doe</span>
102
+ <span class="usx-attribution__secondary">Under Secretary for the Department of Magic and Mystical Affairs</span>
103
+ </span>
104
+ </div>
105
+ </div>
106
+
107
+ <div class="display-flex flex-align-center margin-top-2">
108
+ <span class="usx-circle bg-black text-white usx-clickable__bg-color-on-hover display-flex flex-align-center flex-justify-center width-4 height-4">
109
+ <svg class="usa-icon usa-icon--size-3" aria-hidden="true" focusable="false" role="img">
110
+ <use href="./img/sprite.svg#arrow_forward"></use>
111
+ </svg>
112
+ </span>
113
+ <span class="margin-left-1 usx-clickable__link">Read John's Story</span>
114
+ </div>
115
+ </div>
116
+ </a>
117
+
118
+ <h2 class="site-preview-heading margin-top-5">Basic Class demonstrations</h2>
119
+
120
+ <h3 class="site-preview-heading margin-top-5">All classes on single element</h3>
121
+ <a class="usx-clickable text-primary-lightest" href="https://google.com">
122
+ <span class="usx-clickable__bg-color-on-hover usx-clickable__color-on-hover usx-clickable__link">Background and text changes color.</span>
123
+ </a>
124
+
125
+ <h3 class="site-preview-heading margin-top-5">Color classes within link class (fully underlined)</h3>
126
+ <a class="usx-clickable text-primary-lightest" href="https://google.com">
127
+ <span class="usx-clickable__link"><span class="usx-clickable__bg-color-on-hover">Background changes color.</span><span class="usx-clickable__color-on-hover"> Text changes color.</span> No change to background or color.</span>
128
+ </a>
129
+
130
+ <h3 class="site-preview-heading margin-top-5">Color classes outside link class</h3>
131
+ <a class="usx-clickable text-primary-lightest" href="https://google.com">
132
+ <span class="usx-clickable__bg-color-on-hover">Background changes color.</span><span class="usx-clickable__color-on-hover"> Text changes color. </span><span class="usx-clickable__link">No change to background or color.</span>
133
+ </a>
@@ -0,0 +1,26 @@
1
+ {
2
+ "name": "clickable",
3
+ "template": "clickable/clickable.django.html",
4
+ "version": 1,
5
+ "required": [
6
+ "href"
7
+ ],
8
+ "props": {
9
+ "href": {
10
+ "type": "string",
11
+ "description": "URL the clickable navigates to."
12
+ },
13
+ "className": {
14
+ "type": "string",
15
+ "description": "Additional layout or utility classes applied to the root anchor (e.g. 'flex-column padding-2')."
16
+ },
17
+ "id": {
18
+ "type": "string",
19
+ "description": "Optional id attribute for the anchor element."
20
+ },
21
+ "children": {
22
+ "type": "string",
23
+ "description": "Safe inner HTML. Apply usx-clickable__link, usx-clickable__color-on-hover, and/or usx-clickable__bg-color-on-hover to any child elements as needed."
24
+ }
25
+ }
26
+ }
@@ -0,0 +1,60 @@
1
+ import React from 'react';
2
+ import ClassNames from 'classnames';
3
+
4
+ function usxCopy(text: string) {
5
+ if (navigator.clipboard) {
6
+ navigator.clipboard.writeText(text);
7
+ } else {
8
+ const ta = document.createElement('textarea');
9
+ ta.value = text;
10
+ ta.style.cssText = 'position:fixed;opacity:0';
11
+ document.body.appendChild(ta);
12
+ ta.focus();
13
+ ta.select();
14
+ try { document.execCommand('copy'); } catch { /* ignore */ }
15
+ document.body.removeChild(ta);
16
+ }
17
+ }
18
+
19
+ export interface CodeLine {
20
+ code: string;
21
+ prefix?: string;
22
+ className?: string;
23
+ }
24
+
25
+ export interface CodeProps {
26
+ lines?: CodeLine[];
27
+ copyText?: string | null;
28
+ className?: string;
29
+ }
30
+
31
+ export default function Code({ lines = [], copyText = null, className = '' }: CodeProps) {
32
+ return (
33
+ <div className={ClassNames('usx-mockup-code', className)}>
34
+ <div className="usx-mockup-code__content">
35
+ {lines.map((line, i) => (
36
+ <pre
37
+ key={i}
38
+ {...(line.prefix != null ? { 'data-prefix': line.prefix } : {})}
39
+ className={line.className || undefined}
40
+ >
41
+ <code dangerouslySetInnerHTML={{ __html: line.code }} />
42
+ </pre>
43
+ ))}
44
+ </div>
45
+ {copyText && (
46
+ <button
47
+ className="usa-button usx-button usx-button--ghost usx-copy"
48
+ onClick={() => usxCopy(copyText)}
49
+ >
50
+ <svg className="usa-icon usx-copy__copy" aria-hidden="true" focusable="false" role="img">
51
+ <use href="./img/sprite.svg#content_copy" />
52
+ </svg>
53
+ <svg className="usa-icon usx-copy__check" aria-hidden="true" focusable="false" role="img">
54
+ <use href="./img/sprite.svg#check" />
55
+ </svg>
56
+ </button>
57
+ )}
58
+ </div>
59
+ );
60
+ }
@@ -0,0 +1,21 @@
1
+ {# Django template for Code #}
2
+ <div class="usx-mockup-code{% if className %} {{ className }}{% endif %}">
3
+ <div class="usx-mockup-code__content">
4
+ {% for line in lines %}
5
+ <pre
6
+ {% if line.prefix %} data-prefix="{{ line.prefix }}"{% endif %}{% if line.className %} class="{{ line.className }}"{% endif %}
7
+ ><code>{{ line.code|safe }}</code></pre>
8
+ {% endfor %}
9
+ </div>
10
+ {% if copyText %}
11
+ <button class="usa-button usx-button usx-button--ghost usx-copy"
12
+ onclick="navigator.clipboard.writeText('{{ copyText|escapejs }}')">
13
+ <svg class="usa-icon usx-copy__copy" aria-hidden="true" focusable="false" role="img">
14
+ <use href="./img/sprite.svg#content_copy"></use>
15
+ </svg>
16
+ <svg class="usa-icon usx-copy__check" aria-hidden="true" focusable="false" role="img">
17
+ <use href="./img/sprite.svg#check"></use>
18
+ </svg>
19
+ </button>
20
+ {% endif %}
21
+ </div>
@@ -0,0 +1,71 @@
1
+ <h3 class="site-preview-heading">Default</h3>
2
+ <div class="usx-mockup-code">
3
+ <div class="usx-mockup-code__content">
4
+ <pre data-prefix="$"><code>npm install @solexllc/usx</code></pre>
5
+ <pre data-prefix=">" class="text-warning"><code>installing...</code></pre>
6
+ <pre data-prefix=">" class="text-success"><code>Done!</code></pre>
7
+ </div>
8
+ </div>
9
+
10
+ <h3 class="site-preview-heading">With Line Numbers</h3>
11
+ <div class="usx-mockup-code">
12
+ <div class="usx-mockup-code__content">
13
+ <pre data-prefix="1"><code>npm install @solexllc/usx</code></pre>
14
+ <pre data-prefix="2" class="text-warning"><code>installing...</code></pre>
15
+ <pre data-prefix="3" class="text-success"><code>Done!</code></pre>
16
+ </div>
17
+ </div>
18
+
19
+ <h3 class="site-preview-heading">Highlighted Line</h3>
20
+ <div class="usx-mockup-code">
21
+ <div class="usx-mockup-code__content">
22
+ <pre data-prefix="$"><code>npm install @solexllc/usx</code></pre>
23
+ <pre data-prefix=">" class="text-warning"><code>installing...</code></pre>
24
+ <pre data-prefix=">" class="text-ink bg-warning"><code>Error!</code></pre>
25
+ </div>
26
+ </div>
27
+
28
+ <h3 class="site-preview-heading">Long Line with Scroll</h3>
29
+ <div class="usx-mockup-code">
30
+ <div class="usx-mockup-code__content">
31
+ <pre data-prefix="~"><code>Magnam dolore beatae necessitatibus nemopsum itaque sit. Et porro quae qui et et dolore ratione.</code></pre>
32
+ </div>
33
+ </div>
34
+
35
+ <h3 class="site-preview-heading">Without Prefix</h3>
36
+ <div class="usx-mockup-code">
37
+ <div class="usx-mockup-code__content">
38
+ <pre><code>without prefix</code></pre>
39
+ </div>
40
+ </div>
41
+
42
+ <h3 class="site-preview-heading">With Color</h3>
43
+ <div class="usx-mockup-code bg-primary-darker text-magenta">
44
+ <div class="usx-mockup-code__content">
45
+ <pre data-prefix="$"><code>npm install @solexllc/usx</code></pre>
46
+ <pre data-prefix=">" class="text-warning"><code>installing...</code></pre>
47
+ <pre data-prefix=">" class="text-success"><code>Done!</code></pre>
48
+ </div>
49
+ </div>
50
+
51
+ <h3 class="site-preview-heading">With Copy Button</h3>
52
+ <span id="hidden-text-to-copy" class="display-none" aria-hidden="true">npm install @solexllc/usx
53
+ installing...
54
+ Done!</span>
55
+ <div class="usx-mockup-code">
56
+ <div class="usx-mockup-code__content">
57
+ <pre data-prefix="$"><code>npm install @solexllc/usx</code></pre>
58
+ <pre data-prefix=">" class="text-warning"><code>installing...</code></pre>
59
+ <pre data-prefix=">" class="text-success"><code>Done!</code></pre>
60
+ </div>
61
+
62
+ <button class="usa-button usx-button usx-button--ghost usx-copy"
63
+ onclick="navigator.clipboard.writeText(document.getElementById('hidden-text-to-copy').textContent)">
64
+ <svg class="usa-icon usx-copy__copy" aria-hidden="true" focusable="false" role="img">
65
+ <use href="./img/sprite.svg#content_copy"></use>
66
+ </svg>
67
+ <svg class="usa-icon usx-copy__check" aria-hidden="true" focusable="false" role="img">
68
+ <use href="./img/sprite.svg#check"></use>
69
+ </svg>
70
+ </button>
71
+ </div>
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "code",
3
+ "template": "code/code.django.html",
4
+ "version": 1,
5
+ "required": [
6
+ "lines"
7
+ ],
8
+ "props": {
9
+ "lines": {
10
+ "type": "array",
11
+ "description": "Array of line objects. Each supports: code (string), prefix (string, omit for no data-prefix attribute), className (string).",
12
+ "items": {
13
+ "type": "object",
14
+ "description": "Terminal line.",
15
+ "properties": {
16
+ "code": {
17
+ "type": "string",
18
+ "description": "Line content."
19
+ },
20
+ "prefix": {
21
+ "type": "string",
22
+ "description": "data-prefix attribute; omit for no prefix."
23
+ },
24
+ "className": {
25
+ "type": "string",
26
+ "description": "Additional classes."
27
+ }
28
+ }
29
+ }
30
+ },
31
+ "copyText": {
32
+ "type": "string",
33
+ "description": "Text to copy when the copy button is clicked. If provided, shows the copy button."
34
+ },
35
+ "className": {
36
+ "type": "string",
37
+ "description": "Additional CSS classes to apply to the wrapper div."
38
+ }
39
+ }
40
+ }
@@ -0,0 +1,99 @@
1
+ import React from 'react';
2
+ import ClassNames from 'classnames';
3
+ import CalendarDate from '../calendar-date/CalendarDate';
4
+
5
+ export interface CollectionMetaItem {
6
+ text: string;
7
+ datetime?: string;
8
+ }
9
+
10
+ export interface CollectionTag {
11
+ label: string;
12
+ isNew?: boolean;
13
+ }
14
+
15
+ export interface CollectionItemProps {
16
+ href: string;
17
+ heading: string;
18
+ description?: string;
19
+ imgSrc?: string;
20
+ imgAlt?: string;
21
+ calendarDate?: string | { datetime: string; month: string; day: string };
22
+ meta?: (string | CollectionMetaItem)[];
23
+ tags?: (string | CollectionTag)[];
24
+ }
25
+
26
+ function CollectionItem({ href, heading, description, imgSrc, imgAlt = '', calendarDate, meta, tags }: CollectionItemProps) {
27
+ return (
28
+ <li className="usa-collection__item">
29
+ {imgSrc && (
30
+ <img className="usa-collection__img" src={imgSrc} alt={imgAlt} />
31
+ )}
32
+ {calendarDate && (
33
+ <CalendarDate datetime={typeof calendarDate === 'string' ? calendarDate : calendarDate.datetime} underCollection={true} />
34
+ )}
35
+ <div className="usa-collection__body">
36
+ <h4 className="usa-collection__heading">
37
+ <a className="usa-link usx-link" href={href}>{heading}</a>
38
+ </h4>
39
+ {description && (
40
+ <p className="usa-collection__description">{description}</p>
41
+ )}
42
+ {meta && meta.length > 0 && (
43
+ <ul className="usa-collection__meta" aria-label="More information">
44
+ {meta.map((item, i) =>
45
+ typeof item === 'object' && 'datetime' in item ? (
46
+ <li key={i} className="usa-collection__meta-item">
47
+ <time dateTime={item.datetime}>{item.text}</time>
48
+ </li>
49
+ ) : (
50
+ <li key={i} className="usa-collection__meta-item">
51
+ {typeof item === 'string' ? item : item.text}
52
+ </li>
53
+ )
54
+ )}
55
+ </ul>
56
+ )}
57
+ {tags && tags.length > 0 && (
58
+ <ul className="usa-collection__meta" aria-label="Topics">
59
+ {tags.map((tag, i) => (
60
+ <li
61
+ key={i}
62
+ className={ClassNames(
63
+ 'usa-collection__meta-item',
64
+ 'usa-tag usx-tag',
65
+ typeof tag === 'object' && tag.isNew && 'usa-tag--new',
66
+ )}
67
+ >
68
+ {typeof tag === 'string' ? tag : tag.label}
69
+ </li>
70
+ ))}
71
+ </ul>
72
+ )}
73
+ </div>
74
+ </li>
75
+ );
76
+ }
77
+
78
+ export interface CollectionProps extends React.HTMLAttributes<HTMLUListElement> {
79
+ items?: CollectionItemProps[];
80
+ condensed?: boolean;
81
+ className?: string;
82
+ }
83
+
84
+ export default function Collection({ items = [], condensed = false, className = '', ...props }: CollectionProps) {
85
+ const classes = ClassNames(
86
+ 'usa-collection',
87
+ 'usx-collection',
88
+ condensed && 'usa-collection--condensed',
89
+ className,
90
+ );
91
+
92
+ return (
93
+ <ul className={classes} {...props}>
94
+ {items.map((item, i) => (
95
+ <CollectionItem key={i} {...item} />
96
+ ))}
97
+ </ul>
98
+ );
99
+ }
@@ -0,0 +1,48 @@
1
+ {% load components %}
2
+
3
+ <ul class="usa-collection usx-collection{% if condensed %} usa-collection--condensed{% endif %}{% if className %} {{ className }}{% endif %}">
4
+ {% for item in items %}
5
+ <li class="usa-collection__item">
6
+ {% if item.imgSrc %}
7
+ <img class="usa-collection__img" src="{{ item.imgSrc }}" alt="{{ item.imgAlt }}" />
8
+ {% endif %}
9
+ {% if item.calendarDate %}
10
+ {% with datetime=item.calendarDate %}
11
+ {% calendar_date datetime=datetime under_collection=True %}{% endcalendar_date %}
12
+ {% endwith %}
13
+ {% endif %}
14
+ <div class="usa-collection__body">
15
+ <h4 class="usa-collection__heading">
16
+ <a class="usa-link usx-link" href="{{ item.href }}">{{ item.heading }}</a>
17
+ </h4>
18
+ {% if item.description %}
19
+ <p class="usa-collection__description">{{ item.description }}</p>
20
+ {% endif %}
21
+ {% if item.meta %}
22
+ <ul class="usa-collection__meta" aria-label="More information">
23
+ {% for m in item.meta %}
24
+ {% if m.datetime %}
25
+ <li class="usa-collection__meta-item"><time datetime="{{ m.datetime }}">{{ m.text }}</time></li>
26
+ {% elif m.text %}
27
+ <li class="usa-collection__meta-item">{{ m.text }}</li>
28
+ {% else %}
29
+ <li class="usa-collection__meta-item">{{ m }}</li>
30
+ {% endif %}
31
+ {% endfor %}
32
+ </ul>
33
+ {% endif %}
34
+ {% if item.tags %}
35
+ <ul class="usa-collection__meta" aria-label="Topics">
36
+ {% for tag in item.tags %}
37
+ {% if tag.label %}
38
+ <li class="usa-collection__meta-item usa-tag usx-tag{% if tag.isNew %} usa-tag--new{% endif %}">{{ tag.label }}</li>
39
+ {% else %}
40
+ <li class="usa-collection__meta-item usa-tag usx-tag">{{ tag }}</li>
41
+ {% endif %}
42
+ {% endfor %}
43
+ </ul>
44
+ {% endif %}
45
+ </div>
46
+ </li>
47
+ {% endfor %}
48
+ </ul>