beez-ui 0.4.2 → 0.5.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 (53) hide show
  1. package/CHANGELOG.md +35 -27
  2. package/README.md +28 -5
  3. package/dist/adapters/unpic-image.js +92 -14
  4. package/dist/components/alert-dialog.js +444 -26
  5. package/dist/components/alert.js +153 -18
  6. package/dist/components/animated-theme-toggler.js +215 -76
  7. package/dist/components/avatar.js +247 -15
  8. package/dist/components/badge.js +18 -16
  9. package/dist/components/button.js +85 -28
  10. package/dist/components/calendar.js +327 -68
  11. package/dist/components/card.js +39 -9
  12. package/dist/components/carousel.js +454 -84
  13. package/dist/components/checkbox.js +50 -3
  14. package/dist/components/data-table.js +827 -583
  15. package/dist/components/dialog.js +363 -22
  16. package/dist/components/dropdown-menu.d.ts +1 -0
  17. package/dist/components/dropdown-menu.js +544 -32
  18. package/dist/components/filter-query-bar.js +809 -468
  19. package/dist/components/filter-query-grammar.js +781 -736
  20. package/dist/components/form.js +305 -43
  21. package/dist/components/highlighter.js +142 -87
  22. package/dist/components/hover-card.js +97 -7
  23. package/dist/components/input-group.js +261 -41
  24. package/dist/components/input.js +8 -2
  25. package/dist/components/label.js +38 -3
  26. package/dist/components/link.js +45 -7
  27. package/dist/components/pagination.js +332 -16
  28. package/dist/components/popover.js +222 -16
  29. package/dist/components/radio-group.js +85 -5
  30. package/dist/components/select.js +451 -22
  31. package/dist/components/separator.js +43 -3
  32. package/dist/components/sheet.js +345 -22
  33. package/dist/components/sidebar.js +1385 -193
  34. package/dist/components/skeleton.js +6 -2
  35. package/dist/components/svgs/whatsappIcon.js +11 -1
  36. package/dist/components/switch.js +55 -3
  37. package/dist/components/table.js +288 -18
  38. package/dist/components/tabs.js +161 -18
  39. package/dist/components/textarea.js +7 -2
  40. package/dist/components/themed-toaster.js +63 -20
  41. package/dist/components/tooltip.js +128 -9
  42. package/dist/components/typing-animation.js +335 -150
  43. package/dist/constants/sidebar.js +1 -4
  44. package/dist/hooks/use-mobile.js +8 -8
  45. package/dist/hooks/use-sidebar-persistence.js +27 -27
  46. package/dist/lib/image-dimensions.js +2 -2
  47. package/dist/lib/year-month-filter.js +38 -40
  48. package/dist/next.js +69 -17
  49. package/dist/providers/beez-ui-provider.js +48 -7
  50. package/dist/providers/native-provider.js +40 -6
  51. package/dist/styles.css +1 -1
  52. package/dist/tanstack.js +35 -23
  53. package/package.json +4 -1
@@ -1,88 +1,227 @@
1
1
  "use client";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { useCallback, useRef, useSyncExternalStore } from "react";
2
+ import { c as _c } from "react/compiler-runtime";
3
+ import { useRef, useSyncExternalStore } from "react";
4
4
  import { Monitor, Moon, Sun, SunMoon } from "lucide-react";
5
5
  import { flushSync } from "react-dom";
6
6
  import { useTheme } from "next-themes";
7
- import { DropdownMenu, DropdownMenuContent, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuTrigger, } from "./dropdown-menu.js";
7
+ import { DropdownMenu, DropdownMenuContent, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuTrigger } from "./dropdown-menu.js";
8
8
  import { cn } from "../lib/utils.js";
9
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
9
10
  const THEME_OPTIONS = [
10
- {
11
- icon: Sun,
12
- label: "Claro",
13
- value: "light",
14
- },
15
- {
16
- icon: Moon,
17
- label: "Oscuro",
18
- value: "dark",
19
- },
20
- {
21
- icon: Monitor,
22
- label: "Sistema",
23
- value: "system",
24
- },
11
+ {
12
+ icon: Sun,
13
+ label: "Claro",
14
+ value: "light"
15
+ },
16
+ {
17
+ icon: Moon,
18
+ label: "Oscuro",
19
+ value: "dark"
20
+ },
21
+ {
22
+ icon: Monitor,
23
+ label: "Sistema",
24
+ value: "system"
25
+ }
25
26
  ];
