@waveso/ui 0.17.0 → 0.18.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 -14
- package/dist/accordion.js +2 -2
- package/dist/action-bar.js +1 -1
- package/dist/alert-dialog.js +1 -1
- package/dist/alert.js +1 -1
- package/dist/autocomplete.js +4 -4
- package/dist/avatar.js +6 -6
- package/dist/badge.js +2 -2
- package/dist/button-group.js +3 -3
- package/dist/button.js +3 -3
- package/dist/card.js +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/combobox.js +6 -6
- package/dist/context-menu.d.ts +1 -1
- package/dist/context-menu.js +27 -10
- package/dist/dialog.js +1 -1
- package/dist/drawer.js +2 -2
- package/dist/gradient-reveal-text.js +1 -1
- package/dist/input-group.js +1 -1
- package/dist/input-otp.js +1 -1
- package/dist/input.js +1 -1
- package/dist/item.js +2 -2
- package/dist/menu.d.ts +1 -1
- package/dist/menu.js +27 -10
- package/dist/menubar.js +2 -2
- package/dist/popover.js +1 -1
- package/dist/preview-card.js +1 -1
- package/dist/radio.js +1 -1
- package/dist/resizable.js +2 -2
- package/dist/scroll-area.js +2 -12
- package/dist/select.js +5 -5
- package/dist/separator.js +1 -1
- package/dist/sidebar.js +11 -11
- package/dist/slider.js +2 -2
- package/dist/styles.css +190 -76
- package/dist/swipe-deck.d.ts +92 -36
- package/dist/swipe-deck.js +601 -158
- package/dist/switch.js +1 -1
- package/dist/table.js +3 -3
- package/dist/tabs.js +3 -3
- package/dist/textarea.js +1 -1
- package/dist/toast.d.ts +1 -1
- package/dist/toast.js +4 -4
- package/dist/toggle.js +3 -3
- package/package.json +1 -1
package/dist/menu.js
CHANGED
|
@@ -3,6 +3,7 @@ import { cn } from "./lib/utils.js";
|
|
|
3
3
|
import { CheckIcon, ChevronRightIcon } from "./lib/internal-icons.js";
|
|
4
4
|
import { resolveFinalFocus } from "./lib/focus.js";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import * as React from "react";
|
|
6
7
|
import { Menu as Menu$1 } from "@base-ui/react/menu";
|
|
7
8
|
//#region src/menu.tsx
|
|
8
9
|
function Menu(props) {
|
|
@@ -23,19 +24,35 @@ function MenuTrigger(props) {
|
|
|
23
24
|
...props
|
|
24
25
|
});
|
|
25
26
|
}
|
|
26
|
-
function MenuContent({ align = "start", alignOffset = 0, side = "bottom", sideOffset = 4, className, restoreFocusOnClose, finalFocus, ...props }) {
|
|
27
|
+
function MenuContent({ align = "start", alignOffset = 0, side = "bottom", sideOffset = 4, className, restoreFocusOnClose, finalFocus, onKeyDown, children, ...props }) {
|
|
28
|
+
const listRef = React.useRef(null);
|
|
27
29
|
return /* @__PURE__ */ jsx(MenuPortal, { children: /* @__PURE__ */ jsx(Menu$1.Positioner, {
|
|
28
30
|
"data-slot": "menu-positioner",
|
|
29
|
-
className: "isolate z-50
|
|
31
|
+
className: "isolate z-50",
|
|
30
32
|
align,
|
|
31
33
|
alignOffset,
|
|
32
34
|
side,
|
|
33
35
|
sideOffset,
|
|
34
36
|
children: /* @__PURE__ */ jsx(Menu$1.Popup, {
|
|
35
37
|
"data-slot": "menu-content",
|
|
36
|
-
className: cn("motion-pop-md
|
|
38
|
+
className: cn("motion-pop-md border-edge bg-elevated text-contrast z-50 flex max-h-(--available-height) max-w-(--available-width) w-auto min-w-32 flex-col overflow-hidden rounded-md shadow-md border focus-visible:outline-hidden", className),
|
|
37
39
|
finalFocus: resolveFinalFocus(restoreFocusOnClose, finalFocus),
|
|
38
|
-
|
|
40
|
+
onKeyDown: (event) => {
|
|
41
|
+
onKeyDown?.(event);
|
|
42
|
+
const list = listRef.current;
|
|
43
|
+
if (list && !event.defaultPrevented && event.target === event.currentTarget && (event.key === "PageDown" || event.key === "PageUp")) {
|
|
44
|
+
event.preventDefault();
|
|
45
|
+
const direction = event.key === "PageDown" ? 1 : -1;
|
|
46
|
+
list.scrollBy({ top: direction * list.clientHeight * .875 });
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
...props,
|
|
50
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
51
|
+
ref: listRef,
|
|
52
|
+
"data-slot": "menu-list",
|
|
53
|
+
className: "scroll-fade supports-[animation-timeline:scroll()]:scrollbar-none min-h-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain p-1",
|
|
54
|
+
children
|
|
55
|
+
})
|
|
39
56
|
})
|
|
40
57
|
}) });
|
|
41
58
|
}
|
|
@@ -58,7 +75,7 @@ function MenuItem({ className, inset, variant = "default", ...props }) {
|
|
|
58
75
|
"data-slot": "menu-item",
|
|
59
76
|
"data-inset": inset,
|
|
60
77
|
"data-variant": variant,
|
|
61
|
-
className: cn("focus:bg-
|
|
78
|
+
className: cn("focus:bg-highlighted data-[variant=danger]:text-danger data-[variant=danger]:*:[svg]:text-danger data-[variant=danger]:focus:bg-danger data-[variant=danger]:focus:text-white data-[variant=danger]:focus:**:text-white group/menu-item relative flex cursor-clickable items-center gap-1.5 rounded-sm px-1.5 py-1 text-sm focus:outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-30 data-inset:pl-7 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
62
79
|
...props
|
|
63
80
|
});
|
|
64
81
|
}
|
|
@@ -72,12 +89,12 @@ function MenuSubTrigger({ className, inset, children, ...props }) {
|
|
|
72
89
|
return /* @__PURE__ */ jsxs(Menu$1.SubmenuTrigger, {
|
|
73
90
|
"data-slot": "menu-sub-trigger",
|
|
74
91
|
"data-inset": inset,
|
|
75
|
-
className: cn("focus:bg-
|
|
92
|
+
className: cn("focus:bg-highlighted data-popup-open:bg-highlighted flex cursor-clickable items-center gap-1.5 rounded-sm px-1.5 py-1 text-sm focus:outline-hidden select-none data-inset:pl-7 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
76
93
|
...props,
|
|
77
94
|
children: [children, /* @__PURE__ */ jsx(ChevronRightIcon, { className: "ml-auto" })]
|
|
78
95
|
});
|
|
79
96
|
}
|
|
80
|
-
function MenuSubContent({ align = "start", alignOffset = -
|
|
97
|
+
function MenuSubContent({ align = "start", alignOffset = -5, side = "right", sideOffset = 0, className, ...props }) {
|
|
81
98
|
return /* @__PURE__ */ jsx(MenuContent, {
|
|
82
99
|
"data-slot": "menu-sub-content",
|
|
83
100
|
className: cn("w-auto min-w-24 shadow-md", className),
|
|
@@ -92,7 +109,7 @@ function MenuCheckboxItem({ className, children, checked, inset, ...props }) {
|
|
|
92
109
|
return /* @__PURE__ */ jsxs(Menu$1.CheckboxItem, {
|
|
93
110
|
"data-slot": "menu-checkbox-item",
|
|
94
111
|
"data-inset": inset,
|
|
95
|
-
className: cn("focus:bg-
|
|
112
|
+
className: cn("focus:bg-highlighted relative flex cursor-clickable items-center gap-1.5 rounded-sm py-1 pr-8 pl-1.5 text-sm focus:outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-30 data-inset:pl-7 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
96
113
|
checked,
|
|
97
114
|
...props,
|
|
98
115
|
children: [/* @__PURE__ */ jsx("span", {
|
|
@@ -112,7 +129,7 @@ function MenuRadioItem({ className, children, inset, ...props }) {
|
|
|
112
129
|
return /* @__PURE__ */ jsxs(Menu$1.RadioItem, {
|
|
113
130
|
"data-slot": "menu-radio-item",
|
|
114
131
|
"data-inset": inset,
|
|
115
|
-
className: cn("focus:bg-
|
|
132
|
+
className: cn("focus:bg-highlighted relative flex cursor-clickable items-center gap-1.5 rounded-sm py-1 pr-8 pl-1.5 text-sm focus:outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-30 data-inset:pl-7 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
116
133
|
...props,
|
|
117
134
|
children: [/* @__PURE__ */ jsx("span", {
|
|
118
135
|
"data-slot": "menu-radio-item-indicator",
|
|
@@ -124,7 +141,7 @@ function MenuRadioItem({ className, children, inset, ...props }) {
|
|
|
124
141
|
function MenuSeparator({ className, ...props }) {
|
|
125
142
|
return /* @__PURE__ */ jsx(Menu$1.Separator, {
|
|
126
143
|
"data-slot": "menu-separator",
|
|
127
|
-
className: cn("bg-
|
|
144
|
+
className: cn("bg-line -mx-1 my-1 h-px", className),
|
|
128
145
|
...props
|
|
129
146
|
});
|
|
130
147
|
}
|
package/dist/menubar.js
CHANGED
|
@@ -7,7 +7,7 @@ import { Menubar as Menubar$1 } from "@base-ui/react/menubar";
|
|
|
7
7
|
function Menubar({ className, ...props }) {
|
|
8
8
|
return /* @__PURE__ */ jsx(Menubar$1, {
|
|
9
9
|
"data-slot": "menubar",
|
|
10
|
-
className: cn("bg-foundation flex h-9 items-center gap-0.5 rounded-md border border-
|
|
10
|
+
className: cn("bg-foundation flex h-9 items-center gap-0.5 rounded-md border border-contour p-1", className),
|
|
11
11
|
...props
|
|
12
12
|
});
|
|
13
13
|
}
|
|
@@ -35,7 +35,7 @@ function MenubarTrigger({ ...props }) {
|
|
|
35
35
|
...props
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
|
-
function MenubarContent({ align = "start", alignOffset = -
|
|
38
|
+
function MenubarContent({ align = "start", alignOffset = -5, sideOffset = 8, className, ...props }) {
|
|
39
39
|
return /* @__PURE__ */ jsx(MenuContent, {
|
|
40
40
|
"data-slot": "menubar-content",
|
|
41
41
|
className: cn("w-auto", className),
|
package/dist/popover.js
CHANGED
|
@@ -46,7 +46,7 @@ function PopoverContent({ className, positionerClassName, align = "center", alig
|
|
|
46
46
|
className: cn("isolate z-50", positionerClassName),
|
|
47
47
|
children: /* @__PURE__ */ jsx(Popover$1.Popup, {
|
|
48
48
|
"data-slot": "popover-content",
|
|
49
|
-
className: cn("motion-pop-md bg-elevated text-contrast
|
|
49
|
+
className: cn("motion-pop-md bg-elevated text-contrast border-edge z-50 flex w-72 flex-col gap-2.5 rounded-md p-2.5 text-sm shadow-md border focus-visible:outline-hidden", className),
|
|
50
50
|
finalFocus: resolveFinalFocus(restoreFocusOnClose, finalFocus),
|
|
51
51
|
...props
|
|
52
52
|
})
|
package/dist/preview-card.js
CHANGED
|
@@ -38,7 +38,7 @@ function PreviewCardContent({ className, positionerClassName, side = "bottom", s
|
|
|
38
38
|
className: cn("isolate z-50", positionerClassName),
|
|
39
39
|
children: /* @__PURE__ */ jsx(PreviewCard$1.Popup, {
|
|
40
40
|
"data-slot": "preview-card-content",
|
|
41
|
-
className: cn("motion-pop-md bg-elevated text-contrast
|
|
41
|
+
className: cn("motion-pop-md bg-elevated text-contrast border-edge z-50 w-64 rounded-md p-2.5 text-sm shadow-md border focus-visible:outline-hidden", className),
|
|
42
42
|
...props
|
|
43
43
|
})
|
|
44
44
|
}) });
|
package/dist/radio.js
CHANGED
|
@@ -6,7 +6,7 @@ import { Radio as Radio$1 } from "@base-ui/react/radio";
|
|
|
6
6
|
function Radio({ className, ...props }) {
|
|
7
7
|
return /* @__PURE__ */ jsx(Radio$1.Root, {
|
|
8
8
|
"data-slot": "radio",
|
|
9
|
-
className: cn("cursor-clickable bg-
|
|
9
|
+
className: cn("cursor-clickable bg-neutral border-transparent not-data-disabled:data-unchecked:hover:border-focus not-data-disabled:data-unchecked:group-hover/field:border-focus data-checked:bg-primary data-checked:text-white data-checked:border-primary aria-invalid:aria-checked:border-primary aria-invalid:border-danger focus-visible:border-focus focus-visible:ring-focus/50 aria-invalid:ring-danger/30 group/radio peer relative flex aspect-square size-6 shrink-0 rounded-full border motion-color focus-visible:outline-hidden group-has-disabled/field:opacity-30 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:ring-3 data-disabled:pointer-events-none data-disabled:opacity-30 aria-invalid:ring-3", className),
|
|
10
10
|
...props,
|
|
11
11
|
children: /* @__PURE__ */ jsx(RadioIndicator, {})
|
|
12
12
|
});
|
package/dist/resizable.js
CHANGED
|
@@ -41,11 +41,11 @@ function ResizableHandle({ className, grip = false, ref, ...props }) {
|
|
|
41
41
|
return /* @__PURE__ */ jsx(Separator, {
|
|
42
42
|
"data-slot": "resizable-handle",
|
|
43
43
|
elementRef: ref,
|
|
44
|
-
className: cn("group/resizable-handle bg-
|
|
44
|
+
className: cn("group/resizable-handle bg-line z-10 flex items-center justify-center motion-color focus-visible:outline-hidden focus-visible:ring-3 focus-visible:ring-focus/50 data-[separator=active]:bg-focus data-[separator=hover]:bg-focus data-[separator=disabled]:pointer-events-none aria-[orientation=horizontal]:h-px aria-[orientation=vertical]:w-px", className),
|
|
45
45
|
...props,
|
|
46
46
|
children: grip && /* @__PURE__ */ jsx("div", {
|
|
47
47
|
"data-slot": "resizable-handle-grip",
|
|
48
|
-
className: "bg-
|
|
48
|
+
className: "bg-neutral h-6 w-1 shrink-0 rounded-full motion-color group-data-[separator=active]/resizable-handle:bg-focus group-data-[separator=hover]/resizable-handle:bg-focus group-data-[separator=disabled]/resizable-handle:opacity-30 group-aria-[orientation=horizontal]/resizable-handle:h-1 group-aria-[orientation=horizontal]/resizable-handle:w-6"
|
|
49
49
|
})
|
|
50
50
|
});
|
|
51
51
|
}
|
package/dist/scroll-area.js
CHANGED
|
@@ -4,16 +4,6 @@ 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
7
|
* A scrollable region with styled scrollbars. Both scrollbars are built in:
|
|
18
8
|
* Base UI only mounts one when its axis overflows, so pass content and the
|
|
19
9
|
* right bars appear. They fade in while the area is hovered or scrolling.
|
|
@@ -26,7 +16,7 @@ function ScrollArea({ className, children, fade = true, ...props }) {
|
|
|
26
16
|
children: [
|
|
27
17
|
/* @__PURE__ */ jsx(ScrollArea$1.Viewport, {
|
|
28
18
|
"data-slot": "scroll-area-viewport",
|
|
29
|
-
className: cn("size-full rounded-[inherit] outline-hidden", fade &&
|
|
19
|
+
className: cn("size-full rounded-[inherit] focus-visible:outline-hidden", fade && "scroll-fade"),
|
|
30
20
|
children: /* @__PURE__ */ jsx(ScrollArea$1.Content, {
|
|
31
21
|
"data-slot": "scroll-area-content",
|
|
32
22
|
children
|
|
@@ -46,7 +36,7 @@ function ScrollBar({ className, orientation = "vertical", ...props }) {
|
|
|
46
36
|
...props,
|
|
47
37
|
children: /* @__PURE__ */ jsx(ScrollArea$1.Thumb, {
|
|
48
38
|
"data-slot": "scroll-area-thumb",
|
|
49
|
-
className: "bg-
|
|
39
|
+
className: "bg-neutral relative flex-1 rounded-full"
|
|
50
40
|
})
|
|
51
41
|
});
|
|
52
42
|
}
|
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-
|
|
8
|
+
const selectTriggerVariants = cva("data-placeholder:text-subtle bg-neutral 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 focus-visible: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",
|
|
@@ -36,7 +36,7 @@ function SelectPositioner({ className, ...props }) {
|
|
|
36
36
|
function SelectList({ className, ...props }) {
|
|
37
37
|
return /* @__PURE__ */ jsx(Select$1.List, {
|
|
38
38
|
"data-slot": "select-list",
|
|
39
|
-
className,
|
|
39
|
+
className: cn("scroll-fade supports-[animation-timeline:scroll()]:scrollbar-none min-h-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain [--scroll-fade-inset:1.5rem] in-data-[side=none]:scroll-py-0", className),
|
|
40
40
|
...props
|
|
41
41
|
});
|
|
42
42
|
}
|
|
@@ -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
|
|
79
|
+
className: cn("motion-pop-md bg-elevated text-contrast border-edge relative isolate z-50 max-h-(--available-height) min-w-(--anchor-width) max-w-(--available-width) flex flex-col overflow-hidden rounded-md shadow-md border", 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-highlighted relative flex w-full cursor-clickable items-center gap-1.5 rounded-sm py-1 pr-8 pl-1.5 text-sm data-highlighted: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-line pointer-events-none -mx-1 my-1 h-px", className),
|
|
118
118
|
...props
|
|
119
119
|
});
|
|
120
120
|
}
|
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-line 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.js
CHANGED
|
@@ -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-line" + (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]:
|
|
173
|
+
className: "bg-surface group-data-[variant=floating]:border-edge group-data-[variant=floating]:rounded-md group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:border 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-line 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-line mx-2 data-[orientation=horizontal]:w-auto", className),
|
|
243
243
|
...props
|
|
244
244
|
});
|
|
245
245
|
}
|
|
@@ -265,7 +265,7 @@ function SidebarGroup({ className, ...props }) {
|
|
|
265
265
|
function SidebarGroupLabel({ className, render, ...props }) {
|
|
266
266
|
return useRender({
|
|
267
267
|
defaultTagName: "div",
|
|
268
|
-
props: mergeProps({ className: cn("text-contrast/70 ring-focus/50 h-8 rounded-md px-2 text-xs font-medium group-data-[collapsible=icon]:hidden focus-visible:ring-3 [&>svg]:size-4 flex shrink-0 items-center outline-hidden [&>svg]:shrink-0", className) }, props),
|
|
268
|
+
props: mergeProps({ className: cn("text-contrast/70 ring-focus/50 h-8 rounded-md px-2 text-xs font-medium group-data-[collapsible=icon]:hidden focus-visible:ring-3 [&>svg]:size-4 flex shrink-0 items-center focus-visible:outline-hidden [&>svg]:shrink-0", className) }, props),
|
|
269
269
|
render,
|
|
270
270
|
state: { slot: "sidebar-group-label" }
|
|
271
271
|
});
|
|
@@ -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-highlighted 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 focus-visible: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-highlighted active:bg-highlighted 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 focus-visible: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
305
|
default: "",
|
|
306
|
-
outline: "bg-foundation hover:bg-
|
|
306
|
+
outline: "bg-foundation hover:bg-highlighted border border-contour hover:border-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-highlighted 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 focus-visible: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
|
});
|
|
@@ -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-line 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-highlighted active:bg-highlighted 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 focus-visible: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/slider.js
CHANGED
|
@@ -26,7 +26,7 @@ function Slider({ className, controlClassName, defaultValue, value, min = 0, max
|
|
|
26
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-neutral 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"
|
|
@@ -34,7 +34,7 @@ function Slider({ className, controlClassName, defaultValue, value, min = 0, max
|
|
|
34
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: "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-
|
|
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-contour 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
|
});
|