@alpic-ai/ui 1.115.2 → 1.116.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/dist/components/alert.d.mts +1 -1
- package/dist/components/avatar.d.mts +1 -1
- package/dist/components/button.d.mts +4 -2
- package/dist/components/button.mjs +17 -3
- package/dist/components/dropdown-menu.d.mts +1 -1
- package/dist/components/sidebar.mjs +4 -4
- package/dist/components/tabs.d.mts +2 -2
- package/package.json +6 -6
- package/src/components/button.tsx +10 -0
- package/src/components/combobox.tsx +18 -6
- package/src/components/sidebar.tsx +4 -4
- package/src/hooks/use-copy-to-clipboard.ts +6 -2
- package/src/stories/button.stories.tsx +23 -1
- package/src/styles/tokens.css +173 -0
|
@@ -5,7 +5,7 @@ import * as _$class_variance_authority_types0 from "class-variance-authority/typ
|
|
|
5
5
|
|
|
6
6
|
//#region src/components/alert.d.ts
|
|
7
7
|
declare const alertVariants: (props?: ({
|
|
8
|
-
variant?: "success" | "warning" | "
|
|
8
|
+
variant?: "success" | "warning" | "default" | "destructive" | null | undefined;
|
|
9
9
|
} & _$class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
10
10
|
interface AlertProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof alertVariants> {}
|
|
11
11
|
declare function Alert({
|
|
@@ -6,7 +6,7 @@ import * as _$class_variance_authority_types0 from "class-variance-authority/typ
|
|
|
6
6
|
|
|
7
7
|
//#region src/components/avatar.d.ts
|
|
8
8
|
declare const avatarVariants: (props?: ({
|
|
9
|
-
size?: "sm" | "md" | "
|
|
9
|
+
size?: "sm" | "md" | "xs" | "lg" | "xl" | null | undefined;
|
|
10
10
|
} & _$class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
11
11
|
type AvatarSize = NonNullable<VariantProps<typeof avatarVariants>["size"]>;
|
|
12
12
|
type AvatarStatus = "online";
|
|
@@ -5,13 +5,14 @@ import * as _$class_variance_authority_types0 from "class-variance-authority/typ
|
|
|
5
5
|
|
|
6
6
|
//#region src/components/button.d.ts
|
|
7
7
|
declare const buttonVariants: (props?: ({
|
|
8
|
-
variant?: "secondary" | "primary" | "
|
|
9
|
-
size?: "default" | "
|
|
8
|
+
variant?: "secondary" | "primary" | "tertiary" | "link" | "link-muted" | "destructive" | "cta" | null | undefined;
|
|
9
|
+
size?: "default" | "pill" | "icon" | "icon-rounded" | null | undefined;
|
|
10
10
|
} & _$class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
11
11
|
interface ButtonProps extends React.ComponentProps<"button">, VariantProps<typeof buttonVariants> {
|
|
12
12
|
asChild?: boolean;
|
|
13
13
|
loading?: boolean;
|
|
14
14
|
icon?: React.ReactNode;
|
|
15
|
+
iconTrailing?: React.ReactNode;
|
|
15
16
|
}
|
|
16
17
|
declare function Button({
|
|
17
18
|
className,
|
|
@@ -21,6 +22,7 @@ declare function Button({
|
|
|
21
22
|
asChild,
|
|
22
23
|
loading,
|
|
23
24
|
icon,
|
|
25
|
+
iconTrailing,
|
|
24
26
|
disabled,
|
|
25
27
|
children,
|
|
26
28
|
...props
|
|
@@ -35,7 +35,14 @@ const buttonVariants = cva([
|
|
|
35
35
|
"[@media(hover:hover)]:hover:underline",
|
|
36
36
|
"focus-visible:bg-background"
|
|
37
37
|
].join(" "),
|
|
38
|
-
destructive: ["bg-destructive text-destructive-foreground", "[@media(hover:hover)]:hover:bg-destructive-hover"].join(" ")
|
|
38
|
+
destructive: ["bg-destructive text-destructive-foreground", "[@media(hover:hover)]:hover:bg-destructive-hover"].join(" "),
|
|
39
|
+
cta: [
|
|
40
|
+
"button-cta",
|
|
41
|
+
"h-9 px-4 gap-2 rounded-md",
|
|
42
|
+
"dark:bg-inverted text-foreground",
|
|
43
|
+
"transition-[transform,filter] duration-300 ease-out",
|
|
44
|
+
"active:scale-[0.99]"
|
|
45
|
+
].join(" ")
|
|
39
46
|
},
|
|
40
47
|
size: {
|
|
41
48
|
default: "type-text-sm",
|
|
@@ -49,7 +56,7 @@ const buttonVariants = cva([
|
|
|
49
56
|
size: "default"
|
|
50
57
|
}
|
|
51
58
|
});
|
|
52
|
-
function Button({ className, variant, size, type = "button", asChild = false, loading = false, icon, disabled, children, ...props }) {
|
|
59
|
+
function Button({ className, variant, size, type = "button", asChild = false, loading = false, icon, iconTrailing, disabled, children, ...props }) {
|
|
53
60
|
return /* @__PURE__ */ jsxs(asChild ? Slot : "button", {
|
|
54
61
|
"data-slot": "button",
|
|
55
62
|
className: cn(buttonVariants({
|
|
@@ -60,7 +67,14 @@ function Button({ className, variant, size, type = "button", asChild = false, lo
|
|
|
60
67
|
disabled: disabled || loading,
|
|
61
68
|
"aria-busy": loading || void 0,
|
|
62
69
|
...props,
|
|
63
|
-
children: [
|
|
70
|
+
children: [
|
|
71
|
+
loading ? /* @__PURE__ */ jsx(Loader2, { className: "motion-safe:animate-spin" }) : icon,
|
|
72
|
+
asChild ? /* @__PURE__ */ jsx(Slottable, { children }) : children,
|
|
73
|
+
!loading && iconTrailing ? /* @__PURE__ */ jsx("span", {
|
|
74
|
+
"data-cta-icon-trailing": true,
|
|
75
|
+
children: iconTrailing
|
|
76
|
+
}) : null
|
|
77
|
+
]
|
|
64
78
|
});
|
|
65
79
|
}
|
|
66
80
|
//#endregion
|
|
@@ -23,7 +23,7 @@ declare function DropdownMenuGroup({
|
|
|
23
23
|
...props
|
|
24
24
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.Group>): _$react_jsx_runtime0.JSX.Element;
|
|
25
25
|
declare const dropdownMenuItemVariants: (props?: ({
|
|
26
|
-
variant?: "
|
|
26
|
+
variant?: "default" | "destructive" | null | undefined;
|
|
27
27
|
} & _$class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
28
28
|
declare function DropdownMenuItem({
|
|
29
29
|
className,
|
|
@@ -105,7 +105,7 @@ function Sidebar({ side = "left", variant = "sidebar", collapsible = "offcanvas"
|
|
|
105
105
|
}
|
|
106
106
|
if (collapsible === "none") return /* @__PURE__ */ jsx("div", {
|
|
107
107
|
"data-slot": "sidebar",
|
|
108
|
-
className: cn("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col", className),
|
|
108
|
+
className: cn("bg-sidebar-surface text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col", className),
|
|
109
109
|
...props,
|
|
110
110
|
children
|
|
111
111
|
});
|
|
@@ -117,7 +117,7 @@ function Sidebar({ side = "left", variant = "sidebar", collapsible = "offcanvas"
|
|
|
117
117
|
"data-sidebar": "sidebar",
|
|
118
118
|
"data-slot": "sidebar",
|
|
119
119
|
"data-mobile": "true",
|
|
120
|
-
className: "bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",
|
|
120
|
+
className: "bg-sidebar-surface text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",
|
|
121
121
|
style: { "--sidebar-width": SIDEBAR_WIDTH_MOBILE },
|
|
122
122
|
side,
|
|
123
123
|
children: [/* @__PURE__ */ jsxs(SheetHeader, {
|
|
@@ -141,12 +141,12 @@ function Sidebar({ side = "left", variant = "sidebar", collapsible = "offcanvas"
|
|
|
141
141
|
className: cn("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-out", "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)")
|
|
142
142
|
}), /* @__PURE__ */ jsx("div", {
|
|
143
143
|
"data-slot": "sidebar-container",
|
|
144
|
-
className: cn("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-out 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) group-data-[side=left]:border-r group-data-[side=right]:border-l", className),
|
|
144
|
+
className: cn("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-out 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)]" : "border-sidebar-border group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l", className),
|
|
145
145
|
...props,
|
|
146
146
|
children: /* @__PURE__ */ jsx("div", {
|
|
147
147
|
"data-sidebar": "sidebar",
|
|
148
148
|
"data-slot": "sidebar-inner",
|
|
149
|
-
className: "bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full cursor-pointer flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",
|
|
149
|
+
className: "bg-sidebar-surface group-data-[variant=floating]:border-sidebar-border flex h-full w-full cursor-pointer flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",
|
|
150
150
|
onClickCapture: handleSurfaceClickCapture,
|
|
151
151
|
children
|
|
152
152
|
})
|
|
@@ -6,7 +6,7 @@ import * as _$class_variance_authority_types0 from "class-variance-authority/typ
|
|
|
6
6
|
|
|
7
7
|
//#region src/components/tabs.d.ts
|
|
8
8
|
declare const tabsTriggerVariants: (props?: ({
|
|
9
|
-
variant?: "
|
|
9
|
+
variant?: "default" | "line" | "pill" | null | undefined;
|
|
10
10
|
} & _$class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
11
11
|
declare function Tabs({
|
|
12
12
|
className,
|
|
@@ -14,7 +14,7 @@ declare function Tabs({
|
|
|
14
14
|
...props
|
|
15
15
|
}: React.ComponentProps<typeof TabsPrimitive.Root>): _$react_jsx_runtime0.JSX.Element;
|
|
16
16
|
declare const tabsListVariants: (props?: ({
|
|
17
|
-
variant?: "
|
|
17
|
+
variant?: "default" | "line" | null | undefined;
|
|
18
18
|
} & _$class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
19
19
|
declare function TabsList({
|
|
20
20
|
className,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alpic-ai/ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.116.0",
|
|
4
4
|
"description": "Alpic design system — shared UI components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"lucide-react": "^1.8.0",
|
|
27
27
|
"react": "^19.2.5",
|
|
28
28
|
"react-dom": "^19.2.5",
|
|
29
|
-
"react-hook-form": "^7.
|
|
29
|
+
"react-hook-form": "^7.73.1",
|
|
30
30
|
"sonner": "^2.0.7",
|
|
31
|
-
"tailwindcss": "^4.2.
|
|
31
|
+
"tailwindcss": "^4.2.3",
|
|
32
32
|
"tw-animate-css": "^1.4.0"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
@@ -56,14 +56,14 @@
|
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@ladle/react": "^5.1.1",
|
|
59
|
-
"@tailwindcss/postcss": "^4.2.
|
|
59
|
+
"@tailwindcss/postcss": "^4.2.3",
|
|
60
60
|
"@types/react": "19.2.14",
|
|
61
61
|
"@types/react-dom": "19.2.3",
|
|
62
62
|
"lucide-react": "^1.8.0",
|
|
63
|
-
"react-hook-form": "^7.
|
|
63
|
+
"react-hook-form": "^7.73.1",
|
|
64
64
|
"shx": "^0.4.0",
|
|
65
65
|
"sonner": "^2.0.7",
|
|
66
|
-
"tailwindcss": "^4.2.
|
|
66
|
+
"tailwindcss": "^4.2.3",
|
|
67
67
|
"tsdown": "^0.21.9",
|
|
68
68
|
"tw-animate-css": "^1.4.0",
|
|
69
69
|
"typescript": "^6.0.3"
|
|
@@ -46,6 +46,13 @@ const buttonVariants = cva(
|
|
|
46
46
|
"bg-destructive text-destructive-foreground",
|
|
47
47
|
"[@media(hover:hover)]:hover:bg-destructive-hover",
|
|
48
48
|
].join(" "),
|
|
49
|
+
cta: [
|
|
50
|
+
"button-cta",
|
|
51
|
+
"h-9 px-4 gap-2 rounded-md",
|
|
52
|
+
"dark:bg-inverted text-foreground",
|
|
53
|
+
"transition-[transform,filter] duration-300 ease-out",
|
|
54
|
+
"active:scale-[0.99]",
|
|
55
|
+
].join(" "),
|
|
49
56
|
},
|
|
50
57
|
size: {
|
|
51
58
|
default: "type-text-sm",
|
|
@@ -65,6 +72,7 @@ interface ButtonProps extends React.ComponentProps<"button">, VariantProps<typeo
|
|
|
65
72
|
asChild?: boolean;
|
|
66
73
|
loading?: boolean;
|
|
67
74
|
icon?: React.ReactNode;
|
|
75
|
+
iconTrailing?: React.ReactNode;
|
|
68
76
|
}
|
|
69
77
|
|
|
70
78
|
function Button({
|
|
@@ -75,6 +83,7 @@ function Button({
|
|
|
75
83
|
asChild = false,
|
|
76
84
|
loading = false,
|
|
77
85
|
icon,
|
|
86
|
+
iconTrailing,
|
|
78
87
|
disabled,
|
|
79
88
|
children,
|
|
80
89
|
...props
|
|
@@ -92,6 +101,7 @@ function Button({
|
|
|
92
101
|
>
|
|
93
102
|
{loading ? <Loader2 className="motion-safe:animate-spin" /> : icon}
|
|
94
103
|
{asChild ? <Slottable>{children}</Slottable> : children}
|
|
104
|
+
{!loading && iconTrailing ? <span data-cta-icon-trailing>{iconTrailing}</span> : null}
|
|
95
105
|
</Comp>
|
|
96
106
|
);
|
|
97
107
|
}
|
|
@@ -84,7 +84,9 @@ function Combobox(props: ComboboxProps) {
|
|
|
84
84
|
|
|
85
85
|
const onOpenChange = useCallback(
|
|
86
86
|
(newOpen: boolean) => {
|
|
87
|
-
if (!isOpenControlled)
|
|
87
|
+
if (!isOpenControlled) {
|
|
88
|
+
setUncontrolledOpen(newOpen);
|
|
89
|
+
}
|
|
88
90
|
controlledOnOpenChange?.(newOpen);
|
|
89
91
|
},
|
|
90
92
|
[isOpenControlled, controlledOnOpenChange],
|
|
@@ -105,7 +107,9 @@ function Combobox(props: ComboboxProps) {
|
|
|
105
107
|
|
|
106
108
|
const isSelected = useCallback(
|
|
107
109
|
(itemValue: string) => {
|
|
108
|
-
if (multiple)
|
|
110
|
+
if (multiple) {
|
|
111
|
+
return multiValues.includes(itemValue);
|
|
112
|
+
}
|
|
109
113
|
return singleValue === itemValue;
|
|
110
114
|
},
|
|
111
115
|
[multiple, singleValue, multiValues],
|
|
@@ -123,11 +127,15 @@ function Combobox(props: ComboboxProps) {
|
|
|
123
127
|
const next = multiValues.includes(itemValue)
|
|
124
128
|
? multiValues.filter((val) => val !== itemValue)
|
|
125
129
|
: [...multiValues, itemValue];
|
|
126
|
-
if (!isControlledMulti)
|
|
130
|
+
if (!isControlledMulti) {
|
|
131
|
+
setUncontrolledMultiValue(next);
|
|
132
|
+
}
|
|
127
133
|
onValueChangeMulti?.(next);
|
|
128
134
|
// Stay open in multi mode
|
|
129
135
|
} else {
|
|
130
|
-
if (!isControlledSingle)
|
|
136
|
+
if (!isControlledSingle) {
|
|
137
|
+
setUncontrolledSingleValue(itemValue);
|
|
138
|
+
}
|
|
131
139
|
onValueChangeSingle?.(itemValue);
|
|
132
140
|
onOpenChange(false);
|
|
133
141
|
}
|
|
@@ -145,9 +153,13 @@ function Combobox(props: ComboboxProps) {
|
|
|
145
153
|
|
|
146
154
|
const onDeselect = useCallback(
|
|
147
155
|
(itemValue: string) => {
|
|
148
|
-
if (!multiple)
|
|
156
|
+
if (!multiple) {
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
149
159
|
const next = multiValues.filter((val) => val !== itemValue);
|
|
150
|
-
if (!isControlledMulti)
|
|
160
|
+
if (!isControlledMulti) {
|
|
161
|
+
setUncontrolledMultiValue(next);
|
|
162
|
+
}
|
|
151
163
|
onValueChangeMulti?.(next);
|
|
152
164
|
},
|
|
153
165
|
[multiple, isControlledMulti, onValueChangeMulti, multiValues],
|
|
@@ -179,7 +179,7 @@ function Sidebar({
|
|
|
179
179
|
return (
|
|
180
180
|
<div
|
|
181
181
|
data-slot="sidebar"
|
|
182
|
-
className={cn("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col", className)}
|
|
182
|
+
className={cn("bg-sidebar-surface text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col", className)}
|
|
183
183
|
{...props}
|
|
184
184
|
>
|
|
185
185
|
{children}
|
|
@@ -194,7 +194,7 @@ function Sidebar({
|
|
|
194
194
|
data-sidebar="sidebar"
|
|
195
195
|
data-slot="sidebar"
|
|
196
196
|
data-mobile="true"
|
|
197
|
-
className="bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden"
|
|
197
|
+
className="bg-sidebar-surface text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden"
|
|
198
198
|
style={
|
|
199
199
|
{
|
|
200
200
|
"--sidebar-width": SIDEBAR_WIDTH_MOBILE,
|
|
@@ -243,7 +243,7 @@ function Sidebar({
|
|
|
243
243
|
// Adjust the padding for floating and inset variants.
|
|
244
244
|
variant === "floating" || variant === "inset"
|
|
245
245
|
? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]"
|
|
246
|
-
: "group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",
|
|
246
|
+
: "border-sidebar-border group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",
|
|
247
247
|
className,
|
|
248
248
|
)}
|
|
249
249
|
{...props}
|
|
@@ -251,7 +251,7 @@ function Sidebar({
|
|
|
251
251
|
<div
|
|
252
252
|
data-sidebar="sidebar"
|
|
253
253
|
data-slot="sidebar-inner"
|
|
254
|
-
className="bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full cursor-pointer flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm"
|
|
254
|
+
className="bg-sidebar-surface group-data-[variant=floating]:border-sidebar-border flex h-full w-full cursor-pointer flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm"
|
|
255
255
|
onClickCapture={handleSurfaceClickCapture}
|
|
256
256
|
>
|
|
257
257
|
{children}
|
|
@@ -8,7 +8,9 @@ export function useCopyToClipboard({ resetDelay = 2000 }: { resetDelay?: number
|
|
|
8
8
|
|
|
9
9
|
useEffect(() => {
|
|
10
10
|
return () => {
|
|
11
|
-
if (timeoutRef.current)
|
|
11
|
+
if (timeoutRef.current) {
|
|
12
|
+
clearTimeout(timeoutRef.current);
|
|
13
|
+
}
|
|
12
14
|
};
|
|
13
15
|
}, []);
|
|
14
16
|
|
|
@@ -16,7 +18,9 @@ export function useCopyToClipboard({ resetDelay = 2000 }: { resetDelay?: number
|
|
|
16
18
|
(text: string) => {
|
|
17
19
|
navigator.clipboard.writeText(text).then(() => {
|
|
18
20
|
setIsCopied(true);
|
|
19
|
-
if (timeoutRef.current)
|
|
21
|
+
if (timeoutRef.current) {
|
|
22
|
+
clearTimeout(timeoutRef.current);
|
|
23
|
+
}
|
|
20
24
|
timeoutRef.current = setTimeout(() => setIsCopied(false), resetDelay);
|
|
21
25
|
});
|
|
22
26
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Plus } from "lucide-react";
|
|
1
|
+
import { ArrowRight, Plus, Sparkles } from "lucide-react";
|
|
2
2
|
|
|
3
3
|
import { Button } from "../components/button";
|
|
4
4
|
|
|
@@ -323,6 +323,28 @@ export const AllVariants = () => {
|
|
|
323
323
|
</Button>
|
|
324
324
|
</div>
|
|
325
325
|
|
|
326
|
+
{/* ── CTA (animated gradient ring) ────────────────────────────────── */}
|
|
327
|
+
<span className={SECTION_HEADER}>CTA — animated</span>
|
|
328
|
+
<p className="type-text-xs text-muted-foreground -mt-2 max-w-md">
|
|
329
|
+
Hover to rotate the conic gradient around the border and ignite the soft halo.
|
|
330
|
+
</p>
|
|
331
|
+
|
|
332
|
+
<div className="flex items-center gap-6">
|
|
333
|
+
<Button variant="cta" iconTrailing={<ArrowRight />}>
|
|
334
|
+
Get started
|
|
335
|
+
</Button>
|
|
336
|
+
<Button variant="cta" icon={<Sparkles />} iconTrailing={<ArrowRight />}>
|
|
337
|
+
Launch server
|
|
338
|
+
</Button>
|
|
339
|
+
<Button variant="cta">Deploy now</Button>
|
|
340
|
+
<Button variant="cta" iconTrailing={<ArrowRight />} disabled>
|
|
341
|
+
Disabled
|
|
342
|
+
</Button>
|
|
343
|
+
<Button variant="cta" iconTrailing={<ArrowRight />} loading>
|
|
344
|
+
Deploying
|
|
345
|
+
</Button>
|
|
346
|
+
</div>
|
|
347
|
+
|
|
326
348
|
{/* ── asChild ─────────────────────────────────────────────────────── */}
|
|
327
349
|
<span className={SECTION_HEADER}>asChild</span>
|
|
328
350
|
|
package/src/styles/tokens.css
CHANGED
|
@@ -39,6 +39,9 @@
|
|
|
39
39
|
|
|
40
40
|
--color-ring: #f22b79; /* Figma: focus-ring */
|
|
41
41
|
|
|
42
|
+
/* cta — decorative gradient accent, used with --color-primary in the CTA button ring */
|
|
43
|
+
--color-cta-accent: #6eece7; /* Figma: CTA border accent (cyan) */
|
|
44
|
+
|
|
42
45
|
/* sidebar */
|
|
43
46
|
--color-sidebar: #f8fafa; /* Figma: bg-secondary-subtle */
|
|
44
47
|
--color-sidebar-foreground: #3a4848; /* Figma: fg-secondary */
|
|
@@ -154,6 +157,160 @@
|
|
|
154
157
|
}
|
|
155
158
|
}
|
|
156
159
|
|
|
160
|
+
/* ─── CTA button — animated conic gradient ring ───────────────────────────── */
|
|
161
|
+
|
|
162
|
+
@property --cta-angle {
|
|
163
|
+
syntax: "<angle>";
|
|
164
|
+
inherits: false;
|
|
165
|
+
initial-value: 135deg;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
@keyframes cta-rotate {
|
|
169
|
+
to {
|
|
170
|
+
--cta-angle: 495deg;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.button-cta {
|
|
175
|
+
position: relative;
|
|
176
|
+
isolation: isolate;
|
|
177
|
+
/* light mode: whisper-of-gradient surface tint + soft rose drop-shadow */
|
|
178
|
+
background-image: linear-gradient(
|
|
179
|
+
135deg,
|
|
180
|
+
color-mix(in oklab, var(--color-primary) 5%, transparent) 0%,
|
|
181
|
+
color-mix(in oklab, var(--color-cta-accent) 5%, transparent) 100%
|
|
182
|
+
);
|
|
183
|
+
box-shadow:
|
|
184
|
+
0 6px 24px -10px color-mix(in oklab, var(--color-primary) 38%, transparent),
|
|
185
|
+
0 2px 6px -4px color-mix(in oklab, var(--color-cta-accent) 30%, transparent);
|
|
186
|
+
transition:
|
|
187
|
+
box-shadow 400ms ease,
|
|
188
|
+
transform 300ms ease,
|
|
189
|
+
filter 300ms ease;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
@media (hover: hover) {
|
|
193
|
+
.button-cta:hover {
|
|
194
|
+
box-shadow:
|
|
195
|
+
0 10px 30px -8px color-mix(in oklab, var(--color-primary) 52%, transparent),
|
|
196
|
+
0 3px 10px -3px color-mix(in oklab, var(--color-cta-accent) 40%, transparent);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/* dark mode: solid inverted surface, no tint or shadow — let the halo do the work */
|
|
201
|
+
.dark .button-cta {
|
|
202
|
+
background-image: none;
|
|
203
|
+
box-shadow: none;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.button-cta::before,
|
|
207
|
+
.button-cta::after {
|
|
208
|
+
content: "";
|
|
209
|
+
position: absolute;
|
|
210
|
+
inset: 0;
|
|
211
|
+
border-radius: inherit;
|
|
212
|
+
pointer-events: none;
|
|
213
|
+
/* Always "running" in browser terms, but paused at rest — freezes at current
|
|
214
|
+
angle on unhover instead of snapping back. */
|
|
215
|
+
animation: cta-rotate 3.2s linear infinite;
|
|
216
|
+
animation-play-state: paused;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/* Gradient ring (masked so only the border shows) */
|
|
220
|
+
.button-cta::before {
|
|
221
|
+
padding: 1.5px;
|
|
222
|
+
background: conic-gradient(
|
|
223
|
+
from var(--cta-angle),
|
|
224
|
+
var(--color-cta-accent) 0deg,
|
|
225
|
+
var(--color-primary) 150deg,
|
|
226
|
+
var(--color-cta-accent) 300deg,
|
|
227
|
+
var(--color-cta-accent) 360deg
|
|
228
|
+
);
|
|
229
|
+
-webkit-mask:
|
|
230
|
+
linear-gradient(#000 0 0) content-box,
|
|
231
|
+
linear-gradient(#000 0 0);
|
|
232
|
+
-webkit-mask-composite: xor;
|
|
233
|
+
mask-composite: exclude;
|
|
234
|
+
transition: filter 400ms ease;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/* Blurred glow halo behind the button — subtle in light, bolder in dark */
|
|
238
|
+
.button-cta::after {
|
|
239
|
+
z-index: -1;
|
|
240
|
+
background: conic-gradient(
|
|
241
|
+
from var(--cta-angle),
|
|
242
|
+
var(--color-cta-accent) 0deg,
|
|
243
|
+
var(--color-primary) 150deg,
|
|
244
|
+
var(--color-cta-accent) 300deg,
|
|
245
|
+
var(--color-cta-accent) 360deg
|
|
246
|
+
);
|
|
247
|
+
filter: blur(12px);
|
|
248
|
+
opacity: 0.05;
|
|
249
|
+
transition: opacity 400ms ease;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.dark .button-cta::after {
|
|
253
|
+
opacity: 0.14;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
@media (hover: hover) {
|
|
257
|
+
.button-cta:hover::before,
|
|
258
|
+
.button-cta:hover::after {
|
|
259
|
+
animation-play-state: running;
|
|
260
|
+
}
|
|
261
|
+
.button-cta:hover::before {
|
|
262
|
+
filter: saturate(1.15) brightness(1.05);
|
|
263
|
+
}
|
|
264
|
+
.button-cta:hover::after {
|
|
265
|
+
opacity: 0.18;
|
|
266
|
+
}
|
|
267
|
+
.dark .button-cta:hover::after {
|
|
268
|
+
opacity: 0.32;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
.button-cta:focus-visible::before,
|
|
273
|
+
.button-cta:focus-visible::after {
|
|
274
|
+
animation-play-state: running;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.button-cta:disabled::before,
|
|
278
|
+
.button-cta:disabled::after,
|
|
279
|
+
[aria-busy="true"].button-cta::before,
|
|
280
|
+
[aria-busy="true"].button-cta::after {
|
|
281
|
+
animation-play-state: paused;
|
|
282
|
+
}
|
|
283
|
+
.button-cta:disabled::after {
|
|
284
|
+
opacity: 0;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
@media (prefers-reduced-motion: reduce) {
|
|
288
|
+
.button-cta::before,
|
|
289
|
+
.button-cta::after {
|
|
290
|
+
animation: none;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
/* Icon slide on hover (applied to [data-cta-icon-trailing]) */
|
|
295
|
+
.button-cta [data-cta-icon-trailing] {
|
|
296
|
+
transition: transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
@media (hover: hover) {
|
|
300
|
+
.button-cta:hover [data-cta-icon-trailing] {
|
|
301
|
+
transform: translateX(2px);
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
@media (prefers-reduced-motion: reduce) {
|
|
306
|
+
.button-cta [data-cta-icon-trailing] {
|
|
307
|
+
transition: none;
|
|
308
|
+
}
|
|
309
|
+
.button-cta:hover [data-cta-icon-trailing] {
|
|
310
|
+
transform: none;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
157
314
|
/* ─── Dark mode ───────────────────────────────────────────────────────────── */
|
|
158
315
|
|
|
159
316
|
.dark {
|
|
@@ -191,6 +348,9 @@
|
|
|
191
348
|
|
|
192
349
|
--color-ring: #f22b79; /* Figma: focus-ring */
|
|
193
350
|
|
|
351
|
+
/* cta — decorative gradient accent, used with --color-primary in the CTA button ring */
|
|
352
|
+
--color-cta-accent: #6eece7; /* Figma: CTA border accent (cyan) */
|
|
353
|
+
|
|
194
354
|
/* sidebar */
|
|
195
355
|
--color-sidebar: #0c1c1c; /* Figma: bg-secondary */
|
|
196
356
|
--color-sidebar-foreground: #90a4a4; /* Figma: fg-secondary */
|
|
@@ -249,6 +409,14 @@
|
|
|
249
409
|
|
|
250
410
|
@custom-variant dark (&:where(.dark, .dark *));
|
|
251
411
|
|
|
412
|
+
:root {
|
|
413
|
+
--gradient-sidebar: linear-gradient(0deg, #c9e2e280 0%, #ffffff 70%); /* Figma: bg-nav-gradiant-light */
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
.dark {
|
|
417
|
+
--gradient-sidebar: linear-gradient(0deg, #213535 0%, #121e1e 70%); /* Figma: bg-nav-gradiant-dark */
|
|
418
|
+
}
|
|
419
|
+
|
|
252
420
|
@layer base {
|
|
253
421
|
* {
|
|
254
422
|
@apply border-border shadow-shadow;
|
|
@@ -302,6 +470,11 @@
|
|
|
302
470
|
|
|
303
471
|
/* ─── Type preset utilities ───────────────────────────────────────────────── */
|
|
304
472
|
|
|
473
|
+
@utility bg-sidebar-surface {
|
|
474
|
+
background-color: var(--color-background);
|
|
475
|
+
background-image: var(--gradient-sidebar);
|
|
476
|
+
}
|
|
477
|
+
|
|
305
478
|
@utility type-display-2xl {
|
|
306
479
|
font-family: var(--font-display);
|
|
307
480
|
font-size: var(--font-size-display-2xl);
|