{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"signup-form","type":"registry:block","title":"Sign up form","description":"An account creation flow with field validation, password strength, and a clear completion state.","categories":["blocks"],"dependencies":["@radix-ui/react-checkbox","motion"],"registryDependencies":["https://ui.teamofsilicons.com/r/silicon-motion-tokens.json","https://ui.teamofsilicons.com/r/button.json","https://ui.teamofsilicons.com/r/checkbox.json","https://ui.teamofsilicons.com/r/input.json","https://ui.teamofsilicons.com/r/password-field.json"],"files":[{"path":"registry/blocks/signup-form/signup-form.tsx","type":"registry:component","target":"@components/silicon-ui/blocks/signup-form/signup-form.tsx","content":"\"use client\";\n\nimport { useCallback, useEffect, useId, useLayoutEffect, useRef, useState, type FormEvent } from \"react\";\nimport { AnimatePresence, animate, motion, useMotionValue, useReducedMotion, type Transition, type Variants } from \"motion/react\";\nimport { Button } from \"../../button/button\";\nimport { Checkbox } from \"../../checkbox/checkbox\";\nimport { Input } from \"../../input/input\";\nimport { PasswordField } from \"../../password-field/password-field\";\nimport { motionTokens } from \"../../lib/motion-tokens\";\nimport styles from \"./signup-form.module.css\";\n\nexport interface SignupDetails {\n  name: string;\n  email: string;\n  password: string;\n  productUpdates: boolean;\n}\n\ntype Provider = \"Google\" | \"Apple\" | \"GitHub\";\n\nexport interface SignupFormProps {\n  /** Receives the details once every field is valid. Throw to show a submit error. */\n  onSubmit?: (details: SignupDetails) => void | Promise<void>;\n  /** An error from your API, shown above the submit button. */\n  serverError?: string | null;\n  /** Called when someone picks a single sign-on provider. The preview simulates the redirect. */\n  onProvider?: (provider: Provider) => void;\n}\n\ntype Field = \"name\" | \"email\" | \"password\";\ntype Step = \"form\" | \"done\";\ntype StepCustom = { direction: number; reduce: boolean };\n\nconst providers: Provider[] = [\"Google\", \"Apple\", \"GitHub\"];\n/** The official four-colour Google \"G\"; Apple and GitHub ship monochrome marks, drawn in currentColor. */\nfunction GoogleLogo() {\n  return <svg className={styles.providerMark} width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n    <path fill=\"#4285F4\" d=\"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z\" />\n    <path fill=\"#34A853\" d=\"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z\" />\n    <path fill=\"#FBBC05\" d=\"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z\" />\n    <path fill=\"#EA4335\" d=\"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z\" />\n  </svg>;\n}\nconst monoMarks: Record<Exclude<Provider, \"Google\">, string> = {\n  Apple: \"M12.152 6.896c-.948 0-2.415-1.078-3.96-1.04-2.04.027-3.91 1.183-4.961 3.014-2.117 3.675-.546 9.103 1.519 12.09 1.013 1.454 2.208 3.09 3.792 3.039 1.52-.065 2.09-.987 3.935-.987 1.831 0 2.35.987 3.96.948 1.637-.026 2.676-1.48 3.676-2.948 1.156-1.688 1.636-3.325 1.662-3.415-.039-.013-3.182-1.221-3.22-4.857-.026-3.04 2.48-4.494 2.597-4.559-1.429-2.09-3.623-2.324-4.39-2.376-2-.156-3.675 1.09-4.61 1.09zM15.53 3.83c.843-1.012 1.4-2.427 1.245-3.83-1.207.052-2.662.805-3.532 1.818-.78.896-1.454 2.338-1.273 3.714 1.338.104 2.715-.688 3.559-1.701\",\n  GitHub: \"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12\",\n};\n\nfunction getErrors(name: string, email: string, password: string) {\n  return {\n    name: name.trim().length < 2 ? \"Enter your full name.\" : \"\",\n    email: !/^[^\\s@]+@[^\\s@]+\\.[^\\s@]{2,}$/.test(email.trim()) ? \"Enter a full address, like name@example.com.\" : \"\",\n    password: password.length < 8 ? \"Use at least 8 characters.\" : \"\",\n  };\n}\n\nfunction passwordScore(password: string) {\n  if (!password) return 0;\n  return [password.length >= 8, password.length >= 12, /[a-z]/.test(password) && /[A-Z]/.test(password), /\\d|[^\\w\\s]/.test(password)].filter(Boolean).length;\n}\nconst strengthLabel = [\"\", \"Weak\", \"Fair\", \"Good\", \"Strong\"];\n\n/** Steps cross over sideways out of a small blur; going back, they return from the other side. */\nconst stepMotion: Variants = {\n  enter: ({ direction, reduce }: StepCustom) => reduce ? { opacity: 0 } : { opacity: 0, x: direction * 24, filter: `blur(${motionTokens.blur.soft}px)` },\n  center: ({ reduce }: StepCustom) => ({ opacity: 1, x: 0, filter: \"blur(0px)\", transition: reduce ? { duration: motionTokens.duration.instant } : { x: motionTokens.spring.smooth, opacity: { duration: motionTokens.duration.standard, ease: motionTokens.ease.enter, delay: .05 }, filter: { duration: motionTokens.duration.standard, ease: motionTokens.ease.enter } } }),\n  exit: ({ direction, reduce }: StepCustom) => reduce ? { opacity: 0, transition: { duration: 0 } } : { opacity: 0, x: direction * -16, filter: `blur(${motionTokens.blur.soft}px)`, transition: { x: motionTokens.spring.smooth, opacity: { duration: motionTokens.duration.exit, ease: motionTokens.ease.standard }, filter: { duration: motionTokens.duration.exit } } },\n};\nconst swap = (reduce: boolean) => ({\n  initial: reduce ? { opacity: 0 } : { opacity: 0, y: 6, filter: `blur(${motionTokens.blur.soft}px)` },\n  animate: { opacity: 1, y: 0, filter: \"blur(0px)\" },\n  exit: reduce ? { opacity: 0, transition: { duration: 0 } } : { opacity: 0, y: -4, filter: `blur(${motionTokens.blur.subtle}px)`, transition: { duration: motionTokens.duration.fast } },\n  transition: (reduce ? { duration: motionTokens.duration.instant } : { duration: motionTokens.duration.standard, ease: motionTokens.ease.enter }) as Transition,\n});\n\n/** The card follows its content on a spring only while the step changes; otherwise it stays auto, so field messages open without lag. */\nfunction useStepHeight(step: Step, reduce: boolean) {\n  const track = useRef<HTMLDivElement>(null);\n  const height = useMotionValue<number | \"auto\">(\"auto\");\n  const measured = useRef(0);\n  const gliding = useRef(false);\n  const lastStep = useRef(step);\n  const glide = useCallback((to: number) => {\n    gliding.current = true;\n    animate(height, to, { ...motionTokens.spring.smooth, onComplete: () => { gliding.current = false; height.jump(\"auto\"); } });\n  }, [height]);\n  useEffect(() => {\n    const node = track.current;\n    if (!node || typeof ResizeObserver === \"undefined\") return;\n    const observer = new ResizeObserver(([entry]) => {\n      if (!entry) return;\n      measured.current = entry.borderBoxSize?.[0]?.blockSize ?? node.offsetHeight;\n      if (gliding.current) glide(measured.current);\n    });\n    observer.observe(node);\n    return () => observer.disconnect();\n  }, [glide]);\n  useLayoutEffect(() => {\n    if (lastStep.current === step) return;\n    lastStep.current = step;\n    const current = height.get();\n    const from = typeof current === \"number\" ? current : measured.current;\n    const to = track.current?.offsetHeight ?? 0;\n    if (reduce || !from || !to) { gliding.current = false; height.jump(\"auto\"); return; }\n    if (current === \"auto\") height.jump(from);\n    glide(to);\n  }, [step, reduce, height, glide]);\n  return { track, height };\n}\n\nexport function SignupForm({ onSubmit, serverError, onProvider }: SignupFormProps) {\n  const reduce = !!useReducedMotion();\n  const feedbackId = useId();\n  const nameRef = useRef<HTMLInputElement>(null);\n  const emailRef = useRef<HTMLInputElement>(null);\n  const passwordRef = useRef<HTMLInputElement>(null);\n  const doneRef = useRef<HTMLHeadingElement>(null);\n  const timers = useRef<number[]>([]);\n  const [step, setStep] = useState<Step>(\"form\");\n  const [direction, setDirection] = useState(1);\n  const [name, setName] = useState(\"\");\n  const [email, setEmail] = useState(\"\");\n  const [password, setPassword] = useState(\"\");\n  const [productUpdates, setProductUpdates] = useState(false);\n  const [touched, setTouched] = useState<Record<Field, boolean>>({ name: false, email: false, password: false });\n  const [submitted, setSubmitted] = useState(false);\n  const [busy, setBusy] = useState<null | \"form\" | Provider>(null);\n  const [method, setMethod] = useState<\"Email\" | Provider>(\"Email\");\n  const [submitError, setSubmitError] = useState(\"\");\n  const [status, setStatus] = useState(\"\");\n  const { track, height } = useStepHeight(step, reduce);\n  const errors = getErrors(name, email, password);\n  const score = passwordScore(password);\n  const visibleError = (field: Field) => (touched[field] || submitted ? errors[field] : \"\");\n  const passwordError = visibleError(\"password\");\n  const custom: StepCustom = { direction, reduce };\n  const shownError = submitError || serverError || \"\";\n  const feedback = passwordError ? { key: \"error\", text: passwordError } : password ? { key: `s${score}`, text: `${strengthLabel[Math.max(score, 1)]} password` } : { key: \"hint\", text: \"Use 8 or more characters.\" };\n\n  useEffect(() => { const pending = timers.current; return () => pending.forEach(window.clearTimeout); }, []);\n  useEffect(() => { if (step === \"done\") doneRef.current?.focus(); }, [step]);\n\n  function markTouched(field: Field) {\n    setTouched(current => ({ ...current, [field]: true }));\n  }\n\n  function finish(how: \"Email\" | Provider) {\n    setBusy(null);\n    setMethod(how);\n    setDirection(1);\n    setStep(\"done\");\n    setStatus(`Account created with ${how === \"Email\" ? \"your email\" : how}`);\n  }\n\n  async function submit(event: FormEvent<HTMLFormElement>) {\n    event.preventDefault();\n    if (busy) return;\n    setSubmitted(true);\n    setSubmitError(\"\");\n    const nextErrors = getErrors(name, email, password);\n    const firstInvalid = (Object.keys(nextErrors) as Field[]).find(field => nextErrors[field]);\n    if (firstInvalid) {\n      ({ name: nameRef, email: emailRef, password: passwordRef })[firstInvalid].current?.focus();\n      return;\n    }\n    setBusy(\"form\");\n    setStatus(\"Creating your account\");\n    try {\n      await Promise.all([onSubmit?.({ name: name.trim(), email: email.trim(), password, productUpdates }), new Promise(resolve => window.setTimeout(resolve, 700))]);\n      finish(\"Email\");\n    } catch (error) {\n      setBusy(null);\n      setSubmitError(error instanceof Error && error.message ? error.message : \"We couldn't create your account. Try again.\");\n      setStatus(\"Account not created\");\n    }\n  }\n\n  function continueWith(provider: Provider) {\n    if (busy) return;\n    setBusy(provider);\n    setStatus(`Opening ${provider}`);\n    onProvider?.(provider);\n    timers.current.push(window.setTimeout(() => {\n      if (!name.trim()) setName(\"Jasmine Brooks\");\n      if (!email.trim()) setEmail(\"jasmine@northwind.studio\");\n      finish(provider);\n    }, 900));\n  }\n\n  function reset() {\n    setName(\"\");\n    setEmail(\"\");\n    setPassword(\"\");\n    setProductUpdates(false);\n    setTouched({ name: false, email: false, password: false });\n    setSubmitted(false);\n    setSubmitError(\"\");\n    setDirection(-1);\n    setStep(\"form\");\n    setStatus(\"Start again with new details\");\n    timers.current.push(window.setTimeout(() => nameRef.current?.focus(), 60));\n  }\n\n  const firstName = name.trim().split(/\\s+/)[0] || \"there\";\n\n  return (\n    <section className={styles.block} aria-label=\"Create a Silicon account\">\n      <motion.div className={styles.viewport} style={{ height }}>\n        <div ref={track} className={styles.track}>\n          <AnimatePresence mode=\"popLayout\" initial={false} custom={custom}>\n            {step === \"form\" ? (\n              <motion.div key=\"form\" className={styles.step} custom={custom} variants={stepMotion} initial=\"enter\" animate=\"center\" exit=\"exit\">\n                <div className={styles.heading}><h2>Create your account</h2><p>Start with your work email. You can invite your team after.</p></div>\n                <div className={styles.sso} role=\"group\" aria-label=\"Sign up with\">\n                  {providers.map(provider => <Button key={provider} type=\"button\" variant=\"secondary\" className={styles.ssoButton} aria-label={`Sign up with ${provider}`} loading={busy === provider} aria-disabled={(!!busy && busy !== provider) || undefined} onClick={() => continueWith(provider)}>\n                    {provider === \"Google\" ? <GoogleLogo /> : <svg className={styles.providerMark} width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden=\"true\"><path d={monoMarks[provider]} /></svg>}{provider}\n                  </Button>)}\n                </div>\n                <div className={styles.divider}>or</div>\n                <form onSubmit={event => void submit(event)} noValidate className={styles.form}>\n                  <Input ref={nameRef} label=\"Full name\" name=\"name\" autoComplete=\"name\" placeholder=\"Jasmine Brooks\" value={name} onChange={event => setName(event.target.value)} onBlur={() => { if (name) markTouched(\"name\"); }} error={visibleError(\"name\")} readOnly={!!busy} />\n                  <Input ref={emailRef} label=\"Work email\" name=\"email\" type=\"email\" inputMode=\"email\" autoComplete=\"email\" autoCapitalize=\"none\" spellCheck={false} placeholder=\"name@example.com\" value={email} onChange={event => setEmail(event.target.value)} onBlur={() => { if (email) markTouched(\"email\"); }} error={visibleError(\"email\")} readOnly={!!busy} />\n                  <div className={styles.passwordGroup}>\n                    <PasswordField ref={passwordRef} label=\"Password\" name=\"password\" autoComplete=\"new-password\" value={password} onChange={event => setPassword(event.target.value)} onBlur={() => { if (password) markTouched(\"password\"); }} aria-invalid={passwordError ? true : undefined} aria-describedby={feedbackId} readOnly={!!busy} />\n                    <div className={styles.feedback}>\n                      <span id={feedbackId} className={styles.feedbackText} data-error={passwordError ? true : undefined} role={passwordError ? \"alert\" : undefined}>\n                        <AnimatePresence mode=\"popLayout\" initial={false}><motion.span key={feedback.key} {...swap(reduce)}>{feedback.text}</motion.span></AnimatePresence>\n                      </span>\n                      <span className={styles.meter} data-level={score} aria-hidden=\"true\">{[1, 2, 3, 4].map(bar => <span key={bar} data-on={bar <= score || undefined} />)}</span>\n                    </div>\n                  </div>\n                  <div className={styles.updates}><Checkbox label=\"Email me product updates\" checked={productUpdates} onCheckedChange={checked => setProductUpdates(checked === true)} disabled={!!busy} /></div>\n                  <AnimatePresence initial={false}>\n                    {shownError && <motion.div key=\"error\" className={styles.row} initial={{ height: 0, opacity: 0 }} animate={{ height: \"auto\", opacity: 1 }} exit={{ height: 0, opacity: 0 }} transition={reduce ? { duration: 0 } : { height: motionTokens.spring.smooth, opacity: { duration: motionTokens.duration.fast } }}>\n                      <p className={styles.submitError} role=\"alert\">{shownError}</p>\n                    </motion.div>}\n                  </AnimatePresence>\n                  <Button className={styles.wide} type=\"submit\" loading={busy === \"form\"}>Create account</Button>\n                </form>\n                <p className={styles.legal}>By creating an account you agree to the <button type=\"button\" className={styles.textButton} onClick={() => setStatus(\"Terms open in your app\")}>Terms</button> and <button type=\"button\" className={styles.textButton} onClick={() => setStatus(\"Privacy policy opens in your app\")}>Privacy policy</button>.</p>\n              </motion.div>\n            ) : (\n              <motion.div key=\"done\" className={styles.step} custom={custom} variants={stepMotion} initial=\"enter\" animate=\"center\" exit=\"exit\">\n                <svg className={styles.success} viewBox=\"0 0 48 48\" aria-hidden=\"true\">\n                  <g transform=\"rotate(-90 24 24)\"><motion.circle cx=\"24\" cy=\"24\" r=\"22.25\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" initial={reduce ? false : { pathLength: 0, opacity: 0 }} animate={{ pathLength: 1, opacity: 1 }} transition={{ pathLength: { duration: motionTokens.duration.expressive, ease: motionTokens.ease.inOut, delay: motionTokens.duration.standard }, opacity: { duration: motionTokens.duration.instant, delay: motionTokens.duration.standard } }} /></g>\n                  <motion.path d=\"M15.5 24.5l5.5 5.5 11.5-12\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" initial={reduce ? false : { pathLength: 0, opacity: 0 }} animate={{ pathLength: 1, opacity: 1 }} transition={{ pathLength: { duration: motionTokens.duration.standard + .08, ease: motionTokens.ease.enter, delay: .5 }, opacity: { duration: motionTokens.duration.instant, delay: .5 } }} />\n                </svg>\n                <div className={styles.heading}><h2 ref={doneRef} tabIndex={-1}>Welcome, {firstName}</h2><p>Your account is ready. We sent a confirmation to <span className={styles.address}>{email.trim()}</span>.</p></div>\n                <dl className={styles.details}>\n                  <div><dt>Signed up with</dt><dd>{method}</dd></div>\n                  <div><dt>Product updates</dt><dd>{productUpdates ? \"On\" : \"Off\"}</dd></div>\n                </dl>\n                <Button type=\"button\" variant=\"secondary\" className={styles.wide} onClick={reset}>Start over</Button>\n              </motion.div>\n            )}\n          </AnimatePresence>\n        </div>\n      </motion.div>\n\n      <footer className={styles.footer}>\n        <p className={styles.srOnly} role=\"status\" aria-live=\"polite\">{status}</p>\n        <span className={styles.status} aria-hidden=\"true\"><AnimatePresence mode=\"popLayout\" initial={false}><motion.span key={status} {...swap(reduce)}>{status}</motion.span></AnimatePresence></span>\n        <span className={styles.switch}>Have an account? <button type=\"button\" className={styles.textButton} onClick={() => setStatus(\"Sign in opens in your app\")}>Sign in</button></span>\n      </footer>\n    </section>\n  );\n}\n\nexport default SignupForm;\n"},{"path":"registry/blocks/signup-form/signup-form.module.css","type":"registry:component","target":"@components/silicon-ui/blocks/signup-form/signup-form.module.css","content":"/* Same card, spacing, and control heights as the sign in variants, so the family reads as one flow. */\n.block { container: signup / inline-size; width: min(100%, 432px); min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-overlay); corner-shape: var(--corner-shape); background: var(--surface); color: var(--foreground); font-family: var(--font-body); letter-spacing: var(--tracking-body); }\n.viewport { overflow: hidden; }\n.track { position: relative; }\n.step { display: grid; min-width: 0; padding: var(--space-block); }\n\n.heading { display: grid; gap: var(--space-related); margin-bottom: var(--space-section); }\n.heading h2 { margin: 0; font-family: var(--font-display); font-size: var(--text-3xl); font-weight: var(--weight-regular); letter-spacing: var(--tracking-display); line-height: var(--leading-display); text-wrap: balance; outline: none; }\n.heading p { margin: 0; color: var(--text-secondary); font-size: var(--text-sm); line-height: var(--leading-body); text-wrap: pretty; }\n.address { color: var(--foreground); overflow-wrap: anywhere; }\n\n.sso { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-related); }\n.sso .ssoButton { min-width: 0; padding-inline: var(--space-related); }\n.providerMark { flex: none; }\n.divider { display: flex; align-items: center; gap: var(--space-group); margin: var(--space-comfort) 0; color: var(--text-muted); font-size: var(--text-xs); line-height: 1; }\n.divider::before, .divider::after { flex: 1; height: 1px; background: var(--border); content: \"\"; }\n\n.form { display: grid; gap: var(--space-inset); }\n.wide { width: 100%; }\n.passwordGroup { display: grid; min-width: 0; }\n/* One stable row under the password: the words change in place and the meter fills beside them. */\n.feedback { display: flex; min-height: 18px; align-items: center; justify-content: space-between; gap: var(--space-group); margin-top: var(--space-related); font-size: var(--text-xs); line-height: var(--leading-body); }\n.feedbackText { position: relative; min-width: 0; flex: 1; color: var(--text-muted); }\n.feedbackText > span { display: block; }\n.feedbackText[data-error] { color: var(--danger); }\n.meter { display: flex; flex: none; gap: var(--space-tight); }\n.meter span { width: 20px; height: 3px; border-radius: var(--radius-full); corner-shape: round; background: var(--border); transition: background-color var(--duration-fast) var(--ease-standard); }\n.meter span[data-on] { background: var(--accent); }\n.meter[data-level=\"1\"] span[data-on] { background: var(--danger); }\n.meter[data-level=\"2\"] span[data-on] { background: var(--warning); }\n.meter[data-level=\"4\"] span[data-on] { background: var(--success); }\n\n/* The checkbox keeps a full size hit area; pull it out so the square lines up with the fields. */\n.updates { margin: calc(var(--space-related) * -1) 0 calc(var(--space-related) * -1) calc((var(--control-height-md) - var(--space-comfort)) / -2); }\n.row { overflow: hidden; }\n.submitError { margin: 0; color: var(--danger); font-size: var(--text-xs); line-height: var(--leading-body); }\n.legal { margin: var(--space-inset) 0 0; color: var(--text-muted); font-size: var(--text-xs); line-height: var(--leading-body); text-wrap: pretty; }\n.textButton { border: 0; padding: 0; background: none; color: var(--text-secondary); font: inherit; text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; cursor: pointer; transition: color var(--duration-fast) var(--ease-standard), text-decoration-color var(--duration-fast) var(--ease-standard); }\n\n.success { display: block; width: 48px; height: 48px; margin-bottom: var(--space-section); overflow: visible; color: var(--success); }\n.details { display: grid; margin: 0 0 var(--space-section); border-top: 1px solid var(--border); padding: 0; }\n.details div { display: flex; justify-content: space-between; gap: var(--space-inset); border-bottom: 1px solid var(--border); padding: var(--space-group) 0; font-size: var(--text-sm); line-height: var(--leading-body); }\n.details dt { color: var(--text-secondary); }\n.details dd { margin: 0; text-align: right; }\n\n.footer { display: flex; min-height: 48px; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-tight) var(--space-inset); border-top: 1px solid var(--border); padding: var(--space-group) var(--space-block); color: var(--text-muted); font-size: var(--text-xs); line-height: var(--leading-body); }\n.status { position: relative; display: block; min-width: 0; flex: 1 1 12rem; }\n.status > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.switch { color: var(--text-secondary); white-space: nowrap; }\n.switch .textButton { color: var(--foreground); font-weight: var(--weight-medium); text-decoration-color: transparent; }\n.srOnly { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }\n\n@media (hover: hover) and (pointer: fine) {\n  .textButton:hover { color: var(--foreground); text-decoration-color: currentColor; }\n}\n@container signup (max-width: 380px) {\n  .step { padding: var(--space-section) var(--space-comfort); }\n  .heading h2 { font-size: var(--text-2xl); }\n  .sso .ssoButton { gap: var(--space-related); font-size: var(--text-xs); }\n  .footer { padding-inline: var(--space-comfort); }\n  .meter span { width: 14px; }\n}\n@media (max-width: 480px) { .block { border-radius: var(--radius-container); corner-shape: var(--corner-shape); } }\n@media (prefers-reduced-motion: reduce) { .meter span, .textButton { transition: none; } }\n"},{"path":"registry/components/password-field/password-field.tsx","type":"registry:component","target":"@components/silicon-ui/password-field/password-field.tsx","content":"\"use client\";\nimport { forwardRef, useEffect, useId, useRef, useState } from \"react\";\nimport type { InputHTMLAttributes } from \"react\";\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\";\nimport { motionTokens } from \"../lib/motion-tokens\";\nimport styles from \"./password-field.module.css\";\n/** The toggle's names. Both have English defaults; pass the ones you translate. */\nexport interface PasswordFieldMessages { showPassword: string; hidePassword: string }\nexport const defaultPasswordFieldMessages: PasswordFieldMessages = { showPassword: \"Show password\", hidePassword: \"Hide password\" };\nexport interface PasswordFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, \"type\"> {\n  label: string;\n  description?: string;\n  /** Translated or reworded toggle names. */\n  messages?: Partial<PasswordFieldMessages>;\n}\n/** One eye that a slash draws across, cutting the outline beneath it, instead of swapping two icons. */\nfunction EyeMorph({ slashed }: { slashed: boolean }) {\n  const reduced = useReducedMotion(); const maskId = `eye-${useId().replace(/[^a-zA-Z0-9_-]/g, \"\")}`;\n  const slash = { pathLength: slashed ? 1 : 0, opacity: slashed ? 1 : 0 };\n  const transition = reduced ? { duration: 0 } : { pathLength: { duration: motionTokens.duration.standard, ease: [...motionTokens.ease.standard] }, opacity: { duration: motionTokens.duration.instant } };\n  return <svg width={18} height={18} viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth={1.75} strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n    <mask id={maskId} maskUnits=\"userSpaceOnUse\" x=\"0\" y=\"0\" width=\"24\" height=\"24\"><rect width=\"24\" height=\"24\" fill=\"white\" stroke=\"none\" /><motion.path d=\"M2 2l20 20\" stroke=\"black\" strokeWidth={5} initial={false} animate={slash} transition={transition} /></mask>\n    <g mask={`url(#${maskId})`}><path d=\"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0\" /><circle cx=\"12\" cy=\"12\" r=\"3\" /></g>\n    <motion.path d=\"M2 2l20 20\" initial={false} animate={slash} transition={transition} />\n  </svg>;\n}\n/** Changed words rise in and unblur while unchanged words hold still. Assistive tech reads the plain copy. */\nfunction MotionText({ text }: { text: string }) {\n  const reduced = useReducedMotion();\n  const words = text.split(\" \");\n  return <><span className={styles.srOnly}>{text}</span><span className={styles.words} aria-hidden=\"true\"><AnimatePresence initial={false} mode=\"popLayout\">{words.map((word, index) => <motion.span key={`${index}:${word}`} className={styles.word}\n    initial={reduced ? { opacity: 0 } : { opacity: 0, y: \"0.35em\", filter: `blur(${motionTokens.blur.soft}px)` }} animate={{ opacity: 1, y: 0, filter: \"blur(0px)\" }}\n    exit={reduced ? { opacity: 0, transition: { duration: 0 } } : { opacity: 0, y: \"-0.35em\", filter: `blur(${motionTokens.blur.subtle}px)`, transition: { duration: motionTokens.duration.exit, ease: [...motionTokens.ease.exit] } }}\n    transition={reduced ? { duration: motionTokens.duration.instant } : { duration: motionTokens.duration.standard, ease: [...motionTokens.ease.enter] }}>{index < words.length - 1 ? `${word} ` : word}</motion.span>)}</AnimatePresence></span></>;\n}\n\n/** Helper and error copy: the row opens its height on a spring, then the words settle in. */\nfunction FieldMessage({ id, text, className, alert }: { id?: string; text?: string; className?: string; alert?: boolean }) {\n  return <AnimatePresence initial={false}>{text ? <MessageRow key=\"message\" id={id} text={text} className={className} alert={alert} /> : null}</AnimatePresence>;\n}\n\n/** The row tracks the measured copy, so a longer message that wraps opens its next line instead of snapping. */\nfunction MessageRow({ id, text, className, alert }: { id?: string; text: string; className?: string; alert?: boolean }) {\n  const reduced = useReducedMotion();\n  const copyRef = useRef<HTMLSpanElement>(null);\n  const [height, setHeight] = useState<number | \"auto\">(\"auto\");\n  useEffect(() => {\n    const node = copyRef.current;\n    if (!node || typeof ResizeObserver === \"undefined\") return;\n    const observer = new ResizeObserver(([entry]) => { if (entry) setHeight(entry.borderBoxSize?.[0]?.blockSize ?? node.offsetHeight); });\n    observer.observe(node);\n    return () => observer.disconnect();\n  }, []);\n  return <motion.span className={styles.messageSlot} initial={{ height: 0, opacity: 0 }} animate={{ height, opacity: 1 }} exit={{ height: 0, opacity: 0, transition: reduced ? { duration: 0 } : { height: motionTokens.spring.smooth, opacity: { duration: motionTokens.duration.instant } } }} transition={reduced ? { duration: 0 } : { height: motionTokens.spring.smooth, opacity: { duration: motionTokens.duration.fast } }}>\n    <motion.span ref={copyRef} id={id} className={className} role={alert ? \"alert\" : undefined} initial={reduced ? false : { y: \"0.35em\", filter: `blur(${motionTokens.blur.soft}px)` }} animate={{ y: 0, filter: \"blur(0px)\" }} transition={{ duration: reduced ? 0 : motionTokens.duration.standard, ease: [...motionTokens.ease.enter] }}><MotionText text={text} /></motion.span>\n  </motion.span>;\n}\n\nexport const PasswordField = forwardRef<HTMLInputElement, PasswordFieldProps>(function PasswordField({ label, description, messages: messagesProp, id, className, ...props }, ref) {\n  const messages = { ...defaultPasswordFieldMessages, ...messagesProp };\n  const generated = useId(); const controlId = id ?? generated; const [visible, setVisible] = useState(false); const [toggled, setToggled] = useState(false);\n  const hintId = description ? `${controlId}-description` : undefined;\n  // data-reveal only appears after the first toggle, so the value resolves on each change but never on mount.\n  return <div className={styles.field}><label htmlFor={controlId}>{label}</label><div className={styles.shell}><input {...props} ref={ref} id={controlId} type={visible ? \"text\" : \"password\"} data-reveal={toggled ? (visible ? \"shown\" : \"hidden\") : undefined} aria-describedby={[props[\"aria-describedby\"], hintId].filter(Boolean).join(\" \") || undefined} className={[styles.input, className].filter(Boolean).join(\" \")} /><button type=\"button\" onClick={() => { setVisible(current => !current); setToggled(true); }} aria-label={visible ? messages.hidePassword : messages.showPassword} aria-pressed={visible}><EyeMorph slashed={visible} /></button></div><FieldMessage id={hintId} text={description} className={styles.hint} /></div>;\n});\n"},{"path":"registry/components/password-field/password-field.module.css","type":"registry:component","target":"@components/silicon-ui/password-field/password-field.module.css","content":"/* No row gap: grid tracks clamp a negative margin at zero, so a closed message row would still pay the gap. Each row carries its own space instead. */\n.field { display: grid; min-width: 0; }\n.field label { margin-bottom: var(--space-related); font-size: var(--text-sm); font-weight: var(--weight-medium); letter-spacing: var(--tracking-body); }\n/* Focus shows as a darker border only; the shell never changes size. The toggle sits with an even inset on top, bottom and right. */\n.shell { display: flex; min-height: var(--control-height-md); align-items: center; border: 1px solid var(--border-strong); border-radius: var(--radius-control); padding: 0 calc((var(--control-height-md) - var(--space-hair) - var(--space-block)) / 2) 0 var(--space-group); background: var(--surface); transition: border-color var(--duration-fast) var(--ease-standard); }\n@media (hover: hover) and (pointer: fine) { .shell:hover:not(:focus-within) { border-color: var(--foreground); } }\n.shell:focus-within { border-color: var(--foreground); }\n.shell:has(.input[aria-invalid=\"true\"]) { border-color: var(--danger); }\n.input { width: 100%; min-width: 0; border: 0; background: transparent; color: var(--foreground); font: inherit; font-size: var(--field-text-size, var(--text-sm)); line-height: var(--leading-body); outline: 0; }\n.input::placeholder { color: var(--text-muted); }\n/* Switching between dots and characters resolves in place instead of snapping. Swapping the keyframe name restarts it. */\n.input[data-reveal=\"shown\"] { animation: resolve-shown var(--duration-standard) var(--ease-enter); }\n.input[data-reveal=\"hidden\"] { animation: resolve-hidden var(--duration-standard) var(--ease-enter); }\n@keyframes resolve-shown { from { opacity: .35; filter: blur(2px); } }\n@keyframes resolve-hidden { from { opacity: .35; filter: blur(2px); } }\n.shell button { display: grid; width: 30px; height: 30px; flex: 0 0 auto; place-items: center; border: 0; border-radius: var(--radius-control); background: transparent; color: var(--text-muted); transition: background-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard), transform var(--duration-spring) var(--ease-spring); }\n@media (hover: hover) and (pointer: fine) { .shell button:hover { background: var(--surface-muted); color: var(--foreground); } }\n.shell button:active { transform: scale(.96); transition: background-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard), transform var(--duration-fast) var(--ease-standard); }\n.shell button[aria-pressed=\"true\"] { color: var(--foreground); }\n/* The row's space is padding inside the clipped slot, so the height animates from a true zero. */\n.messageSlot { display: block; overflow: hidden; }\n.hint { display: block; padding-top: var(--space-related); color: var(--field-hint-colour, var(--text-muted)); font-size: var(--field-hint-size, var(--text-xs)); line-height: var(--leading-body); letter-spacing: var(--tracking-body); }\n/* Words are measured against this box when they pop out to leave, so it must be the positioned parent. */\n.words { position: relative; display: block; }\n.word { display: inline-block; white-space: pre; }\n.srOnly { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }\n@media (prefers-reduced-motion: reduce) { .shell, .shell button { transition: none; } .shell button:active { transform: none; } .input[data-reveal] { animation: none; } }\n"},{"path":"registry/components/input/input.tsx","type":"registry:component","target":"@components/silicon-ui/input/input.tsx","content":"\"use client\";\n\nimport { forwardRef, useEffect, useId, useRef, useState } from \"react\";\nimport type { InputHTMLAttributes, ReactNode } from \"react\";\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\";\nimport { motionTokens } from \"../lib/motion-tokens\";\nimport styles from \"./input.module.css\";\n\nexport interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, \"prefix\"> {\n  label: string;\n  /** Fixed text or an icon inside the field before what is typed (a currency, \"c:\"). It takes the typed text's size and\n   * a quieter colour, with no gap: the value reads as one word with it. */\n  prefix?: ReactNode;\n  /** An icon or short text inside the field after what is typed (a status icon, a unit). */\n  suffix?: ReactNode;\n  /** Plain text animates word by word when it changes; markup (a bold id) is shown as given. */\n  description?: ReactNode;\n  error?: string;\n}\n\n/* Digits roll up when a number grows and down when it shrinks; `custom` hands the latest direction to digits already leaving. */\nconst digit = {\n  enter: (direction: number) => ({ opacity: 0, y: `${direction * 0.6}em`, filter: `blur(${motionTokens.blur.subtle}px)` }),\n  center: { opacity: 1, y: 0, filter: \"blur(0px)\" },\n  exit: (direction: number) => ({ opacity: 0, y: `${direction * -0.6}em`, filter: `blur(${motionTokens.blur.subtle}px)` }),\n};\nconst isNumber = (word: string) => /^\\d[\\d.,/:]*%?$/.test(word);\n\n/** A count in the copy, such as \"12 characters\", rolls only the digits that changed; a gained or lost digit opens or closes its width. */\nfunction RollingNumber({ word }: { word: string }) {\n  const reduced = useReducedMotion();\n  const [shown, setShown] = useState({ word, direction: 1 });\n  if (shown.word !== word) setShown({ word, direction: parseFloat(word.replace(/,/g, \"\")) < parseFloat(shown.word.replace(/,/g, \"\")) ? -1 : 1 });\n  const characters = word.split(\"\");\n  const transition = reduced ? { duration: 0 } : { y: motionTokens.spring.snappy, width: motionTokens.spring.morph, opacity: { duration: motionTokens.duration.fast }, filter: { duration: motionTokens.duration.fast } };\n  return <AnimatePresence initial={false}>{characters.map((character, index) => <motion.span key={characters.length - index} className={styles.column} initial={{ width: 0, opacity: 0 }} animate={{ width: \"auto\", opacity: 1 }} exit={{ width: 0, opacity: 0 }} transition={transition}>\n    <AnimatePresence initial={false} mode=\"popLayout\" custom={shown.direction}><motion.span key={character} custom={shown.direction} variants={digit} initial=\"enter\" animate=\"center\" exit=\"exit\" transition={transition}>{character}</motion.span></AnimatePresence>\n  </motion.span>)}</AnimatePresence>;\n}\n\n/** Changed words rise in and unblur while unchanged words hold still, and numbers roll. Assistive tech reads the plain copy. */\nfunction MotionText({ text }: { text: ReactNode }) {\n  const reduced = useReducedMotion();\n  if (typeof text !== \"string\") return text;\n  const words = text.split(\" \");\n  return <><span className={styles.srOnly}>{text}</span><span className={styles.words} aria-hidden=\"true\"><AnimatePresence initial={false} mode=\"popLayout\">{words.map((word, index) => <motion.span key={`${index}:${isNumber(word) ? \"#\" : word}`} className={styles.word}\n    initial={reduced ? { opacity: 0 } : { opacity: 0, y: \"0.35em\", filter: `blur(${motionTokens.blur.soft}px)` }} animate={{ opacity: 1, y: 0, filter: \"blur(0px)\" }}\n    exit={reduced ? { opacity: 0, transition: { duration: 0 } } : { opacity: 0, y: \"-0.35em\", filter: `blur(${motionTokens.blur.subtle}px)`, transition: { duration: motionTokens.duration.exit, ease: [...motionTokens.ease.standard] } }}\n    transition={reduced ? { duration: motionTokens.duration.instant } : { duration: motionTokens.duration.standard, ease: [...motionTokens.ease.enter] }}>{isNumber(word) ? <RollingNumber word={word} /> : word}{index < words.length - 1 ? \" \" : null}</motion.span>)}</AnimatePresence></span></>;\n}\n\n/** Helper and error copy: the row opens its height on a spring, then the words settle in. */\nfunction FieldMessage({ id, text, className, alert }: { id?: string; text?: ReactNode; className?: string; alert?: boolean }) {\n  return <AnimatePresence initial={false}>{text ? <MessageRow key=\"message\" id={id} text={text} className={className} alert={alert} /> : null}</AnimatePresence>;\n}\n\n/** The row tracks the measured copy, so a longer message that wraps opens its next line instead of snapping. */\nfunction MessageRow({ id, text, className, alert }: { id?: string; text: ReactNode; className?: string; alert?: boolean }) {\n  const reduced = useReducedMotion();\n  const copyRef = useRef<HTMLSpanElement>(null);\n  const [height, setHeight] = useState<number | \"auto\">(\"auto\");\n  useEffect(() => {\n    const node = copyRef.current;\n    if (!node || typeof ResizeObserver === \"undefined\") return;\n    const observer = new ResizeObserver(([entry]) => { if (entry) setHeight(entry.borderBoxSize?.[0]?.blockSize ?? node.offsetHeight); });\n    observer.observe(node);\n    return () => observer.disconnect();\n  }, []);\n  // Reduced motion mounts the row at full height: a zero-duration open would still paint one collapsed frame. The presence starts\n  // with initial={false}, so rows present at hydration render the same on server and client either way.\n  return <motion.span className={styles.messageSlot} initial={reduced ? false : { height: 0, opacity: 0 }} animate={{ height, opacity: 1 }} exit={{ height: 0, opacity: 0, transition: reduced ? { duration: 0 } : { height: motionTokens.spring.smooth, opacity: { duration: motionTokens.duration.instant } } }} transition={reduced ? { duration: 0 } : { height: motionTokens.spring.smooth, opacity: { duration: motionTokens.duration.fast } }}>\n    <motion.span ref={copyRef} id={id} className={className} role={alert ? \"alert\" : undefined} initial={reduced ? false : { y: \"0.35em\", filter: `blur(${motionTokens.blur.soft}px)` }} animate={{ y: 0, filter: \"blur(0px)\" }} transition={{ duration: reduced ? 0 : motionTokens.duration.standard, ease: [...motionTokens.ease.enter] }}><MotionText text={text} /></motion.span>\n  </motion.span>;\n}\n\nexport const Input = forwardRef<HTMLInputElement, InputProps>(function Input(\n  { label, description, error, id, className, prefix, suffix, ...props }, ref,\n) {\n  const generatedId = useId();\n  const controlId = id ?? generatedId;\n  const hintId = description ? `${controlId}-description` : undefined;\n  const errorId = error ? `${controlId}-error` : undefined;\n  const describedBy = [props[\"aria-describedby\"], hintId, errorId].filter(Boolean).join(\" \") || undefined;\n  return <div className={styles.field}>\n    <label className={styles.label} htmlFor={controlId}>{label}</label>\n    {prefix != null || suffix != null ? <div className={styles.control}>\n      {prefix != null ? <span className={styles.prefix} aria-hidden=\"true\">{prefix}</span> : null}\n      <input {...props} id={controlId} ref={ref} className={[styles.input, styles.bare, className].filter(Boolean).join(\" \")} aria-invalid={error ? true : props[\"aria-invalid\"]} aria-describedby={describedBy}/>\n      {suffix != null ? <span className={styles.suffix} aria-hidden=\"true\">{suffix}</span> : null}\n    </div> : <input {...props} id={controlId} ref={ref} className={[styles.input, className].filter(Boolean).join(\" \")} aria-invalid={error ? true : props[\"aria-invalid\"]} aria-describedby={describedBy}/>}\n    <FieldMessage id={hintId} text={description} className={styles.description} />\n    <FieldMessage id={errorId} text={error} className={styles.error} alert />\n  </div>;\n});\n\nInput.displayName = \"Input\";\n"},{"path":"registry/components/input/input.module.css","type":"registry:component","target":"@components/silicon-ui/input/input.module.css","content":"/* No row gap: grid tracks clamp a negative margin at zero, so a closed message row would still pay the gap. Each row carries its own space instead. */\n.field { display: grid; min-width: 0; }\n.label { margin-bottom: var(--space-related); color: var(--foreground); font-size: var(--text-sm); font-weight: var(--weight-medium); line-height: var(--leading-body); letter-spacing: var(--tracking-body); }\n/* Focus answers with the border colour alone (no rings or halos); the field itself never changes size. */\n.input { width: 100%; min-height: var(--control-height-md); padding: 0 var(--space-group); border: 1px solid var(--border-strong); border-radius: var(--radius-control); background: var(--surface); color: var(--foreground); font: inherit; font-size: var(--field-text-size, var(--text-sm)); line-height: var(--leading-body); letter-spacing: var(--tracking-body); outline: none; transition: border-color var(--duration-fast) var(--ease-standard), background-color var(--duration-fast) var(--ease-standard); }\n.input::placeholder { color: var(--text-muted); }\n@media (hover: hover) and (pointer: fine) { .input:hover:not(:disabled, [aria-invalid=\"true\"]) { border-color: var(--foreground); } }\n.input:focus-visible { border-color: var(--foreground); }\n.input[aria-invalid=\"true\"] { border-color: var(--danger); }\n.input:disabled { cursor: not-allowed; opacity: .5; background: var(--surface-muted); }\n/* With a prefix or suffix the box is the control around the input: the prefix sits in line with the typed text, at its\n   size, so \"c:\" and \"anil\" read as one id; the input inside is bare. Hover, focus, invalid and disabled move to the box. */\n.control { display: flex; width: 100%; min-height: var(--control-height-md); box-sizing: border-box; align-items: center; padding: 0 var(--space-group); border: 1px solid var(--border-strong); border-radius: var(--radius-control); background: var(--surface); color: var(--foreground); font-size: var(--field-text-size, var(--text-sm)); line-height: var(--leading-body); letter-spacing: var(--tracking-body); cursor: text; transition: border-color var(--duration-fast) var(--ease-standard), background-color var(--duration-fast) var(--ease-standard); }\n.input.bare { min-width: 0; min-height: calc(var(--control-height-md) - 2px); flex: 1; padding: 0; border: 0; border-radius: 0; background: transparent; }\n.prefix, .suffix { display: inline-flex; flex: none; align-items: center; color: var(--text-secondary); font: inherit; letter-spacing: inherit; white-space: nowrap; pointer-events: none; }\n.suffix { margin-inline-start: var(--space-related); }\n@media (hover: hover) and (pointer: fine) { .control:hover:not(:has(:disabled, [aria-invalid=\"true\"])) { border-color: var(--foreground); } }\n.control:has(.input:focus-visible) { border-color: var(--foreground); }\n.control:has(.input[aria-invalid=\"true\"]) { border-color: var(--danger); }\n.control:has(.input:disabled) { cursor: not-allowed; opacity: .5; background: var(--surface-muted); }\n.control:has(.input:disabled) .input { opacity: 1; background: transparent; }\n/* The row's space is padding inside the clipped slot, so the height animates from a true zero. */\n.messageSlot { display: block; overflow: hidden; }\n.description, .error { display: block; padding-top: var(--space-related); font-size: var(--field-hint-size, var(--text-xs)); line-height: var(--leading-body); letter-spacing: var(--tracking-body); }\n.description { color: var(--field-hint-colour, var(--text-muted)); } .error { color: var(--danger); }\n/* Words are measured against this box when they pop out to leave, so it must be the positioned parent. */\n.words { position: relative; display: block; }\n.word { display: inline-block; white-space: pre; }\n/* One column per character of a count. Tabular digits keep columns equal, so only a gained or lost digit changes the width. */\n.column { position: relative; display: inline-flex; justify-content: center; font-variant-numeric: tabular-nums; }\n.column > span { display: inline-block; }\n.srOnly { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }\n@media (prefers-reduced-motion: reduce) { .input { transition-duration: .01ms; } }\n"},{"path":"registry/components/checkbox/checkbox.tsx","type":"registry:component","target":"@components/silicon-ui/checkbox/checkbox.tsx","content":"\"use client\";\n\nimport { forwardRef, useId, useState } from \"react\";\nimport type { ComponentPropsWithoutRef, ElementRef } from \"react\";\nimport * as CheckboxPrimitive from \"@radix-ui/react-checkbox\";\nimport { motion, useReducedMotion } from \"motion/react\";\nimport type { Transition } from \"motion/react\";\nimport { motionTokens } from \"../lib/motion-tokens\";\nimport styles from \"./checkbox.module.css\";\n\nexport interface CheckboxProps extends ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root> {\n  label?: string;\n  description?: string;\n}\n\n/** Both marks share three points, so the check morphs into the dash and back instead of swapping. */\nconst checkPath = \"M4.25 9.25 L7.25 12.25 L13.75 5.75\";\nconst dashPath = \"M4.75 9 L9 9 L13.25 9\";\n\nexport const Checkbox = forwardRef<ElementRef<typeof CheckboxPrimitive.Root>, CheckboxProps>(function Checkbox(\n  { label, description, id, className, checked, defaultChecked, onCheckedChange, ...props }, ref,\n) {\n  const generatedId = useId();\n  const controlId = id ?? generatedId;\n  const reduced = useReducedMotion();\n  const [internal, setInternal] = useState<CheckboxPrimitive.CheckedState>(defaultChecked ?? false);\n  const state = checked ?? internal;\n  const on = state !== false;\n  const change = (next: CheckboxPrimitive.CheckedState) => { if (checked === undefined) setInternal(next); onCheckedChange?.(next); };\n  const fade: Transition = { duration: on ? motionTokens.duration.instant : motionTokens.duration.fast, ease: [...motionTokens.ease.standard] };\n  return <div className={styles.field}>\n    <CheckboxPrimitive.Root {...props} id={controlId} ref={ref} checked={state} onCheckedChange={change} className={[styles.box, className].filter(Boolean).join(\" \")} aria-describedby={description ? `${controlId}-description` : undefined} aria-label={props[\"aria-label\"] ?? (label ? undefined : \"Checkbox\")}>\n      <span className={styles.visual} aria-hidden=\"true\">\n        <motion.span className={styles.fill} initial={false} animate={{ opacity: on ? 1 : 0, scale: on ? 1 : .6 }} transition={reduced ? { duration: 0 } : { scale: motionTokens.spring.snappy, opacity: fade }} />\n        <svg className={styles.mark} viewBox=\"0 0 18 18\" fill=\"none\" focusable=\"false\">\n          <motion.path initial={false} animate={{ d: state === \"indeterminate\" ? dashPath : checkPath, pathLength: on ? 1 : 0, opacity: on ? 1 : 0 }} transition={reduced ? { duration: 0 } : { d: motionTokens.spring.morph, pathLength: motionTokens.spring.snappy, opacity: fade }} stroke=\"currentColor\" strokeWidth={1.75} strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n        </svg>\n      </span>\n    </CheckboxPrimitive.Root>\n    {label || description ? <div className={styles.copy}>{label ? <label htmlFor={controlId}>{label}</label> : null}{description ? <span id={`${controlId}-description`}>{description}</span> : null}</div> : null}\n  </div>;\n});\n\nCheckbox.displayName = \"Checkbox\";\n"},{"path":"registry/components/checkbox/checkbox.module.css","type":"registry:component","target":"@components/silicon-ui/checkbox/checkbox.module.css","content":".field { display: inline-flex; align-items: flex-start; gap: 0; min-width: 0; }\n.box { position: relative; flex: 0 0 auto; display: grid; place-items: center; width: var(--control-height-md); height: var(--control-height-md); border: 0; border-radius: var(--radius-control); padding: 0; background: transparent; color: var(--control-glyph); cursor: pointer; -webkit-tap-highlight-color: transparent; }\n/* The square is the only part that reacts to a press, so the hit area and label never move. */\n.visual { position: relative; display: block; width: 18px; height: 18px; border: 1px solid var(--border-strong); border-radius: var(--radius-detail); background: var(--surface); transition: border-color var(--duration-fast) var(--ease-standard), transform var(--duration-spring) var(--ease-spring); }\n.fill { position: absolute; inset: -1px; border-radius: inherit; corner-shape: inherit; background: var(--control-on); }\n.mark { position: absolute; inset: -1px; width: 18px; height: 18px; overflow: visible; }\n.box[data-state=\"checked\"] .visual, .box[data-state=\"indeterminate\"] .visual { border-color: var(--control-on); }\n@media (hover: hover) and (pointer: fine) { .box[data-state=\"unchecked\"]:hover:not(:disabled) .visual { border-color: var(--text-muted); } }\n.box:active:not(:disabled) .visual { transform: scale(.95); transition: border-color var(--duration-fast) var(--ease-standard), transform var(--duration-instant) var(--ease-standard); }\n.box:disabled { opacity: .5; cursor: not-allowed; }\n/* The label's first line centers on the square: (44px box - 19.6px line) / 2. */\n.copy { display: grid; gap: var(--space-hair); min-width: 0; margin-left: 1px; padding-top: calc((var(--control-height-md) - var(--text-sm) * 1.4) / 2); }\n.copy label { color: var(--foreground); font-size: var(--text-sm); font-weight: var(--weight-medium); line-height: var(--leading-body); cursor: pointer; }\n.copy span { color: var(--text-muted); font-size: var(--text-xs); line-height: var(--leading-body); }\n@media (prefers-reduced-motion: reduce) { .visual, .box:active:not(:disabled) .visual { transition: none; transform: none; } }\n"},{"path":"registry/components/button/button.tsx","type":"registry:component","target":"@components/silicon-ui/button/button.tsx","content":"\"use client\";\n\nimport { forwardRef, isValidElement, useCallback, useEffect, useLayoutEffect, useRef } from \"react\";\nimport type { ButtonHTMLAttributes, ReactNode, Ref, RefObject } from \"react\";\nimport { AnimatePresence, animate, motion, useIsPresent, useMotionValue, useReducedMotion } from \"motion/react\";\nimport type { TargetAndTransition, Variants } from \"motion/react\";\nimport { motionTokens } from \"../lib/motion-tokens\";\nimport styles from \"./button.module.css\";\n\n/** `soft` is filled and borderless, for controls in a bar (experimental). `link` is text with an underline, for an action\n * among words (a switch under a field); `--button-link-underline` sets the resting underline (transparent: on hover only). */\nexport type ButtonVariant = \"primary\" | \"secondary\" | \"ghost\" | \"danger\" | \"soft\" | \"link\";\n/** `xs` (24px) is for dense UI such as tree rows and toolbars, usually icon-only with an aria-label. */\nexport type ButtonSize = \"xs\" | \"sm\" | \"md\" | \"lg\";\n\nexport interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, \"onDrag\" | \"onDragEnd\" | \"onDragStart\" | \"onAnimationStart\"> {\n  /** The look: `primary` (default) for the main action, `secondary` bordered, `ghost` quiet, `danger` destructive, `soft` filled for bars, `link` underlined text. */\n  variant?: ButtonVariant;\n  /** Height: `xs` 24px, `sm` 36px, `md` 44px (default), `lg` 50px. */\n  size?: ButtonSize;\n  /** Shows a spinner in place of the label and sets aria-busy, keeping the button's width. */\n  loading?: boolean;\n}\n\n/** Icon buttons press a little deeper, wide buttons a little less, so every size reads as the same push. */\nconst pressVariants: Variants = {\n  pressed: (button: RefObject<HTMLButtonElement | null>) => {\n    const width = button.current?.offsetWidth ?? 0;\n    return { scale: width > 220 ? .985 : width && width <= 48 ? .96 : .97, transition: { duration: motionTokens.duration.instant, ease: [...motionTokens.ease.standard] } };\n  },\n};\n\nconst rest: TargetAndTransition = { opacity: 1, y: 0, scale: 1, filter: \"blur(0px)\" };\n/** Text rises about .3em out of a soft blur; the outgoing label lifts away a little faster. */\nconst textIn: TargetAndTransition = { opacity: 0, y: 4, filter: `blur(${motionTokens.blur.soft}px)` };\nconst textOut: TargetAndTransition = { opacity: 0, y: -3, filter: `blur(${motionTokens.blur.soft}px)`, transition: { duration: motionTokens.duration.fast, ease: [...motionTokens.ease.standard] } };\nconst iconIn: TargetAndTransition = { opacity: 0, scale: .6, filter: `blur(${motionTokens.blur.subtle}px)` };\nconst iconOut: TargetAndTransition = { opacity: 0, scale: .6, filter: `blur(${motionTokens.blur.subtle}px)`, transition: { duration: motionTokens.duration.fast, ease: [...motionTokens.ease.standard] } };\nconst fadeIn: TargetAndTransition = { ...rest, opacity: 0 };\nconst fadeOut: TargetAndTransition = { opacity: 0, transition: { duration: motionTokens.duration.instant } };\n/** Scale rides the spring; opacity and blur tween so blur never overshoots below zero. */\nconst iconEnter = { ...motionTokens.spring.snappy, opacity: { duration: motionTokens.duration.fast, ease: [...motionTokens.ease.enter] }, filter: { duration: motionTokens.duration.fast, ease: [...motionTokens.ease.enter] } } as const;\n\n/** A key for the label content: text plus element names, so a new label or icon crossfades while prop-only updates stay in place. */\nfunction labelKey(node: ReactNode): string {\n  if (node == null || typeof node === \"boolean\") return \"\";\n  if (typeof node === \"string\" || typeof node === \"number\" || typeof node === \"bigint\") return String(node);\n  if (Array.isArray(node)) return node.map(labelKey).join(\"\");\n  if (!isValidElement(node)) return \"\";\n  const type = node.type as string | { displayName?: string; name?: string };\n  return `<${typeof type === \"string\" ? type : type?.displayName ?? type?.name ?? \"\"}>${labelKey((node.props as { children?: ReactNode }).children)}`;\n}\n\n/** Springs the slot to the natural width of the incoming label when it changes, so a new label never snaps the button's size.\n *  The outgoing label is popped out of flow at once, so it never holds the old width. Other resizes (a late web font, a parent reflow) jump straight to the new width, so nothing wobbles on first paint. */\nfunction useMorphWidth(content: RefObject<HTMLElement | null>, key: string, reduced: boolean) {\n  const width = useMotionValue<number | \"auto\">(\"auto\");\n  const lastKey = useRef(key), armedUntil = useRef(0);\n  useLayoutEffect(() => {\n    if (lastKey.current === key) return;\n    lastKey.current = key;\n    armedUntil.current = performance.now() + 700;\n  }, [key]);\n  useEffect(() => {\n    const node = content.current, slot = node?.parentElement;\n    if (!node || !slot || typeof ResizeObserver === \"undefined\") return;\n    let measured = false;\n    const observer = new ResizeObserver(([entry]) => {\n      if (!entry) return;\n      const next = entry.contentRect.width;\n      if (!next || !measured || reduced || performance.now() > armedUntil.current) { measured = next > 0; width.jump(next || \"auto\"); delete slot.dataset.morphing; return; }\n      slot.dataset.morphing = \"\";\n      animate(width, next, { ...motionTokens.spring.morph, onComplete: () => { delete slot.dataset.morphing; } });\n    });\n    observer.observe(node);\n    return () => observer.disconnect();\n  }, [content, reduced, width]);\n  return width;\n}\n\nfunction LabelPhase({ children, icon, reduced, ref }: { children: ReactNode; icon: boolean; reduced: boolean; ref?: Ref<HTMLSpanElement> }) {\n  const present = useIsPresent();\n  return <motion.span ref={ref} className={styles.labelPhase} aria-hidden={present ? undefined : true} initial={reduced ? fadeIn : icon ? iconIn : textIn} animate={rest} exit={reduced ? fadeOut : icon ? iconOut : textOut} transition={reduced ? { duration: motionTokens.duration.instant } : icon ? iconEnter : { duration: motionTokens.duration.standard, ease: [...motionTokens.ease.enter] }}>{children}</motion.span>;\n}\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n  { className, variant = \"primary\", size = \"md\", loading = false, disabled, children, onClick, ...props },\n  ref,\n) {\n  const reduceMotion = useReducedMotion() ?? false;\n  const buttonRef = useRef<HTMLButtonElement | null>(null);\n  const contentRef = useRef<HTMLSpanElement>(null);\n  const key = labelKey(children);\n  const width = useMorphWidth(contentRef, key, reduceMotion);\n  const setRefs = useCallback((node: HTMLButtonElement | null) => {\n    buttonRef.current = node;\n    if (typeof ref === \"function\") ref(node); else if (ref) ref.current = node;\n  }, [ref]);\n  // A trigger that anchors a menu, popover, or dialog keeps its rect still while pressed, so the layer never measures a scaled anchor.\n  // Radix triggers (asChild) pass aria-haspopup or data-state through; the stylesheet repeats the guard.\n  const popup = props[\"aria-haspopup\"];\n  const anchorsLayer = (popup !== undefined && popup !== false && popup !== \"false\") || props.role === \"combobox\" || (props as Record<string, unknown>)[\"data-state\"] !== undefined;\n  const inert = disabled || loading || props[\"aria-disabled\"] === true || props[\"aria-disabled\"] === \"true\";\n  const classes = [styles.button, styles[variant], styles[size], className].filter(Boolean).join(\" \");\n  // An icon with no text: square at the compact size.\n  const iconOnly = !/\\S/.test(key.replace(/<[^>]*>/g, \"\"));\n\n  return (\n    <motion.button\n      ref={setRefs}\n      tabIndex={props.tabIndex ?? 0}\n      className={classes}\n      data-variant={variant}\n      data-icon-only={iconOnly || undefined}\n      disabled={disabled}\n      aria-busy={loading || undefined}\n      custom={buttonRef}\n      variants={pressVariants}\n      whileTap={reduceMotion || anchorsLayer || inert ? undefined : \"pressed\"}\n      transition={motionTokens.spring.snappy}\n      {...props}\n      // Loading keeps the button focusable (a disabled button would drop keyboard focus mid-action) and swallows presses instead.\n      aria-disabled={loading || props[\"aria-disabled\"] || undefined}\n      onClick={loading ? event => event.preventDefault() : onClick}\n    >\n      <AnimatePresence initial={false}>\n        {loading ? <motion.span key=\"loader\" className={styles.loader} aria-hidden=\"true\" initial={reduceMotion ? { opacity: 0 } : { opacity: 0, scale: .6 }} animate={{ opacity: 1, scale: 1 }} exit={reduceMotion ? fadeOut : { ...iconOut, scale: .8 }} transition={reduceMotion ? { duration: motionTokens.duration.instant } : iconEnter}><span className={styles.spinner} /></motion.span> : null}\n      </AnimatePresence>\n      <motion.span className={[styles.labelSlot, loading ? styles.loadingLabel : \"\"].filter(Boolean).join(\" \")} style={{ width }}>\n        <span ref={contentRef} className={styles.labelContent}>\n          <AnimatePresence mode=\"popLayout\" initial={false}>\n            <LabelPhase key={key} icon={!/\\S/.test(key.replace(/<[^>]*>/g, \"\"))} reduced={reduceMotion}>{children}</LabelPhase>\n          </AnimatePresence>\n        </span>\n      </motion.span>\n    </motion.button>\n  );\n});\n\nButton.displayName = \"Button\";\n\nexport default Button;\n"},{"path":"registry/components/button/button.module.css","type":"registry:component","target":"@components/silicon-ui/button/button.module.css","content":"/* Press scale is driven by Motion (whileTap) alone, so transform never gets a CSS transition here. */\n.button { position: relative; display: inline-flex; min-height: var(--control-height-md); align-items: center; justify-content: center; gap: var(--space-related); border: 1px solid transparent; border-radius: var(--radius-control); corner-shape: var(--corner-shape); padding: 0 var(--space-inset); font: inherit; font-size: var(--text-sm); font-weight: var(--weight-medium); letter-spacing: var(--tracking-body); line-height: var(--leading-body); white-space: nowrap; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: color var(--duration-fast) var(--ease-standard), background var(--duration-fast) var(--ease-standard), border-color var(--duration-fast) var(--ease-standard), opacity var(--duration-fast) var(--ease-standard), box-shadow var(--duration-fast) var(--ease-standard); }\n.button:disabled { cursor: not-allowed; opacity: .52; }\n.button[aria-busy=\"true\"] { cursor: progress; }\n/* Anchors of floating layers never scale: Radix opens on pointerdown and would measure a shrunken trigger. */\n.button:is([aria-haspopup]:not([aria-haspopup=\"false\"]), [data-state], [role=\"combobox\"]) { transform: none !important; }\n/* The slot's width follows the incoming label on a spring. The label stays centered and may overflow evenly while the slot catches up;\n   the outgoing label pops out of flow against the slot itself, so it keeps its place instead of following the new content box. */\n.labelSlot { position: relative; display: inline-flex; min-width: 0; align-items: center; justify-content: center; transition: opacity var(--duration-fast) var(--ease-standard); }\n.labelSlot[data-morphing] { clip-path: inset(-50% calc(var(--space-group) * -1)); }\n.labelContent { display: inline-flex; flex: none; align-items: center; }\n.labelPhase { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-related); white-space: nowrap; }\n.labelPhase svg { flex: none; }\n.primary { color: var(--primary-foreground); background: var(--primary); border-color: var(--primary); }\n.secondary { color: var(--foreground); background: var(--surface); border-color: var(--border); }\n.ghost { color: var(--text-secondary); background: transparent; border-color: transparent; }\n.danger { color: var(--danger); background: var(--surface); border-color: var(--border); }\n/* Filled and borderless, for controls that live in a bar (a search trigger, a toolbar, a switcher). Place it on --background or\n   --surface; on a --surface-muted panel it has no fill to show. */\n.soft { color: var(--foreground); background: var(--surface-muted); border-color: transparent; }\n/* A disabled outlined button keeps its shape and fades only its label, so it still reads as a button that is off, not as plain text. */\n.secondary:disabled, .danger:disabled { opacity: 1; color: var(--text-muted); background: var(--surface-muted); border-color: var(--border); }\n.danger:disabled { color: color-mix(in oklab, var(--danger) 55%, var(--surface-muted)); }\n.ghost:disabled, .soft:disabled { opacity: 1; color: var(--text-muted); }\n@media (hover: hover) and (pointer: fine) {\n  .primary:hover:not(:disabled) { opacity: .91; box-shadow: var(--shadow-resting); }\n  .secondary:hover:not(:disabled) { background: var(--surface-muted); box-shadow: var(--shadow-resting); }\n  .ghost:hover:not(:disabled) { color: var(--foreground); background: var(--surface-muted); }\n  .danger:hover:not(:disabled) { border-color: var(--danger); background: var(--surface-muted); }\n  .soft:hover:not(:disabled) { background: var(--surface-pressed); }\n}\n/* Color feedback on press, so touch and menu triggers (which never scale) still answer the finger. */\n.primary:active:not(:disabled) { opacity: .84; }\n.secondary:active:not(:disabled), .ghost:active:not(:disabled) { color: var(--foreground); background: var(--surface-muted); }\n.danger:active:not(:disabled) { border-color: var(--danger); background: var(--surface-muted); }\n.soft:active:not(:disabled) { background: var(--surface-pressed); }\n.xs { min-height: var(--control-height-xs); gap: var(--space-tight); padding-inline: var(--space-related); font-size: var(--text-xs); letter-spacing: var(--tracking-body); }\n/* A compact icon-only button is a square, with the icon at its usual 16px. */\n.xs[data-icon-only] { min-width: var(--control-height-xs); padding-inline: 0; }\n.xs svg { width: 16px; height: 16px; }\n.sm { min-height: var(--control-height-sm); padding-inline: var(--space-group); font-size: var(--text-sm); }\n.md { min-height: var(--control-height-md); }\n.lg { min-height: var(--control-height-lg); padding-inline: var(--space-comfort); font-size: var(--text-sm); }\n/* link: text with an underline, no box. The underline is light at rest (--button-link-underline, default --border-strong;\n   transparent shows it on hover only) and takes the text's colour on hover and focus. After the sizes, so it drops their\n   height and padding but keeps their font size. */\n.button.link { min-width: 0; min-height: 0; padding: 0; gap: var(--space-tight); border: 0; background: transparent; color: var(--text-secondary); }\n.link .labelPhase { text-decoration-line: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: var(--button-link-underline, var(--border-strong)); transition: text-decoration-color var(--duration-fast) var(--ease-standard); }\n@media (hover: hover) and (pointer: fine) { .link:hover:not(:disabled) { color: var(--foreground); } .link:hover:not(:disabled) .labelPhase { text-decoration-color: currentColor; } }\n.link:focus-visible, .link:active:not(:disabled) { color: var(--foreground); }\n.link:focus-visible .labelPhase, .link:active:not(:disabled) .labelPhase { text-decoration-color: currentColor; }\n.link:disabled { opacity: 1; color: var(--text-muted); }\n.loader { position: absolute; left: 50%; top: 50%; display: grid; width: var(--space-inset); height: var(--space-inset); margin: calc(var(--space-inset) / -2); }\n.spinner { border: 1.5px solid currentColor; border-right-color: transparent; border-radius: 50%; corner-shape: round; animation: spin .7s linear infinite; }\n.loadingLabel { opacity: 0; }\n@keyframes spin { to { transform: rotate(360deg); } }\n@media (prefers-reduced-motion: reduce) { .button { transition: none; } .labelSlot { transition: opacity var(--duration-instant) linear; } .spinner { animation-duration: .01ms; animation-iteration-count: 1; } }\n"}],"docs":"Docs and live preview: https://ui.teamofsilicons.com/signup-form","meta":{"tier":"free","kind":"block","docs":"https://ui.teamofsilicons.com/signup-form","markdown":"https://ui.teamofsilicons.com/signup-form.md","status":"stable"}}