feat(ui): register favorite star and glyph-only actions
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nodedc/ui-react",
|
||||
"version": "0.7.5",
|
||||
"version": "0.7.6",
|
||||
"type": "module",
|
||||
"files": [
|
||||
"dist"
|
||||
|
||||
@@ -65,12 +65,16 @@ export const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button
|
||||
export interface IconButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
||||
label: string;
|
||||
shape?: "circle" | "rounded";
|
||||
/** Glyph-only action; keeps the normal hit target and keyboard focus. */
|
||||
surface?: "default" | "none";
|
||||
loading?: boolean;
|
||||
}
|
||||
|
||||
export const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(function IconButton({
|
||||
label,
|
||||
shape = "circle",
|
||||
surface = "default",
|
||||
style,
|
||||
className,
|
||||
children,
|
||||
type = "button",
|
||||
@@ -84,6 +88,7 @@ export const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(functio
|
||||
type={type}
|
||||
className={cn("nodedc-icon-button", className)}
|
||||
data-shape={shape === "circle" ? undefined : shape}
|
||||
style={surface === "none" ? { ...style, background: "transparent", boxShadow: "none", color: "var(--nodedc-text-primary)" } : style}
|
||||
aria-label={label}
|
||||
title={label}
|
||||
{...props}
|
||||
|
||||
@@ -64,6 +64,7 @@ import {
|
||||
ShieldCheck,
|
||||
SlidersHorizontal,
|
||||
Square,
|
||||
Star,
|
||||
Terminal,
|
||||
Trash2,
|
||||
UploadCloud,
|
||||
@@ -156,6 +157,7 @@ const icons = {
|
||||
shield: ShieldCheck,
|
||||
sliders: SlidersHorizontal,
|
||||
stop: Square,
|
||||
star: Star,
|
||||
terminal: Terminal,
|
||||
trash: Trash2,
|
||||
upload: UploadCloud,
|
||||
|
||||
Reference in New Issue
Block a user