@solexllc/usx-react 0.10.0 → 0.12.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 (208) hide show
  1. package/README.md +16 -0
  2. package/dist/Popover-BzDCTuQM.cjs +984 -0
  3. package/dist/Popover-LToVWsWc.js +985 -0
  4. package/dist/chat.cjs +1391 -0
  5. package/dist/chat.js +1391 -0
  6. package/dist/index.cjs +4426 -5231
  7. package/dist/index.js +168 -970
  8. package/package.json +9 -5
  9. package/src/chat.js +15 -0
  10. package/src/components/avatar/Avatar.tsx +54 -16
  11. package/src/components/avatar/avatar.django-snapshot.html +112 -0
  12. package/src/components/avatar/avatar.django.html +2 -2
  13. package/src/components/avatar/avatar.html +25 -0
  14. package/src/components/avatar/avatar.react-snapshot.html +104 -0
  15. package/src/components/avatar/config.json +13 -15
  16. package/src/components/avatar-group/AvatarGroup.tsx +17 -15
  17. package/src/components/avatar-group/avatar-group.django-snapshot.html +22 -0
  18. package/src/components/avatar-group/avatar-group.django.html +1 -1
  19. package/src/components/avatar-group/avatar-group.react-snapshot.html +20 -0
  20. package/src/components/avatar-group/config.json +2 -2
  21. package/src/components/back-to-top/BackToTop.tsx +21 -57
  22. package/src/components/back-to-top/back-to-top.django-snapshot.html +101 -202
  23. package/src/components/back-to-top/back-to-top.django.html +11 -38
  24. package/src/components/back-to-top/back-to-top.html +22 -106
  25. package/src/components/back-to-top/back-to-top.react-snapshot.html +94 -148
  26. package/src/components/back-to-top/config.json +41 -10
  27. package/src/components/button/Button.tsx +12 -3
  28. package/src/components/button/button.django-snapshot.html +18 -0
  29. package/src/components/button/button.django.html +3 -2
  30. package/src/components/button/button.react-snapshot.html +16 -0
  31. package/src/components/button/config.json +11 -2
  32. package/src/components/callout/callout.django.html +1 -1
  33. package/src/components/callout/config.json +7 -16
  34. package/src/components/character-count/CharacterCount.tsx +2 -0
  35. package/src/components/character-count/character-count.react-snapshot.html +7 -0
  36. package/src/components/chat/Chat.tsx +575 -0
  37. package/src/components/chat/README.md +174 -0
  38. package/src/components/chat/avatarProps.ts +32 -0
  39. package/src/components/chat/chat.django-snapshot.html +23515 -0
  40. package/src/components/chat/chat.django.html +75 -0
  41. package/src/components/chat/chat.html +116 -0
  42. package/src/components/chat/chat.react-snapshot.html +16895 -0
  43. package/src/components/chat/config.json +1241 -0
  44. package/src/components/chat-attachment/ChatAttachment.tsx +39 -0
  45. package/src/components/chat-attachment/chat-attachment.django.html +24 -0
  46. package/src/components/chat-attachment/chat-attachment.html +10 -0
  47. package/src/components/chat-attachment/config.json +27 -0
  48. package/src/components/chat-attachments/ChatAttachments.tsx +17 -0
  49. package/src/components/chat-attachments/chat-attachments.django-snapshot.html +58 -0
  50. package/src/components/chat-attachments/chat-attachments.django.html +10 -0
  51. package/src/components/chat-attachments/chat-attachments.html +14 -0
  52. package/src/components/chat-attachments/chat-attachments.react-snapshot.html +46 -0
  53. package/src/components/chat-attachments/config.json +25 -0
  54. package/src/components/chat-bubble/ChatBubble.tsx +39 -0
  55. package/src/components/chat-bubble/ChatFormattedText.tsx +138 -0
  56. package/src/components/chat-bubble/chat-bubble.django-snapshot.html +128 -0
  57. package/src/components/chat-bubble/chat-bubble.django.html +19 -0
  58. package/src/components/chat-bubble/chat-bubble.html +1 -0
  59. package/src/components/chat-bubble/chat-bubble.react-snapshot.html +118 -0
  60. package/src/components/chat-bubble/config.json +70 -0
  61. package/src/components/chat-composer/ChatComposer.tsx +210 -0
  62. package/src/components/chat-composer/README.md +15 -0
  63. package/src/components/chat-composer/chat-composer.django-snapshot.html +575 -0
  64. package/src/components/chat-composer/chat-composer.django.html +77 -0
  65. package/src/components/chat-composer/chat-composer.html +44 -0
  66. package/src/components/chat-composer/chat-composer.react-snapshot.html +519 -0
  67. package/src/components/chat-composer/chat-formatting.django.html +59 -0
  68. package/src/components/chat-composer/config.json +137 -0
  69. package/src/components/chat-context/ChatContext.tsx +46 -0
  70. package/src/components/chat-context/chat-context.django-snapshot.html +35 -0
  71. package/src/components/chat-context/chat-context.django.html +20 -0
  72. package/src/components/chat-context/chat-context.html +9 -0
  73. package/src/components/chat-context/chat-context.react-snapshot.html +30 -0
  74. package/src/components/chat-context/config.json +36 -0
  75. package/src/components/chat-controls/ChatControls.tsx +67 -0
  76. package/src/components/chat-controls/chat-controls.django-snapshot.html +114 -0
  77. package/src/components/chat-controls/chat-controls.django.html +36 -0
  78. package/src/components/chat-controls/chat-controls.html +11 -0
  79. package/src/components/chat-controls/chat-controls.react-snapshot.html +107 -0
  80. package/src/components/chat-controls/config.json +67 -0
  81. package/src/components/chat-directory/ChatDirectory.tsx +168 -0
  82. package/src/components/chat-directory/chat-directory.django-snapshot.html +546 -0
  83. package/src/components/chat-directory/chat-directory.django.html +14 -0
  84. package/src/components/chat-directory/chat-directory.html +4 -0
  85. package/src/components/chat-directory/chat-directory.react-snapshot.html +471 -0
  86. package/src/components/chat-directory/config.json +242 -0
  87. package/src/components/chat-directory-item/ChatDirectoryItem.tsx +150 -0
  88. package/src/components/chat-directory-item/chat-directory-item.django-snapshot.html +281 -0
  89. package/src/components/chat-directory-item/chat-directory-item.django.html +38 -0
  90. package/src/components/chat-directory-item/chat-directory-item.html +9 -0
  91. package/src/components/chat-directory-item/chat-directory-item.react-snapshot.html +249 -0
  92. package/src/components/chat-directory-item/config.json +103 -0
  93. package/src/components/chat-history/ChatHistory.tsx +30 -0
  94. package/src/components/chat-history/chat-history.django-snapshot.html +113 -0
  95. package/src/components/chat-history/chat-history.django.html +20 -0
  96. package/src/components/chat-history/chat-history.html +9 -0
  97. package/src/components/chat-history/chat-history.react-snapshot.html +111 -0
  98. package/src/components/chat-history/config.json +24 -0
  99. package/src/components/chat-message/ChatMessage.tsx +148 -0
  100. package/src/components/chat-message/chat-message.django-snapshot.html +758 -0
  101. package/src/components/chat-message/chat-message.django.html +56 -0
  102. package/src/components/chat-message/chat-message.html +12 -0
  103. package/src/components/chat-message/chat-message.react-snapshot.html +627 -0
  104. package/src/components/chat-message/config.json +278 -0
  105. package/src/components/chat-message-actions/ChatMessageActions.tsx +133 -0
  106. package/src/components/chat-message-actions/chat-message-actions.django-snapshot.html +345 -0
  107. package/src/components/chat-message-actions/chat-message-actions.django.html +29 -0
  108. package/src/components/chat-message-actions/chat-message-actions.html +53 -0
  109. package/src/components/chat-message-actions/chat-message-actions.react-snapshot.html +295 -0
  110. package/src/components/chat-message-actions/config.json +121 -0
  111. package/src/components/chat-window/ChatWindow.tsx +133 -0
  112. package/src/components/chat-window/chat-window.django-snapshot.html +448 -0
  113. package/src/components/chat-window/chat-window.django.html +39 -0
  114. package/src/components/chat-window/chat-window.html +26 -0
  115. package/src/components/chat-window/chat-window.react-snapshot.html +286 -0
  116. package/src/components/chat-window/config.json +123 -0
  117. package/src/components/clickable/Clickable.tsx +19 -5
  118. package/src/components/clickable/clickable.django-snapshot.html +11 -2
  119. package/src/components/clickable/clickable.django.html +2 -0
  120. package/src/components/clickable/clickable.react-snapshot.html +10 -2
  121. package/src/components/clickable/config.json +4 -0
  122. package/src/components/code/code.django-snapshot.html +27 -22
  123. package/src/components/code/code.html +2 -2
  124. package/src/components/code/code.react-snapshot.html +43 -8
  125. package/src/components/copy-to-clipboard/CopyToClipboard.tsx +2 -7
  126. package/src/components/copy-to-clipboard/copy-to-clipboard.django-snapshot.html +6 -4
  127. package/src/components/copy-to-clipboard/copy-to-clipboard.django.html +3 -2
  128. package/src/components/copy-to-clipboard/copy-to-clipboard.react-snapshot.html +14 -2
  129. package/src/components/file-list/FileList.tsx +3 -2
  130. package/src/components/file-list/config.json +5 -0
  131. package/src/components/file-list/file-list.django-snapshot.html +63 -0
  132. package/src/components/file-list/file-list.django.html +1 -1
  133. package/src/components/file-list/file-list.react-snapshot.html +53 -0
  134. package/src/components/footer/footer.django-snapshot.html +0 -3
  135. package/src/components/header/header.django-snapshot.html +5 -167
  136. package/src/components/header/header.django.html +2 -2
  137. package/src/components/header/header.html +1 -11
  138. package/src/components/header/header.react-snapshot.html +3 -6
  139. package/src/components/hero/hero.django-snapshot.html +0 -20
  140. package/src/components/hero/hero.django.html +3 -3
  141. package/src/components/icon-list/IconList.tsx +10 -2
  142. package/src/components/icon-list/config.json +5 -1
  143. package/src/components/icon-list/icon-list.django-snapshot.html +39 -0
  144. package/src/components/icon-list/icon-list.django.html +2 -0
  145. package/src/components/icon-list/icon-list.react-snapshot.html +31 -0
  146. package/src/components/image/image.django.html +4 -4
  147. package/src/components/input/Input.tsx +1 -1
  148. package/src/components/input/config.json +2 -3
  149. package/src/components/input/input.django-snapshot.html +4 -21
  150. package/src/components/input/input.django.html +2 -2
  151. package/src/components/link/Link.tsx +7 -4
  152. package/src/components/link/config.json +2 -3
  153. package/src/components/link/link.django-snapshot.html +8 -0
  154. package/src/components/link/link.django.html +2 -2
  155. package/src/components/link/link.html +4 -1
  156. package/src/components/link/link.react-snapshot.html +8 -0
  157. package/src/components/list/List.tsx +10 -2
  158. package/src/components/list/config.json +5 -1
  159. package/src/components/list/list.django-snapshot.html +26 -0
  160. package/src/components/list/list.django.html +2 -0
  161. package/src/components/list/list.html +20 -0
  162. package/src/components/list/list.react-snapshot.html +20 -0
  163. package/src/components/memorable-date/memorable-date.django-snapshot.html +0 -8
  164. package/src/components/memorable-date/memorable-date.django.html +2 -2
  165. package/src/components/misc-banner/misc-banner.django-snapshot.html +12 -12
  166. package/src/components/misc-banner/misc-banner.django.html +4 -2
  167. package/src/components/page/Page.tsx +16 -0
  168. package/src/components/page/config.json +18 -1
  169. package/src/components/page/page.django-snapshot.html +74 -0
  170. package/src/components/page/page.django.html +8 -0
  171. package/src/components/page/page.html +60 -0
  172. package/src/components/page/page.react-snapshot.html +60 -0
  173. package/src/components/popover/Popover.tsx +60 -9
  174. package/src/components/popover/PopoverMenu.tsx +33 -15
  175. package/src/components/popover/config.json +88 -14
  176. package/src/components/popover/popover-menu.django.html +13 -2
  177. package/src/components/popover/popover.django-snapshot.html +229 -7
  178. package/src/components/popover/popover.django.html +3 -2
  179. package/src/components/popover/popover.react-snapshot.html +127 -4
  180. package/src/components/process-list/config.json +41 -3
  181. package/src/components/quote/Quote.tsx +9 -2
  182. package/src/components/search/Search.tsx +1 -1
  183. package/src/components/search/config.json +3 -4
  184. package/src/components/search/search.django-snapshot.html +262 -1684
  185. package/src/components/search/search.django.html +1 -20
  186. package/src/components/select/select.django-snapshot.html +7 -7
  187. package/src/components/select/select.react-snapshot.html +7 -7
  188. package/src/components/summary/Summary.tsx +4 -2
  189. package/src/components/summary/config.json +4 -0
  190. package/src/components/summary/summary.django.html +4 -4
  191. package/src/components/table/Table.tsx +58 -25
  192. package/src/components/table/config.json +61 -13
  193. package/src/components/tag/Tag.tsx +40 -7
  194. package/src/components/tag/config.json +18 -2
  195. package/src/components/tag/tag.django-snapshot.html +16 -1
  196. package/src/components/tag/tag.django.html +12 -6
  197. package/src/components/tag/tag.html +4 -0
  198. package/src/components/tag/tag.react-snapshot.html +16 -1
  199. package/src/components/tag-group/TagGroup.tsx +6 -9
  200. package/src/components/tag-group/config.json +4 -0
  201. package/src/components/tag-group/tag-group.django.html +1 -1
  202. package/src/components/theme-picker/ThemePicker.tsx +95 -52
  203. package/src/components/theme-picker/config.json +7 -4
  204. package/src/components/theme-picker/theme-picker-select.django.html +7 -0
  205. package/src/components/theme-picker/theme-picker.django-snapshot.html +101 -21
  206. package/src/components/theme-picker/theme-picker.django.html +22 -24
  207. package/src/components/theme-picker/theme-picker.html +86 -56
  208. package/src/components/theme-picker/theme-picker.react-snapshot.html +74 -18
