@solexllc/usx-react 0.11.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 (181) 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 +4428 -5290
  7. package/dist/index.js +58 -917
  8. package/package.json +7 -3
  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 +25 -18
  123. package/src/components/code/code.react-snapshot.html +41 -4
  124. package/src/components/copy-to-clipboard/CopyToClipboard.tsx +2 -7
  125. package/src/components/copy-to-clipboard/copy-to-clipboard.django-snapshot.html +6 -4
  126. package/src/components/copy-to-clipboard/copy-to-clipboard.django.html +3 -2
  127. package/src/components/copy-to-clipboard/copy-to-clipboard.react-snapshot.html +14 -2
  128. package/src/components/file-list/FileList.tsx +3 -2
  129. package/src/components/file-list/config.json +5 -0
  130. package/src/components/file-list/file-list.django-snapshot.html +63 -0
  131. package/src/components/file-list/file-list.django.html +1 -1
  132. package/src/components/file-list/file-list.react-snapshot.html +53 -0
  133. package/src/components/footer/footer.django-snapshot.html +0 -3
  134. package/src/components/header/header.django-snapshot.html +0 -160
  135. package/src/components/header/header.django.html +2 -2
  136. package/src/components/hero/hero.django-snapshot.html +0 -20
  137. package/src/components/hero/hero.django.html +3 -3
  138. package/src/components/image/image.django.html +4 -4
  139. package/src/components/input/Input.tsx +1 -1
  140. package/src/components/input/config.json +2 -3
  141. package/src/components/input/input.django-snapshot.html +4 -21
  142. package/src/components/input/input.django.html +2 -2
  143. package/src/components/link/Link.tsx +7 -4
  144. package/src/components/link/config.json +2 -3
  145. package/src/components/link/link.django-snapshot.html +8 -0
  146. package/src/components/link/link.django.html +2 -2
  147. package/src/components/link/link.html +4 -1
  148. package/src/components/link/link.react-snapshot.html +8 -0
  149. package/src/components/memorable-date/memorable-date.django-snapshot.html +0 -8
  150. package/src/components/memorable-date/memorable-date.django.html +2 -2
  151. package/src/components/misc-banner/misc-banner.django-snapshot.html +12 -12
  152. package/src/components/misc-banner/misc-banner.django.html +4 -2
  153. package/src/components/popover/Popover.tsx +60 -9
  154. package/src/components/popover/PopoverMenu.tsx +33 -15
  155. package/src/components/popover/config.json +88 -14
  156. package/src/components/popover/popover-menu.django.html +13 -2
  157. package/src/components/popover/popover.django-snapshot.html +229 -7
  158. package/src/components/popover/popover.django.html +3 -2
  159. package/src/components/popover/popover.react-snapshot.html +127 -4
  160. package/src/components/process-list/config.json +41 -3
  161. package/src/components/quote/Quote.tsx +9 -2
  162. package/src/components/search/Search.tsx +1 -1
  163. package/src/components/search/config.json +3 -4
  164. package/src/components/search/search.django-snapshot.html +262 -1684
  165. package/src/components/search/search.django.html +1 -20
  166. package/src/components/select/select.django-snapshot.html +7 -7
  167. package/src/components/select/select.react-snapshot.html +7 -7
  168. package/src/components/summary/Summary.tsx +4 -2
  169. package/src/components/summary/config.json +4 -0
  170. package/src/components/summary/summary.django.html +4 -4
  171. package/src/components/table/Table.tsx +58 -25
  172. package/src/components/table/config.json +61 -13
  173. package/src/components/tag/Tag.tsx +40 -7
  174. package/src/components/tag/config.json +18 -2
  175. package/src/components/tag/tag.django-snapshot.html +16 -1
  176. package/src/components/tag/tag.django.html +12 -6
  177. package/src/components/tag/tag.html +4 -0
  178. package/src/components/tag/tag.react-snapshot.html +16 -1
  179. package/src/components/tag-group/TagGroup.tsx +6 -9
  180. package/src/components/tag-group/config.json +4 -0
  181. package/src/components/tag-group/tag-group.django.html +1 -1
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,50 +2259,6 @@ 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
- const TagGroup = ({
3013
- tagProps = null,
3014
- children = null,
3015
- className = "",
3016
- ...props2
3017
- }) => {
3018
- const classes = ClassNames(
3019
- "usx-tag-group",
3020
- className
3021
- );
3022
- const content = children ? children : Array.isArray(tagProps) ? tagProps.map((t, i) => /* @__PURE__ */ jsx(Tag, { ...t }, t.id || t.value || i)) : null;
3023
- return /* @__PURE__ */ jsx("div", { className: classes, ...props2, children: content });
3024
- };
3025
2262
  function Page({
3026
2263
  id = void 0,
3027
2264
  title = "Page title",
@@ -3189,10 +2426,10 @@ function getEntryDisplay(entry) {
3189
2426
  if (entry.file) return { name: entry.file.name, size: entry.file.size, url: entry.url };
3190
2427
  return { name: entry.name, size: entry.size, url: entry.url };
3191
2428
  }
3192
- 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 = "" }) {
3193
2430
  if (!files || files.length === 0) return null;
3194
2431
  const lastEntry = getEntryDisplay(files[files.length - 1]);
3195
- 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: [
3196
2433
  /* @__PURE__ */ jsx("span", { className: "usa-sr-only", "aria-live": "polite", children: `You have selected the file: ${lastEntry.name}.` }),
3197
2434
  hint && /* @__PURE__ */ jsx("span", { className: "usa-hint usx-hint usx-file-input__list-heading", children: hint }),
3198
2435
  /* @__PURE__ */ jsx("ul", { className: "usx-file-input__file-list", children: files.map((entry) => {
@@ -3592,7 +2829,7 @@ function Search({
3592
2829
  label,
3593
2830
  screenReaderOnlyLabel: true,
3594
2831
  placeholder: placeholder ?? "",
3595
- ...value !== void 0 ? { value } : { defaultValue },
2832
+ ...value != null ? { value } : { defaultValue },
3596
2833
  onChange,
3597
2834
  type: "search",
3598
2835
  name: searchKey,
@@ -4559,109 +3796,6 @@ function Modal({
4559
3796
  }
4560
3797
  );
4561
3798
  }
4562
- function PopoverMenu({ items, prefix, panelShape, className, ...props2 }) {
4563
- const generatedPrefix = React.useId();
4564
- const base = prefix ?? generatedPrefix;
4565
- return /* @__PURE__ */ jsx("ul", { ...props2, className: ClassNames("usx-popover__menu", className), children: items.map((item, index) => {
4566
- const id = item.id ?? `${base}-${index}`;
4567
- return /* @__PURE__ */ jsxs("li", { children: [
4568
- item.type === "details" && /* @__PURE__ */ jsx(
4569
- Popover,
4570
- {
4571
- id,
4572
- summaryProps: {
4573
- ...item.summaryProps,
4574
- className: ClassNames(item.summaryProps.className, "usx-popover__menu-item")
4575
- },
4576
- name: base,
4577
- side: "right",
4578
- panelShape,
4579
- menuItems: item.items
4580
- }
4581
- ),
4582
- item.type === "link" && /* @__PURE__ */ jsx(
4583
- Link,
4584
- {
4585
- href: item.href,
4586
- text: item.text,
4587
- className: "usx-no-visited usx-popover__menu-item"
4588
- }
4589
- ),
4590
- item.type === "text" && /* @__PURE__ */ jsx("span", { className: "usx-popover__menu-item", children: item.text })
4591
- ] }, id);
4592
- }) });
4593
- }
4594
- function Popover({
4595
- id,
4596
- side = "bottom",
4597
- align = "start",
4598
- panelShape = "rounded",
4599
- defaultOpen = false,
4600
- menuItems,
4601
- showClose = false,
4602
- closeLabel = "Close",
4603
- panelHeading,
4604
- headingAs = "h2",
4605
- scrollable = false,
4606
- className,
4607
- summaryProps,
4608
- panelClassName,
4609
- contentClassName,
4610
- extraAttributes,
4611
- children,
4612
- ...props2
4613
- }) {
4614
- const [initiallyOpen] = React.useState(defaultOpen);
4615
- const composedSummaryProps = { ...summaryProps, label: (summaryProps == null ? void 0 : summaryProps.label) ?? "Open panel" };
4616
- const Heading = headingAs;
4617
- return /* @__PURE__ */ jsxs(
4618
- "details",
4619
- {
4620
- ...props2,
4621
- className: ClassNames("usx-popover", className),
4622
- open: initiallyOpen || void 0,
4623
- "data-side": side,
4624
- "data-align": align,
4625
- ...extraAttributes,
4626
- children: [
4627
- /* @__PURE__ */ jsx(Summary, { unstyled: true, ...composedSummaryProps }),
4628
- /* @__PURE__ */ jsxs(
4629
- "div",
4630
- {
4631
- id,
4632
- className: ClassNames("usx-popover__panel", {
4633
- "usx-popover__panel--square": panelShape === "square"
4634
- }, panelClassName),
4635
- children: [
4636
- panelHeading && /* @__PURE__ */ jsx(Heading, { className: "usx-popover__panel-heading", children: panelHeading }),
4637
- menuItems && /* @__PURE__ */ jsx(PopoverMenu, { items: menuItems, prefix: id, panelShape }),
4638
- children && /* @__PURE__ */ jsx(
4639
- "div",
4640
- {
4641
- className: ClassNames(
4642
- "usx-popover__panel-content",
4643
- { "usx-popover__scroll": scrollable },
4644
- contentClassName
4645
- ),
4646
- children
4647
- }
4648
- ),
4649
- showClose && /* @__PURE__ */ jsx(
4650
- Button,
4651
- {
4652
- variant: "unstyled",
4653
- className: "usx-popover__panel-close",
4654
- "data-usx-popover-close": id,
4655
- children: closeLabel
4656
- }
4657
- )
4658
- ]
4659
- }
4660
- )
4661
- ]
4662
- }
4663
- );
4664
- }
4665
3799
  const ProcessList = ({ items = [], className = "", ...props2 }) => {
4666
3800
  const classes = ClassNames("usa-process-list", "usx-process-list", className);
4667
3801
  return /* @__PURE__ */ jsx("ol", { className: classes, ...props2, children: items.map((item, index) => {
@@ -4684,27 +3818,34 @@ function Quote({
4684
3818
  ...props2
4685
3819
  }) {
4686
3820
  const isVertical = (calloutProps == null ? void 0 : calloutProps.orientation) === "vertical";
4687
- return /* @__PURE__ */ jsxs("div", { className: ClassNames("usx-quote", isVertical && "usx-quote--vertical", className), ...props2, children: [
4688
- !isVertical && /* @__PURE__ */ jsx(Icon, { name: "format_quote", size: 4, className: "usx-quote__icon" }),
4689
- /* @__PURE__ */ jsx(Callout, { ...calloutProps, as: "div", children: /* @__PURE__ */ jsxs("figure", { className: "usx-quote__body", children: [
4690
- /* @__PURE__ */ jsxs(
4691
- "blockquote",
4692
- {
4693
- className: ClassNames("usx-quote__content", blockquoteClassName),
4694
- cite: sourceLinkProps == null ? void 0 : sourceLinkProps.href,
4695
- children: [
4696
- isVertical && "❝",
4697
- children ?? content,
4698
- isVertical && "❞"
4699
- ]
4700
- }
4701
- ),
4702
- (attributionProps || sourceTitle) && /* @__PURE__ */ jsxs("figcaption", { className: "usx-quote__attribution", children: [
4703
- attributionProps && /* @__PURE__ */ jsx(Attribution, { ...attributionProps }),
4704
- sourceTitle && /* @__PURE__ */ jsx("cite", { children: sourceLinkProps ? /* @__PURE__ */ jsx(Link, { ...sourceLinkProps, children: sourceTitle }) : sourceTitle })
4705
- ] })
4706
- ] }) })
4707
- ] });
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
+ );
4708
3849
  }
4709
3850
  function RangeSlider({
4710
3851
  id = "range-slider",
@@ -5392,7 +4533,7 @@ export {
5392
4533
  Alert,
5393
4534
  Attribution,
5394
4535
  Avatar,
5395
- AvatarGroup,
4536
+ k as AvatarGroup,
5396
4537
  BackToTop,
5397
4538
  Banner,
5398
4539
  Breadcrumb,
@@ -5446,7 +4587,7 @@ export {
5446
4587
  Modal,
5447
4588
  Page,
5448
4589
  Pagination,
5449
- Popover,
4590
+ P as Popover,
5450
4591
  ProcessList,
5451
4592
  Prose,
5452
4593
  Quote,
@@ -5459,7 +4600,7 @@ export {
5459
4600
  SideNav,
5460
4601
  SiteAlert,
5461
4602
  Skipnav,
5462
- Spinner,
4603
+ l as Spinner,
5463
4604
  Status,
5464
4605
  StepIndicator,
5465
4606
  Summary,