@codefast/ui 0.12.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +68 -0
- package/README.md +3 -1
- package/dist/components/accordion.js +1 -1
- package/dist/components/avatar.d.ts +2 -2
- package/dist/components/bubble.js +1 -1
- package/dist/components/button-group.d.ts +2 -1
- package/dist/components/button.d.ts +2 -3
- package/dist/components/calendar.d.ts +4 -2
- package/dist/components/calendar.js +2 -2
- package/dist/components/card.d.ts +2 -2
- package/dist/components/chart.d.ts +5 -4
- package/dist/components/checkbox-cards.js +1 -1
- package/dist/components/checkbox-group.js +1 -1
- package/dist/components/checkbox.js +1 -1
- package/dist/components/direction.d.ts +2 -2
- package/dist/components/empty.d.ts +2 -1
- package/dist/components/field.d.ts +6 -5
- package/dist/components/input-group.d.ts +4 -2
- package/dist/components/input-group.js +2 -2
- package/dist/components/input-number.js +6 -6
- package/dist/components/input-otp.js +1 -1
- package/dist/components/input.js +1 -1
- package/dist/components/item.d.ts +4 -3
- package/dist/components/message-scroller.d.ts +3 -2
- package/dist/components/native-select.d.ts +2 -2
- package/dist/components/native-select.js +1 -1
- package/dist/components/navigation-menu.js +2 -2
- package/dist/components/radio-cards.js +1 -1
- package/dist/components/radio-group.js +1 -1
- package/dist/components/radio.js +1 -1
- package/dist/components/resizable.js +1 -1
- package/dist/components/scroll-area.d.ts +2 -1
- package/dist/components/scroll-area.js +1 -1
- package/dist/components/select.js +1 -1
- package/dist/components/sidebar.js +4 -4
- package/dist/components/slider.js +1 -1
- package/dist/components/sonner.d.ts +2 -0
- package/dist/components/sonner.js +5 -3
- package/dist/components/spinner.js +1 -1
- package/dist/components/switch.d.ts +2 -2
- package/dist/components/switch.js +1 -1
- package/dist/components/tabs.d.ts +2 -1
- package/dist/components/tabs.js +2 -2
- package/dist/components/textarea.js +1 -1
- package/dist/components/toggle-group.d.ts +4 -1
- package/dist/index.d.ts +1 -1
- package/dist/lib/message-scroller/geometry.d.ts +1 -8
- package/dist/lib/message-scroller/geometry.js +1 -1
- package/dist/lib/message-scroller/stores.d.ts +2 -6
- package/dist/lib/message-scroller/stores.js +1 -1
- package/dist/lib/message-scroller/types.d.ts +9 -15
- package/dist/lib/message-scroller/types.js +1 -1
- package/dist/primitives/checkbox-group.d.ts +4 -1
- package/dist/primitives/input-number.d.ts +2 -0
- package/dist/primitives/input.d.ts +4 -1
- package/dist/primitives/message-scroller.d.ts +2 -1
- package/dist/variants/attachment.js +1 -1
- package/dist/variants/badge.js +3 -3
- package/dist/variants/bubble.js +1 -1
- package/dist/variants/button.js +3 -3
- package/dist/variants/input-group.js +1 -1
- package/dist/variants/item.js +1 -1
- package/dist/variants/navigation-menu.js +1 -1
- package/dist/variants/sidebar.js +1 -1
- package/dist/variants/toggle.js +1 -1
- package/package.json +8 -20
- package/src/css/foundation/base.css +10 -3
- package/src/css/foundation/motion.css +17 -0
- package/src/css/foundation/tokens.css +2 -0
- package/src/css/foundation/utilities.css +0 -8
- package/src/css/preset.css +1 -1
- package/src/css/themes/amber.css +9 -9
- package/src/css/themes/blue.css +8 -8
- package/src/css/themes/cyan.css +9 -9
- package/src/css/themes/emerald.css +9 -9
- package/src/css/themes/fuchsia.css +11 -11
- package/src/css/themes/gray.css +5 -5
- package/src/css/themes/green.css +9 -9
- package/src/css/themes/indigo.css +9 -9
- package/src/css/themes/lime.css +9 -9
- package/src/css/themes/neutral.css +4 -4
- package/src/css/themes/orange.css +9 -9
- package/src/css/themes/pink.css +11 -11
- package/src/css/themes/purple.css +9 -9
- package/src/css/themes/red.css +11 -11
- package/src/css/themes/rose.css +11 -11
- package/src/css/themes/sky.css +9 -9
- package/src/css/themes/slate.css +5 -5
- package/src/css/themes/stone.css +3 -3
- package/src/css/themes/teal.css +9 -9
- package/src/css/themes/violet.css +9 -9
- package/src/css/themes/yellow.css +9 -9
- package/src/css/themes/zinc.css +3 -3
package/dist/components/radio.js
CHANGED
|
@@ -5,7 +5,7 @@ import { cn } from "#lib/utils";
|
|
|
5
5
|
* @since 0.3.16-canary.0
|
|
6
6
|
*/
|
|
7
7
|
function Radio({ className, onChange, onValueChange, ...props }) {
|
|
8
|
-
return (_jsx("input", { className: cn("peer relative flex size-4 shrink-0 appearance-none items-center justify-center rounded-full border border-input bg-background shadow-xs outline-none before:size-2 before:scale-0 before:rounded-full before:bg-primary-foreground before:transition-transform before:duration-control-indicator before:ease-spring after:absolute after:-inset-x-3 after:-inset-y-2 checked:border-primary checked:bg-primary checked:before:scale-100 focus-visible:
|
|
8
|
+
return (_jsx("input", { className: cn("peer relative flex size-4 shrink-0 appearance-none items-center justify-center rounded-full border border-input bg-background shadow-xs outline-none before:size-2 before:scale-0 before:rounded-full before:bg-primary-foreground before:transition-transform before:duration-control-indicator before:ease-spring after:absolute after:-inset-x-3 after:-inset-y-2 checked:border-primary checked:bg-primary checked:before:scale-100 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring focus-visible:outline-solid disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 checked:aria-invalid:bg-destructive dark:not-checked:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40", className), "data-slot": "radio", type: "radio", onChange: composeEventHandlers(onChange, (event) => onValueChange?.(event.currentTarget.value)), ...props }));
|
|
9
9
|
}
|
|
10
10
|
// ── Exports ──────────────────────────────────────────────────────────────────────────────────────────────────────────
|
|
11
11
|
export { Radio };
|
|
@@ -17,7 +17,7 @@ function ResizablePanel({ ...props }) {
|
|
|
17
17
|
* @since 0.3.16-canary.0
|
|
18
18
|
*/
|
|
19
19
|
function ResizableSeparator({ className, withHandle, ...props }) {
|
|
20
|
-
return (_jsx(ResizablePrimitive.Separator, { className: cn("relative flex w-px items-center justify-center bg-border
|
|
20
|
+
return (_jsx(ResizablePrimitive.Separator, { className: cn("relative flex w-px items-center justify-center bg-border outline-none after:absolute after:inset-y-0 after:inset-s-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring focus-visible:outline-solid aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:inset-s-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 rtl:after:translate-x-1/2 rtl:aria-[orientation=horizontal]:after:translate-x-0 [&[aria-orientation=horizontal]>div]:rotate-90", className), "data-slot": "resizable-separator", ...props, children: withHandle ? _jsx("div", { className: "z-10 flex h-6 w-1 shrink-0 rounded-lg bg-border" }) : null }));
|
|
21
21
|
}
|
|
22
22
|
// ── Exports ──────────────────────────────────────────────────────────────────────────────────────────────────────────
|
|
23
23
|
export { ResizableGroup, ResizablePanel, ResizableSeparator };
|
|
@@ -9,7 +9,8 @@ type ScrollAreaContextValue = Pick<ScrollAreaScrollbarVariants, "size">;
|
|
|
9
9
|
/**
|
|
10
10
|
* @since 0.3.16-canary.0
|
|
11
11
|
*/
|
|
12
|
-
|
|
12
|
+
interface ScrollAreaProps extends ScopedProps<ComponentProps<typeof ScrollAreaPrimitive.Root>>, ScrollAreaContextValue {
|
|
13
|
+
}
|
|
13
14
|
/**
|
|
14
15
|
* @since 0.3.16-canary.0
|
|
15
16
|
*/
|
|
@@ -11,7 +11,7 @@ const [ScrollAreaContextProvider, useScrollAreaContext] = createScrollAreaContex
|
|
|
11
11
|
* @since 0.3.16-canary.0
|
|
12
12
|
*/
|
|
13
13
|
function ScrollArea({ __scopeScrollArea, children, className, size, ...props }) {
|
|
14
|
-
return (_jsx(ScrollAreaContextProvider, { scope: __scopeScrollArea, size: size, children: _jsxs(ScrollAreaPrimitive.Root, { className: cn("relative", className), "data-slot": "scroll-area", ...props, children: [_jsx(ScrollAreaPrimitive.Viewport, { className: "size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:
|
|
14
|
+
return (_jsx(ScrollAreaContextProvider, { scope: __scopeScrollArea, size: size, children: _jsxs(ScrollAreaPrimitive.Root, { className: cn("relative", className), "data-slot": "scroll-area", ...props, children: [_jsx(ScrollAreaPrimitive.Viewport, { className: "size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring focus-visible:outline-solid", "data-slot": "scroll-area-viewport", children: children }), _jsx(ScrollAreaScrollbar, { orientation: "vertical" }), _jsx(ScrollAreaScrollbar, { orientation: "horizontal" }), _jsx(ScrollAreaPrimitive.Corner, {})] }) }));
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* @since 0.3.16-canary.0
|
|
@@ -25,7 +25,7 @@ function SelectValue({ ...props }) {
|
|
|
25
25
|
* @since 0.3.16-canary.0
|
|
26
26
|
*/
|
|
27
27
|
function SelectTrigger({ children, className, size = "default", ...props }) {
|
|
28
|
-
return (_jsxs(SelectPrimitive.Trigger, { className: cn("flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 ps-2.5 pe-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:
|
|
28
|
+
return (_jsxs(SelectPrimitive.Trigger, { className: cn("flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 ps-2.5 pe-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring focus-visible:outline-solid disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *: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 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), "data-size": size, "data-slot": "select-trigger", ...props, children: [children, _jsx(SelectPrimitive.Icon, { asChild: true, children: _jsx(ChevronDownIcon, { className: "pointer-events-none size-4 text-muted-foreground" }) })] }));
|
|
29
29
|
}
|
|
30
30
|
/**
|
|
31
31
|
* @since 0.3.16-canary.0
|
|
@@ -176,14 +176,14 @@ function SidebarGroup({ className, ...props }) {
|
|
|
176
176
|
*/
|
|
177
177
|
function SidebarGroupLabel({ asChild = false, className, ...props }) {
|
|
178
178
|
const Component = asChild ? Slot.Root : "div";
|
|
179
|
-
return (_jsx(Component, { className: cn("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70
|
|
179
|
+
return (_jsx(Component, { className: cn("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 transition-[margin,opacity] duration-200 ease-gentle outline-none group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-sidebar-ring focus-visible:outline-solid [&>svg]:size-4 [&>svg]:shrink-0", className), "data-sidebar": "group-label", "data-slot": "sidebar-group-label", ...props }));
|
|
180
180
|
}
|
|
181
181
|
/**
|
|
182
182
|
* @since 0.3.16-canary.0
|
|
183
183
|
*/
|
|
184
184
|
function SidebarGroupAction({ asChild = false, className, ...props }) {
|
|
185
185
|
const Component = asChild ? Slot.Root : "button";
|
|
186
|
-
return (_jsx(Component, { className: cn("absolute inset-e-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground
|
|
186
|
+
return (_jsx(Component, { className: cn("absolute inset-e-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground transition-transform outline-none group-data-[collapsible=icon]:hidden after:absolute after:-inset-2 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-sidebar-ring focus-visible:outline-solid sidebar:after:hidden [&>svg]:size-4 [&>svg]:shrink-0", className), "data-sidebar": "group-action", "data-slot": "sidebar-group-action", ...props }));
|
|
187
187
|
}
|
|
188
188
|
/**
|
|
189
189
|
* @since 0.3.16-canary.0
|
|
@@ -227,7 +227,7 @@ function SidebarMenuButton({ asChild = false, className, isActive = false, size
|
|
|
227
227
|
*/
|
|
228
228
|
function SidebarMenuAction({ asChild = false, className, showOnHover = false, ...props }) {
|
|
229
229
|
const Component = asChild ? Slot.Root : "button";
|
|
230
|
-
return (_jsx(Component, { className: cn("absolute inset-e-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground
|
|
230
|
+
return (_jsx(Component, { className: cn("absolute inset-e-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground transition-transform outline-none group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 after:absolute after:-inset-2 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-sidebar-ring focus-visible:outline-solid sidebar:after:hidden [&>svg]:size-4 [&>svg]:shrink-0", showOnHover &&
|
|
231
231
|
"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 peer-data-active/menu-button:text-sidebar-accent-foreground aria-expanded:opacity-100 sidebar:opacity-0", className), "data-sidebar": "menu-action", "data-slot": "sidebar-menu-action", ...props }));
|
|
232
232
|
}
|
|
233
233
|
/**
|
|
@@ -268,7 +268,7 @@ function SidebarMenuSubItem({ className, ...props }) {
|
|
|
268
268
|
*/
|
|
269
269
|
function SidebarMenuSubButton({ asChild = false, className, isActive = false, size = "md", ...props }) {
|
|
270
270
|
const Component = asChild ? Slot.Root : "a";
|
|
271
|
-
return (_jsx(Component, { className: cn("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground
|
|
271
|
+
return (_jsx(Component, { className: cn("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none group-data-[collapsible=icon]:hidden hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-sidebar-ring focus-visible:outline-solid active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[size=md]:text-sm data-[size=sm]:text-xs rtl:translate-x-px data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground", className), "data-active": isActive, "data-sidebar": "menu-sub-button", "data-size": size, "data-slot": "sidebar-menu-sub-button", ...props }));
|
|
272
272
|
}
|
|
273
273
|
// ── Helpers ──────────────────────────────────────────────────────────────────────────────────────────────────────────
|
|
274
274
|
// The sheet takes over below the preset's `sidebar:` breakpoint, so JS matches the value that CSS resolved.
|
|
@@ -12,7 +12,7 @@ function Slider({ className, defaultValue, max = 100, min = 0, value, ...props }
|
|
|
12
12
|
}
|
|
13
13
|
return Array.isArray(defaultValue) ? defaultValue : [min, max];
|
|
14
14
|
}, [value, defaultValue, min, max]);
|
|
15
|
-
return (_jsxs(SliderPrimitive.Root, { className: cn("relative flex w-full touch-none items-center select-none data-vertical:h-full data-vertical:min-h-40 data-vertical:w-auto data-vertical:flex-col data-disabled:opacity-50", className), "data-slot": "slider", max: max, min: min, ...(defaultValue === undefined ? {} : { defaultValue }), ...(value === undefined ? {} : { value }), ...props, children: [_jsx(SliderPrimitive.Track, { className: "relative grow overflow-hidden rounded-full bg-muted data-horizontal:h-1 data-horizontal:w-full data-vertical:h-full data-vertical:w-1", "data-slot": "slider-track", children: _jsx(SliderPrimitive.Range, { className: "absolute bg-primary select-none data-horizontal:h-full data-vertical:w-full", "data-slot": "slider-range" }) }), Array.from({ length: _values.length }, (_, index) => (_jsx(SliderPrimitive.Thumb, { className: "relative block size-3 shrink-0 rounded-full border border-ring bg-white shadow-sm ring-ring/50 transition-[color,box-shadow] select-none after:absolute after:-inset-2 hover:ring-3 focus-visible:
|
|
15
|
+
return (_jsxs(SliderPrimitive.Root, { className: cn("relative flex w-full touch-none items-center select-none data-vertical:h-full data-vertical:min-h-40 data-vertical:w-auto data-vertical:flex-col data-disabled:opacity-50", className), "data-slot": "slider", max: max, min: min, ...(defaultValue === undefined ? {} : { defaultValue }), ...(value === undefined ? {} : { value }), ...props, children: [_jsx(SliderPrimitive.Track, { className: "relative grow overflow-hidden rounded-full bg-muted data-horizontal:h-1 data-horizontal:w-full data-vertical:h-full data-vertical:w-1", "data-slot": "slider-track", children: _jsx(SliderPrimitive.Range, { className: "absolute bg-primary select-none data-horizontal:h-full data-vertical:w-full", "data-slot": "slider-range" }) }), Array.from({ length: _values.length }, (_, index) => (_jsx(SliderPrimitive.Thumb, { className: "relative block size-3 shrink-0 rounded-full border border-ring bg-white shadow-sm ring-ring/50 transition-[color,box-shadow] select-none after:absolute after:-inset-2 hover:ring-3 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring focus-visible:outline-solid active:ring-3 disabled:pointer-events-none disabled:opacity-50", "data-slot": "slider-thumb" }, index)))] }));
|
|
16
16
|
}
|
|
17
17
|
// ── Exports ──────────────────────────────────────────────────────────────────────────────────────────────────────────
|
|
18
18
|
export { Slider };
|
|
@@ -5,6 +5,8 @@ import type { ToasterProps as SonnerToasterProps } from "sonner";
|
|
|
5
5
|
*/
|
|
6
6
|
type ToasterProps = SonnerToasterProps;
|
|
7
7
|
/**
|
|
8
|
+
* Renders the toast region in the color scheme resolved by the enclosing `AppearanceProvider`.
|
|
9
|
+
*
|
|
8
10
|
* @since 0.3.16-canary.0
|
|
9
11
|
*/
|
|
10
12
|
declare function Toaster({ ...props }: ToasterProps): JSX.Element;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useAppearance } from "@codefast/theme";
|
|
2
3
|
import { CircleCheckIcon, InfoIcon, Loader2Icon, OctagonXIcon, TriangleAlertIcon } from "lucide-react";
|
|
3
|
-
import { useTheme } from "next-themes";
|
|
4
4
|
import { Toaster as Sonner } from "sonner";
|
|
5
5
|
/**
|
|
6
|
+
* Renders the toast region in the color scheme resolved by the enclosing `AppearanceProvider`.
|
|
7
|
+
*
|
|
6
8
|
* @since 0.3.16-canary.0
|
|
7
9
|
*/
|
|
8
10
|
function Toaster({ ...props }) {
|
|
9
|
-
const {
|
|
11
|
+
const { colorScheme } = useAppearance();
|
|
10
12
|
return (_jsx(Sonner, { className: "toaster group", icons: {
|
|
11
13
|
error: _jsx(OctagonXIcon, { className: "size-4" }),
|
|
12
14
|
info: _jsx(InfoIcon, { className: "size-4" }),
|
|
@@ -18,7 +20,7 @@ function Toaster({ ...props }) {
|
|
|
18
20
|
"--normal-bg": "var(--popover)",
|
|
19
21
|
"--normal-border": "var(--border)",
|
|
20
22
|
"--normal-text": "var(--popover-foreground)",
|
|
21
|
-
}, theme:
|
|
23
|
+
}, theme: colorScheme, toastOptions: {
|
|
22
24
|
classNames: {
|
|
23
25
|
toast: "rounded-2xl",
|
|
24
26
|
},
|
|
@@ -10,7 +10,7 @@ function Spinner({ children, className, loading = true, ...props }) {
|
|
|
10
10
|
if (!loading) {
|
|
11
11
|
return children;
|
|
12
12
|
}
|
|
13
|
-
const spinner = (_jsx("span", { className: cn("relative flex size-4 items-center justify-center opacity-60", className), ...props, children: Array.from({ length: SPINNER_COUNT }, (_, index) => (_jsx("span", { className: "absolute h-full rotate-(--spinner-rotate) before:block before:h-1/3 before:w-full before:animate-out before:rounded-full before:bg-current before:delay-(--spinner-delay) before:animation-duration-(--spinner-duration) before:fade-out-25 before:repeat-infinite
|
|
13
|
+
const spinner = (_jsx("span", { className: cn("relative flex size-4 items-center justify-center opacity-60", className), ...props, children: Array.from({ length: SPINNER_COUNT }, (_, index) => (_jsx("span", { className: "absolute h-full rotate-(--spinner-rotate) before:block before:h-1/3 before:w-full before:animate-out before:rounded-full before:bg-current before:delay-(--spinner-delay) before:animation-duration-(--spinner-duration) before:fade-out-25 before:repeat-infinite", style: {
|
|
14
14
|
"--spinner-delay": `-${((SPINNER_COUNT - index) * 100).toString()}ms`,
|
|
15
15
|
"--spinner-duration": `${(SPINNER_COUNT * 100).toString()}ms`,
|
|
16
16
|
"--spinner-rotate": `${((360 / SPINNER_COUNT) * index).toString()}deg`,
|
|
@@ -3,9 +3,9 @@ import type { ComponentProps, JSX } from "react";
|
|
|
3
3
|
/**
|
|
4
4
|
* @since 0.3.16-canary.0
|
|
5
5
|
*/
|
|
6
|
-
|
|
6
|
+
interface SwitchProps extends ComponentProps<typeof SwitchPrimitives.Root> {
|
|
7
7
|
size?: "default" | "sm";
|
|
8
|
-
}
|
|
8
|
+
}
|
|
9
9
|
/**
|
|
10
10
|
* @since 0.3.16-canary.0
|
|
11
11
|
*/
|
|
@@ -5,7 +5,7 @@ import { cn } from "#lib/utils";
|
|
|
5
5
|
* @since 0.3.16-canary.0
|
|
6
6
|
*/
|
|
7
7
|
function Switch({ className, size = "default", ...props }) {
|
|
8
|
-
return (_jsx(SwitchPrimitives.Root, { className: cn("peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all duration-control ease-snappy outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:
|
|
8
|
+
return (_jsx(SwitchPrimitives.Root, { className: cn("peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all duration-control ease-snappy outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring focus-visible:outline-solid aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-4.5 data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50", className), "data-size": size, "data-slot": "switch", ...props, children: _jsx(SwitchPrimitives.Thumb, { className: "pointer-events-none block rounded-full bg-background ring-0 transition-transform duration-control-indicator ease-spring group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-3.5 group-data-[size=sm]/switch:data-checked:translate-x-2.5 rtl:group-data-[size=default]/switch:data-checked:-translate-x-3.5 rtl:group-data-[size=sm]/switch:data-checked:-translate-x-2.5 dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 rtl:group-data-[size=default]/switch:data-unchecked:translate-x-0 rtl:group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground", "data-slot": "switch-thumb" }) }));
|
|
9
9
|
}
|
|
10
10
|
// ── Exports ──────────────────────────────────────────────────────────────────────────────────────────────────────────
|
|
11
11
|
export { Switch };
|
|
@@ -12,7 +12,8 @@ declare function Tabs({ className, orientation, ...props }: TabsProps): JSX.Elem
|
|
|
12
12
|
/**
|
|
13
13
|
* @since 0.3.16-canary.0
|
|
14
14
|
*/
|
|
15
|
-
|
|
15
|
+
interface TabsListProps extends ComponentProps<typeof TabsPrimitive.List>, TabsListVariants {
|
|
16
|
+
}
|
|
16
17
|
/**
|
|
17
18
|
* @since 0.3.16-canary.0
|
|
18
19
|
*/
|
package/dist/components/tabs.js
CHANGED
|
@@ -18,13 +18,13 @@ function TabsList({ className, variant = "default", ...props }) {
|
|
|
18
18
|
* @since 0.3.16-canary.0
|
|
19
19
|
*/
|
|
20
20
|
function TabsTrigger({ className, ...props }) {
|
|
21
|
-
return (_jsx(TabsPrimitive.Trigger, { className: cn("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:
|
|
21
|
+
return (_jsx(TabsPrimitive.Trigger, { className: cn("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring focus-visible:outline-solid disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pe-1 has-data-[icon=inline-start]:ps-1 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", "group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent", "data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground", "after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:-bottom-1.25 group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-inset-e-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100", className), "data-slot": "tabs-trigger", ...props }));
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
24
|
* @since 0.3.16-canary.0
|
|
25
25
|
*/
|
|
26
26
|
function TabsContent({ className, ...props }) {
|
|
27
|
-
return (_jsx(TabsPrimitive.Content, { className: cn("flex-1 text-sm outline-none", className), "data-slot": "tabs-content", ...props }));
|
|
27
|
+
return (_jsx(TabsPrimitive.Content, { className: cn("flex-1 text-sm outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring focus-visible:outline-solid", className), "data-slot": "tabs-content", ...props }));
|
|
28
28
|
}
|
|
29
29
|
// ── Exports ──────────────────────────────────────────────────────────────────────────────────────────────────────────
|
|
30
30
|
export { Tabs, TabsContent, TabsList, TabsTrigger };
|
|
@@ -4,7 +4,7 @@ import { cn } from "#lib/utils";
|
|
|
4
4
|
* @since 0.3.16-canary.0
|
|
5
5
|
*/
|
|
6
6
|
function Textarea({ className, ...props }) {
|
|
7
|
-
return (_jsx("textarea", { className: cn("flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:
|
|
7
|
+
return (_jsx("textarea", { className: cn("flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring focus-visible:outline-solid disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40", className), "data-slot": "textarea", ...props }));
|
|
8
8
|
}
|
|
9
9
|
// ── Exports ──────────────────────────────────────────────────────────────────────────────────────────────────────────
|
|
10
10
|
export { Textarea };
|
|
@@ -7,6 +7,8 @@ type ScopedProps<P> = P & {
|
|
|
7
7
|
__scopeToggleGroup?: Context.Scope;
|
|
8
8
|
};
|
|
9
9
|
/**
|
|
10
|
+
* @remarks A type alias, since Radix's root props are a union over `type` that only `&` distributes into.
|
|
11
|
+
*
|
|
10
12
|
* @since 0.3.16-canary.0
|
|
11
13
|
*/
|
|
12
14
|
type ToggleGroupProps = ComponentProps<typeof ToggleGroupPrimitive.Root> & VariantProps<typeof toggleVariants> & {
|
|
@@ -20,7 +22,8 @@ declare function ToggleGroup({ __scopeToggleGroup, children, className, orientat
|
|
|
20
22
|
/**
|
|
21
23
|
* @since 0.3.16-canary.0
|
|
22
24
|
*/
|
|
23
|
-
|
|
25
|
+
interface ToggleGroupItemProps extends ScopedProps<ComponentProps<typeof ToggleGroupPrimitive.Item>>, VariantProps<typeof toggleVariants> {
|
|
26
|
+
}
|
|
24
27
|
/**
|
|
25
28
|
* @since 0.3.16-canary.0
|
|
26
29
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -80,7 +80,7 @@ export type { MenubarArrowProps, MenubarCheckboxItemProps, MenubarContentProps,
|
|
|
80
80
|
export { Message, MessageAvatar, MessageContent, MessageFooter, MessageGroup, MessageHeader, } from "#components/message";
|
|
81
81
|
export type { MessageAvatarProps, MessageContentProps, MessageFooterProps, MessageGroupProps, MessageHeaderProps, MessageProps, } from "#components/message";
|
|
82
82
|
export { MessageScroller, MessageScrollerButton, MessageScrollerContent, MessageScrollerItem, MessageScrollerProvider, MessageScrollerViewport, useMessageScroller, useMessageScrollerScrollable, useMessageScrollerVisibility, } from "#components/message-scroller";
|
|
83
|
-
export type { MessageScrollerButtonProps, MessageScrollerContentProps, MessageScrollerDefaultScrollPosition, MessageScrollerItemProps, MessageScrollerProps, MessageScrollerProviderProps, MessageScrollerScrollable, MessageScrollerScrollAlign, MessageScrollerScrollOptions, MessageScrollerViewportProps, MessageScrollerVisibilityState, } from "#components/message-scroller";
|
|
83
|
+
export type { MessageScrollerButtonDirection, MessageScrollerButtonProps, MessageScrollerButtonRenderState, MessageScrollerContentProps, MessageScrollerDefaultScrollPosition, MessageScrollerItemProps, MessageScrollerProps, MessageScrollerProviderProps, MessageScrollerScrollable, MessageScrollerScrollAlign, MessageScrollerScrollOptions, MessageScrollerViewportProps, MessageScrollerVisibilityState, } from "#components/message-scroller";
|
|
84
84
|
export { NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, } from "#components/navigation-menu";
|
|
85
85
|
export type { NavigationMenuContentProps, NavigationMenuIndicatorProps, NavigationMenuItemProps, NavigationMenuLinkProps, NavigationMenuListProps, NavigationMenuProps, NavigationMenuTriggerProps, NavigationMenuViewportProps, } from "#components/navigation-menu";
|
|
86
86
|
export { NativeSelect, NativeSelectOptGroup, NativeSelectOption } from "#components/native-select";
|
|
@@ -88,15 +88,8 @@ declare function getContentBottom({ content, spacer, viewport, }: {
|
|
|
88
88
|
* @since 0.5.0-canary.3
|
|
89
89
|
*/
|
|
90
90
|
declare function getMaxScrollTop(viewport: HTMLElement): number;
|
|
91
|
-
/**
|
|
92
|
-
* @since 0.5.0-canary.3
|
|
93
|
-
*/
|
|
94
|
-
declare function getContentBlockPadding(spacer: HTMLElement | null): {
|
|
95
|
-
end: number;
|
|
96
|
-
start: number;
|
|
97
|
-
};
|
|
98
91
|
/**
|
|
99
92
|
* @since 0.5.0-canary.3
|
|
100
93
|
*/
|
|
101
94
|
declare function getFlexGap(element: HTMLElement | null): number;
|
|
102
|
-
export {
|
|
95
|
+
export { getContentBottom, getElementScrollTop, getElementTop, getElementViewportTop, getFirstVisibleMessageItem, getFlexGap, getLastScrollAnchor, getMaxScrollTop, getMessageScrollerItems, getMessageScrollerScrollable, getMessageScrollerVisibilityState, getNewScrollAnchor, getTailSpacerHeight, getUnanchoredScrollAnchor, hasMultipleNewScrollAnchors, };
|
|
@@ -242,4 +242,4 @@ function readCssPixel(value) {
|
|
|
242
242
|
const number = Number.parseFloat(value);
|
|
243
243
|
return Number.isFinite(number) ? number : 0;
|
|
244
244
|
}
|
|
245
|
-
export {
|
|
245
|
+
export { getContentBottom, getElementScrollTop, getElementTop, getElementViewportTop, getFirstVisibleMessageItem, getFlexGap, getLastScrollAnchor, getMaxScrollTop, getMessageScrollerItems, getMessageScrollerScrollable, getMessageScrollerVisibilityState, getNewScrollAnchor, getTailSpacerHeight, getUnanchoredScrollAnchor, hasMultipleNewScrollAnchors, };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { MessageScrollerScrollable, MessageScrollerStore,
|
|
1
|
+
import type { MessageScrollerScrollable, MessageScrollerStore, MessageScrollerVisibilityStore } from "#lib/message-scroller/types";
|
|
2
2
|
/**
|
|
3
3
|
* @since 0.5.0-canary.3
|
|
4
4
|
*/
|
|
@@ -11,8 +11,4 @@ declare function createMessageScrollerVisibilityStore(): MessageScrollerVisibili
|
|
|
11
11
|
* @since 0.5.0-canary.3
|
|
12
12
|
*/
|
|
13
13
|
declare function areScrollStatesEqual(current: MessageScrollerScrollable, next: MessageScrollerScrollable): boolean;
|
|
14
|
-
|
|
15
|
-
* @since 0.5.0-canary.3
|
|
16
|
-
*/
|
|
17
|
-
declare function areVisibilityStatesEqual(current: MessageScrollerVisibilityState, next: MessageScrollerVisibilityState): boolean;
|
|
18
|
-
export { areScrollStatesEqual, areVisibilityStatesEqual, createMessageScrollerStore, createMessageScrollerVisibilityStore, };
|
|
14
|
+
export { areScrollStatesEqual, createMessageScrollerStore, createMessageScrollerVisibilityStore };
|
|
@@ -60,4 +60,4 @@ function areVisibilityStatesEqual(current, next) {
|
|
|
60
60
|
}
|
|
61
61
|
return current.visibleMessageIds.every((messageId, index) => messageId === next.visibleMessageIds[index]);
|
|
62
62
|
}
|
|
63
|
-
export { areScrollStatesEqual,
|
|
63
|
+
export { areScrollStatesEqual, createMessageScrollerStore, createMessageScrollerVisibilityStore };
|
|
@@ -129,26 +129,26 @@ type MessageScrollerProps = ComponentProps<"div">;
|
|
|
129
129
|
*
|
|
130
130
|
* @since 0.5.0-canary.3
|
|
131
131
|
*/
|
|
132
|
-
|
|
132
|
+
interface MessageScrollerViewportProps extends ComponentProps<"div"> {
|
|
133
133
|
preserveScrollOnPrepend?: boolean;
|
|
134
|
-
}
|
|
134
|
+
}
|
|
135
135
|
/**
|
|
136
136
|
* Transcript row container. Every direct child should be a MessageScrollerItem.
|
|
137
137
|
*
|
|
138
138
|
* @since 0.5.0-canary.3
|
|
139
139
|
*/
|
|
140
|
-
|
|
140
|
+
interface MessageScrollerContentProps extends ComponentProps<"div"> {
|
|
141
141
|
spacerClassName?: string;
|
|
142
|
-
}
|
|
142
|
+
}
|
|
143
143
|
/**
|
|
144
144
|
* One transcript row: a message, marker, typing row, separator, or load-more row.
|
|
145
145
|
*
|
|
146
146
|
* @since 0.5.0-canary.3
|
|
147
147
|
*/
|
|
148
|
-
|
|
148
|
+
interface MessageScrollerItemProps extends ComponentProps<"div"> {
|
|
149
149
|
messageId?: string;
|
|
150
150
|
isScrollAnchor?: boolean;
|
|
151
|
-
}
|
|
151
|
+
}
|
|
152
152
|
/**
|
|
153
153
|
* State passed to MessageScrollerButton's render prop.
|
|
154
154
|
*
|
|
@@ -163,10 +163,10 @@ type MessageScrollerButtonRenderState = {
|
|
|
163
163
|
*
|
|
164
164
|
* @since 0.5.0-canary.3
|
|
165
165
|
*/
|
|
166
|
-
|
|
166
|
+
interface MessageScrollerButtonProps extends UseRenderComponentProps<"button", MessageScrollerButtonRenderState> {
|
|
167
167
|
behavior?: ScrollBehavior;
|
|
168
168
|
direction?: MessageScrollerButtonDirection;
|
|
169
|
-
}
|
|
169
|
+
}
|
|
170
170
|
/**
|
|
171
171
|
* Minimal external store backing useMessageScrollerScrollable, consumed via
|
|
172
172
|
* useSyncExternalStore.
|
|
@@ -228,17 +228,11 @@ type MessageScrollerContextValue = {
|
|
|
228
228
|
* @since 0.5.0-canary.3
|
|
229
229
|
*/
|
|
230
230
|
declare const EMPTY_MESSAGE_SCROLLER_SCROLLABLE: MessageScrollerScrollable;
|
|
231
|
-
/**
|
|
232
|
-
* Shared empty array so empty visibility snapshots stay referentially stable.
|
|
233
|
-
*
|
|
234
|
-
* @since 0.5.0-canary.3
|
|
235
|
-
*/
|
|
236
|
-
declare const EMPTY_VISIBLE_MESSAGE_IDS: Array<string>;
|
|
237
231
|
/**
|
|
238
232
|
* Initial MessageScrollerVisibilityState. Nothing tracked, no current anchor.
|
|
239
233
|
*
|
|
240
234
|
* @since 0.5.0-canary.3
|
|
241
235
|
*/
|
|
242
236
|
declare const EMPTY_MESSAGE_SCROLLER_VISIBILITY_STATE: MessageScrollerVisibilityState;
|
|
243
|
-
export { AUTOSCROLLING_CLEAR_DELAY, DEFAULT_SCROLL_EDGE_THRESHOLD, DEFAULT_SCROLL_MARGIN, DEFAULT_SCROLL_PREVIOUS_ITEM_PEEK, EMPTY_MESSAGE_SCROLLER_SCROLLABLE, EMPTY_MESSAGE_SCROLLER_VISIBILITY_STATE,
|
|
237
|
+
export { AUTOSCROLLING_CLEAR_DELAY, DEFAULT_SCROLL_EDGE_THRESHOLD, DEFAULT_SCROLL_MARGIN, DEFAULT_SCROLL_PREVIOUS_ITEM_PEEK, EMPTY_MESSAGE_SCROLLER_SCROLLABLE, EMPTY_MESSAGE_SCROLLER_VISIBILITY_STATE, SCROLL_POSITION_EPSILON, USER_SCROLL_KEYS, };
|
|
244
238
|
export type { MessageScrollerButtonDirection, MessageScrollerButtonProps, MessageScrollerButtonRenderState, MessageScrollerContentProps, MessageScrollerContextValue, MessageScrollerDefaultScrollPosition, MessageScrollerItemProps, MessageScrollerMode, MessageScrollerProps, MessageScrollerProviderProps, MessageScrollerRegisterMessage, MessageScrollerScrollAlign, MessageScrollerScrollEdges, MessageScrollerScrollOptions, MessageScrollerScrollable, MessageScrollerStore, MessageScrollerViewportProps, MessageScrollerVisibilityState, MessageScrollerVisibilityStore, };
|
|
@@ -72,4 +72,4 @@ const EMPTY_MESSAGE_SCROLLER_VISIBILITY_STATE = {
|
|
|
72
72
|
currentAnchorId: null,
|
|
73
73
|
visibleMessageIds: EMPTY_VISIBLE_MESSAGE_IDS,
|
|
74
74
|
};
|
|
75
|
-
export { AUTOSCROLLING_CLEAR_DELAY, DEFAULT_SCROLL_EDGE_THRESHOLD, DEFAULT_SCROLL_MARGIN, DEFAULT_SCROLL_PREVIOUS_ITEM_PEEK, EMPTY_MESSAGE_SCROLLER_SCROLLABLE, EMPTY_MESSAGE_SCROLLER_VISIBILITY_STATE,
|
|
75
|
+
export { AUTOSCROLLING_CLEAR_DELAY, DEFAULT_SCROLL_EDGE_THRESHOLD, DEFAULT_SCROLL_MARGIN, DEFAULT_SCROLL_PREVIOUS_ITEM_PEEK, EMPTY_MESSAGE_SCROLLER_SCROLLABLE, EMPTY_MESSAGE_SCROLLER_VISIBILITY_STATE, SCROLL_POSITION_EPSILON, USER_SCROLL_KEYS, };
|
|
@@ -4,6 +4,8 @@ import { RovingFocus } from "radix-ui/internal";
|
|
|
4
4
|
import type { ComponentProps, JSX } from "react";
|
|
5
5
|
/**
|
|
6
6
|
* Type for components that can be scoped within the CheckboxGroup context
|
|
7
|
+
*
|
|
8
|
+
* @remarks A type alias, since an interface cannot extend the type parameter `P` it scopes.
|
|
7
9
|
*/
|
|
8
10
|
type ScopedProps<P> = P & {
|
|
9
11
|
/**
|
|
@@ -90,7 +92,8 @@ interface CheckboxGroupBaseProps {
|
|
|
90
92
|
*
|
|
91
93
|
* @since 0.3.16-canary.0
|
|
92
94
|
*/
|
|
93
|
-
|
|
95
|
+
interface CheckboxGroupProps extends CheckboxGroupBaseProps, Omit<ComponentProps<"div">, keyof CheckboxGroupBaseProps> {
|
|
96
|
+
}
|
|
94
97
|
/**
|
|
95
98
|
* CheckboxGroup component that manages a group of checkboxes with roving focus
|
|
96
99
|
*
|
|
@@ -3,6 +3,8 @@ import type { ComponentProps, JSX } from "react";
|
|
|
3
3
|
import * as InputPrimitive from "#primitives/input";
|
|
4
4
|
/**
|
|
5
5
|
* Props that include an optional scope for the InputNumber component.
|
|
6
|
+
*
|
|
7
|
+
* @remarks A type alias, since an interface cannot extend the type parameter `P` it scopes.
|
|
6
8
|
*/
|
|
7
9
|
type ScopedProps<P> = P & {
|
|
8
10
|
/**
|
|
@@ -2,6 +2,8 @@ import { Context } from "radix-ui/internal";
|
|
|
2
2
|
import type { ComponentProps, JSX, PropsWithChildren, ReactNode } from "react";
|
|
3
3
|
/**
|
|
4
4
|
* Type for adding scope to component props
|
|
5
|
+
*
|
|
6
|
+
* @remarks A type alias, since an interface cannot extend the type parameter `P` it scopes.
|
|
5
7
|
*/
|
|
6
8
|
type ScopedProps<P> = P & {
|
|
7
9
|
/**
|
|
@@ -57,7 +59,8 @@ interface InputBehaviorProps {
|
|
|
57
59
|
*
|
|
58
60
|
* @since 0.3.16-canary.0
|
|
59
61
|
*/
|
|
60
|
-
|
|
62
|
+
interface InputProps extends PropsWithChildren<InputBehaviorProps>, InputVisualProps {
|
|
63
|
+
}
|
|
61
64
|
/**
|
|
62
65
|
* @since 0.3.16-canary.0
|
|
63
66
|
*/
|
|
@@ -39,4 +39,5 @@ declare function MessageScrollerItem({ messageId, ref, isScrollAnchor, ...props
|
|
|
39
39
|
* @since 0.5.0-canary.3
|
|
40
40
|
*/
|
|
41
41
|
declare function MessageScrollerButton({ behavior, children, direction, onClick, render, tabIndex, type, ...props }: MessageScrollerButtonProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | null;
|
|
42
|
-
export { MessageScroller, MessageScrollerButton, MessageScrollerContent, MessageScrollerItem, MessageScrollerProvider, MessageScrollerViewport, useMessageScroller, useMessageScrollerScrollable, useMessageScrollerVisibility, };
|
|
42
|
+
export { MessageScroller, MessageScrollerButton, MessageScrollerContent, MessageScrollerItem, MessageScrollerProvider, MessageScrollerViewport, useMessageScroller, useMessageScrollerScrollable, useMessageScrollerVisibility, };
|
|
43
|
+
export type { MessageScrollerButtonDirection, MessageScrollerButtonProps, MessageScrollerButtonRenderState, MessageScrollerContentProps, MessageScrollerDefaultScrollPosition, MessageScrollerItemProps, MessageScrollerProps, MessageScrollerProviderProps, MessageScrollerScrollable, MessageScrollerScrollAlign, MessageScrollerScrollOptions, MessageScrollerViewportProps, MessageScrollerVisibilityState, } from "#lib/message-scroller/types";
|
|
@@ -7,7 +7,7 @@ import { tv } from "#lib/utils";
|
|
|
7
7
|
* @since 0.5.0-canary.3
|
|
8
8
|
*/
|
|
9
9
|
const attachmentVariants = tv({
|
|
10
|
-
base: "group/attachment relative flex w-fit max-w-full min-w-0 shrink-0 flex-wrap rounded-xl border bg-card text-card-foreground transition-colors focus-within:ring-1 focus-within:ring-ring
|
|
10
|
+
base: "group/attachment relative flex w-fit max-w-full min-w-0 shrink-0 flex-wrap rounded-xl border bg-card text-card-foreground transition-colors focus-within:ring-1 focus-within:ring-ring has-[>a,>button]:hover:bg-muted/50 data-[state=error]:border-destructive/30 data-[state=idle]:border-dashed",
|
|
11
11
|
defaultVariants: {
|
|
12
12
|
orientation: "horizontal",
|
|
13
13
|
size: "default",
|
package/dist/variants/badge.js
CHANGED
|
@@ -4,14 +4,14 @@ import { tv } from "#lib/utils";
|
|
|
4
4
|
* @since 0.3.16-canary.0
|
|
5
5
|
*/
|
|
6
6
|
const badgeVariants = tv({
|
|
7
|
-
base: "group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:
|
|
7
|
+
base: "group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring focus-visible:outline-solid has-data-[icon=inline-end]:pe-1.5 has-data-[icon=inline-start]:ps-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",
|
|
8
8
|
defaultVariants: {
|
|
9
9
|
variant: "default",
|
|
10
10
|
},
|
|
11
11
|
variants: {
|
|
12
12
|
variant: {
|
|
13
|
-
default: "bg-primary text-primary-foreground [a]:hover:bg-primary
|
|
14
|
-
destructive: "bg-destructive/10 text-destructive focus-visible:
|
|
13
|
+
default: "bg-primary text-primary-foreground [a]:hover:bg-primary-hover",
|
|
14
|
+
destructive: "bg-destructive/10 text-destructive focus-visible:outline-destructive dark:bg-destructive/20 [a]:hover:bg-destructive/20",
|
|
15
15
|
ghost: "hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",
|
|
16
16
|
link: "text-primary underline-offset-4 hover:underline",
|
|
17
17
|
outline: "border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",
|
package/dist/variants/bubble.js
CHANGED
|
@@ -13,7 +13,7 @@ const bubbleVariants = tv({
|
|
|
13
13
|
},
|
|
14
14
|
variants: {
|
|
15
15
|
variant: {
|
|
16
|
-
default: "*:data-[slot=bubble-content]:bg-primary *:data-[slot=bubble-content]:text-primary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-primary
|
|
16
|
+
default: "*:data-[slot=bubble-content]:bg-primary *:data-[slot=bubble-content]:text-primary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-primary-hover",
|
|
17
17
|
secondary: "*:data-[slot=bubble-content]:bg-secondary *:data-[slot=bubble-content]:text-secondary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)]",
|
|
18
18
|
muted: "*:data-[slot=bubble-content]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--muted),var(--foreground)_5%)]",
|
|
19
19
|
tinted: "*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.93_calc(c*0.4)_h)] *:data-[slot=bubble-content]:text-foreground dark:*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.3_calc(c*0.4)_h)] [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.88_calc(c*0.5)_h)] dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.35_calc(c*0.5)_h)]",
|
package/dist/variants/button.js
CHANGED
|
@@ -4,7 +4,7 @@ import { tv } from "#lib/utils";
|
|
|
4
4
|
* @since 0.3.16-canary.0
|
|
5
5
|
*/
|
|
6
6
|
const buttonVariants = tv({
|
|
7
|
-
base: "group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:
|
|
7
|
+
base: "group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring focus-visible:outline-solid active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
8
8
|
defaultVariants: {
|
|
9
9
|
size: "default",
|
|
10
10
|
variant: "default",
|
|
@@ -21,8 +21,8 @@ const buttonVariants = tv({
|
|
|
21
21
|
"icon-lg": "size-9", // 36px
|
|
22
22
|
},
|
|
23
23
|
variant: {
|
|
24
|
-
default: "bg-primary text-primary-foreground hover:bg-primary
|
|
25
|
-
destructive: "bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:
|
|
24
|
+
default: "bg-primary text-primary-foreground hover:bg-primary-hover",
|
|
25
|
+
destructive: "bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:outline-destructive dark:bg-destructive/20 dark:hover:bg-destructive/30",
|
|
26
26
|
ghost: "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
|
|
27
27
|
link: "text-primary underline-offset-4 hover:underline",
|
|
28
28
|
outline: "border-border bg-background shadow-xs hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
|
|
@@ -4,7 +4,7 @@ import { tv } from "#lib/utils";
|
|
|
4
4
|
* @since 0.3.16-canary.0
|
|
5
5
|
*/
|
|
6
6
|
const inputGroupVariants = tv({
|
|
7
|
-
base: "group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input shadow-xs transition-[color,box-shadow] outline-none in-data-[slot=combobox-content]:focus-within:border-inherit
|
|
7
|
+
base: "group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input shadow-xs transition-[color,box-shadow] outline-none in-data-[slot=combobox-content]:focus-within:border-inherit has-disabled:bg-input/50 has-[[data-slot=input-group-control]:focus-visible]:outline-2 has-[[data-slot=input-group-control]:focus-visible]:outline-offset-2 has-[[data-slot=input-group-control]:focus-visible]:outline-ring has-[[data-slot=input-group-control]:focus-visible]:outline-solid in-data-[slot=combobox-content]:has-[[data-slot=input-group-control]:focus-visible]:outline-none has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pe-1.5 has-[>[data-align=inline-start]]:[&>input]:ps-1.5",
|
|
8
8
|
});
|
|
9
9
|
// ── Variant: InputGroupAddon ─────────────────────────────────────────────────────────────────────────────────────────
|
|
10
10
|
/**
|
package/dist/variants/item.js
CHANGED
|
@@ -4,7 +4,7 @@ import { tv } from "#lib/utils";
|
|
|
4
4
|
* @since 0.3.16-canary.0
|
|
5
5
|
*/
|
|
6
6
|
const itemVariants = tv({
|
|
7
|
-
base: "group/item flex w-full flex-wrap items-center rounded-lg border text-sm transition-colors duration-100 outline-none focus-visible:
|
|
7
|
+
base: "group/item flex w-full flex-wrap items-center rounded-lg border text-sm transition-colors duration-100 outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring focus-visible:outline-solid [a]:transition-colors [a]:hover:bg-muted",
|
|
8
8
|
defaultVariants: {
|
|
9
9
|
size: "default",
|
|
10
10
|
variant: "default",
|
|
@@ -4,7 +4,7 @@ import { tv } from "#lib/utils";
|
|
|
4
4
|
* @since 0.3.16-canary.0
|
|
5
5
|
*/
|
|
6
6
|
const navigationMenuTriggerVariants = tv({
|
|
7
|
-
base: "group/navigation-menu-trigger inline-flex h-9 w-max items-center justify-center rounded-lg px-2.5 py-1.5 text-sm font-medium transition-all outline-none hover:bg-muted focus:bg-muted focus-visible:
|
|
7
|
+
base: "group/navigation-menu-trigger inline-flex h-9 w-max items-center justify-center rounded-lg px-2.5 py-1.5 text-sm font-medium transition-all outline-none hover:bg-muted focus:bg-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring focus-visible:outline-solid disabled:pointer-events-none disabled:opacity-50 data-popup-open:bg-muted/50 data-popup-open:hover:bg-muted data-open:bg-muted/50 data-open:hover:bg-muted data-open:focus:bg-muted",
|
|
8
8
|
});
|
|
9
9
|
// ── Exports ──────────────────────────────────────────────────────────────────────────────────────────────────────────
|
|
10
10
|
export { navigationMenuTriggerVariants };
|
package/dist/variants/sidebar.js
CHANGED
|
@@ -4,7 +4,7 @@ import { tv } from "#lib/utils";
|
|
|
4
4
|
* @since 0.3.16-canary.0
|
|
5
5
|
*/
|
|
6
6
|
const sidebarMenuButtonVariants = tv({
|
|
7
|
-
base: "peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-start text-sm
|
|
7
|
+
base: "peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-start text-sm transition-[width,height,padding] outline-none group-has-data-[sidebar=menu-action]/menu-item:pe-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-sidebar-ring focus-visible:outline-solid active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",
|
|
8
8
|
defaultVariants: {
|
|
9
9
|
size: "default",
|
|
10
10
|
variant: "default",
|
package/dist/variants/toggle.js
CHANGED
|
@@ -4,7 +4,7 @@ import { tv } from "#lib/utils";
|
|
|
4
4
|
* @since 0.3.16-canary.0
|
|
5
5
|
*/
|
|
6
6
|
const toggleVariants = tv({
|
|
7
|
-
base: "group/toggle inline-flex items-center justify-center gap-1 rounded-lg text-sm font-medium whitespace-nowrap transition-[color,box-shadow] outline-none hover:bg-muted hover:text-foreground focus-visible:
|
|
7
|
+
base: "group/toggle inline-flex items-center justify-center gap-1 rounded-lg text-sm font-medium whitespace-nowrap transition-[color,box-shadow] outline-none hover:bg-muted hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring focus-visible:outline-solid disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
8
8
|
defaultVariants: {
|
|
9
9
|
size: "default",
|
|
10
10
|
variant: "default",
|