beez-ui 2.5.0 → 2.6.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 (92) hide show
  1. package/CHANGELOG.md +63 -0
  2. package/THIRD_PARTY_NOTICES.md +1 -1
  3. package/dist/components/alert-dialog.d.ts +15 -4
  4. package/dist/components/alert-dialog.js +84 -44
  5. package/dist/components/alert.d.ts +30 -9
  6. package/dist/components/alert.js +360 -39
  7. package/dist/components/avatar.d.ts +33 -10
  8. package/dist/components/avatar.js +110 -30
  9. package/dist/components/badge.d.ts +39 -7
  10. package/dist/components/badge.js +348 -24
  11. package/dist/components/calendar.d.ts +29 -2
  12. package/dist/components/calendar.js +1035 -223
  13. package/dist/components/card.d.ts +17 -1
  14. package/dist/components/card.js +34 -8
  15. package/dist/components/carousel.d.ts +29 -2
  16. package/dist/components/carousel.js +471 -90
  17. package/dist/components/checkbox.d.ts +13 -2
  18. package/dist/components/checkbox.js +301 -41
  19. package/dist/components/dialog-surface.d.ts +27 -0
  20. package/dist/components/dialog-surface.js +137 -0
  21. package/dist/components/dialog.d.ts +21 -4
  22. package/dist/components/dialog.js +163 -96
  23. package/dist/components/dropdown-menu.d.ts +30 -16
  24. package/dist/components/dropdown-menu.js +139 -83
  25. package/dist/components/hover-card.d.ts +46 -3
  26. package/dist/components/hover-card.js +423 -60
  27. package/dist/components/pagination.d.ts +32 -14
  28. package/dist/components/pagination.js +136 -59
  29. package/dist/components/popover.d.ts +14 -5
  30. package/dist/components/popover.js +78 -36
  31. package/dist/components/radio-group.d.ts +19 -3
  32. package/dist/components/radio-group.js +400 -57
  33. package/dist/components/select.d.ts +17 -6
  34. package/dist/components/select.js +83 -71
  35. package/dist/components/sheet.js +37 -26
  36. package/dist/components/sidebar.js +11 -0
  37. package/dist/components/skeleton.d.ts +19 -5
  38. package/dist/components/skeleton.js +434 -14
  39. package/dist/components/switch.d.ts +14 -4
  40. package/dist/components/switch.js +424 -40
  41. package/dist/components/tabs.d.ts +38 -5
  42. package/dist/components/tabs.js +564 -97
  43. package/dist/components/themed-toaster.d.ts +6 -2
  44. package/dist/components/themed-toaster.js +80 -50
  45. package/dist/components/tooltip.d.ts +33 -2
  46. package/dist/components/tooltip.js +197 -69
  47. package/dist/constants/alert.d.ts +12 -0
  48. package/dist/constants/alert.js +9 -0
  49. package/dist/constants/avatar.d.ts +10 -0
  50. package/dist/constants/avatar.js +7 -0
  51. package/dist/constants/badge.d.ts +6 -0
  52. package/dist/constants/badge.js +6 -0
  53. package/dist/constants/calendar.d.ts +24 -0
  54. package/dist/constants/calendar.js +22 -0
  55. package/dist/constants/carousel.d.ts +37 -0
  56. package/dist/constants/carousel.js +53 -0
  57. package/dist/constants/checkbox.d.ts +17 -0
  58. package/dist/constants/checkbox.js +17 -0
  59. package/dist/constants/dialog.d.ts +6 -0
  60. package/dist/constants/dialog.js +6 -0
  61. package/dist/constants/dropdown-menu.d.ts +5 -0
  62. package/dist/constants/dropdown-menu.js +5 -0
  63. package/dist/constants/hover-card.d.ts +37 -0
  64. package/dist/constants/hover-card.js +85 -0
  65. package/dist/constants/pagination.d.ts +9 -0
  66. package/dist/constants/pagination.js +9 -0
  67. package/dist/constants/popover.d.ts +7 -0
  68. package/dist/constants/popover.js +39 -0
  69. package/dist/constants/radio-group.d.ts +10 -0
  70. package/dist/constants/radio-group.js +10 -0
  71. package/dist/constants/select.d.ts +3 -0
  72. package/dist/constants/select.js +3 -0
  73. package/dist/constants/skeleton.d.ts +17 -0
  74. package/dist/constants/skeleton.js +17 -0
  75. package/dist/constants/switch.d.ts +44 -0
  76. package/dist/constants/switch.js +49 -0
  77. package/dist/constants/tabs.d.ts +17 -0
  78. package/dist/constants/tabs.js +17 -0
  79. package/dist/constants/toast.d.ts +3 -0
  80. package/dist/constants/toast.js +3 -0
  81. package/dist/constants/tooltip.d.ts +13 -0
  82. package/dist/constants/tooltip.js +52 -0
  83. package/dist/lib/toast-layer.d.ts +24 -0
  84. package/dist/lib/toast-layer.js +76 -0
  85. package/dist/motion/arc-floating-slot.d.ts +40 -0
  86. package/dist/motion/arc-floating-slot.js +167 -0
  87. package/dist/motion/glide-indicator.d.ts +6 -7
  88. package/dist/motion/glide-indicator.js +5 -3
  89. package/dist/motion/overlay-warmth.d.ts +24 -0
  90. package/dist/motion/overlay-warmth.js +70 -0
  91. package/dist/styles.css +1 -1
  92. package/package.json +1 -1
