@solexllc/usx-react 0.11.0 → 1.0.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 (240) hide show
  1. package/README.md +31 -0
  2. package/dist/Popover-Bg4-2-cU.cjs +987 -0
  3. package/dist/Popover-CqHczzNE.js +988 -0
  4. package/dist/chat.cjs +1396 -0
  5. package/dist/chat.js +1396 -0
  6. package/dist/index.cjs +4412 -5247
  7. package/dist/index.js +140 -972
  8. package/package.json +9 -5
  9. package/src/chat.js +15 -0
  10. package/src/components/accordion/Accordion.tsx +9 -57
  11. package/src/components/accordion/accordion.django.html +10 -20
  12. package/src/components/accordion/config.json +8 -2
  13. package/src/components/accordion-item/AccordionItem.tsx +54 -0
  14. package/src/components/accordion-item/accordion-item.django.html +19 -0
  15. package/src/components/accordion-item/accordion-item.html +8 -0
  16. package/src/components/accordion-item/config.json +55 -0
  17. package/src/components/alert/alert.django-snapshot.html +4 -4
  18. package/src/components/avatar/Avatar.tsx +54 -16
  19. package/src/components/avatar/avatar.django-snapshot.html +118 -2
  20. package/src/components/avatar/avatar.django.html +2 -2
  21. package/src/components/avatar/avatar.html +25 -0
  22. package/src/components/avatar/avatar.react-snapshot.html +110 -3
  23. package/src/components/avatar/config.json +17 -17
  24. package/src/components/avatar-group/AvatarGroup.tsx +17 -15
  25. package/src/components/avatar-group/avatar-group.django-snapshot.html +196 -174
  26. package/src/components/avatar-group/avatar-group.django.html +1 -1
  27. package/src/components/avatar-group/avatar-group.react-snapshot.html +216 -165
  28. package/src/components/avatar-group/config.json +14 -8
  29. package/src/components/back-to-top/BackToTop.tsx +21 -57
  30. package/src/components/back-to-top/back-to-top.django-snapshot.html +101 -202
  31. package/src/components/back-to-top/back-to-top.django.html +11 -38
  32. package/src/components/back-to-top/back-to-top.html +22 -106
  33. package/src/components/back-to-top/back-to-top.react-snapshot.html +94 -148
  34. package/src/components/back-to-top/config.json +41 -10
  35. package/src/components/banner/banner.django-snapshot.html +2 -2
  36. package/src/components/button/Button.tsx +15 -3
  37. package/src/components/button/button.django-snapshot.html +82 -0
  38. package/src/components/button/button.django.html +5 -2
  39. package/src/components/button/button.react-snapshot.html +80 -0
  40. package/src/components/button/config.json +17 -3
  41. package/src/components/callout/callout.django.html +1 -1
  42. package/src/components/callout/config.json +7 -16
  43. package/src/components/card/card.django-snapshot.html +43 -0
  44. package/src/components/card/card.react-snapshot.html +36 -0
  45. package/src/components/character-count/CharacterCount.tsx +2 -0
  46. package/src/components/character-count/character-count.react-snapshot.html +7 -0
  47. package/src/components/chat/Chat.tsx +575 -0
  48. package/src/components/chat/README.md +174 -0
  49. package/src/components/chat/avatarProps.ts +32 -0
  50. package/src/components/chat/chat.django-snapshot.html +23579 -0
  51. package/src/components/chat/chat.django.html +75 -0
  52. package/src/components/chat/chat.html +116 -0
  53. package/src/components/chat/chat.react-snapshot.html +16895 -0
  54. package/src/components/chat/config.json +1241 -0
  55. package/src/components/chat-attachment/ChatAttachment.tsx +39 -0
  56. package/src/components/chat-attachment/chat-attachment.django.html +24 -0
  57. package/src/components/chat-attachment/chat-attachment.html +10 -0
  58. package/src/components/chat-attachment/config.json +27 -0
  59. package/src/components/chat-attachments/ChatAttachments.tsx +17 -0
  60. package/src/components/chat-attachments/chat-attachments.django-snapshot.html +58 -0
  61. package/src/components/chat-attachments/chat-attachments.django.html +10 -0
  62. package/src/components/chat-attachments/chat-attachments.html +14 -0
  63. package/src/components/chat-attachments/chat-attachments.react-snapshot.html +46 -0
  64. package/src/components/chat-attachments/config.json +25 -0
  65. package/src/components/chat-bubble/ChatBubble.tsx +39 -0
  66. package/src/components/chat-bubble/ChatFormattedText.tsx +138 -0
  67. package/src/components/chat-bubble/chat-bubble.django-snapshot.html +128 -0
  68. package/src/components/chat-bubble/chat-bubble.django.html +19 -0
  69. package/src/components/chat-bubble/chat-bubble.html +1 -0
  70. package/src/components/chat-bubble/chat-bubble.react-snapshot.html +118 -0
  71. package/src/components/chat-bubble/config.json +70 -0
  72. package/src/components/chat-composer/ChatComposer.tsx +213 -0
  73. package/src/components/chat-composer/README.md +15 -0
  74. package/src/components/chat-composer/chat-composer.django-snapshot.html +575 -0
  75. package/src/components/chat-composer/chat-composer.django.html +77 -0
  76. package/src/components/chat-composer/chat-composer.html +44 -0
  77. package/src/components/chat-composer/chat-composer.react-snapshot.html +519 -0
  78. package/src/components/chat-composer/chat-formatting.django.html +59 -0
  79. package/src/components/chat-composer/config.json +137 -0
  80. package/src/components/chat-context/ChatContext.tsx +46 -0
  81. package/src/components/chat-context/chat-context.django-snapshot.html +35 -0
  82. package/src/components/chat-context/chat-context.django.html +20 -0
  83. package/src/components/chat-context/chat-context.html +9 -0
  84. package/src/components/chat-context/chat-context.react-snapshot.html +30 -0
  85. package/src/components/chat-context/config.json +36 -0
  86. package/src/components/chat-controls/ChatControls.tsx +67 -0
  87. package/src/components/chat-controls/chat-controls.django-snapshot.html +114 -0
  88. package/src/components/chat-controls/chat-controls.django.html +36 -0
  89. package/src/components/chat-controls/chat-controls.html +11 -0
  90. package/src/components/chat-controls/chat-controls.react-snapshot.html +107 -0
  91. package/src/components/chat-controls/config.json +67 -0
  92. package/src/components/chat-directory/ChatDirectory.tsx +168 -0
  93. package/src/components/chat-directory/chat-directory.django-snapshot.html +546 -0
  94. package/src/components/chat-directory/chat-directory.django.html +14 -0
  95. package/src/components/chat-directory/chat-directory.html +4 -0
  96. package/src/components/chat-directory/chat-directory.react-snapshot.html +471 -0
  97. package/src/components/chat-directory/config.json +242 -0
  98. package/src/components/chat-directory-item/ChatDirectoryItem.tsx +150 -0
  99. package/src/components/chat-directory-item/chat-directory-item.django-snapshot.html +281 -0
  100. package/src/components/chat-directory-item/chat-directory-item.django.html +38 -0
  101. package/src/components/chat-directory-item/chat-directory-item.html +9 -0
  102. package/src/components/chat-directory-item/chat-directory-item.react-snapshot.html +249 -0
  103. package/src/components/chat-directory-item/config.json +103 -0
  104. package/src/components/chat-history/ChatHistory.tsx +30 -0
  105. package/src/components/chat-history/chat-history.django-snapshot.html +113 -0
  106. package/src/components/chat-history/chat-history.django.html +20 -0
  107. package/src/components/chat-history/chat-history.html +9 -0
  108. package/src/components/chat-history/chat-history.react-snapshot.html +111 -0
  109. package/src/components/chat-history/config.json +24 -0
  110. package/src/components/chat-message/ChatMessage.tsx +148 -0
  111. package/src/components/chat-message/chat-message.django-snapshot.html +758 -0
  112. package/src/components/chat-message/chat-message.django.html +56 -0
  113. package/src/components/chat-message/chat-message.html +12 -0
  114. package/src/components/chat-message/chat-message.react-snapshot.html +627 -0
  115. package/src/components/chat-message/config.json +278 -0
  116. package/src/components/chat-message-actions/ChatMessageActions.tsx +133 -0
  117. package/src/components/chat-message-actions/chat-message-actions.django-snapshot.html +345 -0
  118. package/src/components/chat-message-actions/chat-message-actions.django.html +29 -0
  119. package/src/components/chat-message-actions/chat-message-actions.html +53 -0
  120. package/src/components/chat-message-actions/chat-message-actions.react-snapshot.html +295 -0
  121. package/src/components/chat-message-actions/config.json +121 -0
  122. package/src/components/chat-window/ChatWindow.tsx +135 -0
  123. package/src/components/chat-window/chat-window.django-snapshot.html +450 -0
  124. package/src/components/chat-window/chat-window.django.html +39 -0
  125. package/src/components/chat-window/chat-window.html +26 -0
  126. package/src/components/chat-window/chat-window.react-snapshot.html +286 -0
  127. package/src/components/chat-window/config.json +123 -0
  128. package/src/components/checkbox/checkbox.django-snapshot.html +2 -2
  129. package/src/components/clickable/Clickable.tsx +19 -5
  130. package/src/components/clickable/clickable.django-snapshot.html +11 -2
  131. package/src/components/clickable/clickable.django.html +2 -0
  132. package/src/components/clickable/clickable.react-snapshot.html +10 -2
  133. package/src/components/clickable/config.json +4 -0
  134. package/src/components/code/code.django-snapshot.html +25 -18
  135. package/src/components/code/code.react-snapshot.html +41 -4
  136. package/src/components/copy-to-clipboard/CopyToClipboard.tsx +2 -7
  137. package/src/components/copy-to-clipboard/copy-to-clipboard.django-snapshot.html +6 -4
  138. package/src/components/copy-to-clipboard/copy-to-clipboard.django.html +3 -2
  139. package/src/components/copy-to-clipboard/copy-to-clipboard.react-snapshot.html +14 -2
  140. package/src/components/data-table/data-table.django-snapshot.html +4 -5
  141. package/src/components/data-table/data-table.react-snapshot.html +4 -4
  142. package/src/components/drawer/drawer.django-snapshot.html +53 -30
  143. package/src/components/error-page/error-page.django-snapshot.html +20 -7
  144. package/src/components/fieldset/fieldset.django-snapshot.html +1 -6
  145. package/src/components/file-list/FileList.tsx +3 -2
  146. package/src/components/file-list/config.json +5 -0
  147. package/src/components/file-list/file-list.django-snapshot.html +63 -0
  148. package/src/components/file-list/file-list.django.html +1 -1
  149. package/src/components/file-list/file-list.react-snapshot.html +53 -0
  150. package/src/components/footer/footer.django-snapshot.html +0 -3
  151. package/src/components/form-group/form-group.django-snapshot.html +0 -2
  152. package/src/components/header/header.django-snapshot.html +3 -163
  153. package/src/components/header/header.django.html +2 -2
  154. package/src/components/header/header.html +1 -1
  155. package/src/components/header/header.react-snapshot.html +3 -3
  156. package/src/components/hero/hero.django-snapshot.html +0 -20
  157. package/src/components/hero/hero.django.html +3 -3
  158. package/src/components/identifier/config.json +4 -2
  159. package/src/components/identifier/identifier.django-snapshot.html +13 -16
  160. package/src/components/identifier/identifier.react-snapshot.html +13 -15
  161. package/src/components/image/image.django-snapshot.html +6 -6
  162. package/src/components/image/image.django.html +4 -4
  163. package/src/components/input/Input.tsx +1 -1
  164. package/src/components/input/config.json +2 -3
  165. package/src/components/input/input.django-snapshot.html +4 -21
  166. package/src/components/input/input.django.html +2 -2
  167. package/src/components/layout/layout.django-snapshot.html +2 -0
  168. package/src/components/link/Link.tsx +7 -4
  169. package/src/components/link/config.json +2 -3
  170. package/src/components/link/link.django-snapshot.html +8 -0
  171. package/src/components/link/link.django.html +2 -2
  172. package/src/components/link/link.html +4 -1
  173. package/src/components/link/link.react-snapshot.html +8 -0
  174. package/src/components/memorable-date/memorable-date.django-snapshot.html +0 -8
  175. package/src/components/memorable-date/memorable-date.django.html +2 -2
  176. package/src/components/misc-banner/misc-banner.django-snapshot.html +12 -12
  177. package/src/components/misc-banner/misc-banner.django.html +4 -2
  178. package/src/components/modal/Modal.tsx +4 -3
  179. package/src/components/modal/config.json +3 -2
  180. package/src/components/modal/modal.django-snapshot.html +70 -14
  181. package/src/components/modal/modal.django.html +7 -9
  182. package/src/components/modal/modal.html +4 -4
  183. package/src/components/modal/modal.react-snapshot.html +64 -4
  184. package/src/components/page/Page.tsx +10 -7
  185. package/src/components/page/page.django-snapshot.html +5 -8
  186. package/src/components/page/page.django.html +2 -2
  187. package/src/components/page/page.html +1 -2
  188. package/src/components/page/page.react-snapshot.html +5 -8
  189. package/src/components/pagination/navigation/PaginationNavigation.tsx +2 -0
  190. package/src/components/pagination/navigation/pagination-navigation.django.html +2 -0
  191. package/src/components/pagination/pagination.django-snapshot.html +62 -0
  192. package/src/components/pagination/pagination.django.html +3 -1
  193. package/src/components/pagination/pagination.html +46 -0
  194. package/src/components/pagination/pagination.react-snapshot.html +48 -0
  195. package/src/components/pagination/summary/PaginationSummary.tsx +1 -1
  196. package/src/components/pagination/summary/pagination-summary.django.html +1 -1
  197. package/src/components/popover/Popover.tsx +61 -9
  198. package/src/components/popover/PopoverMenu.tsx +33 -15
  199. package/src/components/popover/config.json +88 -14
  200. package/src/components/popover/popover-menu.django.html +13 -2
  201. package/src/components/popover/popover.django-snapshot.html +265 -7
  202. package/src/components/popover/popover.django.html +3 -2
  203. package/src/components/popover/popover.react-snapshot.html +154 -4
  204. package/src/components/process-list/config.json +41 -3
  205. package/src/components/quote/Quote.tsx +9 -2
  206. package/src/components/search/Search.tsx +1 -1
  207. package/src/components/search/config.json +3 -4
  208. package/src/components/search/search.django-snapshot.html +262 -1684
  209. package/src/components/search/search.django.html +1 -20
  210. package/src/components/section/Section.tsx +3 -1
  211. package/src/components/select/select.django-snapshot.html +7 -7
  212. package/src/components/select/select.react-snapshot.html +7 -7
  213. package/src/components/site-alert/site-alert.django-snapshot.html +8 -8
  214. package/src/components/summary/Summary.tsx +4 -2
  215. package/src/components/summary/config.json +4 -0
  216. package/src/components/summary/summary.django.html +4 -4
  217. package/src/components/swap/Swap.tsx +35 -3
  218. package/src/components/swap/config.json +28 -1
  219. package/src/components/swap/swap.django-snapshot.html +29 -7
  220. package/src/components/swap/swap.django.html +15 -1
  221. package/src/components/swap/swap.react-snapshot.html +34 -4
  222. package/src/components/table/Table.tsx +58 -25
  223. package/src/components/table/config.json +61 -13
  224. package/src/components/tag/Tag.tsx +40 -7
  225. package/src/components/tag/config.json +18 -2
  226. package/src/components/tag/tag.django-snapshot.html +16 -1
  227. package/src/components/tag/tag.django.html +12 -6
  228. package/src/components/tag/tag.html +4 -0
  229. package/src/components/tag/tag.react-snapshot.html +16 -1
  230. package/src/components/tag-group/TagGroup.tsx +6 -9
  231. package/src/components/tag-group/config.json +4 -0
  232. package/src/components/tag-group/tag-group.django.html +1 -1
  233. package/src/components/theme-picker/ThemePicker.tsx +48 -42
  234. package/src/components/theme-picker/config.json +27 -29
  235. package/src/components/theme-picker/theme-picker-select.django.html +1 -1
  236. package/src/components/theme-picker/theme-picker.django-snapshot.html +283 -78
  237. package/src/components/theme-picker/theme-picker.django.html +24 -11
  238. package/src/components/theme-picker/theme-picker.html +155 -54
  239. package/src/components/theme-picker/theme-picker.react-snapshot.html +265 -67
  240. package/src/index.js +1 -0
