diff --git a/.gitignore b/.gitignore
index c89e4b1..7139f43 100644
--- a/.gitignore
+++ b/.gitignore
@@ -46,3 +46,5 @@ coverage/
# typescript
*.tsbuildinfo
next-env.d.ts
+
+storybook-static
diff --git a/.vscode/settings.json b/.vscode/settings.json
index 0996980..8e9e171 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -64,6 +64,7 @@
"hyoban",
"lucide",
"ofetch",
+ "sonner",
"tanstack",
"tsup"
],
diff --git a/apps/admin/package.json b/apps/admin/package.json
index 9ad6d4f..6ec527b 100644
--- a/apps/admin/package.json
+++ b/apps/admin/package.json
@@ -96,7 +96,6 @@
"postcss": "^8.4.47",
"storybook": "^8.4.5",
"tailwindcss": "^3.4.14",
- "turbo": "^2.2.3",
"typescript": "^5.6.3",
"vite": "^5.4.10",
"vite-plugin-html": "^3.2.2",
diff --git a/apps/admin/vite.config.ts b/apps/admin/vite.config.ts
index 38b827b..f88f7d1 100644
--- a/apps/admin/vite.config.ts
+++ b/apps/admin/vite.config.ts
@@ -46,10 +46,5 @@ export default defineConfig(({ mode }) => {
},
},
},
- build: {
- rollupOptions: {
- // external: ["react-hook-form"],
- },
- },
}
})
diff --git a/package.json b/package.json
index 0cc34d2..918e9f8 100644
--- a/package.json
+++ b/package.json
@@ -10,9 +10,10 @@
"type": "git"
},
"scripts": {
+ "admin:build": "pnpm --filter admin build",
"admin:dev": "pnpm --filter admin dev",
"api:dev": "turbo dev --filter api",
- "build": "tsc && vite build",
+ "build": "turbo build",
"build-storybook": "storybook build",
"coverage": "vitest run --coverage",
"dev": "turbo dev",
diff --git a/packages/pro-components/README.md b/packages/pro-components/README.md
index 74872fd..a6f112e 100644
--- a/packages/pro-components/README.md
+++ b/packages/pro-components/README.md
@@ -1,50 +1 @@
-# React + TypeScript + Vite
-
-This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
-
-Currently, two official plugins are available:
-
-- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
-- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
-
-## Expanding the ESLint configuration
-
-If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
-
-- Configure the top-level `parserOptions` property like this:
-
-```js
-export default tseslint.config({
- languageOptions: {
- // other options...
- parserOptions: {
- project: ['./tsconfig.node.json', './tsconfig.app.json'],
- tsconfigRootDir: import.meta.dirname,
- },
- },
-})
-```
-
-- Replace `tseslint.configs.recommended` to `tseslint.configs.recommendedTypeChecked` or `tseslint.configs.strictTypeChecked`
-- Optionally add `...tseslint.configs.stylisticTypeChecked`
-- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and update the config:
-
-```js
-// eslint.config.js
-import react from 'eslint-plugin-react'
-
-export default tseslint.config({
- // Set the react version
- settings: { react: { version: '18.3' } },
- plugins: {
- // Add the react plugin
- react,
- },
- rules: {
- // other rules...
- // Enable its recommended rules
- ...react.configs.recommended.rules,
- ...react.configs['jsx-runtime'].rules,
- },
-})
-```
+# Pro Components
diff --git a/packages/pro-components/package.json b/packages/pro-components/package.json
index d00d958..40b1d9c 100644
--- a/packages/pro-components/package.json
+++ b/packages/pro-components/package.json
@@ -8,7 +8,7 @@
"./pro-table": "./src/components/pro-table/index.tsx"
},
"scripts": {
- "build": "tsc -b && vite build",
+ "build": "tsc -b && vite build -d",
"build-storybook": "storybook build",
"dev": "vite",
"lint": "eslint .",
@@ -38,15 +38,21 @@
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@vitejs/plugin-react-swc": "^3.5.0",
+ "autoprefixer": "^10.4.20",
+ "clsx": "^2.1.1",
"eslint": "^9.13.0",
"eslint-plugin-react-hooks": "^5.0.0",
"eslint-plugin-react-refresh": "^0.4.14",
"eslint-plugin-storybook": "^0.11.0",
"globals": "^15.11.0",
+ "postcss": "^8.4.49",
"storybook": "^8.4.5",
+ "tailwind-merge": "^2.5.4",
+ "tailwindcss": "^3.4.15",
"typescript": "~5.6.2",
"typescript-eslint": "^8.11.0",
- "vite": "^5.4.10"
+ "vite": "^5.4.10",
+ "vite-tsconfig-paths": "^5.0.1"
},
"eslintConfig": {
"extends": [
diff --git a/packages/pro-components/postcss.config.cjs b/packages/pro-components/postcss.config.cjs
new file mode 100644
index 0000000..33ad091
--- /dev/null
+++ b/packages/pro-components/postcss.config.cjs
@@ -0,0 +1,6 @@
+module.exports = {
+ plugins: {
+ tailwindcss: {},
+ autoprefixer: {},
+ },
+}
diff --git a/packages/pro-components/src/App.tsx b/packages/pro-components/src/App.tsx
index 5b0d3ab..ef821be 100644
--- a/packages/pro-components/src/App.tsx
+++ b/packages/pro-components/src/App.tsx
@@ -1,5 +1,6 @@
import "./App.css"
+import { Button } from "@repo/ui/button"
import { useState } from "react"
import viteLogo from "/vite.svg"
@@ -31,6 +32,7 @@ function App() {
Click on the Vite and React logos to learn more
+
>
)
}
diff --git a/packages/pro-components/src/lib/utils.ts b/packages/pro-components/src/lib/utils.ts
new file mode 100644
index 0000000..c66a9d9
--- /dev/null
+++ b/packages/pro-components/src/lib/utils.ts
@@ -0,0 +1,7 @@
+import type { ClassValue } from "clsx"
+import { clsx } from "clsx"
+import { twMerge } from "tailwind-merge"
+
+export function cn(...inputs: ClassValue[]) {
+ return twMerge(clsx(inputs))
+}
diff --git a/packages/pro-components/src/main.tsx b/packages/pro-components/src/main.tsx
index 2e84161..7d68610 100644
--- a/packages/pro-components/src/main.tsx
+++ b/packages/pro-components/src/main.tsx
@@ -1,4 +1,5 @@
import "./index.css"
+import "@repo/ui/globals.css"
import { StrictMode } from "react"
import { createRoot } from "react-dom/client"
diff --git a/packages/pro-components/src/stories/Button.stories.ts b/packages/pro-components/src/stories/Button.stories.ts
deleted file mode 100644
index 32f6706..0000000
--- a/packages/pro-components/src/stories/Button.stories.ts
+++ /dev/null
@@ -1,53 +0,0 @@
-import type { Meta, StoryObj } from "@storybook/react"
-import { fn } from "@storybook/test"
-
-import { Button } from "./Button"
-
-// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
-const meta = {
- title: "Example/Button",
- component: Button,
- parameters: {
- // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
- layout: "centered",
- },
- // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
- tags: ["autodocs"],
- // More on argTypes: https://storybook.js.org/docs/api/argtypes
- argTypes: {
- backgroundColor: { control: "color" },
- },
- // Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args
- args: { onClick: fn() },
-} satisfies Meta
-
-export default meta
-type Story = StoryObj
-
-// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
-export const Primary: Story = {
- args: {
- primary: true,
- label: "Button",
- },
-}
-
-export const Secondary: Story = {
- args: {
- label: "Button",
- },
-}
-
-export const Large: Story = {
- args: {
- size: "large",
- label: "Button",
- },
-}
-
-export const Small: Story = {
- args: {
- size: "small",
- label: "Button",
- },
-}
diff --git a/packages/pro-components/src/stories/Button.tsx b/packages/pro-components/src/stories/Button.tsx
deleted file mode 100644
index f537876..0000000
--- a/packages/pro-components/src/stories/Button.tsx
+++ /dev/null
@@ -1,37 +0,0 @@
-import "./button.css"
-
-import React from "react"
-
-export interface ButtonProps {
- /** Is this the principal call to action on the page? */
- primary?: boolean
- /** What background color to use */
- backgroundColor?: string
- /** How large should the button be? */
- size?: "small" | "medium" | "large"
- /** Button contents */
- label: string
- /** Optional click handler */
- onClick?: () => void
-}
-
-/** Primary UI component for user interaction */
-export const Button = ({
- primary = false,
- size = "medium",
- backgroundColor,
- label,
- ...props
-}: ButtonProps) => {
- const mode = primary ? "storybook-button--primary" : "storybook-button--secondary"
- return (
-
- )
-}
diff --git a/packages/pro-components/src/stories/Configure.mdx b/packages/pro-components/src/stories/Configure.mdx
deleted file mode 100644
index 6a53730..0000000
--- a/packages/pro-components/src/stories/Configure.mdx
+++ /dev/null
@@ -1,364 +0,0 @@
-import { Meta } from "@storybook/blocks";
-
-import Github from "./assets/github.svg";
-import Discord from "./assets/discord.svg";
-import Youtube from "./assets/youtube.svg";
-import Tutorials from "./assets/tutorials.svg";
-import Styling from "./assets/styling.png";
-import Context from "./assets/context.png";
-import Assets from "./assets/assets.png";
-import Docs from "./assets/docs.png";
-import Share from "./assets/share.png";
-import FigmaPlugin from "./assets/figma-plugin.png";
-import Testing from "./assets/testing.png";
-import Accessibility from "./assets/accessibility.png";
-import Theming from "./assets/theming.png";
-import AddonLibrary from "./assets/addon-library.png";
-
-export const RightArrow = () =>
-
-
-
-
-
- # Configure your project
-
- Because Storybook works separately from your app, you'll need to configure it for your specific stack and setup. Below, explore guides for configuring Storybook with popular frameworks and tools. If you get stuck, learn how you can ask for help from our community.
-
-
-
-
-
Add styling and CSS
-
Like with web applications, there are many ways to include CSS within Storybook. Learn more about setting up styling within Storybook.
To link static files (like fonts) to your projects and stories, use the
- `staticDirs` configuration option to specify folders to load when
- starting Storybook.
- # Do more with Storybook
-
- Now that you know the basics, let's explore other parts of Storybook that will improve your experience. This list is just to get you started. You can customise Storybook in many ways to fit your needs.
-
-
-
-
-
-
-
Autodocs
-
Auto-generate living,
- interactive reference documentation from your components and stories.
- We recommend building UIs with a
- {" "}
-
- component-driven
-
- {" "}
- process starting with atomic components and ending with pages.
-
-
- Render pages with mock data. This makes it easy to build and review page states without
- needing to navigate to them in your app. Here are some handy patterns for managing page
- data in Storybook:
-
-
-
- Use a higher-level connected component. Storybook helps you compose such data from the
- "args" of child component stories
-
-
- Assemble data in the page component from your services. You can mock these services out
- using Storybook.
-