Beautiful, AI-native markdown IDE and LLM wiki
TypeScript 2nd-brainagent-skillsclaudecodexcompany-braindocsknowledge-knowledge-baseknowledge-managementllmllm-wikillm-wiki-karpathymarkdownmarkdown-editormdmdxnotespkmsecond-brainskills
feat(open-knowledge): add product-update signup to docs footer (#2264)
sarah638e750b1a41
diff --git a/THIRD_PARTY_NOTICES.md b/THIRD_PARTY_NOTICES.mdindex 7eea912a3..f97bcf2df 100644--- a/THIRD_PARTY_NOTICES.md+++ b/THIRD_PARTY_NOTICES.md@@ -1245,7 +1245,7 @@ Homepage: https://github.com/honojs/node-serverCopyright (c) 2022 - present, Yusuke Wada and Hono contributors-### `@hookform/[email protected]`+### `@hookform/[email protected]`Homepage: https://react-hook-form.comCopyright (c) 2019-present Beier(Bill) Luo@@ -4880,7 +4880,7 @@ Homepage: https://github.com/vasturiano/react-force-graph_(No LICENSE file in package; SPDX identifier in `package.json` is the sole declared grant.)_-### `[email protected]`+### `[email protected]`Homepage: https://react-hook-form.comCopyright (c) 2019-present Beier(Bill) Luodiff --git a/bun.lock b/bun.lockindex 34baf09f0..4384ae53e 100644--- a/bun.lock+++ b/bun.lock@@ -27,6 +27,7 @@"@codemirror/state": "^6.6.0","@codemirror/view": "^6.41.0","@floating-ui/dom": "^1.7.6",+ "@hookform/resolvers": "^5.4.0","@inkeep/cxkit-react": "^0.5.117","@inkeep/open-knowledge-core": "workspace:*","@radix-ui/react-popover": "^1.1.17",@@ -37,6 +38,7 @@"@tiptap/react": "^3.22.3","@tiptap/suggestion": "^3.22.3","@types/mdx": "^2.0.13",+ "class-variance-authority": "^0.7.1","clsx": "^2.1.1","fumadocs-core": "~16.1.0","fumadocs-mdx": "~14.0.3",@@ -49,6 +51,8 @@"radix-ui": "^1.4.3","react": "^19","react-dom": "^19",+ "react-hook-form": "^7.80.0",+ "resend": "^6.16.0","tailwind-merge": "^3.6.0","zod": "^4.3.6",},@@ -742,7 +746,7 @@"@hono/node-server": ["@hono/[email protected]", "", { "peerDependencies": { "hono": "^4" } }, "sha512-TsQLe4i2gvoTtrHje625ngThGBySOgSK3Xo2XRYOdqGN1teR8+I7vchQC46uLJi8OF62YTYA3AhSpumtkhsaKQ=="],- "@hookform/resolvers": ["@hookform/[email protected]", "", { "dependencies": { "@standard-schema/utils": "^0.3.0" }, "peerDependencies": { "react-hook-form": "^7.55.0" } }, "sha512-A/IxlMLShx3KjV/HeTcTfaMxdwy690+L/ZADoeaTltLx+CVuzkeVIPuybK3jrRfw7YZnmdKsVVHAlEPIAEUNlA=="],+ "@hookform/resolvers": ["@hookform/[email protected]", "", { "dependencies": { "@standard-schema/utils": "^0.3.0" }, "peerDependencies": { "react-hook-form": "^7.55.0" } }, "sha512-EIsqr/t/qbinPIhGjMdtvutIN1Kk4uwbROE9/UQ93CAVGR7GkA7Y92+fX80OzXi/OB67jVFYwKGO1WzkxmkFZw=="],"@iconify/types": ["@iconify/[email protected]", "", {}, "sha512-+wluvCrRhXrhyOmRDJ3q8mux9JkKy5SJ/v8ol2tu4FVjyYvtEzkc/3pK15ET6RKg4b4w4BmTk1+gsCUhf21Ykg=="],@@ -1504,6 +1508,8 @@"@size-limit/time": ["@size-limit/[email protected]", "", { "dependencies": { "estimo": "^3.0.5" }, "peerDependencies": { "size-limit": "12.1.0" } }, "sha512-ekYPeZcvkPSLsHtqNmz7F5jx3R0HV7CpY7kGasBW2yKR3NrD0JWMAcswS9OCR8OzK9hyLACRTNYTpLI9PXLczQ=="],+ "@stablelib/base64": ["@stablelib/[email protected]", "", {}, "sha512-1bnPQqSxSuc3Ii6MhBysoWCg58j97aUjuCSZrGSmDxNqtytIi0k8utUenAwTZN4V5mXXYGsVUI9zeBqy+jBOSQ=="],+"@standard-schema/spec": ["@standard-schema/[email protected]", "", {}, "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w=="],"@standard-schema/utils": ["@standard-schema/[email protected]", "", {}, "sha512-e7Mew686owMaPJVNNLs55PUvgz371nKgwsc4vxE49zsODpJEnxgxRo2y/OKrqueavXgZNMDVj3DdHFlaSAeU8g=="],@@ -2518,6 +2524,8 @@"fast-safe-stringify": ["[email protected]", "", {}, "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA=="],+ "fast-sha256": ["[email protected]", "", {}, "sha512-n11RGP/lrWEFI/bWdygLxhI+pVeo1ZYIVwvvPkW7azl/rOy+F3HYRZ2K5zeE9mmkhQppyv9sQFx0JM9UabnpPQ=="],+"fast-string-truncated-width": ["[email protected]", "", {}, "sha512-0jjjIEL6+0jag3l2XWWizO64/aZVtpiGE3t0Zgqxv0DPuxiMjvB3M24fCyhZUO4KomJQPj3LTSUnDP3GpdwC0g=="],"fast-string-width": ["[email protected]", "", { "dependencies": { "fast-string-truncated-width": "^3.0.2" } }, "sha512-gX8LrtNEI5hq8DVUfRQMbr5lpaS4nMIWV+7XEbXk2b8kiQIizgnlr12B4dA3ZEx3308ze0O4Q1R+cHts8kyUJg=="],@@ -3430,6 +3438,8 @@"possible-typed-array-names": ["[email protected]", "", {}, "sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg=="],+ "postal-mime": ["[email protected]", "", {}, "sha512-0WdnFQYUrPGGTFu1uOqD2s7omwua8xaeYGdO6rb88oD5yJ/4pPHDA4sdWqfD8wQVfCny563n/HQS7zTFft+f/g=="],+"postcss": ["[email protected]", "", { "dependencies": { "nanoid": "^3.3.11", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" } }, "sha512-7a70Nsot+EMX9fFU3064K/kdHWZqGVY+BADLyXc8Dfv+mTLLVl6JzJpPaCZ2kQL9gIJvKXSLMHhqdRRjwQeFtw=="],"postcss-selector-parser": ["[email protected]", "", { "dependencies": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" } }, "sha512-orRsuYpJVw8LdAwqqLykBj9ecS5/cRHlI5+nvTo8LcCKmzDmqVORXtOIYEEQuL9D4BxtA1lm5isAqzQZCoQ6Eg=="],@@ -3570,7 +3580,7 @@"react-force-graph-2d": ["[email protected]", "", { "dependencies": { "force-graph": "^1.51", "prop-types": "15", "react-kapsule": "^2.5" }, "peerDependencies": { "react": "*" } }, "sha512-1Rl/1Z3xy2iTHKj6a0jRXGyiI86xUti81K+jBQZ+Oe46csaMikp47L5AjrzA9hY9fNGD63X8ffrqnvaORukCuQ=="],- "react-hook-form": ["[email protected]", "", { "peerDependencies": { "react": "^16.8.0 || ^17 || ^18 || ^19" } }, "sha512-yR6wHr99p9wFv686jhRWVSFhUvDvNbdUf2dKlbno8/VKOCuoNobDGC6S+M2dua9A9Yo8vpcrp8assIYbsZCQ9g=="],+ "react-hook-form": ["[email protected]", "", { "peerDependencies": { "react": "^16.8.0 || ^17 || ^18 || ^19" } }, "sha512-4P+fk6oXsxY+6xSj7Euhc2sumQD8zQqCuVHoJwoyp9EchP+IUW9OESB7uHFJOKsIBQ4MQqYE84INJFqUCYNoOg=="],"react-is": ["[email protected]", "", {}, "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="],@@ -3666,6 +3676,8 @@"resedit": ["[email protected]", "", { "dependencies": { "pe-library": "^0.4.1" } }, "sha512-vHjcY2MlAITJhC0eRD/Vv8Vlgmu9Sd3LX9zZvtGzU5ZImdTN3+d6e/4mnTyV8vEbyf1sgNIrWxhWlrys52OkEA=="],+ "resend": ["[email protected]", "", { "dependencies": { "postal-mime": "2.7.4", "standardwebhooks": "1.0.0" }, "peerDependencies": { "@react-email/render": "*" }, "optionalPeers": ["@react-email/render"] }, "sha512-SaKISwHtxvAxneF84Njgnzg+zdngUu1vOT/paRU1De9QF+zXQR3GnwJHSh+mpJPjUhsGD4WxYi5CfKkXMkDqwg=="],+"resolve": ["[email protected]", "", { "dependencies": { "es-errors": "^1.3.0", "is-core-module": "^2.16.1", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, "bin": { "resolve": "bin/resolve" } }, "sha512-TyeJ1zif53BPfHootBGwPRYT1RUt6oGWsaQr8UyZW/eAm9bKoijtvruSDEmZHm92CwS9nj7/fWttqPCgzep8CA=="],"resolve-alpn": ["[email protected]", "", {}, "sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g=="],@@ -3832,6 +3844,8 @@"ssri": ["[email protected]", "", { "dependencies": { "minipass": "^7.0.3" } }, "sha512-S7iGNosepx9RadX82oimUkvr0Ct7IjJbEbs4mJcTxst8um95J3sDYU1RBEOvdu6oL1Wek2ODI5i4MAw+dZ6cAQ=="],+ "standardwebhooks": ["[email protected]", "", { "dependencies": { "@stablelib/base64": "^1.0.0", "fast-sha256": "^1.3.0" } }, "sha512-BbHGOQK9olHPMvQNHWul6MYlrRTAOKn03rOe4A8O3CLWhNf4YHBqq2HJKKC+sfqpxiBY52pNeesD6jIiLDz8jg=="],+"stat-mode": ["[email protected]", "", {}, "sha512-jH9EhtKIjuXZ2cWxmXS8ZP80XyC3iasQxMDV8jzhNJpfDb7VbQLVW4Wvsxz9QZvzV+G4YoSfBUVKDOyxLzi/sg=="],"statuses": ["[email protected]", "", {}, "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw=="],diff --git a/docs/.env.example b/docs/.env.exampleindex b02949aca..8953279c1 100644--- a/docs/.env.example+++ b/docs/.env.example@@ -1,3 +1,8 @@NEXT_PUBLIC_INKEEP_API_KEY=""NEXT_PUBLIC_POSTHOG_KEY=""NEXT_PUBLIC_POSTHOG_HOST="https://us.posthog.com"++# Server-only. Powers POST /api/subscribe (product-update signups via Resend).+# Never prefix with NEXT_PUBLIC_ — these must not reach the client bundle.+RESEND_API_KEY=""+RESEND_SEGMENT_ID=""diff --git a/docs/package.json b/docs/package.jsonindex bed0baac7..c85d84e49 100644--- a/docs/package.json+++ b/docs/package.json@@ -22,6 +22,7 @@"@codemirror/state": "^6.6.0","@codemirror/view": "^6.41.0","@floating-ui/dom": "^1.7.6",+ "@hookform/resolvers": "^5.4.0","@inkeep/cxkit-react": "^0.5.117","@inkeep/open-knowledge-core": "workspace:*","@radix-ui/react-popover": "^1.1.17",@@ -32,6 +33,7 @@"@tiptap/react": "^3.22.3","@tiptap/suggestion": "^3.22.3","@types/mdx": "^2.0.13",+ "class-variance-authority": "^0.7.1","clsx": "^2.1.1","fumadocs-core": "~16.1.0","fumadocs-mdx": "~14.0.3",@@ -44,6 +46,8 @@"radix-ui": "^1.4.3","react": "^19","react-dom": "^19",+ "react-hook-form": "^7.80.0",+ "resend": "^6.16.0","tailwind-merge": "^3.6.0","zod": "^4.3.6"},diff --git a/docs/src/app/(home)/footer.tsx b/docs/src/app/(home)/footer.tsxindex d01f8182f..253feb1aa 100644--- a/docs/src/app/(home)/footer.tsx+++ b/docs/src/app/(home)/footer.tsx@@ -3,6 +3,8 @@ import { DiscordIcon } from '@/components/icons/discord';import { GitHubIcon } from '@/components/icons/github';import { XIcon } from '@/components/icons/x';import { InkeepLogo } from '@/components/inkeep-logo';+import { SubscribeForm } from '@/components/subscribe-form';+import { DotTexture } from './dot-texture';const socialLinks = [{ href: 'https://github.com/inkeep/open-knowledge', label: 'GitHub', Icon: GitHubIcon },@@ -17,8 +19,12 @@ const legalLinks = [export function SiteFooter() {return (- <footer className="px-6 py-10">- <div className="container mx-auto grid grid-cols-1 items-center gap-6 min-[24rem]:grid-cols-[auto_auto] min-[24rem]:justify-between sm:grid-cols-3 sm:justify-normal">+ <footer className="relative space-y-16 overflow-hidden px-6 py-10">+ <DotTexture variant="left" className="bottom-0 left-0 w-32 sm:w-60 lg:w-96" />+ <div className="container relative z-10 mx-auto">+ <SubscribeForm />+ </div>+ <div className="container relative z-10 mx-auto mt-8 grid grid-cols-1 items-center gap-6 min-[24rem]:grid-cols-[auto_auto] min-[24rem]:justify-between sm:grid-cols-3 sm:justify-normal"><div className="flex items-center justify-center gap-5 min-[24rem]:justify-start">{socialLinks.map(({ href, label, Icon }) => (<Linkdiff --git a/docs/src/app/api/subscribe/route.ts b/docs/src/app/api/subscribe/route.tsnew file mode 100644index 000000000..daf62ad3d--- /dev/null+++ b/docs/src/app/api/subscribe/route.ts@@ -0,0 +1,48 @@+import { NextResponse } from 'next/server';+import { Resend } from 'resend';+import { z } from 'zod';++export const dynamic = 'force-dynamic';++const RESEND_API_KEY = process.env.RESEND_API_KEY;+const RESEND_SEGMENT_ID = process.env.RESEND_SEGMENT_ID;++const subscribeSchema = z.object({+ email: z.email(),+});++export async function POST(request: Request): Promise<NextResponse> {+ if (!RESEND_API_KEY || !RESEND_SEGMENT_ID) {+ console.error('[subscribe] RESEND_API_KEY or RESEND_SEGMENT_ID is not configured');+ return NextResponse.json(+ { error: 'Subscriptions are not available right now.' },+ { status: 503 },+ );+ }++ let payload: unknown;+ try {+ payload = await request.json();+ } catch {+ return NextResponse.json({ error: 'Enter a valid email address.' }, { status: 400 });+ }++ const parsed = subscribeSchema.safeParse(payload);+ if (!parsed.success) {+ return NextResponse.json({ error: 'Enter a valid email address.' }, { status: 400 });+ }++ const resend = new Resend(RESEND_API_KEY);+ const { error } = await resend.contacts.create({+ email: parsed.data.email,+ unsubscribed: false,+ segments: [{ id: RESEND_SEGMENT_ID }],+ });++ if (error) {+ console.error(`[subscribe] Resend create-contact failed: ${error.name} - ${error.message}`);+ return NextResponse.json({ error: 'Something went wrong. Please try again.' }, { status: 502 });+ }++ return NextResponse.json({ ok: true });+}diff --git a/docs/src/components/subscribe-form.tsx b/docs/src/components/subscribe-form.tsxnew file mode 100644index 000000000..0d4f8d430--- /dev/null+++ b/docs/src/components/subscribe-form.tsx@@ -0,0 +1,101 @@+'use client';++import { zodResolver } from '@hookform/resolvers/zod';+import { useState } from 'react';+import { Controller, useForm } from 'react-hook-form';+import { z } from 'zod';+import { MarketingButton } from '@/app/(home)/marketing-button';+import { Field, FieldError, FieldLabel } from '@/components/ui/field';+import { Input } from '@/components/ui/input';++const subscribeSchema = z.object({+ email: z.email({ message: 'Please enter a valid email address.' }),+});++type SubscribeValues = z.infer<typeof subscribeSchema>;++export function SubscribeForm() {+ const [submitFailed, setSubmitFailed] = useState(false);+ const [subscribed, setSubscribed] = useState(false);++ const form = useForm<SubscribeValues>({+ resolver: zodResolver(subscribeSchema),+ defaultValues: { email: '' },+ });++ async function onSubmit(values: SubscribeValues) {+ setSubmitFailed(false);+ try {+ const response = await fetch('/api/subscribe', {+ method: 'POST',+ headers: { 'content-type': 'application/json' },+ body: JSON.stringify(values),+ });+ if (response.ok) {+ form.reset();+ setSubscribed(true);+ } else {+ setSubmitFailed(true);+ }+ } catch (err) {+ console.error(+ `[subscribe-form] fetch failed: ${err instanceof Error ? err.message : String(err)}`,+ );+ setSubmitFailed(true);+ }+ }++ if (subscribed) {+ return (+ <p className="text-sm text-slide-muted" role="status">+ Thanks for subscribing. Watch your inbox for product updates.+ </p>+ );+ }++ return (+ <form onSubmit={form.handleSubmit(onSubmit)} className="flex w-full max-w-2xl flex-col gap-2">+ <Controller+ control={form.control}+ name="email"+ render={({ field, fieldState }) => (+ <Field data-invalid={fieldState.invalid}>+ <FieldLabel className="text-lg leading-tight tracking-tight" htmlFor={field.name}>+ Stay in the loop+ </FieldLabel>+ <div className="relative h-14 w-full">+ <Input+ {...field}+ id={field.name}+ type="email"+ inputMode="email"+ autoComplete="email"+ spellCheck={false}+ placeholder="[email protected]"+ aria-invalid={fieldState.invalid}+ className="h-full w-full rounded-full border bg-fd-background pr-36 pl-6 text-gray-900 placeholder:text-slide-muted/60 focus-visible:ring-2 focus-visible:ring-slide-accent focus-visible:ring-offset-2 shadow-none"+ />+ <div className="absolute inset-y-0 right-2 flex items-center">+ <MarketingButton+ type="submit"+ variant="primary"+ size="md"+ disabled={form.formState.isSubmitting}+ className="h-10"+ >+ Subscribe+ </MarketingButton>+ </div>+ </div>+ <FieldError className="text-red-500" errors={[fieldState.error]} />+ </Field>+ )}+ />+ {submitFailed ? (+ <p className="text-sm text-red-500" role="alert">+ Something went wrong. Please try again.+ </p>+ ) : null}+ </form>+ );+}diff --git a/docs/src/components/ui/field.tsx b/docs/src/components/ui/field.tsxnew file mode 100644index 000000000..5ef2ddc87--- /dev/null+++ b/docs/src/components/ui/field.tsx@@ -0,0 +1,235 @@+'use client';++import { cva, type VariantProps } from 'class-variance-authority';+import { Label } from '@/components/ui/label';+import { Separator } from '@/components/ui/separator';+import { cn } from '@/lib/utils';++function FieldSet({ className, ...props }: React.ComponentProps<'fieldset'>) {+ return (+ <fieldset+ data-slot="field-set"+ className={cn(+ 'flex flex-col gap-6',+ 'has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3',+ className,+ )}+ {...props}+ />+ );+}++function FieldLegend({+ className,+ variant = 'legend',+ ...props+}: React.ComponentProps<'legend'> & { variant?: 'legend' | 'label' }) {+ return (+ <legend+ data-slot="field-legend"+ data-variant={variant}+ className={cn(+ 'mb-3 font-medium',+ 'data-[variant=legend]:text-base',+ 'data-[variant=label]:text-sm',+ className,+ )}+ {...props}+ />+ );+}++function FieldGroup({ className, ...props }: React.ComponentProps<'div'>) {+ return (+ <div+ data-slot="field-group"+ className={cn(+ 'group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4',+ className,+ )}+ {...props}+ />+ );+}++const fieldVariants = cva('group/field flex w-full gap-3 data-[invalid=true]:text-destructive', {+ variants: {+ orientation: {+ vertical: ['flex-col [&>*]:w-full [&>.sr-only]:w-auto'],+ horizontal: [+ 'flex-row items-center',+ '[&>[data-slot=field-label]]:flex-auto',+ 'has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px',+ ],+ responsive: [+ 'flex-col @md/field-group:flex-row @md/field-group:items-center [&>*]:w-full @md/field-group:[&>*]:w-auto [&>.sr-only]:w-auto',+ '@md/field-group:[&>[data-slot=field-label]]:flex-auto',+ '@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px',+ ],+ },+ },+ defaultVariants: {+ orientation: 'vertical',+ },+});++function Field({+ className,+ orientation = 'vertical',+ ...props+}: React.ComponentProps<'div'> & VariantProps<typeof fieldVariants>) {+ return (+ // biome-ignore lint/a11y/useSemanticElements: Field is a styled div-based group wrapper, not a fieldset+ <div+ role="group"+ data-slot="field"+ data-orientation={orientation}+ className={cn(fieldVariants({ orientation }), className)}+ {...props}+ />+ );+}++function FieldContent({ className, ...props }: React.ComponentProps<'div'>) {+ return (+ <div+ data-slot="field-content"+ className={cn('group/field-content flex flex-1 flex-col gap-1.5 leading-snug', className)}+ {...props}+ />+ );+}++function FieldLabel({ className, ...props }: React.ComponentProps<typeof Label>) {+ return (+ <Label+ data-slot="field-label"+ className={cn(+ 'group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50',+ 'has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4',+ 'has-data-[state=checked]:border-primary has-data-[state=checked]:bg-primary/5 dark:has-data-[state=checked]:bg-primary/10',+ className,+ )}+ {...props}+ />+ );+}++function FieldTitle({ className, ...props }: React.ComponentProps<'div'>) {+ return (+ <div+ data-slot="field-label"+ className={cn(+ 'flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50',+ className,+ )}+ {...props}+ />+ );+}++function FieldDescription({ className, ...props }: React.ComponentProps<'p'>) {+ return (+ <p+ data-slot="field-description"+ className={cn(+ 'text-sm leading-normal font-normal text-muted-foreground group-has-[[data-orientation=horizontal]]/field:text-balance',+ 'last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5',+ '[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary',+ className,+ )}+ {...props}+ />+ );+}++function FieldSeparator({+ children,+ className,+ ...props+}: React.ComponentProps<'div'> & {+ children?: React.ReactNode;+}) {+ return (+ <div+ data-slot="field-separator"+ data-content={!!children}+ className={cn(+ 'relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2',+ className,+ )}+ {...props}+ >+ <Separator className="absolute inset-0 top-1/2" />+ {children && (+ <span+ className="relative mx-auto block w-fit bg-background px-2 text-muted-foreground"+ data-slot="field-separator-content"+ >+ {children}+ </span>+ )}+ </div>+ );+}++function FieldError({+ className,+ children,+ errors,+ ...props+}: React.ComponentProps<'div'> & {+ errors?: Array<{ message?: string } | undefined>;+}) {+ const content = (() => {+ if (children) {+ return children;+ }++ if (!errors?.length) {+ return null;+ }++ const uniqueErrors = [...new Map(errors.map((error) => [error?.message, error])).values()];++ if (uniqueErrors?.length === 1) {+ return uniqueErrors[0]?.message;+ }++ return (+ <ul className="ml-4 flex list-disc flex-col gap-1">+ {uniqueErrors.map(+ (error) => error?.message && <li key={error.message}>{error.message}</li>,+ )}+ </ul>+ );+ })();++ if (!content) {+ return null;+ }++ return (+ <div+ role="alert"+ data-slot="field-error"+ className={cn('text-sm font-normal text-destructive', className)}+ {...props}+ >+ {content}+ </div>+ );+}++export {+ Field,+ FieldContent,+ FieldDescription,+ FieldError,+ FieldGroup,+ FieldLabel,+ FieldLegend,+ FieldSeparator,+ FieldSet,+ FieldTitle,+};diff --git a/docs/src/components/ui/input.tsx b/docs/src/components/ui/input.tsxnew file mode 100644index 000000000..b6256c47a--- /dev/null+++ b/docs/src/components/ui/input.tsx@@ -0,0 +1,21 @@+import type * as React from 'react';++import { cn } from '@/lib/utils';++function Input({ className, type, ...props }: React.ComponentProps<'input'>) {+ return (+ <input+ type={type}+ data-slot="input"+ className={cn(+ 'h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground 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 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30',+ 'focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50',+ 'aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40',+ className,+ )}+ {...props}+ />+ );+}++export { Input };diff --git a/docs/src/components/ui/label.tsx b/docs/src/components/ui/label.tsxnew file mode 100644index 000000000..41e359e0a--- /dev/null+++ b/docs/src/components/ui/label.tsx@@ -0,0 +1,21 @@+'use client';++import { Label as LabelPrimitive } from 'radix-ui';+import type * as React from 'react';++import { cn } from '@/lib/utils';++function Label({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>) {+ return (+ <LabelPrimitive.Root+ data-slot="label"+ className={cn(+ 'flex items-center gap-2 text-sm leading-none font-medium 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}+ />+ );+}++export { Label };diff --git a/docs/src/components/ui/separator.tsx b/docs/src/components/ui/separator.tsxnew file mode 100644index 000000000..8dda2b9c5--- /dev/null+++ b/docs/src/components/ui/separator.tsx@@ -0,0 +1,28 @@+'use client';++import { Separator as SeparatorPrimitive } from 'radix-ui';+import type * as React from 'react';++import { cn } from '@/lib/utils';++function Separator({+ className,+ orientation = 'horizontal',+ decorative = true,+ ...props+}: React.ComponentProps<typeof SeparatorPrimitive.Root>) {+ return (+ <SeparatorPrimitive.Root+ data-slot="separator"+ decorative={decorative}+ orientation={orientation}+ className={cn(+ 'shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px',+ className,+ )}+ {...props}+ />+ );+}++export { Separator };