From 79110bbb85ca008814ffa1e1baab42dc1aeaeb7e Mon Sep 17 00:00:00 2001
From: Joe Bell <7349341+joe-bell@users.noreply.github.com>
Date: Thu, 22 Jun 2023 16:21:18 +0300
Subject: [PATCH 01/22] feat: compound components
---
.../.gitignore | 24 +
.../index.html | 14 +
.../package.json | 26 ++
.../postcss.config.cjs | 6 +
.../public/vite.svg | 1 +
.../src/app.tsx | 76 ++++
.../src/components/index.ts | 1 +
.../src/components/nav/index.ts | 1 +
.../src/components/nav/nav.tsx | 107 +++++
.../src/index.css | 14 +
.../src/main.tsx | 9 +
.../src/vite-env.d.ts | 1 +
.../tailwind.config.cjs | 8 +
.../tsconfig.json | 21 +
.../tsconfig.node.json | 9 +
.../vite.config.ts | 7 +
pnpm-lock.yaml | 429 +++++++++++++++++-
17 files changed, 753 insertions(+), 1 deletion(-)
create mode 100644 examples/react-with-tailwindcss-compound/.gitignore
create mode 100644 examples/react-with-tailwindcss-compound/index.html
create mode 100644 examples/react-with-tailwindcss-compound/package.json
create mode 100644 examples/react-with-tailwindcss-compound/postcss.config.cjs
create mode 100644 examples/react-with-tailwindcss-compound/public/vite.svg
create mode 100644 examples/react-with-tailwindcss-compound/src/app.tsx
create mode 100644 examples/react-with-tailwindcss-compound/src/components/index.ts
create mode 100644 examples/react-with-tailwindcss-compound/src/components/nav/index.ts
create mode 100644 examples/react-with-tailwindcss-compound/src/components/nav/nav.tsx
create mode 100644 examples/react-with-tailwindcss-compound/src/index.css
create mode 100644 examples/react-with-tailwindcss-compound/src/main.tsx
create mode 100644 examples/react-with-tailwindcss-compound/src/vite-env.d.ts
create mode 100644 examples/react-with-tailwindcss-compound/tailwind.config.cjs
create mode 100644 examples/react-with-tailwindcss-compound/tsconfig.json
create mode 100644 examples/react-with-tailwindcss-compound/tsconfig.node.json
create mode 100644 examples/react-with-tailwindcss-compound/vite.config.ts
diff --git a/examples/react-with-tailwindcss-compound/.gitignore b/examples/react-with-tailwindcss-compound/.gitignore
new file mode 100644
index 00000000..a547bf36
--- /dev/null
+++ b/examples/react-with-tailwindcss-compound/.gitignore
@@ -0,0 +1,24 @@
+# Logs
+logs
+*.log
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+pnpm-debug.log*
+lerna-debug.log*
+
+node_modules
+dist
+dist-ssr
+*.local
+
+# Editor directories and files
+.vscode/*
+!.vscode/extensions.json
+.idea
+.DS_Store
+*.suo
+*.ntvs*
+*.njsproj
+*.sln
+*.sw?
diff --git a/examples/react-with-tailwindcss-compound/index.html b/examples/react-with-tailwindcss-compound/index.html
new file mode 100644
index 00000000..bb06f6a0
--- /dev/null
+++ b/examples/react-with-tailwindcss-compound/index.html
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+ cva: React with Tailwind CSS
+
+
+
+
+
+
+
diff --git a/examples/react-with-tailwindcss-compound/package.json b/examples/react-with-tailwindcss-compound/package.json
new file mode 100644
index 00000000..b3bfdbf0
--- /dev/null
+++ b/examples/react-with-tailwindcss-compound/package.json
@@ -0,0 +1,26 @@
+{
+ "name": "example-react-with-tailwindcss-compound",
+ "private": true,
+ "type": "module",
+ "scripts": {
+ "build": "pnpm check && vite build",
+ "check": "tsc",
+ "dev": "vite",
+ "preview": "vite preview"
+ },
+ "dependencies": {
+ "class-variance-authority": "latest",
+ "react": "18.2.0",
+ "react-dom": "18.2.0"
+ },
+ "devDependencies": {
+ "@types/react": "18.0.12",
+ "@types/react-dom": "18.0.5",
+ "@vitejs/plugin-react": "^3.1.0",
+ "autoprefixer": "^10.4.13",
+ "postcss": "^8.4.21",
+ "tailwindcss": "^3.3.2",
+ "typescript": "5.0.3",
+ "vite": "^4.1.0"
+ }
+}
diff --git a/examples/react-with-tailwindcss-compound/postcss.config.cjs b/examples/react-with-tailwindcss-compound/postcss.config.cjs
new file mode 100644
index 00000000..33ad091d
--- /dev/null
+++ b/examples/react-with-tailwindcss-compound/postcss.config.cjs
@@ -0,0 +1,6 @@
+module.exports = {
+ plugins: {
+ tailwindcss: {},
+ autoprefixer: {},
+ },
+}
diff --git a/examples/react-with-tailwindcss-compound/public/vite.svg b/examples/react-with-tailwindcss-compound/public/vite.svg
new file mode 100644
index 00000000..e7b8dfb1
--- /dev/null
+++ b/examples/react-with-tailwindcss-compound/public/vite.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/examples/react-with-tailwindcss-compound/src/app.tsx b/examples/react-with-tailwindcss-compound/src/app.tsx
new file mode 100644
index 00000000..8e409c2b
--- /dev/null
+++ b/examples/react-with-tailwindcss-compound/src/app.tsx
@@ -0,0 +1,76 @@
+import { cx } from "class-variance-authority";
+import * as Nav from "./components/nav";
+
+// ## Option 1
+//
+// ```tsx
+// import * as Nav from "./components/nav";
+//
+// const Consumer = () => (
+//
+//
+//
+// Home
+//
+//
+//
+// );
+// ```
+//
+// ## Option 2
+//
+// ```tsx
+// import * as nav from "./components/nav";
+//
+// const Consumer = () => (
+//
+// );
+// ```
+
+const density = ["compact", "cozy"] as const;
+
+function App() {
+ return (
+
+
+
+ {density.map((key) => (
+ {key}
+ ))}
+
+
+
+
+ {density.map((key) => (
+
+
+
+ {[0, 1, 2, 3, 4].map((_, i) => (
+
+ Item {i + 1}
+
+ ))}
+
+
+
+ ))}
+
+
+
+ );
+}
+
+export default App;
diff --git a/examples/react-with-tailwindcss-compound/src/components/index.ts b/examples/react-with-tailwindcss-compound/src/components/index.ts
new file mode 100644
index 00000000..870d3745
--- /dev/null
+++ b/examples/react-with-tailwindcss-compound/src/components/index.ts
@@ -0,0 +1 @@
+export * from "./nav";
diff --git a/examples/react-with-tailwindcss-compound/src/components/nav/index.ts b/examples/react-with-tailwindcss-compound/src/components/nav/index.ts
new file mode 100644
index 00000000..870d3745
--- /dev/null
+++ b/examples/react-with-tailwindcss-compound/src/components/nav/index.ts
@@ -0,0 +1 @@
+export * from "./nav";
diff --git a/examples/react-with-tailwindcss-compound/src/components/nav/nav.tsx b/examples/react-with-tailwindcss-compound/src/components/nav/nav.tsx
new file mode 100644
index 00000000..de67e0a5
--- /dev/null
+++ b/examples/react-with-tailwindcss-compound/src/components/nav/nav.tsx
@@ -0,0 +1,107 @@
+import React from "react";
+import { cva, type VariantProps } from "class-variance-authority";
+
+// note: `data-*` attributes not required, but useful.
+//
+//
+// Home
+//
+//
+// Home
+//
+// ;
+
+/* Root
+ ============================================ */
+
+export const root = cva(
+ [
+ "[--nav-item-py-offset:calc(var(--nav-item-py)*0.5*-1)]",
+ "flex",
+ "flex-col",
+ "rounded-[--nav-radius]",
+ "border",
+ "border-zinc-200",
+ "shadow-sm",
+ ],
+ {
+ variants: {
+ density: {
+ compact: [
+ "[--nav-radius:theme(borderRadius.lg)]",
+ "[--nav-item-px:theme(space.3)]",
+ "[--nav-item-py:theme(space.2)]",
+ ],
+ cozy: [
+ "[--nav-radius:theme(borderRadius.xl)]",
+ "[--nav-item-px:theme(space.5)]",
+ "[--nav-item-py:theme(space.4)]",
+ ],
+ },
+ },
+ defaultVariants: {
+ density: "compact",
+ },
+ }
+);
+
+export interface RootProps
+ extends React.HTMLAttributes,
+ VariantProps {}
+
+export const Root: React.FC = ({ className, density, ...props }) => (
+
+);
+
+/* Item
+ ============================================ */
+
+export const item = cva([
+ "[&+*]:mt-[--nav-item-py-offset]",
+ "[&>*]:first:rounded-t-[--nav-radius]",
+ "[&>*]:last:rounded-b-[--nav-radius]",
+]);
+
+export interface ItemProps
+ extends React.LiHTMLAttributes,
+ VariantProps {}
+
+export const Item: React.FC = ({ className, ...props }) => (
+
+);
+
+/* Link
+ ============================================ */
+
+export const link = cva([
+ "relative",
+ "flex",
+ "bg-transparent",
+ "font-light",
+ "text-sm",
+ "text-zinc-800",
+ "focus-visible:bg-white",
+ "hover:bg-zinc-50",
+ "hover:text-zinc-900",
+ "hover:z-20",
+ "focus-visible:z-30",
+ "focus-visible:outline-none",
+ "focus-visible:ring",
+ "focus-visible:ring-zinc-600",
+ "focus-visible:ring-2",
+ "px-[--nav-item-px]",
+ "py-[--nav-item-py]",
+]);
+
+export interface LinkProps
+ extends React.AnchorHTMLAttributes,
+ VariantProps {}
+
+export const Link: React.FC = ({ className, ...props }) => (
+
+);
diff --git a/examples/react-with-tailwindcss-compound/src/index.css b/examples/react-with-tailwindcss-compound/src/index.css
new file mode 100644
index 00000000..00c93c8b
--- /dev/null
+++ b/examples/react-with-tailwindcss-compound/src/index.css
@@ -0,0 +1,14 @@
+@tailwind base;
+
+:where(html, body, #root) {
+ width: 100%;
+ height: 100%;
+}
+
+:where(#root) {
+ @apply grid p-6;
+}
+
+@tailwind components;
+
+@tailwind utilities;
diff --git a/examples/react-with-tailwindcss-compound/src/main.tsx b/examples/react-with-tailwindcss-compound/src/main.tsx
new file mode 100644
index 00000000..bfb19b8c
--- /dev/null
+++ b/examples/react-with-tailwindcss-compound/src/main.tsx
@@ -0,0 +1,9 @@
+import React from "react";
+import ReactDOM from "react-dom/client";
+import App from "./app";
+
+ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
+
+
+
+);
diff --git a/examples/react-with-tailwindcss-compound/src/vite-env.d.ts b/examples/react-with-tailwindcss-compound/src/vite-env.d.ts
new file mode 100644
index 00000000..11f02fe2
--- /dev/null
+++ b/examples/react-with-tailwindcss-compound/src/vite-env.d.ts
@@ -0,0 +1 @@
+///
diff --git a/examples/react-with-tailwindcss-compound/tailwind.config.cjs b/examples/react-with-tailwindcss-compound/tailwind.config.cjs
new file mode 100644
index 00000000..ecf62b50
--- /dev/null
+++ b/examples/react-with-tailwindcss-compound/tailwind.config.cjs
@@ -0,0 +1,8 @@
+/** @type {import('tailwindcss').Config} */
+module.exports = {
+ content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"],
+ theme: {
+ extend: {},
+ },
+ plugins: [],
+};
diff --git a/examples/react-with-tailwindcss-compound/tsconfig.json b/examples/react-with-tailwindcss-compound/tsconfig.json
new file mode 100644
index 00000000..3d0a51a8
--- /dev/null
+++ b/examples/react-with-tailwindcss-compound/tsconfig.json
@@ -0,0 +1,21 @@
+{
+ "compilerOptions": {
+ "target": "ESNext",
+ "useDefineForClassFields": true,
+ "lib": ["DOM", "DOM.Iterable", "ESNext"],
+ "allowJs": false,
+ "skipLibCheck": true,
+ "esModuleInterop": false,
+ "allowSyntheticDefaultImports": true,
+ "strict": true,
+ "forceConsistentCasingInFileNames": true,
+ "module": "ESNext",
+ "moduleResolution": "Node",
+ "resolveJsonModule": true,
+ "isolatedModules": true,
+ "noEmit": true,
+ "jsx": "react-jsx"
+ },
+ "include": ["src"],
+ "references": [{ "path": "./tsconfig.node.json" }]
+}
diff --git a/examples/react-with-tailwindcss-compound/tsconfig.node.json b/examples/react-with-tailwindcss-compound/tsconfig.node.json
new file mode 100644
index 00000000..9d31e2ae
--- /dev/null
+++ b/examples/react-with-tailwindcss-compound/tsconfig.node.json
@@ -0,0 +1,9 @@
+{
+ "compilerOptions": {
+ "composite": true,
+ "module": "ESNext",
+ "moduleResolution": "Node",
+ "allowSyntheticDefaultImports": true
+ },
+ "include": ["vite.config.ts"]
+}
diff --git a/examples/react-with-tailwindcss-compound/vite.config.ts b/examples/react-with-tailwindcss-compound/vite.config.ts
new file mode 100644
index 00000000..9cc50ead
--- /dev/null
+++ b/examples/react-with-tailwindcss-compound/vite.config.ts
@@ -0,0 +1,7 @@
+import { defineConfig } from "vite";
+import react from "@vitejs/plugin-react";
+
+// https://vitejs.dev/config/
+export default defineConfig({
+ plugins: [react()],
+});
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index aae72a69..4203deef 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -217,6 +217,43 @@ importers:
specifier: ^5.2.10
version: 5.4.8(@types/node@20.12.7)
+ examples/react-with-tailwindcss-compound:
+ dependencies:
+ class-variance-authority:
+ specifier: latest
+ version: 0.7.1
+ react:
+ specifier: 18.2.0
+ version: 18.2.0
+ react-dom:
+ specifier: 18.2.0
+ version: 18.2.0(react@18.2.0)
+ devDependencies:
+ '@types/react':
+ specifier: 18.0.12
+ version: 18.0.12
+ '@types/react-dom':
+ specifier: 18.0.5
+ version: 18.0.5
+ '@vitejs/plugin-react':
+ specifier: ^3.1.0
+ version: 3.1.0(vite@4.5.5(@types/node@20.12.7))
+ autoprefixer:
+ specifier: ^10.4.13
+ version: 10.4.20(postcss@8.4.47)
+ postcss:
+ specifier: ^8.4.21
+ version: 8.4.47
+ tailwindcss:
+ specifier: ^3.3.2
+ version: 3.4.13(ts-node@10.9.2(@swc/core@1.4.16(@swc/helpers@0.5.2))(@types/node@20.12.7)(typescript@5.0.3))
+ typescript:
+ specifier: 5.0.3
+ version: 5.0.3
+ vite:
+ specifier: ^4.1.0
+ version: 4.5.5(@types/node@20.12.7)
+
examples/svelte:
devDependencies:
'@sveltejs/vite-plugin-svelte':
@@ -598,6 +635,12 @@ packages:
cpu: [ppc64]
os: [aix]
+ '@esbuild/android-arm64@0.18.20':
+ resolution: {integrity: sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==}
+ engines: {node: '>=12'}
+ cpu: [arm64]
+ os: [android]
+
'@esbuild/android-arm64@0.21.5':
resolution: {integrity: sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==}
engines: {node: '>=12'}
@@ -610,6 +653,12 @@ packages:
cpu: [arm64]
os: [android]
+ '@esbuild/android-arm@0.18.20':
+ resolution: {integrity: sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==}
+ engines: {node: '>=12'}
+ cpu: [arm]
+ os: [android]
+
'@esbuild/android-arm@0.21.5':
resolution: {integrity: sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==}
engines: {node: '>=12'}
@@ -622,6 +671,12 @@ packages:
cpu: [arm]
os: [android]
+ '@esbuild/android-x64@0.18.20':
+ resolution: {integrity: sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==}
+ engines: {node: '>=12'}
+ cpu: [x64]
+ os: [android]
+
'@esbuild/android-x64@0.21.5':
resolution: {integrity: sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==}
engines: {node: '>=12'}
@@ -634,6 +689,12 @@ packages:
cpu: [x64]
os: [android]
+ '@esbuild/darwin-arm64@0.18.20':
+ resolution: {integrity: sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==}
+ engines: {node: '>=12'}
+ cpu: [arm64]
+ os: [darwin]
+
'@esbuild/darwin-arm64@0.21.5':
resolution: {integrity: sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==}
engines: {node: '>=12'}
@@ -646,6 +707,12 @@ packages:
cpu: [arm64]
os: [darwin]
+ '@esbuild/darwin-x64@0.18.20':
+ resolution: {integrity: sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==}
+ engines: {node: '>=12'}
+ cpu: [x64]
+ os: [darwin]
+
'@esbuild/darwin-x64@0.21.5':
resolution: {integrity: sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==}
engines: {node: '>=12'}
@@ -658,6 +725,12 @@ packages:
cpu: [x64]
os: [darwin]
+ '@esbuild/freebsd-arm64@0.18.20':
+ resolution: {integrity: sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==}
+ engines: {node: '>=12'}
+ cpu: [arm64]
+ os: [freebsd]
+
'@esbuild/freebsd-arm64@0.21.5':
resolution: {integrity: sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==}
engines: {node: '>=12'}
@@ -670,6 +743,12 @@ packages:
cpu: [arm64]
os: [freebsd]
+ '@esbuild/freebsd-x64@0.18.20':
+ resolution: {integrity: sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==}
+ engines: {node: '>=12'}
+ cpu: [x64]
+ os: [freebsd]
+
'@esbuild/freebsd-x64@0.21.5':
resolution: {integrity: sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==}
engines: {node: '>=12'}
@@ -682,6 +761,12 @@ packages:
cpu: [x64]
os: [freebsd]
+ '@esbuild/linux-arm64@0.18.20':
+ resolution: {integrity: sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==}
+ engines: {node: '>=12'}
+ cpu: [arm64]
+ os: [linux]
+
'@esbuild/linux-arm64@0.21.5':
resolution: {integrity: sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==}
engines: {node: '>=12'}
@@ -694,6 +779,12 @@ packages:
cpu: [arm64]
os: [linux]
+ '@esbuild/linux-arm@0.18.20':
+ resolution: {integrity: sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==}
+ engines: {node: '>=12'}
+ cpu: [arm]
+ os: [linux]
+
'@esbuild/linux-arm@0.21.5':
resolution: {integrity: sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==}
engines: {node: '>=12'}
@@ -706,6 +797,12 @@ packages:
cpu: [arm]
os: [linux]
+ '@esbuild/linux-ia32@0.18.20':
+ resolution: {integrity: sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==}
+ engines: {node: '>=12'}
+ cpu: [ia32]
+ os: [linux]
+
'@esbuild/linux-ia32@0.21.5':
resolution: {integrity: sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==}
engines: {node: '>=12'}
@@ -718,6 +815,12 @@ packages:
cpu: [ia32]
os: [linux]
+ '@esbuild/linux-loong64@0.18.20':
+ resolution: {integrity: sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==}
+ engines: {node: '>=12'}
+ cpu: [loong64]
+ os: [linux]
+
'@esbuild/linux-loong64@0.21.5':
resolution: {integrity: sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==}
engines: {node: '>=12'}
@@ -730,6 +833,12 @@ packages:
cpu: [loong64]
os: [linux]
+ '@esbuild/linux-mips64el@0.18.20':
+ resolution: {integrity: sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==}
+ engines: {node: '>=12'}
+ cpu: [mips64el]
+ os: [linux]
+
'@esbuild/linux-mips64el@0.21.5':
resolution: {integrity: sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==}
engines: {node: '>=12'}
@@ -742,6 +851,12 @@ packages:
cpu: [mips64el]
os: [linux]
+ '@esbuild/linux-ppc64@0.18.20':
+ resolution: {integrity: sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==}
+ engines: {node: '>=12'}
+ cpu: [ppc64]
+ os: [linux]
+
'@esbuild/linux-ppc64@0.21.5':
resolution: {integrity: sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==}
engines: {node: '>=12'}
@@ -754,6 +869,12 @@ packages:
cpu: [ppc64]
os: [linux]
+ '@esbuild/linux-riscv64@0.18.20':
+ resolution: {integrity: sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==}
+ engines: {node: '>=12'}
+ cpu: [riscv64]
+ os: [linux]
+
'@esbuild/linux-riscv64@0.21.5':
resolution: {integrity: sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==}
engines: {node: '>=12'}
@@ -766,6 +887,12 @@ packages:
cpu: [riscv64]
os: [linux]
+ '@esbuild/linux-s390x@0.18.20':
+ resolution: {integrity: sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==}
+ engines: {node: '>=12'}
+ cpu: [s390x]
+ os: [linux]
+
'@esbuild/linux-s390x@0.21.5':
resolution: {integrity: sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==}
engines: {node: '>=12'}
@@ -778,6 +905,12 @@ packages:
cpu: [s390x]
os: [linux]
+ '@esbuild/linux-x64@0.18.20':
+ resolution: {integrity: sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==}
+ engines: {node: '>=12'}
+ cpu: [x64]
+ os: [linux]
+
'@esbuild/linux-x64@0.21.5':
resolution: {integrity: sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==}
engines: {node: '>=12'}
@@ -790,6 +923,12 @@ packages:
cpu: [x64]
os: [linux]
+ '@esbuild/netbsd-x64@0.18.20':
+ resolution: {integrity: sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==}
+ engines: {node: '>=12'}
+ cpu: [x64]
+ os: [netbsd]
+
'@esbuild/netbsd-x64@0.21.5':
resolution: {integrity: sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==}
engines: {node: '>=12'}
@@ -808,6 +947,12 @@ packages:
cpu: [arm64]
os: [openbsd]
+ '@esbuild/openbsd-x64@0.18.20':
+ resolution: {integrity: sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==}
+ engines: {node: '>=12'}
+ cpu: [x64]
+ os: [openbsd]
+
'@esbuild/openbsd-x64@0.21.5':
resolution: {integrity: sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==}
engines: {node: '>=12'}
@@ -820,6 +965,12 @@ packages:
cpu: [x64]
os: [openbsd]
+ '@esbuild/sunos-x64@0.18.20':
+ resolution: {integrity: sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==}
+ engines: {node: '>=12'}
+ cpu: [x64]
+ os: [sunos]
+
'@esbuild/sunos-x64@0.21.5':
resolution: {integrity: sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==}
engines: {node: '>=12'}
@@ -832,6 +983,12 @@ packages:
cpu: [x64]
os: [sunos]
+ '@esbuild/win32-arm64@0.18.20':
+ resolution: {integrity: sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==}
+ engines: {node: '>=12'}
+ cpu: [arm64]
+ os: [win32]
+
'@esbuild/win32-arm64@0.21.5':
resolution: {integrity: sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==}
engines: {node: '>=12'}
@@ -844,6 +1001,12 @@ packages:
cpu: [arm64]
os: [win32]
+ '@esbuild/win32-ia32@0.18.20':
+ resolution: {integrity: sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==}
+ engines: {node: '>=12'}
+ cpu: [ia32]
+ os: [win32]
+
'@esbuild/win32-ia32@0.21.5':
resolution: {integrity: sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==}
engines: {node: '>=12'}
@@ -856,6 +1019,12 @@ packages:
cpu: [ia32]
os: [win32]
+ '@esbuild/win32-x64@0.18.20':
+ resolution: {integrity: sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==}
+ engines: {node: '>=12'}
+ cpu: [x64]
+ os: [win32]
+
'@esbuild/win32-x64@0.21.5':
resolution: {integrity: sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==}
engines: {node: '>=12'}
@@ -1689,9 +1858,15 @@ packages:
'@types/pug@2.0.10':
resolution: {integrity: sha512-Sk/uYFOBAB7mb74XcpizmH0KOR2Pv3D2Hmrh1Dmy5BmK3MpdSa5kqZcg6EKBdklU0bFXX9gCfzvpnyUehrPIuA==}
+ '@types/react-dom@18.0.5':
+ resolution: {integrity: sha512-OWPWTUrY/NIrjsAPkAk1wW9LZeIjSvkXRhclsFO8CZcZGCOg2G0YZy4ft+rOyYxy8B7ui5iZzi9OkDebZ7/QSA==}
+
'@types/react-dom@18.2.25':
resolution: {integrity: sha512-o/V48vf4MQh7juIKZU2QGDfli6p1+OOi5oXx36Hffpc9adsHeXjVp8rHuPkjd8VT8sOJ2Zp05HR7CdpGTIUFUA==}
+ '@types/react@18.0.12':
+ resolution: {integrity: sha512-duF1OTASSBQtcigUvhuiTB1Ya3OvSy+xORCiEf20H0P0lzx+/KeVsA99U5UjLXSbyo1DRJDlLKqTeM1ngosqtg==}
+
'@types/react@18.2.79':
resolution: {integrity: sha512-RwGAGXPl9kSXwdNTafkOEuFrTBD5SA2B3iEB96xi8+xu5ddUa/cpvyVCSNn+asgLCTHkb5ZxN8gbuibYJi4s1w==}
@@ -1701,6 +1876,9 @@ packages:
'@types/sax@1.2.7':
resolution: {integrity: sha512-rO73L89PJxeYM3s3pPPjiPgVVcymqU490g0YO5n5By0k2Erzj6tay/4lr1CHAAU4JyOWd1rpQ8bCf6cZfHU96A==}
+ '@types/scheduler@0.23.0':
+ resolution: {integrity: sha512-YIoDCTH3Af6XM5VuwGG/QL/CJqga1Zm3NkU3HZ4ZHK2fRMPYP1VczsTUqtsf43PH/iJNVlPHAo2oWX7BSdB2Hw==}
+
'@types/unist@2.0.11':
resolution: {integrity: sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA==}
@@ -1729,6 +1907,12 @@ packages:
engines: {node: '>=16'}
hasBin: true
+ '@vitejs/plugin-react@3.1.0':
+ resolution: {integrity: sha512-AfgcRL8ZBhAlc3BFdigClmTUMISmmzHn7sB2h9U1odvc5U/MjWXsAaz18b/WoppUTDBzxOJwo2VdClfUcItu9g==}
+ engines: {node: ^14.18.0 || >=16.0.0}
+ peerDependencies:
+ vite: ^4.1.0-beta.0
+
'@vitejs/plugin-react@4.3.1':
resolution: {integrity: sha512-m/V2syj5CuVnaxcUJOQRel/Wr31FFXRFlnOoq1TVtkCxsY5veGMTEmpWHndrhB2U8ScHtCQB1e+4hWYExQc6Lg==}
engines: {node: ^14.18.0 || >=16.0.0}
@@ -2201,6 +2385,9 @@ packages:
class-variance-authority@0.7.0:
resolution: {integrity: sha512-jFI8IQw4hczaL4ALINxqLEXQbWcNjoSkloa4IaufXCJr6QawJyw7tuRysRsrE8w2p/4gGaxKIt/hX3qz/IbD1A==}
+ class-variance-authority@0.7.1:
+ resolution: {integrity: sha512-Ka+9Trutv7G8M6WT6SeiRWz792K5qEqIGEGzXKhAE6xOWAY6pPH8U+9IY3oCMv6kqTmLsv7Xh/2w2RigkePMsg==}
+
cli-boxes@3.0.0:
resolution: {integrity: sha512-/lzGpEWL/8PfI0BmBOPRwp0c/wFNX1RdUML3jK/RcSBA9T8mZDdQpqYBKtCFTOfQbwPqWEOpjqW+Fnayc0969g==}
engines: {node: '>=10'}
@@ -2811,6 +2998,11 @@ packages:
es6-promise@3.3.1:
resolution: {integrity: sha512-SOp9Phqvqn7jtEUxPWdWfWoLmyt2VaJ6MpvP9Comy1MceMXqE6bxvaTu4iaxpYYPzhny28Lc+M87/c2cPK6lDg==}
+ esbuild@0.18.20:
+ resolution: {integrity: sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==}
+ engines: {node: '>=12'}
+ hasBin: true
+
esbuild@0.21.5:
resolution: {integrity: sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==}
engines: {node: '>=12'}
@@ -3762,6 +3954,10 @@ packages:
resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==}
engines: {node: '>=10'}
+ magic-string@0.27.0:
+ resolution: {integrity: sha512-8UnnX2PeRAPZuN12svgR9j7M1uWMovg/CEnIwIG0LFkXSJJe4PdfUGiTGl8V9bsBHFUtfVINcSyYxd7q+kx9fA==}
+ engines: {node: '>=12'}
+
magic-string@0.30.11:
resolution: {integrity: sha512-+Wri9p0QHMy+545hKww7YAu5NyzF8iomPL/RQazugQ9+Ez4Ic3mERMd8ZTX5rfK944j+560ZJi8iAwgak1Ac7A==}
@@ -5060,6 +5256,11 @@ packages:
robust-predicates@3.0.2:
resolution: {integrity: sha512-IXgzBWvWQwE6PrDI05OvmXUIruQTcoMDzRsOd5CDvHCVLcLHMTSYvOK5Cm46kWqlV3yAbuSpBZdJ5oP5OUoStg==}
+ rollup@3.29.5:
+ resolution: {integrity: sha512-GVsDdsbJzzy4S/v3dqWPJ7EfvZJfCHiDqe80IyrF59LYuP+e6U1LJoUqeuqRbwAWoMNoXivMNeNAOf5E22VA1w==}
+ engines: {node: '>=14.18.0', npm: '>=8.0.0'}
+ hasBin: true
+
rollup@4.22.5:
resolution: {integrity: sha512-WoinX7GeQOFMGznEcWA1WrTQCd/tpEbMkc3nuMs9BT0CPjMdSjPMTVClwWd4pgSQwJdP65SK9mTCNvItlr5o7w==}
engines: {node: '>=18.0.0', npm: '>=8.0.0'}
@@ -5680,6 +5881,11 @@ packages:
typescript-auto-import-cache@0.3.3:
resolution: {integrity: sha512-ojEC7+Ci1ij9eE6hp8Jl9VUNnsEKzztktP5gtYNRMrTmfXVwA1PITYYAkpxCvvupdSYa/Re51B6KMcv1CTZEUA==}
+ typescript@5.0.3:
+ resolution: {integrity: sha512-xv8mOEDnigb/tN9PSMTwSEqAnUvkoXMQlicOb0IUVDBSQCgBSaAAROUZYy2IcUy5qU6XajK5jjjO7TMWqBTKZA==}
+ engines: {node: '>=12.20'}
+ hasBin: true
+
typescript@5.4.5:
resolution: {integrity: sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==}
engines: {node: '>=14.17'}
@@ -5821,6 +6027,34 @@ packages:
engines: {node: ^18.0.0 || >=20.0.0}
hasBin: true
+ vite@4.5.5:
+ resolution: {integrity: sha512-ifW3Lb2sMdX+WU91s3R0FyQlAyLxOzCSCP37ujw0+r5POeHPwe6udWVIElKQq8gk3t7b8rkmvqC6IHBpCff4GQ==}
+ engines: {node: ^14.18.0 || >=16.0.0}
+ hasBin: true
+ peerDependencies:
+ '@types/node': '>= 14'
+ less: '*'
+ lightningcss: ^1.21.0
+ sass: '*'
+ stylus: '*'
+ sugarss: '*'
+ terser: ^5.4.0
+ peerDependenciesMeta:
+ '@types/node':
+ optional: true
+ less:
+ optional: true
+ lightningcss:
+ optional: true
+ sass:
+ optional: true
+ stylus:
+ optional: true
+ sugarss:
+ optional: true
+ terser:
+ optional: true
+
vite@5.4.8:
resolution: {integrity: sha512-FqrItQ4DT1NC4zCUqMB4c4AZORMKIa0m8/URVCZ77OZ/QSNeJ54bU1vrFADbDsuwfIPcgknRkmqakQcgnL4GiQ==}
engines: {node: ^18.0.0 || >=20.0.0}
@@ -6554,102 +6788,153 @@ snapshots:
'@esbuild/aix-ppc64@0.23.1':
optional: true
+ '@esbuild/android-arm64@0.18.20':
+ optional: true
+
'@esbuild/android-arm64@0.21.5':
optional: true
'@esbuild/android-arm64@0.23.1':
optional: true
+ '@esbuild/android-arm@0.18.20':
+ optional: true
+
'@esbuild/android-arm@0.21.5':
optional: true
'@esbuild/android-arm@0.23.1':
optional: true
+ '@esbuild/android-x64@0.18.20':
+ optional: true
+
'@esbuild/android-x64@0.21.5':
optional: true
'@esbuild/android-x64@0.23.1':
optional: true
+ '@esbuild/darwin-arm64@0.18.20':
+ optional: true
+
'@esbuild/darwin-arm64@0.21.5':
optional: true
'@esbuild/darwin-arm64@0.23.1':
optional: true
+ '@esbuild/darwin-x64@0.18.20':
+ optional: true
+
'@esbuild/darwin-x64@0.21.5':
optional: true
'@esbuild/darwin-x64@0.23.1':
optional: true
+ '@esbuild/freebsd-arm64@0.18.20':
+ optional: true
+
'@esbuild/freebsd-arm64@0.21.5':
optional: true
'@esbuild/freebsd-arm64@0.23.1':
optional: true
+ '@esbuild/freebsd-x64@0.18.20':
+ optional: true
+
'@esbuild/freebsd-x64@0.21.5':
optional: true
'@esbuild/freebsd-x64@0.23.1':
optional: true
+ '@esbuild/linux-arm64@0.18.20':
+ optional: true
+
'@esbuild/linux-arm64@0.21.5':
optional: true
'@esbuild/linux-arm64@0.23.1':
optional: true
+ '@esbuild/linux-arm@0.18.20':
+ optional: true
+
'@esbuild/linux-arm@0.21.5':
optional: true
'@esbuild/linux-arm@0.23.1':
optional: true
+ '@esbuild/linux-ia32@0.18.20':
+ optional: true
+
'@esbuild/linux-ia32@0.21.5':
optional: true
'@esbuild/linux-ia32@0.23.1':
optional: true
+ '@esbuild/linux-loong64@0.18.20':
+ optional: true
+
'@esbuild/linux-loong64@0.21.5':
optional: true
'@esbuild/linux-loong64@0.23.1':
optional: true
+ '@esbuild/linux-mips64el@0.18.20':
+ optional: true
+
'@esbuild/linux-mips64el@0.21.5':
optional: true
'@esbuild/linux-mips64el@0.23.1':
optional: true
+ '@esbuild/linux-ppc64@0.18.20':
+ optional: true
+
'@esbuild/linux-ppc64@0.21.5':
optional: true
'@esbuild/linux-ppc64@0.23.1':
optional: true
+ '@esbuild/linux-riscv64@0.18.20':
+ optional: true
+
'@esbuild/linux-riscv64@0.21.5':
optional: true
'@esbuild/linux-riscv64@0.23.1':
optional: true
+ '@esbuild/linux-s390x@0.18.20':
+ optional: true
+
'@esbuild/linux-s390x@0.21.5':
optional: true
'@esbuild/linux-s390x@0.23.1':
optional: true
+ '@esbuild/linux-x64@0.18.20':
+ optional: true
+
'@esbuild/linux-x64@0.21.5':
optional: true
'@esbuild/linux-x64@0.23.1':
optional: true
+ '@esbuild/netbsd-x64@0.18.20':
+ optional: true
+
'@esbuild/netbsd-x64@0.21.5':
optional: true
@@ -6659,30 +6944,45 @@ snapshots:
'@esbuild/openbsd-arm64@0.23.1':
optional: true
+ '@esbuild/openbsd-x64@0.18.20':
+ optional: true
+
'@esbuild/openbsd-x64@0.21.5':
optional: true
'@esbuild/openbsd-x64@0.23.1':
optional: true
+ '@esbuild/sunos-x64@0.18.20':
+ optional: true
+
'@esbuild/sunos-x64@0.21.5':
optional: true
'@esbuild/sunos-x64@0.23.1':
optional: true
+ '@esbuild/win32-arm64@0.18.20':
+ optional: true
+
'@esbuild/win32-arm64@0.21.5':
optional: true
'@esbuild/win32-arm64@0.23.1':
optional: true
+ '@esbuild/win32-ia32@0.18.20':
+ optional: true
+
'@esbuild/win32-ia32@0.21.5':
optional: true
'@esbuild/win32-ia32@0.23.1':
optional: true
+ '@esbuild/win32-x64@0.18.20':
+ optional: true
+
'@esbuild/win32-x64@0.21.5':
optional: true
@@ -7431,10 +7731,20 @@ snapshots:
'@types/pug@2.0.10': {}
+ '@types/react-dom@18.0.5':
+ dependencies:
+ '@types/react': 18.2.79
+
'@types/react-dom@18.2.25':
dependencies:
'@types/react': 18.2.79
+ '@types/react@18.0.12':
+ dependencies:
+ '@types/prop-types': 15.7.13
+ '@types/scheduler': 0.23.0
+ csstype: 3.1.3
+
'@types/react@18.2.79':
dependencies:
'@types/prop-types': 15.7.13
@@ -7448,6 +7758,8 @@ snapshots:
dependencies:
'@types/node': 20.12.7
+ '@types/scheduler@0.23.0': {}
+
'@types/unist@2.0.11': {}
'@types/unist@3.0.3': {}
@@ -7481,6 +7793,17 @@ snapshots:
- encoding
- supports-color
+ '@vitejs/plugin-react@3.1.0(vite@4.5.5(@types/node@20.12.7))':
+ dependencies:
+ '@babel/core': 7.25.2
+ '@babel/plugin-transform-react-jsx-self': 7.24.7(@babel/core@7.25.2)
+ '@babel/plugin-transform-react-jsx-source': 7.24.7(@babel/core@7.25.2)
+ magic-string: 0.27.0
+ react-refresh: 0.14.2
+ vite: 4.5.5(@types/node@20.12.7)
+ transitivePeerDependencies:
+ - supports-color
+
'@vitejs/plugin-react@4.3.1(vite@5.4.8(@types/node@20.12.7))':
dependencies:
'@babel/core': 7.25.2
@@ -8146,6 +8469,10 @@ snapshots:
dependencies:
clsx: 2.0.0
+ class-variance-authority@0.7.1:
+ dependencies:
+ clsx: 2.1.1
+
cli-boxes@3.0.0: {}
cli-cursor@4.0.0:
@@ -8765,6 +9092,31 @@ snapshots:
es6-promise@3.3.1: {}
+ esbuild@0.18.20:
+ optionalDependencies:
+ '@esbuild/android-arm': 0.18.20
+ '@esbuild/android-arm64': 0.18.20
+ '@esbuild/android-x64': 0.18.20
+ '@esbuild/darwin-arm64': 0.18.20
+ '@esbuild/darwin-x64': 0.18.20
+ '@esbuild/freebsd-arm64': 0.18.20
+ '@esbuild/freebsd-x64': 0.18.20
+ '@esbuild/linux-arm': 0.18.20
+ '@esbuild/linux-arm64': 0.18.20
+ '@esbuild/linux-ia32': 0.18.20
+ '@esbuild/linux-loong64': 0.18.20
+ '@esbuild/linux-mips64el': 0.18.20
+ '@esbuild/linux-ppc64': 0.18.20
+ '@esbuild/linux-riscv64': 0.18.20
+ '@esbuild/linux-s390x': 0.18.20
+ '@esbuild/linux-x64': 0.18.20
+ '@esbuild/netbsd-x64': 0.18.20
+ '@esbuild/openbsd-x64': 0.18.20
+ '@esbuild/sunos-x64': 0.18.20
+ '@esbuild/win32-arm64': 0.18.20
+ '@esbuild/win32-ia32': 0.18.20
+ '@esbuild/win32-x64': 0.18.20
+
esbuild@0.21.5:
optionalDependencies:
'@esbuild/aix-ppc64': 0.21.5
@@ -9941,6 +10293,10 @@ snapshots:
dependencies:
yallist: 4.0.0
+ magic-string@0.27.0:
+ dependencies:
+ '@jridgewell/sourcemap-codec': 1.5.0
+
magic-string@0.30.11:
dependencies:
'@jridgewell/sourcemap-codec': 1.5.0
@@ -11157,7 +11513,7 @@ snapshots:
dependencies:
hosted-git-info: 7.0.2
proc-log: 4.2.0
- semver: 7.6.0
+ semver: 7.6.3
validate-npm-package-name: 5.0.1
npm-run-all@1.4.0:
@@ -11463,6 +11819,14 @@ snapshots:
camelcase-css: 2.0.1
postcss: 8.4.47
+ postcss-load-config@4.0.2(postcss@8.4.47)(ts-node@10.9.2(@swc/core@1.4.16(@swc/helpers@0.5.2))(@types/node@20.12.7)(typescript@5.0.3)):
+ dependencies:
+ lilconfig: 3.1.2
+ yaml: 2.5.1
+ optionalDependencies:
+ postcss: 8.4.47
+ ts-node: 10.9.2(@swc/core@1.4.16(@swc/helpers@0.5.2))(@types/node@20.12.7)(typescript@5.0.3)
+
postcss-load-config@4.0.2(postcss@8.4.47)(ts-node@10.9.2(@swc/core@1.4.16(@swc/helpers@0.5.2))(@types/node@20.12.7)(typescript@5.4.5)):
dependencies:
lilconfig: 3.1.2
@@ -11896,6 +12260,10 @@ snapshots:
robust-predicates@3.0.2: {}
+ rollup@3.29.5:
+ optionalDependencies:
+ fsevents: 2.3.3
+
rollup@4.22.5:
dependencies:
'@types/estree': 1.0.6
@@ -12439,6 +12807,33 @@ snapshots:
transitivePeerDependencies:
- typescript
+ tailwindcss@3.4.13(ts-node@10.9.2(@swc/core@1.4.16(@swc/helpers@0.5.2))(@types/node@20.12.7)(typescript@5.0.3)):
+ 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.0
+ postcss: 8.4.47
+ postcss-import: 15.1.0(postcss@8.4.47)
+ postcss-js: 4.0.1(postcss@8.4.47)
+ postcss-load-config: 4.0.2(postcss@8.4.47)(ts-node@10.9.2(@swc/core@1.4.16(@swc/helpers@0.5.2))(@types/node@20.12.7)(typescript@5.0.3))
+ postcss-nested: 6.2.0(postcss@8.4.47)
+ postcss-selector-parser: 6.1.2
+ resolve: 1.22.8
+ sucrase: 3.35.0
+ transitivePeerDependencies:
+ - ts-node
+
tailwindcss@3.4.13(ts-node@10.9.2(@swc/core@1.4.16(@swc/helpers@0.5.2))(@types/node@20.12.7)(typescript@5.4.5)):
dependencies:
'@alloc/quick-lru': 5.2.0
@@ -12552,6 +12947,27 @@ snapshots:
ts-interface-checker@0.1.13: {}
+ ts-node@10.9.2(@swc/core@1.4.16(@swc/helpers@0.5.2))(@types/node@20.12.7)(typescript@5.0.3):
+ dependencies:
+ '@cspotcode/source-map-support': 0.8.1
+ '@tsconfig/node10': 1.0.11
+ '@tsconfig/node12': 1.0.11
+ '@tsconfig/node14': 1.0.3
+ '@tsconfig/node16': 1.0.4
+ '@types/node': 20.12.7
+ acorn: 8.12.1
+ acorn-walk: 8.3.4
+ arg: 4.1.3
+ create-require: 1.1.1
+ diff: 4.0.2
+ make-error: 1.3.6
+ typescript: 5.0.3
+ v8-compile-cache-lib: 3.0.1
+ yn: 3.1.1
+ optionalDependencies:
+ '@swc/core': 1.4.16(@swc/helpers@0.5.2)
+ optional: true
+
ts-node@10.9.2(@swc/core@1.4.16(@swc/helpers@0.5.2))(@types/node@20.12.7)(typescript@5.4.5):
dependencies:
'@cspotcode/source-map-support': 0.8.1
@@ -12635,6 +13051,8 @@ snapshots:
dependencies:
semver: 7.6.3
+ typescript@5.0.3: {}
+
typescript@5.4.5: {}
ufo@1.5.4: {}
@@ -12852,6 +13270,15 @@ snapshots:
- supports-color
- terser
+ vite@4.5.5(@types/node@20.12.7):
+ dependencies:
+ esbuild: 0.18.20
+ postcss: 8.4.47
+ rollup: 3.29.5
+ optionalDependencies:
+ '@types/node': 20.12.7
+ fsevents: 2.3.3
+
vite@5.4.8(@types/node@20.12.7):
dependencies:
esbuild: 0.21.5
From 1d303dcf7f76142a28575ebf3942c087c3b53730 Mon Sep 17 00:00:00 2001
From: Joe Bell <7349341+joe-bell@users.noreply.github.com>
Date: Tue, 27 Jun 2023 19:44:20 +0300
Subject: [PATCH 02/22] docs: link to compound component example
---
docs/latest/pages/docs/examples/react/tailwind-css.mdx | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/docs/latest/pages/docs/examples/react/tailwind-css.mdx b/docs/latest/pages/docs/examples/react/tailwind-css.mdx
index b0678ef8..f5b562d1 100644
--- a/docs/latest/pages/docs/examples/react/tailwind-css.mdx
+++ b/docs/latest/pages/docs/examples/react/tailwind-css.mdx
@@ -6,3 +6,10 @@ import { StackBlitz } from "../../../../components/StackBlitz";
dir="examples/react-with-tailwindcss"
file="src/components/button/button.tsx"
/>
+
+## Compound Components
+
+
From 098e32de3d22fc337ae741194eb8b45f36e3a250 Mon Sep 17 00:00:00 2001
From: Joe Bell <7349341+joe-bell@users.noreply.github.com>
Date: Tue, 27 Jun 2023 19:53:45 +0300
Subject: [PATCH 03/22] docs: kick off compound components page
---
.../docs/examples/react/tailwind-css.mdx | 5 +++
.../pages/docs/getting-started/_meta.json | 5 ++-
.../getting-started/composing-components.mdx | 4 +-
.../getting-started/compound-components.mdx | 5 +++
.../getting-started/mixing-components.mdx | 44 +++++++++++++++++++
.../src/index.test.ts | 2 +-
6 files changed, 60 insertions(+), 5 deletions(-)
create mode 100644 docs/latest/pages/docs/getting-started/compound-components.mdx
create mode 100644 docs/latest/pages/docs/getting-started/mixing-components.mdx
diff --git a/docs/latest/pages/docs/examples/react/tailwind-css.mdx b/docs/latest/pages/docs/examples/react/tailwind-css.mdx
index f5b562d1..4fbc019b 100644
--- a/docs/latest/pages/docs/examples/react/tailwind-css.mdx
+++ b/docs/latest/pages/docs/examples/react/tailwind-css.mdx
@@ -2,6 +2,11 @@ import { StackBlitz } from "../../../../components/StackBlitz";
# React with Tailwind CSS
+1. [Basic Components](#basic-components)
+2. [Compound Components](#compound-components)
+
+## Basic Components
+
;
+export const box = cva(["box", "box-border"], {
+ variants: {
+ margin: { 0: "m-0", 2: "m-2", 4: "m-4", 8: "m-8" },
+ padding: { 0: "p-0", 2: "p-2", 4: "p-4", 8: "p-8" },
+ },
+ defaultVariants: {
+ margin: 0,
+ padding: 0,
+ },
+});
+
+/**
+ * Card
+ */
+type CardBaseProps = VariantProps;
+const cardBase = cva(["card", "border-solid", "border-slate-300", "rounded"], {
+ variants: {
+ shadow: {
+ md: "drop-shadow-md",
+ lg: "drop-shadow-lg",
+ xl: "drop-shadow-xl",
+ },
+ },
+});
+
+export interface CardProps extends BoxProps, CardBaseProps {}
+export const card = ({ margin, padding, shadow }: CardProps = {}) =>
+ cx(box({ margin, padding }), cardBase({ shadow }));
+```
diff --git a/packages/class-variance-authority/src/index.test.ts b/packages/class-variance-authority/src/index.test.ts
index 641a284c..2b0bf758 100644
--- a/packages/class-variance-authority/src/index.test.ts
+++ b/packages/class-variance-authority/src/index.test.ts
@@ -1656,7 +1656,7 @@ describe("cva", () => {
});
});
- describe("composing classes", () => {
+ describe("mixing classes", () => {
type BoxProps = CVA.VariantProps;
const box = cva(["box", "box-border"], {
variants: {
From dd2f58178ce80ee49f8cdf9cbb9929e6f421699b Mon Sep 17 00:00:00 2001
From: Joe Bell <7349341+joe-bell@users.noreply.github.com>
Date: Tue, 27 Jun 2023 19:55:49 +0300
Subject: [PATCH 04/22] fix: prettier and syncpack failures
---
.../package.json | 2 +-
.../postcss.config.cjs | 2 +-
pnpm-lock.yaml | 26 +++++++++----------
3 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/examples/react-with-tailwindcss-compound/package.json b/examples/react-with-tailwindcss-compound/package.json
index b3bfdbf0..d68da02a 100644
--- a/examples/react-with-tailwindcss-compound/package.json
+++ b/examples/react-with-tailwindcss-compound/package.json
@@ -20,7 +20,7 @@
"autoprefixer": "^10.4.13",
"postcss": "^8.4.21",
"tailwindcss": "^3.3.2",
- "typescript": "5.0.3",
+ "typescript": "5.1.3",
"vite": "^4.1.0"
}
}
diff --git a/examples/react-with-tailwindcss-compound/postcss.config.cjs b/examples/react-with-tailwindcss-compound/postcss.config.cjs
index 33ad091d..12a703d9 100644
--- a/examples/react-with-tailwindcss-compound/postcss.config.cjs
+++ b/examples/react-with-tailwindcss-compound/postcss.config.cjs
@@ -3,4 +3,4 @@ module.exports = {
tailwindcss: {},
autoprefixer: {},
},
-}
+};
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 4203deef..ee73ae9d 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -246,10 +246,10 @@ importers:
version: 8.4.47
tailwindcss:
specifier: ^3.3.2
- version: 3.4.13(ts-node@10.9.2(@swc/core@1.4.16(@swc/helpers@0.5.2))(@types/node@20.12.7)(typescript@5.0.3))
+ version: 3.4.13(ts-node@10.9.2(@swc/core@1.4.16(@swc/helpers@0.5.2))(@types/node@20.12.7)(typescript@5.1.3))
typescript:
- specifier: 5.0.3
- version: 5.0.3
+ specifier: 5.1.3
+ version: 5.1.3
vite:
specifier: ^4.1.0
version: 4.5.5(@types/node@20.12.7)
@@ -5881,9 +5881,9 @@ packages:
typescript-auto-import-cache@0.3.3:
resolution: {integrity: sha512-ojEC7+Ci1ij9eE6hp8Jl9VUNnsEKzztktP5gtYNRMrTmfXVwA1PITYYAkpxCvvupdSYa/Re51B6KMcv1CTZEUA==}
- typescript@5.0.3:
- resolution: {integrity: sha512-xv8mOEDnigb/tN9PSMTwSEqAnUvkoXMQlicOb0IUVDBSQCgBSaAAROUZYy2IcUy5qU6XajK5jjjO7TMWqBTKZA==}
- engines: {node: '>=12.20'}
+ typescript@5.1.3:
+ resolution: {integrity: sha512-XH627E9vkeqhlZFQuL+UsyAXEnibT0kWR2FWONlr4sTjvxyJYnyefgrkyECLzM5NenmKzRAy2rR/OlYLA1HkZw==}
+ engines: {node: '>=14.17'}
hasBin: true
typescript@5.4.5:
@@ -11819,13 +11819,13 @@ snapshots:
camelcase-css: 2.0.1
postcss: 8.4.47
- postcss-load-config@4.0.2(postcss@8.4.47)(ts-node@10.9.2(@swc/core@1.4.16(@swc/helpers@0.5.2))(@types/node@20.12.7)(typescript@5.0.3)):
+ postcss-load-config@4.0.2(postcss@8.4.47)(ts-node@10.9.2(@swc/core@1.4.16(@swc/helpers@0.5.2))(@types/node@20.12.7)(typescript@5.1.3)):
dependencies:
lilconfig: 3.1.2
yaml: 2.5.1
optionalDependencies:
postcss: 8.4.47
- ts-node: 10.9.2(@swc/core@1.4.16(@swc/helpers@0.5.2))(@types/node@20.12.7)(typescript@5.0.3)
+ ts-node: 10.9.2(@swc/core@1.4.16(@swc/helpers@0.5.2))(@types/node@20.12.7)(typescript@5.1.3)
postcss-load-config@4.0.2(postcss@8.4.47)(ts-node@10.9.2(@swc/core@1.4.16(@swc/helpers@0.5.2))(@types/node@20.12.7)(typescript@5.4.5)):
dependencies:
@@ -12807,7 +12807,7 @@ snapshots:
transitivePeerDependencies:
- typescript
- tailwindcss@3.4.13(ts-node@10.9.2(@swc/core@1.4.16(@swc/helpers@0.5.2))(@types/node@20.12.7)(typescript@5.0.3)):
+ tailwindcss@3.4.13(ts-node@10.9.2(@swc/core@1.4.16(@swc/helpers@0.5.2))(@types/node@20.12.7)(typescript@5.1.3)):
dependencies:
'@alloc/quick-lru': 5.2.0
arg: 5.0.2
@@ -12826,7 +12826,7 @@ snapshots:
postcss: 8.4.47
postcss-import: 15.1.0(postcss@8.4.47)
postcss-js: 4.0.1(postcss@8.4.47)
- postcss-load-config: 4.0.2(postcss@8.4.47)(ts-node@10.9.2(@swc/core@1.4.16(@swc/helpers@0.5.2))(@types/node@20.12.7)(typescript@5.0.3))
+ postcss-load-config: 4.0.2(postcss@8.4.47)(ts-node@10.9.2(@swc/core@1.4.16(@swc/helpers@0.5.2))(@types/node@20.12.7)(typescript@5.1.3))
postcss-nested: 6.2.0(postcss@8.4.47)
postcss-selector-parser: 6.1.2
resolve: 1.22.8
@@ -12947,7 +12947,7 @@ snapshots:
ts-interface-checker@0.1.13: {}
- ts-node@10.9.2(@swc/core@1.4.16(@swc/helpers@0.5.2))(@types/node@20.12.7)(typescript@5.0.3):
+ ts-node@10.9.2(@swc/core@1.4.16(@swc/helpers@0.5.2))(@types/node@20.12.7)(typescript@5.1.3):
dependencies:
'@cspotcode/source-map-support': 0.8.1
'@tsconfig/node10': 1.0.11
@@ -12961,7 +12961,7 @@ snapshots:
create-require: 1.1.1
diff: 4.0.2
make-error: 1.3.6
- typescript: 5.0.3
+ typescript: 5.1.3
v8-compile-cache-lib: 3.0.1
yn: 3.1.1
optionalDependencies:
@@ -13051,7 +13051,7 @@ snapshots:
dependencies:
semver: 7.6.3
- typescript@5.0.3: {}
+ typescript@5.1.3: {}
typescript@5.4.5: {}
From 631149fc47cf8b27e93174d9fd780b553c2642d2 Mon Sep 17 00:00:00 2001
From: Joe Bell <7349341+joe-bell@users.noreply.github.com>
Date: Thu, 13 Jul 2023 14:05:22 +0300
Subject: [PATCH 05/22] docs: update example to include boolean variants
---
.../pages/docs/getting-started/variants.mdx | 39 ++++++++++++-------
1 file changed, 24 insertions(+), 15 deletions(-)
diff --git a/docs/latest/pages/docs/getting-started/variants.mdx b/docs/latest/pages/docs/getting-started/variants.mdx
index 293dc94f..03b5666d 100644
--- a/docs/latest/pages/docs/getting-started/variants.mdx
+++ b/docs/latest/pages/docs/getting-started/variants.mdx
@@ -25,46 +25,55 @@ import { cva } from "class-variance-authority";
const button = cva(["font-semibold", "border", "rounded"], {
variants: {
intent: {
- primary: [
- "bg-blue-500",
- "text-white",
- "border-transparent",
- "hover:bg-blue-600",
- ],
+ primary: ["bg-blue-500", "text-white", "border-transparent"],
// **or**
// primary: "bg-blue-500 text-white border-transparent hover:bg-blue-600",
- secondary: [
- "bg-white",
- "text-gray-800",
- "border-gray-400",
- "hover:bg-gray-100",
- ],
+ secondary: ["bg-white", "text-gray-800", "border-gray-400"],
},
size: {
small: ["text-sm", "py-1", "px-2"],
medium: ["text-base", "py-2", "px-4"],
},
+ // `boolean` variants are also supported!
+ disabled: {
+ false: null,
+ true: ["opacity-50", "cursor-not-allowed"],
+ },
},
compoundVariants: [
+ {
+ intent: "primary",
+ disabled: false,
+ class: "hover:bg-blue-600",
+ },
+ {
+ intent: "secondary",
+ disabled: false,
+ class: "hover:bg-gray-100",
+ },
{
intent: "primary",
size: "medium",
- class: "uppercase",
// **or** if you're a React.js user, `className` may feel more consistent:
// className: "uppercase"
+ class: "uppercase",
},
],
defaultVariants: {
intent: "primary",
size: "medium",
+ disabled: false,
},
});
button();
-// => "font-semibold border rounded bg-blue-500 text-white border-transparent hover:bg-blue-600 text-base py-2 px-4 uppercase"
+// => "font-semibold border rounded bg-blue-500 text-white border-transparent text-base py-2 px-4 hover:bg-blue-600 uppercase"
+
+button({ disabled: true });
+// => "font-semibold border rounded bg-blue-500 text-white border-transparent text-base py-2 px-4 opacity-50 cursor-not-allowed uppercase"
button({ intent: "secondary", size: "small" });
-// => "font-semibold border rounded bg-white text-gray-800 border-gray-400 hover:bg-gray-100 text-sm py-1 px-2"
+// => "font-semibold border rounded bg-white text-gray-800 border-gray-400 text-sm py-1 px-2 hover:bg-gray-100"
```
## Compound Variants
From a399d36ab4445c85bde0e54aea09519c78535fed Mon Sep 17 00:00:00 2001
From: Joe Bell <7349341+joe-bell@users.noreply.github.com>
Date: Thu, 13 Jul 2023 14:05:48 +0300
Subject: [PATCH 06/22] chore(vue): include boolean variant
---
examples/vue/src/App.vue | 24 ++++++++++++------
examples/vue/src/components/Button.vue | 34 +++++++++++++++++++++++---
2 files changed, 46 insertions(+), 12 deletions(-)
diff --git a/examples/vue/src/App.vue b/examples/vue/src/App.vue
index 1d4d4d15..06b07d9f 100644
--- a/examples/vue/src/App.vue
+++ b/examples/vue/src/App.vue
@@ -3,12 +3,14 @@ import Button from "./components/Button.vue";
const intents = [undefined, "primary", "secondary"] as const;
const sizes = [undefined, "medium", "small"] as const;
+const isDisabled = [undefined, ""] as const;
+
{{ intent || "default" }}
@@ -16,15 +18,21 @@ const sizes = [undefined, "medium", "small"] as const;
-
- {{ size || "default" }}
+
+
+
+ {{ typeof disabled === "undefined" ? "enabled" : "disabled" }}
+
-
- {{ intent || "default" }} button
-
-
-
+ {{ size || "default" }}
+
+
+ {{ intent || "default" }} button
+
+
+
+
diff --git a/examples/vue/src/components/Button.vue b/examples/vue/src/components/Button.vue
index 9b2f2ac3..5a1339c6 100644
--- a/examples/vue/src/components/Button.vue
+++ b/examples/vue/src/components/Button.vue
@@ -11,6 +11,10 @@ const button = cva("button", {
small: "small",
medium: "medium",
},
+ disabled: {
+ true: "disabled",
+ false: "enabled",
+ },
},
compoundVariants: [
{ intent: "primary", size: "medium", class: "primaryMedium" },
@@ -20,16 +24,33 @@ const button = cva("button", {
type ButtonProps = VariantProps;
withDefaults(
- defineProps<{ intent: ButtonProps["intent"]; size: ButtonProps["size"] }>(),
+ defineProps<{
+ intent: ButtonProps["intent"];
+ size: ButtonProps["size"];
+ }>(),
{
intent: "primary",
size: "medium",
+ // Within Vue, `disabled` is defined and included by default.
+ disabled: false,
},
);
-
+
@@ -47,7 +68,7 @@ withDefaults(
border: transparent;
}
-.primary:hover {
+.primary.enabled:hover {
background-color: rgb(37 99 235);
}
@@ -57,7 +78,7 @@ withDefaults(
border-color: rgb(156 163 175);
}
-.secondary:hover {
+.secondary.enabled:hover {
background-color: rgb(243 244 246);
}
@@ -73,6 +94,11 @@ withDefaults(
padding: 0.5rem 1rem;
}
+.disabled {
+ opacity: 0.75;
+ cursor: not-allowed;
+}
+
.primaryMedium {
text-transform: uppercase;
}
From 9553025c0c0e4a8eb18f13d0152ad9b19dec8aa0 Mon Sep 17 00:00:00 2001
From: Joe Bell <7349341+joe-bell@users.noreply.github.com>
Date: Thu, 13 Jul 2023 14:06:10 +0300
Subject: [PATCH 07/22] chore(astro-with-tailwindcss): include boolean variant
---
.../src/components/button.astro | 46 ++++++++++++-------
.../src/pages/index.astro | 35 ++++++++++----
2 files changed, 55 insertions(+), 26 deletions(-)
diff --git a/examples/astro-with-tailwindcss/src/components/button.astro b/examples/astro-with-tailwindcss/src/components/button.astro
index d655a803..53fe451d 100644
--- a/examples/astro-with-tailwindcss/src/components/button.astro
+++ b/examples/astro-with-tailwindcss/src/components/button.astro
@@ -5,38 +5,52 @@ import { cva, type VariantProps } from "class-variance-authority";
const button = cva("button", {
variants: {
intent: {
- primary: [
- "bg-blue-500",
- "text-white",
- "border-transparent",
- "hover:bg-blue-600",
- ],
- secondary: [
- "bg-white",
- "text-gray-800",
- "border-gray-400",
- "hover:bg-gray-100",
- ],
+ primary: ["bg-blue-500", "text-white", "border-transparent"],
+ secondary: ["bg-white", "text-gray-800", "border-gray-400"],
},
size: {
small: ["text-sm", "py-1", "px-2"],
medium: ["text-base", "py-2", "px-4"],
},
+ disabled: {
+ false: null,
+ true: ["opacity-50", "cursor-not-allowed"],
+ },
},
- compoundVariants: [{ intent: "primary", size: "medium", class: "uppercase" }],
+ compoundVariants: [
+ {
+ intent: "primary",
+ disabled: false,
+ class: "hover:bg-blue-600",
+ },
+ {
+ intent: "secondary",
+ disabled: false,
+ class: "hover:bg-gray-100",
+ },
+ { intent: "primary", size: "medium", class: "uppercase" },
+ ],
});
export interface Props
- extends HTMLAttributes<"button">,
+ extends Omit, "disabled">,
VariantProps {}
/**
* For Astro components, we recommend setting your defaultVariants within
* Astro.props (which are `undefined` by default)
*/
-const { intent = "primary", size = "medium" } = Astro.props;
+const {
+ class: className,
+ intent = "primary",
+ size = "medium",
+ disabled = false,
+} = Astro.props;
---
-
+
diff --git a/examples/astro-with-tailwindcss/src/pages/index.astro b/examples/astro-with-tailwindcss/src/pages/index.astro
index 2d02a6eb..83e5eb45 100644
--- a/examples/astro-with-tailwindcss/src/pages/index.astro
+++ b/examples/astro-with-tailwindcss/src/pages/index.astro
@@ -3,6 +3,7 @@ import Button from "../components/button.astro";
const intents = [undefined, "primary", "secondary"] as const;
const sizes = [undefined, "medium", "small"] as const;
+const isDisabled = [false, true] as const;
---
@@ -23,23 +24,37 @@ const sizes = [undefined, "medium", "small"] as const;
>
+
{intents.map((intent) => {intent || "default"} )}
{
- sizes.map((size) => (
-
- {size || "default"}
- {intents.map((intent) => (
-
-
- {intent || "default"} button
-
-
+ isDisabled.map((disabled) => (
+
+ {sizes.map((size, index) => (
+
+ {index === 0 && (
+
+ {disabled ? "disabled" : "enabled"}
+
+ )}
+ {size || "default"}
+ {intents.map((intent) => (
+
+
+ {intent || "default"} button
+
+
+ ))}
+
))}
-
+
))
}
From d26b9a5fa0e1b0f48c2d1c9f62fe2d49b91b86d6 Mon Sep 17 00:00:00 2001
From: Joe Bell <7349341+joe-bell@users.noreply.github.com>
Date: Thu, 13 Jul 2023 14:06:24 +0300
Subject: [PATCH 08/22] chore(react-with-tailwindcss): include boolean variant
---
examples/react-with-tailwindcss/src/app.tsx | 37 +++++++++++-----
.../src/components/button/button.tsx | 44 ++++++++++++-------
2 files changed, 54 insertions(+), 27 deletions(-)
diff --git a/examples/react-with-tailwindcss/src/app.tsx b/examples/react-with-tailwindcss/src/app.tsx
index 0a2b5c28..fdb0376b 100644
--- a/examples/react-with-tailwindcss/src/app.tsx
+++ b/examples/react-with-tailwindcss/src/app.tsx
@@ -3,6 +3,7 @@ import { Button } from "./components";
const intents = [undefined, "primary", "secondary"] as const;
const sizes = [undefined, "medium", "small"] as const;
+const isDisabled = [false, true] as const;
function App() {
return (
@@ -16,6 +17,7 @@ function App() {
>
+
{intents.map((intent) => (
{intent || "default"}
@@ -23,18 +25,29 @@ function App() {
- {sizes.map((size) => (
-
- {size || "default"}
- {intents.map((intent) => (
-
-
- {intent || "default"} button
-
-
- ))}
-
- ))}
+ {isDisabled.map((disabled) =>
+ sizes.map((size, index) => (
+
+ {index === 0 && (
+
+ {disabled ? "disabled" : "enabled"}
+
+ )}
+ {size || "default"}
+ {intents.map((intent) => (
+
+
+ {intent || "default"} button
+
+
+ ))}
+
+ ))
+ )}
);
diff --git a/examples/react-with-tailwindcss/src/components/button/button.tsx b/examples/react-with-tailwindcss/src/components/button/button.tsx
index 83794cc4..e0b5761e 100644
--- a/examples/react-with-tailwindcss/src/components/button/button.tsx
+++ b/examples/react-with-tailwindcss/src/components/button/button.tsx
@@ -4,38 +4,52 @@ import { cva, type VariantProps } from "class-variance-authority";
const button = cva("button", {
variants: {
intent: {
- primary: [
- "bg-blue-500",
- "text-white",
- "border-transparent",
- "hover:bg-blue-600",
- ],
- secondary: [
- "bg-white",
- "text-gray-800",
- "border-gray-400",
- "hover:bg-gray-100",
- ],
+ primary: ["bg-blue-500", "text-white", "border-transparent"],
+ secondary: ["bg-white", "text-gray-800", "border-gray-400"],
},
size: {
small: ["text-sm", "py-1", "px-2"],
medium: ["text-base", "py-2", "px-4"],
},
+ disabled: {
+ false: null,
+ true: ["opacity-50", "cursor-not-allowed"],
+ },
},
- compoundVariants: [{ intent: "primary", size: "medium", class: "uppercase" }],
+ compoundVariants: [
+ {
+ intent: "primary",
+ disabled: false,
+ class: "hover:bg-blue-600",
+ },
+ {
+ intent: "secondary",
+ disabled: false,
+ class: "hover:bg-gray-100",
+ },
+ { intent: "primary", size: "medium", class: "uppercase" },
+ ],
defaultVariants: {
+ disabled: false,
intent: "primary",
size: "medium",
},
});
export interface ButtonProps
- extends React.ButtonHTMLAttributes,
+ extends Omit, "disabled">,
VariantProps {}
export const Button: React.FC = ({
className,
intent,
size,
+ disabled,
...props
-}) => ;
+}) => (
+
+);
From 0389cba910eacd73c5ed931760d955e244ecd5b6 Mon Sep 17 00:00:00 2001
From: Joe Bell <7349341+joe-bell@users.noreply.github.com>
Date: Fri, 14 Jul 2023 09:03:05 +0300
Subject: [PATCH 09/22] chore(react-with-css-modules): include boolean variant
---
examples/react-with-css-modules/src/app.tsx | 37 +++++++++++++------
.../src/components/button/button.module.css | 9 ++++-
.../src/components/button/button.tsx | 16 +++++++-
3 files changed, 46 insertions(+), 16 deletions(-)
diff --git a/examples/react-with-css-modules/src/app.tsx b/examples/react-with-css-modules/src/app.tsx
index 9aa745e3..c16845a5 100644
--- a/examples/react-with-css-modules/src/app.tsx
+++ b/examples/react-with-css-modules/src/app.tsx
@@ -2,12 +2,14 @@ import { Button } from "./components";
const intents = [undefined, "primary", "secondary"] as const;
const sizes = [undefined, "medium", "small"] as const;
+const isDisabled = [false, true] as const;
function App() {
return (
+
{intents.map((intent) => (
{intent || "default"}
@@ -15,18 +17,29 @@ function App() {
- {sizes.map((size) => (
-
- {size || "default"}
- {intents.map((intent) => (
-
-
- {intent || "default"} button
-
-
- ))}
-
- ))}
+ {isDisabled.map((disabled) =>
+ sizes.map((size, index) => (
+
+ {index === 0 && (
+
+ {disabled ? "disabled" : "enabled"}
+
+ )}
+ {size || "default"}
+ {intents.map((intent) => (
+
+
+ {intent || "default"} button
+
+
+ ))}
+
+ ))
+ )}
);
diff --git a/examples/react-with-css-modules/src/components/button/button.module.css b/examples/react-with-css-modules/src/components/button/button.module.css
index ed207d71..ec26e55a 100644
--- a/examples/react-with-css-modules/src/components/button/button.module.css
+++ b/examples/react-with-css-modules/src/components/button/button.module.css
@@ -10,7 +10,7 @@
border: transparent;
}
-.primary:hover {
+.primary.enabled:hover {
background-color: rgb(37 99 235);
}
@@ -20,7 +20,7 @@
border-color: rgb(156 163 175);
}
-.secondary:hover {
+.secondary.enabled:hover {
background-color: rgb(243 244 246);
}
@@ -39,3 +39,8 @@
.primaryMedium {
text-transform: uppercase;
}
+
+.disabled {
+ opacity: 0.5;
+ cursor: not-allowed;
+}
diff --git a/examples/react-with-css-modules/src/components/button/button.tsx b/examples/react-with-css-modules/src/components/button/button.tsx
index bab323aa..5501b2a4 100644
--- a/examples/react-with-css-modules/src/components/button/button.tsx
+++ b/examples/react-with-css-modules/src/components/button/button.tsx
@@ -13,6 +13,10 @@ const button = cva(styles.base, {
small: styles.small,
medium: styles.medium,
},
+ disabled: {
+ false: styles.enabled,
+ true: styles.disabled,
+ },
},
compoundVariants: [
{ intent: "primary", size: "medium", className: styles.primaryMedium },
@@ -20,16 +24,24 @@ const button = cva(styles.base, {
defaultVariants: {
intent: "primary",
size: "medium",
+ disabled: false,
},
});
export interface ButtonProps
- extends React.ButtonHTMLAttributes,
+ extends Omit, "disabled">,
VariantProps {}
export const Button: React.FC = ({
className,
intent,
size,
+ disabled,
...props
-}) => ;
+}) => (
+
+);
From db40810536ab75bf624552d8240c57044a520462 Mon Sep 17 00:00:00 2001
From: Joe Bell <7349341+joe-bell@users.noreply.github.com>
Date: Fri, 14 Jul 2023 09:13:57 +0300
Subject: [PATCH 10/22] chore(svelte): include boolean variant
---
examples/svelte/src/App.svelte | 35 ++++++++++++++------
examples/svelte/src/components/button.svelte | 20 +++++++++--
2 files changed, 41 insertions(+), 14 deletions(-)
diff --git a/examples/svelte/src/App.svelte b/examples/svelte/src/App.svelte
index cc8f97d3..3de87458 100644
--- a/examples/svelte/src/App.svelte
+++ b/examples/svelte/src/App.svelte
@@ -3,11 +3,13 @@
const intents = [undefined, "primary", "secondary"] as const;
const sizes = [undefined, "medium", "small"] as const;
+ const isDisabled = [false, true] as const;
+
{#each intents as intent}
{intent || "default"}
@@ -15,17 +17,28 @@
- {#each sizes as size}
-
- {size || "default"}
- {#each intents as intent}
-
-
- {intent || "default"} button
-
-
- {/each}
-
+ {#each isDisabled as disabled}
+ {#each sizes as size, index}
+
+ {#if index === 0}
+
+ {disabled ? "disabled" : "enabled"}
+
+ {/if}
+ {size || "default"}
+ {#each intents as intent}
+
+
+ {intent || "default"} button
+
+
+ {/each}
+
+ {/each}
{/each}
diff --git a/examples/svelte/src/components/button.svelte b/examples/svelte/src/components/button.svelte
index 76f80ed9..d903d2fb 100644
--- a/examples/svelte/src/components/button.svelte
+++ b/examples/svelte/src/components/button.svelte
@@ -12,6 +12,10 @@
small: "small",
medium: "medium",
},
+ disabled: {
+ false: "enabled",
+ true: "disabled",
+ },
},
compoundVariants: [
{ intent: "primary", size: "medium", class: "primaryMedium" },
@@ -26,9 +30,14 @@
*/
export let intent: $$Props["intent"] = "primary";
export let size: $$Props["size"] = "medium";
+ export let disabled: $$Props["disabled"] = false;
-
+
@@ -45,7 +54,7 @@
border: transparent;
}
- .primary:hover {
+ .primary.enabled:hover {
background-color: rgb(37 99 235);
}
@@ -55,7 +64,7 @@
border-color: rgb(156 163 175);
}
- .secondary:hover {
+ .secondary.enabled:hover {
background-color: rgb(243 244 246);
}
@@ -74,4 +83,9 @@
.primaryMedium {
text-transform: uppercase;
}
+
+ .disabled {
+ opacity: 0.5;
+ cursor: not-allowed;
+ }
From c8c6927ed108c49ac77a9cbf62fde9a341af6158 Mon Sep 17 00:00:00 2001
From: Joe Bell <7349341+joe-bell@users.noreply.github.com>
Date: Fri, 21 Jul 2023 07:52:55 +0100
Subject: [PATCH 11/22] docs: polymorphism
---
docs/latest/pages/docs/faqs.mdx | 18 +----
.../pages/docs/getting-started/_meta.json | 3 +-
.../docs/getting-started/polymorphism.mdx | 81 +++++++++++++++++++
3 files changed, 84 insertions(+), 18 deletions(-)
create mode 100644 docs/latest/pages/docs/getting-started/polymorphism.mdx
diff --git a/docs/latest/pages/docs/faqs.mdx b/docs/latest/pages/docs/faqs.mdx
index e94ae39c..9014e886 100644
--- a/docs/latest/pages/docs/faqs.mdx
+++ b/docs/latest/pages/docs/faqs.mdx
@@ -13,23 +13,7 @@ Long story short: it's unnecessary.
- Polymorphism is free; just apply the class to your preferred HTML element
- Less opinionated; you're free to build components with `cva` however you'd like
-
-
-{" "}
-
-Example: Polymorphic Components
-
-There's no `as` prop in `cva`, because HTML is free:
-
-```diff
--- // A familiar `styled` button as a link
--- Button as a link
-
-++ // A `cva` button as a link
-++ Button as a link
-```
-
-
+See the ["Polymorphism"](/docs/getting-started/polymorphism) documentation for further recommendations.
## How Can I Create [Responsive Variants like Stitches.js](https://stitches.dev/docs/responsive-styles#responsive-variants)?
diff --git a/docs/latest/pages/docs/getting-started/_meta.json b/docs/latest/pages/docs/getting-started/_meta.json
index 3bff8a5b..ebe75322 100644
--- a/docs/latest/pages/docs/getting-started/_meta.json
+++ b/docs/latest/pages/docs/getting-started/_meta.json
@@ -4,5 +4,6 @@
"compound-components": "",
"typescript": "TypeScript",
"extending-components": "",
- "mixing-components": ""
+ "mixing-components": "",
+ "polymorphism": ""
}
diff --git a/docs/latest/pages/docs/getting-started/polymorphism.mdx b/docs/latest/pages/docs/getting-started/polymorphism.mdx
new file mode 100644
index 00000000..90deb089
--- /dev/null
+++ b/docs/latest/pages/docs/getting-started/polymorphism.mdx
@@ -0,0 +1,81 @@
+# Polymorphism
+
+`cva` components are polymorphic (and framework-agnostic) by default; just apply the class to your preferred HTML element…
+
+```tsx
+import { button } from "./components/button";
+
+export default () => (
+
+ Sign up
+
+);
+```
+
+## Alternative Approaches
+
+### React
+
+If you'd prefer to use a React-based API, `cva` strongly recommends using [`@radix-ui`'s `Slot` component](https://www.radix-ui.com/docs/primitives/utilities/slot) to create your own `asChild` prop.
+
+```tsx
+// ./components/button.tsx
+import * as React from "react";
+import { Slot } from "@radix-ui/react-slot";
+import { cva, type VariantProps } from "class-variance-authority";
+
+const button = cva("button", {
+ variants: {
+ intent: {
+ primary: [
+ "bg-blue-500 text-white",
+ "text-white",
+ "border-transparent",
+ "hover:bg-blue-600",
+ ],
+ secondary: [
+ "bg-white",
+ "text-gray-800",
+ "border-gray-400",
+ "hover:bg-gray-100",
+ ],
+ },
+ },
+ defaultVariants: {
+ intent: "primary",
+ },
+});
+
+export interface ButtonProps
+ extends React.ButtonHTMLAttributes,
+ VariantProps {
+ asChild?: boolean;
+}
+
+export const Button: React.FC = ({
+ asChild,
+ className,
+ intent,
+ ...props
+}) => {
+ const Comp = asChild ? Slot : "button";
+
+ return ;
+};
+```
+
+#### Usage
+
+```tsx
+import { Button } from "./components/button";
+
+// Renders:
+//
+// Sign up
+//
+export default () => (
+
+ Sign up
+
+);
+```
From 99919c3c532a45f3987ad4b91d04d807c39336ad Mon Sep 17 00:00:00 2001
From: Joe Bell <7349341+joe-bell@users.noreply.github.com>
Date: Fri, 14 Jul 2023 09:28:54 +0300
Subject: [PATCH 12/22] chore(react-with-tailwindcss-compound): tidy
---
.../src/components/nav/nav.tsx | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/examples/react-with-tailwindcss-compound/src/components/nav/nav.tsx b/examples/react-with-tailwindcss-compound/src/components/nav/nav.tsx
index de67e0a5..6b66b8b8 100644
--- a/examples/react-with-tailwindcss-compound/src/components/nav/nav.tsx
+++ b/examples/react-with-tailwindcss-compound/src/components/nav/nav.tsx
@@ -1,16 +1,6 @@
import React from "react";
import { cva, type VariantProps } from "class-variance-authority";
-// note: `data-*` attributes not required, but useful.
-//
-//
-// Home
-//
-//
-// Home
-//
-// ;
-
/* Root
============================================ */
@@ -51,6 +41,7 @@ export interface RootProps
export const Root: React.FC = ({ className, density, ...props }) => (
Date: Sat, 12 Aug 2023 10:59:23 +0300
Subject: [PATCH 13/22] feat: compound docs
---
.../pages/docs/getting-started/compound-components.mdx | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/docs/latest/pages/docs/getting-started/compound-components.mdx b/docs/latest/pages/docs/getting-started/compound-components.mdx
index a67e168e..cb3c05ef 100644
--- a/docs/latest/pages/docs/getting-started/compound-components.mdx
+++ b/docs/latest/pages/docs/getting-started/compound-components.mdx
@@ -1,5 +1,14 @@
# Compound Components
+Compound Components are a term that React.js developers will be familiar with, and feels like the best way to describe this pattern.
+
+Build compound components with the power of CSS selectors and variables – no additional JS required.
+
+TODO
+
+1. Tab with NormalCSS
+2. Tab with TailwindCss
+
## Examples
- [React with Tailwind CSS](../examples/react/tailwind-css#compound-components)
From aa8b2f4aff3dd89bc741a3b2891da8d4bd748e96 Mon Sep 17 00:00:00 2001
From: Joe Bell <7349341+joe-bell@users.noreply.github.com>
Date: Sat, 7 Dec 2024 07:43:29 +0200
Subject: [PATCH 14/22] fix: sync versions
---
docs/beta/astro.config.ts | 2 +-
.../pages/docs/getting-started/_meta.json | 2 +-
.../getting-started/composing-components.mdx | 4 +-
.../getting-started/mixing-components.mdx | 44 --
.../package.json | 12 +-
examples/react-with-tailwindcss/package.json | 4 +-
.../src/index.test.ts | 2 +-
packages/cva/package.json | 2 +-
pnpm-lock.yaml | 434 +-----------------
9 files changed, 33 insertions(+), 473 deletions(-)
delete mode 100644 docs/latest/pages/docs/getting-started/mixing-components.mdx
diff --git a/docs/beta/astro.config.ts b/docs/beta/astro.config.ts
index aafa0a7d..bc931a52 100644
--- a/docs/beta/astro.config.ts
+++ b/docs/beta/astro.config.ts
@@ -18,7 +18,7 @@ const config = {
export default defineConfig({
site,
output: "static",
- adapter: vercel({ analytics: false }),
+ adapter: vercel(),
integrations: [
starlight({
...config,
diff --git a/docs/latest/pages/docs/getting-started/_meta.json b/docs/latest/pages/docs/getting-started/_meta.json
index ebe75322..5738467e 100644
--- a/docs/latest/pages/docs/getting-started/_meta.json
+++ b/docs/latest/pages/docs/getting-started/_meta.json
@@ -4,6 +4,6 @@
"compound-components": "",
"typescript": "TypeScript",
"extending-components": "",
- "mixing-components": "",
+ "composing-components": "",
"polymorphism": ""
}
diff --git a/docs/latest/pages/docs/getting-started/composing-components.mdx b/docs/latest/pages/docs/getting-started/composing-components.mdx
index 81c6edf0..e7fbee26 100644
--- a/docs/latest/pages/docs/getting-started/composing-components.mdx
+++ b/docs/latest/pages/docs/getting-started/composing-components.mdx
@@ -1,6 +1,6 @@
-# Mixing Components
+# Composing Components
-Whilst `cva` doesn't yet offer a built-in method for mixing components together, it does offer the tools to _extend_ components on your own terms…
+Whilst `cva` doesn't yet offer a built-in method for composing components together, it does offer the tools to _extend_ components on your own terms…
For example; two `cva` components, concatenated together with `cx`:
diff --git a/docs/latest/pages/docs/getting-started/mixing-components.mdx b/docs/latest/pages/docs/getting-started/mixing-components.mdx
deleted file mode 100644
index 81c6edf0..00000000
--- a/docs/latest/pages/docs/getting-started/mixing-components.mdx
+++ /dev/null
@@ -1,44 +0,0 @@
-# Mixing Components
-
-Whilst `cva` doesn't yet offer a built-in method for mixing components together, it does offer the tools to _extend_ components on your own terms…
-
-For example; two `cva` components, concatenated together with `cx`:
-
-```ts
-// components/card.ts
-import type { VariantProps } from "class-variance-authority";
-import { cva, cx } from "class-variance-authority";
-
-/**
- * Box
- */
-export type BoxProps = VariantProps;
-export const box = cva(["box", "box-border"], {
- variants: {
- margin: { 0: "m-0", 2: "m-2", 4: "m-4", 8: "m-8" },
- padding: { 0: "p-0", 2: "p-2", 4: "p-4", 8: "p-8" },
- },
- defaultVariants: {
- margin: 0,
- padding: 0,
- },
-});
-
-/**
- * Card
- */
-type CardBaseProps = VariantProps;
-const cardBase = cva(["card", "border-solid", "border-slate-300", "rounded"], {
- variants: {
- shadow: {
- md: "drop-shadow-md",
- lg: "drop-shadow-lg",
- xl: "drop-shadow-xl",
- },
- },
-});
-
-export interface CardProps extends BoxProps, CardBaseProps {}
-export const card = ({ margin, padding, shadow }: CardProps = {}) =>
- cx(box({ margin, padding }), cardBase({ shadow }));
-```
diff --git a/examples/react-with-tailwindcss-compound/package.json b/examples/react-with-tailwindcss-compound/package.json
index d68da02a..5d6f34d3 100644
--- a/examples/react-with-tailwindcss-compound/package.json
+++ b/examples/react-with-tailwindcss-compound/package.json
@@ -14,13 +14,13 @@
"react-dom": "18.2.0"
},
"devDependencies": {
- "@types/react": "18.0.12",
- "@types/react-dom": "18.0.5",
- "@vitejs/plugin-react": "^3.1.0",
+ "@types/react": "18.2.79",
+ "@types/react-dom": "18.2.25",
+ "@vitejs/plugin-react": "^4.2.1",
"autoprefixer": "^10.4.13",
"postcss": "^8.4.21",
- "tailwindcss": "^3.3.2",
- "typescript": "5.1.3",
- "vite": "^4.1.0"
+ "tailwindcss": "^3.4.3",
+ "typescript": "5.4.5",
+ "vite": "^5.2.10"
}
}
diff --git a/examples/react-with-tailwindcss/package.json b/examples/react-with-tailwindcss/package.json
index e2d4ed50..9eb5b827 100644
--- a/examples/react-with-tailwindcss/package.json
+++ b/examples/react-with-tailwindcss/package.json
@@ -17,8 +17,8 @@
"@types/react": "18.2.79",
"@types/react-dom": "18.2.25",
"@vitejs/plugin-react": "^4.2.1",
- "autoprefixer": "^10.4.19",
- "postcss": "^8.4.38",
+ "autoprefixer": "^10.4.13",
+ "postcss": "^8.4.21",
"tailwindcss": "^3.4.3",
"typescript": "5.4.5",
"vite": "^5.2.10"
diff --git a/packages/class-variance-authority/src/index.test.ts b/packages/class-variance-authority/src/index.test.ts
index 2b0bf758..641a284c 100644
--- a/packages/class-variance-authority/src/index.test.ts
+++ b/packages/class-variance-authority/src/index.test.ts
@@ -1656,7 +1656,7 @@ describe("cva", () => {
});
});
- describe("mixing classes", () => {
+ describe("composing classes", () => {
type BoxProps = CVA.VariantProps;
const box = cva(["box", "box-border"], {
variants: {
diff --git a/packages/cva/package.json b/packages/cva/package.json
index dc20a9a3..4c685ed4 100644
--- a/packages/cva/package.json
+++ b/packages/cva/package.json
@@ -57,7 +57,7 @@
"typescript": "5.4.5"
},
"peerDependencies": {
- "typescript": ">= 4.5.5 < 6"
+ "typescript": "5.4.5"
},
"peerDependenciesMeta": {
"typescript": {
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index ee73ae9d..8d4b8db1 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -140,7 +140,7 @@ importers:
version: 4.15.9(@types/node@20.12.7)(rollup@4.22.5)(typescript@5.4.5)
class-variance-authority:
specifier: latest
- version: 0.7.0
+ version: 0.7.1
npm-run-all:
specifier: 4.1.5
version: 4.1.5
@@ -156,7 +156,7 @@ importers:
dependencies:
class-variance-authority:
specifier: latest
- version: 0.7.0
+ version: 0.7.1
react:
specifier: 18.2.0
version: 18.2.0
@@ -184,7 +184,7 @@ importers:
dependencies:
class-variance-authority:
specifier: latest
- version: 0.7.0
+ version: 0.7.1
react:
specifier: 18.2.0
version: 18.2.0
@@ -202,10 +202,10 @@ importers:
specifier: ^4.2.1
version: 4.3.1(vite@5.4.8(@types/node@20.12.7))
autoprefixer:
- specifier: ^10.4.19
+ specifier: ^10.4.13
version: 10.4.20(postcss@8.4.47)
postcss:
- specifier: ^8.4.38
+ specifier: ^8.4.21
version: 8.4.47
tailwindcss:
specifier: ^3.4.3
@@ -230,14 +230,14 @@ importers:
version: 18.2.0(react@18.2.0)
devDependencies:
'@types/react':
- specifier: 18.0.12
- version: 18.0.12
+ specifier: 18.2.79
+ version: 18.2.79
'@types/react-dom':
- specifier: 18.0.5
- version: 18.0.5
+ specifier: 18.2.25
+ version: 18.2.25
'@vitejs/plugin-react':
- specifier: ^3.1.0
- version: 3.1.0(vite@4.5.5(@types/node@20.12.7))
+ specifier: ^4.2.1
+ version: 4.3.1(vite@5.4.8(@types/node@20.12.7))
autoprefixer:
specifier: ^10.4.13
version: 10.4.20(postcss@8.4.47)
@@ -245,14 +245,14 @@ importers:
specifier: ^8.4.21
version: 8.4.47
tailwindcss:
- specifier: ^3.3.2
- version: 3.4.13(ts-node@10.9.2(@swc/core@1.4.16(@swc/helpers@0.5.2))(@types/node@20.12.7)(typescript@5.1.3))
+ specifier: ^3.4.3
+ version: 3.4.13(ts-node@10.9.2(@swc/core@1.4.16(@swc/helpers@0.5.2))(@types/node@20.12.7)(typescript@5.4.5))
typescript:
- specifier: 5.1.3
- version: 5.1.3
+ specifier: 5.4.5
+ version: 5.4.5
vite:
- specifier: ^4.1.0
- version: 4.5.5(@types/node@20.12.7)
+ specifier: ^5.2.10
+ version: 5.4.8(@types/node@20.12.7)
examples/svelte:
devDependencies:
@@ -264,7 +264,7 @@ importers:
version: 5.0.4
class-variance-authority:
specifier: latest
- version: 0.7.0
+ version: 0.7.1
svelte:
specifier: ^4.2.15
version: 4.2.19
@@ -285,7 +285,7 @@ importers:
dependencies:
class-variance-authority:
specifier: latest
- version: 0.7.0
+ version: 0.7.1
vue:
specifier: ^3.4.23
version: 3.5.10(typescript@5.4.5)
@@ -635,12 +635,6 @@ packages:
cpu: [ppc64]
os: [aix]
- '@esbuild/android-arm64@0.18.20':
- resolution: {integrity: sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==}
- engines: {node: '>=12'}
- cpu: [arm64]
- os: [android]
-
'@esbuild/android-arm64@0.21.5':
resolution: {integrity: sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==}
engines: {node: '>=12'}
@@ -653,12 +647,6 @@ packages:
cpu: [arm64]
os: [android]
- '@esbuild/android-arm@0.18.20':
- resolution: {integrity: sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==}
- engines: {node: '>=12'}
- cpu: [arm]
- os: [android]
-
'@esbuild/android-arm@0.21.5':
resolution: {integrity: sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==}
engines: {node: '>=12'}
@@ -671,12 +659,6 @@ packages:
cpu: [arm]
os: [android]
- '@esbuild/android-x64@0.18.20':
- resolution: {integrity: sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==}
- engines: {node: '>=12'}
- cpu: [x64]
- os: [android]
-
'@esbuild/android-x64@0.21.5':
resolution: {integrity: sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==}
engines: {node: '>=12'}
@@ -689,12 +671,6 @@ packages:
cpu: [x64]
os: [android]
- '@esbuild/darwin-arm64@0.18.20':
- resolution: {integrity: sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==}
- engines: {node: '>=12'}
- cpu: [arm64]
- os: [darwin]
-
'@esbuild/darwin-arm64@0.21.5':
resolution: {integrity: sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==}
engines: {node: '>=12'}
@@ -707,12 +683,6 @@ packages:
cpu: [arm64]
os: [darwin]
- '@esbuild/darwin-x64@0.18.20':
- resolution: {integrity: sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==}
- engines: {node: '>=12'}
- cpu: [x64]
- os: [darwin]
-
'@esbuild/darwin-x64@0.21.5':
resolution: {integrity: sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==}
engines: {node: '>=12'}
@@ -725,12 +695,6 @@ packages:
cpu: [x64]
os: [darwin]
- '@esbuild/freebsd-arm64@0.18.20':
- resolution: {integrity: sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==}
- engines: {node: '>=12'}
- cpu: [arm64]
- os: [freebsd]
-
'@esbuild/freebsd-arm64@0.21.5':
resolution: {integrity: sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==}
engines: {node: '>=12'}
@@ -743,12 +707,6 @@ packages:
cpu: [arm64]
os: [freebsd]
- '@esbuild/freebsd-x64@0.18.20':
- resolution: {integrity: sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==}
- engines: {node: '>=12'}
- cpu: [x64]
- os: [freebsd]
-
'@esbuild/freebsd-x64@0.21.5':
resolution: {integrity: sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==}
engines: {node: '>=12'}
@@ -761,12 +719,6 @@ packages:
cpu: [x64]
os: [freebsd]
- '@esbuild/linux-arm64@0.18.20':
- resolution: {integrity: sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==}
- engines: {node: '>=12'}
- cpu: [arm64]
- os: [linux]
-
'@esbuild/linux-arm64@0.21.5':
resolution: {integrity: sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==}
engines: {node: '>=12'}
@@ -779,12 +731,6 @@ packages:
cpu: [arm64]
os: [linux]
- '@esbuild/linux-arm@0.18.20':
- resolution: {integrity: sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==}
- engines: {node: '>=12'}
- cpu: [arm]
- os: [linux]
-
'@esbuild/linux-arm@0.21.5':
resolution: {integrity: sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==}
engines: {node: '>=12'}
@@ -797,12 +743,6 @@ packages:
cpu: [arm]
os: [linux]
- '@esbuild/linux-ia32@0.18.20':
- resolution: {integrity: sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==}
- engines: {node: '>=12'}
- cpu: [ia32]
- os: [linux]
-
'@esbuild/linux-ia32@0.21.5':
resolution: {integrity: sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==}
engines: {node: '>=12'}
@@ -815,12 +755,6 @@ packages:
cpu: [ia32]
os: [linux]
- '@esbuild/linux-loong64@0.18.20':
- resolution: {integrity: sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==}
- engines: {node: '>=12'}
- cpu: [loong64]
- os: [linux]
-
'@esbuild/linux-loong64@0.21.5':
resolution: {integrity: sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==}
engines: {node: '>=12'}
@@ -833,12 +767,6 @@ packages:
cpu: [loong64]
os: [linux]
- '@esbuild/linux-mips64el@0.18.20':
- resolution: {integrity: sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==}
- engines: {node: '>=12'}
- cpu: [mips64el]
- os: [linux]
-
'@esbuild/linux-mips64el@0.21.5':
resolution: {integrity: sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==}
engines: {node: '>=12'}
@@ -851,12 +779,6 @@ packages:
cpu: [mips64el]
os: [linux]
- '@esbuild/linux-ppc64@0.18.20':
- resolution: {integrity: sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==}
- engines: {node: '>=12'}
- cpu: [ppc64]
- os: [linux]
-
'@esbuild/linux-ppc64@0.21.5':
resolution: {integrity: sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==}
engines: {node: '>=12'}
@@ -869,12 +791,6 @@ packages:
cpu: [ppc64]
os: [linux]
- '@esbuild/linux-riscv64@0.18.20':
- resolution: {integrity: sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==}
- engines: {node: '>=12'}
- cpu: [riscv64]
- os: [linux]
-
'@esbuild/linux-riscv64@0.21.5':
resolution: {integrity: sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==}
engines: {node: '>=12'}
@@ -887,12 +803,6 @@ packages:
cpu: [riscv64]
os: [linux]
- '@esbuild/linux-s390x@0.18.20':
- resolution: {integrity: sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==}
- engines: {node: '>=12'}
- cpu: [s390x]
- os: [linux]
-
'@esbuild/linux-s390x@0.21.5':
resolution: {integrity: sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==}
engines: {node: '>=12'}
@@ -905,12 +815,6 @@ packages:
cpu: [s390x]
os: [linux]
- '@esbuild/linux-x64@0.18.20':
- resolution: {integrity: sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==}
- engines: {node: '>=12'}
- cpu: [x64]
- os: [linux]
-
'@esbuild/linux-x64@0.21.5':
resolution: {integrity: sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==}
engines: {node: '>=12'}
@@ -923,12 +827,6 @@ packages:
cpu: [x64]
os: [linux]
- '@esbuild/netbsd-x64@0.18.20':
- resolution: {integrity: sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==}
- engines: {node: '>=12'}
- cpu: [x64]
- os: [netbsd]
-
'@esbuild/netbsd-x64@0.21.5':
resolution: {integrity: sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==}
engines: {node: '>=12'}
@@ -947,12 +845,6 @@ packages:
cpu: [arm64]
os: [openbsd]
- '@esbuild/openbsd-x64@0.18.20':
- resolution: {integrity: sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==}
- engines: {node: '>=12'}
- cpu: [x64]
- os: [openbsd]
-
'@esbuild/openbsd-x64@0.21.5':
resolution: {integrity: sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==}
engines: {node: '>=12'}
@@ -965,12 +857,6 @@ packages:
cpu: [x64]
os: [openbsd]
- '@esbuild/sunos-x64@0.18.20':
- resolution: {integrity: sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==}
- engines: {node: '>=12'}
- cpu: [x64]
- os: [sunos]
-
'@esbuild/sunos-x64@0.21.5':
resolution: {integrity: sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==}
engines: {node: '>=12'}
@@ -983,12 +869,6 @@ packages:
cpu: [x64]
os: [sunos]
- '@esbuild/win32-arm64@0.18.20':
- resolution: {integrity: sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==}
- engines: {node: '>=12'}
- cpu: [arm64]
- os: [win32]
-
'@esbuild/win32-arm64@0.21.5':
resolution: {integrity: sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==}
engines: {node: '>=12'}
@@ -1001,12 +881,6 @@ packages:
cpu: [arm64]
os: [win32]
- '@esbuild/win32-ia32@0.18.20':
- resolution: {integrity: sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==}
- engines: {node: '>=12'}
- cpu: [ia32]
- os: [win32]
-
'@esbuild/win32-ia32@0.21.5':
resolution: {integrity: sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==}
engines: {node: '>=12'}
@@ -1019,12 +893,6 @@ packages:
cpu: [ia32]
os: [win32]
- '@esbuild/win32-x64@0.18.20':
- resolution: {integrity: sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==}
- engines: {node: '>=12'}
- cpu: [x64]
- os: [win32]
-
'@esbuild/win32-x64@0.21.5':
resolution: {integrity: sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==}
engines: {node: '>=12'}
@@ -1858,15 +1726,9 @@ packages:
'@types/pug@2.0.10':
resolution: {integrity: sha512-Sk/uYFOBAB7mb74XcpizmH0KOR2Pv3D2Hmrh1Dmy5BmK3MpdSa5kqZcg6EKBdklU0bFXX9gCfzvpnyUehrPIuA==}
- '@types/react-dom@18.0.5':
- resolution: {integrity: sha512-OWPWTUrY/NIrjsAPkAk1wW9LZeIjSvkXRhclsFO8CZcZGCOg2G0YZy4ft+rOyYxy8B7ui5iZzi9OkDebZ7/QSA==}
-
'@types/react-dom@18.2.25':
resolution: {integrity: sha512-o/V48vf4MQh7juIKZU2QGDfli6p1+OOi5oXx36Hffpc9adsHeXjVp8rHuPkjd8VT8sOJ2Zp05HR7CdpGTIUFUA==}
- '@types/react@18.0.12':
- resolution: {integrity: sha512-duF1OTASSBQtcigUvhuiTB1Ya3OvSy+xORCiEf20H0P0lzx+/KeVsA99U5UjLXSbyo1DRJDlLKqTeM1ngosqtg==}
-
'@types/react@18.2.79':
resolution: {integrity: sha512-RwGAGXPl9kSXwdNTafkOEuFrTBD5SA2B3iEB96xi8+xu5ddUa/cpvyVCSNn+asgLCTHkb5ZxN8gbuibYJi4s1w==}
@@ -1876,9 +1738,6 @@ packages:
'@types/sax@1.2.7':
resolution: {integrity: sha512-rO73L89PJxeYM3s3pPPjiPgVVcymqU490g0YO5n5By0k2Erzj6tay/4lr1CHAAU4JyOWd1rpQ8bCf6cZfHU96A==}
- '@types/scheduler@0.23.0':
- resolution: {integrity: sha512-YIoDCTH3Af6XM5VuwGG/QL/CJqga1Zm3NkU3HZ4ZHK2fRMPYP1VczsTUqtsf43PH/iJNVlPHAo2oWX7BSdB2Hw==}
-
'@types/unist@2.0.11':
resolution: {integrity: sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA==}
@@ -1907,12 +1766,6 @@ packages:
engines: {node: '>=16'}
hasBin: true
- '@vitejs/plugin-react@3.1.0':
- resolution: {integrity: sha512-AfgcRL8ZBhAlc3BFdigClmTUMISmmzHn7sB2h9U1odvc5U/MjWXsAaz18b/WoppUTDBzxOJwo2VdClfUcItu9g==}
- engines: {node: ^14.18.0 || >=16.0.0}
- peerDependencies:
- vite: ^4.1.0-beta.0
-
'@vitejs/plugin-react@4.3.1':
resolution: {integrity: sha512-m/V2syj5CuVnaxcUJOQRel/Wr31FFXRFlnOoq1TVtkCxsY5veGMTEmpWHndrhB2U8ScHtCQB1e+4hWYExQc6Lg==}
engines: {node: ^14.18.0 || >=16.0.0}
@@ -2382,9 +2235,6 @@ packages:
resolution: {integrity: sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==}
engines: {node: '>=8'}
- class-variance-authority@0.7.0:
- resolution: {integrity: sha512-jFI8IQw4hczaL4ALINxqLEXQbWcNjoSkloa4IaufXCJr6QawJyw7tuRysRsrE8w2p/4gGaxKIt/hX3qz/IbD1A==}
-
class-variance-authority@0.7.1:
resolution: {integrity: sha512-Ka+9Trutv7G8M6WT6SeiRWz792K5qEqIGEGzXKhAE6xOWAY6pPH8U+9IY3oCMv6kqTmLsv7Xh/2w2RigkePMsg==}
@@ -2422,10 +2272,6 @@ packages:
clone-response@1.0.3:
resolution: {integrity: sha512-ROoL94jJH2dUVML2Y/5PEDNaSHgeOdSDicUyS7izcF63G6sTc/FTjLub4b8Il9S8S0beOfYt0TaA5qvFK+w0wA==}
- clsx@2.0.0:
- resolution: {integrity: sha512-rQ1+kcj+ttHG0MKVGBUXwayCCF1oh39BF5COIpRzuCEv8Mwjv0XucrI2ExNTOn9IlLifGClWQcU9BrZORvtw6Q==}
- engines: {node: '>=6'}
-
clsx@2.1.0:
resolution: {integrity: sha512-m3iNNWpd9rl3jvvcBnu70ylMdrXt8Vlq4HYadnU5fwcOtvkSQWPmj7amUcDT2qYI7risszBjI5AUIUox9D16pg==}
engines: {node: '>=6'}
@@ -2998,11 +2844,6 @@ packages:
es6-promise@3.3.1:
resolution: {integrity: sha512-SOp9Phqvqn7jtEUxPWdWfWoLmyt2VaJ6MpvP9Comy1MceMXqE6bxvaTu4iaxpYYPzhny28Lc+M87/c2cPK6lDg==}
- esbuild@0.18.20:
- resolution: {integrity: sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==}
- engines: {node: '>=12'}
- hasBin: true
-
esbuild@0.21.5:
resolution: {integrity: sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==}
engines: {node: '>=12'}
@@ -3954,10 +3795,6 @@ packages:
resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==}
engines: {node: '>=10'}
- magic-string@0.27.0:
- resolution: {integrity: sha512-8UnnX2PeRAPZuN12svgR9j7M1uWMovg/CEnIwIG0LFkXSJJe4PdfUGiTGl8V9bsBHFUtfVINcSyYxd7q+kx9fA==}
- engines: {node: '>=12'}
-
magic-string@0.30.11:
resolution: {integrity: sha512-+Wri9p0QHMy+545hKww7YAu5NyzF8iomPL/RQazugQ9+Ez4Ic3mERMd8ZTX5rfK944j+560ZJi8iAwgak1Ac7A==}
@@ -5256,11 +5093,6 @@ packages:
robust-predicates@3.0.2:
resolution: {integrity: sha512-IXgzBWvWQwE6PrDI05OvmXUIruQTcoMDzRsOd5CDvHCVLcLHMTSYvOK5Cm46kWqlV3yAbuSpBZdJ5oP5OUoStg==}
- rollup@3.29.5:
- resolution: {integrity: sha512-GVsDdsbJzzy4S/v3dqWPJ7EfvZJfCHiDqe80IyrF59LYuP+e6U1LJoUqeuqRbwAWoMNoXivMNeNAOf5E22VA1w==}
- engines: {node: '>=14.18.0', npm: '>=8.0.0'}
- hasBin: true
-
rollup@4.22.5:
resolution: {integrity: sha512-WoinX7GeQOFMGznEcWA1WrTQCd/tpEbMkc3nuMs9BT0CPjMdSjPMTVClwWd4pgSQwJdP65SK9mTCNvItlr5o7w==}
engines: {node: '>=18.0.0', npm: '>=8.0.0'}
@@ -5881,11 +5713,6 @@ packages:
typescript-auto-import-cache@0.3.3:
resolution: {integrity: sha512-ojEC7+Ci1ij9eE6hp8Jl9VUNnsEKzztktP5gtYNRMrTmfXVwA1PITYYAkpxCvvupdSYa/Re51B6KMcv1CTZEUA==}
- typescript@5.1.3:
- resolution: {integrity: sha512-XH627E9vkeqhlZFQuL+UsyAXEnibT0kWR2FWONlr4sTjvxyJYnyefgrkyECLzM5NenmKzRAy2rR/OlYLA1HkZw==}
- engines: {node: '>=14.17'}
- hasBin: true
-
typescript@5.4.5:
resolution: {integrity: sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==}
engines: {node: '>=14.17'}
@@ -6027,34 +5854,6 @@ packages:
engines: {node: ^18.0.0 || >=20.0.0}
hasBin: true
- vite@4.5.5:
- resolution: {integrity: sha512-ifW3Lb2sMdX+WU91s3R0FyQlAyLxOzCSCP37ujw0+r5POeHPwe6udWVIElKQq8gk3t7b8rkmvqC6IHBpCff4GQ==}
- engines: {node: ^14.18.0 || >=16.0.0}
- hasBin: true
- peerDependencies:
- '@types/node': '>= 14'
- less: '*'
- lightningcss: ^1.21.0
- sass: '*'
- stylus: '*'
- sugarss: '*'
- terser: ^5.4.0
- peerDependenciesMeta:
- '@types/node':
- optional: true
- less:
- optional: true
- lightningcss:
- optional: true
- sass:
- optional: true
- stylus:
- optional: true
- sugarss:
- optional: true
- terser:
- optional: true
-
vite@5.4.8:
resolution: {integrity: sha512-FqrItQ4DT1NC4zCUqMB4c4AZORMKIa0m8/URVCZ77OZ/QSNeJ54bU1vrFADbDsuwfIPcgknRkmqakQcgnL4GiQ==}
engines: {node: ^18.0.0 || >=20.0.0}
@@ -6788,153 +6587,102 @@ snapshots:
'@esbuild/aix-ppc64@0.23.1':
optional: true
- '@esbuild/android-arm64@0.18.20':
- optional: true
-
'@esbuild/android-arm64@0.21.5':
optional: true
'@esbuild/android-arm64@0.23.1':
optional: true
- '@esbuild/android-arm@0.18.20':
- optional: true
-
'@esbuild/android-arm@0.21.5':
optional: true
'@esbuild/android-arm@0.23.1':
optional: true
- '@esbuild/android-x64@0.18.20':
- optional: true
-
'@esbuild/android-x64@0.21.5':
optional: true
'@esbuild/android-x64@0.23.1':
optional: true
- '@esbuild/darwin-arm64@0.18.20':
- optional: true
-
'@esbuild/darwin-arm64@0.21.5':
optional: true
'@esbuild/darwin-arm64@0.23.1':
optional: true
- '@esbuild/darwin-x64@0.18.20':
- optional: true
-
'@esbuild/darwin-x64@0.21.5':
optional: true
'@esbuild/darwin-x64@0.23.1':
optional: true
- '@esbuild/freebsd-arm64@0.18.20':
- optional: true
-
'@esbuild/freebsd-arm64@0.21.5':
optional: true
'@esbuild/freebsd-arm64@0.23.1':
optional: true
- '@esbuild/freebsd-x64@0.18.20':
- optional: true
-
'@esbuild/freebsd-x64@0.21.5':
optional: true
'@esbuild/freebsd-x64@0.23.1':
optional: true
- '@esbuild/linux-arm64@0.18.20':
- optional: true
-
'@esbuild/linux-arm64@0.21.5':
optional: true
'@esbuild/linux-arm64@0.23.1':
optional: true
- '@esbuild/linux-arm@0.18.20':
- optional: true
-
'@esbuild/linux-arm@0.21.5':
optional: true
'@esbuild/linux-arm@0.23.1':
optional: true
- '@esbuild/linux-ia32@0.18.20':
- optional: true
-
'@esbuild/linux-ia32@0.21.5':
optional: true
'@esbuild/linux-ia32@0.23.1':
optional: true
- '@esbuild/linux-loong64@0.18.20':
- optional: true
-
'@esbuild/linux-loong64@0.21.5':
optional: true
'@esbuild/linux-loong64@0.23.1':
optional: true
- '@esbuild/linux-mips64el@0.18.20':
- optional: true
-
'@esbuild/linux-mips64el@0.21.5':
optional: true
'@esbuild/linux-mips64el@0.23.1':
optional: true
- '@esbuild/linux-ppc64@0.18.20':
- optional: true
-
'@esbuild/linux-ppc64@0.21.5':
optional: true
'@esbuild/linux-ppc64@0.23.1':
optional: true
- '@esbuild/linux-riscv64@0.18.20':
- optional: true
-
'@esbuild/linux-riscv64@0.21.5':
optional: true
'@esbuild/linux-riscv64@0.23.1':
optional: true
- '@esbuild/linux-s390x@0.18.20':
- optional: true
-
'@esbuild/linux-s390x@0.21.5':
optional: true
'@esbuild/linux-s390x@0.23.1':
optional: true
- '@esbuild/linux-x64@0.18.20':
- optional: true
-
'@esbuild/linux-x64@0.21.5':
optional: true
'@esbuild/linux-x64@0.23.1':
optional: true
- '@esbuild/netbsd-x64@0.18.20':
- optional: true
-
'@esbuild/netbsd-x64@0.21.5':
optional: true
@@ -6944,45 +6692,30 @@ snapshots:
'@esbuild/openbsd-arm64@0.23.1':
optional: true
- '@esbuild/openbsd-x64@0.18.20':
- optional: true
-
'@esbuild/openbsd-x64@0.21.5':
optional: true
'@esbuild/openbsd-x64@0.23.1':
optional: true
- '@esbuild/sunos-x64@0.18.20':
- optional: true
-
'@esbuild/sunos-x64@0.21.5':
optional: true
'@esbuild/sunos-x64@0.23.1':
optional: true
- '@esbuild/win32-arm64@0.18.20':
- optional: true
-
'@esbuild/win32-arm64@0.21.5':
optional: true
'@esbuild/win32-arm64@0.23.1':
optional: true
- '@esbuild/win32-ia32@0.18.20':
- optional: true
-
'@esbuild/win32-ia32@0.21.5':
optional: true
'@esbuild/win32-ia32@0.23.1':
optional: true
- '@esbuild/win32-x64@0.18.20':
- optional: true
-
'@esbuild/win32-x64@0.21.5':
optional: true
@@ -7731,20 +7464,10 @@ snapshots:
'@types/pug@2.0.10': {}
- '@types/react-dom@18.0.5':
- dependencies:
- '@types/react': 18.2.79
-
'@types/react-dom@18.2.25':
dependencies:
'@types/react': 18.2.79
- '@types/react@18.0.12':
- dependencies:
- '@types/prop-types': 15.7.13
- '@types/scheduler': 0.23.0
- csstype: 3.1.3
-
'@types/react@18.2.79':
dependencies:
'@types/prop-types': 15.7.13
@@ -7758,8 +7481,6 @@ snapshots:
dependencies:
'@types/node': 20.12.7
- '@types/scheduler@0.23.0': {}
-
'@types/unist@2.0.11': {}
'@types/unist@3.0.3': {}
@@ -7793,17 +7514,6 @@ snapshots:
- encoding
- supports-color
- '@vitejs/plugin-react@3.1.0(vite@4.5.5(@types/node@20.12.7))':
- dependencies:
- '@babel/core': 7.25.2
- '@babel/plugin-transform-react-jsx-self': 7.24.7(@babel/core@7.25.2)
- '@babel/plugin-transform-react-jsx-source': 7.24.7(@babel/core@7.25.2)
- magic-string: 0.27.0
- react-refresh: 0.14.2
- vite: 4.5.5(@types/node@20.12.7)
- transitivePeerDependencies:
- - supports-color
-
'@vitejs/plugin-react@4.3.1(vite@5.4.8(@types/node@20.12.7))':
dependencies:
'@babel/core': 7.25.2
@@ -8465,10 +8175,6 @@ snapshots:
ci-info@4.0.0: {}
- class-variance-authority@0.7.0:
- dependencies:
- clsx: 2.0.0
-
class-variance-authority@0.7.1:
dependencies:
clsx: 2.1.1
@@ -8507,8 +8213,6 @@ snapshots:
dependencies:
mimic-response: 1.0.1
- clsx@2.0.0: {}
-
clsx@2.1.0: {}
clsx@2.1.1: {}
@@ -9092,31 +8796,6 @@ snapshots:
es6-promise@3.3.1: {}
- esbuild@0.18.20:
- optionalDependencies:
- '@esbuild/android-arm': 0.18.20
- '@esbuild/android-arm64': 0.18.20
- '@esbuild/android-x64': 0.18.20
- '@esbuild/darwin-arm64': 0.18.20
- '@esbuild/darwin-x64': 0.18.20
- '@esbuild/freebsd-arm64': 0.18.20
- '@esbuild/freebsd-x64': 0.18.20
- '@esbuild/linux-arm': 0.18.20
- '@esbuild/linux-arm64': 0.18.20
- '@esbuild/linux-ia32': 0.18.20
- '@esbuild/linux-loong64': 0.18.20
- '@esbuild/linux-mips64el': 0.18.20
- '@esbuild/linux-ppc64': 0.18.20
- '@esbuild/linux-riscv64': 0.18.20
- '@esbuild/linux-s390x': 0.18.20
- '@esbuild/linux-x64': 0.18.20
- '@esbuild/netbsd-x64': 0.18.20
- '@esbuild/openbsd-x64': 0.18.20
- '@esbuild/sunos-x64': 0.18.20
- '@esbuild/win32-arm64': 0.18.20
- '@esbuild/win32-ia32': 0.18.20
- '@esbuild/win32-x64': 0.18.20
-
esbuild@0.21.5:
optionalDependencies:
'@esbuild/aix-ppc64': 0.21.5
@@ -10293,10 +9972,6 @@ snapshots:
dependencies:
yallist: 4.0.0
- magic-string@0.27.0:
- dependencies:
- '@jridgewell/sourcemap-codec': 1.5.0
-
magic-string@0.30.11:
dependencies:
'@jridgewell/sourcemap-codec': 1.5.0
@@ -11819,14 +11494,6 @@ snapshots:
camelcase-css: 2.0.1
postcss: 8.4.47
- postcss-load-config@4.0.2(postcss@8.4.47)(ts-node@10.9.2(@swc/core@1.4.16(@swc/helpers@0.5.2))(@types/node@20.12.7)(typescript@5.1.3)):
- dependencies:
- lilconfig: 3.1.2
- yaml: 2.5.1
- optionalDependencies:
- postcss: 8.4.47
- ts-node: 10.9.2(@swc/core@1.4.16(@swc/helpers@0.5.2))(@types/node@20.12.7)(typescript@5.1.3)
-
postcss-load-config@4.0.2(postcss@8.4.47)(ts-node@10.9.2(@swc/core@1.4.16(@swc/helpers@0.5.2))(@types/node@20.12.7)(typescript@5.4.5)):
dependencies:
lilconfig: 3.1.2
@@ -12260,10 +11927,6 @@ snapshots:
robust-predicates@3.0.2: {}
- rollup@3.29.5:
- optionalDependencies:
- fsevents: 2.3.3
-
rollup@4.22.5:
dependencies:
'@types/estree': 1.0.6
@@ -12807,33 +12470,6 @@ snapshots:
transitivePeerDependencies:
- typescript
- tailwindcss@3.4.13(ts-node@10.9.2(@swc/core@1.4.16(@swc/helpers@0.5.2))(@types/node@20.12.7)(typescript@5.1.3)):
- 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.0
- postcss: 8.4.47
- postcss-import: 15.1.0(postcss@8.4.47)
- postcss-js: 4.0.1(postcss@8.4.47)
- postcss-load-config: 4.0.2(postcss@8.4.47)(ts-node@10.9.2(@swc/core@1.4.16(@swc/helpers@0.5.2))(@types/node@20.12.7)(typescript@5.1.3))
- postcss-nested: 6.2.0(postcss@8.4.47)
- postcss-selector-parser: 6.1.2
- resolve: 1.22.8
- sucrase: 3.35.0
- transitivePeerDependencies:
- - ts-node
-
tailwindcss@3.4.13(ts-node@10.9.2(@swc/core@1.4.16(@swc/helpers@0.5.2))(@types/node@20.12.7)(typescript@5.4.5)):
dependencies:
'@alloc/quick-lru': 5.2.0
@@ -12947,27 +12583,6 @@ snapshots:
ts-interface-checker@0.1.13: {}
- ts-node@10.9.2(@swc/core@1.4.16(@swc/helpers@0.5.2))(@types/node@20.12.7)(typescript@5.1.3):
- dependencies:
- '@cspotcode/source-map-support': 0.8.1
- '@tsconfig/node10': 1.0.11
- '@tsconfig/node12': 1.0.11
- '@tsconfig/node14': 1.0.3
- '@tsconfig/node16': 1.0.4
- '@types/node': 20.12.7
- acorn: 8.12.1
- acorn-walk: 8.3.4
- arg: 4.1.3
- create-require: 1.1.1
- diff: 4.0.2
- make-error: 1.3.6
- typescript: 5.1.3
- v8-compile-cache-lib: 3.0.1
- yn: 3.1.1
- optionalDependencies:
- '@swc/core': 1.4.16(@swc/helpers@0.5.2)
- optional: true
-
ts-node@10.9.2(@swc/core@1.4.16(@swc/helpers@0.5.2))(@types/node@20.12.7)(typescript@5.4.5):
dependencies:
'@cspotcode/source-map-support': 0.8.1
@@ -13051,8 +12666,6 @@ snapshots:
dependencies:
semver: 7.6.3
- typescript@5.1.3: {}
-
typescript@5.4.5: {}
ufo@1.5.4: {}
@@ -13270,15 +12883,6 @@ snapshots:
- supports-color
- terser
- vite@4.5.5(@types/node@20.12.7):
- dependencies:
- esbuild: 0.18.20
- postcss: 8.4.47
- rollup: 3.29.5
- optionalDependencies:
- '@types/node': 20.12.7
- fsevents: 2.3.3
-
vite@5.4.8(@types/node@20.12.7):
dependencies:
esbuild: 0.21.5
From 462d3050e9044eb420b2ab5fa9684dc4ed91d9ab Mon Sep 17 00:00:00 2001
From: Joe Bell <7349341+joe-bell@users.noreply.github.com>
Date: Sat, 7 Dec 2024 07:47:38 +0200
Subject: [PATCH 15/22] Update packages/cva/package.json
---
packages/cva/package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/cva/package.json b/packages/cva/package.json
index 4c685ed4..dc20a9a3 100644
--- a/packages/cva/package.json
+++ b/packages/cva/package.json
@@ -57,7 +57,7 @@
"typescript": "5.4.5"
},
"peerDependencies": {
- "typescript": "5.4.5"
+ "typescript": ">= 4.5.5 < 6"
},
"peerDependenciesMeta": {
"typescript": {
From 26e09da5d1113064e4ee82a2504bcf1484f5cec0 Mon Sep 17 00:00:00 2001
From: Joe Bell <7349341+joe-bell@users.noreply.github.com>
Date: Wed, 11 Dec 2024 11:10:24 +0200
Subject: [PATCH 16/22] chore: kick off beta examples
---
.config/.syncpackrc | 17 +++-
docs/beta/astro.config.ts | 8 ++
.../getting-started/compound-components.mdx | 6 +-
.../docs/getting-started/polymorphism.mdx | 9 +-
.../docs/examples/react/tailwind-css.mdx | 12 ---
.../pages/docs/getting-started/_meta.json | 4 +-
.../.gitignore | 0
.../index.html | 2 +-
.../package.json | 2 +-
.../postcss.config.cjs | 0
.../public/vite.svg | 0
.../src/app.tsx | 4 +-
.../src/components/index.ts | 0
.../src/components/nav/index.ts | 0
.../src/components/nav/nav.tsx | 94 ++++++++++---------
.../src/index.css | 0
.../src/main.tsx | 2 +-
.../src/vite-env.d.ts | 0
.../tailwind.config.cjs | 0
.../tsconfig.json | 0
.../tsconfig.node.json | 0
.../vite.config.ts | 0
package.json | 7 ++
pnpm-lock.yaml | 61 ++++++------
pnpm-workspace.yaml | 2 +-
25 files changed, 124 insertions(+), 106 deletions(-)
rename docs/{latest/pages => beta/src/content}/docs/getting-started/compound-components.mdx (70%)
rename docs/{latest/pages => beta/src/content}/docs/getting-started/polymorphism.mdx (93%)
rename examples/{ => beta}/react-with-tailwindcss-compound/.gitignore (100%)
rename examples/{ => beta}/react-with-tailwindcss-compound/index.html (96%)
rename examples/{ => beta}/react-with-tailwindcss-compound/package.json (93%)
rename examples/{ => beta}/react-with-tailwindcss-compound/postcss.config.cjs (100%)
rename examples/{ => beta}/react-with-tailwindcss-compound/public/vite.svg (100%)
rename examples/{ => beta}/react-with-tailwindcss-compound/src/app.tsx (95%)
rename examples/{ => beta}/react-with-tailwindcss-compound/src/components/index.ts (100%)
rename examples/{ => beta}/react-with-tailwindcss-compound/src/components/nav/index.ts (100%)
rename examples/{ => beta}/react-with-tailwindcss-compound/src/components/nav/nav.tsx (53%)
rename examples/{ => beta}/react-with-tailwindcss-compound/src/index.css (100%)
rename examples/{ => beta}/react-with-tailwindcss-compound/src/main.tsx (89%)
rename examples/{ => beta}/react-with-tailwindcss-compound/src/vite-env.d.ts (100%)
rename examples/{ => beta}/react-with-tailwindcss-compound/tailwind.config.cjs (100%)
rename examples/{ => beta}/react-with-tailwindcss-compound/tsconfig.json (100%)
rename examples/{ => beta}/react-with-tailwindcss-compound/tsconfig.node.json (100%)
rename examples/{ => beta}/react-with-tailwindcss-compound/vite.config.ts (100%)
diff --git a/.config/.syncpackrc b/.config/.syncpackrc
index 5bef1d6d..193bd47a 100644
--- a/.config/.syncpackrc
+++ b/.config/.syncpackrc
@@ -6,6 +6,7 @@
{
"label": "Use `workspace:*` protocol for local packages",
"packages": [
+ "root",
"docs-*",
"cva",
"class-variance-authority",
@@ -21,12 +22,11 @@
"pinVersion": "workspace:*"
},
{
- "label": "Use `latest` for examples",
+ "label": "Use `latest` for `latest` examples",
"packages": [
"example-*"
],
"dependencies": [
- "cva",
"class-variance-authority"
],
"dependencyTypes": [
@@ -34,6 +34,19 @@
],
"pinVersion": "latest"
},
+ {
+ "label": "Use `beta` for `beta` examples",
+ "packages": [
+ "example-*"
+ ],
+ "dependencies": [
+ "cva"
+ ],
+ "dependencyTypes": [
+ "!local"
+ ],
+ "pinVersion": "beta"
+ },
{
"label": "Keep all other dependencies in sync",
"packages": [
diff --git a/docs/beta/astro.config.ts b/docs/beta/astro.config.ts
index bc931a52..278b2f2d 100644
--- a/docs/beta/astro.config.ts
+++ b/docs/beta/astro.config.ts
@@ -41,6 +41,10 @@ export default defineConfig({
{ label: "What's New?", link: "/getting-started/whats-new" },
{ label: "Installation", link: "/getting-started/installation" },
{ label: "Variants", link: "/getting-started/variants" },
+ {
+ label: "Compound Components",
+ link: "/getting-started/compound-components",
+ },
{
label: "Extending Components",
link: "/getting-started/extending-components",
@@ -49,6 +53,10 @@ export default defineConfig({
label: "Composing Components",
link: "/getting-started/composing-components",
},
+ {
+ label: "Polymorphism",
+ link: "/getting-started/polymorphism",
+ },
{ label: "TypeScript", link: "/getting-started/typescript" },
],
},
diff --git a/docs/latest/pages/docs/getting-started/compound-components.mdx b/docs/beta/src/content/docs/getting-started/compound-components.mdx
similarity index 70%
rename from docs/latest/pages/docs/getting-started/compound-components.mdx
rename to docs/beta/src/content/docs/getting-started/compound-components.mdx
index cb3c05ef..19ca5366 100644
--- a/docs/latest/pages/docs/getting-started/compound-components.mdx
+++ b/docs/beta/src/content/docs/getting-started/compound-components.mdx
@@ -1,4 +1,6 @@
-# Compound Components
+---
+title: Compound Components
+---
Compound Components are a term that React.js developers will be familiar with, and feels like the best way to describe this pattern.
@@ -11,4 +13,4 @@ TODO
## Examples
-- [React with Tailwind CSS](../examples/react/tailwind-css#compound-components)
+- [React with Tailwind CSS](../examples/beta/react-with-tailwind-css-compound/index.html)
diff --git a/docs/latest/pages/docs/getting-started/polymorphism.mdx b/docs/beta/src/content/docs/getting-started/polymorphism.mdx
similarity index 93%
rename from docs/latest/pages/docs/getting-started/polymorphism.mdx
rename to docs/beta/src/content/docs/getting-started/polymorphism.mdx
index 90deb089..1791d996 100644
--- a/docs/latest/pages/docs/getting-started/polymorphism.mdx
+++ b/docs/beta/src/content/docs/getting-started/polymorphism.mdx
@@ -1,4 +1,6 @@
-# Polymorphism
+---
+title: Polymorphism
+---
`cva` components are polymorphic (and framework-agnostic) by default; just apply the class to your preferred HTML element…
@@ -22,9 +24,10 @@ If you'd prefer to use a React-based API, `cva` strongly recommends using [`@rad
// ./components/button.tsx
import * as React from "react";
import { Slot } from "@radix-ui/react-slot";
-import { cva, type VariantProps } from "class-variance-authority";
+import { cva, type VariantProps } from "cva";
-const button = cva("button", {
+const button = cva({
+ base: "button",
variants: {
intent: {
primary: [
diff --git a/docs/latest/pages/docs/examples/react/tailwind-css.mdx b/docs/latest/pages/docs/examples/react/tailwind-css.mdx
index 4fbc019b..b0678ef8 100644
--- a/docs/latest/pages/docs/examples/react/tailwind-css.mdx
+++ b/docs/latest/pages/docs/examples/react/tailwind-css.mdx
@@ -2,19 +2,7 @@ import { StackBlitz } from "../../../../components/StackBlitz";
# React with Tailwind CSS
-1. [Basic Components](#basic-components)
-2. [Compound Components](#compound-components)
-
-## Basic Components
-
-
-## Compound Components
-
-
diff --git a/docs/latest/pages/docs/getting-started/_meta.json b/docs/latest/pages/docs/getting-started/_meta.json
index 5738467e..1d9db324 100644
--- a/docs/latest/pages/docs/getting-started/_meta.json
+++ b/docs/latest/pages/docs/getting-started/_meta.json
@@ -1,9 +1,7 @@
{
"installation": "",
"variants": "",
- "compound-components": "",
"typescript": "TypeScript",
"extending-components": "",
- "composing-components": "",
- "polymorphism": ""
+ "composing-components": ""
}
diff --git a/examples/react-with-tailwindcss-compound/.gitignore b/examples/beta/react-with-tailwindcss-compound/.gitignore
similarity index 100%
rename from examples/react-with-tailwindcss-compound/.gitignore
rename to examples/beta/react-with-tailwindcss-compound/.gitignore
diff --git a/examples/react-with-tailwindcss-compound/index.html b/examples/beta/react-with-tailwindcss-compound/index.html
similarity index 96%
rename from examples/react-with-tailwindcss-compound/index.html
rename to examples/beta/react-with-tailwindcss-compound/index.html
index bb06f6a0..f89f3975 100644
--- a/examples/react-with-tailwindcss-compound/index.html
+++ b/examples/beta/react-with-tailwindcss-compound/index.html
@@ -1,4 +1,4 @@
-
+
diff --git a/examples/react-with-tailwindcss-compound/package.json b/examples/beta/react-with-tailwindcss-compound/package.json
similarity index 93%
rename from examples/react-with-tailwindcss-compound/package.json
rename to examples/beta/react-with-tailwindcss-compound/package.json
index 5d6f34d3..cd48623a 100644
--- a/examples/react-with-tailwindcss-compound/package.json
+++ b/examples/beta/react-with-tailwindcss-compound/package.json
@@ -9,7 +9,7 @@
"preview": "vite preview"
},
"dependencies": {
- "class-variance-authority": "latest",
+ "cva": "beta",
"react": "18.2.0",
"react-dom": "18.2.0"
},
diff --git a/examples/react-with-tailwindcss-compound/postcss.config.cjs b/examples/beta/react-with-tailwindcss-compound/postcss.config.cjs
similarity index 100%
rename from examples/react-with-tailwindcss-compound/postcss.config.cjs
rename to examples/beta/react-with-tailwindcss-compound/postcss.config.cjs
diff --git a/examples/react-with-tailwindcss-compound/public/vite.svg b/examples/beta/react-with-tailwindcss-compound/public/vite.svg
similarity index 100%
rename from examples/react-with-tailwindcss-compound/public/vite.svg
rename to examples/beta/react-with-tailwindcss-compound/public/vite.svg
diff --git a/examples/react-with-tailwindcss-compound/src/app.tsx b/examples/beta/react-with-tailwindcss-compound/src/app.tsx
similarity index 95%
rename from examples/react-with-tailwindcss-compound/src/app.tsx
rename to examples/beta/react-with-tailwindcss-compound/src/app.tsx
index 8e409c2b..8936cb30 100644
--- a/examples/react-with-tailwindcss-compound/src/app.tsx
+++ b/examples/beta/react-with-tailwindcss-compound/src/app.tsx
@@ -1,4 +1,4 @@
-import { cx } from "class-variance-authority";
+import { cx } from "cva";
import * as Nav from "./components/nav";
// ## Option 1
@@ -42,7 +42,7 @@ function App() {
"relative",
"h-max w-max",
"self-center justify-self-center",
- "[&_:where(th,td)]:p-4"
+ "[&_:where(th,td)]:p-4",
)}
>
diff --git a/examples/react-with-tailwindcss-compound/src/components/index.ts b/examples/beta/react-with-tailwindcss-compound/src/components/index.ts
similarity index 100%
rename from examples/react-with-tailwindcss-compound/src/components/index.ts
rename to examples/beta/react-with-tailwindcss-compound/src/components/index.ts
diff --git a/examples/react-with-tailwindcss-compound/src/components/nav/index.ts b/examples/beta/react-with-tailwindcss-compound/src/components/nav/index.ts
similarity index 100%
rename from examples/react-with-tailwindcss-compound/src/components/nav/index.ts
rename to examples/beta/react-with-tailwindcss-compound/src/components/nav/index.ts
diff --git a/examples/react-with-tailwindcss-compound/src/components/nav/nav.tsx b/examples/beta/react-with-tailwindcss-compound/src/components/nav/nav.tsx
similarity index 53%
rename from examples/react-with-tailwindcss-compound/src/components/nav/nav.tsx
rename to examples/beta/react-with-tailwindcss-compound/src/components/nav/nav.tsx
index 6b66b8b8..7f59acd5 100644
--- a/examples/react-with-tailwindcss-compound/src/components/nav/nav.tsx
+++ b/examples/beta/react-with-tailwindcss-compound/src/components/nav/nav.tsx
@@ -1,11 +1,11 @@
import React from "react";
-import { cva, type VariantProps } from "class-variance-authority";
+import { cva, type VariantProps } from "cva";
/* Root
============================================ */
-export const root = cva(
- [
+export const root = cva({
+ base: [
"[--nav-item-py-offset:calc(var(--nav-item-py)*0.5*-1)]",
"flex",
"flex-col",
@@ -14,26 +14,24 @@ export const root = cva(
"border-zinc-200",
"shadow-sm",
],
- {
- variants: {
- density: {
- compact: [
- "[--nav-radius:theme(borderRadius.lg)]",
- "[--nav-item-px:theme(space.3)]",
- "[--nav-item-py:theme(space.2)]",
- ],
- cozy: [
- "[--nav-radius:theme(borderRadius.xl)]",
- "[--nav-item-px:theme(space.5)]",
- "[--nav-item-py:theme(space.4)]",
- ],
- },
+ variants: {
+ density: {
+ compact: [
+ "[--nav-radius:theme(borderRadius.lg)]",
+ "[--nav-item-px:theme(space.3)]",
+ "[--nav-item-py:theme(space.2)]",
+ ],
+ cozy: [
+ "[--nav-radius:theme(borderRadius.xl)]",
+ "[--nav-item-px:theme(space.5)]",
+ "[--nav-item-py:theme(space.4)]",
+ ],
},
- defaultVariants: {
- density: "compact",
- },
- }
-);
+ },
+ defaultVariants: {
+ density: "compact",
+ },
+});
export interface RootProps
extends React.HTMLAttributes,
@@ -52,11 +50,13 @@ export const Root: React.FC = ({ className, density, ...props }) => (
/* Item
============================================ */
-export const item = cva([
- "[&+*]:mt-[--nav-item-py-offset]",
- "[&>*]:first:rounded-t-[--nav-radius]",
- "[&>*]:last:rounded-b-[--nav-radius]",
-]);
+export const item = cva({
+ base: [
+ "[&+*]:mt-[--nav-item-py-offset]",
+ "[&>*]:first:rounded-t-[--nav-radius]",
+ "[&>*]:last:rounded-b-[--nav-radius]",
+ ],
+});
export interface ItemProps
extends React.LiHTMLAttributes,
@@ -69,25 +69,27 @@ export const Item: React.FC = ({ className, ...props }) => (
/* Link
============================================ */
-export const link = cva([
- "relative",
- "flex",
- "bg-transparent",
- "font-light",
- "text-sm",
- "text-zinc-800",
- "focus-visible:bg-white",
- "hover:bg-zinc-50",
- "hover:text-zinc-900",
- "hover:z-20",
- "focus-visible:z-30",
- "focus-visible:outline-none",
- "focus-visible:ring",
- "focus-visible:ring-zinc-600",
- "focus-visible:ring-2",
- "px-[--nav-item-px]",
- "py-[--nav-item-py]",
-]);
+export const link = cva({
+ base: [
+ "relative",
+ "flex",
+ "bg-transparent",
+ "font-light",
+ "text-sm",
+ "text-zinc-800",
+ "focus-visible:bg-white",
+ "hover:bg-zinc-50",
+ "hover:text-zinc-900",
+ "hover:z-20",
+ "focus-visible:z-30",
+ "focus-visible:outline-none",
+ "focus-visible:ring",
+ "focus-visible:ring-zinc-600",
+ "focus-visible:ring-2",
+ "px-[--nav-item-px]",
+ "py-[--nav-item-py]",
+ ],
+});
export interface LinkProps
extends React.AnchorHTMLAttributes,
diff --git a/examples/react-with-tailwindcss-compound/src/index.css b/examples/beta/react-with-tailwindcss-compound/src/index.css
similarity index 100%
rename from examples/react-with-tailwindcss-compound/src/index.css
rename to examples/beta/react-with-tailwindcss-compound/src/index.css
diff --git a/examples/react-with-tailwindcss-compound/src/main.tsx b/examples/beta/react-with-tailwindcss-compound/src/main.tsx
similarity index 89%
rename from examples/react-with-tailwindcss-compound/src/main.tsx
rename to examples/beta/react-with-tailwindcss-compound/src/main.tsx
index bfb19b8c..8287a61b 100644
--- a/examples/react-with-tailwindcss-compound/src/main.tsx
+++ b/examples/beta/react-with-tailwindcss-compound/src/main.tsx
@@ -5,5 +5,5 @@ import App from "./app";
ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
-
+ ,
);
diff --git a/examples/react-with-tailwindcss-compound/src/vite-env.d.ts b/examples/beta/react-with-tailwindcss-compound/src/vite-env.d.ts
similarity index 100%
rename from examples/react-with-tailwindcss-compound/src/vite-env.d.ts
rename to examples/beta/react-with-tailwindcss-compound/src/vite-env.d.ts
diff --git a/examples/react-with-tailwindcss-compound/tailwind.config.cjs b/examples/beta/react-with-tailwindcss-compound/tailwind.config.cjs
similarity index 100%
rename from examples/react-with-tailwindcss-compound/tailwind.config.cjs
rename to examples/beta/react-with-tailwindcss-compound/tailwind.config.cjs
diff --git a/examples/react-with-tailwindcss-compound/tsconfig.json b/examples/beta/react-with-tailwindcss-compound/tsconfig.json
similarity index 100%
rename from examples/react-with-tailwindcss-compound/tsconfig.json
rename to examples/beta/react-with-tailwindcss-compound/tsconfig.json
diff --git a/examples/react-with-tailwindcss-compound/tsconfig.node.json b/examples/beta/react-with-tailwindcss-compound/tsconfig.node.json
similarity index 100%
rename from examples/react-with-tailwindcss-compound/tsconfig.node.json
rename to examples/beta/react-with-tailwindcss-compound/tsconfig.node.json
diff --git a/examples/react-with-tailwindcss-compound/vite.config.ts b/examples/beta/react-with-tailwindcss-compound/vite.config.ts
similarity index 100%
rename from examples/react-with-tailwindcss-compound/vite.config.ts
rename to examples/beta/react-with-tailwindcss-compound/vite.config.ts
diff --git a/package.json b/package.json
index e3c072ec..a39caa91 100644
--- a/package.json
+++ b/package.json
@@ -1,4 +1,5 @@
{
+ "name": "root",
"private": true,
"scripts": {
"check": "pnpm run --filter './packages/**' --parallel check",
@@ -35,5 +36,11 @@
"packageManager": "pnpm@9.0.4",
"engines": {
"node": "20"
+ },
+ "pnpm": {
+ "overrides": {
+ "class-variance-authority": "workspace:*",
+ "cva": "workspace:*"
+ }
}
}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 8d4b8db1..7b6e3fef 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -4,6 +4,10 @@ settings:
autoInstallPeers: true
excludeLinksFromLockfile: false
+overrides:
+ class-variance-authority: workspace:*
+ cva: workspace:*
+
importers:
.:
@@ -139,8 +143,8 @@ importers:
specifier: ^4.15.9
version: 4.15.9(@types/node@20.12.7)(rollup@4.22.5)(typescript@5.4.5)
class-variance-authority:
- specifier: latest
- version: 0.7.1
+ specifier: workspace:*
+ version: link:../../packages/class-variance-authority
npm-run-all:
specifier: 4.1.5
version: 4.1.5
@@ -152,11 +156,11 @@ importers:
specifier: 5.4.5
version: 5.4.5
- examples/react-with-css-modules:
+ examples/beta/react-with-tailwindcss-compound:
dependencies:
- class-variance-authority:
- specifier: latest
- version: 0.7.1
+ cva:
+ specifier: workspace:*
+ version: link:../../../packages/cva
react:
specifier: 18.2.0
version: 18.2.0
@@ -173,6 +177,15 @@ importers:
'@vitejs/plugin-react':
specifier: ^4.2.1
version: 4.3.1(vite@5.4.8(@types/node@20.12.7))
+ autoprefixer:
+ specifier: ^10.4.13
+ version: 10.4.20(postcss@8.4.47)
+ postcss:
+ specifier: ^8.4.21
+ version: 8.4.47
+ tailwindcss:
+ specifier: ^3.4.3
+ version: 3.4.13(ts-node@10.9.2(@swc/core@1.4.16(@swc/helpers@0.5.2))(@types/node@20.12.7)(typescript@5.4.5))
typescript:
specifier: 5.4.5
version: 5.4.5
@@ -180,11 +193,11 @@ importers:
specifier: ^5.2.10
version: 5.4.8(@types/node@20.12.7)
- examples/react-with-tailwindcss:
+ examples/react-with-css-modules:
dependencies:
class-variance-authority:
- specifier: latest
- version: 0.7.1
+ specifier: workspace:*
+ version: link:../../packages/class-variance-authority
react:
specifier: 18.2.0
version: 18.2.0
@@ -201,15 +214,6 @@ importers:
'@vitejs/plugin-react':
specifier: ^4.2.1
version: 4.3.1(vite@5.4.8(@types/node@20.12.7))
- autoprefixer:
- specifier: ^10.4.13
- version: 10.4.20(postcss@8.4.47)
- postcss:
- specifier: ^8.4.21
- version: 8.4.47
- tailwindcss:
- specifier: ^3.4.3
- version: 3.4.13(ts-node@10.9.2(@swc/core@1.4.16(@swc/helpers@0.5.2))(@types/node@20.12.7)(typescript@5.4.5))
typescript:
specifier: 5.4.5
version: 5.4.5
@@ -217,11 +221,11 @@ importers:
specifier: ^5.2.10
version: 5.4.8(@types/node@20.12.7)
- examples/react-with-tailwindcss-compound:
+ examples/react-with-tailwindcss:
dependencies:
class-variance-authority:
- specifier: latest
- version: 0.7.1
+ specifier: workspace:*
+ version: link:../../packages/class-variance-authority
react:
specifier: 18.2.0
version: 18.2.0
@@ -263,8 +267,8 @@ importers:
specifier: ^5.0.4
version: 5.0.4
class-variance-authority:
- specifier: latest
- version: 0.7.1
+ specifier: workspace:*
+ version: link:../../packages/class-variance-authority
svelte:
specifier: ^4.2.15
version: 4.2.19
@@ -284,8 +288,8 @@ importers:
examples/vue:
dependencies:
class-variance-authority:
- specifier: latest
- version: 0.7.1
+ specifier: workspace:*
+ version: link:../../packages/class-variance-authority
vue:
specifier: ^3.4.23
version: 3.5.10(typescript@5.4.5)
@@ -2235,9 +2239,6 @@ packages:
resolution: {integrity: sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==}
engines: {node: '>=8'}
- class-variance-authority@0.7.1:
- resolution: {integrity: sha512-Ka+9Trutv7G8M6WT6SeiRWz792K5qEqIGEGzXKhAE6xOWAY6pPH8U+9IY3oCMv6kqTmLsv7Xh/2w2RigkePMsg==}
-
cli-boxes@3.0.0:
resolution: {integrity: sha512-/lzGpEWL/8PfI0BmBOPRwp0c/wFNX1RdUML3jK/RcSBA9T8mZDdQpqYBKtCFTOfQbwPqWEOpjqW+Fnayc0969g==}
engines: {node: '>=10'}
@@ -8175,10 +8176,6 @@ snapshots:
ci-info@4.0.0: {}
- class-variance-authority@0.7.1:
- dependencies:
- clsx: 2.1.1
-
cli-boxes@3.0.0: {}
cli-cursor@4.0.0:
diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml
index c3e19729..ab077efd 100644
--- a/pnpm-workspace.yaml
+++ b/pnpm-workspace.yaml
@@ -1,5 +1,5 @@
packages:
- "docs/*"
- - "examples/*"
+ - "examples/**"
- "packages/**"
enable-pre-post-scripts: true
From 37d32d7b91fa6dbb727ca2d1a96d242724f5b0c2 Mon Sep 17 00:00:00 2001
From: Joe Bell <7349341+joe-bell@users.noreply.github.com>
Date: Wed, 11 Dec 2024 11:15:05 +0200
Subject: [PATCH 17/22] chore: create latest examples dir
---
docs/latest/pages/docs/examples/astro.mdx | 2 +-
.../pages/docs/examples/react/css-modules.mdx | 2 +-
.../docs/examples/react/tailwind-css.mdx | 2 +-
docs/latest/pages/docs/examples/svelte.mdx | 2 +-
docs/latest/pages/docs/examples/vue.mdx | 2 +-
.../astro-with-tailwindcss/.gitignore | 0
.../.vscode/extensions.json | 0
.../.vscode/launch.json | 0
.../astro-with-tailwindcss/README.md | 0
.../astro-with-tailwindcss/astro.config.mjs | 0
.../astro-with-tailwindcss/package.json | 0
.../src/components/button.astro | 0
.../astro-with-tailwindcss/src/env.d.ts | 0
.../src/pages/index.astro | 0
.../tailwind.config.cjs | 0
.../astro-with-tailwindcss/tsconfig.json | 0
.../react-with-css-modules/.gitignore | 0
.../react-with-css-modules/index.html | 0
.../react-with-css-modules/package.json | 0
.../react-with-css-modules/src/app.tsx | 2 +-
.../src/components/button/button.module.css | 0
.../src/components/button/button.tsx | 0
.../src/components/button/index.ts | 0
.../src/components/index.ts | 0
.../react-with-css-modules/src/main.css | 0
.../react-with-css-modules/src/main.tsx | 0
.../react-with-css-modules/src/vite-env.d.ts | 0
.../react-with-css-modules/tsconfig.json | 0
.../react-with-css-modules/tsconfig.node.json | 0
.../react-with-css-modules/vite.config.ts | 0
.../react-with-tailwindcss/.gitignore | 0
.../react-with-tailwindcss/index.html | 0
.../react-with-tailwindcss/package.json | 0
.../react-with-tailwindcss/postcss.config.cjs | 0
.../react-with-tailwindcss/src/app.tsx | 2 +-
.../src/components/button/button.tsx | 0
.../src/components/button/index.ts | 0
.../src/components/index.ts | 0
.../react-with-tailwindcss/src/index.css | 0
.../react-with-tailwindcss/src/main.tsx | 0
.../react-with-tailwindcss/src/vite-env.d.ts | 0
.../tailwind.config.cjs | 0
.../react-with-tailwindcss/tsconfig.json | 0
.../react-with-tailwindcss/tsconfig.node.json | 0
.../react-with-tailwindcss/vite.config.ts | 0
examples/{ => latest}/svelte/.gitignore | 0
.../svelte/.vscode/extensions.json | 0
examples/{ => latest}/svelte/README.md | 0
examples/{ => latest}/svelte/index.html | 0
examples/{ => latest}/svelte/package.json | 0
examples/{ => latest}/svelte/src/App.svelte | 0
examples/{ => latest}/svelte/src/app.css | 0
.../svelte/src/components/button.svelte | 0
examples/{ => latest}/svelte/src/main.ts | 0
.../{ => latest}/svelte/src/vite-env.d.ts | 0
examples/{ => latest}/svelte/svelte.config.js | 0
examples/{ => latest}/svelte/tsconfig.json | 0
.../{ => latest}/svelte/tsconfig.node.json | 0
examples/{ => latest}/svelte/vite.config.ts | 0
examples/{ => latest}/vue/.gitignore | 0
.../{ => latest}/vue/.vscode/extensions.json | 0
examples/{ => latest}/vue/README.md | 0
examples/{ => latest}/vue/index.html | 0
examples/{ => latest}/vue/package.json | 0
examples/{ => latest}/vue/src/App.vue | 0
examples/{ => latest}/vue/src/app.css | 0
.../vue/src/components/Button.vue | 0
examples/{ => latest}/vue/src/main.ts | 0
examples/{ => latest}/vue/src/vite-env.d.ts | 0
examples/{ => latest}/vue/tsconfig.json | 0
examples/{ => latest}/vue/tsconfig.node.json | 0
examples/{ => latest}/vue/vite.config.ts | 0
pnpm-lock.yaml | 72 +++++++++----------
73 files changed, 43 insertions(+), 43 deletions(-)
rename examples/{ => latest}/astro-with-tailwindcss/.gitignore (100%)
rename examples/{ => latest}/astro-with-tailwindcss/.vscode/extensions.json (100%)
rename examples/{ => latest}/astro-with-tailwindcss/.vscode/launch.json (100%)
rename examples/{ => latest}/astro-with-tailwindcss/README.md (100%)
rename examples/{ => latest}/astro-with-tailwindcss/astro.config.mjs (100%)
rename examples/{ => latest}/astro-with-tailwindcss/package.json (100%)
rename examples/{ => latest}/astro-with-tailwindcss/src/components/button.astro (100%)
rename examples/{ => latest}/astro-with-tailwindcss/src/env.d.ts (100%)
rename examples/{ => latest}/astro-with-tailwindcss/src/pages/index.astro (100%)
rename examples/{ => latest}/astro-with-tailwindcss/tailwind.config.cjs (100%)
rename examples/{ => latest}/astro-with-tailwindcss/tsconfig.json (100%)
rename examples/{ => latest}/react-with-css-modules/.gitignore (100%)
rename examples/{ => latest}/react-with-css-modules/index.html (100%)
rename examples/{ => latest}/react-with-css-modules/package.json (100%)
rename examples/{ => latest}/react-with-css-modules/src/app.tsx (98%)
rename examples/{ => latest}/react-with-css-modules/src/components/button/button.module.css (100%)
rename examples/{ => latest}/react-with-css-modules/src/components/button/button.tsx (100%)
rename examples/{ => latest}/react-with-css-modules/src/components/button/index.ts (100%)
rename examples/{ => latest}/react-with-css-modules/src/components/index.ts (100%)
rename examples/{ => latest}/react-with-css-modules/src/main.css (100%)
rename examples/{ => latest}/react-with-css-modules/src/main.tsx (100%)
rename examples/{ => latest}/react-with-css-modules/src/vite-env.d.ts (100%)
rename examples/{ => latest}/react-with-css-modules/tsconfig.json (100%)
rename examples/{ => latest}/react-with-css-modules/tsconfig.node.json (100%)
rename examples/{ => latest}/react-with-css-modules/vite.config.ts (100%)
rename examples/{ => latest}/react-with-tailwindcss/.gitignore (100%)
rename examples/{ => latest}/react-with-tailwindcss/index.html (100%)
rename examples/{ => latest}/react-with-tailwindcss/package.json (100%)
rename examples/{ => latest}/react-with-tailwindcss/postcss.config.cjs (100%)
rename examples/{ => latest}/react-with-tailwindcss/src/app.tsx (99%)
rename examples/{ => latest}/react-with-tailwindcss/src/components/button/button.tsx (100%)
rename examples/{ => latest}/react-with-tailwindcss/src/components/button/index.ts (100%)
rename examples/{ => latest}/react-with-tailwindcss/src/components/index.ts (100%)
rename examples/{ => latest}/react-with-tailwindcss/src/index.css (100%)
rename examples/{ => latest}/react-with-tailwindcss/src/main.tsx (100%)
rename examples/{ => latest}/react-with-tailwindcss/src/vite-env.d.ts (100%)
rename examples/{ => latest}/react-with-tailwindcss/tailwind.config.cjs (100%)
rename examples/{ => latest}/react-with-tailwindcss/tsconfig.json (100%)
rename examples/{ => latest}/react-with-tailwindcss/tsconfig.node.json (100%)
rename examples/{ => latest}/react-with-tailwindcss/vite.config.ts (100%)
rename examples/{ => latest}/svelte/.gitignore (100%)
rename examples/{ => latest}/svelte/.vscode/extensions.json (100%)
rename examples/{ => latest}/svelte/README.md (100%)
rename examples/{ => latest}/svelte/index.html (100%)
rename examples/{ => latest}/svelte/package.json (100%)
rename examples/{ => latest}/svelte/src/App.svelte (100%)
rename examples/{ => latest}/svelte/src/app.css (100%)
rename examples/{ => latest}/svelte/src/components/button.svelte (100%)
rename examples/{ => latest}/svelte/src/main.ts (100%)
rename examples/{ => latest}/svelte/src/vite-env.d.ts (100%)
rename examples/{ => latest}/svelte/svelte.config.js (100%)
rename examples/{ => latest}/svelte/tsconfig.json (100%)
rename examples/{ => latest}/svelte/tsconfig.node.json (100%)
rename examples/{ => latest}/svelte/vite.config.ts (100%)
rename examples/{ => latest}/vue/.gitignore (100%)
rename examples/{ => latest}/vue/.vscode/extensions.json (100%)
rename examples/{ => latest}/vue/README.md (100%)
rename examples/{ => latest}/vue/index.html (100%)
rename examples/{ => latest}/vue/package.json (100%)
rename examples/{ => latest}/vue/src/App.vue (100%)
rename examples/{ => latest}/vue/src/app.css (100%)
rename examples/{ => latest}/vue/src/components/Button.vue (100%)
rename examples/{ => latest}/vue/src/main.ts (100%)
rename examples/{ => latest}/vue/src/vite-env.d.ts (100%)
rename examples/{ => latest}/vue/tsconfig.json (100%)
rename examples/{ => latest}/vue/tsconfig.node.json (100%)
rename examples/{ => latest}/vue/vite.config.ts (100%)
diff --git a/docs/latest/pages/docs/examples/astro.mdx b/docs/latest/pages/docs/examples/astro.mdx
index 35ec6cf4..15cc4f37 100644
--- a/docs/latest/pages/docs/examples/astro.mdx
+++ b/docs/latest/pages/docs/examples/astro.mdx
@@ -5,6 +5,6 @@ import { StackBlitz } from "../../../components/StackBlitz";
## Tailwind CSS
diff --git a/docs/latest/pages/docs/examples/react/css-modules.mdx b/docs/latest/pages/docs/examples/react/css-modules.mdx
index b224aebb..dc8bb0b5 100644
--- a/docs/latest/pages/docs/examples/react/css-modules.mdx
+++ b/docs/latest/pages/docs/examples/react/css-modules.mdx
@@ -3,6 +3,6 @@ import { StackBlitz } from "../../../../components/StackBlitz";
# React with CSS Modules
diff --git a/docs/latest/pages/docs/examples/react/tailwind-css.mdx b/docs/latest/pages/docs/examples/react/tailwind-css.mdx
index b0678ef8..8321c79c 100644
--- a/docs/latest/pages/docs/examples/react/tailwind-css.mdx
+++ b/docs/latest/pages/docs/examples/react/tailwind-css.mdx
@@ -3,6 +3,6 @@ import { StackBlitz } from "../../../../components/StackBlitz";
# React with Tailwind CSS
diff --git a/docs/latest/pages/docs/examples/svelte.mdx b/docs/latest/pages/docs/examples/svelte.mdx
index 89573ec6..1c3ff23a 100644
--- a/docs/latest/pages/docs/examples/svelte.mdx
+++ b/docs/latest/pages/docs/examples/svelte.mdx
@@ -2,4 +2,4 @@ import { StackBlitz } from "../../../components/StackBlitz";
# Svelte
-
+
diff --git a/docs/latest/pages/docs/examples/vue.mdx b/docs/latest/pages/docs/examples/vue.mdx
index 4ecaf60d..44658ae0 100644
--- a/docs/latest/pages/docs/examples/vue.mdx
+++ b/docs/latest/pages/docs/examples/vue.mdx
@@ -2,4 +2,4 @@ import { StackBlitz } from "../../../components/StackBlitz";
# Vue
-
+
diff --git a/examples/astro-with-tailwindcss/.gitignore b/examples/latest/astro-with-tailwindcss/.gitignore
similarity index 100%
rename from examples/astro-with-tailwindcss/.gitignore
rename to examples/latest/astro-with-tailwindcss/.gitignore
diff --git a/examples/astro-with-tailwindcss/.vscode/extensions.json b/examples/latest/astro-with-tailwindcss/.vscode/extensions.json
similarity index 100%
rename from examples/astro-with-tailwindcss/.vscode/extensions.json
rename to examples/latest/astro-with-tailwindcss/.vscode/extensions.json
diff --git a/examples/astro-with-tailwindcss/.vscode/launch.json b/examples/latest/astro-with-tailwindcss/.vscode/launch.json
similarity index 100%
rename from examples/astro-with-tailwindcss/.vscode/launch.json
rename to examples/latest/astro-with-tailwindcss/.vscode/launch.json
diff --git a/examples/astro-with-tailwindcss/README.md b/examples/latest/astro-with-tailwindcss/README.md
similarity index 100%
rename from examples/astro-with-tailwindcss/README.md
rename to examples/latest/astro-with-tailwindcss/README.md
diff --git a/examples/astro-with-tailwindcss/astro.config.mjs b/examples/latest/astro-with-tailwindcss/astro.config.mjs
similarity index 100%
rename from examples/astro-with-tailwindcss/astro.config.mjs
rename to examples/latest/astro-with-tailwindcss/astro.config.mjs
diff --git a/examples/astro-with-tailwindcss/package.json b/examples/latest/astro-with-tailwindcss/package.json
similarity index 100%
rename from examples/astro-with-tailwindcss/package.json
rename to examples/latest/astro-with-tailwindcss/package.json
diff --git a/examples/astro-with-tailwindcss/src/components/button.astro b/examples/latest/astro-with-tailwindcss/src/components/button.astro
similarity index 100%
rename from examples/astro-with-tailwindcss/src/components/button.astro
rename to examples/latest/astro-with-tailwindcss/src/components/button.astro
diff --git a/examples/astro-with-tailwindcss/src/env.d.ts b/examples/latest/astro-with-tailwindcss/src/env.d.ts
similarity index 100%
rename from examples/astro-with-tailwindcss/src/env.d.ts
rename to examples/latest/astro-with-tailwindcss/src/env.d.ts
diff --git a/examples/astro-with-tailwindcss/src/pages/index.astro b/examples/latest/astro-with-tailwindcss/src/pages/index.astro
similarity index 100%
rename from examples/astro-with-tailwindcss/src/pages/index.astro
rename to examples/latest/astro-with-tailwindcss/src/pages/index.astro
diff --git a/examples/astro-with-tailwindcss/tailwind.config.cjs b/examples/latest/astro-with-tailwindcss/tailwind.config.cjs
similarity index 100%
rename from examples/astro-with-tailwindcss/tailwind.config.cjs
rename to examples/latest/astro-with-tailwindcss/tailwind.config.cjs
diff --git a/examples/astro-with-tailwindcss/tsconfig.json b/examples/latest/astro-with-tailwindcss/tsconfig.json
similarity index 100%
rename from examples/astro-with-tailwindcss/tsconfig.json
rename to examples/latest/astro-with-tailwindcss/tsconfig.json
diff --git a/examples/react-with-css-modules/.gitignore b/examples/latest/react-with-css-modules/.gitignore
similarity index 100%
rename from examples/react-with-css-modules/.gitignore
rename to examples/latest/react-with-css-modules/.gitignore
diff --git a/examples/react-with-css-modules/index.html b/examples/latest/react-with-css-modules/index.html
similarity index 100%
rename from examples/react-with-css-modules/index.html
rename to examples/latest/react-with-css-modules/index.html
diff --git a/examples/react-with-css-modules/package.json b/examples/latest/react-with-css-modules/package.json
similarity index 100%
rename from examples/react-with-css-modules/package.json
rename to examples/latest/react-with-css-modules/package.json
diff --git a/examples/react-with-css-modules/src/app.tsx b/examples/latest/react-with-css-modules/src/app.tsx
similarity index 98%
rename from examples/react-with-css-modules/src/app.tsx
rename to examples/latest/react-with-css-modules/src/app.tsx
index c16845a5..5a216deb 100644
--- a/examples/react-with-css-modules/src/app.tsx
+++ b/examples/latest/react-with-css-modules/src/app.tsx
@@ -38,7 +38,7 @@ function App() {
))}
- ))
+ )),
)}
diff --git a/examples/react-with-css-modules/src/components/button/button.module.css b/examples/latest/react-with-css-modules/src/components/button/button.module.css
similarity index 100%
rename from examples/react-with-css-modules/src/components/button/button.module.css
rename to examples/latest/react-with-css-modules/src/components/button/button.module.css
diff --git a/examples/react-with-css-modules/src/components/button/button.tsx b/examples/latest/react-with-css-modules/src/components/button/button.tsx
similarity index 100%
rename from examples/react-with-css-modules/src/components/button/button.tsx
rename to examples/latest/react-with-css-modules/src/components/button/button.tsx
diff --git a/examples/react-with-css-modules/src/components/button/index.ts b/examples/latest/react-with-css-modules/src/components/button/index.ts
similarity index 100%
rename from examples/react-with-css-modules/src/components/button/index.ts
rename to examples/latest/react-with-css-modules/src/components/button/index.ts
diff --git a/examples/react-with-css-modules/src/components/index.ts b/examples/latest/react-with-css-modules/src/components/index.ts
similarity index 100%
rename from examples/react-with-css-modules/src/components/index.ts
rename to examples/latest/react-with-css-modules/src/components/index.ts
diff --git a/examples/react-with-css-modules/src/main.css b/examples/latest/react-with-css-modules/src/main.css
similarity index 100%
rename from examples/react-with-css-modules/src/main.css
rename to examples/latest/react-with-css-modules/src/main.css
diff --git a/examples/react-with-css-modules/src/main.tsx b/examples/latest/react-with-css-modules/src/main.tsx
similarity index 100%
rename from examples/react-with-css-modules/src/main.tsx
rename to examples/latest/react-with-css-modules/src/main.tsx
diff --git a/examples/react-with-css-modules/src/vite-env.d.ts b/examples/latest/react-with-css-modules/src/vite-env.d.ts
similarity index 100%
rename from examples/react-with-css-modules/src/vite-env.d.ts
rename to examples/latest/react-with-css-modules/src/vite-env.d.ts
diff --git a/examples/react-with-css-modules/tsconfig.json b/examples/latest/react-with-css-modules/tsconfig.json
similarity index 100%
rename from examples/react-with-css-modules/tsconfig.json
rename to examples/latest/react-with-css-modules/tsconfig.json
diff --git a/examples/react-with-css-modules/tsconfig.node.json b/examples/latest/react-with-css-modules/tsconfig.node.json
similarity index 100%
rename from examples/react-with-css-modules/tsconfig.node.json
rename to examples/latest/react-with-css-modules/tsconfig.node.json
diff --git a/examples/react-with-css-modules/vite.config.ts b/examples/latest/react-with-css-modules/vite.config.ts
similarity index 100%
rename from examples/react-with-css-modules/vite.config.ts
rename to examples/latest/react-with-css-modules/vite.config.ts
diff --git a/examples/react-with-tailwindcss/.gitignore b/examples/latest/react-with-tailwindcss/.gitignore
similarity index 100%
rename from examples/react-with-tailwindcss/.gitignore
rename to examples/latest/react-with-tailwindcss/.gitignore
diff --git a/examples/react-with-tailwindcss/index.html b/examples/latest/react-with-tailwindcss/index.html
similarity index 100%
rename from examples/react-with-tailwindcss/index.html
rename to examples/latest/react-with-tailwindcss/index.html
diff --git a/examples/react-with-tailwindcss/package.json b/examples/latest/react-with-tailwindcss/package.json
similarity index 100%
rename from examples/react-with-tailwindcss/package.json
rename to examples/latest/react-with-tailwindcss/package.json
diff --git a/examples/react-with-tailwindcss/postcss.config.cjs b/examples/latest/react-with-tailwindcss/postcss.config.cjs
similarity index 100%
rename from examples/react-with-tailwindcss/postcss.config.cjs
rename to examples/latest/react-with-tailwindcss/postcss.config.cjs
diff --git a/examples/react-with-tailwindcss/src/app.tsx b/examples/latest/react-with-tailwindcss/src/app.tsx
similarity index 99%
rename from examples/react-with-tailwindcss/src/app.tsx
rename to examples/latest/react-with-tailwindcss/src/app.tsx
index fdb0376b..a39f794a 100644
--- a/examples/react-with-tailwindcss/src/app.tsx
+++ b/examples/latest/react-with-tailwindcss/src/app.tsx
@@ -46,7 +46,7 @@ function App() {
))}
- ))
+ )),
)}
diff --git a/examples/react-with-tailwindcss/src/components/button/button.tsx b/examples/latest/react-with-tailwindcss/src/components/button/button.tsx
similarity index 100%
rename from examples/react-with-tailwindcss/src/components/button/button.tsx
rename to examples/latest/react-with-tailwindcss/src/components/button/button.tsx
diff --git a/examples/react-with-tailwindcss/src/components/button/index.ts b/examples/latest/react-with-tailwindcss/src/components/button/index.ts
similarity index 100%
rename from examples/react-with-tailwindcss/src/components/button/index.ts
rename to examples/latest/react-with-tailwindcss/src/components/button/index.ts
diff --git a/examples/react-with-tailwindcss/src/components/index.ts b/examples/latest/react-with-tailwindcss/src/components/index.ts
similarity index 100%
rename from examples/react-with-tailwindcss/src/components/index.ts
rename to examples/latest/react-with-tailwindcss/src/components/index.ts
diff --git a/examples/react-with-tailwindcss/src/index.css b/examples/latest/react-with-tailwindcss/src/index.css
similarity index 100%
rename from examples/react-with-tailwindcss/src/index.css
rename to examples/latest/react-with-tailwindcss/src/index.css
diff --git a/examples/react-with-tailwindcss/src/main.tsx b/examples/latest/react-with-tailwindcss/src/main.tsx
similarity index 100%
rename from examples/react-with-tailwindcss/src/main.tsx
rename to examples/latest/react-with-tailwindcss/src/main.tsx
diff --git a/examples/react-with-tailwindcss/src/vite-env.d.ts b/examples/latest/react-with-tailwindcss/src/vite-env.d.ts
similarity index 100%
rename from examples/react-with-tailwindcss/src/vite-env.d.ts
rename to examples/latest/react-with-tailwindcss/src/vite-env.d.ts
diff --git a/examples/react-with-tailwindcss/tailwind.config.cjs b/examples/latest/react-with-tailwindcss/tailwind.config.cjs
similarity index 100%
rename from examples/react-with-tailwindcss/tailwind.config.cjs
rename to examples/latest/react-with-tailwindcss/tailwind.config.cjs
diff --git a/examples/react-with-tailwindcss/tsconfig.json b/examples/latest/react-with-tailwindcss/tsconfig.json
similarity index 100%
rename from examples/react-with-tailwindcss/tsconfig.json
rename to examples/latest/react-with-tailwindcss/tsconfig.json
diff --git a/examples/react-with-tailwindcss/tsconfig.node.json b/examples/latest/react-with-tailwindcss/tsconfig.node.json
similarity index 100%
rename from examples/react-with-tailwindcss/tsconfig.node.json
rename to examples/latest/react-with-tailwindcss/tsconfig.node.json
diff --git a/examples/react-with-tailwindcss/vite.config.ts b/examples/latest/react-with-tailwindcss/vite.config.ts
similarity index 100%
rename from examples/react-with-tailwindcss/vite.config.ts
rename to examples/latest/react-with-tailwindcss/vite.config.ts
diff --git a/examples/svelte/.gitignore b/examples/latest/svelte/.gitignore
similarity index 100%
rename from examples/svelte/.gitignore
rename to examples/latest/svelte/.gitignore
diff --git a/examples/svelte/.vscode/extensions.json b/examples/latest/svelte/.vscode/extensions.json
similarity index 100%
rename from examples/svelte/.vscode/extensions.json
rename to examples/latest/svelte/.vscode/extensions.json
diff --git a/examples/svelte/README.md b/examples/latest/svelte/README.md
similarity index 100%
rename from examples/svelte/README.md
rename to examples/latest/svelte/README.md
diff --git a/examples/svelte/index.html b/examples/latest/svelte/index.html
similarity index 100%
rename from examples/svelte/index.html
rename to examples/latest/svelte/index.html
diff --git a/examples/svelte/package.json b/examples/latest/svelte/package.json
similarity index 100%
rename from examples/svelte/package.json
rename to examples/latest/svelte/package.json
diff --git a/examples/svelte/src/App.svelte b/examples/latest/svelte/src/App.svelte
similarity index 100%
rename from examples/svelte/src/App.svelte
rename to examples/latest/svelte/src/App.svelte
diff --git a/examples/svelte/src/app.css b/examples/latest/svelte/src/app.css
similarity index 100%
rename from examples/svelte/src/app.css
rename to examples/latest/svelte/src/app.css
diff --git a/examples/svelte/src/components/button.svelte b/examples/latest/svelte/src/components/button.svelte
similarity index 100%
rename from examples/svelte/src/components/button.svelte
rename to examples/latest/svelte/src/components/button.svelte
diff --git a/examples/svelte/src/main.ts b/examples/latest/svelte/src/main.ts
similarity index 100%
rename from examples/svelte/src/main.ts
rename to examples/latest/svelte/src/main.ts
diff --git a/examples/svelte/src/vite-env.d.ts b/examples/latest/svelte/src/vite-env.d.ts
similarity index 100%
rename from examples/svelte/src/vite-env.d.ts
rename to examples/latest/svelte/src/vite-env.d.ts
diff --git a/examples/svelte/svelte.config.js b/examples/latest/svelte/svelte.config.js
similarity index 100%
rename from examples/svelte/svelte.config.js
rename to examples/latest/svelte/svelte.config.js
diff --git a/examples/svelte/tsconfig.json b/examples/latest/svelte/tsconfig.json
similarity index 100%
rename from examples/svelte/tsconfig.json
rename to examples/latest/svelte/tsconfig.json
diff --git a/examples/svelte/tsconfig.node.json b/examples/latest/svelte/tsconfig.node.json
similarity index 100%
rename from examples/svelte/tsconfig.node.json
rename to examples/latest/svelte/tsconfig.node.json
diff --git a/examples/svelte/vite.config.ts b/examples/latest/svelte/vite.config.ts
similarity index 100%
rename from examples/svelte/vite.config.ts
rename to examples/latest/svelte/vite.config.ts
diff --git a/examples/vue/.gitignore b/examples/latest/vue/.gitignore
similarity index 100%
rename from examples/vue/.gitignore
rename to examples/latest/vue/.gitignore
diff --git a/examples/vue/.vscode/extensions.json b/examples/latest/vue/.vscode/extensions.json
similarity index 100%
rename from examples/vue/.vscode/extensions.json
rename to examples/latest/vue/.vscode/extensions.json
diff --git a/examples/vue/README.md b/examples/latest/vue/README.md
similarity index 100%
rename from examples/vue/README.md
rename to examples/latest/vue/README.md
diff --git a/examples/vue/index.html b/examples/latest/vue/index.html
similarity index 100%
rename from examples/vue/index.html
rename to examples/latest/vue/index.html
diff --git a/examples/vue/package.json b/examples/latest/vue/package.json
similarity index 100%
rename from examples/vue/package.json
rename to examples/latest/vue/package.json
diff --git a/examples/vue/src/App.vue b/examples/latest/vue/src/App.vue
similarity index 100%
rename from examples/vue/src/App.vue
rename to examples/latest/vue/src/App.vue
diff --git a/examples/vue/src/app.css b/examples/latest/vue/src/app.css
similarity index 100%
rename from examples/vue/src/app.css
rename to examples/latest/vue/src/app.css
diff --git a/examples/vue/src/components/Button.vue b/examples/latest/vue/src/components/Button.vue
similarity index 100%
rename from examples/vue/src/components/Button.vue
rename to examples/latest/vue/src/components/Button.vue
diff --git a/examples/vue/src/main.ts b/examples/latest/vue/src/main.ts
similarity index 100%
rename from examples/vue/src/main.ts
rename to examples/latest/vue/src/main.ts
diff --git a/examples/vue/src/vite-env.d.ts b/examples/latest/vue/src/vite-env.d.ts
similarity index 100%
rename from examples/vue/src/vite-env.d.ts
rename to examples/latest/vue/src/vite-env.d.ts
diff --git a/examples/vue/tsconfig.json b/examples/latest/vue/tsconfig.json
similarity index 100%
rename from examples/vue/tsconfig.json
rename to examples/latest/vue/tsconfig.json
diff --git a/examples/vue/tsconfig.node.json b/examples/latest/vue/tsconfig.node.json
similarity index 100%
rename from examples/vue/tsconfig.node.json
rename to examples/latest/vue/tsconfig.node.json
diff --git a/examples/vue/vite.config.ts b/examples/latest/vue/vite.config.ts
similarity index 100%
rename from examples/vue/vite.config.ts
rename to examples/latest/vue/vite.config.ts
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 7b6e3fef..98e1cf98 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -128,34 +128,6 @@ importers:
specifier: 5.4.5
version: 5.4.5
- examples/astro-with-tailwindcss:
- dependencies:
- '@astrojs/check':
- specifier: ^0.9.3
- version: 0.9.3(prettier-plugin-astro@0.13.0)(prettier@3.2.5)(typescript@5.4.5)
- '@astrojs/tailwind':
- specifier: ^5.1.1
- version: 5.1.1(astro@4.15.9(@types/node@20.12.7)(rollup@4.22.5)(typescript@5.4.5))(tailwindcss@3.4.13(ts-node@10.9.2(@swc/core@1.4.16(@swc/helpers@0.5.2))(@types/node@20.12.7)(typescript@5.4.5)))(ts-node@10.9.2(@swc/core@1.4.16(@swc/helpers@0.5.2))(@types/node@20.12.7)(typescript@5.4.5))
- '@astrojs/ts-plugin':
- specifier: ^1.10.2
- version: 1.10.2
- astro:
- specifier: ^4.15.9
- version: 4.15.9(@types/node@20.12.7)(rollup@4.22.5)(typescript@5.4.5)
- class-variance-authority:
- specifier: workspace:*
- version: link:../../packages/class-variance-authority
- npm-run-all:
- specifier: 4.1.5
- version: 4.1.5
- tailwindcss:
- specifier: ^3.4.3
- version: 3.4.13(ts-node@10.9.2(@swc/core@1.4.16(@swc/helpers@0.5.2))(@types/node@20.12.7)(typescript@5.4.5))
- devDependencies:
- typescript:
- specifier: 5.4.5
- version: 5.4.5
-
examples/beta/react-with-tailwindcss-compound:
dependencies:
cva:
@@ -193,11 +165,39 @@ importers:
specifier: ^5.2.10
version: 5.4.8(@types/node@20.12.7)
- examples/react-with-css-modules:
+ examples/latest/astro-with-tailwindcss:
dependencies:
+ '@astrojs/check':
+ specifier: ^0.9.3
+ version: 0.9.3(prettier-plugin-astro@0.13.0)(prettier@3.2.5)(typescript@5.4.5)
+ '@astrojs/tailwind':
+ specifier: ^5.1.1
+ version: 5.1.1(astro@4.15.9(@types/node@20.12.7)(rollup@4.22.5)(typescript@5.4.5))(tailwindcss@3.4.13(ts-node@10.9.2(@swc/core@1.4.16(@swc/helpers@0.5.2))(@types/node@20.12.7)(typescript@5.4.5)))(ts-node@10.9.2(@swc/core@1.4.16(@swc/helpers@0.5.2))(@types/node@20.12.7)(typescript@5.4.5))
+ '@astrojs/ts-plugin':
+ specifier: ^1.10.2
+ version: 1.10.2
+ astro:
+ specifier: ^4.15.9
+ version: 4.15.9(@types/node@20.12.7)(rollup@4.22.5)(typescript@5.4.5)
class-variance-authority:
specifier: workspace:*
- version: link:../../packages/class-variance-authority
+ version: link:../../../packages/class-variance-authority
+ npm-run-all:
+ specifier: 4.1.5
+ version: 4.1.5
+ tailwindcss:
+ specifier: ^3.4.3
+ version: 3.4.13(ts-node@10.9.2(@swc/core@1.4.16(@swc/helpers@0.5.2))(@types/node@20.12.7)(typescript@5.4.5))
+ devDependencies:
+ typescript:
+ specifier: 5.4.5
+ version: 5.4.5
+
+ examples/latest/react-with-css-modules:
+ dependencies:
+ class-variance-authority:
+ specifier: workspace:*
+ version: link:../../../packages/class-variance-authority
react:
specifier: 18.2.0
version: 18.2.0
@@ -221,11 +221,11 @@ importers:
specifier: ^5.2.10
version: 5.4.8(@types/node@20.12.7)
- examples/react-with-tailwindcss:
+ examples/latest/react-with-tailwindcss:
dependencies:
class-variance-authority:
specifier: workspace:*
- version: link:../../packages/class-variance-authority
+ version: link:../../../packages/class-variance-authority
react:
specifier: 18.2.0
version: 18.2.0
@@ -258,7 +258,7 @@ importers:
specifier: ^5.2.10
version: 5.4.8(@types/node@20.12.7)
- examples/svelte:
+ examples/latest/svelte:
devDependencies:
'@sveltejs/vite-plugin-svelte':
specifier: ^3.1.0
@@ -268,7 +268,7 @@ importers:
version: 5.0.4
class-variance-authority:
specifier: workspace:*
- version: link:../../packages/class-variance-authority
+ version: link:../../../packages/class-variance-authority
svelte:
specifier: ^4.2.15
version: 4.2.19
@@ -285,11 +285,11 @@ importers:
specifier: ^5.2.10
version: 5.4.8(@types/node@20.12.7)
- examples/vue:
+ examples/latest/vue:
dependencies:
class-variance-authority:
specifier: workspace:*
- version: link:../../packages/class-variance-authority
+ version: link:../../../packages/class-variance-authority
vue:
specifier: ^3.4.23
version: 3.5.10(typescript@5.4.5)
From ab67cbaa6145711ccdc8b8a8643ea46308e9bddf Mon Sep 17 00:00:00 2001
From: Joe Bell <7349341+joe-bell@users.noreply.github.com>
Date: Wed, 11 Dec 2024 11:36:16 +0200
Subject: [PATCH 18/22] chore: add beta examples
---
.../beta/astro-with-tailwindcss/.gitignore | 21 +++
.../.vscode/extensions.json | 4 +
.../.vscode/launch.json | 11 ++
.../beta/astro-with-tailwindcss/README.md | 46 ++++++
.../astro-with-tailwindcss/astro.config.mjs | 9 ++
.../beta/astro-with-tailwindcss/package.json | 25 +++
.../src/components/button.astro | 57 +++++++
.../beta/astro-with-tailwindcss/src/env.d.ts | 1 +
.../src/pages/index.astro | 63 ++++++++
.../tailwind.config.cjs | 8 +
.../beta/astro-with-tailwindcss/tsconfig.json | 10 ++
.../beta/react-with-css-modules/.gitignore | 24 +++
.../beta/react-with-css-modules/index.html | 12 ++
.../beta/react-with-css-modules/package.json | 23 +++
.../beta/react-with-css-modules/src/app.tsx | 49 ++++++
.../src/components/button/button.module.css | 46 ++++++
.../src/components/button/button.tsx | 48 ++++++
.../src/components/button/index.ts | 1 +
.../src/components/index.ts | 1 +
.../beta/react-with-css-modules/src/main.css | 48 ++++++
.../beta/react-with-css-modules/src/main.tsx | 10 ++
.../react-with-css-modules/src/vite-env.d.ts | 1 +
.../beta/react-with-css-modules/tsconfig.json | 21 +++
.../react-with-css-modules/tsconfig.node.json | 9 ++
.../react-with-css-modules/vite.config.ts | 7 +
.../package.json | 2 +-
.../beta/react-with-tailwindcss/.gitignore | 24 +++
.../beta/react-with-tailwindcss/index.html | 13 ++
.../beta/react-with-tailwindcss/package.json | 26 ++++
.../react-with-tailwindcss/postcss.config.cjs | 6 +
.../beta/react-with-tailwindcss/src/app.tsx | 57 +++++++
.../src/components/button/button.tsx | 56 +++++++
.../src/components/button/index.ts | 1 +
.../src/components/index.ts | 1 +
.../beta/react-with-tailwindcss/src/index.css | 14 ++
.../beta/react-with-tailwindcss/src/main.tsx | 9 ++
.../react-with-tailwindcss/src/vite-env.d.ts | 1 +
.../tailwind.config.cjs | 8 +
.../beta/react-with-tailwindcss/tsconfig.json | 21 +++
.../react-with-tailwindcss/tsconfig.node.json | 9 ++
.../react-with-tailwindcss/vite.config.ts | 7 +
examples/beta/svelte/.gitignore | 24 +++
examples/beta/svelte/.vscode/extensions.json | 3 +
examples/beta/svelte/README.md | 47 ++++++
examples/beta/svelte/index.html | 12 ++
examples/beta/svelte/package.json | 21 +++
examples/beta/svelte/src/App.svelte | 58 +++++++
examples/beta/svelte/src/app.css | 36 +++++
.../beta/svelte/src/components/button.svelte | 92 ++++++++++++
examples/beta/svelte/src/main.ts | 8 +
examples/beta/svelte/src/vite-env.d.ts | 2 +
examples/beta/svelte/svelte.config.js | 7 +
examples/beta/svelte/tsconfig.json | 20 +++
examples/beta/svelte/tsconfig.node.json | 8 +
examples/beta/svelte/vite.config.ts | 7 +
examples/beta/vue/.gitignore | 24 +++
examples/beta/vue/.vscode/extensions.json | 3 +
examples/beta/vue/README.md | 18 +++
examples/beta/vue/index.html | 12 ++
examples/beta/vue/package.json | 21 +++
examples/beta/vue/src/App.vue | 52 +++++++
examples/beta/vue/src/app.css | 36 +++++
examples/beta/vue/src/components/Button.vue | 106 +++++++++++++
examples/beta/vue/src/main.ts | 5 +
examples/beta/vue/src/vite-env.d.ts | 1 +
examples/beta/vue/tsconfig.json | 18 +++
examples/beta/vue/tsconfig.node.json | 9 ++
examples/beta/vue/vite.config.ts | 7 +
pnpm-lock.yaml | 142 ++++++++++++++++++
69 files changed, 1608 insertions(+), 1 deletion(-)
create mode 100644 examples/beta/astro-with-tailwindcss/.gitignore
create mode 100644 examples/beta/astro-with-tailwindcss/.vscode/extensions.json
create mode 100644 examples/beta/astro-with-tailwindcss/.vscode/launch.json
create mode 100644 examples/beta/astro-with-tailwindcss/README.md
create mode 100644 examples/beta/astro-with-tailwindcss/astro.config.mjs
create mode 100644 examples/beta/astro-with-tailwindcss/package.json
create mode 100644 examples/beta/astro-with-tailwindcss/src/components/button.astro
create mode 100644 examples/beta/astro-with-tailwindcss/src/env.d.ts
create mode 100644 examples/beta/astro-with-tailwindcss/src/pages/index.astro
create mode 100644 examples/beta/astro-with-tailwindcss/tailwind.config.cjs
create mode 100644 examples/beta/astro-with-tailwindcss/tsconfig.json
create mode 100644 examples/beta/react-with-css-modules/.gitignore
create mode 100644 examples/beta/react-with-css-modules/index.html
create mode 100644 examples/beta/react-with-css-modules/package.json
create mode 100644 examples/beta/react-with-css-modules/src/app.tsx
create mode 100644 examples/beta/react-with-css-modules/src/components/button/button.module.css
create mode 100644 examples/beta/react-with-css-modules/src/components/button/button.tsx
create mode 100644 examples/beta/react-with-css-modules/src/components/button/index.ts
create mode 100644 examples/beta/react-with-css-modules/src/components/index.ts
create mode 100644 examples/beta/react-with-css-modules/src/main.css
create mode 100644 examples/beta/react-with-css-modules/src/main.tsx
create mode 100644 examples/beta/react-with-css-modules/src/vite-env.d.ts
create mode 100644 examples/beta/react-with-css-modules/tsconfig.json
create mode 100644 examples/beta/react-with-css-modules/tsconfig.node.json
create mode 100644 examples/beta/react-with-css-modules/vite.config.ts
create mode 100644 examples/beta/react-with-tailwindcss/.gitignore
create mode 100644 examples/beta/react-with-tailwindcss/index.html
create mode 100644 examples/beta/react-with-tailwindcss/package.json
create mode 100644 examples/beta/react-with-tailwindcss/postcss.config.cjs
create mode 100644 examples/beta/react-with-tailwindcss/src/app.tsx
create mode 100644 examples/beta/react-with-tailwindcss/src/components/button/button.tsx
create mode 100644 examples/beta/react-with-tailwindcss/src/components/button/index.ts
create mode 100644 examples/beta/react-with-tailwindcss/src/components/index.ts
create mode 100644 examples/beta/react-with-tailwindcss/src/index.css
create mode 100644 examples/beta/react-with-tailwindcss/src/main.tsx
create mode 100644 examples/beta/react-with-tailwindcss/src/vite-env.d.ts
create mode 100644 examples/beta/react-with-tailwindcss/tailwind.config.cjs
create mode 100644 examples/beta/react-with-tailwindcss/tsconfig.json
create mode 100644 examples/beta/react-with-tailwindcss/tsconfig.node.json
create mode 100644 examples/beta/react-with-tailwindcss/vite.config.ts
create mode 100644 examples/beta/svelte/.gitignore
create mode 100644 examples/beta/svelte/.vscode/extensions.json
create mode 100644 examples/beta/svelte/README.md
create mode 100644 examples/beta/svelte/index.html
create mode 100644 examples/beta/svelte/package.json
create mode 100644 examples/beta/svelte/src/App.svelte
create mode 100644 examples/beta/svelte/src/app.css
create mode 100644 examples/beta/svelte/src/components/button.svelte
create mode 100644 examples/beta/svelte/src/main.ts
create mode 100644 examples/beta/svelte/src/vite-env.d.ts
create mode 100644 examples/beta/svelte/svelte.config.js
create mode 100644 examples/beta/svelte/tsconfig.json
create mode 100644 examples/beta/svelte/tsconfig.node.json
create mode 100644 examples/beta/svelte/vite.config.ts
create mode 100644 examples/beta/vue/.gitignore
create mode 100644 examples/beta/vue/.vscode/extensions.json
create mode 100644 examples/beta/vue/README.md
create mode 100644 examples/beta/vue/index.html
create mode 100644 examples/beta/vue/package.json
create mode 100644 examples/beta/vue/src/App.vue
create mode 100644 examples/beta/vue/src/app.css
create mode 100644 examples/beta/vue/src/components/Button.vue
create mode 100644 examples/beta/vue/src/main.ts
create mode 100644 examples/beta/vue/src/vite-env.d.ts
create mode 100644 examples/beta/vue/tsconfig.json
create mode 100644 examples/beta/vue/tsconfig.node.json
create mode 100644 examples/beta/vue/vite.config.ts
diff --git a/examples/beta/astro-with-tailwindcss/.gitignore b/examples/beta/astro-with-tailwindcss/.gitignore
new file mode 100644
index 00000000..6240da8b
--- /dev/null
+++ b/examples/beta/astro-with-tailwindcss/.gitignore
@@ -0,0 +1,21 @@
+# build output
+dist/
+# generated types
+.astro/
+
+# dependencies
+node_modules/
+
+# logs
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+pnpm-debug.log*
+
+
+# environment variables
+.env
+.env.production
+
+# macOS-specific files
+.DS_Store
diff --git a/examples/beta/astro-with-tailwindcss/.vscode/extensions.json b/examples/beta/astro-with-tailwindcss/.vscode/extensions.json
new file mode 100644
index 00000000..22a15055
--- /dev/null
+++ b/examples/beta/astro-with-tailwindcss/.vscode/extensions.json
@@ -0,0 +1,4 @@
+{
+ "recommendations": ["astro-build.astro-vscode"],
+ "unwantedRecommendations": []
+}
diff --git a/examples/beta/astro-with-tailwindcss/.vscode/launch.json b/examples/beta/astro-with-tailwindcss/.vscode/launch.json
new file mode 100644
index 00000000..d6422097
--- /dev/null
+++ b/examples/beta/astro-with-tailwindcss/.vscode/launch.json
@@ -0,0 +1,11 @@
+{
+ "version": "0.2.0",
+ "configurations": [
+ {
+ "command": "./node_modules/.bin/astro dev",
+ "name": "Development server",
+ "request": "launch",
+ "type": "node-terminal"
+ }
+ ]
+}
diff --git a/examples/beta/astro-with-tailwindcss/README.md b/examples/beta/astro-with-tailwindcss/README.md
new file mode 100644
index 00000000..e14d3255
--- /dev/null
+++ b/examples/beta/astro-with-tailwindcss/README.md
@@ -0,0 +1,46 @@
+# Astro Starter Kit: Minimal
+
+```
+npm create astro@latest -- --template minimal
+```
+
+[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/minimal)
+[![Open with CodeSandbox](https://assets.codesandbox.io/github/button-edit-lime.svg)](https://codesandbox.io/p/sandbox/github/withastro/astro/tree/latest/examples/minimal)
+
+> 🧑🚀 **Seasoned astronaut?** Delete this file. Have fun!
+
+## 🚀 Project Structure
+
+Inside of your Astro project, you'll see the following folders and files:
+
+```
+/
+├── public/
+├── src/
+│ └── pages/
+│ └── index.astro
+└── package.json
+```
+
+Astro looks for `.astro` or `.md` files in the `src/pages/` directory. Each page is exposed as a route based on its file name.
+
+There's nothing special about `src/components/`, but that's where we like to put any Astro/React/Vue/Svelte/Preact components.
+
+Any static assets, like images, can be placed in the `public/` directory.
+
+## 🧞 Commands
+
+All commands are run from the root of the project, from a terminal:
+
+| Command | Action |
+| :--------------------- | :----------------------------------------------- |
+| `npm install` | Installs dependencies |
+| `npm run dev` | Starts local dev server at `localhost:3000` |
+| `npm run build` | Build your production site to `./dist/` |
+| `npm run preview` | Preview your build locally, before deploying |
+| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
+| `npm run astro --help` | Get help using the Astro CLI |
+
+## 👀 Want to learn more?
+
+Feel free to check [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat).
diff --git a/examples/beta/astro-with-tailwindcss/astro.config.mjs b/examples/beta/astro-with-tailwindcss/astro.config.mjs
new file mode 100644
index 00000000..2fde1045
--- /dev/null
+++ b/examples/beta/astro-with-tailwindcss/astro.config.mjs
@@ -0,0 +1,9 @@
+import { defineConfig } from "astro/config";
+
+// https://astro.build/config
+import tailwind from "@astrojs/tailwind";
+
+// https://astro.build/config
+export default defineConfig({
+ integrations: [tailwind()],
+});
diff --git a/examples/beta/astro-with-tailwindcss/package.json b/examples/beta/astro-with-tailwindcss/package.json
new file mode 100644
index 00000000..5451a5e7
--- /dev/null
+++ b/examples/beta/astro-with-tailwindcss/package.json
@@ -0,0 +1,25 @@
+{
+ "name": "example-beta-astro-with-tailwindcss",
+ "private": true,
+ "type": "module",
+ "scripts": {
+ "astro": "astro",
+ "build": "pnpm check && astro check && astro build",
+ "check": "tsc",
+ "dev": "astro dev",
+ "preview": "astro preview",
+ "start": "astro dev"
+ },
+ "dependencies": {
+ "@astrojs/check": "^0.9.3",
+ "@astrojs/tailwind": "^5.1.1",
+ "@astrojs/ts-plugin": "^1.10.2",
+ "astro": "^4.15.9",
+ "cva": "beta",
+ "npm-run-all": "4.1.5",
+ "tailwindcss": "^3.4.3"
+ },
+ "devDependencies": {
+ "typescript": "5.4.5"
+ }
+}
diff --git a/examples/beta/astro-with-tailwindcss/src/components/button.astro b/examples/beta/astro-with-tailwindcss/src/components/button.astro
new file mode 100644
index 00000000..24ad0ec9
--- /dev/null
+++ b/examples/beta/astro-with-tailwindcss/src/components/button.astro
@@ -0,0 +1,57 @@
+---
+import type { HTMLAttributes } from "astro/types";
+import { cva, type VariantProps } from "cva";
+
+const button = cva({
+ base: "button",
+ variants: {
+ intent: {
+ primary: ["bg-blue-500", "text-white", "border-transparent"],
+ secondary: ["bg-white", "text-gray-800", "border-gray-400"],
+ },
+ size: {
+ small: ["text-sm", "py-1", "px-2"],
+ medium: ["text-base", "py-2", "px-4"],
+ },
+ disabled: {
+ false: null,
+ true: ["opacity-50", "cursor-not-allowed"],
+ },
+ },
+ compoundVariants: [
+ {
+ intent: "primary",
+ disabled: false,
+ class: "hover:bg-blue-600",
+ },
+ {
+ intent: "secondary",
+ disabled: false,
+ class: "hover:bg-gray-100",
+ },
+ { intent: "primary", size: "medium", class: "uppercase" },
+ ],
+});
+
+export interface Props
+ extends Omit, "disabled">,
+ VariantProps {}
+
+/**
+ * For Astro components, we recommend setting your defaultVariants within
+ * Astro.props (which are `undefined` by default)
+ */
+const {
+ class: className,
+ intent = "primary",
+ size = "medium",
+ disabled = false,
+} = Astro.props;
+---
+
+
+
+
diff --git a/examples/beta/astro-with-tailwindcss/src/env.d.ts b/examples/beta/astro-with-tailwindcss/src/env.d.ts
new file mode 100644
index 00000000..f964fe0c
--- /dev/null
+++ b/examples/beta/astro-with-tailwindcss/src/env.d.ts
@@ -0,0 +1 @@
+///
diff --git a/examples/beta/astro-with-tailwindcss/src/pages/index.astro b/examples/beta/astro-with-tailwindcss/src/pages/index.astro
new file mode 100644
index 00000000..83e5eb45
--- /dev/null
+++ b/examples/beta/astro-with-tailwindcss/src/pages/index.astro
@@ -0,0 +1,63 @@
+---
+import Button from "../components/button.astro";
+
+const intents = [undefined, "primary", "secondary"] as const;
+const sizes = [undefined, "medium", "small"] as const;
+const isDisabled = [false, true] as const;
+---
+
+
+
+
+
+
+ cva: Astro with Tailwind CSS
+
+
+
+
+
+
+
+ {intents.map((intent) => {intent || "default"} )}
+
+
+
+ {
+ isDisabled.map((disabled) => (
+
+ {sizes.map((size, index) => (
+
+ {index === 0 && (
+
+ {disabled ? "disabled" : "enabled"}
+
+ )}
+ {size || "default"}
+ {intents.map((intent) => (
+
+
+ {intent || "default"} button
+
+
+ ))}
+
+ ))}
+
+ ))
+ }
+
+
+
+
diff --git a/examples/beta/astro-with-tailwindcss/tailwind.config.cjs b/examples/beta/astro-with-tailwindcss/tailwind.config.cjs
new file mode 100644
index 00000000..5ea66181
--- /dev/null
+++ b/examples/beta/astro-with-tailwindcss/tailwind.config.cjs
@@ -0,0 +1,8 @@
+/** @type {import('tailwindcss').Config} */
+module.exports = {
+ content: ["./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}"],
+ theme: {
+ extend: {},
+ },
+ plugins: [],
+};
diff --git a/examples/beta/astro-with-tailwindcss/tsconfig.json b/examples/beta/astro-with-tailwindcss/tsconfig.json
new file mode 100644
index 00000000..6b68cb84
--- /dev/null
+++ b/examples/beta/astro-with-tailwindcss/tsconfig.json
@@ -0,0 +1,10 @@
+{
+ "extends": "astro/tsconfigs/strictest",
+ "compilerOptions": {
+ "plugins": [
+ {
+ "name": "@astrojs/ts-plugin"
+ }
+ ]
+ }
+}
diff --git a/examples/beta/react-with-css-modules/.gitignore b/examples/beta/react-with-css-modules/.gitignore
new file mode 100644
index 00000000..a547bf36
--- /dev/null
+++ b/examples/beta/react-with-css-modules/.gitignore
@@ -0,0 +1,24 @@
+# Logs
+logs
+*.log
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+pnpm-debug.log*
+lerna-debug.log*
+
+node_modules
+dist
+dist-ssr
+*.local
+
+# Editor directories and files
+.vscode/*
+!.vscode/extensions.json
+.idea
+.DS_Store
+*.suo
+*.ntvs*
+*.njsproj
+*.sln
+*.sw?
diff --git a/examples/beta/react-with-css-modules/index.html b/examples/beta/react-with-css-modules/index.html
new file mode 100644
index 00000000..6f979451
--- /dev/null
+++ b/examples/beta/react-with-css-modules/index.html
@@ -0,0 +1,12 @@
+
+
+
+
+
+ cva: React with CSS Modules
+
+
+
+
+
+
diff --git a/examples/beta/react-with-css-modules/package.json b/examples/beta/react-with-css-modules/package.json
new file mode 100644
index 00000000..55962766
--- /dev/null
+++ b/examples/beta/react-with-css-modules/package.json
@@ -0,0 +1,23 @@
+{
+ "name": "example-beta-react-with-css-modules",
+ "private": true,
+ "type": "module",
+ "scripts": {
+ "build": "pnpm check && vite build",
+ "check": "tsc",
+ "dev": "vite",
+ "preview": "vite preview"
+ },
+ "dependencies": {
+ "cva": "beta",
+ "react": "18.2.0",
+ "react-dom": "18.2.0"
+ },
+ "devDependencies": {
+ "@types/react": "18.2.79",
+ "@types/react-dom": "18.2.25",
+ "@vitejs/plugin-react": "^4.2.1",
+ "typescript": "5.4.5",
+ "vite": "^5.2.10"
+ }
+}
diff --git a/examples/beta/react-with-css-modules/src/app.tsx b/examples/beta/react-with-css-modules/src/app.tsx
new file mode 100644
index 00000000..ee3f05de
--- /dev/null
+++ b/examples/beta/react-with-css-modules/src/app.tsx
@@ -0,0 +1,49 @@
+import React from "react";
+import { Button } from "./components";
+
+const intents = [undefined, "primary", "secondary"] as const;
+const sizes = [undefined, "medium", "small"] as const;
+const isDisabled = [false, true] as const;
+
+function App() {
+ return (
+
+
+
+
+
+ {intents.map((intent) => (
+ {intent || "default"}
+ ))}
+
+
+
+ {isDisabled.map((disabled) =>
+ sizes.map((size, index) => (
+
+ {index === 0 && (
+
+ {disabled ? "disabled" : "enabled"}
+
+ )}
+ {size || "default"}
+ {intents.map((intent) => (
+
+
+ {intent || "default"} button
+
+
+ ))}
+
+ )),
+ )}
+
+
+ );
+}
+
+export default App;
diff --git a/examples/beta/react-with-css-modules/src/components/button/button.module.css b/examples/beta/react-with-css-modules/src/components/button/button.module.css
new file mode 100644
index 00000000..ec26e55a
--- /dev/null
+++ b/examples/beta/react-with-css-modules/src/components/button/button.module.css
@@ -0,0 +1,46 @@
+.base {
+ display: inline-flex;
+ border-width: 1px;
+ border-style: solid;
+}
+
+.primary {
+ color: rgb(255 255 255);
+ background-color: rgb(59 130 246);
+ border: transparent;
+}
+
+.primary.enabled:hover {
+ background-color: rgb(37 99 235);
+}
+
+.secondary {
+ background-color: rgb(255 255 255);
+ color: rgb(31 41 55);
+ border-color: rgb(156 163 175);
+}
+
+.secondary.enabled:hover {
+ background-color: rgb(243 244 246);
+}
+
+.small {
+ font-size: 0.875rem /* 14px */;
+ line-height: 1.25rem /* 20px */;
+ padding: 0.25rem 0.5rem;
+}
+
+.medium {
+ font-size: 1rem /* 16px */;
+ line-height: 1.5rem /* 24px */;
+ padding: 0.5rem 1rem;
+}
+
+.primaryMedium {
+ text-transform: uppercase;
+}
+
+.disabled {
+ opacity: 0.5;
+ cursor: not-allowed;
+}
diff --git a/examples/beta/react-with-css-modules/src/components/button/button.tsx b/examples/beta/react-with-css-modules/src/components/button/button.tsx
new file mode 100644
index 00000000..2c7ac645
--- /dev/null
+++ b/examples/beta/react-with-css-modules/src/components/button/button.tsx
@@ -0,0 +1,48 @@
+import React from "react";
+import { cva, type VariantProps } from "cva";
+
+import styles from "./button.module.css";
+
+const button = cva({
+ base: styles.base,
+ variants: {
+ intent: {
+ primary: styles.primary,
+ secondary: styles.secondary,
+ },
+ size: {
+ small: styles.small,
+ medium: styles.medium,
+ },
+ disabled: {
+ false: styles.enabled,
+ true: styles.disabled,
+ },
+ },
+ compoundVariants: [
+ { intent: "primary", size: "medium", className: styles.primaryMedium },
+ ],
+ defaultVariants: {
+ intent: "primary",
+ size: "medium",
+ disabled: false,
+ },
+});
+
+export interface ButtonProps
+ extends Omit, "disabled">,
+ VariantProps {}
+
+export const Button: React.FC = ({
+ className,
+ intent,
+ size,
+ disabled,
+ ...props
+}) => (
+
+);
diff --git a/examples/beta/react-with-css-modules/src/components/button/index.ts b/examples/beta/react-with-css-modules/src/components/button/index.ts
new file mode 100644
index 00000000..98d55acd
--- /dev/null
+++ b/examples/beta/react-with-css-modules/src/components/button/index.ts
@@ -0,0 +1 @@
+export * from "./button";
diff --git a/examples/beta/react-with-css-modules/src/components/index.ts b/examples/beta/react-with-css-modules/src/components/index.ts
new file mode 100644
index 00000000..98d55acd
--- /dev/null
+++ b/examples/beta/react-with-css-modules/src/components/index.ts
@@ -0,0 +1 @@
+export * from "./button";
diff --git a/examples/beta/react-with-css-modules/src/main.css b/examples/beta/react-with-css-modules/src/main.css
new file mode 100644
index 00000000..f8e1c7b2
--- /dev/null
+++ b/examples/beta/react-with-css-modules/src/main.css
@@ -0,0 +1,48 @@
+html,
+body {
+ margin: 0;
+ padding: 0;
+ width: 100%;
+ height: 100%;
+}
+
+html {
+ line-height: 1.5;
+ -webkit-text-size-adjust: 100%;
+ tab-size: 4;
+ font-family:
+ ui-sans-serif,
+ system-ui,
+ -apple-system,
+ BlinkMacSystemFont,
+ "Segoe UI",
+ Roboto,
+ "Helvetica Neue",
+ Arial,
+ "Noto Sans",
+ sans-serif,
+ "Apple Color Emoji",
+ "Segoe UI Emoji",
+ "Segoe UI Symbol",
+ "Noto Color Emoji";
+ font-feature-settings: normal;
+}
+
+#root {
+ display: grid;
+ width: 100%;
+ height: 100%;
+ padding: 1.5rem;
+}
+
+.variant-table {
+ position: relative;
+ height: max-content;
+ width: max-content;
+ align-self: center;
+ justify-self: center;
+}
+
+.variant-table :where(th, td) {
+ padding: 0.5rem;
+}
diff --git a/examples/beta/react-with-css-modules/src/main.tsx b/examples/beta/react-with-css-modules/src/main.tsx
new file mode 100644
index 00000000..2d379698
--- /dev/null
+++ b/examples/beta/react-with-css-modules/src/main.tsx
@@ -0,0 +1,10 @@
+import React from "react";
+import ReactDOM from "react-dom/client";
+import App from "./app";
+import "./main.css";
+
+ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
+
+
+ ,
+);
diff --git a/examples/beta/react-with-css-modules/src/vite-env.d.ts b/examples/beta/react-with-css-modules/src/vite-env.d.ts
new file mode 100644
index 00000000..11f02fe2
--- /dev/null
+++ b/examples/beta/react-with-css-modules/src/vite-env.d.ts
@@ -0,0 +1 @@
+///
diff --git a/examples/beta/react-with-css-modules/tsconfig.json b/examples/beta/react-with-css-modules/tsconfig.json
new file mode 100644
index 00000000..54749d43
--- /dev/null
+++ b/examples/beta/react-with-css-modules/tsconfig.json
@@ -0,0 +1,21 @@
+{
+ "compilerOptions": {
+ "target": "ESNext",
+ "useDefineForClassFields": true,
+ "lib": ["DOM", "DOM.Iterable", "ESNext"],
+ "allowJs": false,
+ "skipLibCheck": true,
+ "esModuleInterop": false,
+ "allowSyntheticDefaultImports": true,
+ "strict": true,
+ "forceConsistentCasingInFileNames": true,
+ "module": "ESNext",
+ "moduleResolution": "Node",
+ "resolveJsonModule": true,
+ "isolatedModules": true,
+ "noEmit": true,
+ "jsx": "react"
+ },
+ "include": ["src"],
+ "references": [{ "path": "./tsconfig.node.json" }]
+}
diff --git a/examples/beta/react-with-css-modules/tsconfig.node.json b/examples/beta/react-with-css-modules/tsconfig.node.json
new file mode 100644
index 00000000..9d31e2ae
--- /dev/null
+++ b/examples/beta/react-with-css-modules/tsconfig.node.json
@@ -0,0 +1,9 @@
+{
+ "compilerOptions": {
+ "composite": true,
+ "module": "ESNext",
+ "moduleResolution": "Node",
+ "allowSyntheticDefaultImports": true
+ },
+ "include": ["vite.config.ts"]
+}
diff --git a/examples/beta/react-with-css-modules/vite.config.ts b/examples/beta/react-with-css-modules/vite.config.ts
new file mode 100644
index 00000000..9cc50ead
--- /dev/null
+++ b/examples/beta/react-with-css-modules/vite.config.ts
@@ -0,0 +1,7 @@
+import { defineConfig } from "vite";
+import react from "@vitejs/plugin-react";
+
+// https://vitejs.dev/config/
+export default defineConfig({
+ plugins: [react()],
+});
diff --git a/examples/beta/react-with-tailwindcss-compound/package.json b/examples/beta/react-with-tailwindcss-compound/package.json
index cd48623a..8b6ae11f 100644
--- a/examples/beta/react-with-tailwindcss-compound/package.json
+++ b/examples/beta/react-with-tailwindcss-compound/package.json
@@ -1,5 +1,5 @@
{
- "name": "example-react-with-tailwindcss-compound",
+ "name": "example-beta-react-with-tailwindcss-compound",
"private": true,
"type": "module",
"scripts": {
diff --git a/examples/beta/react-with-tailwindcss/.gitignore b/examples/beta/react-with-tailwindcss/.gitignore
new file mode 100644
index 00000000..a547bf36
--- /dev/null
+++ b/examples/beta/react-with-tailwindcss/.gitignore
@@ -0,0 +1,24 @@
+# Logs
+logs
+*.log
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+pnpm-debug.log*
+lerna-debug.log*
+
+node_modules
+dist
+dist-ssr
+*.local
+
+# Editor directories and files
+.vscode/*
+!.vscode/extensions.json
+.idea
+.DS_Store
+*.suo
+*.ntvs*
+*.njsproj
+*.sln
+*.sw?
diff --git a/examples/beta/react-with-tailwindcss/index.html b/examples/beta/react-with-tailwindcss/index.html
new file mode 100644
index 00000000..6d8295e7
--- /dev/null
+++ b/examples/beta/react-with-tailwindcss/index.html
@@ -0,0 +1,13 @@
+
+
+
+
+
+ cva: React with Tailwind CSS
+
+
+
+
+
+
+
diff --git a/examples/beta/react-with-tailwindcss/package.json b/examples/beta/react-with-tailwindcss/package.json
new file mode 100644
index 00000000..126e747f
--- /dev/null
+++ b/examples/beta/react-with-tailwindcss/package.json
@@ -0,0 +1,26 @@
+{
+ "name": "example-beta-react-with-tailwindcss",
+ "private": true,
+ "type": "module",
+ "scripts": {
+ "build": "pnpm check && vite build",
+ "check": "tsc",
+ "dev": "vite",
+ "preview": "vite preview"
+ },
+ "dependencies": {
+ "cva": "beta",
+ "react": "18.2.0",
+ "react-dom": "18.2.0"
+ },
+ "devDependencies": {
+ "@types/react": "18.2.79",
+ "@types/react-dom": "18.2.25",
+ "@vitejs/plugin-react": "^4.2.1",
+ "autoprefixer": "^10.4.13",
+ "postcss": "^8.4.21",
+ "tailwindcss": "^3.4.3",
+ "typescript": "5.4.5",
+ "vite": "^5.2.10"
+ }
+}
diff --git a/examples/beta/react-with-tailwindcss/postcss.config.cjs b/examples/beta/react-with-tailwindcss/postcss.config.cjs
new file mode 100644
index 00000000..12a703d9
--- /dev/null
+++ b/examples/beta/react-with-tailwindcss/postcss.config.cjs
@@ -0,0 +1,6 @@
+module.exports = {
+ plugins: {
+ tailwindcss: {},
+ autoprefixer: {},
+ },
+};
diff --git a/examples/beta/react-with-tailwindcss/src/app.tsx b/examples/beta/react-with-tailwindcss/src/app.tsx
new file mode 100644
index 00000000..3c97287a
--- /dev/null
+++ b/examples/beta/react-with-tailwindcss/src/app.tsx
@@ -0,0 +1,57 @@
+import React from "react";
+import { cx } from "cva";
+import { Button } from "./components";
+
+const intents = [undefined, "primary", "secondary"] as const;
+const sizes = [undefined, "medium", "small"] as const;
+const isDisabled = [false, true] as const;
+
+function App() {
+ return (
+
+
+
+
+
+ {intents.map((intent) => (
+ {intent || "default"}
+ ))}
+
+
+
+ {isDisabled.map((disabled) =>
+ sizes.map((size, index) => (
+
+ {index === 0 && (
+
+ {disabled ? "disabled" : "enabled"}
+
+ )}
+ {size || "default"}
+ {intents.map((intent) => (
+
+
+ {intent || "default"} button
+
+
+ ))}
+
+ )),
+ )}
+
+
+ );
+}
+
+export default App;
diff --git a/examples/beta/react-with-tailwindcss/src/components/button/button.tsx b/examples/beta/react-with-tailwindcss/src/components/button/button.tsx
new file mode 100644
index 00000000..3bb364c7
--- /dev/null
+++ b/examples/beta/react-with-tailwindcss/src/components/button/button.tsx
@@ -0,0 +1,56 @@
+import React from "react";
+import { cva, type VariantProps } from "cva";
+
+const button = cva({
+ base: "button",
+ variants: {
+ intent: {
+ primary: ["bg-blue-500", "text-white", "border-transparent"],
+ secondary: ["bg-white", "text-gray-800", "border-gray-400"],
+ },
+ size: {
+ small: ["text-sm", "py-1", "px-2"],
+ medium: ["text-base", "py-2", "px-4"],
+ },
+ disabled: {
+ false: null,
+ true: ["opacity-50", "cursor-not-allowed"],
+ },
+ },
+ compoundVariants: [
+ {
+ intent: "primary",
+ disabled: false,
+ class: "hover:bg-blue-600",
+ },
+ {
+ intent: "secondary",
+ disabled: false,
+ class: "hover:bg-gray-100",
+ },
+ { intent: "primary", size: "medium", class: "uppercase" },
+ ],
+ defaultVariants: {
+ disabled: false,
+ intent: "primary",
+ size: "medium",
+ },
+});
+
+export interface ButtonProps
+ extends Omit, "disabled">,
+ VariantProps {}
+
+export const Button: React.FC = ({
+ className,
+ intent,
+ size,
+ disabled,
+ ...props
+}) => (
+
+);
diff --git a/examples/beta/react-with-tailwindcss/src/components/button/index.ts b/examples/beta/react-with-tailwindcss/src/components/button/index.ts
new file mode 100644
index 00000000..98d55acd
--- /dev/null
+++ b/examples/beta/react-with-tailwindcss/src/components/button/index.ts
@@ -0,0 +1 @@
+export * from "./button";
diff --git a/examples/beta/react-with-tailwindcss/src/components/index.ts b/examples/beta/react-with-tailwindcss/src/components/index.ts
new file mode 100644
index 00000000..98d55acd
--- /dev/null
+++ b/examples/beta/react-with-tailwindcss/src/components/index.ts
@@ -0,0 +1 @@
+export * from "./button";
diff --git a/examples/beta/react-with-tailwindcss/src/index.css b/examples/beta/react-with-tailwindcss/src/index.css
new file mode 100644
index 00000000..00c93c8b
--- /dev/null
+++ b/examples/beta/react-with-tailwindcss/src/index.css
@@ -0,0 +1,14 @@
+@tailwind base;
+
+:where(html, body, #root) {
+ width: 100%;
+ height: 100%;
+}
+
+:where(#root) {
+ @apply grid p-6;
+}
+
+@tailwind components;
+
+@tailwind utilities;
diff --git a/examples/beta/react-with-tailwindcss/src/main.tsx b/examples/beta/react-with-tailwindcss/src/main.tsx
new file mode 100644
index 00000000..8287a61b
--- /dev/null
+++ b/examples/beta/react-with-tailwindcss/src/main.tsx
@@ -0,0 +1,9 @@
+import React from "react";
+import ReactDOM from "react-dom/client";
+import App from "./app";
+
+ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
+
+
+ ,
+);
diff --git a/examples/beta/react-with-tailwindcss/src/vite-env.d.ts b/examples/beta/react-with-tailwindcss/src/vite-env.d.ts
new file mode 100644
index 00000000..11f02fe2
--- /dev/null
+++ b/examples/beta/react-with-tailwindcss/src/vite-env.d.ts
@@ -0,0 +1 @@
+///
diff --git a/examples/beta/react-with-tailwindcss/tailwind.config.cjs b/examples/beta/react-with-tailwindcss/tailwind.config.cjs
new file mode 100644
index 00000000..ecf62b50
--- /dev/null
+++ b/examples/beta/react-with-tailwindcss/tailwind.config.cjs
@@ -0,0 +1,8 @@
+/** @type {import('tailwindcss').Config} */
+module.exports = {
+ content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"],
+ theme: {
+ extend: {},
+ },
+ plugins: [],
+};
diff --git a/examples/beta/react-with-tailwindcss/tsconfig.json b/examples/beta/react-with-tailwindcss/tsconfig.json
new file mode 100644
index 00000000..54749d43
--- /dev/null
+++ b/examples/beta/react-with-tailwindcss/tsconfig.json
@@ -0,0 +1,21 @@
+{
+ "compilerOptions": {
+ "target": "ESNext",
+ "useDefineForClassFields": true,
+ "lib": ["DOM", "DOM.Iterable", "ESNext"],
+ "allowJs": false,
+ "skipLibCheck": true,
+ "esModuleInterop": false,
+ "allowSyntheticDefaultImports": true,
+ "strict": true,
+ "forceConsistentCasingInFileNames": true,
+ "module": "ESNext",
+ "moduleResolution": "Node",
+ "resolveJsonModule": true,
+ "isolatedModules": true,
+ "noEmit": true,
+ "jsx": "react"
+ },
+ "include": ["src"],
+ "references": [{ "path": "./tsconfig.node.json" }]
+}
diff --git a/examples/beta/react-with-tailwindcss/tsconfig.node.json b/examples/beta/react-with-tailwindcss/tsconfig.node.json
new file mode 100644
index 00000000..9d31e2ae
--- /dev/null
+++ b/examples/beta/react-with-tailwindcss/tsconfig.node.json
@@ -0,0 +1,9 @@
+{
+ "compilerOptions": {
+ "composite": true,
+ "module": "ESNext",
+ "moduleResolution": "Node",
+ "allowSyntheticDefaultImports": true
+ },
+ "include": ["vite.config.ts"]
+}
diff --git a/examples/beta/react-with-tailwindcss/vite.config.ts b/examples/beta/react-with-tailwindcss/vite.config.ts
new file mode 100644
index 00000000..9cc50ead
--- /dev/null
+++ b/examples/beta/react-with-tailwindcss/vite.config.ts
@@ -0,0 +1,7 @@
+import { defineConfig } from "vite";
+import react from "@vitejs/plugin-react";
+
+// https://vitejs.dev/config/
+export default defineConfig({
+ plugins: [react()],
+});
diff --git a/examples/beta/svelte/.gitignore b/examples/beta/svelte/.gitignore
new file mode 100644
index 00000000..a547bf36
--- /dev/null
+++ b/examples/beta/svelte/.gitignore
@@ -0,0 +1,24 @@
+# Logs
+logs
+*.log
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+pnpm-debug.log*
+lerna-debug.log*
+
+node_modules
+dist
+dist-ssr
+*.local
+
+# Editor directories and files
+.vscode/*
+!.vscode/extensions.json
+.idea
+.DS_Store
+*.suo
+*.ntvs*
+*.njsproj
+*.sln
+*.sw?
diff --git a/examples/beta/svelte/.vscode/extensions.json b/examples/beta/svelte/.vscode/extensions.json
new file mode 100644
index 00000000..bdef8201
--- /dev/null
+++ b/examples/beta/svelte/.vscode/extensions.json
@@ -0,0 +1,3 @@
+{
+ "recommendations": ["svelte.svelte-vscode"]
+}
diff --git a/examples/beta/svelte/README.md b/examples/beta/svelte/README.md
new file mode 100644
index 00000000..08925843
--- /dev/null
+++ b/examples/beta/svelte/README.md
@@ -0,0 +1,47 @@
+# cva: Svelte + TS + Vite
+
+This template should help get you started developing with Svelte and TypeScript in Vite.
+
+## Recommended IDE Setup
+
+[VS Code](https://code.visualstudio.com/) + [Svelte](https://marketplace.visualstudio.com/items?itemName=svelte.svelte-vscode).
+
+## Need an official Svelte framework?
+
+Check out [SvelteKit](https://github.com/sveltejs/kit#readme), which is also powered by Vite. Deploy anywhere with its serverless-first approach and adapt to various platforms, with out of the box support for TypeScript, SCSS, and Less, and easily-added support for mdsvex, GraphQL, PostCSS, Tailwind CSS, and more.
+
+## Technical considerations
+
+**Why use this over SvelteKit?**
+
+- It brings its own routing solution which might not be preferable for some users.
+- It is first and foremost a framework that just happens to use Vite under the hood, not a Vite app.
+
+This template contains as little as possible to get started with Vite + TypeScript + Svelte, while taking into account the developer experience with regards to HMR and intellisense. It demonstrates capabilities on par with the other `create-vite` templates and is a good starting point for beginners dipping their toes into a Vite + Svelte project.
+
+Should you later need the extended capabilities and extensibility provided by SvelteKit, the template has been structured similarly to SvelteKit so that it is easy to migrate.
+
+**Why `global.d.ts` instead of `compilerOptions.types` inside `jsconfig.json` or `tsconfig.json`?**
+
+Setting `compilerOptions.types` shuts out all other types not explicitly listed in the configuration. Using triple-slash references keeps the default TypeScript setting of accepting type information from the entire workspace, while also adding `svelte` and `vite/client` type information.
+
+**Why include `.vscode/extensions.json`?**
+
+Other templates indirectly recommend extensions via the README, but this file allows VS Code to prompt the user to install the recommended extension upon opening the project.
+
+**Why enable `allowJs` in the TS template?**
+
+While `allowJs: false` would indeed prevent the use of `.js` files in the project, it does not prevent the use of JavaScript syntax in `.svelte` files. In addition, it would force `checkJs: false`, bringing the worst of both worlds: not being able to guarantee the entire codebase is TypeScript, and also having worse typechecking for the existing JavaScript. In addition, there are valid use cases in which a mixed codebase may be relevant.
+
+**Why is HMR not preserving my local component state?**
+
+HMR state preservation comes with a number of gotchas! It has been disabled by default in both `svelte-hmr` and `@sveltejs/vite-plugin-svelte` due to its often surprising behavior. You can read the details [here](https://github.com/rixo/svelte-hmr#svelte-hmr).
+
+If you have state that's important to retain within a component, consider creating an external store which would not be replaced by HMR.
+
+```ts
+// store.ts
+// An extremely simple external store
+import { writable } from "svelte/store";
+export default writable(0);
+```
diff --git a/examples/beta/svelte/index.html b/examples/beta/svelte/index.html
new file mode 100644
index 00000000..d6aee1ee
--- /dev/null
+++ b/examples/beta/svelte/index.html
@@ -0,0 +1,12 @@
+
+
+
+
+
+ cva: Svelte
+
+
+
+
+
+
diff --git a/examples/beta/svelte/package.json b/examples/beta/svelte/package.json
new file mode 100644
index 00000000..29be5e63
--- /dev/null
+++ b/examples/beta/svelte/package.json
@@ -0,0 +1,21 @@
+{
+ "name": "example-beta-svelte",
+ "private": true,
+ "type": "module",
+ "scripts": {
+ "build": "pnpm check && vite build",
+ "check": "svelte-check --tsconfig ./tsconfig.json",
+ "dev": "vite",
+ "preview": "vite preview"
+ },
+ "devDependencies": {
+ "@sveltejs/vite-plugin-svelte": "^3.1.0",
+ "@tsconfig/svelte": "^5.0.4",
+ "cva": "beta",
+ "svelte": "^4.2.15",
+ "svelte-check": "^3.6.9",
+ "tslib": "^2.6.2",
+ "typescript": "5.4.5",
+ "vite": "^5.2.10"
+ }
+}
diff --git a/examples/beta/svelte/src/App.svelte b/examples/beta/svelte/src/App.svelte
new file mode 100644
index 00000000..3de87458
--- /dev/null
+++ b/examples/beta/svelte/src/App.svelte
@@ -0,0 +1,58 @@
+
+
+
+
+
+
+
+ {#each intents as intent}
+ {intent || "default"}
+ {/each}
+
+
+
+ {#each isDisabled as disabled}
+ {#each sizes as size, index}
+
+ {#if index === 0}
+
+ {disabled ? "disabled" : "enabled"}
+
+ {/if}
+ {size || "default"}
+ {#each intents as intent}
+
+
+ {intent || "default"} button
+
+
+ {/each}
+
+ {/each}
+ {/each}
+
+
+
+
diff --git a/examples/beta/svelte/src/app.css b/examples/beta/svelte/src/app.css
new file mode 100644
index 00000000..11ba391b
--- /dev/null
+++ b/examples/beta/svelte/src/app.css
@@ -0,0 +1,36 @@
+html,
+body {
+ margin: 0;
+ padding: 0;
+ width: 100%;
+ height: 100%;
+}
+
+html {
+ line-height: 1.5;
+ -webkit-text-size-adjust: 100%;
+ tab-size: 4;
+ font-family:
+ ui-sans-serif,
+ system-ui,
+ -apple-system,
+ BlinkMacSystemFont,
+ "Segoe UI",
+ Roboto,
+ "Helvetica Neue",
+ Arial,
+ "Noto Sans",
+ sans-serif,
+ "Apple Color Emoji",
+ "Segoe UI Emoji",
+ "Segoe UI Symbol",
+ "Noto Color Emoji";
+ font-feature-settings: normal;
+}
+
+#app {
+ display: grid;
+ width: 100%;
+ height: 100%;
+ padding: 1.5rem;
+}
diff --git a/examples/beta/svelte/src/components/button.svelte b/examples/beta/svelte/src/components/button.svelte
new file mode 100644
index 00000000..fc6996cf
--- /dev/null
+++ b/examples/beta/svelte/src/components/button.svelte
@@ -0,0 +1,92 @@
+
+
+
+
+
+
+
diff --git a/examples/beta/svelte/src/main.ts b/examples/beta/svelte/src/main.ts
new file mode 100644
index 00000000..e7362853
--- /dev/null
+++ b/examples/beta/svelte/src/main.ts
@@ -0,0 +1,8 @@
+import "./app.css";
+import App from "./App.svelte";
+
+const app = new App({
+ target: document.getElementById("app")!,
+});
+
+export default app;
diff --git a/examples/beta/svelte/src/vite-env.d.ts b/examples/beta/svelte/src/vite-env.d.ts
new file mode 100644
index 00000000..4078e747
--- /dev/null
+++ b/examples/beta/svelte/src/vite-env.d.ts
@@ -0,0 +1,2 @@
+///
+///
diff --git a/examples/beta/svelte/svelte.config.js b/examples/beta/svelte/svelte.config.js
new file mode 100644
index 00000000..de2ddd65
--- /dev/null
+++ b/examples/beta/svelte/svelte.config.js
@@ -0,0 +1,7 @@
+import { vitePreprocess } from "@sveltejs/vite-plugin-svelte";
+
+export default {
+ // Consult https://svelte.dev/docs#compile-time-svelte-preprocess
+ // for more information about preprocessors
+ preprocess: vitePreprocess(),
+};
diff --git a/examples/beta/svelte/tsconfig.json b/examples/beta/svelte/tsconfig.json
new file mode 100644
index 00000000..c4e1c5fe
--- /dev/null
+++ b/examples/beta/svelte/tsconfig.json
@@ -0,0 +1,20 @@
+{
+ "extends": "@tsconfig/svelte/tsconfig.json",
+ "compilerOptions": {
+ "target": "ESNext",
+ "useDefineForClassFields": true,
+ "module": "ESNext",
+ "resolveJsonModule": true,
+ /**
+ * Typecheck JS in `.svelte` and `.js` files by default.
+ * Disable checkJs if you'd like to use dynamic types in JS.
+ * Note that setting allowJs false does not prevent the use
+ * of JS in `.svelte` files.
+ */
+ "allowJs": true,
+ "checkJs": true,
+ "isolatedModules": true
+ },
+ "include": ["src/**/*.d.ts", "src/**/*.ts", "src/**/*.js", "src/**/*.svelte"],
+ "references": [{ "path": "./tsconfig.node.json" }]
+}
diff --git a/examples/beta/svelte/tsconfig.node.json b/examples/beta/svelte/tsconfig.node.json
new file mode 100644
index 00000000..65dbdb96
--- /dev/null
+++ b/examples/beta/svelte/tsconfig.node.json
@@ -0,0 +1,8 @@
+{
+ "compilerOptions": {
+ "composite": true,
+ "module": "ESNext",
+ "moduleResolution": "Node"
+ },
+ "include": ["vite.config.ts"]
+}
diff --git a/examples/beta/svelte/vite.config.ts b/examples/beta/svelte/vite.config.ts
new file mode 100644
index 00000000..5ac8ecfe
--- /dev/null
+++ b/examples/beta/svelte/vite.config.ts
@@ -0,0 +1,7 @@
+import { defineConfig } from "vite";
+import { svelte } from "@sveltejs/vite-plugin-svelte";
+
+// https://vitejs.dev/config/
+export default defineConfig({
+ plugins: [svelte()],
+});
diff --git a/examples/beta/vue/.gitignore b/examples/beta/vue/.gitignore
new file mode 100644
index 00000000..a547bf36
--- /dev/null
+++ b/examples/beta/vue/.gitignore
@@ -0,0 +1,24 @@
+# Logs
+logs
+*.log
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+pnpm-debug.log*
+lerna-debug.log*
+
+node_modules
+dist
+dist-ssr
+*.local
+
+# Editor directories and files
+.vscode/*
+!.vscode/extensions.json
+.idea
+.DS_Store
+*.suo
+*.ntvs*
+*.njsproj
+*.sln
+*.sw?
diff --git a/examples/beta/vue/.vscode/extensions.json b/examples/beta/vue/.vscode/extensions.json
new file mode 100644
index 00000000..c0a6e5a4
--- /dev/null
+++ b/examples/beta/vue/.vscode/extensions.json
@@ -0,0 +1,3 @@
+{
+ "recommendations": ["Vue.volar", "Vue.vscode-typescript-vue-plugin"]
+}
diff --git a/examples/beta/vue/README.md b/examples/beta/vue/README.md
new file mode 100644
index 00000000..04992f5d
--- /dev/null
+++ b/examples/beta/vue/README.md
@@ -0,0 +1,18 @@
+# cva: Vue 3 + TypeScript + Vite
+
+This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `
+
+
diff --git a/examples/beta/vue/package.json b/examples/beta/vue/package.json
new file mode 100644
index 00000000..239548f0
--- /dev/null
+++ b/examples/beta/vue/package.json
@@ -0,0 +1,21 @@
+{
+ "name": "example-beta-vue",
+ "private": true,
+ "type": "module",
+ "scripts": {
+ "build": "pnpm check && vite build",
+ "check": "vue-tsc",
+ "dev": "vite",
+ "preview": "vite preview"
+ },
+ "dependencies": {
+ "cva": "beta",
+ "vue": "^3.4.23"
+ },
+ "devDependencies": {
+ "@vitejs/plugin-vue": "^5.0.4",
+ "typescript": "5.4.5",
+ "vite": "^5.2.10",
+ "vue-tsc": "^2.0.13"
+ }
+}
diff --git a/examples/beta/vue/src/App.vue b/examples/beta/vue/src/App.vue
new file mode 100644
index 00000000..06b07d9f
--- /dev/null
+++ b/examples/beta/vue/src/App.vue
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+
+
+
+ {{ intent || "default" }}
+
+
+
+
+
+
+
+ {{ typeof disabled === "undefined" ? "enabled" : "disabled" }}
+
+
+ {{ size || "default" }}
+
+
+ {{ intent || "default" }} button
+
+
+
+
+
+
+
+
+
diff --git a/examples/beta/vue/src/app.css b/examples/beta/vue/src/app.css
new file mode 100644
index 00000000..11ba391b
--- /dev/null
+++ b/examples/beta/vue/src/app.css
@@ -0,0 +1,36 @@
+html,
+body {
+ margin: 0;
+ padding: 0;
+ width: 100%;
+ height: 100%;
+}
+
+html {
+ line-height: 1.5;
+ -webkit-text-size-adjust: 100%;
+ tab-size: 4;
+ font-family:
+ ui-sans-serif,
+ system-ui,
+ -apple-system,
+ BlinkMacSystemFont,
+ "Segoe UI",
+ Roboto,
+ "Helvetica Neue",
+ Arial,
+ "Noto Sans",
+ sans-serif,
+ "Apple Color Emoji",
+ "Segoe UI Emoji",
+ "Segoe UI Symbol",
+ "Noto Color Emoji";
+ font-feature-settings: normal;
+}
+
+#app {
+ display: grid;
+ width: 100%;
+ height: 100%;
+ padding: 1.5rem;
+}
diff --git a/examples/beta/vue/src/components/Button.vue b/examples/beta/vue/src/components/Button.vue
new file mode 100644
index 00000000..e6480ef9
--- /dev/null
+++ b/examples/beta/vue/src/components/Button.vue
@@ -0,0 +1,106 @@
+
+
+
+
+
+
+
+
+
diff --git a/examples/beta/vue/src/main.ts b/examples/beta/vue/src/main.ts
new file mode 100644
index 00000000..355ea380
--- /dev/null
+++ b/examples/beta/vue/src/main.ts
@@ -0,0 +1,5 @@
+import { createApp } from "vue";
+import "./app.css";
+import App from "./App.vue";
+
+createApp(App).mount("#app");
diff --git a/examples/beta/vue/src/vite-env.d.ts b/examples/beta/vue/src/vite-env.d.ts
new file mode 100644
index 00000000..11f02fe2
--- /dev/null
+++ b/examples/beta/vue/src/vite-env.d.ts
@@ -0,0 +1 @@
+///
diff --git a/examples/beta/vue/tsconfig.json b/examples/beta/vue/tsconfig.json
new file mode 100644
index 00000000..b557c404
--- /dev/null
+++ b/examples/beta/vue/tsconfig.json
@@ -0,0 +1,18 @@
+{
+ "compilerOptions": {
+ "target": "ESNext",
+ "useDefineForClassFields": true,
+ "module": "ESNext",
+ "moduleResolution": "Node",
+ "strict": true,
+ "jsx": "preserve",
+ "resolveJsonModule": true,
+ "isolatedModules": true,
+ "esModuleInterop": true,
+ "lib": ["ESNext", "DOM"],
+ "skipLibCheck": true,
+ "noEmit": true
+ },
+ "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
+ "references": [{ "path": "./tsconfig.node.json" }]
+}
diff --git a/examples/beta/vue/tsconfig.node.json b/examples/beta/vue/tsconfig.node.json
new file mode 100644
index 00000000..9d31e2ae
--- /dev/null
+++ b/examples/beta/vue/tsconfig.node.json
@@ -0,0 +1,9 @@
+{
+ "compilerOptions": {
+ "composite": true,
+ "module": "ESNext",
+ "moduleResolution": "Node",
+ "allowSyntheticDefaultImports": true
+ },
+ "include": ["vite.config.ts"]
+}
diff --git a/examples/beta/vue/vite.config.ts b/examples/beta/vue/vite.config.ts
new file mode 100644
index 00000000..0a8bd808
--- /dev/null
+++ b/examples/beta/vue/vite.config.ts
@@ -0,0 +1,7 @@
+import { defineConfig } from "vite";
+import vue from "@vitejs/plugin-vue";
+
+// https://vitejs.dev/config/
+export default defineConfig({
+ plugins: [vue()],
+});
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 98e1cf98..b32e7b37 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -128,6 +128,99 @@ importers:
specifier: 5.4.5
version: 5.4.5
+ examples/beta/astro-with-tailwindcss:
+ dependencies:
+ '@astrojs/check':
+ specifier: ^0.9.3
+ version: 0.9.3(prettier-plugin-astro@0.13.0)(prettier@3.2.5)(typescript@5.4.5)
+ '@astrojs/tailwind':
+ specifier: ^5.1.1
+ version: 5.1.1(astro@4.15.9(@types/node@20.12.7)(rollup@4.22.5)(typescript@5.4.5))(tailwindcss@3.4.13(ts-node@10.9.2(@swc/core@1.4.16(@swc/helpers@0.5.2))(@types/node@20.12.7)(typescript@5.4.5)))(ts-node@10.9.2(@swc/core@1.4.16(@swc/helpers@0.5.2))(@types/node@20.12.7)(typescript@5.4.5))
+ '@astrojs/ts-plugin':
+ specifier: ^1.10.2
+ version: 1.10.2
+ astro:
+ specifier: ^4.15.9
+ version: 4.15.9(@types/node@20.12.7)(rollup@4.22.5)(typescript@5.4.5)
+ cva:
+ specifier: workspace:*
+ version: link:../../../packages/cva
+ npm-run-all:
+ specifier: 4.1.5
+ version: 4.1.5
+ tailwindcss:
+ specifier: ^3.4.3
+ version: 3.4.13(ts-node@10.9.2(@swc/core@1.4.16(@swc/helpers@0.5.2))(@types/node@20.12.7)(typescript@5.4.5))
+ devDependencies:
+ typescript:
+ specifier: 5.4.5
+ version: 5.4.5
+
+ examples/beta/react-with-css-modules:
+ dependencies:
+ cva:
+ specifier: workspace:*
+ version: link:../../../packages/cva
+ react:
+ specifier: 18.2.0
+ version: 18.2.0
+ react-dom:
+ specifier: 18.2.0
+ version: 18.2.0(react@18.2.0)
+ devDependencies:
+ '@types/react':
+ specifier: 18.2.79
+ version: 18.2.79
+ '@types/react-dom':
+ specifier: 18.2.25
+ version: 18.2.25
+ '@vitejs/plugin-react':
+ specifier: ^4.2.1
+ version: 4.3.1(vite@5.4.8(@types/node@20.12.7))
+ typescript:
+ specifier: 5.4.5
+ version: 5.4.5
+ vite:
+ specifier: ^5.2.10
+ version: 5.4.8(@types/node@20.12.7)
+
+ examples/beta/react-with-tailwindcss:
+ dependencies:
+ cva:
+ specifier: workspace:*
+ version: link:../../../packages/cva
+ react:
+ specifier: 18.2.0
+ version: 18.2.0
+ react-dom:
+ specifier: 18.2.0
+ version: 18.2.0(react@18.2.0)
+ devDependencies:
+ '@types/react':
+ specifier: 18.2.79
+ version: 18.2.79
+ '@types/react-dom':
+ specifier: 18.2.25
+ version: 18.2.25
+ '@vitejs/plugin-react':
+ specifier: ^4.2.1
+ version: 4.3.1(vite@5.4.8(@types/node@20.12.7))
+ autoprefixer:
+ specifier: ^10.4.13
+ version: 10.4.20(postcss@8.4.47)
+ postcss:
+ specifier: ^8.4.21
+ version: 8.4.47
+ tailwindcss:
+ specifier: ^3.4.3
+ version: 3.4.13(ts-node@10.9.2(@swc/core@1.4.16(@swc/helpers@0.5.2))(@types/node@20.12.7)(typescript@5.4.5))
+ typescript:
+ specifier: 5.4.5
+ version: 5.4.5
+ vite:
+ specifier: ^5.2.10
+ version: 5.4.8(@types/node@20.12.7)
+
examples/beta/react-with-tailwindcss-compound:
dependencies:
cva:
@@ -165,6 +258,55 @@ importers:
specifier: ^5.2.10
version: 5.4.8(@types/node@20.12.7)
+ examples/beta/svelte:
+ devDependencies:
+ '@sveltejs/vite-plugin-svelte':
+ specifier: ^3.1.0
+ version: 3.1.2(svelte@4.2.19)(vite@5.4.8(@types/node@20.12.7))
+ '@tsconfig/svelte':
+ specifier: ^5.0.4
+ version: 5.0.4
+ cva:
+ specifier: workspace:*
+ version: link:../../../packages/cva
+ svelte:
+ specifier: ^4.2.15
+ version: 4.2.19
+ svelte-check:
+ specifier: ^3.6.9
+ version: 3.8.6(@babel/core@7.25.2)(postcss-load-config@4.0.2(postcss@8.4.47)(ts-node@10.9.2(@swc/core@1.4.16(@swc/helpers@0.5.2))(@types/node@20.12.7)(typescript@5.4.5)))(postcss@8.4.47)(svelte@4.2.19)
+ tslib:
+ specifier: ^2.6.2
+ version: 2.7.0
+ typescript:
+ specifier: 5.4.5
+ version: 5.4.5
+ vite:
+ specifier: ^5.2.10
+ version: 5.4.8(@types/node@20.12.7)
+
+ examples/beta/vue:
+ dependencies:
+ cva:
+ specifier: workspace:*
+ version: link:../../../packages/cva
+ vue:
+ specifier: ^3.4.23
+ version: 3.5.10(typescript@5.4.5)
+ devDependencies:
+ '@vitejs/plugin-vue':
+ specifier: ^5.0.4
+ version: 5.1.4(vite@5.4.8(@types/node@20.12.7))(vue@3.5.10(typescript@5.4.5))
+ typescript:
+ specifier: 5.4.5
+ version: 5.4.5
+ vite:
+ specifier: ^5.2.10
+ version: 5.4.8(@types/node@20.12.7)
+ vue-tsc:
+ specifier: ^2.0.13
+ version: 2.1.6(typescript@5.4.5)
+
examples/latest/astro-with-tailwindcss:
dependencies:
'@astrojs/check':
From 347319df601092a08519c1f7ff0a75b7d7c8bf9c Mon Sep 17 00:00:00 2001
From: Joe Bell <7349341+joe-bell@users.noreply.github.com>
Date: Wed, 11 Dec 2024 11:55:39 +0200
Subject: [PATCH 19/22] chore: add stackblitz embeds to beta pages
---
docs/beta/astro.config.ts | 36 +++++++++++-
docs/beta/package.json | 1 +
docs/beta/src/components/stackblitz.astro | 25 ++++++++
docs/beta/src/content/docs/examples/11ty.mdx | 43 ++++++++++++++
docs/beta/src/content/docs/examples/astro.mdx | 12 ++++
docs/beta/src/content/docs/examples/bem.mdx | 58 +++++++++++++++++++
.../content/docs/examples/other-use-cases.mdx | 27 +++++++++
.../docs/examples/react/css-modules.mdx | 10 ++++
.../docs/examples/react/tailwindcss.mdx | 19 ++++++
.../beta/src/content/docs/examples/svelte.mdx | 7 +++
docs/beta/src/content/docs/examples/vue.mdx | 7 +++
.../getting-started/compound-components.mdx | 2 +-
pnpm-lock.yaml | 3 +
13 files changed, 247 insertions(+), 3 deletions(-)
create mode 100644 docs/beta/src/components/stackblitz.astro
create mode 100644 docs/beta/src/content/docs/examples/11ty.mdx
create mode 100644 docs/beta/src/content/docs/examples/astro.mdx
create mode 100644 docs/beta/src/content/docs/examples/bem.mdx
create mode 100644 docs/beta/src/content/docs/examples/other-use-cases.mdx
create mode 100644 docs/beta/src/content/docs/examples/react/css-modules.mdx
create mode 100644 docs/beta/src/content/docs/examples/react/tailwindcss.mdx
create mode 100644 docs/beta/src/content/docs/examples/svelte.mdx
create mode 100644 docs/beta/src/content/docs/examples/vue.mdx
diff --git a/docs/beta/astro.config.ts b/docs/beta/astro.config.ts
index 278b2f2d..47550068 100644
--- a/docs/beta/astro.config.ts
+++ b/docs/beta/astro.config.ts
@@ -61,8 +61,40 @@ export default defineConfig({
],
},
{
- label: "Examples ↗",
- link: "https://cva.style/docs/examples/astro",
+ label: "Examples",
+ items: [
+ {
+ label: "11ty",
+ link: "/examples/11ty",
+ },
+ {
+ label: "Astro",
+ link: "/examples/astro",
+ },
+ {
+ label: "BEM",
+ link: "/examples/bem",
+ },
+ {
+ label: "React",
+ items: [
+ { label: "CSS Modules", link: "/examples/react/css-modules" },
+ { label: "Tailwind CSS", link: "/examples/react/tailwindcss" },
+ ],
+ },
+ {
+ label: "Svelte",
+ link: "/examples/svelte",
+ },
+ {
+ label: "Vue",
+ link: "/examples/vue",
+ },
+ {
+ label: "Other Use Cases",
+ link: "/examples/other-use-cases",
+ },
+ ],
},
{
label: "API Reference",
diff --git a/docs/beta/package.json b/docs/beta/package.json
index d88bce35..b4dcdfa8 100644
--- a/docs/beta/package.json
+++ b/docs/beta/package.json
@@ -22,6 +22,7 @@
"date-fns": "3.6.0",
"sharp": "^0.33.2",
"tailwindcss": "^3.4.3",
+ "tiny-invariant": "1.3.1",
"typescript": "5.4.5"
}
}
diff --git a/docs/beta/src/components/stackblitz.astro b/docs/beta/src/components/stackblitz.astro
new file mode 100644
index 00000000..034b5c52
--- /dev/null
+++ b/docs/beta/src/components/stackblitz.astro
@@ -0,0 +1,25 @@
+---
+import invariant from "tiny-invariant";
+
+export interface Props {
+ dir?: string;
+ file?: string;
+}
+
+const branch = "feat/compound";
+
+const { dir, file } = Astro.props;
+
+invariant(dir, "No directory specified");
+invariant(file, "No file specified");
+---
+
+
diff --git a/docs/beta/src/content/docs/examples/11ty.mdx b/docs/beta/src/content/docs/examples/11ty.mdx
new file mode 100644
index 00000000..a91dd73a
--- /dev/null
+++ b/docs/beta/src/content/docs/examples/11ty.mdx
@@ -0,0 +1,43 @@
+---
+title: 11ty
+---
+
+## Tailwind CSS
+
+```js
+// button.11ty.js
+const { cva } = require("class-variance-authority");
+
+// ⚠️ Disclaimer: Use of Tailwind CSS is optional
+const button = cva("button", {
+ variants: {
+ intent: {
+ primary: [
+ "bg-blue-500",
+ "text-white",
+ "border-transparent",
+ "hover:bg-blue-600",
+ ],
+ secondary: [
+ "bg-white",
+ "text-gray-800",
+ "border-gray-400",
+ "hover:bg-gray-100",
+ ],
+ },
+ size: {
+ small: ["text-sm", "py-1", "px-2"],
+ medium: ["text-base", "py-2", "px-4"],
+ },
+ },
+ compoundVariants: [{ intent: "primary", size: "medium", class: "uppercase" }],
+ defaultVariants: {
+ intent: "primary",
+ size: "medium",
+ },
+});
+
+module.exports = function ({ label, intent, size }) {
+ return `${label} `;
+};
+```
diff --git a/docs/beta/src/content/docs/examples/astro.mdx b/docs/beta/src/content/docs/examples/astro.mdx
new file mode 100644
index 00000000..335fdaff
--- /dev/null
+++ b/docs/beta/src/content/docs/examples/astro.mdx
@@ -0,0 +1,12 @@
+---
+title: Astro
+---
+
+import StackBlitz from "../../../components/stackblitz.astro";
+
+## Tailwind CSS
+
+
diff --git a/docs/beta/src/content/docs/examples/bem.mdx b/docs/beta/src/content/docs/examples/bem.mdx
new file mode 100644
index 00000000..f01f7df9
--- /dev/null
+++ b/docs/beta/src/content/docs/examples/bem.mdx
@@ -0,0 +1,58 @@
+---
+title: BEM
+---
+
+```css
+/* styles.css */
+.button {
+ /* */
+}
+
+.button--primary {
+ /* */
+}
+.button--secondary {
+ /* */
+}
+
+.button--small {
+ /* */
+}
+.button--medium {
+ /* */
+}
+
+.button--primary-small {
+ /* */
+}
+```
+
+```ts
+import { cva } from "class-variance-authority";
+
+const button = cva("button", {
+ variants: {
+ intent: {
+ primary: "button--primary",
+ secondary: "button--secondary",
+ },
+ size: {
+ small: "button--small",
+ medium: "button--medium",
+ },
+ },
+ compoundVariants: [
+ { intent: "primary", size: "medium", class: "button--primary-small" },
+ ],
+ defaultVariants: {
+ intent: "primary",
+ size: "medium",
+ },
+});
+
+button();
+// => "button button--primary button--medium"
+
+button({ intent: "secondary", size: "small" });
+// => "button button--secondary button--small"
+```
diff --git a/docs/beta/src/content/docs/examples/other-use-cases.mdx b/docs/beta/src/content/docs/examples/other-use-cases.mdx
new file mode 100644
index 00000000..a8ffee85
--- /dev/null
+++ b/docs/beta/src/content/docs/examples/other-use-cases.mdx
@@ -0,0 +1,27 @@
+---
+title: Other Use Cases
+---
+
+Although primarily designed for handling class names, at its core, `cva` is really just a fancy way of managing a string…
+
+## Dynamic Text Content
+
+```ts
+const greeter = cva("Good morning!", {
+ variants: {
+ isLoggedIn: {
+ true: "Here's a secret only logged in users can see",
+ false: "Log in to find out more…",
+ },
+ },
+ defaultVariants: {
+ isLoggedIn: "false",
+ },
+});
+
+greeter();
+// => "Good morning! Log in to find out more…"
+
+greeter({ isLoggedIn: "true" });
+// => "Good morning! Here's a secret only logged in users can see"
+```
diff --git a/docs/beta/src/content/docs/examples/react/css-modules.mdx b/docs/beta/src/content/docs/examples/react/css-modules.mdx
new file mode 100644
index 00000000..635df8bb
--- /dev/null
+++ b/docs/beta/src/content/docs/examples/react/css-modules.mdx
@@ -0,0 +1,10 @@
+---
+title: React with CSS Modules
+---
+
+import StackBlitz from "../../../../components/stackblitz.astro";
+
+
diff --git a/docs/beta/src/content/docs/examples/react/tailwindcss.mdx b/docs/beta/src/content/docs/examples/react/tailwindcss.mdx
new file mode 100644
index 00000000..0037988e
--- /dev/null
+++ b/docs/beta/src/content/docs/examples/react/tailwindcss.mdx
@@ -0,0 +1,19 @@
+---
+title: React with Tailwind CSS
+---
+
+import StackBlitz from "../../../../components/stackblitz.astro";
+
+## Basic Component
+
+
+
+## Compound Component
+
+
diff --git a/docs/beta/src/content/docs/examples/svelte.mdx b/docs/beta/src/content/docs/examples/svelte.mdx
new file mode 100644
index 00000000..b8ac24cf
--- /dev/null
+++ b/docs/beta/src/content/docs/examples/svelte.mdx
@@ -0,0 +1,7 @@
+---
+title: Svelte
+---
+
+import StackBlitz from "../../../components/stackblitz.astro";
+
+
diff --git a/docs/beta/src/content/docs/examples/vue.mdx b/docs/beta/src/content/docs/examples/vue.mdx
new file mode 100644
index 00000000..549226a2
--- /dev/null
+++ b/docs/beta/src/content/docs/examples/vue.mdx
@@ -0,0 +1,7 @@
+---
+title: Vue
+---
+
+import StackBlitz from "../../../components/stackblitz.astro";
+
+
diff --git a/docs/beta/src/content/docs/getting-started/compound-components.mdx b/docs/beta/src/content/docs/getting-started/compound-components.mdx
index 19ca5366..cb12f1cd 100644
--- a/docs/beta/src/content/docs/getting-started/compound-components.mdx
+++ b/docs/beta/src/content/docs/getting-started/compound-components.mdx
@@ -13,4 +13,4 @@ TODO
## Examples
-- [React with Tailwind CSS](../examples/beta/react-with-tailwind-css-compound/index.html)
+- [React with Tailwind CSS](../examples/react/tailwindcss#compound-component)
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index b32e7b37..a4eb6f66 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -87,6 +87,9 @@ importers:
tailwindcss:
specifier: ^3.4.3
version: 3.4.13(ts-node@10.9.2(@swc/core@1.4.16(@swc/helpers@0.5.2))(@types/node@20.12.7)(typescript@5.4.5))
+ tiny-invariant:
+ specifier: 1.3.1
+ version: 1.3.1
typescript:
specifier: 5.4.5
version: 5.4.5
From 5120367a40a20815e1a6480e2f3cdb335fd44cc0 Mon Sep 17 00:00:00 2001
From: Joe Bell <7349341+joe-bell@users.noreply.github.com>
Date: Wed, 11 Dec 2024 11:56:46 +0200
Subject: [PATCH 20/22] chore: revert manual branch override
---
docs/beta/src/components/stackblitz.astro | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/beta/src/components/stackblitz.astro b/docs/beta/src/components/stackblitz.astro
index 034b5c52..82a51af8 100644
--- a/docs/beta/src/components/stackblitz.astro
+++ b/docs/beta/src/components/stackblitz.astro
@@ -6,7 +6,7 @@ export interface Props {
file?: string;
}
-const branch = "feat/compound";
+const branch = "main";
const { dir, file } = Astro.props;
From 0a3f6bd774c5cae4ddf73b21b13789ba5720f0fa Mon Sep 17 00:00:00 2001
From: Joe Bell <7349341+joe-bell@users.noreply.github.com>
Date: Fri, 13 Dec 2024 11:22:14 +0200
Subject: [PATCH 21/22] docs: compound components
---
.../docs/examples/react/tailwindcss.mdx | 2 +-
.../getting-started/compound-components.mdx | 27 ++++++++++++++-----
2 files changed, 22 insertions(+), 7 deletions(-)
diff --git a/docs/beta/src/content/docs/examples/react/tailwindcss.mdx b/docs/beta/src/content/docs/examples/react/tailwindcss.mdx
index 0037988e..df098450 100644
--- a/docs/beta/src/content/docs/examples/react/tailwindcss.mdx
+++ b/docs/beta/src/content/docs/examples/react/tailwindcss.mdx
@@ -11,7 +11,7 @@ import StackBlitz from "../../../../components/stackblitz.astro";
file="src/components/button/button.tsx"
/>
-## Compound Component
+## Compound Components
+e.g. <Accordion.Subcomponent />
instead of <Accordion />
-TODO
+```tsx
+import * as Accordion from "./Accordion";
-1. Tab with NormalCSS
-2. Tab with TailwindCss
+function Example() {
+ return (
+
+
+ Section 1
+ Content 1
+
+
+ );
+}
+```
+
+
+
+`cva` encourages you to build these compound components **with the power of CSS**; leverage the cascade, custom properties, `:has()` selectors, and more…
## Examples
-- [React with Tailwind CSS](../examples/react/tailwindcss#compound-component)
+- [React with Tailwind CSS (Compound Components)](../examples/react/tailwindcss#compound-components)
From 56ffa2629a717e8405e51690376e2c9d38f5f06b Mon Sep 17 00:00:00 2001
From: Joe Bell <7349341+joe-bell@users.noreply.github.com>
Date: Fri, 13 Dec 2024 11:45:21 +0200
Subject: [PATCH 22/22] chore: tidy up
---
.../docs/getting-started/installation.mdx | 6 +---
.../beta/astro-with-tailwindcss/src/env.d.ts | 1 +
.../src/app.tsx | 4 ++-
.../src/components/nav/nav.tsx | 36 ++++++-------------
4 files changed, 15 insertions(+), 32 deletions(-)
diff --git a/docs/beta/src/content/docs/getting-started/installation.mdx b/docs/beta/src/content/docs/getting-started/installation.mdx
index 068fd668..288e15d6 100644
--- a/docs/beta/src/content/docs/getting-started/installation.mdx
+++ b/docs/beta/src/content/docs/getting-started/installation.mdx
@@ -133,11 +133,7 @@ You can enable autocompletion inside `cva` using the steps below:
### Handling Style Conflicts
-Although `cva`'s API is designed to help you avoid styling conflicts, there's still a small margin of error.
-
-If you're keen to lift that burden altogether, check out the wonderful [`tailwind-merge`](https://github.com/dcastil/tailwind-merge) package.
-
-For bulletproof components, extend `cva` with `twMerge`.
+If you want to merge Tailwind CSS classes without conflicts, you may wish to [roll-your-own `cva`](../api-reference#defineconfig) with the [`tailwind-merge`](https://github.com/dcastil/tailwind-merge) package:
diff --git a/examples/beta/astro-with-tailwindcss/src/env.d.ts b/examples/beta/astro-with-tailwindcss/src/env.d.ts
index f964fe0c..acef35f1 100644
--- a/examples/beta/astro-with-tailwindcss/src/env.d.ts
+++ b/examples/beta/astro-with-tailwindcss/src/env.d.ts
@@ -1 +1,2 @@
+///
///
diff --git a/examples/beta/react-with-tailwindcss-compound/src/app.tsx b/examples/beta/react-with-tailwindcss-compound/src/app.tsx
index 8936cb30..b9c6b16b 100644
--- a/examples/beta/react-with-tailwindcss-compound/src/app.tsx
+++ b/examples/beta/react-with-tailwindcss-compound/src/app.tsx
@@ -48,7 +48,9 @@ function App() {
{density.map((key) => (
- {key}
+
+ {key}
+
))}
diff --git a/examples/beta/react-with-tailwindcss-compound/src/components/nav/nav.tsx b/examples/beta/react-with-tailwindcss-compound/src/components/nav/nav.tsx
index 7f59acd5..bcd0937f 100644
--- a/examples/beta/react-with-tailwindcss-compound/src/components/nav/nav.tsx
+++ b/examples/beta/react-with-tailwindcss-compound/src/components/nav/nav.tsx
@@ -7,11 +7,9 @@ import { cva, type VariantProps } from "cva";
export const root = cva({
base: [
"[--nav-item-py-offset:calc(var(--nav-item-py)*0.5*-1)]",
- "flex",
- "flex-col",
+ "flex flex-col",
"rounded-[--nav-radius]",
- "border",
- "border-zinc-200",
+ "border border-zinc-200",
"shadow-sm",
],
variants: {
@@ -51,11 +49,7 @@ export const Root: React.FC = ({ className, density, ...props }) => (
============================================ */
export const item = cva({
- base: [
- "[&+*]:mt-[--nav-item-py-offset]",
- "[&>*]:first:rounded-t-[--nav-radius]",
- "[&>*]:last:rounded-b-[--nav-radius]",
- ],
+ base: "group/nav-item mt-[--nav-item-py-offset] first:mt-0",
});
export interface ItemProps
@@ -71,23 +65,13 @@ export const Item: React.FC = ({ className, ...props }) => (
export const link = cva({
base: [
- "relative",
- "flex",
- "bg-transparent",
- "font-light",
- "text-sm",
- "text-zinc-800",
- "focus-visible:bg-white",
- "hover:bg-zinc-50",
- "hover:text-zinc-900",
- "hover:z-20",
- "focus-visible:z-30",
- "focus-visible:outline-none",
- "focus-visible:ring",
- "focus-visible:ring-zinc-600",
- "focus-visible:ring-2",
- "px-[--nav-item-px]",
- "py-[--nav-item-py]",
+ "relative flex bg-transparent font-light text-sm text-zinc-800",
+ "px-[--nav-item-px] py-[--nav-item-py]",
+ "hover:bg-zinc-50 hover:text-zinc-900 hover:z-20",
+ "focus-visible:bg-white focus-visible:z-30 focus-visible:outline-none",
+ "focus-visible:ring focus-visible:ring-zinc-600 focus-visible:ring-2",
+ "group-first/nav-item:rounded-t-[--nav-radius]",
+ "group-last/nav-item:rounded-b-[--nav-radius]",
],
});