@astra-kit/ui 0.0.0-stage → 0.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 (304) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/LICENSE.md +21 -0
  3. package/README.md +384 -2
  4. package/THIRD_PARTY_NOTICES.md +31 -0
  5. package/assets/fonts/geist-LICENSE.txt +93 -0
  6. package/assets/fonts/geist-latin-variable.woff2 +0 -0
  7. package/assets/fonts/ibm-plex-mono-latin-400.woff2 +0 -0
  8. package/assets/fonts/ibm-plex-mono-latin-500.woff2 +0 -0
  9. package/assets/fonts/ibmplexmono-LICENSE.txt +93 -0
  10. package/assets/fonts/inter-LICENSE.txt +93 -0
  11. package/assets/fonts/inter-latin-variable.woff2 +0 -0
  12. package/dist/adapters/unpic-image.d.ts +3 -0
  13. package/dist/adapters/unpic-image.js +98 -0
  14. package/dist/components/account-menu.d.ts +67 -0
  15. package/dist/components/account-menu.js +440 -0
  16. package/dist/components/action-button.d.ts +25 -0
  17. package/dist/components/action-button.js +264 -0
  18. package/dist/components/alert.d.ts +31 -0
  19. package/dist/components/alert.js +503 -0
  20. package/dist/components/animated-collapse.d.ts +19 -0
  21. package/dist/components/animated-collapse.js +170 -0
  22. package/dist/components/animated-count.d.ts +13 -0
  23. package/dist/components/animated-count.js +105 -0
  24. package/dist/components/animated-list-item.d.ts +25 -0
  25. package/dist/components/animated-list-item.js +134 -0
  26. package/dist/components/animated-theme-toggler.d.ts +12 -0
  27. package/dist/components/animated-theme-toggler.js +200 -0
  28. package/dist/components/avatar.d.ts +65 -0
  29. package/dist/components/avatar.js +463 -0
  30. package/dist/components/badge.d.ts +21 -0
  31. package/dist/components/badge.js +297 -0
  32. package/dist/components/button-interaction.d.ts +23 -0
  33. package/dist/components/button-interaction.js +22 -0
  34. package/dist/components/button-label.d.ts +8 -0
  35. package/dist/components/button-label.js +203 -0
  36. package/dist/components/button.d.ts +23 -0
  37. package/dist/components/button.js +145 -0
  38. package/dist/components/calendar.d.ts +47 -0
  39. package/dist/components/calendar.js +155 -0
  40. package/dist/components/card.d.ts +38 -0
  41. package/dist/components/card.js +904 -0
  42. package/dist/components/carousel.d.ts +71 -0
  43. package/dist/components/carousel.js +585 -0
  44. package/dist/components/checkbox.d.ts +15 -0
  45. package/dist/components/checkbox.js +324 -0
  46. package/dist/components/control-button.d.ts +16 -0
  47. package/dist/components/control-button.js +215 -0
  48. package/dist/components/data-table.d.ts +118 -0
  49. package/dist/components/data-table.js +895 -0
  50. package/dist/components/dialog-surface.d.ts +49 -0
  51. package/dist/components/dialog-surface.js +220 -0
  52. package/dist/components/dialog.d.ts +92 -0
  53. package/dist/components/dialog.js +320 -0
  54. package/dist/components/dropdown-menu.d.ts +57 -0
  55. package/dist/components/dropdown-menu.js +107 -0
  56. package/dist/components/field.d.ts +53 -0
  57. package/dist/components/field.js +710 -0
  58. package/dist/components/file-upload.d.ts +88 -0
  59. package/dist/components/file-upload.js +776 -0
  60. package/dist/components/filter-presets-bar.d.ts +73 -0
  61. package/dist/components/filter-presets-bar.js +510 -0
  62. package/dist/components/filter-query-bar.d.ts +21 -0
  63. package/dist/components/filter-query-bar.js +881 -0
  64. package/dist/components/filter-query-grammar.d.ts +188 -0
  65. package/dist/components/filter-query-grammar.js +875 -0
  66. package/dist/components/form.d.ts +29 -0
  67. package/dist/components/form.js +330 -0
  68. package/dist/components/highlighter.d.ts +15 -0
  69. package/dist/components/highlighter.js +152 -0
  70. package/dist/components/hover-card.d.ts +50 -0
  71. package/dist/components/hover-card.js +80 -0
  72. package/dist/components/input-group.d.ts +16 -0
  73. package/dist/components/input-group.js +277 -0
  74. package/dist/components/input.d.ts +17 -0
  75. package/dist/components/input.js +120 -0
  76. package/dist/components/label.d.ts +4 -0
  77. package/dist/components/label.js +43 -0
  78. package/dist/components/link.d.ts +9 -0
  79. package/dist/components/link.js +43 -0
  80. package/dist/components/morph-text.d.ts +14 -0
  81. package/dist/components/morph-text.js +210 -0
  82. package/dist/components/pagination.d.ts +59 -0
  83. package/dist/components/pagination.js +190 -0
  84. package/dist/components/popover.d.ts +17 -0
  85. package/dist/components/popover.js +40 -0
  86. package/dist/components/presence-swap.d.ts +22 -0
  87. package/dist/components/presence-swap.js +209 -0
  88. package/dist/components/primitives/alert-dialog.d.ts +68 -0
  89. package/dist/components/primitives/alert-dialog.js +629 -0
  90. package/dist/components/primitives/avatar.d.ts +46 -0
  91. package/dist/components/primitives/avatar.js +265 -0
  92. package/dist/components/primitives/calendar.d.ts +37 -0
  93. package/dist/components/primitives/calendar.js +1250 -0
  94. package/dist/components/primitives/carousel.d.ts +106 -0
  95. package/dist/components/primitives/carousel.js +928 -0
  96. package/dist/components/primitives/dialog.d.ts +62 -0
  97. package/dist/components/primitives/dialog.js +490 -0
  98. package/dist/components/primitives/dropdown-menu-items.d.ts +59 -0
  99. package/dist/components/primitives/dropdown-menu-items.js +265 -0
  100. package/dist/components/primitives/dropdown-menu.d.ts +64 -0
  101. package/dist/components/primitives/dropdown-menu.js +560 -0
  102. package/dist/components/primitives/hover-card.d.ts +50 -0
  103. package/dist/components/primitives/hover-card.js +507 -0
  104. package/dist/components/primitives/pagination.d.ts +65 -0
  105. package/dist/components/primitives/pagination.js +373 -0
  106. package/dist/components/primitives/popover.d.ts +22 -0
  107. package/dist/components/primitives/popover.js +213 -0
  108. package/dist/components/primitives/select.d.ts +37 -0
  109. package/dist/components/primitives/select.js +428 -0
  110. package/dist/components/primitives/tooltip.d.ts +30 -0
  111. package/dist/components/primitives/tooltip.js +277 -0
  112. package/dist/components/progress-ring.d.ts +20 -0
  113. package/dist/components/progress-ring.js +53 -0
  114. package/dist/components/radio-group.d.ts +34 -0
  115. package/dist/components/radio-group.js +392 -0
  116. package/dist/components/reaction-button.d.ts +30 -0
  117. package/dist/components/reaction-button.js +189 -0
  118. package/dist/components/rich-link-editor.d.ts +25 -0
  119. package/dist/components/rich-link-editor.js +320 -0
  120. package/dist/components/rich-markdown-content.d.ts +10 -0
  121. package/dist/components/rich-markdown-content.js +56 -0
  122. package/dist/components/rich-text-content.d.ts +19 -0
  123. package/dist/components/rich-text-content.js +26 -0
  124. package/dist/components/select.d.ts +55 -0
  125. package/dist/components/select.js +188 -0
  126. package/dist/components/separator.d.ts +3 -0
  127. package/dist/components/separator.js +48 -0
  128. package/dist/components/sheet.d.ts +19 -0
  129. package/dist/components/sheet.js +420 -0
  130. package/dist/components/sidebar-panel-context.d.ts +17 -0
  131. package/dist/components/sidebar-panel-context.js +14 -0
  132. package/dist/components/sidebar.d.ts +195 -0
  133. package/dist/components/sidebar.js +2041 -0
  134. package/dist/components/skeleton.d.ts +23 -0
  135. package/dist/components/skeleton.js +334 -0
  136. package/dist/components/split-button.d.ts +36 -0
  137. package/dist/components/split-button.js +306 -0
  138. package/dist/components/svgs/whatsappIcon.d.ts +3 -0
  139. package/dist/components/svgs/whatsappIcon.js +14 -0
  140. package/dist/components/switch.d.ts +13 -0
  141. package/dist/components/switch.js +444 -0
  142. package/dist/components/table.d.ts +10 -0
  143. package/dist/components/table.js +298 -0
  144. package/dist/components/tabs.d.ts +36 -0
  145. package/dist/components/tabs.js +636 -0
  146. package/dist/components/textarea.d.ts +16 -0
  147. package/dist/components/textarea.js +111 -0
  148. package/dist/components/themed-toaster.d.ts +7 -0
  149. package/dist/components/themed-toaster.js +86 -0
  150. package/dist/components/toaster.d.ts +12 -0
  151. package/dist/components/toaster.js +62 -0
  152. package/dist/components/tooltip.d.ts +43 -0
  153. package/dist/components/tooltip.js +65 -0
  154. package/dist/components/typing-animation.d.ts +34 -0
  155. package/dist/components/typing-animation.js +389 -0
  156. package/dist/constants/action-button.d.ts +20 -0
  157. package/dist/constants/action-button.js +17 -0
  158. package/dist/constants/alert.d.ts +16 -0
  159. package/dist/constants/alert.js +13 -0
  160. package/dist/constants/avatar.d.ts +38 -0
  161. package/dist/constants/avatar.js +32 -0
  162. package/dist/constants/badge.d.ts +6 -0
  163. package/dist/constants/badge.js +6 -0
  164. package/dist/constants/button.d.ts +16 -0
  165. package/dist/constants/button.js +16 -0
  166. package/dist/constants/calendar.d.ts +36 -0
  167. package/dist/constants/calendar.js +34 -0
  168. package/dist/constants/card.d.ts +23 -0
  169. package/dist/constants/card.js +20 -0
  170. package/dist/constants/carousel.d.ts +55 -0
  171. package/dist/constants/carousel.js +74 -0
  172. package/dist/constants/checkbox.d.ts +17 -0
  173. package/dist/constants/checkbox.js +17 -0
  174. package/dist/constants/dialog.d.ts +11 -0
  175. package/dist/constants/dialog.js +10 -0
  176. package/dist/constants/dropdown-menu.d.ts +10 -0
  177. package/dist/constants/dropdown-menu.js +37 -0
  178. package/dist/constants/field.d.ts +24 -0
  179. package/dist/constants/field.js +24 -0
  180. package/dist/constants/hover-card.d.ts +37 -0
  181. package/dist/constants/hover-card.js +85 -0
  182. package/dist/constants/morph-text.d.ts +13 -0
  183. package/dist/constants/morph-text.js +13 -0
  184. package/dist/constants/motion.d.ts +12 -0
  185. package/dist/constants/motion.js +12 -0
  186. package/dist/constants/pagination.d.ts +20 -0
  187. package/dist/constants/pagination.js +20 -0
  188. package/dist/constants/popover.d.ts +7 -0
  189. package/dist/constants/popover.js +33 -0
  190. package/dist/constants/radio-group.d.ts +10 -0
  191. package/dist/constants/radio-group.js +10 -0
  192. package/dist/constants/select.d.ts +7 -0
  193. package/dist/constants/select.js +34 -0
  194. package/dist/constants/sidebar.d.ts +9 -0
  195. package/dist/constants/sidebar.js +17 -0
  196. package/dist/constants/skeleton.d.ts +17 -0
  197. package/dist/constants/skeleton.js +17 -0
  198. package/dist/constants/split-button.d.ts +7 -0
  199. package/dist/constants/split-button.js +5 -0
  200. package/dist/constants/switch.d.ts +33 -0
  201. package/dist/constants/switch.js +41 -0
  202. package/dist/constants/tabs.d.ts +17 -0
  203. package/dist/constants/tabs.js +17 -0
  204. package/dist/constants/toast.d.ts +3 -0
  205. package/dist/constants/toast.js +3 -0
  206. package/dist/constants/tooltip.d.ts +13 -0
  207. package/dist/constants/tooltip.js +52 -0
  208. package/dist/hooks/use-horizontal-swipe.d.ts +23 -0
  209. package/dist/hooks/use-horizontal-swipe.js +80 -0
  210. package/dist/hooks/use-is-hydrated.d.ts +6 -0
  211. package/dist/hooks/use-is-hydrated.js +20 -0
  212. package/dist/hooks/use-mobile.d.ts +1 -0
  213. package/dist/hooks/use-mobile.js +19 -0
  214. package/dist/hooks/use-prefers-reduced-motion.d.ts +2 -0
  215. package/dist/hooks/use-prefers-reduced-motion.js +27 -0
  216. package/dist/hooks/use-rich-link-editor.d.ts +55 -0
  217. package/dist/hooks/use-rich-link-editor.js +515 -0
  218. package/dist/hooks/use-sidebar-persistence.d.ts +6 -0
  219. package/dist/hooks/use-sidebar-persistence.js +52 -0
  220. package/dist/hooks/use-today.d.ts +7 -0
  221. package/dist/hooks/use-today.js +50 -0
  222. package/dist/hooks/use-viewer-time-zone.d.ts +6 -0
  223. package/dist/hooks/use-viewer-time-zone.js +20 -0
  224. package/dist/hooks.d.ts +11 -0
  225. package/dist/hooks.js +11 -0
  226. package/dist/index.d.ts +71 -0
  227. package/dist/index.js +69 -0
  228. package/dist/lib/browser-clipboard.d.ts +13 -0
  229. package/dist/lib/browser-clipboard.js +48 -0
  230. package/dist/lib/column-filter-value.d.ts +12 -0
  231. package/dist/lib/column-filter-value.js +52 -0
  232. package/dist/lib/file-acceptance.d.ts +43 -0
  233. package/dist/lib/file-acceptance.js +107 -0
  234. package/dist/lib/format-file-size.d.ts +16 -0
  235. package/dist/lib/format-file-size.js +34 -0
  236. package/dist/lib/fuzzy-search.d.ts +17 -0
  237. package/dist/lib/fuzzy-search.js +183 -0
  238. package/dist/lib/horizontal-swipe.d.ts +23 -0
  239. package/dist/lib/horizontal-swipe.js +29 -0
  240. package/dist/lib/image-dimensions.d.ts +2 -0
  241. package/dist/lib/image-dimensions.js +7 -0
  242. package/dist/lib/name-initials.d.ts +7 -0
  243. package/dist/lib/name-initials.js +11 -0
  244. package/dist/lib/rich-text/link-markdown-constants.d.ts +147 -0
  245. package/dist/lib/rich-text/link-markdown-constants.js +458 -0
  246. package/dist/lib/rich-text/link-markdown-types.d.ts +53 -0
  247. package/dist/lib/rich-text/link-markdown-types.js +1 -0
  248. package/dist/lib/rich-text/link-markdown.d.ts +193 -0
  249. package/dist/lib/rich-text/link-markdown.js +592 -0
  250. package/dist/lib/rich-text/rich-markdown.d.ts +41 -0
  251. package/dist/lib/rich-text/rich-markdown.js +105 -0
  252. package/dist/lib/rich-text/rich-text-editor-dom.d.ts +26 -0
  253. package/dist/lib/rich-text/rich-text-editor-dom.js +79 -0
  254. package/dist/lib/toast-layer.d.ts +24 -0
  255. package/dist/lib/toast-layer.js +76 -0
  256. package/dist/lib/utils.d.ts +2 -0
  257. package/dist/lib/utils.js +2 -0
  258. package/dist/lib/year-month-filter.d.ts +16 -0
  259. package/dist/lib/year-month-filter.js +46 -0
  260. package/dist/motion/arc-floating-slot.d.ts +40 -0
  261. package/dist/motion/arc-floating-slot.js +177 -0
  262. package/dist/motion/arc-press.d.ts +6 -0
  263. package/dist/motion/arc-press.js +59 -0
  264. package/dist/motion/arc-swap.d.ts +22 -0
  265. package/dist/motion/arc-swap.js +49 -0
  266. package/dist/motion/arc-tokens.d.ts +53 -0
  267. package/dist/motion/arc-tokens.js +73 -0
  268. package/dist/motion/glide-indicator.d.ts +69 -0
  269. package/dist/motion/glide-indicator.js +309 -0
  270. package/dist/motion/glide-slot.d.ts +9 -0
  271. package/dist/motion/glide-slot.js +71 -0
  272. package/dist/motion/motion-slot.d.ts +12 -0
  273. package/dist/motion/motion-slot.js +376 -0
  274. package/dist/motion/overlay-warmth.d.ts +24 -0
  275. package/dist/motion/overlay-warmth.js +70 -0
  276. package/dist/motion/presence.d.ts +40 -0
  277. package/dist/motion/presence.js +101 -0
  278. package/dist/motion/surface-keyframes.d.ts +24 -0
  279. package/dist/motion/surface-keyframes.js +141 -0
  280. package/dist/motion/tokens.d.ts +81 -0
  281. package/dist/motion/tokens.js +67 -0
  282. package/dist/motion/use-attached-element.d.ts +7 -0
  283. package/dist/motion/use-attached-element.js +22 -0
  284. package/dist/motion/use-morph-width.d.ts +13 -0
  285. package/dist/motion/use-morph-width.js +59 -0
  286. package/dist/next.d.ts +14 -0
  287. package/dist/next.js +79 -0
  288. package/dist/providers/astra-ui-provider.d.ts +27 -0
  289. package/dist/providers/astra-ui-provider.js +100 -0
  290. package/dist/providers/native-provider.d.ts +4 -0
  291. package/dist/providers/native-provider.js +45 -0
  292. package/dist/sonner.d.ts +7 -0
  293. package/dist/sonner.js +8 -0
  294. package/dist/styles.css +2 -0
  295. package/dist/tanstack.d.ts +11 -0
  296. package/dist/tanstack.js +50 -0
  297. package/dist/theme.d.ts +3 -0
  298. package/dist/theme.js +1 -0
  299. package/dist/types/data-table.d.ts +27 -0
  300. package/dist/types/data-table.js +1 -0
  301. package/fonts.css +5 -0
  302. package/package.json +450 -4
  303. package/styles.css +4 -0
  304. package/theme.css +248 -0
