beez-ui 2.7.1 → 3.0.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 (110) hide show
  1. package/CHANGELOG.md +78 -0
  2. package/README.md +43 -13
  3. package/THIRD_PARTY_NOTICES.md +1 -1
  4. package/dist/components/account-menu.d.ts +4 -3
  5. package/dist/components/account-menu.js +63 -54
  6. package/dist/components/alert.d.ts +15 -15
  7. package/dist/components/alert.js +289 -270
  8. package/dist/components/animated-theme-toggler.js +1 -1
  9. package/dist/components/avatar.d.ts +56 -31
  10. package/dist/components/avatar.js +394 -277
  11. package/dist/components/badge.d.ts +8 -28
  12. package/dist/components/badge.js +55 -108
  13. package/dist/components/calendar.d.ts +36 -26
  14. package/dist/components/calendar.js +132 -1227
  15. package/dist/components/card.d.ts +36 -25
  16. package/dist/components/card.js +895 -72
  17. package/dist/components/carousel.d.ts +63 -47
  18. package/dist/components/carousel.js +496 -777
  19. package/dist/components/data-table.d.ts +5 -4
  20. package/dist/components/data-table.js +7 -6
  21. package/dist/components/dialog-surface.d.ts +23 -1
  22. package/dist/components/dialog-surface.js +99 -3
  23. package/dist/components/dialog.d.ts +80 -45
  24. package/dist/components/dialog.js +258 -503
  25. package/dist/components/dropdown-menu.d.ts +56 -73
  26. package/dist/components/dropdown-menu.js +79 -714
  27. package/dist/components/field.d.ts +3 -1
  28. package/dist/components/field.js +49 -39
  29. package/dist/components/filter-presets-bar.js +2 -2
  30. package/dist/components/filter-query-bar.js +1 -1
  31. package/dist/components/hover-card.d.ts +42 -41
  32. package/dist/components/hover-card.js +57 -483
  33. package/dist/components/pagination.d.ts +53 -31
  34. package/dist/components/pagination.js +176 -412
  35. package/dist/components/popover.d.ts +11 -23
  36. package/dist/components/popover.js +19 -304
  37. package/dist/components/{alert-dialog.d.ts → primitives/alert-dialog.d.ts} +17 -5
  38. package/dist/components/{alert-dialog.js → primitives/alert-dialog.js} +102 -54
  39. package/dist/components/primitives/avatar.d.ts +46 -0
  40. package/dist/components/primitives/avatar.js +268 -0
  41. package/dist/components/primitives/calendar.d.ts +37 -0
  42. package/dist/components/primitives/calendar.js +1250 -0
  43. package/dist/components/primitives/carousel.d.ts +106 -0
  44. package/dist/components/primitives/carousel.js +928 -0
  45. package/dist/components/primitives/dialog.d.ts +62 -0
  46. package/dist/components/primitives/dialog.js +490 -0
  47. package/dist/components/primitives/dropdown-menu-items.d.ts +59 -0
  48. package/dist/components/primitives/dropdown-menu-items.js +265 -0
  49. package/dist/components/primitives/dropdown-menu.d.ts +64 -0
  50. package/dist/components/primitives/dropdown-menu.js +557 -0
  51. package/dist/components/primitives/hover-card.d.ts +50 -0
  52. package/dist/components/primitives/hover-card.js +507 -0
  53. package/dist/components/primitives/pagination.d.ts +65 -0
  54. package/dist/components/primitives/pagination.js +373 -0
  55. package/dist/components/primitives/popover.d.ts +22 -0
  56. package/dist/components/primitives/popover.js +213 -0
  57. package/dist/components/primitives/select.d.ts +36 -0
  58. package/dist/components/primitives/select.js +407 -0
  59. package/dist/components/primitives/tooltip.d.ts +30 -0
  60. package/dist/components/primitives/tooltip.js +277 -0
  61. package/dist/components/radio-group.d.ts +30 -17
  62. package/dist/components/radio-group.js +266 -315
  63. package/dist/components/rich-link-editor.js +1 -1
  64. package/dist/components/select.d.ts +51 -42
  65. package/dist/components/select.js +163 -495
  66. package/dist/components/skeleton.d.ts +16 -15
  67. package/dist/components/skeleton.js +99 -205
  68. package/dist/components/split-button.js +1 -1
  69. package/dist/components/switch.d.ts +3 -6
  70. package/dist/components/switch.js +163 -170
  71. package/dist/components/tabs.d.ts +3 -11
  72. package/dist/components/tabs.js +61 -75
  73. package/dist/components/themed-toaster.d.ts +1 -1
  74. package/dist/components/themed-toaster.js +1 -1
  75. package/dist/components/toaster.d.ts +1 -1
  76. package/dist/components/toaster.js +1 -1
  77. package/dist/components/tooltip.d.ts +36 -31
  78. package/dist/components/tooltip.js +44 -284
  79. package/dist/constants/alert.d.ts +5 -1
  80. package/dist/constants/alert.js +5 -1
  81. package/dist/constants/avatar.d.ts +29 -1
  82. package/dist/constants/avatar.js +25 -0
  83. package/dist/constants/calendar.d.ts +12 -0
  84. package/dist/constants/calendar.js +12 -0
  85. package/dist/constants/card.d.ts +23 -0
  86. package/dist/constants/card.js +20 -0
  87. package/dist/constants/carousel.d.ts +31 -13
  88. package/dist/constants/carousel.js +32 -11
  89. package/dist/constants/dialog.d.ts +6 -1
  90. package/dist/constants/dialog.js +5 -1
  91. package/dist/constants/dropdown-menu.d.ts +2 -2
  92. package/dist/constants/dropdown-menu.js +2 -2
  93. package/dist/constants/pagination.d.ts +13 -2
  94. package/dist/constants/pagination.js +13 -2
  95. package/dist/constants/select.d.ts +4 -2
  96. package/dist/constants/select.js +4 -2
  97. package/dist/constants/switch.d.ts +5 -16
  98. package/dist/constants/switch.js +6 -14
  99. package/dist/hooks/use-today.d.ts +7 -0
  100. package/dist/hooks/use-today.js +50 -0
  101. package/dist/hooks.d.ts +1 -0
  102. package/dist/hooks.js +1 -0
  103. package/dist/index.d.ts +0 -1
  104. package/dist/index.js +0 -1
  105. package/dist/motion/glide-indicator.d.ts +1 -1
  106. package/dist/motion/glide-indicator.js +1 -1
  107. package/dist/motion/presence.d.ts +0 -1
  108. package/dist/motion/presence.js +0 -1
  109. package/dist/styles.css +1 -1
  110. package/package.json +1 -6
