@vamos-ui/react 0.3.0 → 0.4.1

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 (274) hide show
  1. package/README.md +4 -0
  2. package/dist/blocks/block-heading.js +1 -1
  3. package/dist/blocks/block-image.js +1 -1
  4. package/dist/blocks/block-link.js +2 -2
  5. package/dist/blocks/index.d.ts +5 -5
  6. package/dist/blocks/index.js +5 -5
  7. package/dist/blocks/labels.d.ts +8 -0
  8. package/dist/blocks/labels.js +60 -0
  9. package/dist/blocks/section-header.js +1 -1
  10. package/dist/blocks/section.js +2 -2
  11. package/dist/blocks/site/_kit-1.js +1 -1
  12. package/dist/blocks/site/announcement-bar.js +1 -1
  13. package/dist/blocks/site/article-layout.d.ts +1 -0
  14. package/dist/blocks/site/article-layout.js +2 -1
  15. package/dist/blocks/site/blog-list.d.ts +1 -0
  16. package/dist/blocks/site/blog-list.js +3 -2
  17. package/dist/blocks/site/contact-dock.js +3 -1
  18. package/dist/blocks/site/contact-form.js +1 -1
  19. package/dist/blocks/site/cta.d.ts +2 -2
  20. package/dist/blocks/site/cta.js +6 -4
  21. package/dist/blocks/site/feature-grid.d.ts +1 -0
  22. package/dist/blocks/site/feature-grid.js +5 -4
  23. package/dist/blocks/site/feature-tabs.js +1 -1
  24. package/dist/blocks/site/footer.d.ts +11 -2
  25. package/dist/blocks/site/footer.js +36 -11
  26. package/dist/blocks/site/gallery-section.d.ts +6 -1
  27. package/dist/blocks/site/gallery-section.js +5 -4
  28. package/dist/blocks/site/hero.d.ts +3 -2
  29. package/dist/blocks/site/hero.js +7 -5
  30. package/dist/blocks/site/logo-strip.d.ts +1 -0
  31. package/dist/blocks/site/logo-strip.js +1 -1
  32. package/dist/blocks/site/map-hours.d.ts +2 -2
  33. package/dist/blocks/site/map-hours.js +4 -2
  34. package/dist/blocks/site/media-text.d.ts +4 -1
  35. package/dist/blocks/site/media-text.js +4 -3
  36. package/dist/blocks/site/menu-list.d.ts +7 -3
  37. package/dist/blocks/site/menu-list.js +34 -7
  38. package/dist/blocks/site/navbar.d.ts +1 -0
  39. package/dist/blocks/site/navbar.js +6 -5
  40. package/dist/blocks/site/not-found.js +2 -1
  41. package/dist/blocks/site/page-intro.d.ts +1 -0
  42. package/dist/blocks/site/page-intro.js +2 -1
  43. package/dist/blocks/site/process.d.ts +1 -0
  44. package/dist/blocks/site/process.js +2 -1
  45. package/dist/blocks/site/registry-1.d.ts +1 -1
  46. package/dist/blocks/site/registry-2.d.ts +5 -0
  47. package/dist/blocks/site/registry-2.js +5 -3
  48. package/dist/blocks/site/rich-text-section.js +2 -1
  49. package/dist/blocks/site/shared/heading-lines.d.ts +9 -0
  50. package/dist/blocks/site/shared/heading-lines.js +32 -0
  51. package/dist/blocks/site/shared/image-sizes.d.ts +25 -0
  52. package/dist/blocks/site/shared/image-sizes.js +37 -0
  53. package/dist/blocks/site/shared/island-keys.d.ts +1 -1
  54. package/dist/blocks/site/shared/island-keys.js +1 -1
  55. package/dist/blocks/site/shared/labels-2.d.ts +17 -1
  56. package/dist/blocks/site/shared/labels-2.js +832 -6
  57. package/dist/blocks/site/shared/open-now.d.ts +1 -1
  58. package/dist/blocks/site/shared/open-now.js +1 -1
  59. package/dist/blocks/site/shared/opening-hours.d.ts +18 -2
  60. package/dist/blocks/site/shared/opening-hours.js +36 -7
  61. package/dist/blocks/site/shared/tap.d.ts +9 -0
  62. package/dist/blocks/site/shared/tap.js +16 -0
  63. package/dist/blocks/site/site-shell.js +3 -3
  64. package/dist/blocks/site/team.d.ts +1 -1
  65. package/dist/blocks/site/team.js +4 -3
  66. package/dist/blocks/site/testimonials.d.ts +2 -2
  67. package/dist/blocks/site/testimonials.js +3 -3
  68. package/dist/business/approval-flow.js +2 -2
  69. package/dist/business/import-wizard.js +1 -1
  70. package/dist/business/line-items.js +1 -1
  71. package/dist/business/multi-step-form.js +2 -2
  72. package/dist/business/permission-matrix.js +1 -1
  73. package/dist/business/setup-checklist.js +2 -2
  74. package/dist/business/signer-status.js +1 -1
  75. package/dist/charts/bar-chart.js +1 -1
  76. package/dist/charts/bar-list.js +1 -1
  77. package/dist/charts/chart-shell.d.ts +9 -2
  78. package/dist/charts/chart-shell.js +11 -5
  79. package/dist/charts/chart.js +1 -1
  80. package/dist/charts/combo-chart.js +5 -7
  81. package/dist/charts/donut-chart.js +1 -1
  82. package/dist/charts/funnel.js +1 -1
  83. package/dist/charts/gauge.js +2 -2
  84. package/dist/charts/utils.d.ts +10 -0
  85. package/dist/charts/utils.js +46 -0
  86. package/dist/components/accordion.d.ts +1 -1
  87. package/dist/components/accordion.js +8 -8
  88. package/dist/components/activity-timeline.js +11 -11
  89. package/dist/components/address-field.js +3 -3
  90. package/dist/components/alert-dialog.d.ts +1 -1
  91. package/dist/components/alert-dialog.js +8 -8
  92. package/dist/components/alert.js +2 -2
  93. package/dist/components/app-shell.js +3 -3
  94. package/dist/components/aspect-ratio.d.ts +26 -0
  95. package/dist/components/aspect-ratio.js +42 -0
  96. package/dist/components/attachment-list.js +2 -2
  97. package/dist/components/audit-log.js +1 -1
  98. package/dist/components/avatar.d.ts +1 -1
  99. package/dist/components/avatar.js +8 -8
  100. package/dist/components/backup-codes.js +1 -1
  101. package/dist/components/badge.js +3 -3
  102. package/dist/components/breadcrumb.js +10 -9
  103. package/dist/components/button-group.js +4 -4
  104. package/dist/components/button.js +4 -4
  105. package/dist/components/calendar.js +5 -5
  106. package/dist/components/card.js +8 -8
  107. package/dist/components/carousel.d.ts +12 -3
  108. package/dist/components/carousel.js +17 -14
  109. package/dist/components/checkbox.d.ts +1 -1
  110. package/dist/components/checkbox.js +6 -6
  111. package/dist/components/collapsible.d.ts +36 -0
  112. package/dist/components/collapsible.js +37 -0
  113. package/dist/components/color-picker.js +3 -3
  114. package/dist/components/combobox.js +1 -1
  115. package/dist/components/command.js +9 -9
  116. package/dist/components/comment-thread.js +3 -3
  117. package/dist/components/context-menu.d.ts +1 -1
  118. package/dist/components/context-menu.js +9 -9
  119. package/dist/components/currency-input.js +1 -1
  120. package/dist/components/date-picker.js +2 -2
  121. package/dist/components/date-range-picker.js +1 -1
  122. package/dist/components/description-list.js +2 -2
  123. package/dist/components/dialog.d.ts +1 -1
  124. package/dist/components/dialog.js +9 -9
  125. package/dist/components/dropdown-menu.d.ts +1 -1
  126. package/dist/components/dropdown-menu.js +9 -9
  127. package/dist/components/editor-layout.js +9 -9
  128. package/dist/components/empty-state.js +2 -2
  129. package/dist/components/entity-card.js +1 -1
  130. package/dist/components/file-upload.js +5 -5
  131. package/dist/components/formatted-input.js +3 -3
  132. package/dist/components/hierarchy-chart.js +1 -1
  133. package/dist/components/hover-card.d.ts +1 -1
  134. package/dist/components/hover-card.js +3 -3
  135. package/dist/components/iban-input.js +1 -1
  136. package/dist/components/id-input.js +3 -3
  137. package/dist/components/image.d.ts +18 -2
  138. package/dist/components/image.js +16 -9
  139. package/dist/components/input-otp.js +6 -6
  140. package/dist/components/input.d.ts +1 -1
  141. package/dist/components/input.js +6 -6
  142. package/dist/components/item.js +4 -4
  143. package/dist/components/kbd.js +3 -3
  144. package/dist/components/list-layout.js +9 -9
  145. package/dist/components/menubar.d.ts +96 -0
  146. package/dist/components/menubar.js +123 -0
  147. package/dist/components/native-select.js +1 -1
  148. package/dist/components/navigation-menu.d.ts +1 -1
  149. package/dist/components/navigation-menu.js +12 -11
  150. package/dist/components/notification-center.js +4 -4
  151. package/dist/components/page-header.js +3 -3
  152. package/dist/components/pagination.js +9 -9
  153. package/dist/components/phone-input.js +1 -1
  154. package/dist/components/pin-map.js +1 -1
  155. package/dist/components/placeholder-art.d.ts +51 -0
  156. package/dist/components/placeholder-art.js +82 -0
  157. package/dist/components/popover.d.ts +1 -1
  158. package/dist/components/popover.js +7 -7
  159. package/dist/components/progress.js +3 -3
  160. package/dist/components/qr-code.js +1 -1
  161. package/dist/components/radio-group.d.ts +1 -1
  162. package/dist/components/radio-group.js +4 -4
  163. package/dist/components/record-detail-layout.js +10 -10
  164. package/dist/components/record-picker.js +2 -2
  165. package/dist/components/resizable.js +2 -2
  166. package/dist/components/scroll-area.d.ts +1 -1
  167. package/dist/components/scroll-area.js +4 -4
  168. package/dist/components/select.d.ts +1 -1
  169. package/dist/components/select.js +10 -10
  170. package/dist/components/separator.d.ts +1 -1
  171. package/dist/components/separator.js +3 -3
  172. package/dist/components/settings-layout.js +6 -6
  173. package/dist/components/sheet.js +3 -3
  174. package/dist/components/sidebar.js +12 -11
  175. package/dist/components/signature-pad.js +1 -1
  176. package/dist/components/skeleton.js +5 -5
  177. package/dist/components/sla-timer.js +2 -2
  178. package/dist/components/slider.d.ts +1 -1
  179. package/dist/components/slider.js +2 -2
  180. package/dist/components/slug-input.js +1 -1
  181. package/dist/components/sparkline.js +1 -1
  182. package/dist/components/spinner.js +2 -2
  183. package/dist/components/stat.js +5 -5
  184. package/dist/components/status-picker.js +2 -2
  185. package/dist/components/stepper.js +1 -1
  186. package/dist/components/switch.d.ts +1 -1
  187. package/dist/components/switch.js +3 -3
  188. package/dist/components/table.js +10 -10
  189. package/dist/components/tabs.d.ts +1 -1
  190. package/dist/components/tabs.js +11 -11
  191. package/dist/components/tag-input.js +1 -1
  192. package/dist/components/task-list.js +1 -1
  193. package/dist/components/time-picker.js +3 -3
  194. package/dist/components/toggle.d.ts +2 -1
  195. package/dist/components/toggle.js +7 -6
  196. package/dist/components/tooltip.d.ts +1 -1
  197. package/dist/components/tooltip.js +5 -4
  198. package/dist/components/top-bar.js +4 -4
  199. package/dist/components/tour.js +1 -1
  200. package/dist/components/tree-select.js +2 -2
  201. package/dist/components/tree-view.js +3 -3
  202. package/dist/components/typography.js +11 -11
  203. package/dist/components/user-picker.js +2 -2
  204. package/dist/components/version-history.js +3 -3
  205. package/dist/data-table/data-table.js +1 -1
  206. package/dist/data-table/filter-bar.js +2 -2
  207. package/dist/data-table/index.d.ts +15 -8
  208. package/dist/data-table/index.js +9 -8
  209. package/dist/data-table/saved-views.js +1 -1
  210. package/dist/editor/block-editor.js +1 -1
  211. package/dist/editor/context.js +1 -1
  212. package/dist/editor/menus.js +1 -1
  213. package/dist/fonts/font-picker.js +3 -3
  214. package/dist/fonts/pairing-picker.js +1 -1
  215. package/dist/fonts/provider.js +1 -1
  216. package/dist/index.d.ts +188 -90
  217. package/dist/index.js +94 -90
  218. package/dist/lib/data-islands.js +1 -1
  219. package/dist/lib/field-context.js +1 -1
  220. package/dist/lib/floating-arrow.js +1 -1
  221. package/dist/lib/islands.js +1 -1
  222. package/dist/lib/layer.js +3 -3
  223. package/dist/lib/locale.js +2 -2
  224. package/dist/lib/menu.js +2 -2
  225. package/dist/lib/provider.js +4 -4
  226. package/dist/lib/theme-scope.js +4 -3
  227. package/dist/lib/value-format.js +1 -1
  228. package/dist/lib/variants.js +2 -2
  229. package/dist/locales/ar.d.ts +2087 -0
  230. package/dist/locales/ar.js +2088 -0
  231. package/dist/locales/de.d.ts +2087 -0
  232. package/dist/locales/de.js +2088 -0
  233. package/dist/locales/en.d.ts +1 -0
  234. package/dist/locales/en.js +1 -0
  235. package/dist/locales/es.d.ts +2087 -0
  236. package/dist/locales/es.js +2087 -0
  237. package/dist/locales/fr.d.ts +2087 -0
  238. package/dist/locales/fr.js +2088 -0
  239. package/dist/locales/tr.d.ts +1 -0
  240. package/dist/locales/tr.js +1 -0
  241. package/dist/media/focal-point.js +1 -1
  242. package/dist/media/gallery.js +1 -1
  243. package/dist/media/image-cropper.js +1 -1
  244. package/dist/media/image-field.js +2 -2
  245. package/dist/media/lightbox.js +4 -3
  246. package/dist/media/link-preview.js +3 -3
  247. package/dist/media/media-library.js +4 -4
  248. package/dist/media/media-picker.js +1 -1
  249. package/dist/media/media-provider.js +1 -1
  250. package/dist/media/video-player.js +4 -4
  251. package/dist/motion/count-up.js +1 -1
  252. package/dist/motion/motion-scope.js +2 -2
  253. package/dist/motion/page-transition.js +1 -1
  254. package/dist/motion/parallax.js +2 -2
  255. package/dist/motion/pointer.js +3 -3
  256. package/dist/motion/reveal.js +3 -3
  257. package/dist/motion/skeleton-swap.js +1 -1
  258. package/dist/motion/text-reveal.d.ts +3 -1
  259. package/dist/motion/text-reveal.js +6 -4
  260. package/dist/motion/ticker.js +1 -1
  261. package/dist/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
  262. package/dist/render/block-renderer.js +1 -1
  263. package/dist/scheduler/gantt.js +2 -2
  264. package/dist/scheduler/resource-calendar.js +2 -2
  265. package/dist/scheduler/scheduler.js +3 -3
  266. package/dist/scheduler/time-tracker.js +4 -4
  267. package/dist/sortable/kanban.js +2 -2
  268. package/dist/sortable/sortable-list.js +2 -2
  269. package/dist/sortable/sortable.js +4 -4
  270. package/dist/styles/blocks.css +18 -9
  271. package/dist/styles/editors.css +2 -1
  272. package/dist/styles/media.css +31 -5
  273. package/dist/styles.css +39 -9
  274. package/package.json +1 -1