@@ -0,0 +1,49 @@
1
+ import type { ReactNode, Ref } from "react";
2
+ /** Arc's overlay: a near-black scrim at 46% with a 7px backdrop blur where the engine supports it. */
3
+ export declare const dialogOverlayClassName = "fixed inset-0 isolate z-50 bg-[oklch(10%_0_0/0.46)] supports-backdrop-filter:backdrop-blur-[7px]";
4
+ /**
5
+ * Arc's panel: raised surface, hairline border, surface radius and floating shadow, padded on Arc's 24px step.
6
+ * Placement, width and scrolling stay with each dialog.
7
+ */
8
+ export declare const dialogSurfaceClassName = "z-50 gap-(--space-5) rounded-(--radius-surface) border border-border bg-surface-raised p-(--space-6) text-sm leading-(--leading-body) text-foreground shadow-(--shadow-floating) outline-none";
9
+ /** Edge-to-edge action row: bleeds through the panel padding and sits under a hairline like Arc's header divider. */
10
+ export declare const dialogFooterClassName = "-mx-(--space-6) -mb-(--space-6) flex flex-col-reverse gap-(--space-2) rounded-b-[calc(var(--radius-surface)-1px)] border-t border-border bg-surface-muted/50 px-(--space-6) py-(--space-4) sm:flex-row sm:justify-end";
11
+ /** Arc's title: body font at 18px, medium weight, body leading so a heading reset never shrinks it. */
12
+ export declare const dialogTitleClassName = "font-sans text-lg leading-(--leading-body) font-medium tracking-(--tracking-body) [overflow-wrap:anywhere]";
13
+ /** Arc's description: secondary text at 14px on body leading. */
14
+ export declare const dialogDescriptionClassName = "text-sm leading-(--leading-body) text-text-secondary [overflow-wrap:anywhere] *:[a]:underline *:[a]:underline-offset-3 hover-fine:*:[a]:text-foreground";
15
+ /**
16
+ * Arc's compact close button: 32px, bordered, half-tinted, quiet until a fine pointer hovers it. Press feedback comes
17
+ * from `ControlButton`.
18
+ */
19
+ export declare const dialogCloseButtonClassName = "size-(--space-8) rounded-(--radius-control) border-border bg-surface-muted/50 text-text-secondary hover-fine:bg-surface-muted hover-fine:text-foreground [&_svg:not([class*='size-'])]:size-4";
20
+ /** Where the dialog close button sits: inside the panel or pinned to the viewport corner. */
21
+ export type DialogCloseButtonPlacement = "content" | "viewport";
22
+ /** Which Radix family owns the close button: a regular dialog closes, an alert dialog cancels. */
23
+ export type DialogSurfaceKind = "dialog" | "alert";
24
+ /**
25
+ * Arc's bordered close button for both dialog families. Pinned to the viewport corner it stays hidden while the panel
26
+ * enters, because the entrance transform would otherwise carry it along with the panel, fades in once the panel settles and hides
27
+ * at once when the dialog starts closing; while hidden it is also `visibility: hidden`, so the initial focus and the
28
+ * keyboard never land on a control that cannot be seen. Inside the panel it pops in after the panel.
29
+ * @param props - The Radix family, the placement and the accessible name.
30
+ * @param props.kind - `alert` renders Radix's `AlertDialog.Cancel`, `dialog` its `Dialog.Close`.
31
+ * @param props.placement - `viewport` pins it to the viewport corner; `content` keeps it in the panel.
32
+ * @param props.label - Accessible name of the icon-only button.
33
+ * @returns The close control.
34
+ */
35
+ export declare function DialogSurfaceCloseButton({ kind, placement, label, buttonRef, }: {
36
+ kind: DialogSurfaceKind;
37
+ placement: DialogCloseButtonPlacement;
38
+ label?: string;
39
+ /** Ref of the close button element. */
40
+ buttonRef?: Ref<HTMLButtonElement>;
41
+ }): import("react").JSX.Element;
42
+ /**
43
+ * Arc's text swap: when a dialog's title or description text changes while it is open, the new copy rises in and the
44
+ * old copy lifts out. The first render is static, so server HTML and the opening frame never animate the copy.
45
+ * @param children - Copy of the title or description. Only plain text and numbers animate when they change.
46
+ * @param asChild - Whether the primitive renders the consumer's element, which must then receive it untouched.
47
+ * @returns The copy, wrapped for the swap when it is plain text.
48
+ */
49
+ export declare function withDialogSwapText(children: ReactNode, asChild?: boolean): ReactNode;
@@ -0,0 +1,220 @@
1
+ "use client";
2
+ import { c as _c } from "react/compiler-runtime";
3
+ /**
4
+ * Arc's Dialog surface (https://uiarc.dev, MIT License, see THIRD_PARTY_NOTICES.md), shared by `Dialog` and
5
+ * its `alert` mode: the dimmed, blurred overlay, the raised panel with Arc's surface radius, border and floating shadow,
6
+ * the title and description type, the bordered close button and the text swap that animates a title or description
7
+ * changed while the dialog is open. Internal: the panel's entrance and exit are Arc's, played by `MotionSlot`.
8
+ */
9
+ import { XIcon } from "lucide-react";
10
+ import { AnimatePresence, motion, useIsPresent } from "motion/react";
11
+ import { AlertDialog as AlertDialogPrimitive, Dialog as DialogPrimitive } from "radix-ui";
12
+ import { DIALOG_DEFAULT_COPY, DIALOG_TEXT_SWAP_OFFSET_EM } from "../constants/dialog.js";
13
+ import { usePrefersReducedMotion } from "../hooks/use-prefers-reduced-motion.js";
14
+ import { cn } from "../lib/utils.js";
15
+ import { ARC_BLUR, ARC_DURATION, ARC_EASE } from "../motion/arc-tokens.js";
16
+ import { ControlButton } from "./control-button.js";
17
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
18
+ /** Arc's overlay: a near-black scrim at 46% with a 7px backdrop blur where the engine supports it. */
19
+ export const dialogOverlayClassName = "fixed inset-0 isolate z-50 bg-[oklch(10%_0_0/0.46)] supports-backdrop-filter:backdrop-blur-[7px]";
20
+ /**
21
+ * Arc's panel: raised surface, hairline border, surface radius and floating shadow, padded on Arc's 24px step.
22
+ * Placement, width and scrolling stay with each dialog.
23
+ */
24
+ export const dialogSurfaceClassName = "z-50 gap-(--space-5) rounded-(--radius-surface) border border-border bg-surface-raised p-(--space-6) text-sm leading-(--leading-body) text-foreground shadow-(--shadow-floating) outline-none";
25
+ /** Edge-to-edge action row: bleeds through the panel padding and sits under a hairline like Arc's header divider. */
26
+ export const dialogFooterClassName = "-mx-(--space-6) -mb-(--space-6) flex flex-col-reverse gap-(--space-2) rounded-b-[calc(var(--radius-surface)-1px)] border-t border-border bg-surface-muted/50 px-(--space-6) py-(--space-4) sm:flex-row sm:justify-end";
27
+ /** Arc's title: body font at 18px, medium weight, body leading so a heading reset never shrinks it. */
28
+ export const dialogTitleClassName = "font-sans text-lg leading-(--leading-body) font-medium tracking-(--tracking-body) [overflow-wrap:anywhere]";
29
+ /** Arc's description: secondary text at 14px on body leading. */
30
+ export const dialogDescriptionClassName = "text-sm leading-(--leading-body) text-text-secondary [overflow-wrap:anywhere] *:[a]:underline *:[a]:underline-offset-3 hover-fine:*:[a]:text-foreground";
31
+ /**
32
+ * Arc's compact close button: 32px, bordered, half-tinted, quiet until a fine pointer hovers it. Press feedback comes
33
+ * from `ControlButton`.
34
+ */
35
+ export const dialogCloseButtonClassName = "size-(--space-8) rounded-(--radius-control) border-border bg-surface-muted/50 text-text-secondary hover-fine:bg-surface-muted hover-fine:text-foreground [&_svg:not([class*='size-'])]:size-4";
36
+ /** Classes of a close button pinned to the viewport corner while the panel enters and closes. */
37
+ const viewportCloseButtonClassName = "fixed top-4 right-4 transition-opacity duration-200 ease-out in-data-motion-entering:invisible in-data-motion-entering:opacity-0 in-data-motion-entering:transition-none in-data-[state=closed]:invisible in-data-[state=closed]:opacity-0 in-data-[state=closed]:transition-none motion-reduce:transition-none";
38
+ /** Classes of a close button centred on the first line of an 18px title, as in Arc's header row. */
39
+ const contentCloseButtonClassName = "absolute top-[calc(var(--space-6)+(var(--text-lg)*var(--leading-body)-var(--space-8))/2)] right-(--space-6)";
40
+ /**
41
+ * Arc's bordered close button for both dialog families. Pinned to the viewport corner it stays hidden while the panel
42
+ * enters, because the entrance transform would otherwise carry it along with the panel, fades in once the panel settles and hides
43
+ * at once when the dialog starts closing; while hidden it is also `visibility: hidden`, so the initial focus and the
44
+ * keyboard never land on a control that cannot be seen. Inside the panel it pops in after the panel.
45
+ * @param props - The Radix family, the placement and the accessible name.
46
+ * @param props.kind - `alert` renders Radix's `AlertDialog.Cancel`, `dialog` its `Dialog.Close`.
47
+ * @param props.placement - `viewport` pins it to the viewport corner; `content` keeps it in the panel.
48
+ * @param props.label - Accessible name of the icon-only button.
49
+ * @returns The close control.
50
+ */
51
+ export function DialogSurfaceCloseButton(t0) {
52
+ const $ = _c(12);
53
+ const { kind, placement, label: t1, buttonRef } = t0;
54
+ const label = t1 === undefined ? DIALOG_DEFAULT_COPY.closeLabel : t1;
55
+ const Close = kind === "alert" ? AlertDialogPrimitive.Cancel : DialogPrimitive.Close;
56
+ const t2 = placement === "viewport" ? viewportCloseButtonClassName : contentCloseButtonClassName;
57
+ let t3;
58
+ if ($[0] !== t2) {
59
+ t3 = cn(dialogCloseButtonClassName, t2);
60
+ $[0] = t2;
61
+ $[1] = t3;
62
+ } else {
63
+ t3 = $[1];
64
+ }
65
+ let t4;
66
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
67
+ t4 = /* @__PURE__ */ _jsx(XIcon, { "aria-hidden": "true" });
68
+ $[2] = t4;
69
+ } else {
70
+ t4 = $[2];
71
+ }
72
+ let t5;
73
+ if ($[3] !== label) {
74
+ t5 = /* @__PURE__ */ _jsx("span", {
75
+ className: "sr-only",
76
+ children: label
77
+ });
78
+ $[3] = label;
79
+ $[4] = t5;
80
+ } else {
81
+ t5 = $[4];
82
+ }
83
+ let t6;
84
+ if ($[5] !== buttonRef || $[6] !== t3 || $[7] !== t5) {
85
+ t6 = /* @__PURE__ */ _jsxs(ControlButton, {
86
+ ref: buttonRef,
87
+ variant: "ghost",
88
+ size: "icon-sm",
89
+ className: t3,
90
+ children: [t4, t5]
91
+ });
92
+ $[5] = buttonRef;
93
+ $[6] = t3;
94
+ $[7] = t5;
95
+ $[8] = t6;
96
+ } else {
97
+ t6 = $[8];
98
+ }
99
+ const button = t6;
100
+ let t7;
101
+ if ($[9] !== Close || $[10] !== button) {
102
+ t7 = /* @__PURE__ */ _jsx(Close, {
103
+ "data-slot": "dialog-close",
104
+ asChild: true,
105
+ children: button
106
+ });
107
+ $[9] = Close;
108
+ $[10] = button;
109
+ $[11] = t7;
110
+ } else {
111
+ t7 = $[11];
112
+ }
113
+ return t7;
114
+ }
115
+ /**
116
+ * One version of the copy. While it lifts out it turns inert and hidden from assistive technology, so the dialog's
117
+ * accessible name never reads the old and the new copy together.
118
+ * @param props - The copy to render and the ref `AnimatePresence` injects to pop the leaving copy out of layout.
119
+ * @returns The animated copy.
120
+ */
121
+ function DialogSwapTextItem(t0) {
122
+ const $ = _c(13);
123
+ const { children, ref } = t0;
124
+ const isPresent = useIsPresent();
125
+ const shouldReduceMotion = usePrefersReducedMotion();
126
+ const t1 = isPresent ? undefined : true;
127
+ const t2 = !isPresent || undefined;
128
+ let t3;
129
+ if ($[0] !== shouldReduceMotion) {
130
+ t3 = shouldReduceMotion ? false : {
131
+ opacity: 0,
132
+ y: `${DIALOG_TEXT_SWAP_OFFSET_EM.enter}em`,
133
+ filter: `blur(${ARC_BLUR.soft}px)`
134
+ };
135
+ $[0] = shouldReduceMotion;
136
+ $[1] = t3;
137
+ } else {
138
+ t3 = $[1];
139
+ }
140
+ let t4;
141
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
142
+ t4 = {
143
+ opacity: 1,
144
+ y: 0,
145
+ filter: "blur(0px)"
146
+ };
147
+ $[2] = t4;
148
+ } else {
149
+ t4 = $[2];
150
+ }
151
+ let t5;
152
+ if ($[3] !== shouldReduceMotion) {
153
+ t5 = shouldReduceMotion ? {
154
+ opacity: 0,
155
+ transition: { duration: 0 }
156
+ } : {
157
+ opacity: 0,
158
+ y: `${DIALOG_TEXT_SWAP_OFFSET_EM.exit}em`,
159
+ filter: `blur(${ARC_BLUR.subtle}px)`,
160
+ transition: {
161
+ duration: ARC_DURATION.fast,
162
+ ease: [...ARC_EASE.standard]
163
+ }
164
+ };
165
+ $[3] = shouldReduceMotion;
166
+ $[4] = t5;
167
+ } else {
168
+ t5 = $[4];
169
+ }
170
+ let t6;
171
+ if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
172
+ t6 = {
173
+ duration: ARC_DURATION.standard,
174
+ ease: [...ARC_EASE.enter]
175
+ };
176
+ $[5] = t6;
177
+ } else {
178
+ t6 = $[5];
179
+ }
180
+ let t7;
181
+ if ($[6] !== children || $[7] !== ref || $[8] !== t1 || $[9] !== t2 || $[10] !== t3 || $[11] !== t5) {
182
+ t7 = /* @__PURE__ */ _jsx(motion.span, {
183
+ ref,
184
+ "data-slot": "dialog-swap-text",
185
+ className: "block",
186
+ "aria-hidden": t1,
187
+ inert: t2,
188
+ initial: t3,
189
+ animate: t4,
190
+ exit: t5,
191
+ transition: t6,
192
+ children
193
+ });
194
+ $[6] = children;
195
+ $[7] = ref;
196
+ $[8] = t1;
197
+ $[9] = t2;
198
+ $[10] = t3;
199
+ $[11] = t5;
200
+ $[12] = t7;
201
+ } else {
202
+ t7 = $[12];
203
+ }
204
+ return t7;
205
+ }
206
+ /**
207
+ * Arc's text swap: when a dialog's title or description text changes while it is open, the new copy rises in and the
208
+ * old copy lifts out. The first render is static, so server HTML and the opening frame never animate the copy.
209
+ * @param children - Copy of the title or description. Only plain text and numbers animate when they change.
210
+ * @param asChild - Whether the primitive renders the consumer's element, which must then receive it untouched.
211
+ * @returns The copy, wrapped for the swap when it is plain text.
212
+ */
213
+ export function withDialogSwapText(children, asChild = false) {
214
+ if (asChild || typeof children !== "string" && typeof children !== "number") return children;
215
+ return /* @__PURE__ */ _jsx(AnimatePresence, {
216
+ mode: "popLayout",
217
+ initial: false,
218
+ children: /* @__PURE__ */ _jsx(DialogSwapTextItem, { children }, String(children))
219
+ });
220
+ }
@@ -0,0 +1,92 @@
1
+ /**
2
+ * Arc's Dialog (https://uiarc.dev, MIT License, see THIRD_PARTY_NOTICES.md): a focused surface for decisions that need
3
+ * attention. Arc's API (`Dialog`, `DialogTrigger`, `DialogContent` with its `title`, `description` and built-in close
4
+ * button, `DialogClose`) on Arc's overlay, raised panel, text swap and dialog transition. @astra-kit/ui
5
+ * extends it with a footer slot, a hidden title, the viewport close button placement, Spanish copy and an `alert` mode
6
+ * that replaces the former `AlertDialog`.
7
+ */
8
+ import { type ComponentProps, type ReactNode, type Ref } from "react";
9
+ import { type Dialog as DialogRadix } from "radix-ui";
10
+ import type { DialogCloseButtonPlacement } from "./dialog-surface.js";
11
+ export type { DialogCloseButtonPlacement } from "./dialog-surface.js";
12
+ /** Props of `Dialog`: Radix's root contract plus @astra-kit/ui's `alert` mode. */
13
+ export type DialogProps = ComponentProps<typeof DialogRadix.Root> & {
14
+ /**
15
+ * Gives the dialog alert dialog semantics: `role="alertdialog"`, a press outside never closes it, it opens with the
16
+ * focus on the first `DialogClose` (the least destructive answer) and `DialogContent` hides its close button by
17
+ * default. `Escape` still cancels it. `modal` does not apply: an alert dialog is always modal.
18
+ */
19
+ alert?: boolean;
20
+ };
21
+ /**
22
+ * Root that tracks the open state so the content can animate out. Controlled (`open`, `onOpenChange`) or uncontrolled
23
+ * (`defaultOpen`).
24
+ * @param props - Radix root props and `alert`.
25
+ * @returns The dialog root.
26
+ */
27
+ declare function Dialog({ alert, modal, ...props }: DialogProps): import("react").JSX.Element;
28
+ /** Props of `DialogTrigger`: Radix's trigger contract, including `asChild`. */
29
+ export type DialogTriggerProps = ComponentProps<typeof DialogRadix.Trigger>;
30
+ /**
31
+ * Opens the dialog. Use `asChild` to render your own button.
32
+ * @param props - Radix trigger props.
33
+ * @returns The trigger.
34
+ */
35
+ declare function DialogTrigger(props: DialogTriggerProps): import("react").JSX.Element;
36
+ /** Props of `DialogClose`: Radix's close contract, including `asChild`. */
37
+ export type DialogCloseProps = ComponentProps<typeof DialogRadix.Close>;
38
+ /**
39
+ * Closes the dialog from a custom control, such as a cancel button. In `alert` mode it cancels the confirmation, and
40
+ * the first one receives the focus when the dialog opens.
41
+ * @param props - Radix close props.
42
+ * @returns The close control.
43
+ */
44
+ declare function DialogClose(props: DialogCloseProps): import("react").JSX.Element;
45
+ /** Props of `DialogContent`: Arc's titled panel, @astra-kit/ui's extensions and Radix's content props. */
46
+ export type DialogContentProps = Omit<ComponentProps<typeof DialogRadix.Content>, "title" | "children"> & {
47
+ /** Heading of the dialog and its accessible name. Plain text that changes while open crossfades in place. */
48
+ title: ReactNode;
49
+ /** Supporting line under the title, wired to `aria-describedby`. */
50
+ description?: ReactNode;
51
+ /** Body of the dialog, usually a form or actions. */
52
+ children?: ReactNode;
53
+ /** Edge-to-edge action row under a hairline at the bottom of the panel, usually the dialog's buttons. */
54
+ footer?: ReactNode;
55
+ /** Keeps the title as the accessible name but shows it only to screen readers. */
56
+ hideTitle?: boolean;
57
+ /** Whether the panel renders its close button. Defaults to `true`, or `false` in `alert` mode. */
58
+ showCloseButton?: boolean;
59
+ /**
60
+ * `content` (default) places the close button in the panel header; `viewport` pins it to the viewport corner and
61
+ * shows it once the panel has settled.
62
+ */
63
+ closeButtonPlacement?: DialogCloseButtonPlacement;
64
+ /** Accessible name of the close button. Defaults to "Cerrar diálogo". */
65
+ closeLabel?: string;
66
+ /**
67
+ * Ref of the built-in close button, while it is rendered. To open the dialog with the focus on it, call
68
+ * `event.preventDefault()` in `onOpenAutoFocus` and focus `closeButtonRef.current`.
69
+ */
70
+ closeButtonRef?: Ref<HTMLButtonElement>;
71
+ /**
72
+ * Extra content of the header, rendered after the title and before the description but outside the title, such as
73
+ * type or status badges. The dialog keeps the title alone as its accessible name.
74
+ */
75
+ headerContent?: ReactNode;
76
+ /** Classes of the block that holds the title, the header content and the description. */
77
+ headerClassName?: string;
78
+ /** Classes of the title. */
79
+ titleClassName?: string;
80
+ /** Classes of the description. */
81
+ descriptionClassName?: string;
82
+ /** Classes of the footer. */
83
+ footerClassName?: string;
84
+ };
85
+ /**
86
+ * The portaled overlay and panel with a titled header, the body, an optional footer and the built-in close button.
87
+ * @param props - Title, header content, description, body, footer, close button options and ref, part classes and
88
+ * Radix content props.
89
+ * @returns The dialog panel.
90
+ */
91
+ declare function DialogContent({ title, description, children, footer, hideTitle, showCloseButton, closeButtonPlacement, closeLabel, closeButtonRef, headerContent, headerClassName, titleClassName, descriptionClassName, footerClassName, onOpenAutoFocus, ...props }: DialogContentProps): import("react").JSX.Element;
92
+ export { Dialog, DialogClose, DialogContent, DialogTrigger };
@@ -0,0 +1,320 @@
1
+ "use client";
2
+ import { c as _c } from "react/compiler-runtime";
3
+ /**
4
+ * Arc's Dialog (https://uiarc.dev, MIT License, see THIRD_PARTY_NOTICES.md): a focused surface for decisions that need
5
+ * attention. Arc's API (`Dialog`, `DialogTrigger`, `DialogContent` with its `title`, `description` and built-in close
6
+ * button, `DialogClose`) on Arc's overlay, raised panel, text swap and dialog transition. @astra-kit/ui
7
+ * extends it with a footer slot, a hidden title, the viewport close button placement, Spanish copy and an `alert` mode
8
+ * that replaces the former `AlertDialog`.
9
+ */
10
+ import { createContext, useContext } from "react";
11
+ import { AlertDialog as AlertDialogPrimitive } from "radix-ui";
12
+ import { cn } from "../lib/utils.js";
13
+ import { AlertDialog as AlertDialogRoot, AlertDialogContent as AlertDialogContentPrimitive, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger } from "./primitives/alert-dialog.js";
14
+ import { Dialog as DialogRoot, DialogClose as DialogClosePrimitive, DialogContent as DialogContentPrimitive, DialogDescription as DialogDescriptionPrimitive, DialogFooter as DialogFooterPrimitive, DialogHeader as DialogHeaderPrimitive, DialogTitle as DialogTitlePrimitive, DialogTrigger as DialogTriggerPrimitive } from "./primitives/dialog.js";
15
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
16
+ /** Marks the consumer's close controls, so an alert dialog can focus the first one when it opens. */
17
+ const DIALOG_CLOSE_ACTION_ATTRIBUTE = "data-dialog-close-action";
18
+ /** Whether the surrounding `Dialog` runs in `alert` mode. */
19
+ const DialogAlertContext = createContext(false);
20
+ /**
21
+ * Root that tracks the open state so the content can animate out. Controlled (`open`, `onOpenChange`) or uncontrolled
22
+ * (`defaultOpen`).
23
+ * @param props - Radix root props and `alert`.
24
+ * @returns The dialog root.
25
+ */
26
+ function Dialog(t0) {
27
+ const $ = _c(11);
28
+ let modal;
29
+ let props;
30
+ let t1;
31
+ if ($[0] !== t0) {
32
+ ({alert: t1, modal, ...props} = t0);
33
+ $[0] = t0;
34
+ $[1] = modal;
35
+ $[2] = props;
36
+ $[3] = t1;
37
+ } else {
38
+ modal = $[1];
39
+ props = $[2];
40
+ t1 = $[3];
41
+ }
42
+ const alert = t1 === undefined ? false : t1;
43
+ let t2;
44
+ if ($[4] !== alert || $[5] !== modal || $[6] !== props) {
45
+ t2 = alert ? /* @__PURE__ */ _jsx(AlertDialogRoot, { ...props }) : /* @__PURE__ */ _jsx(DialogRoot, {
46
+ modal,
47
+ ...props
48
+ });
49
+ $[4] = alert;
50
+ $[5] = modal;
51
+ $[6] = props;
52
+ $[7] = t2;
53
+ } else {
54
+ t2 = $[7];
55
+ }
56
+ let t3;
57
+ if ($[8] !== alert || $[9] !== t2) {
58
+ t3 = /* @__PURE__ */ _jsx(DialogAlertContext.Provider, {
59
+ value: alert,
60
+ children: t2
61
+ });
62
+ $[8] = alert;
63
+ $[9] = t2;
64
+ $[10] = t3;
65
+ } else {
66
+ t3 = $[10];
67
+ }
68
+ return t3;
69
+ }
70
+ /**
71
+ * Opens the dialog. Use `asChild` to render your own button.
72
+ * @param props - Radix trigger props.
73
+ * @returns The trigger.
74
+ */
75
+ function DialogTrigger(props) {
76
+ return useContext(DialogAlertContext) ? /* @__PURE__ */ _jsx(AlertDialogTrigger, { ...props }) : /* @__PURE__ */ _jsx(DialogTriggerPrimitive, { ...props });
77
+ }
78
+ /**
79
+ * Closes the dialog from a custom control, such as a cancel button. In `alert` mode it cancels the confirmation, and
80
+ * the first one receives the focus when the dialog opens.
81
+ * @param props - Radix close props.
82
+ * @returns The close control.
83
+ */
84
+ function DialogClose(props) {
85
+ const $ = _c(1);
86
+ let t0;
87
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
88
+ t0 = { [DIALOG_CLOSE_ACTION_ATTRIBUTE]: "" };
89
+ $[0] = t0;
90
+ } else {
91
+ t0 = $[0];
92
+ }
93
+ const closeActionProps = t0;
94
+ return useContext(DialogAlertContext) ? /* @__PURE__ */ _jsx(AlertDialogPrimitive.Cancel, {
95
+ "data-slot": "dialog-close",
96
+ ...closeActionProps,
97
+ ...props
98
+ }) : /* @__PURE__ */ _jsx(DialogClosePrimitive, {
99
+ ...closeActionProps,
100
+ ...props
101
+ });
102
+ }
103
+ /**
104
+ * Focuses the first consumer close control of an alert dialog when it opens, or the panel when there is none.
105
+ * @param event - Radix's open auto-focus event, already handed to the consumer's handler.
106
+ */
107
+ function focusFirstCloseAction(event) {
108
+ if (event.defaultPrevented) return;
109
+ const panel = event.currentTarget ?? event.target;
110
+ if (!(panel instanceof HTMLElement)) return;
111
+ event.preventDefault();
112
+ const firstCloseAction = panel.querySelector(`[${DIALOG_CLOSE_ACTION_ATTRIBUTE}]`);
113
+ (firstCloseAction ?? panel).focus({ preventScroll: true });
114
+ }
115
+ /**
116
+ * The portaled overlay and panel with a titled header, the body, an optional footer and the built-in close button.
117
+ * @param props - Title, header content, description, body, footer, close button options and ref, part classes and
118
+ * Radix content props.
119
+ * @returns The dialog panel.
120
+ */
121
+ function DialogContent(t0) {
122
+ const $ = _c(60);
123
+ let children;
124
+ let closeButtonRef;
125
+ let closeLabel;
126
+ let description;
127
+ let descriptionClassName;
128
+ let footer;
129
+ let footerClassName;
130
+ let headerClassName;
131
+ let headerContent;
132
+ let onOpenAutoFocus;
133
+ let props;
134
+ let showCloseButton;
135
+ let t1;
136
+ let t2;
137
+ let title;
138
+ let titleClassName;
139
+ if ($[0] !== t0) {
140
+ ({title, description, children, footer, hideTitle: t1, showCloseButton, closeButtonPlacement: t2, closeLabel, closeButtonRef, headerContent, headerClassName, titleClassName, descriptionClassName, footerClassName, onOpenAutoFocus, ...props} = t0);
141
+ $[0] = t0;
142
+ $[1] = children;
143
+ $[2] = closeButtonRef;
144
+ $[3] = closeLabel;
145
+ $[4] = description;
146
+ $[5] = descriptionClassName;
147
+ $[6] = footer;
148
+ $[7] = footerClassName;
149
+ $[8] = headerClassName;
150
+ $[9] = headerContent;
151
+ $[10] = onOpenAutoFocus;
152
+ $[11] = props;
153
+ $[12] = showCloseButton;
154
+ $[13] = t1;
155
+ $[14] = t2;
156
+ $[15] = title;
157
+ $[16] = titleClassName;
158
+ } else {
159
+ children = $[1];
160
+ closeButtonRef = $[2];
161
+ closeLabel = $[3];
162
+ description = $[4];
163
+ descriptionClassName = $[5];
164
+ footer = $[6];
165
+ footerClassName = $[7];
166
+ headerClassName = $[8];
167
+ headerContent = $[9];
168
+ onOpenAutoFocus = $[10];
169
+ props = $[11];
170
+ showCloseButton = $[12];
171
+ t1 = $[13];
172
+ t2 = $[14];
173
+ title = $[15];
174
+ titleClassName = $[16];
175
+ }
176
+ const hideTitle = t1 === undefined ? false : t1;
177
+ const closeButtonPlacement = t2 === undefined ? "content" : t2;
178
+ const alert = useContext(DialogAlertContext);
179
+ const Content = alert ? AlertDialogContentPrimitive : DialogContentPrimitive;
180
+ const Header = alert ? AlertDialogHeader : DialogHeaderPrimitive;
181
+ const Title = alert ? AlertDialogTitle : DialogTitlePrimitive;
182
+ const Description = alert ? AlertDialogDescription : DialogDescriptionPrimitive;
183
+ const Footer = alert ? AlertDialogFooter : DialogFooterPrimitive;
184
+ const hasDescription = description !== undefined && description !== null && description !== false;
185
+ const hasHeaderContent = headerContent !== undefined && headerContent !== null && headerContent !== false;
186
+ let t3;
187
+ if ($[17] !== hasDescription || $[18] !== props) {
188
+ t3 = hasDescription || "aria-describedby" in props ? {} : { "aria-describedby": undefined };
189
+ $[17] = hasDescription;
190
+ $[18] = props;
191
+ $[19] = t3;
192
+ } else {
193
+ t3 = $[19];
194
+ }
195
+ const describedBy = t3;
196
+ const t4 = hideTitle && "sr-only";
197
+ let t5;
198
+ if ($[20] !== t4 || $[21] !== titleClassName) {
199
+ t5 = cn(t4, titleClassName);
200
+ $[20] = t4;
201
+ $[21] = titleClassName;
202
+ $[22] = t5;
203
+ } else {
204
+ t5 = $[22];
205
+ }
206
+ let t6;
207
+ if ($[23] !== Title || $[24] !== t5 || $[25] !== title) {
208
+ t6 = /* @__PURE__ */ _jsx(Title, {
209
+ className: t5,
210
+ children: title
211
+ });
212
+ $[23] = Title;
213
+ $[24] = t5;
214
+ $[25] = title;
215
+ $[26] = t6;
216
+ } else {
217
+ t6 = $[26];
218
+ }
219
+ const titleElement = t6;
220
+ let t7;
221
+ if ($[27] !== Description || $[28] !== description || $[29] !== descriptionClassName || $[30] !== hasDescription) {
222
+ t7 = hasDescription ? /* @__PURE__ */ _jsx(Description, {
223
+ className: descriptionClassName,
224
+ children: description
225
+ }) : null;
226
+ $[27] = Description;
227
+ $[28] = description;
228
+ $[29] = descriptionClassName;
229
+ $[30] = hasDescription;
230
+ $[31] = t7;
231
+ } else {
232
+ t7 = $[31];
233
+ }
234
+ const descriptionElement = t7;
235
+ const t8 = showCloseButton ?? !alert;
236
+ let t9;
237
+ if ($[32] !== alert || $[33] !== onOpenAutoFocus) {
238
+ t9 = (event) => {
239
+ onOpenAutoFocus?.(event);
240
+ if (alert) {
241
+ focusFirstCloseAction(event);
242
+ }
243
+ };
244
+ $[32] = alert;
245
+ $[33] = onOpenAutoFocus;
246
+ $[34] = t9;
247
+ } else {
248
+ t9 = $[34];
249
+ }
250
+ const t10 = hideTitle ? titleElement : null;
251
+ let t11;
252
+ if ($[35] !== Header || $[36] !== descriptionElement || $[37] !== hasHeaderContent || $[38] !== headerClassName || $[39] !== headerContent || $[40] !== hideTitle || $[41] !== titleElement) {
253
+ t11 = !hideTitle || descriptionElement || hasHeaderContent ? /* @__PURE__ */ _jsxs(Header, {
254
+ className: headerClassName,
255
+ children: [
256
+ hideTitle ? null : titleElement,
257
+ hasHeaderContent ? headerContent : null,
258
+ descriptionElement
259
+ ]
260
+ }) : null;
261
+ $[35] = Header;
262
+ $[36] = descriptionElement;
263
+ $[37] = hasHeaderContent;
264
+ $[38] = headerClassName;
265
+ $[39] = headerContent;
266
+ $[40] = hideTitle;
267
+ $[41] = titleElement;
268
+ $[42] = t11;
269
+ } else {
270
+ t11 = $[42];
271
+ }
272
+ let t12;
273
+ if ($[43] !== Footer || $[44] !== footer || $[45] !== footerClassName) {
274
+ t12 = footer === undefined || footer === null || footer === false ? null : /* @__PURE__ */ _jsx(Footer, {
275
+ className: footerClassName,
276
+ children: footer
277
+ });
278
+ $[43] = Footer;
279
+ $[44] = footer;
280
+ $[45] = footerClassName;
281
+ $[46] = t12;
282
+ } else {
283
+ t12 = $[46];
284
+ }
285
+ let t13;
286
+ if ($[47] !== Content || $[48] !== children || $[49] !== closeButtonPlacement || $[50] !== closeButtonRef || $[51] !== closeLabel || $[52] !== describedBy || $[53] !== props || $[54] !== t10 || $[55] !== t11 || $[56] !== t12 || $[57] !== t8 || $[58] !== t9) {
287
+ t13 = /* @__PURE__ */ _jsxs(Content, {
288
+ ...describedBy,
289
+ ...props,
290
+ showCloseButton: t8,
291
+ closeButtonPlacement,
292
+ closeLabel,
293
+ closeButtonRef,
294
+ onOpenAutoFocus: t9,
295
+ children: [
296
+ t10,
297
+ t11,
298
+ children,
299
+ t12
300
+ ]
301
+ });
302
+ $[47] = Content;
303
+ $[48] = children;
304
+ $[49] = closeButtonPlacement;
305
+ $[50] = closeButtonRef;
306
+ $[51] = closeLabel;
307
+ $[52] = describedBy;
308
+ $[53] = props;
309
+ $[54] = t10;
310
+ $[55] = t11;
311
+ $[56] = t12;
312
+ $[57] = t8;
313
+ $[58] = t9;
314
+ $[59] = t13;
315
+ } else {
316
+ t13 = $[59];
317
+ }
318
+ return t13;
319
+ }
320
+ export { Dialog, DialogClose, DialogContent, DialogTrigger };