@@ -1,41 +1,21 @@
1
1
  import type { ComponentProps, ReactNode } from "react";
2
- /** shadcn-compatible visual variants, each drawn with one of Arc's tones. */
3
- export type BadgeVariant = "default" | "secondary" | "destructive" | "outline" | "ghost" | "link";
4
- /** Arc's semantic tones; a `tone` wins over the tone implied by `variant`. */
2
+ /** Arc's semantic tones. */
5
3
  export type BadgeTone = "neutral" | "success" | "info" | "warning" | "danger";
6
4
  /** Arc's badge heights: 26px (`md`) and 22px (`sm`). */
7
5
  export type BadgeSize = "sm" | "md";
8
- /** Options of `badgeVariants`, for styling links or other elements as badges. */
9
- export type BadgeVariantsOptions = {
10
- variant?: BadgeVariant | null;
11
- tone?: BadgeTone | null;
12
- size?: BadgeSize | null;
13
- className?: string;
14
- };
15
- /**
16
- * Arc's badge classes for any element. Without a `tone`, the tone implied by `variant` is used, as in `Badge`.
17
- * @param options - Variant, tone, size and extra classes.
18
- * @returns The class list.
19
- */
20
- declare function badgeVariants({ variant, tone, size, className }?: BadgeVariantsOptions): string;
21
6
  export type BadgeProps = ComponentProps<"span"> & {
22
- /** shadcn-compatible variant, drawn with an Arc tone: default (info), secondary, outline and ghost (neutral),
23
- * destructive (danger) and link (info, underlined on hover). */
24
- variant?: BadgeVariant | null;
25
- /** Arc's semantic tone; overrides the tone implied by `variant`. */
7
+ /** Arc's semantic tone: `neutral` (default), `success`, `info`, `warning` or `danger`. */
26
8
  tone?: BadgeTone;
27
9
  /** Arc's height: `md` (26px, default) or `sm` (22px). */
28
10
  size?: BadgeSize;
29
- /** A leading icon tinted with the tone, hidden from assistive technology. */
11
+ /** A leading icon tinted with the tone, hidden from assistive technology. A different icon component crossfades in. */
30
12
  icon?: ReactNode;
31
- /** Renders the child element instead of a span, merging the badge props into it. Text and icon swaps are off. */
32
- asChild?: boolean;
33
13
  };