26
27
  /** Restricts transition styling to theme changes initiated by this component. */
27
28
  const THEME_TRANSITION_CLASS = "BeezThemeTransition";
28
29
  /** Respects user preferences when deciding whether to animate a theme change. */
29
30
  const REDUCED_MOTION_QUERY = "(prefers-reduced-motion: reduce)";
30
- export const AnimatedThemeToggler = ({ className, duration = 400, disabled, theme: controlledTheme, resolvedTheme: controlledResolvedTheme, onThemeChange: controlledOnThemeChange, ...props }) => {
31
- const providerTheme = useTheme();
32
- const theme = controlledTheme ?? providerTheme.theme;
33
- const resolvedTheme = controlledResolvedTheme ?? providerTheme.resolvedTheme;
34
- const onThemeChange = controlledOnThemeChange ?? providerTheme.setTheme;
35
- const buttonRef = useRef(null);
36
- const isHydrated = useSyncExternalStore(() => () => undefined, () => true, () => false);
37
- const isThemeReady = isHydrated &&
38
- (resolvedTheme === "light" || resolvedTheme === "dark");
39
- const isDark = resolvedTheme === "dark";
40
- const selectedTheme = theme === "light" || theme === "dark" || theme === "system"
41
- ? theme
42
- : "system";
43
- const isDisabled = !isThemeReady || disabled;
44
- const selectTheme = useCallback((nextTheme) => {
45
- const button = buttonRef.current;
46
- if (!button || typeof document === "undefined" || isDisabled) {
47
- return;
48
- }
49
- const { top, left, width, height } = button.getBoundingClientRect();
50
- const x = left + width / 2;
51
- const y = top + height / 2;
52
- const viewportWidth = window.visualViewport?.width ?? window.innerWidth;
53
- const viewportHeight = window.visualViewport?.height ?? window.innerHeight;
54
- const maxRadius = Math.hypot(Math.max(x, viewportWidth - x), Math.max(y, viewportHeight - y));
55
- const applyTheme = () => {
56
- onThemeChange(nextTheme);
57
- };
58
- if (typeof document.startViewTransition !== "function" ||
59
- typeof document.documentElement.animate !== "function" ||
60
- window.matchMedia?.(REDUCED_MOTION_QUERY).matches) {
61
- applyTheme();
62
- return;
63
- }
64
- document.documentElement.classList.add(THEME_TRANSITION_CLASS);
65
- const transition = document.startViewTransition(() => {
66
- flushSync(applyTheme);
67
- });
68
- void transition.ready.then(() => {
69
- return document.documentElement.animate({
70
- clipPath: [
71
- `circle(0px at ${x}px ${y}px)`,
72
- `circle(${maxRadius}px at ${x}px ${y}px)`,
73
- ],
74
- }, {
75
- duration,
76
- easing: "ease-in-out",
77
- pseudoElement: "::view-transition-new(root)",
78
- }).finished;
79
- }).catch(() => {
80
- // Skipped transitions retain the applied theme without an unhandled rejection.
81
- }).finally(() => {
82
- document.documentElement.classList.remove(THEME_TRANSITION_CLASS);
83
- });
84
- }, [duration, isDisabled, onThemeChange]);
85
- return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs("button", { type: "button", ref: buttonRef, disabled: isDisabled, className: cn(className), ...props, children: [!isThemeReady ? _jsx(SunMoon, { "aria-hidden": "true" }) : isDark ? _jsx(Moon, { "aria-hidden": "true" }) : _jsx(Sun, { "aria-hidden": "true" }), _jsx("span", { className: "sr-only", children: "Alternar tema" })] }) }), _jsx(DropdownMenuContent, { align: "end", className: "w-44 rounded-xl p-2", side: "bottom", sideOffset: 8, children: _jsx(DropdownMenuRadioGroup, { onValueChange: (nextTheme) => {
86
- selectTheme(nextTheme);
87
- }, value: selectedTheme, children: THEME_OPTIONS.map(({ icon: Icon, label, value }) => (_jsxs(DropdownMenuRadioItem, { className: "h-11 gap-3 px-3 pr-9 text-base", value: value, children: [_jsx(Icon, { "aria-hidden": "true", className: "size-5" }), _jsx("span", { children: label })] }, value))) }) })] }));
31
+ export const AnimatedThemeToggler = (t0) => {
32
+ const $ = _c(32);
33
+ let className;
34
+ let controlledOnThemeChange;
35
+ let controlledResolvedTheme;
36
+ let controlledTheme;
37
+ let disabled;
38
+ let props;
39
+ let t1;
40
+ if ($[0] !== t0) {
41
+ ({className, duration: t1, disabled, theme: controlledTheme, resolvedTheme: controlledResolvedTheme, onThemeChange: controlledOnThemeChange, ...props} = t0);
42
+ $[0] = t0;
43
+ $[1] = className;
44
+ $[2] = controlledOnThemeChange;
45
+ $[3] = controlledResolvedTheme;
46
+ $[4] = controlledTheme;
47
+ $[5] = disabled;
48
+ $[6] = props;
49
+ $[7] = t1;
50
+ } else {
51
+ className = $[1];
52
+ controlledOnThemeChange = $[2];
53
+ controlledResolvedTheme = $[3];
54
+ controlledTheme = $[4];
55
+ disabled = $[5];
56
+ props = $[6];
57
+ t1 = $[7];
58
+ }
59
+ const duration = t1 === undefined ? 400 : t1;
60
+ const providerTheme = useTheme();
61
+ const theme = controlledTheme ?? providerTheme.theme;
62
+ const resolvedTheme = controlledResolvedTheme ?? providerTheme.resolvedTheme;
63
+ const onThemeChange = controlledOnThemeChange ?? providerTheme.setTheme;
64
+ const buttonRef = useRef(null);
65
+ const isHydrated = useSyncExternalStore(_temp2, _temp3, _temp4);
66
+ const isThemeReady = isHydrated && (resolvedTheme === "light" || resolvedTheme === "dark");
67
+ const isDark = resolvedTheme === "dark";
68
+ const selectedTheme = theme === "light" || theme === "dark" || theme === "system" ? theme : "system";
69
+ const isDisabled = !isThemeReady || disabled;
70
+ let t2;
71
+ if ($[8] !== duration || $[9] !== isDisabled || $[10] !== onThemeChange) {
72
+ t2 = (nextTheme) => {
73
+ const button = buttonRef.current;
74
+ if (!button || typeof document === "undefined" || isDisabled) {
75
+ return;
76
+ }
77
+ const { top, left, width, height } = button.getBoundingClientRect();
78
+ const x = left + width / 2;
79
+ const y = top + height / 2;
80
+ const viewportWidth = window.visualViewport?.width ?? window.innerWidth;
81
+ const viewportHeight = window.visualViewport?.height ?? window.innerHeight;
82
+ const maxRadius = Math.hypot(Math.max(x, viewportWidth - x), Math.max(y, viewportHeight - y));
83
+ const applyTheme = () => {
84
+ onThemeChange(nextTheme);
85
+ };
86
+ if (typeof document.startViewTransition !== "function" || typeof document.documentElement.animate !== "function" || window.matchMedia?.(REDUCED_MOTION_QUERY).matches) {
87
+ applyTheme();
88
+ return;
89
+ }
90
+ document.documentElement.classList.add(THEME_TRANSITION_CLASS);
91
+ const transition = document.startViewTransition(() => {
92
+ flushSync(applyTheme);
93
+ });
94
+ transition.ready.then(() => document.documentElement.animate({ clipPath: [`circle(0px at ${x}px ${y}px)`, `circle(${maxRadius}px at ${x}px ${y}px)`] }, {
95
+ duration,
96
+ easing: "ease-in-out",
97
+ pseudoElement: "::view-transition-new(root)"
98
+ }).finished).catch(_temp5).finally(_temp6);
99
+ };
100
+ $[8] = duration;
101
+ $[9] = isDisabled;
102
+ $[10] = onThemeChange;
103
+ $[11] = t2;
104
+ } else {
105
+ t2 = $[11];
106
+ }
107
+ const selectTheme = t2;
108
+ let t3;
109
+ if ($[12] !== className) {
110
+ t3 = cn(className);
111
+ $[12] = className;
112
+ $[13] = t3;
113
+ } else {
114
+ t3 = $[13];
115
+ }
116
+ let t4;
117
+ if ($[14] !== isDark || $[15] !== isThemeReady) {
118
+ t4 = !isThemeReady ? /* @__PURE__ */ _jsx(SunMoon, { "aria-hidden": "true" }) : isDark ? /* @__PURE__ */ _jsx(Moon, { "aria-hidden": "true" }) : /* @__PURE__ */ _jsx(Sun, { "aria-hidden": "true" });
119
+ $[14] = isDark;
120
+ $[15] = isThemeReady;
121
+ $[16] = t4;
122
+ } else {
123
+ t4 = $[16];
124
+ }
125
+ let t5;
126
+ if ($[17] === Symbol.for("react.memo_cache_sentinel")) {
127
+ t5 = /* @__PURE__ */ _jsx("span", {
128
+ className: "sr-only",
129
+ children: "Alternar tema"
130
+ });
131
+ $[17] = t5;
132
+ } else {
133
+ t5 = $[17];
134
+ }
135
+ let t6;
136
+ if ($[18] !== isDisabled || $[19] !== props || $[20] !== t3 || $[21] !== t4) {
137
+ t6 = /* @__PURE__ */ _jsx(DropdownMenuTrigger, {
138
+ asChild: true,
139
+ children: /* @__PURE__ */ _jsxs("button", {
140
+ type: "button",
141
+ ref: buttonRef,
142
+ disabled: isDisabled,
143
+ className: t3,
144
+ ...props,
145
+ children: [t4, t5]
146
+ })
147
+ });
148
+ $[18] = isDisabled;
149
+ $[19] = props;
150
+ $[20] = t3;
151
+ $[21] = t4;
152
+ $[22] = t6;
153
+ } else {
154
+ t6 = $[22];
155
+ }
156
+ let t7;
157
+ if ($[23] !== selectTheme) {
158
+ t7 = (nextTheme_0) => {
159
+ selectTheme(nextTheme_0);
160
+ };
161
+ $[23] = selectTheme;
162
+ $[24] = t7;
163
+ } else {
164
+ t7 = $[24];
165
+ }
166
+ let t8;
167
+ if ($[25] === Symbol.for("react.memo_cache_sentinel")) {
168
+ t8 = THEME_OPTIONS.map(_temp7);
169
+ $[25] = t8;
170
+ } else {
171
+ t8 = $[25];
172
+ }
173
+ let t9;
174
+ if ($[26] !== selectedTheme || $[27] !== t7) {
175
+ t9 = /* @__PURE__ */ _jsx(DropdownMenuContent, {
176
+ align: "end",
177
+ className: "w-44 rounded-xl p-2",
178
+ side: "bottom",
179
+ sideOffset: 8,
180
+ children: /* @__PURE__ */ _jsx(DropdownMenuRadioGroup, {
181
+ onValueChange: t7,
182
+ value: selectedTheme,
183
+ children: t8
184
+ })
185
+ });
186
+ $[26] = selectedTheme;
187
+ $[27] = t7;
188
+ $[28] = t9;
189
+ } else {
190
+ t9 = $[28];
191
+ }
192
+ let t10;
193
+ if ($[29] !== t6 || $[30] !== t9) {
194
+ t10 = /* @__PURE__ */ _jsxs(DropdownMenu, { children: [t6, t9] });
195
+ $[29] = t6;
196
+ $[30] = t9;
197
+ $[31] = t10;
198
+ } else {
199
+ t10 = $[31];
200
+ }
201
+ return t10;
88
202
  };
