Skip to content

A full-featured CRM built with React, shadcn/ui, and Supabase.

feat: shadcn admin kit v2

erwanMarmelabe32a1e4d5040
diff --git a/components.json b/components.json
index 13e1db0b..2483eeeb 100644
--- a/components.json
+++ b/components.json
@@ -1,6 +1,6 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
- "style": "new-york",
+ "style": "base-vega",
"rsc": false,
"tsx": true,
"tailwind": {
@@ -17,5 +17,9 @@
"lib": "@/lib",
"hooks": "@/hooks"
},
- "iconLibrary": "lucide"
+ "iconLibrary": "lucide",
+ "rtl": false,
+ "menuColor": "default",
+ "menuAccent": "subtle",
+ "registries": {}
}
diff --git a/doc/src/content/docs/developers/architecture-choices.mdx b/doc/src/content/docs/developers/architecture-choices.mdx
index c9970d16..067e19db 100644
--- a/doc/src/content/docs/developers/architecture-choices.mdx
+++ b/doc/src/content/docs/developers/architecture-choices.mdx
@@ -15,7 +15,7 @@ The frontend is a Single-Page Application built with [Shadcn Admin Kit](https://
- [React Query](https://tanstack.com/query/latest) for data fetching and caching
- [React Hook Form](https://react-hook-form.com/) for form management
- [Shadcn UI](https://ui.shadcn.com/) for beautiful, accessible, and customizable components
-- [Radix UI](https://www.radix-ui.com/) for accessible UI components
+- [Base UI](https://base-ui.com/) for accessible UI components
- [Tailwind CSS](https://tailwindcss.com/) for styling
For the backend, Atomic CRM leverages [Supabase](https://supabase.com/). Supabase provides a PostgreSQL database, a REST API, authentication, storage, and edge functions. In practice, this means that there is very little backend code to maintain (a few edge functions for user management and inbound email processing).
diff --git a/package-lock.json b/package-lock.json
index b037517d..477372b1 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -8,27 +8,10 @@
"name": "atomic-crm",
"version": "0.1.0",
"dependencies": {
+ "@base-ui/react": "^1.8.0",
"@fontsource-variable/inter": "^5.2.8",
"@hello-pangea/dnd": "^18.0.1",
"@nivo/bar": "^0.99.0",
- "@radix-ui/react-accordion": "^1.2.13",
- "@radix-ui/react-avatar": "^1.1.12",
- "@radix-ui/react-checkbox": "^1.3.4",
- "@radix-ui/react-dialog": "^1.1.16",
- "@radix-ui/react-dropdown-menu": "^2.1.17",
- "@radix-ui/react-label": "^2.1.9",
- "@radix-ui/react-navigation-menu": "^1.2.14",
- "@radix-ui/react-popover": "^1.1.16",
- "@radix-ui/react-progress": "^1.1.7",
- "@radix-ui/react-radio-group": "^1.4.0",
- "@radix-ui/react-select": "^2.3.0",
- "@radix-ui/react-separator": "^1.1.9",
- "@radix-ui/react-slot": "^1.2.5",
- "@radix-ui/react-switch": "^1.3.0",
- "@radix-ui/react-tabs": "^1.1.12",
- "@radix-ui/react-toggle": "^1.1.10",
- "@radix-ui/react-toggle-group": "^1.1.11",
- "@radix-ui/react-tooltip": "^1.2.9",
"@streamparser/json-whatwg": "^0.0.22",
"@tailwindcss/vite": "^4.1.18",
"@tanstack/query-async-storage-persister": "^5.90.22",
@@ -53,15 +36,14 @@
"papaparse": "^5.5.3",
"qs": "^6.15.2",
"query-string": "^7.1.3",
- "ra-core": "^5.14.7",
- "ra-data-fakerest": "^5.10.0",
- "ra-i18n-polyglot": "^5.14.7",
- "ra-language-english": "^5.14.7",
- "ra-language-french": "^5.14.2",
+ "ra-core": "^5.15.2",
+ "ra-data-fakerest": "^5.15.2",
+ "ra-i18n-polyglot": "^5.15.2",
+ "ra-language-english": "^5.15.2",
+ "ra-language-french": "^5.15.2",
"ra-supabase-core": "^3.5.2",
"ra-supabase-language-english": "^3.5.0",
"ra-supabase-language-french": "^3.5.0",
- "radix-ui": "^1.5.0",
"react": "^19.1.0",
"react-cropper": "^2.3.3",
"react-dom": "^19.1.0",
@@ -74,7 +56,6 @@
"tailwind-merge": "^3.6.0",
"tailwindcss": "^4.1.11",
"tw-animate-css": "^1.4.0",
- "vaul": "^1.1.2",
"zod": "^4.1.12"
},
"devDependencies": {
@@ -107,7 +88,7 @@
"pgsql-ast-parser": "^12.0.2",
"playwright": "^1.60.0",
"prettier": "^3.6.2",
- "shadcn": "^3.5.0",
+ "shadcn": "^4.0.6",
"storybook": "^9.1.19",
"tldts": "^7.0.26",
"typescript": "~5.8.3",
@@ -140,28 +121,6 @@
"node": ">=6.0.0"
}
},
- "node_modules/@antfu/ni": {
- "version": "25.0.0",
- "resolved": "https://registry.npmjs.org/@antfu/ni/-/ni-25.0.0.tgz",
- "integrity": "sha512-9q/yCljni37pkMr4sPrI3G4jqdIk074+iukc5aFJl7kmDCCsiJrbZ6zKxnES1Gwg+i9RcDZwvktl23puGslmvA==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "ansis": "^4.0.0",
- "fzf": "^0.5.2",
- "package-manager-detector": "^1.3.0",
- "tinyexec": "^1.0.1"
- },
- "bin": {
- "na": "bin/na.mjs",
- "nci": "bin/nci.mjs",
- "ni": "bin/ni.mjs",
- "nlx": "bin/nlx.mjs",
- "nr": "bin/nr.mjs",
- "nun": "bin/nun.mjs",
- "nup": "bin/nup.mjs"
- }
- },
"node_modules/@babel/code-frame": {
"version": "7.29.7",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz",
@@ -1733,10 +1692,9 @@
}
},
"node_modules/@babel/runtime": {
- "version": "7.28.3",
- "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.28.3.tgz",
- "integrity": "sha512-9uIQ10o0WGdpP6GDhXcdOJPJuDgFtIDtN/9+ArJQ2NAfAmiuhTQdzkaTGR33v43GYS2UrSA0eX2pPPHoFVvpxA==",
- "license": "MIT",
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.29.7.tgz",
+ "integrity": "sha512-Nq8OhGWiZIZGV6hLHoyAKLLcJihP/xFeBMGJoUrxTX2psI8dCifzLhZISFb+VWS3wFMRDmCGw5R+dOySCqPLhw==",
"engines": {
"node": ">=6.9.0"
}
@@ -1789,6 +1747,64 @@
"node": ">=6.9.0"
}
},
+ "node_modules/@base-ui/react": {
+ "version": "1.8.0",
+ "resolved": "https://registry.npmjs.org/@base-ui/react/-/react-1.8.0.tgz",
+ "integrity": "sha512-P0/1sxo6SBVZOklKMIedvTWqw2s2IQzi9x5bIVsXu980cuSOD4NeuRSs+/L7LZQfDkZP/uRZyGPyfFl/B1oH+Q==",
+ "dependencies": {
+ "@babel/runtime": "^7.29.7",
+ "@base-ui/utils": "0.4.0",
+ "@floating-ui/react-dom": "^2.1.9",
+ "@floating-ui/utils": "^0.2.12",
+ "use-sync-external-store": "^1.6.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/mui-org"
+ },
+ "peerDependencies": {
+ "@date-fns/tz": "^1.2.0",
+ "@types/react": "^17 || ^18 || ^19",
+ "date-fns": "^4.0.0",
+ "react": "^17 || ^18 || ^19",
+ "react-dom": "^17 || ^18 || ^19"
+ },
+ "peerDependenciesMeta": {
+ "@date-fns/tz": {
+ "optional": true
+ },
+ "@types/react": {
+ "optional": true
+ },
+ "date-fns": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@base-ui/utils": {
+ "version": "0.4.0",
+ "resolved": "https://registry.npmjs.org/@base-ui/utils/-/utils-0.4.0.tgz",
+ "integrity": "sha512-bO9fz25kKtPf+aZVyfQrC0PDmJdmVni31W2hCS5/Owb+inwdIL3XU26pCPRPlt4LSxZrBgLwubXQXQlKaFEZzw==",
+ "dependencies": {
+ "@babel/runtime": "^7.29.7",
+ "@floating-ui/utils": "^0.2.12",
+ "reselect": "^5.2.0",
+ "use-sync-external-store": "^1.6.0"
+ },
+ "peerDependencies": {
+ "@types/react": "^17 || ^18 || ^19",
+ "react": "^17 || ^18 || ^19",
+ "react-dom": "^17 || ^18 || ^19"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
"node_modules/@blazediff/core": {
"version": "1.9.1",
"resolved": "https://registry.npmjs.org/@blazediff/core/-/core-1.9.1.tgz",
@@ -2605,31 +2621,28 @@
}
},
"node_modules/@floating-ui/core": {
- "version": "1.7.5",
- "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.7.5.tgz",
- "integrity": "sha512-1Ih4WTWyw0+lKyFMcBHGbb5U5FtuHJuujoyyr5zTaWS5EYMeT6Jb2AuDeftsCsEuchO+mM2ij5+q9crhydzLhQ==",
- "license": "MIT",
+ "version": "1.8.0",
+ "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.8.0.tgz",
+ "integrity": "sha512-0CIZ5itps/8x7BG8dEIhs53BvCUH2PCoogtakwRTut+Arm58sJooJ0AuZhLw2HJYIR5cMLNPBSS728sPho2khQ==",
"dependencies": {
- "@floating-ui/utils": "^0.2.11"
+ "@floating-ui/utils": "^0.2.12"
}
},
"node_modules/@floating-ui/dom": {
- "version": "1.7.6",
- "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.7.6.tgz",
- "integrity": "sha512-9gZSAI5XM36880PPMm//9dfiEngYoC6Am2izES1FF406YFsjvyBMmeJ2g4SAju3xWwtuynNRFL2s9hgxpLI5SQ==",
- "license": "MIT",
+ "version": "1.8.0",
+ "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.8.0.tgz",
+ "integrity": "sha512-yXSrzeHZBTZadLOlfyhCkJHNeLJnHRnRInwdZ40L7ZiaAtrBwoYlsDrX3v5zB1Utk7CLfzcOVnVVWoXEky7Ceg==",
"dependencies": {
- "@floating-ui/core": "^1.7.5",
- "@floating-ui/utils": "^0.2.11"
+ "@floating-ui/core": "^1.8.0",
+ "@floating-ui/utils": "^0.2.12"
}
},
"node_modules/@floating-ui/react-dom": {
- "version": "2.1.8",
- "resolved": "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-2.1.8.tgz",
- "integrity": "sha512-cC52bHwM/n/CxS87FH0yWdngEZrjdtLW/qVruo68qg+prK7ZQ4YGdut2GyDVpoGeAYe/h899rVeOVm6Oi40k2A==",
- "license": "MIT",
+ "version": "2.1.9",
+ "resolved": "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-2.1.9.tgz",
+ "integrity": "sha512-JDjEFGCpImxDCA7JJKviA0M9+RtmJdj0m/NVU5IMgBK+AmZouAQQ7/+2GLH0GXXY0YMw9oXPB8hKdbPYg5QLYg==",
"dependencies": {
- "@floating-ui/dom": "^1.7.6"
+ "@floating-ui/dom": "^1.8.0"
},
"peerDependencies": {
"react": ">=16.8.0",
@@ -2637,10 +2650,9 @@
}
},
"node_modules/@floating-ui/utils": {
- "version": "0.2.11",
- "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.11.tgz",
- "integrity": "sha512-RiB/yIh78pcIxl6lLMG0CgBXAZ2Y0eVHqMPYugu+9U0AeT6YBeiJpf7lbdJNIugFP5SIjwNRgo4DhR1Qxi26Gg==",
- "license": "MIT"
+ "version": "0.2.12",
+ "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.12.tgz",
+ "integrity": "sha512-HpCo8tmWzLVad5s2d19EhAz5zqrrQ6s69qd6moPMQvkOuSwDT1YgRfWSVuc4ennqrgv3OHppiOGMQ7oC13yIww=="
},
"node_modules/@fontsource-variable/inter": {
"version": "5.2.8",
@@ -2753,6 +2765,8 @@
"integrity": "sha512-S8qNSZiYzFd0wAcyG5AXCvUHC5Sr7xpZ9wZ2py9XR88jUz8wooStVx5M6dRzczbBWjic9NP7+rY0Xi7qqK/aMQ==",
"dev": true,
"license": "MIT",
+ "optional": true,
+ "peer": true,
"engines": {
"node": ">=18"
}
@@ -2862,6 +2876,8 @@
"integrity": "sha512-KR8edRkIsUayMXV+o3Gv+q4jlhENF9nMYUZs9PA2HzrXeHI8M5uDag70U7RJn9yyiMZSbtF5/UexBtAVtZGSbQ==",
"dev": true,
"license": "MIT",
+ "optional": true,
+ "peer": true,
"dependencies": {
"@inquirer/core": "^10.3.2",
"@inquirer/type": "^3.0.10"
@@ -2884,6 +2900,8 @@
"integrity": "sha512-43RTuEbfP8MbKzedNqBrlhhNKVwoK//vUFNW3Q3vZ88BLcrs4kYpGg+B2mm5p2K/HfygoCxuKwJJiv8PbGmE0A==",
"dev": true,
"license": "MIT",
+ "optional": true,
+ "peer": true,
"dependencies": {
"@inquirer/ansi": "^1.0.2",
"@inquirer/figures": "^1.0.15",
@@ -2912,6 +2930,8 @@
"integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==",
"dev": true,
"license": "MIT",
+ "optional": true,
+ "peer": true,
"dependencies": {
"ansi-styles": "^4.0.0",
"string-width": "^4.1.0",
@@ -3144,6 +3164,8 @@
"integrity": "sha512-t2IEY+unGHOzAaVM5Xx6DEWKeXlDDcNPeDyUpsRc6CUhBfU3VQOEl+Vssh7VNp1dR8MdUJBWhuObjXCsVpjN5g==",
"dev": true,
"license": "MIT",
+ "optional": true,
+ "peer": true,
"engines": {
"node": ">=18"
}
@@ -3867,6 +3889,8 @@
"integrity": "sha512-BvziSRxfz5Ov8ch0z/n3oijRSEcEsHnhggm4xFZe93DHcUCTlutlq9Ox4SVENAfcRD22UQq7T/atg9Wr3k09eA==",
"dev": true,
"license": "MIT",
+ "optional": true,
+ "peer": true,
"engines": {
"node": ">=18"
},
@@ -4218,6 +4242,8 @@
"integrity": "sha512-EFd6cVbHsgLa6wa4RljGj6Wk75qoHxUSyc5asLyyPSyuhIcdS2Q3Phw6ImS1q+CkALthJRShiYfKANcQMuMqsQ==",
"dev": true,
"license": "MIT",
+ "optional": true,
+ "peer": true,
"dependencies": {
"@open-draft/deferred-promise": "^2.2.0",
"@open-draft/logger": "^0.3.0",
@@ -4513,7 +4539,9 @@
"resolved": "https://registry.npmjs.org/@open-draft/deferred-promise/-/deferred-promise-2.2.0.tgz",
"integrity": "sha512-CecwLWx3rhxVQF6V4bAgPS5t+So2sTbPgAzafKkVizyi7tlwpcFpdFqq+wqF2OwNBmqFuu6tOyouTuxgpMfzmA==",
"dev": true,
- "license": "MIT"
+ "license": "MIT",
+ "optional": true,
+ "peer": true
},
"node_modules/@open-draft/logger": {
"version": "0.3.0",
@@ -4521,6 +4549,8 @@
"integrity": "sha512-X2g45fzhxH238HKO4xbSr7+wBS8Fvw6ixhTDuvLd5mqh6bJJCFAPwU9mPDxbcrRtfxv4u5IHCEH77BmxvXmmxQ==",
"dev": true,
"license": "MIT",
+ "optional": true,
+ "peer": true,
"dependencies": {
"is-node-process": "^1.2.0",
"outvariant": "^1.4.0"
@@ -4531,7 +4561,9 @@
"resolved": "https://registry.npmjs.org/@open-draft/until/-/until-2.1.0.tgz",
"integrity": "sha512-U69T3ItWHvLwGg5eJ0n3I62nWuE6ilHlmz7zM0npLBRvPRd7e6NYmg54vvRtP5mZG7kZqZCFVdsTWo7BPtBujg==",
"dev": true,
- "license": "MIT"
+ "license": "MIT",
+ "optional": true,
+ "peer": true
},
"node_modules/@pkgjs/parseargs": {
"version": "0.11.0",
@@ -4631,217 +4663,62 @@
"dev": true,
"license": "MIT"
},
- "node_modules/@radix-ui/number": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/@radix-ui/number/-/number-1.1.2.tgz",
- "integrity": "sha512-ceTwaxc4I5IOi97DgCotl3pqiyRGvffcc0oOsE2dQYaJOFIDsDt4VWG6xEbg1QePv9QWausCEIppud/tJ1wNig==",
- "license": "MIT"
- },
"node_modules/@radix-ui/primitive": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/@radix-ui/primitive/-/primitive-1.1.4.tgz",
"integrity": "sha512-7AdCK9PQyiljKoBDbN8OuctCbd/esdwZPQ8RtOE3SsyQtUpiPb+ND75q0jEhC1m1ecBI0MFNeLJvwIh9iKHRcQ==",
"license": "MIT"
},
- "node_modules/@radix-ui/react-accessible-icon": {
- "version": "1.1.9",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-accessible-icon/-/react-accessible-icon-1.1.9.tgz",
- "integrity": "sha512-5W9KzJz/3DeYbGJHbZv8Q6AkxMOKUmALfc+PRg9dWwJZMk6zD37Sz8sZrF7UD6CBkiJvn7dNeRzn5G7XiCMyig==",
+ "node_modules/@radix-ui/react-compose-refs": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.1.3.tgz",
+ "integrity": "sha512-rYOP8OMnuuPMQF1uhPVlGNcCDlkokKqGFE3JcxFViIkAXP7EvFWUliJAstrapypaBLJNHbZL6jGhbVDGTwmVhA==",
"license": "MIT",
- "dependencies": {
- "@radix-ui/react-visually-hidden": "1.2.5"
- },
"peerDependencies": {
"@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
},
"peerDependenciesMeta": {
"@types/react": {
"optional": true
- },
- "@types/react-dom": {
- "optional": true
}
}
},
- "node_modules/@radix-ui/react-accordion": {
- "version": "1.2.13",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-accordion/-/react-accordion-1.2.13.tgz",
- "integrity": "sha512-xITxBB2p5m5tAe7M0F95kb4uAh7jSIKGlExMEm93HlW+XxZHV2eXFbPWLktd4JhRiwcnXNbO7iekcrbZy6ZCvA==",
+ "node_modules/@radix-ui/react-context": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-context/-/react-context-1.1.4.tgz",
+ "integrity": "sha512-QwH4PO5urrbO+FaGd5Aglg+YJgWTyyuZ3g/6mKvsqraLkglDdckw9JafgL5McL5VEJ6EPNduPaT3ZE9BttDAqg==",
"license": "MIT",
- "dependencies": {
- "@radix-ui/primitive": "1.1.4",
- "@radix-ui/react-collapsible": "1.1.13",
- "@radix-ui/react-collection": "1.1.9",
- "@radix-ui/react-compose-refs": "1.1.3",
- "@radix-ui/react-context": "1.1.4",
- "@radix-ui/react-direction": "1.1.2",
- "@radix-ui/react-id": "1.1.2",
- "@radix-ui/react-primitive": "2.1.5",
- "@radix-ui/react-use-controllable-state": "1.2.3"
- },
"peerDependencies": {
"@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
},
"peerDependenciesMeta": {
"@types/react": {
"optional": true
- },
- "@types/react-dom": {
- "optional": true
}
}
},
- "node_modules/@radix-ui/react-alert-dialog": {
+ "node_modules/@radix-ui/react-dialog": {
"version": "1.1.16",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-alert-dialog/-/react-alert-dialog-1.1.16.tgz",
- "integrity": "sha512-vPaIgo0mxYlvcFaM9jB2Uot9TjGXMuAPEvrc6BOLeV+I5U8s1dkIoouYaa6lmSfc5SPMo5x5djOTOTvaigdGMQ==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/primitive": "1.1.4",
- "@radix-ui/react-compose-refs": "1.1.3",
- "@radix-ui/react-context": "1.1.4",
- "@radix-ui/react-dialog": "1.1.16",
- "@radix-ui/react-primitive": "2.1.5",
- "@radix-ui/react-slot": "1.2.5"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-arrow": {
- "version": "1.1.9",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-arrow/-/react-arrow-1.1.9.tgz",
- "integrity": "sha512-yqHW5WQ/cTpU/un7dqqIKNy2iRU8BC0JB78PEzTfCCYvZu1U6W9KwObAniMk9nhSfyotKPQTYaUD/HB0f5muig==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-primitive": "2.1.5"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-aspect-ratio": {
- "version": "1.1.9",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-aspect-ratio/-/react-aspect-ratio-1.1.9.tgz",
- "integrity": "sha512-Xy+Dpxt/5n9rVTdPrNFmf8GwG1NlT1pzCF/z1MgOGZMLZWdWl+km+ZRWGQAPEhbkzSwYEsfYmTca8NhUtVxqnw==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-primitive": "2.1.5"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-avatar": {
- "version": "1.1.12",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-avatar/-/react-avatar-1.1.12.tgz",
- "integrity": "sha512-NQCQyWC7QrDPhjMn8hUqFeU0lUrprIgm1AyMgLbzuQJibNnatdc3SSMo3/UGFu/eUkJUU1cEcKCnyhXTQzq6tA==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-context": "1.1.4",
- "@radix-ui/react-primitive": "2.1.5",
- "@radix-ui/react-use-callback-ref": "1.1.2",
- "@radix-ui/react-use-is-hydrated": "0.1.1",
- "@radix-ui/react-use-layout-effect": "1.1.2"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-checkbox": {
- "version": "1.3.4",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-checkbox/-/react-checkbox-1.3.4.tgz",
- "integrity": "sha512-m3JmIOAX5ZzZ6VPjxEU2dbTOhoHi0nT5riwcDwe8idocsWf4a5DXJLDtZ6LfJwMBx7W+A2b7kp2TgPEKtaiF6A==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/primitive": "1.1.4",
- "@radix-ui/react-compose-refs": "1.1.3",
- "@radix-ui/react-context": "1.1.4",
- "@radix-ui/react-presence": "1.1.6",
- "@radix-ui/react-primitive": "2.1.5",
- "@radix-ui/react-use-controllable-state": "1.2.3",
- "@radix-ui/react-use-previous": "1.1.2",
- "@radix-ui/react-use-size": "1.1.2"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-collapsible": {
- "version": "1.1.13",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-collapsible/-/react-collapsible-1.1.13.tgz",
- "integrity": "sha512-F0s8+p2XNpfc3k02zBfB0jPWbkHVG162+p7BdUMyJ2308QMqZ+oaclX+FAzKFovgL5OqRU+Rvy6f/vbdlJVaqA==",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-dialog/-/react-dialog-1.1.16.tgz",
+ "integrity": "sha512-l9ok83YBclEZhbjgzt76Hw733e6cvRKPNgO6GJ/IETlufXG9p+fRu2wlvpImQvR6xdJ8h7J8J2DBvsPEiEsKMw==",
"license": "MIT",
"dependencies": {
"@radix-ui/primitive": "1.1.4",
"@radix-ui/react-compose-refs": "1.1.3",
"@radix-ui/react-context": "1.1.4",
+ "@radix-ui/react-dismissable-layer": "1.1.12",
+ "@radix-ui/react-focus-guards": "1.1.4",
+ "@radix-ui/react-focus-scope": "1.1.9",
"@radix-ui/react-id": "1.1.2",
+ "@radix-ui/react-portal": "1.1.11",
"@radix-ui/react-presence": "1.1.6",
"@radix-ui/react-primitive": "2.1.5",
+ "@radix-ui/react-slot": "1.2.5",
"@radix-ui/react-use-controllable-state": "1.2.3",
- "@radix-ui/react-use-layout-effect": "1.1.2"
+ "aria-hidden": "^1.2.4",
+ "react-remove-scroll": "^2.7.2"
},
"peerDependencies": {
"@types/react": "*",
@@ -4858,16 +4735,17 @@
}
}
},
- "node_modules/@radix-ui/react-collection": {
- "version": "1.1.9",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-collection/-/react-collection-1.1.9.tgz",
- "integrity": "sha512-zuSVi7ziP7uQRqc+yGxsKJfNkdyHv3ZKDaHe0gzg4dRgws96TPKWIiz84tVHP4GEcEl8bC0mdt17NkcxaJHmaQ==",
+ "node_modules/@radix-ui/react-dismissable-layer": {
+ "version": "1.1.12",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-dismissable-layer/-/react-dismissable-layer-1.1.12.tgz",
+ "integrity": "sha512-MhoruH6xEzsbvOmo4TNgMfmtvRGyDZw4MDSdf4ybMHfezjqwzv6hyd4lsMzBp8K9Sn6sGzCF62x1I7BYUECXOg==",
"license": "MIT",
"dependencies": {
+ "@radix-ui/primitive": "1.1.4",
"@radix-ui/react-compose-refs": "1.1.3",
- "@radix-ui/react-context": "1.1.4",
"@radix-ui/react-primitive": "2.1.5",
- "@radix-ui/react-slot": "1.2.5"
+ "@radix-ui/react-use-callback-ref": "1.1.2",
+ "@radix-ui/react-use-escape-keydown": "1.1.2"
},
"peerDependencies": {
"@types/react": "*",
@@ -4884,10 +4762,10 @@
}
}
},
- "node_modules/@radix-ui/react-compose-refs": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.1.3.tgz",
- "integrity": "sha512-rYOP8OMnuuPMQF1uhPVlGNcCDlkokKqGFE3JcxFViIkAXP7EvFWUliJAstrapypaBLJNHbZL6jGhbVDGTwmVhA==",
+ "node_modules/@radix-ui/react-focus-guards": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-focus-guards/-/react-focus-guards-1.1.4.tgz",
+ "integrity": "sha512-cot/aB/mOm0IYVYTTmQcEEK1M48lZWi8FlYe5nDPQQ8NYZUlXEFgncJ9p2Kzer3RKSrY7cTTpEMLZKNo9QoP5Q==",
"license": "MIT",
"peerDependencies": {
"@types/react": "*",
@@ -4899,885 +4777,15 @@
}
}
},
- "node_modules/@radix-ui/react-context": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-context/-/react-context-1.1.4.tgz",
- "integrity": "sha512-QwH4PO5urrbO+FaGd5Aglg+YJgWTyyuZ3g/6mKvsqraLkglDdckw9JafgL5McL5VEJ6EPNduPaT3ZE9BttDAqg==",
+ "node_modules/@radix-ui/react-focus-scope": {
+ "version": "1.1.9",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-focus-scope/-/react-focus-scope-1.1.9.tgz",
+ "integrity": "sha512-9Se8t+Zry+1rEOL7Y6l/4ANYU/TOtAtf8O2fKdwLltcaMcm6kOqYGbzO4tMFQ0bvzO920pRAoHpFZ4W85S3keQ==",
"license": "MIT",
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-context-menu": {
- "version": "2.3.0",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-context-menu/-/react-context-menu-2.3.0.tgz",
- "integrity": "sha512-d7CouXhAW+CGmFOqmB+IEvd3E9GcaqfgvfjCc3hfulp2pkaUCEVEGa0SN5nNWYA+IvQ6g1Pt+S5dpNn1AoY9hg==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/primitive": "1.1.4",
- "@radix-ui/react-context": "1.1.4",
- "@radix-ui/react-menu": "2.1.17",
- "@radix-ui/react-primitive": "2.1.5",
- "@radix-ui/react-use-controllable-state": "1.2.3"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-dialog": {
- "version": "1.1.16",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-dialog/-/react-dialog-1.1.16.tgz",
- "integrity": "sha512-l9ok83YBclEZhbjgzt76Hw733e6cvRKPNgO6GJ/IETlufXG9p+fRu2wlvpImQvR6xdJ8h7J8J2DBvsPEiEsKMw==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/primitive": "1.1.4",
- "@radix-ui/react-compose-refs": "1.1.3",
- "@radix-ui/react-context": "1.1.4",
- "@radix-ui/react-dismissable-layer": "1.1.12",
- "@radix-ui/react-focus-guards": "1.1.4",
- "@radix-ui/react-focus-scope": "1.1.9",
- "@radix-ui/react-id": "1.1.2",
- "@radix-ui/react-portal": "1.1.11",
- "@radix-ui/react-presence": "1.1.6",
- "@radix-ui/react-primitive": "2.1.5",
- "@radix-ui/react-slot": "1.2.5",
- "@radix-ui/react-use-controllable-state": "1.2.3",
- "aria-hidden": "^1.2.4",
- "react-remove-scroll": "^2.7.2"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-direction": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-direction/-/react-direction-1.1.2.tgz",
- "integrity": "sha512-C3vFhbyi4SW3PmbAi6Awpu4OzJtd0MxGurvSsYtr7p7nM8RNB3VAF3CUmnp2j50knpkrRcB7+ycVXzgLgF6yNA==",
- "license": "MIT",
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-dismissable-layer": {
- "version": "1.1.12",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-dismissable-layer/-/react-dismissable-layer-1.1.12.tgz",
- "integrity": "sha512-MhoruH6xEzsbvOmo4TNgMfmtvRGyDZw4MDSdf4ybMHfezjqwzv6hyd4lsMzBp8K9Sn6sGzCF62x1I7BYUECXOg==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/primitive": "1.1.4",
- "@radix-ui/react-compose-refs": "1.1.3",
- "@radix-ui/react-primitive": "2.1.5",
- "@radix-ui/react-use-callback-ref": "1.1.2",
- "@radix-ui/react-use-escape-keydown": "1.1.2"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-dropdown-menu": {
- "version": "2.1.17",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-dropdown-menu/-/react-dropdown-menu-2.1.17.tgz",
- "integrity": "sha512-S6b3Jm57sY5EdDyOMLkacbB0qMnKhy1RCKZCt795ZkmtUOAvojYIZ5p7dXHIh5Cyr3jCLLI5/g64V3FKLudZmw==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/primitive": "1.1.4",
- "@radix-ui/react-compose-refs": "1.1.3",
- "@radix-ui/react-context": "1.1.4",
- "@radix-ui/react-id": "1.1.2",
- "@radix-ui/react-menu": "2.1.17",
- "@radix-ui/react-primitive": "2.1.5",
- "@radix-ui/react-use-controllable-state": "1.2.3"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-focus-guards": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-focus-guards/-/react-focus-guards-1.1.4.tgz",
- "integrity": "sha512-cot/aB/mOm0IYVYTTmQcEEK1M48lZWi8FlYe5nDPQQ8NYZUlXEFgncJ9p2Kzer3RKSrY7cTTpEMLZKNo9QoP5Q==",
- "license": "MIT",
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-focus-scope": {
- "version": "1.1.9",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-focus-scope/-/react-focus-scope-1.1.9.tgz",
- "integrity": "sha512-9Se8t+Zry+1rEOL7Y6l/4ANYU/TOtAtf8O2fKdwLltcaMcm6kOqYGbzO4tMFQ0bvzO920pRAoHpFZ4W85S3keQ==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-compose-refs": "1.1.3",
- "@radix-ui/react-primitive": "2.1.5",
- "@radix-ui/react-use-callback-ref": "1.1.2"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-form": {
- "version": "0.1.9",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-form/-/react-form-0.1.9.tgz",
- "integrity": "sha512-eTPyThIKDacJ3mJDvYwf/PSmsEYlOyA2Qcb+aGyWwYv+P5w57VPUkMVA2XJ9z0Du2KBY1HoHQzhPV9iYL/r4hg==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/primitive": "1.1.4",
- "@radix-ui/react-compose-refs": "1.1.3",
- "@radix-ui/react-context": "1.1.4",
- "@radix-ui/react-id": "1.1.2",
- "@radix-ui/react-label": "2.1.9",
- "@radix-ui/react-primitive": "2.1.5"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-hover-card": {
- "version": "1.1.16",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-hover-card/-/react-hover-card-1.1.16.tgz",
- "integrity": "sha512-hAileDBtd6CX7nlZOarOnISQ6PP4q0e16BX51ulzdZ+7IzjL0sDTVpFdmSYrIjw6zVNsfQBao5gG6AWr3qwfvA==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/primitive": "1.1.4",
- "@radix-ui/react-compose-refs": "1.1.3",
- "@radix-ui/react-context": "1.1.4",
- "@radix-ui/react-dismissable-layer": "1.1.12",
- "@radix-ui/react-popper": "1.3.0",
- "@radix-ui/react-portal": "1.1.11",
- "@radix-ui/react-presence": "1.1.6",
- "@radix-ui/react-primitive": "2.1.5",
- "@radix-ui/react-use-controllable-state": "1.2.3"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-id": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-id/-/react-id-1.1.2.tgz",
- "integrity": "sha512-orBC88futVpqCmhX1p4cvquNHsELQ+w+vBJnuj3ftETI5bJb0bZn3Tqu3SWN2IOcPycTnMGnhwoermvISt72sA==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-use-layout-effect": "1.1.2"
- },
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-label": {
- "version": "2.1.9",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-label/-/react-label-2.1.9.tgz",
- "integrity": "sha512-rDoTeMbCwRVcnmo7NGT9IlPo1yXmEI+xc1URP3oeewwZEV4mdTp1dYUhYbQdo4D1q2SjKVvv4N1gNY77QAQtjA==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-primitive": "2.1.5"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-menu": {
- "version": "2.1.17",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-menu/-/react-menu-2.1.17.tgz",
- "integrity": "sha512-fmbNnFyf+JYCN0DhhWnEdUTDnZD1mXaPQWivdsPIb8oOSbARfD3LIQJbLCG8a8QLCwoMxiJ7GVPIFcC8Dw8v2Q==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/primitive": "1.1.4",
- "@radix-ui/react-collection": "1.1.9",
- "@radix-ui/react-compose-refs": "1.1.3",
- "@radix-ui/react-context": "1.1.4",
- "@radix-ui/react-direction": "1.1.2",
- "@radix-ui/react-dismissable-layer": "1.1.12",
- "@radix-ui/react-focus-guards": "1.1.4",
- "@radix-ui/react-focus-scope": "1.1.9",
- "@radix-ui/react-id": "1.1.2",
- "@radix-ui/react-popper": "1.3.0",
- "@radix-ui/react-portal": "1.1.11",
- "@radix-ui/react-presence": "1.1.6",
- "@radix-ui/react-primitive": "2.1.5",
- "@radix-ui/react-roving-focus": "1.1.12",
- "@radix-ui/react-slot": "1.2.5",
- "@radix-ui/react-use-callback-ref": "1.1.2",
- "aria-hidden": "^1.2.4",
- "react-remove-scroll": "^2.7.2"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-menubar": {
- "version": "1.1.17",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-menubar/-/react-menubar-1.1.17.tgz",
- "integrity": "sha512-AKtZ4O782yO7qwIyq73WpulYt1IHhQ0htDb6wNcxzxnSDCcSWMVBiU9ycpcA90XzQO4IVIxIErtak6Kg/Vt0rQ==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/primitive": "1.1.4",
- "@radix-ui/react-collection": "1.1.9",
- "@radix-ui/react-compose-refs": "1.1.3",
- "@radix-ui/react-context": "1.1.4",
- "@radix-ui/react-direction": "1.1.2",
- "@radix-ui/react-id": "1.1.2",
- "@radix-ui/react-menu": "2.1.17",
- "@radix-ui/react-primitive": "2.1.5",
- "@radix-ui/react-roving-focus": "1.1.12",
- "@radix-ui/react-use-controllable-state": "1.2.3"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-navigation-menu": {
- "version": "1.2.15",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-navigation-menu/-/react-navigation-menu-1.2.15.tgz",
- "integrity": "sha512-/fS8hKCcRt4DwCGa5QIB3juRXmfYSOk4a2AEe/BDIyy7Hm+eje2Y13oUx5zejl+wFt1owrM7E8NWlbaEl5EGpg==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/primitive": "1.1.4",
- "@radix-ui/react-collection": "1.1.9",
- "@radix-ui/react-compose-refs": "1.1.3",
- "@radix-ui/react-context": "1.1.4",
- "@radix-ui/react-direction": "1.1.2",
- "@radix-ui/react-dismissable-layer": "1.1.12",
- "@radix-ui/react-id": "1.1.2",
- "@radix-ui/react-presence": "1.1.6",
- "@radix-ui/react-primitive": "2.1.5",
- "@radix-ui/react-use-callback-ref": "1.1.2",
- "@radix-ui/react-use-controllable-state": "1.2.3",
- "@radix-ui/react-use-layout-effect": "1.1.2",
- "@radix-ui/react-use-previous": "1.1.2",
- "@radix-ui/react-visually-hidden": "1.2.5"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-one-time-password-field": {
- "version": "0.1.9",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-one-time-password-field/-/react-one-time-password-field-0.1.9.tgz",
- "integrity": "sha512-fvCzA9hm7yN5xxTPJIi4VhSmH5gv+76ILsxguBK3cm3icD5BR4vW7POQmu8Zio0yh91uuouG/Kang40IbMkaSQ==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/number": "1.1.2",
- "@radix-ui/primitive": "1.1.4",
- "@radix-ui/react-collection": "1.1.9",
- "@radix-ui/react-compose-refs": "1.1.3",
- "@radix-ui/react-context": "1.1.4",
- "@radix-ui/react-direction": "1.1.2",
- "@radix-ui/react-primitive": "2.1.5",
- "@radix-ui/react-roving-focus": "1.1.12",
- "@radix-ui/react-use-controllable-state": "1.2.3",
- "@radix-ui/react-use-effect-event": "0.0.3",
- "@radix-ui/react-use-is-hydrated": "0.1.1",
- "@radix-ui/react-use-layout-effect": "1.1.2"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-password-toggle-field": {
- "version": "0.1.4",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-password-toggle-field/-/react-password-toggle-field-0.1.4.tgz",
- "integrity": "sha512-qoDSkObZ9faJlsjlwyBH6ia7kq9vaJ2QwWTowT3nQpzPvUTAKesmWuGJYpd91HIoJqS+5ZPXy5uFPp+HlwdaAg==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/primitive": "1.1.4",
- "@radix-ui/react-compose-refs": "1.1.3",
- "@radix-ui/react-context": "1.1.4",
- "@radix-ui/react-id": "1.1.2",
- "@radix-ui/react-primitive": "2.1.5",
- "@radix-ui/react-use-controllable-state": "1.2.3",
- "@radix-ui/react-use-effect-event": "0.0.3",
- "@radix-ui/react-use-is-hydrated": "0.1.1"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-popover": {
- "version": "1.1.16",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-popover/-/react-popover-1.1.16.tgz",
- "integrity": "sha512-8brVpAU5Uq7Bh0c8EFc4ZTf2JJTYn0o+1L+CUJB3UYIOkTjKGMgoHvduylrahdmNlr3DfH0rFq2DrbNZXgaspw==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/primitive": "1.1.4",
- "@radix-ui/react-compose-refs": "1.1.3",
- "@radix-ui/react-context": "1.1.4",
- "@radix-ui/react-dismissable-layer": "1.1.12",
- "@radix-ui/react-focus-guards": "1.1.4",
- "@radix-ui/react-focus-scope": "1.1.9",
- "@radix-ui/react-id": "1.1.2",
- "@radix-ui/react-popper": "1.3.0",
- "@radix-ui/react-portal": "1.1.11",
- "@radix-ui/react-presence": "1.1.6",
- "@radix-ui/react-primitive": "2.1.5",
- "@radix-ui/react-slot": "1.2.5",
- "@radix-ui/react-use-controllable-state": "1.2.3",
- "aria-hidden": "^1.2.4",
- "react-remove-scroll": "^2.7.2"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-popper": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-popper/-/react-popper-1.3.0.tgz",
- "integrity": "sha512-9PB589e1aWZbrlFUHdz6WiPCL+xLZHQFX7oibqG/6Q0SwOkxDyQX9W/cyPa+sAPPKuC8cpLCpRczE5a/1DiwVQ==",
- "license": "MIT",
- "dependencies": {
- "@floating-ui/react-dom": "^2.0.0",
- "@radix-ui/react-arrow": "1.1.9",
- "@radix-ui/react-compose-refs": "1.1.3",
- "@radix-ui/react-context": "1.1.4",
- "@radix-ui/react-primitive": "2.1.5",
- "@radix-ui/react-use-callback-ref": "1.1.2",
- "@radix-ui/react-use-layout-effect": "1.1.2",
- "@radix-ui/react-use-rect": "1.1.2",
- "@radix-ui/react-use-size": "1.1.2",
- "@radix-ui/rect": "1.1.2"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-portal": {
- "version": "1.1.11",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-portal/-/react-portal-1.1.11.tgz",
- "integrity": "sha512-UEytdjgEh2tJGgD/gZK4FUx6t1rNIlM3U0DENhSrG7I75FGm1DnaDuVUWF1pWAWUwGmn1sCJ1VGHn8LhN1aTOw==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-primitive": "2.1.5",
- "@radix-ui/react-use-layout-effect": "1.1.2"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-presence": {
- "version": "1.1.6",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-presence/-/react-presence-1.1.6.tgz",
- "integrity": "sha512-zdTk4PlUO0E18HnZ3wYbW0KkJJxWCdiNYp6g6X1PtONFhxVkg01vliTJAmwIszU6mHiyBOoW9P0rAugl5/hULQ==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-use-layout-effect": "1.1.2"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-primitive": {
- "version": "2.1.5",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-2.1.5.tgz",
- "integrity": "sha512-zifXeB8Y88qCYx8PLZ5oQb32KwZub+s925mMoZsBBq9KUQqWKkREubTfs6ASjRPPBe7Jt9O8OHH89+95VG+grA==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-slot": "1.2.5"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-progress": {
- "version": "1.1.9",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-progress/-/react-progress-1.1.9.tgz",
- "integrity": "sha512-+EOkvg1Zn1vI1+fRDfRSAiJ7BWfcDAo5ASMmbqrcLZ4s4USk2FGkoHgeb2X+CkUgo2zJMiyObwf1k44CrRWsyw==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-context": "1.1.4",
- "@radix-ui/react-primitive": "2.1.5"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-radio-group": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-radio-group/-/react-radio-group-1.4.0.tgz",
- "integrity": "sha512-eHdV5bLx9sH+tBnbDjkIBdvQEH/c6MEtQYhTbxkaDK9qsIFFLtmJYEQFVdwhnruWotLfQmIuWEL/J+L3utE8rQ==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/primitive": "1.1.4",
- "@radix-ui/react-compose-refs": "1.1.3",
- "@radix-ui/react-context": "1.1.4",
- "@radix-ui/react-direction": "1.1.2",
- "@radix-ui/react-presence": "1.1.6",
- "@radix-ui/react-primitive": "2.1.5",
- "@radix-ui/react-roving-focus": "1.1.12",
- "@radix-ui/react-use-controllable-state": "1.2.3",
- "@radix-ui/react-use-previous": "1.1.2",
- "@radix-ui/react-use-size": "1.1.2"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-roving-focus": {
- "version": "1.1.12",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-roving-focus/-/react-roving-focus-1.1.12.tgz",
- "integrity": "sha512-FvgPt1bRmg8Xt2QpF7NUZW3dE0ZQHGm41dAdgT2J2GJPoIXz+9Em3NobAxf4fupcxhgHu03E5CRiU2MWvObXyg==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/primitive": "1.1.4",
- "@radix-ui/react-collection": "1.1.9",
- "@radix-ui/react-compose-refs": "1.1.3",
- "@radix-ui/react-context": "1.1.4",
- "@radix-ui/react-direction": "1.1.2",
- "@radix-ui/react-id": "1.1.2",
- "@radix-ui/react-primitive": "2.1.5",
- "@radix-ui/react-use-callback-ref": "1.1.2",
- "@radix-ui/react-use-controllable-state": "1.2.3"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-scroll-area": {
- "version": "1.2.11",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-scroll-area/-/react-scroll-area-1.2.11.tgz",
- "integrity": "sha512-DS39ziOgea75U/TrXKU2/oKp0be2jrDHnzFLvahg/0iNAT1Zq16e4Uw0WXwyXvsK+mG3BRyMb7A3NRZMDuEXtQ==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/number": "1.1.2",
- "@radix-ui/primitive": "1.1.4",
- "@radix-ui/react-compose-refs": "1.1.3",
- "@radix-ui/react-context": "1.1.4",
- "@radix-ui/react-direction": "1.1.2",
- "@radix-ui/react-presence": "1.1.6",
- "@radix-ui/react-primitive": "2.1.5",
- "@radix-ui/react-use-callback-ref": "1.1.2",
- "@radix-ui/react-use-layout-effect": "1.1.2"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-select": {
- "version": "2.3.0",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-select/-/react-select-2.3.0.tgz",
- "integrity": "sha512-mENc7WpJvJcW8hlMpzfFcHcEhTvYS5JMBmi9HVC1Q00uhBwML086MHYUV8QQdQv6lcu0Wg8dzd1RB8AFADcG/g==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/number": "1.1.2",
- "@radix-ui/primitive": "1.1.4",
- "@radix-ui/react-collection": "1.1.9",
- "@radix-ui/react-compose-refs": "1.1.3",
- "@radix-ui/react-context": "1.1.4",
- "@radix-ui/react-direction": "1.1.2",
- "@radix-ui/react-dismissable-layer": "1.1.12",
- "@radix-ui/react-focus-guards": "1.1.4",
- "@radix-ui/react-focus-scope": "1.1.9",
- "@radix-ui/react-id": "1.1.2",
- "@radix-ui/react-popper": "1.3.0",
- "@radix-ui/react-portal": "1.1.11",
- "@radix-ui/react-presence": "1.1.6",
- "@radix-ui/react-primitive": "2.1.5",
- "@radix-ui/react-slot": "1.2.5",
- "@radix-ui/react-use-callback-ref": "1.1.2",
- "@radix-ui/react-use-controllable-state": "1.2.3",
- "@radix-ui/react-use-layout-effect": "1.1.2",
- "@radix-ui/react-use-previous": "1.1.2",
- "@radix-ui/react-visually-hidden": "1.2.5",
- "aria-hidden": "^1.2.4",
- "react-remove-scroll": "^2.7.2"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-separator": {
- "version": "1.1.9",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-separator/-/react-separator-1.1.9.tgz",
- "integrity": "sha512-gvgW+JV/Mbjj6darztTetnmElpQEzZrXpJvfj+dOxNAxiyHEAyUvEjjl4zxblvmjmKmi3jfPoy7ZdxzCuUBJSA==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-primitive": "2.1.5"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-slider": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-slider/-/react-slider-1.4.0.tgz",
- "integrity": "sha512-RHcPlLOThRJM51DSIC33ZnpDEBYhyEFroVWkd2P54PGGjkmAt14RboYUU9E1MFst666zFHM0tGtWvMjSOtU1pw==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/number": "1.1.2",
- "@radix-ui/primitive": "1.1.4",
- "@radix-ui/react-collection": "1.1.9",
- "@radix-ui/react-compose-refs": "1.1.3",
- "@radix-ui/react-context": "1.1.4",
- "@radix-ui/react-direction": "1.1.2",
- "@radix-ui/react-primitive": "2.1.5",
- "@radix-ui/react-use-controllable-state": "1.2.3",
- "@radix-ui/react-use-layout-effect": "1.1.2",
- "@radix-ui/react-use-previous": "1.1.2",
- "@radix-ui/react-use-size": "1.1.2"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-slot": {
- "version": "1.2.5",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.2.5.tgz",
- "integrity": "sha512-rCMO3QsIVKv5JTY5CVbo2MvO77SpEqqYc8AvRE7OWqRDOIqAKjsp+DrmnY9uc8NPdxB5E2z47HTYGeE2+NTptg==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-compose-refs": "1.1.3"
- },
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-switch": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-switch/-/react-switch-1.3.0.tgz",
- "integrity": "sha512-GP1EZwhoZO/GGnhM1P5/2Vpm8iN8EnngyU0oezn2l78kN8tj25pyrvjIaT7azBhK615KSt+P2w39y57YV5jVkA==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/primitive": "1.1.4",
- "@radix-ui/react-compose-refs": "1.1.3",
- "@radix-ui/react-context": "1.1.4",
- "@radix-ui/react-primitive": "2.1.5",
- "@radix-ui/react-use-controllable-state": "1.2.3",
- "@radix-ui/react-use-previous": "1.1.2",
- "@radix-ui/react-use-size": "1.1.2"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-tabs": {
- "version": "1.1.14",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-tabs/-/react-tabs-1.1.14.tgz",
- "integrity": "sha512-D5jwp9JNuwDeCw3CYD2Fz+sSHo0droQjC8u75dJHe4aWr5q6yBiXZU+hurXnKudRgEpUkD5TsI6bjHPo5ThUxA==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/primitive": "1.1.4",
- "@radix-ui/react-context": "1.1.4",
- "@radix-ui/react-direction": "1.1.2",
- "@radix-ui/react-id": "1.1.2",
- "@radix-ui/react-presence": "1.1.6",
+ "dependencies": {
+ "@radix-ui/react-compose-refs": "1.1.3",
"@radix-ui/react-primitive": "2.1.5",
- "@radix-ui/react-roving-focus": "1.1.12",
- "@radix-ui/react-use-controllable-state": "1.2.3"
+ "@radix-ui/react-use-callback-ref": "1.1.2"
},
"peerDependencies": {
"@types/react": "*",
@@ -5794,49 +4802,32 @@
}
}
},
- "node_modules/@radix-ui/react-toast": {
- "version": "1.2.16",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-toast/-/react-toast-1.2.16.tgz",
- "integrity": "sha512-WUymDDiN2DpoGudRN1aW4wF5O3BNQjZZO/5nngPoNiEVqjyOzirvZZNO0R6dC1ifucSINVaSv8JX1aq47VGgiA==",
+ "node_modules/@radix-ui/react-id": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-id/-/react-id-1.1.2.tgz",
+ "integrity": "sha512-orBC88futVpqCmhX1p4cvquNHsELQ+w+vBJnuj3ftETI5bJb0bZn3Tqu3SWN2IOcPycTnMGnhwoermvISt72sA==",
"license": "MIT",
"dependencies": {
- "@radix-ui/primitive": "1.1.4",
- "@radix-ui/react-collection": "1.1.9",
- "@radix-ui/react-compose-refs": "1.1.3",
- "@radix-ui/react-context": "1.1.4",
- "@radix-ui/react-dismissable-layer": "1.1.12",
- "@radix-ui/react-portal": "1.1.11",
- "@radix-ui/react-presence": "1.1.6",
- "@radix-ui/react-primitive": "2.1.5",
- "@radix-ui/react-use-callback-ref": "1.1.2",
- "@radix-ui/react-use-controllable-state": "1.2.3",
- "@radix-ui/react-use-layout-effect": "1.1.2",
- "@radix-ui/react-visually-hidden": "1.2.5"
+ "@radix-ui/react-use-layout-effect": "1.1.2"
},
"peerDependencies": {
"@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
},
"peerDependenciesMeta": {
"@types/react": {
"optional": true
- },
- "@types/react-dom": {
- "optional": true
}
}
},
- "node_modules/@radix-ui/react-toggle": {
+ "node_modules/@radix-ui/react-portal": {
"version": "1.1.11",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-toggle/-/react-toggle-1.1.11.tgz",
- "integrity": "sha512-FikrKJemoBGZQ6uRID0HJqSPBP6D7OppdD2OhLl0ZYLlAyPXI7MezoYGmumwNkrAoRm35xXkb4C8JPfJZZzcaw==",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-portal/-/react-portal-1.1.11.tgz",
+ "integrity": "sha512-UEytdjgEh2tJGgD/gZK4FUx6t1rNIlM3U0DENhSrG7I75FGm1DnaDuVUWF1pWAWUwGmn1sCJ1VGHn8LhN1aTOw==",
"license": "MIT",
"dependencies": {
- "@radix-ui/primitive": "1.1.4",
"@radix-ui/react-primitive": "2.1.5",
- "@radix-ui/react-use-controllable-state": "1.2.3"
+ "@radix-ui/react-use-layout-effect": "1.1.2"
},
"peerDependencies": {
"@types/react": "*",
@@ -5853,19 +4844,13 @@
}
}
},
- "node_modules/@radix-ui/react-toggle-group": {
- "version": "1.1.12",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-toggle-group/-/react-toggle-group-1.1.12.tgz",
- "integrity": "sha512-TEgECgJaWGAHJJZGzNNEYTNBdIXqX7LchANycpyP7DkfjmuiSN7ISt1k/ZRGVJgVJonsgP4vwaiKMn5utrcwWQ==",
+ "node_modules/@radix-ui/react-presence": {
+ "version": "1.1.6",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-presence/-/react-presence-1.1.6.tgz",
+ "integrity": "sha512-zdTk4PlUO0E18HnZ3wYbW0KkJJxWCdiNYp6g6X1PtONFhxVkg01vliTJAmwIszU6mHiyBOoW9P0rAugl5/hULQ==",
"license": "MIT",
"dependencies": {
- "@radix-ui/primitive": "1.1.4",
- "@radix-ui/react-context": "1.1.4",
- "@radix-ui/react-direction": "1.1.2",
- "@radix-ui/react-primitive": "2.1.5",
- "@radix-ui/react-roving-focus": "1.1.12",
- "@radix-ui/react-toggle": "1.1.11",
- "@radix-ui/react-use-controllable-state": "1.2.3"
+ "@radix-ui/react-use-layout-effect": "1.1.2"
},
"peerDependencies": {
"@types/react": "*",
@@ -5882,19 +4867,13 @@
}
}
},
- "node_modules/@radix-ui/react-toolbar": {
- "version": "1.1.12",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-toolbar/-/react-toolbar-1.1.12.tgz",
- "integrity": "sha512-4wHtJVdIgqMmEwUvxA0BYg/2JMRbt0L3+8UD8Ml/nhKkfXtiZcM8u/S15gQ5xj9YEd/0qlrm5bE805LsjQ+J8A==",
+ "node_modules/@radix-ui/react-primitive": {
+ "version": "2.1.5",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-2.1.5.tgz",
+ "integrity": "sha512-zifXeB8Y88qCYx8PLZ5oQb32KwZub+s925mMoZsBBq9KUQqWKkREubTfs6ASjRPPBe7Jt9O8OHH89+95VG+grA==",
"license": "MIT",
"dependencies": {
- "@radix-ui/primitive": "1.1.4",
- "@radix-ui/react-context": "1.1.4",
- "@radix-ui/react-direction": "1.1.2",
- "@radix-ui/react-primitive": "2.1.5",
- "@radix-ui/react-roving-focus": "1.1.12",
- "@radix-ui/react-separator": "1.1.9",
- "@radix-ui/react-toggle-group": "1.1.12"
+ "@radix-ui/react-slot": "1.2.5"
},
"peerDependencies": {
"@types/react": "*",
@@ -5911,37 +4890,21 @@
}
}
},
- "node_modules/@radix-ui/react-tooltip": {
- "version": "1.2.9",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-tooltip/-/react-tooltip-1.2.9.tgz",
- "integrity": "sha512-u6F9MmTtBSLkiXNVDrtB/yPCZarM9smNswC24YYLV/M+bth6J3Gs3vlJezEoFwKZvPvxhCpUYdUnOsNG/0XOlA==",
+ "node_modules/@radix-ui/react-slot": {
+ "version": "1.2.5",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.2.5.tgz",
+ "integrity": "sha512-rCMO3QsIVKv5JTY5CVbo2MvO77SpEqqYc8AvRE7OWqRDOIqAKjsp+DrmnY9uc8NPdxB5E2z47HTYGeE2+NTptg==",
"license": "MIT",
"dependencies": {
- "@radix-ui/primitive": "1.1.4",
- "@radix-ui/react-compose-refs": "1.1.3",
- "@radix-ui/react-context": "1.1.4",
- "@radix-ui/react-dismissable-layer": "1.1.12",
- "@radix-ui/react-id": "1.1.2",
- "@radix-ui/react-popper": "1.3.0",
- "@radix-ui/react-portal": "1.1.11",
- "@radix-ui/react-presence": "1.1.6",
- "@radix-ui/react-primitive": "2.1.5",
- "@radix-ui/react-slot": "1.2.5",
- "@radix-ui/react-use-controllable-state": "1.2.3",
- "@radix-ui/react-visually-hidden": "1.2.5"
+ "@radix-ui/react-compose-refs": "1.1.3"
},
"peerDependencies": {
"@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
},
"peerDependenciesMeta": {
"@types/react": {
"optional": true
- },
- "@types/react-dom": {
- "optional": true
}
}
},
@@ -6015,21 +4978,6 @@
}
}
},
- "node_modules/@radix-ui/react-use-is-hydrated": {
- "version": "0.1.1",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-use-is-hydrated/-/react-use-is-hydrated-0.1.1.tgz",
- "integrity": "sha512-qwOiz4Tjo8CNnrOLAYUMXeZwDzXgXpvK4TKQPmWLECM9XoWvA6+0Z2/7Ag3A4ivjS4ovbLJPbskkxioFyBhr8A==",
- "license": "MIT",
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
"node_modules/@radix-ui/react-use-layout-effect": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/@radix-ui/react-use-layout-effect/-/react-use-layout-effect-1.1.2.tgz",
@@ -6045,86 +4993,6 @@
}
}
},
- "node_modules/@radix-ui/react-use-previous": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-use-previous/-/react-use-previous-1.1.2.tgz",
- "integrity": "sha512-IGBQPtRFdhN6MQ8dbegVmBq1LVZluya3F1jWY+puIcQC3MHctRwTDSBWCkL/3ZcnMJLTMJ++Z+ktmvg0F89iCw==",
- "license": "MIT",
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-use-rect": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-use-rect/-/react-use-rect-1.1.2.tgz",
- "integrity": "sha512-d8a+bBY/FxikNPlgJJoaBHZX+zKVbWHYJGTLnLvveQgFSTntkGdEKv3JDtHrMS0DNYpllz2nRsTLGLKYttbpmw==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/rect": "1.1.2"
- },
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-use-size": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-use-size/-/react-use-size-1.1.2.tgz",
- "integrity": "sha512-giWQp+4mxjBPt4KZ0MmyuykFNWfbDxKt4x+fPkRYmgRFJSbCZFzUglvMb/Kjn38tm10YP4ufiQZDx3zna4LU6w==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-use-layout-effect": "1.1.2"
- },
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-visually-hidden": {
- "version": "1.2.5",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-visually-hidden/-/react-visually-hidden-1.2.5.tgz",
- "integrity": "sha512-tPcHNI3FajdDBFpl/Ez1m2WL0ufJqBKyHxMDBvKitopamK36WwBGOMicuMEZKkM5Wce41QxUyv6BsiqfrWBiGg==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-primitive": "2.1.5"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/rect": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/@radix-ui/rect/-/rect-1.1.2.tgz",
- "integrity": "sha512-xnXE7wG13PI+cxieVssYXlQJuYVRhH9NBoxt3KNwzghDIA69GMm7d4wXRouHIYjE+KvS6U/MsMO73NdS2MH9ZA==",
- "license": "MIT"
- },
"node_modules/@raphiniert/ra-data-postgrest": {
"version": "2.5.1",
"resolved": "https://registry.npmjs.org/@raphiniert/ra-data-postgrest/-/ra-data-postgrest-2.5.1.tgz",
@@ -8002,7 +6870,9 @@
"resolved": "https://registry.npmjs.org/@types/statuses/-/statuses-2.0.6.tgz",
"integrity": "sha512-xMAgYwceFhRA2zY+XbEA7mxYbA093wdiW8Vu6gZPGWy9cmOyU9XesH1tNcEWsKFd5Vzrqx5T3D38PWx1FIIXkA==",
"dev": true,
- "license": "MIT"
+ "license": "MIT",
+ "optional": true,
+ "peer": true
},
"node_modules/@types/trusted-types": {
"version": "2.0.7",
@@ -8017,6 +6887,12 @@
"integrity": "sha512-zFDAD+tlpf2r4asuHEj0XH6pY6i0g5NeAHPn+15wk3BV6JA69eERFXC1gyGThDkVa1zCyKr5jox1+2LbV/AMLg==",
"license": "MIT"
},
+ "node_modules/@types/validate-npm-package-name": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/@types/validate-npm-package-name/-/validate-npm-package-name-4.0.2.tgz",
+ "integrity": "sha512-lrpDziQipxCEeK5kWxvljWYhUvOiB2A9izZd9B2AFarYAkqZshb4lPbRs7zKEic6eGtH8V/2qJW+dPp9OtF6bw==",
+ "dev": true
+ },
"node_modules/@types/ws": {
"version": "8.18.1",
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.18.1.tgz",
@@ -8733,16 +7609,6 @@
"acorn": "^6.0.0 || ^7.0.0 || ^8.0.0"
}
},
- "node_modules/agent-base": {
- "version": "7.1.4",
- "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz",
- "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">= 14"
- }
- },
"node_modules/ajv": {
"version": "6.15.0",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.15.0.tgz",
@@ -8842,16 +7708,6 @@
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
}
},
- "node_modules/ansis": {
- "version": "4.2.0",
- "resolved": "https://registry.npmjs.org/ansis/-/ansis-4.2.0.tgz",
- "integrity": "sha512-HqZ5rWlFjGiV0tDm3UxxgNRqsOTniqoKZu0pIAfh7TZQMGuZK+hH0drySty0si0QXj1ieop4+SkSfPZBPPkHig==",
- "dev": true,
- "license": "ISC",
- "engines": {
- "node": ">=14"
- }
- },
"node_modules/argparse": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
@@ -9167,6 +8023,21 @@
"devOptional": true,
"license": "MIT"
},
+ "node_modules/bundle-name": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/bundle-name/-/bundle-name-4.1.0.tgz",
+ "integrity": "sha512-tjwM5exMg6BGRI+kNmTntNsvdZS1X8BFYS6tnJ2hdH0kVxM6/eVZ2xy+FqStSWvYmtfFMDLIxurorHwDKfDz5Q==",
+ "dev": true,
+ "dependencies": {
+ "run-applescript": "^7.0.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
"node_modules/bytes": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
@@ -9459,6 +8330,18 @@
"react-dom": "^18 || ^19 || ^19.0.0-rc"
}
},
+ "node_modules/cn": {
+ "version": "0.2.6",
+ "resolved": "https://registry.npmjs.org/cn/-/cn-0.2.6.tgz",
+ "integrity": "sha512-+i4L0zUGgRcEnhsxueVrP7iBGxBx5iD0WOTYg1MwFEu2ZyCmH5Ov2V1cul2Ht5UchRQQgftCf4be/RxspuW6QQ==",
+ "dev": true,
+ "bin": {
+ "cn": "bin/cn.mjs"
+ },
+ "engines": {
+ "node": ">=20"
+ }
+ },
"node_modules/code-block-writer": {
"version": "13.0.3",
"resolved": "https://registry.npmjs.org/code-block-writer/-/code-block-writer-13.0.3.tgz",
@@ -9674,6 +8557,18 @@
"dev": true,
"license": "MIT"
},
+ "node_modules/cssesc": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz",
+ "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==",
+ "dev": true,
+ "bin": {
+ "cssesc": "bin/cssesc"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
"node_modules/csstype": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz",
@@ -9797,16 +8692,6 @@
"d3-time": "1 - 2"
}
},
- "node_modules/data-uri-to-buffer": {
- "version": "4.0.1",
- "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz",
- "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">= 12"
- }
- },
"node_modules/data-view-buffer": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.2.tgz",
@@ -9862,10 +8747,11 @@
}
},
"node_modules/date-fns": {
- "version": "3.6.0",
- "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-3.6.0.tgz",
- "integrity": "sha512-fRHTG8g/Gif+kSh50gaGEdToemgfj74aRX3swtiouboip5JDLAyDE9F11nHMIcvOaXeOC6D7SpNhi7uFyB7Uww==",
- "license": "MIT",
+ "version": "4.4.0",
+ "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-4.4.0.tgz",
+ "integrity": "sha512-+1UMbeh68lH1SegH83CGWwpb6OHHbpSgr3+s5Eww5M4CAgswBpoWS0AjTOfEJ33HiYKz1hdj/KTFprzXHmq/6w==",
+ "optional": true,
+ "peer": true,
"funding": {
"type": "github",
"url": "https://github.com/sponsors/kossnocorp"
@@ -9940,6 +8826,34 @@
"node": ">=0.10.0"
}
},
+ "node_modules/default-browser": {
+ "version": "5.5.1",
+ "resolved": "https://registry.npmjs.org/default-browser/-/default-browser-5.5.1.tgz",
+ "integrity": "sha512-m1pAzaJgZ/gssEqlOhJkPJp8Xly7QyW6xcrkUa2KKcDeDSEMP7X8xipU3snUcfisTQx0w1AGae+9UtJSfVnXGw==",
+ "dev": true,
+ "dependencies": {
+ "bundle-name": "^4.1.0",
+ "default-browser-id": "^5.0.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/default-browser-id": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/default-browser-id/-/default-browser-id-5.0.1.tgz",
+ "integrity": "sha512-x1VCxdX4t+8wVfd1so/9w+vQ4vx7lKd2Qp5tDRutErwmR85OgmfX7RlLRMWafRMY7hbEiXIbudNrjOAPa/hL8Q==",
+ "dev": true,
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
"node_modules/define-data-property": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz",
@@ -10958,30 +9872,6 @@
"reusify": "^1.0.4"
}
},
- "node_modules/fetch-blob": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz",
- "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==",
- "dev": true,
- "funding": [
- {
- "type": "github",
- "url": "https://github.com/sponsors/jimmywarting"
- },
- {
- "type": "paypal",
- "url": "https://paypal.me/jimmywarting"
- }
- ],
- "license": "MIT",
- "dependencies": {
- "node-domexception": "^1.0.0",
- "web-streams-polyfill": "^3.0.3"
- },
- "engines": {
- "node": "^12.20 || >= 14.13"
- }
- },
"node_modules/figures": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/figures/-/figures-6.1.0.tgz",
@@ -11217,19 +10107,6 @@
"url": "https://github.com/sponsors/isaacs"
}
},
- "node_modules/formdata-polyfill": {
- "version": "4.0.10",
- "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz",
- "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "fetch-blob": "^3.1.2"
- },
- "engines": {
- "node": ">=12.20.0"
- }
- },
"node_modules/forwarded": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
@@ -11326,13 +10203,6 @@
"dev": true,
"license": "MIT"
},
- "node_modules/fzf": {
- "version": "0.5.2",
- "resolved": "https://registry.npmjs.org/fzf/-/fzf-0.5.2.tgz",
- "integrity": "sha512-Tt4kuxLXFKHy8KT40zwsUPUkg1CrsgY25FxA2U/j/0WgEDCk3ddc/zLTCCcbSHX9FcKtLuVaDGtGE/STWC+j3Q==",
- "dev": true,
- "license": "BSD-3-Clause"
- },
"node_modules/generator-function": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/generator-function/-/generator-function-2.0.1.tgz",
@@ -11667,6 +10537,8 @@
"integrity": "sha512-mS1lbMsxgQj6hge1XZ6p7GPhbrtFwUFYi3wRzXAC/FmYnyXMTvvI3td3rjmQ2u8ewXueaSvRPWaEcgVVOT9Jnw==",
"dev": true,
"license": "MIT",
+ "optional": true,
+ "peer": true,
"engines": {
"node": "^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0"
}
@@ -11767,7 +10639,9 @@
"resolved": "https://registry.npmjs.org/headers-polyfill/-/headers-polyfill-4.0.3.tgz",
"integrity": "sha512-IScLbePpkvO846sIwOtOTDjutRMWdXdJmXdMvk6gCBHxFO8d+QKOQedyZSxFTTFYRSmlgSTDtXqqq4pcenBXLQ==",
"dev": true,
- "license": "MIT"
+ "license": "MIT",
+ "optional": true,
+ "peer": true
},
"node_modules/hono": {
"version": "4.12.25",
@@ -11800,20 +10674,6 @@
"url": "https://opencollective.com/express"
}
},
- "node_modules/https-proxy-agent": {
- "version": "7.0.6",
- "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz",
- "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "agent-base": "^7.1.2",
- "debug": "4"
- },
- "engines": {
- "node": ">= 14"
- }
- },
"node_modules/human-signals": {
"version": "8.0.1",
"resolved": "https://registry.npmjs.org/human-signals/-/human-signals-8.0.1.tgz",
@@ -12205,6 +11065,51 @@
"node": ">=0.10.0"
}
},
+ "node_modules/is-in-ssh": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-in-ssh/-/is-in-ssh-1.0.0.tgz",
+ "integrity": "sha512-jYa6Q9rH90kR1vKB6NM7qqd1mge3Fx4Dhw5TVlK1MUBqhEOuCagrEHMevNuCcbECmXZ0ThXkRm+Ymr51HwEPAw==",
+ "dev": true,
+ "engines": {
+ "node": ">=20"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/is-inside-container": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz",
+ "integrity": "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==",
+ "dev": true,
+ "dependencies": {
+ "is-docker": "^3.0.0"
+ },
+ "bin": {
+ "is-inside-container": "cli.js"
+ },
+ "engines": {
+ "node": ">=14.16"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/is-inside-container/node_modules/is-docker": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz",
+ "integrity": "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==",
+ "dev": true,
+ "bin": {
+ "is-docker": "cli.js"
+ },
+ "engines": {
+ "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
"node_modules/is-interactive": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-2.0.0.tgz",
@@ -12256,7 +11161,9 @@
"resolved": "https://registry.npmjs.org/is-node-process/-/is-node-process-1.2.0.tgz",
"integrity": "sha512-Vg4o6/fqPxIjtxgUH5QLJhwZ7gW5diGCVlXpuUfELC62CuxM1iHcRe51f2W1FDy04Ai4KJkagKjx3XaqyfRKXw==",
"dev": true,
- "license": "MIT"
+ "license": "MIT",
+ "optional": true,
+ "peer": true
},
"node_modules/is-number": {
"version": "7.0.0",
@@ -13661,6 +12568,8 @@
"dev": true,
"hasInstallScript": true,
"license": "MIT",
+ "optional": true,
+ "peer": true,
"dependencies": {
"@inquirer/confirm": "^5.0.0",
"@mswjs/interceptors": "^0.40.0",
@@ -13705,6 +12614,8 @@
"integrity": "sha512-WWdIxpyjEn+FhQJQQv9aQAYlHoNVdzIzUySNV1gHUPDSdZJ3yZn7pAAbQcV7B56Mvu881q9FZV+0Vx2xC44VWA==",
"dev": true,
"license": "ISC",
+ "optional": true,
+ "peer": true,
"engines": {
"node": "^18.17.0 || >=20.5.0"
}
@@ -13784,46 +12695,6 @@
"react-dom": "^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc"
}
},
- "node_modules/node-domexception": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz",
- "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==",
- "deprecated": "Use your platform's native DOMException instead",
- "dev": true,
- "funding": [
- {
- "type": "github",
- "url": "https://github.com/sponsors/jimmywarting"
- },
- {
- "type": "github",
- "url": "https://paypal.me/jimmywarting"
- }
- ],
- "license": "MIT",
- "engines": {
- "node": ">=10.5.0"
- }
- },
- "node_modules/node-fetch": {
- "version": "3.3.2",
- "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz",
- "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "data-uri-to-buffer": "^4.0.0",
- "fetch-blob": "^3.1.4",
- "formdata-polyfill": "^4.0.10"
- },
- "engines": {
- "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
- },
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/node-fetch"
- }
- },
"node_modules/node-polyglot": {
"version": "2.6.0",
"resolved": "https://registry.npmjs.org/node-polyglot/-/node-polyglot-2.6.0.tgz",
@@ -14138,7 +13009,9 @@
"resolved": "https://registry.npmjs.org/outvariant/-/outvariant-1.4.3.tgz",
"integrity": "sha512-+Sl2UErvtsoajRDKCE5/dBz4DIvHXQQnAxtQTF04OJxY0+DyZXSo5P5Bb7XYWOh81syohlYL24hbDwxedPUJCA==",
"dev": true,
- "license": "MIT"
+ "license": "MIT",
+ "optional": true,
+ "peer": true
},
"node_modules/own-keys": {
"version": "1.0.1",
@@ -14207,13 +13080,6 @@
"dev": true,
"license": "BlueOak-1.0.0"
},
- "node_modules/package-manager-detector": {
- "version": "1.5.0",
- "resolved": "https://registry.npmjs.org/package-manager-detector/-/package-manager-detector-1.5.0.tgz",
- "integrity": "sha512-uBj69dVlYe/+wxj8JOpr97XfsxH/eumMt6HqjNTmJDf/6NO9s+0uxeOneIz3AsPt2m6y9PqzDzd3ATcU17MNfw==",
- "dev": true,
- "license": "MIT"
- },
"node_modules/papaparse": {
"version": "5.5.3",
"resolved": "https://registry.npmjs.org/papaparse/-/papaparse-5.5.3.tgz",
@@ -14341,7 +13207,9 @@
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.3.0.tgz",
"integrity": "sha512-Yhpw4T9C6hPpgPeA28us07OJeqZ5EzQTkbfwuhsUg0c237RomFoETJgmp2sa3F/41gfLE6G5cqcYwznmeEeOlQ==",
"dev": true,
- "license": "MIT"
+ "license": "MIT",
+ "optional": true,
+ "peer": true
},
"node_modules/path-type": {
"version": "4.0.0",
@@ -14574,6 +13442,31 @@
"node": "^10 || ^12 || >=14"
}
},
+ "node_modules/postcss-selector-parser": {
+ "version": "7.1.6",
+ "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.6.tgz",
+ "integrity": "sha512-7qASPzhKF2l2KLboRZux8CCTRMdGiV08vWmyKzPz22qZ7ZjQBOeY7rNzNoCLSUiftJ7HUq0GERHmxw/t0dCdMw==",
+ "dev": true,
+ "dependencies": {
+ "cssesc": "^3.0.0",
+ "util-deprecate": "^1.0.2"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/powershell-utils": {
+ "version": "0.2.1",
+ "resolved": "https://registry.npmjs.org/powershell-utils/-/powershell-utils-0.2.1.tgz",
+ "integrity": "sha512-C+y9x90UElAddDZmV4qOx9W53B61PO7cIqWz2dQsWlwswuq4mr8NEwytdGKboYbQlGZ3awrkTeNvcZiZNHnQ8A==",
+ "dev": true,
+ "engines": {
+ "node": ">=20"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
"node_modules/prelude-ls": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz",
@@ -14784,10 +13677,9 @@
"license": "MIT"
},
"node_modules/ra-core": {
- "version": "5.14.7",
- "resolved": "https://registry.npmjs.org/ra-core/-/ra-core-5.14.7.tgz",
- "integrity": "sha512-daHOUEY9nEpBEHBzo1l4kDQ+/dqmYYsUKxWJyeFC2Vd7yh4w48MOBvGJ3nGFYgdLVICDuSl/VUr3kwHWkyfubA==",
- "license": "MIT",
+ "version": "5.15.3",
+ "resolved": "https://registry.npmjs.org/ra-core/-/ra-core-5.15.3.tgz",
+ "integrity": "sha512-C1j7HxBb7MqBBy/1f3f0yK6LNYoezpk6IG++Sps6RofFgNH2QBDQT0Rezgpx33XuQKLmHNhpv/5V4EyVB/Edcw==",
"dependencies": {
"date-fns": "^3.6.0",
"eventemitter3": "^5.0.1",
@@ -14807,6 +13699,15 @@
"react-router-dom": "^6.28.1 || ^7.1.1"
}
},
+ "node_modules/ra-core/node_modules/date-fns": {
+ "version": "3.6.0",
+ "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-3.6.0.tgz",
+ "integrity": "sha512-fRHTG8g/Gif+kSh50gaGEdToemgfj74aRX3swtiouboip5JDLAyDE9F11nHMIcvOaXeOC6D7SpNhi7uFyB7Uww==",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/kossnocorp"
+ }
+ },
"node_modules/ra-core/node_modules/react-error-boundary": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/react-error-boundary/-/react-error-boundary-4.1.2.tgz",
@@ -14820,10 +13721,9 @@
}
},
"node_modules/ra-data-fakerest": {
- "version": "5.10.2",
- "resolved": "https://registry.npmjs.org/ra-data-fakerest/-/ra-data-fakerest-5.10.2.tgz",
- "integrity": "sha512-VPzcRjYahLn1K/D4CHHKAkMLu4bdXqL3WtzMI8Zbc6CQ7bd4c6XC2HHOwoVhpLRVQluvLoGyK1Lkw2hH48pYfQ==",
- "license": "MIT",
+ "version": "5.15.3",
+ "resolved": "https://registry.npmjs.org/ra-data-fakerest/-/ra-data-fakerest-5.15.3.tgz",
+ "integrity": "sha512-dsf9yQ54M3z/sf/SLzroVl+CBuS9DyC/vFE7r6CaNR3IU311DKI9VCRJn7Y24hvSTrCkQAsSwp/p5hRW4PArHA==",
"dependencies": {
"fakerest": "^4.0.1"
},
@@ -14832,31 +13732,28 @@
}
},
"node_modules/ra-i18n-polyglot": {
- "version": "5.14.7",
- "resolved": "https://registry.npmjs.org/ra-i18n-polyglot/-/ra-i18n-polyglot-5.14.7.tgz",
- "integrity": "sha512-gZCVOnnch09p5e2vNIPlWtMIMWek+Qpdhg3nucvN1EXRzKRpRE6xUndeXRK/mJ/+d9LGq99sN0UUsqvGCPHtNQ==",
- "license": "MIT",
+ "version": "5.15.3",
+ "resolved": "https://registry.npmjs.org/ra-i18n-polyglot/-/ra-i18n-polyglot-5.15.3.tgz",
+ "integrity": "sha512-AMmqYvGVdhxiebD2Rg0m8bqBkfA4ya+XHLT2fnhxddt32VorhilGA/lOYQ4KOzDlqWHKvDUtXWQTQyMtIfk+3Q==",
"dependencies": {
"node-polyglot": "^2.2.2",
- "ra-core": "^5.14.7"
+ "ra-core": "^5.15.3"
}
},
"node_modules/ra-language-english": {
- "version": "5.14.7",
- "resolved": "https://registry.npmjs.org/ra-language-english/-/ra-language-english-5.14.7.tgz",
- "integrity": "sha512-pW4ZNXFLWzcDtDxpgn6J/ms+8mSeJEyjvO+uGANgGDcHc8NgruhaaDtObgPFDcyM2k6FdIYEITm1x2ZijSpsCw==",
- "license": "MIT",
+ "version": "5.15.3",
+ "resolved": "https://registry.npmjs.org/ra-language-english/-/ra-language-english-5.15.3.tgz",
+ "integrity": "sha512-pvOBaVGt2cr/HZd66a5RWRO2ikDwb/mX8YTA9TQDoeiiPpK7+BRImnvZj1JH0Opkpicua7cOGh8+xPTly1PgqA==",
"dependencies": {
- "ra-core": "^5.14.7"
+ "ra-core": "^5.15.3"
}
},
"node_modules/ra-language-french": {
- "version": "5.14.2",
- "resolved": "https://registry.npmjs.org/ra-language-french/-/ra-language-french-5.14.2.tgz",
- "integrity": "sha512-vuSOmJCM+2NwzGZULpn+PbRxJuXoLRdyfLUWstGGYPWMlpaBDr+GBw0VYtWuashIS32Hxl2QQ/fVvuDD+R7qQg==",
- "license": "MIT",
+ "version": "5.15.3",
+ "resolved": "https://registry.npmjs.org/ra-language-french/-/ra-language-french-5.15.3.tgz",
+ "integrity": "sha512-V86TlBhGz+yqr7T51zMv8OtZFxJnU6AKln6YhlufbINx7zQTrHjOfh5aNH9gM2BQVqC1UAswlZB/Y9zNFsLk5w==",
"dependencies": {
- "ra-core": "^5.14.2"
+ "ra-core": "^5.15.3"
}
},
"node_modules/ra-supabase-core": {
@@ -14885,83 +13782,6 @@
"integrity": "sha512-sSl4Mt3yfKykbIAvBTTd+KRs1d07ANmLJQdYimWs1+ZyhMEtBuTnLy+hNAWFogdB+GCH19X0P224rjMshn86/w==",
"license": "MIT"
},
- "node_modules/radix-ui": {
- "version": "1.5.0",
- "resolved": "https://registry.npmjs.org/radix-ui/-/radix-ui-1.5.0.tgz",
- "integrity": "sha512-Nzh2HNpClgB31FBHRqt2xG8XNUfVfQRpf34hACC5PNrXTd5JdXdqOXwLs3BL+D8CNYiNQiJiT8QGr5Q4vq+00w==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/primitive": "1.1.4",
- "@radix-ui/react-accessible-icon": "1.1.9",
- "@radix-ui/react-accordion": "1.2.13",
- "@radix-ui/react-alert-dialog": "1.1.16",
- "@radix-ui/react-arrow": "1.1.9",
- "@radix-ui/react-aspect-ratio": "1.1.9",
- "@radix-ui/react-avatar": "1.1.12",
- "@radix-ui/react-checkbox": "1.3.4",
- "@radix-ui/react-collapsible": "1.1.13",
- "@radix-ui/react-collection": "1.1.9",
- "@radix-ui/react-compose-refs": "1.1.3",
- "@radix-ui/react-context": "1.1.4",
- "@radix-ui/react-context-menu": "2.3.0",
- "@radix-ui/react-dialog": "1.1.16",
- "@radix-ui/react-direction": "1.1.2",
- "@radix-ui/react-dismissable-layer": "1.1.12",
- "@radix-ui/react-dropdown-menu": "2.1.17",
- "@radix-ui/react-focus-guards": "1.1.4",
- "@radix-ui/react-focus-scope": "1.1.9",
- "@radix-ui/react-form": "0.1.9",
- "@radix-ui/react-hover-card": "1.1.16",
- "@radix-ui/react-label": "2.1.9",
- "@radix-ui/react-menu": "2.1.17",
- "@radix-ui/react-menubar": "1.1.17",
- "@radix-ui/react-navigation-menu": "1.2.15",
- "@radix-ui/react-one-time-password-field": "0.1.9",
- "@radix-ui/react-password-toggle-field": "0.1.4",
- "@radix-ui/react-popover": "1.1.16",
- "@radix-ui/react-popper": "1.3.0",
- "@radix-ui/react-portal": "1.1.11",
- "@radix-ui/react-presence": "1.1.6",
- "@radix-ui/react-primitive": "2.1.5",
- "@radix-ui/react-progress": "1.1.9",
- "@radix-ui/react-radio-group": "1.4.0",
- "@radix-ui/react-roving-focus": "1.1.12",
- "@radix-ui/react-scroll-area": "1.2.11",
- "@radix-ui/react-select": "2.3.0",
- "@radix-ui/react-separator": "1.1.9",
- "@radix-ui/react-slider": "1.4.0",
- "@radix-ui/react-slot": "1.2.5",
- "@radix-ui/react-switch": "1.3.0",
- "@radix-ui/react-tabs": "1.1.14",
- "@radix-ui/react-toast": "1.2.16",
- "@radix-ui/react-toggle": "1.1.11",
- "@radix-ui/react-toggle-group": "1.1.12",
- "@radix-ui/react-toolbar": "1.1.12",
- "@radix-ui/react-tooltip": "1.2.9",
- "@radix-ui/react-use-callback-ref": "1.1.2",
- "@radix-ui/react-use-controllable-state": "1.2.3",
- "@radix-ui/react-use-effect-event": "0.0.3",
- "@radix-ui/react-use-escape-keydown": "1.1.2",
- "@radix-ui/react-use-is-hydrated": "0.1.1",
- "@radix-ui/react-use-layout-effect": "1.1.2",
- "@radix-ui/react-use-size": "1.1.2",
- "@radix-ui/react-visually-hidden": "1.2.5"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
- },
"node_modules/raf-schd": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/raf-schd/-/raf-schd-4.0.3.tgz",
@@ -15450,6 +14270,11 @@
"node": ">=0.10.0"
}
},
+ "node_modules/reselect": {
+ "version": "5.3.0",
+ "resolved": "https://registry.npmjs.org/reselect/-/reselect-5.3.0.tgz",
+ "integrity": "sha512-XGoLeRAVzUTcJ1qkxPQhDJyIZ5d6zzZD9nT7AEZOaaU9UbWclhycElmhO+VD5bFeLuzhPBaOV2oXC8uG35ZSpg=="
+ },
"node_modules/resolve": {
"version": "1.22.11",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.11.tgz",
@@ -15513,7 +14338,9 @@
"resolved": "https://registry.npmjs.org/rettime/-/rettime-0.7.0.tgz",
"integrity": "sha512-LPRKoHnLKd/r3dVxcwO7vhCW+orkOGj9ViueosEBK6ie89CijnfRlhaDhHq/3Hxu4CkWQtxwlBG0mzTQY6uQjw==",
"dev": true,
- "license": "MIT"
+ "license": "MIT",
+ "optional": true,
+ "peer": true
},
"node_modules/reusify": {
"version": "1.1.0",
@@ -15656,6 +14483,18 @@
"url": "https://opencollective.com/express"
}
},
+ "node_modules/run-applescript": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/run-applescript/-/run-applescript-7.1.0.tgz",
+ "integrity": "sha512-DPe5pVFaAsinSaV6QjQ6gdiedWDcRCbUuiQfQa2wmWV7+xC9bGulGI8+TdRmoFkAPaBXk8CrAbnlY2ISniJ47Q==",
+ "dev": true,
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
"node_modules/run-parallel": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz",
@@ -15877,20 +14716,20 @@
"license": "ISC"
},
"node_modules/shadcn": {
- "version": "3.5.0",
- "resolved": "https://registry.npmjs.org/shadcn/-/shadcn-3.5.0.tgz",
- "integrity": "sha512-5f9tn7gHOiI8CqJ8LGrUEmX6dOivGgSbHkMCeOMCzxHZy9cPwyuRXt7ZyjwukO8QH9kGqi6oiKOpfvTXNGBP4g==",
+ "version": "4.21.0",
+ "resolved": "https://registry.npmjs.org/shadcn/-/shadcn-4.21.0.tgz",
+ "integrity": "sha512-UU2mFNusW8C5rvadKdH69vERYZqUlOOlXBcf0MYhYLdTGP6DPti7X4qovCu+RTfCqsAgq/T+YfE0Vnttxh9aiw==",
"dev": true,
- "license": "MIT",
"dependencies": {
- "@antfu/ni": "^25.0.0",
"@babel/core": "^7.28.0",
"@babel/parser": "^7.28.0",
"@babel/plugin-transform-typescript": "^7.28.0",
"@babel/preset-typescript": "^7.27.1",
"@dotenvx/dotenvx": "^1.48.4",
- "@modelcontextprotocol/sdk": "^1.17.2",
+ "@modelcontextprotocol/sdk": "^1.26.0",
+ "@types/validate-npm-package-name": "^4.0.2",
"browserslist": "^4.26.2",
+ "cn": "^0.2.4",
"commander": "^14.0.0",
"cosmiconfig": "^9.0.0",
"dedent": "^1.6.0",
@@ -15900,22 +14739,59 @@
"fast-glob": "^3.3.3",
"fs-extra": "^11.3.1",
"fuzzysort": "^3.1.0",
- "https-proxy-agent": "^7.0.6",
"kleur": "^4.1.5",
- "msw": "^2.10.4",
- "node-fetch": "^3.3.2",
+ "open": "^11.0.0",
"ora": "^8.2.0",
"postcss": "^8.5.6",
+ "postcss-selector-parser": "^7.1.0",
"prompts": "^2.4.2",
"recast": "^0.23.11",
+ "socks": "^2.8.8",
"stringify-object": "^5.0.0",
"ts-morph": "^26.0.0",
"tsconfig-paths": "^4.2.0",
+ "undici": "^7.27.2",
+ "validate-npm-package-name": "^7.0.1",
"zod": "^3.24.1",
"zod-to-json-schema": "^3.24.6"
},
"bin": {
"shadcn": "dist/index.js"
+ },
+ "engines": {
+ "node": ">=20.18.1"
+ }
+ },
+ "node_modules/shadcn/node_modules/define-lazy-prop": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-3.0.0.tgz",
+ "integrity": "sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==",
+ "dev": true,
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/shadcn/node_modules/open": {
+ "version": "11.0.4",
+ "resolved": "https://registry.npmjs.org/open/-/open-11.0.4.tgz",
+ "integrity": "sha512-++Zlftm0kVLPmzC06t6epuWmcRMDbI4z5P3NNX979WA/k23+NtSOynEGzsVfZwguKw2mi5umVgnBlJQMwRz4Pg==",
+ "dev": true,
+ "dependencies": {
+ "default-browser": "^5.5.1",
+ "define-lazy-prop": "^3.0.0",
+ "is-in-ssh": "^1.0.0",
+ "is-inside-container": "^1.0.0",
+ "powershell-utils": "^0.2.1",
+ "wsl-utils": "^1.0.0"
+ },
+ "engines": {
+ "node": ">=20"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/shadcn/node_modules/zod": {
@@ -16121,6 +14997,16 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
+ "node_modules/smart-buffer": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz",
+ "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==",
+ "dev": true,
+ "engines": {
+ "node": ">= 6.0.0",
+ "npm": ">= 3.0.0"
+ }
+ },
"node_modules/smob": {
"version": "1.6.2",
"resolved": "https://registry.npmjs.org/smob/-/smob-1.6.2.tgz",
@@ -16131,6 +15017,20 @@
"node": ">=20.0.0"
}
},
+ "node_modules/socks": {
+ "version": "2.8.10",
+ "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.10.tgz",
+ "integrity": "sha512-e0VyvkVTwVYViNovRkZ9aodhxVlyoMn7eJhVUPxZ+eK9P/7CBkxvvsBOHqFPEH416726W8tLXXXjKwqgTErrCQ==",
+ "dev": true,
+ "dependencies": {
+ "ip-address": "^10.1.1",
+ "smart-buffer": "^4.2.0"
+ },
+ "engines": {
+ "node": ">= 10.0.0",
+ "npm": ">= 3.0.0"
+ }
+ },
"node_modules/sonner": {
"version": "2.0.7",
"resolved": "https://registry.npmjs.org/sonner/-/sonner-2.0.7.tgz",
@@ -16285,7 +15185,9 @@
"resolved": "https://registry.npmjs.org/strict-event-emitter/-/strict-event-emitter-0.5.1.tgz",
"integrity": "sha512-vMgjE/GGEPEFnhFub6pa4FmJBRBVOLpIII2hvCZ8Kzb7K0hlHo7mQv6xYrBvCL2LtAIBwFUK8wvuJgTVSQ5MFQ==",
"dev": true,
- "license": "MIT"
+ "license": "MIT",
+ "optional": true,
+ "peer": true
},
"node_modules/strict-uri-encode": {
"version": "2.0.0",
@@ -16833,6 +15735,8 @@
"integrity": "sha512-kXuRi1mtaKMrsLUxz3sQYvVl37B0Ns6MzfrtV5DvJceE9bPyspOqk9xxv7XbZWcfLWbFmm997vl83qUWVJA64w==",
"dev": true,
"license": "BSD-3-Clause",
+ "optional": true,
+ "peer": true,
"dependencies": {
"tldts": "^7.0.5"
},
@@ -16956,6 +15860,8 @@
"integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==",
"dev": true,
"license": "(MIT OR CC0-1.0)",
+ "optional": true,
+ "peer": true,
"engines": {
"node": ">=16"
},
@@ -17113,6 +16019,15 @@
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/undici": {
+ "version": "7.29.1",
+ "resolved": "https://registry.npmjs.org/undici/-/undici-7.29.1.tgz",
+ "integrity": "sha512-RYONW2MeafgYlkVOKYKkA/Ag7BmXqgIWCa8t1m0JcxrQg9pI9lEqRhAOruOBCbAohOa/gkCF+iPi9hrgvTzu6Q==",
+ "dev": true,
+ "engines": {
+ "node": ">=20.18.1"
+ }
+ },
"node_modules/undici-types": {
"version": "6.21.0",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz",
@@ -17229,6 +16144,8 @@
"integrity": "sha512-IiSk4HlzAMqTUseHHe3VhIGyuFmN90zMTpD3Z3y8jeQbzLIq500MVM7Jq2vUAnTKAFPJrqwkzr6PoTcPhGcOiw==",
"dev": true,
"license": "MIT",
+ "optional": true,
+ "peer": true,
"funding": {
"url": "https://github.com/sponsors/kettanaito"
}
@@ -17341,14 +16258,28 @@
}
},
"node_modules/use-sync-external-store": {
- "version": "1.5.0",
- "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.5.0.tgz",
- "integrity": "sha512-Rb46I4cGGVBmjamjphe8L/UnvJD+uPPtTkNvX5mZgqdbavhI4EbgIWJiIHXJ8bc/i9EQGPRh4DwEURJ552Do0A==",
- "license": "MIT",
+ "version": "1.7.0",
+ "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.7.0.tgz",
+ "integrity": "sha512-6L+EeigHMQhdaIPNIFUKwfWJSwWFQ8gJbJ2DLOs5sDIegTwR9fRxvnM3uciHKjIZhFz+KAv2emhWMRvDmMcY8A==",
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
}
},
+ "node_modules/util-deprecate": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
+ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==",
+ "dev": true
+ },
+ "node_modules/validate-npm-package-name": {
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-7.0.2.tgz",
+ "integrity": "sha512-hVDIBwsRruT73PbK7uP5ebUt+ezEtCmzZz3F59BSr2F6OVFnJ/6h8liuvdLrQ88Xmnk6/+xGGuq+pG9WwTuy3A==",
+ "dev": true,
+ "engines": {
+ "node": "^20.17.0 || >=22.9.0"
+ }
+ },
"node_modules/vary": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
@@ -17359,19 +16290,6 @@
"node": ">= 0.8"
}
},
- "node_modules/vaul": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/vaul/-/vaul-1.1.2.tgz",
- "integrity": "sha512-ZFkClGpWyI2WUQjdLJ/BaGuV6AVQiJ3uELGk3OYtP+B6yCO7Cmn9vPFXVJkRaGkOJu3m8bQMgtyzNHixULceQA==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-dialog": "^1.1.1"
- },
- "peerDependencies": {
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0.0 || ^19.0.0-rc"
- }
- },
"node_modules/vite": {
"version": "7.3.2",
"resolved": "https://registry.npmjs.org/vite/-/vite-7.3.2.tgz",
@@ -18211,16 +17129,6 @@
"loose-envify": "^1.0.0"
}
},
- "node_modules/web-streams-polyfill": {
- "version": "3.3.3",
- "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz",
- "integrity": "sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">= 8"
- }
- },
"node_modules/webidl-conversions": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz",
@@ -18770,6 +17678,49 @@
}
}
},
+ "node_modules/wsl-utils": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/wsl-utils/-/wsl-utils-1.0.0.tgz",
+ "integrity": "sha512-Hl0ZOAs672vg+06kfujwRhoS6/jehvULrlFkuF2dRu6pHgA8U06h3xqNIqNNU1LTXPcedxByAR4GS6pwQK0mgA==",
+ "dev": true,
+ "dependencies": {
+ "is-wsl": "^3.1.0",
+ "powershell-utils": "^0.1.0"
+ },
+ "engines": {
+ "node": ">=20"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/wsl-utils/node_modules/is-wsl": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-3.1.1.tgz",
+ "integrity": "sha512-e6rvdUCiQCAuumZslxRJWR/Doq4VpPR82kqclvcS0efgt430SlGIk05vdCN58+VrzgtIcfNODjozVielycD4Sw==",
+ "dev": true,
+ "dependencies": {
+ "is-inside-container": "^1.0.0"
+ },
+ "engines": {
+ "node": ">=16"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/wsl-utils/node_modules/powershell-utils": {
+ "version": "0.1.0",
+ "resolved": "https://registry.npmjs.org/powershell-utils/-/powershell-utils-0.1.0.tgz",
+ "integrity": "sha512-dM0jVuXJPsDN6DvRpea484tCUaMiXWjuCn++HGTqUWzGDjv5tZkEZldAJ/UMlqRYGFrD/etByo4/xOuC/snX2A==",
+ "dev": true,
+ "engines": {
+ "node": ">=20"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
"node_modules/y18n": {
"version": "5.0.8",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",
@@ -18861,6 +17812,8 @@
"integrity": "sha512-U/PBtDf35ff0D8X8D0jfdzHYEPFxAI7jJlxZXwCSez5M3190m+QobIfh+sWDWSHMCWWJN2AWamkegn6vr6YBTw==",
"dev": true,
"license": "MIT",
+ "optional": true,
+ "peer": true,
"engines": {
"node": ">=18"
},
diff --git a/package.json b/package.json
index 968e342d..d8c17b77 100644
--- a/package.json
+++ b/package.json
@@ -27,27 +27,10 @@
"update-changelog": "gh api 'repos/{owner}/{repo}/releases' --paginate -q '.[] | \"## \\(.tag_name) - \\(.published_at[:10])\\n\\n\\(.body)\\n\"' > CHANGELOG.md"
},
"dependencies": {
+ "@base-ui/react": "^1.8.0",
"@fontsource-variable/inter": "^5.2.8",
"@hello-pangea/dnd": "^18.0.1",
"@nivo/bar": "^0.99.0",
- "@radix-ui/react-accordion": "^1.2.13",
- "@radix-ui/react-avatar": "^1.1.12",
- "@radix-ui/react-checkbox": "^1.3.4",
- "@radix-ui/react-dialog": "^1.1.16",
- "@radix-ui/react-dropdown-menu": "^2.1.17",
- "@radix-ui/react-label": "^2.1.9",
- "@radix-ui/react-navigation-menu": "^1.2.14",
- "@radix-ui/react-popover": "^1.1.16",
- "@radix-ui/react-progress": "^1.1.7",
- "@radix-ui/react-radio-group": "^1.4.0",
- "@radix-ui/react-select": "^2.3.0",
- "@radix-ui/react-separator": "^1.1.9",
- "@radix-ui/react-slot": "^1.2.5",
- "@radix-ui/react-switch": "^1.3.0",
- "@radix-ui/react-tabs": "^1.1.12",
- "@radix-ui/react-toggle": "^1.1.10",
- "@radix-ui/react-toggle-group": "^1.1.11",
- "@radix-ui/react-tooltip": "^1.2.9",
"@streamparser/json-whatwg": "^0.0.22",
"@tailwindcss/vite": "^4.1.18",
"@tanstack/query-async-storage-persister": "^5.90.22",
@@ -72,15 +55,14 @@
"papaparse": "^5.5.3",
"qs": "^6.15.2",
"query-string": "^7.1.3",
- "ra-core": "^5.14.7",
- "ra-data-fakerest": "^5.10.0",
- "ra-i18n-polyglot": "^5.14.7",
- "ra-language-english": "^5.14.7",
- "ra-language-french": "^5.14.2",
+ "ra-core": "^5.15.2",
+ "ra-data-fakerest": "^5.15.2",
+ "ra-i18n-polyglot": "^5.15.2",
+ "ra-language-english": "^5.15.2",
+ "ra-language-french": "^5.15.2",
"ra-supabase-core": "^3.5.2",
"ra-supabase-language-english": "^3.5.0",
"ra-supabase-language-french": "^3.5.0",
- "radix-ui": "^1.5.0",
"react": "^19.1.0",
"react-cropper": "^2.3.3",
"react-dom": "^19.1.0",
@@ -93,7 +75,6 @@
"tailwind-merge": "^3.6.0",
"tailwindcss": "^4.1.11",
"tw-animate-css": "^1.4.0",
- "vaul": "^1.1.2",
"zod": "^4.1.12"
},
"devDependencies": {
@@ -126,7 +107,7 @@
"pgsql-ast-parser": "^12.0.2",
"playwright": "^1.60.0",
"prettier": "^3.6.2",
- "shadcn": "^3.5.0",
+ "shadcn": "^4.0.6",
"storybook": "^9.1.19",
"tldts": "^7.0.26",
"typescript": "~5.8.3",
diff --git a/src/components/admin/Readme.md b/src/components/admin/Readme.md
index c3832909..7c212530 100644
--- a/src/components/admin/Readme.md
+++ b/src/components/admin/Readme.md
@@ -20,7 +20,7 @@ The components in this directory come from [Shadcn Admin Kit](https://marmelab.c
- notifications,
- and more.
-These components are built on top of [TanStack Query](https://tanstack.com/query/latest), [React Hook Form](https://react-hook-form.com/), [React Router](https://reactrouter.com/), [ra-core](https://marmelab.com/ra-core/), [Radix UI](https://www.radix-ui.com/) and [Shadcn UI](https://ui.shadcn.com/).
+These components are built on top of [TanStack Query](https://tanstack.com/query/latest), [React Hook Form](https://react-hook-form.com/), [React Router](https://reactrouter.com/), [ra-core](https://marmelab.com/ra-core/), [Base UI](https://base-ui.com/) and [Shadcn UI](https://ui.shadcn.com/).
## Documentation
diff --git a/src/components/admin/admin.tsx b/src/components/admin/admin.tsx
index a5814545..b60fdcc5 100644
--- a/src/components/admin/admin.tsx
+++ b/src/components/admin/admin.tsx
@@ -1,11 +1,9 @@
-import {
- CoreAdminUI,
- type CoreAdminUIProps,
- CoreAdminContext,
- type CoreAdminContextProps,
- type CoreAdminProps,
- localStorageStore,
+import type {
+ CoreAdminUIProps,
+ CoreAdminContextProps,
+ CoreAdminProps,
} from "ra-core";
+import { CoreAdminUI, CoreAdminContext, localStorageStore } from "ra-core";
import { i18nProvider as defaultI18nProvider } from "@/lib/i18nProvider";
import { Layout } from "@/components/admin/layout";
import { LoginPage } from "@/components/admin/login-page";
@@ -119,6 +117,7 @@ export const Admin = (props: CoreAdminProps) => {
queryClient,
ready = Ready,
requireAuth,
+ routerProvider,
store = defaultStore,
title = "Shadcn Admin",
} = props;
@@ -129,6 +128,7 @@ export const Admin = (props: CoreAdminProps) => {
dataProvider={dataProvider}
i18nProvider={i18nProvider}
queryClient={queryClient}
+ routerProvider={routerProvider}
store={store}
>
<AdminUI
diff --git a/src/components/admin/app-sidebar.tsx b/src/components/admin/app-sidebar.tsx
index 4f3ad119..7d1622c9 100644
--- a/src/components/admin/app-sidebar.tsx
+++ b/src/components/admin/app-sidebar.tsx
@@ -6,8 +6,9 @@ import {
useHasDashboard,
useResourceDefinitions,
useTranslate,
+ LinkBase,
+ useMatch,
} from "ra-core";
-import { Link, useMatch } from "react-router";
import {
Sidebar,
SidebarContent,
@@ -50,13 +51,11 @@ export function AppSidebar() {
<SidebarMenu>
<SidebarMenuItem>
<SidebarMenuButton
- asChild
+ render={<LinkBase to="/" />}
className="data-[slot=sidebar-menu-button]:!p-1.5"
>
- <Link to="/">
- <Shell className="!size-5" />
- <span className="text-base font-semibold">Acme Inc.</span>
- </Link>
+ <Shell className="!size-5" />
+ <span className="text-base font-semibold">Acme Inc.</span>
</SidebarMenuButton>
</SidebarMenuItem>
</SidebarMenu>
@@ -103,11 +102,12 @@ export const DashboardMenuItem = ({ onClick }: { onClick?: () => void }) => {
const match = useMatch({ path: "/", end: true });
return (
<SidebarMenuItem>
- <SidebarMenuButton asChild isActive={!!match}>
- <Link to="/" onClick={onClick}>
- <House />
- {label}
- </Link>
+ <SidebarMenuButton
+ render={<LinkBase to="/" onClick={onClick} />}
+ isActive={!!match}
+ >
+ <House />
+ {label}
</SidebarMenuButton>
</SidebarMenuItem>
);
@@ -151,15 +151,14 @@ export const ResourceMenuItem = ({
return (
<SidebarMenuItem>
- <SidebarMenuButton asChild isActive={!!match}>
- <Link to={to} state={{ _scrollToTop: true }} onClick={onClick}>
- {resources[name].icon ? (
- createElement(resources[name].icon)
- ) : (
- <List />
- )}
- {getResourceLabel(name, 2)}
- </Link>
+ <SidebarMenuButton
+ render={
+ <LinkBase to={to} state={{ _scrollToTop: true }} onClick={onClick} />
+ }
+ isActive={!!match}
+ >
+ {resources[name].icon ? createElement(resources[name].icon) : <List />}
+ {getResourceLabel(name, 2)}
</SidebarMenuButton>
</SidebarMenuItem>
);
diff --git a/src/components/admin/array-input.tsx b/src/components/admin/array-input.tsx
index 7e76ed50..dca37aae 100644
--- a/src/components/admin/array-input.tsx
+++ b/src/components/admin/array-input.tsx
@@ -85,7 +85,7 @@ export const ArrayInput = (props: ArrayInputProps) => {
name={finalSource}
{...sanitizeInputRestProps(rest)}
>
- <Label className="text-sm" id={labelId}>
+ <Label className="text-muted-foreground text-sm" id={labelId}>
<FieldTitle
label={label}
source={arraySource}
diff --git a/src/components/admin/authentication.tsx b/src/components/admin/authentication.tsx
index da94d48c..b7ca0ab1 100644
--- a/src/components/admin/authentication.tsx
+++ b/src/components/admin/authentication.tsx
@@ -1,5 +1,9 @@
-import { Link } from "react-router";
-import { Translate, useHandleAuthCallback, useTranslate } from "ra-core";
+import {
+ LinkBase,
+ Translate,
+ useHandleAuthCallback,
+ useTranslate,
+} from "ra-core";
import { CircleAlert, LockIcon } from "lucide-react";
import { cn } from "@/lib/utils";
import { Button } from "@/components/ui/button";
@@ -76,10 +80,8 @@ export const AuthError = (props: AuthErrorProps) => {
<Translate i18nKey={title} />
</h1>
<p className="my-5">{translate(message, { _: message })}</p>
- <Button asChild>
- <Link to="/login">
- <LockIcon /> {translate("ra.auth.sign_in", { _: "Sign in" })}
- </Link>
+ <Button render={<LinkBase to="/login" />} nativeButton={false}>
+ <LockIcon /> {translate("ra.auth.sign_in", { _: "Sign in" })}
</Button>
</div>
);
diff --git a/src/components/admin/autocomplete-array-input.tsx b/src/components/admin/autocomplete-array-input.tsx
index d86fe789..02c815be 100644
--- a/src/components/admin/autocomplete-array-input.tsx
+++ b/src/components/admin/autocomplete-array-input.tsx
@@ -15,7 +15,11 @@ import {
FormLabel,
} from "@/components/admin/form";
import { Command as CommandPrimitive } from "cmdk";
-import type { ChoicesProps, InputProps } from "ra-core";
+import type {
+ ChoicesProps,
+ InputProps,
+ SupportCreateSuggestionOptions,
+} from "ra-core";
import {
useChoices,
useChoicesContext,
@@ -24,6 +28,7 @@ import {
useTranslate,
FieldTitle,
useEvent,
+ useSupportCreateSuggestion,
} from "ra-core";
import { InputHelperText } from "./input-helper-text";
import { useCallback } from "react";
@@ -32,7 +37,7 @@ import { useCallback } from "react";
* Form control that lets users choose multiple values from a list using a dropdown with autocompletion.
*
* This input allows editing array values with a searchable dropdown interface and displays selected items as removable badges.
- * Works seamlessly inside ReferenceArrayInput for editing many-to-many relationships.
+ * Works seamlessly inside ReferenceArrayInput for creating and editing many-to-many relationships.
*
* @see {@link https://marmelab.com/shadcn-admin-kit/docs/autocompletearrayinput/ AutocompleteArrayInput documentation}
*
@@ -64,6 +69,7 @@ import { useCallback } from "react";
*/
export const AutocompleteArrayInput = (
props: Omit<InputProps, "source"> &
+ Omit<SupportCreateSuggestionOptions, "handleChange" | "filter"> &
Partial<Pick<InputProps, "source">> &
ChoicesProps & {
className?: string;
@@ -76,7 +82,17 @@ export const AutocompleteArrayInput = (
| ((option: any | undefined) => React.ReactNode);
},
) => {
- const { filterToQuery = DefaultFilterToQuery, inputText } = props;
+ const {
+ filterToQuery = DefaultFilterToQuery,
+ inputText,
+ create,
+ createValue,
+ createLabel,
+ createHintValue,
+ createItemLabel,
+ onCreate,
+ optionText,
+ } = props;
const {
allChoices = [],
source,
@@ -96,6 +112,8 @@ export const AutocompleteArrayInput = (
optionValue: props.optionValue ?? "id",
disableValue: props.disableValue,
translateChoice: props.translateChoice ?? !isFromReference,
+ createValue,
+ createHintValue,
});
const inputRef = React.useRef<HTMLInputElement>(null);
@@ -144,122 +162,163 @@ export const AutocompleteArrayInput = (
[inputText, getChoiceText],
);
+ const handleChange = useEvent((choice: any) => {
+ setFilterValue("");
+ if (isFromReference) {
+ setFilters(filterToQuery(""));
+ }
+ const value = getChoiceValue(choice);
+ // a newly created choice may already be selected
+ if (field.value.includes(value)) {
+ return;
+ }
+ field.onChange([...field.value, value]);
+ });
+
+ const {
+ getCreateItem,
+ handleChange: handleChangeWithCreateSupport,
+ createElement,
+ getOptionDisabled,
+ } = useSupportCreateSuggestion({
+ create,
+ createLabel,
+ createValue,
+ createHintValue,
+ createItemLabel,
+ onCreate,
+ handleChange,
+ optionText,
+ filter: filterValue,
+ });
+
+ const createItem =
+ (create || onCreate) && (filterValue !== "" || createLabel)
+ ? getCreateItem(filterValue)
+ : null;
+ const finalChoices = createItem
+ ? [...availableChoices, createItem]
+ : availableChoices;
+
return (
- <FormField className={props.className} id={id} name={field.name}>
- {props.label !== false && (
- <FormLabel>
- <FieldTitle
- label={props.label}
- source={props.source ?? source}
- resource={resource}
- isRequired={isRequired}
- />
- </FormLabel>
- )}
- <FormControl>
- <Command
- onKeyDown={handleKeyDown}
- shouldFilter={!isFromReference}
- className="overflow-visible bg-transparent"
- >
- <div className="group rounded-md bg-transparent dark:bg-input/30 border border-input px-3 py-1.75 text-sm transition-all ring-offset-background focus-within:border-ring focus-within:ring-ring/50 focus-within:ring-[3px]">
- <div className="flex flex-wrap gap-1">
- {selectedChoices.map((choice) => (
- <Badge key={getChoiceValue(choice)} variant="outline">
- {getInputText(choice)}
- <button
- className="ml-1 rounded-full outline-none ring-offset-background focus:ring-2 focus:ring-ring focus:ring-offset-2"
- onKeyDown={(e) => {
- if (e.key === "Enter") {
+ <>
+ <FormField className={props.className} id={id} name={field.name}>
+ {props.label !== false && (
+ <FormLabel>
+ <FieldTitle
+ label={props.label}
+ source={props.source ?? source}
+ resource={resource}
+ isRequired={isRequired}
+ />
+ </FormLabel>
+ )}
+ <FormControl>
+ <Command
+ onKeyDown={handleKeyDown}
+ shouldFilter={!isFromReference}
+ className="overflow-visible bg-transparent"
+ >
+ <div className="group rounded-md bg-transparent dark:bg-input/30 border border-input px-3 py-1.75 text-sm transition-all ring-offset-background focus-within:border-ring focus-within:ring-ring/50 focus-within:ring-[3px]">
+ <div className="flex flex-wrap gap-1">
+ {selectedChoices.map((choice) => (
+ <Badge key={getChoiceValue(choice)} variant="outline">
+ {getInputText(choice)}
+ <button
+ className="ml-1 rounded-full outline-none ring-offset-background focus:ring-2 focus:ring-ring focus:ring-offset-2"
+ onKeyDown={(e) => {
+ if (e.key === "Enter") {
+ handleUnselect(choice);
+ }
+ }}
+ onMouseDown={(e) => {
+ e.preventDefault();
+ e.stopPropagation();
+ }}
+ onClick={(e) => {
+ e.preventDefault();
handleUnselect(choice);
- }
- }}
- onMouseDown={(e) => {
- e.preventDefault();
- e.stopPropagation();
- }}
- onClick={(e) => {
- e.preventDefault();
- handleUnselect(choice);
- }}
- >
- <span className="sr-only">
- {translate("ra.action.remove", {
- _: "Remove",
- })}
- </span>
- <X className="h-3 w-3" />
- </button>
- </Badge>
- ))}
- {/* Avoid having the "Search" Icon by not using CommandInput */}
- <CommandPrimitive.Input
- ref={inputRef}
- value={filterValue}
- onValueChange={(filter) => {
- setFilterValue(filter);
- requestAnimationFrame(() => {
- listRef.current?.scrollTo(0, 0);
- });
- // We don't want the ChoicesContext to filter the choices if the input
- // is not from a reference as it would also filter out the selected values
- if (isFromReference) {
- setFilters(filterToQuery(filter), undefined, true);
- }
- }}
- onBlur={() => setOpen(false)}
- onFocus={() => setOpen(true)}
- placeholder={placeholder}
- className="ml-2 flex-1 bg-transparent outline-none placeholder:text-muted-foreground"
- />
+ }}
+ >
+ <span className="sr-only">
+ {translate("ra.action.remove", {
+ _: "Remove",
+ })}
+ </span>
+ <X className="h-3 w-3" />
+ </button>
+ </Badge>
+ ))}
+ {/* Avoid having the "Search" Icon by not using CommandInput */}
+ <CommandPrimitive.Input
+ ref={inputRef}
+ value={filterValue}
+ onValueChange={(filter) => {
+ setFilterValue(filter);
+ requestAnimationFrame(() => {
+ listRef.current?.scrollTo(0, 0);
+ });
+ // We don't want the ChoicesContext to filter the choices if the input
+ // is not from a reference as it would also filter out the selected values
+ if (isFromReference) {
+ setFilters(filterToQuery(filter), undefined, true);
+ }
+ }}
+ onBlur={() => setOpen(false)}
+ onFocus={() => setOpen(true)}
+ placeholder={placeholder}
+ className="ml-2 flex-1 bg-transparent outline-none placeholder:text-muted-foreground"
+ />
+ </div>
</div>
- </div>
- <div className="relative">
- <CommandList ref={listRef}>
- {open && availableChoices.length > 0 ? (
- <div className="absolute top-2 z-10 w-full rounded-md border bg-popover text-popover-foreground shadow-md outline-none animate-in">
- <CommandGroup className="h-full overflow-auto">
- {availableChoices.map((choice) => {
- const choiceText = getChoiceText(choice);
- return (
- <CommandItem
- key={getChoiceValue(choice)}
- value={getChoiceValue(choice)}
- keywords={
- React.isValidElement(choiceText)
- ? undefined
- : [choiceText]
- }
- onMouseDown={(e) => {
- e.preventDefault();
- e.stopPropagation();
- }}
- onSelect={() => {
- setFilterValue("");
- if (isFromReference) {
- setFilters(filterToQuery(""));
+ <div className="relative">
+ <CommandList ref={listRef}>
+ {open && finalChoices.length > 0 ? (
+ <div className="absolute top-2 z-10 w-full rounded-md border bg-popover text-popover-foreground shadow-md outline-none animate-in">
+ <CommandGroup className="h-full overflow-auto">
+ {finalChoices.map((choice) => {
+ const isCreateItem =
+ !!createItem && choice?.id === createItem.id;
+ const choiceText = getChoiceText(choice);
+ return (
+ <CommandItem
+ key={getChoiceValue(choice)}
+ value={
+ isCreateItem
+ ? `?${filterValue}?`
+ : getChoiceValue(choice)
+ }
+ keywords={
+ isCreateItem || React.isValidElement(choiceText)
+ ? undefined
+ : [choiceText]
}
- field.onChange([
- ...field.value,
- getChoiceValue(choice),
- ]);
- }}
- className="cursor-pointer"
- >
- {choiceText}
- </CommandItem>
- );
- })}
- </CommandGroup>
- </div>
- ) : null}
- </CommandList>
- </div>
- </Command>
- </FormControl>
- <InputHelperText helperText={props.helperText} />
- <FormError />
- </FormField>
+ disabled={getOptionDisabled(choice)}
+ onMouseDown={(e) => {
+ e.preventDefault();
+ e.stopPropagation();
+ }}
+ onSelect={() =>
+ handleChangeWithCreateSupport(choice)
+ }
+ className="cursor-pointer"
+ >
+ {choiceText}
+ </CommandItem>
+ );
+ })}
+ </CommandGroup>
+ </div>
+ ) : null}
+ </CommandList>
+ </div>
+ </Command>
+ </FormControl>
+ <InputHelperText helperText={props.helperText} />
+ <FormError />
+ </FormField>
+ {createElement}
+ </>
);
};
diff --git a/src/components/admin/autocomplete-input.tsx b/src/components/admin/autocomplete-input.tsx
index 0a7652ce..281f106b 100644
--- a/src/components/admin/autocomplete-input.tsx
+++ b/src/components/admin/autocomplete-input.tsx
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import * as React from "react";
-import { useCallback } from "react";
+import { useCallback, useId } from "react";
import { Check, ChevronsUpDown, X } from "lucide-react";
import { cn } from "@/lib/utils";
import { Button } from "@/components/ui/button";
@@ -23,6 +23,7 @@ import {
PopoverContent,
PopoverTrigger,
} from "@/components/ui/popover";
+import type { Popover as PopoverPrimitive } from "@base-ui/react/popover";
import type {
ChoicesProps,
InputProps,
@@ -39,7 +40,6 @@ import {
useSupportCreateSuggestion,
} from "ra-core";
import { InputHelperText } from "./input-helper-text";
-import { PopoverProps } from "@radix-ui/react-popover";
/**
* Form control that lets users choose a value from a list using a dropdown with autocompletion.
@@ -89,7 +89,7 @@ export const AutocompleteInput = (
inputText?:
| React.ReactNode
| ((option: any | undefined) => React.ReactNode);
- } & Pick<PopoverProps, "modal">,
+ } & Pick<PopoverPrimitive.Root.Props, "modal">,
) => {
const {
clearable = false,
@@ -112,7 +112,7 @@ export const AutocompleteInput = (
setFilters,
} = useChoicesContext(props);
const { id, field, isRequired } = useInput({ ...props, source });
- const uniqueId = React.useId();
+ const uniqueId = useId();
const translate = useTranslate();
const { placeholder = translate("ra.action.search", { _: "Search..." }) } =
props;
@@ -222,25 +222,29 @@ export const AutocompleteInput = (
<FormControl>
<Popover open={open} onOpenChange={handleOpenChange} modal={modal}>
<div className="relative">
- <PopoverTrigger asChild>
- <Button
- variant="outline"
- role="combobox"
- aria-expanded={open}
- aria-label={accessibleName}
- aria-labelledby={hasLabel ? uniqueId : undefined}
- className={cn(
- "w-full justify-between h-auto py-1.75 font-normal",
- isClearable && "pr-9",
- )}
- >
+ <PopoverTrigger
+ render={
+ <Button
+ variant="outline"
+ role="combobox"
+ aria-expanded={open}
+ aria-label={accessibleName}
+ aria-labelledby={hasLabel ? uniqueId : undefined}
+ className={cn(
+ "w-full justify-between h-auto py-1.75 font-normal",
+ isClearable && "pr-9",
+ )}
+ />
+ }
+ >
+ <div className="min-w-0 flex flex-1 items-center gap-2 overflow-hidden text-left">
{selectedChoice ? (
getInputText(selectedChoice)
) : (
<span className="text-muted-foreground">{placeholder}</span>
)}
- <ChevronsUpDown className="ml-2 h-4 w-4 shrink-0 opacity-50" />
- </Button>
+ </div>
+ <ChevronsUpDown className="ml-2 h-4 w-4 shrink-0 opacity-50" />
</PopoverTrigger>
{isClearable && (
<button
@@ -253,7 +257,7 @@ export const AutocompleteInput = (
</button>
)}
</div>
- <PopoverContent className="w-full max-w-(--radix-popover-trigger-width) p-0">
+ <PopoverContent className="w-full max-w-(--anchor-width) p-0">
{/* We handle the filtering ourselves */}
<Command shouldFilter={!isFromReference}>
<CommandInput
diff --git a/src/components/admin/badge-field.tsx b/src/components/admin/badge-field.tsx
index 39aaab30..032137a1 100644
--- a/src/components/admin/badge-field.tsx
+++ b/src/components/admin/badge-field.tsx
@@ -2,7 +2,7 @@ import * as React from "react";
import type { RaRecord } from "ra-core";
import { useFieldValue, useTranslate } from "ra-core";
import { Badge } from "@/components/ui/badge";
-import type { FieldProps } from "@/lib/field.type";
+import type { FieldProps } from "@/lib/field.type.ts";
type BadgeProps = React.ComponentProps<typeof Badge>;
diff --git a/src/components/admin/boolean-field.tsx b/src/components/admin/boolean-field.tsx
index 15cb1f54..60c7819c 100644
--- a/src/components/admin/boolean-field.tsx
+++ b/src/components/admin/boolean-field.tsx
@@ -1,7 +1,9 @@
-import { Check, type LucideIcon, X } from "lucide-react";
-import { RaRecord, useFieldValue, useTranslate } from "ra-core";
+import type { LucideIcon } from "lucide-react";
+import { Check, X } from "lucide-react";
+import type { RaRecord } from "ra-core";
+import { useFieldValue, useTranslate } from "ra-core";
-import type { FieldProps } from "@/lib/field.type";
+import type { FieldProps } from "@/lib/field.type.ts";
import { cn } from "@/lib/utils";
import {
Tooltip,
@@ -45,22 +47,22 @@ export const BooleanField = <RecordType extends RaRecord = any>({
const baseClassName = "size-5 text-foreground";
if (looseValue || typeof value === "boolean") {
+ const icon = isTruthyValue ? (
+ TrueIcon ? (
+ <TrueIcon className={cn(baseClassName, className)} />
+ ) : (
+ <div />
+ )
+ ) : FalseIcon ? (
+ <FalseIcon className={cn(baseClassName, className)} />
+ ) : (
+ <div />
+ );
+
return (
<TooltipProvider>
<Tooltip>
- <TooltipTrigger asChild>
- {isTruthyValue ? (
- TrueIcon ? (
- <TrueIcon className={cn(baseClassName, className)} />
- ) : (
- <div />
- )
- ) : FalseIcon ? (
- <FalseIcon className={cn(baseClassName, className)} />
- ) : (
- <div />
- )}
- </TooltipTrigger>
+ <TooltipTrigger render={icon} />
<TooltipContent>
<RenderLabel
value={!!value}
diff --git a/src/components/admin/boolean-input.tsx b/src/components/admin/boolean-input.tsx
index 76e16478..e4ec3171 100644
--- a/src/components/admin/boolean-input.tsx
+++ b/src/components/admin/boolean-input.tsx
@@ -108,7 +108,7 @@ export interface BooleanInputProps {
label?: React.ReactNode;
onBlur?: (event: React.FocusEvent<HTMLButtonElement>) => void;
onChange?: (value: any) => void;
- onFocus?: (event: React.FocusEvent<HTMLButtonElement>) => void;
+ onFocus?: React.ComponentProps<typeof Switch>["onFocus"];
readOnly?: boolean;
disabled?: boolean;
parse?: (value: any) => any;
diff --git a/src/components/admin/breadcrumb.tsx b/src/components/admin/breadcrumb.tsx
index be4e5e38..26ab1d9e 100644
--- a/src/components/admin/breadcrumb.tsx
+++ b/src/components/admin/breadcrumb.tsx
@@ -9,7 +9,7 @@ import {
BreadcrumbList,
BreadcrumbSeparator,
} from "@/components/ui/breadcrumb";
-import { Button } from "@/components/ui/button";
+import { buttonVariants } from "@/components/ui/button";
import {
Drawer,
DrawerClose,
@@ -22,6 +22,7 @@ import {
} from "@/components/ui/drawer";
import { useIsMobile } from "@/hooks/use-mobile";
import { Translate } from "ra-core";
+import { cn } from "@/lib/utils";
/**
* A breadcrumb navigation component with mobile drawer support.
@@ -37,17 +38,16 @@ import { Translate } from "ra-core";
*
* @example
* import { Edit, Breadcrumb, SimpleForm } from "@/components/admin";
- * import { RecordRepresentation } from 'ra-core';
- * import { Link } from "react-router";
+ * import { LinkBase, RecordRepresentation } from 'ra-core';
*
* const PostEdit = () => (
* <Edit disableBreadcrumb>
* <Breadcrumb>
- * <Breadcrumb.Item><Link to="/">Home</Link></Breadcrumb.Item>
- * <Breadcrumb.Item><Link to="/posts">Articles</Link></Breadcrumb.Item>
+ * <Breadcrumb.Item><LinkBase to="/">Home</LinkBase></Breadcrumb.Item>
+ * <Breadcrumb.Item><LinkBase to="/posts">Articles</LinkBase></Breadcrumb.Item>
* <Breadcrumb.PageItem>
* Edit Article "<RecordRepresentation />"
- * </Breadcrumb.Item>
+ * </Breadcrumb.PageItem>
* </Breadcrumb>
* <SimpleForm>
* ...
@@ -63,7 +63,6 @@ export const Breadcrumb = ({ children, ref }: BreadcrumbProps) => {
return createPortal(
<>
<Separator
- decorative
orientation="vertical"
className="data-[orientation=vertical]:h-4 mr-4"
/>
@@ -95,10 +94,10 @@ export const Breadcrumb = ({ children, ref }: BreadcrumbProps) => {
.map((item) => item)}
</ol>
<DrawerFooter className="pt-4">
- <DrawerClose asChild>
- <Button variant="outline">
- <Translate i18nKey="ra.action.close">Close</Translate>
- </Button>
+ <DrawerClose
+ className={cn(buttonVariants({ variant: "outline" }))}
+ >
+ <Translate i18nKey="ra.action.close">Close</Translate>
</DrawerClose>
</DrawerFooter>
</DrawerContent>
diff --git a/src/components/admin/bulk-export-button.tsx b/src/components/admin/bulk-export-button.tsx
index a42604b8..ca6ad3dd 100644
--- a/src/components/admin/bulk-export-button.tsx
+++ b/src/components/admin/bulk-export-button.tsx
@@ -54,7 +54,11 @@ export const BulkExportButton = <T extends RaRecord>({
userText: labelProp,
});
- const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {
+ const handleClick = (
+ event: Parameters<
+ NonNullable<React.ComponentProps<typeof Button>["onClick"]>
+ >[0],
+ ) => {
bulkExport();
onClick?.(event);
};
diff --git a/src/components/admin/cancel-button.tsx b/src/components/admin/cancel-button.tsx
index 22ea21e6..faa6e97c 100644
--- a/src/components/admin/cancel-button.tsx
+++ b/src/components/admin/cancel-button.tsx
@@ -1,6 +1,5 @@
import { CircleX } from "lucide-react";
-import { Translate } from "ra-core";
-import { useNavigate } from "react-router";
+import { Translate, useNavigate } from "ra-core";
import { Button } from "../ui/button";
diff --git a/src/components/admin/columns-button.tsx b/src/components/admin/columns-button.tsx
index 197554df..9dd5f29e 100644
--- a/src/components/admin/columns-button.tsx
+++ b/src/components/admin/columns-button.tsx
@@ -1,14 +1,16 @@
-import {
- useState,
- useEffect,
- Children,
- type ComponentProps,
- type ReactNode,
-} from "react";
+import type { ComponentProps, ReactNode } from "react";
+import { useState, useEffect, Children } from "react";
import { createPortal } from "react-dom";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
import * as diacritic from "diacritic";
+import type {
+ RaRecord,
+ Identifier,
+ SortPayload,
+ HintedString,
+ ExtractRecordPaths,
+} from "ra-core";
import {
useDataTableStoreContext,
useStore,
@@ -19,14 +21,8 @@ import {
useTranslateLabel,
DataTableColumnRankContext,
DataTableColumnFilterContext,
- type RaRecord,
- type Identifier,
- type SortPayload,
- type HintedString,
- type ExtractRecordPaths,
} from "ra-core";
import { Columns, Search } from "lucide-react";
-import * as PopoverPrimitive from "@radix-ui/react-popover";
import { useIsMobile } from "@/hooks/use-mobile";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
@@ -34,9 +30,14 @@ import { FieldToggle } from "@/components/admin/field-toggle";
import {
Tooltip,
TooltipContent,
+ TooltipProvider,
TooltipTrigger,
} from "@/components/ui/tooltip";
-import { Popover, PopoverTrigger } from "@/components/ui/popover";
+import {
+ Popover,
+ PopoverContent,
+ PopoverTrigger,
+} from "@/components/ui/popover";
import { cn } from "@/lib/utils";
/**
@@ -78,40 +79,43 @@ export const ColumnsButton = (props: ColumnsButtonProps) => {
return (
<span className={cn("inline-flex", className)}>
<Popover open={open} onOpenChange={setOpen}>
- <PopoverTrigger asChild>
- {isMobile ? (
+ {isMobile ? (
+ // Base UI defaults tooltips to a 600ms open delay; the provider keeps
+ // them instant without app-level setup.
+ <TooltipProvider delay={0}>
<Tooltip>
- <TooltipTrigger asChild>
- <Button
- variant="ghost"
- size="icon"
- aria-label={title}
- {...rest}
- >
- <Columns className="size-4" />
- </Button>
- </TooltipTrigger>
+ <PopoverTrigger
+ render={
+ <TooltipTrigger
+ render={
+ <Button
+ variant="ghost"
+ size="icon"
+ aria-label={title}
+ {...rest}
+ />
+ }
+ />
+ }
+ >
+ <Columns className="size-4" />
+ </PopoverTrigger>
<TooltipContent>{title}</TooltipContent>
</Tooltip>
- ) : (
- <Button variant="outline" className="cursor-pointer" {...rest}>
- <Columns />
- {title}
- </Button>
- )}
- </PopoverTrigger>
- <PopoverPrimitive.Portal forceMount>
- <div className={open ? "block" : "hidden"}>
- <PopoverPrimitive.Content
- data-slot="popover-content"
- sideOffset={4}
- align="start"
- className="bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border shadow-md outline-hidden p-0 min-w-[200px]"
- >
- <div id={`${storeKey}-columnsSelector`} className="p-2" />
- </PopoverPrimitive.Content>
- </div>
- </PopoverPrimitive.Portal>
+ </TooltipProvider>
+ ) : (
+ <PopoverTrigger
+ render={
+ <Button variant="outline" className="cursor-pointer" {...rest} />
+ }
+ >
+ <Columns />
+ {title}
+ </PopoverTrigger>
+ )}
+ <PopoverContent align="start" className="w-72 min-w-[200px] p-0">
+ <div id={`${storeKey}-columnsSelector`} className="p-2" />
+ </PopoverContent>
</Popover>
</span>
);
@@ -139,30 +143,36 @@ export const ColumnsSelector = ({ children }: ColumnsSelectorProps) => {
);
const elementId = `${storeKey}-columnsSelector`;
- const [container, setContainer] = useState<HTMLElement | null>(() =>
- typeof document !== "undefined" ? document.getElementById(elementId) : null,
- );
+ const [container, setContainer] = useState<HTMLElement | null>(null);
- // on first mount, we don't have the container yet, so we wait for it
+ // Track the portal container across popover mount/unmount cycles.
useEffect(() => {
- if (
- container &&
- typeof document !== "undefined" &&
- document.body.contains(container)
- )
- return;
- // look for the container in the DOM every 100ms
- const interval = setInterval(() => {
+ if (typeof document === "undefined") return;
+
+ const resolveContainer = () => {
const target = document.getElementById(elementId);
- if (target) setContainer(target);
- }, 100);
- // stop looking after 500ms
- const timeout = setTimeout(() => clearInterval(interval), 500);
+ setContainer((current) => {
+ if (target === current) return current;
+ if (target) return target;
+ if (current && !document.body.contains(current)) return null;
+ return current;
+ });
+ };
+
+ resolveContainer();
+
+ const observer = new MutationObserver(resolveContainer);
+
+ // The popover renders its content in a portal appended to <body>, so
+ // watching body's direct children is enough to catch it opening and
+ // closing. Watching the whole subtree instead would run this on every DOM
+ // mutation of the list for as long as the view is mounted.
+ observer.observe(document.body, { childList: true });
+
return () => {
- clearInterval(interval);
- clearTimeout(timeout);
+ observer.disconnect();
};
- }, [elementId, container]);
+ }, [elementId]);
const [columnFilter, setColumnFilter] = useState<string>("");
diff --git a/src/components/admin/confirm.tsx b/src/components/admin/confirm.tsx
index 6cc08b77..87114812 100644
--- a/src/components/admin/confirm.tsx
+++ b/src/components/admin/confirm.tsx
@@ -1,7 +1,8 @@
import { AlertCircle, CheckCircle } from "lucide-react";
import { useTranslate } from "ra-core";
import * as React from "react";
-import { type ComponentType, type MouseEventHandler, useCallback } from "react";
+import type { ComponentType, MouseEventHandler } from "react";
+import { useCallback } from "react";
import { Button } from "@/components/ui/button";
import {
diff --git a/src/components/admin/count.tsx b/src/components/admin/count.tsx
index 84bb991b..08acf1a6 100644
--- a/src/components/admin/count.tsx
+++ b/src/components/admin/count.tsx
@@ -1,5 +1,6 @@
import type { SortPayload } from "ra-core";
import {
+ LinkBase,
useResourceContext,
useGetList,
useTimeout,
@@ -7,8 +8,6 @@ import {
} from "ra-core";
import { CircleX, LoaderCircle } from "lucide-react";
-import { Link } from "react-router";
-
/**
* Fetches and displays the item count for a resource.
*
@@ -69,16 +68,16 @@ export const Count = (props: CountProps) => {
);
return link ? (
- <Link
+ <LinkBase
to={{
pathname: createPath({ resource, type: "list" }),
search: filter ? `filter=${JSON.stringify(filter)}` : undefined,
}}
- onClick={(e) => e.stopPropagation()}
+ onClick={(e: React.MouseEvent<HTMLAnchorElement>) => e.stopPropagation()}
{...rest}
>
{body}
- </Link>
+ </LinkBase>
) : (
<span {...rest}>{body}</span>
);
diff --git a/src/components/admin/create-button.tsx b/src/components/admin/create-button.tsx
index 27a13e34..09f50164 100644
--- a/src/components/admin/create-button.tsx
+++ b/src/components/admin/create-button.tsx
@@ -2,12 +2,13 @@ import React from "react";
import { buttonVariants } from "@/components/ui/button";
import { Plus } from "lucide-react";
import {
+ LinkBase,
useCreatePath,
useGetResourceLabel,
useResourceContext,
useResourceTranslation,
} from "ra-core";
-import { Link } from "react-router";
+import { cn } from "@/lib/utils";
export type CreateButtonProps = {
label?: string;
@@ -55,15 +56,15 @@ export const CreateButton = (props: CreateButtonProps) => {
userText: labelProp,
});
return (
- <Link
- className={buttonVariants({ variant: "outline" })}
+ <LinkBase
+ className={cn(buttonVariants({ variant: "outline" }))}
to={link}
onClick={stopPropagation}
aria-label={typeof label === "string" ? label : undefined}
>
<Plus />
{label}
- </Link>
+ </LinkBase>
);
};
diff --git a/src/components/admin/create.tsx b/src/components/admin/create.tsx
index 61289c1b..1e89aeae 100644
--- a/src/components/admin/create.tsx
+++ b/src/components/admin/create.tsx
@@ -5,6 +5,7 @@ import {
} from "@/components/admin/breadcrumb";
import type { CreateBaseProps } from "ra-core";
import {
+ LinkBase,
CreateBase,
Translate,
useCreateContext,
@@ -14,7 +15,6 @@ import {
useResourceContext,
} from "ra-core";
import type { ReactNode } from "react";
-import { Link } from "react-router";
import { cn } from "@/lib/utils";
export type CreateProps = CreateViewProps & CreateBaseProps;
@@ -102,13 +102,13 @@ export const CreateView = ({
<Breadcrumb>
{hasDashboard && (
<BreadcrumbItem>
- <Link to="/">
+ <LinkBase to="/">
<Translate i18nKey="ra.page.dashboard">Home</Translate>
- </Link>
+ </LinkBase>
</BreadcrumbItem>
)}
<BreadcrumbItem>
- <Link to={listLink}>{listLabel}</Link>
+ <LinkBase to={listLink}>{listLabel}</LinkBase>
</BreadcrumbItem>
<BreadcrumbPage>
<Translate i18nKey="ra.action.create">Create</Translate>
diff --git a/src/components/admin/data-table.tsx b/src/components/admin/data-table.tsx
index 706fa3f2..9c356c24 100644
--- a/src/components/admin/data-table.tsx
+++ b/src/components/admin/data-table.tsx
@@ -26,8 +26,8 @@ import {
useStore,
useTranslate,
useTranslateLabel,
+ useNavigate,
} from "ra-core";
-import { useNavigate } from "react-router";
import { ArrowDownAZ, ArrowUpZA } from "lucide-react";
import get from "lodash/get";
import { cn } from "@/lib/utils";
@@ -380,36 +380,30 @@ function DataTableHeadCell<
{handleSort && sort && !disableSort && source ? (
<TooltipProvider>
<Tooltip>
- <TooltipTrigger asChild>
- <Button
- variant="ghost"
- size="sm"
- className="-ml-3 -mr-3 h-8 data-[state=open]:bg-accent cursor-pointer"
- data-field={source}
- onClick={handleSort}
- >
- {headerClassName?.includes("text-right") ? null : (
- <FieldTitle
- label={label}
- source={source}
- resource={resource}
- />
- )}
- {sort.field === source ? (
- sort.order === "ASC" ? (
- <ArrowDownAZ className="ml-2 h-6 w-6" />
- ) : (
- <ArrowUpZA className="ml-2 h-6 w-6" />
- )
- ) : null}
- {headerClassName?.includes("text-right") ? (
- <FieldTitle
- label={label}
- source={source}
- resource={resource}
- />
- ) : null}
- </Button>
+ <TooltipTrigger
+ render={
+ <Button
+ variant="ghost"
+ size="sm"
+ className="-ml-3 -mr-3 h-8 data-[state=open]:bg-accent cursor-pointer"
+ data-field={source}
+ onClick={handleSort}
+ />
+ }
+ >
+ {headerClassName?.includes("text-right") ? null : (
+ <FieldTitle label={label} source={source} resource={resource} />
+ )}
+ {sort.field === source ? (
+ sort.order === "ASC" ? (
+ <ArrowDownAZ className="ml-2 h-6 w-6" />
+ ) : (
+ <ArrowUpZA className="ml-2 h-6 w-6" />
+ )
+ ) : null}
+ {headerClassName?.includes("text-right") ? (
+ <FieldTitle label={label} source={source} resource={resource} />
+ ) : null}
</TooltipTrigger>
<TooltipContent>
<p>{sortLabel}</p>
diff --git a/src/components/admin/date-field.tsx b/src/components/admin/date-field.tsx
index 5af7e0a9..78f04185 100644
--- a/src/components/admin/date-field.tsx
+++ b/src/components/admin/date-field.tsx
@@ -1,7 +1,7 @@
import type { HTMLAttributes } from "react";
import { genericMemo, useFieldValue, useTranslate } from "ra-core";
-import type { FieldProps } from "@/lib/field.type";
+import type { FieldProps } from "@/lib/field.type.ts";
const DateFieldImpl = <
// eslint-disable-next-line @typescript-eslint/no-explicit-any
diff --git a/src/components/admin/edit-button.tsx b/src/components/admin/edit-button.tsx
index f621af00..6882aef9 100644
--- a/src/components/admin/edit-button.tsx
+++ b/src/components/admin/edit-button.tsx
@@ -3,6 +3,7 @@ import { buttonVariants } from "@/components/ui/button";
import { Pencil } from "lucide-react";
import type { RaRecord } from "ra-core";
import {
+ LinkBase,
useCreatePath,
useGetRecordRepresentation,
useGetResourceLabel,
@@ -10,7 +11,7 @@ import {
useResourceContext,
useResourceTranslation,
} from "ra-core";
-import { Link } from "react-router";
+import { cn } from "@/lib/utils";
export type EditButtonProps = {
record?: RaRecord;
@@ -66,15 +67,15 @@ export const EditButton = (props: EditButtonProps) => {
userText: labelProp,
});
return (
- <Link
- className={buttonVariants({ variant: "outline" })}
+ <LinkBase
+ className={cn(buttonVariants({ variant: "outline" }))}
to={link}
onClick={stopPropagation}
aria-label={typeof label === "string" ? label : undefined}
>
<Pencil />
{label}
- </Link>
+ </LinkBase>
);
};
diff --git a/src/components/admin/edit.tsx b/src/components/admin/edit.tsx
index 3c23138a..689d4245 100644
--- a/src/components/admin/edit.tsx
+++ b/src/components/admin/edit.tsx
@@ -1,6 +1,7 @@
import type { EditBaseProps } from "ra-core";
import {
EditBase,
+ LinkBase,
Translate,
useCreatePath,
useEditContext,
@@ -11,7 +12,6 @@ import {
useResourceDefinition,
} from "ra-core";
import type { ReactNode } from "react";
-import { Link } from "react-router";
import {
Breadcrumb,
BreadcrumbItem,
@@ -119,13 +119,13 @@ export const EditView = ({
<Breadcrumb>
{hasDashboard && (
<BreadcrumbItem>
- <Link to="/">
+ <LinkBase to="/">
<Translate i18nKey="ra.page.dashboard">Home</Translate>
- </Link>
+ </LinkBase>
</BreadcrumbItem>
)}
<BreadcrumbItem>
- <Link to={listLink}>{listLabel}</Link>
+ <LinkBase to={listLink}>{listLabel}</LinkBase>
</BreadcrumbItem>
<BreadcrumbPage>{recordRepresentation}</BreadcrumbPage>
</Breadcrumb>
diff --git a/src/components/admin/email-field.tsx b/src/components/admin/email-field.tsx
index 3ce0231f..b4c069e8 100644
--- a/src/components/admin/email-field.tsx
+++ b/src/components/admin/email-field.tsx
@@ -3,7 +3,7 @@ import type { AnchorHTMLAttributes } from "react";
import React from "react";
import { cn } from "@/lib/utils";
-import type { FieldProps } from "@/lib/field.type";
+import type { FieldProps } from "@/lib/field.type.ts";
const EmailFieldImpl = <
// eslint-disable-next-line @typescript-eslint/no-explicit-any
diff --git a/src/components/admin/error.tsx b/src/components/admin/error.tsx
index 0d03acab..70699aac 100644
--- a/src/components/admin/error.tsx
+++ b/src/components/admin/error.tsx
@@ -44,10 +44,7 @@ export const Error = (props: InternalErrorProps & {}) => {
</div>
{process.env.NODE_ENV !== "production" && (
<>
- <Accordion
- type="multiple"
- className="mt-1 p-2 bg-secondary w-full lg:w-150"
- >
+ <Accordion multiple className="mt-1 p-2 bg-secondary w-full lg:w-150">
<AccordionItem value="error">
<AccordionTrigger className="py-2">
<Translate i18nKey={errorMessage}>{errorMessage}</Translate>
diff --git a/src/components/admin/file-field.tsx b/src/components/admin/file-field.tsx
index 51a0c2a2..299b0648 100644
--- a/src/components/admin/file-field.tsx
+++ b/src/components/admin/file-field.tsx
@@ -3,7 +3,7 @@ import get from "lodash/get";
import type { ExtractRecordPaths, HintedString } from "ra-core";
import { useFieldValue, useTranslate } from "ra-core";
import { cn } from "@/lib/utils";
-import type { FieldProps } from "@/lib/field.type";
+import type { FieldProps } from "@/lib/field.type.ts";
/**
* Displays a downloadable file link with customizable title and target.
diff --git a/src/components/admin/file-input.tsx b/src/components/admin/file-input.tsx
index e6fb312b..eb8c7a3e 100644
--- a/src/components/admin/file-input.tsx
+++ b/src/components/admin/file-input.tsx
@@ -26,7 +26,7 @@ import { XCircle } from "lucide-react";
import { cn } from "@/lib/utils";
import { FormError, FormField, FormLabel } from "@/components/admin/form";
import { InputHelperText } from "@/components/admin/input-helper-text";
-import { Button } from "@/components/ui/button";
+import { Button } from "@/components/ui/button.tsx";
/**
* File upload input with drag-and-drop support and preview capabilities.
diff --git a/src/components/admin/filter-form.tsx b/src/components/admin/filter-form.tsx
index 0b04d95d..5adac149 100644
--- a/src/components/admin/filter-form.tsx
+++ b/src/components/admin/filter-form.tsx
@@ -5,18 +5,18 @@ import { useCallback, useEffect, useState, isValidElement } from "react";
import get from "lodash/get";
import isEqual from "lodash/isEqual";
import queryString from "query-string";
+import type { SavedQuery } from "ra-core";
import {
extractValidSavedQueries,
FieldTitle,
FilterLiveForm,
- type SavedQuery,
useFilterContext,
useListContext,
+ useNavigate,
useResourceContext,
useSavedQueries,
useTranslate,
} from "ra-core";
-import { useNavigate } from "react-router";
import {
Bookmark,
BookmarkMinus,
@@ -329,17 +329,19 @@ export const FilterButton = (props: FilterButtonProps) => {
return (
<div className={cn("inline-block", className)} {...rest}>
<DropdownMenu open={open} onOpenChange={setOpen}>
- <DropdownMenuTrigger asChild>
- <Button
- type="button"
- className="add-filter"
- variant={variant}
- size={size}
- aria-haspopup="true"
- >
- <Filter className="h-4 w-4" />
- {translate("ra.action.add_filter")}
- </Button>
+ <DropdownMenuTrigger
+ render={
+ <Button
+ type="button"
+ className="add-filter"
+ variant={variant}
+ size={size}
+ aria-haspopup="true"
+ />
+ }
+ >
+ <Filter className="h-4 w-4" />
+ {translate("ra.action.add_filter")}
</DropdownMenuTrigger>
<DropdownMenuContent align="start" className="w-56">
{allTogglableFilters
diff --git a/src/components/admin/form.tsx b/src/components/admin/form.tsx
index d87e2cfc..f1d8f459 100644
--- a/src/components/admin/form.tsx
+++ b/src/components/admin/form.tsx
@@ -15,13 +15,11 @@ import {
warning,
} from "ra-core";
import { Loader2, Save } from "lucide-react";
-import * as LabelPrimitive from "@radix-ui/react-label";
-import { Slot } from "@radix-ui/react-slot";
import { FormProvider, useFormContext, useFormState } from "react-hook-form";
import type { UseMutationOptions } from "@tanstack/react-query";
import { cn } from "@/lib/utils";
import { Label } from "@/components/ui/label";
-import { Button } from "@/components/ui/button";
+import { Button } from "@/components/ui/button.tsx";
const Form = FormProvider;
@@ -80,7 +78,7 @@ type FormItemProps = Omit<React.ComponentProps<"div">, "id"> & {
function FormLabel({
className,
...props
-}: React.ComponentProps<typeof LabelPrimitive.Root>) {
+}: React.ComponentProps<typeof Label>) {
const { error, formItemId } = useFormField();
return (
@@ -94,23 +92,42 @@ function FormLabel({
);
}
-function FormControl({ ...props }: React.ComponentProps<typeof Slot>) {
+/**
+ * Wires the field's id and aria attributes onto its single child input.
+ *
+ * `aria-describedby` is the exception: the child's value is kept and the
+ * field's ids are appended to it, which Slot would have overwritten.
+ */
+function FormControl({
+ children,
+ ...props
+}: React.HTMLAttributes<HTMLElement> & { children: React.ReactElement }) {
const { error, formItemId, formDescriptionId, formMessageId } =
useFormField();
+ const fieldDescribedBy = !error
+ ? formDescriptionId
+ : `${formDescriptionId} ${formMessageId}`;
- return (
- <Slot
- data-slot="form-control"
- id={formItemId}
- aria-describedby={
- !error
- ? `${formDescriptionId}`
- : `${formDescriptionId} ${formMessageId}`
- }
- aria-invalid={!!error}
- {...props}
- />
- );
+ if (!React.isValidElement(children)) {
+ return children;
+ }
+
+ const child = children as React.ReactElement<Record<string, unknown>>;
+ const childDescribedBy =
+ typeof child.props["aria-describedby"] === "string"
+ ? child.props["aria-describedby"]
+ : undefined;
+ const describedBy = [childDescribedBy, fieldDescribedBy]
+ .filter(Boolean)
+ .join(" ");
+
+ return React.cloneElement(child, {
+ ...(props as Record<string, unknown>),
+ "data-slot": "form-control",
+ id: formItemId,
+ "aria-describedby": describedBy,
+ "aria-invalid": !!error,
+ });
}
function FormDescription({ className, ...props }: React.ComponentProps<"p">) {
diff --git a/src/components/admin/icon-button-with-tooltip.tsx b/src/components/admin/icon-button-with-tooltip.tsx
index 55700c20..b57cc28c 100644
--- a/src/components/admin/icon-button-with-tooltip.tsx
+++ b/src/components/admin/icon-button-with-tooltip.tsx
@@ -53,22 +53,26 @@ export const IconButtonWithTooltip = ({
return (
<TooltipProvider>
<Tooltip open={open} onOpenChange={setOpen}>
- <TooltipTrigger asChild>
- <Button
- type="button"
- variant="ghost"
- size="icon"
- aria-label={
- typeof translatedLabel === "string" ? translatedLabel : undefined
- }
- onClick={handleClick}
- disabled={disabled}
- onMouseEnter={handleOpen}
- onMouseLeave={handleClose}
- {...props}
- >
- {children}
- </Button>
+ <TooltipTrigger
+ render={
+ <Button
+ type="button"
+ variant="ghost"
+ size="icon"
+ aria-label={
+ typeof translatedLabel === "string"
+ ? translatedLabel
+ : undefined
+ }
+ onClick={handleClick}
+ disabled={disabled}
+ onMouseEnter={handleOpen}
+ onMouseLeave={handleClose}
+ {...props}
+ />
+ }
+ >
+ {children}
</TooltipTrigger>
<TooltipContent>
<p>{translatedLabel}</p>
diff --git a/src/components/admin/image-field.tsx b/src/components/admin/image-field.tsx
index adb3129f..cd42c428 100644
--- a/src/components/admin/image-field.tsx
+++ b/src/components/admin/image-field.tsx
@@ -1,15 +1,11 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import type { HTMLAttributes } from "react";
import get from "lodash/get.js";
-import {
- type ExtractRecordPaths,
- type HintedString,
- useFieldValue,
- useTranslate,
-} from "ra-core";
+import type { ExtractRecordPaths, HintedString } from "ra-core";
+import { useFieldValue, useTranslate } from "ra-core";
import { cn } from "@/lib/utils";
-import type { FieldProps } from "@/lib/field.type";
+import type { FieldProps } from "@/lib/field.type.ts";
/**
* Displays an image or a list of images from a record field inside an img element or a ul of img elements.
diff --git a/src/components/admin/list-guesser.tsx b/src/components/admin/list-guesser.tsx
index 5240f7f5..41c6e56e 100644
--- a/src/components/admin/list-guesser.tsx
+++ b/src/components/admin/list-guesser.tsx
@@ -7,10 +7,10 @@ import {
getElementsFromRecords,
InferredElement,
useListContext,
+ useLocation,
usePrevious,
useResourceContext,
} from "ra-core";
-import { useLocation } from "react-router";
import type { ListProps, ListViewProps } from "@/components/admin/list";
import { ListView } from "@/components/admin/list";
import { capitalize, singularize } from "inflection";
diff --git a/src/components/admin/list.tsx b/src/components/admin/list.tsx
index 4e4035c9..517fc0a1 100644
--- a/src/components/admin/list.tsx
+++ b/src/components/admin/list.tsx
@@ -6,6 +6,7 @@ import {
import type { ListBaseProps, ListControllerResult, RaRecord } from "ra-core";
import {
FilterContext,
+ LinkBase,
ListBase,
Translate,
useGetResourceLabel,
@@ -15,7 +16,6 @@ import {
useTranslate,
} from "ra-core";
import type { ReactElement, ReactNode } from "react";
-import { Link } from "react-router";
import { cn } from "@/lib/utils";
import { CreateButton } from "@/components/admin/create-button";
import { ExportButton } from "@/components/admin/export-button";
@@ -133,9 +133,9 @@ export const ListView = <RecordType extends RaRecord = RaRecord>(
<Breadcrumb>
{hasDashboard && (
<BreadcrumbItem>
- <Link to="/">
+ <LinkBase to="/">
<Translate i18nKey="ra.page.dashboard">Home</Translate>
- </Link>
+ </LinkBase>
</BreadcrumbItem>
)}
<BreadcrumbPage>{resourceLabel}</BreadcrumbPage>
diff --git a/src/components/admin/locales-menu-button.tsx b/src/components/admin/locales-menu-button.tsx
index d4349e65..e633fc2a 100644
--- a/src/components/admin/locales-menu-button.tsx
+++ b/src/components/admin/locales-menu-button.tsx
@@ -37,10 +37,16 @@ export function LocalesMenuButton() {
}
return (
<DropdownMenu modal={false}>
- <DropdownMenuTrigger asChild>
- <Button variant="ghost" size="icon" className="hidden sm:inline-flex">
- {locale.toUpperCase()}
- </Button>
+ <DropdownMenuTrigger
+ render={
+ <Button
+ variant="ghost"
+ size="icon"
+ className="hidden sm:inline-flex"
+ />
+ }
+ >
+ {locale.toUpperCase()}
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
{languages.map((language) => (
diff --git a/src/components/admin/number-field.tsx b/src/components/admin/number-field.tsx
index b65c9fa0..a741b47c 100644
--- a/src/components/admin/number-field.tsx
+++ b/src/components/admin/number-field.tsx
@@ -1,7 +1,7 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import type { HTMLAttributes } from "react";
import { useFieldValue, useTranslate } from "ra-core";
-import type { FieldProps } from "@/lib/field.type";
+import type { FieldProps } from "@/lib/field.type.ts";
/**
* Displays a numeric value with locale-specific formatting.
diff --git a/src/components/admin/radio-button-group-input.tsx b/src/components/admin/radio-button-group-input.tsx
index 89e0bbcf..6ba4f2b3 100644
--- a/src/components/admin/radio-button-group-input.tsx
+++ b/src/components/admin/radio-button-group-input.tsx
@@ -178,7 +178,8 @@ export interface RadioButtonGroupInputProps
ChoicesProps,
Omit<
React.ComponentProps<typeof RadioGroup>,
- "defaultValue" | "onBlur" | "onChange" | "type"
+ "className" | "defaultValue" | "onBlur" | "onChange" | "type"
> {
+ className?: string;
row?: boolean;
}
diff --git a/src/components/admin/reference-field.tsx b/src/components/admin/reference-field.tsx
index 5a7ab7a4..5a1c68d8 100644
--- a/src/components/admin/reference-field.tsx
+++ b/src/components/admin/reference-field.tsx
@@ -5,6 +5,7 @@ import type {
UseReferenceFieldControllerResult,
} from "ra-core";
import {
+ LinkBase,
ReferenceFieldBase,
useFieldValue,
useGetRecordRepresentation,
@@ -12,7 +13,6 @@ import {
useTranslate,
} from "ra-core";
import type { MouseEvent, ReactNode } from "react";
-import { Link } from "react-router";
import type { UseQueryOptions } from "@tanstack/react-query";
/**
@@ -126,9 +126,9 @@ export const ReferenceFieldView = <
if (link) {
return (
<span className={className}>
- <Link to={link} onClick={stopPropagation}>
+ <LinkBase to={link} onClick={stopPropagation}>
{child}
- </Link>
+ </LinkBase>
</span>
);
}
diff --git a/src/components/admin/reference-many-count.tsx b/src/components/admin/reference-many-count.tsx
index bd2e3843..6a15a0d2 100644
--- a/src/components/admin/reference-many-count.tsx
+++ b/src/components/admin/reference-many-count.tsx
@@ -1,10 +1,10 @@
import type { RaRecord, SortPayload } from "ra-core";
import {
+ LinkBase,
useCreatePath,
useRecordContext,
useReferenceManyFieldController,
} from "ra-core";
-import { Link } from "react-router";
/**
* Displays the count of related records that reference the current record.
@@ -59,7 +59,7 @@ export const ReferenceManyCount = <RecordType extends RaRecord = RaRecord>(
const body = isLoading ? "" : error ? "error" : total;
return link && record ? (
- <Link
+ <LinkBase
to={{
pathname: createPath({ resource: reference, type: "list" }),
search: `filter=${JSON.stringify({
@@ -67,10 +67,10 @@ export const ReferenceManyCount = <RecordType extends RaRecord = RaRecord>(
[target]: record[source],
})}`,
}}
- onClick={(e) => e.stopPropagation()}
+ onClick={(e: React.MouseEvent<HTMLAnchorElement>) => e.stopPropagation()}
>
{body}
- </Link>
+ </LinkBase>
) : (
<span>{body}</span>
);
diff --git a/src/components/admin/select-field.tsx b/src/components/admin/select-field.tsx
index 3763c5ad..e008fff7 100644
--- a/src/components/admin/select-field.tsx
+++ b/src/components/admin/select-field.tsx
@@ -2,7 +2,7 @@ import type { HTMLAttributes } from "react";
import type { ChoicesProps } from "ra-core";
import { genericMemo, useChoices, useFieldValue, useTranslate } from "ra-core";
-import type { FieldProps } from "@/lib/field.type";
+import type { FieldProps } from "@/lib/field.type.ts";
/**
* Displays a value from an enumeration by mapping it to a human-readable label.
diff --git a/src/components/admin/select-input.tsx b/src/components/admin/select-input.tsx
index 26791c3d..b7261e85 100644
--- a/src/components/admin/select-input.tsx
+++ b/src/components/admin/select-input.tsx
@@ -263,10 +263,8 @@ export const SelectInput = (props: SelectInputProps) => {
)}
<div className="relative">
<Select
- //FIXME https://github.com/radix-ui/primitives/issues/3135
- // Setting a key based on the value fixes an issue where onValueChange
- // was called with an empty string when the controlled value was changed.
- // See: https://github.com/radix-ui/primitives/issues/3135#issuecomment-2916908248
+ // Re-mounting the select when the controlled value changes avoids a stale
+ // internal state edge case where onValueChange can briefly receive "".
key={`select:${field.value?.toString() ?? emptyValue}`}
value={field.value?.toString() || emptyValue}
onValueChange={handleChangeWithCreateSupport}
@@ -276,7 +274,18 @@ export const SelectInput = (props: SelectInputProps) => {
disabled={field.disabled}
aria-labelledby={labelId}
>
- <SelectValue placeholder={renderEmptyItemOption()} />
+ <SelectValue placeholder={renderEmptyItemOption()}>
+ {(value: string | null) => {
+ if (!value || value === emptyValue) {
+ return renderEmptyItemOption();
+ }
+ const choice = finalChoices?.find(
+ (choice) =>
+ choice && getChoiceValue(choice)?.toString() === value,
+ );
+ return choice ? renderMenuItemOption(choice) : value;
+ }}
+ </SelectValue>
{field.value && field.value !== emptyValue ? (
<div
diff --git a/src/components/admin/show-button.tsx b/src/components/admin/show-button.tsx
index 7a31455f..9ddd2cd6 100644
--- a/src/components/admin/show-button.tsx
+++ b/src/components/admin/show-button.tsx
@@ -1,9 +1,9 @@
import React from "react";
-import { Link } from "react-router";
import { buttonVariants } from "@/components/ui/button";
import { Eye } from "lucide-react";
import type { RaRecord } from "ra-core";
import {
+ LinkBase,
useCreatePath,
useGetRecordRepresentation,
useGetResourceLabel,
@@ -11,6 +11,7 @@ import {
useResourceContext,
useResourceTranslation,
} from "ra-core";
+import { cn } from "@/lib/utils";
export type ShowButtonProps = {
label?: string;
@@ -66,8 +67,8 @@ export const ShowButton = (props: ShowButtonProps) => {
userText: labelProp,
});
return (
- <Link
- className={buttonVariants({ variant: "outline" })}
+ <LinkBase
+ className={cn(buttonVariants({ variant: "outline" }))}
to={link}
onClick={stopPropagation}
aria-label={typeof label === "string" ? label : undefined}
@@ -75,7 +76,7 @@ export const ShowButton = (props: ShowButtonProps) => {
>
{icon ?? <Eye />}
{label}
- </Link>
+ </LinkBase>
);
};
diff --git a/src/components/admin/show.tsx b/src/components/admin/show.tsx
index f1f6ac40..a68a7af9 100644
--- a/src/components/admin/show.tsx
+++ b/src/components/admin/show.tsx
@@ -5,6 +5,7 @@ import {
} from "@/components/admin/breadcrumb";
import type { ShowBaseProps } from "ra-core";
import {
+ LinkBase,
ShowBase,
Translate,
useCreatePath,
@@ -16,7 +17,6 @@ import {
useResourceDefinition,
} from "ra-core";
import type { ReactNode } from "react";
-import { Link } from "react-router";
import { cn } from "@/lib/utils";
import { EditButton } from "@/components/admin/edit-button";
@@ -152,13 +152,13 @@ export const ShowView = ({
<Breadcrumb>
{hasDashboard && (
<BreadcrumbItem>
- <Link to="/">
+ <LinkBase to="/">
<Translate i18nKey="ra.page.dashboard">Home</Translate>
- </Link>
+ </LinkBase>
</BreadcrumbItem>
)}
<BreadcrumbItem>
- <Link to={listLink}>{listLabel}</Link>
+ <LinkBase to={listLink}>{listLabel}</LinkBase>
</BreadcrumbItem>
<BreadcrumbPage>{recordRepresentation}</BreadcrumbPage>
</Breadcrumb>
diff --git a/src/components/admin/simple-form-iterator.tsx b/src/components/admin/simple-form-iterator.tsx
index 4c13fac0..0b72bb45 100644
--- a/src/components/admin/simple-form-iterator.tsx
+++ b/src/components/admin/simple-form-iterator.tsx
@@ -283,18 +283,20 @@ export const AddItemButton = (props: React.ComponentProps<"button">) => {
return (
<TooltipProvider>
<Tooltip>
- <TooltipTrigger asChild>
- <Button
- type="button"
- variant="ghost"
- size="icon"
- onClick={() => add()}
- aria-label={translate("ra.action.add")}
- className={cn("button-add", `button-add-${source}`, className)}
- {...rest}
- >
- <PlusCircle className="h-5 w-5" />
- </Button>
+ <TooltipTrigger
+ render={
+ <Button
+ type="button"
+ variant="ghost"
+ size="icon"
+ onClick={() => add()}
+ aria-label={translate("ra.action.add")}
+ className={cn("button-add", `button-add-${source}`, className)}
+ {...rest}
+ />
+ }
+ >
+ <PlusCircle className="h-5 w-5" />
</TooltipTrigger>
<TooltipContent>{translate("ra.action.add")}</TooltipContent>
</Tooltip>
@@ -404,10 +406,12 @@ export const ClearArrayButton = (props: React.ComponentProps<"button">) => {
return (
<TooltipProvider>
<Tooltip>
- <TooltipTrigger asChild>
- <Button type="button" variant="ghost" size="icon" {...props}>
- <Trash className="h-5 w-5 text-red-500" />
- </Button>
+ <TooltipTrigger
+ render={
+ <Button type="button" variant="ghost" size="icon" {...props} />
+ }
+ >
+ <Trash className="h-5 w-5 text-red-500" />
</TooltipTrigger>
<TooltipContent>
{translate("ra.action.clear_array_input")}
@@ -441,21 +445,23 @@ export const RemoveItemButton = (props: React.ComponentProps<"button">) => {
return (
<TooltipProvider>
<Tooltip>
- <TooltipTrigger asChild>
- <Button
- type="button"
- variant="ghost"
- size="icon"
- onClick={() => remove()}
- className={cn(
- "button-remove",
- `button-remove-${source}-${index}`,
- className,
- )}
- {...rest}
- >
- <XCircle className="h-5 w-5 text-red-500" />
- </Button>
+ <TooltipTrigger
+ render={
+ <Button
+ type="button"
+ variant="ghost"
+ size="icon"
+ onClick={() => remove()}
+ className={cn(
+ "button-remove",
+ `button-remove-${source}-${index}`,
+ className,
+ )}
+ {...rest}
+ />
+ }
+ >
+ <XCircle className="h-5 w-5 text-red-500" />
</TooltipTrigger>
<TooltipContent>{translate("ra.action.remove")}</TooltipContent>
</Tooltip>
diff --git a/src/components/admin/sort-button.tsx b/src/components/admin/sort-button.tsx
index 8a08bdb0..b1e0fa02 100644
--- a/src/components/admin/sort-button.tsx
+++ b/src/components/admin/sort-button.tsx
@@ -93,17 +93,21 @@ const SortButtonComponent = (props: SortButtonProps) => {
{isMobile ? (
<TooltipProvider>
<Tooltip>
- <DropdownMenuTrigger asChild>
- <TooltipTrigger asChild>
- <Button
- variant="outline"
- size="icon"
- aria-label={buttonLabel}
- {...rest}
- >
- {icon}
- </Button>
- </TooltipTrigger>
+ <DropdownMenuTrigger
+ render={
+ <TooltipTrigger
+ render={
+ <Button
+ variant="outline"
+ size="icon"
+ aria-label={buttonLabel}
+ {...rest}
+ />
+ }
+ />
+ }
+ >
+ {icon}
</DropdownMenuTrigger>
<TooltipContent>
<p>{buttonLabel}</p>
@@ -111,12 +115,14 @@ const SortButtonComponent = (props: SortButtonProps) => {
</Tooltip>
</TooltipProvider>
) : (
- <DropdownMenuTrigger asChild>
- <Button variant="outline" size="sm" className="h-9" {...rest}>
- {icon}
- <span className="ml-2">{buttonLabel}</span>
- <ChevronDown className="ml-2 h-4 w-4" />
- </Button>
+ <DropdownMenuTrigger
+ render={
+ <Button variant="outline" size="sm" className="h-9" {...rest} />
+ }
+ >
+ {icon}
+ <span className="ml-2">{buttonLabel}</span>
+ <ChevronDown className="ml-2 h-4 w-4" />
</DropdownMenuTrigger>
)}
<DropdownMenuContent align="start">
diff --git a/src/components/admin/text-field.tsx b/src/components/admin/text-field.tsx
index d0a8cb0f..e2596ac7 100644
--- a/src/components/admin/text-field.tsx
+++ b/src/components/admin/text-field.tsx
@@ -1,7 +1,7 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import type { HTMLAttributes } from "react";
import { useFieldValue, useTranslate } from "ra-core";
-import type { FieldProps } from "@/lib/field.type";
+import type { FieldProps } from "@/lib/field.type.ts";
/**
* Displays a text value from a record field inside a span element.
diff --git a/src/components/admin/theme-mode-toggle.tsx b/src/components/admin/theme-mode-toggle.tsx
index 4dfbdb22..cc566f0b 100644
--- a/src/components/admin/theme-mode-toggle.tsx
+++ b/src/components/admin/theme-mode-toggle.tsx
@@ -22,12 +22,18 @@ export function ThemeModeToggle() {
return (
<DropdownMenu modal={false}>
- <DropdownMenuTrigger asChild>
- <Button variant="ghost" size="icon" className="hidden sm:inline-flex">
- <Sun className="h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" />
- <Moon className="absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" />
- <span className="sr-only">Toggle theme</span>
- </Button>
+ <DropdownMenuTrigger
+ render={
+ <Button
+ variant="ghost"
+ size="icon"
+ className="hidden sm:inline-flex"
+ />
+ }
+ >
+ <Sun className="h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" />
+ <Moon className="absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" />
+ <span className="sr-only">Toggle theme</span>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
<DropdownMenuItem onClick={() => setTheme("light")}>
diff --git a/src/components/admin/theme-provider.tsx b/src/components/admin/theme-provider.tsx
index d03d74cf..2c2f9e6e 100644
--- a/src/components/admin/theme-provider.tsx
+++ b/src/components/admin/theme-provider.tsx
@@ -1,7 +1,8 @@
import { useEffect } from "react";
import { useStore } from "ra-core";
-import { ThemeProviderContext, type Theme } from "./theme-context";
+import type { Theme } from "./theme-context";
+import { ThemeProviderContext } from "./theme-context";
type ThemeProviderProps = {
children: React.ReactNode;
diff --git a/src/components/admin/url-field.tsx b/src/components/admin/url-field.tsx
index 5d5e82f6..928f2e40 100644
--- a/src/components/admin/url-field.tsx
+++ b/src/components/admin/url-field.tsx
@@ -3,7 +3,7 @@ import type { AnchorHTMLAttributes } from "react";
import * as React from "react";
import { cn } from "@/lib/utils";
-import type { FieldProps } from "@/lib/field.type";
+import type { FieldProps } from "@/lib/field.type.ts";
/**
* Displays a URL as a clickable hyperlink.
diff --git a/src/components/admin/user-menu.tsx b/src/components/admin/user-menu.tsx
index bffb4188..c79ab3a5 100644
--- a/src/components/admin/user-menu.tsx
+++ b/src/components/admin/user-menu.tsx
@@ -10,6 +10,7 @@ import { LogOut } from "lucide-react";
import {
DropdownMenu,
DropdownMenuContent,
+ DropdownMenuGroup,
DropdownMenuItem,
DropdownMenuLabel,
DropdownMenuSeparator,
@@ -38,10 +39,6 @@ export function UserMenu({ children }: UserMenuProps) {
const [open, setOpen] = useState(false);
- const handleToggleOpen = useCallback(() => {
- setOpen((prevOpen) => !prevOpen);
- }, []);
-
const handleClose = useCallback(() => {
setOpen(false);
}, []);
@@ -50,26 +47,30 @@ export function UserMenu({ children }: UserMenuProps) {
return (
<UserMenuContext.Provider value={{ onClose: handleClose }}>
- <DropdownMenu open={open} onOpenChange={handleToggleOpen}>
- <DropdownMenuTrigger asChild>
- <Button
- variant="ghost"
- className="relative h-8 w-8 ml-2 rounded-full"
- >
- <Avatar className="h-8 w-8">
- <AvatarImage src={identity?.avatar} role="presentation" />
- <AvatarFallback>{identity?.fullName?.charAt(0)}</AvatarFallback>
- </Avatar>
- </Button>
+ <DropdownMenu open={open} onOpenChange={setOpen}>
+ <DropdownMenuTrigger
+ render={
+ <Button
+ variant="ghost"
+ className="relative h-8 w-8 ml-2 rounded-full"
+ />
+ }
+ >
+ <Avatar className="h-8 w-8">
+ <AvatarImage src={identity?.avatar} role="presentation" />
+ <AvatarFallback>{identity?.fullName?.charAt(0)}</AvatarFallback>
+ </Avatar>
</DropdownMenuTrigger>
- <DropdownMenuContent className="w-56" align="end" forceMount>
- <DropdownMenuLabel className="font-normal">
- <div className="flex flex-col space-y-1">
- <p className="text-sm font-medium leading-none">
- {identity?.fullName}
- </p>
- </div>
- </DropdownMenuLabel>
+ <DropdownMenuContent className="w-56" align="end">
+ <DropdownMenuGroup>
+ <DropdownMenuLabel className="font-normal">
+ <div className="flex flex-col space-y-1">
+ <p className="text-sm font-medium leading-none">
+ {identity?.fullName}
+ </p>
+ </div>
+ </DropdownMenuLabel>
+ </DropdownMenuGroup>
<DropdownMenuSeparator />
{children}
{Children.count(children) > 0 && <DropdownMenuSeparator />}
diff --git a/src/components/atomic-crm/companies/AutocompleteCompanyInput.tsx b/src/components/atomic-crm/companies/AutocompleteCompanyInput.tsx
index 7a1c2308..512432ff 100644
--- a/src/components/atomic-crm/companies/AutocompleteCompanyInput.tsx
+++ b/src/components/atomic-crm/companies/AutocompleteCompanyInput.tsx
@@ -2,13 +2,14 @@ import { useCreate, useGetIdentity, useNotify } from "ra-core";
import { AutocompleteInput } from "@/components/admin/autocomplete-input";
import type { InputProps } from "ra-core";
import { useIsMobile } from "@/hooks/use-mobile";
-import type { PopoverProps } from "@radix-ui/react-popover";
+import type { Popover as PopoverPrimitive } from "@base-ui/react/popover";
export const AutocompleteCompanyInput = ({
validate,
label,
modal,
-}: Pick<InputProps, "validate" | "label"> & Pick<PopoverProps, "modal">) => {
+}: Pick<InputProps, "validate" | "label"> &
+ Pick<PopoverPrimitive.Root.Props, "modal">) => {
const [create] = useCreate();
const { identity } = useGetIdentity();
const notify = useNotify();
diff --git a/src/components/atomic-crm/companies/CompanyShow.tsx b/src/components/atomic-crm/companies/CompanyShow.tsx
index c3fd107f..47c5d337 100644
--- a/src/components/atomic-crm/companies/CompanyShow.tsx
+++ b/src/components/atomic-crm/companies/CompanyShow.tsx
@@ -245,15 +245,20 @@ const CreateRelatedContactButton = () => {
const translate = useTranslate();
const company = useRecordContext<Company>();
return (
- <Button variant="outline" asChild size="sm" className="h-9">
- <RouterLink
- to="/contacts/create"
- state={company ? { record: { company_id: company.id } } : undefined}
- className="flex items-center gap-2"
- >
- <UserPlus className="h-4 w-4" />
- {translate("resources.contacts.action.add")}
- </RouterLink>
+ <Button
+ variant="outline"
+ size="sm"
+ className="h-9"
+ render={
+ <RouterLink
+ to="/contacts/create"
+ state={company ? { record: { company_id: company.id } } : undefined}
+ className="flex items-center gap-2"
+ />
+ }
+ >
+ <UserPlus className="h-4 w-4" />
+ {translate("resources.contacts.action.add")}
</Button>
);
};
diff --git a/src/components/atomic-crm/contacts/ContactEditSheet.tsx b/src/components/atomic-crm/contacts/ContactEditSheet.tsx
index 0ee75f0d..364e4deb 100644
--- a/src/components/atomic-crm/contacts/ContactEditSheet.tsx
+++ b/src/components/atomic-crm/contacts/ContactEditSheet.tsx
@@ -67,19 +67,17 @@ const ContactEditMenuButton = ({
return (
<DropdownMenu>
- <DropdownMenuTrigger asChild>
- <Button variant="ghost" size="icon">
- <EllipsisVertical />
- <span className="sr-only">
- {translate("ra.action.open_menu", { _: "More" })}
- </span>
- </Button>
+ <DropdownMenuTrigger render={<Button variant="ghost" size="icon" />}>
+ <EllipsisVertical />
+ <span className="sr-only">
+ {translate("ra.action.open_menu", { _: "More" })}
+ </span>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
<DropdownMenuItem
variant="destructive"
className="h-12 md:h-8 px-4 md:px-2 text-base md:text-sm"
- onSelect={onDelete}
+ onClick={onDelete}
>
<Trash2 />
{translate("ra.action.delete")}
diff --git a/src/components/atomic-crm/contacts/TagsListEdit.tsx b/src/components/atomic-crm/contacts/TagsListEdit.tsx
index ac038676..5813779c 100644
--- a/src/components/atomic-crm/contacts/TagsListEdit.tsx
+++ b/src/components/atomic-crm/contacts/TagsListEdit.tsx
@@ -108,15 +108,17 @@ export const TagsListEdit = () => {
<div>
<DropdownMenu>
- <DropdownMenuTrigger asChild>
- <Button
- variant="outline"
- size="sm"
- className="h-9 md:h-6 cursor-pointer"
- >
- <Plus className="w-4 h-4 md:w-3 md:h-3 mr-1" />
- {translate("resources.tags.action.add")}
- </Button>
+ <DropdownMenuTrigger
+ render={
+ <Button
+ variant="outline"
+ size="sm"
+ className="h-9 md:h-6 cursor-pointer"
+ />
+ }
+ >
+ <Plus className="w-4 h-4 md:w-3 md:h-3 mr-1" />
+ {translate("resources.tags.action.add")}
</DropdownMenuTrigger>
<DropdownMenuContent>
{unselectedTags?.map((tag) => (
diff --git a/src/components/atomic-crm/dashboard/DashboardStepper.tsx b/src/components/atomic-crm/dashboard/DashboardStepper.tsx
index d452fcfb..6d4777f5 100644
--- a/src/components/atomic-crm/dashboard/DashboardStepper.tsx
+++ b/src/components/atomic-crm/dashboard/DashboardStepper.tsx
@@ -100,15 +100,18 @@ export const DashboardStepper = ({
{addContactLabel}
</Button>
) : (
- <Button asChild className="w-fit">
- <Link
- to={createPath({
- resource: "contacts",
- type: "create",
- })}
- >
- {addContactLabel}
- </Link>
+ <Button
+ className="w-fit"
+ render={
+ <Link
+ to={createPath({
+ resource: "contacts",
+ type: "create",
+ })}
+ />
+ }
+ >
+ {addContactLabel}
</Button>
)}
</div>
@@ -139,18 +142,22 @@ export const DashboardStepper = ({
})}
</Button>
) : (
- <Button asChild disabled={step < 2} className="w-fit">
- <Link
- to={createPath({
- resource: "contacts",
- type: "show",
- id: contactId,
- })}
- >
- {translate("resources.notes.action.add", {
- _: "Add note",
- })}
- </Link>
+ <Button
+ disabled={step < 2}
+ className="w-fit"
+ render={
+ <Link
+ to={createPath({
+ resource: "contacts",
+ type: "show",
+ id: contactId,
+ })}
+ />
+ }
+ >
+ {translate("resources.notes.action.add", {
+ _: "Add note",
+ })}
</Button>
)}
</div>
diff --git a/src/components/atomic-crm/dashboard/HotContacts.tsx b/src/components/atomic-crm/dashboard/HotContacts.tsx
index 84327384..17ceb704 100644
--- a/src/components/atomic-crm/dashboard/HotContacts.tsx
+++ b/src/components/atomic-crm/dashboard/HotContacts.tsx
@@ -42,17 +42,17 @@ export const HotContacts = () => {
</h2>
<TooltipProvider>
<Tooltip>
- <TooltipTrigger asChild>
- <Button
- variant="ghost"
- size="sm"
- className="ml-auto text-muted-foreground"
- asChild
- >
- <Link to="/contacts/create">
- <Plus className="w-4 h-4 text-primary" />
- </Link>
- </Button>
+ <TooltipTrigger
+ render={
+ <Button
+ variant="ghost"
+ size="sm"
+ className="ml-auto text-muted-foreground"
+ render={<Link to="/contacts/create" />}
+ />
+ }
+ >
+ <Plus className="w-4 h-4 text-primary" />
</TooltipTrigger>
<TooltipContent>
{translate("resources.contacts.action.create")}
diff --git a/src/components/atomic-crm/dataImport/DataImportDialog.tsx b/src/components/atomic-crm/dataImport/DataImportDialog.tsx
index d0c1b37a..e052e521 100644
--- a/src/components/atomic-crm/dataImport/DataImportDialog.tsx
+++ b/src/components/atomic-crm/dataImport/DataImportDialog.tsx
@@ -127,6 +127,10 @@ export function DataImportDialog({
value={resource.name}
onValueChange={handleResourceChange}
disabled={importer.state !== "idle"}
+ items={resources.map(({ name }) => ({
+ value: name,
+ label: getResourceLabel(name, 2),
+ }))}
>
<SelectTrigger id="data-import-resource" className="w-full">
<SelectValue />
@@ -201,13 +205,17 @@ export function DataImportDialog({
<Alert>
<AlertDescription className="flex flex-col gap-4">
{translate("crm.data_import.sample_hint")}
- <Button asChild variant="outline" size="sm">
- <Link
- to={sampleUrl}
- download={sampleFileName(resource.name)}
- >
- {translate("crm.data_import.sample_download")}
- </Link>
+ <Button
+ variant="outline"
+ size="sm"
+ render={
+ <Link
+ to={sampleUrl}
+ download={sampleFileName(resource.name)}
+ />
+ }
+ >
+ {translate("crm.data_import.sample_download")}
</Button>
</AlertDescription>
</Alert>
diff --git a/src/components/atomic-crm/deals/DealEdit.tsx b/src/components/atomic-crm/deals/DealEdit.tsx
index daeb4d1c..e3fc73dd 100644
--- a/src/components/atomic-crm/deals/DealEdit.tsx
+++ b/src/components/atomic-crm/deals/DealEdit.tsx
@@ -75,10 +75,12 @@ function EditHeader() {
</div>
<div className="flex gap-2 pr-12">
<DeleteButton />
- <Button asChild variant="outline" className="h-9">
- <Link to={`/deals/${deal.id}/show`}>
- {translate("resources.deals.action.back_to_deal")}
- </Link>
+ <Button
+ variant="outline"
+ className="h-9"
+ render={<Link to={`/deals/${deal.id}/show`} />}
+ >
+ {translate("resources.deals.action.back_to_deal")}
</Button>
</div>
</div>
diff --git a/src/components/atomic-crm/layout/Header.tsx b/src/components/atomic-crm/layout/Header.tsx
index 2e8f983d..5efb583b 100644
--- a/src/components/atomic-crm/layout/Header.tsx
+++ b/src/components/atomic-crm/layout/Header.tsx
@@ -131,11 +131,12 @@ const UsersMenu = () => {
throw new Error("<UsersMenu> must be used inside <UserMenu?");
}
return (
- <DropdownMenuItem asChild onClick={userMenuContext.onClose}>
- <Link to="/sales" className="flex items-center gap-2">
- <Users />
- {translate("resources.sales.name", { smart_count: 2 })}
- </Link>
+ <DropdownMenuItem
+ onClick={userMenuContext.onClose}
+ render={<Link to="/sales" className="flex items-center gap-2" />}
+ >
+ <Users />
+ {translate("resources.sales.name", { smart_count: 2 })}
</DropdownMenuItem>
);
};
@@ -147,11 +148,12 @@ const ProfileMenu = () => {
throw new Error("<ProfileMenu> must be used inside <UserMenu?");
}
return (
- <DropdownMenuItem asChild onClick={userMenuContext.onClose}>
- <Link to="/profile" className="flex items-center gap-2">
- <User />
- {translate("crm.profile.title")}
- </Link>
+ <DropdownMenuItem
+ onClick={userMenuContext.onClose}
+ render={<Link to="/profile" className="flex items-center gap-2" />}
+ >
+ <User />
+ {translate("crm.profile.title")}
</DropdownMenuItem>
);
};
@@ -163,11 +165,12 @@ const SettingsMenu = () => {
throw new Error("<SettingsMenu> must be used inside <UserMenu>");
}
return (
- <DropdownMenuItem asChild onClick={userMenuContext.onClose}>
- <Link to="/settings" className="flex items-center gap-2">
- <Settings />
- {translate("crm.settings.title")}
- </Link>
+ <DropdownMenuItem
+ onClick={userMenuContext.onClose}
+ render={<Link to="/settings" className="flex items-center gap-2" />}
+ >
+ <Settings />
+ {translate("crm.settings.title")}
</DropdownMenuItem>
);
};
@@ -179,11 +182,12 @@ const ImportFromJsonMenuItem = () => {
throw new Error("<ImportFromJsonMenuItem> must be used inside <UserMenu>");
}
return (
- <DropdownMenuItem asChild onClick={userMenuContext.onClose}>
- <Link to={ImportPage.path} className="flex items-center gap-2">
- <Import />
- {translate("crm.header.import_data")}
- </Link>
+ <DropdownMenuItem
+ onClick={userMenuContext.onClose}
+ render={<Link to={ImportPage.path} className="flex items-center gap-2" />}
+ >
+ <Import />
+ {translate("crm.header.import_data")}
</DropdownMenuItem>
);
};
@@ -195,11 +199,14 @@ const ChangelogMenuItem = () => {
throw new Error("<ChangelogMenuItem> must be used inside <UserMenu>");
}
return (
- <DropdownMenuItem asChild onClick={userMenuContext.onClose}>
- <Link to={ChangelogPage.path} className="flex items-center gap-2">
- <FileText />
- {translate("crm.changelog.title")}
- </Link>
+ <DropdownMenuItem
+ onClick={userMenuContext.onClose}
+ render={
+ <Link to={ChangelogPage.path} className="flex items-center gap-2" />
+ }
+ >
+ <FileText />
+ {translate("crm.changelog.title")}
</DropdownMenuItem>
);
};
diff --git a/src/components/atomic-crm/layout/MobileNavigation.tsx b/src/components/atomic-crm/layout/MobileNavigation.tsx
index aac0c651..8982d33f 100644
--- a/src/components/atomic-crm/layout/MobileNavigation.tsx
+++ b/src/components/atomic-crm/layout/MobileNavigation.tsx
@@ -94,17 +94,15 @@ const NavigationButton = ({
isActive: boolean;
}) => (
<Button
- asChild
variant="ghost"
className={cn(
"flex-col gap-1 h-auto py-2 px-1 rounded-md w-16",
isActive ? null : "text-muted-foreground",
)}
+ render={<Link to={href} />}
>
- <Link to={href}>
- <Icon className="size-6" />
- <span className="text-[0.6rem] font-medium">{label}</span>
- </Link>
+ <Icon className="size-6" />
+ <span className="text-[0.6rem] font-medium">{label}</span>
</Button>
);
@@ -132,20 +130,22 @@ const CreateButton = () => {
contact_id={contact_id}
/>
<DropdownMenu>
- <DropdownMenuTrigger asChild>
- <Button
- variant="default"
- size="icon"
- className="h-16 w-16 rounded-full -mt-3"
- aria-label={translate("ra.action.create")}
- >
- <Plus className="size-10" />
- </Button>
+ <DropdownMenuTrigger
+ render={
+ <Button
+ variant="default"
+ size="icon"
+ className="h-16 w-16 rounded-full -mt-3"
+ aria-label={translate("ra.action.create")}
+ />
+ }
+ >
+ <Plus className="size-10" />
</DropdownMenuTrigger>
<DropdownMenuContent>
<DropdownMenuItem
className="h-12 px-4 text-base"
- onSelect={() => {
+ onClick={() => {
setContactCreateOpen(true);
}}
>
@@ -153,7 +153,7 @@ const CreateButton = () => {
</DropdownMenuItem>
<DropdownMenuItem
className="h-12 px-4 text-base"
- onSelect={() => {
+ onClick={() => {
setNoteCreateOpen(true);
}}
>
@@ -161,7 +161,7 @@ const CreateButton = () => {
</DropdownMenuItem>
<DropdownMenuItem
className="h-12 px-4 text-base"
- onSelect={() => {
+ onClick={() => {
setTaskCreateOpen(true);
}}
>
diff --git a/src/components/atomic-crm/layout/PullToRefresh.test.tsx b/src/components/atomic-crm/layout/PullToRefresh.test.tsx
index 7afc8a8b..2a6dddd4 100644
--- a/src/components/atomic-crm/layout/PullToRefresh.test.tsx
+++ b/src/components/atomic-crm/layout/PullToRefresh.test.tsx
@@ -132,8 +132,8 @@ describe("PullToRefresh", () => {
it("ignores a pull started inside an overlay portalled out of the page", async () => {
const screen = await render(
<Fixture>
- {/* Shape of a Radix dropdown menu / select: portalled popper, own scrolling. */}
- <div data-radix-popper-content-wrapper="">
+ {/* Shape of a Base UI dropdown menu / select: portalled popup, own scrolling. */}
+ <div data-base-ui-portal="">
<div role="menu" data-testid="menu">
<div role="menuitem">Archive</div>
</div>
diff --git a/src/components/atomic-crm/layout/PullToRefresh.tsx b/src/components/atomic-crm/layout/PullToRefresh.tsx
index 958f34ec..740c72f1 100644
--- a/src/components/atomic-crm/layout/PullToRefresh.tsx
+++ b/src/components/atomic-crm/layout/PullToRefresh.tsx
@@ -15,14 +15,14 @@ const MAX_DISTANCE = 96;
/**
* True when a pull starting on `target` belongs to something else than the page: an
* ancestor is already scrolled down, or the touch is inside an overlay. Overlays are
- * matched on their two portal roots — Radix's popper wrapper
- * (select, dropdown menu, popover, command) and the dialog role (dialog and, since
- * vaul renders one too, sheet) — rather than on the role of the panel itself, which
- * varies (dialog, listbox, menu, …) and is portalled out of its own sheet anyway.
+ * matched on their two portal roots — Base UI's portal wrapper
+ * (select, dropdown menu, popover, command, sheet) and the dialog role — rather than
+ * on the role of the panel itself, which varies (dialog, listbox, menu, …) and is
+ * portalled out of its own sheet anyway.
*/
const isScrollGesture = (target: EventTarget | null) => {
let node = target instanceof Element ? target : null;
- if (node?.closest('[role="dialog"], [data-radix-popper-content-wrapper]')) {
+ if (node?.closest('[role="dialog"], [data-base-ui-portal]')) {
return true;
}
while (node) {
diff --git a/src/components/atomic-crm/misc/ResponsiveFilters.tsx b/src/components/atomic-crm/misc/ResponsiveFilters.tsx
index 4971be23..bf833617 100644
--- a/src/components/atomic-crm/misc/ResponsiveFilters.tsx
+++ b/src/components/atomic-crm/misc/ResponsiveFilters.tsx
@@ -57,23 +57,25 @@ export const ResponsiveFilters = ({
/>
</FilterLiveForm>
<Sheet>
- <SheetTrigger asChild>
- <Button
- variant="ghost"
- size="icon"
- className="relative size-9"
- aria-label={translate("ra.action.add_filter")}
- >
- <Filter className="size-5" />
- {activeFiltersCount > 0 && (
- <Badge
- variant="destructive"
- className="absolute -top-1 -right-1 h-5 w-5 p-0 text-xs flex items-center justify-center"
- >
- {activeFiltersCount}
- </Badge>
- )}
- </Button>
+ <SheetTrigger
+ render={
+ <Button
+ variant="ghost"
+ size="icon"
+ className="relative size-9"
+ aria-label={translate("ra.action.add_filter")}
+ />
+ }
+ >
+ <Filter className="size-5" />
+ {activeFiltersCount > 0 && (
+ <Badge
+ variant="destructive"
+ className="absolute -top-1 -right-1 h-5 w-5 p-0 text-xs flex items-center justify-center"
+ >
+ {activeFiltersCount}
+ </Badge>
+ )}
</SheetTrigger>
<SheetContent side="bottom" className="h-dvh p-4 flex flex-col">
<SheetHeader className="-p-4">
@@ -89,22 +91,22 @@ export const ResponsiveFilters = ({
<SheetFooter className="-p-4 relative">
<div className="absolute -top-12 left-0 right-0 h-8 bg-gradient-to-t from-background to-transparent pointer-events-none" />
<div className="flex w-full gap-4">
- <SheetClose asChild>
- <Button
- onClick={handleClearFilters}
- type="button"
- variant="secondary"
- className="flex-1"
- >
- {translate("ra.navigation.clear_filters", {
- _: "Clear filters",
- })}
- </Button>
+ <SheetClose
+ render={
+ <Button
+ onClick={handleClearFilters}
+ type="button"
+ variant="secondary"
+ className="flex-1"
+ />
+ }
+ >
+ {translate("ra.navigation.clear_filters", {
+ _: "Clear filters",
+ })}
</SheetClose>
- <SheetClose asChild>
- <Button className="flex-1">
- {translate("ra.action.confirm")}
- </Button>
+ <SheetClose render={<Button className="flex-1" />}>
+ {translate("ra.action.confirm")}
</SheetClose>
</div>
</SheetFooter>
diff --git a/src/components/atomic-crm/notes/Note.tsx b/src/components/atomic-crm/notes/Note.tsx
index 2e3ac09e..15ddc706 100644
--- a/src/components/atomic-crm/notes/Note.tsx
+++ b/src/components/atomic-crm/notes/Note.tsx
@@ -124,15 +124,17 @@ export const Note = ({
<span className={`${isHover ? "visible" : "invisible"}`}>
<TooltipProvider>
<Tooltip>
- <TooltipTrigger asChild>
- <Button
- variant="ghost"
- size="sm"
- onClick={handleEnterEditMode}
- className="p-1 h-auto cursor-pointer"
- >
- <Edit className="w-4 h-4" />
- </Button>
+ <TooltipTrigger
+ render={
+ <Button
+ variant="ghost"
+ size="sm"
+ onClick={handleEnterEditMode}
+ className="p-1 h-auto cursor-pointer"
+ />
+ }
+ >
+ <Edit className="w-4 h-4" />
</TooltipTrigger>
<TooltipContent>
<p>{translate("resources.notes.action.edit")}</p>
@@ -141,15 +143,17 @@ export const Note = ({
</TooltipProvider>
<TooltipProvider>
<Tooltip>
- <TooltipTrigger asChild>
- <Button
- variant="ghost"
- size="sm"
- onClick={handleDelete}
- className="p-1 h-auto cursor-pointer"
- >
- <Trash2 className="w-4 h-4" />
- </Button>
+ <TooltipTrigger
+ render={
+ <Button
+ variant="ghost"
+ size="sm"
+ onClick={handleDelete}
+ className="p-1 h-auto cursor-pointer"
+ />
+ }
+ >
+ <Trash2 className="w-4 h-4" />
</TooltipTrigger>
<TooltipContent>
<p>{translate("resources.notes.action.delete")}</p>
diff --git a/src/components/atomic-crm/notes/NoteEditSheet.tsx b/src/components/atomic-crm/notes/NoteEditSheet.tsx
index c595a399..a2667a26 100644
--- a/src/components/atomic-crm/notes/NoteEditSheet.tsx
+++ b/src/components/atomic-crm/notes/NoteEditSheet.tsx
@@ -98,22 +98,24 @@ const NoteEditMenuButton = ({
return (
<DropdownMenu>
- <DropdownMenuTrigger asChild>
- <button
- type="button"
- className="opacity-70 transition-opacity hover:opacity-100 rounded-xs"
- >
- <EllipsisVertical className="size-6" />
- <span className="sr-only">
- {translate("ra.action.open_menu", { _: "More" })}
- </span>
- </button>
+ <DropdownMenuTrigger
+ render={
+ <button
+ type="button"
+ className="opacity-70 transition-opacity hover:opacity-100 rounded-xs"
+ />
+ }
+ >
+ <EllipsisVertical className="size-6" />
+ <span className="sr-only">
+ {translate("ra.action.open_menu", { _: "More" })}
+ </span>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
<DropdownMenuItem
variant="destructive"
className="h-12 md:h-8 px-4 md:px-2 text-base md:text-sm"
- onSelect={onDelete}
+ onClick={onDelete}
>
<Trash2 />
{translate("ra.action.delete")}
diff --git a/src/components/atomic-crm/notes/StatusSelector.tsx b/src/components/atomic-crm/notes/StatusSelector.tsx
index 1ed83280..5694f6ee 100644
--- a/src/components/atomic-crm/notes/StatusSelector.tsx
+++ b/src/components/atomic-crm/notes/StatusSelector.tsx
@@ -82,18 +82,28 @@ export const StatusSelector = ({
}
/**
- * Radix's Select component doesn't allow empty string as value, so we use a placeholder value and convert it back to empty string on change
- * @see https://github.com/radix-ui/primitives/issues/2706
+ * "No status" needs a selectable item of its own, and an item cannot carry an empty
+ * value, so it uses a sentinel that is converted back to an empty string on change.
*/
const handleValueChange = (value: string) => {
setStatus(value === NONE_VALUE ? "" : value);
};
+ // <SelectValue> renders the trigger label from this map, not from the items' children.
+ const items = [
+ { value: NONE_VALUE, label: noneLabel },
+ ...noteStatuses.map((statusOption) => ({
+ value: statusOption.value,
+ label: <StatusOption {...statusOption} />,
+ })),
+ ];
+
return (
<Select
disabled={disabled}
value={status || NONE_VALUE}
onValueChange={handleValueChange}
+ items={items}
>
<SelectTrigger className={cn("w-32", triggerClassName)}>
<SelectValue placeholder={noneLabel} />
@@ -106,16 +116,20 @@ export const StatusSelector = ({
</SelectItem>
{noteStatuses.map((statusOption) => (
<SelectItem key={statusOption.value} value={statusOption.value}>
- <div className="flex items-center gap-2">
- <span
- className="inline-block w-2.5 h-2.5 rounded-full"
- style={{ backgroundColor: statusOption.color }}
- />
- {statusOption.label}
- </div>
+ <StatusOption {...statusOption} />
</SelectItem>
))}
</SelectContent>
</Select>
);
};
+
+const StatusOption = ({ color, label }: { color: string; label: string }) => (
+ <div className="flex items-center gap-2">
+ <span
+ className="inline-block w-2.5 h-2.5 rounded-full"
+ style={{ backgroundColor: color }}
+ />
+ {label}
+ </div>
+);
diff --git a/src/components/atomic-crm/settings/ProfilePage.tsx b/src/components/atomic-crm/settings/ProfilePage.tsx
index 246374cb..be06a590 100644
--- a/src/components/atomic-crm/settings/ProfilePage.tsx
+++ b/src/components/atomic-crm/settings/ProfilePage.tsx
@@ -286,12 +286,17 @@ const LanguageSelector = () => {
return null;
}
+ const localeItems = locales.map(({ locale, name }) => ({
+ value: locale,
+ label: name,
+ }));
+
return (
<div className="space-y-2">
<p className="text-xs text-muted-foreground">
{translate("crm.language")}
</p>
- <Select value={locale} onValueChange={setLocale}>
+ <Select value={locale} onValueChange={setLocale} items={localeItems}>
<SelectTrigger className="w-full">
<SelectValue />
</SelectTrigger>
@@ -382,20 +387,22 @@ const CopyPaste = ({ value }: { value: string }) => {
return (
<TooltipProvider>
<Tooltip>
- <TooltipTrigger asChild>
- <Button
- type="button"
- onClick={handleCopy}
- variant="ghost"
- className="normal-case justify-between w-full"
- >
- <span className="overflow-hidden text-ellipsis">{value}</span>
- {copied ? (
- <Check className="h-4 w-4 ml-2" />
- ) : (
- <Copy className="h-4 w-4 ml-2" />
- )}
- </Button>
+ <TooltipTrigger
+ render={
+ <Button
+ type="button"
+ onClick={handleCopy}
+ variant="ghost"
+ className="normal-case justify-between w-full"
+ />
+ }
+ >
+ <span className="overflow-hidden text-ellipsis">{value}</span>
+ {copied ? (
+ <Check className="h-4 w-4 ml-2" />
+ ) : (
+ <Copy className="h-4 w-4 ml-2" />
+ )}
</TooltipTrigger>
<TooltipContent>
<p>
diff --git a/src/components/atomic-crm/settings/SettingsPageMobile.tsx b/src/components/atomic-crm/settings/SettingsPageMobile.tsx
index ebb230a1..9528b65d 100644
--- a/src/components/atomic-crm/settings/SettingsPageMobile.tsx
+++ b/src/components/atomic-crm/settings/SettingsPageMobile.tsx
@@ -451,6 +451,11 @@ const LanguageRow = () => {
if (locales.length <= 1) return null;
+ const localeItems = locales.map(({ locale, name }) => ({
+ value: locale,
+ label: name,
+ }));
+
return (
<Item size="sm">
<ItemContent>
@@ -459,7 +464,7 @@ const LanguageRow = () => {
</ItemTitle>
</ItemContent>
<ItemActions>
- <Select value={locale} onValueChange={setLocale}>
+ <Select value={locale} onValueChange={setLocale} items={localeItems}>
<SelectTrigger
size="sm"
className="w-auto !h-auto py-0 border-none shadow-none"
@@ -489,9 +494,8 @@ const ThemeRow = () => {
{translate("crm.theme.label", { _: "Theme" })}
</ItemTitle>
<ToggleGroup
- type="single"
- value={theme}
- onValueChange={(value) =>
+ value={theme ? [theme] : []}
+ onValueChange={([value]) =>
value && setTheme(value as "light" | "dark" | "system")
}
size="lg"
@@ -577,17 +581,19 @@ const AboutSection = () => {
<div>
<SectionLabel>{translate("crm.settings.about")}</SectionLabel>
<ItemGroup className="rounded-lg border overflow-hidden">
- <Item asChild size="sm" className="cursor-pointer">
- <Link to={ChangelogPage.path}>
- <ItemContent>
- <ItemTitle className="font-normal">
- {translate("crm.changelog.title")}
- </ItemTitle>
- </ItemContent>
- <ItemActions>
- <ChevronRight className="size-4 text-muted-foreground" />
- </ItemActions>
- </Link>
+ <Item
+ size="sm"
+ className="cursor-pointer"
+ render={<Link to={ChangelogPage.path} />}
+ >
+ <ItemContent>
+ <ItemTitle className="font-normal">
+ {translate("crm.changelog.title")}
+ </ItemTitle>
+ </ItemContent>
+ <ItemActions>
+ <ChevronRight className="size-4 text-muted-foreground" />
+ </ItemActions>
</Item>
</ItemGroup>
</div>
@@ -608,23 +614,25 @@ const CopyPasteRow = ({ value }: { value: string }) => {
return (
<TooltipProvider>
<Tooltip>
- <TooltipTrigger asChild>
- <Item
- size="sm"
- className="cursor-pointer flex-nowrap"
- onClick={handleCopy}
- >
- <ItemContent className="overflow-hidden">
- <ItemTitle className="font-normal truncate">{value}</ItemTitle>
- </ItemContent>
- <ItemActions className="shrink-0">
- {copied ? (
- <Check className="size-4 text-muted-foreground" />
- ) : (
- <Copy className="size-4 text-muted-foreground" />
- )}
- </ItemActions>
- </Item>
+ <TooltipTrigger
+ render={
+ <Item
+ size="sm"
+ className="cursor-pointer flex-nowrap"
+ onClick={handleCopy}
+ />
+ }
+ >
+ <ItemContent className="overflow-hidden">
+ <ItemTitle className="font-normal truncate">{value}</ItemTitle>
+ </ItemContent>
+ <ItemActions className="shrink-0">
+ {copied ? (
+ <Check className="size-4 text-muted-foreground" />
+ ) : (
+ <Copy className="size-4 text-muted-foreground" />
+ )}
+ </ItemActions>
</TooltipTrigger>
<TooltipContent>
<p>
diff --git a/src/components/atomic-crm/tasks/AddTask.tsx b/src/components/atomic-crm/tasks/AddTask.tsx
index 9f6decef..089e07ae 100644
--- a/src/components/atomic-crm/tasks/AddTask.tsx
+++ b/src/components/atomic-crm/tasks/AddTask.tsx
@@ -71,15 +71,17 @@ export const AddTask = ({
{display === "icon" ? (
<TooltipProvider>
<Tooltip>
- <TooltipTrigger asChild>
- <Button
- size="sm"
- variant="ghost"
- className="p-2 cursor-pointer"
- onClick={handleOpen}
- >
- <Plus className="w-4 h-4" />
- </Button>
+ <TooltipTrigger
+ render={
+ <Button
+ size="sm"
+ variant="ghost"
+ className="p-2 cursor-pointer"
+ onClick={handleOpen}
+ />
+ }
+ >
+ <Plus className="w-4 h-4" />
</TooltipTrigger>
<TooltipContent>
{translate("resources.tasks.action.create")}
diff --git a/src/components/atomic-crm/tasks/Task.tsx b/src/components/atomic-crm/tasks/Task.tsx
index a4e856c5..2751f0d6 100644
--- a/src/components/atomic-crm/tasks/Task.tsx
+++ b/src/components/atomic-crm/tasks/Task.tsx
@@ -150,15 +150,17 @@ export const Task = ({
</div>
<DropdownMenu>
- <DropdownMenuTrigger asChild>
- <Button
- variant="ghost"
- size="icon"
- className="h-5 pr-0! size-8 cursor-pointer"
- aria-label={translate("resources.tasks.actions.title")}
- >
- <MoreVertical className="size-5 md:size-4" />
- </Button>
+ <DropdownMenuTrigger
+ render={
+ <Button
+ variant="ghost"
+ size="icon"
+ className="h-5 pr-0! size-8 cursor-pointer"
+ aria-label={translate("resources.tasks.actions.title")}
+ />
+ }
+ >
+ <MoreVertical className="size-5 md:size-4" />
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
<DropdownMenuItem
diff --git a/src/components/ui/README.md b/src/components/ui/README.md
index 2dc90466..5af06a33 100644
--- a/src/components/ui/README.md
+++ b/src/components/ui/README.md
@@ -13,7 +13,7 @@ The components in this directory come from [shadcn/ui](https://ui.shadcn.com/).
- Tooltips
- And more...
-These components are built on top of [Radix UI](https://www.radix-ui.com/) and styled using [Tailwind CSS](https://tailwindcss.com/).
+These components are built on top of [Base UI](https://base-ui.com/) and styled using [Tailwind CSS](https://tailwindcss.com/).
## Documentation
diff --git a/src/components/ui/accordion.tsx b/src/components/ui/accordion.tsx
index d21b65f7..92377d66 100644
--- a/src/components/ui/accordion.tsx
+++ b/src/components/ui/accordion.tsx
@@ -1,23 +1,23 @@
-import * as React from "react"
-import * as AccordionPrimitive from "@radix-ui/react-accordion"
-import { ChevronDownIcon } from "lucide-react"
-
+import { Accordion as AccordionPrimitive } from "@base-ui/react/accordion"
import { cn } from "@/lib/utils"
-function Accordion({
- ...props
-}: React.ComponentProps<typeof AccordionPrimitive.Root>) {
- return <AccordionPrimitive.Root data-slot="accordion" {...props} />
+import { ChevronDownIcon, ChevronUpIcon } from "lucide-react"
+
+function Accordion({ className, ...props }: AccordionPrimitive.Root.Props) {
+ return (
+ <AccordionPrimitive.Root
+ data-slot="accordion"
+ className={cn("flex w-full flex-col", className)}
+ {...props}
+ />
+ )
}
-function AccordionItem({
- className,
- ...props
-}: React.ComponentProps<typeof AccordionPrimitive.Item>) {
+function AccordionItem({ className, ...props }: AccordionPrimitive.Item.Props) {
return (
<AccordionPrimitive.Item
data-slot="accordion-item"
- className={cn("border-b last:border-b-0", className)}
+ className={cn("not-last:border-b", className)}
{...props}
/>
)
@@ -27,19 +27,26 @@ function AccordionTrigger({
className,
children,
...props
-}: React.ComponentProps<typeof AccordionPrimitive.Trigger>) {
+}: AccordionPrimitive.Trigger.Props) {
return (
<AccordionPrimitive.Header className="flex">
<AccordionPrimitive.Trigger
data-slot="accordion-trigger"
className={cn(
- "focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",
+ "group/accordion-trigger relative flex flex-1 items-start justify-between rounded-md border border-transparent py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:after:border-ring aria-disabled:pointer-events-none aria-disabled:opacity-50 **:data-[slot=accordion-trigger-icon]:ml-auto **:data-[slot=accordion-trigger-icon]:size-4 **:data-[slot=accordion-trigger-icon]:text-muted-foreground",
className
)}
{...props}
>
{children}
- <ChevronDownIcon className="text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200" />
+ <ChevronDownIcon
+ data-slot="accordion-trigger-icon"
+ className="pointer-events-none shrink-0 group-aria-expanded/accordion-trigger:hidden"
+ />
+ <ChevronUpIcon
+ data-slot="accordion-trigger-icon"
+ className="pointer-events-none hidden shrink-0 group-aria-expanded/accordion-trigger:inline"
+ />
</AccordionPrimitive.Trigger>
</AccordionPrimitive.Header>
)
@@ -49,15 +56,22 @@ function AccordionContent({
className,
children,
...props
-}: React.ComponentProps<typeof AccordionPrimitive.Content>) {
+}: AccordionPrimitive.Panel.Props) {
return (
- <AccordionPrimitive.Content
+ <AccordionPrimitive.Panel
data-slot="accordion-content"
- className="data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm"
+ className="overflow-hidden text-sm data-open:animate-accordion-down data-closed:animate-accordion-up"
{...props}
>
- <div className={cn("pt-0 pb-4", className)}>{children}</div>
- </AccordionPrimitive.Content>
+ <div
+ className={cn(
+ "h-(--accordion-panel-height) pt-0 pb-4 data-ending-style:h-0 data-starting-style:h-0 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4",
+ className
+ )}
+ >
+ {children}
+ </div>
+ </AccordionPrimitive.Panel>
)
}
diff --git a/src/components/ui/alert.tsx b/src/components/ui/alert.tsx
index 14213546..64d68233 100644
--- a/src/components/ui/alert.tsx
+++ b/src/components/ui/alert.tsx
@@ -1,16 +1,15 @@
import * as React from "react"
import { cva, type VariantProps } from "class-variance-authority"
-
import { cn } from "@/lib/utils"
const alertVariants = cva(
- "relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",
+ "group/alert relative grid w-full gap-0.5 rounded-lg border px-4 py-3 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2.5 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4",
{
variants: {
variant: {
default: "bg-card text-card-foreground",
destructive:
- "text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",
+ "bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current",
},
},
defaultVariants: {
@@ -39,7 +38,7 @@ function AlertTitle({ className, ...props }: React.ComponentProps<"div">) {
<div
data-slot="alert-title"
className={cn(
- "col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",
+ "font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground",
className
)}
{...props}
@@ -55,7 +54,7 @@ function AlertDescription({
<div
data-slot="alert-description"
className={cn(
- "text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",
+ "text-sm text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4",
className
)}
{...props}
@@ -63,4 +62,14 @@ function AlertDescription({
)
}
-export { Alert, AlertTitle, AlertDescription }
+function AlertAction({ className, ...props }: React.ComponentProps<"div">) {
+ return (
+ <div
+ data-slot="alert-action"
+ className={cn("absolute top-2.5 right-3", className)}
+ {...props}
+ />
+ )
+}
+
+export { Alert, AlertTitle, AlertDescription, AlertAction }
diff --git a/src/components/ui/avatar.tsx b/src/components/ui/avatar.tsx
index 54446e18..e92312dc 100644
--- a/src/components/ui/avatar.tsx
+++ b/src/components/ui/avatar.tsx
@@ -1,17 +1,22 @@
-import * as React from "react"
-import * as AvatarPrimitive from "@radix-ui/react-avatar"
+"use client"
+import * as React from "react"
+import { Avatar as AvatarPrimitive } from "@base-ui/react/avatar"
import { cn } from "@/lib/utils"
function Avatar({
className,
+ size = "default",
...props
-}: React.ComponentProps<typeof AvatarPrimitive.Root>) {
+}: AvatarPrimitive.Root.Props & {
+ size?: "default" | "sm" | "lg"
+}) {
return (
<AvatarPrimitive.Root
data-slot="avatar"
+ data-size={size}
className={cn(
- "relative flex size-8 shrink-0 overflow-hidden rounded-full",
+ "group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten",
className
)}
{...props}
@@ -19,14 +24,14 @@ function Avatar({
)
}
-function AvatarImage({
- className,
- ...props
-}: React.ComponentProps<typeof AvatarPrimitive.Image>) {
+function AvatarImage({ className, ...props }: AvatarPrimitive.Image.Props) {
return (
<AvatarPrimitive.Image
data-slot="avatar-image"
- className={cn("aspect-square size-full", className)}
+ className={cn(
+ "aspect-square size-full rounded-full object-cover",
+ className
+ )}
{...props}
/>
)
@@ -80,12 +85,12 @@ function AvatarFallback({
className,
children,
...props
-}: React.ComponentProps<typeof AvatarPrimitive.Fallback>) {
+}: AvatarPrimitive.Fallback.Props) {
return (
<AvatarPrimitive.Fallback
data-slot="avatar-fallback"
className={cn(
- "flex size-full items-center justify-center rounded-full",
+ "flex size-full items-center justify-center rounded-full text-sm group-data-[size=sm]/avatar:text-xs",
className,
getAvatarColorClass(children)
)}
@@ -96,4 +101,56 @@ function AvatarFallback({
)
}
-export { Avatar, AvatarImage, AvatarFallback }
+function AvatarBadge({ className, ...props }: React.ComponentProps<"span">) {
+ return (
+ <span
+ data-slot="avatar-badge"
+ className={cn(
+ "absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full bg-primary text-primary-foreground bg-blend-color ring-2 ring-background select-none",
+ "group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden",
+ "group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2",
+ "group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2",
+ className
+ )}
+ {...props}
+ />
+ )
+}
+
+function AvatarGroup({ className, ...props }: React.ComponentProps<"div">) {
+ return (
+ <div
+ data-slot="avatar-group"
+ className={cn(
+ "group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2 *:data-[slot=avatar]:ring-background",
+ className
+ )}
+ {...props}
+ />
+ )
+}
+
+function AvatarGroupCount({
+ className,
+ ...props
+}: React.ComponentProps<"div">) {
+ return (
+ <div
+ data-slot="avatar-group-count"
+ className={cn(
+ "relative flex size-8 shrink-0 items-center justify-center rounded-full bg-muted text-sm text-muted-foreground ring-2 ring-background group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6 [&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3",
+ className
+ )}
+ {...props}
+ />
+ )
+}
+
+export {
+ Avatar,
+ AvatarImage,
+ AvatarFallback,
+ AvatarGroup,
+ AvatarGroupCount,
+ AvatarBadge,
+}
diff --git a/src/components/ui/badge.tsx b/src/components/ui/badge.tsx
index 02054139..2265150a 100644
--- a/src/components/ui/badge.tsx
+++ b/src/components/ui/badge.tsx
@@ -1,22 +1,23 @@
-import * as React from "react"
-import { Slot } from "@radix-ui/react-slot"
+import { mergeProps } from "@base-ui/react/merge-props"
+import { useRender } from "@base-ui/react/use-render"
import { cva, type VariantProps } from "class-variance-authority"
-
import { cn } from "@/lib/utils"
const badgeVariants = cva(
- "inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",
+ "group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",
{
variants: {
variant: {
- default:
- "border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
+ default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",
secondary:
- "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
+ "bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",
destructive:
- "border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
+ "bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",
outline:
- "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
+ "border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",
+ ghost:
+ "hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",
+ link: "text-primary underline-offset-4 hover:underline",
},
},
defaultVariants: {
@@ -27,20 +28,24 @@ const badgeVariants = cva(
function Badge({
className,
- variant,
- asChild = false,
+ variant = "default",
+ render,
...props
-}: React.ComponentProps<"span"> &
- VariantProps<typeof badgeVariants> & { asChild?: boolean }) {
- const Comp = asChild ? Slot : "span"
-
- return (
- <Comp
- data-slot="badge"
- className={cn(badgeVariants({ variant }), className)}
- {...props}
- />
- )
+}: useRender.ComponentProps<"span"> & VariantProps<typeof badgeVariants>) {
+ return useRender({
+ defaultTagName: "span",
+ props: mergeProps<"span">(
+ {
+ className: cn(badgeVariants({ variant }), className),
+ },
+ props
+ ),
+ render,
+ state: {
+ slot: "badge",
+ variant,
+ },
+ })
}
export { Badge, badgeVariants }
diff --git a/src/components/ui/breadcrumb.tsx b/src/components/ui/breadcrumb.tsx
index eb88f321..0550b94b 100644
--- a/src/components/ui/breadcrumb.tsx
+++ b/src/components/ui/breadcrumb.tsx
@@ -1,11 +1,19 @@
import * as React from "react"
-import { Slot } from "@radix-ui/react-slot"
-import { ChevronRight, MoreHorizontal } from "lucide-react"
-
+import { mergeProps } from "@base-ui/react/merge-props"
+import { useRender } from "@base-ui/react/use-render"
import { cn } from "@/lib/utils"
-function Breadcrumb({ ...props }: React.ComponentProps<"nav">) {
- return <nav aria-label="breadcrumb" data-slot="breadcrumb" {...props} />
+import { ChevronRightIcon, MoreHorizontalIcon } from "lucide-react"
+
+function Breadcrumb({ className, ...props }: React.ComponentProps<"nav">) {
+ return (
+ <nav
+ aria-label="breadcrumb"
+ data-slot="breadcrumb"
+ className={cn(className)}
+ {...props}
+ />
+ )
}
function BreadcrumbList({ className, ...props }: React.ComponentProps<"ol">) {
@@ -13,7 +21,7 @@ function BreadcrumbList({ className, ...props }: React.ComponentProps<"ol">) {
<ol
data-slot="breadcrumb-list"
className={cn(
- "text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",
+ "flex flex-wrap items-center gap-1.5 text-sm wrap-break-word text-muted-foreground sm:gap-2.5",
className
)}
{...props}
@@ -32,21 +40,23 @@ function BreadcrumbItem({ className, ...props }: React.ComponentProps<"li">) {
}
function BreadcrumbLink({
- asChild,
className,
+ render,
...props
-}: React.ComponentProps<"a"> & {
- asChild?: boolean
-}) {
- const Comp = asChild ? Slot : "a"
-
- return (
- <Comp
- data-slot="breadcrumb-link"
- className={cn("hover:text-foreground transition-colors", className)}
- {...props}
- />
- )
+}: useRender.ComponentProps<"a">) {
+ return useRender({
+ defaultTagName: "a",
+ props: mergeProps<"a">(
+ {
+ className: cn("transition-colors hover:text-foreground", className),
+ },
+ props
+ ),
+ render,
+ state: {
+ slot: "breadcrumb-link",
+ },
+ })
}
function BreadcrumbPage({ className, ...props }: React.ComponentProps<"span">) {
@@ -56,7 +66,7 @@ function BreadcrumbPage({ className, ...props }: React.ComponentProps<"span">) {
role="link"
aria-disabled="true"
aria-current="page"
- className={cn("text-foreground font-normal", className)}
+ className={cn("font-normal text-foreground", className)}
{...props}
/>
)
@@ -75,7 +85,7 @@ function BreadcrumbSeparator({
className={cn("[&>svg]:size-3.5", className)}
{...props}
>
- {children ?? <ChevronRight />}
+ {children ?? <ChevronRightIcon className="cn-rtl-flip" />}
</li>
)
}
@@ -89,10 +99,13 @@ function BreadcrumbEllipsis({
data-slot="breadcrumb-ellipsis"
role="presentation"
aria-hidden="true"
- className={cn("flex size-9 items-center justify-center", className)}
+ className={cn(
+ "flex size-5 items-center justify-center [&>svg]:size-4",
+ className
+ )}
{...props}
>
- <MoreHorizontal className="size-4" />
+ <MoreHorizontalIcon />
<span className="sr-only">More</span>
</span>
)
diff --git a/src/components/ui/button.tsx b/src/components/ui/button.tsx
index a2df8dce..b20f4152 100644
--- a/src/components/ui/button.tsx
+++ b/src/components/ui/button.tsx
@@ -1,31 +1,35 @@
-import * as React from "react"
-import { Slot } from "@radix-ui/react-slot"
+import { Button as ButtonPrimitive } from "@base-ui/react/button"
import { cva, type VariantProps } from "class-variance-authority"
-
import { cn } from "@/lib/utils"
const buttonVariants = cva(
- "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
+ "group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
{
variants: {
variant: {
- default:
- "bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
- destructive:
- "bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
+ default: "bg-primary text-primary-foreground hover:bg-primary/80",
outline:
- "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
+ "border-border bg-background shadow-xs hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
secondary:
- "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
+ "bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
ghost:
- "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
+ "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
+ destructive:
+ "bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",
link: "text-primary underline-offset-4 hover:underline",
},
size: {
- default: "h-9 px-4 py-2 has-[>svg]:px-3",
- sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
- lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
+ default:
+ "h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
+ xs: "h-6 gap-1 rounded-[min(var(--radius-md),8px)] px-2 text-xs in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
+ sm: "h-8 gap-1 rounded-[min(var(--radius-md),10px)] px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5",
+ lg: "h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
icon: "size-9",
+ "icon-xs":
+ "size-6 rounded-[min(var(--radius-md),8px)] in-data-[slot=button-group]:rounded-md [&_svg:not([class*='size-'])]:size-3",
+ "icon-sm":
+ "size-8 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-md",
+ "icon-lg": "size-10",
},
},
defaultVariants: {
@@ -37,18 +41,12 @@ const buttonVariants = cva(
function Button({
className,
- variant,
- size,
- asChild = false,
+ variant = "default",
+ size = "default",
...props
-}: React.ComponentProps<"button"> &
- VariantProps<typeof buttonVariants> & {
- asChild?: boolean
- }) {
- const Comp = asChild ? Slot : "button"
-
+}: ButtonPrimitive.Props & VariantProps<typeof buttonVariants>) {
return (
- <Comp
+ <ButtonPrimitive
data-slot="button"
className={cn(buttonVariants({ variant, size, className }))}
{...props}
diff --git a/src/components/ui/card.tsx b/src/components/ui/card.tsx
index 32f46430..ae8ca02b 100644
--- a/src/components/ui/card.tsx
+++ b/src/components/ui/card.tsx
@@ -1,13 +1,17 @@
import * as React from "react"
-
import { cn } from "@/lib/utils"
-function Card({ className, ...props }: React.ComponentProps<"div">) {
+function Card({
+ className,
+ size = "default",
+ ...props
+}: React.ComponentProps<"div"> & { size?: "default" | "sm" }) {
return (
<div
data-slot="card"
+ data-size={size}
className={cn(
- "bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6",
+ "group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(6)] has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(4)] *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",
className
)}
{...props}
@@ -20,7 +24,7 @@ function CardHeader({ className, ...props }: React.ComponentProps<"div">) {
<div
data-slot="card-header"
className={cn(
- "@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",
+ "group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)",
className
)}
{...props}
@@ -32,7 +36,10 @@ function CardTitle({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
data-slot="card-title"
- className={cn("leading-none font-semibold", className)}
+ className={cn(
+ "cn-font-heading text-base leading-normal font-medium group-data-[size=sm]/card:text-sm",
+ className
+ )}
{...props}
/>
)
@@ -42,7 +49,7 @@ function CardDescription({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
data-slot="card-description"
- className={cn("text-muted-foreground text-sm", className)}
+ className={cn("text-sm text-muted-foreground", className)}
{...props}
/>
)
@@ -65,7 +72,7 @@ function CardContent({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
data-slot="card-content"
- className={cn("px-6", className)}
+ className={cn("flex flex-col gap-3 px-(--card-spacing)", className)}
{...props}
/>
)
@@ -75,7 +82,10 @@ function CardFooter({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
data-slot="card-footer"
- className={cn("flex items-center px-6 [.border-t]:pt-6", className)}
+ className={cn(
+ "flex items-center rounded-b-xl px-(--card-spacing) [.border-t]:pt-(--card-spacing)",
+ className
+ )}
{...props}
/>
)
diff --git a/src/components/ui/checkbox.tsx b/src/components/ui/checkbox.tsx
index defeb01f..51cda677 100644
--- a/src/components/ui/checkbox.tsx
+++ b/src/components/ui/checkbox.tsx
@@ -1,27 +1,25 @@
-import * as React from "react"
-import * as CheckboxPrimitive from "@radix-ui/react-checkbox"
-import { CheckIcon } from "lucide-react"
+"use client"
+import { Checkbox as CheckboxPrimitive } from "@base-ui/react/checkbox"
import { cn } from "@/lib/utils"
-function Checkbox({
- className,
- ...props
-}: React.ComponentProps<typeof CheckboxPrimitive.Root>) {
+import { CheckIcon } from "lucide-react"
+
+function Checkbox({ className, ...props }: CheckboxPrimitive.Root.Props) {
return (
<CheckboxPrimitive.Root
data-slot="checkbox"
className={cn(
- "peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
+ "peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input shadow-xs transition-shadow outline-none group-has-disabled/field:opacity-50 group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:not-data-checked:border-input after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary",
className
)}
{...props}
>
<CheckboxPrimitive.Indicator
data-slot="checkbox-indicator"
- className="flex items-center justify-center text-current transition-none"
+ className="grid place-content-center text-current transition-none [&>svg]:size-3.5"
>
- <CheckIcon className="size-3.5" />
+ <CheckIcon />
</CheckboxPrimitive.Indicator>
</CheckboxPrimitive.Root>
)
diff --git a/src/components/ui/command.tsx b/src/components/ui/command.tsx
index 5360f6db..83d70e73 100644
--- a/src/components/ui/command.tsx
+++ b/src/components/ui/command.tsx
@@ -1,8 +1,9 @@
+"use client"
+
import * as React from "react"
import { Command as CommandPrimitive } from "cmdk"
-import { SearchIcon } from "lucide-react"
-
import { cn } from "@/lib/utils"
+
import {
Dialog,
DialogContent,
@@ -10,6 +11,8 @@ import {
DialogHeader,
DialogTitle,
} from "@/components/ui/dialog"
+import { InputGroup, InputGroupAddon } from "@/components/ui/input-group"
+import { CheckIcon, SearchIcon } from "lucide-react"
function Command({
className,
@@ -19,7 +22,7 @@ function Command({
<CommandPrimitive
data-slot="command"
className={cn(
- "bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",
+ "flex size-full flex-col overflow-hidden rounded-xl! bg-popover p-1 text-popover-foreground",
className
)}
{...props}
@@ -31,10 +34,15 @@ function CommandDialog({
title = "Command Palette",
description = "Search for a command to run...",
children,
+ className,
+ showCloseButton = false,
...props
-}: React.ComponentProps<typeof Dialog> & {
+}: Omit<React.ComponentProps<typeof Dialog>, "children"> & {
title?: string
description?: string
+ className?: string
+ showCloseButton?: boolean
+ children: React.ReactNode
}) {
return (
<Dialog {...props}>
@@ -42,10 +50,14 @@ function CommandDialog({
<DialogTitle>{title}</DialogTitle>
<DialogDescription>{description}</DialogDescription>
</DialogHeader>
- <DialogContent className="overflow-hidden p-0">
- <Command className="[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5">
- {children}
- </Command>
+ <DialogContent
+ className={cn(
+ "top-1/3 translate-y-0 overflow-hidden rounded-xl! p-0",
+ className
+ )}
+ showCloseButton={showCloseButton}
+ >
+ {children}
</DialogContent>
</Dialog>
)
@@ -56,19 +68,20 @@ function CommandInput({
...props
}: React.ComponentProps<typeof CommandPrimitive.Input>) {
return (
- <div
- data-slot="command-input-wrapper"
- className="flex h-9 items-center gap-2 border-b px-3"
- >
- <SearchIcon className="size-4 shrink-0 opacity-50" />
- <CommandPrimitive.Input
- data-slot="command-input"
- className={cn(
- "placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",
- className
- )}
- {...props}
- />
+ <div data-slot="command-input-wrapper" className="p-1 pb-0">
+ <InputGroup className="h-8! rounded-lg! border-input/30 bg-input/30 shadow-none! *:data-[slot=input-group-addon]:pl-2!">
+ <CommandPrimitive.Input
+ data-slot="command-input"
+ className={cn(
+ "w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",
+ className
+ )}
+ {...props}
+ />
+ <InputGroupAddon>
+ <SearchIcon className="size-4 shrink-0 opacity-50" />
+ </InputGroupAddon>
+ </InputGroup>
</div>
)
}
@@ -81,7 +94,7 @@ function CommandList({
<CommandPrimitive.List
data-slot="command-list"
className={cn(
- "max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",
+ "no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none",
className
)}
{...props}
@@ -90,12 +103,13 @@ function CommandList({
}
function CommandEmpty({
+ className,
...props
}: React.ComponentProps<typeof CommandPrimitive.Empty>) {
return (
<CommandPrimitive.Empty
data-slot="command-empty"
- className="py-6 text-center text-sm"
+ className={cn("py-6 text-center text-sm", className)}
{...props}
/>
)
@@ -109,7 +123,7 @@ function CommandGroup({
<CommandPrimitive.Group
data-slot="command-group"
className={cn(
- "text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",
+ "overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground",
className
)}
{...props}
@@ -124,7 +138,7 @@ function CommandSeparator({
return (
<CommandPrimitive.Separator
data-slot="command-separator"
- className={cn("bg-border -mx-1 h-px", className)}
+ className={cn("-mx-1 h-px w-auto bg-border", className)}
{...props}
/>
)
@@ -132,17 +146,21 @@ function CommandSeparator({
function CommandItem({
className,
+ children,
...props
}: React.ComponentProps<typeof CommandPrimitive.Item>) {
return (
<CommandPrimitive.Item
data-slot="command-item"
className={cn(
- "data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
+ "group/command-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-lg! data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-selected:**:[svg]:text-foreground",
className
)}
{...props}
- />
+ >
+ {children}
+ <CheckIcon className="ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100" />
+ </CommandPrimitive.Item>
)
}
@@ -154,7 +172,7 @@ function CommandShortcut({
<span
data-slot="command-shortcut"
className={cn(
- "text-muted-foreground ml-auto text-xs tracking-widest",
+ "ml-auto text-xs tracking-widest text-muted-foreground group-data-selected/command-item:text-foreground",
className
)}
{...props}
diff --git a/src/components/ui/dialog.tsx b/src/components/ui/dialog.tsx
index 981e999f..05efbbb0 100644
--- a/src/components/ui/dialog.tsx
+++ b/src/components/ui/dialog.tsx
@@ -1,42 +1,37 @@
-import * as React from "react"
-import * as DialogPrimitive from "@radix-ui/react-dialog"
-import { XIcon } from "lucide-react"
+"use client"
+import * as React from "react"
+import { Dialog as DialogPrimitive } from "@base-ui/react/dialog"
import { cn } from "@/lib/utils"
-function Dialog({
- ...props
-}: React.ComponentProps<typeof DialogPrimitive.Root>) {
+import { Button } from "@/components/ui/button"
+import { XIcon } from "lucide-react"
+
+function Dialog({ ...props }: DialogPrimitive.Root.Props) {
return <DialogPrimitive.Root data-slot="dialog" {...props} />
}
-function DialogTrigger({
- ...props
-}: React.ComponentProps<typeof DialogPrimitive.Trigger>) {
+function DialogTrigger({ ...props }: DialogPrimitive.Trigger.Props) {
return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props} />
}
-function DialogPortal({
- ...props
-}: React.ComponentProps<typeof DialogPrimitive.Portal>) {
+function DialogPortal({ ...props }: DialogPrimitive.Portal.Props) {
return <DialogPrimitive.Portal data-slot="dialog-portal" {...props} />
}
-function DialogClose({
- ...props
-}: React.ComponentProps<typeof DialogPrimitive.Close>) {
+function DialogClose({ ...props }: DialogPrimitive.Close.Props) {
return <DialogPrimitive.Close data-slot="dialog-close" {...props} />
}
function DialogOverlay({
className,
...props
-}: React.ComponentProps<typeof DialogPrimitive.Overlay>) {
+}: DialogPrimitive.Backdrop.Props) {
return (
- <DialogPrimitive.Overlay
+ <DialogPrimitive.Backdrop
data-slot="dialog-overlay"
className={cn(
- "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
+ "fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
className
)}
{...props}
@@ -47,25 +42,39 @@ function DialogOverlay({
function DialogContent({
className,
children,
+ showCloseButton = true,
...props
-}: React.ComponentProps<typeof DialogPrimitive.Content>) {
+}: DialogPrimitive.Popup.Props & {
+ showCloseButton?: boolean
+}) {
return (
- <DialogPortal data-slot="dialog-portal">
+ <DialogPortal>
<DialogOverlay />
- <DialogPrimitive.Content
+ <DialogPrimitive.Popup
data-slot="dialog-content"
className={cn(
- "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",
+ "fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-6 rounded-xl bg-popover p-6 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-md data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
className
)}
{...props}
>
{children}
- <DialogPrimitive.Close className="ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4">
- <XIcon />
- <span className="sr-only">Close</span>
- </DialogPrimitive.Close>
- </DialogPrimitive.Content>
+ {showCloseButton && (
+ <DialogPrimitive.Close
+ data-slot="dialog-close"
+ render={
+ <Button
+ variant="ghost"
+ className="absolute top-4 right-4"
+ size="icon-sm"
+ />
+ }
+ >
+ <XIcon />
+ <span className="sr-only">Close</span>
+ </DialogPrimitive.Close>
+ )}
+ </DialogPrimitive.Popup>
</DialogPortal>
)
}
@@ -74,13 +83,20 @@ function DialogHeader({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
data-slot="dialog-header"
- className={cn("flex flex-col gap-2 text-center sm:text-left", className)}
+ className={cn("flex flex-col gap-2", className)}
{...props}
/>
)
}
-function DialogFooter({ className, ...props }: React.ComponentProps<"div">) {
+function DialogFooter({
+ className,
+ showCloseButton = false,
+ children,
+ ...props
+}: React.ComponentProps<"div"> & {
+ showCloseButton?: boolean
+}) {
return (
<div
data-slot="dialog-footer"
@@ -89,18 +105,22 @@ function DialogFooter({ className, ...props }: React.ComponentProps<"div">) {
className
)}
{...props}
- />
+ >
+ {children}
+ {showCloseButton && (
+ <DialogPrimitive.Close render={<Button variant="outline" />}>
+ Close
+ </DialogPrimitive.Close>
+ )}
+ </div>
)
}
-function DialogTitle({
- className,
- ...props
-}: React.ComponentProps<typeof DialogPrimitive.Title>) {
+function DialogTitle({ className, ...props }: DialogPrimitive.Title.Props) {
return (
<DialogPrimitive.Title
data-slot="dialog-title"
- className={cn("text-lg leading-none font-semibold", className)}
+ className={cn("cn-font-heading leading-none font-medium", className)}
{...props}
/>
)
@@ -109,11 +129,14 @@ function DialogTitle({
function DialogDescription({
className,
...props
-}: React.ComponentProps<typeof DialogPrimitive.Description>) {
+}: DialogPrimitive.Description.Props) {
return (
<DialogPrimitive.Description
data-slot="dialog-description"
- className={cn("text-muted-foreground text-sm", className)}
+ className={cn(
+ "text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",
+ className
+ )}
{...props}
/>
)
diff --git a/src/components/ui/drawer.tsx b/src/components/ui/drawer.tsx
index 869955fc..834a088a 100644
--- a/src/components/ui/drawer.tsx
+++ b/src/components/ui/drawer.tsx
@@ -1,41 +1,94 @@
-import * as React from "react"
-import { Drawer as DrawerPrimitive } from "vaul"
+"use client"
+import * as React from "react"
+import { Drawer as DrawerPrimitive } from "@base-ui/react/drawer"
import { cn } from "@/lib/utils"
+type DrawerContextProps = {
+ hasSnapPoints: boolean
+ modal: DrawerPrimitive.Root.Props["modal"]
+ showSwipeHandle: boolean
+ swipeDirection: NonNullable<DrawerPrimitive.Root.Props["swipeDirection"]>
+}
+
+const DrawerContext = React.createContext<DrawerContextProps | null>(null)
+
+function useDrawer() {
+ const context = React.useContext(DrawerContext)
+
+ if (!context) {
+ throw new Error("useDrawer must be used within a Drawer.")
+ }
+
+ return context
+}
+
function Drawer({
+ modal = true,
+ showSwipeHandle = false,
+ snapPoints,
+ swipeDirection = "down",
...props
-}: React.ComponentProps<typeof DrawerPrimitive.Root>) {
- return <DrawerPrimitive.Root data-slot="drawer" {...props} />
+}: DrawerPrimitive.Root.Props & {
+ showSwipeHandle?: boolean
+}) {
+ const hasSnapPoints = snapPoints != null && snapPoints.length > 0
+ const contextValue = React.useMemo(
+ () => ({ hasSnapPoints, modal, showSwipeHandle, swipeDirection }),
+ [hasSnapPoints, modal, showSwipeHandle, swipeDirection]
+ )
+
+ return (
+ <DrawerContext.Provider value={contextValue}>
+ <DrawerPrimitive.Root
+ data-slot="drawer"
+ modal={modal}
+ snapPoints={snapPoints}
+ swipeDirection={swipeDirection}
+ {...props}
+ />
+ </DrawerContext.Provider>
+ )
}
-function DrawerTrigger({
- ...props
-}: React.ComponentProps<typeof DrawerPrimitive.Trigger>) {
+function DrawerTrigger({ ...props }: DrawerPrimitive.Trigger.Props) {
return <DrawerPrimitive.Trigger data-slot="drawer-trigger" {...props} />
}
-function DrawerPortal({
- ...props
-}: React.ComponentProps<typeof DrawerPrimitive.Portal>) {
+function DrawerPortal({ ...props }: DrawerPrimitive.Portal.Props) {
return <DrawerPrimitive.Portal data-slot="drawer-portal" {...props} />
}
-function DrawerClose({
- ...props
-}: React.ComponentProps<typeof DrawerPrimitive.Close>) {
+function DrawerClose({ ...props }: DrawerPrimitive.Close.Props) {
return <DrawerPrimitive.Close data-slot="drawer-close" {...props} />
}
function DrawerOverlay({
className,
...props
-}: React.ComponentProps<typeof DrawerPrimitive.Overlay>) {
+}: DrawerPrimitive.Backdrop.Props) {
return (
- <DrawerPrimitive.Overlay
+ <DrawerPrimitive.Backdrop
data-slot="drawer-overlay"
className={cn(
- "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
+ "fixed inset-0 z-50 min-h-dvh bg-black/10 opacity-[max(var(--drawer-overlay-min-opacity,0),calc(1-var(--drawer-swipe-progress)))] transition-opacity duration-450 ease-[cubic-bezier(0.32,0.72,0,1)] select-none data-ending-style:pointer-events-none data-ending-style:opacity-0 data-ending-style:duration-[calc(var(--drawer-swipe-strength)*400ms)] data-snap-points:[--drawer-overlay-min-opacity:0.5] data-starting-style:opacity-0 data-swiping:duration-0 supports-backdrop-filter:backdrop-blur-xs supports-[-webkit-touch-callout:none]:absolute",
+ className
+ )}
+ {...props}
+ />
+ )
+}
+
+function DrawerSwipeHandle({
+ className,
+ ...props
+}: React.ComponentProps<"div">) {
+ return (
+ <div
+ data-slot="drawer-swipe-handle"
+ aria-hidden="true"
+ className={cn(
+ "relative z-10 flex shrink-0 cursor-grab transition-opacity duration-200 group-data-nested-drawer-open/drawer-popup:opacity-0 group-data-nested-drawer-swiping/drawer-popup:opacity-100 group-data-[swipe-axis=x]/drawer-popup:h-full group-data-[swipe-axis=x]/drawer-popup:w-3 group-data-[swipe-axis=x]/drawer-popup:items-center group-data-[swipe-axis=y]/drawer-popup:h-3 group-data-[swipe-axis=y]/drawer-popup:w-full group-data-[swipe-axis=y]/drawer-popup:justify-center group-data-[swipe-direction=down]/drawer-popup:items-end group-data-[swipe-direction=left]/drawer-popup:order-last group-data-[swipe-direction=left]/drawer-popup:justify-start group-data-[swipe-direction=right]/drawer-popup:justify-end group-data-[swipe-direction=up]/drawer-popup:order-last group-data-[swipe-direction=up]/drawer-popup:items-start after:block after:shrink-0 after:rounded-full after:bg-muted group-data-[swipe-axis=x]/drawer-popup:after:h-[100px] group-data-[swipe-axis=x]/drawer-popup:after:w-1.5 group-data-[swipe-axis=y]/drawer-popup:after:h-1.5 group-data-[swipe-axis=y]/drawer-popup:after:w-[100px] active:cursor-grabbing",
className
)}
{...props}
@@ -47,25 +100,65 @@ function DrawerContent({
className,
children,
...props
-}: React.ComponentProps<typeof DrawerPrimitive.Content>) {
+}: DrawerPrimitive.Popup.Props) {
+ const { hasSnapPoints, modal, showSwipeHandle, swipeDirection } = useDrawer()
+ const swipeAxis =
+ swipeDirection === "down" || swipeDirection === "up" ? "y" : "x"
+
return (
<DrawerPortal data-slot="drawer-portal">
- <DrawerOverlay />
- <DrawerPrimitive.Content
- data-slot="drawer-content"
- className={cn(
- "group/drawer-content bg-background fixed z-50 flex h-auto flex-col",
- "data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b",
- "data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t",
- "data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm",
- "data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",
- className
- )}
- {...props}
+ {modal === true && (
+ <DrawerOverlay data-snap-points={hasSnapPoints ? "" : undefined} />
+ )}
+ <DrawerPrimitive.Viewport
+ data-slot="drawer-viewport"
+ data-modal={modal}
+ className="pointer-events-none fixed inset-0 z-50 select-none data-[modal=true]:pointer-events-auto"
>
- <div className="bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block" />
- {children}
- </DrawerPrimitive.Content>
+ <DrawerPrimitive.Popup
+ data-slot="drawer-popup"
+ data-swipe-axis={swipeAxis}
+ data-snap-points={hasSnapPoints ? "" : undefined}
+ className={cn(
+ // Base.
+ "group/drawer-popup pointer-events-auto fixed z-50 m-(--drawer-inset,0px) flex h-(--drawer-content-height) max-h-(--drawer-content-max-height,none) min-h-0 w-(--drawer-content-width,auto) transform-[translate3d(var(--translate-x,0px),var(--translate-y,0px),0)_scale(var(--stack-scale))] flex-col bg-popover text-sm text-popover-foreground transition-[transform,height,opacity,filter] duration-450 ease-[cubic-bezier(0.22,1,0.36,1)] will-change-transform outline-none select-none [interpolate-size:allow-keywords] data-[swipe-direction=down]:rounded-t-xl data-[swipe-direction=down]:border-t data-[swipe-direction=left]:rounded-r-xl data-[swipe-direction=left]:border-r data-[swipe-direction=right]:rounded-l-xl data-[swipe-direction=right]:border-l data-[swipe-direction=up]:rounded-b-xl data-[swipe-direction=up]:border-b",
+ // Nested.
+ "data-nested-drawer-open:overflow-hidden data-nested-drawer-open:brightness-95",
+ // Bleed.
+ "after:pointer-events-none after:absolute after:bg-(--drawer-bleed-background,var(--color-popover)) data-[swipe-axis=x]:after:inset-y-0 data-[swipe-axis=x]:after:w-(--bleed) data-[swipe-axis=y]:after:inset-x-0 data-[swipe-axis=y]:after:h-(--bleed) data-[swipe-direction=down]:after:top-full data-[swipe-direction=left]:after:right-full data-[swipe-direction=right]:after:left-full data-[swipe-direction=up]:after:bottom-full",
+ // Sizing.
+ "[--drawer-content-height:var(--drawer-height,auto)] data-[swipe-axis=x]:[--drawer-content-width:75%] data-[swipe-axis=y]:[--drawer-content-max-height:calc(100dvh-6rem)] data-[swipe-axis=y]:data-snap-points:[--drawer-content-height:100dvh] data-[swipe-axis=x]:sm:[--drawer-content-width:24rem]",
+ // Stack.
+ "[--bleed:3rem] [--peek:1rem] [--stack-height:var(--drawer-frontmost-height,var(--drawer-height,0px))] [--stack-peek-offset:max(0px,calc((var(--nested-drawers)-var(--stack-progress))*var(--peek)))] [--stack-progress:clamp(0,var(--drawer-swipe-progress),1)] [--stack-scale-base:max(0,calc(1-(var(--nested-drawers)*var(--stack-step))))] [--stack-scale:clamp(0,calc(var(--stack-scale-base)+(var(--stack-step)*var(--stack-progress))),1)] [--stack-shrink:calc(1-var(--stack-scale))] [--stack-step:0.05]",
+ // Transitions.
+ "data-ending-style:transform-(--closed-transform) data-ending-style:opacity-[0.9999] data-ending-style:duration-[calc(var(--drawer-swipe-strength)*400ms)] data-nested-drawer-swiping:duration-0 data-ending-style:data-nested-drawer-swiping:duration-[calc(var(--drawer-swipe-strength)*400ms)] data-starting-style:transform-(--closed-transform) data-swiping:duration-0 data-ending-style:data-swiping:duration-[calc(var(--drawer-swipe-strength)*400ms)]",
+ // Axis: y.
+ "data-[swipe-axis=y]:inset-x-0 data-[swipe-axis=y]:data-nested-drawer-open:h-(--stack-height)",
+ // Axis: x.
+ "data-[swipe-axis=x]:inset-y-0 data-[swipe-axis=x]:flex-row",
+ // Direction: down.
+ "data-[swipe-direction=down]:bottom-0 data-[swipe-direction=down]:origin-bottom data-[swipe-direction=down]:[--closed-transform:translate3d(0,calc(100%+var(--drawer-inset,0px)+2px),0)] data-[swipe-direction=down]:[--translate-y:calc(var(--drawer-snap-point-offset,0px)+var(--drawer-swipe-movement-y)-var(--stack-peek-offset)-(var(--stack-shrink)*var(--stack-height)))]",
+ // Direction: up.
+ "data-[swipe-direction=up]:top-0 data-[swipe-direction=up]:origin-top data-[swipe-direction=up]:[--closed-transform:translate3d(0,calc(-100%-var(--drawer-inset,0px)-2px),0)] data-[swipe-direction=up]:[--translate-y:calc(var(--drawer-snap-point-offset,0px)+var(--drawer-swipe-movement-y)+var(--stack-peek-offset)+(var(--stack-shrink)*var(--stack-height)))]",
+ // Direction: left.
+ "data-[swipe-direction=left]:left-0 data-[swipe-direction=left]:origin-left data-[swipe-direction=left]:[--closed-transform:translate3d(calc(-100%-var(--drawer-inset,0px)-2px),0,0)] data-[swipe-direction=left]:[--translate-x:calc(var(--drawer-swipe-movement-x)+var(--stack-peek-offset)+(var(--stack-shrink)*100%))]",
+ // Direction: right.
+ "data-[swipe-direction=right]:right-0 data-[swipe-direction=right]:origin-right data-[swipe-direction=right]:[--closed-transform:translate3d(calc(100%+var(--drawer-inset,0px)+2px),0,0)] data-[swipe-direction=right]:[--translate-x:calc(var(--drawer-swipe-movement-x)-var(--stack-peek-offset)-(var(--stack-shrink)*100%))]",
+ className
+ )}
+ {...props}
+ >
+ {showSwipeHandle && <DrawerSwipeHandle />}
+ <DrawerPrimitive.Content
+ data-slot="drawer-content"
+ className={cn(
+ "flex min-h-0 flex-1 flex-col overflow-hidden overscroll-contain rounded-[inherit] transition-opacity duration-300 ease-[cubic-bezier(0.45,1.005,0,1.005)] select-text group-data-nested-drawer-open/drawer-popup:opacity-0 group-data-nested-drawer-swiping/drawer-popup:opacity-100 group-data-swiping/drawer-popup:select-none"
+ )}
+ >
+ {children}
+ </DrawerPrimitive.Content>
+ </DrawerPrimitive.Popup>
+ </DrawerPrimitive.Viewport>
</DrawerPortal>
)
}
@@ -75,7 +168,7 @@ function DrawerHeader({ className, ...props }: React.ComponentProps<"div">) {
<div
data-slot="drawer-header"
className={cn(
- "flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left",
+ "flex shrink-0 flex-col gap-0.5 p-4 pb-0 group-data-[swipe-axis=y]/drawer-popup:text-center md:gap-1.5 md:text-left",
className
)}
{...props}
@@ -87,20 +180,17 @@ function DrawerFooter({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
data-slot="drawer-footer"
- className={cn("mt-auto flex flex-col gap-2 p-4", className)}
+ className={cn("mt-auto flex shrink-0 flex-col gap-2 p-4 pt-0", className)}
{...props}
/>
)
}
-function DrawerTitle({
- className,
- ...props
-}: React.ComponentProps<typeof DrawerPrimitive.Title>) {
+function DrawerTitle({ className, ...props }: DrawerPrimitive.Title.Props) {
return (
<DrawerPrimitive.Title
data-slot="drawer-title"
- className={cn("text-foreground font-semibold", className)}
+ className={cn("cn-font-heading font-medium text-foreground", className)}
{...props}
/>
)
@@ -109,11 +199,11 @@ function DrawerTitle({
function DrawerDescription({
className,
...props
-}: React.ComponentProps<typeof DrawerPrimitive.Description>) {
+}: DrawerPrimitive.Description.Props) {
return (
<DrawerPrimitive.Description
data-slot="drawer-description"
- className={cn("text-muted-foreground text-sm", className)}
+ className={cn("text-sm text-balance text-muted-foreground", className)}
{...props}
/>
)
@@ -123,6 +213,7 @@ export {
Drawer,
DrawerPortal,
DrawerOverlay,
+ DrawerSwipeHandle,
DrawerTrigger,
DrawerClose,
DrawerContent,
diff --git a/src/components/ui/dropdown-menu.tsx b/src/components/ui/dropdown-menu.tsx
index 0d6741b4..83e06055 100644
--- a/src/components/ui/dropdown-menu.tsx
+++ b/src/components/ui/dropdown-menu.tsx
@@ -1,59 +1,78 @@
-import * as React from "react"
-import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu"
-import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react"
+"use client"
+import * as React from "react"
+import { Menu as MenuPrimitive } from "@base-ui/react/menu"
import { cn } from "@/lib/utils"
-function DropdownMenu({
- ...props
-}: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {
- return <DropdownMenuPrimitive.Root data-slot="dropdown-menu" {...props} />
+import { CheckIcon, ChevronRightIcon } from "lucide-react"
+
+function DropdownMenu({ ...props }: MenuPrimitive.Root.Props) {
+ return <MenuPrimitive.Root data-slot="dropdown-menu" {...props} />
}
-function DropdownMenuPortal({
- ...props
-}: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {
- return (
- <DropdownMenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props} />
- )
+function DropdownMenuPortal({ ...props }: MenuPrimitive.Portal.Props) {
+ return <MenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props} />
}
-function DropdownMenuTrigger({
- ...props
-}: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {
- return (
- <DropdownMenuPrimitive.Trigger
- data-slot="dropdown-menu-trigger"
- {...props}
- />
- )
+function DropdownMenuTrigger({ ...props }: MenuPrimitive.Trigger.Props) {
+ return <MenuPrimitive.Trigger data-slot="dropdown-menu-trigger" {...props} />
}
function DropdownMenuContent({
- className,
+ align = "start",
+ alignOffset = 0,
+ side = "bottom",
sideOffset = 4,
+ className,
...props
-}: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) {
+}: MenuPrimitive.Popup.Props &
+ Pick<
+ MenuPrimitive.Positioner.Props,
+ "align" | "alignOffset" | "side" | "sideOffset"
+ >) {
return (
- <DropdownMenuPrimitive.Portal>
- <DropdownMenuPrimitive.Content
- data-slot="dropdown-menu-content"
+ <MenuPrimitive.Portal>
+ <MenuPrimitive.Positioner
+ className="isolate z-50 outline-none"
+ align={align}
+ alignOffset={alignOffset}
+ side={side}
sideOffset={sideOffset}
- className={cn(
- "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",
- className
- )}
- {...props}
- />
- </DropdownMenuPrimitive.Portal>
+ >
+ <MenuPrimitive.Popup
+ data-slot="dropdown-menu-content"
+ className={cn(
+ "cn-menu-target cn-menu-translucent z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95",
+ className
+ )}
+ {...props}
+ />
+ </MenuPrimitive.Positioner>
+ </MenuPrimitive.Portal>
)
}
-function DropdownMenuGroup({
+function DropdownMenuGroup({ ...props }: MenuPrimitive.Group.Props) {
+ return <MenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />
+}
+
+function DropdownMenuLabel({
+ className,
+ inset,
...props
-}: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {
+}: MenuPrimitive.GroupLabel.Props & {
+ inset?: boolean
+}) {
return (
- <DropdownMenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />
+ <MenuPrimitive.GroupLabel
+ data-slot="dropdown-menu-label"
+ data-inset={inset}
+ className={cn(
+ "px-2 py-1.5 text-xs font-medium text-muted-foreground data-inset:pl-8",
+ className
+ )}
+ {...props}
+ />
)
}
@@ -62,17 +81,17 @@ function DropdownMenuItem({
inset,
variant = "default",
...props
-}: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
+}: MenuPrimitive.Item.Props & {
inset?: boolean
variant?: "default" | "destructive"
}) {
return (
- <DropdownMenuPrimitive.Item
+ <MenuPrimitive.Item
data-slot="dropdown-menu-item"
data-inset={inset}
data-variant={variant}
className={cn(
- "focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
+ "group/dropdown-menu-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",
className
)}
{...props}
@@ -80,95 +99,139 @@ function DropdownMenuItem({
)
}
-function DropdownMenuCheckboxItem({
+function DropdownMenuSub({ ...props }: MenuPrimitive.SubmenuRoot.Props) {
+ return <MenuPrimitive.SubmenuRoot data-slot="dropdown-menu-sub" {...props} />
+}
+
+function DropdownMenuSubTrigger({
className,
+ inset,
children,
- checked,
...props
-}: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) {
+}: MenuPrimitive.SubmenuTrigger.Props & {
+ inset?: boolean
+}) {
return (
- <DropdownMenuPrimitive.CheckboxItem
- data-slot="dropdown-menu-checkbox-item"
+ <MenuPrimitive.SubmenuTrigger
+ data-slot="dropdown-menu-sub-trigger"
+ data-inset={inset}
className={cn(
- "focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
+ "flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-8 data-popup-open:bg-accent data-popup-open:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
className
)}
- checked={checked}
{...props}
>
- <span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
- <DropdownMenuPrimitive.ItemIndicator>
- <CheckIcon className="size-4" />
- </DropdownMenuPrimitive.ItemIndicator>
- </span>
{children}
- </DropdownMenuPrimitive.CheckboxItem>
+ <ChevronRightIcon className="cn-rtl-flip ml-auto" />
+ </MenuPrimitive.SubmenuTrigger>
)
}
-function DropdownMenuRadioGroup({
+function DropdownMenuSubContent({
+ align = "start",
+ alignOffset = -3,
+ side = "right",
+ sideOffset = 0,
+ className,
...props
-}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {
+}: React.ComponentProps<typeof DropdownMenuContent>) {
return (
- <DropdownMenuPrimitive.RadioGroup
- data-slot="dropdown-menu-radio-group"
+ <DropdownMenuContent
+ data-slot="dropdown-menu-sub-content"
+ className={cn(
+ "cn-menu-target cn-menu-translucent w-auto min-w-[96px] rounded-md bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
+ className
+ )}
+ align={align}
+ alignOffset={alignOffset}
+ side={side}
+ sideOffset={sideOffset}
{...props}
/>
)
}
-function DropdownMenuRadioItem({
+function DropdownMenuCheckboxItem({
className,
children,
+ checked,
+ inset,
...props
-}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {
+}: MenuPrimitive.CheckboxItem.Props & {
+ inset?: boolean
+}) {
return (
- <DropdownMenuPrimitive.RadioItem
- data-slot="dropdown-menu-radio-item"
+ <MenuPrimitive.CheckboxItem
+ data-slot="dropdown-menu-checkbox-item"
+ data-inset={inset}
className={cn(
- "focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
+ "relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-8 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
className
)}
+ checked={checked}
{...props}
>
- <span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
- <DropdownMenuPrimitive.ItemIndicator>
- <CircleIcon className="size-2 fill-current" />
- </DropdownMenuPrimitive.ItemIndicator>
+ <span
+ className="pointer-events-none absolute right-2 flex items-center justify-center"
+ data-slot="dropdown-menu-checkbox-item-indicator"
+ >
+ <MenuPrimitive.CheckboxItemIndicator>
+ <CheckIcon />
+ </MenuPrimitive.CheckboxItemIndicator>
</span>
{children}
- </DropdownMenuPrimitive.RadioItem>
+ </MenuPrimitive.CheckboxItem>
)
}
-function DropdownMenuLabel({
+function DropdownMenuRadioGroup({ ...props }: MenuPrimitive.RadioGroup.Props) {
+ return (
+ <MenuPrimitive.RadioGroup
+ data-slot="dropdown-menu-radio-group"
+ {...props}
+ />
+ )
+}
+
+function DropdownMenuRadioItem({
className,
+ children,
inset,
...props
-}: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
+}: MenuPrimitive.RadioItem.Props & {
inset?: boolean
}) {
return (
- <DropdownMenuPrimitive.Label
- data-slot="dropdown-menu-label"
+ <MenuPrimitive.RadioItem
+ data-slot="dropdown-menu-radio-item"
data-inset={inset}
className={cn(
- "px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",
+ "relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-8 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
className
)}
{...props}
- />
+ >
+ <span
+ className="pointer-events-none absolute right-2 flex items-center justify-center"
+ data-slot="dropdown-menu-radio-item-indicator"
+ >
+ <MenuPrimitive.RadioItemIndicator>
+ <CheckIcon />
+ </MenuPrimitive.RadioItemIndicator>
+ </span>
+ {children}
+ </MenuPrimitive.RadioItem>
)
}
function DropdownMenuSeparator({
className,
...props
-}: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {
+}: MenuPrimitive.Separator.Props) {
return (
- <DropdownMenuPrimitive.Separator
+ <MenuPrimitive.Separator
data-slot="dropdown-menu-separator"
- className={cn("bg-border -mx-1 my-1 h-px", className)}
+ className={cn("-mx-1 my-1 h-px bg-border", className)}
{...props}
/>
)
@@ -182,53 +245,7 @@ function DropdownMenuShortcut({
<span
data-slot="dropdown-menu-shortcut"
className={cn(
- "text-muted-foreground ml-auto text-xs tracking-widest",
- className
- )}
- {...props}
- />
- )
-}
-
-function DropdownMenuSub({
- ...props
-}: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {
- return <DropdownMenuPrimitive.Sub data-slot="dropdown-menu-sub" {...props} />
-}
-
-function DropdownMenuSubTrigger({
- className,
- inset,
- children,
- ...props
-}: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
- inset?: boolean
-}) {
- return (
- <DropdownMenuPrimitive.SubTrigger
- data-slot="dropdown-menu-sub-trigger"
- data-inset={inset}
- className={cn(
- "focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",
- className
- )}
- {...props}
- >
- {children}
- <ChevronRightIcon className="ml-auto size-4" />
- </DropdownMenuPrimitive.SubTrigger>
- )
-}
-
-function DropdownMenuSubContent({
- className,
- ...props
-}: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {
- return (
- <DropdownMenuPrimitive.SubContent
- data-slot="dropdown-menu-sub-content"
- className={cn(
- "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",
+ "ml-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground",
className
)}
{...props}
diff --git a/src/components/ui/input-group.tsx b/src/components/ui/input-group.tsx
new file mode 100644
index 00000000..2f244c5b
--- /dev/null
+++ b/src/components/ui/input-group.tsx
@@ -0,0 +1,158 @@
+"use client"
+
+import * as React from "react"
+import { cva, type VariantProps } from "class-variance-authority"
+import { cn } from "@/lib/utils"
+
+import { Button } from "@/components/ui/button"
+import { Input } from "@/components/ui/input"
+import { Textarea } from "@/components/ui/textarea"
+
+function InputGroup({ className, ...props }: React.ComponentProps<"div">) {
+ return (
+ <div
+ data-slot="input-group"
+ role="group"
+ className={cn(
+ "group/input-group relative flex h-9 w-full min-w-0 items-center rounded-md border border-input shadow-xs transition-[color,box-shadow] outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5",
+ className
+ )}
+ {...props}
+ />
+ )
+}
+
+const inputGroupAddonVariants = cva(
+ "flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",
+ {
+ variants: {
+ align: {
+ "inline-start":
+ "order-first pl-2 has-[>button]:-ml-1 has-[>kbd]:ml-[-0.15rem]",
+ "inline-end":
+ "order-last pr-2 has-[>button]:-mr-1 has-[>kbd]:mr-[-0.15rem]",
+ "block-start":
+ "order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2",
+ "block-end":
+ "order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2",
+ },
+ },
+ defaultVariants: {
+ align: "inline-start",
+ },
+ }
+)
+
+function InputGroupAddon({
+ className,
+ align = "inline-start",
+ ...props
+}: React.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>) {
+ return (
+ <div
+ role="group"
+ data-slot="input-group-addon"
+ data-align={align}
+ className={cn(inputGroupAddonVariants({ align }), className)}
+ onClick={(e) => {
+ if ((e.target as HTMLElement).closest("button")) {
+ return
+ }
+ e.currentTarget.parentElement?.querySelector("input")?.focus()
+ }}
+ {...props}
+ />
+ )
+}
+
+const inputGroupButtonVariants = cva(
+ "flex items-center gap-2 text-sm shadow-none",
+ {
+ variants: {
+ size: {
+ xs: "h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5",
+ sm: "",
+ "icon-xs":
+ "size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0",
+ "icon-sm": "size-8 p-0 has-[>svg]:p-0",
+ },
+ },
+ defaultVariants: {
+ size: "xs",
+ },
+ }
+)
+
+function InputGroupButton({
+ className,
+ type = "button",
+ variant = "ghost",
+ size = "xs",
+ ...props
+}: Omit<React.ComponentProps<typeof Button>, "size" | "type"> &
+ VariantProps<typeof inputGroupButtonVariants> & {
+ type?: "button" | "submit" | "reset"
+ }) {
+ return (
+ <Button
+ type={type}
+ data-size={size}
+ variant={variant}
+ className={cn(inputGroupButtonVariants({ size }), className)}
+ {...props}
+ />
+ )
+}
+
+function InputGroupText({ className, ...props }: React.ComponentProps<"span">) {
+ return (
+ <span
+ className={cn(
+ "flex items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
+ className
+ )}
+ {...props}
+ />
+ )
+}
+
+function InputGroupInput({
+ className,
+ ...props
+}: React.ComponentProps<"input">) {
+ return (
+ <Input
+ data-slot="input-group-control"
+ className={cn(
+ "flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent",
+ className
+ )}
+ {...props}
+ />
+ )
+}
+
+function InputGroupTextarea({
+ className,
+ ...props
+}: React.ComponentProps<"textarea">) {
+ return (
+ <Textarea
+ data-slot="input-group-control"
+ className={cn(
+ "flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent",
+ className
+ )}
+ {...props}
+ />
+ )
+}
+
+export {
+ InputGroup,
+ InputGroupAddon,
+ InputGroupButton,
+ InputGroupText,
+ InputGroupInput,
+ InputGroupTextarea,
+}
diff --git a/src/components/ui/input.tsx b/src/components/ui/input.tsx
index a0c930e5..267f6a31 100644
--- a/src/components/ui/input.tsx
+++ b/src/components/ui/input.tsx
@@ -1,16 +1,14 @@
import * as React from "react"
-
+import { Input as InputPrimitive } from "@base-ui/react/input"
import { cn } from "@/lib/utils"
function Input({ className, type, ...props }: React.ComponentProps<"input">) {
return (
- <input
+ <InputPrimitive
type={type}
data-slot="input"
className={cn(
- "file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 text-sm",
- "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
- "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
+ "h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-2.5 py-1 text-sm shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",
className
)}
{...props}
diff --git a/src/components/ui/item.tsx b/src/components/ui/item.tsx
index d97de21e..a932752d 100644
--- a/src/components/ui/item.tsx
+++ b/src/components/ui/item.tsx
@@ -1,8 +1,9 @@
import * as React from "react"
-import { Slot } from "@radix-ui/react-slot"
+import { mergeProps } from "@base-ui/react/merge-props"
+import { useRender } from "@base-ui/react/use-render"
import { cva, type VariantProps } from "class-variance-authority"
-
import { cn } from "@/lib/utils"
+
import { Separator } from "@/components/ui/separator"
function ItemGroup({ className, ...props }: React.ComponentProps<"div">) {
@@ -10,7 +11,10 @@ function ItemGroup({ className, ...props }: React.ComponentProps<"div">) {
<div
role="list"
data-slot="item-group"
- className={cn("group/item-group flex flex-col", className)}
+ className={cn(
+ "group/item-group flex w-full flex-col gap-4 has-data-[size=sm]:gap-2.5 has-data-[size=xs]:gap-2",
+ className
+ )}
{...props}
/>
)
@@ -24,24 +28,25 @@ function ItemSeparator({
<Separator
data-slot="item-separator"
orientation="horizontal"
- className={cn("my-0", className)}
+ className={cn("my-2", className)}
{...props}
/>
)
}
const itemVariants = cva(
- "group/item flex items-center border border-transparent text-sm rounded-md transition-colors [a]:hover:bg-accent/50 [a]:transition-colors duration-100 flex-wrap outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
+ "group/item flex w-full flex-wrap items-center rounded-md border text-sm transition-colors duration-100 outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 [a]:transition-colors [a]:hover:bg-muted",
{
variants: {
variant: {
- default: "bg-transparent",
+ default: "border-transparent",
outline: "border-border",
- muted: "bg-muted/50",
+ muted: "border-transparent bg-muted/50",
},
size: {
- default: "p-4 gap-4 ",
- sm: "py-3 px-4 gap-2.5",
+ default: "gap-3.5 px-4 py-3.5",
+ sm: "gap-2.5 px-3 py-2.5",
+ xs: "gap-2 px-2.5 py-2 in-data-[slot=dropdown-menu-content]:p-0",
},
},
defaultVariants: {
@@ -55,31 +60,35 @@ function Item({
className,
variant = "default",
size = "default",
- asChild = false,
+ render,
...props
-}: React.ComponentProps<"div"> &
- VariantProps<typeof itemVariants> & { asChild?: boolean }) {
- const Comp = asChild ? Slot : "div"
- return (
- <Comp
- data-slot="item"
- data-variant={variant}
- data-size={size}
- className={cn(itemVariants({ variant, size, className }))}
- {...props}
- />
- )
+}: useRender.ComponentProps<"div"> & VariantProps<typeof itemVariants>) {
+ return useRender({
+ defaultTagName: "div",
+ props: mergeProps<"div">(
+ {
+ className: cn(itemVariants({ variant, size, className })),
+ },
+ props
+ ),
+ render,
+ state: {
+ slot: "item",
+ variant,
+ size,
+ },
+ })
}
const itemMediaVariants = cva(
- "flex shrink-0 items-center justify-center gap-2 group-has-[[data-slot=item-description]]/item:self-start [&_svg]:pointer-events-none group-has-[[data-slot=item-description]]/item:translate-y-0.5",
+ "flex shrink-0 items-center justify-center gap-2 group-has-data-[slot=item-description]/item:translate-y-0.5 group-has-data-[slot=item-description]/item:self-start [&_svg]:pointer-events-none",
{
variants: {
variant: {
default: "bg-transparent",
- icon: "size-8 border rounded-sm bg-muted [&_svg:not([class*='size-'])]:size-4",
+ icon: "[&_svg:not([class*='size-'])]:size-4",
image:
- "size-10 rounded-sm overflow-hidden [&_img]:size-full [&_img]:object-cover",
+ "size-10 overflow-hidden rounded-sm group-data-[size=sm]/item:size-8 group-data-[size=xs]/item:size-6 [&_img]:size-full [&_img]:object-cover",
},
},
defaultVariants: {
@@ -108,7 +117,7 @@ function ItemContent({ className, ...props }: React.ComponentProps<"div">) {
<div
data-slot="item-content"
className={cn(
- "flex flex-1 flex-col gap-1 [&+[data-slot=item-content]]:flex-none",
+ "flex flex-1 flex-col gap-1 group-data-[size=xs]/item:gap-0 [&+[data-slot=item-content]]:flex-none",
className
)}
{...props}
@@ -121,7 +130,7 @@ function ItemTitle({ className, ...props }: React.ComponentProps<"div">) {
<div
data-slot="item-title"
className={cn(
- "flex w-fit items-center gap-2 text-sm leading-snug font-medium",
+ "line-clamp-1 flex w-fit items-center gap-2 text-sm leading-snug font-medium underline-offset-4",
className
)}
{...props}
@@ -134,8 +143,7 @@ function ItemDescription({ className, ...props }: React.ComponentProps<"p">) {
<p
data-slot="item-description"
className={cn(
- "text-muted-foreground line-clamp-2 text-sm leading-normal font-normal text-balance",
- "[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",
+ "line-clamp-2 text-left text-sm leading-normal font-normal text-muted-foreground group-data-[size=xs]/item:text-xs [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",
className
)}
{...props}
diff --git a/src/components/ui/label.tsx b/src/components/ui/label.tsx
index 5b899d89..b14a8928 100644
--- a/src/components/ui/label.tsx
+++ b/src/components/ui/label.tsx
@@ -1,19 +1,14 @@
"use client"
import * as React from "react"
-import * as LabelPrimitive from "@radix-ui/react-label"
-
import { cn } from "@/lib/utils"
-function Label({
- className,
- ...props
-}: React.ComponentProps<typeof LabelPrimitive.Root>) {
+function Label({ className, ...props }: React.ComponentProps<"label">) {
return (
- <LabelPrimitive.Root
+ <label
data-slot="label"
className={cn(
- "flex items-center gap-2 text-sm leading-none font-medium select-none text-muted-foreground group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
+ "flex items-center gap-2 text-sm leading-none font-medium text-muted-foreground select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
className
)}
{...props}
diff --git a/src/components/ui/navigation-menu.tsx b/src/components/ui/navigation-menu.tsx
index 0a673f51..a8eef378 100644
--- a/src/components/ui/navigation-menu.tsx
+++ b/src/components/ui/navigation-menu.tsx
@@ -1,22 +1,19 @@
-import * as React from "react"
+import { NavigationMenu as NavigationMenuPrimitive } from "@base-ui/react/navigation-menu"
import { cva } from "class-variance-authority"
-import { ChevronDownIcon } from "lucide-react"
-import { NavigationMenu as NavigationMenuPrimitive } from "radix-ui"
-
import { cn } from "@/lib/utils"
+import { ChevronDownIcon } from "lucide-react"
+
function NavigationMenu({
+ align = "start",
className,
children,
- viewport = true,
...props
-}: React.ComponentProps<typeof NavigationMenuPrimitive.Root> & {
- viewport?: boolean
-}) {
+}: NavigationMenuPrimitive.Root.Props &
+ Pick<NavigationMenuPrimitive.Positioner.Props, "align">) {
return (
<NavigationMenuPrimitive.Root
data-slot="navigation-menu"
- data-viewport={viewport}
className={cn(
"group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",
className
@@ -24,7 +21,7 @@ function NavigationMenu({
{...props}
>
{children}
- {viewport && <NavigationMenuViewport />}
+ <NavigationMenuPositioner align={align} />
</NavigationMenuPrimitive.Root>
)
}
@@ -32,12 +29,12 @@ function NavigationMenu({
function NavigationMenuList({
className,
...props
-}: React.ComponentProps<typeof NavigationMenuPrimitive.List>) {
+}: React.ComponentPropsWithRef<typeof NavigationMenuPrimitive.List>) {
return (
<NavigationMenuPrimitive.List
data-slot="navigation-menu-list"
className={cn(
- "group flex flex-1 list-none items-center justify-center gap-1",
+ "group flex flex-1 list-none items-center justify-center gap-0",
className
)}
{...props}
@@ -48,7 +45,7 @@ function NavigationMenuList({
function NavigationMenuItem({
className,
...props
-}: React.ComponentProps<typeof NavigationMenuPrimitive.Item>) {
+}: React.ComponentPropsWithRef<typeof NavigationMenuPrimitive.Item>) {
return (
<NavigationMenuPrimitive.Item
data-slot="navigation-menu-item"
@@ -59,14 +56,14 @@ function NavigationMenuItem({
}
const navigationMenuTriggerStyle = cva(
- "group inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-[color,box-shadow] outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=open]:bg-accent/50 data-[state=open]:text-accent-foreground data-[state=open]:hover:bg-accent data-[state=open]:focus:bg-accent"
+ "group/navigation-menu-trigger inline-flex h-9 w-max items-center justify-center rounded-md px-4 py-2 text-sm font-medium transition-all outline-none hover:bg-muted focus:bg-muted focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-popup-open:bg-muted/50 data-popup-open:hover:bg-muted data-open:bg-muted/50 data-open:hover:bg-muted data-open:focus:bg-muted"
)
function NavigationMenuTrigger({
className,
children,
...props
-}: React.ComponentProps<typeof NavigationMenuPrimitive.Trigger>) {
+}: NavigationMenuPrimitive.Trigger.Props) {
return (
<NavigationMenuPrimitive.Trigger
data-slot="navigation-menu-trigger"
@@ -75,7 +72,7 @@ function NavigationMenuTrigger({
>
{children}{" "}
<ChevronDownIcon
- className="relative top-[1px] ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180"
+ className="relative top-px ml-1 size-3 transition duration-300 group-data-popup-open/navigation-menu-trigger:rotate-180 group-data-open/navigation-menu-trigger:rotate-180"
aria-hidden="true"
/>
</NavigationMenuPrimitive.Trigger>
@@ -85,13 +82,12 @@ function NavigationMenuTrigger({
function NavigationMenuContent({
className,
...props
-}: React.ComponentProps<typeof NavigationMenuPrimitive.Content>) {
+}: NavigationMenuPrimitive.Content.Props) {
return (
<NavigationMenuPrimitive.Content
data-slot="navigation-menu-content"
className={cn(
- "top-0 left-0 w-full p-2 pr-2.5 data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 data-[motion^=from-]:animate-in data-[motion^=from-]:fade-in data-[motion^=to-]:animate-out data-[motion^=to-]:fade-out md:absolute md:w-auto",
- "group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:mt-1.5 group-data-[viewport=false]/navigation-menu:overflow-hidden group-data-[viewport=false]/navigation-menu:rounded-md group-data-[viewport=false]/navigation-menu:border group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:shadow group-data-[viewport=false]/navigation-menu:duration-200 **:data-[slot=navigation-menu-link]:focus:ring-0 **:data-[slot=navigation-menu-link]:focus:outline-none group-data-[viewport=false]/navigation-menu:data-[state=closed]:animate-out group-data-[viewport=false]/navigation-menu:data-[state=closed]:fade-out-0 group-data-[viewport=false]/navigation-menu:data-[state=closed]:zoom-out-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:animate-in group-data-[viewport=false]/navigation-menu:data-[state=open]:fade-in-0 group-data-[viewport=false]/navigation-menu:data-[state=open]:zoom-in-95",
+ "data-ending-style:data-activation-direction=left:translate-x-[50%] data-ending-style:data-activation-direction=right:translate-x-[-50%] data-starting-style:data-activation-direction=left:translate-x-[-50%] data-starting-style:data-activation-direction=right:translate-x-[50%] h-full w-auto p-2 pr-2.5 transition-[opacity,transform,translate] duration-[0.35s] ease-[cubic-bezier(0.22,1,0.36,1)] group-data-[viewport=false]/navigation-menu:rounded-md group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:shadow group-data-[viewport=false]/navigation-menu:ring-1 group-data-[viewport=false]/navigation-menu:ring-foreground/10 group-data-[viewport=false]/navigation-menu:duration-300 data-ending-style:opacity-0 data-starting-style:opacity-0 data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 data-[motion^=from-]:animate-in data-[motion^=from-]:fade-in data-[motion^=to-]:animate-out data-[motion^=to-]:fade-out **:data-[slot=navigation-menu-link]:focus:ring-0 **:data-[slot=navigation-menu-link]:focus:outline-none group-data-[viewport=false]/navigation-menu:data-open:animate-in group-data-[viewport=false]/navigation-menu:data-open:fade-in-0 group-data-[viewport=false]/navigation-menu:data-open:zoom-in-95 group-data-[viewport=false]/navigation-menu:data-closed:animate-out group-data-[viewport=false]/navigation-menu:data-closed:fade-out-0 group-data-[viewport=false]/navigation-menu:data-closed:zoom-out-95",
className
)}
{...props}
@@ -99,37 +95,44 @@ function NavigationMenuContent({
)
}
-function NavigationMenuViewport({
+function NavigationMenuPositioner({
className,
+ side = "bottom",
+ sideOffset = 8,
+ align = "start",
+ alignOffset = 0,
...props
-}: React.ComponentProps<typeof NavigationMenuPrimitive.Viewport>) {
+}: NavigationMenuPrimitive.Positioner.Props) {
return (
- <div
- className={cn(
- "absolute top-full left-0 isolate z-50 flex justify-center"
- )}
- >
- <NavigationMenuPrimitive.Viewport
- data-slot="navigation-menu-viewport"
+ <NavigationMenuPrimitive.Portal>
+ <NavigationMenuPrimitive.Positioner
+ side={side}
+ sideOffset={sideOffset}
+ align={align}
+ alignOffset={alignOffset}
className={cn(
- "origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",
+ "isolate z-50 h-(--positioner-height) w-(--positioner-width) max-w-(--available-width) transition-[top,left,right,bottom] duration-[0.35s] ease-[cubic-bezier(0.22,1,0.36,1)] data-instant:transition-none data-[side=bottom]:before:top-[-10px] data-[side=bottom]:before:right-0 data-[side=bottom]:before:left-0",
className
)}
{...props}
- />
- </div>
+ >
+ <NavigationMenuPrimitive.Popup className="data-[ending-style]:easing-[ease] xs:w-(--popup-width) relative h-(--popup-height) w-(--popup-width) origin-(--transform-origin) rounded-lg bg-popover text-popover-foreground shadow ring-1 ring-foreground/10 transition-[opacity,transform,width,height,scale,translate] duration-[0.35s] ease-[cubic-bezier(0.22,1,0.36,1)] outline-none data-ending-style:scale-90 data-ending-style:opacity-0 data-ending-style:duration-150 data-starting-style:scale-90 data-starting-style:opacity-0">
+ <NavigationMenuPrimitive.Viewport className="relative size-full overflow-hidden" />
+ </NavigationMenuPrimitive.Popup>
+ </NavigationMenuPrimitive.Positioner>
+ </NavigationMenuPrimitive.Portal>
)
}
function NavigationMenuLink({
className,
...props
-}: React.ComponentProps<typeof NavigationMenuPrimitive.Link>) {
+}: NavigationMenuPrimitive.Link.Props) {
return (
<NavigationMenuPrimitive.Link
data-slot="navigation-menu-link"
className={cn(
- "flex flex-col gap-1 rounded-sm p-2 text-sm transition-all outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 data-[active=true]:bg-accent/50 data-[active=true]:text-accent-foreground data-[active=true]:hover:bg-accent data-[active=true]:focus:bg-accent [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",
+ "flex items-center gap-1.5 rounded-md p-2 text-sm transition-all outline-none hover:bg-muted focus:bg-muted focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:outline-1 in-data-[slot=navigation-menu-content]:rounded-sm data-[active=true]:bg-muted/50 data-[active=true]:hover:bg-muted data-[active=true]:focus:bg-muted [&_svg:not([class*='size-'])]:size-4",
className
)}
{...props}
@@ -140,29 +143,29 @@ function NavigationMenuLink({
function NavigationMenuIndicator({
className,
...props
-}: React.ComponentProps<typeof NavigationMenuPrimitive.Indicator>) {
+}: React.ComponentPropsWithRef<typeof NavigationMenuPrimitive.Icon>) {
return (
- <NavigationMenuPrimitive.Indicator
+ <NavigationMenuPrimitive.Icon
data-slot="navigation-menu-indicator"
className={cn(
- "top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:animate-in data-[state=visible]:fade-in",
+ "top-full z-1 flex h-1.5 items-end justify-center overflow-hidden data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:animate-in data-[state=visible]:fade-in",
className
)}
{...props}
>
<div className="relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md" />
- </NavigationMenuPrimitive.Indicator>
+ </NavigationMenuPrimitive.Icon>
)
}
export {
NavigationMenu,
- NavigationMenuList,
- NavigationMenuItem,
NavigationMenuContent,
- NavigationMenuTrigger,
- NavigationMenuLink,
NavigationMenuIndicator,
- NavigationMenuViewport,
+ NavigationMenuItem,
+ NavigationMenuLink,
+ NavigationMenuList,
+ NavigationMenuTrigger,
navigationMenuTriggerStyle,
+ NavigationMenuPositioner,
}
diff --git a/src/components/ui/pagination.tsx b/src/components/ui/pagination.tsx
index 0d185410..b577096c 100644
--- a/src/components/ui/pagination.tsx
+++ b/src/components/ui/pagination.tsx
@@ -1,13 +1,13 @@
import * as React from "react"
+import { cn } from "@/lib/utils"
+
+import { Button } from "@/components/ui/button"
import {
ChevronLeftIcon,
ChevronRightIcon,
MoreHorizontalIcon,
} from "lucide-react"
-import { cn } from "@/lib/utils"
-import { Button, buttonVariants } from "@/components/ui/button"
-
function Pagination({ className, ...props }: React.ComponentProps<"nav">) {
return (
<nav
@@ -27,7 +27,7 @@ function PaginationContent({
return (
<ul
data-slot="pagination-content"
- className={cn("flex flex-row items-center gap-1", className)}
+ className={cn("flex items-center gap-1", className)}
{...props}
/>
)
@@ -49,52 +49,55 @@ function PaginationLink({
...props
}: PaginationLinkProps) {
return (
- <a
- aria-current={isActive ? "page" : undefined}
- data-slot="pagination-link"
- data-active={isActive}
- className={cn(
- buttonVariants({
- variant: isActive ? "outline" : "ghost",
- size,
- }),
- className
- )}
- {...props}
+ <Button
+ variant={isActive ? "outline" : "ghost"}
+ size={size}
+ className={cn(className)}
+ nativeButton={false}
+ render={
+ <a
+ aria-current={isActive ? "page" : undefined}
+ data-slot="pagination-link"
+ data-active={isActive}
+ {...props}
+ />
+ }
/>
)
}
function PaginationPrevious({
className,
+ text = "Previous",
...props
-}: React.ComponentProps<typeof PaginationLink>) {
+}: React.ComponentProps<typeof PaginationLink> & { text?: string }) {
return (
<PaginationLink
aria-label="Go to previous page"
size="default"
- className={cn("gap-1 px-2.5 sm:pl-2.5", className)}
+ className={cn("pl-2!", className)}
{...props}
>
- <ChevronLeftIcon />
- <span className="hidden sm:block">Previous</span>
+ <ChevronLeftIcon data-icon="inline-start" className="cn-rtl-flip" />
+ <span className="hidden sm:block">{text}</span>
</PaginationLink>
)
}
function PaginationNext({
className,
+ text = "Next",
...props
-}: React.ComponentProps<typeof PaginationLink>) {
+}: React.ComponentProps<typeof PaginationLink> & { text?: string }) {
return (
<PaginationLink
aria-label="Go to next page"
size="default"
- className={cn("gap-1 px-2.5 sm:pr-2.5", className)}
+ className={cn("pr-2!", className)}
{...props}
>
- <span className="hidden sm:block">Next</span>
- <ChevronRightIcon />
+ <span className="hidden sm:block">{text}</span>
+ <ChevronRightIcon data-icon="inline-end" className="cn-rtl-flip" />
</PaginationLink>
)
}
@@ -107,10 +110,13 @@ function PaginationEllipsis({
<span
aria-hidden
data-slot="pagination-ellipsis"
- className={cn("flex size-9 items-center justify-center", className)}
+ className={cn(
+ "flex size-9 items-center justify-center [&_svg:not([class*='size-'])]:size-4",
+ className
+ )}
{...props}
>
- <MoreHorizontalIcon className="size-4" />
+ <MoreHorizontalIcon />
<span className="sr-only">More pages</span>
</span>
)
@@ -119,9 +125,9 @@ function PaginationEllipsis({
export {
Pagination,
PaginationContent,
- PaginationLink,
+ PaginationEllipsis,
PaginationItem,
- PaginationPrevious,
+ PaginationLink,
PaginationNext,
- PaginationEllipsis,
+ PaginationPrevious,
}
diff --git a/src/components/ui/popover.tsx b/src/components/ui/popover.tsx
index 6d51b6ce..1531a84e 100644
--- a/src/components/ui/popover.tsx
+++ b/src/components/ui/popover.tsx
@@ -1,46 +1,89 @@
-import * as React from "react"
-import * as PopoverPrimitive from "@radix-ui/react-popover"
+"use client"
+import * as React from "react"
+import { Popover as PopoverPrimitive } from "@base-ui/react/popover"
import { cn } from "@/lib/utils"
-function Popover({
- ...props
-}: React.ComponentProps<typeof PopoverPrimitive.Root>) {
+function Popover({ ...props }: PopoverPrimitive.Root.Props) {
return <PopoverPrimitive.Root data-slot="popover" {...props} />
}
-function PopoverTrigger({
- ...props
-}: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {
+function PopoverTrigger({ ...props }: PopoverPrimitive.Trigger.Props) {
return <PopoverPrimitive.Trigger data-slot="popover-trigger" {...props} />
}
function PopoverContent({
className,
align = "center",
+ alignOffset = 0,
+ side = "bottom",
sideOffset = 4,
...props
-}: React.ComponentProps<typeof PopoverPrimitive.Content>) {
+}: PopoverPrimitive.Popup.Props &
+ Pick<
+ PopoverPrimitive.Positioner.Props,
+ "align" | "alignOffset" | "side" | "sideOffset"
+ >) {
return (
<PopoverPrimitive.Portal>
- <PopoverPrimitive.Content
- data-slot="popover-content"
+ <PopoverPrimitive.Positioner
align={align}
+ alignOffset={alignOffset}
+ side={side}
sideOffset={sideOffset}
- className={cn(
- "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",
- className
- )}
- {...props}
- />
+ className="isolate z-50"
+ >
+ <PopoverPrimitive.Popup
+ data-slot="popover-content"
+ className={cn(
+ "z-50 flex w-72 origin-(--transform-origin) flex-col gap-4 rounded-md bg-popover p-4 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
+ className
+ )}
+ {...props}
+ />
+ </PopoverPrimitive.Positioner>
</PopoverPrimitive.Portal>
)
}
-function PopoverAnchor({
+function PopoverHeader({ className, ...props }: React.ComponentProps<"div">) {
+ return (
+ <div
+ data-slot="popover-header"
+ className={cn("flex flex-col gap-1 text-sm", className)}
+ {...props}
+ />
+ )
+}
+
+function PopoverTitle({ className, ...props }: PopoverPrimitive.Title.Props) {
+ return (
+ <PopoverPrimitive.Title
+ data-slot="popover-title"
+ className={cn("font-medium", className)}
+ {...props}
+ />
+ )
+}
+
+function PopoverDescription({
+ className,
...props
-}: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {
- return <PopoverPrimitive.Anchor data-slot="popover-anchor" {...props} />
+}: PopoverPrimitive.Description.Props) {
+ return (
+ <PopoverPrimitive.Description
+ data-slot="popover-description"
+ className={cn("text-muted-foreground", className)}
+ {...props}
+ />
+ )
}
-export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor }
+export {
+ Popover,
+ PopoverContent,
+ PopoverDescription,
+ PopoverHeader,
+ PopoverTitle,
+ PopoverTrigger,
+}
diff --git a/src/components/ui/progress.tsx b/src/components/ui/progress.tsx
index 10af7e63..b60e2b45 100644
--- a/src/components/ui/progress.tsx
+++ b/src/components/ui/progress.tsx
@@ -1,29 +1,82 @@
-import * as React from "react"
-import * as ProgressPrimitive from "@radix-ui/react-progress"
+"use client"
+import { Progress as ProgressPrimitive } from "@base-ui/react/progress"
import { cn } from "@/lib/utils"
function Progress({
className,
+ children,
value,
...props
-}: React.ComponentProps<typeof ProgressPrimitive.Root>) {
+}: ProgressPrimitive.Root.Props) {
return (
<ProgressPrimitive.Root
+ value={value}
data-slot="progress"
+ className={cn("flex flex-wrap gap-3", className)}
+ {...props}
+ >
+ {children}
+ <ProgressTrack>
+ <ProgressIndicator />
+ </ProgressTrack>
+ </ProgressPrimitive.Root>
+ )
+}
+
+function ProgressTrack({ className, ...props }: ProgressPrimitive.Track.Props) {
+ return (
+ <ProgressPrimitive.Track
className={cn(
- "bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",
+ "relative flex h-1.5 w-full items-center overflow-x-hidden rounded-full bg-muted",
className
)}
+ data-slot="progress-track"
{...props}
- >
- <ProgressPrimitive.Indicator
- data-slot="progress-indicator"
- className="bg-primary h-full w-full flex-1 transition-all"
- style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
- />
- </ProgressPrimitive.Root>
+ />
+ )
+}
+
+function ProgressIndicator({
+ className,
+ ...props
+}: ProgressPrimitive.Indicator.Props) {
+ return (
+ <ProgressPrimitive.Indicator
+ data-slot="progress-indicator"
+ className={cn("h-full bg-primary transition-all", className)}
+ {...props}
+ />
+ )
+}
+
+function ProgressLabel({ className, ...props }: ProgressPrimitive.Label.Props) {
+ return (
+ <ProgressPrimitive.Label
+ className={cn("text-sm font-medium", className)}
+ data-slot="progress-label"
+ {...props}
+ />
)
}
-export { Progress }
+function ProgressValue({ className, ...props }: ProgressPrimitive.Value.Props) {
+ return (
+ <ProgressPrimitive.Value
+ className={cn(
+ "ml-auto text-sm text-muted-foreground tabular-nums",
+ className
+ )}
+ data-slot="progress-value"
+ {...props}
+ />
+ )
+}
+
+export {
+ Progress,
+ ProgressTrack,
+ ProgressIndicator,
+ ProgressLabel,
+ ProgressValue,
+}
diff --git a/src/components/ui/radio-group.tsx b/src/components/ui/radio-group.tsx
index dc682eb9..762d2733 100644
--- a/src/components/ui/radio-group.tsx
+++ b/src/components/ui/radio-group.tsx
@@ -1,42 +1,36 @@
-import * as React from "react"
-import * as RadioGroupPrimitive from "@radix-ui/react-radio-group"
-import { CircleIcon } from "lucide-react"
+"use client"
+import { Radio as RadioPrimitive } from "@base-ui/react/radio"
+import { RadioGroup as RadioGroupPrimitive } from "@base-ui/react/radio-group"
import { cn } from "@/lib/utils"
-function RadioGroup({
- className,
- ...props
-}: React.ComponentProps<typeof RadioGroupPrimitive.Root>) {
+function RadioGroup({ className, ...props }: RadioGroupPrimitive.Props) {
return (
- <RadioGroupPrimitive.Root
+ <RadioGroupPrimitive
data-slot="radio-group"
- className={cn("grid gap-3", className)}
+ className={cn("grid w-full gap-3", className)}
{...props}
/>
)
}
-function RadioGroupItem({
- className,
- ...props
-}: React.ComponentProps<typeof RadioGroupPrimitive.Item>) {
+function RadioGroupItem({ className, ...props }: RadioPrimitive.Root.Props) {
return (
- <RadioGroupPrimitive.Item
+ <RadioPrimitive.Root
data-slot="radio-group-item"
className={cn(
- "border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
+ "group/radio-group-item peer relative flex aspect-square size-4 shrink-0 rounded-full border border-input outline-none group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:not-data-checked:border-input after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary",
className
)}
{...props}
>
- <RadioGroupPrimitive.Indicator
+ <RadioPrimitive.Indicator
data-slot="radio-group-indicator"
- className="relative flex items-center justify-center"
+ className="flex size-4 items-center justify-center"
>
- <CircleIcon className="fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2" />
- </RadioGroupPrimitive.Indicator>
- </RadioGroupPrimitive.Item>
+ <span className="absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full bg-primary-foreground" />
+ </RadioPrimitive.Indicator>
+ </RadioPrimitive.Root>
)
}
diff --git a/src/components/ui/select.tsx b/src/components/ui/select.tsx
index 51f466ec..a9006cfb 100644
--- a/src/components/ui/select.tsx
+++ b/src/components/ui/select.tsx
@@ -1,25 +1,31 @@
-import * as React from "react"
-import * as SelectPrimitive from "@radix-ui/react-select"
-import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react"
+"use client"
+import * as React from "react"
+import { Select as SelectPrimitive } from "@base-ui/react/select"
import { cn } from "@/lib/utils"
-function Select({
- ...props
-}: React.ComponentProps<typeof SelectPrimitive.Root>) {
- return <SelectPrimitive.Root data-slot="select" {...props} />
-}
+import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react"
-function SelectGroup({
- ...props
-}: React.ComponentProps<typeof SelectPrimitive.Group>) {
- return <SelectPrimitive.Group data-slot="select-group" {...props} />
+const Select = SelectPrimitive.Root
+
+function SelectGroup({ className, ...props }: SelectPrimitive.Group.Props) {
+ return (
+ <SelectPrimitive.Group
+ data-slot="select-group"
+ className={cn("scroll-my-1 p-1", className)}
+ {...props}
+ />
+ )
}
-function SelectValue({
- ...props
-}: React.ComponentProps<typeof SelectPrimitive.Value>) {
- return <SelectPrimitive.Value data-slot="select-value" {...props} />
+function SelectValue({ className, ...props }: SelectPrimitive.Value.Props) {
+ return (
+ <SelectPrimitive.Value
+ data-slot="select-value"
+ className={cn("flex flex-1 text-left", className)}
+ {...props}
+ />
+ )
}
function SelectTrigger({
@@ -27,7 +33,7 @@ function SelectTrigger({
size = "default",
children,
...props
-}: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
+}: SelectPrimitive.Trigger.Props & {
size?: "sm" | "default"
}) {
return (
@@ -35,15 +41,17 @@ function SelectTrigger({
data-slot="select-trigger"
data-size={size}
className={cn(
- "border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
+ "flex w-fit items-center justify-between gap-1.5 rounded-md border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
className
)}
{...props}
>
{children}
- <SelectPrimitive.Icon asChild>
- <ChevronDownIcon className="size-4 opacity-50" />
- </SelectPrimitive.Icon>
+ <SelectPrimitive.Icon
+ render={
+ <ChevronDownIcon className="pointer-events-none size-4 text-muted-foreground" />
+ }
+ />
</SelectPrimitive.Trigger>
)
}
@@ -51,34 +59,41 @@ function SelectTrigger({
function SelectContent({
className,
children,
- position = "popper",
+ side = "bottom",
+ sideOffset = 4,
+ align = "center",
+ alignOffset = 0,
+ alignItemWithTrigger = true,
...props
-}: React.ComponentProps<typeof SelectPrimitive.Content>) {
+}: SelectPrimitive.Popup.Props &
+ Pick<
+ SelectPrimitive.Positioner.Props,
+ "align" | "alignOffset" | "side" | "sideOffset" | "alignItemWithTrigger"
+ >) {
return (
<SelectPrimitive.Portal>
- <SelectPrimitive.Content
- data-slot="select-content"
- className={cn(
- "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",
- position === "popper" &&
- "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
- className
- )}
- position={position}
- {...props}
+ <SelectPrimitive.Positioner
+ side={side}
+ sideOffset={sideOffset}
+ align={align}
+ alignOffset={alignOffset}
+ alignItemWithTrigger={alignItemWithTrigger}
+ className="isolate z-50"
>
- <SelectScrollUpButton />
- <SelectPrimitive.Viewport
+ <SelectPrimitive.Popup
+ data-slot="select-content"
+ data-align-trigger={alignItemWithTrigger}
className={cn(
- "p-1",
- position === "popper" &&
- "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"
+ "cn-menu-target cn-menu-translucent relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
+ className
)}
+ {...props}
>
- {children}
- </SelectPrimitive.Viewport>
- <SelectScrollDownButton />
- </SelectPrimitive.Content>
+ <SelectScrollUpButton />
+ <SelectPrimitive.List>{children}</SelectPrimitive.List>
+ <SelectScrollDownButton />
+ </SelectPrimitive.Popup>
+ </SelectPrimitive.Positioner>
</SelectPrimitive.Portal>
)
}
@@ -86,11 +101,11 @@ function SelectContent({
function SelectLabel({
className,
...props
-}: React.ComponentProps<typeof SelectPrimitive.Label>) {
+}: SelectPrimitive.GroupLabel.Props) {
return (
- <SelectPrimitive.Label
+ <SelectPrimitive.GroupLabel
data-slot="select-label"
- className={cn("text-muted-foreground px-2 py-1.5 text-xs", className)}
+ className={cn("px-2 py-1.5 text-xs text-muted-foreground", className)}
{...props}
/>
)
@@ -100,22 +115,26 @@ function SelectItem({
className,
children,
...props
-}: React.ComponentProps<typeof SelectPrimitive.Item>) {
+}: SelectPrimitive.Item.Props) {
return (
<SelectPrimitive.Item
data-slot="select-item"
className={cn(
- "focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
+ "relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
className
)}
{...props}
>
- <span className="absolute right-2 flex size-3.5 items-center justify-center">
- <SelectPrimitive.ItemIndicator>
- <CheckIcon className="size-4" />
- </SelectPrimitive.ItemIndicator>
- </span>
- <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
+ <SelectPrimitive.ItemText className="flex flex-1 shrink-0 gap-2 whitespace-nowrap">
+ {children}
+ </SelectPrimitive.ItemText>
+ <SelectPrimitive.ItemIndicator
+ render={
+ <span className="pointer-events-none absolute right-2 flex size-4 items-center justify-center" />
+ }
+ >
+ <CheckIcon className="pointer-events-none" />
+ </SelectPrimitive.ItemIndicator>
</SelectPrimitive.Item>
)
}
@@ -123,11 +142,11 @@ function SelectItem({
function SelectSeparator({
className,
...props
-}: React.ComponentProps<typeof SelectPrimitive.Separator>) {
+}: SelectPrimitive.Separator.Props) {
return (
<SelectPrimitive.Separator
data-slot="select-separator"
- className={cn("bg-border pointer-events-none -mx-1 my-1 h-px", className)}
+ className={cn("pointer-events-none -mx-1 my-1 h-px bg-border", className)}
{...props}
/>
)
@@ -136,36 +155,36 @@ function SelectSeparator({
function SelectScrollUpButton({
className,
...props
-}: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {
+}: React.ComponentProps<typeof SelectPrimitive.ScrollUpArrow>) {
return (
- <SelectPrimitive.ScrollUpButton
+ <SelectPrimitive.ScrollUpArrow
data-slot="select-scroll-up-button"
className={cn(
- "flex cursor-default items-center justify-center py-1",
+ "top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",
className
)}
{...props}
>
- <ChevronUpIcon className="size-4" />
- </SelectPrimitive.ScrollUpButton>
+ <ChevronUpIcon />
+ </SelectPrimitive.ScrollUpArrow>
)
}
function SelectScrollDownButton({
className,
...props
-}: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {
+}: React.ComponentProps<typeof SelectPrimitive.ScrollDownArrow>) {
return (
- <SelectPrimitive.ScrollDownButton
+ <SelectPrimitive.ScrollDownArrow
data-slot="select-scroll-down-button"
className={cn(
- "flex cursor-default items-center justify-center py-1",
+ "bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",
className
)}
{...props}
>
- <ChevronDownIcon className="size-4" />
- </SelectPrimitive.ScrollDownButton>
+ <ChevronDownIcon />
+ </SelectPrimitive.ScrollDownArrow>
)
}
diff --git a/src/components/ui/separator.tsx b/src/components/ui/separator.tsx
index 3cf4f89b..692f8a9b 100644
--- a/src/components/ui/separator.tsx
+++ b/src/components/ui/separator.tsx
@@ -1,21 +1,19 @@
-import * as React from "react"
-import * as SeparatorPrimitive from "@radix-ui/react-separator"
+"use client"
+import { Separator as SeparatorPrimitive } from "@base-ui/react/separator"
import { cn } from "@/lib/utils"
function Separator({
className,
orientation = "horizontal",
- decorative = true,
...props
-}: React.ComponentProps<typeof SeparatorPrimitive.Root>) {
+}: SeparatorPrimitive.Props) {
return (
- <SeparatorPrimitive.Root
- data-slot="separator-root"
- decorative={decorative}
+ <SeparatorPrimitive
+ data-slot="separator"
orientation={orientation}
className={cn(
- "bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
+ "shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",
className
)}
{...props}
diff --git a/src/components/ui/sheet.tsx b/src/components/ui/sheet.tsx
index 443035a1..a9cca222 100644
--- a/src/components/ui/sheet.tsx
+++ b/src/components/ui/sheet.tsx
@@ -1,40 +1,34 @@
-import * as React from "react"
-import * as SheetPrimitive from "@radix-ui/react-dialog"
-import { XIcon } from "lucide-react"
+"use client"
+import * as React from "react"
+import { Dialog as SheetPrimitive } from "@base-ui/react/dialog"
import { cn } from "@/lib/utils"
-function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>) {
+import { Button } from "@/components/ui/button"
+import { XIcon } from "lucide-react"
+
+function Sheet({ ...props }: SheetPrimitive.Root.Props) {
return <SheetPrimitive.Root data-slot="sheet" {...props} />
}
-function SheetTrigger({
- ...props
-}: React.ComponentProps<typeof SheetPrimitive.Trigger>) {
+function SheetTrigger({ ...props }: SheetPrimitive.Trigger.Props) {
return <SheetPrimitive.Trigger data-slot="sheet-trigger" {...props} />
}
-function SheetClose({
- ...props
-}: React.ComponentProps<typeof SheetPrimitive.Close>) {
+function SheetClose({ ...props }: SheetPrimitive.Close.Props) {
return <SheetPrimitive.Close data-slot="sheet-close" {...props} />
}
-function SheetPortal({
- ...props
-}: React.ComponentProps<typeof SheetPrimitive.Portal>) {
+function SheetPortal({ ...props }: SheetPrimitive.Portal.Props) {
return <SheetPrimitive.Portal data-slot="sheet-portal" {...props} />
}
-function SheetOverlay({
- className,
- ...props
-}: React.ComponentProps<typeof SheetPrimitive.Overlay>) {
+function SheetOverlay({ className, ...props }: SheetPrimitive.Backdrop.Props) {
return (
- <SheetPrimitive.Overlay
+ <SheetPrimitive.Backdrop
data-slot="sheet-overlay"
className={cn(
- "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
+ "fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs",
className
)}
{...props}
@@ -46,35 +40,41 @@ function SheetContent({
className,
children,
side = "right",
+ showCloseButton = true,
...props
-}: React.ComponentProps<typeof SheetPrimitive.Content> & {
+}: SheetPrimitive.Popup.Props & {
side?: "top" | "right" | "bottom" | "left"
+ showCloseButton?: boolean
}) {
return (
<SheetPortal>
<SheetOverlay />
- <SheetPrimitive.Content
+ <SheetPrimitive.Popup
data-slot="sheet-content"
+ data-side={side}
className={cn(
- "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
- side === "right" &&
- "data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",
- side === "left" &&
- "data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",
- side === "top" &&
- "data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",
- side === "bottom" &&
- "data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",
+ "fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",
className
)}
{...props}
>
{children}
- <SheetPrimitive.Close className="ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none">
- <XIcon className="size-6 md:size-4" />
- <span className="sr-only">Close</span>
- </SheetPrimitive.Close>
- </SheetPrimitive.Content>
+ {showCloseButton && (
+ <SheetPrimitive.Close
+ data-slot="sheet-close"
+ render={
+ <Button
+ variant="ghost"
+ className="absolute top-4 right-4"
+ size="icon-sm"
+ />
+ }
+ >
+ <XIcon className="size-6 md:size-4" />
+ <span className="sr-only">Close</span>
+ </SheetPrimitive.Close>
+ )}
+ </SheetPrimitive.Popup>
</SheetPortal>
)
}
@@ -99,14 +99,11 @@ function SheetFooter({ className, ...props }: React.ComponentProps<"div">) {
)
}
-function SheetTitle({
- className,
- ...props
-}: React.ComponentProps<typeof SheetPrimitive.Title>) {
+function SheetTitle({ className, ...props }: SheetPrimitive.Title.Props) {
return (
<SheetPrimitive.Title
data-slot="sheet-title"
- className={cn("text-foreground font-semibold", className)}
+ className={cn("cn-font-heading font-medium text-foreground", className)}
{...props}
/>
)
@@ -115,11 +112,11 @@ function SheetTitle({
function SheetDescription({
className,
...props
-}: React.ComponentProps<typeof SheetPrimitive.Description>) {
+}: SheetPrimitive.Description.Props) {
return (
<SheetPrimitive.Description
data-slot="sheet-description"
- className={cn("text-muted-foreground text-sm", className)}
+ className={cn("text-sm text-muted-foreground", className)}
{...props}
/>
)
diff --git a/src/components/ui/sidebar.tsx b/src/components/ui/sidebar.tsx
index 22393149..6f64cee1 100644
--- a/src/components/ui/sidebar.tsx
+++ b/src/components/ui/sidebar.tsx
@@ -1,10 +1,12 @@
+"use client"
+
import * as React from "react"
-import { Slot } from "@radix-ui/react-slot"
-import { VariantProps, cva } from "class-variance-authority"
-import { PanelLeftIcon } from "lucide-react"
+import { mergeProps } from "@base-ui/react/merge-props"
+import { useRender } from "@base-ui/react/use-render"
+import { cva, type VariantProps } from "class-variance-authority"
+import { cn } from "@/lib/utils"
import { useIsMobile } from "@/hooks/use-mobile"
-import { cn } from "@/lib/utils"
import { Button } from "@/components/ui/button"
import { Input } from "@/components/ui/input"
import { Separator } from "@/components/ui/separator"
@@ -19,9 +21,9 @@ import { Skeleton } from "@/components/ui/skeleton"
import {
Tooltip,
TooltipContent,
- TooltipProvider,
TooltipTrigger,
} from "@/components/ui/tooltip"
+import { PanelLeftIcon } from "lucide-react"
const SIDEBAR_COOKIE_NAME = "sidebar_state"
const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7
@@ -126,25 +128,23 @@ function SidebarProvider({
return (
<SidebarContext.Provider value={contextValue}>
- <TooltipProvider delayDuration={0}>
- <div
- data-slot="sidebar-wrapper"
- style={
- {
- "--sidebar-width": SIDEBAR_WIDTH,
- "--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
- ...style,
- } as React.CSSProperties
- }
- className={cn(
- "group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",
- className
- )}
- {...props}
- >
- {children}
- </div>
- </TooltipProvider>
+ <div
+ data-slot="sidebar-wrapper"
+ style={
+ {
+ "--sidebar-width": SIDEBAR_WIDTH,
+ "--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
+ ...style,
+ } as React.CSSProperties
+ }
+ className={cn(
+ "group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",
+ className
+ )}
+ {...props}
+ >
+ {children}
+ </div>
</SidebarContext.Provider>
)
}
@@ -155,6 +155,7 @@ function Sidebar({
collapsible = "offcanvas",
className,
children,
+ dir,
...props
}: React.ComponentProps<"div"> & {
side?: "left" | "right"
@@ -168,7 +169,7 @@ function Sidebar({
<div
data-slot="sidebar"
className={cn(
- "bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",
+ "flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",
className
)}
{...props}
@@ -182,10 +183,11 @@ function Sidebar({
return (
<Sheet open={openMobile} onOpenChange={setOpenMobile} {...props}>
<SheetContent
+ dir={dir}
data-sidebar="sidebar"
data-slot="sidebar"
data-mobile="true"
- className="bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden"
+ className="w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden"
style={
{
"--sidebar-width": SIDEBAR_WIDTH_MOBILE,
@@ -205,7 +207,7 @@ function Sidebar({
return (
<div
- className="group peer text-sidebar-foreground hidden md:block"
+ className="group peer hidden text-sidebar-foreground md:block"
data-state={state}
data-collapsible={state === "collapsed" ? collapsible : ""}
data-variant={variant}
@@ -226,11 +228,9 @@ function Sidebar({
/>
<div
data-slot="sidebar-container"
+ data-side={side}
className={cn(
- "fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",
- side === "left"
- ? "left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]"
- : "right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",
+ "fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex",
// Adjust the padding for floating and inset variants.
variant === "floating" || variant === "inset"
? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]"
@@ -242,7 +242,7 @@ function Sidebar({
<div
data-sidebar="sidebar"
data-slot="sidebar-inner"
- className="bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm"
+ className="flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border"
>
{children}
</div>
@@ -263,15 +263,15 @@ function SidebarTrigger({
data-sidebar="trigger"
data-slot="sidebar-trigger"
variant="ghost"
- size="icon"
- className={cn("size-7", className)}
+ size="icon-sm"
+ className={cn(className)}
onClick={(event) => {
onClick?.(event)
toggleSidebar()
}}
{...props}
>
- <PanelLeftIcon />
+ <PanelLeftIcon className="cn-rtl-flip" />
<span className="sr-only">Toggle Sidebar</span>
</Button>
)
@@ -289,10 +289,10 @@ function SidebarRail({ className, ...props }: React.ComponentProps<"button">) {
onClick={toggleSidebar}
title="Toggle Sidebar"
className={cn(
- "hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex",
+ "absolute inset-y-0 z-20 hidden w-4 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:start-1/2 after:w-[2px] hover:after:bg-sidebar-border sm:flex ltr:-translate-x-1/2 rtl:-translate-x-1/2",
"in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize",
"[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize",
- "hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full",
+ "group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar",
"[[data-side=left][data-collapsible=offcanvas]_&]:-right-2",
"[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",
className
@@ -307,8 +307,7 @@ function SidebarInset({ className, ...props }: React.ComponentProps<"main">) {
<main
data-slot="sidebar-inset"
className={cn(
- "bg-background relative flex w-full flex-1 flex-col",
- "md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",
+ "relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",
className
)}
{...props}
@@ -324,7 +323,7 @@ function SidebarInput({
<Input
data-slot="sidebar-input"
data-sidebar="input"
- className={cn("bg-background h-8 w-full shadow-none", className)}
+ className={cn("h-8 w-full bg-background shadow-none", className)}
{...props}
/>
)
@@ -360,7 +359,7 @@ function SidebarSeparator({
<Separator
data-slot="sidebar-separator"
data-sidebar="separator"
- className={cn("bg-sidebar-border mx-2 w-auto", className)}
+ className={cn("mx-2 w-auto bg-sidebar-border", className)}
{...props}
/>
)
@@ -372,7 +371,7 @@ function SidebarContent({ className, ...props }: React.ComponentProps<"div">) {
data-slot="sidebar-content"
data-sidebar="content"
className={cn(
- "flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",
+ "no-scrollbar flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",
className
)}
{...props}
@@ -393,46 +392,50 @@ function SidebarGroup({ className, ...props }: React.ComponentProps<"div">) {
function SidebarGroupLabel({
className,
- asChild = false,
+ render,
...props
-}: React.ComponentProps<"div"> & { asChild?: boolean }) {
- const Comp = asChild ? Slot : "div"
-
- return (
- <Comp
- data-slot="sidebar-group-label"
- data-sidebar="group-label"
- className={cn(
- "text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
- "group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",
- className
- )}
- {...props}
- />
- )
+}: useRender.ComponentProps<"div"> & React.ComponentProps<"div">) {
+ return useRender({
+ defaultTagName: "div",
+ props: mergeProps<"div">(
+ {
+ className: cn(
+ "flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
+ className
+ ),
+ },
+ props
+ ),
+ render,
+ state: {
+ slot: "sidebar-group-label",
+ sidebar: "group-label",
+ },
+ })
}
function SidebarGroupAction({
className,
- asChild = false,
+ render,
...props
-}: React.ComponentProps<"button"> & { asChild?: boolean }) {
- const Comp = asChild ? Slot : "button"
-
- return (
- <Comp
- data-slot="sidebar-group-action"
- data-sidebar="group-action"
- className={cn(
- "text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
- // Increases the hit area of the button on mobile.
- "after:absolute after:-inset-2 md:after:hidden",
- "group-data-[collapsible=icon]:hidden",
- className
- )}
- {...props}
- />
- )
+}: useRender.ComponentProps<"button"> & React.ComponentProps<"button">) {
+ return useRender({
+ defaultTagName: "button",
+ props: mergeProps<"button">(
+ {
+ className: cn(
+ "absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform group-data-[collapsible=icon]:hidden after:absolute after:-inset-2 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0",
+ className
+ ),
+ },
+ props
+ ),
+ render,
+ state: {
+ slot: "sidebar-group-action",
+ sidebar: "group-action",
+ },
+ })
}
function SidebarGroupContent({
@@ -472,13 +475,13 @@ function SidebarMenuItem({ className, ...props }: React.ComponentProps<"li">) {
}
const sidebarMenuButtonVariants = cva(
- "peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",
+ "peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",
{
variants: {
variant: {
default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
outline:
- "bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]",
+ "bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]",
},
size: {
default: "h-8 text-sm",
@@ -494,34 +497,38 @@ const sidebarMenuButtonVariants = cva(
)
function SidebarMenuButton({
- asChild = false,
+ render,
isActive = false,
variant = "default",
size = "default",
tooltip,
className,
...props
-}: React.ComponentProps<"button"> & {
- asChild?: boolean
- isActive?: boolean
- tooltip?: string | React.ComponentProps<typeof TooltipContent>
-} & VariantProps<typeof sidebarMenuButtonVariants>) {
- const Comp = asChild ? Slot : "button"
+}: useRender.ComponentProps<"button"> &
+ React.ComponentProps<"button"> & {
+ isActive?: boolean
+ tooltip?: string | React.ComponentProps<typeof TooltipContent>
+ } & VariantProps<typeof sidebarMenuButtonVariants>) {
const { isMobile, state } = useSidebar()
-
- const button = (
- <Comp
- data-slot="sidebar-menu-button"
- data-sidebar="menu-button"
- data-size={size}
- data-active={isActive}
- className={cn(sidebarMenuButtonVariants({ variant, size }), className)}
- {...props}
- />
- )
+ const comp = useRender({
+ defaultTagName: "button",
+ props: mergeProps<"button">(
+ {
+ className: cn(sidebarMenuButtonVariants({ variant, size }), className),
+ },
+ props
+ ),
+ render: !tooltip ? render : <TooltipTrigger render={render} />,
+ state: {
+ slot: "sidebar-menu-button",
+ sidebar: "menu-button",
+ size,
+ active: isActive,
+ },
+ })
if (!tooltip) {
- return button
+ return comp
}
if (typeof tooltip === "string") {
@@ -532,7 +539,7 @@ function SidebarMenuButton({
return (
<Tooltip>
- <TooltipTrigger asChild>{button}</TooltipTrigger>
+ {comp}
<TooltipContent
side="right"
align="center"
@@ -545,34 +552,32 @@ function SidebarMenuButton({
function SidebarMenuAction({
className,
- asChild = false,
+ render,
showOnHover = false,
...props
-}: React.ComponentProps<"button"> & {
- asChild?: boolean
- showOnHover?: boolean
-}) {
- const Comp = asChild ? Slot : "button"
-
- return (
- <Comp
- data-slot="sidebar-menu-action"
- data-sidebar="menu-action"
- className={cn(
- "text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
- // Increases the hit area of the button on mobile.
- "after:absolute after:-inset-2 md:after:hidden",
- "peer-data-[size=sm]/menu-button:top-1",
- "peer-data-[size=default]/menu-button:top-1.5",
- "peer-data-[size=lg]/menu-button:top-2.5",
- "group-data-[collapsible=icon]:hidden",
- showOnHover &&
- "peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0",
- className
- )}
- {...props}
- />
- )
+}: useRender.ComponentProps<"button"> &
+ React.ComponentProps<"button"> & {
+ showOnHover?: boolean
+ }) {
+ return useRender({
+ defaultTagName: "button",
+ props: mergeProps<"button">(
+ {
+ className: cn(
+ "absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 after:absolute after:-inset-2 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0",
+ showOnHover &&
+ "group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 peer-data-active/menu-button:text-sidebar-accent-foreground aria-expanded:opacity-100 md:opacity-0",
+ className
+ ),
+ },
+ props
+ ),
+ render,
+ state: {
+ slot: "sidebar-menu-action",
+ sidebar: "menu-action",
+ },
+ })
}
function SidebarMenuBadge({
@@ -584,12 +589,7 @@ function SidebarMenuBadge({
data-slot="sidebar-menu-badge"
data-sidebar="menu-badge"
className={cn(
- "text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none",
- "peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground",
- "peer-data-[size=sm]/menu-button:top-1",
- "peer-data-[size=default]/menu-button:top-1.5",
- "peer-data-[size=lg]/menu-button:top-2.5",
- "group-data-[collapsible=icon]:hidden",
+ "pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium text-sidebar-foreground tabular-nums select-none group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 peer-data-active/menu-button:text-sidebar-accent-foreground",
className
)}
{...props}
@@ -605,9 +605,9 @@ function SidebarMenuSkeleton({
showIcon?: boolean
}) {
// Random width between 50 to 90%.
- const width = React.useMemo(() => {
+ const [width] = React.useState(() => {
return `${Math.floor(Math.random() * 40) + 50}%`
- }, [])
+ })
return (
<div
@@ -641,8 +641,7 @@ function SidebarMenuSub({ className, ...props }: React.ComponentProps<"ul">) {
data-slot="sidebar-menu-sub"
data-sidebar="menu-sub"
className={cn(
- "border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5",
- "group-data-[collapsible=icon]:hidden",
+ "mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5 group-data-[collapsible=icon]:hidden",
className
)}
{...props}
@@ -665,35 +664,35 @@ function SidebarMenuSubItem({
}
function SidebarMenuSubButton({
- asChild = false,
+ render,
size = "md",
isActive = false,
className,
...props
-}: React.ComponentProps<"a"> & {
- asChild?: boolean
- size?: "sm" | "md"
- isActive?: boolean
-}) {
- const Comp = asChild ? Slot : "a"
-
- return (
- <Comp
- data-slot="sidebar-menu-sub-button"
- data-sidebar="menu-sub-button"
- data-size={size}
- data-active={isActive}
- className={cn(
- "text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",
- "data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",
- size === "sm" && "text-xs",
- size === "md" && "text-sm",
- "group-data-[collapsible=icon]:hidden",
- className
- )}
- {...props}
- />
- )
+}: useRender.ComponentProps<"a"> &
+ React.ComponentProps<"a"> & {
+ size?: "sm" | "md"
+ isActive?: boolean
+ }) {
+ return useRender({
+ defaultTagName: "a",
+ props: mergeProps<"a">(
+ {
+ className: cn(
+ "flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground ring-sidebar-ring outline-hidden group-data-[collapsible=icon]:hidden hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[size=md]:text-sm data-[size=sm]:text-xs data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground",
+ className
+ ),
+ },
+ props
+ ),
+ render,
+ state: {
+ slot: "sidebar-menu-sub-button",
+ sidebar: "menu-sub-button",
+ size,
+ active: isActive,
+ },
+ })
}
export {
diff --git a/src/components/ui/skeleton.tsx b/src/components/ui/skeleton.tsx
index 32ea0ef7..0118624f 100644
--- a/src/components/ui/skeleton.tsx
+++ b/src/components/ui/skeleton.tsx
@@ -4,7 +4,7 @@ function Skeleton({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
data-slot="skeleton"
- className={cn("bg-accent animate-pulse rounded-md", className)}
+ className={cn("animate-pulse rounded-md bg-muted", className)}
{...props}
/>
)
diff --git a/src/components/ui/sonner.tsx b/src/components/ui/sonner.tsx
index 9f46e06d..eddaa82a 100644
--- a/src/components/ui/sonner.tsx
+++ b/src/components/ui/sonner.tsx
@@ -1,3 +1,8 @@
+"use client"
+
+import { useTheme } from "next-themes"
+import { Toaster as Sonner, type ToasterProps } from "sonner"
+
import {
CircleCheckIcon,
InfoIcon,
@@ -5,8 +10,6 @@ import {
OctagonXIcon,
TriangleAlertIcon,
} from "lucide-react"
-import { useTheme } from "next-themes"
-import { Toaster as Sonner, type ToasterProps } from "sonner"
const Toaster = ({ ...props }: ToasterProps) => {
const { theme = "system" } = useTheme()
@@ -30,6 +33,11 @@ const Toaster = ({ ...props }: ToasterProps) => {
"--border-radius": "var(--radius)",
} as React.CSSProperties
}
+ toastOptions={{
+ classNames: {
+ toast: "cn-toast",
+ },
+ }}
{...props}
/>
)
diff --git a/src/components/ui/switch.tsx b/src/components/ui/switch.tsx
index b0363e3f..2a35c386 100644
--- a/src/components/ui/switch.tsx
+++ b/src/components/ui/switch.tsx
@@ -1,26 +1,28 @@
-import * as React from "react"
-import * as SwitchPrimitive from "@radix-ui/react-switch"
+"use client"
+import { Switch as SwitchPrimitive } from "@base-ui/react/switch"
import { cn } from "@/lib/utils"
function Switch({
className,
+ size = "default",
...props
-}: React.ComponentProps<typeof SwitchPrimitive.Root>) {
+}: SwitchPrimitive.Root.Props & {
+ size?: "sm" | "default"
+}) {
return (
<SwitchPrimitive.Root
data-slot="switch"
+ data-size={size}
className={cn(
- "peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
+ "peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none group-has-[:focus-visible]/field-label:border-transparent group-has-[:focus-visible]/field-label:ring-0 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50",
className
)}
{...props}
>
<SwitchPrimitive.Thumb
data-slot="switch-thumb"
- className={cn(
- "bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0"
- )}
+ className="pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground"
/>
</SwitchPrimitive.Root>
)
diff --git a/src/components/ui/table.tsx b/src/components/ui/table.tsx
index 5513a5cd..c02e2af1 100644
--- a/src/components/ui/table.tsx
+++ b/src/components/ui/table.tsx
@@ -1,5 +1,6 @@
-import * as React from "react"
+"use client"
+import * as React from "react"
import { cn } from "@/lib/utils"
function Table({ className, ...props }: React.ComponentProps<"table">) {
@@ -42,7 +43,7 @@ function TableFooter({ className, ...props }: React.ComponentProps<"tfoot">) {
<tfoot
data-slot="table-footer"
className={cn(
- "bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",
+ "border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",
className
)}
{...props}
@@ -55,7 +56,7 @@ function TableRow({ className, ...props }: React.ComponentProps<"tr">) {
<tr
data-slot="table-row"
className={cn(
- "hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",
+ "border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",
className
)}
{...props}
@@ -68,7 +69,7 @@ function TableHead({ className, ...props }: React.ComponentProps<"th">) {
<th
data-slot="table-head"
className={cn(
- "text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
+ "h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0",
className
)}
{...props}
@@ -81,7 +82,7 @@ function TableCell({ className, ...props }: React.ComponentProps<"td">) {
<td
data-slot="table-cell"
className={cn(
- "p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
+ "p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0",
className
)}
{...props}
@@ -96,7 +97,7 @@ function TableCaption({
return (
<caption
data-slot="table-caption"
- className={cn("text-muted-foreground mt-4 text-sm", className)}
+ className={cn("mt-4 text-sm text-muted-foreground", className)}
{...props}
/>
)
diff --git a/src/components/ui/tabs.tsx b/src/components/ui/tabs.tsx
index 3d6f3acf..7b054282 100644
--- a/src/components/ui/tabs.tsx
+++ b/src/components/ui/tabs.tsx
@@ -1,46 +1,66 @@
-import * as React from "react"
-import * as TabsPrimitive from "@radix-ui/react-tabs"
+"use client"
+import { Tabs as TabsPrimitive } from "@base-ui/react/tabs"
+import { cva, type VariantProps } from "class-variance-authority"
import { cn } from "@/lib/utils"
function Tabs({
className,
+ orientation = "horizontal",
...props
-}: React.ComponentProps<typeof TabsPrimitive.Root>) {
+}: TabsPrimitive.Root.Props) {
return (
<TabsPrimitive.Root
data-slot="tabs"
- className={cn("flex flex-col gap-2", className)}
+ data-orientation={orientation}
+ className={cn(
+ "group/tabs flex gap-2 data-horizontal:flex-col",
+ className
+ )}
{...props}
/>
)
}
+const tabsListVariants = cva(
+ "group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-9 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none",
+ {
+ variants: {
+ variant: {
+ default: "bg-muted",
+ line: "gap-1 bg-transparent",
+ },
+ },
+ defaultVariants: {
+ variant: "default",
+ },
+ }
+)
+
function TabsList({
className,
+ variant = "default",
...props
-}: React.ComponentProps<typeof TabsPrimitive.List>) {
+}: TabsPrimitive.List.Props & VariantProps<typeof tabsListVariants>) {
return (
<TabsPrimitive.List
data-slot="tabs-list"
- className={cn(
- "bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",
- className
- )}
+ data-variant={variant}
+ className={cn(tabsListVariants({ variant }), className)}
{...props}
/>
)
}
-function TabsTrigger({
- className,
- ...props
-}: React.ComponentProps<typeof TabsPrimitive.Trigger>) {
+function TabsTrigger({ className, ...props }: TabsPrimitive.Tab.Props) {
return (
- <TabsPrimitive.Trigger
+ <TabsPrimitive.Tab
data-slot="tabs-trigger"
className={cn(
- "data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
+ "relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-disabled:pointer-events-none aria-disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
+ "group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent",
+ "data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground",
+ "after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",
className
)}
{...props}
@@ -48,17 +68,14 @@ function TabsTrigger({
)
}
-function TabsContent({
- className,
- ...props
-}: React.ComponentProps<typeof TabsPrimitive.Content>) {
+function TabsContent({ className, ...props }: TabsPrimitive.Panel.Props) {
return (
- <TabsPrimitive.Content
+ <TabsPrimitive.Panel
data-slot="tabs-content"
- className={cn("flex-1 outline-none", className)}
+ className={cn("flex-1 text-sm outline-none", className)}
{...props}
/>
)
}
-export { Tabs, TabsList, TabsTrigger, TabsContent }
+export { Tabs, TabsList, TabsTrigger, TabsContent, tabsListVariants }
diff --git a/src/components/ui/textarea.tsx b/src/components/ui/textarea.tsx
index 5dd6b14f..1b7989be 100644
--- a/src/components/ui/textarea.tsx
+++ b/src/components/ui/textarea.tsx
@@ -1,5 +1,4 @@
import * as React from "react"
-
import { cn } from "@/lib/utils"
function Textarea({ className, ...props }: React.ComponentProps<"textarea">) {
@@ -7,7 +6,7 @@ function Textarea({ className, ...props }: React.ComponentProps<"textarea">) {
<textarea
data-slot="textarea"
className={cn(
- "border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 text-sm",
+ "flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-2.5 py-2 text-sm shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",
className
)}
{...props}
diff --git a/src/components/ui/toggle-group.tsx b/src/components/ui/toggle-group.tsx
index 24a4850d..e3cf0495 100644
--- a/src/components/ui/toggle-group.tsx
+++ b/src/components/ui/toggle-group.tsx
@@ -1,82 +1,88 @@
"use client"
import * as React from "react"
-import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group"
+import { Toggle as TogglePrimitive } from "@base-ui/react/toggle"
+import { ToggleGroup as ToggleGroupPrimitive } from "@base-ui/react/toggle-group"
import { type VariantProps } from "class-variance-authority"
-
import { cn } from "@/lib/utils"
+
import { toggleVariants } from "@/components/ui/toggle"
const ToggleGroupContext = React.createContext<
VariantProps<typeof toggleVariants> & {
spacing?: number
+ orientation?: "horizontal" | "vertical"
}
>({
size: "default",
variant: "default",
- spacing: 0,
+ spacing: 2,
+ orientation: "horizontal",
})
function ToggleGroup({
className,
variant,
size,
- spacing = 0,
+ spacing = 2,
+ orientation = "horizontal",
children,
...props
-}: React.ComponentProps<typeof ToggleGroupPrimitive.Root> &
+}: ToggleGroupPrimitive.Props &
VariantProps<typeof toggleVariants> & {
spacing?: number
+ orientation?: "horizontal" | "vertical"
}) {
return (
- <ToggleGroupPrimitive.Root
+ <ToggleGroupPrimitive
data-slot="toggle-group"
data-variant={variant}
data-size={size}
data-spacing={spacing}
+ data-orientation={orientation}
style={{ "--gap": spacing } as React.CSSProperties}
className={cn(
- "group/toggle-group flex w-fit items-center gap-[--spacing(var(--gap))] rounded-md data-[spacing=default]:data-[variant=outline]:shadow-xs",
+ "group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] rounded-md data-[spacing=0]:data-[variant=outline]:shadow-xs data-vertical:flex-col data-vertical:items-stretch",
className
)}
{...props}
>
- <ToggleGroupContext.Provider value={{ variant, size, spacing }}>
+ <ToggleGroupContext.Provider
+ value={{ variant, size, spacing, orientation }}
+ >
{children}
</ToggleGroupContext.Provider>
- </ToggleGroupPrimitive.Root>
+ </ToggleGroupPrimitive>
)
}
function ToggleGroupItem({
className,
children,
- variant,
- size,
+ variant = "default",
+ size = "default",
...props
-}: React.ComponentProps<typeof ToggleGroupPrimitive.Item> &
- VariantProps<typeof toggleVariants>) {
+}: TogglePrimitive.Props & VariantProps<typeof toggleVariants>) {
const context = React.useContext(ToggleGroupContext)
return (
- <ToggleGroupPrimitive.Item
+ <TogglePrimitive
data-slot="toggle-group-item"
data-variant={context.variant || variant}
data-size={context.size || size}
data-spacing={context.spacing}
className={cn(
+ "shrink-0 group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 group-data-[spacing=0]/toggle-group:shadow-none focus:z-10 focus-visible:z-10 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-end]:pr-1.5 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-start]:pl-1.5 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-md group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-md group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-md group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-md data-[state=on]:bg-muted group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t",
toggleVariants({
variant: context.variant || variant,
size: context.size || size,
}),
- "w-auto min-w-0 shrink-0 px-3 focus:z-10 focus-visible:z-10",
- "data-[spacing=0]:rounded-none data-[spacing=0]:shadow-none data-[spacing=0]:first:rounded-l-md data-[spacing=0]:last:rounded-r-md data-[spacing=0]:data-[variant=outline]:border-l-0 data-[spacing=0]:data-[variant=outline]:first:border-l",
className
)}
{...props}
>
{children}
- </ToggleGroupPrimitive.Item>
+ </TogglePrimitive>
)
}
diff --git a/src/components/ui/toggle.tsx b/src/components/ui/toggle.tsx
index b9662212..949acf1b 100644
--- a/src/components/ui/toggle.tsx
+++ b/src/components/ui/toggle.tsx
@@ -1,22 +1,22 @@
-import * as React from "react"
-import * as TogglePrimitive from "@radix-ui/react-toggle"
-import { cva, type VariantProps } from "class-variance-authority"
+"use client"
+import { Toggle as TogglePrimitive } from "@base-ui/react/toggle"
+import { cva, type VariantProps } from "class-variance-authority"
import { cn } from "@/lib/utils"
const toggleVariants = cva(
- "inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",
+ "group/toggle inline-flex items-center justify-center gap-1 rounded-md text-sm font-medium whitespace-nowrap transition-[color,box-shadow] outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
{
variants: {
variant: {
default: "bg-transparent",
- outline:
- "border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground",
+ outline: "border border-input bg-transparent shadow-xs hover:bg-muted",
},
size: {
- default: "h-9 px-2 min-w-9",
- sm: "h-8 px-1.5 min-w-8",
- lg: "h-10 px-2.5 min-w-10",
+ default:
+ "h-9 min-w-9 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
+ sm: "h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5",
+ lg: "h-10 min-w-10 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
},
},
defaultVariants: {
@@ -28,13 +28,12 @@ const toggleVariants = cva(
function Toggle({
className,
- variant,
- size,
+ variant = "default",
+ size = "default",
...props
-}: React.ComponentProps<typeof TogglePrimitive.Root> &
- VariantProps<typeof toggleVariants>) {
+}: TogglePrimitive.Props & VariantProps<typeof toggleVariants>) {
return (
- <TogglePrimitive.Root
+ <TogglePrimitive
data-slot="toggle"
className={cn(toggleVariants({ variant, size, className }))}
{...props}
diff --git a/src/components/ui/tooltip.tsx b/src/components/ui/tooltip.tsx
index 4ee26b38..56da4b2c 100644
--- a/src/components/ui/tooltip.tsx
+++ b/src/components/ui/tooltip.tsx
@@ -1,59 +1,63 @@
"use client"
-import * as React from "react"
-import * as TooltipPrimitive from "@radix-ui/react-tooltip"
-
+import { Tooltip as TooltipPrimitive } from "@base-ui/react/tooltip"
import { cn } from "@/lib/utils"
function TooltipProvider({
- delayDuration = 0,
+ delay = 0,
...props
-}: React.ComponentProps<typeof TooltipPrimitive.Provider>) {
+}: TooltipPrimitive.Provider.Props) {
return (
<TooltipPrimitive.Provider
data-slot="tooltip-provider"
- delayDuration={delayDuration}
+ delay={delay}
{...props}
/>
)
}
-function Tooltip({
- ...props
-}: React.ComponentProps<typeof TooltipPrimitive.Root>) {
- return (
- <TooltipProvider>
- <TooltipPrimitive.Root data-slot="tooltip" {...props} />
- </TooltipProvider>
- )
+function Tooltip({ ...props }: TooltipPrimitive.Root.Props) {
+ return <TooltipPrimitive.Root data-slot="tooltip" {...props} />
}
-function TooltipTrigger({
- ...props
-}: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {
+function TooltipTrigger({ ...props }: TooltipPrimitive.Trigger.Props) {
return <TooltipPrimitive.Trigger data-slot="tooltip-trigger" {...props} />
}
function TooltipContent({
className,
- sideOffset = 0,
+ side = "top",
+ sideOffset = 4,
+ align = "center",
+ alignOffset = 0,
children,
...props
-}: React.ComponentProps<typeof TooltipPrimitive.Content>) {
+}: TooltipPrimitive.Popup.Props &
+ Pick<
+ TooltipPrimitive.Positioner.Props,
+ "align" | "alignOffset" | "side" | "sideOffset"
+ >) {
return (
<TooltipPrimitive.Portal>
- <TooltipPrimitive.Content
- data-slot="tooltip-content"
+ <TooltipPrimitive.Positioner
+ align={align}
+ alignOffset={alignOffset}
+ side={side}
sideOffset={sideOffset}
- className={cn(
- "bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",
- className
- )}
- {...props}
+ className="isolate z-50"
>
- {children}
- <TooltipPrimitive.Arrow className="bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" />
- </TooltipPrimitive.Content>
+ <TooltipPrimitive.Popup
+ data-slot="tooltip-content"
+ className={cn(
+ "z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
+ className
+ )}
+ {...props}
+ >
+ {children}
+ <TooltipPrimitive.Arrow className="z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5" />
+ </TooltipPrimitive.Popup>
+ </TooltipPrimitive.Positioner>
</TooltipPrimitive.Portal>
)
}
diff --git a/src/index.css b/src/index.css
index ee7971a3..9103b864 100644
--- a/src/index.css
+++ b/src/index.css
@@ -1,5 +1,6 @@
@import "tailwindcss";
@import "tw-animate-css";
+@import "shadcn/tailwind.css";
@import "@fontsource-variable/inter";
@custom-variant dark (&:is(.dark *));