{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "block-account-settings",
  "type": "registry:block",
  "title": "Account settings",
  "description": "A person’s own settings on a raised page, each section’s title beside its controls: profile and a verified e-mail, language and region, a theme that switches, notifications, sign-in and sessions, and deleting the account behind a typed confirmation.",
  "dependencies": [
    "@remixicon/react@^4.9.0"
  ],
  "registryDependencies": [
    "https://wideset.co/r/app-shell.json",
    "https://wideset.co/r/avatar.json",
    "https://wideset.co/r/block-styles.json",
    "https://wideset.co/r/breadcrumbs.json",
    "https://wideset.co/r/button.json",
    "https://wideset.co/r/divider.json",
    "https://wideset.co/r/dropdown-menu.json",
    "https://wideset.co/r/form-field.json",
    "https://wideset.co/r/icon-button.json",
    "https://wideset.co/r/list-item.json",
    "https://wideset.co/r/modal.json",
    "https://wideset.co/r/select.json",
    "https://wideset.co/r/sidebar.json",
    "https://wideset.co/r/switch.json",
    "https://wideset.co/r/text-input.json",
    "https://wideset.co/r/tile.json",
    "https://wideset.co/r/toast.json",
    "https://wideset.co/r/utils.json"
  ],
  "files": [
    {
      "path": "src/blocks/account-settings/active-sessions.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/account-settings/active-sessions.tsx",
      "content": "'use client';\n\nimport { Button } from '@/components/ui/wideset/button/Button';\nimport { useToast } from '@/components/ui/wideset/toast/Toast.context';\nimport { useId, useState } from 'react';\n\nimport { type Session, sessions as initialSessions } from './data';\nimport { formatDateTime, formatLastActive } from './format';\nimport { SettingRow } from './setting-row';\n\n/**\n * Where Maya is signed in: each device with where and when it was last used. This device is\n * marked and cannot sign itself out here; every other one can, one at a time or all at once.\n */\nexport function ActiveSessions() {\n  const titleId = useId();\n  const { showToast } = useToast();\n  const [sessions, setSessions] = useState(initialSessions);\n  const others = sessions.filter((session) => !session.current);\n\n  const signOut = (gone: Session[]) => {\n    setSessions(sessions.filter((session) => !gone.includes(session)));\n    showToast({\n      content:\n        gone.length === 1\n          ? `Signed out of ${gone[0].device}`\n          : `Signed out of ${gone.length} other sessions`,\n    });\n  };\n\n  return (\n    <div className=\"gap-ws-9 flex flex-col\">\n      <h3 id={titleId} className=\"typography-label-strong-sm text-ws-static-strong\">\n        Active sessions\n      </h3>\n      <ul aria-labelledby={titleId} className=\"gap-ws-11 flex flex-col\">\n        {sessions.map((session) => (\n          <li key={session.id}>\n            <SettingRow\n              icon={session.icon}\n              label={session.device}\n              description={\n                <>\n                  {session.place} ·{' '}\n                  <time dateTime={session.lastActive} title={formatDateTime(session.lastActive)}>\n                    {formatLastActive(session.lastActive)}\n                  </time>\n                </>\n              }\n            >\n              {session.current ? (\n                <span className=\"typography-label-sm text-ws-static-subtle\">This device</span>\n              ) : (\n                <Button\n                  size=\"sm\"\n                  variant=\"secondary\"\n                  preset=\"border\"\n                  aria-label={`Sign out of ${session.device}`}\n                  onClick={() => signOut([session])}\n                >\n                  Sign out\n                </Button>\n              )}\n            </SettingRow>\n          </li>\n        ))}\n      </ul>\n      <div>\n        <Button\n          size=\"sm\"\n          variant=\"secondary\"\n          preset=\"border\"\n          disabled={others.length === 0}\n          onClick={() => signOut(others)}\n        >\n          Sign out of all other sessions\n        </Button>\n      </div>\n    </div>\n  );\n}\n"
    },
    {
      "path": "src/blocks/account-settings/appearance-section.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/account-settings/appearance-section.tsx",
      "content": "'use client';\n\nimport { RiComputerLine, RiMoonLine, RiSunLine } from '@remixicon/react';\nimport { Tile } from '@/components/ui/wideset/tile/Tile';\n\nimport type { Theme } from './data';\nimport { SettingsSection } from './settings-section';\n\nconst THEMES = [\n  { value: 'light', title: 'Light', description: 'Always light', icon: RiSunLine },\n  { value: 'dark', title: 'Dark', description: 'Always dark', icon: RiMoonLine },\n  {\n    value: 'system',\n    title: 'Match system',\n    description: 'Follows this device',\n    icon: RiComputerLine,\n  },\n] as const;\n\n/**\n * The theme as three tiles, one picked. It applies the moment it is picked, like a switch, so it\n * stays out of the save bar; the screen holds it and turns the whole page with it. The tiles\n * leave out `Tile.Indicator`: it is drawn as a switch, which reads as on and off for each theme\n * when only one can be chosen; the picked tile's border says it.\n */\nexport function AppearanceSection({\n  theme,\n  onThemeChange,\n}: {\n  theme: Theme;\n  onThemeChange: (theme: Theme) => void;\n}) {\n  return (\n    <SettingsSection\n      title=\"Appearance\"\n      description=\"How Orbit looks on this device. It changes right away.\"\n    >\n      <Tile.RadioGroup\n        aria-label=\"Theme\"\n        orientation=\"horizontal\"\n        value={theme}\n        onValueChange={(value) => onThemeChange(value as Theme)}\n        className=\"gap-ws-5 grid grid-cols-3\"\n      >\n        {THEMES.map(({ value, title, description, icon }) => (\n          <Tile.Radio\n            key={value}\n            value={value}\n            icon={icon}\n            title={title}\n            description={description}\n          />\n        ))}\n      </Tile.RadioGroup>\n    </SettingsSection>\n  );\n}\n"
    },
    {
      "path": "src/blocks/account-settings/brand-mark.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/account-settings/brand-mark.tsx",
      "content": "'use client';\n\nimport { cn } from '@/lib/wideset/utils';\n\nconst TILE =\n  'M0 16C0 8.45753 0 4.68629 2.34315 2.34315C4.68629 0 8.45753 0 16 0C23.5425 0 27.3137 0 29.6569 2.34315C32 4.68629 32 8.45753 32 16C32 23.5425 32 27.3137 29.6569 29.6569C27.3137 32 23.5425 32 16 32C8.45753 32 4.68629 32 2.34315 29.6569C0 27.3137 0 23.5425 0 16Z';\n\n/**\n * Orbit's mark: a planet and its ring on the inverse tile, so it inverts in dark mode. It takes\n * the size of its place (32px in a sidebar, 36px in a larger switcher). Decorative beside the\n * product's name; give it a `label` when it stands alone.\n */\nexport function BrandMark({ className, label }: { className?: string; label?: string }) {\n  return (\n    <svg\n      viewBox=\"0 0 32 32\"\n      role={label ? 'img' : undefined}\n      aria-label={label}\n      aria-hidden={label ? undefined : true}\n      className={cn('size-ws-14 shrink-0', className)}\n    >\n      <path d={TILE} className=\"fill-(--ws-static-fill-inverse-background)\" />\n      <ellipse\n        cx=\"16\"\n        cy=\"16\"\n        rx=\"10.5\"\n        ry=\"4\"\n        transform=\"rotate(-28 16 16)\"\n        strokeWidth=\"1.75\"\n        className=\"fill-none stroke-(--ws-static-text-inverse-strong)\"\n      />\n      <circle cx=\"16\" cy=\"16\" r=\"4.75\" className=\"fill-(--ws-static-text-inverse-strong)\" />\n    </svg>\n  );\n}\n"
    },
    {
      "path": "src/blocks/account-settings/danger-zone.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/account-settings/danger-zone.tsx",
      "content": "'use client';\n\nimport { useToast } from '@/components/ui/wideset/toast/Toast.context';\n\nimport { DeactivateAccountModal } from './deactivate-account-modal';\nimport { DeleteAccountModal } from './delete-account-modal';\nimport { SettingRow } from './setting-row';\nimport { SettingsSection } from './settings-section';\n\n/**\n * Leaving Orbit, kept last: deactivating (undone by signing in) above deleting (for good), each\n * in one line. Colour goes only on the delete button, the one action that cannot be undone.\n */\nexport function DangerZone({ email }: { email: string }) {\n  const { showToast } = useToast();\n\n  return (\n    <SettingsSection\n      title=\"Danger zone\"\n      description=\"Step away from Orbit for a while, or leave it for good.\"\n    >\n      <div className=\"gap-ws-11 flex flex-col\">\n        <SettingRow\n          label=\"Deactivate account\"\n          description=\"Hides you from teammates until you sign in again.\"\n        >\n          <DeactivateAccountModal\n            onDeactivate={() => showToast({ content: 'Your account is deactivated' })}\n          />\n        </SettingRow>\n        <SettingRow label=\"Delete account\" description=\"Removes your profile and notes for good.\">\n          <DeleteAccountModal\n            email={email}\n            onDelete={() => showToast({ content: 'Your account is deleted' })}\n          />\n        </SettingRow>\n      </div>\n    </SettingsSection>\n  );\n}\n"
    },
    {
      "path": "src/blocks/account-settings/data.ts",
      "type": "registry:file",
      "target": "blocks/wideset/account-settings/data.ts",
      "content": "import {\n  type RemixiconComponentType,\n  RiBankCardLine,\n  RiComputerLine,\n  RiContactsBook3Line,\n  RiGoogleLine,\n  RiHandCoinLine,\n  RiHome5Line,\n  RiInbox2Line,\n  RiKey2Line,\n  RiLineChartLine,\n  RiMacbookLine,\n  RiMicrosoftLine,\n  RiPieChart2Line,\n  RiPlugLine,\n  RiQuestionLine,\n  RiSettings3Line,\n  RiSmartphoneLine,\n  RiTeamLine,\n} from '@remixicon/react';\nimport type { AvatarColor } from '@/components/ui/wideset/avatar/Avatar.colors';\n\nimport { PHOTOS } from './people.assets';\n\n/*\n  Maya's own account, reached from the account menu at the foot of the sidebar. She works from\n  London (GMT in November), reads Orbit in US English with US dates and numbers, signs in with a\n  password and an authenticator app, has Google linked, and is signed in on three devices.\n*/\n\n/** The sample's clock: an instant, so the format example can follow the chosen time zone. */\nexport const NOW = new Date('2026-11-10T14:30:00Z');\n\n/** The product is Orbit; the workspace is Lumen Studio. */\nexport const product = { name: 'Orbit' };\nexport const workspace = { name: 'Lumen Studio', initials: 'LS' };\nexport const account = {\n  name: 'Maya Okafor',\n  email: 'maya@lumenstudio.co',\n  initials: 'MO',\n  color: 'orange' as AvatarColor,\n};\n\nexport type NavLink = {\n  id: string;\n  label: string;\n  icon: RemixiconComponentType;\n  /** The icon while the page is open (a line icon swaps for its fill). */\n  activeIcon?: RemixiconComponentType;\n};\n\nexport const mainLinks: NavLink[] = [\n  { id: 'home', label: 'Home', icon: RiHome5Line },\n  { id: 'inbox', label: 'Inbox', icon: RiInbox2Line },\n  { id: 'customers', label: 'Customers', icon: RiContactsBook3Line },\n  { id: 'deals', label: 'Deals', icon: RiHandCoinLine },\n  { id: 'revenue', label: 'Revenue', icon: RiLineChartLine },\n  { id: 'reports', label: 'Reports', icon: RiPieChart2Line },\n];\n\nexport const settingsLinks: NavLink[] = [\n  { id: 'general', label: 'General', icon: RiSettings3Line },\n  { id: 'members', label: 'Members', icon: RiTeamLine },\n  { id: 'billing', label: 'Billing', icon: RiBankCardLine },\n  { id: 'integrations', label: 'Integrations', icon: RiPlugLine },\n  { id: 'api-keys', label: 'API keys', icon: RiKey2Line },\n];\n\nexport const helpLink: NavLink = { id: 'help', label: 'Help and support', icon: RiQuestionLine };\n\n/** What the save bar saves: the profile and the language and region, as the server holds them. */\nexport type AccountValues = {\n  /** The saved photo, or an uploaded image's object URL; `null` shows the initials. */\n  photo: string | null;\n  name: string;\n  jobTitle: string;\n  email: string;\n  language: string;\n  timeZone: string;\n  /** The locale dates and numbers are written in. */\n  format: string;\n};\n\n/** A message per field that is wrong; every field's control has the id `account-<field>`. */\nexport type FieldErrors = Partial<Record<keyof AccountValues, string>>;\n\nexport const saved: AccountValues = {\n  photo: PHOTOS['Maya Okafor'] ?? null,\n  name: 'Maya Okafor',\n  jobTitle: 'Head of Sales',\n  email: 'maya@lumenstudio.co',\n  language: 'en-US',\n  timeZone: 'Europe/London',\n  format: 'en-US',\n};\n\nexport const languages = [\n  { value: 'en-US', label: 'English (US)' },\n  { value: 'en-GB', label: 'English (UK)' },\n  { value: 'de', label: 'Deutsch' },\n  { value: 'es', label: 'Español' },\n  { value: 'fr', label: 'Français' },\n  { value: 'pl', label: 'Polski' },\n  { value: 'pt-BR', label: 'Português (Brasil)' },\n];\n\nexport const timeZones = [\n  { value: 'America/Los_Angeles', label: '(GMT−08:00) Los Angeles' },\n  { value: 'America/New_York', label: '(GMT−05:00) New York' },\n  { value: 'Europe/London', label: '(GMT+00:00) London' },\n  { value: 'Europe/Lisbon', label: '(GMT+00:00) Lisbon' },\n  { value: 'Europe/Berlin', label: '(GMT+01:00) Berlin' },\n  { value: 'Europe/Warsaw', label: '(GMT+01:00) Warsaw' },\n  { value: 'Europe/Helsinki', label: '(GMT+02:00) Helsinki' },\n  { value: 'Asia/Dubai', label: '(GMT+04:00) Dubai' },\n  { value: 'Asia/Kolkata', label: '(GMT+05:30) Mumbai' },\n  { value: 'Asia/Singapore', label: '(GMT+08:00) Singapore' },\n  { value: 'Asia/Tokyo', label: '(GMT+09:00) Tokyo' },\n  { value: 'Australia/Sydney', label: '(GMT+11:00) Sydney' },\n];\n\n/** Date and number formats, named by the region whose habits they follow. */\nexport const formats = [\n  { value: 'en-US', label: 'United States' },\n  { value: 'en-GB', label: 'United Kingdom' },\n  { value: 'de-DE', label: 'Germany' },\n  { value: 'fr-FR', label: 'France' },\n  { value: 'pl-PL', label: 'Poland' },\n  { value: 'ja-JP', label: 'Japan' },\n];\n\nexport type Theme = 'light' | 'dark' | 'system';\n\n/** E-mail notifications: each switch applies the moment it flips. */\nexport const notifications: { id: string; label: string; description: string; on: boolean }[] = [\n  {\n    id: 'deals',\n    label: 'Deal updates',\n    description: 'When a deal you own moves stage, or someone comments on it.',\n    on: true,\n  },\n  {\n    id: 'mentions',\n    label: 'Mentions',\n    description: 'When someone mentions you in a note or on a deal.',\n    on: true,\n  },\n  {\n    id: 'requests',\n    label: 'Access requests',\n    description: 'When someone asks to join Lumen Studio and an admin has to answer.',\n    on: true,\n  },\n  {\n    id: 'digest',\n    label: 'Weekly revenue digest',\n    description: 'New revenue, churn and pipeline changes, every Monday at 9:00.',\n    on: false,\n  },\n  {\n    id: 'product',\n    label: 'Product updates',\n    description: 'New Orbit features, about once a month.',\n    on: false,\n  },\n];\n\nexport const security = {\n  /** ISO date the password was last changed. */\n  passwordChanged: '2026-08-14T10:00:00Z',\n  twoFactor: { method: 'an authenticator app', backupCodes: 8 },\n};\n\n/** A sign-in provider; `connected` is the address it is linked as, `null` when it is not. */\nexport type LinkedAccount = {\n  id: string;\n  name: string;\n  icon: RemixiconComponentType;\n  connected: string | null;\n};\n\nexport const linkedAccounts: LinkedAccount[] = [\n  { id: 'google', name: 'Google', icon: RiGoogleLine, connected: 'maya@lumenstudio.co' },\n  { id: 'microsoft', name: 'Microsoft', icon: RiMicrosoftLine, connected: null },\n];\n\nexport type Session = {\n  id: string;\n  device: string;\n  icon: RemixiconComponentType;\n  place: string;\n  /** ISO date and time of the last request from it. */\n  lastActive: string;\n  /** The device this page is open on: it cannot sign itself out here. */\n  current?: boolean;\n};\n\nexport const sessions: Session[] = [\n  {\n    id: 'mac',\n    device: 'Chrome on macOS',\n    icon: RiMacbookLine,\n    place: 'London, United Kingdom',\n    lastActive: '2026-11-10T14:30:00Z',\n    current: true,\n  },\n  {\n    id: 'iphone',\n    device: 'Orbit for iPhone',\n    icon: RiSmartphoneLine,\n    place: 'London, United Kingdom',\n    lastActive: '2026-11-10T12:10:00Z',\n  },\n  {\n    id: 'windows',\n    device: 'Edge on Windows',\n    icon: RiComputerLine,\n    place: 'Berlin, Germany',\n    lastActive: '2026-11-03T09:20:00Z',\n  },\n];\n"
    },
    {
      "path": "src/blocks/account-settings/deactivate-account-modal.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/account-settings/deactivate-account-modal.tsx",
      "content": "'use client';\n\nimport { Button } from '@/components/ui/wideset/button/Button';\nimport { Modal } from '@/components/ui/wideset/modal/Modal';\n\nimport { workspace } from './data';\n\n/**\n * Deactivating: it can be undone by signing in again and deletes nothing, so the dialog only\n * says what happens meanwhile and confirms with an ordinary filled button, not a red one.\n */\nexport function DeactivateAccountModal({ onDeactivate }: { onDeactivate: () => void }) {\n  return (\n    <Modal>\n      <Modal.Trigger asChild>\n        <Button size=\"sm\" variant=\"secondary\" preset=\"border\">\n          Deactivate\n        </Button>\n      </Modal.Trigger>\n      <Modal.Content className=\"ws-block-utility\">\n        <Modal.Header>\n          <Modal.Title>Deactivate your account?</Modal.Title>\n          <Modal.Description>\n            You are signed out on every device, Orbit stops e-mailing you and teammates in{' '}\n            {workspace.name} see you as deactivated. Sign in again whenever you want to come back;\n            nothing is deleted.\n          </Modal.Description>\n        </Modal.Header>\n        <Modal.Footer>\n          <Modal.Close asChild>\n            <Button variant=\"secondary\" preset=\"border\">\n              Cancel\n            </Button>\n          </Modal.Close>\n          <Modal.Close asChild>\n            <Button onClick={onDeactivate}>Deactivate account</Button>\n          </Modal.Close>\n        </Modal.Footer>\n      </Modal.Content>\n    </Modal>\n  );\n}\n"
    },
    {
      "path": "src/blocks/account-settings/delete-account-modal.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/account-settings/delete-account-modal.tsx",
      "content": "'use client';\n\nimport { Button } from '@/components/ui/wideset/button/Button';\nimport { FormField } from '@/components/ui/wideset/form-field/FormField';\nimport { Modal } from '@/components/ui/wideset/modal/Modal';\nimport { TextInput } from '@/components/ui/wideset/text-input/TextInput';\nimport { useId, useState } from 'react';\n\nimport { workspace } from './data';\n\n/**\n * Deleting the account: it cannot be undone, so the danger button stays disabled until the\n * account's e-mail address is typed. Cancel comes first and Enter never deletes.\n */\nexport function DeleteAccountModal({\n  email,\n  onDelete,\n}: {\n  /** The address to type: the one Maya signs in with. */\n  email: string;\n  onDelete: () => void;\n}) {\n  const [open, setOpen] = useState(false);\n  const [typed, setTyped] = useState('');\n  const inputId = useId();\n  const matches = typed.trim().toLowerCase() === email;\n\n  return (\n    <Modal\n      open={open}\n      onOpenChange={(next) => {\n        if (next) setTyped('');\n        setOpen(next);\n      }}\n    >\n      <Modal.Trigger asChild>\n        <Button size=\"sm\" variant=\"danger\" preset=\"border\">\n          Delete account\n        </Button>\n      </Modal.Trigger>\n      <Modal.Content className=\"ws-block-utility\">\n        <Modal.Header>\n          <Modal.Title>Delete your account?</Modal.Title>\n          <Modal.Description>\n            Your profile, notes and saved views are deleted for good, and you lose access to{' '}\n            {workspace.name} at once. Deals and customers you own stay in the workspace for an admin\n            to hand on.\n          </Modal.Description>\n        </Modal.Header>\n        <Modal.Body>\n          <FormField label={`To confirm, type “${email}”`} htmlFor={inputId}>\n            <TextInput\n              id={inputId}\n              type=\"email\"\n              autoComplete=\"off\"\n              spellCheck={false}\n              value={typed}\n              onChange={(event) => setTyped(event.target.value)}\n            />\n          </FormField>\n        </Modal.Body>\n        <Modal.Footer>\n          <Modal.Close asChild>\n            <Button variant=\"secondary\" preset=\"border\">\n              Cancel\n            </Button>\n          </Modal.Close>\n          <Button\n            variant=\"danger\"\n            disabled={!matches}\n            onClick={() => {\n              setOpen(false);\n              onDelete();\n            }}\n          >\n            Delete account\n          </Button>\n        </Modal.Footer>\n      </Modal.Content>\n    </Modal>\n  );\n}\n"
    },
    {
      "path": "src/blocks/account-settings/format.ts",
      "type": "registry:file",
      "target": "blocks/wideset/account-settings/format.ts",
      "content": "import { NOW } from './data';\n\nconst DAY = 24 * 60 * 60 * 1000;\nconst relative = new Intl.RelativeTimeFormat('en-US', { numeric: 'auto' });\nconst date = new Intl.DateTimeFormat('en-US', {\n  month: 'short',\n  day: 'numeric',\n  year: 'numeric',\n  timeZone: 'UTC',\n});\nconst dateTime = new Intl.DateTimeFormat('en-US', {\n  dateStyle: 'medium',\n  timeStyle: 'short',\n  timeZone: 'UTC',\n});\n\nconst capitalise = (text: string) => text.charAt(0).toUpperCase() + text.slice(1);\n\n/** \"Aug 14, 2026\". */\nexport const formatDate = (iso: string) => date.format(new Date(iso));\n\n/** The exact moment, for the `title` beside a relative date. */\nexport const formatDateTime = (iso: string) => dateTime.format(new Date(iso));\n\n/** \"Active now\", \"2 hours ago\", \"Yesterday\"; a week or more back, the date. */\nexport function formatLastActive(iso: string) {\n  const minutes = Math.round((NOW.getTime() - new Date(iso).getTime()) / 60000);\n  if (minutes < 5) return 'Active now';\n  if (minutes < 60 * 24) {\n    return capitalise(\n      minutes < 60\n        ? relative.format(-minutes, 'minute')\n        : relative.format(-Math.round(minutes / 60), 'hour'),\n    );\n  }\n  const days = Math.round((NOW.getTime() - new Date(iso).getTime()) / DAY);\n  return days >= 7 ? formatDate(iso) : capitalise(relative.format(-days, 'day'));\n}\n\n/**\n * How a date and an amount read in a format and time zone: \"Nov 10, 2026, 2:30 PM and\n * $1,560.00\". The amount stays in dollars; only how it is written changes.\n */\nexport function formatExample(locale: string, timeZone: string) {\n  const when = new Intl.DateTimeFormat(locale, {\n    dateStyle: 'medium',\n    timeStyle: 'short',\n    timeZone,\n  }).format(NOW);\n  const amount = new Intl.NumberFormat(locale, { style: 'currency', currency: 'USD' }).format(1560);\n  return { when, amount };\n}\n"
    },
    {
      "path": "src/blocks/account-settings/index.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/account-settings/index.tsx",
      "content": "'use client';\n\nimport '@/styles/wideset-blocks.css';\n\nimport { RiSideBarLine } from '@remixicon/react';\nimport { AppShell } from '@/components/ui/wideset/app-shell/AppShell';\nimport { Breadcrumbs } from '@/components/ui/wideset/breadcrumbs/Breadcrumbs';\nimport { cn } from '@/lib/wideset/utils';\nimport { IconButton } from '@/components/ui/wideset/button/IconButton';\nimport { ToastProvider, useToast } from '@/components/ui/wideset/toast/Toast.context';\nimport { type FormEvent, useEffect, useId, useState, useSyncExternalStore } from 'react';\n\nimport { AppearanceSection } from './appearance-section';\nimport { DangerZone } from './danger-zone';\nimport {\n  type AccountValues,\n  type FieldErrors,\n  notifications,\n  saved as initialValues,\n  type Theme,\n} from './data';\nimport { NotificationsSection } from './notifications-section';\nimport { PageHeader } from './page-header';\nimport { ProfileSection } from './profile-section';\nimport { RegionSection } from './region-section';\nimport { SaveBar } from './save-bar';\nimport { SecuritySection } from './security-section';\nimport { AccountSidebar } from './sidebar';\n\n/** One column of the page: the header, the sections and the save bar share its edges. */\nconst COLUMN = 'px-ws-14 mx-auto w-full max-w-[80rem]';\n/** The fields in the order they appear, so the first wrong one gets the focus. */\nconst FIELDS = Object.keys(initialValues) as (keyof AccountValues)[];\nconst EMAIL = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n\nfunction validate(values: AccountValues): FieldErrors {\n  const errors: FieldErrors = {};\n  if (!values.name.trim()) errors.name = 'Enter your name.';\n  if (!EMAIL.test(values.email.trim()))\n    errors.email = 'Enter an e-mail address like maya@lumenstudio.co.';\n  return errors;\n}\n\n/**\n * Whether the device asks for dark, kept in step with it. Where there is no `matchMedia` (a test\n * runner, an old browser) the answer is light and nothing is watched.\n */\nconst DARK_QUERY = '(prefers-color-scheme: dark)';\nconst darkQuery = () =>\n  typeof window !== 'undefined' && typeof window.matchMedia === 'function'\n    ? window.matchMedia(DARK_QUERY)\n    : null;\nconst subscribe = (onChange: () => void) => {\n  const query = darkQuery();\n  query?.addEventListener('change', onChange);\n  return () => query?.removeEventListener('change', onChange);\n};\nconst useSystemDark = () =>\n  useSyncExternalStore(\n    subscribe,\n    () => darkQuery()?.matches ?? false,\n    () => false,\n  );\n\n/**\n * The page inside the card, under the toasts. Profile and language and region are one form with\n * one save bar, up only while the draft differs from what is saved; the theme, the switches and\n * everything in security apply at once.\n */\nfunction AccountPage({\n  theme,\n  onThemeChange,\n}: {\n  theme: Theme;\n  onThemeChange: (theme: Theme) => void;\n}) {\n  const { showToast } = useToast();\n  const formId = useId();\n  // What the server holds; the form edits a draft of it.\n  const [stored, setStored] = useState(initialValues);\n  const [draft, setDraft] = useState(initialValues);\n  const [errors, setErrors] = useState<FieldErrors>({});\n  const [pendingEmail, setPendingEmail] = useState<string | null>(null);\n  const [notify, setNotify] = useState(() =>\n    Object.fromEntries(notifications.map(({ id, on }) => [id, on])),\n  );\n  const changes = FIELDS.filter((field) => draft[field] !== stored[field]).length;\n  const dirty = changes > 0;\n\n  // Closing the tab with unsaved changes asks first.\n  useEffect(() => {\n    if (!dirty) return;\n    const warn = (event: BeforeUnloadEvent) => event.preventDefault();\n    window.addEventListener('beforeunload', warn);\n    return () => window.removeEventListener('beforeunload', warn);\n  }, [dirty]);\n\n  const update = (patch: Partial<AccountValues>) => {\n    const next = { ...draft, ...patch };\n    setDraft(next);\n    // An error shown after a save goes as soon as its field is right; nothing new appears.\n    const now = validate(next);\n    setErrors((shown) => {\n      const kept: FieldErrors = {};\n      for (const field of FIELDS) if (shown[field] && now[field]) kept[field] = now[field];\n      return kept;\n    });\n  };\n\n  const save = (event: FormEvent<HTMLFormElement>) => {\n    event.preventDefault();\n    const found = validate(draft);\n    setErrors(found);\n    const first = FIELDS.find((field) => found[field]);\n    if (first) {\n      document.getElementById(`account-${first}`)?.focus();\n      return;\n    }\n    const email = draft.email.trim().toLowerCase();\n    // A new address takes over only once the link sent to it is opened.\n    const next = { ...draft, email: stored.email };\n    if (email !== stored.email) setPendingEmail(email);\n    setStored(next);\n    setDraft(next);\n    showToast({ status: 'success', content: 'Changes saved' });\n  };\n\n  return (\n    <>\n      {/* The page scrolls inside the card, so the card's corners stay put. */}\n      <div className=\"ws-scrollbar min-h-0 flex-1 overflow-y-auto\">\n        <div className={cn(COLUMN, 'gap-ws-14 pt-ws-14 pb-ws-16 flex flex-col')}>\n          <PageHeader />\n          <div className=\"gap-ws-14 flex flex-col\">\n            <form id={formId} noValidate onSubmit={save} className=\"gap-ws-14 flex flex-col\">\n              <ProfileSection\n                values={draft}\n                errors={errors}\n                onChange={update}\n                confirmedEmail={stored.email}\n                pendingEmail={pendingEmail}\n                onResend={() =>\n                  showToast({ content: `Confirmation link sent again to ${pendingEmail}` })\n                }\n              />\n              <RegionSection values={draft} onChange={update} />\n            </form>\n            <AppearanceSection theme={theme} onThemeChange={onThemeChange} />\n            <NotificationsSection\n              values={notify}\n              onChange={(id, on) => setNotify({ ...notify, [id]: on })}\n            />\n            <SecuritySection />\n            <DangerZone email={stored.email} />\n          </div>\n        </div>\n      </div>\n      {dirty && (\n        <SaveBar\n          form={formId}\n          changes={changes}\n          onCancel={() => {\n            setDraft(stored);\n            setErrors({});\n          }}\n        />\n      )}\n    </>\n  );\n}\n\n/**\n * Account settings (Inset direction): Maya's own account on the raised page beside the workspace\n * sidebar, reached from the account menu, so no sidebar page is active. One calm column of\n * sections, each a title and a line beside its controls: profile, language and region,\n * appearance, notifications, sign-in and security, and the danger zone. The theme really turns\n * the screen: the `dark` class on its root re-points every token under it (a real app sets it\n * on <html> with `useTheme`, so menus and dialogs, which open outside the screen, follow too).\n */\nexport default function AccountSettings() {\n  const sidebarId = useId();\n  const [collapsed, setCollapsed] = useState(false);\n  const [theme, setTheme] = useState<Theme>('system');\n  const systemDark = useSystemDark();\n  const dark = theme === 'dark' || (theme === 'system' && systemDark);\n\n  return (\n    <ToastProvider position=\"bottom-center\">\n      <AppShell direction=\"inset\" className={['ws-block-utility', (cn(dark && 'dark'))].filter(Boolean).join(' ')}>\n        <AccountSidebar id={sidebarId} collapsed={collapsed} onCollapsedChange={setCollapsed} />\n        <AppShell.Main>\n          <div className=\"h-ws-18 border-ws-static-base flex shrink-0 items-center border-b\">\n            {/* The bar belongs to the surround: it runs edge to edge. The sidebar's toggle is\n                pulled left so its glyph, not its box, sits 20px from the edge; the crumbs follow\n                it. */}\n            <div className=\"gap-ws-5 px-ws-11 flex w-full items-center\">\n              <IconButton\n                icon={RiSideBarLine}\n                variant=\"secondary\"\n                preset=\"ghost\"\n                size=\"sm\"\n                iconClassName=\"text-ws-static-subtle size-ws-9\"\n                aria-label={collapsed ? 'Expand sidebar' : 'Collapse sidebar'}\n                aria-expanded={!collapsed}\n                aria-controls={sidebarId}\n                onClick={() => setCollapsed(!collapsed)}\n                className=\"-ml-ws-5\"\n              />\n              <Breadcrumbs separator=\"arrow\">\n                <Breadcrumbs.Item asChild>\n                  <a href=\"#account\">Account</a>\n                </Breadcrumbs.Item>\n                <Breadcrumbs.Item>Settings</Breadcrumbs.Item>\n              </Breadcrumbs>\n            </div>\n          </div>\n\n          <AccountPage theme={theme} onThemeChange={setTheme} />\n        </AppShell.Main>\n      </AppShell>\n    </ToastProvider>\n  );\n}\n"
    },
    {
      "path": "src/blocks/account-settings/linked-accounts.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/account-settings/linked-accounts.tsx",
      "content": "'use client';\n\nimport { Button } from '@/components/ui/wideset/button/Button';\nimport { useToast } from '@/components/ui/wideset/toast/Toast.context';\nimport { useId, useState } from 'react';\n\nimport { account, linkedAccounts } from './data';\nimport { SettingRow } from './setting-row';\n\n/**\n * The providers Maya can sign in with besides her password: each says whom it is linked as, or\n * that it is not, and offers the one thing to do about it. A change applies at once.\n */\nexport function LinkedAccounts() {\n  const titleId = useId();\n  const { showToast } = useToast();\n  const [linked, setLinked] = useState(linkedAccounts);\n\n  const link = (id: string, connected: string | null) =>\n    setLinked(linked.map((item) => (item.id === id ? { ...item, connected } : item)));\n\n  return (\n    <div className=\"gap-ws-9 flex flex-col\">\n      <h3 id={titleId} className=\"typography-label-strong-sm text-ws-static-strong\">\n        Linked accounts\n      </h3>\n      <ul aria-labelledby={titleId} className=\"gap-ws-11 flex flex-col\">\n        {linked.map(({ id, name, icon, connected }) => (\n          <li key={id}>\n            <SettingRow\n              icon={icon}\n              label={name}\n              description={connected ? `Connected as ${connected}` : 'Not connected'}\n            >\n              {connected ? (\n                <Button\n                  size=\"sm\"\n                  variant=\"secondary\"\n                  preset=\"border\"\n                  aria-label={`Disconnect ${name}`}\n                  onClick={() => {\n                    link(id, null);\n                    showToast({ content: `${name} disconnected` });\n                  }}\n                >\n                  Disconnect\n                </Button>\n              ) : (\n                <Button\n                  size=\"sm\"\n                  variant=\"secondary\"\n                  preset=\"border\"\n                  aria-label={`Connect ${name}`}\n                  onClick={() => {\n                    link(id, account.email);\n                    showToast({ status: 'success', content: `${name} connected` });\n                  }}\n                >\n                  Connect\n                </Button>\n              )}\n            </SettingRow>\n          </li>\n        ))}\n      </ul>\n    </div>\n  );\n}\n"
    },
    {
      "path": "src/blocks/account-settings/notifications-section.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/account-settings/notifications-section.tsx",
      "content": "'use client';\n\nimport { account, notifications } from './data';\nimport { SettingsSection } from './settings-section';\nimport { SwitchRow } from './switch-row';\n\n/**\n * What Orbit e-mails Maya about, one switch each. A switch applies the moment it flips, so the\n * section stays out of the save bar and its line says so.\n */\nexport function NotificationsSection({\n  values,\n  onChange,\n}: {\n  values: Record<string, boolean>;\n  onChange: (id: string, on: boolean) => void;\n}) {\n  return (\n    <SettingsSection\n      title=\"Notifications\"\n      description={`E-mails to ${account.email}. Each switch applies right away.`}\n    >\n      <ul className=\"gap-ws-11 flex flex-col\">\n        {notifications.map(({ id, label, description }) => (\n          <li key={id}>\n            <SwitchRow\n              label={label}\n              description={description}\n              checked={values[id]}\n              onCheckedChange={(on) => onChange(id, on)}\n            />\n          </li>\n        ))}\n      </ul>\n    </SettingsSection>\n  );\n}\n"
    },
    {
      "path": "src/blocks/account-settings/page-header.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/account-settings/page-header.tsx",
      "content": "'use client';\n\n// TODO(custom): page header (title and a line of description); no PageHeader in Wideset.\n\n/**\n * The page's title and what it holds in one line. It has no action of its own: the only filled\n * button is Save changes, and it comes with the save bar once something changes.\n */\nexport function PageHeader() {\n  return (\n    <header className=\"gap-ws-2 flex min-w-0 flex-col\">\n      <h1 className=\"typography-title-md text-ws-static-strong\">Account settings</h1>\n      <p className=\"typography-body-md text-ws-static-subtle\">\n        Your profile, how Orbit looks and talks to you, and how you sign in. Only you see these.\n      </p>\n    </header>\n  );\n}\n"
    },
    {
      "path": "src/blocks/account-settings/people.assets.ts",
      "type": "registry:file",
      "target": "blocks/wideset/account-settings/people.assets.ts",
      "content": "// Portraits of the sample people as small JPEG data URLs (a block ships only .ts and .tsx).\n// Exported from the Wideset Core Figma file by people.cjs: do not edit by hand.\n\n/** A person’s photo by name. People who are not here show their initials. */\nexport const PHOTOS: Record<string, string | undefined> = {\n  'Maya Okafor':\n    'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/4gHYSUNDX1BST0ZJTEUAAQEAAAHIAAAAAAQwAABtbnRyUkdCIFhZWiAH4AABAAEAAAAAAABhY3NwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAA9tYAAQAAAADTLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlkZXNjAAAA8AAAACRyWFlaAAABFAAAABRnWFlaAAABKAAAABRiWFlaAAABPAAAABR3dHB0AAABUAAAABRyVFJDAAABZAAAAChnVFJDAAABZAAAAChiVFJDAAABZAAAAChjcHJ0AAABjAAAADxtbHVjAAAAAAAAAAEAAAAMZW5VUwAAAAgAAAAcAHMAUgBHAEJYWVogAAAAAAAAb6IAADj1AAADkFhZWiAAAAAAAABimQAAt4UAABjaWFlaIAAAAAAAACSgAAAPhAAAts9YWVogAAAAAAAA9tYAAQAAAADTLXBhcmEAAAAAAAQAAAACZmYAAPKnAAANWQAAE9AAAApbAAAAAAAAAABtbHVjAAAAAAAAAAEAAAA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JfvrRGOwyV0D0sJUbRSeZcZXfRKCJWTiB3x4XG9/mzujZ+WMepPXKbyKLf7HK5baMWl1VJ+aXLyUe4ntkia4CSOT2BwqBWx+TWPb2JyFoJBdZ5ZyOXvyPkqTeosPEoCYtWUXPSru1qI58Pg//2Q==',\n};\n"
    },
    {
      "path": "src/blocks/account-settings/person-avatar.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/account-settings/person-avatar.tsx",
      "content": "'use client';\n\nimport { Avatar } from '@/components/ui/wideset/avatar/Avatar';\nimport { type AvatarColor } from '@/components/ui/wideset/avatar/Avatar.colors';\nimport { type AvatarProps } from '@/components/ui/wideset/avatar/Avatar.types';\n\nimport { PHOTOS } from './people.assets';\n\ntype PersonAvatarProps = Pick<\n  AvatarProps,\n  'size' | 'shape' | 'status' | 'className' | 'style' | 'title' | 'aria-hidden' | 'aria-label'\n> & {\n  /** The person's full name: the key their photo is filed under. */\n  name: string;\n  initials: string;\n  /** The colour of the initials. A photo takes none. */\n  color?: AvatarColor;\n  /** Empty beside the person's name (the default); their name when the avatar stands alone. */\n  alt?: string;\n};\n\n/**\n * A person's avatar: their photo when they have one, their initials when not. The choice lives\n * here so every place the block draws a person mixes the two the same way. The rest of the props\n * go to the `Avatar`, so it also sits in an `Avatar.Group`.\n */\nexport function PersonAvatar({ name, initials, color, alt = '', ...avatar }: PersonAvatarProps) {\n  const photo = PHOTOS[name];\n  return photo ? (\n    <Avatar src={photo} alt={alt} initials={initials} {...avatar} />\n  ) : (\n    <Avatar initials={initials} color={color} {...avatar} />\n  );\n}\n"
    },
    {
      "path": "src/blocks/account-settings/profile-section.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/account-settings/profile-section.tsx",
      "content": "'use client';\n\n// TODO(custom): photo upload (Change, Remove) composed by hand, and a helper line holding an action (HelperText is not exported and takes text only).\nimport { RiCheckboxCircleFill } from '@remixicon/react';\nimport { Avatar } from '@/components/ui/wideset/avatar/Avatar';\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 { useEffect, useRef } from 'react';\n\nimport { account, type AccountValues, type FieldErrors } from './data';\nimport { SettingsSection } from './settings-section';\nimport { TextButton } from './text-button';\n\n/**\n * Who Maya is to her teammates: photo, name, job title and the e-mail she signs in with, saved\n * with the save bar. The address carries its state: Verified as a quiet mark beside its label;\n * a new address does not replace it until the link sent to it is opened, and until then the line\n * under the field says so, with Resend.\n */\nexport function ProfileSection({\n  values,\n  errors,\n  onChange,\n  confirmedEmail,\n  pendingEmail,\n  onResend,\n}: {\n  values: AccountValues;\n  errors: FieldErrors;\n  onChange: (patch: Partial<AccountValues>) => void;\n  /** The address Maya signs in with now. */\n  confirmedEmail: string;\n  /** A new address waiting for its confirmation link to be opened. */\n  pendingEmail: string | null;\n  onResend: () => void;\n}) {\n  const fileInput = useRef<HTMLInputElement>(null);\n  // Object URLs made for picked files, released when the section goes.\n  const objectUrls = useRef<string[]>([]);\n  useEffect(() => {\n    const urls = objectUrls.current;\n    return () => urls.forEach((url) => URL.revokeObjectURL(url));\n  }, []);\n  const editing = values.email !== confirmedEmail;\n  const waiting = pendingEmail !== null && !editing && !errors.email;\n\n  return (\n    <SettingsSection title=\"Profile\" description=\"How you appear to your teammates in Orbit.\">\n      <div className=\"gap-ws-11 flex flex-col\">\n        <FormField label=\"Photo\" id=\"account-photo-label\">\n          <div\n            role=\"group\"\n            aria-labelledby=\"account-photo-label\"\n            className=\"gap-ws-9 flex items-center\"\n          >\n            {values.photo ? (\n              <Avatar size=\"xl\" src={values.photo} alt={values.name} initials={account.initials} />\n            ) : (\n              <Avatar size=\"xl\" initials={account.initials} color={account.color} />\n            )}\n            <div className=\"gap-ws-5 flex\">\n              <Button\n                id=\"account-photo\"\n                size=\"sm\"\n                variant=\"secondary\"\n                preset=\"border\"\n                onClick={() => fileInput.current?.click()}\n              >\n                {values.photo ? 'Change photo' : 'Upload photo'}\n              </Button>\n              {values.photo && (\n                <Button\n                  size=\"sm\"\n                  variant=\"secondary\"\n                  preset=\"ghost\"\n                  onClick={() => onChange({ photo: null })}\n                >\n                  Remove\n                </Button>\n              )}\n            </div>\n            <input\n              ref={fileInput}\n              type=\"file\"\n              accept=\"image/png,image/jpeg\"\n              hidden\n              onChange={(event) => {\n                const file = event.target.files?.[0];\n                if (!file) return;\n                const url = URL.createObjectURL(file);\n                objectUrls.current.push(url);\n                onChange({ photo: url });\n                event.target.value = '';\n              }}\n            />\n          </div>\n        </FormField>\n\n        <FormField label=\"Name\" htmlFor=\"account-name\" errorText={errors.name}>\n          <TextInput\n            id=\"account-name\"\n            size=\"sm\"\n            required\n            autoComplete=\"name\"\n            variant={errors.name ? 'danger' : 'primary'}\n            value={values.name}\n            onChange={(event) => onChange({ name: event.target.value })}\n          />\n        </FormField>\n\n        <FormField label=\"Job title\" htmlFor=\"account-jobTitle\" suffix=\"(optional)\">\n          <TextInput\n            id=\"account-jobTitle\"\n            size=\"sm\"\n            autoComplete=\"organization-title\"\n            value={values.jobTitle}\n            onChange={(event) => onChange({ jobTitle: event.target.value })}\n          />\n        </FormField>\n\n        <FormField\n          label=\"E-mail\"\n          htmlFor=\"account-email\"\n          aside={\n            editing ? undefined : (\n              <span className=\"gap-ws-2 flex items-center\">\n                <RiCheckboxCircleFill\n                  aria-hidden=\"true\"\n                  className=\"size-ws-8 text-ws-semantic-positive\"\n                />\n                Verified\n              </span>\n            )\n          }\n          helperText={\n            errors.email || waiting\n              ? undefined\n              : editing\n                ? 'We send a link to the new address; it takes over once the link is opened.'\n                : 'You sign in with it, and notifications go here.'\n          }\n          errorText={errors.email}\n        >\n          <TextInput\n            id=\"account-email\"\n            type=\"email\"\n            size=\"sm\"\n            required\n            autoComplete=\"email\"\n            variant={errors.email ? 'danger' : 'primary'}\n            value={values.email}\n            onChange={(event) => onChange({ email: event.target.value })}\n          />\n        </FormField>\n        {waiting && (\n          // Drawn as FormField's helper line, which cannot hold a button.\n          <p role=\"status\" className=\"typography-body-sm text-ws-static-subtle py-ws-3 -mt-ws-8\">\n            Check your inbox at {pendingEmail} to confirm the new address.{' '}\n            <TextButton onClick={onResend}>Resend</TextButton>\n          </p>\n        )}\n      </div>\n    </SettingsSection>\n  );\n}\n"
    },
    {
      "path": "src/blocks/account-settings/region-section.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/account-settings/region-section.tsx",
      "content": "'use client';\n\nimport { FormField } from '@/components/ui/wideset/form-field/FormField';\nimport { Select } from '@/components/ui/wideset/select/Select';\n\nimport { type AccountValues, formats, languages, timeZones } from './data';\nimport { formatExample } from './format';\nimport { SettingsSection } from './settings-section';\n\n/**\n * The language Orbit speaks, the time zone it keeps and how it writes dates and numbers, saved\n * with the save bar. The format is easier to pick by sight than by name, so a line under it\n * shows today and an amount the way the current choice (and time zone) writes them.\n */\nexport function RegionSection({\n  values,\n  onChange,\n}: {\n  values: AccountValues;\n  onChange: (patch: Partial<AccountValues>) => void;\n}) {\n  const example = formatExample(values.format, values.timeZone);\n\n  return (\n    <SettingsSection\n      title=\"Language and region\"\n      description=\"The language Orbit uses, and how it writes times, dates and amounts.\"\n    >\n      <div className=\"gap-ws-11 flex flex-col\">\n        <FormField label=\"Language\" htmlFor=\"account-language\">\n          <Select\n            id=\"account-language\"\n            size=\"sm\"\n            className=\"w-full\"\n            options={languages}\n            value={values.language}\n            onValueChange={(language) => onChange({ language })}\n          />\n        </FormField>\n\n        <FormField\n          label=\"Time zone\"\n          htmlFor=\"account-timeZone\"\n          helperText=\"Due dates, reminders and the Monday digest follow it.\"\n        >\n          <Select\n            id=\"account-timeZone\"\n            size=\"sm\"\n            className=\"w-full\"\n            hasSearch\n            options={timeZones}\n            value={values.timeZone}\n            onValueChange={(timeZone) => onChange({ timeZone })}\n          />\n        </FormField>\n\n        <FormField\n          label=\"Date and number format\"\n          htmlFor=\"account-format\"\n          helperText={`Now reads ${example.when}; an amount reads ${example.amount}.`}\n        >\n          <Select\n            id=\"account-format\"\n            size=\"sm\"\n            className=\"w-full\"\n            options={formats}\n            value={values.format}\n            onValueChange={(format) => onChange({ format })}\n          />\n        </FormField>\n      </div>\n    </SettingsSection>\n  );\n}\n"
    },
    {
      "path": "src/blocks/account-settings/save-bar.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/account-settings/save-bar.tsx",
      "content": "'use client';\n\n// TODO(custom): unsaved-changes bar (count, Cancel, Save); ActionBar is for selections only.\nimport { Button } from '@/components/ui/wideset/button/Button';\n\n/**\n * The page's one way to save: a bar along the card's foot, under the scrolling page, shown only\n * while something differs from what is saved. It runs on the page's column, so its buttons end\n * where the controls do; Save submits the form by its id.\n */\nexport function SaveBar({\n  form,\n  changes,\n  onCancel,\n}: {\n  form: string;\n  changes: number;\n  onCancel: () => void;\n}) {\n  return (\n    <div className=\"border-ws-static-base py-ws-7 shrink-0 border-t\">\n      <div className=\"gap-ws-9 px-ws-14 mx-auto flex w-full max-w-[80rem] items-center justify-between\">\n        <p role=\"status\" className=\"typography-body-md text-ws-static-base\">\n          {changes === 1 ? '1 unsaved change' : `${changes} unsaved changes`}\n        </p>\n        <div className=\"gap-ws-5 flex\">\n          <Button size=\"sm\" variant=\"secondary\" preset=\"border\" onClick={onCancel}>\n            Cancel\n          </Button>\n          <Button size=\"sm\" type=\"submit\" form={form}>\n            Save changes\n          </Button>\n        </div>\n      </div>\n    </div>\n  );\n}\n"
    },
    {
      "path": "src/blocks/account-settings/security-section.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/account-settings/security-section.tsx",
      "content": "'use client';\n\nimport { Button } from '@/components/ui/wideset/button/Button';\nimport { useToast } from '@/components/ui/wideset/toast/Toast.context';\n\nimport { ActiveSessions } from './active-sessions';\nimport { account, security } from './data';\nimport { formatDate } from './format';\nimport { LinkedAccounts } from './linked-accounts';\nimport { SettingRow } from './setting-row';\nimport { SettingsSection } from './settings-section';\n\n/**\n * How Maya gets in and where she is in now: the password and two-factor first, then the linked\n * sign-in providers, then her sessions. Everything here acts at once (or e-mails a link), so the\n * section has no part in the save bar.\n */\nexport function SecuritySection() {\n  const { showToast } = useToast();\n\n  return (\n    <SettingsSection\n      title=\"Sign-in and security\"\n      description=\"How you sign in, and the devices you are signed in on now.\"\n    >\n      <div className=\"gap-ws-14 flex flex-col\">\n        <div className=\"gap-ws-11 flex flex-col\">\n          <SettingRow\n            label=\"Password\"\n            description={`Last changed on ${formatDate(security.passwordChanged)}.`}\n          >\n            <Button\n              size=\"sm\"\n              variant=\"secondary\"\n              preset=\"border\"\n              onClick={() =>\n                showToast({\n                  status: 'success',\n                  content: `A link to change your password is on its way to ${account.email}`,\n                })\n              }\n            >\n              Change password\n            </Button>\n          </SettingRow>\n          <SettingRow\n            label=\"Two-factor authentication\"\n            description={`On, with ${security.twoFactor.method}. ${security.twoFactor.backupCodes} backup codes left.`}\n          >\n            <Button size=\"sm\" variant=\"secondary\" preset=\"border\" asChild>\n              <a href=\"#two-factor\">Manage</a>\n            </Button>\n          </SettingRow>\n        </div>\n        <LinkedAccounts />\n        <ActiveSessions />\n      </div>\n    </SettingsSection>\n  );\n}\n"
    },
    {
      "path": "src/blocks/account-settings/setting-row.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/account-settings/setting-row.tsx",
      "content": "'use client';\n\n// TODO(custom): setting row (name and description beside an action); no component in Wideset.\nimport type { RemixiconComponentType } from '@remixicon/react';\nimport type { ReactNode } from 'react';\n\n/**\n * A setting with an action: its name and one line on the left, the button on the right edge.\n * A row that stands for a thing (a linked account, a device) leads with its icon.\n */\nexport function SettingRow({\n  label,\n  description,\n  icon: Icon,\n  children,\n}: {\n  label: ReactNode;\n  description: ReactNode;\n  icon?: RemixiconComponentType;\n  children?: ReactNode;\n}) {\n  return (\n    <div className=\"gap-ws-9 flex items-center justify-between\">\n      <div className=\"gap-ws-7 flex min-w-0 items-center\">\n        {Icon && <Icon aria-hidden=\"true\" className=\"size-ws-9 text-ws-static-base shrink-0\" />}\n        <div className=\"gap-ws-3 flex min-w-0 flex-col\">\n          {/* Set like Switch.Label, so action rows and switch rows read the same. */}\n          <p className=\"typography-label-sm text-ws-dynamic-secondary-default\">{label}</p>\n          <p className=\"typography-label-sm text-ws-static-subtle\">{description}</p>\n        </div>\n      </div>\n      {children && <div className=\"gap-ws-5 flex shrink-0\">{children}</div>}\n    </div>\n  );\n}\n"
    },
    {
      "path": "src/blocks/account-settings/settings-section.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/account-settings/settings-section.tsx",
      "content": "'use client';\n\n// TODO(custom): settings section (title and one line on the left, its controls on the right); no SettingsSection in Wideset.\nimport { type ReactNode, useId } from 'react';\n\n/**\n * One band of the settings page: what it is, in a title and one line, on the left; its controls\n * in a 40rem column pinned to the page's right edge, so every section's controls (and the save\n * bar's buttons) end on the same line. Bands are split by a line, not boxed.\n */\nexport function SettingsSection({\n  title,\n  description,\n  children,\n}: {\n  title: string;\n  description: ReactNode;\n  children: ReactNode;\n}) {\n  const titleId = useId();\n\n  return (\n    <section\n      aria-labelledby={titleId}\n      className=\"gap-x-ws-16 gap-y-ws-9 border-ws-static-subtle pt-ws-14 first:pt-ws-0 grid grid-cols-1 justify-between border-t first:border-t-0 lg:grid-cols-[20rem_minmax(0,40rem)]\"\n    >\n      <div className=\"gap-ws-3 flex flex-col\">\n        <h2 id={titleId} className=\"typography-label-strong-md text-ws-static-strong\">\n          {title}\n        </h2>\n        <p className=\"typography-body-md text-ws-static-subtle\">{description}</p>\n      </div>\n      <div className=\"flex min-w-0 flex-col\">{children}</div>\n    </section>\n  );\n}\n"
    },
    {
      "path": "src/blocks/account-settings/sidebar.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/account-settings/sidebar.tsx",
      "content": "'use client';\n\n// TODO(custom): workspace switcher and account menu are composed by hand.\nimport {\n  RiAddLine,\n  RiArrowDownSLine,\n  RiLogoutBoxRLine,\n  RiSearchLine,\n  RiSettingsLine,\n} from '@remixicon/react';\nimport { Divider } from '@/components/ui/wideset/divider/Divider';\nimport { DropdownMenu } from '@/components/ui/wideset/dropdown/DropdownMenu';\nimport { IconButton } from '@/components/ui/wideset/button/IconButton';\nimport { ListItem } from '@/components/ui/wideset/list-item/ListItem';\nimport { Sidebar } from '@/components/ui/wideset/sidebar/Sidebar';\nimport { type SidebarProps } from '@/components/ui/wideset/sidebar/Sidebar.types';\nimport { TextInput } from '@/components/ui/wideset/text-input/TextInput';\nimport { useState } from 'react';\n\nimport { BrandMark } from './brand-mark';\nimport {\n  account,\n  helpLink,\n  mainLinks,\n  type NavLink,\n  product,\n  settingsLinks,\n  workspace,\n} from './data';\nimport { PersonAvatar } from './person-avatar';\n\n/**\n * The workspace sidebar: switcher, search, the app's pages, settings and the signed-in account.\n * Account settings open from the account menu, so no page in it is active.\n * Its toggle sits in the page bar, so the screen holds `collapsed` and passes it down; collapsed,\n * it keeps the mark, the page icons and the avatar.\n */\nexport function AccountSidebar(\n  props: Pick<SidebarProps, 'id' | 'collapsed' | 'onCollapsedChange'>,\n) {\n  const [active, setActive] = useState('');\n\n  const link = ({ id, label, icon, activeIcon }: NavLink) => (\n    <Sidebar.Item\n      key={id}\n      href={`#${id}`}\n      icon={active === id ? (activeIcon ?? icon) : icon}\n      label={label}\n      active={active === id}\n      onClick={() => setActive(id)}\n    />\n  );\n\n  const nav = (\n    <nav aria-label=\"Workspace\" className=\"gap-ws-9 flex flex-col\">\n      <div className=\"flex flex-col\">{mainLinks.map(link)}</div>\n      <Divider weight=\"thin\" />\n      <div role=\"group\" aria-labelledby=\"sidebar-settings\" className=\"gap-ws-2 flex flex-col\">\n        <Sidebar.SectionHeader id=\"sidebar-settings\">Settings</Sidebar.SectionHeader>\n        {settingsLinks.map(link)}\n      </div>\n    </nav>\n  );\n\n  return (\n    <Sidebar {...props}>\n      <Sidebar.Header>\n        <Sidebar.Expanded>\n          <div className=\"gap-ws-9 flex flex-col\">\n            <div className=\"gap-ws-7 pt-ws-3 pb-ws-7 flex items-center\">\n              <BrandMark className=\"size-ws-15\" />\n              <div className=\"flex min-w-0 flex-1 flex-col\">\n                <span className=\"typography-label-strong-sm text-ws-static-strong truncate\">\n                  {workspace.name}\n                </span>\n                <span className=\"typography-caption-md text-ws-static-subtle truncate\">\n                  {product.name}\n                </span>\n              </div>\n              <DropdownMenu>\n                <DropdownMenu.Trigger asChild>\n                  <IconButton\n                    icon={RiArrowDownSLine}\n                    variant=\"secondary\"\n                    preset=\"ghost\"\n                    size=\"xs\"\n                    aria-label=\"Switch workspace\"\n                    className=\"mr-ws-3\"\n                  />\n                </DropdownMenu.Trigger>\n                <DropdownMenu.Content className=\"ws-block-utility\" align=\"end\">\n                  <DropdownMenu.Item data-state=\"checked\">\n                    <ListItem.Content>\n                      <ListItem.Label>{workspace.name}</ListItem.Label>\n                    </ListItem.Content>\n                  </DropdownMenu.Item>\n                  <DropdownMenu.Separator />\n                  <DropdownMenu.Item>\n                    <ListItem.Prefix>\n                      <RiAddLine className=\"size-ws-9\" />\n                    </ListItem.Prefix>\n                    <ListItem.Content>\n                      <ListItem.Label>New workspace</ListItem.Label>\n                    </ListItem.Content>\n                  </DropdownMenu.Item>\n                </DropdownMenu.Content>\n              </DropdownMenu>\n            </div>\n            <TextInput size=\"sm\">\n              <TextInput.Prefix inner>\n                <TextInput.Icon icon={RiSearchLine} />\n              </TextInput.Prefix>\n              <TextInput.Input type=\"search\" placeholder=\"Search\" aria-label=\"Search\" />\n            </TextInput>\n          </div>\n        </Sidebar.Expanded>\n        <Sidebar.Collapsed>\n          <div className=\"pt-ws-3 pb-ws-7 flex justify-center\">\n            <BrandMark className=\"size-ws-15\" />\n          </div>\n        </Sidebar.Collapsed>\n      </Sidebar.Header>\n\n      {/* A section draws only the slot for the state it is in, so the pages go in both. */}\n      <Sidebar.Section scrollable>{nav}</Sidebar.Section>\n\n      <Sidebar.Footer>\n        <div className=\"gap-ws-9 flex flex-col\">\n          <div className=\"flex flex-col\">{link(helpLink)}</div>\n          {/* On the grey ground the line keeps the nav's inset: run edge to edge, it would stop\n              short of the page and read as broken. */}\n          <div className=\"border-ws-static-base pt-ws-5 border-t\">\n            <Sidebar.Expanded>\n              <DropdownMenu>\n                <DropdownMenu.Trigger asChild>\n                  <button\n                    type=\"button\"\n                    className=\"gap-ws-5 px-ws-5 py-ws-3 rounded-ws-control-lg hover:bg-ws-dynamic-tertiary-alpha-strong-default focus-visible:wds-focus-visible outline-ws-dynamic-primary-strong-default flex w-full items-center text-left\"\n                  >\n                    <PersonAvatar name={account.name} initials={account.initials} color=\"orange\" />\n                    <span className=\"flex min-w-0 flex-1 flex-col\">\n                      <span className=\"typography-label-strong-sm text-ws-static-base truncate\">\n                        {account.name}\n                      </span>\n                      <span className=\"typography-caption-md text-ws-static-subtle truncate\">\n                        {account.email}\n                      </span>\n                    </span>\n                    <RiArrowDownSLine\n                      aria-hidden=\"true\"\n                      className=\"size-ws-9 text-ws-static-strong\"\n                    />\n                  </button>\n                </DropdownMenu.Trigger>\n                <DropdownMenu.Content side=\"top\" align=\"start\" className=\"ws-block-utility w-[14rem]\">\n                  <DropdownMenu.Item>\n                    <ListItem.Prefix>\n                      <RiSettingsLine className=\"size-ws-9\" />\n                    </ListItem.Prefix>\n                    <ListItem.Content>\n                      <ListItem.Label>Account settings</ListItem.Label>\n                    </ListItem.Content>\n                  </DropdownMenu.Item>\n                  <DropdownMenu.Separator />\n                  <DropdownMenu.Item variant=\"danger\">\n                    <ListItem.Prefix>\n                      <RiLogoutBoxRLine className=\"size-ws-9\" />\n                    </ListItem.Prefix>\n                    <ListItem.Content>\n                      <ListItem.Label>Log out</ListItem.Label>\n                    </ListItem.Content>\n                  </DropdownMenu.Item>\n                </DropdownMenu.Content>\n              </DropdownMenu>\n            </Sidebar.Expanded>\n            <Sidebar.Collapsed>\n              <div className=\"flex justify-center\">\n                <PersonAvatar\n                  name={account.name}\n                  initials={account.initials}\n                  color=\"orange\"\n                  title={account.name}\n                  alt={account.name}\n                />\n              </div>\n            </Sidebar.Collapsed>\n          </div>\n        </div>\n      </Sidebar.Footer>\n    </Sidebar>\n  );\n}\n"
    },
    {
      "path": "src/blocks/account-settings/switch-row.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/account-settings/switch-row.tsx",
      "content": "'use client';\n\n// TODO(custom): Switch with a description line; Switch has no description part.\nimport { Switch } from '@/components/ui/wideset/switch/Switch';\nimport { useId } from 'react';\n\n/**\n * A setting that applies the moment it flips: its name and one line on the left, the switch on\n * the right edge. The name is the switch's label, the line its description.\n */\nexport function SwitchRow({\n  label,\n  description,\n  checked,\n  defaultChecked,\n  onCheckedChange,\n}: {\n  label: string;\n  description: string;\n  checked?: boolean;\n  defaultChecked?: boolean;\n  onCheckedChange?: (checked: boolean) => void;\n}) {\n  const descriptionId = useId();\n  return (\n    <Switch\n      size=\"sm\"\n      labelPosition=\"left\"\n      className=\"w-full justify-between\"\n      aria-describedby={descriptionId}\n      checked={checked}\n      defaultChecked={defaultChecked}\n      onCheckedChange={onCheckedChange}\n    >\n      <Switch.Label>{label}</Switch.Label>\n      <p id={descriptionId} className=\"typography-label-sm text-ws-static-subtle\">\n        {description}\n      </p>\n    </Switch>\n  );\n}\n"
    },
    {
      "path": "src/blocks/account-settings/text-button.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/account-settings/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"
  }
}