package/dist/index.js CHANGED
@@ -1,73 +1,7 @@
1
1
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
- import React, { useState, createContext, useContext, useId, useRef, createElement } from "react";
3
- function getDefaultExportFromCjs(x) {
4
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
5
- }
6
- var classnames = { exports: {} };
7
- /*!
8
- Copyright (c) 2018 Jed Watson.
9
- Licensed under the MIT License (MIT), see
10
- http://jedwatson.github.io/classnames
11
- */
12
- var hasRequiredClassnames;
13
- function requireClassnames() {
14
- if (hasRequiredClassnames) return classnames.exports;
15
- hasRequiredClassnames = 1;
16
- (function(module) {
17
- (function() {
18
- var hasOwn = {}.hasOwnProperty;
19
- function classNames() {
20
- var classes = "";
21
- for (var i = 0; i < arguments.length; i++) {
22
- var arg = arguments[i];
23
- if (arg) {
24
- classes = appendClass(classes, parseValue(arg));
25
- }
26
- }
27
- return classes;
28
- }
29
- function parseValue(arg) {
30
- if (typeof arg === "string" || typeof arg === "number") {
31
- return arg;
32
- }
33
- if (typeof arg !== "object") {
34
- return "";
35
- }
36
- if (Array.isArray(arg)) {
37
- return classNames.apply(null, arg);
38
- }
39
- if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
40
- return arg.toString();
41
- }
42
- var classes = "";
43
- for (var key in arg) {
44
- if (hasOwn.call(arg, key) && arg[key]) {
45
- classes = appendClass(classes, key);
46
- }
47
- }
48
- return classes;
49
- }
50
- function appendClass(value, newClass) {
51
- if (!newClass) {
52
- return value;
53
- }
54
- if (value) {
55
- return value + " " + newClass;
56
- }
57
- return value + newClass;
58
- }
59
- if (module.exports) {
60
- classNames.default = classNames;
61
- module.exports = classNames;
62
- } else {
63
- window.classNames = classNames;
64
- }
65
- })();
66
- })(classnames);
67
- return classnames.exports;
68
- }
69
- var classnamesExports = requireClassnames();
70
- const ClassNames = /* @__PURE__ */ getDefaultExportFromCjs(classnamesExports);
2
+ import { C as ClassNames, A as Avatar, B as Button, g as getAssetUrl, I as Icon, a as Image, T as Tag, b as ButtonGroup, F as FormGroup, L as Label, H as Hint, E as ErrorMessage, c as TextArea, R as Required, d as Tooltip, S as Summary, e as TagGroup, f as Link, h as Callout, i as Alert, j as Clickable } from "./Popover-LToVWsWc.js";
3
+ import { k, P, l } from "./Popover-LToVWsWc.js";
4
+ import React, { createContext, useContext, useId, useRef, useState, createElement } from "react";
71
5
  function AccordionItem({
72
6
  title,
73
7
  id,
@@ -150,150 +84,6 @@ function Accordion({
150
84
  }
151
85
  );
152
86
  }
153
- function getAssetUrl(assetPath, staticBaseUrl) {
154
- if (/^[a-z][a-z\d+.-]*:/i.test(assetPath)) return assetPath;
155
- const base = staticBaseUrl || typeof window !== "undefined" && window.usxBaseUrl || "/";
156
- return `${base.replace(/\/+$/, "")}/${assetPath.replace(/^\/+/, "")}`;
157
- }
158
- function getAssetSrcSet(srcSet, staticBaseUrl) {
159
- return srcSet.replace(/(^\s*|,\s*)(\S*[^,\s])(?=,?(?:\s|$))/g, (_match, separator, url) => `${separator}${getAssetUrl(url, staticBaseUrl)}`);
160
- }
161
- function Icon({
162
- name,
163
- source = "uswds",
164
- size,
165
- color,
166
- alt,
167
- staticBaseUrl,
168
- staticUrlPrefix,
169
- className = "",
170
- ...props2
171
- }) {
172
- const spritePrefix = staticUrlPrefix ?? getAssetUrl(`img/${source === "usx" ? "usx-sprite.svg" : "sprite.svg"}#`, staticBaseUrl);
173
- const classes = ClassNames(
174
- "usa-icon",
175
- "usx-icon",
176
- size ? size === 1 ? "usx-icon--size-1" : "usa-icon--size-" + size : "",
177
- color ? "text-" + color : "",
178
- className
179
- );
180
- return /* @__PURE__ */ jsx(
181
- "svg",
182
- {
183
- className: classes,
184
- "aria-hidden": alt ? void 0 : "true",
185
- "aria-label": alt || void 0,
186
- focusable: "false",
187
- role: "img",
188
- ...props2,
189
- children: /* @__PURE__ */ jsx("use", { href: spritePrefix + name })
190
- }
191
- );
192
- }
193
- function Alert({
194
- heading,
195
- text,
196
- variant,
197
- slim = false,
198
- noIcon = false,
199
- className = "",
200
- role,
201
- ariaLabel,
202
- ariaLabelledby,
203
- onDismiss = void 0,
204
- staticBaseUrl,
205
- children = null,
206
- ...props2
207
- }) {
208
- const normalizedVariant = variant && ["info", "warning", "success", "error", "emergency"].includes(variant) ? variant : null;
209
- const classes = ClassNames(
210
- "usa-alert",
211
- "usx-alert",
212
- normalizedVariant ? `usa-alert--${normalizedVariant}` : "",
213
- slim ? "usa-alert--slim" : "",
214
- noIcon ? "usa-alert--no-icon" : "",
215
- className
216
- );
217
- const resolvedRole = role || (normalizedVariant === "error" || normalizedVariant === "emergency" ? "alert" : normalizedVariant === "success" ? "status" : "region");
218
- const accessibilityProps = {
219
- role: resolvedRole
220
- };
221
- if (ariaLabelledby) {
222
- accessibilityProps["aria-labelledby"] = ariaLabelledby;
223
- } else if (ariaLabel) {
224
- accessibilityProps["aria-label"] = ariaLabel;
225
- } else if (resolvedRole === "region") {
226
- const label = heading || (normalizedVariant ? `${normalizedVariant} alert` : void 0);
227
- if (label) accessibilityProps["aria-label"] = label;
228
- }
229
- return /* @__PURE__ */ jsx("div", { className: classes, ...accessibilityProps, ...props2, children: /* @__PURE__ */ jsxs("div", { className: "usa-alert__body", children: [
230
- !slim && heading ? /* @__PURE__ */ jsx("h4", { className: "usa-alert__heading", children: heading }) : null,
231
- children ? /* @__PURE__ */ jsx("div", { className: "usa-alert__text", children }) : text ? /* @__PURE__ */ jsx("p", { className: "usa-alert__text", children: text }) : null,
232
- onDismiss && /* @__PURE__ */ jsx("button", { className: "usx-alert__dismiss", "aria-label": "Dismiss alert", onClick: onDismiss, children: /* @__PURE__ */ jsx(Icon, { name: "close", size: 3, staticBaseUrl }) })
233
- ] }) });
234
- }
235
- const Tooltip = ({
236
- label,
237
- position = "right",
238
- children,
239
- className = "",
240
- bodyClassName = "",
241
- ...props2
242
- }) => {
243
- const validPositions = ["top", "bottom", "left", "right"];
244
- const normalizedPosition = validPositions.includes(position) ? position : "right";
245
- return /* @__PURE__ */ jsxs("span", { className: ClassNames("usx-tooltip", className), ...props2, children: [
246
- children,
247
- /* @__PURE__ */ jsx(
248
- "span",
249
- {
250
- className: ClassNames("usa-tooltip__body", `usa-tooltip__body--${normalizedPosition}`, bodyClassName),
251
- role: "tooltip",
252
- children: label
253
- }
254
- )
255
- ] });
256
- };
257
- const shapeClassMap = {
258
- circle: "usx-circle",
259
- "rounded-sm": "usx-rounded-sm",
260
- "rounded-md": "usx-rounded-md",
261
- "rounded-lg": "usx-rounded-lg",
262
- "rounded-xl": "usx-rounded-xl"
263
- };
264
- function Avatar({
265
- href = "#",
266
- src = null,
267
- alt = null,
268
- variant = "image",
269
- value = null,
270
- shape = null,
271
- tooltipProps = null,
272
- className = "",
273
- imageClassName = "",
274
- contentClassName = "",
275
- ...props2
276
- }) {
277
- const isInitialsVariant = variant === "initials";
278
- const isIconVariant = variant === "icon";
279
- const wrapperClasses = ClassNames(
280
- "usx-avatar",
281
- className
282
- );
283
- const imgClasses = ClassNames(
284
- "usx-avatar__img",
285
- shape ? shapeClassMap[shape] : null,
286
- imageClassName
287
- );
288
- const contentClasses = ClassNames(
289
- "usx-avatar__content",
290
- shape ? shapeClassMap[shape] : "usx-circle",
291
- contentClassName
292
- );
293
- const avatarContent = isInitialsVariant ? /* @__PURE__ */ jsx("span", { className: contentClasses, children: value }) : isIconVariant ? /* @__PURE__ */ jsx("span", { className: contentClasses, children: /* @__PURE__ */ jsx(Icon, { name: value, alt: alt ? void 0 : `${value} icon` }) }) : /* @__PURE__ */ jsx("img", { className: imgClasses, src: src || void 0, alt: alt || void 0, role: "img", ...props2 });
294
- const avatar = /* @__PURE__ */ jsx("a", { href, className: wrapperClasses, "aria-label": isInitialsVariant || isIconVariant ? alt || void 0 : void 0, children: avatarContent });
295
- return tooltipProps ? /* @__PURE__ */ jsx(Tooltip, { ...tooltipProps, children: avatar }) : avatar;
296
- }
297
87
  function Attribution({
298
88
  avatarProps = null,
299
89
  media = null,
@@ -314,77 +104,30 @@ function Attribution({
314
104
  ] });
315
105
  return /* @__PURE__ */ jsx("div", { className: classes, ...props2, children: content });
316
106
  }
317
- function AvatarGroup({ avatarProps = [], overlap = false, stacked = false, className = "", ...props2 }) {
318
- const classes = ClassNames(
319
- "usx-avatar-group",
320
- overlap && "usx-avatar-group--overlap",
321
- stacked && "usx-avatar-group--stacked",
322
- className
323
- );
324
- return /* @__PURE__ */ jsx("div", { className: classes, ...props2, children: avatarProps.map((avatar, index) => /* @__PURE__ */ jsx(
325
- Avatar,
326
- {
327
- href: avatar.href,
328
- src: avatar.src,
329
- alt: avatar.alt,
330
- value: avatar.initials,
331
- shape: avatar.shape,
332
- tooltipProps: avatar.tooltipProps,
333
- className: avatar.className,
334
- imageClassName: avatar.imageClassName,
335
- contentClassName: avatar.initialsClassName
336
- },
337
- `${avatar.src || avatar.initials || "avatar"}-${index}`
338
- )) });
339
- }
340
107
  function BackToTop({
341
108
  label = "Back to top",
342
109
  ariaLabel = "Back to top",
343
- href = void 0,
344
- variant = null,
110
+ href = "#top",
111
+ variant = "primary",
112
+ ghost = true,
113
+ inverse = false,
345
114
  iconPosition = "right",
346
115
  iconSize = 2,
347
116
  className = "",
348
- onClick = void 0,
349
- ...props2
117
+ onClick = void 0
350
118
  }) {
351
- const accessibleName = label ? void 0 : ariaLabel;
352
- const icon = /* @__PURE__ */ jsx(Icon, { name: "arrow_upward", size: iconSize, className: ClassNames(
353
- iconPosition === "left" ? "margin-right-05" : "margin-left-05"
354
- ) });
355
- if (href) {
356
- const linkClasses = ClassNames(
357
- "usx-link",
358
- "usx-no-visited",
359
- "flex-align-center",
360
- className
361
- );
362
- return /* @__PURE__ */ jsxs("a", { className: linkClasses, href, "aria-label": accessibleName, ...props2, children: [
363
- iconPosition === "left" && icon,
364
- label,
365
- iconPosition === "right" && icon
366
- ] });
367
- }
368
- const buttonClasses = ClassNames(
369
- "usa-button",
370
- "usx-button",
371
- variant === "primary" && "usa-button--primary",
372
- "usx-button--ghost",
373
- className
374
- );
375
- return /* @__PURE__ */ jsxs(
376
- "button",
119
+ return /* @__PURE__ */ jsx(
120
+ Button,
377
121
  {
378
- type: "button",
379
- className: buttonClasses,
380
- "aria-label": accessibleName,
381
- onClick: onClick || (() => window.scrollTo({ top: 0, behavior: "smooth" })),
382
- ...props2,
383
- children: [
384
- iconPosition === "left" && icon,
385
- label,
386
- iconPosition === "right" && icon
387
- ]
122
+ href: onClick ? void 0 : href || "#top",
123
+ onClick: typeof onClick === "function" ? onClick : void 0,
124
+ label: label ?? void 0,
125
+ "aria-label": label ? void 0 : ariaLabel,
126
+ variant: variant ?? "primary",
127
+ ghost,
128
+ inverse,
129
+ iconProps: [{ name: "arrow_upward", position: iconPosition, size: iconSize }],
130
+ className
388
131
  }
389
132
  );
390
133
  }
@@ -552,177 +295,6 @@ function Breadcrumb({
552
295
  }
553
296
  ) });
