beez-ui 2.7.0 → 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 +78 -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 +2 -2
- 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
|
@@ -38,6 +38,8 @@ export declare function useFieldAria({ id, description, error, ...aria }: FieldA
|
|
|
38
38
|
export declare function usesFieldCopy(props: FieldCopyProps): boolean;
|
|
39
39
|
type FieldProps = Omit<FieldCopyProps, "label"> & {
|
|
40
40
|
label?: string;
|
|
41
|
+
/** Keeps the label for assistive technology only, for layouts that already show their own label. */
|
|
42
|
+
hideLabel?: boolean;
|
|
41
43
|
aria: FieldAria;
|
|
42
44
|
className?: string;
|
|
43
45
|
children: ReactNode;
|
|
@@ -47,5 +49,5 @@ type FieldProps = Omit<FieldCopyProps, "label"> & {
|
|
|
47
49
|
* a negative margin at zero and a closed row would still pay it; each row carries its own space instead. The wrapper
|
|
48
50
|
* keeps the bare control's full-width contract, so a field fills a flex row like the control alone does.
|
|
49
51
|
*/
|
|
50
|
-
export declare function Field({ label, description, error, aria, className, children }: FieldProps): import("react").JSX.Element;
|
|
52
|
+
export declare function Field({ label, hideLabel, description, error, aria, className, children }: FieldProps): import("react").JSX.Element;
|
|
51
53
|
export {};
|
package/dist/components/field.js
CHANGED
|
@@ -31,6 +31,14 @@ const digitVariants = {
|
|
|
31
31
|
};
|
|
32
32
|
const instantTransition = { duration: 0 };
|
|
33
33
|
/**
|
|
34
|
+
* Arc `spring.snappy` without its bounce: a rolled digit must land on its line, since even the small overshoot of the
|
|
35
|
+
* bouncy preset pushes it past rest toward the side it came from.
|
|
36
|
+
*/
|
|
37
|
+
const digitRollSpring = {
|
|
38
|
+
...ARC_SPRING_SNAPPY,
|
|
39
|
+
bounce: 0
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
34
42
|
* Reads one component of a count as a number, in English or Spanish formatting: grouping separators are dropped and
|
|
35
43
|
* a decimal comma becomes a point.
|
|
36
44
|
* @param component - A count, or one side of a time or ratio.
|
|
@@ -109,7 +117,7 @@ function RollingNumber(t0) {
|
|
|
109
117
|
let t4;
|
|
110
118
|
if ($[8] !== reduceMotion) {
|
|
111
119
|
t4 = reduceMotion ? instantTransition : {
|
|
112
|
-
y:
|
|
120
|
+
y: digitRollSpring,
|
|
113
121
|
width: ARC_SPRING_MORPH,
|
|
114
122
|
opacity: { duration: ARC_DURATION.fast },
|
|
115
123
|
filter: { duration: ARC_DURATION.fast }
|
|
@@ -624,77 +632,79 @@ export function usesFieldCopy(props) {
|
|
|
624
632
|
* keeps the bare control's full-width contract, so a field fills a flex row like the control alone does.
|
|
625
633
|
*/
|
|
626
634
|
export function Field(t0) {
|
|
627
|
-
const $ = _c(
|
|
628
|
-
const { label, description, error, aria, className, children } = t0;
|
|
629
|
-
|
|
635
|
+
const $ = _c(18);
|
|
636
|
+
const { label, hideLabel: t1, description, error, aria, className, children } = t0;
|
|
637
|
+
const hideLabel = t1 === undefined ? false : t1;
|
|
638
|
+
let t2;
|
|
630
639
|
if ($[0] !== className) {
|
|
631
|
-
|
|
640
|
+
t2 = cn("grid w-full min-w-0", className);
|
|
632
641
|
$[0] = className;
|
|
633
|
-
$[1] =
|
|
642
|
+
$[1] = t2;
|
|
634
643
|
} else {
|
|
635
|
-
|
|
644
|
+
t2 = $[1];
|
|
636
645
|
}
|
|
637
|
-
let
|
|
638
|
-
if ($[2] !== aria.controlId || $[3] !== label) {
|
|
639
|
-
|
|
646
|
+
let t3;
|
|
647
|
+
if ($[2] !== aria.controlId || $[3] !== hideLabel || $[4] !== label) {
|
|
648
|
+
t3 = label ? /* @__PURE__ */ _jsx("label", {
|
|
640
649
|
"data-slot": "field-label",
|
|
641
650
|
htmlFor: aria.controlId,
|
|
642
|
-
className: "mb-(--space-2) text-sm leading-(--leading-body) font-medium text-foreground",
|
|
651
|
+
className: hideLabel ? "sr-only" : "mb-(--space-2) text-sm leading-(--leading-body) font-medium text-foreground",
|
|
643
652
|
children: label
|
|
644
653
|
}) : null;
|
|
645
654
|
$[2] = aria.controlId;
|
|
646
|
-
$[3] =
|
|
647
|
-
$[4] =
|
|
655
|
+
$[3] = hideLabel;
|
|
656
|
+
$[4] = label;
|
|
657
|
+
$[5] = t3;
|
|
648
658
|
} else {
|
|
649
|
-
|
|
659
|
+
t3 = $[5];
|
|
650
660
|
}
|
|
651
|
-
let
|
|
652
|
-
if ($[
|
|
653
|
-
|
|
661
|
+
let t4;
|
|
662
|
+
if ($[6] !== aria.descriptionId || $[7] !== description) {
|
|
663
|
+
t4 = /* @__PURE__ */ _jsx(FieldMessage, {
|
|
654
664
|
id: aria.descriptionId,
|
|
655
665
|
text: description,
|
|
656
666
|
className: "text-text-muted"
|
|
657
667
|
});
|
|
658
|
-
$[
|
|
659
|
-
$[
|
|
660
|
-
$[
|
|
668
|
+
$[6] = aria.descriptionId;
|
|
669
|
+
$[7] = description;
|
|
670
|
+
$[8] = t4;
|
|
661
671
|
} else {
|
|
662
|
-
|
|
672
|
+
t4 = $[8];
|
|
663
673
|
}
|
|
664
|
-
let
|
|
665
|
-
if ($[
|
|
666
|
-
|
|
674
|
+
let t5;
|
|
675
|
+
if ($[9] !== aria.errorId || $[10] !== error) {
|
|
676
|
+
t5 = /* @__PURE__ */ _jsx(FieldMessage, {
|
|
667
677
|
id: aria.errorId,
|
|
668
678
|
text: error,
|
|
669
679
|
className: "text-danger",
|
|
670
680
|
alert: true
|
|
671
681
|
});
|
|
672
|
-
$[
|
|
673
|
-
$[
|
|
674
|
-
$[
|
|
682
|
+
$[9] = aria.errorId;
|
|
683
|
+
$[10] = error;
|
|
684
|
+
$[11] = t5;
|
|
675
685
|
} else {
|
|
676
|
-
|
|
686
|
+
t5 = $[11];
|
|
677
687
|
}
|
|
678
|
-
let
|
|
679
|
-
if ($[
|
|
680
|
-
|
|
688
|
+
let t6;
|
|
689
|
+
if ($[12] !== children || $[13] !== t2 || $[14] !== t3 || $[15] !== t4 || $[16] !== t5) {
|
|
690
|
+
t6 = /* @__PURE__ */ _jsxs("div", {
|
|
681
691
|
"data-slot": "field",
|
|
682
|
-
className:
|
|
692
|
+
className: t2,
|
|
683
693
|
children: [
|
|
684
|
-
t2,
|
|
685
|
-
children,
|
|
686
694
|
t3,
|
|
687
|
-
|
|
695
|
+
children,
|
|
696
|
+
t4,
|
|
697
|
+
t5
|
|
688
698
|
]
|
|
689
699
|
});
|
|
690
|
-
$[
|
|
691
|
-
$[12] = t1;
|
|
700
|
+
$[12] = children;
|
|
692
701
|
$[13] = t2;
|
|
693
702
|
$[14] = t3;
|
|
694
703
|
$[15] = t4;
|
|
695
704
|
$[16] = t5;
|
|
705
|
+
$[17] = t6;
|
|
696
706
|
} else {
|
|
697
|
-
|
|
707
|
+
t6 = $[17];
|
|
698
708
|
}
|
|
699
|
-
return
|
|
709
|
+
return t6;
|
|
700
710
|
}
|
|
@@ -11,8 +11,8 @@ import { ControlButton } from "./control-button.js";
|
|
|
11
11
|
import { FilterQueryBar } from "./filter-query-bar.js";
|
|
12
12
|
import { Input } from "./input.js";
|
|
13
13
|
import { Label } from "./label.js";
|
|
14
|
-
import { Popover, PopoverContent, PopoverTrigger } from "./popover.js";
|
|
15
|
-
import { Tooltip, TooltipContent, TooltipTrigger } from "./tooltip.js";
|
|
14
|
+
import { Popover, PopoverContent, PopoverTrigger } from "./primitives/popover.js";
|
|
15
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "./primitives/tooltip.js";
|
|
16
16
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
17
|
const ENTER_KEY = "Enter";
|
|
18
18
|
/** Suggestions of the query editor render in their own popover, outside the edit popover. */
|
|
@@ -4,7 +4,7 @@ import * as React from "react";
|
|
|
4
4
|
import { Calendar, Check, CircleDot, CircleMinus, CircleSlash, Folder, Hash, List, Type, User, X } from "lucide-react";
|
|
5
5
|
import { ControlButton } from "./control-button.js";
|
|
6
6
|
import { Input } from "./input.js";
|
|
7
|
-
import { Popover, PopoverAnchor, PopoverContent } from "./popover.js";
|
|
7
|
+
import { Popover, PopoverAnchor, PopoverContent } from "./primitives/popover.js";
|
|
8
8
|
import { GlideSlot } from "../motion/glide-slot.js";
|
|
9
9
|
import { cn } from "../lib/utils.js";
|
|
10
10
|
import { getActiveFilterToken, getValueHighlightRanges, normalizeFilterSlug, parseFilterQuery, PRESENCE_HAS_META_KEY, PRESENCE_NO_META_KEY, UNASSIGNED_FOLDER_FILTER_VALUE } from "./filter-query-grammar.js";
|
|
@@ -2,48 +2,49 @@
|
|
|
2
2
|
* Arc's Hover Card (https://uiarc.dev, MIT License, see THIRD_PARTY_NOTICES.md): a read-only preview of a person or
|
|
3
3
|
* link that opens after half a second of hover or on keyboard focus, grows from the trigger edge on a smooth spring
|
|
4
4
|
* and closes fast on leave. While a card is open, and briefly after it closes, moving to another trigger opens its
|
|
5
|
-
* card almost at once and only fades. It
|
|
5
|
+
* card almost at once and only fades. It follows Arc's closed API, `<HoverCard content={...}>` around its trigger,
|
|
6
|
+
* with Arc's `HoverCardProfile` preset and open state and placement extensions.
|
|
6
7
|
*/
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
/**
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
value: string | number;
|
|
28
|
-
}
|
|
29
|
-
/** A person preview for `HoverCardContent`. */
|
|
30
|
-
export interface HoverCardProfileProps {
|
|
31
|
-
name: string;
|
|
32
|
-
/** Role and team, such as "Diseñadora de producto, Pagos". */
|
|
33
|
-
role?: string;
|
|
34
|
-
/** A portrait URL, or your own image element such as an `Image` adapter. Initials show when it is missing. */
|
|
35
|
-
avatar?: string | React.ReactNode;
|
|
36
|
-
bio?: string;
|
|
37
|
-
stats?: HoverCardStat[];
|
|
38
|
-
/** A footer line, such as a location and local time. */
|
|
39
|
-
meta?: React.ReactNode;
|
|
8
|
+
import type { ReactElement, ReactNode } from "react";
|
|
9
|
+
import { HoverCardProfile, type HoverCardProfileProps, type HoverCardStat } from "./primitives/hover-card.js";
|
|
10
|
+
/** Side of the trigger a hover card prefers. */
|
|
11
|
+
export type HoverCardSide = "top" | "bottom" | "left" | "right";
|
|
12
|
+
/** Alignment of the card against its trigger. */
|
|
13
|
+
export type HoverCardAlign = "start" | "center" | "end";
|
|
14
|
+
export type HoverCardProps = {
|
|
15
|
+
/** The trigger, such as a mention button or link. Rendered with `asChild`, so it must accept a ref and be focusable. */
|
|
16
|
+
children: ReactElement;
|
|
17
|
+
/** The preview. `HoverCardProfile` covers people. Keep it read only: focus never moves into the card. */
|
|
18
|
+
content: ReactNode;
|
|
19
|
+
/** Preferred side of the trigger. Defaults to `bottom`. */
|
|
20
|
+
side?: HoverCardSide;
|
|
21
|
+
/** Alignment against the trigger. Defaults to `start`. */
|
|
22
|
+
align?: HoverCardAlign;
|
|
23
|
+
/** Milliseconds of hover before the first card opens. Defaults to 500. */
|
|
24
|
+
openDelay?: number;
|
|
25
|
+
/** Grace, in milliseconds, after the pointer leaves. Defaults to 140. */
|
|
26
|
+
closeDelay?: number;
|
|
27
|
+
/** Class on the card surface. */
|
|
40
28
|
className?: string;
|
|
41
|
-
|
|
29
|
+
/** Class on the card surface, merged after `className`. */
|
|
30
|
+
contentClassName?: string;
|
|
31
|
+
/** Gap, in px, between the card and its trigger. Defaults to 8. */
|
|
32
|
+
sideOffset?: number;
|
|
33
|
+
/** Distance, in px, the card keeps from the viewport edges. Defaults to 12. */
|
|
34
|
+
collisionPadding?: number;
|
|
35
|
+
/** Controlled open state. */
|
|
36
|
+
open?: boolean;
|
|
37
|
+
/** Initial open state when uncontrolled. */
|
|
38
|
+
defaultOpen?: boolean;
|
|
39
|
+
/** Called when the card opens or closes, for example to load its data on open. */
|
|
40
|
+
onOpenChange?: (open: boolean) => void;
|
|
41
|
+
};
|
|
42
42
|
/**
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
* @param props - The
|
|
46
|
-
* @returns The
|
|
43
|
+
* A read-only preview that opens after a short hover or keyboard focus and stays open while the pointer travels into
|
|
44
|
+
* it.
|
|
45
|
+
* @param props - The trigger, the preview and optional timing, placement and open state.
|
|
46
|
+
* @returns The trigger with its hover card.
|
|
47
47
|
*/
|
|
48
|
-
declare function
|
|
49
|
-
export { HoverCard,
|
|
48
|
+
declare function HoverCard({ children, content, side, align, openDelay, closeDelay, className, contentClassName, sideOffset, collisionPadding, open, defaultOpen, onOpenChange, }: HoverCardProps): import("react").JSX.Element;
|
|
49
|
+
export { HoverCard, HoverCardProfile };
|
|
50
|
+
export type { HoverCardProfileProps, HoverCardStat };
|