@elizaos/ui 2.0.0-alpha.43 → 2.0.0-alpha.45
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/ui/button.js +2 -2
- package/dist/components/ui/section-card.js +1 -1
- package/dist/components/ui/status-badge.d.ts +0 -2
- package/dist/components/ui/status-badge.d.ts.map +1 -1
- package/dist/components/ui/status-badge.js +1 -1
- package/dist/components/ui/switch.d.ts +2 -13
- package/dist/components/ui/switch.d.ts.map +1 -1
- package/dist/components/ui/switch.js +3 -35
- package/dist/package.json +3 -2
- package/package.json +2 -2
|
@@ -15,8 +15,8 @@ const buttonVariants = cva("inline-flex items-center justify-center gap-2 whites
|
|
|
15
15
|
},
|
|
16
16
|
size: {
|
|
17
17
|
default: "h-10 px-4 py-2",
|
|
18
|
-
sm: "h-9 rounded-md px-3",
|
|
19
|
-
lg: "h-11 rounded-md px-8",
|
|
18
|
+
sm: "h-9 rounded-md px-3 py-1.5",
|
|
19
|
+
lg: "h-11 rounded-md px-8 py-2.5",
|
|
20
20
|
icon: "h-10 w-10",
|
|
21
21
|
},
|
|
22
22
|
},
|
|
@@ -3,7 +3,7 @@ import * as React from "react";
|
|
|
3
3
|
import { cn } from "../../lib/utils";
|
|
4
4
|
export const SectionCard = React.forwardRef(({ title, description, actions, collapsible = false, defaultCollapsed = false, className, children, ...props }, ref) => {
|
|
5
5
|
const [collapsed, setCollapsed] = React.useState(defaultCollapsed);
|
|
6
|
-
return (_jsxs("div", { ref: ref, className: cn("border border-border bg-card text-card-fg", className), ...props, children: [(title || actions) && (_jsxs("div", { className: "flex items-center justify-between border-b border-border px-4 py-
|
|
6
|
+
return (_jsxs("div", { ref: ref, className: cn("border border-border bg-card text-card-fg", className), ...props, children: [(title || actions) && (_jsxs("div", { className: "flex items-center justify-between border-b border-border px-4 py-4", children: [_jsxs("div", { className: "flex flex-col gap-1.5", children: [title && (_jsxs("button", { type: "button", className: cn("text-sm font-semibold text-left", collapsible &&
|
|
7
7
|
"cursor-pointer hover:text-accent transition-colors", !collapsible && "cursor-default"), onClick: collapsible ? () => setCollapsed((c) => !c) : undefined, tabIndex: collapsible ? 0 : -1, children: [collapsible && (_jsx("span", { className: cn("mr-1.5 inline-block text-[10px] text-muted transition-transform", !collapsed && "rotate-90"), children: "\u25B6" })), title] })), description && (_jsx("span", { className: "text-[11px] text-muted", children: description }))] }), actions && (_jsx("div", { className: "flex items-center gap-2", children: actions }))] })), (!collapsible || !collapsed) && _jsx("div", { className: "p-4", children: children })] }));
|
|
8
8
|
});
|
|
9
9
|
SectionCard.displayName = "SectionCard";
|
|
@@ -15,8 +15,6 @@ export interface StatCardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
15
15
|
label: string;
|
|
16
16
|
value: React.ReactNode;
|
|
17
17
|
accent?: boolean;
|
|
18
|
-
valueClassName?: string;
|
|
19
|
-
labelClassName?: string;
|
|
20
18
|
}
|
|
21
19
|
export declare const StatCard: React.ForwardRefExoticComponent<StatCardProps & React.RefAttributes<HTMLDivElement>>;
|
|
22
20
|
//# sourceMappingURL=status-badge.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status-badge.d.ts","sourceRoot":"","sources":["../../../src/components/ui/status-badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAC;AAqBpE,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,OAAO,EAClB,MAAM,GAAE,UAAsB,EAC9B,OAAO,GAAE,UAAoB,GAC5B,UAAU,CAEZ;AAID,MAAM,WAAW,gBACf,SAAQ,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,M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,sFAuBpB,CAAC"}
|
|
@@ -37,5 +37,5 @@ export const StatusDot = React.forwardRef(({ status, className, ...props }, ref)
|
|
|
37
37
|
return (_jsx("span", { ref: ref, className: cn("inline-block h-2 w-2 rounded-full", styles.dot, className), ...props }));
|
|
38
38
|
});
|
|
39
39
|
StatusDot.displayName = "StatusDot";
|
|
40
|
-
export const StatCard = React.forwardRef(({ label, value, accent = false,
|
|
40
|
+
export const StatCard = React.forwardRef(({ label, value, accent = false, className, ...props }, ref) => (_jsxs("div", { ref: ref, className: cn("flex flex-col items-center justify-center border border-border bg-bg p-3 min-w-[80px]", className), ...props, children: [_jsx("div", { className: cn("text-lg font-bold tabular-nums", accent && "text-accent"), children: value }), _jsx("div", { className: "mt-0.5 text-[10px] uppercase tracking-wide text-muted", children: label })] })));
|
|
41
41
|
StatCard.displayName = "StatCard";
|
|
@@ -1,16 +1,5 @@
|
|
|
1
|
+
import * as SwitchPrimitives from "@radix-ui/react-switch";
|
|
1
2
|
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
export interface SwitchProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "type" | "onChange" | "onClick" | "role" | "aria-checked" | "defaultChecked" | "checked"> {
|
|
4
|
-
checked?: boolean;
|
|
5
|
-
defaultChecked?: boolean;
|
|
6
|
-
onChange?: (next: boolean) => void;
|
|
7
|
-
onCheckedChange?: (next: boolean) => void;
|
|
8
|
-
size?: SwitchSize;
|
|
9
|
-
trackOnClass?: string;
|
|
10
|
-
trackOffClass?: string;
|
|
11
|
-
knobClass?: string;
|
|
12
|
-
disabledClassName?: string;
|
|
13
|
-
}
|
|
14
|
-
declare const Switch: React.ForwardRefExoticComponent<SwitchProps & React.RefAttributes<HTMLButtonElement>>;
|
|
3
|
+
declare const Switch: React.ForwardRefExoticComponent<Omit<SwitchPrimitives.SwitchProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
15
4
|
export { Switch };
|
|
16
5
|
//# sourceMappingURL=switch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../../src/components/ui/switch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../../src/components/ui/switch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,gBAAgB,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,QAAA,MAAM,MAAM,8JAkBV,CAAC;AAGH,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -1,39 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as SwitchPrimitives from "@radix-ui/react-switch";
|
|
2
3
|
import * as React from "react";
|
|
3
4
|
import { cn } from "../../lib/utils";
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
compact: "h-5 w-9 border-2 border-transparent",
|
|
7
|
-
};
|
|
8
|
-
const KNOB_CLASS = {
|
|
9
|
-
default: "h-5 w-5",
|
|
10
|
-
compact: "h-4 w-4",
|
|
11
|
-
};
|
|
12
|
-
const KNOB_POSITION_CLASS = {
|
|
13
|
-
default: "translate-x-5",
|
|
14
|
-
compact: "translate-x-4",
|
|
15
|
-
};
|
|
16
|
-
const Switch = React.forwardRef(({ checked, defaultChecked = false, onChange, onCheckedChange, size = "default", trackOnClass = "bg-primary", trackOffClass = "bg-input", knobClass = "bg-bg shadow-lg", disabledClassName = "cursor-not-allowed opacity-50", className, disabled, ...props }, ref) => {
|
|
17
|
-
const isControlled = checked !== undefined;
|
|
18
|
-
const [internalChecked, setInternalChecked] = React.useState(defaultChecked);
|
|
19
|
-
const isOn = isControlled ? checked : internalChecked;
|
|
20
|
-
React.useEffect(() => {
|
|
21
|
-
if (!isControlled) {
|
|
22
|
-
setInternalChecked(defaultChecked);
|
|
23
|
-
}
|
|
24
|
-
}, [defaultChecked, isControlled]);
|
|
25
|
-
const handleToggle = () => {
|
|
26
|
-
if (disabled) {
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
const next = !isOn;
|
|
30
|
-
if (!isControlled) {
|
|
31
|
-
setInternalChecked(next);
|
|
32
|
-
}
|
|
33
|
-
onChange?.(next);
|
|
34
|
-
onCheckedChange?.(next);
|
|
35
|
-
};
|
|
36
|
-
return (_jsx("button", { ...props, ref: ref, type: "button", role: "switch", "aria-checked": isOn, disabled: disabled, className: cn("peer relative inline-flex shrink-0 items-center rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-bg", SIZE_CLASS[size], isOn ? trackOnClass : trackOffClass, disabled ? disabledClassName : "cursor-pointer", className), onClick: handleToggle, children: _jsx("span", { className: cn("pointer-events-none absolute left-0.5 top-0.5 block rounded-full ring-0 transition-transform", KNOB_CLASS[size], knobClass, isOn && KNOB_POSITION_CLASS[size]) }) }));
|
|
37
|
-
});
|
|
38
|
-
Switch.displayName = "Switch";
|
|
5
|
+
const Switch = React.forwardRef(({ className, ...props }, ref) => (_jsx(SwitchPrimitives.Root, { className: cn("peer inline-flex h-[24px] w-[44px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-bg disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input", className), ...props, ref: ref, children: _jsx(SwitchPrimitives.Thumb, { className: cn("pointer-events-none block h-5 w-5 rounded-full bg-bg shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0") }) })));
|
|
6
|
+
Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
39
7
|
export { Switch };
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elizaos/ui",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.45",
|
|
4
4
|
"description": "Reusable UI primitives and components for elizaOS applications.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -60,5 +60,6 @@
|
|
|
60
60
|
"author": "elizaOS Team",
|
|
61
61
|
"engines": {
|
|
62
62
|
"node": ">=18.0.0"
|
|
63
|
-
}
|
|
63
|
+
},
|
|
64
|
+
"gitHead": "cb192f7b21c441e9463d1af2f890c145814baad2"
|
|
64
65
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elizaos/ui",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.45",
|
|
4
4
|
"description": "Reusable UI primitives and components for elizaOS applications.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -90,5 +90,5 @@
|
|
|
90
90
|
"engines": {
|
|
91
91
|
"node": ">=18.0.0"
|
|
92
92
|
},
|
|
93
|
-
"gitHead": "
|
|
93
|
+
"gitHead": "22554454220d12365848eb55350bb769df24281c"
|
|
94
94
|
}
|