This commit is contained in:
Hari 2026-03-31 23:50:51 -04:00 committed by GitHub
parent 4f174ec3a8
commit b68151035a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
81 changed files with 6263 additions and 545 deletions

View file

@ -0,0 +1,4 @@
import { config } from "@betternas/eslint-config/react-internal";
/** @type {import("eslint").Linter.Config} */
export default config;

27
packages/ui/package.json Normal file
View file

@ -0,0 +1,27 @@
{
"name": "@betternas/ui",
"version": "0.0.0",
"private": true,
"exports": {
"./*": "./src/*.tsx"
},
"scripts": {
"build": "tsc -p tsconfig.json",
"lint": "eslint . --max-warnings 0",
"generate:component": "turbo gen react-component",
"check-types": "tsc --noEmit"
},
"devDependencies": {
"@betternas/eslint-config": "*",
"@betternas/typescript-config": "*",
"@types/node": "^22.15.3",
"@types/react": "19.2.2",
"@types/react-dom": "19.2.2",
"eslint": "^9.39.1",
"typescript": "5.9.2"
},
"dependencies": {
"react": "^19.2.0",
"react-dom": "^19.2.0"
}
}

View file

@ -0,0 +1,17 @@
"use client";
import { ReactNode } from "react";
interface ButtonProps {
children: ReactNode;
className?: string;
onClick?: () => void;
}
export const Button = ({ children, className, onClick }: ButtonProps) => {
return (
<button className={className} onClick={onClick} type="button">
{children}
</button>
);
};

22
packages/ui/src/card.tsx Normal file
View file

@ -0,0 +1,22 @@
import { type JSX } from "react";
export function Card({
className,
title,
children,
href,
}: {
className?: string;
title: string;
children: React.ReactNode;
href: string;
}): JSX.Element {
return (
<a className={className} href={href}>
<h2>
{title} <span>-&gt;</span>
</h2>
<p>{children}</p>
</a>
);
}

11
packages/ui/src/code.tsx Normal file
View file

@ -0,0 +1,11 @@
import { type JSX } from "react";
export function Code({
children,
className,
}: {
children: React.ReactNode;
className?: string;
}): JSX.Element {
return <code className={className}>{children}</code>;
}

View file

@ -0,0 +1,9 @@
{
"extends": "@betternas/typescript-config/react-library.json",
"compilerOptions": {
"outDir": "dist",
"strictNullChecks": true
},
"include": ["src"],
"exclude": ["node_modules", "dist"]
}