@solexllc/usx-react 0.10.0 → 0.12.0

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