203
+ function _temp() {}
204
+ function _temp2() {
205
+ return _temp;
206
+ }
207
+ function _temp3() {
208
+ return true;
209
+ }
210
+ function _temp4() {
211
+ return false;
212
+ }
213
+ function _temp5() {}
214
+ function _temp6() {
215
+ document.documentElement.classList.remove(THEME_TRANSITION_CLASS);
216
+ }
217
+ function _temp7(t0) {
218
+ const { icon: Icon, label, value } = t0;
219
+ return /* @__PURE__ */ _jsxs(DropdownMenuRadioItem, {
220
+ className: "h-11 gap-3 px-3 pr-9 text-base",
221
+ value,
222
+ children: [/* @__PURE__ */ _jsx(Icon, {
223
+ "aria-hidden": "true",
224
+ className: "size-5"
225
+ }), /* @__PURE__ */ _jsx("span", { children: label })]
226
+ }, value);
227
+ }
@@ -1,26 +1,258 @@
1
1
  "use client";
2
- import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { c as _c } from "react/compiler-runtime";
3
+ import * as React from "react";
3
4
  import { Avatar as AvatarPrimitive } from "@base-ui/react/avatar";
4
5
  import { cn } from "../lib/utils.js";
5
6
  import { useBeezUIComponents } from "../providers/beez-ui-provider.js";