@@ -44,7 +44,7 @@ function a11yProps(semantic, value, max, valueText, label) {
44
44
  * <ProgressRing value={85} aria-label="Profile completeness" format="percent" size="md" />
45
45
  * ```
46
46
  */
47
- export const ProgressRing = React.forwardRef(function ProgressRing({ value, max = 100, size = "md", thickness, color = "chart-1", thresholds, label, format, semantic = "progress", labels, className, style, "aria-label": ariaLabel, ...props }, ref) {
47
+ export const ProgressRing = /*#__PURE__*/ React.forwardRef(function ProgressRing({ value, max = 100, size = "md", thickness, color = "chart-1", thresholds, label, format, semantic = "progress", labels, className, style, "aria-label": ariaLabel, ...props }, ref) {
48
48
  const px = typeof size === "number" ? size : SIZES[size];
49
49
  const sw = thickness ?? Math.max(2.5, Math.round(px * 0.09 * 10) / 10);
50
50
  const threshold = pickThreshold(value, thresholds);
@@ -64,7 +64,7 @@ export const ProgressRing = React.forwardRef(function ProgressRing({ value, max
64
64
  * <Gauge value={64} aria-label="SEO score" semantic="meter" thresholds={[{ at: 0, color: "danger", label: "Poor" }, { at: 50, color: "warning", label: "Fair" }, { at: 80, color: "success", label: "Good" }]} color="auto" />
65
65
  * ```
66
66
  */
67
- export const Gauge = React.forwardRef(function Gauge({ value, max = 100, size = "lg", thickness, color = "chart-1", thresholds, label, format, semantic = "meter", arc = 270, showThresholdBands, target, labels, className, style, "aria-label": ariaLabel, ...props }, ref) {
67
+ export const Gauge = /*#__PURE__*/ React.forwardRef(function Gauge({ value, max = 100, size = "lg", thickness, color = "chart-1", thresholds, label, format, semantic = "meter", arc = 270, showThresholdBands, target, labels, className, style, "aria-label": ariaLabel, ...props }, ref) {
68
68
  const px = typeof size === "number" ? size : SIZES[size];
69
69
  const sw = thickness ?? Math.max(3, Math.round(px * 0.075 * 10) / 10);
70
70
  const threshold = pickThreshold(value, thresholds);
@@ -100,6 +100,16 @@ export declare function niceStep(v: number): number;
100
100
  * Returns domains with the same negative share, so neither axis exaggerates.
101
101
  */
102
102
  export declare function alignZeroDomains(a: [number, number], b: [number, number]): [[number, number], [number, number]];
103
+ /**
104
+ * Two value axes (Combo) with nice, evenly spaced ticks whose zero lines meet: both axes get the
105
+ * same number of steps below and above zero, each with its own nice step (1, 2, 2.5, 5… × 10ⁿ), so
106
+ * one set of grid lines serves both scales. An axis whose data never goes below zero keeps only its
107
+ * non-negative ticks (its domain still reaches below zero to line up with the other axis).
108
+ */
109
+ export declare function alignedAxes(a: [number, number], b: [number, number]): {
110
+ domains: [[number, number], [number, number]];
111
+ ticks: [number[], number[]];
112
+ };
103
113
  export interface SeriesStats {
104
114
  key: string;
105
115
  min: number;
@@ -188,6 +188,52 @@ export function alignZeroDomains(a, b) {
188
188
  };
189
189
  return [fit(aLo, aHi), fit(bLo, bHi)];
190
190
  }
191
+ /**
192
+ * Two value axes (Combo) with nice, evenly spaced ticks whose zero lines meet: both axes get the
193
+ * same number of steps below and above zero, each with its own nice step (1, 2, 2.5, 5… × 10ⁿ), so
194
+ * one set of grid lines serves both scales. An axis whose data never goes below zero keeps only its
195
+ * non-negative ticks (its domain still reaches below zero to line up with the other axis).
196
+ */
197
+ export function alignedAxes(a, b) {
198
+ const norm = ([lo, hi]) => [Math.min(0, Number.isFinite(lo) ? lo : 0), Math.max(0, Number.isFinite(hi) ? hi : 0)];
199
+ const axes = [norm(a), norm(b)];
200
+ const round = (v) => Number(v.toPrecision(12));
201
+ const build = (neg, pos, steps) => axes.map(([lo], i) => {
202
+ const step = steps[i];
203
+ const all = Array.from({ length: neg + pos + 1 }, (_, k) => round((k - neg) * step));
204
+ return { domain: [round(-neg * step), round(pos * step)], ticks: lo < 0 ? all : all.filter((v) => v >= 0) };
205
+ });
206
+ const anyNeg = axes.some(([lo]) => lo < 0);
207
+ const anyPos = axes.some(([, hi]) => hi > 0);
208
+ if (!anyNeg) {
209
+ // Non-negative data: four equal steps on both axes.
210
+ const steps = axes.map(([, hi]) => niceStep(hi / 4) || 0.25);
211
+ const [x, y] = build(0, 4, steps);
212
+ return { domains: [x.domain, y.domain], ticks: [x.ticks, y.ticks] };
213
+ }
214
+ let best = null;
215
+ for (const total of [4, 5, 6]) {
216
+ for (let neg = 1; neg <= total; neg++) {
217
+ const pos = total - neg;
218
+ if (anyPos && pos === 0)
219
+ continue;
220
+ const steps = axes.map(([lo, hi]) => {
221
+ const need = Math.max(neg ? -lo / neg : 0, pos ? hi / pos : hi > 0 ? Infinity : 0);
222
+ return Number.isFinite(need) ? niceStep(need) || 1 : Infinity;
223
+ });
224
+ if (!steps.every(Number.isFinite))
225
+ continue;
226
+ // Share of each axis left empty, plus a small cost per extra step.
227
+ const waste = axes.reduce((sum, [lo, hi], i) => sum + 1 - (hi - lo) / (steps[i] * total || 1), 0);
228
+ const score = waste + (total - 4) * 0.06;
229
+ if (!best || score < best.score - 1e-9)
230
+ best = { score, neg, pos, steps };
231
+ }
232
+ }
233
+ const { neg, pos, steps } = best;
234
+ const [x, y] = build(neg, pos, steps);
235
+ return { domains: [x.domain, y.domain], ticks: [x.ticks, y.ticks] };
236
+ }
191
237
  /** Min / max / average of one series (nulls skipped). `null` when the series has no numbers. */
192
238
  export function seriesStats(rows, key) {
193
239
  let min = Infinity;
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import { Accordion as RadixAccordion } from "radix-ui";
2
+ import * as RadixAccordion from "radix-ui/accordion";
3
3
  type AccordionVariant = "plain" | "separated" | "card";
4
4
  type AccordionSize = "sm" | "md";
5
5
  type AccordionRootProps = React.ComponentPropsWithoutRef<typeof RadixAccordion.Root>;
@@ -1,16 +1,16 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import * as React from "react";
4
- import { Accordion as RadixAccordion } from "radix-ui";
4
+ import * as RadixAccordion from "radix-ui/accordion";
5
5
  import { ChevronDown } from "lucide-react";
6
6
  import { cva } from "class-variance-authority";
7
7
  import { cn } from "../lib/cn.js";
8
- const AccordionContext = React.createContext({
8
+ const AccordionContext = /*#__PURE__*/ React.createContext({
9
9
  variant: "plain",
10
10
  size: "md",
11
11
  headingLevel: 3,
12
12
  });
13
- const rootVariants = cva("w-full", {
13
+ const rootVariants = /*#__PURE__*/ cva("w-full", {
14
14
  variants: {
15
15
  variant: {
16
16
  /** Ruled list: hairlines between items. */
@@ -38,11 +38,11 @@ const rootVariants = cva("w-full", {
38
38
  *
39
39
  * Persisting the open sections is the consumer's job: control `value` and store it.
40
40
  */
41
- export const Accordion = React.forwardRef(function Accordion({ variant = "plain", size = "md", headingLevel = 3, className, ...props }, ref) {
41
+ export const Accordion = /*#__PURE__*/ React.forwardRef(function Accordion({ variant = "plain", size = "md", headingLevel = 3, className, ...props }, ref) {
42
42
  const ctx = React.useMemo(() => ({ variant, size, headingLevel }), [variant, size, headingLevel]);
43
43
  return (_jsx(AccordionContext.Provider, { value: ctx, children: _jsx(RadixAccordion.Root, { ref: ref, "data-slot": "accordion", "data-variant": variant, className: cn(rootVariants({ variant }), className), ...props }) }));
44
44
  });
45
- const accordionItemVariants = cva("group/acc-item", {
45
+ const accordionItemVariants = /*#__PURE__*/ cva("group/acc-item", {
46
46
  variants: {
47
47
  variant: {
48
48
  plain: "border-b border-line last:border-b-0",
@@ -52,19 +52,19 @@ const accordionItemVariants = cva("group/acc-item", {
52
52
  },
53
53
  });
54
54
  /** One section. `value` identifies it; `disabled` locks it. */
55
- export const AccordionItem = React.forwardRef(function AccordionItem({ className, ...props }, ref) {
55
+ export const AccordionItem = /*#__PURE__*/ React.forwardRef(function AccordionItem({ className, ...props }, ref) {
56
56
  const { variant } = React.useContext(AccordionContext);
57
57
  return _jsx(RadixAccordion.Item, { ref: ref, "data-slot": "accordion-item", className: cn(accordionItemVariants({ variant }), className), ...props });
58
58
  });
59
59
  const pad = { plain: "", separated: "px-4", card: "px-(--gap)" };
60
60
  /** The section header: a heading with the toggle button (and optional actions beside it). */
61
- export const AccordionTrigger = React.forwardRef(function AccordionTrigger({ icon, meta, actions, className, children, ...props }, ref) {
61
+ export const AccordionTrigger = /*#__PURE__*/ React.forwardRef(function AccordionTrigger({ icon, meta, actions, className, children, ...props }, ref) {
62
62
  const { variant, size, headingLevel } = React.useContext(AccordionContext);
63
63
  const Heading = `h${headingLevel}`;
64
64
  return (_jsx(RadixAccordion.Header, { asChild: true, children: _jsxs(Heading, { "data-slot": "accordion-header", className: cn("flex items-center gap-1", pad[variant], actions && "pe-2"), children: [_jsxs(RadixAccordion.Trigger, { ref: ref, "data-slot": "accordion-trigger", className: cn("group/acc flex min-w-0 flex-1 items-center gap-3 rounded-ui-sm text-start font-medium text-fg outline-none transition-colors focus-ring", "disabled:cursor-not-allowed disabled:opacity-45", "hover:[&_[data-slot=accordion-title]]:underline hover:[&_[data-slot=accordion-title]]:decoration-line hover:[&_[data-slot=accordion-title]]:underline-offset-4", size === "sm" ? "py-2.5 text-[13px] [&_svg]:size-3.5" : "py-3.5 text-sm [&_svg]:size-4", variant === "plain" && (size === "sm" ? "py-2" : "py-3"), className), ...props, children: [icon ? _jsx("span", { "aria-hidden": true, className: "inline-flex shrink-0 text-fg-muted [&_svg]:shrink-0", children: icon }) : null, _jsx("span", { "data-slot": "accordion-title", className: "min-w-0 flex-1 text-pretty", children: children }), meta ? _jsx("span", { className: "sr-only", children: ", " }) : null, meta ? (_jsx("span", { "data-slot": "accordion-meta", className: "tabular shrink-0 truncate text-[13px] font-normal text-fg-subtle", children: meta })) : null, _jsx(ChevronDown, { "aria-hidden": true, className: "shrink-0 text-fg-subtle transition-transform duration-200 motion-reduce:transition-none group-data-[state=open]/acc:rotate-180" })] }), actions ? (_jsx("span", { "data-slot": "accordion-actions", className: "flex shrink-0 items-center gap-0.5", children: actions })) : null] }) }));
65
65
  });
66
66
  /** The collapsible body. Animates its height (`ui-collapse`, reduced-motion safe). */
67
- export const AccordionContent = React.forwardRef(function AccordionContent({ className, children, ...props }, ref) {
67
+ export const AccordionContent = /*#__PURE__*/ React.forwardRef(function AccordionContent({ className, children, ...props }, ref) {
68
68
  const { variant, size } = React.useContext(AccordionContext);
69
69
  return (_jsx(RadixAccordion.Content, { ref: ref, "data-slot": "accordion-content", className: "ui-collapse", ...props, children: _jsx("div", { className: cn("text-fg-muted", size === "sm" ? "pb-3 text-[13px]" : "pb-4 text-sm leading-relaxed", pad[variant], className), children: children }) }));
70
70
  });
@@ -13,28 +13,28 @@ export { RelativeTime } from "../lib/data-islands.js";
13
13
  * Composable timeline (`<ol>`). For data use `ActivityTimeline`; compose these parts for
14
14
  * custom rows: `Timeline › TimelineGroup › TimelineItem › TimelineIndicator + TimelineContent`.
15
15
  */
16
- export const Timeline = React.forwardRef(function Timeline({ variant = "feed", density = "inherit", className, ...props }, ref) {
16
+ export const Timeline = /*#__PURE__*/ React.forwardRef(function Timeline({ variant = "feed", density = "inherit", className, ...props }, ref) {
17
17
  return (_jsx("ol", { ref: ref, "data-slot": "timeline", "data-variant": variant, "data-density": density === "inherit" ? undefined : density, className: cn("group/timeline m-0 grid list-none gap-(--tl-gap) p-0 [--tl-gap:calc(var(--row-h)*0.3)] [--tl-ind:1.75rem]", "data-[density=compact]:[--tl-ind:1.5rem] [[data-density=compact]_&]:[--tl-ind:1.5rem]", className), ...props }));
18
18
  });
19
19
  /** A labelled section (a day). Children are TimelineItems. */
20
- export const TimelineGroup = React.forwardRef(function TimelineGroup({ date, label, now, labels, className, children, ...props }, ref) {
20
+ export const TimelineGroup = /*#__PURE__*/ React.forwardRef(function TimelineGroup({ date, label, now, labels, className, children, ...props }, ref) {
21
21
  const id = React.useId();
22
22
  return (_jsxs("li", { ref: ref, "data-slot": "timeline-group", "aria-labelledby": id, className: cn("grid gap-(--tl-gap)", className), ...props, children: [_jsxs("div", { id: id, className: "flex items-center gap-3 font-mono text-[11px] font-medium tracking-[0.06em] text-fg-subtle", children: [_jsx("span", { className: "shrink-0", children: label ?? (date ? _jsx(TimelineDayLabel, { date: date, now: now, labels: labels }) : null) }), _jsx("span", { "aria-hidden": true, className: "h-px flex-1 bg-line" })] }), _jsx("ol", { className: "m-0 grid list-none gap-(--tl-gap) p-0", children: children })] }));
23
23
  });
24
- export const TimelineItem = React.forwardRef(function TimelineItem({ status, highlight, className, ...props }, ref) {
24
+ export const TimelineItem = /*#__PURE__*/ React.forwardRef(function TimelineItem({ status, highlight, className, ...props }, ref) {
25
25
  return (_jsx("li", { ref: ref, "data-slot": "timeline-item", "data-status": status, "data-highlight": highlight ? "" : undefined, "aria-current": status === "current" ? "step" : undefined, className: cn("relative grid grid-cols-[var(--tl-ind)_minmax(0,1fr)] gap-x-3",
26
26
  // connector from below this indicator to the next one (start side, RTL-aware)
27
27
  "before:absolute before:start-[calc(var(--tl-ind)/2-0.5px)] before:top-[calc(var(--tl-ind)+0.25rem)] before:-bottom-[calc(var(--tl-gap)-0.25rem)] before:w-px before:bg-line last:before:hidden", "data-[status=upcoming]:before:w-0 data-[status=upcoming]:before:border-s data-[status=upcoming]:before:border-dashed data-[status=upcoming]:before:border-line data-[status=upcoming]:before:bg-transparent", "data-[status=current]:before:w-0 data-[status=current]:before:border-s data-[status=current]:before:border-dashed data-[status=current]:before:border-line data-[status=current]:before:bg-transparent", className), ...props }));
28
28
  });
29
- const indicatorVariants = cva("relative z-[1] grid size-(--tl-ind) shrink-0 place-items-center rounded-full border text-fg-muted [&_svg]:size-[calc(var(--tl-ind)*0.5)] [&_svg]:shrink-0", {
29
+ const indicatorVariants = /*#__PURE__*/ cva("relative z-[1] grid size-(--tl-ind) shrink-0 place-items-center rounded-full border text-fg-muted [&_svg]:size-[calc(var(--tl-ind)*0.5)] [&_svg]:shrink-0", {
30
30
  variants: {
31
31
  tone: {
32
32
  neutral: "border-line bg-[color-mix(in_oklch,var(--surface)_90%,var(--scene))]",
33
- accent: "tone-accent border-[color-mix(in_srgb,var(--tone)_35%,var(--line))] bg-[color-mix(in_oklch,var(--tone)_14%,color-mix(in_oklch,var(--surface)_92%,var(--scene)))] text-(--tone)",
34
- success: "tone-success border-[color-mix(in_srgb,var(--tone)_35%,var(--line))] bg-[color-mix(in_oklch,var(--tone)_14%,color-mix(in_oklch,var(--surface)_92%,var(--scene)))] text-(--tone)",
35
- warning: "tone-warning border-[color-mix(in_srgb,var(--tone)_35%,var(--line))] bg-[color-mix(in_oklch,var(--tone)_14%,color-mix(in_oklch,var(--surface)_92%,var(--scene)))] text-(--tone)",
36
- danger: "tone-danger border-[color-mix(in_srgb,var(--tone)_35%,var(--line))] bg-[color-mix(in_oklch,var(--tone)_14%,color-mix(in_oklch,var(--surface)_92%,var(--scene)))] text-(--tone)",
37
- info: "tone-info border-[color-mix(in_srgb,var(--tone)_35%,var(--line))] bg-[color-mix(in_oklch,var(--tone)_14%,color-mix(in_oklch,var(--surface)_92%,var(--scene)))] text-(--tone)",
33
+ accent: "tone-accent border-[color-mix(in_srgb,var(--tone)_35%,var(--line))] bg-[color-mix(in_oklch,var(--tone)_14%,color-mix(in_oklch,var(--surface)_92%,var(--scene)))] text-(--tone-ink)",
34
+ success: "tone-success border-[color-mix(in_srgb,var(--tone)_35%,var(--line))] bg-[color-mix(in_oklch,var(--tone)_14%,color-mix(in_oklch,var(--surface)_92%,var(--scene)))] text-(--tone-ink)",
35
+ warning: "tone-warning border-[color-mix(in_srgb,var(--tone)_35%,var(--line))] bg-[color-mix(in_oklch,var(--tone)_14%,color-mix(in_oklch,var(--surface)_92%,var(--scene)))] text-(--tone-ink)",
36
+ danger: "tone-danger border-[color-mix(in_srgb,var(--tone)_35%,var(--line))] bg-[color-mix(in_oklch,var(--tone)_14%,color-mix(in_oklch,var(--surface)_92%,var(--scene)))] text-(--tone-ink)",
37
+ info: "tone-info border-[color-mix(in_srgb,var(--tone)_35%,var(--line))] bg-[color-mix(in_oklch,var(--tone)_14%,color-mix(in_oklch,var(--surface)_92%,var(--scene)))] text-(--tone-ink)",
38
38
  },
39
39
  },
40
40
  defaultVariants: { tone: "neutral" },
@@ -70,7 +70,7 @@ export function TimelineActions({ className, ...props }) {
70
70
  return _jsx("div", { "data-slot": "timeline-actions", className: cn("mt-2 flex flex-wrap items-center gap-1.5", className), ...props });
71
71
  }
72
72
  /** "3 new updates" pill for live feeds: new items wait above instead of shifting the list. */
73
- export const TimelineNewItems = React.forwardRef(function TimelineNewItems({ count, labels, className, children, ...props }, ref) {
73
+ export const TimelineNewItems = /*#__PURE__*/ React.forwardRef(function TimelineNewItems({ count, labels, className, children, ...props }, ref) {
74
74
  if (count <= 0)
75
75
  return null;
76
76
  return (_jsxs("button", { ref: ref, type: "button", "data-slot": "timeline-new-items", className: cn("mx-auto inline-flex h-7 items-center gap-1.5 rounded-full bg-accent-soft px-3 text-xs font-medium text-accent-ink transition-[filter] hover:brightness-95 focus-ring motion-safe:ui-fade", className), ...props, children: [_jsx("span", { "aria-hidden": true, className: "size-1.5 rounded-full bg-current" }), children ?? _jsx(DataLabel, { ns: "timeline", id: "newItems", vars: { count }, override: labels })] }));
@@ -91,7 +91,7 @@ export function TimelineSkeleton({ count = 3, className }) {
91
91
  * ]} />
92
92
  * ```
93
93
  */
94
- export const ActivityTimeline = React.forwardRef(function ActivityTimeline({ items, variant = "feed", groupBy = "none", order, timeZone = "UTC", now, timeMode, loading, empty, hasMore, onLoadMore, newCount = 0, onShowNew, announcement, filter, labels, className, density, ...props }, ref) {
94
+ export const ActivityTimeline = /*#__PURE__*/ React.forwardRef(function ActivityTimeline({ items, variant = "feed", groupBy = "none", order, timeZone = "UTC", now, timeMode, loading, empty, hasMore, onLoadMore, newCount = 0, onShowNew, announcement, filter, labels, className, density, ...props }, ref) {
95
95
  const dir = order ?? (variant === "steps" ? "asc" : "desc");
96
96
  const sorted = variant === "steps" && order === undefined ? items : [...items].sort((a, b) => cmp(a.at, b.at) * (dir === "asc" ? 1 : -1));
97
97
  const renderItem = (it, inGroup) => (_jsxs(TimelineItem, { status: it.status, children: [_jsx(TimelineIndicator, { icon: it.icon, avatar: it.avatar, tone: it.tone, status: variant === "steps" ? (it.status ?? "upcoming") : undefined, labels: labels }), _jsxs(TimelineContent, { children: [_jsxs(TimelineTitle, { className: it.status === "upcoming" ? "text-fg-subtle" : undefined, children: [it.actor ? _jsxs("b", { children: [it.actor, " "] }) : null, it.href ? (_jsx("a", { href: it.href, className: "rounded-[2px] underline-offset-2 hover:text-fg hover:underline focus-ring", children: it.title })) : (it.title)] }), variant === "steps" && it.status === "upcoming" ? null : _jsx(TimelineTime, { value: toIsoInstant(it.at), now: now, mode: timeMode ?? (inGroup ? "absolute" : "relative") }), it.body ? _jsx(TimelineBody, { children: it.body }) : null, it.actions ? _jsx(TimelineActions, { children: it.actions }) : null] })] }, it.id));
@@ -65,7 +65,7 @@ export function formatAddress(a, opts = {}) {
65
65
  lines.push(displayNames(locale)?.of(c) ?? c);
66
66
  return lines.map((l) => l?.trim()).filter((l) => !!l);
67
67
  }
68
- const NativeSelect = React.forwardRef(function NativeSelect({ className, size = "md", invalid, children, ...rest }, ref) {
68
+ const NativeSelect = /*#__PURE__*/ React.forwardRef(function NativeSelect({ className, size = "md", invalid, children, ...rest }, ref) {
69
69
  const props = useFieldControl({ ...rest, "aria-invalid": invalid ? true : rest["aria-invalid"] });
70
70
  return (_jsxs("div", { "data-slot": "address-select", className: cn(controlVariants({ size }), "px-0", className), children: [_jsx("select", { ref: ref, ...props, className: cn("h-full w-full min-w-0 cursor-pointer appearance-none rounded-[inherit] bg-transparent ps-3 pe-9 text-[length:inherit] text-fg outline-none disabled:cursor-not-allowed", props.value === "" && "text-fg-subtle"), children: children }), _jsx(ChevronDown, { "aria-hidden": true, className: "pointer-events-none absolute end-3 size-4 text-fg-subtle" })] }));
71
71
  });
@@ -120,7 +120,7 @@ function useRegions(source, level, province) {
120
120
  * <Field label="Province"><RegionSelect source={trAddress} level="province" /></Field>
121
121
  * ```
122
122
  */
123
- export const RegionSelect = React.forwardRef(function RegionSelect({ source, level, province, value, defaultValue, onValueChange, placeholder, labels, disabled, ...rest }, ref) {
123
+ export const RegionSelect = /*#__PURE__*/ React.forwardRef(function RegionSelect({ source, level, province, value, defaultValue, onValueChange, placeholder, labels, disabled, ...rest }, ref) {
124
124
  const t = useLabels("address", addressLabels, labels);
125
125
  const [current, setCurrent] = useControllableState({ value, defaultValue: defaultValue ?? "", onChange: onValueChange, name: "RegionSelect" });
126
126
  const { items } = useRegions(source, level, province);
@@ -140,7 +140,7 @@ const DEFAULT_FIELDS = ["country", "region1", "region2", "line1", "line2", "post
140
140
  * <AddressField legend="Billing address" name="billing" defaultValue={{ country: "TR" }} required={["line1", "region1", "region2"]} />
141
141
  * ```
142
142
  */
143
- export const AddressField = React.forwardRef(function AddressField(props, ref) {
143
+ export const AddressField = /*#__PURE__*/ React.forwardRef(function AddressField(props, ref) {
144
144
  const { value, defaultValue, onValueChange, sources = { TR: trAddress }, countries, defaultCountry, fields = DEFAULT_FIELDS, required = [], layout = "grid", name, legend, hint, errors, readOnly, disabled, size, labels, className, ...rest } = props;
145
145
  const { locale } = useLocale();
146
146
  const t = useLabels("address", addressLabels, labels);
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import { AlertDialog as AlertDialogPrimitive } from "radix-ui";
2
+ import * as AlertDialogPrimitive from "radix-ui/alert-dialog";
3
3
  import { type ButtonProps } from "./button.js";
4
4
  import { type LayerHeaderProps } from "./dialog.js";
5
5
  type Tone = "default" | "danger";
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  import * as React from "react";
4
- import { AlertDialog as AlertDialogPrimitive } from "radix-ui";
4
+ import * as AlertDialogPrimitive from "radix-ui/alert-dialog";
5
5
  import { TriangleAlert } from "lucide-react";
6
6
  import { cn } from "../lib/cn.js";
7
7
  import { useLabels } from "../lib/labels.js";
@@ -12,7 +12,7 @@ import { Button } from "./button.js";
12
12
  import { Field, Input } from "./input.js";
13
13
  import { Alert } from "./alert.js";
14
14
  import { LayerBody, LayerFooter, LayerHeader, LayerPartsProvider } from "./dialog.js";
15
- const AlertDialogContentContext = React.createContext({ tone: "default", actionRef: { current: null } });
15
+ const AlertDialogContentContext = /*#__PURE__*/ React.createContext({ tone: "default", actionRef: { current: null } });
16
16
  /**
17
17
  * Confirms an irreversible or high-stakes action. `role="alertdialog"`; the overlay never closes it.
18
18
  *
@@ -34,7 +34,7 @@ const AlertDialogContentContext = React.createContext({ tone: "default", actionR
34
34
  export const AlertDialog = AlertDialogPrimitive.Root;
35
35
  export const AlertDialogTrigger = AlertDialogPrimitive.Trigger;
36
36
  /** Fixed 420px panel. Below 640px it anchors to the bottom and stacks the buttons, action on top. */
37
- export const AlertDialogContent = React.forwardRef(function AlertDialogContent({ tone = "default", dismissible = true, container, className, children, onEscapeKeyDown, onOpenAutoFocus, onCloseAutoFocus, ...props }, ref) {
37
+ export const AlertDialogContent = /*#__PURE__*/ React.forwardRef(function AlertDialogContent({ tone = "default", dismissible = true, container, className, children, onEscapeKeyDown, onOpenAutoFocus, onCloseAutoFocus, ...props }, ref) {
38
38
  const scope = usePortalContainer();
39
39
  const depth = useLayerDepth() + 1;
40
40
  const actionRef = React.useRef(null);
@@ -82,24 +82,24 @@ export function AlertDialogIcon({ className, children }) {
82
82
  return (_jsx("span", { "aria-hidden": true, className: cn("flex size-10 items-center justify-center rounded-ui tone-danger bg-[color-mix(in_srgb,var(--danger)_12%,transparent)] text-danger [&_svg]:size-5", className), children: children ?? _jsx(TriangleAlert, {}) }));
83
83
  }
84
84
  /** `LayerHeader` that adds the warning icon well when the content is `tone="danger"` (pass `icon={null}` to drop it). */
85
- export const AlertDialogHeader = React.forwardRef(function AlertDialogHeader({ icon, className, ...props }, ref) {
85
+ export const AlertDialogHeader = /*#__PURE__*/ React.forwardRef(function AlertDialogHeader({ icon, className, ...props }, ref) {
86
86
  const { tone } = React.useContext(AlertDialogContentContext);
87
87
  const resolvedIcon = icon === undefined ? (tone === "danger" ? _jsx(AlertDialogIcon, {}) : undefined) : icon;
88
88
  return _jsx(LayerHeader, { ref: ref, icon: resolvedIcon, className: cn("pt-6", className), ...props });
89
89
  });
90
90
  export const AlertDialogBody = LayerBody;
91
91
  /** Footer without the hairline; buttons at the end, stacked on mobile. */
92
- export const AlertDialogFooter = React.forwardRef(function AlertDialogFooter({ className, ...props }, ref) {
92
+ export const AlertDialogFooter = /*#__PURE__*/ React.forwardRef(function AlertDialogFooter({ className, ...props }, ref) {
93
93
  return _jsx(LayerFooter, { ref: ref, className: cn("border-t-0 pt-1 pb-5", className), ...props });
94
94
  });
95
95
  const confirmLabels = { cancel: "Cancel", confirm: "Confirm", typeToConfirm: "Type {text} to confirm", error: "That didn't work. Try again." };
96
96
  /** Closes without acting. Receives initial focus in a danger dialog. Default label "Cancel". */
97
- export const AlertDialogCancel = React.forwardRef(function AlertDialogCancel({ children, labels, variant = "secondary", ...props }, ref) {
97
+ export const AlertDialogCancel = /*#__PURE__*/ React.forwardRef(function AlertDialogCancel({ children, labels, variant = "secondary", ...props }, ref) {
98
98
  const t = useLabels("confirm", confirmLabels, labels);
99
99
  return (_jsx(AlertDialogPrimitive.Cancel, { asChild: true, children: _jsx(Button, { ref: ref, variant: variant, ...props, children: children ?? t("cancel") }) }));
100
100
  });
101
101
  /** Runs the action and closes. `variant` follows the content tone (`danger` or `primary`). */
102
- export const AlertDialogAction = React.forwardRef(function AlertDialogAction({ children, labels, variant, keepOpen, onClick, ...props }, ref) {
102
+ export const AlertDialogAction = /*#__PURE__*/ React.forwardRef(function AlertDialogAction({ children, labels, variant, keepOpen, onClick, ...props }, ref) {
103
103
  const { tone, actionRef } = React.useContext(AlertDialogContentContext);
104
104
  const t = useLabels("confirm", confirmLabels, labels);
105
105
  const setRefs = React.useCallback((node) => {
@@ -155,7 +155,7 @@ export function ConfirmDialog({ open, onResult, title, description, tone = "defa
155
155
  }
156
156
  } }) })) : null] })) : null, _jsxs(AlertDialogFooter, { children: [_jsx(AlertDialogCancel, { disabled: busy, children: cancelLabel ?? t("cancel") }), _jsx(AlertDialogAction, { keepOpen: true, disabled: !matches, loading: busy, onClick: () => void run(), children: confirmLabel ?? t("confirm") })] })] }) }));
157
157
  }
158
- const ConfirmContext = React.createContext(null);
158
+ const ConfirmContext = /*#__PURE__*/ React.createContext(null);
159
159
  /**
160
160
  * Provides `useConfirm()` to its subtree and renders the one shared confirmation dialog.
161
161
  * App shell includes it; mount it yourself at the app root otherwise.
@@ -5,7 +5,7 @@ import { CircleAlert, CircleCheck, Info, Lightbulb, TriangleAlert, X } from "luc
5
5
  import { cn } from "../lib/cn.js";
6
6
  import { useLabels } from "../lib/labels.js";
7
7
  import { IconButton } from "./button.js";
8
- export const alertVariants = cva([
8
+ export const alertVariants = /*#__PURE__*/ cva([
9
9
  "vui-alert relative grid grid-cols-[auto_minmax(0,1fr)_auto] items-start text-fg",
10
10
  // Tinted surface + hairline in the tone colour; body text stays --fg for contrast.
11
11
  "[--alert-tone:var(--tone)]",
@@ -56,7 +56,7 @@ const alertLabels = { dismiss: "Dismiss" };
56
56
  *
57
57
  * Critical information must not live only in a toast — show it here too.
58
58
  */
59
- export const Alert = React.forwardRef(function Alert({ tone, variant, size, title, icon, actions, onDismiss, dismissLabel, live, className, children, ...props }, ref) {
59
+ export const Alert = /*#__PURE__*/ React.forwardRef(function Alert({ tone, variant, size, title, icon, actions, onDismiss, dismissLabel, live, className, children, ...props }, ref) {
60
60
  const t = tone ?? "neutral";
61
61
  const DefaultIcon = defaultIcons[t];
62
62
  const iconNode = icon === false ? null : (icon ?? _jsx(DefaultIcon, { "aria-hidden": true }));
@@ -33,9 +33,9 @@ const appShellLabels = {
33
33
  noAppsDescription: "Your account doesn't have access to any app yet. Ask an administrator to invite you.",
34
34
  pageChanged: "{title}",
35
35
  };
36
- const AppShellContext = React.createContext(null);
36
+ const AppShellContext = /*#__PURE__*/ React.createContext(null);
37
37
  /** Rail state as resolved by the layout (preference or width). */
38
- const CollapsedContext = React.createContext(false);
38
+ const CollapsedContext = /*#__PURE__*/ React.createContext(false);
39
39
  function writeCookie(v) {
40
40
  try {
41
41
  document.cookie = `${SIDEBAR_COOKIE}=${v ? "1" : "0"}; path=/; max-age=31536000; samesite=lax`;
@@ -226,7 +226,7 @@ export function AppShellBreadcrumb({ includeApp = true, className }) {
226
226
  * </AppShellProvider>
227
227
  * ```
228
228
  */
229
- export const AppShell = React.forwardRef(function AppShell({ sidebar, topbar, banner, notifications, actions, user, badges, sidebarFooter, appSwitcherFooter, layout = "sidebar", loading, announceRouteChanges = true, height = "screen", globals = true, labels, className, children, ...props }, ref) {
229
+ export const AppShell = /*#__PURE__*/ React.forwardRef(function AppShell({ sidebar, topbar, banner, notifications, actions, user, badges, sidebarFooter, appSwitcherFooter, layout = "sidebar", loading, announceRouteChanges = true, height = "screen", globals = true, labels, className, children, ...props }, ref) {
230
230
  const ctx = React.useContext(AppShellContext);
231
231
  if (!ctx)
232
232
  throw new Error("AppShell must be used inside <AppShellProvider>.");
@@ -0,0 +1,26 @@
1
+ import * as React from "react";
2
+ import { type VariantProps } from "class-variance-authority";
3
+ /** `"16/9"`, `"4/3"`, `"1/1"`… or a number (`1.5`). */
4
+ export type AspectRatioValue = `${number}/${number}` | number;
5
+ /** `"16/9"` → 1.777…, `"16:9"` → 1.777…, `1.5` → 1.5. Invalid values return `undefined`. */
6
+ export declare function parseAspectRatio(ratio: AspectRatioValue | string | undefined): number | undefined;
7
+ export declare const aspectRatioVariants: (props?: ({
8
+ rounded?: "ui" | "ui-lg" | "full" | "none" | null | undefined;
9
+ fit?: "fill" | "contain" | "cover" | null | undefined;
10
+ tone?: "inset" | "none" | null | undefined;
11
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
12
+ export interface AspectRatioProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof aspectRatioVariants> {
13
+ /** Width ÷ height. `"16/9"` (default), `"4/3"`, `"1/1"`, `"21/9"` or a number. */
14
+ ratio?: AspectRatioValue;
15
+ }
16
+ /**
17
+ * Keeps a box at a fixed ratio whatever its width, and stretches the direct child to fill it —
18
+ * an iframe, a video, a map, an image or any element. Pure CSS (`aspect-ratio`), server-safe.
19
+ *
20
+ * ```tsx
21
+ * <AspectRatio ratio="16/9" rounded="ui-lg">
22
+ * <iframe src="https://www.youtube-nocookie.com/embed/…" title="Product tour" />
23
+ * </AspectRatio>
24
+ * ```
25
+ */
26
+ export declare const AspectRatio: React.ForwardRefExoticComponent<AspectRatioProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,42 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import { cva } from "class-variance-authority";
4
+ import { cn } from "../lib/cn.js";
5
+ /** `"16/9"` → 1.777…, `"16:9"` → 1.777…, `1.5` → 1.5. Invalid values return `undefined`. */
6
+ export function parseAspectRatio(ratio) {
7
+ if (typeof ratio === "number")
8
+ return Number.isFinite(ratio) && ratio > 0 ? ratio : undefined;
9
+ if (!ratio)
10
+ return undefined;
11
+ const [w, h] = ratio.split(/[/:]/).map((s) => Number(s.trim()));
12
+ if (w && h && w > 0 && h > 0)
13
+ return w / h;
14
+ const n = Number(ratio);
15
+ return Number.isFinite(n) && n > 0 ? n : undefined;
16
+ }
17
+ export const aspectRatioVariants = /*#__PURE__*/ cva("relative isolate block w-full overflow-hidden", {
18
+ variants: {
19
+ rounded: { none: "", ui: "rounded-ui", "ui-lg": "rounded-ui-lg", full: "rounded-full" },
20
+ /** How a direct `img` / `video` child fills the box. */
21
+ fit: { cover: "[&>img]:object-cover [&>video]:object-cover", contain: "[&>img]:object-contain [&>video]:object-contain", fill: "[&>img]:object-fill [&>video]:object-fill" },
22
+ /** `inset`: a `surface-2` backdrop (letterboxing for `contain`, a frame while an iframe loads). */
23
+ tone: { none: "", inset: "bg-surface-2" },
24
+ },
25
+ defaultVariants: { rounded: "none", fit: "cover", tone: "none" },
26
+ });
27
+ /**
28
+ * Keeps a box at a fixed ratio whatever its width, and stretches the direct child to fill it —
29
+ * an iframe, a video, a map, an image or any element. Pure CSS (`aspect-ratio`), server-safe.
30
+ *
31
+ * ```tsx
32
+ * <AspectRatio ratio="16/9" rounded="ui-lg">
33
+ * <iframe src="https://www.youtube-nocookie.com/embed/…" title="Product tour" />
34
+ * </AspectRatio>
35
+ * ```
36
+ */
37
+ export const AspectRatio = /*#__PURE__*/ React.forwardRef(function AspectRatio({ ratio = "16/9", rounded, fit, tone, className, style, children, ...props }, ref) {
38
+ const value = parseAspectRatio(ratio) ?? 16 / 9;
39
+ return (_jsx("div", { ref: ref, "data-slot": "aspect-ratio", className: cn(aspectRatioVariants({ rounded, fit, tone }),
40
+ // The child fills the box; iframes lose their default border.
41
+ "[&>*]:absolute [&>*]:inset-0 [&>*]:size-full [&>iframe]:border-0", className), style: { aspectRatio: String(value), ...style }, ...props, children: children }));
42
+ });
@@ -110,7 +110,7 @@ export function AttachmentName({ name, className, ...props }) {
110
110
  /* ------------------------------------------------------------------ */
111
111
  /* AttachmentList */
112
112
  /* ------------------------------------------------------------------ */
113
- const listVariants = cva("", {
113
+ const listVariants = /*#__PURE__*/ cva("", {
114
114
  variants: {
115
115
  layout: {
116
116
  list: "flex flex-col divide-y divide-line overflow-hidden rounded-ui border border-line",
@@ -131,7 +131,7 @@ const listVariants = cva("", {
131
131
  * <AttachmentList layout="chips" items={commentFiles} readOnly />
132
132
  * ```
133
133
  */
134
- export const AttachmentList = React.forwardRef(function AttachmentList({ items, layout = "list", size = "md", onPreview, onDownload, onRemove, onRetry, onAddFiles, accept, uploadSlot, readOnly, empty, labels, className, "aria-label": ariaLabel, ...props }, ref) {
134
+ export const AttachmentList = /*#__PURE__*/ React.forwardRef(function AttachmentList({ items, layout = "list", size = "md", onPreview, onDownload, onRemove, onRetry, onAddFiles, accept, uploadSlot, readOnly, empty, labels, className, "aria-label": ariaLabel, ...props }, ref) {
135
135
  const t = useLabels("attachments", attachmentLabels, labels);
136
136
  const [removing, setRemoving] = React.useState(() => new Set());
137
137
  const inputRef = React.useRef(null);
@@ -96,7 +96,7 @@ export function filterAuditEvents(events, filters, locale, actionLabels) {
96
96
  * />
97
97
  * ```
98
98
  */
99
- export const AuditLog = React.forwardRef(function AuditLog({ events, rowCount, actionLabels, changeFields, filters: filtersProp, defaultFilters, onFiltersChange, manualFiltering, showFilters = true, toolbar, notice, onExport, hasMore, onLoadMore, loading, height = "32rem", virtualizeAfter = 80, variant = "table", now, labels, className, ...props }, ref) {
99
+ export const AuditLog = /*#__PURE__*/ React.forwardRef(function AuditLog({ events, rowCount, actionLabels, changeFields, filters: filtersProp, defaultFilters, onFiltersChange, manualFiltering, showFilters = true, toolbar, notice, onExport, hasMore, onLoadMore, loading, height = "32rem", virtualizeAfter = 80, variant = "table", now, labels, className, ...props }, ref) {
100
100
  const t = useLabels("auditLog", auditLogLabels, labels);
101
101
  const f = useFormat();
102
102
  const { locale } = useLocale();
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import { Avatar as AvatarPrimitive } from "radix-ui";
2
+ import * as AvatarPrimitive from "radix-ui/avatar";
3
3
  declare const avatarLabels: {
4
4
  online: string;
5
5
  away: string;
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import * as React from "react";
4
- import { Avatar as AvatarPrimitive } from "radix-ui";
4
+ import * as AvatarPrimitive from "radix-ui/avatar";
5
5
  import { cva } from "class-variance-authority";
6
6
  import { cn } from "../lib/cn.js";
7
7
  import { useLabels } from "../lib/labels.js";
@@ -16,7 +16,7 @@ const avatarLabels = {
16
16
  overflow: "+{count}",
17
17
  more: "{count, plural, one {# more person} other {# more people}}",
18
18
  };
19
- export const avatarVariants = cva("relative inline-flex shrink-0 select-none items-center justify-center align-middle font-medium leading-none tracking-[0.01em]", {
19
+ export const avatarVariants = /*#__PURE__*/ cva("relative inline-flex shrink-0 select-none items-center justify-center align-middle font-medium leading-none tracking-[0.01em]", {
20
20
  variants: {
21
21
  size: {
22
22
  xs: "size-5 text-[8.5px]",
@@ -61,20 +61,20 @@ export function avatarColor(seed) {
61
61
  color: `color-mix(in oklch, ${c} 60%, var(--fg))`,
62
62
  };
63
63
  }
64
- const AvatarGroupContext = React.createContext(null);
64
+ const AvatarGroupContext = /*#__PURE__*/ React.createContext(null);
65
65
  /** Root of the composite API: `<AvatarRoot><AvatarImage/><AvatarFallback/></AvatarRoot>`. */
66
- export const AvatarRoot = React.forwardRef(function AvatarRoot({ size, shape, className, ...props }, ref) {
66
+ export const AvatarRoot = /*#__PURE__*/ React.forwardRef(function AvatarRoot({ size, shape, className, ...props }, ref) {
67
67
  const group = React.useContext(AvatarGroupContext);
68
68
  const s = size ?? group?.size ?? "md";
69
69
  const sh = shape ?? group?.shape ?? "circle";
70
70
  return (_jsx(AvatarPrimitive.Root, { ref: ref, "data-slot": "avatar", "data-size": s, "data-shape": sh, className: cn(avatarVariants({ size: s, shape: sh }), group && "ring-2 ring-(--avatar-ring)", className), ...props }));
71
71
  });
72
72
  /** The photo. Pass `asChild` to render a framework image (Next `<Image>`). */
73
- export const AvatarImage = React.forwardRef(function AvatarImage({ className, ...props }, ref) {
73
+ export const AvatarImage = /*#__PURE__*/ React.forwardRef(function AvatarImage({ className, ...props }, ref) {
74
74
  return _jsx(AvatarPrimitive.Image, { ref: ref, "data-slot": "avatar-image", className: cn("size-full rounded-[inherit] object-cover", className), ...props });
75
75
  });
76
76
  /** Shown while the image loads (after `delayMs`), when it fails, or when there is none. */
77
- export const AvatarFallback = React.forwardRef(function AvatarFallback({ className, ...props }, ref) {
77
+ export const AvatarFallback = /*#__PURE__*/ React.forwardRef(function AvatarFallback({ className, ...props }, ref) {
78
78
  return (_jsx(AvatarPrimitive.Fallback, { ref: ref, "data-slot": "avatar-fallback", className: cn("flex size-full items-center justify-center rounded-[inherit] bg-selected text-fg-muted [&_svg]:size-[55%]", className), ...props }));
79
79
  });
80
80
  /**
@@ -87,7 +87,7 @@ export const AvatarFallback = React.forwardRef(function AvatarFallback({ classNa
87
87
  * <Avatar name="Northwind Traders" shape="square" size="lg" />
88
88
  * ```
89
89
  */
90
- export const Avatar = React.forwardRef(function Avatar({ src, name, size, shape, status, statusLabel, fallback, delayMs = 300, neutral, labels, className, style, ...props }, ref) {
90
+ export const Avatar = /*#__PURE__*/ React.forwardRef(function Avatar({ src, name, size, shape, status, statusLabel, fallback, delayMs = 300, neutral, labels, className, style, ...props }, ref) {
91
91
  const t = useLabels("avatar", avatarLabels, labels);
92
92
  const { locale } = useLocale();
93
93
  const group = React.useContext(AvatarGroupContext);
@@ -114,7 +114,7 @@ const overlap = {
114
114
  * </AvatarGroup>
115
115
  * ```
116
116
  */
117
- export const AvatarGroup = React.forwardRef(function AvatarGroup({ max = 4, total, size = "md", shape = "circle", onOverflowClick, spacing = "md", labels, className, children, ...props }, ref) {
117
+ export const AvatarGroup = /*#__PURE__*/ React.forwardRef(function AvatarGroup({ max = 4, total, size = "md", shape = "circle", onOverflowClick, spacing = "md", labels, className, children, ...props }, ref) {
118
118
  const t = useLabels("avatar", avatarLabels, labels);
119
119
  const items = React.Children.toArray(children).filter(React.isValidElement);
120
120
  const shown = items.slice(0, Math.max(0, max));
@@ -25,7 +25,7 @@ export const backupCodesLabels = {
25
25
  * <BackupCodes codes={codes} used={["4K7Q-PX2M"]} onRegenerate={regenerate} />
26
26
  * ```
27
27
  */
28
- export const BackupCodes = React.forwardRef(function BackupCodes({ codes, used = [], title, filename = "backup-codes.txt", fileNote, onCopy, onDownload, onRegenerate, regenerating, labels, className, ...props }, ref) {
28
+ export const BackupCodes = /*#__PURE__*/ React.forwardRef(function BackupCodes({ codes, used = [], title, filename = "backup-codes.txt", fileNote, onCopy, onDownload, onRegenerate, regenerating, labels, className, ...props }, ref) {
29
29
  const t = useLabels("backupCodes", backupCodesLabels, labels);
30
30
  const f = useFormat();
31
31
  const [copied, setCopied] = React.useState(false);
@@ -1,10 +1,10 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
- import { Slot } from "radix-ui";
3
+ import * as Slot from "radix-ui/slot";
4
4
  import { cva } from "class-variance-authority";
5
5
  import { cn } from "../lib/cn.js";
6
6
  import { ChipRemoveButton, LocaleCount } from "../lib/islands.js";
7
- export const badgeVariants = cva("inline-flex shrink-0 items-center gap-1 whitespace-nowrap font-medium leading-none [&_svg]:size-3 [&_svg]:shrink-0", {
7
+ export const badgeVariants = /*#__PURE__*/ cva("inline-flex shrink-0 items-center gap-1 whitespace-nowrap font-medium leading-none [&_svg]:size-3 [&_svg]:shrink-0", {
8
8
  variants: {
9
9
  tone: {
10
10
  neutral: "bg-selected text-fg-muted",
@@ -47,7 +47,7 @@ export const badgeVariants = cva("inline-flex shrink-0 items-center gap-1 whites
47
47
  *
48
48
  * No CSS `uppercase` — it breaks Turkish (i → I) without the right `lang`; use `upperText()`.
49
49
  */
50
- export const Badge = React.forwardRef(function Badge({ className, tone, size, shape, dot, color, count, max = 99, onRemove, removeLabel, disabled, asChild, children, style, ...props }, ref) {
50
+ export const Badge = /*#__PURE__*/ React.forwardRef(function Badge({ className, tone, size, shape, dot, color, count, max = 99, onRemove, removeLabel, disabled, asChild, children, style, ...props }, ref) {
51
51
  const removable = Boolean(onRemove);
52
52
  const Comp = asChild && !removable ? Slot.Root : "span";
53
53
  const classes = cn(badgeVariants({ tone: color ? "custom" : tone, size, shape, interactive: asChild && !removable ? true : undefined }), count !== undefined && "tabular justify-center", count !== undefined && (size === "lg" ? "min-w-7 px-2" : size === "md" ? "min-w-6 px-2" : "min-w-5 px-1.5"), removable && "pe-1.5", disabled && "pointer-events-none opacity-50", className);