@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,141 @@
1
+ import { MOTION_DIALOG_DISTANCE, MOTION_DIALOG_EXIT_DISTANCE, MOTION_EASE, MOTION_EASE_STANDARD, MOTION_EXIT_SCALE, MOTION_SURFACE_SCALE, MOTION_TIMING, SPRING_PANEL } from "./tokens.js";
2
+ /** Fraction of Arc's drawer close after which the panel starts to fade. */
3
+ const SHEET_EXIT_FADE_START = .65;
4
+ const EASE_OUT = [...MOTION_EASE];
5
+ const EASE_STANDARD = [...MOTION_EASE_STANDARD];
6
+ const SIDES = [
7
+ "top",
8
+ "right",
9
+ "bottom",
10
+ "left"
11
+ ];
12
+ /** Builds a transform with explicit identity parts, so Motion never reads a missing scale as zero. */
13
+ function transform(x, y, scale = 1) {
14
+ const unit = (value) => typeof value === "number" ? `${value}px` : value;
15
+ return `translate(${unit(x)}, ${unit(y)}) scale(${scale})`;
16
+ }
17
+ /**
18
+ * Arc's dialog leave: a short tween on the standard curve, so it never lingers and a reopen
19
+ * retargets from wherever the panel is.
20
+ */
21
+ const DIALOG_LEAVE = {
22
+ duration: MOTION_TIMING.fast,
23
+ ease: EASE_STANDARD
24
+ };
25
+ /** Edge-panel travel: fully off-screen on the side the sheet is attached to. */
26
+ function sheetOffset(element) {
27
+ const side = element.getAttribute("data-side");
28
+ const resolved = SIDES.includes(side) ? side : "right";
29
+ if (resolved === "left") return {
30
+ x: "-100%",
31
+ y: "0%"
32
+ };
33
+ if (resolved === "top") return {
34
+ x: "0%",
35
+ y: "-100%"
36
+ };
37
+ if (resolved === "bottom") return {
38
+ x: "0%",
39
+ y: "100%"
40
+ };
41
+ return {
42
+ x: "100%",
43
+ y: "0%"
44
+ };
45
+ }
46
+ /** Entrance playback for each surface kind, on Arc's motion presets. */
47
+ export function surfaceEnter(element, kind) {
48
+ if (kind === "overlay") {
49
+ return {
50
+ keyframes: { opacity: [0, 1] },
51
+ transition: {
52
+ duration: MOTION_TIMING.overlay,
53
+ ease: EASE_OUT
54
+ }
55
+ };
56
+ }
57
+ if (kind === "sheet") {
58
+ // Arc's drawer: the panel slides in from its edge on the smooth spring, at full opacity.
59
+ const offset = sheetOffset(element);
60
+ return {
61
+ // Opacity is listed at rest so a reopen during the close fades back from where the close left it.
62
+ keyframes: {
63
+ transform: [transform(offset.x, offset.y), transform("0%", "0%")],
64
+ opacity: [1, 1]
65
+ },
66
+ transition: SPRING_PANEL
67
+ };
68
+ }
69
+ // Arc's dialog: the panel rises and scales in on the smooth spring while it fades in quickly.
70
+ return {
71
+ keyframes: {
72
+ opacity: [0, 1],
73
+ transform: [transform(0, MOTION_DIALOG_DISTANCE, MOTION_SURFACE_SCALE), transform(0, 0)]
74
+ },
75
+ transition: {
76
+ ...SPRING_PANEL,
77
+ opacity: {
78
+ duration: MOTION_TIMING.fast,
79
+ ease: EASE_OUT
80
+ }
81
+ }
82
+ };
83
+ }
84
+ /**
85
+ * Composes surface playback with the surface's resting transform and opacity, so a caller-owned
86
+ * tilt, offset or translucency holds through the whole entrance and exit instead of being
87
+ * replaced by identity and full opacity, then snapping back once playback restores it.
88
+ */
89
+ export function withRestingStyle(keyframes, resting) {
90
+ const composed = { ...keyframes };
91
+ const { transform, opacity } = composed;
92
+ if (Array.isArray(transform) && resting.transform && resting.transform !== "none") {
93
+ composed.transform = transform.map((value) => `${String(value)} ${resting.transform}`);
94
+ }
95
+ if (Array.isArray(opacity) && Number.isFinite(resting.opacity) && resting.opacity !== 1) {
96
+ composed.opacity = opacity.map((value) => Number(value) * resting.opacity);
97
+ }
98
+ return composed;
99
+ }
100
+ /** Exit playback: brief and eased so dismissal never blocks the next interaction. */
101
+ export function surfaceExit(element, kind) {
102
+ if (kind === "overlay") {
103
+ return {
104
+ keyframes: { opacity: [1, 0] },
105
+ transition: DIALOG_LEAVE
106
+ };
107
+ }
108
+ if (kind === "sheet") {
109
+ // Arc's drawer close: a tween on the standard curve that holds the panel opaque until it is mostly gone.
110
+ const offset = sheetOffset(element);
111
+ return {
112
+ keyframes: {
113
+ transform: [transform("0%", "0%"), transform(offset.x, offset.y)],
114
+ opacity: [
115
+ 1,
116
+ 1,
117
+ 0
118
+ ]
119
+ },
120
+ transition: {
121
+ duration: MOTION_TIMING.sheetExit,
122
+ ease: EASE_STANDARD,
123
+ opacity: {
124
+ duration: MOTION_TIMING.sheetExit,
125
+ times: [
126
+ 0,
127
+ SHEET_EXIT_FADE_START,
128
+ 1
129
+ ]
130
+ }
131
+ }
132
+ };
133
+ }
134
+ return {
135
+ keyframes: {
136
+ opacity: [1, 0],
137
+ transform: [transform(0, 0), transform(0, MOTION_DIALOG_EXIT_DISTANCE, MOTION_EXIT_SCALE)]
138
+ },
139
+ transition: DIALOG_LEAVE
140
+ };
141
+ }
@@ -0,0 +1,81 @@
1
+ export declare const MOTION_TIMING: {
2
+ /** Arc `duration.instant`: color answers and fades that must feel immediate. */
3
+ readonly instant: 0.12;
4
+ /** Arc `duration.fast`: small fades, the opacity of a spring entrance, and dialog exits. */
5
+ readonly fast: 0.16;
6
+ /** Arc `duration.standard`: entrance tweens. */
7
+ readonly enter: 0.24;
8
+ /** Arc `duration.standard`: tween length for a deliberate on-screen change. */
9
+ readonly standard: 0.24;
10
+ /** Arc `duration.considered`: the slowest tween, for large layout changes. */
11
+ readonly considered: 0.48;
12
+ /** Arc `duration.standard`: opacity of panels whose size moves on a spring. */
13
+ readonly panel: 0.24;
14
+ /** Arc `duration.standard`: scrims fading in behind dialogs and sheets. */
15
+ readonly overlay: 0.24;
16
+ /** Arc `duration.exit`: leaving is faster than arriving. */
17
+ readonly exit: 0.18;
18
+ /** Arc `duration.standard`: a check mark drawing its stroke. */
19
+ readonly checkDraw: 0.24;
20
+ /** Arc `stagger.item`. */
21
+ readonly listStagger: 0.035;
22
+ /** Arc `duration.standard`: edge panels leaving the viewport. */
23
+ readonly sheetExit: 0.24;
24
+ /** Blink period of the typing cursor, the one loop that shows live status. */
25
+ readonly cursorBlink: 1;
26
+ };
27
+ /** Arc staggers at most the first four items of a list; the rest share the last delay, so long lists never lag. */
28
+ export declare const MOTION_LIST_STAGGER_LIMIT = 4;
29
+ /** Arc `ease.enter`: strong ease-out for entrances; weak defaults such as `ease-out` feel sluggish. */
30
+ export declare const MOTION_EASE: readonly [0.16, 1, 0.3, 1];
31
+ /** Arc `ease.exit`: accelerates away, for elements leaving the screen. */
32
+ export declare const MOTION_EASE_EXIT: readonly [0.7, 0, 0.84, 0];
33
+ /** Arc `ease.standard`: color and opacity changes, and quick exits that must not linger. */
34
+ export declare const MOTION_EASE_STANDARD: readonly [0.22, 1, 0.36, 1];
35
+ /** Arc `ease.inOut`: elements that move while already on screen, and looping effects. */
36
+ export declare const MOTION_EASE_IN_OUT: readonly [0.65, 0, 0.35, 1];
37
+ /** Arc `spring.snappy`: press feedback on buttons and other tappable surfaces. */
38
+ export declare const SPRING_PRESS: {
39
+ readonly type: "spring";
40
+ readonly visualDuration: 0.26;
41
+ readonly bounce: 0.12;
42
+ };
43
+ /** Arc `spring.smooth`: panels, heights and overlay entrances; never overshoots. */
44
+ export declare const SPRING_PANEL: {
45
+ readonly type: "spring";
46
+ readonly visualDuration: 0.4;
47
+ readonly bounce: 0;
48
+ };
49
+ /** Arc `spring.morph`: shared-layout glides, indicators and highlights moving between items. */
50
+ export declare const SPRING_LAYOUT: {
51
+ readonly type: "spring";
52
+ readonly visualDuration: 0.42;
53
+ readonly bounce: 0.16;
54
+ };
55
+ /** Arc `spring.snappy`: disclosure chevrons turning toward their new state. */
56
+ export declare const SPRING_CHEVRON: {
57
+ readonly type: "spring";
58
+ readonly visualDuration: 0.26;
59
+ readonly bounce: 0.12;
60
+ };
61
+ /** Arc `spring.snappy`: small, confident pops for counters, badges and swapped icons. */
62
+ export declare const SPRING_POP: {
63
+ readonly type: "spring";
64
+ readonly visualDuration: 0.26;
65
+ readonly bounce: 0.12;
66
+ };
67
+ /** Arc's press: about 0.97, so every pressable reads as the same push. */
68
+ export declare const MOTION_PRESS_SCALE = 0.97;
69
+ /** Arc's calendar title slides just enough to show the direction of navigation. */
70
+ export declare const MOTION_MONTH_DISTANCE = 12;
71
+ /** Arc's dialog panel scale on entrance. */
72
+ export declare const MOTION_SURFACE_SCALE = 0.96;
73
+ /** Scale a dialog shrinks to while it leaves (Arc). */
74
+ export declare const MOTION_EXIT_SCALE = 0.98;
75
+ /** Arc's dialog rise on entrance, in pixels. */
76
+ export declare const MOTION_DIALOG_DISTANCE = 8;
77
+ /** Arc's dialog drop while it leaves, in pixels. */
78
+ export declare const MOTION_DIALOG_EXIT_DISTANCE = 4;
79
+ /** Time after an item loses its active state during which a new active item still glides from it. */
80
+ export declare const GLIDE_CONTINUITY_MS = 300;
81
+ export type MotionKind = "rotate" | "item-check" | "icon-swap" | "message" | "reveal" | "dialog" | "sheet" | "overlay";
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Defines the timing, curves and physics shared by Motion animations. Every value is one of Arc's motion presets
3
+ * (https://uiarc.dev, `components/arc/lib/motion-tokens.ts`): `snappy` for presses and small indicators, `smooth` for
4
+ * panels and anything that reports state, `morph` for shared highlights. Motion explains cause and effect; it does not
5
+ * decorate. Public: consumers animate their own product surfaces with these tokens so they move like the library.
6
+ */
7
+ import { ARC_DURATION, ARC_EASE, ARC_SPRING_MORPH, ARC_SPRING_SMOOTH, ARC_SPRING_SNAPPY, ARC_STAGGER } from "./arc-tokens.js";
8
+ export const MOTION_TIMING = {
9
+ /** Arc `duration.instant`: color answers and fades that must feel immediate. */
10
+ instant: ARC_DURATION.instant,
11
+ /** Arc `duration.fast`: small fades, the opacity of a spring entrance, and dialog exits. */
12
+ fast: ARC_DURATION.fast,
13
+ /** Arc `duration.standard`: entrance tweens. */
14
+ enter: ARC_DURATION.standard,
15
+ /** Arc `duration.standard`: tween length for a deliberate on-screen change. */
16
+ standard: ARC_DURATION.standard,
17
+ /** Arc `duration.considered`: the slowest tween, for large layout changes. */
18
+ considered: ARC_DURATION.considered,
19
+ /** Arc `duration.standard`: opacity of panels whose size moves on a spring. */
20
+ panel: ARC_DURATION.standard,
21
+ /** Arc `duration.standard`: scrims fading in behind dialogs and sheets. */
22
+ overlay: ARC_DURATION.standard,
23
+ /** Arc `duration.exit`: leaving is faster than arriving. */
24
+ exit: ARC_DURATION.exit,
25
+ /** Arc `duration.standard`: a check mark drawing its stroke. */
26
+ checkDraw: ARC_DURATION.standard,
27
+ /** Arc `stagger.item`. */
28
+ listStagger: ARC_STAGGER.item,
29
+ /** Arc `duration.standard`: edge panels leaving the viewport. */
30
+ sheetExit: ARC_DURATION.standard,
31
+ /** Blink period of the typing cursor, the one loop that shows live status. */
32
+ cursorBlink: 1
33
+ };
34
+ /** Arc staggers at most the first four items of a list; the rest share the last delay, so long lists never lag. */
35
+ export const MOTION_LIST_STAGGER_LIMIT = 4;
36
+ /** Arc `ease.enter`: strong ease-out for entrances; weak defaults such as `ease-out` feel sluggish. */
37
+ export const MOTION_EASE = ARC_EASE.enter;
38
+ /** Arc `ease.exit`: accelerates away, for elements leaving the screen. */
39
+ export const MOTION_EASE_EXIT = ARC_EASE.exit;
40
+ /** Arc `ease.standard`: color and opacity changes, and quick exits that must not linger. */
41
+ export const MOTION_EASE_STANDARD = ARC_EASE.standard;
42
+ /** Arc `ease.inOut`: elements that move while already on screen, and looping effects. */
43
+ export const MOTION_EASE_IN_OUT = ARC_EASE.inOut;
44
+ /** Arc `spring.snappy`: press feedback on buttons and other tappable surfaces. */
45
+ export const SPRING_PRESS = ARC_SPRING_SNAPPY;
46
+ /** Arc `spring.smooth`: panels, heights and overlay entrances; never overshoots. */
47
+ export const SPRING_PANEL = ARC_SPRING_SMOOTH;
48
+ /** Arc `spring.morph`: shared-layout glides, indicators and highlights moving between items. */
49
+ export const SPRING_LAYOUT = ARC_SPRING_MORPH;
50
+ /** Arc `spring.snappy`: disclosure chevrons turning toward their new state. */
51
+ export const SPRING_CHEVRON = ARC_SPRING_SNAPPY;
52
+ /** Arc `spring.snappy`: small, confident pops for counters, badges and swapped icons. */
53
+ export const SPRING_POP = ARC_SPRING_SNAPPY;
54
+ /** Arc's press: about 0.97, so every pressable reads as the same push. */
55
+ export const MOTION_PRESS_SCALE = .97;
56
+ /** Arc's calendar title slides just enough to show the direction of navigation. */
57
+ export const MOTION_MONTH_DISTANCE = 12;
58
+ /** Arc's dialog panel scale on entrance. */
59
+ export const MOTION_SURFACE_SCALE = .96;
60
+ /** Scale a dialog shrinks to while it leaves (Arc). */
61
+ export const MOTION_EXIT_SCALE = .98;
62
+ /** Arc's dialog rise on entrance, in pixels. */
63
+ export const MOTION_DIALOG_DISTANCE = 8;
64
+ /** Arc's dialog drop while it leaves, in pixels. */
65
+ export const MOTION_DIALOG_EXIT_DISTANCE = 4;
66
+ /** Time after an item loses its active state during which a new active item still glides from it. */
67
+ export const GLIDE_CONTINUITY_MS = 300;
@@ -0,0 +1,7 @@
1
+ /** Tracks the DOM node rendered through a Slot while forwarding it to the caller's ref. */
2
+ import { type Ref } from "react";
3
+ /**
4
+ * Returns the attached element and a callback ref that also feeds the caller's ref,
5
+ * honoring React 19 ref cleanups.
6
+ */
7
+ export declare function useAttachedElement<T extends HTMLElement>(ref: Ref<T> | undefined): readonly [T | null, (node: T | null) => () => void];
@@ -0,0 +1,22 @@
1
+ "use client";
2
+ /** Tracks the DOM node rendered through a Slot while forwarding it to the caller's ref. */
3
+ import { useCallback, useState } from "react";
4
+ /**
5
+ * Returns the attached element and a callback ref that also feeds the caller's ref,
6
+ * honoring React 19 ref cleanups.
7
+ */
8
+ export function useAttachedElement(ref) {
9
+ const [element, setElement] = useState(null);
10
+ const attach = useCallback((node) => {
11
+ setElement(node);
12
+ const cleanup = typeof ref === "function" ? ref(node) : undefined;
13
+ if (ref && typeof ref !== "function") ref.current = node;
14
+ return () => {
15
+ setElement(null);
16
+ if (typeof cleanup === "function") cleanup();
17
+ else if (typeof ref === "function") ref(null);
18
+ else if (ref) ref.current = null;
19
+ };
20
+ }, [ref]);
21
+ return [element, attach];
22
+ }
@@ -0,0 +1,13 @@
1
+ import type { RefObject } from "react";
2
+ import type { MotionValue } from "motion/react";
3
+ /**
4
+ * Springs a label slot to the natural width of its content when the label changes, so new text never snaps the
5
+ * layout. Other resizes (a late web font, a parent reflow) jump straight to the new width, so nothing wobbles on
6
+ * first paint. While it springs, the slot carries `data-morphing` so it can clip overflowing glyphs.
7
+ *
8
+ * @param contentRef - Content measured by a `ResizeObserver`; its parent element is the slot that gets the width.
9
+ * @param labelKey - Identity of the current label: a change opens the window in which resizes spring.
10
+ * @param reduceMotion - Whether the user prefers reduced motion, which makes every resize jump.
11
+ * @returns Width to bind to the slot's `style.width`.
12
+ */
13
+ export declare function useMorphWidth(contentRef: RefObject<HTMLElement | null>, labelKey: string, reduceMotion: boolean): MotionValue<number | "auto">;
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Label width spring adapted from Arc (https://uiarc.dev), Copyright (c) 2026 Elia Kuratli, MIT License.
3
+ * The full license text ships in THIRD_PARTY_NOTICES.md. Internal: shared by `Button` and `ActionButton`.
4
+ */
5
+ import { useEffect, useLayoutEffect, useRef } from "react";
6
+ import { animate, useMotionValue } from "motion/react";
7
+ import { BUTTON_MORPH_WINDOW_MS } from "../constants/button.js";
8
+ import { ARC_SPRING_MORPH } from "./arc-tokens.js";
9
+ /**
10
+ * Springs a label slot to the natural width of its content when the label changes, so new text never snaps the
11
+ * layout. Other resizes (a late web font, a parent reflow) jump straight to the new width, so nothing wobbles on
12
+ * first paint. While it springs, the slot carries `data-morphing` so it can clip overflowing glyphs.
13
+ *
14
+ * @param contentRef - Content measured by a `ResizeObserver`; its parent element is the slot that gets the width.
15
+ * @param labelKey - Identity of the current label: a change opens the window in which resizes spring.
16
+ * @param reduceMotion - Whether the user prefers reduced motion, which makes every resize jump.
17
+ * @returns Width to bind to the slot's `style.width`.
18
+ */
19
+ export function useMorphWidth(contentRef, labelKey, reduceMotion) {
20
+ const width = useMotionValue("auto");
21
+ const lastLabelKey = useRef(labelKey);
22
+ const morphDeadline = useRef(0);
23
+ useLayoutEffect(() => {
24
+ if (lastLabelKey.current === labelKey) return;
25
+ lastLabelKey.current = labelKey;
26
+ morphDeadline.current = performance.now() + BUTTON_MORPH_WINDOW_MS;
27
+ }, [labelKey]);
28
+ useEffect(() => {
29
+ const content = contentRef.current;
30
+ const slot = content?.parentElement;
31
+ if (!content || !slot || typeof ResizeObserver === "undefined") return;
32
+ let hasMeasured = false;
33
+ const observer = new ResizeObserver(([entry]) => {
34
+ if (!entry) return;
35
+ const nextWidth = entry.contentRect.width;
36
+ const shouldJump = !nextWidth || !hasMeasured || reduceMotion || performance.now() > morphDeadline.current;
37
+ if (shouldJump) {
38
+ hasMeasured = nextWidth > 0;
39
+ width.jump(nextWidth || "auto");
40
+ delete slot.dataset.morphing;
41
+ return;
42
+ }
43
+ slot.dataset.morphing = "";
44
+ animate(width, nextWidth, {
45
+ ...ARC_SPRING_MORPH,
46
+ onComplete: () => {
47
+ delete slot.dataset.morphing;
48
+ }
49
+ });
50
+ });
51
+ observer.observe(content);
52
+ return () => observer.disconnect();
53
+ }, [
54
+ contentRef,
55
+ reduceMotion,
56
+ width
57
+ ]);
58
+ return width;
59
+ }
package/dist/next.d.ts ADDED
@@ -0,0 +1,14 @@
1
+ /** Isolates optional Next.js imports from the framework-neutral package entrypoint. */
2
+ import { type ReactNode } from "react";
3
+ import { type AstraUIProviderProps as BaseAstraUIProviderProps } from "./providers/astra-ui-provider.js";
4
+ /** Configures Next adapters without forcing image host configuration on existing apps. */
5
+ export interface AstraUIProviderProps {
6
+ children: ReactNode;
7
+ /** Enables the image optimizer; configure allowed image hosts in the application. */
8
+ optimizeImages?: boolean;
9
+ /** Keeps speculative navigation opt-in, matching LaTribu's existing behavior. */
10
+ prefetch?: boolean;
11
+ themeOptions?: BaseAstraUIProviderProps["themeOptions"];
12
+ }
13
+ /** Activates Next.js navigation and images for every descendant using shared primitives. */
14
+ export declare function AstraUIProvider({ children, optimizeImages, prefetch, themeOptions }: AstraUIProviderProps): import("react").JSX.Element;
package/dist/next.js ADDED
@@ -0,0 +1,79 @@
1
+ "use client";
2
+ import { c as _c } from "react/compiler-runtime";
3
+ import NextImageModule from "next/image.js";
4
+ import NextLinkModule from "next/link.js";
5
+ import { AstraUIProvider as BaseAstraUIProvider } from "./providers/astra-ui-provider.js";
6
+ import { imageDimension } from "./lib/image-dimensions.js";
7
+ import { jsx as _jsx } from "react/jsx-runtime";
8
+ /** Supports both native ESM loading of Next's CommonJS modules and bundler interop. */
9
+ const NextImage = NextImageModule.default ?? NextImageModule;
10
+ const NextLink = NextLinkModule.default ?? NextLinkModule;
11
+ /** Activates Next.js navigation and images for every descendant using shared primitives. */
12
+ export function AstraUIProvider(t0) {
13
+ const $ = _c(11);
14
+ const { children, optimizeImages: t1, prefetch: t2, themeOptions } = t0;
15
+ const optimizeImages = t1 === undefined ? false : t1;
16
+ const prefetch = t2 === undefined ? false : t2;
17
+ let t3;
18
+ if ($[0] !== prefetch) {
19
+ t3 = function NextRoutingAdapter(t4) {
20
+ const { prefetch: linkPrefetch, ...props } = t4;
21
+ return /* @__PURE__ */ _jsx(NextLink, {
22
+ ...props,
23
+ prefetch: linkPrefetch ?? prefetch
24
+ });
25
+ };
26
+ $[0] = prefetch;
27
+ $[1] = t3;
28
+ } else {
29
+ t3 = $[1];
30
+ }
31
+ let t4;
32
+ if ($[2] !== optimizeImages) {
33
+ t4 = function NextImageAdapter(props_0) {
34
+ if (!props_0.src) {
35
+ return /* @__PURE__ */ _jsx("img", { ...props_0 });
36
+ }
37
+ return /* @__PURE__ */ _jsx(NextImage, {
38
+ ...props_0,
39
+ alt: props_0.alt ?? "",
40
+ src: props_0.src,
41
+ width: imageDimension(props_0.width),
42
+ height: imageDimension(props_0.height),
43
+ unoptimized: !optimizeImages
44
+ });
45
+ };
46
+ $[2] = optimizeImages;
47
+ $[3] = t4;
48
+ } else {
49
+ t4 = $[3];
50
+ }
51
+ let t5;
52
+ if ($[4] !== t3 || $[5] !== t4) {
53
+ t5 = {
54
+ Link: t3,
55
+ Image: t4
56
+ };
57
+ $[4] = t3;
58
+ $[5] = t4;
59
+ $[6] = t5;
60
+ } else {
61
+ t5 = $[6];
62
+ }
63
+ const components = t5;
64
+ let t6;
65
+ if ($[7] !== children || $[8] !== components || $[9] !== themeOptions) {
66
+ t6 = /* @__PURE__ */ _jsx(BaseAstraUIProvider, {
67
+ components,
68
+ themeOptions,
69
+ children
70
+ });
71
+ $[7] = children;
72
+ $[8] = components;
73
+ $[9] = themeOptions;
74
+ $[10] = t6;
75
+ } else {
76
+ t6 = $[10];
77
+ }
78
+ return t6;
79
+ }
@@ -0,0 +1,27 @@
1
+ /** Shares optional rendering adapters without importing a framework into the core. */
2
+ import { type ComponentProps, type ComponentType, type ReactNode } from "react";
3
+ import { type ThemeProviderProps } from "next-themes";
4
+ /** Defines the native link contract accepted by routing adapters. */
5
+ export type AstraLinkProps = ComponentProps<"a"> & {
6
+ href: string;
7
+ /** Optional navigation hint consumed by framework adapters, never by native anchors. */
8
+ prefetch?: boolean;
9
+ };
10
+ /** Defines the native image contract accepted by image adapters. */
11
+ export type AstraImageProps = ComponentProps<"img">;
12
+ /** Lets each application select only the adapters it needs. */
13
+ export interface AstraUIComponents {
14
+ Link?: ComponentType<AstraLinkProps>;
15
+ Image?: ComponentType<AstraImageProps>;
16
+ }
17
+ /** Configures descendants while leaving theme and application state to the consumer. */
18
+ export interface AstraUIProviderProps {
19
+ children: ReactNode;
20
+ components?: AstraUIComponents;
21
+ /** Shares light/dark/system behavior; the theme is written as a class and as Arc's `data-theme` attribute. */
22
+ themeOptions?: Omit<ThemeProviderProps, "children" | "attribute">;
23
+ }
24
+ /** Merges nested overrides while preserving stable adapter identities. */
25
+ export declare function AstraUIProvider({ children, components, themeOptions }: AstraUIProviderProps): import("react").JSX.Element;
26
+ /** Reads adapters internally; native components work without a provider. */
27
+ export declare function useAstraUIComponents(): AstraUIComponents;
@@ -0,0 +1,100 @@
1
+ "use client";
2
+ import { c as _c } from "react/compiler-runtime";
3
+ /** Shares optional rendering adapters without importing a framework into the core. */
4
+ import { createContext, useContext, useSyncExternalStore } from "react";
5
+ import { MotionConfig } from "motion/react";
6
+ import { ThemeProvider } from "next-themes";
7
+ import { jsx as _jsx } from "react/jsx-runtime";
8
+ /**
9
+ * Arc's foundation selects dark tokens with `data-theme`; the class keeps Tailwind's `dark` variant and
10
+ * consumer styles written for it.
11
+ */
12
+ const THEME_ATTRIBUTES = ["class", "data-theme"];
13
+ /**
14
+ * next-themes renders an inline script that applies the stored theme before hydration. It only
15
+ * runs when it arrives in server HTML; a script created by a client render never executes, and
16
+ * React 19 warns about it. Client-only renders mark it as a data block, which React accepts.
17
+ */
18
+ const CLIENT_RENDER_THEME_SCRIPT_PROPS = { type: "application/json" };
19
+ /** Nothing to subscribe to: the value only distinguishes server/hydration from client renders. */
20
+ function subscribeToRenderEnvironment() {
21
+ return () => {};
22
+ }
23
+ /** Native elements remain the implicit fallback for unconfigured adapters. */
24
+ const EMPTY_COMPONENTS = {};
25
+ const AdapterContext = createContext(EMPTY_COMPONENTS);
26
+ /** Merges nested overrides while preserving stable adapter identities. */
27
+ export function AstraUIProvider(t0) {
28
+ const $ = _c(13);
29
+ const { children, components: t1, themeOptions } = t0;
30
+ const components = t1 === undefined ? EMPTY_COMPONENTS : t1;
31
+ const parent = useContext(AdapterContext);
32
+ let t2;
33
+ if ($[0] !== components || $[1] !== parent) {
34
+ t2 = {
35
+ ...parent,
36
+ ...components
37
+ };
38
+ $[0] = components;
39
+ $[1] = parent;
40
+ $[2] = t2;
41
+ } else {
42
+ t2 = $[2];
43
+ }
44
+ const value = t2;
45
+ const isClientOnlyRender = useSyncExternalStore(subscribeToRenderEnvironment, _temp, _temp2);
46
+ let t3;
47
+ if ($[3] !== isClientOnlyRender || $[4] !== themeOptions?.scriptProps) {
48
+ t3 = isClientOnlyRender ? {
49
+ ...CLIENT_RENDER_THEME_SCRIPT_PROPS,
50
+ ...themeOptions?.scriptProps
51
+ } : themeOptions?.scriptProps;
52
+ $[3] = isClientOnlyRender;
53
+ $[4] = themeOptions?.scriptProps;
54
+ $[5] = t3;
55
+ } else {
56
+ t3 = $[5];
57
+ }
58
+ const scriptProps = t3;
59
+ let t4;
60
+ if ($[6] !== children || $[7] !== value) {
61
+ t4 = /* @__PURE__ */ _jsx(MotionConfig, {
62
+ reducedMotion: "user",
63
+ children: /* @__PURE__ */ _jsx(AdapterContext.Provider, {
64
+ value,
65
+ children
66
+ })
67
+ });
68
+ $[6] = children;
69
+ $[7] = value;
70
+ $[8] = t4;
71
+ } else {
72
+ t4 = $[8];
73
+ }
74
+ let t5;
75
+ if ($[9] !== scriptProps || $[10] !== t4 || $[11] !== themeOptions) {
76
+ t5 = /* @__PURE__ */ _jsx(ThemeProvider, {
77
+ attribute: THEME_ATTRIBUTES,
78
+ ...themeOptions,
79
+ scriptProps,
80
+ children: t4
81
+ });
82
+ $[9] = scriptProps;
83
+ $[10] = t4;
84
+ $[11] = themeOptions;
85
+ $[12] = t5;
86
+ } else {
87
+ t5 = $[12];
88
+ }
89
+ return t5;
90
+ }
91
+ function _temp2() {
92
+ return false;
93
+ }
94
+ function _temp() {
95
+ return true;
96
+ }
97
+ /** Reads adapters internally; native components work without a provider. */
98
+ export function useAstraUIComponents() {
99
+ return useContext(AdapterContext);
100
+ }
@@ -0,0 +1,4 @@
1
+ import { type AstraUIProviderProps } from "./astra-ui-provider.js";
2
+ export type { AstraUIProviderProps } from "./astra-ui-provider.js";
3
+ /** Combines native navigation, responsive Unpic images and the shared theme provider. */
4
+ export declare function AstraUIProvider({ components, ...props }: AstraUIProviderProps): import("react").JSX.Element;
@@ -0,0 +1,45 @@
1
+ "use client";
2
+ import { c as _c } from "react/compiler-runtime";
3
+ import { AstraUIProvider as BaseAstraUIProvider } from "./astra-ui-provider.js";
4
+ import { UnpicImageAdapter } from "../adapters/unpic-image.js";
5
+ import { jsx as _jsx } from "react/jsx-runtime";
6
+ /** Combines native navigation, responsive Unpic images and the shared theme provider. */
7
+ export function AstraUIProvider(t0) {
8
+ const $ = _c(8);
9
+ let components;
10
+ let props;
11
+ if ($[0] !== t0) {
12
+ ({components, ...props} = t0);
13
+ $[0] = t0;
14
+ $[1] = components;
15
+ $[2] = props;
16
+ } else {
17
+ components = $[1];
18
+ props = $[2];
19
+ }
20
+ let t1;
21
+ if ($[3] !== components) {
22
+ t1 = {
23
+ Image: UnpicImageAdapter,
24
+ ...components
25
+ };
26
+ $[3] = components;
27
+ $[4] = t1;
28
+ } else {
29
+ t1 = $[4];
30
+ }
31
+ const nativeComponents = t1;
32
+ let t2;
33
+ if ($[5] !== nativeComponents || $[6] !== props) {
34
+ t2 = /* @__PURE__ */ _jsx(BaseAstraUIProvider, {
35
+ ...props,
36
+ components: nativeComponents
37
+ });
38
+ $[5] = nativeComponents;
39
+ $[6] = props;
40
+ $[7] = t2;
41
+ } else {
42
+ t2 = $[7];
43
+ }
44
+ return t2;
45
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Exposes the shared notification implementation and its public types. `Toaster` is @astra-kit/ui's own, which keeps
3
+ * Sonner's look and props but lets toasts work while a modal is open; this local export takes precedence over the
4
+ * one `export *` would bring from Sonner.
5
+ */
6
+ export * from "sonner";
7
+ export { Toaster } from "./components/toaster.js";