frontend tailwind half working without external styling
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"type": "commonjs",
|
||||
"exports": {
|
||||
"./client": "./src/index.ts",
|
||||
"./shared" : "./shared/schemas/index.ts"
|
||||
"./shared/schemas" : "./shared/schemas/index.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@prisma/client": "^6.7.0",
|
||||
|
||||
@@ -1,85 +0,0 @@
|
||||
import { pgTable, text, serial, integer, boolean, date, timestamp, time } from "drizzle-orm/pg-core";
|
||||
import { createInsertSchema } from "drizzle-zod";
|
||||
import { z } from "zod";
|
||||
|
||||
// User schema
|
||||
export const users = pgTable("users", {
|
||||
id: serial("id").primaryKey(),
|
||||
username: text("username").notNull().unique(),
|
||||
password: text("password").notNull(),
|
||||
});
|
||||
|
||||
export const insertUserSchema = createInsertSchema(users).pick({
|
||||
username: true,
|
||||
password: true,
|
||||
});
|
||||
|
||||
export type InsertUser = z.infer<typeof insertUserSchema>;
|
||||
export type User = typeof users.$inferSelect;
|
||||
|
||||
// Patient schema
|
||||
export const patients = pgTable("patients", {
|
||||
id: serial("id").primaryKey(),
|
||||
firstName: text("first_name").notNull(),
|
||||
lastName: text("last_name").notNull(),
|
||||
dateOfBirth: date("date_of_birth").notNull(),
|
||||
gender: text("gender").notNull(),
|
||||
phone: text("phone").notNull(),
|
||||
email: text("email"),
|
||||
address: text("address"),
|
||||
city: text("city"),
|
||||
zipCode: text("zip_code"),
|
||||
insuranceProvider: text("insurance_provider"),
|
||||
insuranceId: text("insurance_id"),
|
||||
groupNumber: text("group_number"),
|
||||
policyHolder: text("policy_holder"),
|
||||
allergies: text("allergies"),
|
||||
medicalConditions: text("medical_conditions"),
|
||||
status: text("status").default("active"),
|
||||
userId: integer("user_id").notNull().references(() => users.id),
|
||||
createdAt: timestamp("created_at").defaultNow(),
|
||||
});
|
||||
|
||||
export const insertPatientSchema = createInsertSchema(patients).omit({
|
||||
id: true,
|
||||
createdAt: true,
|
||||
});
|
||||
|
||||
export const updatePatientSchema = createInsertSchema(patients).omit({
|
||||
id: true,
|
||||
createdAt: true,
|
||||
userId: true,
|
||||
}).partial();
|
||||
|
||||
export type InsertPatient = z.infer<typeof insertPatientSchema>;
|
||||
export type UpdatePatient = z.infer<typeof updatePatientSchema>;
|
||||
export type Patient = typeof patients.$inferSelect;
|
||||
|
||||
// Appointment schema
|
||||
export const appointments = pgTable("appointments", {
|
||||
id: serial("id").primaryKey(),
|
||||
patientId: integer("patient_id").notNull().references(() => patients.id),
|
||||
userId: integer("user_id").notNull().references(() => users.id),
|
||||
title: text("title").notNull(), // Added title field
|
||||
date: date("date").notNull(),
|
||||
startTime: time("start_time").notNull(),
|
||||
endTime: time("end_time").notNull(),
|
||||
type: text("type").notNull(), // e.g., "checkup", "cleaning", "filling", etc.
|
||||
notes: text("notes"),
|
||||
status: text("status").default("scheduled"), // "scheduled", "completed", "cancelled", "no-show"
|
||||
createdAt: timestamp("created_at").defaultNow(),
|
||||
});
|
||||
|
||||
export const insertAppointmentSchema = createInsertSchema(appointments).omit({
|
||||
id: true,
|
||||
createdAt: true,
|
||||
});
|
||||
|
||||
export const updateAppointmentSchema = createInsertSchema(appointments).omit({
|
||||
id: true,
|
||||
createdAt: true,
|
||||
}).partial();
|
||||
|
||||
export type InsertAppointment = z.infer<typeof insertAppointmentSchema>;
|
||||
export type UpdateAppointment = z.infer<typeof updateAppointmentSchema>;
|
||||
export type Appointment = typeof appointments.$inferSelect;
|
||||
@@ -1,6 +1,6 @@
|
||||
// Optional PostCSS configuration for applications that need it
|
||||
import tailwindcss from "@tailwindcss/postcss";
|
||||
import autoprefixer from "autoprefixer";
|
||||
|
||||
export const postcssConfig = {
|
||||
plugins: {
|
||||
"@tailwindcss/postcss": {},
|
||||
},
|
||||
plugins: [tailwindcss(), autoprefixer()]
|
||||
};
|
||||
|
||||
@@ -1,7 +1,2 @@
|
||||
@import "tailwindcss";
|
||||
|
||||
@theme {
|
||||
--blue-1000: #2a8af6;
|
||||
--purple-1000: #a853ba;
|
||||
--red-1000: #e92a67;
|
||||
}
|
||||
|
||||
4
packages/ui/eslint.config.mjs
Normal file
4
packages/ui/eslint.config.mjs
Normal file
@@ -0,0 +1,4 @@
|
||||
import { config } from "@repo/eslint-config/react-internal";
|
||||
|
||||
/** @type {import("eslint").Linter.Config} */
|
||||
export default config;
|
||||
36
packages/ui/package.json
Normal file
36
packages/ui/package.json
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"name": "@repo/ui",
|
||||
"version": "0.0.0",
|
||||
"sideEffects": [
|
||||
"**/*.css"
|
||||
],
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"exports": {
|
||||
"./styles.css": "./dist/index.css",
|
||||
"./*": "./dist/*.js"
|
||||
},
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"build:styles": "tailwindcss -i ./src/styles.css -o ./dist/index.css",
|
||||
"build:components": "tsc",
|
||||
"check-types": "tsc --noEmit",
|
||||
"dev:styles": "tailwindcss -i ./src/styles.css -o ./dist/index.css --watch",
|
||||
"dev:components": "tsc --watch",
|
||||
"lint": "eslint src --max-warnings 0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^19"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@repo/eslint-config": "*",
|
||||
"@repo/tailwind-config": "*",
|
||||
"@repo/typescript-config": "*",
|
||||
"@tailwindcss/cli": "^4.1.5",
|
||||
"@types/react": "^19.1.0",
|
||||
"eslint": "^9.26.0",
|
||||
"tailwindcss": "^4.1.5",
|
||||
"typescript": "5.8.2"
|
||||
}
|
||||
}
|
||||
28
packages/ui/src/card.tsx
Normal file
28
packages/ui/src/card.tsx
Normal file
@@ -0,0 +1,28 @@
|
||||
import { type ReactNode } from "react";
|
||||
|
||||
export function Card({
|
||||
title,
|
||||
children,
|
||||
href,
|
||||
}: {
|
||||
title: string;
|
||||
children: ReactNode;
|
||||
href: string;
|
||||
}) {
|
||||
return (
|
||||
<a
|
||||
className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-neutral-700 hover:bg-neutral-800/30"
|
||||
href={`${href}?utm_source=create-turbo&utm_medium=with-tailwind&utm_campaign=create-turbo"`}
|
||||
rel="noopener noreferrer"
|
||||
target="_blank"
|
||||
>
|
||||
<h2 className="mb-3 text-2xl font-semibold">
|
||||
{title}{" "}
|
||||
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
|
||||
->
|
||||
</span>
|
||||
</h2>
|
||||
<p className="m-0 max-w-[30ch] text-sm opacity-50">{children}</p>
|
||||
</a>
|
||||
);
|
||||
}
|
||||
21
packages/ui/src/gradient.tsx
Normal file
21
packages/ui/src/gradient.tsx
Normal file
@@ -0,0 +1,21 @@
|
||||
export function Gradient({
|
||||
conic,
|
||||
className,
|
||||
small,
|
||||
}: {
|
||||
small?: boolean;
|
||||
conic?: boolean;
|
||||
className?: string;
|
||||
}) {
|
||||
return (
|
||||
<span
|
||||
className={`absolute mix-blend-normal will-change-[filter] rounded-[100%] ${
|
||||
small ? "blur-[32px]" : "blur-[75px]"
|
||||
} ${
|
||||
conic
|
||||
? "bg-[conic-gradient(from_180deg_at_50%_50%,var(--red-1000)_0deg,_var(--purple-1000)_180deg,_var(--blue-1000)_360deg)]"
|
||||
: ""
|
||||
} ${className ?? ""}`}
|
||||
/>
|
||||
);
|
||||
}
|
||||
1
packages/ui/src/styles.css
Normal file
1
packages/ui/src/styles.css
Normal file
@@ -0,0 +1 @@
|
||||
@import "tailwindcss";
|
||||
35
packages/ui/src/turborepo-logo.tsx
Normal file
35
packages/ui/src/turborepo-logo.tsx
Normal file
@@ -0,0 +1,35 @@
|
||||
export const TurborepoLogo = () => {
|
||||
return (
|
||||
<svg
|
||||
aria-label="Turbo logomark"
|
||||
height="80"
|
||||
role="img"
|
||||
viewBox="0 0 40 40"
|
||||
width="80"
|
||||
>
|
||||
<path
|
||||
d="M19.9845 6.99291C12.818 6.99291 6.98755 12.8279 6.98755 19.9999C6.98755 27.1721 12.818 33.0071 19.9845 33.0071C27.1509 33.0071 32.9814 27.1721 32.9814 19.9999C32.9814 12.8279 27.1509 6.99291 19.9845 6.99291ZM19.9845 26.7313C16.2694 26.7313 13.2585 23.718 13.2585 19.9999C13.2585 16.282 16.2694 13.2687 19.9845 13.2687C23.6996 13.2687 26.7105 16.282 26.7105 19.9999C26.7105 23.718 23.6996 26.7313 19.9845 26.7313Z"
|
||||
fill="currentcolor"
|
||||
></path>
|
||||
<path
|
||||
clipRule="evenodd"
|
||||
d="M21.0734 4.85648V0C31.621 0.564369 40 9.30362 40 19.9999C40 30.6963 31.621 39.4332 21.0734 40V35.1435C28.9344 34.5815 35.1594 28.0078 35.1594 19.9999C35.1594 11.9922 28.9344 5.41843 21.0734 4.85648ZM8.52181 29.931C6.43794 27.5233 5.09469 24.4568 4.85508 21.09H0C0.251709 25.8011 2.13468 30.0763 5.08501 33.368L8.51938 29.931H8.52181ZM18.8951 40V35.1435C15.5285 34.9037 12.4644 33.5619 10.0587 31.4739L6.62435 34.9109C9.91593 37.866 14.1876 39.7481 18.8927 40H18.8951Z"
|
||||
fill="url(#:Sb:paint0_linear_902_224)"
|
||||
fillRule="evenodd"
|
||||
></path>
|
||||
<defs>
|
||||
<linearGradient
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id=":Sb:paint0_linear_902_224"
|
||||
x1="21.8576"
|
||||
x2="2.17018"
|
||||
y1="2.81244"
|
||||
y2="22.4844"
|
||||
>
|
||||
<stop stopColor="#0096FF"></stop>
|
||||
<stop offset="1" stopColor="#FF1E56"></stop>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
</svg>
|
||||
);
|
||||
};
|
||||
8
packages/ui/tsconfig.json
Normal file
8
packages/ui/tsconfig.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "@repo/typescript-config/react-library.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "dist"
|
||||
},
|
||||
"include": ["src"],
|
||||
"exclude": ["dist", "build", "node_modules"]
|
||||
}
|
||||
25
packages/ui/turbo.json
Normal file
25
packages/ui/turbo.json
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"extends": ["//"],
|
||||
"tasks": {
|
||||
"build": {
|
||||
"dependsOn": ["build:styles", "build:components"]
|
||||
},
|
||||
"build:styles": {
|
||||
"outputs": ["dist/**"]
|
||||
},
|
||||
"build:components": {
|
||||
"outputs": ["dist/**"]
|
||||
},
|
||||
"dev": {
|
||||
"with": ["dev:styles", "dev:components"]
|
||||
},
|
||||
"dev:styles": {
|
||||
"cache": false,
|
||||
"persistent": true
|
||||
},
|
||||
"dev:components": {
|
||||
"cache": false,
|
||||
"persistent": true
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user