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
@@ -6,7 +6,7 @@ import { animate, frame } from "motion/react";
6
6
  import { MotionSlot } from "../motion/motion-slot.js";
7
7
  import { MOTION_EASE } from "../motion/tokens.js";
8
8
  import { useTheme } from "next-themes";
9
- import { DropdownMenu, DropdownMenuContent, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuTrigger } from "./dropdown-menu.js";
9
+ import { DropdownMenu, DropdownMenuContent, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuTrigger } from "./primitives/dropdown-menu.js";
10
10
  import { MILLISECONDS_PER_SECOND, REDUCED_MOTION_QUERY } from "../constants/motion.js";
11
11
  import { cn } from "../lib/utils.js";
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
@@ -1,40 +1,65 @@
1
+ import type { ComponentProps, ReactNode } from "react";
2
+ import type { AvatarGroupSize, AvatarSize, AvatarStatus } from "../constants/avatar.js";
3
+ export type { AvatarGroupSize, AvatarSize, AvatarStatus };
4
+ export type AvatarProps = Omit<ComponentProps<"span">, "children"> & {
5
+ /** Full name: the accessible name of the avatar and the source of its first two initials. */
6
+ name: string;
7
+ /** Photo URL, rendered through the provider's `Image` adapter. Falls back to the initials if it fails to load. */
8
+ src?: string | null;
9
+ /** Diameter: 24px (`sm`), 32px (`md`, default), 40px (`lg`) or Arc's 88px profile size (`xl`). */
10
+ size?: AvatarSize;
11
+ /** Adds a presence dot and appends the presence to the accessible name. */
12
+ status?: AvatarStatus;
13
+ /** Presence text appended to the accessible name; defaults to "En línea" or "Desconectado". */
14
+ statusLabel?: string;
15
+ /** Replaces the initials, for example with an icon. */
16
+ fallback?: ReactNode;
17
+ /** A custom corner badge; the presence dot moves to the top corner while it is shown. */
18
+ badge?: ReactNode;
19
+ /** Accessible text to use instead of `name`, when the photo needs a different description. */
20
+ alt?: string;
21
+ };
1
22
  /**
2
- * Arc's Avatar (https://uiarc.dev, MIT License, see THIRD_PARTY_NOTICES.md): a compact identity marker on Arc's
3
- * tokens, with a hairline border, a muted fill behind the initials and an optional presence dot that pops in and out.
4
- * Loading, failure and fallback stay on the Base UI avatar primitive.
23
+ * A round portrait for one person, with initials as fallback and an optional presence dot.
24
+ * @param props - Name, photo, size, presence, optional fallback and badge, plus native span attributes for the root.
25
+ * @returns The avatar, announced as one image.
5
26
  */
6
- import type { ComponentProps } from "react";
7
- import { Avatar as AvatarPrimitive } from "@base-ui/react/avatar";
8
- import type { AvatarStatus } from "../constants/avatar.js";
9
- export type { AvatarStatus };
10
- /** Avatar diameters: 24px (`sm`), 32px (`default`), 40px (`lg`) and Arc's 88px profile size (`xl`). */
11
- export type AvatarSize = "default" | "sm" | "lg" | "xl";
12
- /** Accepts native image props and nullable image sources from application results. */
13
- export type AvatarImageProps = Omit<ComponentProps<"img">, "src"> & {
27
+ declare function Avatar({ name, src, size, status, statusLabel, fallback, badge, alt, ...props }: AvatarProps): import("react").JSX.Element;
28
+ /** One person of an avatar group. */
29
+ export type AvatarGroupMember = {
30
+ /** Full name, shown on hover and used as the avatar's accessible name. */
31
+ name: string;
32
+ /** Photo URL. */
14
33
  src?: string | null;
34
+ /** Presence dot of the avatar. */
35
+ status?: AvatarStatus;
36
+ /** Stable key for members that share a name; defaults to `name`. */
37
+ key?: string;
15
38
  };
16
- export type AvatarProps = AvatarPrimitive.Root.Props & {
17
- size?: AvatarSize;
39
+ export type AvatarGroupProps = Omit<ComponentProps<"div">, "children" | "role" | "aria-label"> & {
18
40
  /**
19
- * Shows Arc's presence dot in the bottom corner, or the top corner when an `AvatarBadge` holds the bottom one, and
20
- * adds the presence to the accessible text.
41
+ * People in display order. Pass the whole list and let `max` collapse the rest, or a preview of it together with
42
+ * `total`.
21
43
  */
22
- status?: AvatarStatus;
23
- /** Accessible presence text; defaults to "En línea" or "Desconectado". */
24
- statusLabel?: string;
44
+ members: AvatarGroupMember[];
45
+ /**
46
+ * How many people the group has when `members` is only a preview of them. When it is larger than
47
+ * `members.length`, the +N chip counts the people left out against it. Defaults to `members.length`.
48
+ */
49
+ total?: number;
50
+ /** Avatars shown before the rest collapse into the overflow count. */
51
+ max?: number;
52
+ /** Size of each avatar and of the overflow chip. */
53
+ size?: AvatarGroupSize;
54
+ /** Accessible name of the group, also used in the overflow label; defaults to "Integrantes". */
55
+ label?: string;
56
+ /** Classes for the group. Native attributes such as `aria-hidden`, `style` or `data-*` also go to the root. */
57
+ className?: string;
25
58
  };
26
59
  /**
27
- * A person or account, as a photo with initials as fallback.
28
- * @param props - Size, optional presence and the Base UI avatar root props.
29
- * @returns The avatar root.
60
+ * An overlapping stack of avatars with a +N overflow chip.
61
+ * @param props - Members, optional total, how many to show, size, accessible label, classes and native root attributes.
62
+ * @returns The group.
30
63
  */
31
- declare function Avatar({ className, size, status, statusLabel, children, ...props }: AvatarProps): import("react").JSX.Element;
32
- /** Delegates loading, failure and fallback synchronization to the avatar primitive; loaded images develop in place. */
33
- declare function AvatarImage({ alt, className, src, ...props }: AvatarImageProps): import("react").JSX.Element;
34
- declare function AvatarFallback({ className, ...props }: AvatarPrimitive.Fallback.Props): import("react").JSX.Element;
35
- /** A custom corner badge, drawn with the same ring as Arc's presence dot. Prefer `status` for presence. */
36
- declare function AvatarBadge({ className, ...props }: ComponentProps<"span">): import("react").JSX.Element;
37
- /** Overlaps avatars; the hovered one lifts slightly above its neighbours. */
38
- declare function AvatarGroup({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
39
- declare function AvatarGroupCount({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
40
- export { Avatar, AvatarImage, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarBadge, };
64
+ declare function AvatarGroup({ members, total, max, size, label, className, style, ...props }: AvatarGroupProps): import("react").JSX.Element;
65
+ export { Avatar, AvatarGroup };