@@ -1,4 +1,8 @@
1
1
  import { type ToasterProps } from "sonner";
2
- /** Renders shared notification styling using the consumer's resolved theme. */
3
- declare const ThemedToaster: ({ theme, ...props }: ToasterProps) => import("react").JSX.Element;
2
+ /**
3
+ * Renders shared notification styling using the consumer's resolved theme. Toasts take pointer input even while a
4
+ * modal overlay (which disables pointer events on the page) is open, and Sonner's hotkey moves keyboard focus into
5
+ * them past the modal's focus trap, so their actions stay usable from a dialog.
6
+ */
7
+ declare const ThemedToaster: ({ theme, className, ...props }: ToasterProps) => import("react").JSX.Element;
4
8
  export { ThemedToaster };
@@ -1,104 +1,134 @@
1
1
  "use client";
2
2
  import { c as _c } from "react/compiler-runtime";
3
3
  import { MotionSlot } from "../motion/motion-slot.js";
4
+ import { cn } from "../lib/utils.js";
5
+ import { letFocusReachToastLayer } from "../lib/toast-layer.js";
6
+ import { useEffect } from "react";
4
7
  import { Toaster as Sonner } from "sonner";
5
8
  import { useTheme } from "next-themes";
6
9
  import { CircleCheck, Info, TriangleAlert, OctagonAlert, Loader } from "lucide-react";
7
10
  import { jsx as _jsx } from "react/jsx-runtime";
