{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "block-settings",
  "type": "registry:block",
  "title": "Settings",
  "description": "Workspace settings: a list of sections beside forms for the profile, the workspace and notifications, and a danger zone.",
  "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/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/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/toast.json",
    "https://wideset.co/r/utils.json"
  ],
  "files": [
    {
      "path": "src/blocks/settings/brand-mark.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/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/settings/danger-zone.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/settings/danger-zone.tsx",
      "content": "'use client';\n\nimport { useToast } from '@/components/ui/wideset/toast/Toast.context';\n\nimport { DeleteWorkspaceModal } from './delete-workspace-modal';\nimport { SectionHeader } from './section-header';\nimport { SettingRow } from './setting-row';\n\n/** What cannot be undone, kept last and apart; colour only on the action itself. */\nexport function DangerZone({ workspaceName }: { workspaceName: string }) {\n  const { showToast } = useToast();\n  return (\n    <section aria-labelledby=\"settings-danger-title\" className=\"gap-ws-12 flex flex-col\">\n      <SectionHeader id=\"settings-danger-title\" title=\"Danger zone\" />\n      <SettingRow\n        label=\"Delete workspace\"\n        description=\"Every customer, deal and invoice in it goes too.\"\n      >\n        <DeleteWorkspaceModal\n          workspaceName={workspaceName}\n          onDelete={() => showToast({ status: 'success', content: `${workspaceName} deleted` })}\n        />\n      </SettingRow>\n    </section>\n  );\n}\n"
    },
    {
      "path": "src/blocks/settings/data.ts",
      "type": "registry:file",
      "target": "blocks/wideset/settings/data.ts",
      "content": "import {\n  type RemixiconComponentType,\n  RiBuilding2Line,\n  RiFileChartLine,\n  RiHandCoinLine,\n  RiHome5Line,\n  RiInboxLine,\n  RiLineChartLine,\n  RiSettings3Line,\n} from '@remixicon/react';\nimport type { AvatarColor } from '@/components/ui/wideset/avatar/Avatar.colors';\n\n/** The workspace these settings belong to, and what deleting it would take with it. */\nexport const workspace = {\n  initials: 'LS',\n  color: 'teal' as AvatarColor,\n  members: 12,\n  customers: 1284,\n  deals: 312,\n  invoices: 2140,\n};\n\n/** The signed-in user. */\nexport const account = {\n  name: 'Sanne de Vries',\n  initials: 'SV',\n  color: 'orange' as AvatarColor,\n  role: 'Owner',\n};\n\nexport const navigation: {\n  id: string;\n  label: string;\n  icon: RemixiconComponentType;\n  count?: number;\n}[] = [\n  { id: 'home', label: 'Home', icon: RiHome5Line },\n  { id: 'inbox', label: 'Inbox', icon: RiInboxLine, count: 8 },\n  { id: 'customers', label: 'Customers', icon: RiBuilding2Line },\n  { id: 'deals', label: 'Deals', icon: RiHandCoinLine },\n  { id: 'revenue', label: 'Revenue', icon: RiLineChartLine },\n  { id: 'reports', label: 'Reports', icon: RiFileChartLine },\n  { id: 'settings', label: 'Settings', icon: RiSettings3Line },\n];\n\nexport type SectionId =\n  'general' | 'members' | 'billing' | 'notifications' | 'security' | 'integrations' | 'api';\n\n/** The settings section list, in order; the description is the line under the page title. */\nexport const sections: { id: SectionId; label: string; description: string }[] = [\n  {\n    id: 'general',\n    label: 'General',\n    description: 'The workspace details apply to all 12 members; your profile is yours alone.',\n  },\n  { id: 'members', label: 'Members', description: 'Who can join the workspace, and how.' },\n  { id: 'billing', label: 'Billing', description: 'Your plan, the payment method and invoices.' },\n  { id: 'notifications', label: 'Notifications', description: 'What Orbit e-mails you about.' },\n  { id: 'security', label: 'Security', description: 'How members sign in to the workspace.' },\n  {\n    id: 'integrations',\n    label: 'Integrations',\n    description: 'Tools that bring customers, payments and messages into Orbit.',\n  },\n  { id: 'api', label: 'API', description: 'Keys and webhooks for connecting your own systems.' },\n];\n\n/** The values the General form saves, as the server holds them. */\nexport type GeneralValues = {\n  /** An uploaded image's object URL; `null` shows the initials. */\n  logo: string | null;\n  name: string;\n  /** The workspace address after `orbit.app/`. */\n  slug: string;\n  currency: string;\n  timeZone: string;\n  fullName: string;\n  email: string;\n};\n\n/** A message per field that is wrong; every field's control has the id `settings-<field>`. */\nexport type FieldErrors = Partial<Record<keyof GeneralValues, string>>;\n\nexport const general: GeneralValues = {\n  logo: null,\n  name: 'Lumen Studio',\n  slug: 'lumen-studio',\n  currency: 'EUR',\n  timeZone: 'Europe/Amsterdam',\n  fullName: 'Sanne de Vries',\n  email: 'sanne@lumen.studio',\n};\n\nexport const currencies = [\n  { value: 'EUR', label: 'Euro (EUR)' },\n  { value: 'USD', label: 'US dollar (USD)' },\n  { value: 'GBP', label: 'British pound (GBP)' },\n  { value: 'CHF', label: 'Swiss franc (CHF)' },\n  { value: 'SEK', label: 'Swedish krona (SEK)' },\n  { value: 'DKK', label: 'Danish krone (DKK)' },\n  { value: 'NOK', label: 'Norwegian krone (NOK)' },\n  { value: 'PLN', label: 'Polish złoty (PLN)' },\n  { value: 'CAD', label: 'Canadian dollar (CAD)' },\n  { value: 'AUD', label: 'Australian dollar (AUD)' },\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/Amsterdam', label: '(GMT+01:00) Amsterdam' },\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/** E-mail notifications: each switch applies the moment it flips. */\nexport const notifications: {\n  id: string;\n  label: string;\n  description: string;\n  on: boolean;\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: true,\n  },\n  {\n    id: 'deals-won',\n    label: 'Deals won',\n    description: 'When a deal you own closes, with its value and the next step.',\n    on: true,\n  },\n  {\n    id: 'failed-payments',\n    label: 'Failed payments',\n    description: 'When a card is declined or an invoice is seven days overdue.',\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: 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\n/** A setting on the other sections' pages: a switch that applies at once, or an action. */\nexport type SettingRowData =\n  | { kind: 'switch'; id: string; label: string; description: string; on: boolean }\n  | { kind: 'action'; id: string; label: string; description: string; action: string };\n\nexport const sectionRows: Record<\n  Exclude<SectionId, 'general' | 'notifications'>,\n  SettingRowData[]\n> = {\n  members: [\n    {\n      kind: 'switch',\n      id: 'domain-join',\n      label: 'Join with a lumen.studio e-mail',\n      description: 'People who sign up with a lumen.studio address join without an invitation.',\n      on: true,\n    },\n    {\n      kind: 'switch',\n      id: 'invite-link',\n      label: 'Invite link',\n      description: 'Anyone with the link joins as a member. It expires after seven days.',\n      on: false,\n    },\n    {\n      kind: 'action',\n      id: 'members',\n      label: 'Members and invitations',\n      description: '12 members, 2 invitations waiting for an answer.',\n      action: 'Manage members',\n    },\n  ],\n  billing: [\n    {\n      kind: 'action',\n      id: 'plan',\n      label: 'Growth plan',\n      description: '12 seats, €588 a month. Renews on 1 December 2026.',\n      action: 'Change plan',\n    },\n    {\n      kind: 'action',\n      id: 'payment-method',\n      label: 'Payment method',\n      description: 'Visa ending in 4242, expires 08/2028.',\n      action: 'Update',\n    },\n    {\n      kind: 'action',\n      id: 'invoices',\n      label: 'Invoices',\n      description: '23 invoices since March 2025, sent to finance@lumen.studio.',\n      action: 'View invoices',\n    },\n  ],\n  security: [\n    {\n      kind: 'switch',\n      id: 'two-factor',\n      label: 'Require two-factor authentication',\n      description: 'Members without it set it up the next time they sign in.',\n      on: false,\n    },\n    {\n      kind: 'switch',\n      id: 'google-only',\n      label: 'Sign in with Google only',\n      description: 'Turns off passwords for everyone in the workspace.',\n      on: false,\n    },\n    {\n      kind: 'action',\n      id: 'sessions',\n      label: 'Your sessions',\n      description: 'Signed in on 3 devices, most recently today at 08:42 in Amsterdam.',\n      action: 'Review sessions',\n    },\n  ],\n  integrations: [\n    {\n      kind: 'action',\n      id: 'stripe',\n      label: 'Stripe',\n      description: 'Connected. Payments and invoices sync every 15 minutes.',\n      action: 'Manage',\n    },\n    {\n      kind: 'action',\n      id: 'slack',\n      label: 'Slack',\n      description: 'Connected to #revenue. Won deals and failed payments are posted there.',\n      action: 'Manage',\n    },\n    {\n      kind: 'action',\n      id: 'hubspot',\n      label: 'HubSpot',\n      description: 'Bring in contacts, companies and open deals.',\n      action: 'Connect',\n    },\n    {\n      kind: 'action',\n      id: 'gmail',\n      label: 'Gmail',\n      description: 'Log e-mails with customers on their timeline.',\n      action: 'Connect',\n    },\n  ],\n  api: [\n    {\n      kind: 'action',\n      id: 'live-key',\n      label: 'Production key',\n      description: 'orb_live_…3f9a, created 2 September 2026, last used 2 hours ago.',\n      action: 'Revoke',\n    },\n    {\n      kind: 'action',\n      id: 'test-key',\n      label: 'Test key',\n      description: 'orb_test_…81c2, created 14 July 2026, never used.',\n      action: 'Revoke',\n    },\n    {\n      kind: 'action',\n      id: 'webhooks',\n      label: 'Webhooks',\n      description: 'Send customer, deal and invoice events to your own systems.',\n      action: 'Add endpoint',\n    },\n  ],\n};\n"
    },
    {
      "path": "src/blocks/settings/delete-workspace-modal.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/settings/delete-workspace-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\nconst count = (value: number) => value.toLocaleString('en');\n\n/**\n * Deleting the workspace: a high-stakes delete, so the danger button stays disabled until the\n * workspace's name is typed. Cancel comes first and Enter never deletes.\n */\nexport function DeleteWorkspaceModal({\n  workspaceName,\n  onDelete,\n}: {\n  workspaceName: 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() === workspaceName;\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 workspace\n        </Button>\n      </Modal.Trigger>\n      <Modal.Content className=\"ws-block-utility\">\n        <Modal.Header>\n          <Modal.Title>Delete {workspaceName}?</Modal.Title>\n          <Modal.Description>\n            Its {count(workspace.customers)} customers, {count(workspace.deals)} deals and{' '}\n            {count(workspace.invoices)} invoices are deleted for good, and all {workspace.members}{' '}\n            members lose access at once.\n          </Modal.Description>\n        </Modal.Header>\n        <Modal.Body>\n          <FormField label={`To confirm, type “${workspaceName}”`} htmlFor={inputId}>\n            <TextInput\n              id={inputId}\n              size=\"sm\"\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 size=\"sm\" variant=\"secondary\" preset=\"border\">\n              Cancel\n            </Button>\n          </Modal.Close>\n          <Button\n            size=\"sm\"\n            variant=\"danger\"\n            disabled={!matches}\n            onClick={() => {\n              setOpen(false);\n              onDelete();\n            }}\n          >\n            Delete workspace\n          </Button>\n        </Modal.Footer>\n      </Modal.Content>\n    </Modal>\n  );\n}\n"
    },
    {
      "path": "src/blocks/settings/general-settings.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/settings/general-settings.tsx",
      "content": "'use client';\n\nimport { Divider } from '@/components/ui/wideset/divider/Divider';\nimport { useToast } from '@/components/ui/wideset/toast/Toast.context';\nimport { type FormEvent, useEffect, useId, useState } from 'react';\n\nimport { DangerZone } from './danger-zone';\nimport { type FieldErrors, general, type GeneralValues, sections } from './data';\nimport { NotificationsSection } from './notifications-section';\nimport { ProfileSection } from './profile-section';\nimport { SaveBar } from './save-bar';\nimport { SettingsPage } from './settings-page';\nimport { WorkspaceSection } from './workspace-section';\n\n/** The fields in the order they appear, so the first wrong one gets the focus. */\nconst FIELDS = Object.keys(general) as (keyof GeneralValues)[];\nconst page = sections.find(({ id }) => id === 'general')!;\n\nfunction validate(values: GeneralValues): FieldErrors {\n  const errors: FieldErrors = {};\n  if (!values.name.trim()) errors.name = 'Enter a name for the workspace.';\n  if (!values.slug) errors.slug = 'Enter an address for the workspace.';\n  else if (!/^[a-z0-9]+(-[a-z0-9]+)*$/.test(values.slug))\n    errors.slug = 'Use lowercase letters, numbers and hyphens, like lumen-studio.';\n  if (!values.fullName.trim()) errors.fullName = 'Enter your name.';\n  if (!/^\\S+@\\S+\\.\\S+$/.test(values.email))\n    errors.email = 'Enter an e-mail address like sanne@lumen.studio.';\n  return errors;\n}\n\n/**\n * The General page. The workspace and profile fields are one form with one save bar, shown only\n * while the draft differs from what is saved; the notification switches apply at once.\n */\nexport function GeneralSettings({\n  hidden,\n  saved,\n  onSave,\n  notify,\n  onNotifyChange,\n}: {\n  hidden: boolean;\n  saved: GeneralValues;\n  onSave: (values: GeneralValues) => void;\n  notify: Record<string, boolean>;\n  onNotifyChange: (id: string, on: boolean) => void;\n}) {\n  const { showToast } = useToast();\n  const formId = useId();\n  const [draft, setDraft] = useState(saved);\n  const [errors, setErrors] = useState<FieldErrors>({});\n  const changes = FIELDS.filter((field) => draft[field] !== saved[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<GeneralValues>) => {\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(`settings-${first}`)?.focus();\n      return;\n    }\n    onSave(draft);\n    showToast({ status: 'success', content: 'Changes saved' });\n  };\n\n  const cancel = () => {\n    setDraft(saved);\n    setErrors({});\n  };\n\n  return (\n    <SettingsPage\n      title={page.label}\n      description={page.description}\n      hidden={hidden}\n      footer={dirty && <SaveBar form={formId} changes={changes} onCancel={cancel} />}\n    >\n      {/* Sections are split by a line: a long settings page, read in bands. */}\n      <form id={formId} noValidate onSubmit={save} className=\"gap-ws-14 flex flex-col\">\n        <WorkspaceSection values={draft} errors={errors} onChange={update} />\n        <Divider weight=\"thin\" emphasis=\"subtle\" />\n        <ProfileSection values={draft} errors={errors} onChange={update} />\n      </form>\n      <Divider weight=\"thin\" emphasis=\"subtle\" />\n      <NotificationsSection email={saved.email} values={notify} onChange={onNotifyChange} />\n      <Divider weight=\"thin\" emphasis=\"subtle\" />\n      <DangerZone workspaceName={saved.name} />\n    </SettingsPage>\n  );\n}\n"
    },
    {
      "path": "src/blocks/settings/index.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/settings/index.tsx",
      "content": "'use client';\n\nimport '@/styles/wideset-blocks.css';\n\nimport { AppShell } from '@/components/ui/wideset/app-shell/AppShell';\nimport { ToastProvider } from '@/components/ui/wideset/toast/Toast.context';\nimport { useState } from 'react';\n\nimport { general, notifications, type SectionId, sectionRows, sections } from './data';\nimport { GeneralSettings } from './general-settings';\nimport { NotificationsSection } from './notifications-section';\nimport { SectionPage } from './section-page';\nimport { SettingsNav } from './settings-nav';\nimport { SettingsPage } from './settings-page';\nimport { AppSidebar } from './sidebar';\n\n/**\n * Settings (Frame direction): the tinted app sidebar, then the page: the settings section list\n * beside the open section's form. Every section stays mounted while another is open, so a draft\n * or a flipped switch survives the switch.\n */\nexport default function Settings() {\n  const [open, setOpen] = useState<SectionId>('general');\n  // What the server holds; the General page edits a draft of it.\n  const [saved, setSaved] = useState(general);\n  const [notify, setNotify] = useState(() =>\n    Object.fromEntries(notifications.map(({ id, on }) => [id, on])),\n  );\n  const flip = (id: string, on: boolean) => setNotify((current) => ({ ...current, [id]: on }));\n\n  return (\n    <ToastProvider position=\"bottom-center\">\n      <AppShell className=\"ws-block-utility\" direction=\"frame\">\n        <AppSidebar workspaceName={saved.name} email={saved.email} />\n        <AppShell.Main className=\"flex\">\n          <SettingsNav active={open} onSelect={setOpen} />\n          {sections.map(({ id, label, description }) =>\n            id === 'general' ? (\n              <GeneralSettings\n                key={id}\n                hidden={open !== id}\n                saved={saved}\n                onSave={setSaved}\n                notify={notify}\n                onNotifyChange={flip}\n              />\n            ) : id === 'notifications' ? (\n              <SettingsPage key={id} title={label} description={description} hidden={open !== id}>\n                <NotificationsSection email={saved.email} values={notify} onChange={flip} />\n              </SettingsPage>\n            ) : (\n              <SectionPage\n                key={id}\n                title={label}\n                description={description}\n                rows={sectionRows[id]}\n                hidden={open !== id}\n              />\n            ),\n          )}\n        </AppShell.Main>\n      </AppShell>\n    </ToastProvider>\n  );\n}\n"
    },
    {
      "path": "src/blocks/settings/notifications-section.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/settings/notifications-section.tsx",
      "content": "'use client';\n\nimport { useId } from 'react';\n\nimport { notifications } from './data';\nimport { SectionHeader } from './section-header';\nimport { SwitchRow } from './switch-row';\n\n/**\n * E-mail notifications, one switch each. A switch applies the moment it flips, so this section\n * stays out of the save bar (and says so).\n */\nexport function NotificationsSection({\n  email,\n  values,\n  onChange,\n}: {\n  email: string;\n  values: Record<string, boolean>;\n  onChange: (id: string, on: boolean) => void;\n}) {\n  // Rendered on two pages (General and Notifications), so the title's id is generated.\n  const titleId = useId();\n  return (\n    <section aria-labelledby={titleId} className=\"gap-ws-12 flex flex-col\">\n      <SectionHeader\n        id={titleId}\n        title=\"E-mail notifications\"\n        description={`Sent to ${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    </section>\n  );\n}\n"
    },
    {
      "path": "src/blocks/settings/profile-section.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/settings/profile-section.tsx",
      "content": "'use client';\n\nimport { FormField } from '@/components/ui/wideset/form-field/FormField';\nimport { TextInput } from '@/components/ui/wideset/text-input/TextInput';\n\nimport { account, type FieldErrors, type GeneralValues } from './data';\nimport { SectionHeader } from './section-header';\n\n/** The signed-in user's name and e-mail, saved with the save bar; the role is read-only. */\nexport function ProfileSection({\n  values,\n  errors,\n  onChange,\n}: {\n  values: GeneralValues;\n  errors: FieldErrors;\n  onChange: (patch: Partial<GeneralValues>) => void;\n}) {\n  return (\n    <section aria-labelledby=\"settings-profile-title\" className=\"gap-ws-12 flex flex-col\">\n      <SectionHeader id=\"settings-profile-title\" title=\"Your profile\" />\n\n      <div className=\"gap-ws-11 flex flex-col\">\n        <FormField label=\"Full name\" htmlFor=\"settings-fullName\" errorText={errors.fullName}>\n          <TextInput\n            id=\"settings-fullName\"\n            size=\"sm\"\n            required\n            autoComplete=\"name\"\n            variant={errors.fullName ? 'danger' : 'primary'}\n            value={values.fullName}\n            onChange={(event) => onChange({ fullName: event.target.value })}\n          />\n        </FormField>\n\n        <FormField\n          label=\"E-mail\"\n          htmlFor=\"settings-email\"\n          helperText=\"You sign in with it, and notifications go here.\"\n          errorText={errors.email}\n        >\n          <TextInput\n            id=\"settings-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\n        <FormField\n          label=\"Role\"\n          htmlFor=\"settings-role\"\n          helperText=\"Only another owner can change your role.\"\n        >\n          <TextInput id=\"settings-role\" size=\"sm\" disabled readOnly value={account.role} />\n        </FormField>\n      </div>\n    </section>\n  );\n}\n"
    },
    {
      "path": "src/blocks/settings/save-bar.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/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 under the form, shown only while something differs from what\n * is saved. Its buttons end on the form column's right edge; 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-subtle px-ws-16 py-ws-7 shrink-0 border-t\">\n      <div className=\"gap-ws-9 flex max-w-[40rem] 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/settings/section-header.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/settings/section-header.tsx",
      "content": "'use client';\n\n// TODO(custom): section title with an optional description, composed by hand.\n/** A section's title (16px) and, when it needs one, the line that says what the section holds. */\nexport function SectionHeader({\n  id,\n  title,\n  description,\n}: {\n  id: string;\n  title: string;\n  description?: string;\n}) {\n  return (\n    <div className=\"gap-ws-3 flex flex-col\">\n      <h2 id={id} className=\"typography-label-strong-md text-ws-static-strong\">\n        {title}\n      </h2>\n      {description && <p className=\"typography-label-sm text-ws-static-subtle\">{description}</p>}\n    </div>\n  );\n}\n"
    },
    {
      "path": "src/blocks/settings/section-page.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/settings/section-page.tsx",
      "content": "'use client';\n\nimport { Button } from '@/components/ui/wideset/button/Button';\n\nimport type { SettingRowData } from './data';\nimport { SettingRow } from './setting-row';\nimport { SettingsPage } from './settings-page';\nimport { SwitchRow } from './switch-row';\n\n/** A shorter section (Members, Billing, Security…): its settings as rows of switches and actions. */\nexport function SectionPage({\n  title,\n  description,\n  rows,\n  hidden,\n}: {\n  title: string;\n  description: string;\n  rows: SettingRowData[];\n  hidden: boolean;\n}) {\n  return (\n    <SettingsPage title={title} description={description} hidden={hidden}>\n      <ul className=\"gap-ws-11 flex flex-col\">\n        {rows.map((row) => (\n          <li key={row.id}>\n            {row.kind === 'switch' ? (\n              <SwitchRow label={row.label} description={row.description} defaultChecked={row.on} />\n            ) : (\n              <SettingRow label={row.label} description={row.description}>\n                <Button size=\"sm\" variant=\"secondary\" preset=\"border\">\n                  {row.action}\n                </Button>\n              </SettingRow>\n            )}\n          </li>\n        ))}\n      </ul>\n    </SettingsPage>\n  );\n}\n"
    },
    {
      "path": "src/blocks/settings/setting-row.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/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 { ReactNode } from 'react';\n\n/** A setting with an action: its name and one line on the left, the button on the right edge. */\nexport function SettingRow({\n  label,\n  description,\n  children,\n}: {\n  label: string;\n  description: string;\n  children: ReactNode;\n}) {\n  return (\n    <div className=\"gap-ws-9 flex items-center justify-between\">\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 className=\"flex shrink-0\">{children}</div>\n    </div>\n  );\n}\n"
    },
    {
      "path": "src/blocks/settings/settings-nav.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/settings/settings-nav.tsx",
      "content": "'use client';\n\n// TODO(custom): section nav copies Sidebar.Item, which throws outside a Sidebar; no NavList in Wideset.\nimport { type SectionId, sections } from './data';\n\n/**\n * The settings section list, a panel at the page's left edge split off by a line (Frame). Its\n * rows are drawn like `Sidebar.Item`, which only works inside a `Sidebar`: one target across the\n * row, the neutral fill on the open section.\n */\nexport function SettingsNav({\n  active,\n  onSelect,\n}: {\n  active: SectionId;\n  onSelect: (id: SectionId) => void;\n}) {\n  return (\n    <nav\n      aria-labelledby=\"settings-nav-title\"\n      className=\"gap-ws-5 px-ws-5 py-ws-12 border-ws-static-subtle ws-scrollbar flex w-[15rem] shrink-0 flex-col overflow-y-auto border-r\"\n    >\n      <h2\n        id=\"settings-nav-title\"\n        className=\"typography-label-strong-md text-ws-static-strong px-ws-5 py-ws-3\"\n      >\n        Settings\n      </h2>\n      <ul className=\"flex flex-col\">\n        {sections.map(({ id, label }) => (\n          <li key={id}>\n            <a\n              href={`#${id}`}\n              aria-current={active === id ? 'page' : undefined}\n              onClick={(event) => {\n                event.preventDefault();\n                onSelect(id);\n              }}\n              className=\"h-ws-14 px-ws-5 rounded-ws-control-lg typography-label-strong-sm text-ws-static-base hover:bg-ws-dynamic-tertiary-alpha-strong-default hover:text-ws-static-strong aria-[current=page]:bg-ws-dynamic-tertiary-alpha-strong-default aria-[current=page]:text-ws-static-strong focus-visible:wds-focus-visible outline-ws-dynamic-primary-strong-default flex w-full items-center\"\n            >\n              {label}\n            </a>\n          </li>\n        ))}\n      </ul>\n    </nav>\n  );\n}\n"
    },
    {
      "path": "src/blocks/settings/settings-page.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/settings/settings-page.tsx",
      "content": "'use client';\n\nimport { type ReactNode, useId } from 'react';\n\n/**\n * One settings section's page: the title and its line, then the content in a 40rem column on the\n * page's left axis. The column scrolls inside the page; `footer` (the save bar) stays under it.\n */\nexport function SettingsPage({\n  title,\n  description,\n  hidden,\n  footer,\n  children,\n}: {\n  title: string;\n  description: string;\n  hidden?: boolean;\n  footer?: ReactNode;\n  children: ReactNode;\n}) {\n  const titleId = useId();\n  return (\n    <section aria-labelledby={titleId} hidden={hidden} className=\"flex min-w-0 flex-1 flex-col\">\n      <div className=\"ws-scrollbar min-h-0 flex-1 overflow-y-auto\">\n        <div className=\"gap-ws-14 px-ws-16 py-ws-12 flex max-w-[45rem] flex-col\">\n          <header className=\"gap-ws-3 flex flex-col\">\n            <h1 id={titleId} className=\"typography-title-md text-ws-static-strong\">\n              {title}\n            </h1>\n            <p className=\"typography-body-md text-ws-static-base\">{description}</p>\n          </header>\n          {children}\n        </div>\n      </div>\n      {footer}\n    </section>\n  );\n}\n"
    },
    {
      "path": "src/blocks/settings/sidebar.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/settings/sidebar.tsx",
      "content": "'use client';\n\n// TODO(custom): account menu is composed by hand.\nimport { RiArrowDownSLine } from '@remixicon/react';\nimport { Avatar } from '@/components/ui/wideset/avatar/Avatar';\nimport { DropdownMenu } from '@/components/ui/wideset/dropdown/DropdownMenu';\nimport { ListItem } from '@/components/ui/wideset/list-item/ListItem';\nimport { Sidebar } from '@/components/ui/wideset/sidebar/Sidebar';\n\nimport { BrandMark } from './brand-mark';\nimport { account, navigation } from './data';\n\n/** The account menu: who is signed in, their workspaces and sign-out. */\nfunction AccountMenu({ email }: { email: string }) {\n  return (\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          <Avatar initials={account.initials} color={account.color} />\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-label-sm text-ws-static-subtle truncate\">\n              {account.role}\n            </span>\n          </span>\n          <RiArrowDownSLine aria-hidden=\"true\" className=\"size-ws-9 text-ws-static-strong\" />\n        </button>\n      </DropdownMenu.Trigger>\n      <DropdownMenu.Content side=\"top\" align=\"start\" className=\"ws-block-utility w-[13.875rem]\">\n        <DropdownMenu.Item>\n          <ListItem.Prefix>\n            <Avatar initials={account.initials} color={account.color} />\n          </ListItem.Prefix>\n          <ListItem.Content>\n            <ListItem.Label>{account.name}</ListItem.Label>\n            <ListItem.Description>{email}</ListItem.Description>\n          </ListItem.Content>\n        </DropdownMenu.Item>\n        <DropdownMenu.Separator />\n        <DropdownMenu.Item>\n          <ListItem.Content>\n            <ListItem.Label>Switch workspace</ListItem.Label>\n          </ListItem.Content>\n        </DropdownMenu.Item>\n        <DropdownMenu.Item>\n          <ListItem.Content>\n            <ListItem.Label>Keyboard shortcuts</ListItem.Label>\n          </ListItem.Content>\n        </DropdownMenu.Item>\n        <DropdownMenu.Separator />\n        <DropdownMenu.Item variant=\"danger\">\n          <ListItem.Content>\n            <ListItem.Label>Log out</ListItem.Label>\n          </ListItem.Content>\n        </DropdownMenu.Item>\n      </DropdownMenu.Content>\n    </DropdownMenu>\n  );\n}\n\n/** The app sidebar (Frame direction: a grey tint beside the white page), Settings open. */\nexport function AppSidebar({ workspaceName, email }: { workspaceName: string; email: string }) {\n  const nav = (\n    <nav aria-label=\"Main\" className=\"flex flex-col\">\n      {navigation.map(({ id, label, icon, count }) => (\n        <Sidebar.Item\n          key={id}\n          href={`#${id}`}\n          icon={icon}\n          label={label}\n          active={id === 'settings'}\n          suffix={count}\n        />\n      ))}\n    </nav>\n  );\n\n  return (\n    <Sidebar>\n      <Sidebar.Header>\n        <Sidebar.Expanded>\n          <div className=\"gap-ws-7 py-ws-3 pl-ws-5 flex items-center\">\n            <BrandMark />\n            <span className=\"typography-label-strong-sm text-ws-dynamic-secondary-default min-w-0 flex-1 truncate\">\n              {workspaceName}\n            </span>\n            <Sidebar.Trigger />\n          </div>\n        </Sidebar.Expanded>\n        <Sidebar.Collapsed>\n          <div className=\"gap-ws-7 flex flex-col items-center\">\n            <BrandMark label={workspaceName} />\n            <Sidebar.Trigger />\n          </div>\n        </Sidebar.Collapsed>\n      </Sidebar.Header>\n\n      <Sidebar.Section scrollable>{nav}</Sidebar.Section>\n\n      <Sidebar.Footer>\n        <Sidebar.Expanded>\n          <AccountMenu email={email} />\n        </Sidebar.Expanded>\n        <Sidebar.Collapsed>\n          <Avatar initials={account.initials} color={account.color} aria-label={account.name} />\n        </Sidebar.Collapsed>\n      </Sidebar.Footer>\n    </Sidebar>\n  );\n}\n"
    },
    {
      "path": "src/blocks/settings/switch-row.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/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/settings/workspace-section.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/settings/workspace-section.tsx",
      "content": "'use client';\n\n// TODO(custom): avatar upload (Change, Remove) composed by hand.\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 { Select } from '@/components/ui/wideset/select/Select';\nimport { TextInput } from '@/components/ui/wideset/text-input/TextInput';\nimport { useEffect, useRef } from 'react';\n\nimport { currencies, type FieldErrors, type GeneralValues, timeZones, workspace } from './data';\nimport { SectionHeader } from './section-header';\n\n/** The workspace's logo, name, address and defaults; saved with the save bar. */\nexport function WorkspaceSection({\n  values,\n  errors,\n  onChange,\n}: {\n  values: GeneralValues;\n  errors: FieldErrors;\n  onChange: (patch: Partial<GeneralValues>) => 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\n  return (\n    <section aria-labelledby=\"settings-workspace-title\" className=\"gap-ws-12 flex flex-col\">\n      <SectionHeader id=\"settings-workspace-title\" title=\"Workspace\" />\n\n      <div className=\"gap-ws-11 flex flex-col\">\n        <FormField\n          label=\"Logo\"\n          id=\"settings-logo-label\"\n          helperText=\"On invoices and e-mails to customers. Square, 256 px or more.\"\n        >\n          <div\n            role=\"group\"\n            aria-labelledby=\"settings-logo-label\"\n            className=\"gap-ws-9 flex items-center\"\n          >\n            {values.logo ? (\n              <Avatar\n                shape=\"square\"\n                size=\"xl\"\n                src={values.logo}\n                alt={`${values.name} logo`}\n                initials={workspace.initials}\n              />\n            ) : (\n              <Avatar\n                shape=\"square\"\n                size=\"xl\"\n                initials={workspace.initials}\n                color={workspace.color}\n              />\n            )}\n            <div className=\"gap-ws-5 flex\">\n              <Button\n                id=\"settings-logo\"\n                size=\"sm\"\n                variant=\"secondary\"\n                preset=\"border\"\n                onClick={() => fileInput.current?.click()}\n              >\n                {values.logo ? 'Change logo' : 'Upload logo'}\n              </Button>\n              {values.logo && (\n                <Button\n                  size=\"sm\"\n                  variant=\"secondary\"\n                  preset=\"ghost\"\n                  onClick={() => onChange({ logo: null })}\n                >\n                  Remove\n                </Button>\n              )}\n            </div>\n            <input\n              ref={fileInput}\n              type=\"file\"\n              accept=\"image/png,image/jpeg,image/svg+xml\"\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({ logo: url });\n                event.target.value = '';\n              }}\n            />\n          </div>\n        </FormField>\n\n        <FormField label=\"Name\" htmlFor=\"settings-name\" errorText={errors.name}>\n          <TextInput\n            id=\"settings-name\"\n            size=\"sm\"\n            required\n            autoComplete=\"organization\"\n            variant={errors.name ? 'danger' : 'primary'}\n            value={values.name}\n            onChange={(event) => onChange({ name: event.target.value })}\n          />\n        </FormField>\n\n        <FormField\n          label=\"URL\"\n          htmlFor=\"settings-slug\"\n          helperText=\"Changing it breaks links people have saved.\"\n          errorText={errors.slug}\n        >\n          <TextInput\n            id=\"settings-slug\"\n            size=\"sm\"\n            required\n            autoComplete=\"off\"\n            spellCheck={false}\n            variant={errors.slug ? 'danger' : 'primary'}\n            value={values.slug}\n            onChange={(event) =>\n              onChange({ slug: event.target.value.toLowerCase().replace(/\\s+/g, '-') })\n            }\n          >\n            <TextInput.Prefix>orbit.app/</TextInput.Prefix>\n            <TextInput.Input />\n          </TextInput>\n        </FormField>\n\n        <FormField\n          label=\"Currency\"\n          htmlFor=\"settings-currency\"\n          helperText=\"New deals and revenue reports use it.\"\n        >\n          <Select\n            id=\"settings-currency\"\n            size=\"sm\"\n            className=\"w-full\"\n            options={currencies}\n            value={values.currency}\n            onValueChange={(currency) => onChange({ currency })}\n          />\n        </FormField>\n\n        <FormField\n          label=\"Time zone\"\n          htmlFor=\"settings-timeZone\"\n          helperText=\"Reports and the Monday digest follow it.\"\n        >\n          <Select\n            id=\"settings-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      </div>\n    </section>\n  );\n}\n"
    }
  ],
  "meta": {
    "version": "1.1.0",
    "commit": "a734f9f0"
  }
}
