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. -
-
-
- A wall of logos representing different styling technologies -

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.

- Learn more -
-
- An abstraction representing the composition of data for a component -

Provide context and mocking

-

Often when a story doesn't render, it's because your component is expecting a specific environment or context (like a theme provider) to be available.

- Learn more -
-
- A representation of typography and image assets -
-

Load assets and resources

-

To link static files (like fonts) to your projects and stories, use the - `staticDirs` configuration option to specify folders to load when - starting Storybook.

- Learn more -
-
-
-
-
-
- # 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. -
- -
-
-
- A screenshot showing the autodocs tag being set, pointing a docs page being generated -

Autodocs

-

Auto-generate living, - interactive reference documentation from your components and stories.

- Learn more -
-
- A browser window showing a Storybook being published to a chromatic.com URL -

Publish to Chromatic

-

Publish your Storybook to review and collaborate with your entire team.

- Learn more -
-
- Windows showing the Storybook plugin in Figma -

Figma Plugin

-

Embed your stories into Figma to cross-reference the design and live - implementation in one place.

- Learn more -
-
- Screenshot of tests passing and failing -

Testing

-

Use stories to test a component in all its variations, no matter how - complex.

- Learn more -
-
- Screenshot of accessibility tests passing and failing -

Accessibility

-

Automatically test your components for a11y issues as you develop.

- Learn more -
-
- Screenshot of Storybook in light and dark mode -

Theming

-

Theme Storybook's UI to personalize it to your project.

- Learn more -
-
-
-
-
-
-

Addons

-

Integrate your tools with Storybook to connect workflows.

- Discover all addons -
-
- Integrate your tools with Storybook to connect workflows. -
-
- -
-
- Github logo - Join our contributors building the future of UI development. - - Star on GitHub -
-
- Discord logo -
- Get support and chat with frontend developers. - - Join Discord server -
-
-
- Youtube logo -
- Watch tutorials, feature previews and interviews. - - Watch on YouTube -
-
-
- A book -

Follow guided walkthroughs on for key workflows.

