@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,988 @@
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
+ tighten = false,
352
+ inverse = false,
353
+ ghost = false,
354
+ loading = false,
355
+ iconProps = [],
356
+ className = "",
357
+ children = "",
358
+ extraAttributes = {},
359
+ ...props
360
+ }) {
361
+ const leftIcons = iconProps.filter((icon) => (icon.position ?? "left") === "left");
362
+ const rightIcons = iconProps.filter((icon) => icon.position === "right");
363
+ const renderIcon = (icon, index) => {
364
+ const { position, ...iconRest } = icon;
365
+ return /* @__PURE__ */ jsx(Icon, { ...iconRest }, index);
366
+ };
367
+ const spinner = loading && /* @__PURE__ */ jsx(Spinner, { size: 2 });
368
+ const variantClasses = {
369
+ primary: "usa-button--primary",
370
+ secondary: "usa-button--secondary",
371
+ "accent-cool": "usa-button--accent-cool",
372
+ "accent-warm": "usa-button--accent-warm",
373
+ base: "usa-button--base",
374
+ outline: "usa-button--outline",
375
+ unstyled: "usa-button--unstyled"
376
+ };
377
+ const classes = ClassNames(
378
+ "usa-button",
379
+ "usx-button",
380
+ variant && variantClasses[variant],
381
+ big && "usa-button--big",
382
+ tighten && "usx-button--tight",
383
+ inverse && "usa-button--inverse",
384
+ ghost && "usx-button--ghost",
385
+ className
386
+ );
387
+ if (href) {
388
+ const {
389
+ // Remove unused variables
390
+ ...anchorProps
391
+ } = props;
392
+ return /* @__PURE__ */ jsxs(
393
+ "a",
394
+ {
395
+ className: classes,
396
+ href,
397
+ ...isExternal ? { target: "_blank", rel: "noopener noreferrer" } : {},
398
+ ...anchorProps,
399
+ ...extraAttributes,
400
+ children: [
401
+ spinner,
402
+ leftIcons.map(renderIcon),
403
+ children || label,
404
+ rightIcons.map(renderIcon)
405
+ ]
406
+ }
407
+ );
408
+ }
409
+ const {
410
+ // Remove unused variables
411
+ ...buttonProps
412
+ } = props;
413
+ return /* @__PURE__ */ jsxs(
414
+ "button",
415
+ {
416
+ type,
417
+ className: classes,
418
+ disabled,
419
+ "aria-disabled": disabled ? "true" : void 0,
420
+ ...onClick ? { onClick } : {},
421
+ ...buttonProps,
422
+ ...extraAttributes,
423
+ children: [
424
+ spinner,
425
+ leftIcons.map(renderIcon),
426
+ children || label,
427
+ rightIcons.map(renderIcon)
428
+ ]
429
+ }
430
+ );
431
+ }
432
+ function ButtonGroup({
433
+ buttonProps = [],
434
+ segmented = false,
435
+ className = "",
436
+ ...props
437
+ }) {
438
+ const classes = ClassNames(
439
+ "usa-button-group usx-button-group",
440
+ segmented && "usa-button-group--segmented",
441
+ className
442
+ );
443
+ 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)) });
444
+ }
445
+ function Callout({
446
+ className,
447
+ strokeColor,
448
+ indent,
449
+ dedent,
450
+ big,
451
+ orientation = "horizontal",
452
+ children,
453
+ content,
454
+ backgroundColor,
455
+ textColor,
456
+ as: Element = "div",
457
+ ...props
458
+ }) {
459
+ return /* @__PURE__ */ jsx(
460
+ Element,
461
+ {
462
+ className: ClassNames(
463
+ "usx-callout",
464
+ orientation === "vertical" && "usx-callout--vertical",
465
+ strokeColor && `border-${strokeColor}`,
466
+ indent && `usx-callout--indent-${indent}`,
467
+ dedent && "usx-callout--dedent",
468
+ (big ?? orientation === "horizontal") && "usx-callout--big",
469
+ backgroundColor && `bg-${backgroundColor}`,
470
+ textColor && `text-${textColor}`,
471
+ className
472
+ ),
473
+ ...props,
474
+ children: children ?? content
475
+ }
476
+ );
477
+ }
478
+ const Tag = ({
479
+ id,
480
+ big = false,
481
+ value,
482
+ color = null,
483
+ outline = false,
484
+ icon = null,
485
+ dismissible = false,
486
+ isDismissed = false,
487
+ onDismiss = () => {
488
+ },
489
+ className = "",
490
+ children,
491
+ href,
492
+ target,
493
+ rel,
494
+ extraAttributes = {},
495
+ ...props
496
+ }) => {
497
+ const [isVisible, setIsVisible] = useState(!isDismissed);
498
+ const interactive = Boolean(href);
499
+ const classes = ClassNames(
500
+ "usa-tag",
501
+ "usx-tag",
502
+ { "usa-tag--big": big },
503
+ { [`bg-${color}`]: color && !outline && !interactive },
504
+ { [`text-${color}`]: color && outline && !interactive },
505
+ { "usx-tag--outline": outline || interactive },
506
+ { "usa-link usx-link usx-no-visited usx-tag--interactive": interactive },
507
+ className
508
+ );
509
+ const handleDismiss = (e) => {
510
+ e.preventDefault();
511
+ if (onDismiss) {
512
+ onDismiss(e);
513
+ }
514
+ setIsVisible(false);
515
+ };
516
+ if (!isVisible) {
517
+ return null;
518
+ }
519
+ const content = /* @__PURE__ */ jsxs(Fragment, { children: [
520
+ icon && /* @__PURE__ */ jsx(Icon, { name: icon, size: big ? 3 : 2 }),
521
+ " ",
522
+ children || value,
523
+ dismissible && !interactive && /* @__PURE__ */ jsx(
524
+ "button",
525
+ {
526
+ type: "button",
527
+ className: "usx-tag__dismiss",
528
+ "aria-label": "Dismiss tag",
529
+ onClick: handleDismiss,
530
+ children: /* @__PURE__ */ jsx(Icon, { name: "close", size: 2 })
531
+ }
532
+ )
533
+ ] });
534
+ if (href) {
535
+ return /* @__PURE__ */ jsx(
536
+ "a",
537
+ {
538
+ id,
539
+ href,
540
+ target,
541
+ rel,
542
+ className: classes,
543
+ ...props,
544
+ ...extraAttributes,
545
+ children: content
546
+ }
547
+ );
548
+ }
549
+ return /* @__PURE__ */ jsx("span", { id, className: classes, ...props, ...extraAttributes, children: content });
550
+ };
551
+ function Image({
552
+ src,
553
+ alt,
554
+ href,
555
+ rounded = false,
556
+ circular = false,
557
+ caption,
558
+ hideCaption = false,
559
+ objectFit = "",
560
+ maxWidth,
561
+ maxHeight,
562
+ staticBaseUrl,
563
+ srcSet,
564
+ className = "",
565
+ ...props
566
+ }) {
567
+ const classes = ClassNames(
568
+ "usx-image",
569
+ {
570
+ "usx-image--rounded": rounded,
571
+ "usx-image--circular": circular,
572
+ [`usx-object-fit-${objectFit}`]: objectFit
573
+ },
574
+ className
575
+ );
576
+ const style = {};
577
+ if (maxWidth) style.maxWidth = maxWidth;
578
+ if (maxHeight) style.maxHeight = maxHeight;
579
+ if (maxHeight && !maxWidth) style.width = "auto";
580
+ if (maxWidth && !maxHeight) style.height = "auto";
581
+ const captionClasses = ClassNames(
582
+ "usx-image--caption",
583
+ { "usa-sr-only": hideCaption }
584
+ );
585
+ const isResponsive = src && typeof src === "object";
586
+ const imgElement = !src ? "Image" : isResponsive ? /* @__PURE__ */ jsxs("picture", { children: [
587
+ src.sources.map((source, i) => /* @__PURE__ */ jsx(
588
+ "source",
589
+ {
590
+ ...source.media ? { media: source.media } : {},
591
+ srcSet: getAssetSrcSet(source.srcSet, staticBaseUrl),
592
+ ...source.type ? { type: source.type } : {},
593
+ ...source.sizes ? { sizes: source.sizes } : {}
594
+ },
595
+ i
596
+ )),
597
+ /* @__PURE__ */ jsx("img", { src: getAssetUrl(src.fallback, staticBaseUrl), srcSet: srcSet ? getAssetSrcSet(srcSet, staticBaseUrl) : void 0, alt, style, ...props })
598
+ ] }) : /* @__PURE__ */ jsx("img", { src: getAssetUrl(src, staticBaseUrl), srcSet: srcSet ? getAssetSrcSet(srcSet, staticBaseUrl) : void 0, alt, style, ...props });
599
+ if (caption) {
600
+ return /* @__PURE__ */ jsxs("figure", { className: classes, style, children: [
601
+ href ? /* @__PURE__ */ jsx("a", { href, children: imgElement }) : imgElement,
602
+ /* @__PURE__ */ jsx("figcaption", { className: captionClasses, children: caption })
603
+ ] });
604
+ }
605
+ const Element = href ? "a" : "div";
606
+ return /* @__PURE__ */ jsx(
607
+ Element,
608
+ {
609
+ ...href ? { href } : {},
610
+ className: classes,
611
+ style,
612
+ children: imgElement
613
+ }
614
+ );
615
+ }
616
+ function Hint({
617
+ id,
618
+ children = null,
619
+ className = "",
620
+ ...props
621
+ }) {
622
+ const classes = ClassNames("usa-hint", "usx-hint", className);
623
+ return /* @__PURE__ */ jsx("span", { className: classes, ...id ? { id } : {}, ...props, children });
624
+ }
625
+ function ErrorMessage({
626
+ id,
627
+ children = null,
628
+ className = "",
629
+ ...props
630
+ }) {
631
+ const classes = ClassNames("usa-error-message", "usx-error-message", className);
632
+ return /* @__PURE__ */ jsx("span", { className: classes, role: "alert", ...id ? { id } : {}, ...props, children });
633
+ }
634
+ function FormGroup({ children = null, className = "", error = false, ...props }) {
635
+ const classes = ClassNames(
636
+ "usa-form-group",
637
+ "usx-form-group",
638
+ {
639
+ "usa-form-group--error": error
640
+ },
641
+ className
642
+ );
643
+ return /* @__PURE__ */ jsx("div", { className: classes, ...props, children });
644
+ }
645
+ const TextArea = ({
646
+ label = null,
647
+ id,
648
+ placeholder = "",
649
+ disabled = false,
650
+ required = false,
651
+ defaultValue = "",
652
+ value,
653
+ hint = null,
654
+ screenReaderOnlyLabel = false,
655
+ error = null,
656
+ success = null,
657
+ formGroup = true,
658
+ className = "",
659
+ ...props
660
+ }) => {
661
+ const textAreaId = id || `textarea-${Math.random().toString(36).substr(2, 9)}`;
662
+ const hasError = !!error;
663
+ const hasSuccess = !!success;
664
+ const classes = ClassNames(
665
+ "usa-textarea",
666
+ "usx-textarea",
667
+ hasError ? "usa-input--error" : hasSuccess ? "usa-input--success" : null,
668
+ className
669
+ );
670
+ const hintId = hint ? `${textAreaId}-hint` : void 0;
671
+ const describedByParts = [];
672
+ if (hintId) describedByParts.push(hintId);
673
+ if (hasError && typeof error === "string") describedByParts.push(`${textAreaId}-error`);
674
+ const content = /* @__PURE__ */ jsxs(Fragment, { children: [
675
+ label && /* @__PURE__ */ jsx(Label, { htmlFor: textAreaId, required, screenReaderOnly: screenReaderOnlyLabel, error: hasError, children: label }),
676
+ hint && /* @__PURE__ */ jsx(Hint, { id: hintId, children: hint }),
677
+ hasError && typeof error === "string" && /* @__PURE__ */ jsx(ErrorMessage, { id: `${textAreaId}-error`, children: error }),
678
+ /* @__PURE__ */ jsx(
679
+ "textarea",
680
+ {
681
+ id: textAreaId,
682
+ className: classes,
683
+ placeholder,
684
+ disabled,
685
+ ...value !== void 0 ? { value } : { defaultValue },
686
+ ...required ? { required: true } : {},
687
+ "aria-describedby": describedByParts.length ? describedByParts.join(" ") : void 0,
688
+ "aria-invalid": hasError ? "true" : void 0,
689
+ ...props
690
+ }
691
+ )
692
+ ] });
693
+ return formGroup ? /* @__PURE__ */ jsx(FormGroup, { error: hasError, children: content }) : content;
694
+ };
695
+ function ClickableLink({
696
+ children,
697
+ className,
698
+ as: Tag2 = "span",
699
+ colorChange = false,
700
+ bgColorChange = false,
701
+ ...rest
702
+ }) {
703
+ const classes = ClassNames(
704
+ "usx-clickable__link",
705
+ colorChange && "usx-clickable__color-on-hover",
706
+ bgColorChange && "usx-clickable__bg-color-on-hover",
707
+ className
708
+ );
709
+ return /* @__PURE__ */ jsx(Tag2, { className: classes, ...rest, children });
710
+ }
711
+ function ClickableColorChange({ children, className, as: Tag2 = "span", ...rest }) {
712
+ return /* @__PURE__ */ jsx(Tag2, { className: ClassNames("usx-clickable__color-on-hover", className), ...rest, children });
713
+ }
714
+ function ClickableBgColorChange({ children, className, as: Tag2 = "span", ...rest }) {
715
+ return /* @__PURE__ */ jsx(Tag2, { className: ClassNames("usx-clickable__bg-color-on-hover", className), ...rest, children });
716
+ }
717
+ function Clickable({ className, children, extraAttributes = {}, ...rest }) {
718
+ const classes = ClassNames("usx-clickable", className);
719
+ if ("href" in rest && rest.href !== void 0) {
720
+ return /* @__PURE__ */ jsx(
721
+ "a",
722
+ {
723
+ className: classes,
724
+ ...rest,
725
+ ...extraAttributes,
726
+ children
727
+ }
728
+ );
729
+ }
730
+ return /* @__PURE__ */ jsx(
731
+ "button",
732
+ {
733
+ type: "button",
734
+ className: classes,
735
+ ...rest,
736
+ ...extraAttributes,
737
+ children
738
+ }
739
+ );
740
+ }
741
+ Clickable.Link = ClickableLink;
742
+ Clickable.ColorChange = ClickableColorChange;
743
+ Clickable.BgColorChange = ClickableBgColorChange;
744
+ function Summary({
745
+ label = "Details",
746
+ children,
747
+ ariaLabel,
748
+ title,
749
+ className = "",
750
+ textClassName = "",
751
+ markerColor = void 0,
752
+ underlineColor = void 0,
753
+ noUnderline = false,
754
+ noMarker = false,
755
+ unstyled = false
756
+ }) {
757
+ if (unstyled) {
758
+ return /* @__PURE__ */ jsx("summary", { className: className || void 0, "aria-label": ariaLabel, title, children: children ?? label });
759
+ }
760
+ const summaryClassNames = ClassNames(
761
+ "usx-summary",
762
+ { [`marker-${markerColor}`]: markerColor && !noMarker },
763
+ { "usx-summary--no-marker": noMarker },
764
+ { "usx-summary--no-underline": noUnderline },
765
+ className
766
+ );
767
+ const summaryTextClassNames = ClassNames(
768
+ "usx-summary-text",
769
+ { [`underline-${underlineColor}`]: !noUnderline && underlineColor },
770
+ textClassName
771
+ );
772
+ return /* @__PURE__ */ jsx("summary", { className: summaryClassNames, "aria-label": ariaLabel, title, children: /* @__PURE__ */ jsx("span", { className: summaryTextClassNames, children: children ?? (label || "Details") }) });
773
+ }
774
+ function Link({
775
+ href,
776
+ text,
777
+ children,
778
+ visited = false,
779
+ external = false,
780
+ alt = false,
781
+ newTab = false,
782
+ className = "",
783
+ ...props
784
+ }) {
785
+ const classes = ClassNames(
786
+ "usa-link",
787
+ "usx-link",
788
+ visited && "usx-link--visited",
789
+ external && "usa-link--external",
790
+ alt && "usa-link--alt",
791
+ className
792
+ );
793
+ return /* @__PURE__ */ jsx(
794
+ "a",
795
+ {
796
+ href,
797
+ className: classes,
798
+ target: newTab || external ? "_blank" : void 0,
799
+ rel: newTab || external ? "noreferrer noopener" : void 0,
800
+ ...props,
801
+ children: children ?? text
802
+ }
803
+ );
804
+ }
805
+ const TagGroup = ({
806
+ tagProps = null,
807
+ children = null,
808
+ className = "",
809
+ extraAttributes = {},
810
+ ...props
811
+ }) => {
812
+ const classes = ClassNames("usx-tag-group", className);
813
+ const content = children ? children : Array.isArray(tagProps) ? tagProps.map((t, i) => /* @__PURE__ */ jsx(Tag, { ...t }, t.id || t.value || i)) : null;
814
+ return /* @__PURE__ */ jsx("div", { ...props, ...extraAttributes, className: classes, children: content });
815
+ };
816
+ function PopoverMenu({
817
+ items,
818
+ prefix,
819
+ panelShape,
820
+ className,
821
+ ...props
822
+ }) {
823
+ const generatedPrefix = React.useId();
824
+ const base = prefix ?? generatedPrefix;
825
+ return /* @__PURE__ */ jsx("ul", { ...props, className: ClassNames("usx-popover__menu", className), children: items.map((item, index) => {
826
+ const id = item.id ?? `${base}-${index}`;
827
+ return /* @__PURE__ */ jsx("li", { children: item.type === "details" ? /* @__PURE__ */ jsx(
828
+ Popover,
829
+ {
830
+ id,
831
+ summaryProps: {
832
+ ...item.summaryProps,
833
+ className: ClassNames(item.summaryProps.className, "usx-popover__menu-item")
834
+ },
835
+ name: base,
836
+ side: "right",
837
+ panelShape,
838
+ menuItems: item.items
839
+ }
840
+ ) : item.type === "button" || item.onClick ? /* @__PURE__ */ jsxs(
841
+ "button",
842
+ {
843
+ ...item.extraAttributes,
844
+ type: "button",
845
+ className: "usx-popover__menu-item",
846
+ onClick: item.onClick,
847
+ disabled: item.disabled,
848
+ children: [
849
+ item.icon && /* @__PURE__ */ jsx(Icon, { ...item.icon }),
850
+ item.text
851
+ ]
852
+ }
853
+ ) : item.href ? /* @__PURE__ */ jsx(
854
+ Link,
855
+ {
856
+ href: item.href,
857
+ text: item.text,
858
+ className: "usx-no-visited usx-popover__menu-item"
859
+ }
860
+ ) : /* @__PURE__ */ jsx("span", { className: "usx-popover__menu-item", children: item.text }) }, id);
861
+ }) });
862
+ }
863
+ function Popover({
864
+ id,
865
+ side = "bottom",
866
+ align = "start",
867
+ panelShape = "rounded",
868
+ defaultOpen = false,
869
+ dismissOnOutside = true,
870
+ menuItems,
871
+ showClose = false,
872
+ closeLabel = "Close",
873
+ headerLeftActions,
874
+ headerRightActions,
875
+ showCloseIcon = false,
876
+ closeIconLabel = "Close",
877
+ headerClassName,
878
+ panelHeading,
879
+ panelHeadingId,
880
+ headingAs = "h2",
881
+ scrollable = false,
882
+ className,
883
+ summaryProps,
884
+ panelClassName,
885
+ contentClassName,
886
+ extraAttributes,
887
+ children,
888
+ ...props
889
+ }) {
890
+ const composedSummaryProps = { ...summaryProps, label: (summaryProps == null ? void 0 : summaryProps.label) ?? "Open panel" };
891
+ const Heading = headingAs;
892
+ return /* @__PURE__ */ jsxs(
893
+ "details",
894
+ {
895
+ ...props,
896
+ className: ClassNames("usx-popover", className),
897
+ open: defaultOpen || void 0,
898
+ "data-side": side,
899
+ "data-align": align,
900
+ "data-usx-popover-dismiss-on-outside": dismissOnOutside ? void 0 : "false",
901
+ ...extraAttributes,
902
+ children: [
903
+ /* @__PURE__ */ jsx(Summary, { unstyled: true, ...composedSummaryProps }),
904
+ /* @__PURE__ */ jsxs(
905
+ "div",
906
+ {
907
+ id,
908
+ className: ClassNames(
909
+ "usx-popover__panel",
910
+ {
911
+ "usx-popover__panel--square": panelShape === "square"
912
+ },
913
+ panelClassName
914
+ ),
915
+ children: [
916
+ (headerLeftActions || panelHeading || headerRightActions || showCloseIcon) && /* @__PURE__ */ jsxs("header", { className: ClassNames("usx-popover__header", headerClassName), children: [
917
+ headerLeftActions && /* @__PURE__ */ jsx("div", { className: "usx-popover__header-left-actions", children: headerLeftActions }),
918
+ /* @__PURE__ */ jsx("div", { className: "usx-popover__header-content", children: panelHeading && /* @__PURE__ */ jsx(Heading, { id: panelHeadingId, className: "usx-popover__panel-heading", tabIndex: -1, children: panelHeading }) }),
919
+ (headerRightActions || showCloseIcon) && /* @__PURE__ */ jsxs("div", { className: "usx-popover__header-right-actions", children: [
920
+ headerRightActions,
921
+ showCloseIcon && /* @__PURE__ */ jsx(
922
+ Button,
923
+ {
924
+ variant: "unstyled",
925
+ tighten: true,
926
+ className: "usx-popover__header-action usx-popover__header-close",
927
+ "aria-label": closeIconLabel,
928
+ iconProps: [{ name: "close" }],
929
+ extraAttributes: { "data-usx-popover-close": id }
930
+ }
931
+ )
932
+ ] })
933
+ ] }),
934
+ menuItems && menuItems.length > 0 && /* @__PURE__ */ jsx(PopoverMenu, { items: menuItems, prefix: id, panelShape }),
935
+ Boolean(children) && /* @__PURE__ */ jsx(
936
+ "div",
937
+ {
938
+ className: ClassNames(
939
+ "usx-popover__panel-content",
940
+ { "usx-popover__scroll": scrollable },
941
+ contentClassName
942
+ ),
943
+ children
944
+ }
945
+ ),
946
+ showClose && /* @__PURE__ */ jsx(
947
+ Button,
948
+ {
949
+ variant: "unstyled",
950
+ className: "usx-popover__panel-close",
951
+ "data-usx-popover-close": id,
952
+ children: closeLabel
953
+ }
954
+ )
955
+ ]
956
+ }
957
+ )
958
+ ]
959
+ }
960
+ );
961
+ }
962
+ export {
963
+ Avatar as A,
964
+ Button as B,
965
+ ClassNames as C,
966
+ ErrorMessage as E,
967
+ FormGroup as F,
968
+ Hint as H,
969
+ Icon as I,
970
+ Label as L,
971
+ Popover as P,
972
+ Required as R,
973
+ Summary as S,
974
+ Tag as T,
975
+ Image as a,
976
+ ButtonGroup as b,
977
+ TextArea as c,
978
+ Tooltip as d,
979
+ TagGroup as e,
980
+ Link as f,
981
+ getAssetUrl as g,
982
+ Callout as h,
983
+ Alert as i,
984
+ Clickable as j,
985
+ AvatarGroup as k,
986
+ Spinner as l,
987
+ getDefaultExportFromCjs as m
988
+ };