@astra-kit/ui 0.0.0-stage → 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 (304) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/LICENSE.md +21 -0
  3. package/README.md +330 -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 +58 -0
  55. package/dist/components/dropdown-menu.js +135 -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 +17 -0
  177. package/dist/constants/dropdown-menu.js +48 -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,209 @@
1
+ "use client";
2
+ import { c as _c } from "react/compiler-runtime";
3
+ /** Cross-fades between states of the same region, such as idle, loading and result. */
4
+ import { useState } from "react";
5
+ import { AnimatePresence, motion, useIsPresent } from "motion/react";
6
+ import { usePrefersReducedMotion } from "../hooks/use-prefers-reduced-motion.js";
7
+ import { cn } from "../lib/utils.js";
8
+ import { ARC_BLUR } from "../motion/arc-tokens.js";
9
+ import { MOTION_EASE, MOTION_EASE_STANDARD, MOTION_TIMING } from "../motion/tokens.js";
10
+ import { jsx as _jsx } from "react/jsx-runtime";
11
+ /** Arc's swap: new content rises a third of a line out of a soft blur; old content leaves upward. */
12
+ const SWAP_RISE = "0.3em";
13
+ const SWAP_ENTER_BLUR = `blur(${ARC_BLUR.soft}px)`;
14
+ const SWAP_EXIT_BLUR = `blur(${ARC_BLUR.subtle}px)`;
15
+ const PRESENCE_SWAP_ELEMENTS = {
16
+ div: motion.div,
17
+ span: motion.span
18
+ };
19
+ /**
20
+ * One keyed state of the swap. While it animates out it turns inert and hidden
21
+ * from assistive technology, so stale controls cannot be clicked or announced.
22
+ * @param props - Element type, class name and content.
23
+ * @returns The animated state.
24
+ */
25
+ function PresenceSwapItem(t0) {
26
+ const $ = _c(16);
27
+ const { as, className, children } = t0;
28
+ const MotionElement = PRESENCE_SWAP_ELEMENTS[as];
29
+ const isPresent = useIsPresent();
30
+ const [isMountedExiting] = useState(!isPresent);
31
+ const shouldReduceMotion = usePrefersReducedMotion();
32
+ const rise = shouldReduceMotion ? 0 : SWAP_RISE;
33
+ const enterBlur = shouldReduceMotion ? "blur(0px)" : SWAP_ENTER_BLUR;
34
+ const exitBlur = shouldReduceMotion ? "blur(0px)" : SWAP_EXIT_BLUR;
35
+ if (isMountedExiting) {
36
+ return null;
37
+ }
38
+ const t1 = isPresent ? undefined : true;
39
+ const t2 = !isPresent || undefined;
40
+ let t3;
41
+ if ($[0] !== enterBlur || $[1] !== rise) {
42
+ t3 = {
43
+ opacity: 0,
44
+ y: rise,
45
+ filter: enterBlur
46
+ };
47
+ $[0] = enterBlur;
48
+ $[1] = rise;
49
+ $[2] = t3;
50
+ } else {
51
+ t3 = $[2];
52
+ }
53
+ let t4;
54
+ if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
55
+ t4 = {
56
+ opacity: 1,
57
+ y: 0,
58
+ filter: "blur(0px)",
59
+ transition: {
60
+ duration: MOTION_TIMING.enter,
61
+ ease: MOTION_EASE
62
+ }
63
+ };
64
+ $[3] = t4;
65
+ } else {
66
+ t4 = $[3];
67
+ }
68
+ const t5 = shouldReduceMotion ? 0 : `-${SWAP_RISE}`;
69
+ let t6;
70
+ if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
71
+ t6 = {
72
+ duration: MOTION_TIMING.fast,
73
+ ease: MOTION_EASE_STANDARD
74
+ };
75
+ $[4] = t6;
76
+ } else {
77
+ t6 = $[4];
78
+ }
79
+ let t7;
80
+ if ($[5] !== exitBlur || $[6] !== t5) {
81
+ t7 = {
82
+ opacity: 0,
83
+ y: t5,
84
+ filter: exitBlur,
85
+ transition: t6
86
+ };
87
+ $[5] = exitBlur;
88
+ $[6] = t5;
89
+ $[7] = t7;
90
+ } else {
91
+ t7 = $[7];
92
+ }
93
+ let t8;
94
+ if ($[8] !== MotionElement || $[9] !== children || $[10] !== className || $[11] !== t1 || $[12] !== t2 || $[13] !== t3 || $[14] !== t7) {
95
+ t8 = /* @__PURE__ */ _jsx(MotionElement, {
96
+ "data-slot": "presence-swap",
97
+ "aria-hidden": t1,
98
+ inert: t2,
99
+ className,
100
+ initial: t3,
101
+ animate: t4,
102
+ exit: t7,
103
+ children
104
+ });
105
+ $[8] = MotionElement;
106
+ $[9] = children;
107
+ $[10] = className;
108
+ $[11] = t1;
109
+ $[12] = t2;
110
+ $[13] = t3;
111
+ $[14] = t7;
112
+ $[15] = t8;
113
+ } else {
114
+ t8 = $[15];
115
+ }
116
+ return t8;
117
+ }
118
+ /**
119
+ * Gives every key change its own presence key. Motion keeps the exit bookkeeping of a key that
120
+ * already left, so a reused key (loading → error → loading) mounted already exiting would have
121
+ * its removal ignored and stall a `wait` swap forever.
122
+ * @param presenceKey - Key identifying the current state.
123
+ * @returns A key that is never reused within this swap.
124
+ */
125
+ function usePresenceSwapKey(presenceKey) {
126
+ const $ = _c(5);
127
+ let t0;
128
+ if ($[0] !== presenceKey) {
129
+ t0 = {
130
+ presenceKey,
131
+ generation: 0
132
+ };
133
+ $[0] = presenceKey;
134
+ $[1] = t0;
135
+ } else {
136
+ t0 = $[1];
137
+ }
138
+ const [current, setCurrent] = useState(t0);
139
+ if (current.presenceKey !== presenceKey) {
140
+ const t1 = current.generation + 1;
141
+ let t2;
142
+ if ($[2] !== presenceKey || $[3] !== t1) {
143
+ t2 = {
144
+ presenceKey,
145
+ generation: t1
146
+ };
147
+ $[2] = presenceKey;
148
+ $[3] = t1;
149
+ $[4] = t2;
150
+ } else {
151
+ t2 = $[4];
152
+ }
153
+ const next = t2;
154
+ setCurrent(next);
155
+ return `${next.generation}:${presenceKey}`;
156
+ }
157
+ return `${current.generation}:${presenceKey}`;
158
+ }
159
+ /**
160
+ * Swaps keyed content with Arc's swap (a short rise out of a blur); the first render is not animated.
161
+ * @param props - Key identifying the current state and its content.
162
+ * @returns The animated content.
163
+ */
164
+ export function PresenceSwap(t0) {
165
+ const $ = _c(11);
166
+ const { presenceKey, children, as: t1, className, mode: t2 } = t0;
167
+ const as = t1 === undefined ? "div" : t1;
168
+ const mode = t2 === undefined ? "wait" : t2;
169
+ const itemKey = usePresenceSwapKey(presenceKey);
170
+ const t3 = as === "span" && "inline-flex items-center";
171
+ let t4;
172
+ if ($[0] !== className || $[1] !== t3) {
173
+ t4 = cn("min-w-0", t3, className);
174
+ $[0] = className;
175
+ $[1] = t3;
176
+ $[2] = t4;
177
+ } else {
178
+ t4 = $[2];
179
+ }
180
+ let t5;
181
+ if ($[3] !== as || $[4] !== children || $[5] !== itemKey || $[6] !== t4) {
182
+ t5 = /* @__PURE__ */ _jsx(PresenceSwapItem, {
183
+ as,
184
+ className: t4,
185
+ children
186
+ }, itemKey);
187
+ $[3] = as;
188
+ $[4] = children;
189
+ $[5] = itemKey;
190
+ $[6] = t4;
191
+ $[7] = t5;
192
+ } else {
193
+ t5 = $[7];
194
+ }
195
+ let t6;
196
+ if ($[8] !== mode || $[9] !== t5) {
197
+ t6 = /* @__PURE__ */ _jsx(AnimatePresence, {
198
+ mode,
199
+ initial: false,
200
+ children: t5
201
+ });
202
+ $[8] = mode;
203
+ $[9] = t5;
204
+ $[10] = t6;
205
+ } else {
206
+ t6 = $[10];
207
+ }
208
+ return t6;
209
+ }
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Internal confirmation composition on Arc's Dialog surface (https://uiarc.dev, MIT License, see
3
+ * THIRD_PARTY_NOTICES.md): Radix's alert dialog parts on the same overlay, raised panel, title and description type as
4
+ * the dialog primitive, so both read as one family, with Arc's dialog transition, media slot and Arc `Button`
5
+ * actions. Not exported from the package: the public `Dialog` uses it for its `alert` mode.
6
+ */
7
+ import * as React from "react";
8
+ import { AlertDialog as AlertDialogPrimitive } from "radix-ui";
9
+ import { Button } from "../button.js";
10
+ import { type DialogCloseButtonPlacement } from "../dialog-surface.js";
11
+ declare function AlertDialog({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Root>): React.JSX.Element;
12
+ declare function AlertDialogTrigger({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>): React.JSX.Element;
13
+ declare function AlertDialogPortal({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Portal>): React.JSX.Element;
14
+ declare function AlertDialogOverlay({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Overlay>): React.JSX.Element;
15
+ /**
16
+ * Renders a compact confirmation while preserving the shared theme and viewport bound.
17
+ * @param props - Primitive properties and optional consumer overrides.
18
+ * @param props.showCloseButton - Whether the confirmation renders a close button, which cancels it. Off by default:
19
+ * a confirmation is answered with its actions.
20
+ * @param props.closeButtonPlacement - `viewport` pins the close button to the viewport corner; `content` (default)
21
+ * keeps it in the panel.
22
+ * @param props.closeLabel - Accessible name of the close button.
23
+ * @param props.closeButtonRef - Ref of the close button, when it is rendered.
24
+ * @returns The styled primitive with its original interaction contract.
25
+ */
26
+ declare function AlertDialogContent({ className, size, children, showCloseButton, closeButtonPlacement, closeLabel, closeButtonRef, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Content> & {
27
+ size?: "default" | "sm";
28
+ showCloseButton?: boolean;
29
+ closeButtonPlacement?: DialogCloseButtonPlacement;
30
+ closeLabel?: string;
31
+ closeButtonRef?: React.Ref<HTMLButtonElement>;
32
+ }): React.JSX.Element;
33
+ /**
34
+ * Aligns confirmation headings and media with compact spacing.
35
+ * @param props - Primitive properties and optional consumer overrides.
36
+ * @returns The styled primitive with its original interaction contract.
37
+ */
38
+ declare function AlertDialogHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
39
+ /**
40
+ * Separates confirmation actions with an edge-to-edge footer under a hairline, bleeding through the panel padding.
41
+ * @param props - Primitive properties and optional consumer overrides.
42
+ * @returns The styled primitive with its original interaction contract.
43
+ */
44
+ declare function AlertDialogFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
45
+ /**
46
+ * Renders confirmation media at the compact default size.
47
+ * @param props - Primitive properties and optional consumer overrides.
48
+ * @returns The styled primitive with its original interaction contract.
49
+ */
50
+ declare function AlertDialogMedia({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
51
+ /**
52
+ * Renders the confirmation heading in Arc's title type. Plain text that changes while open swaps with Arc's rise.
53
+ * @param props - Primitive properties and optional consumer overrides.
54
+ * @returns The styled primitive with its original interaction contract.
55
+ */
56
+ declare function AlertDialogTitle({ className, children, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Title>): React.JSX.Element;
57
+ /**
58
+ * Renders the confirmation description in Arc's secondary text. Plain text that changes while open swaps with Arc's
59
+ * rise.
60
+ * @param props - Primitive properties and optional consumer overrides.
61
+ * @returns The styled primitive with its original interaction contract.
62
+ */
63
+ declare function AlertDialogDescription({ className, children, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Description>): React.JSX.Element;
64
+ /** Confirms the dialog with an Arc `Button`; Radix merges its behavior onto the button through `asChild`. */
65
+ declare function AlertDialogAction({ className, variant, size, children, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Action> & Pick<React.ComponentProps<typeof Button>, "variant" | "size">): React.JSX.Element;
66
+ /** Dismisses the dialog with an Arc secondary `Button` by default. */
67
+ declare function AlertDialogCancel({ className, variant, size, children, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Cancel> & Pick<React.ComponentProps<typeof Button>, "variant" | "size">): React.JSX.Element;
68
+ export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, };