34
14
  /**
35
- * A small label for status, category or metadata. Text children swap in place with Arc's motion and the pill springs
36
- * to the new width; other children render as they are.
37
- * @param props - Variant, tone, size, optional icon and native span attributes.
15
+ * A small label for status, category or metadata. String or number children swap in place with Arc's motion and the
16
+ * pill springs to the new width; other children render as they are.
17
+ * @param props - Tone, size, optional icon and native span attributes.
38
18
  * @returns The badge.
39
19
  */
40
- declare function Badge({ className, variant, tone, size, icon, asChild, children, ...props }: BadgeProps): import("react").JSX.Element;
41
- export { Badge, badgeVariants };
20
+ declare function Badge({ className, tone, size, icon, children, ...props }: BadgeProps): import("react").JSX.Element;
21
+ export { Badge };
@@ -3,12 +3,11 @@ import { c as _c } from "react/compiler-runtime";
3
3
  /**
4
4
  * Arc's Badge (https://uiarc.dev, MIT License, see THIRD_PARTY_NOTICES.md): a small pill for status, category or
5
5
  * metadata on Arc's tones and tokens. A new text label rises in while the pill springs to its new width, and a new
6
- * icon crossfades in place. The shadcn variants are kept and mapped onto Arc's tones.
6
+ * icon crossfades in place. The API is Arc's: `tone`, `size`, `icon` and `children`.
7
7
  */
8
8
  import { isValidElement, useRef } from "react";
9
9
  import { cva } from "class-variance-authority";
10
10
  import { AnimatePresence, motion, useIsPresent } from "motion/react";
11
- import { Slot } from "radix-ui";
12
11
  import { BADGE_LABEL_OFFSET_EM } from "../constants/badge.js";
13
12
  import { usePrefersReducedMotion } from "../hooks/use-prefers-reduced-motion.js";
14
13
  import { cn } from "../lib/utils.js";