6
- function Avatar({ className, size = "default", ...props }) {
7
- return (_jsx(AvatarPrimitive.Root, { "data-slot": "avatar", "data-size": size, className: cn("group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten", className), ...props }));
7
+ import { jsx as _jsx } from "react/jsx-runtime";
8
+ function Avatar(t0) {
9
+ const $ = _c(10);
10
+ let className;
11
+ let props;
12
+ let t1;
13
+ if ($[0] !== t0) {
14
+ ({className, size: t1, ...props} = t0);
15
+ $[0] = t0;
16
+ $[1] = className;
17
+ $[2] = props;
18
+ $[3] = t1;
19
+ } else {
20
+ className = $[1];
21
+ props = $[2];
22
+ t1 = $[3];
23
+ }
24
+ const size = t1 === undefined ? "default" : t1;
25
+ let t2;
26
+ if ($[4] !== className) {
27
+ t2 = cn("group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten", className);
28
+ $[4] = className;
29
+ $[5] = t2;
30
+ } else {
31
+ t2 = $[5];
32
+ }
33
+ let t3;
34
+ if ($[6] !== props || $[7] !== size || $[8] !== t2) {
35
+ t3 = /* @__PURE__ */ _jsx(AvatarPrimitive.Root, {
36
+ "data-slot": "avatar",
37
+ "data-size": size,
38
+ className: t2,
39
+ ...props
40
+ });
41
+ $[6] = props;
42
+ $[7] = size;
43
+ $[8] = t2;
44
+ $[9] = t3;
45
+ } else {
46
+ t3 = $[9];
47
+ }
48
+ return t3;
8
49
  }
9
50
  /** Delegates loading, failure and fallback synchronization to the avatar primitive. */
10
- function AvatarImage({ alt = "", className, src, ...props }) {
11
- const { Image: ImageComponent = "img" } = useBeezUIComponents();
12
- return (_jsx(AvatarPrimitive.Image, { render: _jsx(ImageComponent, {}), keepMounted: true, alt: alt, "data-slot": "avatar-image", className: cn("absolute inset-0 aspect-square size-full rounded-full object-cover data-[loading]:opacity-0 data-[error]:hidden", className), src: src ?? undefined, loading: "lazy", decoding: "async", ...props }));
51
+ function AvatarImage(t0) {
52
+ const $ = _c(15);
53
+ let className;
54
+ let props;
55
+ let src;
56
+ let t1;
57
+ if ($[0] !== t0) {
58
+ ({alt: t1, className, src, ...props} = t0);
59
+ $[0] = t0;
60
+ $[1] = className;
61
+ $[2] = props;
62
+ $[3] = src;
63
+ $[4] = t1;
64
+ } else {
65
+ className = $[1];
66
+ props = $[2];
67
+ src = $[3];
68
+ t1 = $[4];
69
+ }
70
+ const alt = t1 === undefined ? "" : t1;
71
+ const { Image: t2 } = useBeezUIComponents();
72
+ const ImageComponent = t2 === undefined ? "img" : t2;
73
+ let t3;
74
+ if ($[5] !== ImageComponent) {
75
+ t3 = /* @__PURE__ */ _jsx(ImageComponent, {});
76
+ $[5] = ImageComponent;
77
+ $[6] = t3;
78
+ } else {
79
+ t3 = $[6];
80
+ }
81
+ let t4;
82
+ if ($[7] !== className) {
83
+ t4 = cn("absolute inset-0 aspect-square size-full rounded-full object-cover data-[loading]:opacity-0 data-[error]:hidden", className);
84
+ $[7] = className;
85
+ $[8] = t4;
86
+ } else {
87
+ t4 = $[8];
88
+ }
89
+ const t5 = src ?? undefined;
90
+ let t6;
91
+ if ($[9] !== alt || $[10] !== props || $[11] !== t3 || $[12] !== t4 || $[13] !== t5) {
92
+ t6 = /* @__PURE__ */ _jsx(AvatarPrimitive.Image, {
93
+ render: t3,
94
+ keepMounted: true,
95
+ alt,
96
+ "data-slot": "avatar-image",
97
+ className: t4,
98
+ src: t5,
99
+ loading: "lazy",
100
+ decoding: "async",
101
+ ...props
102
+ });
103
+ $[9] = alt;
104
+ $[10] = props;
105
+ $[11] = t3;
106
+ $[12] = t4;
107
+ $[13] = t5;
108
+ $[14] = t6;
109
+ } else {
110
+ t6 = $[14];
111
+ }
112
+ return t6;
13
113
  }
14
- function AvatarFallback({ className, ...props }) {
15
- return (_jsx(AvatarPrimitive.Fallback, { "data-slot": "avatar-fallback", className: cn("flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs", className), ...props }));
114
+ function AvatarFallback(t0) {
115
+ const $ = _c(8);
116
+ let className;
117
+ let props;
118
+ if ($[0] !== t0) {
119
+ ({className, ...props} = t0);
120
+ $[0] = t0;
121
+ $[1] = className;
122
+ $[2] = props;
123
+ } else {
124
+ className = $[1];
125
+ props = $[2];
126
+ }
127
+ let t1;
128
+ if ($[3] !== className) {
129
+ t1 = cn("flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs", className);
130
+ $[3] = className;
131
+ $[4] = t1;
132
+ } else {
133
+ t1 = $[4];
134
+ }
135
+ let t2;
136
+ if ($[5] !== props || $[6] !== t1) {
137
+ t2 = /* @__PURE__ */ _jsx(AvatarPrimitive.Fallback, {
138
+ "data-slot": "avatar-fallback",
139
+ className: t1,
140
+ ...props
141
+ });
142
+ $[5] = props;
143
+ $[6] = t1;
144
+ $[7] = t2;
145
+ } else {
146
+ t2 = $[7];
147
+ }
148
+ return t2;
16
149
  }
17
- function AvatarBadge({ className, ...props }) {
18
- return (_jsx("span", { "data-slot": "avatar-badge", className: cn("absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full bg-primary text-primary-foreground bg-blend-color ring-2 ring-background select-none", "group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden", "group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2", "group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2", className), ...props }));
150
+ function AvatarBadge(t0) {
151
+ const $ = _c(8);
152
+ let className;
153
+ let props;
154
+ if ($[0] !== t0) {
155
+ ({className, ...props} = t0);
156
+ $[0] = t0;
157
+ $[1] = className;
158
+ $[2] = props;
159
+ } else {
160
+ className = $[1];
161
+ props = $[2];
162
+ }
163
+ let t1;
164
+ if ($[3] !== className) {
165
+ t1 = cn("absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full bg-primary text-primary-foreground bg-blend-color ring-2 ring-background select-none", "group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden", "group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2", "group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2", className);
166
+ $[3] = className;
167
+ $[4] = t1;
168
+ } else {
169
+ t1 = $[4];
170
+ }
171
+ let t2;
172
+ if ($[5] !== props || $[6] !== t1) {
173
+ t2 = /* @__PURE__ */ _jsx("span", {
174
+ "data-slot": "avatar-badge",
175
+ className: t1,
176
+ ...props
177
+ });
178
+ $[5] = props;
179
+ $[6] = t1;
180
+ $[7] = t2;
181
+ } else {
182
+ t2 = $[7];
183
+ }
184
+ return t2;
19
185
  }
20
- function AvatarGroup({ className, ...props }) {
21
- return (_jsx("div", { "data-slot": "avatar-group", className: cn("group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2 *:data-[slot=avatar]:ring-background", className), ...props }));
186
+ function AvatarGroup(t0) {
187
+ const $ = _c(8);
188
+ let className;
189
+ let props;
190
+ if ($[0] !== t0) {
191
+ ({className, ...props} = t0);
192
+ $[0] = t0;
193
+ $[1] = className;
194
+ $[2] = props;
195
+ } else {
196
+ className = $[1];
197
+ props = $[2];
198
+ }
199
+ let t1;
200
+ if ($[3] !== className) {
201
+ t1 = cn("group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2 *:data-[slot=avatar]:ring-background", className);
202
+ $[3] = className;
203
+ $[4] = t1;
204
+ } else {
205
+ t1 = $[4];
206
+ }
207
+ let t2;
208
+ if ($[5] !== props || $[6] !== t1) {
209
+ t2 = /* @__PURE__ */ _jsx("div", {
210
+ "data-slot": "avatar-group",
211
+ className: t1,
212
+ ...props
213
+ });
214
+ $[5] = props;
215
+ $[6] = t1;
216
+ $[7] = t2;
217
+ } else {
218
+ t2 = $[7];
219
+ }
220
+ return t2;
22
221
  }
23
- function AvatarGroupCount({ className, ...props }) {
24
- return (_jsx("div", { "data-slot": "avatar-group-count", className: cn("relative flex size-8 shrink-0 items-center justify-center rounded-full bg-muted text-sm text-muted-foreground ring-2 ring-background group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6 [&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3", className), ...props }));
222
+ function AvatarGroupCount(t0) {
223
+ const $ = _c(8);
224
+ let className;
225
+ let props;
226
+ if ($[0] !== t0) {
227
+ ({className, ...props} = t0);
228
+ $[0] = t0;
229
+ $[1] = className;
230
+ $[2] = props;
231
+ } else {
232
+ className = $[1];
233
+ props = $[2];
234
+ }
235
+ let t1;
236
+ if ($[3] !== className) {
237
+ t1 = cn("relative flex size-8 shrink-0 items-center justify-center rounded-full bg-muted text-sm text-muted-foreground ring-2 ring-background group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6 [&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3", className);
238
+ $[3] = className;
239
+ $[4] = t1;
240
+ } else {
241
+ t1 = $[4];
242
+ }
243
+ let t2;
244
+ if ($[5] !== props || $[6] !== t1) {
245
+ t2 = /* @__PURE__ */ _jsx("div", {
246
+ "data-slot": "avatar-group-count",
247
+ className: t1,
248
+ ...props
249
+ });
250
+ $[5] = props;
251
+ $[6] = t1;
252
+ $[7] = t2;
253
+ } else {
254
+ t2 = $[7];
255
+ }
256
+ return t2;
25
257
  }
26
- export { Avatar, AvatarImage, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarBadge, };
258
+ export { Avatar, AvatarImage, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarBadge };
@@ -1,24 +1,26 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import * as React from "react";
2
2
  import { cva } from "class-variance-authority";
3
3
  import { Slot } from "radix-ui";
4
4
  import { cn } from "../lib/utils.js";
5
+ import { jsx as _jsx } from "react/jsx-runtime";
5
6
  const badgeVariants = cva("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!", {
6
- variants: {
7
- variant: {
8
- default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",
9
- secondary: "bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",
10
- destructive: "bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",
11
- outline: "border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",
12
- ghost: "hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",
13
- link: "text-primary underline-offset-4 hover:underline",
14
- },
15
- },
16
- defaultVariants: {
17
- variant: "default",
18
- },
7
+ variants: { variant: {
8
+ default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",
9
+ secondary: "bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",
10
+ destructive: "bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",
11
+ outline: "border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",
12
+ ghost: "hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",
13
+ link: "text-primary underline-offset-4 hover:underline"
14
+ } },
15
+ defaultVariants: { variant: "default" }
19
16
  });
20
17
  function Badge({ className, variant = "default", asChild = false, ...props }) {
21
- const Comp = asChild ? Slot.Root : "span";
22
- return (_jsx(Comp, { "data-slot": "badge", "data-variant": variant, className: cn(badgeVariants({ variant }), className), ...props }));
18
+ const Comp = asChild ? Slot.Root : "span";
19
+ return /* @__PURE__ */ _jsx(Comp, {
20
+ "data-slot": "badge",
21
+ "data-variant": variant,
22
+ className: cn(badgeVariants({ variant }), className),
23
+ ...props
24
+ });
23
25
  }
24
26
  export { Badge, badgeVariants };