@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,145 @@
1
+ "use client";
2
+ import { c as _c } from "react/compiler-runtime";
3
+ import { cva } from "class-variance-authority";
4
+ import { useIsPresent } from "motion/react";
5
+ import { usePrefersReducedMotion } from "../hooks/use-prefers-reduced-motion.js";
6
+ import { cn } from "../lib/utils.js";
7
+ import { useArcPress } from "../motion/arc-press.js";
8
+ import { useAttachedElement } from "../motion/use-attached-element.js";
9
+ import { ButtonLabel } from "./button-label.js";
10
+ import { LEAVING_ATTRIBUTES, LOADING_INERT_HANDLERS } from "./button-interaction.js";
11
+ import { jsx as _jsx } from "react/jsx-runtime";
12
+ /**
13
+ * Arc's button recipe on its tokens. Press scale is driven by Motion alone, so `transform` never gets a CSS
14
+ * transition, and anchors of floating layers never scale because Radix measures them on pointerdown. Keyboard focus
15
+ * uses the foundation's shared outline; pointer focus draws no ring.
16
+ */
17
+ const buttonVariants = cva("relative inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 rounded-(--radius-control) border border-transparent px-4 font-sans text-sm leading-(--leading-body) font-medium whitespace-nowrap select-none [-webkit-tap-highlight-color:transparent] transition-[color,background-color,border-color,opacity,box-shadow] duration-(--duration-fast) ease-(--ease-standard) disabled:cursor-not-allowed disabled:opacity-[.52] aria-busy:cursor-progress motion-reduce:transition-none [&:is([aria-haspopup]:not([aria-haspopup=false]),[data-state],[role=combobox])]:transform-none! [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
18
+ variants: {
19
+ variant: {
20
+ primary: "border-foreground bg-foreground text-background hover-fine:not-disabled:opacity-[.91] hover-fine:not-disabled:shadow-(--shadow-resting) active:not-disabled:opacity-[.84]",
21
+ secondary: "border-border bg-surface text-foreground hover-fine:not-disabled:bg-surface-muted hover-fine:not-disabled:shadow-(--shadow-resting) active:not-disabled:bg-surface-muted disabled:bg-surface-muted disabled:text-text-muted disabled:opacity-100",
22
+ ghost: "bg-transparent text-text-secondary hover-fine:not-disabled:bg-surface-muted hover-fine:not-disabled:text-foreground active:not-disabled:bg-surface-muted active:not-disabled:text-foreground disabled:text-text-muted disabled:opacity-100",
23
+ danger: "border-border bg-surface text-danger hover-fine:not-disabled:border-danger hover-fine:not-disabled:bg-surface-muted active:not-disabled:border-danger active:not-disabled:bg-surface-muted disabled:bg-surface-muted disabled:text-[color-mix(in_oklab,var(--danger)_55%,var(--surface-muted))] disabled:opacity-100"
24
+ },
25
+ size: {
26
+ sm: "min-h-(--control-height-sm) px-3",
27
+ md: "min-h-(--control-height-md)",
28
+ lg: "min-h-(--control-height-lg) px-5"
29
+ }
30
+ },
31
+ defaultVariants: {
32
+ variant: "primary",
33
+ size: "md"
34
+ }
35
+ });
36
+ /**
37
+ * A single action on a page, form or dialog. Defaults to `type="button"`, so it only submits a form when asked to.
38
+ * @param props - Variant, size, loading state and native button attributes, including `ref`.
39
+ * @returns The native button.
40
+ */
41
+ function Button(t0) {
42
+ const $ = _c(29);
43
+ let children;
44
+ let className;
45
+ let props;
46
+ let ref;
47
+ let t1;
48
+ let t2;
49
+ let t3;
50
+ let t4;
51
+ if ($[0] !== t0) {
52
+ ({className, variant: t1, size: t2, loading: t3, type: t4, children, ref, ...props} = t0);
53
+ $[0] = t0;
54
+ $[1] = children;
55
+ $[2] = className;
56
+ $[3] = props;
57
+ $[4] = ref;
58
+ $[5] = t1;
59
+ $[6] = t2;
60
+ $[7] = t3;
61
+ $[8] = t4;
62
+ } else {
63
+ children = $[1];
64
+ className = $[2];
65
+ props = $[3];
66
+ ref = $[4];
67
+ t1 = $[5];
68
+ t2 = $[6];
69
+ t3 = $[7];
70
+ t4 = $[8];
71
+ }
72
+ const variant = t1 === undefined ? "primary" : t1;
73
+ const size = t2 === undefined ? "md" : t2;
74
+ const loading = t3 === undefined ? false : t3;
75
+ const type = t4 === undefined ? "button" : t4;
76
+ const reduceMotion = usePrefersReducedMotion();
77
+ const isPresent = useIsPresent();
78
+ const [element, attach] = useAttachedElement(ref);
79
+ useArcPress(element, !reduceMotion);
80
+ let t5;
81
+ if ($[9] !== className || $[10] !== size || $[11] !== variant) {
82
+ t5 = cn(buttonVariants({
83
+ variant,
84
+ size,
85
+ className
86
+ }));
87
+ $[9] = className;
88
+ $[10] = size;
89
+ $[11] = variant;
90
+ $[12] = t5;
91
+ } else {
92
+ t5 = $[12];
93
+ }
94
+ const t6 = loading || undefined;
95
+ const t7 = loading || props["aria-disabled"] || undefined;
96
+ const t8 = loading ? LOADING_INERT_HANDLERS : undefined;
97
+ const t9 = isPresent ? undefined : LEAVING_ATTRIBUTES;
98
+ let t10;
99
+ if ($[13] !== children || $[14] !== loading || $[15] !== reduceMotion) {
100
+ t10 = /* @__PURE__ */ _jsx(ButtonLabel, {
101
+ loading,
102
+ reduceMotion,
103
+ children
104
+ });
105
+ $[13] = children;
106
+ $[14] = loading;
107
+ $[15] = reduceMotion;
108
+ $[16] = t10;
109
+ } else {
110
+ t10 = $[16];
111
+ }
112
+ let t11;
113
+ if ($[17] !== attach || $[18] !== props || $[19] !== size || $[20] !== t10 || $[21] !== t5 || $[22] !== t6 || $[23] !== t7 || $[24] !== t8 || $[25] !== t9 || $[26] !== type || $[27] !== variant) {
114
+ t11 = /* @__PURE__ */ _jsx("button", {
115
+ ref: attach,
116
+ type,
117
+ "data-slot": "button",
118
+ "data-variant": variant,
119
+ "data-size": size,
120
+ className: t5,
121
+ "aria-busy": t6,
122
+ ...props,
123
+ "aria-disabled": t7,
124
+ ...t8,
125
+ ...t9,
126
+ children: t10
127
+ });
128
+ $[17] = attach;
129
+ $[18] = props;
130
+ $[19] = size;
131
+ $[20] = t10;
132
+ $[21] = t5;
133
+ $[22] = t6;
134
+ $[23] = t7;
135
+ $[24] = t8;
136
+ $[25] = t9;
137
+ $[26] = type;
138
+ $[27] = variant;
139
+ $[28] = t11;
140
+ } else {
141
+ t11 = $[28];
142
+ }
143
+ return t11;
144
+ }
145
+ export { Button };
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Arc's Calendar (https://uiarc.dev, MIT License, see THIRD_PARTY_NOTICES.md) as a closed component: one month for
3
+ * picking one date, with a sliding month change, a gliding selected disc and an optional Today button. It renders on
4
+ * the internal react-day-picker composition, which keeps keyboard navigation and accessible day labels.
5
+ */
6
+ import * as React from "react";
7
+ import { useToday } from "../hooks/use-today.js";
8
+ export { useToday };
9
+ /** Returns `true` for a day that cannot be picked, such as a weekend. */
10
+ type CalendarDateMatcher = (date: Date) => boolean;
11
+ /** Props of {@link Calendar}: Arc's calendar API plus the @astra-kit/ui extensions marked below. */
12
+ type CalendarProps = {
13
+ /** Selected date. Controlled only: the calendar shows what it receives. */
14
+ value?: Date | null;
15
+ /** Called with the day the viewer picks, including from the Today button. */
16
+ onChange?: (date: Date) => void;
17
+ /** Controlled visible month. Without it the calendar opens on the month of `value`, or on today's. */
18
+ month?: Date;
19
+ /** Called with the first day of the month the viewer navigates to. */
20
+ onMonthChange?: (month: Date) => void;
21
+ /** Earliest selectable day; navigation stops at its month. */
22
+ minDate?: Date;
23
+ /** Latest selectable day; navigation stops at its month. */
24
+ maxDate?: Date;
25
+ /** Return `true` to block a day, such as weekends. */
26
+ disabledDates?: CalendarDateMatcher;
27
+ /**
28
+ * BCP 47 locale for month, weekday and day names. Defaults to `"es-AR"`, with weeks starting on Monday. Spanish and
29
+ * English locales are fully translated; any other keeps English accessible labels with `Intl` month and weekday names.
30
+ */
31
+ locale?: string;
32
+ /** Class of the calendar root. */
33
+ className?: string;
34
+ /** Adds a Today button that returns to the current month and selects today when it is allowed. */
35
+ showToday?: boolean;
36
+ /** @astra-kit/ui: copy of the Today button. Defaults to "Hoy". */
37
+ todayLabel?: string;
38
+ };
39
+ /**
40
+ * A month grid for picking one date. Days before `minDate`, after `maxDate` or matched by `disabledDates` are blocked,
41
+ * and navigation stops at the months of `minDate` and `maxDate`.
42
+ * @param props - Arc's calendar props plus `todayLabel`.
43
+ * @returns The calendar, in Spanish by default.
44
+ */
45
+ declare function Calendar({ value, onChange, month, onMonthChange, minDate, maxDate, disabledDates, locale, className, showToday, todayLabel, }: CalendarProps): React.JSX.Element;
46
+ export { Calendar };
47
+ export type { CalendarDateMatcher, CalendarProps };
@@ -0,0 +1,155 @@
1
+ "use client";
2
+ import { c as _c } from "react/compiler-runtime";
3
+ /**
4
+ * Arc's Calendar (https://uiarc.dev, MIT License, see THIRD_PARTY_NOTICES.md) as a closed component: one month for
5
+ * picking one date, with a sliding month change, a gliding selected disc and an optional Today button. It renders on
6
+ * the internal react-day-picker composition, which keeps keyboard navigation and accessible day labels.
7
+ */
8
+ import * as React from "react";
9
+ import { enUS, es } from "react-day-picker/locale";
10
+ import { CALENDAR_COPY, CALENDAR_DEFAULT_LOCALE, CALENDAR_LOCALE_SEPARATOR, CALENDAR_TRANSLATED_LANGUAGE } from "../constants/calendar.js";
11
+ import { useToday } from "../hooks/use-today.js";
12
+ import { Calendar as CalendarPrimitive } from "./primitives/calendar.js";
13
+ import { jsx as _jsx } from "react/jsx-runtime";
14
+ export { useToday };
15
+ /**
16
+ * Maps a BCP 47 locale to react-day-picker's localization. Only Spanish and English locale data ship with @astra-kit/ui,
17
+ * so other languages take their month and weekday names from `Intl` and keep English accessible labels.
18
+ * @param locale - BCP 47 locale such as `es-AR`.
19
+ * @returns The react-day-picker locale and, for untranslated languages, `Intl` formatters.
20
+ */
21
+ function resolveCalendarLocale(locale) {
22
+ const language = locale.split(CALENDAR_LOCALE_SEPARATOR)[0]?.toLowerCase();
23
+ if (language === CALENDAR_TRANSLATED_LANGUAGE.spanish) return { dayPickerLocale: es };
24
+ if (language === CALENDAR_TRANSLATED_LANGUAGE.english) return { dayPickerLocale: enUS };
25
+ const captionFormat = new Intl.DateTimeFormat(locale, {
26
+ month: "long",
27
+ year: "numeric"
28
+ });
29
+ const weekdayFormat = new Intl.DateTimeFormat(locale, { weekday: "short" });
30
+ return {
31
+ dayPickerLocale: enUS,
32
+ formatters: {
33
+ formatCaption: (month) => captionFormat.format(month),
34
+ formatWeekdayName: (weekday) => weekdayFormat.format(weekday)
35
+ }
36
+ };
37
+ }
38
+ /**
39
+ * A month grid for picking one date. Days before `minDate`, after `maxDate` or matched by `disabledDates` are blocked,
40
+ * and navigation stops at the months of `minDate` and `maxDate`.
41
+ * @param props - Arc's calendar props plus `todayLabel`.
42
+ * @returns The calendar, in Spanish by default.
43
+ */
44
+ function Calendar(t0) {
45
+ const $ = _c(30);
46
+ const { value, onChange, month, onMonthChange, minDate, maxDate, disabledDates, locale: t1, className, showToday: t2, todayLabel: t3 } = t0;
47
+ const locale = t1 === undefined ? CALENDAR_DEFAULT_LOCALE : t1;
48
+ const showToday = t2 === undefined ? false : t2;
49
+ const todayLabel = t3 === undefined ? CALENDAR_COPY.today : t3;
50
+ const today = useToday();
51
+ let t4;
52
+ if ($[0] !== locale) {
53
+ t4 = resolveCalendarLocale(locale);
54
+ $[0] = locale;
55
+ $[1] = t4;
56
+ } else {
57
+ t4 = $[1];
58
+ }
59
+ const { dayPickerLocale, formatters } = t4;
60
+ let t5;
61
+ if ($[2] !== value) {
62
+ t5 = () => value ?? undefined;
63
+ $[2] = value;
64
+ $[3] = t5;
65
+ } else {
66
+ t5 = $[3];
67
+ }
68
+ const [initialMonth] = React.useState(t5);
69
+ let matchers;
70
+ if ($[4] !== disabledDates || $[5] !== maxDate || $[6] !== minDate) {
71
+ matchers = [];
72
+ if (minDate) {
73
+ let t6;
74
+ if ($[8] !== minDate) {
75
+ t6 = { before: minDate };
76
+ $[8] = minDate;
77
+ $[9] = t6;
78
+ } else {
79
+ t6 = $[9];
80
+ }
81
+ matchers.push(t6);
82
+ }
83
+ if (maxDate) {
84
+ let t6;
85
+ if ($[10] !== maxDate) {
86
+ t6 = { after: maxDate };
87
+ $[10] = maxDate;
88
+ $[11] = t6;
89
+ } else {
90
+ t6 = $[11];
91
+ }
92
+ matchers.push(t6);
93
+ }
94
+ if (disabledDates) {
95
+ matchers.push(disabledDates);
96
+ }
97
+ $[4] = disabledDates;
98
+ $[5] = maxDate;
99
+ $[6] = minDate;
100
+ $[7] = matchers;
101
+ } else {
102
+ matchers = $[7];
103
+ }
104
+ const disabled = matchers;
105
+ const t6 = value ?? undefined;
106
+ let t7;
107
+ if ($[12] !== onChange) {
108
+ t7 = (_selected, triggerDate) => onChange?.(triggerDate);
109
+ $[12] = onChange;
110
+ $[13] = t7;
111
+ } else {
112
+ t7 = $[13];
113
+ }
114
+ let t8;
115
+ if ($[14] !== className || $[15] !== dayPickerLocale || $[16] !== disabled || $[17] !== formatters || $[18] !== initialMonth || $[19] !== locale || $[20] !== maxDate || $[21] !== minDate || $[22] !== month || $[23] !== onMonthChange || $[24] !== showToday || $[25] !== t6 || $[26] !== t7 || $[27] !== today || $[28] !== todayLabel) {
116
+ t8 = /* @__PURE__ */ _jsx(CalendarPrimitive, {
117
+ mode: "single",
118
+ selected: t6,
119
+ onSelect: t7,
120
+ today,
121
+ month,
122
+ defaultMonth: initialMonth,
123
+ onMonthChange,
124
+ startMonth: minDate,
125
+ endMonth: maxDate,
126
+ disabled,
127
+ locale: dayPickerLocale,
128
+ lang: locale,
129
+ formatters,
130
+ className,
131
+ showToday,
132
+ todayLabel
133
+ });
134
+ $[14] = className;
135
+ $[15] = dayPickerLocale;
136
+ $[16] = disabled;
137
+ $[17] = formatters;
138
+ $[18] = initialMonth;
139
+ $[19] = locale;
140
+ $[20] = maxDate;
141
+ $[21] = minDate;
142
+ $[22] = month;
143
+ $[23] = onMonthChange;
144
+ $[24] = showToday;
145
+ $[25] = t6;
146
+ $[26] = t7;
147
+ $[27] = today;
148
+ $[28] = todayLabel;
149
+ $[29] = t8;
150
+ } else {
151
+ t8 = $[29];
152
+ }
153
+ return t8;
154
+ }
155
+ export { Calendar };
@@ -0,0 +1,38 @@
1
+ import type { ComponentProps, ReactNode } from "react";
2
+ import type { CardHeadingLevel } from "../constants/card.js";
3
+ export type { CardHeadingLevel };
4
+ export type CardProps = Omit<ComponentProps<"article">, "title"> & {
5
+ /** Card heading. Without it the card renders only its surface and children. With `details` it opens the quick look. */
6
+ title?: ReactNode;
7
+ /** Supporting line under the title. */
8
+ description?: ReactNode;
9
+ /** Image or visual at the top. Zooms slightly on hover. */
10
+ media?: ReactNode;
11
+ /** Trailing control of the byline row, such as a button. */
12
+ action?: ReactNode;
13
+ /** Small leading visual of the byline, such as the owner's avatar. */
14
+ avatar?: ReactNode;
15
+ /** Who the card belongs to, shown in the byline. */
16
+ meta?: ReactNode;
17
+ /** Short status under the meta, such as "Actualizada hace 2 horas". Changes roll in word by word and are announced politely. */
18
+ status?: string;
19
+ /** Quick look content. With a `title`, the card opens into a larger dialog that grows out of it. */
20
+ details?: ReactNode;
21
+ /** Controlled quick look state. */
22
+ open?: boolean;
23
+ /** Initial quick look state when uncontrolled. */
24
+ defaultOpen?: boolean;
25
+ /** Called when the quick look opens or closes. */
26
+ onOpenChange?: (open: boolean) => void;
27
+ /** Content rendered after the body and byline, such as a row of actions. */
28
+ footer?: ReactNode;
29
+ /** Heading level of the title. */
30
+ headingLevel?: CardHeadingLevel;
31
+ };
32
+ /**
33
+ * A content card with optional media, byline, action and footer that can grow into a quick look dialog.
34
+ * @param props - Arc's card content and quick look state, the heading level, a footer and native article attributes.
35
+ * @returns The card article, wrapped in its quick look dialog when `details` is set.
36
+ */
37
+ declare function Card({ title, description, media, action, avatar, meta, status, details, open: openProp, defaultOpen, onOpenChange, footer, headingLevel, children, className, style, ref, ...props }: CardProps): import("react").JSX.Element;
38
+ export { Card };