feat(proj): init

This commit is contained in:
vl.arkhangelskii
2026-09-21 04:06:43 +03:00
commit c956b94983
1076 changed files with 50876 additions and 0 deletions
+42
View File
@@ -0,0 +1,42 @@
import type { ButtonHTMLAttributes, ReactNode } from "react";
export type AppButtonStyle = "filled" | "tinted" | "gray" | "plain" | "destructive";
export type AppButtonSize = "large" | "medium" | "small";
type Props = ButtonHTMLAttributes<HTMLButtonElement> & {
label?: ReactNode;
children?: ReactNode;
buttonStyle?: AppButtonStyle;
size?: AppButtonSize;
expanded?: boolean;
loading?: boolean;
};
export function AppButton({
label,
children,
buttonStyle = "filled",
size = "large",
expanded = true,
loading = false,
className = "",
disabled,
type = "button",
...rest
}: Props) {
const classes = [
"app-btn",
`app-btn--${buttonStyle}`,
`app-btn--${size}`,
expanded ? "app-btn--expanded" : "",
className,
]
.filter(Boolean)
.join(" ");
return (
<button type={type} className={classes} disabled={disabled || loading} {...rest}>
{loading ? <span className="app-spinner" aria-hidden="true" /> : (label ?? children)}
</button>
);
}