- - Discover tutorials -
-
- - diff --git a/packages/pro-components/src/stories/Header.stories.ts b/packages/pro-components/src/stories/Header.stories.ts deleted file mode 100644 index 254aa88..0000000 --- a/packages/pro-components/src/stories/Header.stories.ts +++ /dev/null @@ -1,33 +0,0 @@ -import type { Meta, StoryObj } from "@storybook/react" -import { fn } from "@storybook/test" - -import { Header } from "./Header" - -const meta = { - title: "Example/Header", - component: Header, - // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs - tags: ["autodocs"], - parameters: { - // More on how to position stories at: https://storybook.js.org/docs/configure/story-layout - layout: "fullscreen", - }, - args: { - onLogin: fn(), - onLogout: fn(), - onCreateAccount: fn(), - }, -} satisfies Meta - -export default meta -type Story = StoryObj - -export const LoggedIn: Story = { - args: { - user: { - name: "Jane Doe", - }, - }, -} - -export const LoggedOut: Story = {} diff --git a/packages/pro-components/src/stories/Header.tsx b/packages/pro-components/src/stories/Header.tsx deleted file mode 100644 index cc9a30e..0000000 --- a/packages/pro-components/src/stories/Header.tsx +++ /dev/null @@ -1,57 +0,0 @@ -import "./header.css" - -import React from "react" - -import { Button } from "./Button" - -type User = { - name: string -} - -export interface HeaderProps { - user?: User - onLogin?: () => void - onLogout?: () => void - onCreateAccount?: () => void -} - -export const Header = ({ user, onLogin, onLogout, onCreateAccount }: HeaderProps) => ( -
-
-
- - - - - - - -

Acme

-
-
- {user ? ( - <> - - Welcome, {user.name}! - -
-
-
-) diff --git a/packages/pro-components/src/stories/Page.stories.ts b/packages/pro-components/src/stories/Page.stories.ts deleted file mode 100644 index 3c63952..0000000 --- a/packages/pro-components/src/stories/Page.stories.ts +++ /dev/null @@ -1,32 +0,0 @@ -import type { Meta, StoryObj } from "@storybook/react" -import { expect, userEvent, within } from "@storybook/test" - -import { Page } from "./Page" - -const meta = { - title: "Example/Page", - component: Page, - parameters: { - // More on how to position stories at: https://storybook.js.org/docs/configure/story-layout - layout: "fullscreen", - }, -} satisfies Meta - -export default meta -type Story = StoryObj - -export const LoggedOut: Story = {} - -// More on interaction testing: https://storybook.js.org/docs/writing-tests/interaction-testing -export const LoggedIn: Story = { - play: async ({ canvasElement }) => { - const canvas = within(canvasElement) - const loginButton = canvas.getByRole("button", { name: /Log in/i }) - await expect(loginButton).toBeInTheDocument() - await userEvent.click(loginButton) - await expect(loginButton).not.toBeInTheDocument() - - const logoutButton = canvas.getByRole("button", { name: /Log out/i }) - await expect(logoutButton).toBeInTheDocument() - }, -} diff --git a/packages/pro-components/src/stories/Page.tsx b/packages/pro-components/src/stories/Page.tsx deleted file mode 100644 index e6fcc76..0000000 --- a/packages/pro-components/src/stories/Page.tsx +++ /dev/null @@ -1,81 +0,0 @@ -import "./page.css" - -import React from "react" - -import { Header } from "./Header" - -type User = { - name: string -} - -export const Page: React.FC = () => { - const [user, setUser] = React.useState() - - return ( -
-
setUser({ name: "Jane Doe" })} - onLogout={() => setUser(undefined)} - onCreateAccount={() => setUser({ name: "Jane Doe" })} - /> - -
-

Pages in Storybook

-

- 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. -
  • -
-

- Get a guided tutorial on component-driven development at - {" "} - - Storybook tutorials - - . Read more in the - {" "} - - docs - - . -

-
- Tip - {" "} - Adjust the width of the canvas with the - {" "} - - - - - - Viewports addon in the toolbar -
-
-
- ) -} diff --git a/packages/pro-components/src/stories/assets/accessibility.png b/packages/pro-components/src/stories/assets/accessibility.png deleted file mode 100644 index 6ffe6fe..0000000 Binary files a/packages/pro-components/src/stories/assets/accessibility.png and /dev/null differ diff --git a/packages/pro-components/src/stories/assets/accessibility.svg b/packages/pro-components/src/stories/assets/accessibility.svg deleted file mode 100644 index 107e93f..0000000 --- a/packages/pro-components/src/stories/assets/accessibility.svg +++ /dev/null @@ -1 +0,0 @@ -Accessibility \ No newline at end of file diff --git a/packages/pro-components/src/stories/assets/addon-library.png b/packages/pro-components/src/stories/assets/addon-library.png deleted file mode 100644 index 95deb38..0000000 Binary files a/packages/pro-components/src/stories/assets/addon-library.png and /dev/null differ diff --git a/packages/pro-components/src/stories/assets/assets.png b/packages/pro-components/src/stories/assets/assets.png deleted file mode 100644 index cfba681..0000000 Binary files a/packages/pro-components/src/stories/assets/assets.png and /dev/null differ diff --git a/packages/pro-components/src/stories/assets/avif-test-image.avif b/packages/pro-components/src/stories/assets/avif-test-image.avif deleted file mode 100644 index 530709b..0000000 Binary files a/packages/pro-components/src/stories/assets/avif-test-image.avif and /dev/null differ diff --git a/packages/pro-components/src/stories/assets/context.png b/packages/pro-components/src/stories/assets/context.png deleted file mode 100644 index e5cd249..0000000 Binary files a/packages/pro-components/src/stories/assets/context.png and /dev/null differ diff --git a/packages/pro-components/src/stories/assets/discord.svg b/packages/pro-components/src/stories/assets/discord.svg deleted file mode 100644 index d638958..0000000 --- a/packages/pro-components/src/stories/assets/discord.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/packages/pro-components/src/stories/assets/docs.png b/packages/pro-components/src/stories/assets/docs.png deleted file mode 100644 index a749629..0000000 Binary files a/packages/pro-components/src/stories/assets/docs.png and /dev/null differ diff --git a/packages/pro-components/src/stories/assets/figma-plugin.png b/packages/pro-components/src/stories/assets/figma-plugin.png deleted file mode 100644 index 8f79b08..0000000 Binary files a/packages/pro-components/src/stories/assets/figma-plugin.png and /dev/null differ diff --git a/packages/pro-components/src/stories/assets/github.svg b/packages/pro-components/src/stories/assets/github.svg deleted file mode 100644 index dc51352..0000000 --- a/packages/pro-components/src/stories/assets/github.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/packages/pro-components/src/stories/assets/share.png b/packages/pro-components/src/stories/assets/share.png deleted file mode 100644 index 8097a37..0000000 Binary files a/packages/pro-components/src/stories/assets/share.png and /dev/null differ diff --git a/packages/pro-components/src/stories/assets/styling.png b/packages/pro-components/src/stories/assets/styling.png deleted file mode 100644 index d341e82..0000000 Binary files a/packages/pro-components/src/stories/assets/styling.png and /dev/null differ diff --git a/packages/pro-components/src/stories/assets/testing.png b/packages/pro-components/src/stories/assets/testing.png deleted file mode 100644 index d4ac39a..0000000 Binary files a/packages/pro-components/src/stories/assets/testing.png and /dev/null differ diff --git a/packages/pro-components/src/stories/assets/theming.png b/packages/pro-components/src/stories/assets/theming.png deleted file mode 100644 index 1535eb9..0000000 Binary files a/packages/pro-components/src/stories/assets/theming.png and /dev/null differ diff --git a/packages/pro-components/src/stories/assets/tutorials.svg b/packages/pro-components/src/stories/assets/tutorials.svg deleted file mode 100644 index b492a9c..0000000 --- a/packages/pro-components/src/stories/assets/tutorials.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/packages/pro-components/src/stories/assets/youtube.svg b/packages/pro-components/src/stories/assets/youtube.svg deleted file mode 100644 index a7515d7..0000000 --- a/packages/pro-components/src/stories/assets/youtube.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/packages/pro-components/src/stories/button.css b/packages/pro-components/src/stories/button.css deleted file mode 100644 index 94d674b..0000000 --- a/packages/pro-components/src/stories/button.css +++ /dev/null @@ -1,30 +0,0 @@ -.storybook-button { - display: inline-block; - cursor: pointer; - border: 0; - border-radius: 3em; - font-weight: 700; - line-height: 1; - font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; -} -.storybook-button--primary { - background-color: #1ea7fd; - color: white; -} -.storybook-button--secondary { - box-shadow: rgba(0, 0, 0, 0.15) 0px 0px 0px 1px inset; - background-color: transparent; - color: #333; -} -.storybook-button--small { - padding: 10px 16px; - font-size: 12px; -} -.storybook-button--medium { - padding: 11px 20px; - font-size: 14px; -} -.storybook-button--large { - padding: 12px 24px; - font-size: 16px; -} diff --git a/packages/pro-components/src/stories/header.css b/packages/pro-components/src/stories/header.css deleted file mode 100644 index 5efd46c..0000000 --- a/packages/pro-components/src/stories/header.css +++ /dev/null @@ -1,32 +0,0 @@ -.storybook-header { - display: flex; - justify-content: space-between; - align-items: center; - border-bottom: 1px solid rgba(0, 0, 0, 0.1); - padding: 15px 20px; - font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; -} - -.storybook-header svg { - display: inline-block; - vertical-align: top; -} - -.storybook-header h1 { - display: inline-block; - vertical-align: top; - margin: 6px 0 6px 10px; - font-weight: 700; - font-size: 20px; - line-height: 1; -} - -.storybook-header button + button { - margin-left: 10px; -} - -.storybook-header .welcome { - margin-right: 10px; - color: #333; - font-size: 14px; -} diff --git a/packages/pro-components/src/stories/page.css b/packages/pro-components/src/stories/page.css deleted file mode 100644 index 87f7ecb..0000000 --- a/packages/pro-components/src/stories/page.css +++ /dev/null @@ -1,69 +0,0 @@ -.storybook-page { - margin: 0 auto; - padding: 48px 20px; - max-width: 600px; - color: #333; - font-size: 14px; - line-height: 24px; - font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; -} - -.storybook-page h2 { - display: inline-block; - vertical-align: top; - margin: 0 0 4px; - font-weight: 700; - font-size: 32px; - line-height: 1; -} - -.storybook-page p { - margin: 1em 0; -} - -.storybook-page a { - color: #1ea7fd; - text-decoration: none; -} - -.storybook-page ul { - margin: 1em 0; - padding-left: 30px; -} - -.storybook-page li { - margin-bottom: 8px; -} - -.storybook-page .tip { - display: inline-block; - vertical-align: top; - margin-right: 10px; - border-radius: 1em; - background: #e7fdd8; - padding: 4px 12px; - color: #66bf3c; - font-weight: 700; - font-size: 11px; - line-height: 12px; -} - -.storybook-page .tip-wrapper { - margin-top: 40px; - margin-bottom: 40px; - font-size: 13px; - line-height: 20px; -} - -.storybook-page .tip-wrapper svg { - display: inline-block; - vertical-align: top; - margin-top: 3px; - margin-right: 4px; - width: 12px; - height: 12px; -} - -.storybook-page .tip-wrapper svg path { - fill: #1ea7fd; -} diff --git a/packages/pro-components/tailwind.config.ts b/packages/pro-components/tailwind.config.ts new file mode 100644 index 0000000..edd381e --- /dev/null +++ b/packages/pro-components/tailwind.config.ts @@ -0,0 +1,146 @@ +import uiConfig from "@repo/ui/tailwind.config.ts" +import tailwindcssTypographyPlugin from "@tailwindcss/typography" +import type { Config } from "tailwindcss" +import animatePlugin from "tailwindcss-animate" + +export default { + ...uiConfig, + darkMode: ["class"], + content: [ + "../../packages/ui/src/**/*.{js,ts,jsx,tsx}", + "../../packages/pro-components/src/**/*.{js,ts,jsx,tsx}", + "./pages/**/*.{ts,tsx}", + "./components/**/*.{ts,tsx}", + "./app/**/*.{ts,tsx}", + "./src/**/*.{ts,tsx}", + "./src/**/*.stories.{ts,tsx}", + "./stories/**/*.stories.{ts,tsx}", + ], + prefix: "", + theme: { + container: { + center: true, + padding: "2rem", + screens: { + "2xl": "1400px", + }, + }, + extend: { + colors: { + border: "hsl(var(--border))", + input: "hsl(var(--input))", + ring: "hsl(var(--ring))", + background: "hsl(var(--background))", + foreground: "hsl(var(--foreground))", + primary: { + DEFAULT: "hsl(var(--primary))", + foreground: "hsl(var(--primary-foreground))", + }, + secondary: { + DEFAULT: "hsl(var(--secondary))", + foreground: "hsl(var(--secondary-foreground))", + }, + destructive: { + DEFAULT: "hsl(var(--destructive))", + foreground: "hsl(var(--destructive-foreground))", + }, + muted: { + DEFAULT: "hsl(var(--muted))", + foreground: "hsl(var(--muted-foreground))", + }, + accent: { + DEFAULT: "hsl(var(--accent))", + foreground: "hsl(var(--accent-foreground))", + }, + popover: { + DEFAULT: "hsl(var(--popover))", + foreground: "hsl(var(--popover-foreground))", + }, + card: { + DEFAULT: "hsl(var(--card))", + foreground: "hsl(var(--card-foreground))", + }, + sidebar: { + "DEFAULT": "hsl(var(--sidebar-background))", + "foreground": "hsl(var(--sidebar-foreground))", + "primary": "hsl(var(--sidebar-primary))", + "primary-foreground": "hsl(var(--sidebar-primary-foreground))", + "accent": "hsl(var(--sidebar-accent))", + "accent-foreground": "hsl(var(--sidebar-accent-foreground))", + "border": "hsl(var(--sidebar-border))", + "ring": "hsl(var(--sidebar-ring))", + }, + }, + borderRadius: { + lg: "var(--radius)", + md: "calc(var(--radius) - 2px)", + sm: "calc(var(--radius) - 4px)", + }, + keyframes: { + "accordion-down": { + from: { + height: "0", + }, + to: { + height: "var(--radix-accordion-content-height)", + }, + }, + "accordion-up": { + from: { + height: "var(--radix-accordion-content-height)", + }, + to: { + height: "0", + }, + }, + "caret-blink": { + "0%,70%,100%": { + opacity: "1", + }, + "20%,50%": { + opacity: "0", + }, + }, + "roll-reveal": { + from: { + transform: "rotate(12deg) scale(0)", + opacity: "0", + }, + to: { + transform: "rotate(0deg) scale(1)", + opacity: "1", + }, + }, + "slide-left": { + from: { + transform: "translateX(20px)", + opacity: "0", + }, + to: { + transform: "translateX(0px)", + opacity: "1", + }, + }, + "slide-top": { + from: { + transform: "translateY(20px)", + opacity: "0", + }, + to: { + transform: "translateY(0px)", + opacity: "1", + }, + }, + }, + animation: { + "accordion-down": "accordion-down 0.2s ease-out", + "accordion-up": "accordion-up 0.2s ease-out", + "caret-blink": "caret-blink 1.25s ease-out infinite", + "roll-reveal": "roll-reveal 0.4s cubic-bezier(.22,1.28,.54,.99)", + "slide-left": "slide-left 0.3s ease-out", + "slide-top": "slide-top 0.3s ease-out", + }, + }, + }, + plugins: [animatePlugin, tailwindcssTypographyPlugin], +} satisfies Config diff --git a/packages/pro-components/tsconfig.app.json b/packages/pro-components/tsconfig.app.json index c389006..1142eae 100644 --- a/packages/pro-components/tsconfig.app.json +++ b/packages/pro-components/tsconfig.app.json @@ -1,6 +1,5 @@ { "compilerOptions": { - "target": "ES2020", "useDefineForClassFields": true, "lib": ["ES2020", "DOM", "DOM.Iterable"], @@ -19,7 +18,11 @@ "strict": true, "noUnusedLocals": true, "noUnusedParameters": true, - "noFallthroughCasesInSwitch": true + "noFallthroughCasesInSwitch": true, + "baseUrl": ".", + "paths": { + "@/*": ["./src/*"] + } }, "include": ["src"] } diff --git a/packages/pro-components/tsconfig.node.json b/packages/pro-components/tsconfig.node.json index abcd7f0..232ec7b 100644 --- a/packages/pro-components/tsconfig.node.json +++ b/packages/pro-components/tsconfig.node.json @@ -18,7 +18,12 @@ "noUnusedLocals": true, "noUnusedParameters": true, "noFallthroughCasesInSwitch": true, - "noUncheckedSideEffectImports": true + "noUncheckedSideEffectImports": true, + /* Paths */ + "baseUrl": ".", + "paths": { + "@/*": ["./src/*"] + } }, "include": ["vite.config.ts"] } diff --git a/packages/pro-components/vite.config.ts b/packages/pro-components/vite.config.ts index 175c964..9e5edcf 100644 --- a/packages/pro-components/vite.config.ts +++ b/packages/pro-components/vite.config.ts @@ -1,7 +1,7 @@ import react from "@vitejs/plugin-react-swc" import { defineConfig } from "vite" +import tsconfigPaths from "vite-tsconfig-paths" -// https://vite.dev/config/ export default defineConfig({ - plugins: [react()], + plugins: [react(), tsconfigPaths()], }) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1b7f48d..1cff503 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -32,7 +32,7 @@ importers: version: 9.14.0(jiti@1.21.6) eslint-config-hyoban: specifier: ^3.1.12 - version: 3.1.12(@typescript-eslint/eslint-plugin@8.12.2(@typescript-eslint/parser@8.12.2(eslint@9.14.0(jiti@1.21.6))(typescript@5.6.3))(eslint@9.14.0(jiti@1.21.6))(typescript@5.6.3))(eslint@9.14.0(jiti@1.21.6))(tailwindcss@3.4.14)(typescript@5.6.3) + version: 3.1.12(@typescript-eslint/eslint-plugin@8.12.2(@typescript-eslint/parser@8.12.2(eslint@9.14.0(jiti@1.21.6))(typescript@5.6.3))(eslint@9.14.0(jiti@1.21.6))(typescript@5.6.3))(eslint@9.14.0(jiti@1.21.6))(tailwindcss@3.4.15)(typescript@5.6.3) eslint-plugin-storybook: specifier: ^0.11.0 version: 0.11.0(eslint@9.14.0(jiti@1.21.6))(typescript@5.6.3) @@ -259,9 +259,6 @@ importers: tailwindcss: specifier: ^3.4.14 version: 3.4.14 - turbo: - specifier: ^2.2.3 - version: 2.2.3 typescript: specifier: ^5.6.3 version: 5.6.3 @@ -488,6 +485,12 @@ importers: '@vitejs/plugin-react-swc': specifier: ^3.5.0 version: 3.7.1(@swc/helpers@0.5.13)(vite@5.4.10(@types/node@22.9.3)(lightningcss@1.25.1)(terser@5.31.6)) + autoprefixer: + specifier: ^10.4.20 + version: 10.4.20(postcss@8.4.49) + clsx: + specifier: ^2.1.1 + version: 2.1.1 eslint: specifier: ^9.13.0 version: 9.14.0(jiti@1.21.6) @@ -503,9 +506,18 @@ importers: globals: specifier: ^15.11.0 version: 15.11.0 + postcss: + specifier: ^8.4.49 + version: 8.4.49 storybook: specifier: ^8.4.5 version: 8.4.5(prettier@3.3.3) + tailwind-merge: + specifier: ^2.5.4 + version: 2.5.4 + tailwindcss: + specifier: ^3.4.15 + version: 3.4.15 typescript: specifier: ~5.6.2 version: 5.6.3 @@ -515,6 +527,9 @@ importers: vite: specifier: ^5.4.10 version: 5.4.10(@types/node@22.9.3)(lightningcss@1.25.1)(terser@5.31.6) + vite-tsconfig-paths: + specifier: ^5.0.1 + version: 5.0.1(typescript@5.6.3)(vite@5.4.10(@types/node@22.9.3)(lightningcss@1.25.1)(terser@5.31.6)) packages/ui: dependencies: @@ -8434,6 +8449,10 @@ packages: resolution: {integrity: sha512-56rxCq7G/XfB4EkXq9Egn5GCqugWvDFjafDOThIdMBsI15iqPqR5r15TfSr1YPYeEI19YeaXMCbY6u88Y76GLQ==} engines: {node: ^10 || ^12 || >=14} + postcss@8.4.49: + resolution: {integrity: sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA==} + engines: {node: ^10 || ^12 || >=14} + postgres-array@2.0.0: resolution: {integrity: sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==} engines: {node: '>=4'} @@ -9476,6 +9495,11 @@ packages: engines: {node: '>=14.0.0'} hasBin: true + tailwindcss@3.4.15: + resolution: {integrity: sha512-r4MeXnfBmSOuKUWmXe6h2CcyfzJCEk4F0pptO5jlnYSIViUkVmsawj80N5h2lO3gwcmSb4n3PuN+e+GC1Guylw==} + engines: {node: '>=14.0.0'} + hasBin: true + tapable@2.2.1: resolution: {integrity: sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==} engines: {node: '>=6'} @@ -9644,70 +9668,36 @@ packages: engines: {node: '>=18.0.0'} hasBin: true - turbo-darwin-64@2.2.3: - resolution: {integrity: sha512-Rcm10CuMKQGcdIBS3R/9PMeuYnv6beYIHqfZFeKWVYEWH69sauj4INs83zKMTUiZJ3/hWGZ4jet9AOwhsssLyg==} - cpu: [x64] - os: [darwin] - turbo-darwin-64@2.3.0: resolution: {integrity: sha512-pji+D49PhFItyQjf2QVoLZw2d3oRGo8gJgKyOiRzvip78Rzie74quA8XNwSg/DuzM7xx6gJ3p2/LylTTlgZXxQ==} cpu: [x64] os: [darwin] - turbo-darwin-arm64@2.2.3: - resolution: {integrity: sha512-+EIMHkuLFqUdJYsA3roj66t9+9IciCajgj+DVek+QezEdOJKcRxlvDOS2BUaeN8kEzVSsNiAGnoysFWYw4K0HA==} - cpu: [arm64] - os: [darwin] - turbo-darwin-arm64@2.3.0: resolution: {integrity: sha512-AJrGIL9BO41mwDF/IBHsNGwvtdyB911vp8f5mbNo1wG66gWTvOBg7WCtYQBvCo11XTenTfXPRSsAb7w3WAZb6w==} cpu: [arm64] os: [darwin] - turbo-linux-64@2.2.3: - resolution: {integrity: sha512-UBhJCYnqtaeOBQLmLo8BAisWbc9v9daL9G8upLR+XGj6vuN/Nz6qUAhverN4Pyej1g4Nt1BhROnj6GLOPYyqxQ==} - cpu: [x64] - os: [linux] - turbo-linux-64@2.3.0: resolution: {integrity: sha512-jZqW6vc2sPJT3M/3ZmV1Cg4ecQVPqsbHncG/RnogHpBu783KCSXIndgxvUQNm9qfgBYbZDBnP1md63O4UTElhw==} cpu: [x64] os: [linux] - turbo-linux-arm64@2.2.3: - resolution: {integrity: sha512-hJYT9dN06XCQ3jBka/EWvvAETnHRs3xuO/rb5bESmDfG+d9yQjeTMlhRXKrr4eyIMt6cLDt1LBfyi+6CQ+VAwQ==} - cpu: [arm64] - os: [linux] - turbo-linux-arm64@2.3.0: resolution: {integrity: sha512-HUbDLJlvd/hxuyCNO0BmEWYQj0TugRMvSQeG8vHJH+Lq8qOgDAe7J0K73bFNbZejZQxW3C3XEiZFB3pnpO78+A==} cpu: [arm64] os: [linux] - turbo-windows-64@2.2.3: - resolution: {integrity: sha512-NPrjacrZypMBF31b4HE4ROg4P3nhMBPHKS5WTpMwf7wydZ8uvdEHpESVNMOtqhlp857zbnKYgP+yJF30H3N2dQ==} - cpu: [x64] - os: [win32] - turbo-windows-64@2.3.0: resolution: {integrity: sha512-c5rxrGNTYDWX9QeMzWLFE9frOXnKjHGEvQMp1SfldDlbZYsloX9UKs31TzUThzfTgTiz8NYuShaXJ2UvTMnV/g==} cpu: [x64] os: [win32] - turbo-windows-arm64@2.2.3: - resolution: {integrity: sha512-fnNrYBCqn6zgKPKLHu4sOkihBI/+0oYFr075duRxqUZ+1aLWTAGfHZLgjVeLh3zR37CVzuerGIPWAEkNhkWEIw==} - cpu: [arm64] - os: [win32] - turbo-windows-arm64@2.3.0: resolution: {integrity: sha512-7qfUuYhfIVb1AZgs89DxhXK+zZez6O2ocmixEQ4hXZK7ytnBt5vaz2zGNJJKFNYIL5HX1C3tuHolnpNgDNCUIg==} cpu: [arm64] os: [win32] - turbo@2.2.3: - resolution: {integrity: sha512-5lDvSqIxCYJ/BAd6rQGK/AzFRhBkbu4JHVMLmGh/hCb7U3CqSnr5Tjwfy9vc+/5wG2DJ6wttgAaA7MoCgvBKZQ==} - hasBin: true - turbo@2.3.0: resolution: {integrity: sha512-/uOq5o2jwRPyaUDnwBpOR5k9mQq4c3wziBgWNWttiYQPmbhDtrKYPRBxTvA2WpgQwRIbt8UM612RMN8n/TvmHA==} hasBin: true @@ -14487,6 +14477,16 @@ snapshots: postcss: 8.4.47 postcss-value-parser: 4.2.0 + autoprefixer@10.4.20(postcss@8.4.49): + dependencies: + browserslist: 4.23.3 + caniuse-lite: 1.0.30001653 + fraction.js: 4.3.7 + normalize-range: 0.1.2 + picocolors: 1.1.1 + postcss: 8.4.49 + postcss-value-parser: 4.2.0 + available-typed-arrays@1.0.7: dependencies: possible-typed-array-names: 1.0.0 @@ -15738,7 +15738,7 @@ snapshots: eslint: 9.14.0(jiti@1.21.6) find-up-simple: 1.0.0 - eslint-config-hyoban@3.1.12(@typescript-eslint/eslint-plugin@8.12.2(@typescript-eslint/parser@8.12.2(eslint@9.14.0(jiti@1.21.6))(typescript@5.6.3))(eslint@9.14.0(jiti@1.21.6))(typescript@5.6.3))(eslint@9.14.0(jiti@1.21.6))(tailwindcss@3.4.14)(typescript@5.6.3): + eslint-config-hyoban@3.1.12(@typescript-eslint/eslint-plugin@8.12.2(@typescript-eslint/parser@8.12.2(eslint@9.14.0(jiti@1.21.6))(typescript@5.6.3))(eslint@9.14.0(jiti@1.21.6))(typescript@5.6.3))(eslint@9.14.0(jiti@1.21.6))(tailwindcss@3.4.15)(typescript@5.6.3): dependencies: '@eslint-react/eslint-plugin': 1.15.2(eslint@9.14.0(jiti@1.21.6))(typescript@5.6.3) '@eslint/js': 9.14.0 @@ -15759,7 +15759,7 @@ snapshots: eslint-plugin-react-refresh: 0.4.14(eslint@9.14.0(jiti@1.21.6)) eslint-plugin-regexp: 2.6.0(eslint@9.14.0(jiti@1.21.6)) eslint-plugin-simple-import-sort: 12.1.1(eslint@9.14.0(jiti@1.21.6)) - eslint-plugin-tailwindcss: 3.17.5(tailwindcss@3.4.14) + eslint-plugin-tailwindcss: 3.17.5(tailwindcss@3.4.15) eslint-plugin-unicorn: 56.0.0(eslint@9.14.0(jiti@1.21.6)) eslint-plugin-unused-imports: 4.1.4(@typescript-eslint/eslint-plugin@8.12.2(@typescript-eslint/parser@8.12.2(eslint@9.14.0(jiti@1.21.6))(typescript@5.6.3))(eslint@9.14.0(jiti@1.21.6))(typescript@5.6.3))(eslint@9.14.0(jiti@1.21.6)) globals: 15.11.0 @@ -16145,11 +16145,11 @@ snapshots: - supports-color - typescript - eslint-plugin-tailwindcss@3.17.5(tailwindcss@3.4.14): + eslint-plugin-tailwindcss@3.17.5(tailwindcss@3.4.15): dependencies: fast-glob: 3.3.2 postcss: 8.4.47 - tailwindcss: 3.4.14 + tailwindcss: 3.4.15 eslint-plugin-unicorn@56.0.0(eslint@9.14.0(jiti@1.21.6)): dependencies: @@ -19562,11 +19562,23 @@ snapshots: read-cache: 1.0.0 resolve: 1.22.8 + postcss-import@15.1.0(postcss@8.4.49): + dependencies: + postcss: 8.4.49 + postcss-value-parser: 4.2.0 + read-cache: 1.0.0 + resolve: 1.22.8 + postcss-js@4.0.1(postcss@8.4.47): dependencies: camelcase-css: 2.0.1 postcss: 8.4.47 + postcss-js@4.0.1(postcss@8.4.49): + dependencies: + camelcase-css: 2.0.1 + postcss: 8.4.49 + postcss-load-config@4.0.2(postcss@8.4.47): dependencies: lilconfig: 3.1.2 @@ -19574,11 +19586,23 @@ snapshots: optionalDependencies: postcss: 8.4.47 + postcss-load-config@4.0.2(postcss@8.4.49): + dependencies: + lilconfig: 3.1.2 + yaml: 2.6.1 + optionalDependencies: + postcss: 8.4.49 + postcss-nested@6.2.0(postcss@8.4.47): dependencies: postcss: 8.4.47 postcss-selector-parser: 6.1.2 + postcss-nested@6.2.0(postcss@8.4.49): + dependencies: + postcss: 8.4.49 + postcss-selector-parser: 6.1.2 + postcss-selector-parser@6.0.10: dependencies: cssesc: 3.0.0 @@ -19603,6 +19627,12 @@ snapshots: picocolors: 1.1.1 source-map-js: 1.2.1 + postcss@8.4.49: + dependencies: + nanoid: 3.3.7 + picocolors: 1.1.1 + source-map-js: 1.2.1 + postgres-array@2.0.0: {} postgres-array@3.0.2: {} @@ -20949,6 +20979,33 @@ snapshots: transitivePeerDependencies: - ts-node + tailwindcss@3.4.15: + dependencies: + '@alloc/quick-lru': 5.2.0 + arg: 5.0.2 + chokidar: 3.6.0 + didyoumean: 1.2.2 + dlv: 1.1.3 + fast-glob: 3.3.2 + glob-parent: 6.0.2 + is-glob: 4.0.3 + jiti: 1.21.6 + lilconfig: 2.1.0 + micromatch: 4.0.8 + normalize-path: 3.0.0 + object-hash: 3.0.0 + picocolors: 1.1.1 + postcss: 8.4.49 + postcss-import: 15.1.0(postcss@8.4.49) + postcss-js: 4.0.1(postcss@8.4.49) + postcss-load-config: 4.0.2(postcss@8.4.49) + postcss-nested: 6.2.0(postcss@8.4.49) + postcss-selector-parser: 6.1.2 + resolve: 1.22.8 + sucrase: 3.35.0 + transitivePeerDependencies: + - ts-node + tapable@2.2.1: {} tar-fs@3.0.6: @@ -21102,51 +21159,24 @@ snapshots: optionalDependencies: fsevents: 2.3.3 - turbo-darwin-64@2.2.3: - optional: true - turbo-darwin-64@2.3.0: optional: true - turbo-darwin-arm64@2.2.3: - optional: true - turbo-darwin-arm64@2.3.0: optional: true - turbo-linux-64@2.2.3: - optional: true - turbo-linux-64@2.3.0: optional: true - turbo-linux-arm64@2.2.3: - optional: true - turbo-linux-arm64@2.3.0: optional: true - turbo-windows-64@2.2.3: - optional: true - turbo-windows-64@2.3.0: optional: true - turbo-windows-arm64@2.2.3: - optional: true - turbo-windows-arm64@2.3.0: optional: true - turbo@2.2.3: - optionalDependencies: - turbo-darwin-64: 2.2.3 - turbo-darwin-arm64: 2.2.3 - turbo-linux-64: 2.2.3 - turbo-linux-arm64: 2.2.3 - turbo-windows-64: 2.2.3 - turbo-windows-arm64: 2.2.3 - turbo@2.3.0: optionalDependencies: turbo-darwin-64: 2.3.0 @@ -21610,10 +21640,21 @@ snapshots: - supports-color - typescript + vite-tsconfig-paths@5.0.1(typescript@5.6.3)(vite@5.4.10(@types/node@22.9.3)(lightningcss@1.25.1)(terser@5.31.6)): + dependencies: + debug: 4.3.6 + globrex: 0.1.2 + tsconfck: 3.1.1(typescript@5.6.3) + optionalDependencies: + vite: 5.4.10(@types/node@22.9.3)(lightningcss@1.25.1)(terser@5.31.6) + transitivePeerDependencies: + - supports-color + - typescript + vite@5.4.10(@types/node@20.17.5)(lightningcss@1.25.1)(terser@5.31.6): dependencies: esbuild: 0.21.5 - postcss: 8.4.47 + postcss: 8.4.49 rollup: 4.21.1 optionalDependencies: '@types/node': 20.17.5 @@ -21624,7 +21665,7 @@ snapshots: vite@5.4.10(@types/node@22.9.1)(lightningcss@1.25.1)(terser@5.31.6): dependencies: esbuild: 0.21.5 - postcss: 8.4.47 + postcss: 8.4.49 rollup: 4.21.1 optionalDependencies: '@types/node': 22.9.1 @@ -21635,7 +21676,7 @@ snapshots: vite@5.4.10(@types/node@22.9.3)(lightningcss@1.25.1)(terser@5.31.6): dependencies: esbuild: 0.21.5 - postcss: 8.4.47 + postcss: 8.4.49 rollup: 4.21.1 optionalDependencies: '@types/node': 22.9.3