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
@@ -7,7 +7,6 @@ import { c as _c } from "react/compiler-runtime";
7
7
  * panel. Radix keeps the roles, keyboard navigation and controlled or uncontrolled value.
8
8
  */
9
9
  import { createContext, useContext, useLayoutEffect, useRef, useState } from "react";
10
- import { cva } from "class-variance-authority";
11
10
  import { Slot, Tabs as TabsPrimitive } from "radix-ui";
12
11
  import { AnimatePresence, animate, motion, useIsPresent } from "motion/react";
13
12
  import { TABS_DIRECTION, TABS_PANEL_HEIGHT_TOLERANCE_PX, TABS_PANEL_OFFSET_PX, TABS_PANEL_REDUCED_EXIT_DURATION_S, TABS_REVEAL_MARGIN_PX } from "../constants/tabs.js";
@@ -167,16 +166,10 @@ function Tabs(t0) {
167
166
  return t6;
168
167
  }
169
168
  /**
170
- * Arc's segmented list (`default`): a muted track whose active trigger is a raised surface. `line` keeps the
171
- * underline variant on the same tokens. Horizontal lists scroll sideways without a visible scrollbar.
169
+ * Arc's segmented list: a muted track whose active trigger is a raised surface. Horizontal lists scroll sideways
170
+ * without a visible scrollbar.
172
171
  */
173
- const tabsListVariants = cva("group/tabs-list inline-flex w-fit max-w-full min-w-0 items-center text-text-muted group-data-horizontal/tabs:overflow-x-auto group-data-horizontal/tabs:[scrollbar-width:none] group-data-horizontal/tabs:[&::-webkit-scrollbar]:hidden group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col", {
174
- variants: { variant: {
175
- default: "gap-(--space-1) rounded-(--radius-control) border border-border bg-surface-muted p-(--space-1)",
176
- line: "gap-(--space-1) bg-transparent"
177
- } },
178
- defaultVariants: { variant: "default" }
179
- });
172
+ const tabsListClassName = "group/tabs-list inline-flex w-fit max-w-full min-w-0 items-center gap-(--space-1) rounded-(--radius-control) border border-border bg-surface-muted p-(--space-1) text-text-muted group-data-horizontal/tabs:overflow-x-auto group-data-horizontal/tabs:[scrollbar-width:none] group-data-horizontal/tabs:[&::-webkit-scrollbar]:hidden group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col";
180
173
  /**
181
174
  * Scrolls a horizontally overflowing list just enough to show the trigger, never the page around it. The target is an
182
175
  * absolute offset, so a second call while a smooth scroll is still running (focus and selection both reveal the
@@ -202,39 +195,35 @@ function revealTrigger(list, trigger, reduceMotion) {
202
195
  /**
203
196
  * Holds the triggers. The active highlight glides to the newly selected trigger and the list scrolls to keep the
204
197
  * active or focused trigger visible.
205
- * @param props - Radix list props, the `variant` and `ref`.
198
+ * @param props - Radix list props, including `aria-label`, `loop` and `ref`.
206
199
  * @returns The tab list.
207
200
  */