554
297
  }
555
- const Required = ({
556
- title = "Required",
557
- children = null,
558
- className = "",
559
- ...props2
560
- }) => {
561
- const classes = ClassNames("usx-required", className);
562
- return /* @__PURE__ */ jsxs(Fragment, { children: [
563
- /* @__PURE__ */ jsx("abbr", { title, className: classes, ...props2, children: "*" }),
564
- " ",
565
- children ? children : ""
566
- ] });
567
- };
568
- function Label({
569
- id,
570
- htmlFor,
571
- required = false,
572
- error = false,
573
- children = null,
574
- screenReaderOnly = false,
575
- className = "",
576
- classOverride = false,
577
- ...props2
578
- }) {
579
- const classes = ClassNames(
580
- "usa-label",
581
- "usx-label",
582
- { "usa-sr-only": screenReaderOnly, "usa-label--error": !!error },
583
- className
584
- );
585
- return /* @__PURE__ */ jsxs(
586
- "label",
587
- {
588
- id: id || void 0,
589
- className: classOverride ? className : classes,
590
- htmlFor: htmlFor || void 0,
591
- ...props2,
592
- children: [
593
- required && /* @__PURE__ */ jsx(Required, {}),
594
- children
595
- ]
596
- }
597
- );
598
- }
599
- const Spinner = ({
600
- size = 3,
601
- color,
602
- label = null,
603
- screenReaderLabel = null,
604
- staticUrlPrefix,
605
- staticBaseUrl,
606
- className = "",
607
- ...props2
608
- }) => {
609
- return /* @__PURE__ */ jsxs("span", { role: "status", "aria-live": "polite", className: `usx-spinner ${className}`, ...props2, children: [
610
- /* @__PURE__ */ jsx(
611
- Icon,
612
- {
613
- name: "spinner",
614
- source: "usx",
615
- size,
616
- color,
617
- staticBaseUrl,
618
- staticUrlPrefix
619
- }
620
- ),
621
- screenReaderLabel && /* @__PURE__ */ jsx(Label, { screenReaderOnly: true, children: screenReaderLabel }),
622
- label && /* @__PURE__ */ jsx(Label, { children: label })
623
- ] });
624
- };
625
- function Button({
626
- label,
627
- variant,
628
- type = "button",
629
- disabled = false,
630
- onClick,
631
- href,
632
- isExternal = false,
633
- big = false,
634
- inverse = false,
635
- ghost = false,
636
- loading = false,
637
- iconProps = [],
638
- className = "",
639
- children = "",
640
- extraAttributes = {},
641
- ...props2
642
- }) {
643
- const leftIcons = iconProps.filter((icon) => (icon.position ?? "left") === "left");
644
- const rightIcons = iconProps.filter((icon) => icon.position === "right");
645
- const renderIcon = (icon, index) => {
646
- const { position, ...iconRest } = icon;
647
- return /* @__PURE__ */ jsx(Icon, { ...iconRest }, index);
648
- };
649
- const spinner = loading && /* @__PURE__ */ jsx(Spinner, { size: 2 });
650
- const variantClasses = {
651
- primary: "usa-button--primary",
652
- secondary: "usa-button--secondary",
653
- "accent-cool": "usa-button--accent-cool",
654
- "accent-warm": "usa-button--accent-warm",
655
- base: "usa-button--base",
656
- outline: "usa-button--outline",
657
- unstyled: "usa-button--unstyled"
658
- };
659
- const classes = ClassNames(
660
- "usa-button",
661
- "usx-button",
662
- variant && variantClasses[variant],
663
- big && "usa-button--big",
664
- inverse && "usa-button--inverse",
665
- ghost && "usx-button--ghost",
666
- className
667
- );
668
- if (href) {
669
- const {
670
- // Remove unused variables
671
- ...anchorProps
672
- } = props2;
673
- return /* @__PURE__ */ jsxs(
674
- "a",
675
- {
676
- className: classes,
677
- href,
678
- ...isExternal ? { target: "_blank", rel: "noopener noreferrer" } : {},
679
- ...anchorProps,
680
- ...extraAttributes,
681
- children: [
682
- spinner,
683
- leftIcons.map(renderIcon),
684
- children || label,
685
- rightIcons.map(renderIcon)
686
- ]
687
- }
688
- );
689
- }
690
- const {
691
- // Remove unused variables
692
- ...buttonProps
693
- } = props2;
694
- return /* @__PURE__ */ jsxs(
695
- "button",
696
- {
697
- type,
698
- className: classes,
699
- disabled,
700
- "aria-disabled": disabled ? "true" : void 0,
701
- ...onClick ? { onClick } : {},
702
- ...buttonProps,
703
- ...extraAttributes,
704
- children: [
705
- spinner,
706
- leftIcons.map(renderIcon),
707
- children || label,
708
- rightIcons.map(renderIcon)
709
- ]
710
- }
711
- );
712
- }
713
- function ButtonGroup({
714
- buttonProps = [],
715
- segmented = false,
716
- className = "",
717
- ...props2
718
- }) {
719
- const classes = ClassNames(
720
- "usa-button-group usx-button-group",
721
- segmented && "usa-button-group--segmented",
722
- className
723
- );
724
- return /* @__PURE__ */ jsx("ul", { className: classes, ...props2, children: buttonProps.map(({ itemClassName, ...item }, index) => /* @__PURE__ */ jsx("li", { className: ClassNames("usa-button-group__item", itemClassName), children: /* @__PURE__ */ jsx(Button, { ...item, children: item.children }) }, index)) });
725
- }
726
298
  function CalendarDate({
727
299
  datetime,
728
300
  underCollection = false
@@ -747,155 +319,6 @@ function CalendarDate({
747
319
  /* @__PURE__ */ jsx("span", { className: dayClasses, children: day })
748
320
  ] }) });