@@ -0,0 +1,987 @@
1
+ "use strict";
2
+ const jsxRuntime = require("react/jsx-runtime");
3
+ const React = require("react");
4
+ function getDefaultExportFromCjs(x) {
5
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
6
+ }
7
+ var classnames = { exports: {} };
8
+ /*!
9
+ Copyright (c) 2018 Jed Watson.
10
+ Licensed under the MIT License (MIT), see
11
+ http://jedwatson.github.io/classnames
12
+ */
13
+ var hasRequiredClassnames;
14
+ function requireClassnames() {
15
+ if (hasRequiredClassnames) return classnames.exports;
16
+ hasRequiredClassnames = 1;
17
+ (function(module2) {
18
+ (function() {
19
+ var hasOwn = {}.hasOwnProperty;
20
+ function classNames() {
21
+ var classes = "";
22
+ for (var i = 0; i < arguments.length; i++) {
23
+ var arg = arguments[i];
24
+ if (arg) {
25
+ classes = appendClass(classes, parseValue(arg));
26
+ }
27
+ }
28
+ return classes;
29
+ }
30
+ function parseValue(arg) {
31
+ if (typeof arg === "string" || typeof arg === "number") {
32
+ return arg;
33
+ }
34
+ if (typeof arg !== "object") {
35
+ return "";
36
+ }
37
+ if (Array.isArray(arg)) {
38
+ return classNames.apply(null, arg);
39
+ }
40
+ if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
41
+ return arg.toString();
42
+ }
43
+ var classes = "";
44
+ for (var key in arg) {
45
+ if (hasOwn.call(arg, key) && arg[key]) {
46
+ classes = appendClass(classes, key);
47
+ }
48
+ }
49
+ return classes;
50
+ }
51
+ function appendClass(value, newClass) {
52
+ if (!newClass) {
53
+ return value;
54
+ }
55
+ if (value) {
56
+ return value + " " + newClass;
57
+ }
58
+ return value + newClass;
59
+ }
60
+ if (module2.exports) {
61
+ classNames.default = classNames;
62
+ module2.exports = classNames;
63
+ } else {
64
+ window.classNames = classNames;
65
+ }
66
+ })();
67
+ })(classnames);
68
+ return classnames.exports;
69
+ }
70
+ var classnamesExports = requireClassnames();
71
+ const ClassNames = /* @__PURE__ */ getDefaultExportFromCjs(classnamesExports);
72
+ function getAssetUrl(assetPath, staticBaseUrl) {
73
+ if (/^[a-z][a-z\d+.-]*:/i.test(assetPath)) return assetPath;
74
+ const base = staticBaseUrl || typeof window !== "undefined" && window.usxBaseUrl || "/";
75
+ return `${base.replace(/\/+$/, "")}/${assetPath.replace(/^\/+/, "")}`;
76
+ }
77
+ function getAssetSrcSet(srcSet, staticBaseUrl) {
78
+ return srcSet.replace(/(^\s*|,\s*)(\S*[^,\s])(?=,?(?:\s|$))/g, (_match, separator, url) => `${separator}${getAssetUrl(url, staticBaseUrl)}`);
79
+ }
80
+ function Icon({
81
+ name,
82
+ source = "uswds",
83
+ size,
84
+ color,
85
+ alt,
86
+ staticBaseUrl,
87
+ staticUrlPrefix,
88
+ className = "",
89
+ ...props
90
+ }) {
91
+ const spritePrefix = staticUrlPrefix ?? getAssetUrl(`img/${source === "usx" ? "usx-sprite.svg" : "sprite.svg"}#`, staticBaseUrl);
92
+ const classes = ClassNames(
93
+ "usa-icon",
94
+ "usx-icon",
95
+ size ? size === 1 ? "usx-icon--size-1" : "usa-icon--size-" + size : "",
96
+ color ? "text-" + color : "",
97
+ className
98
+ );
99
+ return /* @__PURE__ */ jsxRuntime.jsx(
100
+ "svg",
101
+ {
102
+ className: classes,
103
+ "aria-hidden": alt ? void 0 : "true",
104
+ "aria-label": alt || void 0,
105
+ focusable: "false",
106
+ role: "img",
107
+ ...props,
108
+ children: /* @__PURE__ */ jsxRuntime.jsx("use", { href: spritePrefix + name })
109
+ }
110
+ );
111
+ }
112
+ function Alert({
113
+ heading,
114
+ text,
115
+ variant,
116
+ slim = false,
117
+ noIcon = false,
118
+ className = "",
119
+ role,
120
+ ariaLabel,
121
+ ariaLabelledby,
122
+ onDismiss = void 0,
123
+ staticBaseUrl,
124
+ children = null,
125
+ ...props
126
+ }) {
127
+ const normalizedVariant = variant && ["info", "warning", "success", "error", "emergency"].includes(variant) ? variant : null;
128
+ const classes = ClassNames(
129
+ "usa-alert",
130
+ "usx-alert",
131
+ normalizedVariant ? `usa-alert--${normalizedVariant}` : "",
132
+ slim ? "usa-alert--slim" : "",
133
+ noIcon ? "usa-alert--no-icon" : "",
134
+ className
135
+ );
136
+ const resolvedRole = role || (normalizedVariant === "error" || normalizedVariant === "emergency" ? "alert" : normalizedVariant === "success" ? "status" : "region");
137
+ const accessibilityProps = {
138
+ role: resolvedRole
139
+ };
140
+ if (ariaLabelledby) {
141
+ accessibilityProps["aria-labelledby"] = ariaLabelledby;
142
+ } else if (ariaLabel) {
143
+ accessibilityProps["aria-label"] = ariaLabel;
144
+ } else if (resolvedRole === "region") {
145
+ const label = heading || (normalizedVariant ? `${normalizedVariant} alert` : void 0);
146
+ if (label) accessibilityProps["aria-label"] = label;
147
+ }
148
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, ...accessibilityProps, ...props, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "usa-alert__body", children: [
149
+ !slim && heading ? /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "usa-alert__heading", children: heading }) : null,
150
+ children ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "usa-alert__text", children }) : text ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "usa-alert__text", children: text }) : null,
151
+ onDismiss && /* @__PURE__ */ jsxRuntime.jsx("button", { className: "usx-alert__dismiss", "aria-label": "Dismiss alert", onClick: onDismiss, children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "close", size: 3, staticBaseUrl }) })
152
+ ] }) });
153
+ }
154
+ const Tooltip = ({
155
+ label,
156
+ position = "right",
157
+ children,
158
+ className = "",
159
+ bodyClassName = "",
160
+ ...props
161
+ }) => {
162
+ const validPositions = ["top", "bottom", "left", "right"];
163
+ const normalizedPosition = validPositions.includes(position) ? position : "right";
164
+ return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: ClassNames("usx-tooltip", className), ...props, children: [
165
+ children,
166
+ /* @__PURE__ */ jsxRuntime.jsx(
167
+ "span",
168
+ {
169
+ className: ClassNames("usa-tooltip__body", `usa-tooltip__body--${normalizedPosition}`, bodyClassName),
170
+ role: "tooltip",
171
+ children: label
172
+ }
173
+ )
174
+ ] });
175
+ };
176
+ const shapeClassMap = {
177
+ circle: "usx-circle",
178
+ "rounded-sm": "usx-rounded-sm",
179
+ "rounded-md": "usx-rounded-md",
180
+ "rounded-lg": "usx-rounded-lg",
181
+ "rounded-xl": "usx-rounded-xl"
182
+ };
183
+ function Avatar({
184
+ href,
185
+ src = null,
186
+ alt = null,
187
+ variant = "image",
188
+ value = null,
189
+ shape = null,
190
+ statusRingColor = null,
191
+ statusLabel = null,
192
+ tooltipProps = null,
193
+ className = "",
194
+ imageClassName = "",
195
+ contentClassName = "",
196
+ ...props
197
+ }) {
198
+ const isInitialsVariant = variant === "initials";
199
+ const isIconVariant = variant === "icon";
200
+ const ringColor = statusRingColor == null ? void 0 : statusRingColor.trim();
201
+ const label = statusLabel == null ? void 0 : statusLabel.trim();
202
+ const accessibleLabel = label ? [alt, label].filter(Boolean).join(", ") : alt || void 0;
203
+ const wrapperClasses = ClassNames(
204
+ "usx-avatar",
205
+ ringColor && "border-05",
206
+ ringColor && `border-${ringColor}`,
207
+ ringColor && (shape ? shapeClassMap[shape] : isInitialsVariant || isIconVariant ? "usx-circle" : null),
208
+ className
209
+ );
210
+ const imgClasses = ClassNames(
211
+ "usx-avatar__img",
212
+ shape ? shapeClassMap[shape] : null,
213
+ imageClassName
214
+ );
215
+ const contentClasses = ClassNames(
216
+ "usx-avatar__content",
217
+ shape ? shapeClassMap[shape] : "usx-circle",
218
+ contentClassName
219
+ );
220
+ const avatarContent = isInitialsVariant ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: contentClasses, children: value }) : isIconVariant ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: contentClasses, children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: value, alt: alt ? void 0 : `${value} icon` }) }) : /* @__PURE__ */ jsxRuntime.jsx(
221
+ "img",
222
+ {
223
+ className: imgClasses,
224
+ src: src || void 0,
225
+ alt: alt || void 0,
226
+ role: "img",
227
+ ...props
228
+ }
229
+ );
230
+ const avatar = href ? /* @__PURE__ */ jsxRuntime.jsx(
231
+ "a",
232
+ {
233
+ href,
234
+ className: wrapperClasses,
235
+ "aria-label": label ? accessibleLabel : isInitialsVariant || isIconVariant ? alt || void 0 : void 0,
236
+ children: avatarContent
237
+ }
238
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
239
+ "span",
240
+ {
241
+ className: wrapperClasses,
242
+ role: label ? "img" : void 0,
243
+ "aria-label": label ? accessibleLabel : isInitialsVariant || isIconVariant ? alt || void 0 : void 0,
244
+ children: avatarContent
245
+ }
246
+ );
247
+ return tooltipProps ? /* @__PURE__ */ jsxRuntime.jsx(Tooltip, { ...tooltipProps, children: avatar }) : avatar;
248
+ }
249
+ function AvatarGroup({
250
+ avatarProps = [],
251
+ overlap = false,
252
+ stacked = false,
253
+ className = "",
254
+ ...props
255
+ }) {
256
+ const classes = ClassNames(
257
+ "usx-avatar-group",
258
+ overlap && "usx-avatar-group--overlap",
259
+ stacked && "usx-avatar-group--stacked",
260
+ className
261
+ );
262
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, ...props, children: avatarProps.map(({ initials, initialsClassName, ...avatar }, index) => /* @__PURE__ */ jsxRuntime.jsx(
263
+ Avatar,
264
+ {
265
+ ...avatar,
266
+ variant: avatar.variant ?? (avatar.src ? "image" : "initials"),
267
+ value: avatar.value ?? initials,
268
+ contentClassName: avatar.contentClassName ?? initialsClassName
269
+ },
270
+ `${avatar.src || avatar.value || initials || "avatar"}-${index}`
271
+ )) });
272
+ }
273
+ const Required = ({
274
+ title = "Required",
275
+ children = null,
276
+ className = "",
277
+ ...props
278
+ }) => {
279
+ const classes = ClassNames("usx-required", className);
280
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
281
+ /* @__PURE__ */ jsxRuntime.jsx("abbr", { title, className: classes, ...props, children: "*" }),
282
+ " ",
283
+ children ? children : ""
284
+ ] });
285
+ };
286
+ function Label({
287
+ id,
288
+ htmlFor,
289
+ required = false,
290
+ error = false,
291
+ children = null,
292
+ screenReaderOnly = false,
293
+ className = "",
294
+ classOverride = false,
295
+ ...props
296
+ }) {
297
+ const classes = ClassNames(
298
+ "usa-label",
299
+ "usx-label",
300
+ { "usa-sr-only": screenReaderOnly, "usa-label--error": !!error },
301
+ className
302
+ );
303
+ return /* @__PURE__ */ jsxRuntime.jsxs(
304
+ "label",
305
+ {
306
+ id: id || void 0,
307
+ className: classOverride ? className : classes,
308
+ htmlFor: htmlFor || void 0,
309
+ ...props,
310
+ children: [
311
+ required && /* @__PURE__ */ jsxRuntime.jsx(Required, {}),
312
+ children
313
+ ]
314
+ }
315
+ );
316
+ }
317
+ const Spinner = ({
318
+ size = 3,
319
+ color,
320
+ label = null,
321
+ screenReaderLabel = null,
322
+ staticUrlPrefix,
323
+ staticBaseUrl,
324
+ className = "",
325
+ ...props
326
+ }) => {
327
+ return /* @__PURE__ */ jsxRuntime.jsxs("span", { role: "status", "aria-live": "polite", className: `usx-spinner ${className}`, ...props, children: [
328
+ /* @__PURE__ */ jsxRuntime.jsx(
329
+ Icon,
330
+ {
331
+ name: "spinner",
332
+ source: "usx",
333
+ size,
334
+ color,
335
+ staticBaseUrl,
336
+ staticUrlPrefix
337
+ }
338
+ ),
339
+ screenReaderLabel && /* @__PURE__ */ jsxRuntime.jsx(Label, { screenReaderOnly: true, children: screenReaderLabel }),
340
+ label && /* @__PURE__ */ jsxRuntime.jsx(Label, { children: label })
341
+ ] });
342
+ };
343
+ function Button({
344
+ label,
345
+ variant,
346
+ type = "button",
347
+ disabled = false,
348
+ onClick,
349
+ href,
350
+ isExternal = false,
351
+ big = false,
352
+ tighten = false,
353
+ inverse = false,
354
+ ghost = false,
355
+ loading = false,
356
+ iconProps = [],
357
+ className = "",
358
+ children = "",
359
+ extraAttributes = {},
360
+ ...props
361
+ }) {
362
+ const leftIcons = iconProps.filter((icon) => (icon.position ?? "left") === "left");
363
+ const rightIcons = iconProps.filter((icon) => icon.position === "right");
364
+ const renderIcon = (icon, index) => {
365
+ const { position, ...iconRest } = icon;
366
+ return /* @__PURE__ */ jsxRuntime.jsx(Icon, { ...iconRest }, index);
367
+ };
368
+ const spinner = loading && /* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: 2 });
369
+ const variantClasses = {
370
+ primary: "usa-button--primary",
371
+ secondary: "usa-button--secondary",
372
+ "accent-cool": "usa-button--accent-cool",
373
+ "accent-warm": "usa-button--accent-warm",
374
+ base: "usa-button--base",
375
+ outline: "usa-button--outline",
376
+ unstyled: "usa-button--unstyled"
377
+ };
378
+ const classes = ClassNames(
379
+ "usa-button",
380
+ "usx-button",
381
+ variant && variantClasses[variant],
382
+ big && "usa-button--big",
383
+ tighten && "usx-button--tight",
384
+ inverse && "usa-button--inverse",
385
+ ghost && "usx-button--ghost",
386
+ className
387
+ );
388
+ if (href) {
389
+ const {
390
+ // Remove unused variables
391
+ ...anchorProps
392
+ } = props;
393
+ return /* @__PURE__ */ jsxRuntime.jsxs(
394
+ "a",
395
+ {
396
+ className: classes,
397
+ href,
398
+ ...isExternal ? { target: "_blank", rel: "noopener noreferrer" } : {},
399
+ ...anchorProps,
400
+ ...extraAttributes,
401
+ children: [
402
+ spinner,
403
+ leftIcons.map(renderIcon),
404
+ children || label,
405
+ rightIcons.map(renderIcon)
406
+ ]
407
+ }
408
+ );
409
+ }
410
+ const {
411
+ // Remove unused variables
412
+ ...buttonProps
413
+ } = props;
414
+ return /* @__PURE__ */ jsxRuntime.jsxs(
415
+ "button",
416
+ {
417
+ type,
418
+ className: classes,
419
+ disabled,
420
+ "aria-disabled": disabled ? "true" : void 0,
421
+ ...onClick ? { onClick } : {},
422
+ ...buttonProps,
423
+ ...extraAttributes,
424
+ children: [
425
+ spinner,
426
+ leftIcons.map(renderIcon),
427
+ children || label,
428
+ rightIcons.map(renderIcon)
429
+ ]
430
+ }
431
+ );
432
+ }
433
+ function ButtonGroup({
434
+ buttonProps = [],
435
+ segmented = false,
436
+ className = "",
437
+ ...props
438
+ }) {
439
+ const classes = ClassNames(
440
+ "usa-button-group usx-button-group",
441
+ segmented && "usa-button-group--segmented",
442
+ className
443
+ );
444
+ return /* @__PURE__ */ jsxRuntime.jsx("ul", { className: classes, ...props, children: buttonProps.map(({ itemClassName, ...item }, index) => /* @__PURE__ */ jsxRuntime.jsx("li", { className: ClassNames("usa-button-group__item", itemClassName), children: /* @__PURE__ */ jsxRuntime.jsx(Button, { ...item, children: item.children }) }, index)) });
445
+ }
446
+ function Callout({
447
+ className,
448
+ strokeColor,
449
+ indent,
450
+ dedent,
451
+ big,
452
+ orientation = "horizontal",
453
+ children,
454
+ content,
455
+ backgroundColor,
456
+ textColor,
457
+ as: Element = "div",
458
+ ...props
459
+ }) {
460
+ return /* @__PURE__ */ jsxRuntime.jsx(
461
+ Element,
462
+ {
463
+ className: ClassNames(
464
+ "usx-callout",
465
+ orientation === "vertical" && "usx-callout--vertical",
466
+ strokeColor && `border-${strokeColor}`,
467
+ indent && `usx-callout--indent-${indent}`,
468
+ dedent && "usx-callout--dedent",
469
+ (big ?? orientation === "horizontal") && "usx-callout--big",
470
+ backgroundColor && `bg-${backgroundColor}`,
471
+ textColor && `text-${textColor}`,
472
+ className
473
+ ),
474
+ ...props,
475
+ children: children ?? content
476
+ }
477
+ );
478
+ }
479
+ const Tag = ({
480
+ id,
481
+ big = false,
482
+ value,
483
+ color = null,
484
+ outline = false,
485
+ icon = null,
486
+ dismissible = false,
487
+ isDismissed = false,
488
+ onDismiss = () => {
489
+ },
490
+ className = "",
491
+ children,
492
+ href,
493
+ target,
494
+ rel,
495
+ extraAttributes = {},
496
+ ...props
497
+ }) => {
498
+ const [isVisible, setIsVisible] = React.useState(!isDismissed);
499
+ const interactive = Boolean(href);
500
+ const classes = ClassNames(
501
+ "usa-tag",
502
+ "usx-tag",
503
+ { "usa-tag--big": big },
504
+ { [`bg-${color}`]: color && !outline && !interactive },
505
+ { [`text-${color}`]: color && outline && !interactive },
506
+ { "usx-tag--outline": outline || interactive },
507
+ { "usa-link usx-link usx-no-visited usx-tag--interactive": interactive },
508
+ className
509
+ );
510
+ const handleDismiss = (e) => {
511
+ e.preventDefault();
512
+ if (onDismiss) {
513
+ onDismiss(e);
514
+ }
515
+ setIsVisible(false);
516
+ };
517
+ if (!isVisible) {
518
+ return null;
519
+ }
520
+ const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
521
+ icon && /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: icon, size: big ? 3 : 2 }),
522
+ " ",
523
+ children || value,
524
+ dismissible && !interactive && /* @__PURE__ */ jsxRuntime.jsx(
525
+ "button",
526
+ {
527
+ type: "button",
528
+ className: "usx-tag__dismiss",
529
+ "aria-label": "Dismiss tag",
530
+ onClick: handleDismiss,
531
+ children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "close", size: 2 })
532
+ }
533
+ )
534
+ ] });
535
+ if (href) {
536
+ return /* @__PURE__ */ jsxRuntime.jsx(
537
+ "a",
538
+ {
539
+ id,
540
+ href,
541
+ target,
542
+ rel,
543
+ className: classes,
544
+ ...props,
545
+ ...extraAttributes,
546
+ children: content
547
+ }
548
+ );
549
+ }
550
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { id, className: classes, ...props, ...extraAttributes, children: content });
551
+ };
552
+ function Image({
553
+ src,
554
+ alt,
555
+ href,
556
+ rounded = false,
557
+ circular = false,
558
+ caption,
559
+ hideCaption = false,
560
+ objectFit = "",
561
+ maxWidth,
562
+ maxHeight,
563
+ staticBaseUrl,
564
+ srcSet,
565
+ className = "",
566
+ ...props
567
+ }) {
568
+ const classes = ClassNames(
569
+ "usx-image",
570
+ {
571
+ "usx-image--rounded": rounded,
572
+ "usx-image--circular": circular,
573
+ [`usx-object-fit-${objectFit}`]: objectFit
574
+ },
575
+ className
576
+ );
577
+ const style = {};
578
+ if (maxWidth) style.maxWidth = maxWidth;
579
+ if (maxHeight) style.maxHeight = maxHeight;
580
+ if (maxHeight && !maxWidth) style.width = "auto";
581
+ if (maxWidth && !maxHeight) style.height = "auto";
582
+ const captionClasses = ClassNames(
583
+ "usx-image--caption",
584
+ { "usa-sr-only": hideCaption }
585
+ );
586
+ const isResponsive = src && typeof src === "object";
587
+ const imgElement = !src ? "Image" : isResponsive ? /* @__PURE__ */ jsxRuntime.jsxs("picture", { children: [
588
+ src.sources.map((source, i) => /* @__PURE__ */ jsxRuntime.jsx(
589
+ "source",
590
+ {
591
+ ...source.media ? { media: source.media } : {},
592
+ srcSet: getAssetSrcSet(source.srcSet, staticBaseUrl),
593
+ ...source.type ? { type: source.type } : {},
594
+ ...source.sizes ? { sizes: source.sizes } : {}
595
+ },
596
+ i
597
+ )),
598
+ /* @__PURE__ */ jsxRuntime.jsx("img", { src: getAssetUrl(src.fallback, staticBaseUrl), srcSet: srcSet ? getAssetSrcSet(srcSet, staticBaseUrl) : void 0, alt, style, ...props })
599
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx("img", { src: getAssetUrl(src, staticBaseUrl), srcSet: srcSet ? getAssetSrcSet(srcSet, staticBaseUrl) : void 0, alt, style, ...props });
600
+ if (caption) {
601
+ return /* @__PURE__ */ jsxRuntime.jsxs("figure", { className: classes, style, children: [
602
+ href ? /* @__PURE__ */ jsxRuntime.jsx("a", { href, children: imgElement }) : imgElement,
603
+ /* @__PURE__ */ jsxRuntime.jsx("figcaption", { className: captionClasses, children: caption })
604
+ ] });
605
+ }
606
+ const Element = href ? "a" : "div";
607
+ return /* @__PURE__ */ jsxRuntime.jsx(
608
+ Element,
609
+ {
610
+ ...href ? { href } : {},
611
+ className: classes,
612
+ style,
613
+ children: imgElement
614
+ }
615
+ );
616
+ }
617
+ function Hint({
618
+ id,
619
+ children = null,
620
+ className = "",
621
+ ...props
622
+ }) {
623
+ const classes = ClassNames("usa-hint", "usx-hint", className);
624
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { className: classes, ...id ? { id } : {}, ...props, children });
625
+ }
626
+ function ErrorMessage({
627
+ id,
628
+ children = null,
629
+ className = "",
630
+ ...props
631
+ }) {
632
+ const classes = ClassNames("usa-error-message", "usx-error-message", className);
633
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { className: classes, role: "alert", ...id ? { id } : {}, ...props, children });
634
+ }
635
+ function FormGroup({ children = null, className = "", error = false, ...props }) {
636
+ const classes = ClassNames(
637
+ "usa-form-group",
638
+ "usx-form-group",
639
+ {
640
+ "usa-form-group--error": error
641
+ },
642
+ className
643
+ );
644
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, ...props, children });
645
+ }
646
+ const TextArea = ({
647
+ label = null,
648
+ id,
649
+ placeholder = "",
650
+ disabled = false,
651
+ required = false,
652
+ defaultValue = "",
653
+ value,
654
+ hint = null,
655
+ screenReaderOnlyLabel = false,
656
+ error = null,
657
+ success = null,
658
+ formGroup = true,
659
+ className = "",
660
+ ...props
661
+ }) => {
662
+ const textAreaId = id || `textarea-${Math.random().toString(36).substr(2, 9)}`;
663
+ const hasError = !!error;
664
+ const hasSuccess = !!success;
665
+ const classes = ClassNames(
666
+ "usa-textarea",
667
+ "usx-textarea",
668
+ hasError ? "usa-input--error" : hasSuccess ? "usa-input--success" : null,
669
+ className
670
+ );
671
+ const hintId = hint ? `${textAreaId}-hint` : void 0;
672
+ const describedByParts = [];
673
+ if (hintId) describedByParts.push(hintId);
674
+ if (hasError && typeof error === "string") describedByParts.push(`${textAreaId}-error`);
675
+ const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
676
+ label && /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: textAreaId, required, screenReaderOnly: screenReaderOnlyLabel, error: hasError, children: label }),
677
+ hint && /* @__PURE__ */ jsxRuntime.jsx(Hint, { id: hintId, children: hint }),
678
+ hasError && typeof error === "string" && /* @__PURE__ */ jsxRuntime.jsx(ErrorMessage, { id: `${textAreaId}-error`, children: error }),
679
+ /* @__PURE__ */ jsxRuntime.jsx(
680
+ "textarea",
681
+ {
682
+ id: textAreaId,
683
+ className: classes,
684
+ placeholder,
685
+ disabled,
686
+ ...value !== void 0 ? { value } : { defaultValue },
687
+ ...required ? { required: true } : {},
688
+ "aria-describedby": describedByParts.length ? describedByParts.join(" ") : void 0,
689
+ "aria-invalid": hasError ? "true" : void 0,
690
+ ...props
691
+ }
692
+ )
693
+ ] });
694
+ return formGroup ? /* @__PURE__ */ jsxRuntime.jsx(FormGroup, { error: hasError, children: content }) : content;
695
+ };
696
+ function ClickableLink({
697
+ children,
698
+ className,
699
+ as: Tag2 = "span",
700
+ colorChange = false,
701
+ bgColorChange = false,
702
+ ...rest
703
+ }) {
704
+ const classes = ClassNames(
705
+ "usx-clickable__link",
706
+ colorChange && "usx-clickable__color-on-hover",
707
+ bgColorChange && "usx-clickable__bg-color-on-hover",
708
+ className
709
+ );
710
+ return /* @__PURE__ */ jsxRuntime.jsx(Tag2, { className: classes, ...rest, children });
711
+ }
712
+ function ClickableColorChange({ children, className, as: Tag2 = "span", ...rest }) {
713
+ return /* @__PURE__ */ jsxRuntime.jsx(Tag2, { className: ClassNames("usx-clickable__color-on-hover", className), ...rest, children });
714
+ }
715
+ function ClickableBgColorChange({ children, className, as: Tag2 = "span", ...rest }) {
716
+ return /* @__PURE__ */ jsxRuntime.jsx(Tag2, { className: ClassNames("usx-clickable__bg-color-on-hover", className), ...rest, children });
717
+ }
718
+ function Clickable({ className, children, extraAttributes = {}, ...rest }) {
719
+ const classes = ClassNames("usx-clickable", className);
720
+ if ("href" in rest && rest.href !== void 0) {
721
+ return /* @__PURE__ */ jsxRuntime.jsx(
722
+ "a",
723
+ {
724
+ className: classes,
725
+ ...rest,
726
+ ...extraAttributes,
727
+ children
728
+ }
729
+ );
730
+ }
731
+ return /* @__PURE__ */ jsxRuntime.jsx(
732
+ "button",
733
+ {
734
+ type: "button",
735
+ className: classes,
736
+ ...rest,
737
+ ...extraAttributes,
738
+ children
739
+ }
740
+ );
741
+ }
742
+ Clickable.Link = ClickableLink;
743
+ Clickable.ColorChange = ClickableColorChange;
744
+ Clickable.BgColorChange = ClickableBgColorChange;
745
+ function Summary({
746
+ label = "Details",
747
+ children,
748
+ ariaLabel,
749
+ title,
750
+ className = "",
751
+ textClassName = "",
752
+ markerColor = void 0,
753
+ underlineColor = void 0,
754
+ noUnderline = false,
755
+ noMarker = false,
756
+ unstyled = false
757
+ }) {
758
+ if (unstyled) {
759
+ return /* @__PURE__ */ jsxRuntime.jsx("summary", { className: className || void 0, "aria-label": ariaLabel, title, children: children ?? label });
760
+ }
761
+ const summaryClassNames = ClassNames(
762
+ "usx-summary",
763
+ { [`marker-${markerColor}`]: markerColor && !noMarker },
764
+ { "usx-summary--no-marker": noMarker },
765
+ { "usx-summary--no-underline": noUnderline },
766
+ className
767
+ );
768
+ const summaryTextClassNames = ClassNames(
769
+ "usx-summary-text",
770
+ { [`underline-${underlineColor}`]: !noUnderline && underlineColor },
771
+ textClassName
772
+ );
773
+ return /* @__PURE__ */ jsxRuntime.jsx("summary", { className: summaryClassNames, "aria-label": ariaLabel, title, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: summaryTextClassNames, children: children ?? (label || "Details") }) });
774
+ }
775
+ function Link({
776
+ href,
777
+ text,
778
+ children,
779
+ visited = false,
780
+ external = false,
781
+ alt = false,
782
+ newTab = false,
783
+ className = "",
784
+ ...props
785
+ }) {
786
+ const classes = ClassNames(
787
+ "usa-link",
788
+ "usx-link",
789
+ visited && "usx-link--visited",
790
+ external && "usa-link--external",
791
+ alt && "usa-link--alt",
792
+ className
793
+ );
794
+ return /* @__PURE__ */ jsxRuntime.jsx(
795
+ "a",
796
+ {
797
+ href,
798
+ className: classes,
799
+ target: newTab || external ? "_blank" : void 0,
800
+ rel: newTab || external ? "noreferrer noopener" : void 0,
801
+ ...props,
802
+ children: children ?? text
803
+ }
804
+ );
805
+ }
806
+ const TagGroup = ({
807
+ tagProps = null,
808
+ children = null,
809
+ className = "",
810
+ extraAttributes = {},
811
+ ...props
812
+ }) => {
813
+ const classes = ClassNames("usx-tag-group", className);
814
+ const content = children ? children : Array.isArray(tagProps) ? tagProps.map((t, i) => /* @__PURE__ */ jsxRuntime.jsx(Tag, { ...t }, t.id || t.value || i)) : null;
815
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { ...props, ...extraAttributes, className: classes, children: content });
816
+ };
817
+ function PopoverMenu({
818
+ items,
819
+ prefix,
820
+ panelShape,
821
+ className,
822
+ ...props
823
+ }) {
824
+ const generatedPrefix = React.useId();
825
+ const base = prefix ?? generatedPrefix;
826
+ return /* @__PURE__ */ jsxRuntime.jsx("ul", { ...props, className: ClassNames("usx-popover__menu", className), children: items.map((item, index) => {
827
+ const id = item.id ?? `${base}-${index}`;
828
+ return /* @__PURE__ */ jsxRuntime.jsx("li", { children: item.type === "details" ? /* @__PURE__ */ jsxRuntime.jsx(
829
+ Popover,
830
+ {
831
+ id,
832
+ summaryProps: {
833
+ ...item.summaryProps,
834
+ className: ClassNames(item.summaryProps.className, "usx-popover__menu-item")
835
+ },
836
+ name: base,
837
+ side: "right",
838
+ panelShape,
839
+ menuItems: item.items
840
+ }
841
+ ) : item.type === "button" || item.onClick ? /* @__PURE__ */ jsxRuntime.jsxs(
842
+ "button",
843
+ {
844
+ ...item.extraAttributes,
845
+ type: "button",
846
+ className: "usx-popover__menu-item",
847
+ onClick: item.onClick,
848
+ disabled: item.disabled,
849
+ children: [
850
+ item.icon && /* @__PURE__ */ jsxRuntime.jsx(Icon, { ...item.icon }),
851
+ item.text
852
+ ]
853
+ }
854
+ ) : item.href ? /* @__PURE__ */ jsxRuntime.jsx(
855
+ Link,
856
+ {
857
+ href: item.href,
858
+ text: item.text,
859
+ className: "usx-no-visited usx-popover__menu-item"
860
+ }
861
+ ) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "usx-popover__menu-item", children: item.text }) }, id);
862
+ }) });
863
+ }
864
+ function Popover({
865
+ id,
866
+ side = "bottom",
867
+ align = "start",
868
+ panelShape = "rounded",
869
+ defaultOpen = false,
870
+ dismissOnOutside = true,
871
+ menuItems,
872
+ showClose = false,
873
+ closeLabel = "Close",
874
+ headerLeftActions,
875
+ headerRightActions,
876
+ showCloseIcon = false,
877
+ closeIconLabel = "Close",
878
+ headerClassName,
879
+ panelHeading,
880
+ panelHeadingId,
881
+ headingAs = "h2",
882
+ scrollable = false,
883
+ className,
884
+ summaryProps,
885
+ panelClassName,
886
+ contentClassName,
887
+ extraAttributes,
888
+ children,
889
+ ...props
890
+ }) {
891
+ const composedSummaryProps = { ...summaryProps, label: (summaryProps == null ? void 0 : summaryProps.label) ?? "Open panel" };
892
+ const Heading = headingAs;
893
+ return /* @__PURE__ */ jsxRuntime.jsxs(
894
+ "details",
895
+ {
896
+ ...props,
897
+ className: ClassNames("usx-popover", className),
898
+ open: defaultOpen || void 0,
899
+ "data-side": side,
900
+ "data-align": align,
901
+ "data-usx-popover-dismiss-on-outside": dismissOnOutside ? void 0 : "false",
902
+ ...extraAttributes,
903
+ children: [
904
+ /* @__PURE__ */ jsxRuntime.jsx(Summary, { unstyled: true, ...composedSummaryProps }),
905
+ /* @__PURE__ */ jsxRuntime.jsxs(
906
+ "div",
907
+ {
908
+ id,
909
+ className: ClassNames(
910
+ "usx-popover__panel",
911
+ {
912
+ "usx-popover__panel--square": panelShape === "square"
913
+ },
914
+ panelClassName
915
+ ),
916
+ children: [
917
+ (headerLeftActions || panelHeading || headerRightActions || showCloseIcon) && /* @__PURE__ */ jsxRuntime.jsxs("header", { className: ClassNames("usx-popover__header", headerClassName), children: [
918
+ headerLeftActions && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "usx-popover__header-left-actions", children: headerLeftActions }),
919
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "usx-popover__header-content", children: panelHeading && /* @__PURE__ */ jsxRuntime.jsx(Heading, { id: panelHeadingId, className: "usx-popover__panel-heading", tabIndex: -1, children: panelHeading }) }),
920
+ (headerRightActions || showCloseIcon) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "usx-popover__header-right-actions", children: [
921
+ headerRightActions,
922
+ showCloseIcon && /* @__PURE__ */ jsxRuntime.jsx(
923
+ Button,
924
+ {
925
+ variant: "unstyled",
926
+ tighten: true,
927
+ className: "usx-popover__header-action usx-popover__header-close",
928
+ "aria-label": closeIconLabel,
929
+ iconProps: [{ name: "close" }],
930
+ extraAttributes: { "data-usx-popover-close": id }
931
+ }
932
+ )
933
+ ] })
934
+ ] }),
935
+ menuItems && menuItems.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(PopoverMenu, { items: menuItems, prefix: id, panelShape }),
936
+ Boolean(children) && /* @__PURE__ */ jsxRuntime.jsx(
937
+ "div",
938
+ {
939
+ className: ClassNames(
940
+ "usx-popover__panel-content",
941
+ { "usx-popover__scroll": scrollable },
942
+ contentClassName
943
+ ),
944
+ children
945
+ }
946
+ ),
947
+ showClose && /* @__PURE__ */ jsxRuntime.jsx(
948
+ Button,
949
+ {
950
+ variant: "unstyled",
951
+ className: "usx-popover__panel-close",
952
+ "data-usx-popover-close": id,
953
+ children: closeLabel
954
+ }
955
+ )
956
+ ]
957
+ }
958
+ )
959
+ ]
960
+ }
961
+ );
962
+ }
963
+ exports.Alert = Alert;
964
+ exports.Avatar = Avatar;
965
+ exports.AvatarGroup = AvatarGroup;
966
+ exports.Button = Button;
967
+ exports.ButtonGroup = ButtonGroup;
968
+ exports.Callout = Callout;
969
+ exports.ClassNames = ClassNames;
970
+ exports.Clickable = Clickable;
971
+ exports.ErrorMessage = ErrorMessage;
972
+ exports.FormGroup = FormGroup;
973
+ exports.Hint = Hint;
974
+ exports.Icon = Icon;
975
+ exports.Image = Image;
976
+ exports.Label = Label;
977
+ exports.Link = Link;
978
+ exports.Popover = Popover;
979
+ exports.Required = Required;
980
+ exports.Spinner = Spinner;
981
+ exports.Summary = Summary;
982
+ exports.Tag = Tag;
983
+ exports.TagGroup = TagGroup;
984
+ exports.TextArea = TextArea;
985
+ exports.Tooltip = Tooltip;
986
+ exports.getAssetUrl = getAssetUrl;
987
+ exports.getDefaultExportFromCjs = getDefaultExportFromCjs;