208
201
  function TabsList(t0) {
209
- const $ = _c(31);
202
+ const $ = _c(28);
210
203
  let className;
211
204
  let onFocusCapture;
212
205
  let props;
213
206
  let ref;
214
- let t1;
215
207
  if ($[0] !== t0) {
216
- ({className, variant: t1, ref, onFocusCapture, ...props} = t0);
208
+ ({className, ref, onFocusCapture, ...props} = t0);
217
209
  $[0] = t0;
218
210
  $[1] = className;
219
211
  $[2] = onFocusCapture;
220
212
  $[3] = props;
221
213
  $[4] = ref;
222
- $[5] = t1;
223
214
  } else {
224
215
  className = $[1];
225
216
  onFocusCapture = $[2];
226
217
  props = $[3];
227
218
  ref = $[4];
228
- t1 = $[5];
229
219
  }
230
- const variant = t1 === undefined ? "default" : t1;
231
220
  const motionState = useContext(TabsMotionContext);
232
221
  const reduceMotion = usePrefersReducedMotion();
233
222
  const [list, attachList] = useAttachedElement(ref);
234
223
  const activeValue = motionState?.activeValue;
235
- let t2;
236
- if ($[6] !== list || $[7] !== motionState?.orientation || $[8] !== reduceMotion) {
237
- t2 = () => {
224
+ let t1;
225
+ if ($[5] !== list || $[6] !== motionState?.orientation || $[7] !== reduceMotion) {
226
+ t1 = () => {
238
227
  if (!list || motionState?.orientation === "vertical") {
239
228
  return;
240
229
  }
@@ -246,34 +235,34 @@ function TabsList(t0) {
246
235
  }
247
236
  return () => observer.disconnect();
248
237
  };
249
- $[6] = list;
250
- $[7] = motionState?.orientation;
251
- $[8] = reduceMotion;
252
- $[9] = t2;
238
+ $[5] = list;
239
+ $[6] = motionState?.orientation;
240
+ $[7] = reduceMotion;
241
+ $[8] = t1;
253
242
  } else {
254
- t2 = $[9];
243
+ t1 = $[8];
255
244
  }
256
- const t3 = motionState?.orientation;
257
- let t4;
258
- if ($[10] !== activeValue || $[11] !== list || $[12] !== reduceMotion || $[13] !== t3) {
259
- t4 = [
245
+ const t2 = motionState?.orientation;
246
+ let t3;
247
+ if ($[9] !== activeValue || $[10] !== list || $[11] !== reduceMotion || $[12] !== t2) {
248
+ t3 = [
260
249
  list,
261
250
  activeValue,
262
- t3,
251
+ t2,
263
252
  reduceMotion
264
253
  ];
265
- $[10] = activeValue;
266
- $[11] = list;
267
- $[12] = reduceMotion;
254
+ $[9] = activeValue;
255
+ $[10] = list;
256
+ $[11] = reduceMotion;
257
+ $[12] = t2;
268
258
  $[13] = t3;
269
- $[14] = t4;
270
259
  } else {
271
- t4 = $[14];
260
+ t3 = $[13];
272
261
  }
273
- useLayoutEffect(t2, t4);
274
- let t5;
275
- if ($[15] !== list || $[16] !== motionState?.orientation || $[17] !== onFocusCapture || $[18] !== reduceMotion) {
276
- t5 = function handleFocusCapture(event) {
262
+ useLayoutEffect(t1, t3);
263
+ let t4;
264
+ if ($[14] !== list || $[15] !== motionState?.orientation || $[16] !== onFocusCapture || $[17] !== reduceMotion) {
265
+ t4 = function handleFocusCapture(event) {
277
266
  onFocusCapture?.(event);
278
267
  if (!list || motionState?.orientation === "vertical") {
279
268
  return;
@@ -282,55 +271,52 @@ function TabsList(t0) {
282
271
  revealTrigger(list, event.target, reduceMotion);
283
272
  }
284
273
  };
285
- $[15] = list;
286
- $[16] = motionState?.orientation;
287
- $[17] = onFocusCapture;
288
- $[18] = reduceMotion;
289
- $[19] = t5;
274
+ $[14] = list;
275
+ $[15] = motionState?.orientation;
276
+ $[16] = onFocusCapture;
277
+ $[17] = reduceMotion;
278
+ $[18] = t4;
290
279
  } else {
291
- t5 = $[19];
280
+ t4 = $[18];
292
281
  }
293
- const handleFocusCapture = t5;
294
- let t6;
295
- if ($[20] !== className || $[21] !== variant) {
296
- t6 = cn(tabsListVariants({ variant }), className);
297
- $[20] = className;
298
- $[21] = variant;
299
- $[22] = t6;
282
+ const handleFocusCapture = t4;
283
+ let t5;
284
+ if ($[19] !== className) {
285
+ t5 = cn(tabsListClassName, className);
286
+ $[19] = className;
287
+ $[20] = t5;
300
288
  } else {
301
- t6 = $[22];
289
+ t5 = $[20];
302
290
  }
303
- let t7;
304
- if ($[23] !== handleFocusCapture || $[24] !== props || $[25] !== t6 || $[26] !== variant) {
305
- t7 = /* @__PURE__ */ _jsx(TabsPrimitive.List, {
291
+ let t6;
292
+ if ($[21] !== handleFocusCapture || $[22] !== props || $[23] !== t5) {
293
+ t6 = /* @__PURE__ */ _jsx(TabsPrimitive.List, {
306
294
  "data-slot": "tabs-list",
307
- "data-variant": variant,
308
- className: t6,
295
+ className: t5,
309
296
  onFocusCapture: handleFocusCapture,
310
297
  ...props
311
298
  });
312
- $[23] = handleFocusCapture;
313
- $[24] = props;
314
- $[25] = t6;
315
- $[26] = variant;
316
- $[27] = t7;
299
+ $[21] = handleFocusCapture;
300
+ $[22] = props;
301
+ $[23] = t5;
302
+ $[24] = t6;
317
303
  } else {
318
- t7 = $[27];
304
+ t6 = $[24];
319
305
  }
320
- let t8;
321
- if ($[28] !== attachList || $[29] !== t7) {
322
- t8 = /* @__PURE__ */ _jsx(GlideSlot, {
306
+ let t7;
307
+ if ($[25] !== attachList || $[26] !== t6) {
308
+ t7 = /* @__PURE__ */ _jsx(GlideSlot, {
323
309
  preset: "tabs",
324
310
  ref: attachList,
325
- children: t7
311
+ children: t6
326
312
  });
327
- $[28] = attachList;
328
- $[29] = t7;
329
- $[30] = t8;
313
+ $[25] = attachList;
314
+ $[26] = t6;
315
+ $[27] = t7;
330
316
  } else {
331
- t8 = $[30];
317
+ t7 = $[27];
332
318
  }
333
- return t8;
319
+ return t7;
334
320
  }
335
321
  /**
336
322
  * Selects a panel. Arc's trigger: muted label, accent label once active, hover only on fine pointers and the
@@ -356,7 +342,7 @@ function TabsTrigger(t0) {
356
342
  }
357
343
  let t1;
358
344
  if ($[4] !== className) {
359
- t1 = cn("relative inline-flex min-h-(--control-height-sm) min-w-[5.5rem] flex-[1_0_auto] cursor-pointer items-center justify-center gap-1.5 rounded-[calc(var(--radius-control)-3px)] border border-transparent bg-transparent px-(--space-3) font-sans text-sm font-medium whitespace-nowrap text-text-muted [-webkit-tap-highlight-color:transparent] transition-[color,background-color,border-color,box-shadow] duration-(--duration-fast) ease-(--ease-standard) select-none motion-reduce:transition-none hover-fine:text-foreground active:text-foreground disabled:cursor-not-allowed disabled:opacity-50 data-active:text-(--accent-strong) group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", "group-data-[variant=default]/tabs-list:data-active:border-border group-data-[variant=default]/tabs-list:data-active:bg-surface group-data-[variant=default]/tabs-list:data-active:shadow-(--shadow-resting)", "after:absolute after:rounded-full after:bg-(--accent-strong) after:opacity-0 after:transition-opacity after:duration-(--duration-fast) group-data-horizontal/tabs:after:inset-x-(--space-2) group-data-horizontal/tabs:after:-bottom-px group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-(--space-2) group-data-vertical/tabs:after:-right-px group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100 data-glide-target:after:opacity-0! data-glide-freeze:after:transition-none motion-reduce:after:transition-none", className);
345
+ t1 = cn("relative inline-flex min-h-(--control-height-sm) min-w-[5.5rem] flex-[1_0_auto] cursor-pointer items-center justify-center gap-1.5 rounded-[calc(var(--radius-control)-3px)] border border-transparent bg-transparent px-(--space-3) font-sans text-sm font-medium whitespace-nowrap text-text-muted [-webkit-tap-highlight-color:transparent] transition-[color,background-color,border-color,box-shadow] duration-(--duration-fast) ease-(--ease-standard) select-none motion-reduce:transition-none hover-fine:text-foreground active:text-foreground disabled:cursor-not-allowed disabled:opacity-50 data-active:text-(--accent-strong) group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", "data-active:border-border data-active:bg-surface data-active:shadow-(--shadow-resting)", className);
360
346
  $[4] = className;
361
347
  $[5] = t1;
362
348
  } else {
@@ -647,4 +633,4 @@ function TabsContent(t0) {
647
633
  }
648
634
  return t5;
649
635
  }
650
- export { Tabs, TabsList, TabsTrigger, TabsContent, tabsListVariants };
636
+ export { Tabs, TabsList, TabsTrigger, TabsContent };
@@ -1,7 +1,7 @@
1
1
  import type { ToasterProps } from "sonner";
2
2
  /**
3
3
  * Renders shared notification styling using the consumer's resolved theme, on top of beez-ui's `Toaster`, so its
4
- * toasts stay usable from an open `Dialog`, `AlertDialog` or `Sheet`.
4
+ * toasts stay usable from an open `Dialog` (also in `alert` mode) or `Sheet`.
5
5
  */
6
6
  declare const ThemedToaster: ({ theme, className, ...props }: ToasterProps) => import("react").JSX.Element;
7
7
  export { ThemedToaster };
@@ -8,7 +8,7 @@ import { CircleCheck, Info, TriangleAlert, OctagonAlert, Loader } from "lucide-r
8
8
  import { jsx as _jsx } from "react/jsx-runtime";
9
9
  /**
10
10
  * Renders shared notification styling using the consumer's resolved theme, on top of beez-ui's `Toaster`, so its
11
- * toasts stay usable from an open `Dialog`, `AlertDialog` or `Sheet`.
11
+ * toasts stay usable from an open `Dialog` (also in `alert` mode) or `Sheet`.
12
12
  */
13
13
  const ThemedToaster = (t0) => {
14
14
  const $ = _c(16);
@@ -1,7 +1,7 @@
1
1
  import { type ComponentProps } from "react";
2
2
  import { Toaster as SonnerToaster } from "sonner";
3
3
  /**
4
- * Renders Sonner's toaster unchanged in look, but keeps its toasts usable while a modal `Dialog`, `AlertDialog` or
4
+ * Renders Sonner's toaster unchanged in look, but keeps its toasts usable while a modal `Dialog` (also in `alert` mode) or
5
5
  * `Sheet` is open: the toast layer takes pointer input even though the modal disables pointer events on the page,
6
6
  * and Sonner's hotkey moves keyboard focus into the toasts past the modal's focus trap (focus returns to the modal
7
7
  * when the focused toast goes away). Accepts every Sonner prop, including `ref`, and keeps the consumer's `className`.
@@ -6,7 +6,7 @@ import { useEffect } from "react";
6
6
  import { Toaster as SonnerToaster } from "sonner";
7
7
  import { jsx as _jsx } from "react/jsx-runtime";
8
8
  /**
9
- * Renders Sonner's toaster unchanged in look, but keeps its toasts usable while a modal `Dialog`, `AlertDialog` or
9
+ * Renders Sonner's toaster unchanged in look, but keeps its toasts usable while a modal `Dialog` (also in `alert` mode) or
10
10
  * `Sheet` is open: the toast layer takes pointer input even though the modal disables pointer events on the page,
11
11
  * and Sonner's hotkey moves keyboard focus into the toasts past the modal's focus trap (focus returns to the modal
12
12
  * when the focused toast goes away). Accepts every Sonner prop, including `ref`, and keeps the consumer's `className`.
@@ -1,38 +1,43 @@
1
1
  /**
2
2
  * Arc's Tooltip (https://uiarc.dev, MIT License, see THIRD_PARTY_NOTICES.md): a short dark bubble on Arc's tokens that
3
3
  * waits a moment, then rises a few pixels from its trigger. While a tooltip is open, and briefly after it closes, the
4
- * next one opens at once and only fades. It keeps the Radix composition (`Tooltip`, `TooltipTrigger`,
5
- * `TooltipContent`, `TooltipProvider`) and adds Arc's shorthand: `<Tooltip content="..." side="...">` wraps its child.
4
+ * next one opens at once and only fades, without any app-level provider: the skip window is shared by every tooltip
5
+ * on the page. It follows Arc's closed API, `<Tooltip content="...">` around its trigger, plus placement and open
6
+ * state extensions.
6
7
  */
7
- import * as React from "react";
8
- import { Tooltip as TooltipPrimitive } from "radix-ui";
9
- /**
10
- * Shares the open delay among the tooltips it wraps.
11
- * @param props - Radix provider properties. `delayDuration` defaults to Arc's 250ms.
12
- * @returns The provider.
13
- */
14
- declare function TooltipProvider({ delayDuration, ...props }: React.ComponentProps<typeof TooltipPrimitive.Provider>): React.JSX.Element;
15
- export type TooltipProps = React.ComponentProps<typeof TooltipPrimitive.Root> & {
16
- /**
17
- * Arc's shorthand: the bubble's content. When set, the only child becomes the trigger (it must accept a ref and be
18
- * focusable) and the tooltip renders its own `TooltipContent`.
19
- */
20
- content?: React.ReactNode;
21
- /** Side of the trigger the shorthand bubble prefers. Defaults to `top`. */
22
- side?: React.ComponentProps<typeof TooltipPrimitive.Content>["side"];
8
+ import type { ReactElement, ReactNode } from "react";
9
+ /** Side of the trigger a tooltip prefers. Arc offers `top` and `bottom`; beez-ui adds `left` and `right`. */
10
+ export type TooltipSide = "top" | "bottom" | "left" | "right";
11
+ /** Alignment of the bubble against its trigger. */
12
+ export type TooltipAlign = "start" | "center" | "end";
13
+ export type TooltipProps = {
14
+ /** Supplemental text of the bubble. Icon-only triggers still need their own `aria-label`. */
15
+ content: ReactNode;
16
+ /** The trigger. Rendered with `asChild`, so it must accept a ref and be focusable. */
17
+ children: ReactElement;
18
+ /** Preferred side of the trigger. Defaults to `top`. */
19
+ side?: TooltipSide;
20
+ /** Alignment against the trigger. Defaults to `center`. */
21
+ align?: TooltipAlign;
22
+ /** Gap, in px, between the bubble and its trigger. Defaults to 8. */
23
+ sideOffset?: number;
24
+ /** Distance, in px, the bubble keeps from the viewport edges. Defaults to 12. */
25
+ collisionPadding?: number;
26
+ /** Class added to the bubble. */
27
+ contentClassName?: string;
28
+ /** Controlled open state. */
29
+ open?: boolean;
30
+ /** Initial open state when uncontrolled. */
31
+ defaultOpen?: boolean;
32
+ /** Called when the tooltip opens or closes. */
33
+ onOpenChange?: (open: boolean) => void;
34
+ /** Milliseconds of hover or focus before the first tooltip opens. Defaults to Arc's 250. */
35
+ delayDuration?: number;
23
36
  };
24
37
  /**
25
- * Owns the open state of one tooltip. It works with or without a `TooltipProvider`: without one it brings its own,
26
- * as Arc's Tooltip does.
27
- * @param props - Radix root properties plus Arc's optional `content` and `side` shorthand.
28
- * @returns The tooltip root.
29
- */
30
- declare function Tooltip({ content, side, children, delayDuration, ...props }: TooltipProps): React.JSX.Element;
31
- declare function TooltipTrigger({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Trigger>): React.JSX.Element;
32
- /**
33
- * Renders Arc's bubble: inverted colors, a hairline border, the raised shadow and 15rem of maximum width.
34
- * @param props - Radix content properties. `sideOffset` defaults to 8px and `collisionPadding` to 12px.
35
- * @returns The portaled bubble.
38
+ * A short label on hover or focus that opens without delay when moving between tooltips.
39
+ * @param props - The bubble content, the trigger and optional placement and open state.
40
+ * @returns The trigger with its tooltip.
36
41
  */
37
- declare function TooltipContent({ className, sideOffset, collisionPadding, children, ...props }: React.ComponentProps<typeof TooltipPrimitive.Content>): React.JSX.Element;
38
- export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
42
+ declare function Tooltip({ content, children, side, align, sideOffset, collisionPadding, contentClassName, open, defaultOpen, onOpenChange, delayDuration, }: TooltipProps): import("react").JSX.Element;
43
+ export { Tooltip };