{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "block-new-password",
  "type": "registry:block",
  "title": "New password",
  "description": "Choosing a new password in the sign-in card after a reset link: rules that tick as you type, a confirmation, and an expired link that sends a new one.",
  "dependencies": [
    "@remixicon/react@^4.9.0"
  ],
  "registryDependencies": [
    "https://wideset.co/r/block-styles.json",
    "https://wideset.co/r/button.json",
    "https://wideset.co/r/form-field.json",
    "https://wideset.co/r/text-input.json",
    "https://wideset.co/r/toast.json",
    "https://wideset.co/r/utils.json"
  ],
  "files": [
    {
      "path": "src/blocks/new-password/app-icon.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/new-password/app-icon.tsx",
      "content": "'use client';\n\nimport { cn } from '@/lib/wideset/utils';\nimport { useId } from 'react';\n\n/** Figma's W, in its own box (24.97 × 13.87). */\nconst W =\n  'M21.377 0C21.377 0 18.14 9.233 18.017 9.574C17.95 9.402 14.331 0 14.331 0H11.069C11.069 0 7.462 9.574 7.41 9.703C7.353 9.57 3.508 0 3.508 0H0L5.853 13.871H9.059L12.716 4.054H12.773C12.81 4.149 16.51 13.871 16.51 13.871H19.827C19.827 13.871 24.932 0.114 24.967 0H21.377Z';\n\n/** Figma's tile, 46.24 × 46.89 with a 16.18 radius, at its place in the 47.25 × 48 icon. */\nconst TILE = { x: 0.69, y: 0.81, width: 46.24, height: 46.89, rx: 16.18 };\n\n// Light-palette primitives: the icon looks the same in dark mode.\nconst INDIGO_300 = '[stop-color:var(--ws-colors-light-indigo-300)]';\nconst INDIGO_400 = '[stop-color:var(--ws-colors-light-indigo-400)]';\nconst INDIGO_500 = '[stop-color:var(--ws-colors-light-indigo-500)]';\nconst INDIGO_600 = '[stop-color:var(--ws-colors-light-indigo-600)]';\nconst INDIGO_700 = '[stop-color:var(--ws-colors-light-indigo-700)]';\nconst PURPLE_200 = '[stop-color:var(--ws-colors-light-purple-200)]';\nconst PURPLE_400 = '[stop-color:var(--ws-colors-light-purple-400)]';\nconst WHITE = '[stop-color:var(--ws-colors-light-neutral-0)]';\n\n/**\n * The app icon at the top of a sign-in card: Figma's glass tile, a W lit from below. It is not the\n * flat brand mark of an app's sidebar, and it keeps its colours in dark mode, so it draws with the\n * light palette's primitives. Figma lights the tile with blurred, blended shapes; here that light is\n * two gradients in the nearest tokens. Decorative: the title beside it names the product.\n */\nexport function AppIcon({ className }: { className?: string }) {\n  const id = useId();\n  const url = (name: string) => `url(#${id}${name})`;\n\n  return (\n    <svg\n      viewBox=\"0 0 47.25 48\"\n      preserveAspectRatio=\"none\"\n      aria-hidden=\"true\"\n      className={cn('size-ws-18 shrink-0', className)}\n    >\n      <defs>\n        <clipPath id={`${id}tile`}>\n          <rect {...TILE} />\n        </clipPath>\n        {/* The light rising from the bottom edge. */}\n        <linearGradient id={`${id}glow`} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n          <stop offset=\"0\" stopOpacity={0.06} className={INDIGO_600} />\n          <stop offset=\"0.4\" stopOpacity={0.1} className={INDIGO_600} />\n          <stop offset=\"0.6\" stopOpacity={0.38} className={INDIGO_600} />\n          <stop offset=\"0.75\" stopOpacity={0.62} className={INDIGO_600} />\n          <stop offset=\"0.86\" stopOpacity={0.85} className={INDIGO_600} />\n          <stop offset=\"0.93\" stopOpacity={0.9} className={INDIGO_500} />\n          <stop offset=\"0.97\" className={INDIGO_400} />\n          <stop offset=\"1\" className={INDIGO_300} />\n        </linearGradient>\n        {/* Figma's radial fill: centred above the tile, so its rim lights the lower corners. */}\n        <radialGradient\n          id={`${id}bowl`}\n          cx=\"0.5\"\n          cy=\"-0.111\"\n          r=\"1\"\n          gradientTransform=\"matrix(0.8005 0 0 1.4758 0.0998 0.0528)\"\n        >\n          <stop offset=\"0.55\" stopOpacity={0} className={INDIGO_600} />\n          <stop offset=\"0.79\" className={INDIGO_600} />\n          <stop offset=\"0.86\" className={INDIGO_400} />\n        </radialGradient>\n        <linearGradient id={`${id}w`} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n          <stop offset=\"0\" className={PURPLE_200} />\n          <stop offset=\"0.5\" stopOpacity={0.56} className={INDIGO_500} />\n          <stop offset=\"1\" stopOpacity={0.15} className={INDIGO_700} />\n        </linearGradient>\n        {/* Figma's two glass highlights: a lilac line along the top, a white one along the bottom. */}\n        <linearGradient id={`${id}rim`} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n          <stop offset=\"0\" stopOpacity={0.3} className={PURPLE_400} />\n          <stop offset=\"0.15\" stopOpacity={0} className={PURPLE_400} />\n          <stop offset=\"0.92\" stopOpacity={0} className={WHITE} />\n          <stop offset=\"1\" stopOpacity={0.2} className={WHITE} />\n        </linearGradient>\n      </defs>\n      <g clipPath={url('tile')}>\n        <rect {...TILE} className=\"fill-(--ws-colors-light-brand-1100)\" />\n        <rect {...TILE} fill={url('bowl')} />\n        <rect {...TILE} fill={url('glow')} />\n      </g>\n      <rect\n        x=\"0.23\"\n        y=\"0.23\"\n        width=\"46.79\"\n        height=\"47.54\"\n        rx=\"16.18\"\n        fill=\"none\"\n        stroke={url('rim')}\n        strokeWidth=\"0.46\"\n      />\n      <path transform=\"translate(11.32 18.61)\" d={W} fill={url('w')} />\n    </svg>\n  );\n}\n"
    },
    {
      "path": "src/blocks/new-password/auth-card.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/new-password/auth-card.tsx",
      "content": "'use client';\n\nimport {\n  type RemixiconComponentType,\n  RiArrowDownSLine,\n  RiArrowLeftLine,\n  RiArrowUpSLine,\n} from '@remixicon/react';\nimport { cn } from '@/lib/wideset/utils';\nimport { type AnchorHTMLAttributes, type ReactNode, useEffect, useRef } from 'react';\n\nimport { AppIcon } from './app-icon';\n\n/*\n  The card a sign-in or sign-up screen sits in. Every starting point that uses it (the sign-in,\n  sign-up and account-access screens) carries a byte-identical copy of this file and of app-icon.tsx;\n  src/__tests__/blocks.test.tsx keeps them the same.\n*/\n\ntype AuthCardProps = {\n  /** The other screen (sign in, or create an account), in the footer; ↑ and ↓ open it too. */\n  other: { href: string; label: string };\n  children: ReactNode;\n  className?: string;\n};\n\nconst FOOTER_CONTROL =\n  'typography-body-md text-ws-static-subtle hover:text-ws-static-base gap-ws-5 rounded-ws-control-md focus-visible:wds-focus-visible outline-ws-dynamic-primary-strong-default flex cursor-pointer items-center';\n\n/**\n * Figma's sign-in card: the app icon and the form on white, a grey footer that says how to leave by\n * keyboard. Esc, or ← outside a text field, goes back; ↑ or ↓ outside a text field opens the other\n * screen. In a field the arrows stay with the field: they move the caret and open autofill.\n * 740px tall as in Figma, or the window less the page's padding when that is shorter, and never\n * shorter than its content.\n */\nexport function AuthCard({ other, children, className }: AuthCardProps) {\n  const back = useRef<HTMLButtonElement>(null);\n  const next = useRef<HTMLAnchorElement>(null);\n\n  useEffect(() => {\n    const onKeyDown = (event: KeyboardEvent) => {\n      if (event.defaultPrevented || event.isComposing) return;\n      if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) return;\n      const typing =\n        event.target instanceof Element &&\n        event.target.closest('input, textarea, select, [contenteditable]') !== null;\n      if (event.key === 'Escape' || (event.key === 'ArrowLeft' && !typing)) {\n        back.current?.click();\n      } else if ((event.key === 'ArrowUp' || event.key === 'ArrowDown') && !typing) {\n        event.preventDefault();\n        next.current?.click();\n      }\n    };\n    document.addEventListener('keydown', onKeyDown);\n    return () => document.removeEventListener('keydown', onKeyDown);\n  }, []);\n\n  return (\n    <div\n      className={cn(\n        'bg-ws-static-foreground rounded-ws-container-xl shadow-ws-low flex h-[min(46.25rem,calc(100dvh-3rem))] min-h-fit flex-col justify-between overflow-hidden',\n        className,\n      )}\n    >\n      <div className=\"gap-ws-14 p-ws-12 sm:p-ws-18 flex flex-col items-start\">\n        <AppIcon />\n        {children}\n      </div>\n      <footer className=\"bg-ws-static-alpha-subtle px-ws-12 py-ws-9 flex items-center justify-between\">\n        <button\n          ref={back}\n          type=\"button\"\n          aria-keyshortcuts=\"Escape ArrowLeft\"\n          onClick={() => window.history.back()}\n          className={FOOTER_CONTROL}\n        >\n          <Key icon={RiArrowLeftLine} />\n          Back\n        </button>\n        <a\n          ref={next}\n          href={other.href}\n          aria-keyshortcuts=\"ArrowUp ArrowDown\"\n          className={FOOTER_CONTROL}\n        >\n          <span className=\"gap-ws-3 flex\">\n            <Key icon={RiArrowUpSLine} />\n            <Key icon={RiArrowDownSLine} />\n          </span>\n          {other.label}\n        </a>\n      </footer>\n    </div>\n  );\n}\n\n/**\n * A key, drawn as Figma draws it here: the box of Button `xs` Border, as a `kbd`. The control it\n * sits in names the shortcut (`aria-keyshortcuts`), so screen readers skip the key itself.\n */\nfunction Key({ icon: Icon }: { icon: RemixiconComponentType }) {\n  return (\n    <kbd\n      aria-hidden=\"true\"\n      className=\"border-ws-dynamic-secondary-default bg-ws-static-highlight-subtle shadow-ws-controls-control rounded-ws-control-md size-ws-12 text-ws-dynamic-secondary-default flex shrink-0 items-center justify-center border\"\n    >\n      <Icon className=\"size-ws-8\" />\n    </kbd>\n  );\n}\n\n/** A link inside a sentence, as Figma draws the help line's: body text in the primary colour, underlined. */\nexport function TextLink({\n  className,\n  children,\n  ...props\n}: AnchorHTMLAttributes<HTMLAnchorElement>) {\n  return (\n    <a\n      className={cn(\n        'text-ws-dynamic-primary-default hover:text-ws-dynamic-primary-hover active:text-ws-dynamic-primary-pressed rounded-ws-control-sm focus-visible:wds-focus-visible outline-ws-dynamic-primary-strong-default underline decoration-from-font',\n        className,\n      )}\n      {...props}\n    >\n      {children}\n    </a>\n  );\n}\n"
    },
    {
      "path": "src/blocks/new-password/data.ts",
      "type": "registry:file",
      "target": "blocks/wideset/new-password/data.ts",
      "content": "/** Where the screen leads: replace with your routes. */\nexport const ROUTES = {\n  /** After the new password is saved. */\n  app: '#app',\n  signIn: '#sign-in',\n};\n\n/** The account the reset link belongs to: your server reads it from the link's token. */\nexport const ACCOUNT_EMAIL = 'maya@lumenstudio.co';\n\n/** The shortest password the form accepts; password managers read it from `minLength` too. */\nexport const MIN_PASSWORD_LENGTH = 12;\n\n/** How long a reset link works; the e-mail says the same. A no-break space keeps it on one line. */\nexport const LINK_LIFETIME = '30 minutes';\n\n/** Seconds before a new link can be sent again. */\nexport const RESEND_COOLDOWN = 30;\n"
    },
    {
      "path": "src/blocks/new-password/index.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/new-password/index.tsx",
      "content": "'use client';\n\nimport '@/styles/wideset-blocks.css';\n\nimport { ToastProvider } from '@/components/ui/wideset/toast/Toast.context';\nimport { useState } from 'react';\n\nimport { AuthCard } from './auth-card';\nimport { ROUTES } from './data';\nimport { LinkExpired } from './link-expired';\nimport { LinkSent } from './link-sent';\nimport { NewPasswordForm } from './new-password-form';\nimport { PasswordChanged } from './password-changed';\n\ntype Step = 'form' | 'saved' | 'expired' | 'sent';\n\n/**\n * New password, Inset direction with no navigation: the sign-in card opened from a reset link,\n * choosing the new password, then saying it changed. A link that ran out shows why and sends a\n * new one instead.\n */\nexport default function NewPassword() {\n  const [step, setStep] = useState<Step>('form');\n\n  return (\n    <ToastProvider position=\"bottom-center\">\n      <main className=\"ws-block-utility bg-ws-static-background p-ws-12 flex min-h-dvh items-center justify-center\">\n        <AuthCard\n          other={{ href: ROUTES.signIn, label: 'Sign in' }}\n          className=\"w-full max-w-[38.75rem]\"\n        >\n          {step === 'form' && (\n            <NewPasswordForm\n              onSaved={() => setStep('saved')}\n              onExpired={() => setStep('expired')}\n            />\n          )}\n          {step === 'saved' && <PasswordChanged />}\n          {step === 'expired' && <LinkExpired onSent={() => setStep('sent')} />}\n          {step === 'sent' && <LinkSent />}\n        </AuthCard>\n      </main>\n    </ToastProvider>\n  );\n}\n"
    },
    {
      "path": "src/blocks/new-password/link-expired.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/new-password/link-expired.tsx",
      "content": "'use client';\n\nimport { Button } from '@/components/ui/wideset/button/Button';\nimport { useEffect, useId, useRef, useState } from 'react';\n\nimport { TextLink } from './auth-card';\nimport { ACCOUNT_EMAIL, LINK_LIFETIME, ROUTES } from './data';\n\n/**\n * The card when the reset link has run out or was already used: why, and sending a new link to\n * the same address in one step, since the link already says whose account it is. Focus moves to\n * the title, so a screen reader reads the new state. Nothing here talks to a server.\n */\nexport function LinkExpired({ onSent }: { onSent: () => void }) {\n  const id = useId();\n  const title = useRef<HTMLHeadingElement>(null);\n  const [sending, setSending] = useState(false);\n  const timer = useRef<number>(undefined);\n  useEffect(() => {\n    title.current?.focus();\n    return () => window.clearTimeout(timer.current);\n  }, []);\n\n  const send = () => {\n    setSending(true);\n    // Send a new reset link here.\n    timer.current = window.setTimeout(onSent, 600);\n  };\n\n  return (\n    <section aria-labelledby={`${id}-title`} className=\"gap-ws-12 flex w-full flex-col\">\n      <div className=\"gap-ws-5 mb-ws-5 flex flex-col\">\n        <h1\n          ref={title}\n          id={`${id}-title`}\n          tabIndex={-1}\n          className=\"typography-title-md text-ws-static-strong outline-none\"\n        >\n          This link has expired\n        </h1>\n        <p className=\"typography-body-md text-ws-static-base\">\n          Reset links work for {LINK_LIFETIME}. We’ll send a new one to{' '}\n          <span className=\"text-ws-static-strong\">{ACCOUNT_EMAIL}</span>.\n        </p>\n      </div>\n      <Button size=\"lg\" className=\"w-full\" disabled={sending} onClick={send}>\n        {sending ? 'Sending…' : 'Send a new link'}\n      </Button>\n      <p className=\"typography-body-md text-ws-static-subtle\">\n        Remembered it? <TextLink href={ROUTES.signIn}>Back to sign in</TextLink>\n      </p>\n    </section>\n  );\n}\n"
    },
    {
      "path": "src/blocks/new-password/link-sent.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/new-password/link-sent.tsx",
      "content": "'use client';\n\nimport { Button } from '@/components/ui/wideset/button/Button';\nimport { useToast } from '@/components/ui/wideset/toast/Toast.context';\nimport { useEffect, useId, useRef, useState } from 'react';\n\nimport { ACCOUNT_EMAIL, LINK_LIFETIME, RESEND_COOLDOWN, ROUTES } from './data';\nimport { TextButton } from './text-button';\n\n/**\n * Seconds left before an action may run again, and a way to start the wait over. It counts to a\n * deadline rather than counting ticks, so a throttled background tab still shows the right time.\n */\nfunction useCooldown(seconds: number) {\n  const [until, setUntil] = useState(() => Date.now() + seconds * 1000);\n  const [now, setNow] = useState(() => Date.now());\n  const left = Math.max(0, Math.ceil((until - now) / 1000));\n  const counting = left > 0;\n  useEffect(() => {\n    if (!counting) return;\n    const timer = window.setInterval(() => setNow(Date.now()), 1000);\n    return () => window.clearInterval(timer);\n  }, [counting]);\n  const restart = () => {\n    const start = Date.now();\n    setNow(start);\n    setUntil(start + seconds * 1000);\n  };\n  return [left, restart] as const;\n}\n\nconst clock = (seconds: number) =>\n  `${Math.floor(seconds / 60)}:${String(seconds % 60).padStart(2, '0')}`;\n\n/**\n * The card after a new reset link was sent from the expired one, as the forgot-password screen\n * says it: where it went, how long it works, and resending once a cooldown has run out. Focus\n * moves to the title, so a screen reader reads the new state.\n */\nexport function LinkSent() {\n  const id = useId();\n  const title = useRef<HTMLHeadingElement>(null);\n  const { showToast } = useToast();\n  const [left, restart] = useCooldown(RESEND_COOLDOWN);\n\n  useEffect(() => title.current?.focus(), []);\n\n  const resend = () => {\n    // Send the reset link again here.\n    restart();\n    showToast({ content: `We sent a new link to ${ACCOUNT_EMAIL}`, status: 'success' });\n  };\n\n  return (\n    <section aria-labelledby={`${id}-title`} className=\"gap-ws-12 flex w-full flex-col\">\n      <div className=\"gap-ws-5 mb-ws-5 flex flex-col\">\n        <h1\n          ref={title}\n          id={`${id}-title`}\n          tabIndex={-1}\n          className=\"typography-title-md text-ws-static-strong outline-none\"\n        >\n          Check your e-mail\n        </h1>\n        <p className=\"typography-body-md text-ws-static-base\">\n          We sent a new link to <span className=\"text-ws-static-strong\">{ACCOUNT_EMAIL}</span>. It\n          works for {LINK_LIFETIME}.\n        </p>\n      </div>\n      <Button asChild size=\"lg\" variant=\"secondary\" preset=\"border\" className=\"w-full\">\n        <a href={ROUTES.signIn}>Back to sign in</a>\n      </Button>\n      <p className=\"typography-body-md text-ws-static-subtle\">\n        Didn’t get it? Check spam or{' '}\n        {left > 0 ? (\n          <>\n            resend it in <span className=\"tabular-nums\">{clock(left)}</span>\n          </>\n        ) : (\n          <TextButton onClick={resend}>resend it</TextButton>\n        )}\n        .\n      </p>\n    </section>\n  );\n}\n"
    },
    {
      "path": "src/blocks/new-password/new-password-form.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/new-password/new-password-form.tsx",
      "content": "'use client';\n\nimport { RiEyeLine, RiEyeOffLine } from '@remixicon/react';\nimport { Button } from '@/components/ui/wideset/button/Button';\nimport { FormField } from '@/components/ui/wideset/form-field/FormField';\nimport { TextInput } from '@/components/ui/wideset/text-input/TextInput';\nimport { type FormEvent, useEffect, useId, useRef, useState } from 'react';\n\nimport { ACCOUNT_EMAIL, LINK_LIFETIME, MIN_PASSWORD_LENGTH } from './data';\nimport { PasswordRules } from './password-rules';\nimport { TextButton } from './text-button';\n\ntype NewPasswordFormProps = {\n  /** Called once the new password is saved. */\n  onSaved: () => void;\n  /** Shows the expired-link state, the answer a server gives for a link that ran out. */\n  onExpired: () => void;\n};\n\n/** The rules, in the order the checklist shows them. */\nconst rulesFor = (password: string) => {\n  const name = ACCOUNT_EMAIL.split('@')[0].toLowerCase();\n  return [\n    {\n      label: `At least ${MIN_PASSWORD_LENGTH} characters`,\n      met: password.length >= MIN_PASSWORD_LENGTH,\n    },\n    { label: 'A number', met: /\\d/.test(password) },\n    // Empty is not \"not your e-mail\" yet: a rule ticks only once something meets it.\n    { label: 'Not your e-mail', met: password !== '' && !password.toLowerCase().includes(name) },\n  ];\n};\n\n/**\n * Choosing a new password after opening a reset link: the password with its rules ticking as you\n * type, a confirmation, and one button that stays disabled until the rules are met and the two\n * match, so the checklist is the only error message the password needs. One toggle shows both\n * fields. A mismatch is said under the confirmation once it is as long as the password or left.\n * The account's address rides along hidden, so a password manager saves the new password with it.\n * Nothing here talks to a server: a timeout stands in for the request.\n */\nexport function NewPasswordForm({ onSaved, onExpired }: NewPasswordFormProps) {\n  const id = useId();\n  const [password, setPassword] = useState('');\n  const [confirm, setConfirm] = useState('');\n  const [left, setLeft] = useState(false);\n  const [shown, setShown] = useState(false);\n  const [saving, setSaving] = useState(false);\n  const timer = useRef<number>(undefined);\n  useEffect(() => () => window.clearTimeout(timer.current), []);\n\n  const rules = rulesFor(password);\n  const matches = confirm === password;\n  const mismatch = confirm !== '' && !matches && (left || confirm.length >= password.length);\n  const ready = rules.every((rule) => rule.met) && matches;\n\n  const submit = (event: FormEvent<HTMLFormElement>) => {\n    event.preventDefault();\n    if (!ready || saving) return;\n    setSaving(true);\n    // Save the password with the link's token here; an expired token answers with onExpired().\n    timer.current = window.setTimeout(onSaved, 800);\n  };\n\n  const type = shown ? 'text' : 'password';\n\n  return (\n    <form\n      noValidate\n      onSubmit={submit}\n      aria-labelledby={`${id}-title`}\n      className=\"gap-ws-12 flex w-full flex-col\"\n    >\n      <div className=\"gap-ws-5 mb-ws-5 flex flex-col\">\n        <h1 id={`${id}-title`} className=\"typography-title-md text-ws-static-strong\">\n          Choose a new password\n        </h1>\n        <p className=\"typography-body-md text-ws-static-base\">\n          For <span className=\"text-ws-static-strong\">{ACCOUNT_EMAIL}</span>. You’ll be signed in\n          once it’s saved.\n        </p>\n      </div>\n      <input\n        type=\"text\"\n        name=\"username\"\n        autoComplete=\"username\"\n        value={ACCOUNT_EMAIL}\n        readOnly\n        hidden\n      />\n      <FormField label=\"New password\" htmlFor={`${id}-password`}>\n        <>\n          <TextInput\n            id={`${id}-password`}\n            name=\"password\"\n            autoComplete=\"new-password\"\n            minLength={MIN_PASSWORD_LENGTH}\n            required\n            value={password}\n            onChange={(event) => setPassword(event.target.value)}\n            aria-describedby={`${id}-rules`}\n            // eslint-disable-next-line jsx-a11y/no-autofocus -- the screen has one task, and it starts here\n            autoFocus\n          >\n            <TextInput.Input type={type} />\n            <TextInput.Suffix inner>\n              <TextInput.IconButton\n                icon={shown ? RiEyeOffLine : RiEyeLine}\n                aria-label={shown ? 'Hide passwords' : 'Show passwords'}\n                aria-pressed={shown}\n                onClick={() => setShown((value) => !value)}\n              />\n            </TextInput.Suffix>\n          </TextInput>\n          <PasswordRules id={`${id}-rules`} rules={rules} />\n        </>\n      </FormField>\n      <FormField\n        label=\"Confirm password\"\n        htmlFor={`${id}-confirm`}\n        errorText={mismatch ? 'The passwords don’t match.' : undefined}\n      >\n        <TextInput\n          id={`${id}-confirm`}\n          name=\"confirm\"\n          autoComplete=\"new-password\"\n          required\n          value={confirm}\n          variant={mismatch ? 'danger' : 'primary'}\n          onChange={(event) => setConfirm(event.target.value)}\n          onBlur={() => setLeft(true)}\n        >\n          <TextInput.Input type={type} />\n        </TextInput>\n      </FormField>\n      <Button type=\"submit\" size=\"lg\" className=\"w-full\" disabled={!ready || saving}>\n        {saving ? 'Saving…' : 'Save and sign in'}\n      </Button>\n      <p className=\"typography-body-md text-ws-static-subtle\">\n        This link works once, for {LINK_LIFETIME}.{' '}\n        <TextButton onClick={onExpired}>Link expired?</TextButton>\n      </p>\n    </form>\n  );\n}\n"
    },
    {
      "path": "src/blocks/new-password/password-changed.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/new-password/password-changed.tsx",
      "content": "'use client';\n\nimport { Button } from '@/components/ui/wideset/button/Button';\nimport { useEffect, useId, useRef } from 'react';\n\nimport { ROUTES } from './data';\n\n/**\n * The card once the new password is saved, in place of the form: what changed, what it did to other\n * sessions, and the one way on. Focus moves to the title, so a screen reader reads the new state.\n */\nexport function PasswordChanged() {\n  const id = useId();\n  const title = useRef<HTMLHeadingElement>(null);\n  useEffect(() => title.current?.focus(), []);\n\n  return (\n    <section aria-labelledby={`${id}-title`} className=\"gap-ws-12 flex w-full flex-col\">\n      <div className=\"gap-ws-5 mb-ws-5 flex flex-col\">\n        <h1\n          ref={title}\n          id={`${id}-title`}\n          tabIndex={-1}\n          className=\"typography-title-md text-ws-static-strong outline-none\"\n        >\n          Password changed\n        </h1>\n        <p className=\"typography-body-md text-ws-static-base\">\n          You’re signed in. We signed you out of Orbit on your other devices.\n        </p>\n      </div>\n      <Button asChild size=\"lg\" className=\"w-full\">\n        <a href={ROUTES.app}>Continue to Orbit</a>\n      </Button>\n    </section>\n  );\n}\n"
    },
    {
      "path": "src/blocks/new-password/password-rules.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/new-password/password-rules.tsx",
      "content": "'use client';\n\n// TODO(custom): a password's rules as a checklist that ticks as you type; Wideset has no password requirements list (HelperText holds one line of text).\nimport { RiCheckboxBlankCircleLine, RiCheckboxCircleFill } from '@remixicon/react';\n\nexport type PasswordRule = { label: string; met: boolean };\n\n/**\n * The rules a new password must meet, under its field, each ticked the moment it is met. Drawn as\n * Wideset's helper text draws a line (small body text, a 16px icon, 4px above and below), so it\n * reads as part of the field; the tick is the only colour, because met is a judgement. The field\n * points at the list with `aria-describedby`, and each rule says in words whether it is met.\n */\nexport function PasswordRules({ id, rules }: { id: string; rules: PasswordRule[] }) {\n  return (\n    <ul id={id} className=\"flex flex-col\">\n      {rules.map((rule) => (\n        <li\n          key={rule.label}\n          className=\"typography-body-sm text-ws-static-subtle gap-ws-3 py-ws-3 flex items-center\"\n        >\n          {rule.met ? (\n            <RiCheckboxCircleFill\n              aria-hidden=\"true\"\n              className=\"text-ws-semantic-positive size-ws-control-sm shrink-0\"\n            />\n          ) : (\n            <RiCheckboxBlankCircleLine\n              aria-hidden=\"true\"\n              className=\"text-ws-static-subtle size-ws-control-sm shrink-0\"\n            />\n          )}\n          {rule.label}\n          <span className=\"sr-only\">{rule.met ? ', done' : ', not yet'}</span>\n        </li>\n      ))}\n    </ul>\n  );\n}\n"
    },
    {
      "path": "src/blocks/new-password/text-button.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/new-password/text-button.tsx",
      "content": "'use client';\n\n// TODO(custom): an action drawn as the help line's text link; Wideset has no text-style button for an action inside a sentence (LinkButton is an anchor with control padding).\nimport { cn } from '@/lib/wideset/utils';\nimport type { ButtonHTMLAttributes } from 'react';\n\n/**\n * An action inside a sentence (resend, change the address, switch the method), drawn as\n * `TextLink` draws a link: body text in the primary colour, underlined. It is a `button`, so it\n * never navigates or submits.\n */\nexport function TextButton({\n  className,\n  children,\n  ...props\n}: ButtonHTMLAttributes<HTMLButtonElement>) {\n  return (\n    <button\n      type=\"button\"\n      className={cn(\n        'text-ws-dynamic-primary-default hover:text-ws-dynamic-primary-hover active:text-ws-dynamic-primary-pressed rounded-ws-control-sm focus-visible:wds-focus-visible outline-ws-dynamic-primary-strong-default cursor-pointer underline decoration-from-font',\n        className,\n      )}\n      {...props}\n    >\n      {children}\n    </button>\n  );\n}\n"
    }
  ],
  "meta": {
    "version": "1.1.0",
    "commit": "a734f9f0"
  }
}