749
321
  }
750
- function Callout({
751
- className,
752
- strokeColor,
753
- indent,
754
- dedent,
755
- big,
756
- orientation = "horizontal",
757
- children,
758
- content,
759
- backgroundColor,
760
- textColor,
761
- as: Element = "div",
762
- ...props2
763
- }) {
764
- return /* @__PURE__ */ jsx(
765
- Element,
766
- {
767
- className: ClassNames(
768
- "usx-callout",
769
- orientation === "vertical" && "usx-callout--vertical",
770
- strokeColor && `border-${strokeColor}`,
771
- indent && `usx-callout--indent-${indent}`,
772
- dedent && "usx-callout--dedent",
773
- (big ?? orientation === "horizontal") && "usx-callout--big",
774
- backgroundColor && `bg-${backgroundColor}`,
775
- textColor && `text-${textColor}`,
776
- className
777
- ),
778
- ...props2,
779
- children: children ?? content
780
- }
781
- );
782
- }
783
- const Tag = ({
784
- id,
785
- big = false,
786
- value,
787
- color = null,
788
- outline = false,
789
- icon = null,
790
- dismissible = false,
791
- isDismissed = false,
792
- onDismiss = () => {
793
- },
794
- className = "",
795
- children,
796
- ...props2
797
- }) => {
798
- const [isVisible, setIsVisible] = useState(!isDismissed);
799
- const classes = ClassNames(
800
- "usa-tag",
801
- "usx-tag",
802
- { "usa-tag--big": big },
803
- { [`bg-${color}`]: color && !outline },
804
- { [`text-${color}`]: color && outline },
805
- { "usx-tag--outline": outline },
806
- className
807
- );
808
- const handleDismiss = (e) => {
809
- e.preventDefault();
810
- if (onDismiss) {
811
- onDismiss(e);
812
- }
813
- setIsVisible(false);
814
- };
815
- if (!isVisible) {
816
- return null;
817
- }
818
- return /* @__PURE__ */ jsxs("span", { id, className: classes, ...props2, children: [
819
- icon && /* @__PURE__ */ jsx(Icon, { name: icon, size: big ? 3 : 2 }),
820
- " ",
821
- children || value,
822
- dismissible && /* @__PURE__ */ jsx(
823
- "button",
824
- {
825
- type: "button",
826
- className: "usx-tag__dismiss",
827
- "aria-label": "Dismiss tag",
828
- onClick: handleDismiss,
829
- children: /* @__PURE__ */ jsx(Icon, { name: "close", size: 2 })
830
- }
831
- )
832
- ] });
833
- };
834
- function Image({
835
- src,
836
- alt,
837
- href,
838
- rounded = false,
839
- circular = false,
840
- caption,
841
- hideCaption = false,
842
- objectFit = "",
843
- maxWidth,
844
- maxHeight,
845
- staticBaseUrl,
846
- srcSet,
847
- className = "",
848
- ...props2
849
- }) {
850
- const classes = ClassNames(
851
- "usx-image",
852
- {
853
- "usx-image--rounded": rounded,
854
- "usx-image--circular": circular,
855
- [`usx-object-fit-${objectFit}`]: objectFit
856
- },
857
- className
858
- );
859
- const style = {};
860
- if (maxWidth) style.maxWidth = maxWidth;
861
- if (maxHeight) style.maxHeight = maxHeight;
862
- if (maxHeight && !maxWidth) style.width = "auto";
863
- if (maxWidth && !maxHeight) style.height = "auto";
864
- const captionClasses = ClassNames(
865
- "usx-image--caption",
866
- { "usa-sr-only": hideCaption }
867
- );
868
- const isResponsive = src && typeof src === "object";
869
- const imgElement = !src ? "Image" : isResponsive ? /* @__PURE__ */ jsxs("picture", { children: [
870
- src.sources.map((source, i) => /* @__PURE__ */ jsx(
871
- "source",
872
- {
873
- ...source.media ? { media: source.media } : {},
874
- srcSet: getAssetSrcSet(source.srcSet, staticBaseUrl),
875
- ...source.type ? { type: source.type } : {},
876
- ...source.sizes ? { sizes: source.sizes } : {}
877
- },
878
- i
879
- )),
880
- /* @__PURE__ */ jsx("img", { src: getAssetUrl(src.fallback, staticBaseUrl), srcSet: srcSet ? getAssetSrcSet(srcSet, staticBaseUrl) : void 0, alt, style, ...props2 })
881
- ] }) : /* @__PURE__ */ jsx("img", { src: getAssetUrl(src, staticBaseUrl), srcSet: srcSet ? getAssetSrcSet(srcSet, staticBaseUrl) : void 0, alt, style, ...props2 });
882
- if (caption) {
883
- return /* @__PURE__ */ jsxs("figure", { className: classes, style, children: [
884
- href ? /* @__PURE__ */ jsx("a", { href, children: imgElement }) : imgElement,
885
- /* @__PURE__ */ jsx("figcaption", { className: captionClasses, children: caption })
886
- ] });
887
- }
888
- const Element = href ? "a" : "div";
889
- return /* @__PURE__ */ jsx(
890
- Element,
891
- {
892
- ...href ? { href } : {},
893
- className: classes,
894
- style,
895
- children: imgElement
896
- }
897
- );
898
- }
899
322
  function flattenChildren(children) {
900
323
  return React.Children.toArray(children).flatMap(
901
324
  (child) => React.isValidElement(child) && child.type === React.Fragment ? flattenChildren(child.props.children) : [child]
@@ -1010,35 +433,6 @@ function CardGroup({ cardProps = [], className = "", ...props2 }) {
1010
433
  );
1011
434
  return /* @__PURE__ */ jsx("ul", { className: classes, ...props2, children: cardProps.map((card, index) => /* @__PURE__ */ jsx(Card, { ...card, as: "li" }, index)) });
1012
435
  }
1013
- function Hint({
1014
- id,
1015
- children = null,
1016
- className = "",
1017
- ...props2
1018
- }) {
1019
- const classes = ClassNames("usa-hint", "usx-hint", className);
1020
- return /* @__PURE__ */ jsx("span", { className: classes, ...id ? { id } : {}, ...props2, children });
1021
- }
1022
- function ErrorMessage({
1023
- id,
1024
- children = null,
1025
- className = "",
1026
- ...props2
1027
- }) {
1028
- const classes = ClassNames("usa-error-message", "usx-error-message", className);
1029
- return /* @__PURE__ */ jsx("span", { className: classes, role: "alert", ...id ? { id } : {}, ...props2, children });
1030
- }
1031
- function FormGroup({ children = null, className = "", error = false, ...props2 }) {
1032
- const classes = ClassNames(
1033
- "usa-form-group",
1034
- "usx-form-group",
1035
- {
1036
- "usa-form-group--error": error
1037
- },
1038
- className
1039
- );
1040
- return /* @__PURE__ */ jsx("div", { className: classes, ...props2, children });
1041
- }
1042
436
  function Input({
1043
437
  label,
1044
438
  id,
@@ -1078,7 +472,7 @@ function Input({
1078
472
  required,
1079
473
  "aria-describedby": describedByParts.length ? describedByParts.join(" ") : void 0,
1080
474
  "aria-invalid": hasError ? true : void 0,
1081
- ...value !== void 0 ? { value } : { defaultValue },
475
+ ...value != null ? { value } : { defaultValue },
1082
476
  ...props2
1083
477
  };
1084
478
  const content = /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -1089,56 +483,6 @@ function Input({
1089
483
  ] });
1090
484
  return formGroup ? /* @__PURE__ */ jsx(FormGroup, { error: hasError, children: content }) : content;
1091
485
  }
1092
- const TextArea = ({
1093
- label = null,
1094
- id,
1095
- placeholder = "",
1096
- disabled = false,
1097
- required = false,
1098
- defaultValue = "",
1099
- value,
1100
- hint = null,
1101
- screenReaderOnlyLabel = false,
1102
- error = null,
1103
- success = null,
1104
- formGroup = true,
1105
- className = "",
1106
- ...props2
1107
- }) => {
1108
- const textAreaId = id || `textarea-${Math.random().toString(36).substr(2, 9)}`;
1109
- const hasError = !!error;
1110
- const hasSuccess = !!success;
1111
- const classes = ClassNames(
1112
- "usa-textarea",
1113
- "usx-textarea",
1114
- hasError ? "usa-input--error" : hasSuccess ? "usa-input--success" : null,
1115
- className
1116
- );
1117
- const hintId = hint ? `${textAreaId}-hint` : void 0;
1118
- const describedByParts = [];
1119
- if (hintId) describedByParts.push(hintId);
1120
- if (hasError && typeof error === "string") describedByParts.push(`${textAreaId}-error`);
1121
- const content = /* @__PURE__ */ jsxs(Fragment, { children: [
1122
- label && /* @__PURE__ */ jsx(Label, { htmlFor: textAreaId, required, screenReaderOnly: screenReaderOnlyLabel, error: hasError, children: label }),
1123
- hint && /* @__PURE__ */ jsx(Hint, { id: hintId, children: hint }),
1124
- hasError && typeof error === "string" && /* @__PURE__ */ jsx(ErrorMessage, { id: `${textAreaId}-error`, children: error }),
1125
- /* @__PURE__ */ jsx(
1126
- "textarea",
1127
- {
1128
- id: textAreaId,
1129
- className: classes,
1130
- placeholder,
1131
- disabled,
1132
- ...value !== void 0 ? { value } : { defaultValue },
1133
- ...required ? { required: true } : {},
1134
- "aria-describedby": describedByParts.length ? describedByParts.join(" ") : void 0,
1135
- "aria-invalid": hasError ? "true" : void 0,
1136
- ...props2
1137
- }
1138
- )
1139
- ] });
1140
- return formGroup ? /* @__PURE__ */ jsx(FormGroup, { error: hasError, children: content }) : content;
1141
- };
1142
486
  function CharacterCount({
1143
487
  id,
1144
488
  label = null,
@@ -1153,6 +497,7 @@ function CharacterCount({
1153
497
  textArea = false,
1154
498
  className = "",
1155
499
  extraAttributes,
500
+ defaultValue = "",
1156
501
  ...props2
1157
502
  }) {
1158
503
  const fieldId = id || `character-count-${Math.random().toString(36).substr(2, 9)}`;
@@ -1174,6 +519,7 @@ function CharacterCount({
1174
519
  formGroup: true,
1175
520
  className: "usa-character-count__field",
1176
521
  "aria-describedby": [infoId, hintId, errorId].filter(Boolean).join(" "),
522
+ defaultValue,
1177
523
  ...props2,
1178
524
  ...extraAttributes
1179
525
  };
@@ -1333,43 +679,6 @@ const CheckboxGroup = ({
1333
679
  );
1334
680
  }) }) });
1335
681
  };