8
- /** Renders shared notification styling using the consumer's resolved theme. */
11
+ /**
12
+ * Renders shared notification styling using the consumer's resolved theme. Toasts take pointer input even while a
13
+ * modal overlay (which disables pointer events on the page) is open, and Sonner's hotkey moves keyboard focus into
14
+ * them past the modal's focus trap, so their actions stay usable from a dialog.
15
+ */
9
16
  const ThemedToaster = (t0) => {
10
- const $ = _c(12);
17
+ const $ = _c(17);
18
+ let className;
11
19
  let props;
12
20
  let theme;
13
21
  if ($[0] !== t0) {
14
- ({theme, ...props} = t0);
22
+ ({theme, className, ...props} = t0);
15
23
  $[0] = t0;
16
- $[1] = props;
17
- $[2] = theme;
24
+ $[1] = className;
25
+ $[2] = props;
26
+ $[3] = theme;
18
27
  } else {
19
- props = $[1];
20
- theme = $[2];
28
+ className = $[1];
29
+ props = $[2];
30
+ theme = $[3];
21
31
  }
22
32
  const { resolvedTheme } = useTheme();
23
33
  const activeTheme = theme ?? (resolvedTheme === "dark" ? "dark" : "light");
24
34
  let t1;
25
- if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
26
- t1 = /* @__PURE__ */ _jsx(MotionSlot, {
35
+ if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
36
+ t1 = [];
37
+ $[4] = t1;
38
+ } else {
39
+ t1 = $[4];
40
+ }
41
+ useEffect(_temp, t1);
42
+ let t2;
43
+ if ($[5] !== className) {
44
+ t2 = cn("toaster group pointer-events-auto", className);
45
+ $[5] = className;
46
+ $[6] = t2;
47
+ } else {
48
+ t2 = $[6];
49
+ }
50
+ let t3;
51
+ if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
52
+ t3 = /* @__PURE__ */ _jsx(MotionSlot, {
27
53
  kind: "selection",
28
54
  children: /* @__PURE__ */ _jsx(CircleCheck, { className: "size-4" })
29
55
  });
30
- $[3] = t1;
56
+ $[7] = t3;
31
57
  } else {
32
- t1 = $[3];
58
+ t3 = $[7];
33
59
  }
34
- let t2;
35
- if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
36
- t2 = /* @__PURE__ */ _jsx(MotionSlot, {
60
+ let t4;
61
+ if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
62
+ t4 = /* @__PURE__ */ _jsx(MotionSlot, {
37
63
  kind: "selection",
38
64
  children: /* @__PURE__ */ _jsx(Info, { className: "size-4" })
39
65
  });
40
- $[4] = t2;
66
+ $[8] = t4;
41
67
  } else {
42
- t2 = $[4];
68
+ t4 = $[8];
43
69
  }
44
- let t3;
45
- if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
46
- t3 = /* @__PURE__ */ _jsx(MotionSlot, {
70
+ let t5;
71
+ if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
72
+ t5 = /* @__PURE__ */ _jsx(MotionSlot, {
47
73
  kind: "selection",
48
74
  children: /* @__PURE__ */ _jsx(TriangleAlert, { className: "size-4" })
49
75
  });
50
- $[5] = t3;
76
+ $[9] = t5;
51
77
  } else {
52
- t3 = $[5];
78
+ t5 = $[9];
53
79
  }
54
- let t4;
55
- let t5;
56
- if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
57
- t4 = {
58
- success: t1,
59
- info: t2,
60
- warning: t3,
80
+ let t6;
81
+ let t7;
82
+ if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
83
+ t6 = {
84
+ success: t3,
85
+ info: t4,
86
+ warning: t5,
61
87
  error: /* @__PURE__ */ _jsx(MotionSlot, {
62
88
  kind: "selection",
63
89
  children: /* @__PURE__ */ _jsx(OctagonAlert, { className: "size-4" })
64
90
  }),
65
91
  loading: /* @__PURE__ */ _jsx(Loader, { className: "size-4 animate-spin" })
66
92
  };
67
- t5 = {
93
+ t7 = {
68
94
  "--normal-bg": "var(--popover)",
69
95
  "--normal-text": "var(--popover-foreground)",
70
96
  "--normal-border": "var(--border)",
71
97
  "--border-radius": "var(--radius)"
72
98
  };
73
- $[6] = t4;
74
- $[7] = t5;
99
+ $[10] = t6;
100
+ $[11] = t7;
75
101
  } else {
76
- t4 = $[6];
77
- t5 = $[7];
102
+ t6 = $[10];
103
+ t7 = $[11];
78
104
  }
79
- let t6;
80
- if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
81
- t6 = { classNames: { toast: "cn-toast" } };
82
- $[8] = t6;
105
+ let t8;
106
+ if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
107
+ t8 = { classNames: { toast: "cn-toast" } };
108
+ $[12] = t8;
83
109
  } else {
84
- t6 = $[8];
110
+ t8 = $[12];
85
111
  }
86
- let t7;
87
- if ($[9] !== activeTheme || $[10] !== props) {
88
- t7 = /* @__PURE__ */ _jsx(Sonner, {
112
+ let t9;
113
+ if ($[13] !== activeTheme || $[14] !== props || $[15] !== t2) {
114
+ t9 = /* @__PURE__ */ _jsx(Sonner, {
89
115
  theme: activeTheme,
90
- className: "toaster group",
91
- icons: t4,
92
- style: t5,
93
- toastOptions: t6,
116
+ className: t2,
117
+ icons: t6,
118
+ style: t7,
119
+ toastOptions: t8,
94
120
  ...props
95
121
  });
96
- $[9] = activeTheme;
97
- $[10] = props;
98
- $[11] = t7;
122
+ $[13] = activeTheme;
123
+ $[14] = props;
124
+ $[15] = t2;
125
+ $[16] = t9;
99
126
  } else {
100
- t7 = $[11];
127
+ t9 = $[16];
101
128
  }
102
- return t7;
129
+ return t9;
103
130
  };
104
131
  export { ThemedToaster };
132
+ function _temp() {
133
+ return letFocusReachToastLayer(document);
134
+ }
@@ -1,7 +1,38 @@
1
+ /**
2
+ * Arc's Tooltip (https://uiarc.dev, MIT License, see THIRD_PARTY_NOTICES.md): a short dark bubble on Arc's tokens that
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.
6
+ */
1
7
  import * as React from "react";
2
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
+ */
3
14
  declare function TooltipProvider({ delayDuration, ...props }: React.ComponentProps<typeof TooltipPrimitive.Provider>): React.JSX.Element;
4
- declare function Tooltip({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Root>): 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"];
23
+ };
24
+ /**
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;
5
31
  declare function TooltipTrigger({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Trigger>): React.JSX.Element;
6
- declare function TooltipContent({ className, sideOffset, children, ...props }: React.ComponentProps<typeof TooltipPrimitive.Content>): 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.
36
+ */
37
+ declare function TooltipContent({ className, sideOffset, collisionPadding, children, ...props }: React.ComponentProps<typeof TooltipPrimitive.Content>): React.JSX.Element;
7
38
  export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
@@ -1,11 +1,30 @@
1
1
  "use client";
2
2
  import { c as _c } from "react/compiler-runtime";
3
+ /**
4
+ * Arc's Tooltip (https://uiarc.dev, MIT License, see THIRD_PARTY_NOTICES.md): a short dark bubble on Arc's tokens that
5
+ * waits a moment, then rises a few pixels from its trigger. While a tooltip is open, and briefly after it closes, the
6
+ * next one opens at once and only fades. It keeps the Radix composition (`Tooltip`, `TooltipTrigger`,
7
+ * `TooltipContent`, `TooltipProvider`) and adds Arc's shorthand: `<Tooltip content="..." side="...">` wraps its child.
8
+ */
3
9
  import * as React from "react";
4
10
  import { Tooltip as TooltipPrimitive } from "radix-ui";
5
- import { MotionSlot } from "../motion/motion-slot.js";
11
+ import { ArcFloatingSlot } from "../motion/arc-floating-slot.js";
12
+ import { createOverlayWarmth, useOpenedWhileWarm } from "../motion/overlay-warmth.js";
6
13
  import { MotionPresence, MotionOpenProvider, useMotionOpenState } from "../motion/presence.js";
7
14
  import { cn } from "../lib/utils.js";
8
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
15
+ import { TOOLTIP_COLLISION_PADDING_PX, TOOLTIP_INSTANT_MOTION, TOOLTIP_MOTION, TOOLTIP_OPEN_DELAY_MS, TOOLTIP_SIDE_OFFSET_PX, TOOLTIP_SKIP_WINDOW_MS } from "../constants/tooltip.js";
16
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
17
+ /** Every tooltip on the page shares one skip window, whichever provider it belongs to. */
18
+ const tooltipWarmth = createOverlayWarmth(TOOLTIP_SKIP_WINDOW_MS);
19
+ /** Whether the page was already warm when the surrounding layer opened, so its entrance only fades. */
20
+ const TooltipOpenedWhileWarmContext = React.createContext(false);
21
+ /** Tells a `Tooltip` whether a `TooltipProvider` already wraps it. */
22
+ const TooltipProviderPresenceContext = React.createContext(false);
23
+ /**
24
+ * Shares the open delay among the tooltips it wraps.
25
+ * @param props - Radix provider properties. `delayDuration` defaults to Arc's 250ms.
26
+ * @returns The provider.
27
+ */
9
28
  function TooltipProvider(t0) {
10
29
  const $ = _c(6);
11
30
  let props;
@@ -19,13 +38,16 @@ function TooltipProvider(t0) {
19
38
  props = $[1];
20
39
  t1 = $[2];
21
40
  }
22
- const delayDuration = t1 === undefined ? 0 : t1;
41
+ const delayDuration = t1 === undefined ? TOOLTIP_OPEN_DELAY_MS : t1;
23
42
  let t2;
24
43
  if ($[3] !== delayDuration || $[4] !== props) {
25
- t2 = /* @__PURE__ */ _jsx(TooltipPrimitive.Provider, {
26
- "data-slot": "tooltip-provider",
27
- delayDuration,
28
- ...props
44
+ t2 = /* @__PURE__ */ _jsx(TooltipProviderPresenceContext.Provider, {
45
+ value: true,
46
+ children: /* @__PURE__ */ _jsx(TooltipPrimitive.Provider, {
47
+ "data-slot": "tooltip-provider",
48
+ delayDuration,
49
+ ...props
50
+ })
29
51
  });
30
52
  $[3] = delayDuration;
31
53
  $[4] = props;
@@ -35,46 +57,130 @@ function TooltipProvider(t0) {
35
57
  }
36
58
  return t2;
37
59
  }
60
+ /**
61
+ * Owns the open state of one tooltip. It works with or without a `TooltipProvider`: without one it brings its own,
62
+ * as Arc's Tooltip does.
63
+ * @param props - Radix root properties plus Arc's optional `content` and `side` shorthand.
64
+ * @returns The tooltip root.
65
+ */
38
66
  function Tooltip(t0) {
39
- const $ = _c(9);
67
+ const $ = _c(29);
68
+ let children;
69
+ let content;
70
+ let delayDuration;
40
71
  let props;
72
+ let side;
41
73
  if ($[0] !== t0) {
42
- ({...props} = t0);
74
+ ({content, side, children, delayDuration, ...props} = t0);
43
75
  $[0] = t0;
44
- $[1] = props;
76
+ $[1] = children;
77
+ $[2] = content;
78
+ $[3] = delayDuration;
79
+ $[4] = props;
80
+ $[5] = side;
45
81
  } else {
46
- props = $[1];
82
+ children = $[1];
83
+ content = $[2];
84
+ delayDuration = $[3];
85
+ props = $[4];
86
+ side = $[5];
47
87
  }
48
88
  const [motionOpen, setMotionOpen] = useMotionOpenState(props);
89
+ const isWarm = React.useSyncExternalStore(tooltipWarmth.subscribe, tooltipWarmth.isWarm, tooltipWarmth.isWarmOnServer);
90
+ const openedWhileWarm = useOpenedWhileWarm(motionOpen, isWarm);
91
+ const hasProvider = React.useContext(TooltipProviderPresenceContext);
49
92
  let t1;
50
- if ($[2] !== motionOpen || $[3] !== props || $[4] !== setMotionOpen) {
51
- t1 = /* @__PURE__ */ _jsx(TooltipPrimitive.Root, {
93
+ let t2;
94
+ if ($[6] !== motionOpen) {
95
+ t1 = () => {
96
+ if (!motionOpen) {
97
+ return;
98
+ }
99
+ return tooltipWarmth.open();
100
+ };
101
+ t2 = [motionOpen];
102
+ $[6] = motionOpen;
103
+ $[7] = t1;
104
+ $[8] = t2;
105
+ } else {
106
+ t1 = $[7];
107
+ t2 = $[8];
108
+ }
109
+ React.useEffect(t1, t2);
110
+ const usesShorthand = content !== undefined;
111
+ const t3 = isWarm ? 0 : delayDuration;
112
+ let t4;
113
+ if ($[9] !== children || $[10] !== content || $[11] !== side || $[12] !== usesShorthand) {
114
+ t4 = usesShorthand ? /* @__PURE__ */ _jsxs(_Fragment, { children: [/* @__PURE__ */ _jsx(TooltipTrigger, {
115
+ asChild: true,
116
+ children
117
+ }), /* @__PURE__ */ _jsx(TooltipContent, {
118
+ side,
119
+ children: content
120
+ })] }) : children;
121
+ $[9] = children;
122
+ $[10] = content;
123
+ $[11] = side;
124
+ $[12] = usesShorthand;
125
+ $[13] = t4;
126
+ } else {
127
+ t4 = $[13];
128
+ }
129
+ let t5;
130
+ if ($[14] !== motionOpen || $[15] !== props || $[16] !== setMotionOpen || $[17] !== t3 || $[18] !== t4) {
131
+ t5 = /* @__PURE__ */ _jsx(TooltipPrimitive.Root, {
52
132
  "data-slot": "tooltip",
53
133
  ...props,
134
+ delayDuration: t3,
54
135
  open: motionOpen,
55
- onOpenChange: setMotionOpen
136
+ onOpenChange: setMotionOpen,
137
+ children: t4
56
138
  });
57
- $[2] = motionOpen;
58
- $[3] = props;
59
- $[4] = setMotionOpen;
60
- $[5] = t1;
139
+ $[14] = motionOpen;
140
+ $[15] = props;
141
+ $[16] = setMotionOpen;
142
+ $[17] = t3;
143
+ $[18] = t4;
144
+ $[19] = t5;
61
145
  } else {
62
- t1 = $[5];
146
+ t5 = $[19];
63
147
  }
64
- let t2;
65
- if ($[6] !== motionOpen || $[7] !== t1) {
66
- t2 = /* @__PURE__ */ _jsx(MotionOpenProvider, {
148
+ let t6;
149
+ if ($[20] !== openedWhileWarm || $[21] !== t5) {
150
+ t6 = /* @__PURE__ */ _jsx(TooltipOpenedWhileWarmContext.Provider, {
151
+ value: openedWhileWarm,
152
+ children: t5
153
+ });
154
+ $[20] = openedWhileWarm;
155
+ $[21] = t5;
156
+ $[22] = t6;
157
+ } else {
158
+ t6 = $[22];
159
+ }
160
+ let t7;
161
+ if ($[23] !== motionOpen || $[24] !== t6) {
162
+ t7 = /* @__PURE__ */ _jsx(MotionOpenProvider, {
67
163
  scope: "tooltip",
68
164
  open: motionOpen,
69
- children: t1
165
+ children: t6
70
166
  });
71
- $[6] = motionOpen;
72
- $[7] = t1;
73
- $[8] = t2;
167
+ $[23] = motionOpen;
168
+ $[24] = t6;
169
+ $[25] = t7;
74
170
  } else {
75
- t2 = $[8];
171
+ t7 = $[25];
76
172
  }
77
- return t2;
173
+ const root = t7;
174
+ let t8;
175
+ if ($[26] !== hasProvider || $[27] !== root) {
176
+ t8 = hasProvider ? root : /* @__PURE__ */ _jsx(TooltipProvider, { children: root });
177
+ $[26] = hasProvider;
178
+ $[27] = root;
179
+ $[28] = t8;
180
+ } else {
181
+ t8 = $[28];
182
+ }
183
+ return t8;
78
184
  }
79
185
  function TooltipTrigger(t0) {
80
186
  const $ = _c(4);
@@ -99,79 +205,101 @@ function TooltipTrigger(t0) {
99
205
  }
100
206
  return t1;
101
207
  }
208
+ /**
209
+ * Renders Arc's bubble: inverted colors, a hairline border, the raised shadow and 15rem of maximum width.
210
+ * @param props - Radix content properties. `sideOffset` defaults to 8px and `collisionPadding` to 12px.
211
+ * @returns The portaled bubble.
212
+ */
102
213
  function TooltipContent(t0) {
103
- const $ = _c(16);
214
+ const $ = _c(22);
104
215
  let children;
105
216
  let className;
106
217
  let props;
107
218
  let t1;
219
+ let t2;
108
220
  if ($[0] !== t0) {
109
- ({className, sideOffset: t1, children, ...props} = t0);
221
+ ({className, sideOffset: t1, collisionPadding: t2, children, ...props} = t0);
110
222
  $[0] = t0;
111
223
  $[1] = children;
112
224
  $[2] = className;
113
225
  $[3] = props;
114
226
  $[4] = t1;
227
+ $[5] = t2;
115
228
  } else {
116
229
  children = $[1];
117
230
  className = $[2];
118
231
  props = $[3];
119
232
  t1 = $[4];
233
+ t2 = $[5];
120
234
  }
121
- const sideOffset = t1 === undefined ? 0 : t1;
122
- const t2 = props.forceMount;
123
- let t3;
124
- if ($[5] !== className) {
125
- t3 = cn("z-50 inline-flex w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm ", className);
126
- $[5] = className;
127
- $[6] = t3;
128
- } else {
129
- t3 = $[6];
130
- }
235
+ const sideOffset = t1 === undefined ? TOOLTIP_SIDE_OFFSET_PX : t1;
236
+ const collisionPadding = t2 === undefined ? TOOLTIP_COLLISION_PADDING_PX : t2;
237
+ const openedWhileWarm = React.useContext(TooltipOpenedWhileWarmContext);
238
+ const t3 = props.forceMount;
131
239
  let t4;
132
- if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
133
- t4 = /* @__PURE__ */ _jsx(TooltipPrimitive.Arrow, { className: "z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground" });
240
+ if ($[6] !== openedWhileWarm) {
241
+ t4 = () => openedWhileWarm ? TOOLTIP_INSTANT_MOTION : TOOLTIP_MOTION;
242
+ $[6] = openedWhileWarm;
134
243
  $[7] = t4;
135
244
  } else {
136
245
  t4 = $[7];
137
246
  }
138
247
  let t5;
139
- if ($[8] !== children || $[9] !== props || $[10] !== sideOffset || $[11] !== t3) {
140
- t5 = /* @__PURE__ */ _jsx(MotionSlot, {
141
- kind: "tooltip",
142
- children: /* @__PURE__ */ _jsxs(TooltipPrimitive.Content, {
143
- forceMount: true,
144
- "data-slot": "tooltip-content",
145
- sideOffset,
146
- className: t3,
147
- ...props,
148
- children: [children, t4]
149
- })
150
- });
151
- $[8] = children;
152
- $[9] = props;
153
- $[10] = sideOffset;
154
- $[11] = t3;
155
- $[12] = t5;
248
+ if ($[8] !== className) {
249
+ t5 = cn("z-50 inline-flex w-fit max-w-60 origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-(--radius-control) border border-[color-mix(in_oklab,var(--background)_14%,var(--foreground))] bg-foreground px-(--space-4) py-(--space-3) font-sans text-sm leading-(--leading-body) font-normal tracking-(--tracking-body) text-background shadow-(--shadow-raised) has-data-[slot=kbd]:pr-(--space-3) **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm", className);
250
+ $[8] = className;
251
+ $[9] = t5;
156
252
  } else {
157
- t5 = $[12];
253
+ t5 = $[9];
158
254
  }
159
255
  let t6;
160
- if ($[13] !== props.forceMount || $[14] !== t5) {
161
- t6 = /* @__PURE__ */ _jsx(TooltipPrimitive.Portal, {
256
+ if ($[10] !== children || $[11] !== collisionPadding || $[12] !== props || $[13] !== sideOffset || $[14] !== t5) {
257
+ t6 = /* @__PURE__ */ _jsx(TooltipPrimitive.Content, {
162
258
  forceMount: true,
163
- children: /* @__PURE__ */ _jsx(MotionPresence, {
164
- scope: "tooltip",
165
- forceMount: t2,
166
- children: t5
167
- })
259
+ "data-slot": "tooltip-content",
260
+ sideOffset,
261
+ collisionPadding,
262
+ className: t5,
263
+ ...props,
264
+ children
168
265
  });
169
- $[13] = props.forceMount;
266
+ $[10] = children;
267
+ $[11] = collisionPadding;
268
+ $[12] = props;
269
+ $[13] = sideOffset;
170
270
  $[14] = t5;
171
271
  $[15] = t6;
172
272
  } else {
173
273
  t6 = $[15];
174
274
  }
175
- return t6;
275
+ let t7;
276
+ if ($[16] !== t4 || $[17] !== t6) {
277
+ t7 = /* @__PURE__ */ _jsx(ArcFloatingSlot, {
278
+ motion: t4,
279
+ children: t6
280
+ });
281
+ $[16] = t4;
282
+ $[17] = t6;
283
+ $[18] = t7;
284
+ } else {
285
+ t7 = $[18];
286
+ }
287
+ let t8;
288
+ if ($[19] !== props.forceMount || $[20] !== t7) {
289
+ t8 = /* @__PURE__ */ _jsx(TooltipPrimitive.Portal, {
290
+ forceMount: true,
291
+ children: /* @__PURE__ */ _jsx(MotionPresence, {
292
+ scope: "tooltip",
293
+ forceMount: t3,
294
+ children: t7
295
+ })
296
+ });
297
+ $[19] = props.forceMount;
298
+ $[20] = t7;
299
+ $[21] = t8;
300
+ } else {
301
+ t8 = $[21];
302
+ }
303
+ return t8;
176
304
  }
177
305
  export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
@@ -0,0 +1,12 @@
1
+ /** Copy and options of Arc's Alert. */
2
+ /** Arc's semantic tones for an alert; `danger` interrupts as an alert, the rest are polite statuses. */
3
+ export type AlertTone = "info" | "success" | "warning" | "danger";
4
+ /** Default Spanish accessible name of the dismiss button. */
5
+ export declare const ALERT_DISMISS_LABEL = "Descartar aviso";
6
+ /** Live-region roles: only a danger alert interrupts; every other tone is announced politely. */
7
+ export declare const ALERT_TONE_ROLE: {
8
+ readonly info: "status";
9
+ readonly success: "status";
10
+ readonly warning: "status";
11
+ readonly danger: "alert";
12
+ };
@@ -0,0 +1,9 @@
1
+ /** Default Spanish accessible name of the dismiss button. */
2
+ export const ALERT_DISMISS_LABEL = "Descartar aviso";
3
+ /** Live-region roles: only a danger alert interrupts; every other tone is announced politely. */
4
+ export const ALERT_TONE_ROLE = {
5
+ info: "status",
6
+ success: "status",
7
+ warning: "status",
8
+ danger: "alert"
9
+ };
@@ -0,0 +1,10 @@
1
+ /** Copy and options of Arc's Avatar presence dot. */
2
+ /** Presence an avatar can show with Arc's status dot. */
3
+ export type AvatarStatus = "online" | "offline";
4
+ /** Default Spanish labels read by assistive technology for each presence. */
5
+ export declare const AVATAR_STATUS_LABEL: {
6
+ readonly online: "En línea";
7
+ readonly offline: "Desconectado";
8
+ };
9
+ /** Scale the status dot grows from and shrinks back to. */
10
+ export declare const AVATAR_STATUS_HIDDEN_SCALE = 0.6;
@@ -0,0 +1,7 @@
1
+ /** Default Spanish labels read by assistive technology for each presence. */
2
+ export const AVATAR_STATUS_LABEL = {
3
+ online: "En línea",
4
+ offline: "Desconectado"
5
+ };
6
+ /** Scale the status dot grows from and shrinks back to. */
7
+ export const AVATAR_STATUS_HIDDEN_SCALE = .6;
@@ -0,0 +1,6 @@
1
+ /** Tuning of Arc's Badge label swap. */
2
+ /** Vertical offsets, in em, of a new label rising in and the old one lifting out. */
3
+ export declare const BADGE_LABEL_OFFSET_EM: {
4
+ readonly enter: 0.3;
5
+ readonly exit: -0.3;
6
+ };
@@ -0,0 +1,6 @@
1
+ /** Tuning of Arc's Badge label swap. */
2
+ /** Vertical offsets, in em, of a new label rising in and the old one lifting out. */
3
+ export const BADGE_LABEL_OFFSET_EM = {
4
+ enter: .3,
5
+ exit: -.3
6
+ };
@@ -0,0 +1,24 @@
1
+ /** Tuning of `Calendar`, adapted from Arc's calendar (https://uiarc.dev, MIT License, see THIRD_PARTY_NOTICES.md). */
2
+ /** Spring of a month sliding in: Arc's month strip, critically damped so it never overshoots or queues. */
3
+ export declare const CALENDAR_MONTH_SPRING: {
4
+ readonly type: "spring";
5
+ readonly visualDuration: 0.36;
6
+ readonly bounce: 0;
7
+ readonly restDelta: 0.002;
8
+ };
9
+ /** Opacity a month starts from while it slides in, matching Arc's neighbouring pane one step off the strip. */
10
+ export declare const CALENDAR_MONTH_ENTER_OPACITY = 0.4;
11
+ /** Scale the selected disc grows from when the selection enters a month. */
12
+ export declare const CALENDAR_SELECTION_ENTER_SCALE = 0.6;
13
+ /** Duration, in seconds, of the selected disc fading out when the selection leaves a month. */
14
+ export declare const CALENDAR_SELECTION_EXIT_DURATION_S = 0.14;
15
+ /** Day button that holds a single selection, the only one the gliding disc follows. */
16
+ export declare const CALENDAR_SELECTED_DAY_SELECTOR = "[data-selected-single=\"true\"]";
17
+ /** Attribute the month sets while its disc paints the selection, so the selected day drops its own fill. */
18
+ export declare const CALENDAR_SELECTION_DISC_ATTRIBUTE = "data-selection-disc";
19
+ /** Default copy of the optional Today button. */
20
+ export declare const CALENDAR_COPY: {
21
+ readonly today: "Hoy";
22
+ };
23
+ /** Months in a year, to compare dates by calendar month. */
24
+ export declare const CALENDAR_MONTHS_PER_YEAR = 12;