@@ -17,58 +16,23 @@ import { ARC_ICON_ENTER, ARC_ICON_EXIT, ARC_ICON_TRANSITION, ARC_REDUCED_EXIT, A
17
16
  import { MotionSlot } from "../motion/motion-slot.js";
18
17
  import { useMorphWidth } from "../motion/use-morph-width.js";
19
18
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
20
- /** The Arc tone each shadcn variant is drawn with when no explicit `tone` is passed. */
21
- const VARIANT_TONE = {
22
- default: "info",
23
- secondary: "neutral",
24
- destructive: "danger",
25
- outline: "neutral",
26
- ghost: "neutral",
27
- link: "info"
28
- };
29
19
  /**
30
20
  * Arc's badge recipe. Each tone sets the pill's colour roles as custom properties, so hover can mix the tone into the
31
- * border and fill; variants only adjust the fill and border afterwards. Hover answers on fine pointers only.
21
+ * border and fill. Hover answers on fine pointers only.
32
22
  */
33
- const badgeRecipe = cva("group/badge inline-flex w-fit shrink-0 items-center justify-center overflow-clip rounded-(--radius-pill) border border-(--badge-border) bg-(--badge-background) leading-none font-medium tracking-[-.01em] whitespace-nowrap text-(--badge-foreground) transition-[border-color,background-color,color] duration-(--duration-standard) ease-(--ease-standard) motion-reduce:duration-(--duration-instant) hover-fine:border-[color-mix(in_oklab,var(--badge-color)_32%,var(--border))] hover-fine:bg-[color-mix(in_oklab,var(--badge-color)_10%,var(--surface))] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-danger [&>svg]:pointer-events-none [&>svg]:size-3! [&>svg]:text-(--badge-color)", {
34
- variants: {
35
- tone: {
36
- neutral: "[--badge-background:var(--surface-muted)] [--badge-border:var(--border)] [--badge-color:var(--text-secondary)] [--badge-foreground:var(--text-secondary)]",
37
- success: "[--badge-background:color-mix(in_oklab,var(--success)_10%,var(--surface))] [--badge-border:color-mix(in_oklab,var(--success)_25%,var(--border))] [--badge-color:var(--success)] [--badge-foreground:var(--success)]",
38
- info: "[--badge-background:var(--accent-subtle)] [--badge-border:color-mix(in_oklab,var(--accent)_24%,var(--border))] [--badge-color:var(--accent)] [--badge-foreground:var(--accent-strong)]",
39
- warning: "[--badge-background:color-mix(in_oklab,var(--warning)_11%,var(--surface))] [--badge-border:color-mix(in_oklab,var(--warning)_27%,var(--border))] [--badge-color:var(--warning)] [--badge-foreground:var(--warning)]",
40
- danger: "[--badge-background:color-mix(in_oklab,var(--danger)_10%,var(--surface))] [--badge-border:color-mix(in_oklab,var(--danger)_26%,var(--border))] [--badge-color:var(--danger)] [--badge-foreground:var(--danger)]"
41
- },
42
- variant: {
43
- default: "",
44
- secondary: "",
45
- destructive: "",
46
- outline: "[--badge-background:var(--surface)] [--badge-foreground:var(--foreground)]",
47
- ghost: "[--badge-background:transparent] [--badge-border:transparent]",
48
- link: "[--badge-background:transparent] [--badge-border:transparent] underline-offset-4 hover-fine:border-transparent hover-fine:bg-transparent hover-fine:underline"
49
- },
50
- size: {
51
- sm: "min-h-[22px] gap-1 px-2 text-[11px]",
52
- md: "min-h-[26px] gap-[5px] px-2.5 text-xs"
53
- }
23
+ const badgeRecipe = cva("group/badge inline-flex w-fit shrink-0 items-center justify-center overflow-clip rounded-(--radius-pill) border border-(--badge-border) bg-(--badge-background) leading-none font-medium tracking-[-.01em] whitespace-nowrap text-(--badge-foreground) transition-[border-color,background-color,color] duration-(--duration-standard) ease-(--ease-standard) motion-reduce:duration-(--duration-instant) hover-fine:border-[color-mix(in_oklab,var(--badge-color)_32%,var(--border))] hover-fine:bg-[color-mix(in_oklab,var(--badge-color)_10%,var(--surface))] aria-invalid:border-danger [&>svg]:pointer-events-none [&>svg]:size-3! [&>svg]:text-(--badge-color)", { variants: {
24
+ tone: {
25
+ neutral: "[--badge-background:var(--surface-muted)] [--badge-border:var(--border)] [--badge-color:var(--text-secondary)] [--badge-foreground:var(--text-secondary)]",
26
+ success: "[--badge-background:color-mix(in_oklab,var(--success)_10%,var(--surface))] [--badge-border:color-mix(in_oklab,var(--success)_25%,var(--border))] [--badge-color:var(--success)] [--badge-foreground:var(--success)]",
27
+ info: "[--badge-background:var(--accent-subtle)] [--badge-border:color-mix(in_oklab,var(--accent)_24%,var(--border))] [--badge-color:var(--accent)] [--badge-foreground:var(--accent-strong)]",
28
+ warning: "[--badge-background:color-mix(in_oklab,var(--warning)_11%,var(--surface))] [--badge-border:color-mix(in_oklab,var(--warning)_27%,var(--border))] [--badge-color:var(--warning)] [--badge-foreground:var(--warning)]",
29
+ danger: "[--badge-background:color-mix(in_oklab,var(--danger)_10%,var(--surface))] [--badge-border:color-mix(in_oklab,var(--danger)_26%,var(--border))] [--badge-color:var(--danger)] [--badge-foreground:var(--danger)]"
54
30
  },
55
- defaultVariants: {
56
- variant: "default",
57
- size: "md"
31
+ size: {
32
+ sm: "min-h-[22px] gap-1 px-2 text-[11px]",
33
+ md: "min-h-[26px] gap-[5px] px-2.5 text-xs"
58
34
  }
59
- });
60
- /**
61
- * Arc's badge classes for any element. Without a `tone`, the tone implied by `variant` is used, as in `Badge`.
62
- * @param options - Variant, tone, size and extra classes.
63
- * @returns The class list.
64
- */
65
- function badgeVariants({ variant, tone, size, className } = {}) {
66
- return cn(badgeRecipe({
67
- tone: tone ?? VARIANT_TONE[variant ?? "default"],
68
- variant,
69
- size
70
- }), className);
71
- }
35
+ } });
72
36
  /** A new label rises out of a soft blur; the old one lifts away faster. */
73
37
  const labelEnter = {
74
38
  opacity: 0,
@@ -243,23 +207,21 @@ function BadgeIcon(t0) {
243
207
  return t4;
244
208
  }
245
209
  /**
246
- * A small label for status, category or metadata. Text children swap in place with Arc's motion and the pill springs
247
- * to the new width; other children render as they are.
248
- * @param props - Variant, tone, size, optional icon and native span attributes.
210
+ * A small label for status, category or metadata. String or number children swap in place with Arc's motion and the
211
+ * pill springs to the new width; other children render as they are.
212
+ * @param props - Tone, size, optional icon and native span attributes.
249
213
  * @returns The badge.
250
214
  */
251
215
  function Badge(t0) {
252
- const $ = _c(28);
216
+ const $ = _c(22);
253
217
  let children;
254
218
  let className;
255
219
  let icon;
256
220
  let props;
257
221
  let t1;
258
222
  let t2;
259
- let t3;
260
- let tone;
261
223
  if ($[0] !== t0) {
262
- ({className, variant: t1, tone, size: t2, icon, asChild: t3, children, ...props} = t0);
224
+ ({className, tone: t1, size: t2, icon, children, ...props} = t0);
263
225
  $[0] = t0;
264
226
  $[1] = children;
265
227
  $[2] = className;
@@ -267,8 +229,6 @@ function Badge(t0) {
267
229
  $[4] = props;
268
230
  $[5] = t1;
269
231
  $[6] = t2;
270
- $[7] = t3;
271
- $[8] = tone;
272
232
  } else {
273
233
  children = $[1];
274
234
  className = $[2];
@@ -276,20 +236,14 @@ function Badge(t0) {
276
236
  props = $[4];
277
237
  t1 = $[5];
278
238
  t2 = $[6];
279
- t3 = $[7];
280
- tone = $[8];
281
239
  }
282
- const variant = t1 === undefined ? "default" : t1;
240
+ const tone = t1 === undefined ? "neutral" : t1;
283
241
  const size = t2 === undefined ? "md" : t2;
284
- const asChild = t3 === undefined ? false : t3;
285
242
  const reduceMotion = usePrefersReducedMotion();
286
- const resolvedVariant = variant ?? "default";
287
- const resolvedTone = tone ?? VARIANT_TONE[resolvedVariant];
288
243
  const label = typeof children === "string" || typeof children === "number" ? String(children) : null;
289
- const Component = asChild ? Slot.Root : "span";
290
- let t4;
291
- if ($[9] !== asChild || $[10] !== children || $[11] !== icon || $[12] !== label || $[13] !== reduceMotion) {
292
- t4 = asChild ? children : label === null ? /* @__PURE__ */ _jsxs(_Fragment, { children: [icon ? /* @__PURE__ */ _jsx(BadgeIcon, {
244
+ let t3;
245
+ if ($[7] !== children || $[8] !== icon || $[9] !== label || $[10] !== reduceMotion) {
246
+ t3 = label === null ? /* @__PURE__ */ _jsxs(_Fragment, { children: [icon ? /* @__PURE__ */ _jsx(BadgeIcon, {
293
247
  icon,
294
248
  iconKey: getIconKey(icon),
295
249
  reduceMotion
@@ -298,57 +252,50 @@ function Badge(t0) {
298
252
  label,
299
253
  reduceMotion
300
254
  });
301
- $[9] = asChild;
302
- $[10] = children;
303
- $[11] = icon;
304
- $[12] = label;
305
- $[13] = reduceMotion;
306
- $[14] = t4;
255
+ $[7] = children;
256
+ $[8] = icon;
257
+ $[9] = label;
258
+ $[10] = reduceMotion;
259
+ $[11] = t3;
307
260
  } else {
308
- t4 = $[14];
261
+ t3 = $[11];
309
262
  }
310
- const content = t4;
311
- let t5;
312
- if ($[15] !== className || $[16] !== resolvedTone || $[17] !== resolvedVariant || $[18] !== size) {
313
- t5 = badgeVariants({
314
- tone: resolvedTone,
315
- variant: resolvedVariant,
316
- size,
317
- className
318
- });
319
- $[15] = className;
320
- $[16] = resolvedTone;
321
- $[17] = resolvedVariant;
322
- $[18] = size;
323
- $[19] = t5;
263
+ const content = t3;
264
+ let t4;
265
+ if ($[12] !== className || $[13] !== size || $[14] !== tone) {
266
+ t4 = cn(badgeRecipe({
267
+ tone,
268
+ size
269
+ }), className);
270
+ $[12] = className;
271
+ $[13] = size;
272
+ $[14] = tone;
273
+ $[15] = t4;
324
274
  } else {
325
- t5 = $[19];
275
+ t4 = $[15];
326
276
  }
327
- let t6;
328
- if ($[20] !== Component || $[21] !== content || $[22] !== props || $[23] !== resolvedTone || $[24] !== resolvedVariant || $[25] !== size || $[26] !== t5) {
329
- t6 = /* @__PURE__ */ _jsx(MotionSlot, {
277
+ let t5;
278
+ if ($[16] !== content || $[17] !== props || $[18] !== size || $[19] !== t4 || $[20] !== tone) {
279
+ t5 = /* @__PURE__ */ _jsx(MotionSlot, {
330
280
  kind: "fade",
331
- children: /* @__PURE__ */ _jsx(Component, {
281
+ children: /* @__PURE__ */ _jsx("span", {
332
282
  "data-slot": "badge",
333
- "data-variant": resolvedVariant,
334
- "data-tone": resolvedTone,
283
+ "data-tone": tone,
335
284
  "data-size": size,
336
- className: t5,
285
+ className: t4,
337
286
  ...props,
338
287
  children: content
339
288
  })
340
289
  });
341
- $[20] = Component;
342
- $[21] = content;
343
- $[22] = props;
344
- $[23] = resolvedTone;
345
- $[24] = resolvedVariant;
346
- $[25] = size;
347
- $[26] = t5;
348
- $[27] = t6;
290
+ $[16] = content;
291
+ $[17] = props;
292
+ $[18] = size;
293
+ $[19] = t4;
294
+ $[20] = tone;
295
+ $[21] = t5;
349
296
  } else {
350
- t6 = $[27];
297
+ t5 = $[21];
351
298
  }
352
- return t6;
299
+ return t5;
353
300
  }
354
- export { Badge, badgeVariants };
301
+ export { Badge };
@@ -1,37 +1,47 @@
1
1
  /**
2
- * Arc's Calendar (https://uiarc.dev, MIT License, see THIRD_PARTY_NOTICES.md) on react-day-picker: round day cells
3
- * on a 4px grid, the month title on the left with quiet pill controls on the right, today marked by a dot under its
4
- * number, a selected disc that glides between days and an optional Today button. react-day-picker keeps selection
5
- * modes, ranges, dropdowns, locales and keyboard navigation; only the design and the motion come from Arc.
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.
6
5
  */
7
6
  import * as React from "react";
8
- import { DayPicker, type DayButton, type Locale } from "react-day-picker";
9
- import { ControlButton } from "./control-button.js";
10
- type CalendarProps = React.ComponentProps<typeof DayPicker> & {
11
- /** Variant of the month navigation buttons, kept for compatibility; Arc's look is the default `ghost`. */
12
- buttonVariant?: React.ComponentProps<typeof ControlButton>["variant"];
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 beez-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;
13
27
  /**
14
- * Adds Arc's Today button before the month controls: it goes back to the month holding today and, in single
15
- * selection mode, selects today when it is available. It rests dimmed while there is nothing left to do.
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.
16
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. */
17
35
  showToday?: boolean;
18
- /** Copy of the Today button. Defaults to "Hoy". */
36
+ /** beez-ui: copy of the Today button. Defaults to "Hoy". */
19
37
  todayLabel?: string;
20
38
  };
21
39
  /**
22
- * A month grid for picking a day, several days or a range, controlled or uncontrolled like react-day-picker.
23
- * @param props - Every react-day-picker prop plus the Arc additions `showToday` and `todayLabel`.
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`.
24
43
  * @returns The calendar, in Spanish by default.
25
44
  */
26
- declare function Calendar({ className, classNames, showOutsideDays, captionLayout, buttonVariant, locale, formatters, components, showToday, todayLabel, ...props }: CalendarProps): React.JSX.Element;
27
- /**
28
- * One day of the grid: a round cell whose fill answers hover on fine pointers, presses in slightly and marks today
29
- * with a dot under its number that takes the number's colour.
30
- * @param props - react-day-picker day button properties plus the locale used for `data-day`.
31
- * @returns The day button.
32
- */
33
- declare function CalendarDayButton({ className, day, modifiers, locale, ...props }: React.ComponentProps<typeof DayButton> & {
34
- locale?: Partial<Locale>;
35
- }): React.JSX.Element;
36
- export { Calendar, CalendarDayButton };
37
- export type { CalendarProps };
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 };