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.
- package/CHANGELOG.md +72 -0
- package/README.md +43 -13
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/dist/components/account-menu.d.ts +4 -3
- package/dist/components/account-menu.js +63 -54
- package/dist/components/alert.d.ts +15 -15
- package/dist/components/alert.js +289 -270
- package/dist/components/animated-theme-toggler.js +1 -1
- package/dist/components/avatar.d.ts +56 -31
- package/dist/components/avatar.js +394 -277
- package/dist/components/badge.d.ts +8 -28
- package/dist/components/badge.js +55 -108
- package/dist/components/calendar.d.ts +36 -26
- package/dist/components/calendar.js +132 -1227
- package/dist/components/card.d.ts +36 -25
- package/dist/components/card.js +895 -72
- package/dist/components/carousel.d.ts +63 -47
- package/dist/components/carousel.js +496 -777
- package/dist/components/data-table.d.ts +5 -4
- package/dist/components/data-table.js +7 -6
- package/dist/components/dialog-surface.d.ts +23 -1
- package/dist/components/dialog-surface.js +99 -3
- package/dist/components/dialog.d.ts +80 -45
- package/dist/components/dialog.js +258 -503
- package/dist/components/dropdown-menu.d.ts +56 -73
- package/dist/components/dropdown-menu.js +79 -714
- package/dist/components/field.d.ts +3 -1
- package/dist/components/field.js +49 -39
- package/dist/components/filter-presets-bar.js +2 -2
- package/dist/components/filter-query-bar.js +1 -1
- package/dist/components/hover-card.d.ts +42 -41
- package/dist/components/hover-card.js +57 -483
- package/dist/components/pagination.d.ts +53 -31
- package/dist/components/pagination.js +176 -412
- package/dist/components/popover.d.ts +11 -23
- package/dist/components/popover.js +19 -304
- package/dist/components/{alert-dialog.d.ts → primitives/alert-dialog.d.ts} +17 -5
- package/dist/components/{alert-dialog.js → primitives/alert-dialog.js} +102 -54
- package/dist/components/primitives/avatar.d.ts +46 -0
- package/dist/components/primitives/avatar.js +267 -0
- package/dist/components/primitives/calendar.d.ts +37 -0
- package/dist/components/primitives/calendar.js +1250 -0
- package/dist/components/primitives/carousel.d.ts +106 -0
- package/dist/components/primitives/carousel.js +928 -0
- package/dist/components/primitives/dialog.d.ts +62 -0
- package/dist/components/primitives/dialog.js +490 -0
- package/dist/components/primitives/dropdown-menu-items.d.ts +59 -0
- package/dist/components/primitives/dropdown-menu-items.js +265 -0
- package/dist/components/primitives/dropdown-menu.d.ts +64 -0
- package/dist/components/primitives/dropdown-menu.js +557 -0
- package/dist/components/primitives/hover-card.d.ts +50 -0
- package/dist/components/primitives/hover-card.js +507 -0
- package/dist/components/primitives/pagination.d.ts +65 -0
- package/dist/components/primitives/pagination.js +373 -0
- package/dist/components/primitives/popover.d.ts +22 -0
- package/dist/components/primitives/popover.js +213 -0
- package/dist/components/primitives/select.d.ts +36 -0
- package/dist/components/primitives/select.js +407 -0
- package/dist/components/primitives/tooltip.d.ts +30 -0
- package/dist/components/primitives/tooltip.js +277 -0
- package/dist/components/radio-group.d.ts +30 -17
- package/dist/components/radio-group.js +266 -315
- package/dist/components/rich-link-editor.js +1 -1
- package/dist/components/select.d.ts +51 -42
- package/dist/components/select.js +163 -495
- package/dist/components/skeleton.d.ts +16 -15
- package/dist/components/skeleton.js +99 -205
- package/dist/components/split-button.js +1 -1
- package/dist/components/switch.d.ts +3 -6
- package/dist/components/switch.js +163 -170
- package/dist/components/tabs.d.ts +3 -11
- package/dist/components/tabs.js +61 -75
- package/dist/components/themed-toaster.d.ts +1 -1
- package/dist/components/themed-toaster.js +1 -1
- package/dist/components/toaster.d.ts +1 -1
- package/dist/components/toaster.js +1 -1
- package/dist/components/tooltip.d.ts +36 -31
- package/dist/components/tooltip.js +44 -284
- package/dist/constants/alert.d.ts +5 -1
- package/dist/constants/alert.js +5 -1
- package/dist/constants/avatar.d.ts +24 -1
- package/dist/constants/avatar.js +19 -0
- package/dist/constants/calendar.d.ts +12 -0
- package/dist/constants/calendar.js +12 -0
- package/dist/constants/card.d.ts +23 -0
- package/dist/constants/card.js +20 -0
- package/dist/constants/carousel.d.ts +31 -13
- package/dist/constants/carousel.js +32 -11
- package/dist/constants/dialog.d.ts +6 -1
- package/dist/constants/dialog.js +5 -1
- package/dist/constants/dropdown-menu.d.ts +2 -2
- package/dist/constants/dropdown-menu.js +2 -2
- package/dist/constants/pagination.d.ts +13 -2
- package/dist/constants/pagination.js +13 -2
- package/dist/constants/select.d.ts +4 -2
- package/dist/constants/select.js +4 -2
- package/dist/constants/switch.d.ts +5 -16
- package/dist/constants/switch.js +6 -14
- package/dist/hooks/use-today.d.ts +7 -0
- package/dist/hooks/use-today.js +50 -0
- package/dist/hooks.d.ts +1 -0
- package/dist/hooks.js +1 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/motion/glide-indicator.d.ts +1 -1
- package/dist/motion/glide-indicator.js +1 -1
- package/dist/motion/presence.d.ts +0 -1
- package/dist/motion/presence.js +0 -1
- package/dist/styles.css +1 -1
- 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)
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
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
|
|
8
|
-
import { Select as
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* @
|
|
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
|
|
20
|
-
|
|
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 };
|