removed ui, docs package

This commit is contained in:
PxlLoewe
2025-05-24 13:07:55 -07:00
parent cbeae274a4
commit 5187ed194c
44 changed files with 214 additions and 933 deletions

View File

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

View File

@@ -1,28 +0,0 @@
{
"name": "@repo/ui",
"version": "0.0.0",
"private": true,
"exports": {
".": "./src/index.ts",
"./helper": "./src/helper/index.ts"
},
"scripts": {
"lint": "eslint . --max-warnings 0",
"generate:component": "turbo gen react-component",
"check-types": "tsc --noEmit"
},
"devDependencies": {
"@repo/eslint-config": "*",
"@repo/db": "*",
"@repo/typescript-config": "*",
"@turbo/gen": "^1.12.4",
"@types/node": "^20.11.24",
"@types/react": "18.3.0",
"@types/react-dom": "18.3.1",
"typescript": "5.5.4"
},
"dependencies": {
"react": "^19.0.0",
"react-dom": "^19.0.0"
}
}

View File

@@ -1,4 +0,0 @@
declare module "*.png" {
const value: string;
export = value;
}

View File

@@ -1,47 +0,0 @@
import React from "react";
import {
FieldValues,
Path,
RegisterOptions,
UseFormReturn,
} from "react-hook-form";
import { cn } from "../helper/cn";
interface InputProps<T extends FieldValues>
extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "form"> {
name: Path<T>;
form: UseFormReturn<T>;
formOptions?: RegisterOptions<T>;
label?: string;
placeholder?: string;
}
export const Input = <T extends FieldValues>({
name,
label = name,
placeholder = label,
form,
formOptions,
className,
...inputProps
}: InputProps<T>) => {
return (
<label className="floating-label w-full mt-5">
<span className="text-lg flex items-center gap-2">{label}</span>
<input
{...form.register(name, formOptions)}
className={cn(
"input input-bordered w-full placeholder:text-neutral-600",
className,
)}
placeholder={placeholder}
{...inputProps}
/>
{form.formState.errors[name] && (
<p className="text-error">
{form.formState.errors[name].message as string}
</p>
)}
</label>
);
};

View File

@@ -1 +0,0 @@
export * from "./Input";

View File

@@ -1,6 +0,0 @@
import clsx, { ClassValue } from "clsx";
import { twMerge } from "tailwind-merge";
export const cn = (...inputs: ClassValue[]) => {
return twMerge(clsx(inputs));
};

View File

@@ -1,9 +0,0 @@
import { Event, Participant } from "@repo/db";
export const eventCompleted = (event: Event, participant?: Participant) => {
if (!participant) return false;
if (event.finisherMoodleCourseId && !participant.finisherMoodleCurseCompleted)
return false;
if (event.hasPresenceEvents && !participant.attended) return false;
return true;
};

View File

@@ -1 +0,0 @@
export * from "./event";

View File

@@ -1,2 +0,0 @@
export * from "./helper/event";
export * from "./components";

View File

@@ -1,9 +0,0 @@
{
"extends": "@repo/typescript-config/react-library.json",
"compilerOptions": {
"outDir": "dist",
"allowImportingTsExtensions": false
},
"include": ["src", "src/.d.ts"],
"exclude": ["node_modules", "dist"]
}

View File

@@ -1,30 +0,0 @@
import type { PlopTypes } from "@turbo/gen";
// Learn more about Turborepo Generators at https://turbo.build/repo/docs/core-concepts/monorepos/code-generation
export default function generator(plop: PlopTypes.NodePlopAPI): void {
// A simple generator to add a new React component to the internal UI library
plop.setGenerator("react-component", {
description: "Adds a new react component",
prompts: [
{
type: "input",
name: "name",
message: "What is the name of the component?",
},
],
actions: [
{
type: "add",
path: "src/{{kebabCase name}}.tsx",
templateFile: "templates/component.hbs",
},
{
type: "append",
path: "package.json",
pattern: /"exports": {(?<insertion>)/g,
template: ' "./{{kebabCase name}}": "./src/{{kebabCase name}}.tsx",',
},
],
});
}

View File

@@ -1,8 +0,0 @@
export const {{ pascalCase name }} = ({ children }: { children: React.ReactNode }) => {
return (
<div>
<h1>{{ pascalCase name }} Component</h1>
{children}
</div>
);
};