@vvedantb/ui 0.70.0 → 0.75.5
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/dist/src/composer/input-area/ComposerSlashMenu.js +1 -1
- package/dist/src/ui/_field-classes.js +1 -0
- package/dist/src/ui/_menu-classes.alt.js +1 -1
- package/dist/src/ui/_menu-classes.js +1 -1
- package/dist/src/ui/avatar.js +1 -1
- package/dist/src/ui/badge.js +1 -1
- package/dist/src/ui/button.js +6 -4
- package/dist/src/ui/calendar.js +1 -1
- package/dist/src/ui/card.js +1 -1
- package/dist/src/ui/checkbox.js +2 -2
- package/dist/src/ui/clear-input.js +3 -3
- package/dist/src/ui/command.js +3 -3
- package/dist/src/ui/dialog.js +1 -1
- package/dist/src/ui/hover-card.js +1 -1
- package/dist/src/ui/input.js +2 -2
- package/dist/src/ui/kbd.js +2 -2
- package/dist/src/ui/popover.js +1 -1
- package/dist/src/ui/progress.js +28 -25
- package/dist/src/ui/radix-select.js +1 -1
- package/dist/src/ui/search-input.js +2 -2
- package/dist/src/ui/select.js +3 -3
- package/dist/src/ui/sheet.js +2 -2
- package/dist/src/ui/slide-over-panel.js +1 -1
- package/dist/src/ui/slider.js +4 -2
- package/dist/src/ui/sonner.js +1 -1
- package/dist/src/ui/switch.js +71 -62
- package/dist/src/ui/textarea.js +2 -2
- package/dist/src/ui/tooltip.js +1 -1
- package/dist/tokens/src/css/tabs-pills.css +41 -0
- package/package.json +1 -1
- package/src/ai-elements/__snapshots__/queue.test.tsx.snap +4 -4
- package/src/composer/input-area/ComposerSlashMenu.tsx +1 -1
- package/src/ui/__snapshots__/alt-wrappers.test.tsx.snap +1 -1
- package/src/ui/__snapshots__/sonner-dom.test.tsx.snap +1 -1
- package/src/ui/_field-classes.ts +3 -0
- package/src/ui/_menu-classes.alt.ts +1 -1
- package/src/ui/_menu-classes.ts +1 -1
- package/src/ui/avatar.tsx +1 -1
- package/src/ui/badge.tsx +1 -1
- package/src/ui/button.tsx +9 -4
- package/src/ui/calendar.tsx +1 -1
- package/src/ui/card.tsx +1 -1
- package/src/ui/checkbox.tsx +2 -2
- package/src/ui/clear-input.tsx +3 -3
- package/src/ui/command.tsx +3 -3
- package/src/ui/dialog.tsx +1 -1
- package/src/ui/hover-card.tsx +1 -1
- package/src/ui/input.tsx +2 -1
- package/src/ui/kbd.tsx +2 -2
- package/src/ui/popover.tsx +1 -0
- package/src/ui/progress.tsx +3 -3
- package/src/ui/radix-select.tsx +1 -1
- package/src/ui/search-input.tsx +2 -2
- package/src/ui/select.tsx +3 -2
- package/src/ui/sheet.tsx +2 -2
- package/src/ui/slide-over-panel.tsx +1 -1
- package/src/ui/slider.tsx +7 -2
- package/src/ui/sonner.tsx +1 -1
- package/src/ui/switch.tsx +14 -3
- package/src/ui/textarea.tsx +2 -1
- package/src/ui/tooltip.tsx +1 -1
- package/tokens/src/css/tabs-pills.css +41 -0
package/src/ui/button.tsx
CHANGED
|
@@ -10,10 +10,15 @@ const ghostClass =
|
|
|
10
10
|
const buttonBaseClasses =
|
|
11
11
|
"inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium tracking-normal transition-[transform,background-color,box-shadow,opacity,border-color] duration-200 ease-smooth focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 active:scale-[0.96] active:duration-[var(--motion-fast,150ms)] [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0";
|
|
12
12
|
|
|
13
|
+
const GLASS_RIM =
|
|
14
|
+
"shadow-[inset_0_0_0_0.75px_rgb(255_255_255/0.3),inset_1.5px_1.5px_1px_-1px_rgb(255_255_255/0.6),inset_-1.5px_-1.5px_1px_-1px_rgb(255_255_255/0.22),0_1px_2px_rgb(0_0_0/0.16)]";
|
|
15
|
+
const GLASS_RIM_ON_PRIMARY =
|
|
16
|
+
"shadow-[inset_0_0_0_0.75px_color-mix(in_srgb,var(--color-primary-foreground)_30%,transparent),inset_1.5px_1.5px_1px_-1px_color-mix(in_srgb,var(--color-primary-foreground)_60%,transparent),inset_-1.5px_-1.5px_1px_-1px_color-mix(in_srgb,var(--color-primary-foreground)_22%,transparent),0_1px_2px_rgb(0_0_0/0.16)]";
|
|
17
|
+
|
|
13
18
|
const defaultVariantClass =
|
|
14
|
-
"bg-primary text-primary-foreground hover
|
|
19
|
+
"bg-primary text-primary-foreground hover:opacity-90 " + GLASS_RIM_ON_PRIMARY;
|
|
15
20
|
const destructiveVariantClass =
|
|
16
|
-
"bg-[oklch(47.2%_0.195_25.7)] text-white hover:bg-[oklch(42.5%_0.185_25.7)]";
|
|
21
|
+
"bg-[oklch(47.2%_0.195_25.7)] text-white hover:bg-[oklch(42.5%_0.185_25.7)] " + GLASS_RIM;
|
|
17
22
|
|
|
18
23
|
const buttonVariantClasses = {
|
|
19
24
|
default: defaultVariantClass,
|
|
@@ -27,8 +32,8 @@ const buttonVariantClasses = {
|
|
|
27
32
|
tertiary: ghostClass,
|
|
28
33
|
link: "text-primary underline-offset-4 hover:underline active:scale-100",
|
|
29
34
|
flat: `${ghostClass} bg-transparent text-muted hover:bg-surface-tertiary hover:text-foreground`, // check-tokens-allow: text-muted
|
|
30
|
-
success: `${ghostClass} bg-success text-success-foreground hover:bg-success/90`,
|
|
31
|
-
warning: `${ghostClass} bg-warning text-warning-foreground hover:bg-warning/90`,
|
|
35
|
+
success: `${ghostClass} bg-success text-success-foreground hover:bg-success/90 ${GLASS_RIM}`,
|
|
36
|
+
warning: `${ghostClass} bg-warning text-warning-foreground hover:bg-warning/90 ${GLASS_RIM}`,
|
|
32
37
|
};
|
|
33
38
|
|
|
34
39
|
const buttonSizeClasses = {
|
package/src/ui/calendar.tsx
CHANGED
|
@@ -148,7 +148,7 @@ function Calendar({
|
|
|
148
148
|
"not-group-data-selected/day:enabled:hover:bg-surface-tertiary/50",
|
|
149
149
|
"group-data-today/day:font-medium group-data-today/day:not-group-data-selected/day:text-foreground group-data-today/day:after:absolute group-data-today/day:after:bottom-1 group-data-today/day:after:left-1/2 group-data-today/day:after:size-1 group-data-today/day:after:-translate-x-1/2 group-data-today/day:after:rounded-full group-data-today/day:after:bg-current",
|
|
150
150
|
"group-data-outside/day:not-group-data-selected/day:text-muted-foreground",
|
|
151
|
-
"group-data-selected/day:bg-primary group-data-selected/day:text-primary-foreground",
|
|
151
|
+
"group-data-selected/day:bg-primary group-data-selected/day:text-primary-foreground group-data-selected/day:shadow-[inset_1.5px_1.5px_1px_-1px_color-mix(in_srgb,var(--color-primary-foreground)_60%,transparent),0_1px_2px_rgb(0_0_0/0.16)]",
|
|
152
152
|
defaultClassNames.day_button,
|
|
153
153
|
),
|
|
154
154
|
range_start: cn("rounded-l-lg", defaultClassNames.range_start),
|
package/src/ui/card.tsx
CHANGED
|
@@ -28,7 +28,7 @@ const Card = React.forwardRef<
|
|
|
28
28
|
>(({ className, ...props }, ref) => (
|
|
29
29
|
<div
|
|
30
30
|
ref={ref}
|
|
31
|
-
className={useCardClass("root", "rounded-lg bg-surface-card text-surface-foreground", className)}
|
|
31
|
+
className={useCardClass("root", "rounded-lg bg-surface-card text-surface-foreground shadow-[inset_0_0_0_0.5px_rgb(0_0_0/0.06),inset_1.5px_1.5px_1px_-1px_rgb(255_255_255/0.5),0_1px_2px_rgb(0_0_0/0.06)] dark:shadow-[inset_0_0_0_0.5px_rgb(255_255_255/0.08),inset_1.5px_1.5px_1px_-1px_rgb(255_255_255/0.12),0_1px_2px_rgb(0_0_0/0.3)]", className)}
|
|
32
32
|
{...props}
|
|
33
33
|
/>
|
|
34
34
|
));
|
package/src/ui/checkbox.tsx
CHANGED
|
@@ -25,7 +25,7 @@ const Checkbox = React.forwardRef<
|
|
|
25
25
|
ref={ref}
|
|
26
26
|
className={merge(
|
|
27
27
|
config?.classes?.root ??
|
|
28
|
-
"peer relative h-
|
|
28
|
+
"peer relative h-5 w-5 shrink-0 rounded-[6px] border border-border bg-field-background transition-[transform,background-color,border-color,box-shadow] duration-200 ease-smooth motion-reduce:transition-none active:scale-90 data-[state=checked]:shadow-[inset_0_0_0_0.75px_color-mix(in_srgb,var(--color-primary-foreground)_30%,transparent),inset_1px_1px_1px_-0.5px_color-mix(in_srgb,var(--color-primary-foreground)_60%,transparent),inset_-1px_-1px_1px_-0.5px_color-mix(in_srgb,var(--color-primary-foreground)_22%,transparent),0_1px_2px_rgb(0_0_0/0.16)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground before:absolute before:inset-[-12px] before:content-['']",
|
|
29
29
|
className,
|
|
30
30
|
)}
|
|
31
31
|
{...props}
|
|
@@ -33,7 +33,7 @@ const Checkbox = React.forwardRef<
|
|
|
33
33
|
<CheckboxPrimitive.Indicator
|
|
34
34
|
className={config?.classes?.indicator ?? cn("flex items-center justify-center text-current")}
|
|
35
35
|
>
|
|
36
|
-
{icon ?? config?.icon ?? <IconCheck className="h-
|
|
36
|
+
{icon ?? config?.icon ?? <IconCheck className="h-4 w-4" />}
|
|
37
37
|
</CheckboxPrimitive.Indicator>
|
|
38
38
|
</CheckboxPrimitive.Root>
|
|
39
39
|
);
|
package/src/ui/clear-input.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { IconX } from "@tabler/icons-react";
|
|
3
3
|
import { assignRef } from "../utils/ref";
|
|
4
|
-
import { fieldFocusClass } from "./_field-classes";
|
|
4
|
+
import { fieldFocusClass, fieldGlassClass } from "./_field-classes";
|
|
5
5
|
import { runClearInputDissolve } from "./clearInputDissolve";
|
|
6
6
|
import { useCn, useUiConfig } from "./ui-config";
|
|
7
7
|
|
|
@@ -96,7 +96,7 @@ const PlainClearInput = React.forwardRef<
|
|
|
96
96
|
}}
|
|
97
97
|
placeholder=""
|
|
98
98
|
className={merge(
|
|
99
|
-
classes?.input ?? [inputClasses, fieldFocusClass],
|
|
99
|
+
classes?.input ?? [inputClasses, fieldGlassClass, fieldFocusClass],
|
|
100
100
|
(always || filled) && "pr-9",
|
|
101
101
|
className,
|
|
102
102
|
)}
|
|
@@ -232,7 +232,7 @@ const DissolveClearInput = React.forwardRef<HTMLInputElement, ClearInputPartsPro
|
|
|
232
232
|
}}
|
|
233
233
|
placeholder={placeholder}
|
|
234
234
|
className={merge(
|
|
235
|
-
classes?.input ?? [inputClasses, fieldFocusClass],
|
|
235
|
+
classes?.input ?? [inputClasses, fieldGlassClass, fieldFocusClass],
|
|
236
236
|
fieldClassName,
|
|
237
237
|
)}
|
|
238
238
|
{...props}
|
package/src/ui/command.tsx
CHANGED
|
@@ -52,7 +52,7 @@ const Command = React.forwardRef<
|
|
|
52
52
|
Command.displayName = CommandPrimitive.displayName;
|
|
53
53
|
|
|
54
54
|
const commandDialogPinnedClass =
|
|
55
|
-
"[&_[cmdk-list]]:h-80 [&_[cmdk-list]]:max-h-[60dvh] [&_[cmdk-group-heading]]:px-2.5 [&_[cmdk-group-heading]]:py-1
|
|
55
|
+
"[&_[cmdk-list]]:h-80 [&_[cmdk-list]]:max-h-[60dvh] [&_[cmdk-group-heading]]:px-2.5 [&_[cmdk-group-heading]]:py-1 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-semibold [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-1.5 [&_[cmdk-input-wrapper]_svg]:h-4 [&_[cmdk-input-wrapper]_svg]:w-4 [&_[cmdk-input]]:h-11 [&_[cmdk-item]]:rounded-menu-item [&_[cmdk-item]]:px-2.5 [&_[cmdk-item]]:py-2 [&_[cmdk-item]_svg]:h-4 [&_[cmdk-item]_svg]:w-4";
|
|
56
56
|
|
|
57
57
|
const commandDialogInstantClass =
|
|
58
58
|
"[--modal-open-dur:0ms] [--modal-close-dur:1ms] [--modal-scale:1] [--modal-scale-close:1]";
|
|
@@ -60,7 +60,7 @@ const commandDialogInstantClass =
|
|
|
60
60
|
const commandOverlayInstantClass = "[animation:none!important]";
|
|
61
61
|
|
|
62
62
|
const commandDialogAutoClass =
|
|
63
|
-
"[&_[cmdk-group-heading]]:px-2.5 [&_[cmdk-group-heading]]:py-1
|
|
63
|
+
"[&_[cmdk-group-heading]]:px-2.5 [&_[cmdk-group-heading]]:py-1 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-semibold [&_[cmdk-group-heading]]:text-muted [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-1.5 [&_[cmdk-input-wrapper]_svg]:h-4 [&_[cmdk-input-wrapper]_svg]:w-4 [&_[cmdk-input]]:h-11 [&_[cmdk-item]_svg]:h-4 [&_[cmdk-item]_svg]:w-4"; // check-tokens-allow: text-muted
|
|
64
64
|
|
|
65
65
|
interface CommandDialogProps extends React.ComponentProps<typeof Dialog> {
|
|
66
66
|
title?: string;
|
|
@@ -187,7 +187,7 @@ const CommandGroup = React.forwardRef<
|
|
|
187
187
|
ref={ref}
|
|
188
188
|
className={merge(
|
|
189
189
|
group ??
|
|
190
|
-
"overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2.5 [&_[cmdk-group-heading]]:py-1
|
|
190
|
+
"overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2.5 [&_[cmdk-group-heading]]:py-1 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-semibold [&_[cmdk-group-heading]]:text-muted-foreground",
|
|
191
191
|
className,
|
|
192
192
|
)}
|
|
193
193
|
{...props}
|
package/src/ui/dialog.tsx
CHANGED
|
@@ -182,7 +182,7 @@ const DialogContent = React.forwardRef<
|
|
|
182
182
|
data-compact={compact ? "true" : undefined}
|
|
183
183
|
className={merge(
|
|
184
184
|
classes?.content ??
|
|
185
|
-
"glass-panel-strong z-50 flex w-full flex-col gap-4 p-6 text-overlay-foreground smooth-shadow-ring-xl",
|
|
185
|
+
"glass-panel-strong z-50 flex w-full flex-col gap-4 p-6 text-overlay-foreground smooth-shadow-ring-xl after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] after:shadow-[inset_1.5px_1.5px_1px_-1px_rgb(255_255_255/0.5)] dark:after:shadow-[inset_1.5px_1.5px_1px_-1px_rgb(255_255_255/0.12)]",
|
|
186
186
|
compact
|
|
187
187
|
? classes?.compact ?? cn(
|
|
188
188
|
"overflow-y-auto fixed inset-x-0 top-auto w-full max-w-none rounded-t-2xl rounded-b-none pt-3",
|
package/src/ui/hover-card.tsx
CHANGED
|
@@ -47,7 +47,7 @@ const HoverCardContent = React.forwardRef<
|
|
|
47
47
|
sideOffset={sideOffset ?? config?.sideOffset ?? 4}
|
|
48
48
|
className={merge(
|
|
49
49
|
config?.classes?.content ?? [
|
|
50
|
-
"z-50 w-72 max-sm:max-w-[calc(100vw-2rem)] max-sm:max-h-[85dvh] max-sm:overflow-y-auto p-4 outline-none",
|
|
50
|
+
"z-50 w-72 max-sm:max-w-[calc(100vw-2rem)] max-sm:max-h-[85dvh] max-sm:overflow-y-auto p-4 outline-none relative after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] after:shadow-[inset_1.5px_1.5px_1px_-1px_rgb(255_255_255/0.5)] dark:after:shadow-[inset_1.5px_1.5px_1px_-1px_rgb(255_255_255/0.12)]",
|
|
51
51
|
floatingSurfaceClass,
|
|
52
52
|
floatingSurfaceAnimateClass,
|
|
53
53
|
],
|
package/src/ui/input.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { fieldFocusClass } from "./_field-classes";
|
|
2
|
+
import { fieldFocusClass, fieldGlassClass } from "./_field-classes";
|
|
3
3
|
import { useCn, useUiConfig } from "./ui-config";
|
|
4
4
|
|
|
5
5
|
/** `UiConfig.Input`: `classes.base` replaces the built-in field classes. */
|
|
@@ -17,6 +17,7 @@ const Input = React.forwardRef<HTMLInputElement, React.ComponentProps<"input">>(
|
|
|
17
17
|
className={merge(
|
|
18
18
|
base ?? [
|
|
19
19
|
"flex h-10 w-full max-sm:min-w-0 rounded-field border border-border bg-field-background px-3.5 py-2 text-base sm:pointer-fine:text-sm transition-[border-color,box-shadow,background-color] duration-200 ease-smooth file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-field-placeholder disabled:cursor-not-allowed disabled:opacity-50",
|
|
20
|
+
fieldGlassClass,
|
|
20
21
|
fieldFocusClass,
|
|
21
22
|
],
|
|
22
23
|
className,
|
package/src/ui/kbd.tsx
CHANGED
|
@@ -3,8 +3,8 @@ import { cn } from "../utils/cn";
|
|
|
3
3
|
|
|
4
4
|
const kbdVariantClasses = {
|
|
5
5
|
default:
|
|
6
|
-
"pointer-events-none inline-flex h-5 select-none items-center gap-1 rounded-md bg-surface-secondary px-1.5 font-mono text-[10px] font-medium text-muted-foreground",
|
|
7
|
-
subtle: "rounded bg-surface-secondary px-1.5 py-0.5 text-foreground",
|
|
6
|
+
"pointer-events-none inline-flex h-5 select-none items-center gap-1 rounded-md bg-surface-secondary px-1.5 font-mono text-[10px] font-medium text-muted-foreground shadow-[inset_0_0_0_0.5px_rgb(0_0_0/0.08),inset_1.5px_1.5px_1px_-1px_rgb(255_255_255/0.5),0_1px_1px_rgb(0_0_0/0.08)] dark:shadow-[inset_0_0_0_0.5px_rgb(255_255_255/0.1),inset_1.5px_1.5px_1px_-1px_rgb(255_255_255/0.12),0_1px_1px_rgb(0_0_0/0.3)]",
|
|
7
|
+
subtle: "rounded bg-surface-secondary px-1.5 py-0.5 text-foreground shadow-[inset_0_0_0_0.5px_rgb(0_0_0/0.08),inset_1.5px_1.5px_1px_-1px_rgb(255_255_255/0.5),0_1px_1px_rgb(0_0_0/0.08)] dark:shadow-[inset_0_0_0_0.5px_rgb(255_255_255/0.1),inset_1.5px_1.5px_1px_-1px_rgb(255_255_255/0.12),0_1px_1px_rgb(0_0_0/0.3)]",
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
export type KbdProps = React.HTMLAttributes<HTMLElement> & {
|
package/src/ui/popover.tsx
CHANGED
|
@@ -50,6 +50,7 @@ const PopoverContent = React.forwardRef<
|
|
|
50
50
|
config?.classes?.content ?? [
|
|
51
51
|
"z-50 w-72 max-sm:max-w-[calc(100vw-2rem)] max-sm:max-h-[85dvh] max-sm:overflow-y-auto p-4 outline-none",
|
|
52
52
|
floatingSurfaceClass,
|
|
53
|
+
"relative after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] after:shadow-[inset_1.5px_1.5px_1px_-1px_rgb(255_255_255/0.5)] dark:after:shadow-[inset_1.5px_1.5px_1px_-1px_rgb(255_255_255/0.12)]",
|
|
53
54
|
triggerZoomAnimateClass,
|
|
54
55
|
],
|
|
55
56
|
fitViewport &&
|
package/src/ui/progress.tsx
CHANGED
|
@@ -16,7 +16,7 @@ const Progress = React.forwardRef<
|
|
|
16
16
|
<ProgressPrimitive.Root
|
|
17
17
|
ref={ref}
|
|
18
18
|
className={merge(
|
|
19
|
-
classes?.root ?? "relative h-
|
|
19
|
+
classes?.root ?? "relative h-3.5 w-full overflow-hidden rounded-full bg-default/85 p-0.5 shadow-[inset_0_1px_2px_rgb(0_0_0/0.1)]",
|
|
20
20
|
className,
|
|
21
21
|
)}
|
|
22
22
|
{...props}
|
|
@@ -24,9 +24,9 @@ const Progress = React.forwardRef<
|
|
|
24
24
|
<ProgressPrimitive.Indicator
|
|
25
25
|
className={
|
|
26
26
|
classes?.indicator ??
|
|
27
|
-
"h-full w-full flex-1 rounded-full bg-primary transition-transform duration-200 ease-smooth"
|
|
27
|
+
"relative h-full w-full flex-1 rounded-full bg-primary shadow-[inset_0_0_0_0.75px_color-mix(in_srgb,var(--color-primary-foreground)_30%,transparent),inset_1.5px_1.5px_1px_-1px_color-mix(in_srgb,var(--color-primary-foreground)_60%,transparent),inset_-1.5px_-1.5px_1px_-1px_color-mix(in_srgb,var(--color-primary-foreground)_22%,transparent)] transition-transform duration-200 ease-smooth motion-reduce:transition-none after:absolute after:inset-x-2.5 after:top-[2px] after:h-[3px] after:rounded-full after:bg-primary-foreground/30"
|
|
28
28
|
}
|
|
29
|
-
style={{ transform: `translateX(-${100 - (value ?? 0)}%)
|
|
29
|
+
style={{ transform: `translateX(-${100 - (value ?? 0)}%)`, visibility: value ? "visible" : "hidden" }}
|
|
30
30
|
/>
|
|
31
31
|
</ProgressPrimitive.Root>
|
|
32
32
|
);
|
package/src/ui/radix-select.tsx
CHANGED
|
@@ -102,7 +102,7 @@ function SelectLabel({
|
|
|
102
102
|
<SelectPrimitive.Label
|
|
103
103
|
data-slot="select-label"
|
|
104
104
|
className={cn(
|
|
105
|
-
"text-muted-foreground px-2.5 py-1
|
|
105
|
+
"text-muted-foreground px-2.5 py-1 text-xs font-semibold",
|
|
106
106
|
className,
|
|
107
107
|
)}
|
|
108
108
|
{...props}
|
package/src/ui/search-input.tsx
CHANGED
|
@@ -106,13 +106,13 @@ const SearchInput = React.forwardRef<HTMLInputElement, SearchInputProps>(
|
|
|
106
106
|
className={
|
|
107
107
|
config?.classes?.icon ??
|
|
108
108
|
cn(
|
|
109
|
-
"pointer-events-none absolute top-1/2 -translate-y-1/2 shrink-0 text-muted-foreground",
|
|
109
|
+
"pointer-events-none absolute top-1/2 z-10 -translate-y-1/2 shrink-0 text-muted-foreground",
|
|
110
110
|
sizeClasses[size].icon,
|
|
111
111
|
)
|
|
112
112
|
}
|
|
113
113
|
/>
|
|
114
114
|
{showShortcut ? (
|
|
115
|
-
<Kbd className="absolute right-2 top-1/2 -translate-y-1/2">{shortcut}</Kbd>
|
|
115
|
+
<Kbd className="absolute right-2 top-1/2 z-10 -translate-y-1/2">{shortcut}</Kbd>
|
|
116
116
|
) : null}
|
|
117
117
|
</>
|
|
118
118
|
}
|
package/src/ui/select.tsx
CHANGED
|
@@ -2,7 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
3
3
|
import { IconCheck, IconChevronDown, IconChevronUp } from "@tabler/icons-react";
|
|
4
4
|
import { cn } from "../utils/cn";
|
|
5
|
-
import { fieldFocusClass } from "./_field-classes";
|
|
5
|
+
import { fieldFocusClass, fieldGlassClass } from "./_field-classes";
|
|
6
6
|
import {
|
|
7
7
|
floatingSurfaceAnimateClass,
|
|
8
8
|
menuSurfaceClass,
|
|
@@ -48,6 +48,7 @@ const SelectTrigger = React.forwardRef<
|
|
|
48
48
|
className={merge(
|
|
49
49
|
config?.classes?.trigger ?? [
|
|
50
50
|
"flex h-10 w-full max-sm:min-w-0 items-center justify-between whitespace-nowrap rounded-field border border-border bg-field-background px-3.5 py-2 text-base sm:pointer-fine:text-sm ring-offset-background placeholder:text-field-placeholder transition-[border-color,box-shadow,background-color] duration-200 ease-smooth disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
|
|
51
|
+
fieldGlassClass,
|
|
51
52
|
fieldFocusClass,
|
|
52
53
|
],
|
|
53
54
|
className,
|
|
@@ -162,7 +163,7 @@ const SelectLabel = React.forwardRef<
|
|
|
162
163
|
ref={ref}
|
|
163
164
|
className={merge(
|
|
164
165
|
label ??
|
|
165
|
-
"px-2.5 py-1
|
|
166
|
+
"px-2.5 py-1 text-xs font-semibold text-muted-foreground",
|
|
166
167
|
className,
|
|
167
168
|
)}
|
|
168
169
|
{...props}
|
package/src/ui/sheet.tsx
CHANGED
|
@@ -71,13 +71,13 @@ const sheetSideSurfaceClass: Record<SheetSide, string> = {
|
|
|
71
71
|
};
|
|
72
72
|
|
|
73
73
|
const sheetContentClass =
|
|
74
|
-
"fixed z-50 overflow-y-auto bg-overlay/95 text-overlay-foreground smooth-shadow-ring-xl outline-hidden backdrop-blur-xl motion-reduce:transition-none";
|
|
74
|
+
"fixed z-50 overflow-y-auto bg-overlay/95 text-overlay-foreground smooth-shadow-ring-xl outline-hidden backdrop-blur-xl motion-reduce:transition-none after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] after:shadow-[inset_1.5px_1.5px_1px_-1px_rgb(255_255_255/0.5)] dark:after:shadow-[inset_1.5px_1.5px_1px_-1px_rgb(255_255_255/0.12)]";
|
|
75
75
|
|
|
76
76
|
const sheetBlurHostClass =
|
|
77
77
|
"fixed z-50 outline-hidden motion-reduce:transition-none after:hidden";
|
|
78
78
|
|
|
79
79
|
const sheetBlurSurfaceClass =
|
|
80
|
-
"flex min-h-0 flex-auto flex-col overflow-y-auto bg-overlay/95 text-overlay-foreground smooth-shadow-ring-xl backdrop-blur-xl";
|
|
80
|
+
"flex min-h-0 flex-auto flex-col overflow-y-auto bg-overlay/95 text-overlay-foreground smooth-shadow-ring-xl backdrop-blur-xl relative after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] after:shadow-[inset_1.5px_1.5px_1px_-1px_rgb(255_255_255/0.5)] dark:after:shadow-[inset_1.5px_1.5px_1px_-1px_rgb(255_255_255/0.12)]";
|
|
81
81
|
|
|
82
82
|
function supportsMotionBlur(node: HTMLElement): boolean {
|
|
83
83
|
return (
|
|
@@ -38,7 +38,7 @@ export function SlideOverPanel({
|
|
|
38
38
|
exit={{ x: "100%" }}
|
|
39
39
|
transition={{ type: "spring", damping: 30, stiffness: 300 }}
|
|
40
40
|
className={cn(
|
|
41
|
-
`absolute top-0 right-0 bottom-0 ${width} z-20 glass-panel-strong smooth-shadow-ring-xl overflow-y-auto hidden md:flex flex-col`,
|
|
41
|
+
`absolute top-0 right-0 bottom-0 ${width} z-20 glass-panel-strong smooth-shadow-ring-xl after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] after:shadow-[inset_1.5px_1.5px_1px_-1px_rgb(255_255_255/0.5)] dark:after:shadow-[inset_1.5px_1.5px_1px_-1px_rgb(255_255_255/0.12)] overflow-y-auto hidden md:flex flex-col`,
|
|
42
42
|
className,
|
|
43
43
|
)}
|
|
44
44
|
>
|
package/src/ui/slider.tsx
CHANGED
|
@@ -7,6 +7,9 @@ export interface SliderConfig {
|
|
|
7
7
|
classes?: { root?: string; track?: string; range?: string; thumb?: string };
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
+
const THUMB_DRAG =
|
|
11
|
+
"data-[dragging]:border-transparent data-[dragging]:bg-[rgb(0_0_0/0.076)] data-[dragging]:backdrop-blur-[0.8px] data-[dragging]:backdrop-saturate-[1.24] data-[dragging]:shadow-[inset_0_0_0_0.75px_rgb(255_255_255/0.9),inset_0_0_0_1.75px_rgb(0_0_0/0.1),inset_1.5px_1.5px_1px_-1px_white,inset_-1.5px_-1.5px_1px_-1px_rgb(255_255_255/0.6),0_6px_14px_rgb(0_0_0/0.18),0_1px_2px_rgb(0_0_0/0.22)] dark:data-[dragging]:border-transparent dark:data-[dragging]:bg-[rgb(255_255_255/0.08)] dark:data-[dragging]:shadow-[inset_0_0_0_0.75px_rgb(255_255_255/0.3),inset_1.5px_1.5px_1px_-1px_rgb(255_255_255/0.5),inset_-1.5px_-1.5px_1px_-1px_rgb(255_255_255/0.2),0_6px_14px_rgb(0_0_0/0.4)] dark:after:bg-white/15 after:absolute after:inset-x-2 after:top-0.5 after:h-1 after:rounded-full after:bg-white/40 after:opacity-0 data-[dragging]:after:opacity-100";
|
|
12
|
+
|
|
10
13
|
type SliderProps = React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root> & {
|
|
11
14
|
thumbLabels?: string[];
|
|
12
15
|
trackClassName?: string;
|
|
@@ -31,7 +34,8 @@ const Slider = React.forwardRef<React.ComponentRef<typeof SliderPrimitive.Root>,
|
|
|
31
34
|
},
|
|
32
35
|
ref,
|
|
33
36
|
) => {
|
|
34
|
-
const
|
|
37
|
+
const config = useUiConfig("Slider");
|
|
38
|
+
const classes = config?.classes;
|
|
35
39
|
const cn = useCn();
|
|
36
40
|
const count = (props.value ?? props.defaultValue ?? [props.min ?? 0]).length;
|
|
37
41
|
const [dragging, setDragging] = React.useState(false);
|
|
@@ -89,7 +93,8 @@ const Slider = React.forwardRef<React.ComponentRef<typeof SliderPrimitive.Root>,
|
|
|
89
93
|
onFocus={() => setActiveIndex(i)}
|
|
90
94
|
className={cn(
|
|
91
95
|
classes?.thumb ??
|
|
92
|
-
"block h-5 w-8 shrink-0 rounded-full border border-border bg-background shadow-sm [transition-property:
|
|
96
|
+
"relative block h-5 w-8 shrink-0 rounded-full border border-border bg-background shadow-sm [transition-property:width,height,background-color,border-color,box-shadow,backdrop-filter] duration-200 ease-smooth motion-reduce:transition-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring data-[disabled]:cursor-not-allowed data-[orientation=vertical]:h-8 data-[orientation=vertical]:w-5 data-[dragging]:h-7 data-[dragging]:w-[46px] data-[dragging]:data-[orientation=vertical]:h-[46px] data-[dragging]:data-[orientation=vertical]:w-7 dark:border-muted dark:bg-foreground " + // check-tokens-allow: muted
|
|
97
|
+
THUMB_DRAG,
|
|
93
98
|
thumbClassName,
|
|
94
99
|
)}
|
|
95
100
|
/>
|
package/src/ui/sonner.tsx
CHANGED
|
@@ -74,7 +74,7 @@ function createToasterClassNames({
|
|
|
74
74
|
const compact = density === "compact";
|
|
75
75
|
const descriptionSize = compact ? "text-xs" : "text-[13px]";
|
|
76
76
|
return {
|
|
77
|
-
toast: `group toast glass-panel-strong flex w-full items-center ${compact ? "gap-2" : "gap-3"} ${radius} ${compact ? "px-3 py-2 text-xs" : "px-4 py-3 text-sm"} text-foreground smooth-shadow-ring-md${hideStackedContent ? ` ${hideStackedContentClassName}` : ""}`,
|
|
77
|
+
toast: `group toast glass-panel-strong flex w-full items-center ${compact ? "gap-2" : "gap-3"} ${radius} ${compact ? "px-3 py-2 text-xs" : "px-4 py-3 text-sm"} text-foreground smooth-shadow-ring-md after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] after:shadow-[inset_1.5px_1.5px_1px_-1px_rgb(255_255_255/0.5)] dark:after:shadow-[inset_1.5px_1.5px_1px_-1px_rgb(255_255_255/0.12)]${hideStackedContent ? ` ${hideStackedContentClassName}` : ""}`,
|
|
78
78
|
content: "flex min-w-0 grow flex-col",
|
|
79
79
|
icon: "relative",
|
|
80
80
|
title: titleLeading === "5" ? "font-medium leading-5" : "font-medium leading-snug",
|
package/src/ui/switch.tsx
CHANGED
|
@@ -11,11 +11,20 @@ export interface SwitchConfig {
|
|
|
11
11
|
const PRESSED_THUMB_PX = 34;
|
|
12
12
|
const DRAG_THRESHOLD_PX = 3;
|
|
13
13
|
|
|
14
|
+
const THUMB_BASE =
|
|
15
|
+
"pointer-events-none relative block h-4 w-4 rounded-full bg-background shadow-sm ring-0 [transition-property:transform,translate,width,height,background-color,box-shadow,backdrop-filter] duration-200 ease-smooth motion-reduce:transition-none data-[state=checked]:translate-x-[30px] data-[state=checked]:bg-primary-foreground data-[state=unchecked]:translate-x-0 dark:data-[state=unchecked]:bg-foreground group-disabled:group-active:h-4 group-disabled:group-active:w-4 group-disabled:group-active:data-[state=checked]:translate-x-[30px] data-[dragging]:translate-x-(--switch-x)! data-[dragging]:[transition-property:width,height,background-color,box-shadow,backdrop-filter]";
|
|
16
|
+
|
|
17
|
+
const THUMB_CLEAR =
|
|
18
|
+
"group-active:h-7 group-active:w-[34px] group-active:data-[state=checked]:translate-x-3 group-active:bg-[rgb(255_255_255/0.12)] group-active:backdrop-blur-[1.8px] group-active:backdrop-saturate-[1.24] group-active:shadow-[inset_0_0_0_0.75px_rgb(255_255_255/0.7),inset_1.5px_1.5px_1px_-1px_white,inset_-1.5px_-1.5px_1px_-1px_rgb(255_255_255/0.6),0_6px_14px_rgb(0_0_0/0.14),0_1px_2px_rgb(0_0_0/0.18)] group-active:data-[state=checked]:bg-[rgb(255_255_255/0.12)] group-active:data-[state=unchecked]:bg-[rgb(0_0_0/0.096)] dark:data-[state=unchecked]:group-active:bg-[rgb(255_255_255/0.14)] group-active:data-[state=unchecked]:shadow-[inset_0_0_0_0.75px_rgb(255_255_255/0.9),inset_0_0_0_1.75px_rgb(0_0_0/0.1),inset_1.5px_1.5px_1px_-1px_white,inset_-1.5px_-1.5px_1px_-1px_rgb(255_255_255/0.6),0_6px_14px_rgb(0_0_0/0.18),0_1px_2px_rgb(0_0_0/0.22)] after:absolute after:inset-x-2 after:top-0.5 after:h-1 after:rounded-full after:bg-white/40 after:opacity-0 group-active:after:opacity-100";
|
|
19
|
+
|
|
20
|
+
|
|
14
21
|
const Switch = React.forwardRef<
|
|
15
22
|
React.ComponentRef<typeof SwitchPrimitive.Root>,
|
|
16
23
|
React.ComponentPropsWithoutRef<typeof SwitchPrimitive.Root>
|
|
17
|
-
>(({ className, onPointerDown, onPointerMove, onPointerUp, onPointerCancel, onClick, ...props }, ref) => {
|
|
18
|
-
const
|
|
24
|
+
>(({ className, style, onPointerDown, onPointerMove, onPointerUp, onPointerCancel, onClick, ...props }, ref) => {
|
|
25
|
+
const config = useUiConfig("Switch");
|
|
26
|
+
const classes = config?.classes;
|
|
27
|
+
|
|
19
28
|
const merge = useCn();
|
|
20
29
|
const [dragX, setDragX] = React.useState<number | null>(null);
|
|
21
30
|
const drag = React.useRef({ startClientX: 0, startX: 0, active: false, moved: false });
|
|
@@ -50,6 +59,7 @@ const Switch = React.forwardRef<
|
|
|
50
59
|
className,
|
|
51
60
|
)}
|
|
52
61
|
{...props}
|
|
62
|
+
style={style}
|
|
53
63
|
ref={ref}
|
|
54
64
|
onClick={(event) => {
|
|
55
65
|
onClick?.(event);
|
|
@@ -97,7 +107,8 @@ const Switch = React.forwardRef<
|
|
|
97
107
|
className={
|
|
98
108
|
classes?.thumb ??
|
|
99
109
|
cn(
|
|
100
|
-
|
|
110
|
+
THUMB_BASE,
|
|
111
|
+
THUMB_CLEAR,
|
|
101
112
|
)
|
|
102
113
|
}
|
|
103
114
|
/>
|
package/src/ui/textarea.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { fieldFocusClass } from "./_field-classes";
|
|
2
|
+
import { fieldFocusClass, fieldGlassClass } from "./_field-classes";
|
|
3
3
|
import { useCn, useUiConfig } from "./ui-config";
|
|
4
4
|
|
|
5
5
|
/** `UiConfig.Textarea`: `classes.base` replaces the built-in field classes. */
|
|
@@ -18,6 +18,7 @@ const Textarea = React.forwardRef<
|
|
|
18
18
|
className={merge(
|
|
19
19
|
base ?? [
|
|
20
20
|
"flex min-h-20 w-full max-sm:min-w-0 rounded-field border border-border bg-field-background px-3.5 py-2.5 text-base sm:pointer-fine:text-sm placeholder:text-field-placeholder disabled:cursor-not-allowed disabled:opacity-50",
|
|
21
|
+
fieldGlassClass,
|
|
21
22
|
fieldFocusClass,
|
|
22
23
|
],
|
|
23
24
|
className,
|
package/src/ui/tooltip.tsx
CHANGED
|
@@ -39,7 +39,7 @@ const TooltipContent = React.forwardRef<
|
|
|
39
39
|
sideOffset={sideOffset ?? config?.sideOffset ?? 4}
|
|
40
40
|
className={merge(
|
|
41
41
|
config?.classes?.content ??
|
|
42
|
-
"z-50 max-w-[calc(100vw-2rem)] overflow-hidden rounded-lg bg-overlay px-2.5 py-1.5 text-xs text-overlay-foreground smooth-shadow-ring-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[var(--radix-popper-transform-origin)]",
|
|
42
|
+
"relative z-50 max-w-[calc(100vw-2rem)] overflow-hidden rounded-lg bg-overlay px-2.5 py-1.5 text-xs text-overlay-foreground smooth-shadow-ring-md after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] after:shadow-[inset_1.5px_1.5px_1px_-1px_rgb(255_255_255/0.5)] dark:after:shadow-[inset_1.5px_1.5px_1px_-1px_rgb(255_255_255/0.12)] animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[var(--radix-popper-transform-origin)]",
|
|
43
43
|
className,
|
|
44
44
|
)}
|
|
45
45
|
{...props}
|
|
@@ -37,6 +37,47 @@
|
|
|
37
37
|
border-radius: 48px;
|
|
38
38
|
background: var(--tabs-bar-bg);
|
|
39
39
|
}
|
|
40
|
+
/* The sliding pill is a thin frosted glass lens: translucent fill, rim, top-left highlight, streak. */
|
|
41
|
+
.t-tabs--segmented .t-tabs-pill {
|
|
42
|
+
background: color-mix(in srgb, var(--tabs-pill-bg) 55%, transparent);
|
|
43
|
+
backdrop-filter: blur(0.8px) saturate(1.24);
|
|
44
|
+
box-shadow:
|
|
45
|
+
inset 0 0 0 0.75px rgb(255 255 255 / 0.9),
|
|
46
|
+
inset 0 0 0 1.75px rgb(0 0 0 / 0.06),
|
|
47
|
+
inset 1.5px 1.5px 1px -1px white,
|
|
48
|
+
inset -1.5px -1.5px 1px -1px rgb(255 255 255 / 0.6),
|
|
49
|
+
0 3px 8px rgb(0 0 0 / 0.12),
|
|
50
|
+
0 1px 2px rgb(0 0 0 / 0.14);
|
|
51
|
+
}
|
|
52
|
+
.t-tabs--segmented .t-tabs-pill::after {
|
|
53
|
+
content: "";
|
|
54
|
+
position: absolute;
|
|
55
|
+
inset: 2px 10px auto;
|
|
56
|
+
height: 4px;
|
|
57
|
+
border-radius: 48px;
|
|
58
|
+
background: rgb(255 255 255 / 0.4);
|
|
59
|
+
}
|
|
60
|
+
.dark .t-tabs--segmented .t-tabs-pill,
|
|
61
|
+
[data-theme="dark"] .t-tabs--segmented .t-tabs-pill {
|
|
62
|
+
background: rgb(255 255 255 / 0.16);
|
|
63
|
+
box-shadow:
|
|
64
|
+
inset 0 0 0 0.75px rgb(255 255 255 / 0.1),
|
|
65
|
+
inset 1.5px 1.5px 1px -1px rgb(255 255 255 / 0.45),
|
|
66
|
+
inset -1.5px -1.5px 1px -1px rgb(255 255 255 / 0.15),
|
|
67
|
+
0 3px 8px rgb(0 0 0 / 0.35);
|
|
68
|
+
}
|
|
69
|
+
.dark .t-tabs--segmented .t-tabs-pill::after,
|
|
70
|
+
[data-theme="dark"] .t-tabs--segmented .t-tabs-pill::after {
|
|
71
|
+
background: rgb(255 255 255 / 0.12);
|
|
72
|
+
}
|
|
73
|
+
.dark.neutral .t-tabs--segmented .t-tabs-pill {
|
|
74
|
+
background: rgb(255 255 255 / 0.14);
|
|
75
|
+
box-shadow:
|
|
76
|
+
inset 0 0 0 0.75px rgb(255 255 255 / 0.1),
|
|
77
|
+
inset 1.5px 1.5px 1px -1px rgb(255 255 255 / 0.4),
|
|
78
|
+
inset -1.5px -1.5px 1px -1px rgb(255 255 255 / 0.12),
|
|
79
|
+
0 3px 8px rgb(0 0 0 / 0.22);
|
|
80
|
+
}
|
|
40
81
|
/* Isolated pills. Each tab owns its outline; the selected tab is filled. */
|
|
41
82
|
.t-tabs--pills {
|
|
42
83
|
gap: 6px;
|