@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/scroll-area.js
CHANGED
|
@@ -3,18 +3,37 @@ import { cn } from "./lib/utils.js";
|
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { ScrollArea as ScrollArea$1 } from "@base-ui/react/scroll-area";
|
|
5
5
|
//#region src/scroll-area.tsx
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* The edge fade is a mask, so the content itself turns transparent and
|
|
8
|
+
* whatever is behind it shows through: no shadow color to match, in any
|
|
9
|
+
* theme. Each edge has a fixed fade (`--scroll-area-fade`) that switches on
|
|
10
|
+
* when Base UI marks that edge as having more content (`data-overflow-*`):
|
|
11
|
+
* its edge opacity goes from 1 (none) to 0 (fully faded).
|
|
12
|
+
* The two axes are intersected; the horizontal one flips in right-to-left
|
|
13
|
+
* layouts, where Base UI's "start" is the right edge.
|
|
14
|
+
*/
|
|
15
|
+
const FADE_MASK = "[--scroll-area-fade-x:to_right] rtl:[--scroll-area-fade-x:to_left] data-overflow-y-start:[--scroll-area-fade-top:0] data-overflow-y-end:[--scroll-area-fade-bottom:0] data-overflow-x-start:[--scroll-area-fade-start:0] data-overflow-x-end:[--scroll-area-fade-end:0] [mask-composite:intersect] [mask-image:linear-gradient(to_bottom,rgb(0_0_0/var(--scroll-area-fade-top,1)),#000_var(--scroll-area-fade,2.5rem),#000_calc(100%_-_var(--scroll-area-fade,2.5rem)),rgb(0_0_0/var(--scroll-area-fade-bottom,1))),linear-gradient(var(--scroll-area-fade-x),rgb(0_0_0/var(--scroll-area-fade-start,1)),#000_var(--scroll-area-fade,2.5rem),#000_calc(100%_-_var(--scroll-area-fade,2.5rem)),rgb(0_0_0/var(--scroll-area-fade-end,1)))]";
|
|
16
|
+
/**
|
|
17
|
+
* A scrollable region with styled scrollbars. Both scrollbars are built in:
|
|
18
|
+
* Base UI only mounts one when its axis overflows, so pass content and the
|
|
19
|
+
* right bars appear. They fade in while the area is hovered or scrolling.
|
|
20
|
+
*/
|
|
21
|
+
function ScrollArea({ className, children, fade = true, ...props }) {
|
|
7
22
|
return /* @__PURE__ */ jsxs(ScrollArea$1.Root, {
|
|
8
23
|
"data-slot": "scroll-area",
|
|
9
|
-
className: cn("relative", className),
|
|
24
|
+
className: cn("relative motion-color has-[>[data-slot=scroll-area-viewport]:focus-visible]:ring-3 has-[>[data-slot=scroll-area-viewport]:focus-visible]:ring-focus/50 has-[>[data-slot=scroll-area-viewport]:focus-visible]:outline-hidden", className),
|
|
10
25
|
...props,
|
|
11
26
|
children: [
|
|
12
27
|
/* @__PURE__ */ jsx(ScrollArea$1.Viewport, {
|
|
13
28
|
"data-slot": "scroll-area-viewport",
|
|
14
|
-
className: "
|
|
15
|
-
children
|
|
29
|
+
className: cn("size-full rounded-[inherit] outline-hidden", fade && FADE_MASK),
|
|
30
|
+
children: /* @__PURE__ */ jsx(ScrollArea$1.Content, {
|
|
31
|
+
"data-slot": "scroll-area-content",
|
|
32
|
+
children
|
|
33
|
+
})
|
|
16
34
|
}),
|
|
17
|
-
/* @__PURE__ */ jsx(ScrollBar, {}),
|
|
35
|
+
/* @__PURE__ */ jsx(ScrollBar, { orientation: "vertical" }),
|
|
36
|
+
/* @__PURE__ */ jsx(ScrollBar, { orientation: "horizontal" }),
|
|
18
37
|
/* @__PURE__ */ jsx(ScrollArea$1.Corner, { "data-slot": "scroll-area-corner" })
|
|
19
38
|
]
|
|
20
39
|
});
|
|
@@ -23,11 +42,11 @@ function ScrollBar({ className, orientation = "vertical", ...props }) {
|
|
|
23
42
|
return /* @__PURE__ */ jsx(ScrollArea$1.Scrollbar, {
|
|
24
43
|
"data-slot": "scroll-area-scrollbar",
|
|
25
44
|
orientation,
|
|
26
|
-
className: cn("flex touch-none p-px transition-
|
|
45
|
+
className: cn("pointer-events-none flex touch-none p-px opacity-0 transition-opacity duration-(--duration-md) ease-(--ease) select-none data-hovering:pointer-events-auto data-hovering:opacity-100 data-scrolling:pointer-events-auto data-scrolling:opacity-100 data-scrolling:duration-0 data-[orientation=horizontal]:h-2.5 data-[orientation=horizontal]:flex-col data-[orientation=horizontal]:border-t data-[orientation=horizontal]:border-t-transparent data-[orientation=vertical]:h-full data-[orientation=vertical]:w-2.5 data-[orientation=vertical]:border-s data-[orientation=vertical]:border-s-transparent", className),
|
|
27
46
|
...props,
|
|
28
47
|
children: /* @__PURE__ */ jsx(ScrollArea$1.Thumb, {
|
|
29
48
|
"data-slot": "scroll-area-thumb",
|
|
30
|
-
className: "bg-
|
|
49
|
+
className: "bg-shade relative flex-1 rounded-full"
|
|
31
50
|
})
|
|
32
51
|
});
|
|
33
52
|
}
|
package/dist/select.d.ts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
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 { Select as Select$1 } from "@base-ui/react/select";
|
|
5
|
-
import * as _$class_variance_authority_types0 from "class-variance-authority/types";
|
|
6
|
-
|
|
7
4
|
//#region src/select.d.ts
|
|
8
5
|
type SelectProps<Value, Multiple extends boolean | undefined = false> = Select$1.Root.Props<Value, Multiple>;
|
|
9
6
|
type SelectGroupProps = React.ComponentProps<typeof Select$1.Group>;
|
|
@@ -19,68 +16,22 @@ type SelectSeparatorProps = React.ComponentProps<typeof Select$1.Separator>;
|
|
|
19
16
|
type SelectScrollUpButtonProps = React.ComponentProps<typeof Select$1.ScrollUpArrow>;
|
|
20
17
|
type SelectScrollDownButtonProps = React.ComponentProps<typeof Select$1.ScrollDownArrow>;
|
|
21
18
|
declare const selectTriggerVariants: (props?: ({
|
|
22
|
-
size?: "default" | "
|
|
23
|
-
} &
|
|
19
|
+
size?: "default" | "lg" | "sm" | "xs" | null | undefined;
|
|
20
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
24
21
|
type SelectTriggerProps = SelectTriggerBaseProps & VariantProps<typeof selectTriggerVariants>;
|
|
25
22
|
type SelectContentProps = SelectPopupProps & Pick<SelectPositionerProps, "align" | "alignOffset" | "side" | "sideOffset" | "alignItemWithTrigger">;
|
|
26
|
-
declare function Select<Value, Multiple extends boolean | undefined = false>({
|
|
27
|
-
|
|
28
|
-
}:
|
|
29
|
-
declare function
|
|
30
|
-
|
|
31
|
-
}:
|
|
32
|
-
declare function
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}:
|
|
36
|
-
declare function
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}: SelectListProps): _$react_jsx_runtime0.JSX.Element;
|
|
40
|
-
declare function SelectGroup({
|
|
41
|
-
className,
|
|
42
|
-
...props
|
|
43
|
-
}: SelectGroupProps): _$react_jsx_runtime0.JSX.Element;
|
|
44
|
-
declare function SelectValue({
|
|
45
|
-
className,
|
|
46
|
-
...props
|
|
47
|
-
}: SelectValueProps): _$react_jsx_runtime0.JSX.Element;
|
|
48
|
-
declare function SelectTrigger({
|
|
49
|
-
className,
|
|
50
|
-
size,
|
|
51
|
-
children,
|
|
52
|
-
...props
|
|
53
|
-
}: SelectTriggerProps): _$react_jsx_runtime0.JSX.Element;
|
|
54
|
-
declare function SelectContent({
|
|
55
|
-
className,
|
|
56
|
-
children,
|
|
57
|
-
side,
|
|
58
|
-
sideOffset,
|
|
59
|
-
align,
|
|
60
|
-
alignOffset,
|
|
61
|
-
alignItemWithTrigger,
|
|
62
|
-
...props
|
|
63
|
-
}: SelectContentProps): _$react_jsx_runtime0.JSX.Element;
|
|
64
|
-
declare function SelectLabel({
|
|
65
|
-
className,
|
|
66
|
-
...props
|
|
67
|
-
}: SelectLabelProps): _$react_jsx_runtime0.JSX.Element;
|
|
68
|
-
declare function SelectItem({
|
|
69
|
-
className,
|
|
70
|
-
children,
|
|
71
|
-
...props
|
|
72
|
-
}: SelectItemProps): _$react_jsx_runtime0.JSX.Element;
|
|
73
|
-
declare function SelectSeparator({
|
|
74
|
-
className,
|
|
75
|
-
...props
|
|
76
|
-
}: SelectSeparatorProps): _$react_jsx_runtime0.JSX.Element;
|
|
77
|
-
declare function SelectScrollUpButton({
|
|
78
|
-
className,
|
|
79
|
-
...props
|
|
80
|
-
}: SelectScrollUpButtonProps): _$react_jsx_runtime0.JSX.Element;
|
|
81
|
-
declare function SelectScrollDownButton({
|
|
82
|
-
className,
|
|
83
|
-
...props
|
|
84
|
-
}: SelectScrollDownButtonProps): _$react_jsx_runtime0.JSX.Element;
|
|
23
|
+
declare function Select<Value, Multiple extends boolean | undefined = false>({ ...props }: SelectProps<Value, Multiple>): React.JSX.Element;
|
|
24
|
+
declare function SelectPortal({ ...props }: SelectPortalProps): React.JSX.Element;
|
|
25
|
+
declare function SelectPositioner({ className, ...props }: SelectPositionerProps): React.JSX.Element;
|
|
26
|
+
declare function SelectList({ className, ...props }: SelectListProps): React.JSX.Element;
|
|
27
|
+
declare function SelectGroup({ className, ...props }: SelectGroupProps): React.JSX.Element;
|
|
28
|
+
declare function SelectValue({ className, ...props }: SelectValueProps): React.JSX.Element;
|
|
29
|
+
declare function SelectTrigger({ className, size, children, ...props }: SelectTriggerProps): React.JSX.Element;
|
|
30
|
+
declare function SelectContent({ className, children, side, sideOffset, align, alignOffset, alignItemWithTrigger, ...props }: SelectContentProps): React.JSX.Element;
|
|
31
|
+
declare function SelectLabel({ className, ...props }: SelectLabelProps): React.JSX.Element;
|
|
32
|
+
declare function SelectItem({ className, children, ...props }: SelectItemProps): React.JSX.Element;
|
|
33
|
+
declare function SelectSeparator({ className, ...props }: SelectSeparatorProps): React.JSX.Element;
|
|
34
|
+
declare function SelectScrollUpButton({ className, ...props }: SelectScrollUpButtonProps): React.JSX.Element;
|
|
35
|
+
declare function SelectScrollDownButton({ className, ...props }: SelectScrollDownButtonProps): React.JSX.Element;
|
|
85
36
|
//#endregion
|
|
86
37
|
export { Select, SelectContent, type SelectContentProps, SelectGroup, type SelectGroupProps, SelectItem, type SelectItemProps, SelectLabel, type SelectLabelProps, SelectList, type SelectListProps, SelectPortal, type SelectPortalProps, SelectPositioner, type SelectPositionerProps, type SelectProps, SelectScrollDownButton, type SelectScrollDownButtonProps, SelectScrollUpButton, type SelectScrollUpButtonProps, SelectSeparator, type SelectSeparatorProps, SelectTrigger, type SelectTriggerProps, SelectValue, type SelectValueProps, selectTriggerVariants };
|
package/dist/select.js
CHANGED
|
@@ -5,7 +5,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
5
5
|
import { cva } from "class-variance-authority";
|
|
6
6
|
import { Select as Select$1 } from "@base-ui/react/select";
|
|
7
7
|
//#region src/select.tsx
|
|
8
|
-
const selectTriggerVariants = cva("data-placeholder:text-soft bg-
|
|
8
|
+
const selectTriggerVariants = cva("data-placeholder:text-soft bg-shade hover:border-focus focus-visible:border-focus focus-visible:ring-focus/50 aria-invalid:ring-danger/30 aria-invalid:border-danger flex w-fit items-center justify-between gap-1.5 rounded-md border border-transparent whitespace-nowrap motion-color outline-hidden select-none focus-visible:ring-3 data-disabled:pointer-events-none data-disabled:opacity-30 aria-invalid:ring-3 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
|
|
9
9
|
variants: { size: {
|
|
10
10
|
xs: "h-6 rounded-sm px-2 text-xs",
|
|
11
11
|
sm: "h-8 px-3 text-sm",
|
|
@@ -76,7 +76,7 @@ function SelectContent({ className, children, side = "bottom", sideOffset = 4, a
|
|
|
76
76
|
className: "isolate z-50",
|
|
77
77
|
children: /* @__PURE__ */ jsxs(Select$1.Popup, {
|
|
78
78
|
"data-slot": "select-content",
|
|
79
|
-
className: cn("motion-pop-md bg-elevated text-contrast ring-contrast/10 relative isolate z-50 max-h-(--available-height) min-w-(--anchor-width) max-w-(--available-width)
|
|
79
|
+
className: cn("motion-pop-md bg-elevated text-contrast ring-contrast/10 relative isolate z-50 max-h-(--available-height) min-w-(--anchor-width) max-w-(--available-width) overflow-x-hidden overflow-y-auto rounded-md shadow-md ring-1", className),
|
|
80
80
|
...props,
|
|
81
81
|
children: [
|
|
82
82
|
/* @__PURE__ */ jsx(SelectScrollUpButton, {}),
|
|
@@ -96,7 +96,7 @@ function SelectLabel({ className, ...props }) {
|
|
|
96
96
|
function SelectItem({ className, children, ...props }) {
|
|
97
97
|
return /* @__PURE__ */ jsxs(Select$1.Item, {
|
|
98
98
|
"data-slot": "select-item",
|
|
99
|
-
className: cn("data-highlighted:bg-
|
|
99
|
+
className: cn("data-highlighted:bg-highlight relative flex w-full cursor-clickable items-center gap-1.5 rounded-sm py-1 pr-8 pl-1.5 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-30 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", className),
|
|
100
100
|
...props,
|
|
101
101
|
children: [/* @__PURE__ */ jsx(Select$1.ItemText, {
|
|
102
102
|
"data-slot": "select-item-text",
|
|
@@ -114,7 +114,7 @@ function SelectItem({ className, children, ...props }) {
|
|
|
114
114
|
function SelectSeparator({ className, ...props }) {
|
|
115
115
|
return /* @__PURE__ */ jsx(Select$1.Separator, {
|
|
116
116
|
"data-slot": "select-separator",
|
|
117
|
-
className: cn("bg-
|
|
117
|
+
className: cn("bg-contour pointer-events-none -mx-1 my-1 h-px", className),
|
|
118
118
|
...props
|
|
119
119
|
});
|
|
120
120
|
}
|
package/dist/separator.d.ts
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
1
|
import * as React from "react";
|
|
3
2
|
import { Separator as Separator$1 } from "@base-ui/react/separator";
|
|
4
|
-
|
|
5
3
|
//#region src/separator.d.ts
|
|
6
4
|
type SeparatorProps = React.ComponentProps<typeof Separator$1>;
|
|
7
|
-
declare function Separator({
|
|
8
|
-
className,
|
|
9
|
-
orientation,
|
|
10
|
-
...props
|
|
11
|
-
}: SeparatorProps): _$react_jsx_runtime0.JSX.Element;
|
|
5
|
+
declare function Separator({ className, orientation, ...props }: SeparatorProps): React.JSX.Element;
|
|
12
6
|
//#endregion
|
|
13
7
|
export { Separator, type SeparatorProps };
|
package/dist/separator.js
CHANGED
|
@@ -7,7 +7,7 @@ function Separator({ className, orientation = "horizontal", ...props }) {
|
|
|
7
7
|
return /* @__PURE__ */ jsx(Separator$1, {
|
|
8
8
|
"data-slot": "separator",
|
|
9
9
|
orientation,
|
|
10
|
-
className: cn("bg-
|
|
10
|
+
className: cn("bg-contour shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-px data-[orientation=vertical]:self-stretch", className),
|
|
11
11
|
...props
|
|
12
12
|
});
|
|
13
13
|
}
|
package/dist/sidebar.d.ts
CHANGED
|
@@ -2,12 +2,9 @@ import { Button } from "./button.js";
|
|
|
2
2
|
import { Input } from "./input.js";
|
|
3
3
|
import { Separator } from "./separator.js";
|
|
4
4
|
import { TooltipContent } from "./tooltip.js";
|
|
5
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
6
5
|
import * as React from "react";
|
|
7
6
|
import { VariantProps } from "class-variance-authority";
|
|
8
7
|
import { useRender } from "@base-ui/react/use-render";
|
|
9
|
-
import * as _$class_variance_authority_types0 from "class-variance-authority/types";
|
|
10
|
-
|
|
11
8
|
//#region src/sidebar.d.ts
|
|
12
9
|
/**
|
|
13
10
|
* Persist sidebar state to a cookie.
|
|
@@ -60,168 +57,74 @@ type SidebarProviderProps = React.ComponentProps<"div"> & {
|
|
|
60
57
|
* <SidebarProvider persist={(open) => saveToServer(open)}>
|
|
61
58
|
* ```
|
|
62
59
|
*/
|
|
63
|
-
persist?: (open: boolean) => void;
|
|
64
|
-
|
|
60
|
+
persist?: (open: boolean) => void;
|
|
61
|
+
/** Key for Cmd/Ctrl+key toggle shortcut. Defaults to "b". Pass `false` to disable. */
|
|
62
|
+
keyboardShortcut?: string | false;
|
|
63
|
+
/** Breakpoint (px) below which the sidebar uses a mobile drawer. Defaults to 768. */
|
|
65
64
|
mobileBreakpoint?: number;
|
|
66
65
|
};
|
|
67
|
-
declare function SidebarProvider({
|
|
68
|
-
defaultOpen,
|
|
69
|
-
open: openProp,
|
|
70
|
-
onOpenChange: setOpenProp,
|
|
71
|
-
persist,
|
|
72
|
-
keyboardShortcut,
|
|
73
|
-
mobileBreakpoint,
|
|
74
|
-
className,
|
|
75
|
-
style,
|
|
76
|
-
children,
|
|
77
|
-
...props
|
|
78
|
-
}: SidebarProviderProps): _$react_jsx_runtime0.JSX.Element;
|
|
66
|
+
declare function SidebarProvider({ defaultOpen, open: openProp, onOpenChange: setOpenProp, persist, keyboardShortcut, mobileBreakpoint, className, style, children, ...props }: SidebarProviderProps): React.JSX.Element;
|
|
79
67
|
type SidebarProps = React.ComponentProps<"div"> & {
|
|
80
68
|
side?: "left" | "right";
|
|
81
69
|
variant?: "sidebar" | "floating" | "inset";
|
|
82
70
|
collapsible?: "offcanvas" | "icon" | "none";
|
|
83
71
|
};
|
|
84
|
-
declare function Sidebar({
|
|
85
|
-
side,
|
|
86
|
-
variant,
|
|
87
|
-
collapsible,
|
|
88
|
-
className,
|
|
89
|
-
children,
|
|
90
|
-
...props
|
|
91
|
-
}: SidebarProps): _$react_jsx_runtime0.JSX.Element;
|
|
72
|
+
declare function Sidebar({ side, variant, collapsible, className, children, ...props }: SidebarProps): React.JSX.Element;
|
|
92
73
|
type SidebarTriggerProps = React.ComponentProps<typeof Button>;
|
|
93
|
-
declare function SidebarTrigger({
|
|
94
|
-
className,
|
|
95
|
-
onClick,
|
|
96
|
-
...props
|
|
97
|
-
}: SidebarTriggerProps): _$react_jsx_runtime0.JSX.Element;
|
|
74
|
+
declare function SidebarTrigger({ className, onClick, ...props }: SidebarTriggerProps): React.JSX.Element;
|
|
98
75
|
type SidebarRailProps = React.ComponentProps<"button">;
|
|
99
|
-
declare function SidebarRail({
|
|
100
|
-
className,
|
|
101
|
-
...props
|
|
102
|
-
}: SidebarRailProps): _$react_jsx_runtime0.JSX.Element;
|
|
76
|
+
declare function SidebarRail({ className, ...props }: SidebarRailProps): React.JSX.Element;
|
|
103
77
|
type SidebarInsetProps = React.ComponentProps<"main">;
|
|
104
|
-
declare function SidebarInset({
|
|
105
|
-
className,
|
|
106
|
-
...props
|
|
107
|
-
}: SidebarInsetProps): _$react_jsx_runtime0.JSX.Element;
|
|
78
|
+
declare function SidebarInset({ className, ...props }: SidebarInsetProps): React.JSX.Element;
|
|
108
79
|
type SidebarInputProps = React.ComponentProps<typeof Input>;
|
|
109
|
-
declare function SidebarInput({
|
|
110
|
-
className,
|
|
111
|
-
...props
|
|
112
|
-
}: SidebarInputProps): _$react_jsx_runtime0.JSX.Element;
|
|
80
|
+
declare function SidebarInput({ className, ...props }: SidebarInputProps): React.JSX.Element;
|
|
113
81
|
type SidebarHeaderProps = React.ComponentProps<"div">;
|
|
114
|
-
declare function SidebarHeader({
|
|
115
|
-
className,
|
|
116
|
-
...props
|
|
117
|
-
}: SidebarHeaderProps): _$react_jsx_runtime0.JSX.Element;
|
|
82
|
+
declare function SidebarHeader({ className, ...props }: SidebarHeaderProps): React.JSX.Element;
|
|
118
83
|
type SidebarFooterProps = React.ComponentProps<"div">;
|
|
119
|
-
declare function SidebarFooter({
|
|
120
|
-
className,
|
|
121
|
-
...props
|
|
122
|
-
}: SidebarFooterProps): _$react_jsx_runtime0.JSX.Element;
|
|
84
|
+
declare function SidebarFooter({ className, ...props }: SidebarFooterProps): React.JSX.Element;
|
|
123
85
|
type SidebarSeparatorProps = React.ComponentProps<typeof Separator>;
|
|
124
|
-
declare function SidebarSeparator({
|
|
125
|
-
className,
|
|
126
|
-
...props
|
|
127
|
-
}: SidebarSeparatorProps): _$react_jsx_runtime0.JSX.Element;
|
|
86
|
+
declare function SidebarSeparator({ className, ...props }: SidebarSeparatorProps): React.JSX.Element;
|
|
128
87
|
type SidebarContentProps = React.ComponentProps<"div">;
|
|
129
|
-
declare function SidebarContent({
|
|
130
|
-
className,
|
|
131
|
-
style,
|
|
132
|
-
...props
|
|
133
|
-
}: SidebarContentProps): _$react_jsx_runtime0.JSX.Element;
|
|
88
|
+
declare function SidebarContent({ className, style, ...props }: SidebarContentProps): React.JSX.Element;
|
|
134
89
|
type SidebarGroupProps = React.ComponentProps<"div">;
|
|
135
|
-
declare function SidebarGroup({
|
|
136
|
-
className,
|
|
137
|
-
...props
|
|
138
|
-
}: SidebarGroupProps): _$react_jsx_runtime0.JSX.Element;
|
|
90
|
+
declare function SidebarGroup({ className, ...props }: SidebarGroupProps): React.JSX.Element;
|
|
139
91
|
type SidebarGroupLabelProps = useRender.ComponentProps<"div"> & React.ComponentProps<"div">;
|
|
140
|
-
declare function SidebarGroupLabel({
|
|
141
|
-
className,
|
|
142
|
-
render,
|
|
143
|
-
...props
|
|
144
|
-
}: SidebarGroupLabelProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
92
|
+
declare function SidebarGroupLabel({ className, render, ...props }: SidebarGroupLabelProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
145
93
|
type SidebarGroupActionProps = useRender.ComponentProps<"button"> & React.ComponentProps<"button">;
|
|
146
|
-
declare function SidebarGroupAction({
|
|
147
|
-
className,
|
|
148
|
-
render,
|
|
149
|
-
...props
|
|
150
|
-
}: SidebarGroupActionProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
94
|
+
declare function SidebarGroupAction({ className, render, ...props }: SidebarGroupActionProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
151
95
|
type SidebarGroupContentProps = React.ComponentProps<"div">;
|
|
152
|
-
declare function SidebarGroupContent({
|
|
153
|
-
className,
|
|
154
|
-
...props
|
|
155
|
-
}: SidebarGroupContentProps): _$react_jsx_runtime0.JSX.Element;
|
|
96
|
+
declare function SidebarGroupContent({ className, ...props }: SidebarGroupContentProps): React.JSX.Element;
|
|
156
97
|
type SidebarMenuProps = React.ComponentProps<"ul">;
|
|
157
|
-
declare function SidebarMenu({
|
|
158
|
-
className,
|
|
159
|
-
...props
|
|
160
|
-
}: SidebarMenuProps): _$react_jsx_runtime0.JSX.Element;
|
|
98
|
+
declare function SidebarMenu({ className, ...props }: SidebarMenuProps): React.JSX.Element;
|
|
161
99
|
type SidebarMenuItemProps = React.ComponentProps<"li">;
|
|
162
|
-
declare function SidebarMenuItem({
|
|
163
|
-
className,
|
|
164
|
-
...props
|
|
165
|
-
}: SidebarMenuItemProps): _$react_jsx_runtime0.JSX.Element;
|
|
100
|
+
declare function SidebarMenuItem({ className, ...props }: SidebarMenuItemProps): React.JSX.Element;
|
|
166
101
|
declare const sidebarMenuButtonVariants: (props?: ({
|
|
167
102
|
variant?: "default" | "outline" | null | undefined;
|
|
168
|
-
size?: "default" | "
|
|
169
|
-
} &
|
|
103
|
+
size?: "default" | "lg" | "sm" | null | undefined;
|
|
104
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
170
105
|
type SidebarMenuButtonProps = useRender.ComponentProps<"button"> & React.ComponentProps<"button"> & {
|
|
171
106
|
isActive?: boolean;
|
|
172
107
|
tooltip?: string | React.ComponentProps<typeof TooltipContent>;
|
|
173
108
|
} & VariantProps<typeof sidebarMenuButtonVariants>;
|
|
174
|
-
declare function SidebarMenuButton({
|
|
175
|
-
render,
|
|
176
|
-
isActive,
|
|
177
|
-
variant,
|
|
178
|
-
size,
|
|
179
|
-
tooltip,
|
|
180
|
-
className,
|
|
181
|
-
...props
|
|
182
|
-
}: SidebarMenuButtonProps): _$react_jsx_runtime0.JSX.Element;
|
|
109
|
+
declare function SidebarMenuButton({ render, isActive, variant, size, tooltip, className, ...props }: SidebarMenuButtonProps): React.JSX.Element;
|
|
183
110
|
type SidebarMenuActionProps = useRender.ComponentProps<"button"> & React.ComponentProps<"button"> & {
|
|
184
111
|
showOnHover?: boolean;
|
|
185
112
|
};
|
|
186
|
-
declare function SidebarMenuAction({
|
|
187
|
-
className,
|
|
188
|
-
render,
|
|
189
|
-
showOnHover,
|
|
190
|
-
...props
|
|
191
|
-
}: SidebarMenuActionProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
113
|
+
declare function SidebarMenuAction({ className, render, showOnHover, ...props }: SidebarMenuActionProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
192
114
|
type SidebarMenuBadgeProps = React.ComponentProps<"div">;
|
|
193
|
-
declare function SidebarMenuBadge({
|
|
194
|
-
className,
|
|
195
|
-
...props
|
|
196
|
-
}: SidebarMenuBadgeProps): _$react_jsx_runtime0.JSX.Element;
|
|
115
|
+
declare function SidebarMenuBadge({ className, ...props }: SidebarMenuBadgeProps): React.JSX.Element;
|
|
197
116
|
type SidebarMenuSkeletonProps = React.ComponentProps<"div"> & {
|
|
198
117
|
showIcon?: boolean;
|
|
199
118
|
};
|
|
200
|
-
declare function SidebarMenuSkeleton({
|
|
201
|
-
className,
|
|
202
|
-
showIcon,
|
|
203
|
-
...props
|
|
204
|
-
}: SidebarMenuSkeletonProps): _$react_jsx_runtime0.JSX.Element;
|
|
119
|
+
declare function SidebarMenuSkeleton({ className, showIcon, ...props }: SidebarMenuSkeletonProps): React.JSX.Element;
|
|
205
120
|
type SidebarMenuSubProps = React.ComponentProps<"ul">;
|
|
206
|
-
declare function SidebarMenuSub({
|
|
207
|
-
className,
|
|
208
|
-
...props
|
|
209
|
-
}: SidebarMenuSubProps): _$react_jsx_runtime0.JSX.Element;
|
|
121
|
+
declare function SidebarMenuSub({ className, ...props }: SidebarMenuSubProps): React.JSX.Element;
|
|
210
122
|
type SidebarMenuSubItemProps = React.ComponentProps<"li">;
|
|
211
|
-
declare function SidebarMenuSubItem({
|
|
212
|
-
className,
|
|
213
|
-
...props
|
|
214
|
-
}: SidebarMenuSubItemProps): _$react_jsx_runtime0.JSX.Element;
|
|
123
|
+
declare function SidebarMenuSubItem({ className, ...props }: SidebarMenuSubItemProps): React.JSX.Element;
|
|
215
124
|
type SidebarMenuSubButtonProps = useRender.ComponentProps<"a"> & React.ComponentProps<"a"> & {
|
|
216
125
|
size?: "sm" | "md";
|
|
217
126
|
isActive?: boolean;
|
|
218
127
|
};
|
|
219
|
-
declare function SidebarMenuSubButton({
|
|
220
|
-
render,
|
|
221
|
-
size,
|
|
222
|
-
isActive,
|
|
223
|
-
className,
|
|
224
|
-
...props
|
|
225
|
-
}: SidebarMenuSubButtonProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
128
|
+
declare function SidebarMenuSubButton({ render, size, isActive, className, ...props }: SidebarMenuSubButtonProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
226
129
|
//#endregion
|
|
227
130
|
export { Sidebar, SidebarContent, type SidebarContentProps, SidebarFooter, type SidebarFooterProps, SidebarGroup, SidebarGroupAction, type SidebarGroupActionProps, SidebarGroupContent, type SidebarGroupContentProps, SidebarGroupLabel, type SidebarGroupLabelProps, type SidebarGroupProps, SidebarHeader, type SidebarHeaderProps, SidebarInput, type SidebarInputProps, SidebarInset, type SidebarInsetProps, SidebarMenu, SidebarMenuAction, type SidebarMenuActionProps, SidebarMenuBadge, type SidebarMenuBadgeProps, SidebarMenuButton, type SidebarMenuButtonProps, SidebarMenuItem, type SidebarMenuItemProps, type SidebarMenuProps, SidebarMenuSkeleton, type SidebarMenuSkeletonProps, SidebarMenuSub, SidebarMenuSubButton, type SidebarMenuSubButtonProps, SidebarMenuSubItem, type SidebarMenuSubItemProps, type SidebarMenuSubProps, type SidebarProps, SidebarProvider, type SidebarProviderProps, SidebarRail, type SidebarRailProps, SidebarSeparator, type SidebarSeparatorProps, SidebarTrigger, type SidebarTriggerProps, cookiePersist, localStoragePersist, sidebarMenuButtonVariants, useSidebar };
|
package/dist/sidebar.js
CHANGED
|
@@ -31,7 +31,7 @@ const SIDEBAR_DEFAULT_KEYBOARD_SHORTCUT = "b";
|
|
|
31
31
|
* <SidebarProvider persist={cookiePersist("my-sidebar", 86400)}>
|
|
32
32
|
* ```
|
|
33
33
|
*/
|
|
34
|
-
function cookiePersist(name = "sidebar-state", maxAge =
|
|
34
|
+
function cookiePersist(name = "sidebar-state", maxAge = 604800) {
|
|
35
35
|
return (open) => {
|
|
36
36
|
document.cookie = `${name}=${open}; path=/; max-age=${maxAge}`;
|
|
37
37
|
};
|
|
@@ -74,7 +74,7 @@ function SidebarProvider({ defaultOpen = true, open: openProp, onOpenChange: set
|
|
|
74
74
|
persistRef.current?.(openState);
|
|
75
75
|
}, [setOpenProp, open]);
|
|
76
76
|
const toggleSidebar = React.useCallback(() => {
|
|
77
|
-
return isMobile ? setOpenMobile((
|
|
77
|
+
return isMobile ? setOpenMobile((prev) => !prev) : setOpen((prev) => !prev);
|
|
78
78
|
}, [
|
|
79
79
|
isMobile,
|
|
80
80
|
setOpen,
|
|
@@ -163,14 +163,14 @@ function Sidebar({ side = "left", variant = "sidebar", collapsible = "offcanvas"
|
|
|
163
163
|
className: cn("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear", "group-data-[collapsible=offcanvas]:w-0", "group-data-[side=right]:rotate-180", variant === "floating" || variant === "inset" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)")
|
|
164
164
|
}), /* @__PURE__ */ jsx("div", {
|
|
165
165
|
"data-slot": "sidebar-container",
|
|
166
|
-
className: cn("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex", side === "left" ? "left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]" : "right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]", variant === "floating" || variant === "inset" ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon) after:absolute after:inset-y-0 after:w-px after:bg-
|
|
166
|
+
className: cn("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex", side === "left" ? "left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]" : "right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]", variant === "floating" || variant === "inset" ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon) after:absolute after:inset-y-0 after:w-px after:bg-contour" + (side === "left" ? " after:right-0" : " after:left-0"), className),
|
|
167
167
|
...props,
|
|
168
168
|
children: /* @__PURE__ */ jsx(TooltipProvider, {
|
|
169
169
|
delay: 0,
|
|
170
170
|
closeDelay: 300,
|
|
171
171
|
children: /* @__PURE__ */ jsx("div", {
|
|
172
172
|
"data-slot": "sidebar-inner",
|
|
173
|
-
className: "bg-surface group-data-[variant=floating]:ring-
|
|
173
|
+
className: "bg-surface group-data-[variant=floating]:ring-contour group-data-[variant=floating]:rounded-md group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 flex size-full flex-col",
|
|
174
174
|
children
|
|
175
175
|
})
|
|
176
176
|
})
|
|
@@ -204,7 +204,7 @@ function SidebarRail({ className, ...props }) {
|
|
|
204
204
|
tabIndex: -1,
|
|
205
205
|
onClick: toggleSidebar,
|
|
206
206
|
title: "Toggle Sidebar",
|
|
207
|
-
className: cn("hover:after:bg-
|
|
207
|
+
className: cn("hover:after:bg-contour absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-[left,right,transform] duration-200 ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex", "in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize", "[[data-side=left][data-closed]_&]:cursor-e-resize [[data-side=right][data-closed]_&]:cursor-w-resize", "hover:group-data-[collapsible=offcanvas]:bg-surface group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full", "[[data-side=left][data-collapsible=offcanvas]_&]:-right-2", "[[data-side=right][data-collapsible=offcanvas]_&]:-left-2", className),
|
|
208
208
|
...props
|
|
209
209
|
});
|
|
210
210
|
}
|
|
@@ -239,7 +239,7 @@ function SidebarFooter({ className, ...props }) {
|
|
|
239
239
|
function SidebarSeparator({ className, ...props }) {
|
|
240
240
|
return /* @__PURE__ */ jsx(Separator, {
|
|
241
241
|
"data-slot": "sidebar-separator",
|
|
242
|
-
className: cn("bg-
|
|
242
|
+
className: cn("bg-contour mx-2 data-[orientation=horizontal]:w-auto", className),
|
|
243
243
|
...props
|
|
244
244
|
});
|
|
245
245
|
}
|
|
@@ -273,7 +273,7 @@ function SidebarGroupLabel({ className, render, ...props }) {
|
|
|
273
273
|
function SidebarGroupAction({ className, render, ...props }) {
|
|
274
274
|
return useRender({
|
|
275
275
|
defaultTagName: "button",
|
|
276
|
-
props: mergeProps({ className: cn("text-contrast ring-focus/50 hover:bg-
|
|
276
|
+
props: mergeProps({ className: cn("text-contrast ring-focus/50 hover:bg-highlight absolute top-1.5 right-3 w-5 rounded-sm p-0 focus-visible:ring-3 [&>svg]:size-4 flex aspect-square items-center justify-center outline-hidden transition-transform [&>svg]:shrink-0 after:absolute after:-inset-2 md:after:hidden group-data-[collapsible=icon]:hidden", className) }, props),
|
|
277
277
|
render,
|
|
278
278
|
state: { slot: "sidebar-group-action" }
|
|
279
279
|
});
|
|
@@ -299,11 +299,11 @@ function SidebarMenuItem({ className, ...props }) {
|
|
|
299
299
|
...props
|
|
300
300
|
});
|
|
301
301
|
}
|
|
302
|
-
const sidebarMenuButtonVariants = cva("ring-focus/50 hover:bg-
|
|
302
|
+
const sidebarMenuButtonVariants = cva("ring-focus/50 hover:bg-highlight active:bg-highlight data-active:bg-primary data-active:text-white gap-2 rounded-md p-2 text-left text-sm transition-[width,height,padding] group-has-data-[slot=sidebar-menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:w-full group-data-[collapsible=icon]:aspect-square group-data-[collapsible=icon]:h-11 focus-visible:ring-3 data-active:font-medium peer/menu-button flex w-full items-center overflow-hidden outline-hidden group/menu-button disabled:pointer-events-none disabled:opacity-30 aria-disabled:pointer-events-none aria-disabled:opacity-30 [&>span:last-child]:truncate [&_svg]:shrink-0", {
|
|
303
303
|
variants: {
|
|
304
304
|
variant: {
|
|
305
|
-
default: "
|
|
306
|
-
outline: "bg-foundation hover:bg-
|
|
305
|
+
default: "",
|
|
306
|
+
outline: "bg-foundation hover:bg-highlight ring-1 ring-contour hover:ring-focus"
|
|
307
307
|
},
|
|
308
308
|
size: {
|
|
309
309
|
default: "h-11 text-sm",
|
|
@@ -344,7 +344,7 @@ function SidebarMenuButton({ render, isActive = false, variant = "default", size
|
|
|
344
344
|
function SidebarMenuAction({ className, render, showOnHover = false, ...props }) {
|
|
345
345
|
return useRender({
|
|
346
346
|
defaultTagName: "button",
|
|
347
|
-
props: mergeProps({ className: cn("text-contrast ring-focus/50 hover:bg-
|
|
347
|
+
props: mergeProps({ className: cn("text-contrast ring-focus/50 hover:bg-highlight peer-data-active/menu-button:text-white absolute top-1/2 -translate-y-1/2 right-1 aspect-square w-5 rounded-sm p-0 focus-visible:ring-3 [&>svg]:size-4 flex items-center justify-center outline-hidden transition-transform group-data-[collapsible=icon]:hidden after:absolute after:-inset-2 md:after:hidden [&>svg]:shrink-0", showOnHover && "group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-open:opacity-100 md:opacity-0", className) }, props),
|
|
348
348
|
render,
|
|
349
349
|
state: { slot: "sidebar-menu-action" }
|
|
350
350
|
});
|
|
@@ -352,7 +352,7 @@ function SidebarMenuAction({ className, render, showOnHover = false, ...props })
|
|
|
352
352
|
function SidebarMenuBadge({ className, ...props }) {
|
|
353
353
|
return /* @__PURE__ */ jsx("div", {
|
|
354
354
|
"data-slot": "sidebar-menu-badge",
|
|
355
|
-
className: cn("text-contrast peer-
|
|
355
|
+
className: cn("text-contrast peer-data-active/menu-button:text-white pointer-events-none absolute right-1 top-1/2 -translate-y-1/2 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none group-data-[collapsible=icon]:hidden", className),
|
|
356
356
|
...props
|
|
357
357
|
});
|
|
358
358
|
}
|
|
@@ -373,7 +373,7 @@ function SidebarMenuSkeleton({ className, showIcon = false, ...props }) {
|
|
|
373
373
|
function SidebarMenuSub({ className, ...props }) {
|
|
374
374
|
return /* @__PURE__ */ jsx("ul", {
|
|
375
375
|
"data-slot": "sidebar-menu-sub",
|
|
376
|
-
className: cn("border-
|
|
376
|
+
className: cn("border-contour ml-3.5 mr-0 translate-x-px gap-0.5 border-l pl-2.5 pr-0 py-0.5 group-data-[collapsible=icon]:hidden flex min-w-0 flex-col", className),
|
|
377
377
|
...props
|
|
378
378
|
});
|
|
379
379
|
}
|
|
@@ -387,7 +387,7 @@ function SidebarMenuSubItem({ className, ...props }) {
|
|
|
387
387
|
function SidebarMenuSubButton({ render, size = "md", isActive = false, className, ...props }) {
|
|
388
388
|
return useRender({
|
|
389
389
|
defaultTagName: "a",
|
|
390
|
-
props: mergeProps({ className: cn("text-contrast ring-focus/50 hover:bg-
|
|
390
|
+
props: mergeProps({ className: cn("text-contrast ring-focus/50 hover:bg-highlight active:bg-highlight data-active:bg-primary data-active:text-white h-7 gap-2 rounded-md px-2 focus-visible:ring-3 data-[size=md]:text-sm data-[size=sm]:text-xs [&>svg]:size-4 flex min-w-0 -translate-x-px items-center overflow-hidden outline-hidden group-data-[collapsible=icon]:hidden disabled:pointer-events-none disabled:opacity-30 aria-disabled:pointer-events-none aria-disabled:opacity-30 [&>span:last-child]:truncate [&>svg]:shrink-0", className) }, props),
|
|
391
391
|
render,
|
|
392
392
|
state: {
|
|
393
393
|
slot: "sidebar-menu-sub-button",
|
package/dist/skeleton.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/skeleton.d.ts
|
|
5
3
|
type SkeletonProps = React.ComponentProps<"div">;
|
|
6
|
-
declare function Skeleton({
|
|
7
|
-
className,
|
|
8
|
-
...props
|
|
9
|
-
}: SkeletonProps): _$react_jsx_runtime0.JSX.Element;
|
|
4
|
+
declare function Skeleton({ className, ...props }: SkeletonProps): React.JSX.Element;
|
|
10
5
|
//#endregion
|
|
11
6
|
export { Skeleton, type SkeletonProps };
|
package/dist/slider.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 { Slider as Slider$1 } from "@base-ui/react/slider";
|
|
4
|
-
|
|
5
3
|
//#region src/slider.d.ts
|
|
6
4
|
type SliderProps = React.ComponentProps<typeof Slider$1.Root> & {
|
|
7
5
|
controlClassName?: string;
|
|
@@ -12,17 +10,6 @@ type SliderProps = React.ComponentProps<typeof Slider$1.Root> & {
|
|
|
12
10
|
*/
|
|
13
11
|
getThumbAriaLabel?: (index: number) => string;
|
|
14
12
|
};
|
|
15
|
-
declare function Slider({
|
|
16
|
-
className,
|
|
17
|
-
controlClassName,
|
|
18
|
-
defaultValue,
|
|
19
|
-
value,
|
|
20
|
-
min,
|
|
21
|
-
max,
|
|
22
|
-
orientation,
|
|
23
|
-
"aria-label": ariaLabel,
|
|
24
|
-
getThumbAriaLabel,
|
|
25
|
-
...props
|
|
26
|
-
}: SliderProps): _$react_jsx_runtime0.JSX.Element;
|
|
13
|
+
declare function Slider({ className, controlClassName, defaultValue, value, min, max, orientation, "aria-label": ariaLabel, getThumbAriaLabel, ...props }: SliderProps): React.JSX.Element;
|
|
27
14
|
//#endregion
|
|
28
15
|
export { Slider, type SliderProps };
|
package/dist/slider.js
CHANGED
|
@@ -5,7 +5,7 @@ import * as React from "react";
|
|
|
5
5
|
import { Slider as Slider$1 } from "@base-ui/react/slider";
|
|
6
6
|
//#region src/slider.tsx
|
|
7
7
|
function Slider({ className, controlClassName, defaultValue, value, min = 0, max = 100, orientation = "horizontal", "aria-label": ariaLabel, getThumbAriaLabel, ...props }) {
|
|
8
|
-
const
|
|
8
|
+
const resolvedValues = React.useMemo(() => Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min, max], [
|
|
9
9
|
value,
|
|
10
10
|
defaultValue,
|
|
11
11
|
min,
|
|
@@ -23,18 +23,18 @@ function Slider({ className, controlClassName, defaultValue, value, min = 0, max
|
|
|
23
23
|
...props,
|
|
24
24
|
children: /* @__PURE__ */ jsxs(Slider$1.Control, {
|
|
25
25
|
"data-slot": "slider-control",
|
|
26
|
-
className: cn("relative flex w-full touch-none items-center select-none data-disabled:
|
|
26
|
+
className: cn("relative flex w-full touch-none items-center select-none data-disabled:pointer-events-none data-disabled:opacity-30 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-40 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col", controlClassName),
|
|
27
27
|
children: [/* @__PURE__ */ jsx(Slider$1.Track, {
|
|
28
28
|
"data-slot": "slider-track",
|
|
29
|
-
className: "bg-
|
|
29
|
+
className: "bg-shade relative grow overflow-hidden rounded-full select-none data-[orientation=horizontal]:h-2 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-2",
|
|
30
30
|
children: /* @__PURE__ */ jsx(Slider$1.Indicator, {
|
|
31
31
|
"data-slot": "slider-range",
|
|
32
32
|
className: "bg-primary select-none data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"
|
|
33
33
|
})
|
|
34
|
-
}), Array.from({ length:
|
|
34
|
+
}), Array.from({ length: resolvedValues.length }, (_, index) => /* @__PURE__ */ jsx(Slider$1.Thumb, {
|
|
35
35
|
"data-slot": "slider-thumb",
|
|
36
36
|
"aria-label": getThumbAriaLabel ? getThumbAriaLabel(index) : ariaLabel,
|
|
37
|
-
className: "
|
|
37
|
+
className: "ring-focus/50 relative block data-[orientation=horizontal]:h-4 data-[orientation=horizontal]:w-6 data-[orientation=vertical]:h-6 data-[orientation=vertical]:w-4 shrink-0 rounded-full border border-shade bg-white motion-color cursor-clickable select-none after:absolute after:-inset-2 hover:ring-3 focus-visible:ring-3 focus-visible:outline-hidden active:ring-3 data-disabled:pointer-events-none"
|
|
38
38
|
}, index))]
|
|
39
39
|
})
|
|
40
40
|
});
|