@elizaos/ui 2.0.0-alpha.81 → 2.0.0-alpha.83

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.
@@ -6,11 +6,11 @@ import { cn } from "../../lib/utils";
6
6
  const buttonVariants = cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-bg transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 cursor-pointer [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", {
7
7
  variants: {
8
8
  variant: {
9
- default: "bg-primary text-[var(--primary-foreground,#1a1f26)] border border-transparent hover:border-[var(--accent-hover,#d8a108)] hover:shadow-[0_0_0_1px_var(--accent-hover,#d8a108)]",
9
+ default: "bg-accent/15 text-txt border border-accent/40 hover:bg-accent/25 hover:border-accent/60",
10
10
  destructive: "bg-destructive text-destructive-fg border border-transparent hover:border-destructive/70 hover:shadow-[0_0_0_1px_rgba(239,68,68,0.3)]",
11
- outline: "border border-input bg-bg hover:border-[var(--accent,#f0b90b)] hover:shadow-[0_0_0_1px_var(--accent,#f0b90b)]",
12
- secondary: "bg-secondary text-secondary-fg border border-transparent hover:border-secondary/70",
13
- ghost: "hover:bg-bg-accent hover:text-accent-fg",
11
+ outline: "border border-border bg-card hover:border-border-strong hover:bg-bg-hover",
12
+ secondary: "bg-bg-accent text-txt border border-border hover:border-border-strong hover:bg-bg-hover",
13
+ ghost: "hover:bg-bg-accent hover:text-txt",
14
14
  link: "text-primary underline-offset-4 hover:underline",
15
15
  },
16
16
  size: {
@@ -29,7 +29,7 @@ const Button = React.forwardRef(({ className, variant, size, asChild = false, st
29
29
  const Comp = asChild ? Slot : "button";
30
30
  const isDefault = variant === "default" || variant === undefined;
31
31
  const resolvedStyle = isDefault && !style?.color
32
- ? { ...style, color: "var(--primary-foreground, #1a1f26)" }
32
+ ? { ...style, color: "var(--primary-foreground)" }
33
33
  : style;
34
34
  return (_jsx(Comp, { className: cn(buttonVariants({ variant, size, className })), ref: ref, style: resolvedStyle, ...props }));
35
35
  });
@@ -9,7 +9,7 @@ const DialogPortal = DialogPrimitive.Portal;
9
9
  const DialogClose = DialogPrimitive.Close;
10
10
  const DialogOverlay = React.forwardRef(({ className, ...props }, ref) => (_jsx(DialogPrimitive.Overlay, { ref: ref, className: cn("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", className), ...props })));
11
11
  DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
12
- const DialogContent = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(DialogPortal, { children: [_jsx(DialogOverlay, {}), _jsxs(DialogPrimitive.Content, { ref: ref, className: cn("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-bg p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg", className), ...props, children: [children, _jsxs(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-bg transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted", children: [_jsx(X, { className: "h-4 w-4" }), _jsx("span", { className: "sr-only", children: "Close" })] })] })] })));
12
+ const DialogContent = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(DialogPortal, { children: [_jsx(DialogOverlay, {}), _jsxs(DialogPrimitive.Content, { ref: ref, className: cn("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-bg p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg", className), ...props, children: [children, _jsxs(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-bg transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-accent-fg", children: [_jsx(X, { className: "h-4 w-4" }), _jsx("span", { className: "sr-only", children: "Close" })] })] })] })));
13
13
  DialogContent.displayName = DialogPrimitive.Content.displayName;
14
14
  const DialogHeader = ({ className, ...props }) => (_jsx("div", { className: cn("flex flex-col space-y-1.5 text-center sm:text-left", className), ...props }));
15
15
  DialogHeader.displayName = "DialogHeader";
@@ -9,7 +9,7 @@ const DropdownMenuGroup = DropdownMenuPrimitive.Group;
9
9
  const DropdownMenuPortal = DropdownMenuPrimitive.Portal;
10
10
  const DropdownMenuSub = DropdownMenuPrimitive.Sub;
11
11
  const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
12
- const DropdownMenuSubTrigger = React.forwardRef(({ className, inset, children, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.SubTrigger, { ref: ref, className: cn("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent", inset && "pl-8", className), ...props, children: [children, _jsx(ChevronRight, { className: "ml-auto h-4 w-4" })] })));
12
+ const DropdownMenuSubTrigger = React.forwardRef(({ className, inset, children, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.SubTrigger, { ref: ref, className: cn("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-fg data-[state=open]:bg-accent data-[state=open]:text-accent-fg", inset && "pl-8", className), ...props, children: [children, _jsx(ChevronRight, { className: "ml-auto h-4 w-4" })] })));
13
13
  DropdownMenuSubTrigger.displayName =
14
14
  DropdownMenuPrimitive.SubTrigger.displayName;
15
15
  const DropdownMenuSubContent = React.forwardRef(({ className, ...props }, ref) => (_jsx(DropdownMenuPrimitive.SubContent, { ref: ref, className: cn("z-50 min-w-[8rem] overflow-hidden rounded-md border border-border bg-card p-1 text-txt shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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", className), ...props })));
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
3
  import { cn } from "../../lib/utils";
4
- const Skeleton = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("animate-pulse rounded-md bg-secondary", className), ...props })));
4
+ const Skeleton = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("animate-pulse rounded-md bg-bg-accent", className), ...props })));
5
5
  Skeleton.displayName = "Skeleton";
6
6
  /* ── Skeleton Variants ───────────────────────────────────────────────── */
7
7
  function SkeletonLine({ width = "100%", className = "", }) {
@@ -2,6 +2,6 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import * as SliderPrimitive from "@radix-ui/react-slider";
3
3
  import * as React from "react";
4
4
  import { cn } from "../../lib/utils";
5
- const Slider = React.forwardRef(({ className, ...props }, ref) => (_jsxs(SliderPrimitive.Root, { ref: ref, className: cn("relative flex w-full touch-none select-none items-center", className), ...props, children: [_jsx(SliderPrimitive.Track, { className: "relative h-2 w-full grow overflow-hidden rounded-full bg-secondary", children: _jsx(SliderPrimitive.Range, { className: "absolute h-full bg-primary" }) }), _jsx(SliderPrimitive.Thumb, { className: "block h-5 w-5 rounded-full border-2 border-primary bg-bg ring-offset-bg transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50" })] })));
5
+ const Slider = React.forwardRef(({ className, ...props }, ref) => (_jsxs(SliderPrimitive.Root, { ref: ref, className: cn("relative flex w-full touch-none select-none items-center", className), ...props, children: [_jsx(SliderPrimitive.Track, { className: "relative h-2 w-full grow overflow-hidden rounded-full bg-input", children: _jsx(SliderPrimitive.Range, { className: "absolute h-full bg-primary" }) }), _jsx(SliderPrimitive.Thumb, { className: "block h-5 w-5 rounded-full border-2 border-primary bg-bg ring-offset-bg transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50" })] })));
6
6
  Slider.displayName = SliderPrimitive.Root.displayName;
7
7
  export { Slider };
@@ -8,7 +8,7 @@ const Toaster = ({ ...props }) => {
8
8
  toast: "group toast group-[.toaster]:bg-bg group-[.toaster]:text-txt group-[.toaster]:border-border group-[.toaster]:shadow-lg",
9
9
  description: "group-[.toast]:text-muted",
10
10
  actionButton: "group-[.toast]:bg-primary group-[.toast]:text-primary-fg",
11
- cancelButton: "group-[.toast]:bg-muted group-[.toast]:text-muted-fg",
11
+ cancelButton: "group-[.toast]:bg-bg-accent group-[.toast]:text-muted",
12
12
  },
13
13
  }, ...props }));
14
14
  };
@@ -3,7 +3,7 @@ import * as TabsPrimitive from "@radix-ui/react-tabs";
3
3
  import * as React from "react";
4
4
  import { cn } from "../../lib/utils";
5
5
  const Tabs = TabsPrimitive.Root;
6
- const TabsList = React.forwardRef(({ className, ...props }, ref) => (_jsx(TabsPrimitive.List, { ref: ref, className: cn("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-fg", className), ...props })));
6
+ const TabsList = React.forwardRef(({ className, ...props }, ref) => (_jsx(TabsPrimitive.List, { ref: ref, className: cn("inline-flex h-10 items-center justify-center rounded-md bg-bg-accent p-1 text-muted", className), ...props })));
7
7
  TabsList.displayName = TabsPrimitive.List.displayName;
8
8
  const TabsTrigger = React.forwardRef(({ className, ...props }, ref) => (_jsx(TabsPrimitive.Trigger, { ref: ref, className: cn("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-bg transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-bg data-[state=active]:text-txt data-[state=active]:shadow-sm", className), ...props })));
9
9
  TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
@@ -45,11 +45,11 @@ export function ThemedSelect({ value, groups, onChange, placeholder = "select...
45
45
  const menuStyle = menuPlacement === "top"
46
46
  ? { bottom: "calc(100% + 0.125rem)" }
47
47
  : { top: "calc(100% + 0.125rem)" };
48
- return (_jsxs("div", { ref: ref, className: `relative min-w-0 w-full ${open ? "z-[100]" : ""} ${className}`, children: [_jsxs(Button, { type: "button", variant: "outline", size: "sm", className: `flex h-12 w-full items-center justify-between border-border bg-card px-2.5 py-1.5 text-left text-xs shadow-sm hover:border-accent focus-visible:ring-1 focus-visible:ring-accent ${triggerClassName}`, onClick: () => setOpen(!open), children: [_jsx("span", { className: "truncate", children: currentLabel }), _jsx("span", { className: `ml-2 text-[10px] text-muted transition-transform ${open ? "rotate-180" : ""}`, children: "\u25BC" })] }), open && (_jsx("div", { className: `absolute left-0 right-0 z-50 max-h-[280px] overflow-y-auto rounded-md border border-border bg-card shadow-lg ${menuClassName}`, style: menuStyle, children: groups.map((g) => (_jsxs("div", { children: [_jsx("div", { className: "px-2.5 py-1 text-[10px] font-semibold text-muted bg-bg-muted sticky top-0", children: g.label }), g.items.map((item) => {
48
+ return (_jsxs("div", { ref: ref, className: `relative min-w-0 w-full ${open ? "z-[100]" : ""} ${className}`, children: [_jsxs(Button, { type: "button", variant: "outline", size: "sm", className: `flex h-12 w-full items-center justify-between border-border bg-card px-2.5 py-1.5 text-left text-xs shadow-sm hover:border-accent focus-visible:ring-1 focus-visible:ring-accent ${triggerClassName}`, onClick: () => setOpen(!open), children: [_jsx("span", { className: "truncate", children: currentLabel }), _jsx("span", { className: `ml-2 text-[10px] text-muted transition-transform ${open ? "rotate-180" : ""}`, children: "\u25BC" })] }), open && (_jsx("div", { className: `absolute left-0 right-0 z-50 max-h-[280px] overflow-y-auto rounded-md border border-border bg-card shadow-lg ${menuClassName}`, style: menuStyle, children: groups.map((g) => (_jsxs("div", { children: [_jsx("div", { className: "px-2.5 py-1 text-[10px] font-semibold text-muted bg-bg-accent sticky top-0", children: g.label }), g.items.map((item) => {
49
49
  const active = item.id === value;
50
50
  return (_jsxs(Button, { variant: "ghost", size: "sm", className: `w-full justify-start text-left px-2.5 py-1.5 h-auto text-xs rounded-none ${active
51
- ? "bg-accent text-accent-foreground"
52
- : "text-txt hover:bg-bg-muted"}`, onClick: () => {
51
+ ? "bg-accent/20 text-accent"
52
+ : "text-txt hover:bg-accent/10 hover:text-txt"}`, onClick: () => {
53
53
  onChange(item.id);
54
54
  setOpen(false);
55
55
  }, children: [_jsx("span", { className: "font-semibold", children: item.text }), item.hint && (_jsx("span", { className: `ml-1.5 ${active ? "opacity-70" : "text-muted"}`, children: item.hint }))] }, item.id));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elizaos/ui",
3
- "version": "2.0.0-alpha.81",
3
+ "version": "2.0.0-alpha.83",
4
4
  "description": "Reusable UI primitives and components for Milady applications.",
5
5
  "type": "module",
6
6
  "main": "./index.js",
package/styles/theme.css CHANGED
@@ -21,6 +21,10 @@
21
21
  --color-input: var(--input);
22
22
  --color-ring: var(--ring);
23
23
 
24
+ --color-secondary: var(--bg-accent);
25
+ --color-secondary-fg: var(--text);
26
+ --color-muted-fg: var(--muted);
27
+
24
28
  --color-accent: var(--accent);
25
29
  --color-accent-hover: var(--accent-hover);
26
30
  --color-accent-muted: var(--accent-muted);