beez-ui 2.7.1 → 3.0.0

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 +72 -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 +267 -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 +24 -1
  82. package/dist/constants/avatar.js +19 -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
@@ -5,7 +5,7 @@ import { useEffect, useRef } from "react";
5
5
  import { cn } from "../lib/utils.js";
6
6
  import { RICH_LINK_POPOVER_MODE, RICH_TEXT_EDITOR_KEY, RICH_TEXT_SEGMENT_TYPE } from "../lib/rich-text/link-markdown-constants.js";
7
7
  import { ControlButton } from "./control-button.js";
8
- import { Popover, PopoverContent, PopoverTrigger } from "./popover.js";
8
+ import { Popover, PopoverContent, PopoverTrigger } from "./primitives/popover.js";
9
9
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
10
  const BUTTON_TYPE = "button";
11
11
  const BUTTON_VARIANT = {
@@ -1,46 +1,55 @@
1
1
  /**
2
- * Arc's Select (https://uiarc.dev, MIT License, see THIRD_PARTY_NOTICES.md) as beez-ui's composable Radix select:
3
- * Arc's trigger, whose hover, press and open states answer in color only so the anchored list never shifts, and its
4
- * raised list with option rows and an end check, on Arc's tokens. It keeps every subcomponent, prop and `data-slot`
5
- * of the previous API and beez-ui's option entrance, check pop and chevron rotation.
2
+ * Arc's Select (https://uiarc.dev, MIT License, see THIRD_PARTY_NOTICES.md): a labelled choice field whose trigger
3
+ * answers hover, press and open in color only, so the anchored list never shifts, and whose raised list matches the
4
+ * trigger width, with option rows and an end check. It follows Arc's closed API (`label`, `options`, `placeholder`,
5
+ * `description` and Radix's root props) and shares the label, helper and error rows of `Input`.
6
6
  */
7
- import * as React from "react";
8
- import { Select as SelectPrimitive } from "radix-ui";
9
- declare function Select({ ...props }: React.ComponentProps<typeof SelectPrimitive.Root>): React.JSX.Element;
10
- declare function SelectGroup({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Group>): React.JSX.Element;
11
- declare function SelectValue({ ...props }: React.ComponentProps<typeof SelectPrimitive.Value>): React.JSX.Element;
7
+ import type { AriaAttributes, ComponentProps, Ref } from "react";
8
+ import { Select as SelectRoot } from "./primitives/select.js";
9
+ /** One choice of a `Select`. */
10
+ export type SelectOption = {
11
+ value: string;
12
+ label: string;
13
+ disabled?: boolean;
14
+ };
15
+ /** Height of the trigger: `default` matches `Input` and `Button`, `sm` their small size. */
16
+ export type SelectSize = "default" | "sm";
17
+ export type SelectProps = Omit<ComponentProps<typeof SelectRoot>, "children"> & {
18
+ /** Visible label, tied to the trigger with `htmlFor`. */
19
+ label: string;
20
+ /** Choices, in list order. Readonly arrays, such as lists declared `as const`, are accepted as they are. */
21
+ options: readonly SelectOption[];
22
+ /** Shown while no option is chosen. Defaults to "Seleccioná una opción". */
23
+ placeholder?: string;
24
+ /** Helper copy under the trigger, linked through `aria-describedby`. */
25
+ description?: string;
26
+ /** Error copy: marks the trigger invalid and renders in a `role="alert"` row, as in `Input`. */
27
+ error?: string;
28
+ /** Trigger id, so an external `<label htmlFor>` can point at it. Generated when omitted. */
29
+ id?: string;
30
+ /** Class on the field that wraps the label, the trigger and the helper rows. */
31
+ className?: string;
32
+ /** Keeps `label` for assistive technology only, for layouts that already show their own label. */
33
+ hideLabel?: boolean;
34
+ /** Height of the trigger. Defaults to `default`. */
35
+ size?: SelectSize;
36
+ /** Class on the trigger. */
37
+ triggerClassName?: string;
38
+ /** Marks the trigger invalid without an error message. `error` sets it too. */
39
+ "aria-invalid"?: AriaAttributes["aria-invalid"];
40
+ /**
41
+ * Ids of external elements that describe the trigger. They are combined with the ids of `description` and
42
+ * `error`, which follow them.
43
+ */
44
+ "aria-describedby"?: string;
45
+ /** The trigger button. */
46
+ ref?: Ref<HTMLButtonElement>;
47
+ };
12
48
  /**
13
- * Renders Arc's selection control: `default` matches the height of `Input` and `Button`, `sm` their small size.
14
- * Hover only answers on fine pointers, keyboard focus draws the shared outline, and `aria-invalid` turns the border
15
- * to the danger color.
16
- * @param props - Primitive properties, the `size` and optional consumer overrides.
17
- * @returns The styled primitive with its original interaction contract.
49
+ * A compact choice field with a keyboard friendly list, controlled with `value` and `onValueChange` or uncontrolled
50
+ * with `defaultValue`; pass `name` to submit it with a form.
51
+ * @param props - Label, options, optional copy and layout, and Radix select root properties.
52
+ * @returns The labelled field.
18
53
  */
19
- declare function SelectTrigger({ className, size, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
20
- size?: "sm" | "default";
21
- }): React.JSX.Element;
22
- /**
23
- * Renders Arc's raised option list, at least twelve rem wide so options stay readable. With `position="popper"` it
24
- * grows from the trigger edge, matches the trigger width, keeps 12px from the viewport edges and caps its height at
25
- * 20rem.
26
- * @param props - Primitive properties and optional consumer overrides.
27
- * @returns The styled primitive with its original interaction contract.
28
- */
29
- declare function SelectContent({ className, children, position, align, collisionPadding, ...props }: React.ComponentProps<typeof SelectPrimitive.Content>): React.JSX.Element;
30
- /**
31
- * Renders a muted option group label aligned with the option text.
32
- * @param props - Primitive properties and optional consumer overrides.
33
- * @returns The styled primitive with its original interaction contract.
34
- */
35
- declare function SelectLabel({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Label>): React.JSX.Element;
36
- /**
37
- * Renders Arc's option row: 36px tall, a muted fill when highlighted and the check of the chosen option at the end,
38
- * while retaining selection and disabled semantics.
39
- * @param props - Primitive properties and optional consumer overrides.
40
- * @returns The styled primitive with its original interaction contract.
41
- */
42
- declare function SelectItem({ className, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Item>): React.JSX.Element;
43
- declare function SelectSeparator({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Separator>): React.JSX.Element;
44
- declare function SelectScrollUpButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>): React.JSX.Element;
45
- declare function SelectScrollDownButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>): React.JSX.Element;
46
- export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, };
54
+ declare function Select({ label, options, placeholder, description, error, id, className, hideLabel, size, triggerClassName, "aria-invalid": ariaInvalid, "aria-describedby": ariaDescribedBy, ref, ...rootProps }: SelectProps): import("react").JSX.Element;
55
+ export { Select };