@waveso/ui 0.15.0 → 0.16.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/README.md +25 -22
- package/dist/accordion.d.ts +4 -20
- package/dist/accordion.js +2 -2
- package/dist/action-bar.d.ts +1 -10
- package/dist/action-bar.js +6 -5
- package/dist/alert-dialog.d.ts +12 -52
- package/dist/alert-dialog.js +5 -5
- package/dist/alert.d.ts +13 -22
- package/dist/alert.js +13 -4
- package/dist/animate.d.ts +6 -49
- package/dist/animate.js +8 -13
- package/dist/aspect-ratio.d.ts +3 -8
- package/dist/autocomplete.d.ts +21 -88
- package/dist/autocomplete.js +3 -3
- package/dist/avatar.d.ts +7 -28
- package/dist/avatar.js +4 -4
- package/dist/badge.d.ts +3 -11
- package/dist/badge.js +6 -6
- package/dist/breadcrumb.d.ts +7 -31
- package/dist/button-group.d.ts +7 -20
- package/dist/button-group.js +5 -4
- package/dist/button.d.ts +4 -12
- package/dist/button.js +6 -6
- package/dist/card.d.ts +16 -33
- package/dist/card.js +27 -14
- package/dist/checkbox.d.ts +1 -6
- package/dist/checkbox.js +2 -2
- package/dist/collapsible.d.ts +3 -12
- package/dist/combobox.d.ts +18 -81
- package/dist/combobox.js +4 -4
- package/dist/context-menu.d.ts +17 -68
- package/dist/context-menu.js +14 -14
- package/dist/count.d.ts +1 -15
- package/dist/count.js +3 -2
- package/dist/dialog.d.ts +10 -41
- package/dist/dialog.js +5 -5
- package/dist/direction.d.ts +0 -1
- package/dist/drawer.d.ts +11 -44
- package/dist/drawer.js +1 -1
- package/dist/encrypted-text.d.ts +15 -14
- package/dist/encrypted-text.js +205 -66
- package/dist/field.d.ts +27 -30
- package/dist/field.js +36 -8
- package/dist/fieldset.d.ts +14 -0
- package/dist/fieldset.js +26 -0
- package/dist/film-grain-shader.d.ts +3 -4
- package/dist/film-grain-webgl.d.ts +2 -9
- package/dist/film-grain-webgl.js +4 -1
- package/dist/film-grain.d.ts +1 -11
- package/dist/form.d.ts +23 -42
- package/dist/form.js +7 -4
- package/dist/glyph-matrix.d.ts +25 -0
- package/dist/glyph-matrix.js +266 -0
- package/dist/gradient-reveal-text.d.ts +4 -17
- package/dist/gradient-reveal-text.js +8 -8
- package/dist/hooks/use-mobile.d.ts +2 -3
- package/dist/infinite-scroll.d.ts +1 -16
- package/dist/input-group.d.ts +11 -37
- package/dist/input-group.js +1 -1
- package/dist/input-otp.d.ts +4 -20
- package/dist/input-otp.js +2 -2
- package/dist/input.d.ts +3 -11
- package/dist/input.js +1 -1
- package/dist/item.d.ts +14 -51
- package/dist/item.js +17 -11
- package/dist/kbd.d.ts +3 -11
- package/dist/kbd.js +2 -2
- package/dist/label.d.ts +1 -6
- package/dist/label.js +1 -1
- package/dist/lib/focus.d.ts +3 -5
- package/dist/lib/internal-icons.d.ts +19 -22
- package/dist/lib/merge-refs.d.ts +9 -0
- package/dist/lib/merge-refs.js +16 -0
- package/dist/lib/utils.d.ts +3 -5
- package/dist/lib/utils.js +9 -1
- package/dist/masonry.d.ts +2 -16
- package/dist/masonry.js +5 -3
- package/dist/menu.d.ts +17 -65
- package/dist/menu.js +7 -7
- package/dist/menubar.d.ts +16 -55
- package/dist/menubar.js +1 -1
- package/dist/pagination.d.ts +9 -33
- package/dist/pagination.js +1 -1
- package/dist/popover.d.ts +9 -43
- package/dist/popover.js +1 -1
- package/dist/preview-card.d.ts +5 -25
- package/dist/preview-card.js +1 -1
- package/dist/progress.d.ts +5 -24
- package/dist/progress.js +2 -2
- package/dist/radio-group.d.ts +2 -9
- package/dist/radio-group.js +1 -1
- package/dist/radio.d.ts +2 -10
- package/dist/radio.js +2 -2
- package/dist/resizable.d.ts +43 -0
- package/dist/resizable.js +53 -0
- package/dist/scroll-area.d.ts +14 -13
- package/dist/scroll-area.js +26 -7
- package/dist/select.d.ts +15 -64
- package/dist/select.js +4 -4
- package/dist/separator.d.ts +1 -7
- package/dist/separator.js +1 -1
- package/dist/sidebar.d.ts +29 -126
- package/dist/sidebar.js +14 -14
- package/dist/skeleton.d.ts +1 -6
- package/dist/slider.d.ts +1 -14
- package/dist/slider.js +5 -5
- package/dist/spinner.d.ts +8 -6
- package/dist/spinner.js +24 -6
- package/dist/styles.css +575 -182
- package/dist/switch.d.ts +2 -9
- package/dist/switch.js +6 -6
- package/dist/table.d.ts +14 -34
- package/dist/table.js +40 -9
- package/dist/tabs.d.ts +5 -22
- package/dist/tabs.js +3 -3
- package/dist/textarea.d.ts +3 -12
- package/dist/textarea.js +1 -1
- package/dist/toast.d.ts +13 -39
- package/dist/toast.js +4 -4
- package/dist/toggle-group.d.ts +3 -19
- package/dist/toggle-group.js +16 -10
- package/dist/toggle.d.ts +3 -11
- package/dist/toggle.js +11 -6
- package/dist/tooltip.d.ts +6 -24
- package/dist/tooltip.js +10 -6
- package/dist/typewriter.d.ts +1 -14
- package/dist/video-text.d.ts +25 -0
- package/dist/video-text.js +147 -0
- package/package.json +57 -51
package/dist/input-otp.js
CHANGED
|
@@ -10,7 +10,7 @@ function InputOTP({ className, containerClassName, ...props }) {
|
|
|
10
10
|
"data-slot": "input-otp",
|
|
11
11
|
containerClassName: cn("group/input-otp flex items-center has-disabled:opacity-50", containerClassName),
|
|
12
12
|
spellCheck: false,
|
|
13
|
-
className: cn(
|
|
13
|
+
className: cn(className),
|
|
14
14
|
...props
|
|
15
15
|
});
|
|
16
16
|
}
|
|
@@ -26,7 +26,7 @@ function InputOTPSlot({ index, className, ...props }) {
|
|
|
26
26
|
return /* @__PURE__ */ jsxs("div", {
|
|
27
27
|
"data-slot": "input-otp-slot",
|
|
28
28
|
"data-active": isActive || void 0,
|
|
29
|
-
className: cn("border-
|
|
29
|
+
className: cn("border-shade relative flex size-9 items-center justify-center border-y border-r text-sm motion-color outline-hidden first:rounded-l-md first:border-l last:rounded-r-md", "data-active:border-focus data-active:ring-3 data-active:ring-focus/50 data-active:z-10", "group-has-aria-invalid/input-otp:border-danger group-has-aria-invalid/input-otp:data-active:ring-3 group-has-aria-invalid/input-otp:data-active:ring-danger/30", className),
|
|
30
30
|
...props,
|
|
31
31
|
children: [char, hasFakeCaret && /* @__PURE__ */ jsx("div", {
|
|
32
32
|
className: "pointer-events-none absolute inset-0 flex items-center justify-center",
|
package/dist/input.d.ts
CHANGED
|
@@ -1,19 +1,11 @@
|
|
|
1
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
1
|
import * as React from "react";
|
|
3
2
|
import { VariantProps } from "class-variance-authority";
|
|
4
3
|
import { Input as Input$1 } from "@base-ui/react/input";
|
|
5
|
-
import * as _$class_variance_authority_types0 from "class-variance-authority/types";
|
|
6
|
-
|
|
7
4
|
//#region src/input.d.ts
|
|
8
5
|
declare const inputVariants: (props?: ({
|
|
9
|
-
size?: "default" | "
|
|
10
|
-
} &
|
|
6
|
+
size?: "default" | "lg" | "sm" | "xs" | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
11
8
|
type InputProps = Omit<React.ComponentProps<typeof Input$1>, "size"> & VariantProps<typeof inputVariants>;
|
|
12
|
-
declare function Input({
|
|
13
|
-
className,
|
|
14
|
-
type,
|
|
15
|
-
size,
|
|
16
|
-
...props
|
|
17
|
-
}: InputProps): _$react_jsx_runtime0.JSX.Element;
|
|
9
|
+
declare function Input({ className, type, size, ...props }: InputProps): React.JSX.Element;
|
|
18
10
|
//#endregion
|
|
19
11
|
export { Input, type InputProps, inputVariants };
|
package/dist/input.js
CHANGED
|
@@ -3,7 +3,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { cva } from "class-variance-authority";
|
|
4
4
|
import { Input as Input$1 } from "@base-ui/react/input";
|
|
5
5
|
//#region src/input.tsx
|
|
6
|
-
const inputVariants = cva("bg-
|
|
6
|
+
const inputVariants = cva("bg-shade hover:border-focus focus-visible:border-focus focus-visible:ring-focus/50 aria-invalid:ring-danger/30 aria-invalid:border-danger placeholder:text-soft flex w-full min-w-0 items-center overflow-hidden rounded-md border border-transparent motion-color outline-hidden file:inline-flex file:my-[3px] file:items-center file:me-3 file:cursor-clickable file:rounded-md file:border-0 file:bg-primary file:px-2.5 file:leading-none file:font-medium file:text-white file:motion-color file:hover:bg-primary/80 focus-visible:ring-3 data-disabled:pointer-events-none data-disabled:opacity-30 aria-invalid:ring-3", {
|
|
7
7
|
variants: { size: {
|
|
8
8
|
xs: "h-6 rounded-sm px-2 text-xs file:-ms-[5px] file:h-4",
|
|
9
9
|
sm: "h-8 px-3 text-sm file:-ms-[9px] file:h-6",
|
package/dist/item.d.ts
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import { Separator } from "./separator.js";
|
|
2
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
2
|
import * as React from "react";
|
|
4
3
|
import { VariantProps } from "class-variance-authority";
|
|
5
4
|
import { useRender } from "@base-ui/react/use-render";
|
|
6
|
-
import * as _$class_variance_authority_types0 from "class-variance-authority/types";
|
|
7
|
-
|
|
8
5
|
//#region src/item.d.ts
|
|
9
6
|
declare const itemVariants: (props?: ({
|
|
10
|
-
variant?: "default" | "
|
|
7
|
+
variant?: "default" | "muted" | "outline" | null | undefined;
|
|
11
8
|
size?: "default" | "sm" | "xs" | null | undefined;
|
|
12
|
-
} &
|
|
9
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
13
10
|
declare const itemMediaVariants: (props?: ({
|
|
14
|
-
variant?: "default" | "
|
|
15
|
-
} &
|
|
11
|
+
variant?: "default" | "icon" | "image" | null | undefined;
|
|
12
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
16
13
|
type ItemGroupProps = React.ComponentProps<"div">;
|
|
17
14
|
type ItemSeparatorProps = React.ComponentProps<typeof Separator>;
|
|
18
15
|
type ItemProps = useRender.ComponentProps<"div"> & VariantProps<typeof itemVariants>;
|
|
@@ -23,49 +20,15 @@ type ItemDescriptionProps = React.ComponentProps<"p">;
|
|
|
23
20
|
type ItemActionsProps = React.ComponentProps<"div">;
|
|
24
21
|
type ItemHeaderProps = React.ComponentProps<"div">;
|
|
25
22
|
type ItemFooterProps = React.ComponentProps<"div">;
|
|
26
|
-
declare function ItemGroup({
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}:
|
|
30
|
-
declare function
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}:
|
|
34
|
-
declare function
|
|
35
|
-
|
|
36
|
-
variant,
|
|
37
|
-
size,
|
|
38
|
-
render,
|
|
39
|
-
...props
|
|
40
|
-
}: ItemProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
41
|
-
declare function ItemMedia({
|
|
42
|
-
className,
|
|
43
|
-
variant,
|
|
44
|
-
...props
|
|
45
|
-
}: ItemMediaProps): _$react_jsx_runtime0.JSX.Element;
|
|
46
|
-
declare function ItemContent({
|
|
47
|
-
className,
|
|
48
|
-
...props
|
|
49
|
-
}: ItemContentProps): _$react_jsx_runtime0.JSX.Element;
|
|
50
|
-
declare function ItemTitle({
|
|
51
|
-
className,
|
|
52
|
-
...props
|
|
53
|
-
}: ItemTitleProps): _$react_jsx_runtime0.JSX.Element;
|
|
54
|
-
declare function ItemDescription({
|
|
55
|
-
className,
|
|
56
|
-
...props
|
|
57
|
-
}: ItemDescriptionProps): _$react_jsx_runtime0.JSX.Element;
|
|
58
|
-
declare function ItemActions({
|
|
59
|
-
className,
|
|
60
|
-
...props
|
|
61
|
-
}: ItemActionsProps): _$react_jsx_runtime0.JSX.Element;
|
|
62
|
-
declare function ItemHeader({
|
|
63
|
-
className,
|
|
64
|
-
...props
|
|
65
|
-
}: ItemHeaderProps): _$react_jsx_runtime0.JSX.Element;
|
|
66
|
-
declare function ItemFooter({
|
|
67
|
-
className,
|
|
68
|
-
...props
|
|
69
|
-
}: ItemFooterProps): _$react_jsx_runtime0.JSX.Element;
|
|
23
|
+
declare function ItemGroup({ className, ...props }: ItemGroupProps): React.JSX.Element;
|
|
24
|
+
declare function ItemSeparator({ className, ...props }: ItemSeparatorProps): React.JSX.Element;
|
|
25
|
+
declare function Item({ className, variant, size, render, ...props }: ItemProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
26
|
+
declare function ItemMedia({ className, variant, ...props }: ItemMediaProps): React.JSX.Element;
|
|
27
|
+
declare function ItemContent({ className, ...props }: ItemContentProps): React.JSX.Element;
|
|
28
|
+
declare function ItemTitle({ className, children, ...props }: ItemTitleProps): React.JSX.Element;
|
|
29
|
+
declare function ItemDescription({ className, ...props }: ItemDescriptionProps): React.JSX.Element;
|
|
30
|
+
declare function ItemActions({ className, ...props }: ItemActionsProps): React.JSX.Element;
|
|
31
|
+
declare function ItemHeader({ className, ...props }: ItemHeaderProps): React.JSX.Element;
|
|
32
|
+
declare function ItemFooter({ className, ...props }: ItemFooterProps): React.JSX.Element;
|
|
70
33
|
//#endregion
|
|
71
34
|
export { Item, ItemActions, type ItemActionsProps, ItemContent, type ItemContentProps, ItemDescription, type ItemDescriptionProps, ItemFooter, type ItemFooterProps, ItemGroup, type ItemGroupProps, ItemHeader, type ItemHeaderProps, ItemMedia, type ItemMediaProps, type ItemProps, ItemSeparator, type ItemSeparatorProps, ItemTitle, type ItemTitleProps, itemMediaVariants, itemVariants };
|
package/dist/item.js
CHANGED
|
@@ -2,21 +2,22 @@
|
|
|
2
2
|
import { cn } from "./lib/utils.js";
|
|
3
3
|
import { Separator } from "./separator.js";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import * as React from "react";
|
|
5
6
|
import { cva } from "class-variance-authority";
|
|
6
7
|
import { mergeProps } from "@base-ui/react/merge-props";
|
|
7
8
|
import { useRender } from "@base-ui/react/use-render";
|
|
8
9
|
//#region src/item.tsx
|
|
9
|
-
const itemVariants = cva("[a]:hover:bg-
|
|
10
|
+
const itemVariants = cva("[a,button]:hover:bg-highlight [a,button]:cursor-clickable rounded-md border text-sm w-full group/item focus-visible:border-focus focus-visible:ring-focus/50 flex items-center flex-wrap outline-hidden motion-color focus-visible:ring-3 disabled:pointer-events-none disabled:opacity-30 aria-disabled:pointer-events-none aria-disabled:opacity-30", {
|
|
10
11
|
variants: {
|
|
11
12
|
variant: {
|
|
12
13
|
default: "border-transparent",
|
|
13
|
-
outline: "border-
|
|
14
|
-
muted: "bg-secondary/50 border-transparent"
|
|
14
|
+
outline: "border-contour",
|
|
15
|
+
muted: "bg-secondary/50 border-transparent [a,button]:hover:bg-secondary"
|
|
15
16
|
},
|
|
16
17
|
size: {
|
|
17
|
-
default: "gap-
|
|
18
|
-
sm: "gap-
|
|
19
|
-
xs: "gap-2 px-
|
|
18
|
+
default: "gap-3.5 px-4 py-3.5",
|
|
19
|
+
sm: "gap-3.5 px-3.5 py-3",
|
|
20
|
+
xs: "gap-2.5 px-3 py-2.5 in-data-[slot=menu-content]:p-0"
|
|
20
21
|
}
|
|
21
22
|
},
|
|
22
23
|
defaultVariants: {
|
|
@@ -77,21 +78,26 @@ function ItemMedia({ className, variant = "default", ...props }) {
|
|
|
77
78
|
function ItemContent({ className, ...props }) {
|
|
78
79
|
return /* @__PURE__ */ jsx("div", {
|
|
79
80
|
"data-slot": "item-content",
|
|
80
|
-
className: cn("flex flex-1 flex-col gap-1 group-data-[size=xs]/item:gap-0 [&+[data-slot=item-content]]:flex-none", className),
|
|
81
|
+
className: cn("flex min-w-0 flex-1 flex-col gap-1 group-data-[size=xs]/item:gap-0.5 [&+[data-slot=item-content]]:flex-none", className),
|
|
81
82
|
...props
|
|
82
83
|
});
|
|
83
84
|
}
|
|
84
|
-
function ItemTitle({ className, ...props }) {
|
|
85
|
+
function ItemTitle({ className, children, ...props }) {
|
|
85
86
|
return /* @__PURE__ */ jsx("div", {
|
|
86
87
|
"data-slot": "item-title",
|
|
87
|
-
className: cn("line-clamp-1 flex w-fit items-center gap-2 text-sm leading-snug font-medium underline-offset-4", className),
|
|
88
|
-
...props
|
|
88
|
+
className: cn("line-clamp-1 flex w-fit max-w-full min-w-0 items-center gap-2 text-sm leading-snug font-medium underline-offset-4 [&>:not([data-slot=item-title-text])]:shrink-0", className),
|
|
89
|
+
...props,
|
|
90
|
+
children: React.Children.map(children, (child) => typeof child === "string" || typeof child === "number" ? /* @__PURE__ */ jsx("span", {
|
|
91
|
+
"data-slot": "item-title-text",
|
|
92
|
+
className: "truncate",
|
|
93
|
+
children: child
|
|
94
|
+
}) : child)
|
|
89
95
|
});
|
|
90
96
|
}
|
|
91
97
|
function ItemDescription({ className, ...props }) {
|
|
92
98
|
return /* @__PURE__ */ jsx("p", {
|
|
93
99
|
"data-slot": "item-description",
|
|
94
|
-
className: cn("text-muted [&>a:hover]:text-primary line-clamp-2 text-
|
|
100
|
+
className: cn("text-muted [&>a:hover]:text-primary line-clamp-2 text-start text-sm leading-normal font-normal group-data-[size=xs]/item:text-xs [&>a]:underline [&>a]:underline-offset-4", className),
|
|
95
101
|
...props
|
|
96
102
|
});
|
|
97
103
|
}
|
package/dist/kbd.d.ts
CHANGED
|
@@ -1,16 +1,8 @@
|
|
|
1
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
1
|
import * as React from "react";
|
|
3
|
-
|
|
4
2
|
//#region src/kbd.d.ts
|
|
5
3
|
type KbdProps = React.ComponentProps<"kbd">;
|
|
6
|
-
type KbdGroupProps = React.ComponentProps<"
|
|
7
|
-
declare function Kbd({
|
|
8
|
-
|
|
9
|
-
...props
|
|
10
|
-
}: KbdProps): _$react_jsx_runtime0.JSX.Element;
|
|
11
|
-
declare function KbdGroup({
|
|
12
|
-
className,
|
|
13
|
-
...props
|
|
14
|
-
}: KbdGroupProps): _$react_jsx_runtime0.JSX.Element;
|
|
4
|
+
type KbdGroupProps = React.ComponentProps<"kbd">;
|
|
5
|
+
declare function Kbd({ className, ...props }: KbdProps): React.JSX.Element;
|
|
6
|
+
declare function KbdGroup({ className, ...props }: KbdGroupProps): React.JSX.Element;
|
|
15
7
|
//#endregion
|
|
16
8
|
export { Kbd, KbdGroup, type KbdGroupProps, type KbdProps };
|
package/dist/kbd.js
CHANGED
|
@@ -4,12 +4,12 @@ import { jsx } from "react/jsx-runtime";
|
|
|
4
4
|
function Kbd({ className, ...props }) {
|
|
5
5
|
return /* @__PURE__ */ jsx("kbd", {
|
|
6
6
|
"data-slot": "kbd",
|
|
7
|
-
className: cn("bg-secondary text-
|
|
7
|
+
className: cn("bg-secondary text-contrast in-data-[slot=tooltip-content]:bg-contrast-inverse/10 in-data-[slot=tooltip-content]:text-contrast-inverse pointer-events-none inline-flex h-5.5 w-fit min-w-5.5 items-center justify-center gap-1 rounded-sm px-1.5 font-sans text-xs font-medium select-none [&_svg:not([class*='size-'])]:size-3 in-data-[slot=input-group]:bg-contrast-inverse/50", className),
|
|
8
8
|
...props
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
function KbdGroup({ className, ...props }) {
|
|
12
|
-
return /* @__PURE__ */ jsx("
|
|
12
|
+
return /* @__PURE__ */ jsx("kbd", {
|
|
13
13
|
"data-slot": "kbd-group",
|
|
14
14
|
className: cn("inline-flex items-center gap-1", className),
|
|
15
15
|
...props
|
package/dist/label.d.ts
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
1
|
import * as React from "react";
|
|
3
|
-
|
|
4
2
|
//#region src/label.d.ts
|
|
5
3
|
type LabelProps = React.ComponentProps<"label">;
|
|
6
|
-
declare function Label({
|
|
7
|
-
className,
|
|
8
|
-
...props
|
|
9
|
-
}: LabelProps): _$react_jsx_runtime0.JSX.Element;
|
|
4
|
+
declare function Label({ className, ...props }: LabelProps): React.JSX.Element;
|
|
10
5
|
//#endregion
|
|
11
6
|
export { Label, type LabelProps };
|
package/dist/label.js
CHANGED
|
@@ -4,7 +4,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
4
4
|
function Label({ className, ...props }) {
|
|
5
5
|
return /* @__PURE__ */ jsx("label", {
|
|
6
6
|
"data-slot": "label",
|
|
7
|
-
className: cn("flex items-center gap-2 text-sm leading-
|
|
7
|
+
className: cn("flex items-center gap-2 text-sm leading-snug font-medium select-none [&[for]]:cursor-clickable", "in-data-disabled:pointer-events-none in-data-disabled:opacity-30", "peer-data-disabled:pointer-events-none peer-data-disabled:opacity-30", "has-[+:is(:disabled,[data-disabled])]:pointer-events-none has-[+:is(:disabled,[data-disabled])]:opacity-30", className),
|
|
8
8
|
...props
|
|
9
9
|
});
|
|
10
10
|
}
|
package/dist/lib/focus.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Menu } from "@base-ui/react/menu";
|
|
3
|
-
|
|
4
3
|
//#region src/lib/focus.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* The full shape Base UI's `finalFocus` prop accepts on the
|
|
@@ -25,7 +24,7 @@ type FinalFocus = NonNullable<React.ComponentProps<typeof Menu.Popup>["finalFocu
|
|
|
25
24
|
* expected focus return.
|
|
26
25
|
* - `"never"` — never auto-restore focus on close.
|
|
27
26
|
*/
|
|
28
|
-
type RestoreFocusOnClose = "always" | "keyboard" | "never";
|
|
27
|
+
export type RestoreFocusOnClose = "always" | "keyboard" | "never";
|
|
29
28
|
/**
|
|
30
29
|
* Resolve the high-level {@link RestoreFocusOnClose} policy to the
|
|
31
30
|
* Base UI `finalFocus` value.
|
|
@@ -36,6 +35,5 @@ type RestoreFocusOnClose = "always" | "keyboard" | "never";
|
|
|
36
35
|
* other — when `restoreFocusOnClose` is set it fully governs
|
|
37
36
|
* `finalFocus`.
|
|
38
37
|
*/
|
|
39
|
-
declare function resolveFinalFocus(restoreFocusOnClose: RestoreFocusOnClose | undefined, finalFocus: FinalFocus | undefined): FinalFocus | undefined;
|
|
40
|
-
//#endregion
|
|
41
|
-
export { RestoreFocusOnClose, resolveFinalFocus };
|
|
38
|
+
export declare function resolveFinalFocus(restoreFocusOnClose: RestoreFocusOnClose | undefined, finalFocus: FinalFocus | undefined): FinalFocus | undefined;
|
|
39
|
+
//#endregion
|
|
@@ -1,25 +1,22 @@
|
|
|
1
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
1
|
import * as React from "react";
|
|
3
|
-
|
|
4
2
|
//#region src/lib/internal-icons.d.ts
|
|
5
3
|
type IconProps = React.SVGProps<SVGSVGElement>;
|
|
6
|
-
declare function ChevronDownIcon(props: IconProps):
|
|
7
|
-
declare function ChevronUpIcon(props: IconProps):
|
|
8
|
-
declare function ChevronLeftIcon(props: IconProps):
|
|
9
|
-
declare function ChevronRightIcon(props: IconProps):
|
|
10
|
-
declare function CheckIcon(props: IconProps):
|
|
11
|
-
declare function CloseIcon(props: IconProps):
|
|
12
|
-
declare function MinusIcon(props: IconProps):
|
|
13
|
-
declare function EllipsisIcon(props: IconProps):
|
|
14
|
-
declare function EllipsisVerticalIcon(props: IconProps):
|
|
15
|
-
declare function ChevronsUpDownIcon(props: IconProps):
|
|
16
|
-
declare function SidebarPanelIcon(props: IconProps):
|
|
17
|
-
declare function LoaderIcon(props: IconProps):
|
|
18
|
-
declare function AlertTriangleIcon(props: IconProps):
|
|
19
|
-
declare function SuccessCircleIcon(props: IconProps):
|
|
20
|
-
declare function InfoCircleIcon(props: IconProps):
|
|
21
|
-
declare function ErrorCircleIcon(props: IconProps):
|
|
22
|
-
declare function TrashIcon(props: IconProps):
|
|
23
|
-
declare function StarIcon(props: IconProps):
|
|
24
|
-
//#endregion
|
|
25
|
-
export { AlertTriangleIcon, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, ChevronsUpDownIcon, CloseIcon, EllipsisIcon, EllipsisVerticalIcon, ErrorCircleIcon, InfoCircleIcon, LoaderIcon, MinusIcon, SidebarPanelIcon, StarIcon, SuccessCircleIcon, TrashIcon };
|
|
4
|
+
export declare function ChevronDownIcon(props: IconProps): React.JSX.Element;
|
|
5
|
+
export declare function ChevronUpIcon(props: IconProps): React.JSX.Element;
|
|
6
|
+
export declare function ChevronLeftIcon(props: IconProps): React.JSX.Element;
|
|
7
|
+
export declare function ChevronRightIcon(props: IconProps): React.JSX.Element;
|
|
8
|
+
export declare function CheckIcon(props: IconProps): React.JSX.Element;
|
|
9
|
+
export declare function CloseIcon(props: IconProps): React.JSX.Element;
|
|
10
|
+
export declare function MinusIcon(props: IconProps): React.JSX.Element;
|
|
11
|
+
export declare function EllipsisIcon(props: IconProps): React.JSX.Element;
|
|
12
|
+
export declare function EllipsisVerticalIcon(props: IconProps): React.JSX.Element;
|
|
13
|
+
export declare function ChevronsUpDownIcon(props: IconProps): React.JSX.Element;
|
|
14
|
+
export declare function SidebarPanelIcon(props: IconProps): React.JSX.Element;
|
|
15
|
+
export declare function LoaderIcon(props: IconProps): React.JSX.Element;
|
|
16
|
+
export declare function AlertTriangleIcon(props: IconProps): React.JSX.Element;
|
|
17
|
+
export declare function SuccessCircleIcon(props: IconProps): React.JSX.Element;
|
|
18
|
+
export declare function InfoCircleIcon(props: IconProps): React.JSX.Element;
|
|
19
|
+
export declare function ErrorCircleIcon(props: IconProps): React.JSX.Element;
|
|
20
|
+
export declare function TrashIcon(props: IconProps): React.JSX.Element;
|
|
21
|
+
export declare function StarIcon(props: IconProps): React.JSX.Element;
|
|
22
|
+
//#endregion
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
//#region src/lib/merge-refs.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Combines refs so one element can feed several of them: a component's own
|
|
5
|
+
* ref and the one a consumer passes. Takes object refs, callback refs and
|
|
6
|
+
* `undefined`.
|
|
7
|
+
*/
|
|
8
|
+
export declare function mergeRefs<T>(...refs: (React.Ref<T> | undefined)[]): (el: T | null) => void;
|
|
9
|
+
//#endregion
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//#region src/lib/merge-refs.ts
|
|
2
|
+
/**
|
|
3
|
+
* Combines refs so one element can feed several of them: a component's own
|
|
4
|
+
* ref and the one a consumer passes. Takes object refs, callback refs and
|
|
5
|
+
* `undefined`.
|
|
6
|
+
*/
|
|
7
|
+
function mergeRefs(...refs) {
|
|
8
|
+
return (el) => {
|
|
9
|
+
refs.forEach((ref) => {
|
|
10
|
+
if (typeof ref === "function") ref(el);
|
|
11
|
+
else if (ref && typeof ref === "object") ref.current = el;
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { mergeRefs };
|
package/dist/lib/utils.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ClassValue } from "clsx";
|
|
2
|
-
|
|
3
2
|
//#region src/lib/utils.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* `cn()` is the single className helper.
|
|
@@ -35,7 +34,6 @@ import { ClassValue } from "clsx";
|
|
|
35
34
|
* ```
|
|
36
35
|
*/
|
|
37
36
|
type CnValue<State> = ClassValue | ((state: State) => ClassValue);
|
|
38
|
-
declare function cn(...inputs: ClassValue[]): string;
|
|
39
|
-
declare function cn<State>(...inputs: CnValue<State>[]): (state: State) => string;
|
|
40
|
-
//#endregion
|
|
41
|
-
export { cn };
|
|
37
|
+
export declare function cn(...inputs: ClassValue[]): string;
|
|
38
|
+
export declare function cn<State>(...inputs: CnValue<State>[]): (state: State) => string;
|
|
39
|
+
//#endregion
|
package/dist/lib/utils.js
CHANGED
|
@@ -8,6 +8,8 @@ import { extendTailwindMerge } from "tailwind-merge";
|
|
|
8
8
|
* exclusive — the last one applied wins (e.g. a consumer overriding a
|
|
9
9
|
* component's default animation). `motion-color` / `motion-scrim` are left out
|
|
10
10
|
* on purpose: they compose with an enter recipe on the same element.
|
|
11
|
+
* - the spin speeds (`motion-spin-*`) are mutually exclusive too, so a
|
|
12
|
+
* consumer's `motion-spin-lg` replaces a component's `motion-spin-sm`.
|
|
11
13
|
* - `cursor-clickable` joins the built-in `cursor` group.
|
|
12
14
|
*/
|
|
13
15
|
const twMerge = extendTailwindMerge({ extend: { classGroups: {
|
|
@@ -23,12 +25,18 @@ const twMerge = extendTailwindMerge({ extend: { classGroups: {
|
|
|
23
25
|
"motion-fade-lg",
|
|
24
26
|
"motion-pop-md"
|
|
25
27
|
],
|
|
28
|
+
"motion-spin": [
|
|
29
|
+
"motion-spin-sm",
|
|
30
|
+
"motion-spin-md",
|
|
31
|
+
"motion-spin-lg"
|
|
32
|
+
],
|
|
26
33
|
cursor: ["cursor-clickable"]
|
|
27
34
|
} } });
|
|
28
35
|
function cn(...inputs) {
|
|
29
36
|
if (!inputs.some((v) => typeof v === "function")) return twMerge(clsx(inputs));
|
|
30
37
|
return (state) => {
|
|
31
|
-
|
|
38
|
+
const resolved = inputs.map((v) => typeof v === "function" ? v(state) : v);
|
|
39
|
+
return twMerge(clsx(resolved));
|
|
32
40
|
};
|
|
33
41
|
}
|
|
34
42
|
//#endregion
|
package/dist/masonry.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
1
|
import * as React from "react";
|
|
3
2
|
import { HTMLMotionProps } from "motion/react";
|
|
4
|
-
|
|
5
3
|
//#region src/masonry.d.ts
|
|
6
4
|
type MasonryProps = React.ComponentProps<"div"> & {
|
|
7
5
|
columns?: number;
|
|
@@ -12,19 +10,7 @@ type MasonryItemProps = Omit<HTMLMotionProps<"div">, "children"> & {
|
|
|
12
10
|
span?: number;
|
|
13
11
|
children?: React.ReactNode;
|
|
14
12
|
};
|
|
15
|
-
declare function Masonry({
|
|
16
|
-
|
|
17
|
-
columnWidth,
|
|
18
|
-
gap,
|
|
19
|
-
className,
|
|
20
|
-
children,
|
|
21
|
-
...props
|
|
22
|
-
}: MasonryProps): _$react_jsx_runtime0.JSX.Element;
|
|
23
|
-
declare function MasonryItem({
|
|
24
|
-
className,
|
|
25
|
-
span,
|
|
26
|
-
children,
|
|
27
|
-
...props
|
|
28
|
-
}: MasonryItemProps): _$react_jsx_runtime0.JSX.Element;
|
|
13
|
+
declare function Masonry({ columns, columnWidth, gap, className, children, ref, ...props }: MasonryProps): React.JSX.Element;
|
|
14
|
+
declare function MasonryItem({ className, span, children, ...props }: MasonryItemProps): React.JSX.Element;
|
|
29
15
|
//#endregion
|
|
30
16
|
export { Masonry, MasonryItem, type MasonryItemProps, type MasonryProps };
|
package/dist/masonry.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "./lib/utils.js";
|
|
3
3
|
import { StarIcon } from "./lib/internal-icons.js";
|
|
4
|
+
import { mergeRefs } from "./lib/merge-refs.js";
|
|
4
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
6
|
import * as React from "react";
|
|
6
7
|
import { AnimatePresence, motion, useReducedMotion } from "motion/react";
|
|
7
8
|
//#region src/masonry.tsx
|
|
8
9
|
const STAGGER_STEP = .05;
|
|
9
10
|
const MasonryStaggerContext = React.createContext(null);
|
|
10
|
-
function Masonry({ columns, columnWidth, gap = 4, className, children, ...props }) {
|
|
11
|
+
function Masonry({ columns, columnWidth, gap = 4, className, children, ref, ...props }) {
|
|
11
12
|
const containerRef = React.useRef(null);
|
|
13
|
+
const mergedRef = React.useMemo(() => mergeRefs(containerRef, ref), [ref]);
|
|
12
14
|
const rafRef = React.useRef(0);
|
|
13
15
|
const staggerCounterRef = React.useRef(0);
|
|
14
16
|
staggerCounterRef.current = 0;
|
|
@@ -47,7 +49,7 @@ function Masonry({ columns, columnWidth, gap = 4, className, children, ...props
|
|
|
47
49
|
container.style.removeProperty("flex-direction");
|
|
48
50
|
container.style.removeProperty("gap");
|
|
49
51
|
const colWidth = (containerWidth - (colCount - 1) * gapPx) / colCount;
|
|
50
|
-
const columnBottoms =
|
|
52
|
+
const columnBottoms = Array.from({ length: colCount }, () => 0);
|
|
51
53
|
const topItems = [];
|
|
52
54
|
const regularItems = [];
|
|
53
55
|
for (const item of items) {
|
|
@@ -134,7 +136,7 @@ function Masonry({ columns, columnWidth, gap = 4, className, children, ...props
|
|
|
134
136
|
return /* @__PURE__ */ jsx(MasonryStaggerContext.Provider, {
|
|
135
137
|
value: getStaggerIndex,
|
|
136
138
|
children: /* @__PURE__ */ jsx("div", {
|
|
137
|
-
ref:
|
|
139
|
+
ref: mergedRef,
|
|
138
140
|
"data-slot": "masonry",
|
|
139
141
|
className: cn("relative", className),
|
|
140
142
|
...props,
|
package/dist/menu.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { RestoreFocusOnClose } from "./lib/focus.js";
|
|
2
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
2
|
import * as React from "react";
|
|
4
3
|
import { Menu as Menu$1 } from "@base-ui/react/menu";
|
|
5
|
-
|
|
6
4
|
//#region src/menu.d.ts
|
|
7
5
|
type MenuProps = React.ComponentProps<typeof Menu$1.Root>;
|
|
8
6
|
type MenuPortalProps = React.ComponentProps<typeof Menu$1.Portal>;
|
|
@@ -22,7 +20,8 @@ type MenuLabelProps = React.ComponentProps<typeof Menu$1.GroupLabel> & {
|
|
|
22
20
|
};
|
|
23
21
|
type MenuItemProps = React.ComponentProps<typeof Menu$1.Item> & {
|
|
24
22
|
inset?: boolean;
|
|
25
|
-
|
|
23
|
+
/** `danger` turns the item's text and leading icon red. */
|
|
24
|
+
variant?: "default" | "danger";
|
|
26
25
|
};
|
|
27
26
|
type MenuSubProps = React.ComponentProps<typeof Menu$1.SubmenuRoot>;
|
|
28
27
|
type MenuSubTriggerProps = React.ComponentProps<typeof Menu$1.SubmenuTrigger> & {
|
|
@@ -38,67 +37,20 @@ type MenuRadioItemProps = React.ComponentProps<typeof Menu$1.RadioItem> & {
|
|
|
38
37
|
};
|
|
39
38
|
type MenuSeparatorProps = React.ComponentProps<typeof Menu$1.Separator>;
|
|
40
39
|
type MenuShortcutProps = React.ComponentProps<"span">;
|
|
41
|
-
declare function Menu(props: MenuProps):
|
|
42
|
-
declare function MenuPortal(props: MenuPortalProps):
|
|
43
|
-
declare function MenuTrigger(props: MenuTriggerProps):
|
|
44
|
-
declare function MenuContent({
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}:
|
|
54
|
-
declare function
|
|
55
|
-
declare function
|
|
56
|
-
className,
|
|
57
|
-
inset,
|
|
58
|
-
...props
|
|
59
|
-
}: MenuLabelProps): _$react_jsx_runtime0.JSX.Element;
|
|
60
|
-
declare function MenuItem({
|
|
61
|
-
className,
|
|
62
|
-
inset,
|
|
63
|
-
variant,
|
|
64
|
-
...props
|
|
65
|
-
}: MenuItemProps): _$react_jsx_runtime0.JSX.Element;
|
|
66
|
-
declare function MenuSub(props: MenuSubProps): _$react_jsx_runtime0.JSX.Element;
|
|
67
|
-
declare function MenuSubTrigger({
|
|
68
|
-
className,
|
|
69
|
-
inset,
|
|
70
|
-
children,
|
|
71
|
-
...props
|
|
72
|
-
}: MenuSubTriggerProps): _$react_jsx_runtime0.JSX.Element;
|
|
73
|
-
declare function MenuSubContent({
|
|
74
|
-
align,
|
|
75
|
-
alignOffset,
|
|
76
|
-
side,
|
|
77
|
-
sideOffset,
|
|
78
|
-
className,
|
|
79
|
-
...props
|
|
80
|
-
}: MenuSubContentProps): _$react_jsx_runtime0.JSX.Element;
|
|
81
|
-
declare function MenuCheckboxItem({
|
|
82
|
-
className,
|
|
83
|
-
children,
|
|
84
|
-
checked,
|
|
85
|
-
inset,
|
|
86
|
-
...props
|
|
87
|
-
}: MenuCheckboxItemProps): _$react_jsx_runtime0.JSX.Element;
|
|
88
|
-
declare function MenuRadioGroup(props: MenuRadioGroupProps): _$react_jsx_runtime0.JSX.Element;
|
|
89
|
-
declare function MenuRadioItem({
|
|
90
|
-
className,
|
|
91
|
-
children,
|
|
92
|
-
inset,
|
|
93
|
-
...props
|
|
94
|
-
}: MenuRadioItemProps): _$react_jsx_runtime0.JSX.Element;
|
|
95
|
-
declare function MenuSeparator({
|
|
96
|
-
className,
|
|
97
|
-
...props
|
|
98
|
-
}: MenuSeparatorProps): _$react_jsx_runtime0.JSX.Element;
|
|
99
|
-
declare function MenuShortcut({
|
|
100
|
-
className,
|
|
101
|
-
...props
|
|
102
|
-
}: MenuShortcutProps): _$react_jsx_runtime0.JSX.Element;
|
|
40
|
+
declare function Menu(props: MenuProps): React.JSX.Element;
|
|
41
|
+
declare function MenuPortal(props: MenuPortalProps): React.JSX.Element;
|
|
42
|
+
declare function MenuTrigger(props: MenuTriggerProps): React.JSX.Element;
|
|
43
|
+
declare function MenuContent({ align, alignOffset, side, sideOffset, className, restoreFocusOnClose, finalFocus, ...props }: MenuContentProps): React.JSX.Element;
|
|
44
|
+
declare function MenuGroup(props: MenuGroupProps): React.JSX.Element;
|
|
45
|
+
declare function MenuLabel({ className, inset, ...props }: MenuLabelProps): React.JSX.Element;
|
|
46
|
+
declare function MenuItem({ className, inset, variant, ...props }: MenuItemProps): React.JSX.Element;
|
|
47
|
+
declare function MenuSub(props: MenuSubProps): React.JSX.Element;
|
|
48
|
+
declare function MenuSubTrigger({ className, inset, children, ...props }: MenuSubTriggerProps): React.JSX.Element;
|
|
49
|
+
declare function MenuSubContent({ align, alignOffset, side, sideOffset, className, ...props }: MenuSubContentProps): React.JSX.Element;
|
|
50
|
+
declare function MenuCheckboxItem({ className, children, checked, inset, ...props }: MenuCheckboxItemProps): React.JSX.Element;
|
|
51
|
+
declare function MenuRadioGroup(props: MenuRadioGroupProps): React.JSX.Element;
|
|
52
|
+
declare function MenuRadioItem({ className, children, inset, ...props }: MenuRadioItemProps): React.JSX.Element;
|
|
53
|
+
declare function MenuSeparator({ className, ...props }: MenuSeparatorProps): React.JSX.Element;
|
|
54
|
+
declare function MenuShortcut({ className, ...props }: MenuShortcutProps): React.JSX.Element;
|
|
103
55
|
//#endregion
|
|
104
56
|
export { Menu, MenuCheckboxItem, type MenuCheckboxItemProps, MenuContent, type MenuContentProps, MenuGroup, type MenuGroupProps, MenuItem, type MenuItemProps, MenuLabel, type MenuLabelProps, MenuPortal, type MenuPortalProps, type MenuProps, MenuRadioGroup, type MenuRadioGroupProps, MenuRadioItem, type MenuRadioItemProps, MenuSeparator, type MenuSeparatorProps, MenuShortcut, type MenuShortcutProps, MenuSub, MenuSubContent, type MenuSubContentProps, type MenuSubProps, MenuSubTrigger, type MenuSubTriggerProps, MenuTrigger, type MenuTriggerProps, type RestoreFocusOnClose };
|