diff --git a/components.json b/components.json index f892854..ac1fc34 100644 --- a/components.json +++ b/components.json @@ -19,6 +19,7 @@ "hooks": "@/hooks" }, "registries": { - "@reui": "https://reui.io/r/{name}.json" + "@reui": "https://reui.io/r/{name}.json", + "@diceui": "https://diceui.com/r/{name}.json" } } diff --git a/package-lock.json b/package-lock.json index 0d54129..6704809 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,6 +8,7 @@ "name": "scheduler", "version": "0.0.0", "dependencies": { + "@diceui/mention": "^0.8.0", "@hookform/resolvers": "^5.2.2", "@radix-ui/react-accordion": "^1.2.12", "@radix-ui/react-alert-dialog": "^1.1.15", @@ -376,6 +377,50 @@ "integrity": "sha512-P5LUNhtbj6YfI3iJjw5EL9eUAG6OitD0W3fWQcpQjDRc/QIsL0tRNuO1PcDvPccWL1fSTXXdE1ds+l95DV/OFA==", "license": "MIT" }, + "node_modules/@diceui/mention": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@diceui/mention/-/mention-0.8.0.tgz", + "integrity": "sha512-BHTYLG4qJA+9TJ/n5otlIHoJuLz5v13xAayYsRL7lnCnp4ik37uYrLpA+25y+uQmJ5i1W3kv2MfD2ZasvDzDDw==", + "license": "MIT", + "dependencies": { + "@diceui/shared": "0.12.0", + "@floating-ui/react": "^0.27.4" + }, + "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/@diceui/shared": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/@diceui/shared/-/shared-0.12.0.tgz", + "integrity": "sha512-aJ+gxHTleFD8b9DgXOb7G0sHymW8nMK4C3KXDMca4+PPl1NsfRG/Lnb2dN8vq44XOb/W7Wjn3gmgakXAOzgrJA==", + "peerDependencies": { + "@floating-ui/react": "^0.27.4", + "@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/@esbuild/aix-ppc64": { "version": "0.25.11", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.11.tgz", @@ -968,6 +1013,22 @@ "@floating-ui/utils": "^0.2.10" } }, + "node_modules/@floating-ui/react": { + "version": "0.27.16", + "resolved": "https://registry.npmjs.org/@floating-ui/react/-/react-0.27.16.tgz", + "integrity": "sha512-9O8N4SeG2z++TSM8QA/KTeKFBVCNEz/AGS7gWPJf6KFRzmRWixFRnCnkPHRDwSVZW6QPDO6uT0P2SpWNKCc9/g==", + "license": "MIT", + "peer": true, + "dependencies": { + "@floating-ui/react-dom": "^2.1.6", + "@floating-ui/utils": "^0.2.10", + "tabbable": "^6.0.0" + }, + "peerDependencies": { + "react": ">=17.0.0", + "react-dom": ">=17.0.0" + } + }, "node_modules/@floating-ui/react-dom": { "version": "2.1.6", "resolved": "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-2.1.6.tgz", @@ -6375,6 +6436,12 @@ "node": ">=8" } }, + "node_modules/tabbable": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/tabbable/-/tabbable-6.3.0.tgz", + "integrity": "sha512-EIHvdY5bPLuWForiR/AN2Bxngzpuwn1is4asboytXtpTgsArc+WmSJKVLlhdh71u7jFcryDqB2A8lQvj78MkyQ==", + "license": "MIT" + }, "node_modules/tailwind-merge": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-3.4.0.tgz", diff --git a/package.json b/package.json index 0254749..9b90fab 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "preview": "vite preview" }, "dependencies": { + "@diceui/mention": "^0.8.0", "@hookform/resolvers": "^5.2.2", "@radix-ui/react-accordion": "^1.2.12", "@radix-ui/react-alert-dialog": "^1.1.15", diff --git a/src/components/ui/mention.tsx b/src/components/ui/mention.tsx new file mode 100644 index 0000000..fefdf0d --- /dev/null +++ b/src/components/ui/mention.tsx @@ -0,0 +1,91 @@ +import * as MentionPrimitive from "@diceui/mention"; +import type * as React from "react"; + +import { cn } from "@/lib/utils"; + +function Mention({ + className, + ...props +}: React.ComponentProps) { + return ( + + ); +} + +function MentionLabel({ + className, + ...props +}: React.ComponentProps) { + return ( + + ); +} + +function MentionInput({ + className, + ...props +}: React.ComponentProps) { + return ( + + ); +} + +function MentionContent({ + className, + children, + ...props +}: React.ComponentProps) { + return ( + + + {children} + + + ); +} + +function MentionItem({ + className, + children, + ...props +}: React.ComponentProps) { + return ( + + {children} + + ); +} + +export { Mention, MentionContent, MentionInput, MentionItem, MentionLabel }; diff --git a/src/components/ui/textarea.tsx b/src/components/ui/textarea.tsx index 7f21b5e..798e032 100644 --- a/src/components/ui/textarea.tsx +++ b/src/components/ui/textarea.tsx @@ -7,7 +7,7 @@ function Textarea({ className, ...props }: React.ComponentProps<"textarea">) {