1336
- function ClickableLink({
1337
- children,
1338
- className,
1339
- as: Tag2 = "span",
1340
- colorChange = false,
1341
- bgColorChange = false,
1342
- ...rest
1343
- }) {
1344
- const classes = ClassNames(
1345
- "usx-clickable__link",
1346
- colorChange && "usx-clickable__color-on-hover",
1347
- bgColorChange && "usx-clickable__bg-color-on-hover",
1348
- className
1349
- );
1350
- return /* @__PURE__ */ jsx(Tag2, { className: classes, ...rest, children });
1351
- }
1352
- function ClickableColorChange({ children, className, as: Tag2 = "span", ...rest }) {
1353
- return /* @__PURE__ */ jsx(Tag2, { className: ClassNames("usx-clickable__color-on-hover", className), ...rest, children });
1354
- }
1355
- function ClickableBgColorChange({ children, className, as: Tag2 = "span", ...rest }) {
1356
- return /* @__PURE__ */ jsx(Tag2, { className: ClassNames("usx-clickable__bg-color-on-hover", className), ...rest, children });
1357
- }
1358
- function Clickable({ className, children, ...rest }) {
1359
- const classes = ClassNames("usx-clickable", className);
1360
- if ("href" in rest && rest.href !== void 0) {
1361
- return /* @__PURE__ */ jsx("a", { className: classes, ...rest, children });
1362
- }
1363
- return /* @__PURE__ */ jsx("button", { type: "button", className: classes, ...rest, children });
1364
- }
1365
- Clickable.Link = ClickableLink;
1366
- Clickable.ColorChange = ClickableColorChange;
1367
- Clickable.BgColorChange = ClickableBgColorChange;
1368
- function copyTextToClipboard(text) {
1369
- if (window.navigator.clipboard) {
1370
- return window.navigator.clipboard.writeText(text);
1371
- }
1372
- }
1373
682
  function CopyToClipboard({
1374
683
  copyText = "",
1375
684
  label = null,
@@ -1382,7 +691,8 @@ function CopyToClipboard({
1382
691
  {
1383
692
  ghost: true,
1384
693
  className: ClassNames("usx-copy", className),
1385
- onClick: () => copyTextToClipboard(copyText),
694
+ extraAttributes: { "data-usx-copy": copyText },
695
+ "aria-label": label ? void 0 : "Copy to clipboard",
1386
696
  type: "button",
1387
697
  children: [
1388
698
  /* @__PURE__ */ jsx(Icon, { name: "content_copy", className: "usx-copy__copy", staticBaseUrl }),
@@ -2846,35 +2156,6 @@ function DateRangePicker({
2846
2156
  }
2847
2157
  );
2848
2158
  }
2849
- function Summary({
2850
- label = "Details",
2851
- children,
2852
- ariaLabel,
2853
- className = "",
2854
- textClassName = "",
2855
- markerColor = void 0,
2856
- underlineColor = void 0,
2857
- noUnderline = false,
2858
- noMarker = false,
2859
- unstyled = false
2860
- }) {
2861
- if (unstyled) {
2862
- return /* @__PURE__ */ jsx("summary", { className: className || void 0, "aria-label": ariaLabel, children: children ?? label });
2863
- }
2864
- const summaryClassNames = ClassNames(
2865
- "usx-summary",
2866
- { [`marker-${markerColor}`]: markerColor && !noMarker },
2867
- { "usx-summary--no-marker": noMarker },
2868
- { "usx-summary--no-underline": noUnderline },
2869
- className
2870
- );
2871
- const summaryTextClassNames = ClassNames(
2872
- "usx-summary-text",
2873
- { [`underline-${underlineColor}`]: !noUnderline && underlineColor },
2874
- textClassName
2875
- );
2876
- return /* @__PURE__ */ jsx("summary", { className: summaryClassNames, "aria-label": ariaLabel, children: /* @__PURE__ */ jsx("span", { className: summaryTextClassNames, children: children ?? (label || "Details") }) });
2877
- }
2878
2159
  function Details({
2879
2160
  summaryProps = {},
2880
2161
  text = "",
@@ -2978,42 +2259,14 @@ function Drawer({
2978
2259
  )
2979
2260
  ] });
2980
2261
  }
2981
- function Link({
2982
- href = "javascript:void(0);",
2983
- text,
2984
- children,
2985
- visited = false,
2986
- external = false,
2987
- alt = false,
2988
- newTab = false,
2989
- className = "",
2990
- ...props2
2991
- }) {
2992
- const classes = ClassNames(
2993
- "usa-link",
2994
- "usx-link",
2995
- visited && "usx-link--visited",
2996
- external && "usa-link--external",
2997
- alt && "usa-link--alt",
2998
- className
2999
- );
3000
- return /* @__PURE__ */ jsx(
3001
- "a",
3002
- {
3003
- href,
3004
- className: classes,
3005
- target: newTab || external ? "_blank" : void 0,
3006
- rel: newTab || external ? "noreferrer noopener" : void 0,
3007
- ...props2,
3008
- children: children ?? text
3009
- }
3010
- );
3011
- }
3012
2262
  function Page({
3013
2263
  id = void 0,
3014
2264
  title = "Page title",
3015
2265
  titleId = void 0,
3016
2266
  eyebrow = null,
2267
+ subtitle = void 0,
2268
+ description = void 0,
2269
+ tagProps = void 0,
3017
2270
  as: Element = "main",
3018
2271
  children = null,
3019
2272
  content = null,
@@ -3022,6 +2275,7 @@ function Page({
3022
2275
  className = "",
3023
2276
  ...props2
3024
2277
  }) {
2278
+ const hasSummary = Boolean(subtitle || description || (tagProps == null ? void 0 : tagProps.length));
3025
2279
  const classes = ClassNames("usx-page", className);
3026
2280
  const pageContent = children || content;
3027
2281
  const labelledBy = ariaLabelledby || titleId || void 0;
@@ -3038,6 +2292,11 @@ function Page({
3038
2292
  eyebrow ? /* @__PURE__ */ jsx("span", { className: "usx-eyebrow", children: eyebrow }) : null,
3039
2293
  title
3040
2294
  ] }),
2295
+ hasSummary && /* @__PURE__ */ jsxs("div", { className: "usx-page__summary", children: [
2296
+ subtitle && /* @__PURE__ */ jsx("p", { className: "usx-page__subtitle", children: subtitle }),
2297
+ (tagProps == null ? void 0 : tagProps.length) ? /* @__PURE__ */ jsx(TagGroup, { className: "usx-page__tags", tagProps }) : null,
2298
+ description && /* @__PURE__ */ jsx("p", { className: "usx-page__description", children: description })
2299
+ ] }),
3041
2300
  /* @__PURE__ */ jsx("div", { className: "usx-page__content", children: pageContent })
3042
2301
  ]
3043
2302
  }
@@ -3167,10 +2426,10 @@ function getEntryDisplay(entry) {
3167
2426
  if (entry.file) return { name: entry.file.name, size: entry.file.size, url: entry.url };
3168
2427
  return { name: entry.name, size: entry.size, url: entry.url };
3169
2428
  }
3170
- function FileList({ files, hint = "Selected files", onRemove = null, disabled = false, className = "" }) {
2429
+ function FileList({ files, hint = "Selected files", onRemove = null, disabled = false, slim = false, className = "" }) {
3171
2430
  if (!files || files.length === 0) return null;
3172
2431
  const lastEntry = getEntryDisplay(files[files.length - 1]);
3173
- return /* @__PURE__ */ jsxs("div", { className: ClassNames("usx-file-input__list", "margin-top-1", className), children: [
2432
+ return /* @__PURE__ */ jsxs("div", { className: ClassNames("usx-file-input__list", "margin-top-1", slim && "usx-file-list--slim", className), children: [
3174
2433
  /* @__PURE__ */ jsx("span", { className: "usa-sr-only", "aria-live": "polite", children: `You have selected the file: ${lastEntry.name}.` }),
3175
2434
  hint && /* @__PURE__ */ jsx("span", { className: "usa-hint usx-hint usx-file-input__list-heading", children: hint }),
3176
2435
  /* @__PURE__ */ jsx("ul", { className: "usx-file-input__file-list", children: files.map((entry) => {
@@ -3570,7 +2829,7 @@ function Search({
3570
2829
  label,
3571
2830
  screenReaderOnlyLabel: true,
3572
2831
  placeholder: placeholder ?? "",
3573
- ...value !== void 0 ? { value } : { defaultValue },
2832
+ ...value != null ? { value } : { defaultValue },
3574
2833
  onChange,
3575
2834
  type: "search",
3576
2835
  name: searchKey,
@@ -3821,7 +3080,7 @@ function renderContent(content) {
3821
3080
  }
3822
3081
  return content;
3823
3082
  }
3824
- function IconList({ items = [], primary = false, size = null, className = "", ...props2 }) {
3083
+ function IconList({ items = [], caption, primary = false, size = null, className = "", ...props2 }) {
3825
3084
  const classes = ClassNames(
3826
3085
  "usa-icon-list",
3827
3086
  "usx-icon-list",
@@ -3829,7 +3088,7 @@ function IconList({ items = [], primary = false, size = null, className = "", ..
3829
3088
  size === "lg" && "usa-icon-list--size-lg",
3830
3089
  className
3831
3090
  );
3832
- return /* @__PURE__ */ jsx("ul", { className: classes, ...props2, children: items.map((item, index) => /* @__PURE__ */ jsxs("li", { className: ClassNames("usa-icon-list__item", item.itemClassName), children: [
3091
+ const list = /* @__PURE__ */ jsx("ul", { className: classes, ...props2, children: items.map((item, index) => /* @__PURE__ */ jsxs("li", { className: ClassNames("usa-icon-list__item", item.itemClassName), children: [
3833
3092
  /* @__PURE__ */ jsx("div", { className: ClassNames("usa-icon-list__icon", item.iconColor && `text-${item.iconColor}`, item.iconClassName), children: /* @__PURE__ */ jsx(
3834
3093
  Icon,
3835
3094
  {
@@ -3844,6 +3103,10 @@ function IconList({ items = [], primary = false, size = null, className = "", ..
3844
3103
  renderContent(item.content)
3845
3104
  ] })
3846
3105
  ] }, index)) });
3106
+ return caption ? /* @__PURE__ */ jsxs("figure", { className: "usx-list-figure", children: [
3107
+ /* @__PURE__ */ jsx("figcaption", { className: "usx-list-figure__caption", children: caption }),
3108
+ list
3109
+ ] }) : list;
3847
3110
  }
3848
3111
  const defaultRequiredLinks = {
3849
3112
  en: [
@@ -4270,7 +3533,7 @@ function renderItems(items = [], parentOptions = {}) {
4270
3533
  ] }, index);
4271
3534
  });
4272
3535
  }
4273
- function List({ items = [], ordered = false, unstyled = false, className = "", ...props2 }) {
3536
+ function List({ items = [], caption, ordered = false, unstyled = false, className = "", ...props2 }) {
4274
3537
  const classes = ClassNames(
4275
3538
  "usa-list",
4276
3539
  "usx-list",
@@ -4278,7 +3541,11 @@ function List({ items = [], ordered = false, unstyled = false, className = "", .
4278
3541
  className
4279
3542
  );
4280
3543
  const Tag2 = ordered ? "ol" : "ul";
4281
- return /* @__PURE__ */ jsx(Tag2, { className: classes, ...props2, children: renderItems(items, { ordered, unstyled }) });
3544
+ const list = /* @__PURE__ */ jsx(Tag2, { className: classes, ...props2, children: renderItems(items, { ordered, unstyled }) });
3545
+ return caption ? /* @__PURE__ */ jsxs("figure", { className: "usx-list-figure", children: [
3546
+ /* @__PURE__ */ jsx("figcaption", { className: "usx-list-figure__caption", children: caption }),
3547
+ list
3548
+ ] }) : list;
4282
3549
  }
4283
3550
  const MONTH_OPTIONS = [
4284
3551
  { value: "1", label: "January" },
@@ -4529,109 +3796,6 @@ function Modal({
4529
3796
  }
4530
3797
  );
4531
3798
  }
4532
- function PopoverMenu({ items, prefix, panelShape, className, ...props2 }) {
4533
- const generatedPrefix = React.useId();
4534
- const base = prefix ?? generatedPrefix;
4535
- return /* @__PURE__ */ jsx("ul", { ...props2, className: ClassNames("usx-popover__menu", className), children: items.map((item, index) => {
4536
- const id = item.id ?? `${base}-${index}`;
4537
- return /* @__PURE__ */ jsxs("li", { children: [
4538
- item.type === "details" && /* @__PURE__ */ jsx(
4539
- Popover,
4540
- {
4541
- id,
4542
- summaryProps: {
4543
- ...item.summaryProps,
4544
- className: ClassNames(item.summaryProps.className, "usx-popover__menu-item")
4545
- },
4546
- name: base,
4547
- side: "right",
4548
- panelShape,
4549
- menuItems: item.items
4550
- }
4551
- ),
4552
- item.type === "link" && /* @__PURE__ */ jsx(
4553
- Link,
4554
- {
4555
- href: item.href,
4556
- text: item.text,
4557
- className: "usx-no-visited usx-popover__menu-item"
4558
- }
4559
- ),
4560
- item.type === "text" && /* @__PURE__ */ jsx("span", { className: "usx-popover__menu-item", children: item.text })
4561
- ] }, id);
4562
- }) });
4563
- }
4564
- function Popover({
4565
- id,
4566
- side = "bottom",
4567
- align = "start",
4568
- panelShape = "rounded",
4569
- defaultOpen = false,
4570
- menuItems,
4571
- showClose = false,
4572
- closeLabel = "Close",
4573
- panelHeading,
4574
- headingAs = "h2",
4575
- scrollable = false,
4576
- className,
4577
- summaryProps,
4578
- panelClassName,
4579
- contentClassName,
4580
- extraAttributes,
4581
- children,
4582
- ...props2
4583
- }) {
4584
- const [initiallyOpen] = React.useState(defaultOpen);
4585
- const composedSummaryProps = { ...summaryProps, label: (summaryProps == null ? void 0 : summaryProps.label) ?? "Open panel" };
4586
- const Heading = headingAs;
4587
- return /* @__PURE__ */ jsxs(
4588
- "details",
4589
- {
4590
- ...props2,
4591
- className: ClassNames("usx-popover", className),
4592
- open: initiallyOpen || void 0,
4593
- "data-side": side,
4594
- "data-align": align,
4595
- ...extraAttributes,
4596
- children: [
4597
- /* @__PURE__ */ jsx(Summary, { unstyled: true, ...composedSummaryProps }),
4598
- /* @__PURE__ */ jsxs(
4599
- "div",
4600
- {
4601
- id,
4602
- className: ClassNames("usx-popover__panel", {
4603
- "usx-popover__panel--square": panelShape === "square"
4604
- }, panelClassName),
4605
- children: [
4606
- panelHeading && /* @__PURE__ */ jsx(Heading, { className: "usx-popover__panel-heading", children: panelHeading }),
4607
- menuItems && /* @__PURE__ */ jsx(PopoverMenu, { items: menuItems, prefix: id, panelShape }),
4608
- children && /* @__PURE__ */ jsx(
4609
- "div",
4610
- {
4611
- className: ClassNames(
4612
- "usx-popover__panel-content",
4613
- { "usx-popover__scroll": scrollable },
4614
- contentClassName
4615
- ),
4616
- children
4617
- }
4618
- ),
4619
- showClose && /* @__PURE__ */ jsx(
4620
- Button,
4621
- {
4622
- variant: "unstyled",
4623
- className: "usx-popover__panel-close",
4624
- "data-usx-popover-close": id,
4625
- children: closeLabel
4626
- }
4627
- )
4628
- ]
4629
- }
4630
- )
4631
- ]
4632
- }
4633
- );
4634
- }
4635
3799
  const ProcessList = ({ items = [], className = "", ...props2 }) => {
4636
3800
  const classes = ClassNames("usa-process-list", "usx-process-list", className);
4637
3801
  return /* @__PURE__ */ jsx("ol", { className: classes, ...props2, children: items.map((item, index) => {
@@ -4654,27 +3818,34 @@ function Quote({
4654
3818
  ...props2
4655
3819
  }) {
4656
3820
  const isVertical = (calloutProps == null ? void 0 : calloutProps.orientation) === "vertical";
4657
- return /* @__PURE__ */ jsxs("div", { className: ClassNames("usx-quote", isVertical && "usx-quote--vertical", className), ...props2, children: [
4658
- !isVertical && /* @__PURE__ */ jsx(Icon, { name: "format_quote", size: 4, className: "usx-quote__icon" }),
4659
- /* @__PURE__ */ jsx(Callout, { ...calloutProps, as: "div", children: /* @__PURE__ */ jsxs("figure", { className: "usx-quote__body", children: [
4660
- /* @__PURE__ */ jsxs(
4661
- "blockquote",
4662
- {
4663
- className: ClassNames("usx-quote__content", blockquoteClassName),
4664
- cite: sourceLinkProps == null ? void 0 : sourceLinkProps.href,
4665
- children: [
4666
- isVertical && "❝",
4667
- children ?? content,
4668
- isVertical && "❞"
4669
- ]
4670
- }
4671
- ),
4672
- (attributionProps || sourceTitle) && /* @__PURE__ */ jsxs("figcaption", { className: "usx-quote__attribution", children: [
4673
- attributionProps && /* @__PURE__ */ jsx(Attribution, { ...attributionProps }),
4674
- sourceTitle && /* @__PURE__ */ jsx("cite", { children: sourceLinkProps ? /* @__PURE__ */ jsx(Link, { ...sourceLinkProps, children: sourceTitle }) : sourceTitle })
4675
- ] })
4676
- ] }) })
4677
- ] });
3821
+ return /* @__PURE__ */ jsxs(
3822
+ "div",
3823
+ {
3824
+ className: ClassNames("usx-quote", isVertical && "usx-quote--vertical", className),
3825
+ ...props2,
3826
+ children: [
3827
+ !isVertical && /* @__PURE__ */ jsx(Icon, { name: "format_quote", size: 4, className: "usx-quote__icon" }),
3828
+ /* @__PURE__ */ jsx(Callout, { ...calloutProps, as: "div", children: /* @__PURE__ */ jsxs("figure", { className: "usx-quote__body", children: [
3829
+ /* @__PURE__ */ jsxs(
3830
+ "blockquote",
3831
+ {
3832
+ className: ClassNames("usx-quote__content", blockquoteClassName),
3833
+ cite: sourceLinkProps == null ? void 0 : sourceLinkProps.href,
3834
+ children: [
3835
+ isVertical && "❝",
3836
+ children ?? content,
3837
+ isVertical && "❞"
3838
+ ]
3839
+ }
3840
+ ),
3841
+ (attributionProps || sourceTitle) && /* @__PURE__ */ jsxs("figcaption", { className: "usx-quote__attribution", children: [
3842
+ attributionProps && /* @__PURE__ */ jsx(Attribution, { ...attributionProps }),
3843
+ sourceTitle && /* @__PURE__ */ jsx("cite", { children: (sourceLinkProps == null ? void 0 : sourceLinkProps.href) ? /* @__PURE__ */ jsx(Link, { ...sourceLinkProps, children: sourceTitle }) : sourceTitle })
3844
+ ] })
3845
+ ] }) })
3846
+ ]
3847
+ }
3848
+ );
4678
3849
  }
4679
3850
  function RangeSlider({
4680
3851
  id = "range-slider",
@@ -5045,19 +4216,6 @@ function Table({
5045
4216
  }
5046
4217
  ) : table;
5047
4218
  }
5048
- const TagGroup = ({
5049
- tagProps = null,
5050
- children = null,
5051
- className = "",
5052
- ...props2
5053
- }) => {
5054
- const classes = ClassNames(
5055
- "usx-tag-group",
5056
- className
5057
- );
5058
- const content = children ? children : Array.isArray(tagProps) ? tagProps.map((t, i) => /* @__PURE__ */ jsx(Tag, { ...t }, t.id || t.value || i)) : null;
5059
- return /* @__PURE__ */ jsx("div", { className: classes, ...props2, children: content });
5060
- };
5061
4219
  function TaskList({ tasks = [], className }) {
5062
4220
  return /* @__PURE__ */ jsx("ul", { className: ClassNames("usx-task-list", className), children: tasks == null ? void 0 : tasks.map((task, i) => {
5063
4221
  return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(Clickable, { href: task.href, className: "usx-task-list__item", children: [
@@ -5074,67 +4232,107 @@ function ThemePicker({
5074
4232
  name,
5075
4233
  label = "Theme",
5076
4234
  themes = [],
4235
+ variant = "default",
5077
4236
  value,
5078
4237
  defaultValue,
5079
4238
  onChange,
5080
4239
  className = "",
5081
4240
  extraAttributes
5082
4241
  }) {
5083
- var _a;
4242
+ var _a, _b, _c, _d, _e, _f;
5084
4243
  const selectId = id || "theme-picker";
5085
- const selection = value !== void 0 ? { value } : { defaultValue: defaultValue ?? ((_a = themes[0]) == null ? void 0 : _a.value) };
5086
- return /* @__PURE__ */ jsxs("div", { className: ClassNames("usx-theme-picker", className), ...extraAttributes, children: [
4244
+ const [localValue, setLocalValue] = React.useState(defaultValue ?? ((_a = themes[0]) == null ? void 0 : _a.value) ?? "");
4245
+ const selectedValue = value ?? localValue;
4246
+ const selectedLabel = ((_b = themes.find((option) => option.value === selectedValue)) == null ? void 0 : _b.label) ?? label;
4247
+ const choose = (next) => {
4248
+ if (value === void 0) setLocalValue(next);
4249
+ onChange == null ? void 0 : onChange(next);
4250
+ };
4251
+ const select = (hidden = false) => /* @__PURE__ */ jsxs(Fragment, { children: [
4252
+ /* @__PURE__ */ jsx(Label, { htmlFor: selectId, screenReaderOnly: true, children: label }),
5087
4253
  /* @__PURE__ */ jsx(
5088
- "button",
4254
+ "select",
5089
4255
  {
5090
- type: "button",
5091
- className: "usa-button usx-button usx-button--ghost usx-theme-picker__trigger",
5092
- "aria-label": label,
5093
- "aria-expanded": "false",
5094
- "aria-controls": `${selectId}-panel`,
5095
- children: /* @__PURE__ */ jsx(PaletteIcon, {})
4256
+ id: selectId,
4257
+ name,
4258
+ className: ClassNames(
4259
+ "usa-select usx-select",
4260
+ hidden && "usx-theme-picker__select--hidden"
4261
+ ),
4262
+ value: selectedValue,
4263
+ onChange: (event) => choose(event.target.value),
4264
+ children: themes.map((option) => /* @__PURE__ */ jsx("option", { value: option.value, children: option.label }, option.value))
5096
4265
  }
5097
- ),
5098
- /* @__PURE__ */ jsxs("div", { id: `${selectId}-panel`, className: "usx-theme-picker__panel", children: [
5099
- /* @__PURE__ */ jsx(Label, { htmlFor: selectId, screenReaderOnly: true, children: label }),
5100
- /* @__PURE__ */ jsx(
5101
- "select",
5102
- {
5103
- id: selectId,
5104
- name,
5105
- className: "usa-select usx-select",
5106
- ...selection,
5107
- onChange: (event) => onChange == null ? void 0 : onChange(event.target.value),
5108
- children: themes.map((option) => /* @__PURE__ */ jsx("option", { value: option.value, children: option.label }, option.value))
5109
- }
5110
- ),
5111
- /* @__PURE__ */ jsx(
5112
- "button",
5113
- {
5114
- type: "button",
5115
- className: "usa-button usx-button usa-button--primary usx-theme-picker__toggle",
5116
- "aria-label": "Confirm theme",
5117
- children: /* @__PURE__ */ jsx(Icon, { name: "close", className: "usx-theme-picker__icon" })
5118
- }
5119
- )
5120
- ] })
4266
+ )
5121
4267
  ] });
5122
- }
5123
- function PaletteIcon() {
5124
- return /* @__PURE__ */ jsx(
5125
- "svg",
4268
+ return /* @__PURE__ */ jsxs(
4269
+ "div",
5126
4270
  {
5127
- className: "usa-icon usx-theme-picker__icon",
5128
- "aria-hidden": "true",
5129
- focusable: "false",
5130
- viewBox: "0 0 24 24",
5131
- children: /* @__PURE__ */ jsx(
5132
- "path",
5133
- {
5134
- fill: "currentColor",
5135
- d: "M12 3c-4.97 0-9 4.03-9 9s4.03 9 9 9c.83 0 1.5-.67 1.5-1.5 0-.39-.15-.74-.39-1.01-.23-.26-.38-.61-.38-.99 0-.83.67-1.5 1.5-1.5H16c2.76 0 5-2.24 5-5 0-4.42-4.03-8-9-8zm-5.5 9c-.83 0-1.5-.67-1.5-1.5S5.67 9 6.5 9 8 9.67 8 10.5 7.33 12 6.5 12zm3-4C8.67 8 8 7.33 8 6.5S8.67 5 9.5 5s1.5.67 1.5 1.5S10.33 8 9.5 8zm5 0c-.83 0-1.5-.67-1.5-1.5S13.67 5 14.5 5s1.5.67 1.5 1.5S15.33 8 14.5 8zm3 4c-.83 0-1.5-.67-1.5-1.5S16.67 9 17.5 9s1.5.67 1.5 1.5-.67 1.5-1.5 1.5z"
5136
- }
5137
- )
4271
+ className: ClassNames(
4272
+ "usx-theme-picker",
4273
+ variant !== "default" && `usx-theme-picker--${variant}`,
4274
+ className
4275
+ ),
4276
+ ...extraAttributes,
4277
+ children: [
4278
+ variant === "default" && /* @__PURE__ */ jsxs(Fragment, { children: [
4279
+ /* @__PURE__ */ jsx(
4280
+ "button",
4281
+ {
4282
+ type: "button",
4283
+ className: "usa-button usx-button usx-button--ghost usx-theme-picker__trigger",
4284
+ "aria-label": label,
4285
+ "aria-expanded": "false",
4286
+ "aria-controls": `${selectId}-panel`,
4287
+ children: /* @__PURE__ */ jsx(Icon, { name: "color_palette", source: "usx", className: "usx-theme-picker__icon" })
4288
+ }
4289
+ ),
4290
+ /* @__PURE__ */ jsxs("div", { id: `${selectId}-panel`, className: "usx-theme-picker__panel", children: [
4291
+ select(),
4292
+ /* @__PURE__ */ jsx(
4293
+ "button",
4294
+ {
4295
+ type: "button",
4296
+ className: "usa-button usx-button usa-button--primary usx-theme-picker__toggle",
4297
+ "aria-label": "Confirm theme",
4298
+ children: /* @__PURE__ */ jsx(Icon, { name: "close", className: "usx-theme-picker__icon" })
4299
+ }
4300
+ )
4301
+ ] })
4302
+ ] }),
4303
+ variant === "swap" && /* @__PURE__ */ jsxs(Fragment, { children: [
4304
+ /* @__PURE__ */ jsx(
4305
+ Swap,
4306
+ {
4307
+ className: "usx-theme-picker__swap usa-button usx-button usx-button--ghost",
4308
+ variant: "rotate",
4309
+ inputProps: {
4310
+ checked: selectedValue === ((_c = themes[1]) == null ? void 0 : _c.value),
4311
+ "aria-label": `${label}: ${selectedLabel}. Switch to ${selectedValue === ((_d = themes[1]) == null ? void 0 : _d.value) ? (_e = themes[0]) == null ? void 0 : _e.label : (_f = themes[1]) == null ? void 0 : _f.label}`,
4312
+ onChange: (event) => {
4313
+ var _a2;
4314
+ event.stopPropagation();
4315
+ choose(((_a2 = themes[event.target.checked ? 1 : 0]) == null ? void 0 : _a2.value) ?? "");
4316
+ }
4317
+ },
4318
+ offContent: /* @__PURE__ */ jsx(Icon, { name: "sun", source: "usx", className: "usx-theme-picker__icon" }),
4319
+ onContent: /* @__PURE__ */ jsx(Icon, { name: "moon", source: "usx", className: "usx-theme-picker__icon" })
4320
+ }
4321
+ ),
4322
+ /* @__PURE__ */ jsx("div", { className: "usx-theme-picker__fallback", children: select() })
4323
+ ] }),
4324
+ variant === "ghost-select" && /* @__PURE__ */ jsxs("div", { className: "usx-theme-picker__ghost", children: [
4325
+ /* @__PURE__ */ jsx(
4326
+ "span",
4327
+ {
4328
+ className: "usa-button usx-button usx-button--ghost usx-theme-picker__ghost-face",
4329
+ "aria-hidden": "true",
4330
+ children: /* @__PURE__ */ jsx(Icon, { name: "color_palette", source: "usx", className: "usx-theme-picker__icon" })
4331
+ }
4332
+ ),
4333
+ select(true)
4334
+ ] })
4335
+ ]
5138
4336
  }
5139
4337
  );
5140
4338
  }
@@ -5335,7 +4533,7 @@ export {
5335
4533
  Alert,
5336
4534
  Attribution,
5337
4535
  Avatar,
5338
- AvatarGroup,
4536
+ k as AvatarGroup,
5339
4537
  BackToTop,
5340
4538
  Banner,
5341
4539
  Breadcrumb,
@@ -5389,7 +4587,7 @@ export {
5389
4587
  Modal,
5390
4588
  Page,
5391
4589
  Pagination,
5392
- Popover,
4590
+ P as Popover,
5393
4591
  ProcessList,
5394
4592
  Prose,
5395
4593
  Quote,
@@ -5402,7 +4600,7 @@ export {
5402
4600
  SideNav,
5403
4601
  SiteAlert,
5404
4602
  Skipnav,
5405
- Spinner,
4603
+ l as Spinner,
5406
4604
  Status,
5407
4605
  StepIndicator,
5408
4606
  Summary,