{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "application-03",
  "title": "Settings",
  "description": "Lattice Studio settings: a settings rail with a way back to the app, a profile, notifications by channel and the workspace page, each saving through one unsaved-changes bar, with saved names showing in the sidebar at once.",
  "dependencies": [
    "@base-ui/react",
    "motion"
  ],
  "registryDependencies": [
    "https://ui.ndekocode.dev/r/alert-dialog.json",
    "https://ui.ndekocode.dev/r/animated-size.json",
    "https://ui.ndekocode.dev/r/avatar.json",
    "https://ui.ndekocode.dev/r/breadcrumb.json",
    "https://ui.ndekocode.dev/r/button.json",
    "https://ui.ndekocode.dev/r/command.json",
    "https://ui.ndekocode.dev/r/company-mark.json",
    "https://ui.ndekocode.dev/r/dropdown-menu.json",
    "https://ui.ndekocode.dev/r/icons.json",
    "https://ui.ndekocode.dev/r/input.json",
    "https://ui.ndekocode.dev/r/kbd.json",
    "https://ui.ndekocode.dev/r/radio-group.json",
    "https://ui.ndekocode.dev/r/recipes.json",
    "https://ui.ndekocode.dev/r/select.json",
    "https://ui.ndekocode.dev/r/sheet.json",
    "https://ui.ndekocode.dev/r/switch.json",
    "https://ui.ndekocode.dev/r/textarea.json",
    "https://ui.ndekocode.dev/r/theme.json",
    "https://ui.ndekocode.dev/r/use-prefers-reduced-motion.json",
    "https://ui.ndekocode.dev/r/utils.json"
  ],
  "files": [
    {
      "path": "registry/ndeko/templates/settings/application-03/index.tsx",
      "content": "'use client';\n\nimport { useEffect, useState } from 'react';\n\nimport { Sheet, SheetContent, SheetTitle } from '@/registry/ndeko/ui/sheet';\n\nimport { AppSidebar } from './app-sidebar';\nimport {\n  CURRENT_USER_ID,\n  INITIAL_NOTIFICATIONS,\n  INITIAL_PROFILE,\n  INITIAL_WORKSPACE,\n  PEOPLE,\n  SETTINGS_GROUPS,\n  WORKSPACE_FACTS,\n  WORKSPACE_ID,\n  type NavItem,\n  type NotificationValues,\n  type PageId,\n  type Person,\n  type ProfileValues,\n  type Workspace,\n  type WorkspaceValues,\n} from './data';\nimport { NotificationsPage } from './notifications-page';\nimport { ProfilePage } from './profile-page';\nimport { CommandPalette } from './search-palette';\nimport { TopBar } from './top-bar';\nimport { WorkspacePage } from './workspace-page';\n\nconst NAV_ITEMS = SETTINGS_GROUPS.flatMap((group) => group.items);\n\nconst SETTINGS_ANCESTOR = 'Settings';\n\nfunction navItemOf(pageId: PageId): NavItem {\n  const item = NAV_ITEMS.find((candidate) => candidate.id === pageId);\n  if (item) {\n    return item;\n  }\n  return NAV_ITEMS[0];\n}\n\nfunction personOf(personId: string) {\n  const person = PEOPLE.find((candidate) => candidate.id === personId);\n  if (person) {\n    return person;\n  }\n  return PEOPLE[0];\n}\n\nfunction accountOf(profile: ProfileValues): Person {\n  const person = personOf(CURRENT_USER_ID);\n  return {\n    ...person,\n    name: profile.name,\n    role: profile.title,\n    avatar: profile.photo,\n  };\n}\n\nfunction workspaceOf(values: WorkspaceValues): Workspace {\n  return {\n    id: WORKSPACE_ID,\n    name: values.name,\n    memberCount: WORKSPACE_FACTS.members,\n  };\n}\n\nfunction isPaletteShortcut(event: KeyboardEvent) {\n  const isKKey = event.key.toLowerCase() === 'k';\n  const hasModifier = event.metaKey || event.ctrlKey;\n  return isKKey && hasModifier;\n}\n\nexport default function Application03() {\n  const [activePageId, setActivePageId] = useState<PageId>('profile');\n  const [isNavigationOpen, setIsNavigationOpen] = useState(false);\n  const [isPaletteOpen, setIsPaletteOpen] = useState(false);\n  const [profile, setProfile] = useState<ProfileValues>(INITIAL_PROFILE);\n  const [notifications, setNotifications] = useState<NotificationValues>(\n    INITIAL_NOTIFICATIONS\n  );\n  const [workspaceValues, setWorkspaceValues] =\n    useState<WorkspaceValues>(INITIAL_WORKSPACE);\n\n  const activePage = navItemOf(activePageId);\n  const account = accountOf(profile);\n  const workspace = workspaceOf(workspaceValues);\n\n  useEffect(() => {\n    function handleKeyDown(event: KeyboardEvent) {\n      if (isPaletteShortcut(event)) {\n        event.preventDefault();\n        setIsPaletteOpen((isOpen) => !isOpen);\n      }\n    }\n\n    document.addEventListener('keydown', handleKeyDown);\n    return () => document.removeEventListener('keydown', handleKeyDown);\n  }, []);\n\n  function navigate(pageId: PageId) {\n    setActivePageId(pageId);\n    setIsNavigationOpen(false);\n  }\n\n  function openSearch() {\n    setIsNavigationOpen(false);\n    setIsPaletteOpen(true);\n  }\n\n  function openNavigation() {\n    setIsNavigationOpen(true);\n  }\n\n  const sidebarProps = {\n    workspace,\n    groups: SETTINGS_GROUPS,\n    activePageId,\n    person: account,\n    onNavigate: navigate,\n    onOpenSearch: openSearch,\n  };\n\n  return (\n    <div className='bg-sidebar text-foreground flex h-dvh min-h-0 w-full md:p-2'>\n      <aside\n        aria-label='Sidebar'\n        className='hidden w-60 shrink-0 pr-2 md:block'\n      >\n        <AppSidebar {...sidebarProps} />\n      </aside>\n      <Sheet open={isNavigationOpen} onOpenChange={setIsNavigationOpen}>\n        <SheetContent\n          side='left'\n          showCloseButton={false}\n          className='bg-sidebar w-72 gap-0 p-2'\n        >\n          <SheetTitle className='sr-only'>Navigation</SheetTitle>\n          <AppSidebar {...sidebarProps} />\n        </SheetContent>\n      </Sheet>\n      <main className='bg-background md:hairline-ring md:ring-border flex min-w-0 flex-1 flex-col overflow-clip md:rounded-xl md:shadow-[0_1px_2px_rgb(0_0_0/0.04)]'>\n        <TopBar\n          page={activePage}\n          ancestor={SETTINGS_ANCESTOR}\n          people={PEOPLE}\n          onOpenNavigation={openNavigation}\n        />\n        {activePageId === 'profile' && (\n          <ProfilePage\n            values={profile}\n            workspaceName={workspace.name}\n            onSaved={setProfile}\n          />\n        )}\n        {activePageId === 'notifications' && (\n          <NotificationsPage\n            values={notifications}\n            onSaved={setNotifications}\n          />\n        )}\n        {activePageId === 'workspace' && (\n          <WorkspacePage\n            values={workspaceValues}\n            onSaved={setWorkspaceValues}\n          />\n        )}\n      </main>\n      <CommandPalette\n        open={isPaletteOpen}\n        onOpenChange={setIsPaletteOpen}\n        groups={SETTINGS_GROUPS}\n        onNavigate={navigate}\n      />\n    </div>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-03/index.tsx"
    },
    {
      "path": "registry/ndeko/templates/settings/application-03/app-sidebar.tsx",
      "content": "'use client';\n\nimport { useId } from 'react';\n\nimport { ArrowLeftIcon } from '@/registry/ndeko/lib/icons';\n\nimport { AccountMenu } from './account-menu';\nimport type { NavGroup, NavItem, PageId, Person, Workspace } from './data';\nimport { SearchTrigger } from './search-palette';\nimport { NAV_ROW, NavRow } from './sidebar-parts';\nimport { WorkspaceSwitcher } from './workspace-switcher';\n\ntype AppSidebarProps = {\n  workspace: Workspace;\n  groups: NavGroup[];\n  activePageId: PageId;\n  person: Person;\n  onNavigate: (pageId: PageId) => void;\n  onOpenSearch: () => void;\n};\n\nfunction GroupLabel({ group }: { group: NavGroup }) {\n  if (!group.label) {\n    return null;\n  }\n  return (\n    <p className='text-muted-foreground flex h-6 items-center px-2 text-xs font-medium'>\n      {group.label}\n    </p>\n  );\n}\n\nfunction keepWorkspace() {\n  return undefined;\n}\n\n/** The settings rail. Back to app is a plain link, so the template can point it at the app it lives in. */\nexport function AppSidebar({\n  workspace,\n  groups,\n  activePageId,\n  person,\n  onNavigate,\n  onOpenSearch,\n}: AppSidebarProps) {\n  const indicatorId = useId();\n\n  function selectItem(item: NavItem) {\n    onNavigate(item.id);\n  }\n\n  function openWorkspaceSettings() {\n    onNavigate('workspace');\n  }\n\n  return (\n    <div className='flex h-full min-h-0 flex-col gap-3'>\n      <div className='flex flex-col gap-2'>\n        <WorkspaceSwitcher\n          workspaces={[workspace]}\n          current={workspace}\n          onSelect={keepWorkspace}\n          onOpenSettings={openWorkspaceSettings}\n        />\n        <div className='flex items-center'>\n          <SearchTrigger onOpen={onOpenSearch} />\n        </div>\n      </div>\n      <nav\n        aria-label='Settings'\n        className='-mx-2 flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto px-2'\n      >\n        <a href='#' className={NAV_ROW}>\n          <ArrowLeftIcon />\n          <span className='relative min-w-0 flex-1 truncate'>Back to app</span>\n        </a>\n        {groups.map((group) => (\n          <div key={group.id} className='flex flex-col gap-0.5'>\n            <GroupLabel group={group} />\n            <ul className='flex flex-col gap-px'>\n              {group.items.map((item) => (\n                <NavRow\n                  key={item.id}\n                  item={item}\n                  isActive={item.id === activePageId}\n                  indicatorId={indicatorId}\n                  onSelect={selectItem}\n                />\n              ))}\n            </ul>\n          </div>\n        ))}\n      </nav>\n      <AccountMenu person={person} onOpenSettings={onNavigate} />\n    </div>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-03/app-sidebar.tsx"
    },
    {
      "path": "registry/ndeko/templates/settings/application-03/sidebar-parts.tsx",
      "content": "'use client';\n\nimport { motion, type Transition } from 'motion/react';\n\nimport { usePrefersReducedMotion } from '@/registry/ndeko/hooks/use-prefers-reduced-motion';\nimport { Avatar, AvatarImage } from '@/registry/ndeko/ui/avatar';\n\nimport type { NavItem, Person } from './data';\n\nexport const NAV_ROW = [\n  'relative flex h-7 w-full min-w-0 items-center gap-2 rounded-md px-2 text-left text-[13px] font-medium text-foreground outline-none',\n  'transition-colors duration-150 hover:bg-foreground/5 focus-visible:ring-[3px] focus-visible:ring-ring/25',\n  \"[&_svg]:pointer-events-none [&_svg]:relative [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground\",\n].join(' ');\n\nconst INDICATOR_TRAVEL: Transition = {\n  duration: 0.25,\n  ease: [0.77, 0, 0.175, 1],\n};\n\nconst INSTANT: Transition = { duration: 0 };\n\nfunction travelOf(shouldReduceMotion: boolean | null) {\n  if (shouldReduceMotion) {\n    return INSTANT;\n  }\n  return INDICATOR_TRAVEL;\n}\n\n/** The one highlight of the active row. It travels from the old row to the new one. */\nexport function ActiveRowIndicator({ layoutId }: { layoutId: string }) {\n  const shouldReduceMotion = usePrefersReducedMotion();\n\n  return (\n    <motion.span\n      aria-hidden='true'\n      layoutId={layoutId}\n      transition={travelOf(shouldReduceMotion)}\n      className='bg-foreground/[0.07] absolute inset-0 rounded-md'\n    />\n  );\n}\n\nexport function PersonAvatar({\n  person,\n  className,\n}: {\n  person: Person;\n  className?: string;\n}) {\n  return (\n    <Avatar className={className} seed={person.id}>\n      {person.avatar && <AvatarImage src={person.avatar} alt='' />}\n    </Avatar>\n  );\n}\n\nexport function ariaCurrentOf(isActive: boolean) {\n  if (isActive) {\n    return 'page' as const;\n  }\n  return undefined;\n}\n\ntype NavRowProps = {\n  item: NavItem;\n  isActive: boolean;\n  indicatorId: string;\n  onSelect: (item: NavItem) => void;\n};\n\nexport function NavRow({ item, isActive, indicatorId, onSelect }: NavRowProps) {\n  const ItemIcon = item.icon;\n  const ariaCurrent = ariaCurrentOf(isActive);\n\n  function selectItem() {\n    onSelect(item);\n  }\n\n  return (\n    <li>\n      <button\n        type='button'\n        aria-current={ariaCurrent}\n        onClick={selectItem}\n        className={NAV_ROW}\n      >\n        {isActive && <ActiveRowIndicator layoutId={indicatorId} />}\n        <ItemIcon />\n        <span className='relative min-w-0 flex-1 truncate'>{item.label}</span>\n      </button>\n    </li>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-03/sidebar-parts.tsx"
    },
    {
      "path": "registry/ndeko/templates/settings/application-03/workspace-switcher.tsx",
      "content": "'use client';\n\nimport {\n  ChevronsUpDownIcon,\n  PlusIcon,\n  SettingsIcon,\n} from '@/registry/ndeko/lib/icons';\nimport { CompanyMark } from '@/registry/ndeko/ui/company-mark';\nimport {\n  DropdownMenu,\n  DropdownMenuContent,\n  DropdownMenuItem,\n  DropdownMenuLabel,\n  DropdownMenuRadioGroup,\n  DropdownMenuRadioItem,\n  DropdownMenuSeparator,\n  DropdownMenuTrigger,\n} from '@/registry/ndeko/ui/dropdown-menu';\nimport { Kbd } from '@/registry/ndeko/ui/kbd';\n\nimport type { Workspace } from './data';\n\nconst TRIGGER = [\n  'flex h-9 min-w-0 flex-1 items-center gap-2 rounded-md px-1.5 text-left outline-none',\n  'transition-colors duration-150 hover:bg-foreground/5 data-popup-open:bg-foreground/5 focus-visible:ring-[3px] focus-visible:ring-ring/25',\n].join(' ');\n\nfunction memberCountLabelOf(count: number) {\n  if (count === 1) {\n    return '1 member';\n  }\n  return `${count} members`;\n}\n\ntype WorkspaceSwitcherProps = {\n  workspaces: Workspace[];\n  current: Workspace;\n  onSelect: (workspaceId: string) => void;\n  onOpenSettings: () => void;\n};\n\nexport function WorkspaceSwitcher({\n  workspaces,\n  current,\n  onSelect,\n  onOpenSettings,\n}: WorkspaceSwitcherProps) {\n  function selectWorkspace(value: unknown) {\n    if (typeof value === 'string') {\n      onSelect(value);\n    }\n  }\n\n  return (\n    <DropdownMenu>\n      <DropdownMenuTrigger\n        render={\n          <button\n            type='button'\n            aria-label={`Workspace: ${current.name}`}\n            className={TRIGGER}\n          />\n        }\n      >\n        <CompanyMark seed={current.id} className='size-6 rounded-md' />\n        <span className='min-w-0 flex-1 truncate text-[13px] font-semibold'>\n          {current.name}\n        </span>\n        <ChevronsUpDownIcon className='text-muted-foreground size-3.5 shrink-0' />\n      </DropdownMenuTrigger>\n      <DropdownMenuContent className='w-64'>\n        <DropdownMenuLabel>Workspaces</DropdownMenuLabel>\n        <DropdownMenuRadioGroup\n          value={current.id}\n          onValueChange={selectWorkspace}\n        >\n          {workspaces.map((workspace) => (\n            <DropdownMenuRadioItem\n              key={workspace.id}\n              value={workspace.id}\n              closeOnClick\n              className='h-9'\n            >\n              <CompanyMark seed={workspace.id} />\n              <span className='min-w-0 flex-1 truncate'>{workspace.name}</span>\n              <Kbd aria-hidden='true'>{workspace.memberCount}</Kbd>\n              <span className='sr-only'>\n                {memberCountLabelOf(workspace.memberCount)}\n              </span>\n            </DropdownMenuRadioItem>\n          ))}\n        </DropdownMenuRadioGroup>\n        <DropdownMenuSeparator />\n        <DropdownMenuItem onClick={onOpenSettings}>\n          <SettingsIcon />\n          Settings\n        </DropdownMenuItem>\n        <DropdownMenuItem>\n          <PlusIcon />\n          Add workspace\n        </DropdownMenuItem>\n      </DropdownMenuContent>\n    </DropdownMenu>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-03/workspace-switcher.tsx"
    },
    {
      "path": "registry/ndeko/templates/settings/application-03/search-palette.tsx",
      "content": "'use client';\n\nimport { SearchIcon } from '@/registry/ndeko/lib/icons';\nimport { CONTROL_RECIPE } from '@/registry/ndeko/lib/recipes';\nimport { cn } from '@/registry/ndeko/lib/utils';\nimport {\n  CommandDialog,\n  CommandEmpty,\n  CommandGroup,\n  CommandInput,\n  CommandItem,\n  CommandList,\n} from '@/registry/ndeko/ui/command';\nimport { Kbd } from '@/registry/ndeko/ui/kbd';\n\nimport type { NavGroup, PageId } from './data';\n\nfunction headingOf(group: NavGroup) {\n  if (group.team) {\n    return group.team.name;\n  }\n  if (group.label) {\n    return group.label;\n  }\n  return 'Personal';\n}\n\nexport function SearchTrigger({ onOpen }: { onOpen: () => void }) {\n  return (\n    <button\n      type='button'\n      onClick={onOpen}\n      className={cn(\n        CONTROL_RECIPE,\n        'text-muted-foreground flex h-8 min-w-0 flex-1 cursor-pointer items-center gap-2 px-2.5 text-left'\n      )}\n    >\n      <SearchIcon className='size-4 shrink-0' />\n      <span className='min-w-0 flex-1 truncate'>Search</span>\n      <Kbd>⌘K</Kbd>\n    </button>\n  );\n}\n\ntype CommandPaletteProps = {\n  open: boolean;\n  onOpenChange: (open: boolean) => void;\n  groups: NavGroup[];\n  onNavigate: (pageId: PageId) => void;\n};\n\nexport function CommandPalette({\n  open,\n  onOpenChange,\n  groups,\n  onNavigate,\n}: CommandPaletteProps) {\n  function closePalette() {\n    onOpenChange(false);\n  }\n\n  return (\n    <CommandDialog\n      open={open}\n      onOpenChange={onOpenChange}\n      title='Search'\n      description='Go to a settings page'\n    >\n      <CommandInput placeholder='Go to a settings page' />\n      <CommandList>\n        <CommandEmpty>\n          Nothing matches. Try the name of a settings page.\n        </CommandEmpty>\n        {groups.map((group) => (\n          <CommandGroup key={group.id} heading={headingOf(group)}>\n            {group.items.map((item) => {\n              const ItemIcon = item.icon;\n\n              function goToPage() {\n                closePalette();\n                onNavigate(item.id);\n              }\n\n              return (\n                <CommandItem\n                  key={item.id}\n                  value={`${group.id} ${item.label}`}\n                  onSelect={goToPage}\n                >\n                  <ItemIcon />\n                  {item.label}\n                </CommandItem>\n              );\n            })}\n          </CommandGroup>\n        ))}\n      </CommandList>\n    </CommandDialog>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-03/search-palette.tsx"
    },
    {
      "path": "registry/ndeko/templates/settings/application-03/account-menu.tsx",
      "content": "'use client';\n\nimport {\n  BellIcon,\n  ChevronsUpDownIcon,\n  CommandIcon,\n  LifeBuoyIcon,\n  LogOutIcon,\n  UserIcon,\n} from '@/registry/ndeko/lib/icons';\nimport {\n  DropdownMenu,\n  DropdownMenuContent,\n  DropdownMenuItem,\n  DropdownMenuSeparator,\n  DropdownMenuTrigger,\n} from '@/registry/ndeko/ui/dropdown-menu';\nimport { Kbd } from '@/registry/ndeko/ui/kbd';\n\nimport type { PageId, Person } from './data';\nimport { PersonAvatar } from './sidebar-parts';\n\nconst TRIGGER = [\n  'flex h-9 w-full min-w-0 items-center gap-2 rounded-md px-1.5 text-left outline-none',\n  'transition-colors duration-150 hover:bg-foreground/5 data-popup-open:bg-foreground/5 focus-visible:ring-[3px] focus-visible:ring-ring/25',\n].join(' ');\n\ntype AccountMenuProps = {\n  person: Person;\n  onOpenSettings: (pageId: PageId) => void;\n};\n\nexport function AccountMenuItems({ person, onOpenSettings }: AccountMenuProps) {\n  function openProfile() {\n    onOpenSettings('profile');\n  }\n\n  function openNotifications() {\n    onOpenSettings('notifications');\n  }\n\n  return (\n    <>\n      <div className='flex items-center gap-2.5 px-2 py-2'>\n        <PersonAvatar person={person} />\n        <div className='min-w-0'>\n          <p className='truncate text-[13px] font-medium'>{person.name}</p>\n          <p className='text-muted-foreground truncate text-xs'>\n            {person.role}\n          </p>\n        </div>\n      </div>\n      <DropdownMenuSeparator />\n      <DropdownMenuItem onClick={openProfile}>\n        <UserIcon />\n        Profile\n      </DropdownMenuItem>\n      <DropdownMenuItem onClick={openNotifications}>\n        <BellIcon />\n        Notifications\n      </DropdownMenuItem>\n      <DropdownMenuItem>\n        <CommandIcon />\n        Keyboard shortcuts\n        <Kbd className='ml-auto'>?</Kbd>\n      </DropdownMenuItem>\n      <DropdownMenuItem>\n        <LifeBuoyIcon />\n        Help and docs\n      </DropdownMenuItem>\n      <DropdownMenuSeparator />\n      <DropdownMenuItem variant='destructive'>\n        <LogOutIcon />\n        Log out\n      </DropdownMenuItem>\n    </>\n  );\n}\n\nexport function AccountMenu({ person, onOpenSettings }: AccountMenuProps) {\n  return (\n    <DropdownMenu>\n      <DropdownMenuTrigger\n        render={\n          <button\n            type='button'\n            aria-label={`Account: ${person.name}`}\n            className={TRIGGER}\n          />\n        }\n      >\n        <PersonAvatar person={person} className='size-6 text-[10px]' />\n        <span className='min-w-0 flex-1 truncate text-[13px] font-medium'>\n          {person.name}\n        </span>\n        <ChevronsUpDownIcon className='text-muted-foreground size-3.5 shrink-0' />\n      </DropdownMenuTrigger>\n      <DropdownMenuContent side='top' align='start' className='w-60'>\n        <AccountMenuItems person={person} onOpenSettings={onOpenSettings} />\n      </DropdownMenuContent>\n    </DropdownMenu>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-03/account-menu.tsx"
    },
    {
      "path": "registry/ndeko/templates/settings/application-03/top-bar.tsx",
      "content": "'use client';\n\nimport { MenuIcon } from '@/registry/ndeko/lib/icons';\nimport {\n  Breadcrumb,\n  BreadcrumbItem,\n  BreadcrumbList,\n  BreadcrumbPage,\n  BreadcrumbSeparator,\n} from '@/registry/ndeko/ui/breadcrumb';\nimport { Button } from '@/registry/ndeko/ui/button';\n\nimport type { NavItem, Person } from './data';\nimport { PersonAvatar } from './sidebar-parts';\n\nconst STACK_LIMIT = 4;\n\nfunction AvatarStack({ people }: { people: Person[] }) {\n  const shown = people.slice(0, STACK_LIMIT);\n  const hiddenCount = people.length - shown.length;\n  const hasHidden = hiddenCount > 0;\n\n  return (\n    <div\n      role='group'\n      aria-label='Team members'\n      className='hidden items-center sm:flex'\n    >\n      {shown.map((person) => (\n        <PersonAvatar\n          key={person.id}\n          person={person}\n          className='ring-background -ml-1.5 size-6 text-[10px] ring-2 first:ml-0'\n        />\n      ))}\n      {hasHidden && (\n        <span className='bg-muted text-muted-foreground ring-background -ml-1.5 inline-flex size-6 items-center justify-center rounded-full text-[10px] font-medium tabular-nums ring-2'>\n          +{hiddenCount}\n        </span>\n      )}\n    </div>\n  );\n}\n\ntype TopBarProps = {\n  page: NavItem;\n  ancestor?: string;\n  people: Person[];\n  onOpenNavigation: () => void;\n};\n\nexport function TopBar({\n  page,\n  ancestor,\n  people,\n  onOpenNavigation,\n}: TopBarProps) {\n  const PageIcon = page.icon;\n  const hasAncestor = Boolean(ancestor);\n\n  return (\n    <header className='hairline-b border-border flex h-11 shrink-0 items-center gap-2 px-3 md:px-4'>\n      <Button\n        variant='ghost'\n        size='icon-sm'\n        aria-label='Open navigation'\n        onClick={onOpenNavigation}\n        className='text-muted-foreground md:hidden'\n      >\n        <MenuIcon />\n      </Button>\n      <Breadcrumb className='min-w-0'>\n        <BreadcrumbList className='flex-nowrap'>\n          <li aria-hidden='true' className='flex'>\n            <PageIcon className='text-muted-foreground size-4 shrink-0' />\n          </li>\n          {hasAncestor && (\n            <>\n              <BreadcrumbItem className='hidden sm:inline-flex'>\n                {ancestor}\n              </BreadcrumbItem>\n              <BreadcrumbSeparator className='hidden sm:block' />\n            </>\n          )}\n          <BreadcrumbItem className='min-w-0'>\n            <BreadcrumbPage className='truncate'>{page.label}</BreadcrumbPage>\n          </BreadcrumbItem>\n        </BreadcrumbList>\n      </Breadcrumb>\n      <div className='ml-auto flex items-center gap-2'>\n        <AvatarStack people={people} />\n      </div>\n    </header>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-03/top-bar.tsx"
    },
    {
      "path": "registry/ndeko/templates/settings/application-03/profile-page.tsx",
      "content": "'use client';\n\nimport {\n  AnimatePresence,\n  motion,\n  type Transition,\n  type Variants,\n} from 'motion/react';\nimport { useState } from 'react';\n\nimport { usePrefersReducedMotion } from '@/registry/ndeko/hooks/use-prefers-reduced-motion';\nimport { GlobeIcon, MailIcon, UserIcon } from '@/registry/ndeko/lib/icons';\n\nimport {\n  BIO_MAX_LENGTH,\n  INITIAL_PROFILE,\n  LANGUAGES,\n  PROFILE_HOST,\n  PROFILE_SECTION_KEYS,\n  type ProfileField,\n  type ProfileSectionId,\n  type ProfileValues,\n  TIME_FORMAT_SAMPLE,\n  TIME_FORMATS,\n  TIME_ZONES,\n  WEEK_STARTS,\n} from './data';\nimport { BioRow, PhotoRow } from './profile-fields';\nimport {\n  ChoiceRow,\n  SectionPanel,\n  SectionTabs,\n  SelectRow,\n  SettingsPage,\n  SettingsSection,\n  SwitchRow,\n  TextRow,\n  UnsavedBar,\n  hasChangeIn,\n  useSettingsDraft,\n  type NavItem,\n} from './settings-kit';\nimport {\n  FIELD_SECTION,\n  errorCountOf,\n  errorsOf,\n  firstErrorFieldOf,\n  withoutError,\n  type ProfileErrors,\n} from './validation';\n\nconst SECTIONS = [\n  { id: 'profile', label: 'Profile', icon: UserIcon },\n  { id: 'contact', label: 'Contact', icon: MailIcon },\n  { id: 'region', label: 'Language and region', icon: GlobeIcon },\n] as const;\n\nconst SAMPLE_TRANSITION: Transition = { duration: 0.15, ease: [0.2, 0, 0, 1] };\n\nconst SAMPLE_VARIANTS: Variants = {\n  enter: { opacity: 0, y: 4 },\n  visible: { opacity: 1, y: 0 },\n  exit: { opacity: 0, y: -4 },\n};\n\nconst FADE_VARIANTS: Variants = {\n  enter: { opacity: 0 },\n  visible: { opacity: 1 },\n  exit: { opacity: 0 },\n};\n\nfunction sampleVariantsOf(shouldReduceMotion: boolean | null) {\n  if (shouldReduceMotion) {\n    return FADE_VARIANTS;\n  }\n  return SAMPLE_VARIANTS;\n}\n\nfunction fieldIdOf(field: ProfileField) {\n  return `profile-${field}`;\n}\n\nfunction fixMessageOf(count: number) {\n  if (count === 0) {\n    return undefined;\n  }\n  if (count === 1) {\n    return 'Fix 1 field to save';\n  }\n  return `Fix ${count} fields to save`;\n}\n\nfunction pageAddressOf(username: string) {\n  const handle = username.trim();\n  if (handle.length === 0) {\n    return `${PROFILE_HOST}your-name`;\n  }\n  return `${PROFILE_HOST}${handle}`;\n}\n\nfunction emailLineOf(isChanged: boolean) {\n  if (isChanged) {\n    return 'A confirmation link goes to the new address before it replaces the old one';\n  }\n  return 'Verified, used to sign in and for notifications';\n}\n\nfunction focusField(field: ProfileField) {\n  const fieldId = fieldIdOf(field);\n  window.requestAnimationFrame(() => {\n    document.getElementById(fieldId)?.focus();\n  });\n}\n\n/** The sample line under the time format swaps with the format it describes. */\nfunction TimeSample({ format }: { format: ProfileValues['timeFormat'] }) {\n  const shouldReduceMotion = usePrefersReducedMotion();\n  const variants = sampleVariantsOf(shouldReduceMotion);\n\n  return (\n    <span className='relative block'>\n      <AnimatePresence mode='popLayout' initial={false}>\n        <motion.span\n          key={format}\n          variants={variants}\n          initial='enter'\n          animate='visible'\n          exit='exit'\n          transition={SAMPLE_TRANSITION}\n          className='block'\n        >\n          {TIME_FORMAT_SAMPLE[format]}\n        </motion.span>\n      </AnimatePresence>\n    </span>\n  );\n}\n\ntype ProfilePageProps = {\n  values: ProfileValues;\n  workspaceName: string;\n  onSaved: (values: ProfileValues) => void;\n};\n\nexport function ProfilePage({\n  values,\n  workspaceName,\n  onSaved,\n}: ProfilePageProps) {\n  const settings = useSettingsDraft<ProfileValues>(values, onSaved);\n  const [section, setSection] = useState<ProfileSectionId>('profile');\n  const [hasSwitched, setHasSwitched] = useState(false);\n  const [shownErrors, setShownErrors] = useState<ProfileErrors>({});\n  const [photoError, setPhotoError] = useState<string | null>(null);\n  const draft = settings.draft;\n  const errorCount = errorCountOf(shownErrors);\n  const fixMessage = fixMessageOf(errorCount);\n  const pageAddress = pageAddressOf(draft.username);\n  const isEmailChanged = settings.changedKeys.includes('email');\n  const emailLine = emailLineOf(isEmailChanged);\n  const navItems: NavItem<ProfileSectionId>[] = SECTIONS.map((item) => ({\n    id: item.id,\n    label: item.label,\n    icon: item.icon,\n    hasChanges: hasChangeIn(\n      settings.changedKeys,\n      PROFILE_SECTION_KEYS[item.id]\n    ),\n  }));\n\n  function openSection(nextSection: ProfileSectionId) {\n    setSection(nextSection);\n    setHasSwitched(true);\n  }\n\n  function changeField<Field extends ProfileField>(\n    field: Field,\n    value: ProfileValues[Field]\n  ) {\n    settings.change(field, value);\n    setShownErrors((previous) => withoutError(previous, field));\n  }\n\n  function save() {\n    const errors = errorsOf(draft);\n    const firstField = firstErrorFieldOf(errors);\n    setShownErrors(errors);\n    if (!firstField) {\n      settings.save();\n      return;\n    }\n    const fieldSection = FIELD_SECTION[firstField];\n    if (fieldSection !== section) {\n      openSection(fieldSection);\n    }\n    focusField(firstField);\n  }\n\n  function discard() {\n    settings.discard();\n    setShownErrors({});\n    setPhotoError(null);\n  }\n\n  function changePhoto(photo: string) {\n    changeField('photo', photo);\n  }\n\n  function changeName(name: string) {\n    changeField('name', name);\n  }\n\n  function changeUsername(username: string) {\n    const lowered = username.toLowerCase();\n    changeField('username', lowered);\n  }\n\n  function changeTitle(title: string) {\n    changeField('title', title);\n  }\n\n  function changeBio(bio: string) {\n    changeField('bio', bio);\n  }\n\n  function changeEmail(email: string) {\n    changeField('email', email);\n  }\n\n  function changePhone(phone: string) {\n    changeField('phone', phone);\n  }\n\n  function changeShowEmail(showEmail: boolean) {\n    changeField('showEmail', showEmail);\n  }\n\n  function changeLanguage(language: string) {\n    changeField('language', language);\n  }\n\n  function changeTimeZone(timeZone: string) {\n    changeField('timeZone', timeZone);\n  }\n\n  function changeWeekStart(weekStart: ProfileValues['weekStart']) {\n    changeField('weekStart', weekStart);\n  }\n\n  function changeTimeFormat(timeFormat: ProfileValues['timeFormat']) {\n    changeField('timeFormat', timeFormat);\n  }\n\n  const bar = (\n    <UnsavedBar\n      isShown={settings.isBarShown}\n      status={settings.status}\n      changeCount={settings.changedKeys.length}\n      message={fixMessage}\n      onDiscard={discard}\n      onSave={save}\n    />\n  );\n\n  return (\n    <SettingsPage\n      title='Profile'\n      line={`How you appear to the people of ${workspaceName}, and how dates and times read for you.`}\n      bar={bar}\n    >\n      <SectionTabs\n        label='Profile sections'\n        items={navItems}\n        value={section}\n        onValueChange={openSection}\n      >\n        <SectionPanel value='profile' animatesIn={hasSwitched}>\n          <SettingsSection\n            title='Public profile'\n            line='Teammates see this next to your tasks, comments and time'\n          >\n            <PhotoRow\n              photo={draft.photo}\n              seed={INITIAL_PROFILE.username}\n              error={photoError}\n              onPhotoChange={changePhoto}\n              onError={setPhotoError}\n            />\n            <TextRow\n              inputId={fieldIdOf('name')}\n              label='Full name'\n              line='As it appears on invoices and reports'\n              value={draft.name}\n              error={shownErrors.name}\n              autoComplete='name'\n              maxLength={60}\n              onValueChange={changeName}\n            />\n            <TextRow\n              inputId={fieldIdOf('username')}\n              label='Username'\n              line={pageAddress}\n              value={draft.username}\n              error={shownErrors.username}\n              autoComplete='username'\n              maxLength={24}\n              onValueChange={changeUsername}\n            />\n            <TextRow\n              inputId={fieldIdOf('title')}\n              label='Title'\n              line='Shown under your name in the member list'\n              value={draft.title}\n              autoComplete='organization-title'\n              maxLength={60}\n              onValueChange={changeTitle}\n            />\n            <BioRow\n              value={draft.bio}\n              maxLength={BIO_MAX_LENGTH}\n              onValueChange={changeBio}\n            />\n          </SettingsSection>\n        </SectionPanel>\n        <SectionPanel value='contact' animatesIn={hasSwitched}>\n          <SettingsSection\n            title='How teammates reach you'\n            line='Your email signs you in; your phone stays optional'\n          >\n            <TextRow\n              inputId={fieldIdOf('email')}\n              type='email'\n              label='Email'\n              line={emailLine}\n              value={draft.email}\n              error={shownErrors.email}\n              autoComplete='email'\n              onValueChange={changeEmail}\n            />\n            <TextRow\n              inputId={fieldIdOf('phone')}\n              type='tel'\n              inputMode='tel'\n              label='Phone'\n              line='Optional, for urgent calls from your team'\n              placeholder='+234 803 555 0142'\n              value={draft.phone}\n              error={shownErrors.phone}\n              autoComplete='tel'\n              onValueChange={changePhone}\n            />\n            <SwitchRow\n              label='Show my email to teammates'\n              line='Off keeps it visible to workspace admins only'\n              checked={draft.showEmail}\n              onCheckedChange={changeShowEmail}\n            />\n          </SettingsSection>\n        </SectionPanel>\n        <SectionPanel value='region' animatesIn={hasSwitched}>\n          <SettingsSection\n            title='Language and region'\n            line='Applies to the app, your emails and your exports'\n          >\n            <SelectRow\n              label='Language'\n              line='Menus, emails and dates'\n              value={draft.language}\n              options={LANGUAGES}\n              onValueChange={changeLanguage}\n            />\n            <SelectRow\n              label='Time zone'\n              line='Due dates and reminders follow it'\n              value={draft.timeZone}\n              options={TIME_ZONES}\n              onValueChange={changeTimeZone}\n            />\n            <ChoiceRow\n              label='Week starts on'\n              line='Calendars and weekly reports'\n              value={draft.weekStart}\n              options={WEEK_STARTS}\n              onValueChange={changeWeekStart}\n            />\n            <ChoiceRow\n              label='Time format'\n              line={<TimeSample format={draft.timeFormat} />}\n              value={draft.timeFormat}\n              options={TIME_FORMATS}\n              onValueChange={changeTimeFormat}\n            />\n          </SettingsSection>\n        </SectionPanel>\n      </SectionTabs>\n    </SettingsPage>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-03/profile-page.tsx"
    },
    {
      "path": "registry/ndeko/templates/settings/application-03/profile-fields.tsx",
      "content": "'use client';\n\nimport { useEffect, useId, useRef } from 'react';\n\nimport { ImageUpIcon } from '@/registry/ndeko/lib/icons';\nimport { Avatar, AvatarImage } from '@/registry/ndeko/ui/avatar';\nimport { Button } from '@/registry/ndeko/ui/button';\nimport { Textarea } from '@/registry/ndeko/ui/textarea';\n\nimport { PHOTO_MAX_BYTES, PHOTO_TYPES } from './data';\nimport { describedByOf, ErrorPresence, SettingsRow } from './settings-kit';\n\nconst PHOTO_ACCEPT = PHOTO_TYPES.join(',');\n\nfunction photoProblemOf(file: File) {\n  const isAllowedType = PHOTO_TYPES.includes(file.type);\n  if (!isAllowedType) {\n    return 'Pick a PNG, JPEG or WebP image';\n  }\n  const isSmallEnough = file.size <= PHOTO_MAX_BYTES;\n  if (!isSmallEnough) {\n    return 'Pick an image under 2 MB';\n  }\n  return null;\n}\n\ntype PhotoRowProps = {\n  photo: string;\n  /** What the gradient is drawn from while there is no photo: something that stays the same, such as the username. */\n  seed: string;\n  error: string | null;\n  onPhotoChange: (photo: string) => void;\n  onError: (error: string | null) => void;\n};\n\n/** The picked image stays in the browser as an object URL; nothing is uploaded. */\nexport function PhotoRow({\n  photo,\n  seed,\n  error,\n  onPhotoChange,\n  onError,\n}: PhotoRowProps) {\n  const pickerRef = useRef<HTMLInputElement>(null);\n  const createdUrlsRef = useRef<string[]>([]);\n  const errorId = useId();\n  const hasPhoto = photo.length > 0;\n  const hasError = Boolean(error);\n  const describedBy = describedByOf(hasError, errorId);\n\n  useEffect(() => {\n    const createdUrls = createdUrlsRef.current;\n    return () => {\n      createdUrls.forEach((url) => URL.revokeObjectURL(url));\n    };\n  }, []);\n\n  function openPicker() {\n    pickerRef.current?.click();\n  }\n\n  function pickPhoto(event: React.ChangeEvent<HTMLInputElement>) {\n    const file = event.target.files?.[0];\n    event.target.value = '';\n    if (!file) {\n      return;\n    }\n    const problem = photoProblemOf(file);\n    onError(problem);\n    if (problem) {\n      return;\n    }\n    const url = URL.createObjectURL(file);\n    createdUrlsRef.current.push(url);\n    onPhotoChange(url);\n  }\n\n  function removePhoto() {\n    onError(null);\n    onPhotoChange('');\n  }\n\n  return (\n    <SettingsRow\n      label='Photo'\n      line='PNG, JPEG or WebP under 2 MB, shown on your tasks and comments'\n    >\n      <div className='flex items-center gap-3'>\n        <Avatar className='size-11' seed={seed}>\n          {hasPhoto && <AvatarImage src={photo} alt='' />}\n        </Avatar>\n        <Button\n          variant='outline'\n          size='sm'\n          aria-describedby={describedBy}\n          onClick={openPicker}\n        >\n          <ImageUpIcon />\n          Upload photo\n        </Button>\n        {hasPhoto && (\n          <Button variant='ghost' size='sm' onClick={removePhoto}>\n            Remove\n          </Button>\n        )}\n        <input\n          ref={pickerRef}\n          type='file'\n          accept={PHOTO_ACCEPT}\n          tabIndex={-1}\n          aria-hidden='true'\n          onChange={pickPhoto}\n          className='sr-only'\n        />\n      </div>\n      <ErrorPresence id={errorId} error={error} />\n    </SettingsRow>\n  );\n}\n\ntype BioRowProps = {\n  value: string;\n  maxLength: number;\n  onValueChange: (value: string) => void;\n};\n\nexport function BioRow({ value, maxLength, onValueChange }: BioRowProps) {\n  const fieldId = useId();\n  const countId = useId();\n  const countText = `${value.length} of ${maxLength}`;\n\n  function changeValue(event: React.ChangeEvent<HTMLTextAreaElement>) {\n    onValueChange(event.target.value);\n  }\n\n  return (\n    <div className='flex flex-col gap-2 px-4 py-3'>\n      <div className='flex items-baseline justify-between gap-3'>\n        <label htmlFor={fieldId} className='text-[13px] font-medium'>\n          Bio\n        </label>\n        <span\n          id={countId}\n          className='text-muted-foreground text-xs tabular-nums'\n        >\n          {countText}\n        </span>\n      </div>\n      <p className='text-muted-foreground -mt-1.5 text-xs'>\n        Two lines on your profile card, plain text\n      </p>\n      <Textarea\n        id={fieldId}\n        value={value}\n        rows={2}\n        maxLength={maxLength}\n        aria-describedby={countId}\n        onChange={changeValue}\n      />\n    </div>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-03/profile-fields.tsx"
    },
    {
      "path": "registry/ndeko/templates/settings/application-03/validation.ts",
      "content": "import type { ProfileField, ProfileValues, ProfileSectionId } from './data';\n\nexport type ProfileErrors = Partial<Record<ProfileField, string>>;\n\nconst USERNAME_PATTERN = /^[a-z0-9-]{3,24}$/;\n\nconst EMAIL_PATTERN = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n\nconst PHONE_PATTERN = /^\\+?[\\d\\s().-]+$/;\n\nconst PHONE_MIN_DIGITS = 7;\n\nconst FIELD_ORDER: ProfileField[] = [\n  'photo',\n  'name',\n  'username',\n  'title',\n  'bio',\n  'email',\n  'phone',\n];\n\nexport const FIELD_SECTION: Record<ProfileField, ProfileSectionId> = {\n  photo: 'profile',\n  name: 'profile',\n  username: 'profile',\n  title: 'profile',\n  bio: 'profile',\n  email: 'contact',\n  phone: 'contact',\n  showEmail: 'contact',\n  language: 'region',\n  timeZone: 'region',\n  weekStart: 'region',\n  timeFormat: 'region',\n};\n\nfunction digitCountOf(text: string) {\n  const digits = text.replace(/\\D/g, '');\n  return digits.length;\n}\n\nfunction phoneErrorOf(phone: string) {\n  const trimmed = phone.trim();\n  if (trimmed.length === 0) {\n    return null;\n  }\n  const hasAllowedCharacters = PHONE_PATTERN.test(trimmed);\n  const digitCount = digitCountOf(trimmed);\n  const hasEnoughDigits = digitCount >= PHONE_MIN_DIGITS;\n  const isValid = hasAllowedCharacters && hasEnoughDigits;\n  if (isValid) {\n    return null;\n  }\n  return 'Enter a phone number with its country code, such as +234 803 555 0142';\n}\n\nexport function errorsOf(values: ProfileValues): ProfileErrors {\n  const errors: ProfileErrors = {};\n  const name = values.name.trim();\n  const email = values.email.trim();\n  const isUsernameValid = USERNAME_PATTERN.test(values.username);\n  const hasEmail = email.length > 0;\n  const isEmailValid = EMAIL_PATTERN.test(email);\n  const isEmailMalformed = hasEmail && !isEmailValid;\n  const phoneError = phoneErrorOf(values.phone);\n  if (name.length === 0) {\n    errors.name = 'Enter your full name';\n  }\n  if (!isUsernameValid) {\n    errors.username = 'Use 3 to 24 lowercase letters, digits or hyphens';\n  }\n  if (!hasEmail) {\n    errors.email = 'Enter the email address you sign in with';\n  }\n  if (isEmailMalformed) {\n    errors.email = 'Enter an email like name@company.com';\n  }\n  if (phoneError) {\n    errors.phone = phoneError;\n  }\n  return errors;\n}\n\nexport function firstErrorFieldOf(errors: ProfileErrors) {\n  const field = FIELD_ORDER.find((candidate) => Boolean(errors[candidate]));\n  if (field) {\n    return field;\n  }\n  return null;\n}\n\nexport function errorCountOf(errors: ProfileErrors) {\n  const messages = Object.values(errors);\n  return messages.filter(Boolean).length;\n}\n\nexport function withoutError(errors: ProfileErrors, field: ProfileField) {\n  if (!errors[field]) {\n    return errors;\n  }\n  const next = { ...errors };\n  delete next[field];\n  return next;\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-03/validation.ts"
    },
    {
      "path": "registry/ndeko/templates/settings/application-03/notifications-page.tsx",
      "content": "'use client';\n\nimport { useId, useState } from 'react';\n\nimport {\n  Select,\n  SelectContent,\n  SelectItem,\n  SelectTrigger,\n  SelectValue,\n} from '@/registry/ndeko/ui/select';\n\nimport { ChannelEvents, Fold, SwappingLine } from './channel-sections';\nimport {\n  CHANNELS,\n  DELIVERIES,\n  DELIVERY_LINE,\n  QUIET_TIMES,\n  type Channel,\n  type ChannelId,\n  type Delivery,\n  type NotificationValues,\n  type SwitchKey,\n} from './data';\nimport {\n  ChoiceRow,\n  ErrorPresence,\n  SectionPanel,\n  SectionTabs,\n  SettingsPage,\n  SettingsRow,\n  SettingsSection,\n  SwitchRow,\n  UnsavedBar,\n  describedByOf,\n  hasChangeIn,\n  useSettingsDraft,\n  type NavItem,\n} from './settings-kit';\n\nconst SAME_TIMES_ERROR = 'Pick two different times';\n\nfunction channelOf(channelId: ChannelId): Channel {\n  const channel = CHANNELS.find((candidate) => candidate.id === channelId);\n  if (channel) {\n    return channel;\n  }\n  return CHANNELS[0];\n}\n\nfunction quietErrorOf(values: NotificationValues) {\n  const isSameTime = values.quietFrom === values.quietTo;\n  const isBroken = values.quietHours && isSameTime;\n  if (isBroken) {\n    return SAME_TIMES_ERROR;\n  }\n  return null;\n}\n\nfunction quietLineOf(values: NotificationValues) {\n  if (!values.quietHours) {\n    return 'Push arrives at any hour';\n  }\n  return `Nothing buzzes from ${values.quietFrom} to ${values.quietTo}, mentions included`;\n}\n\nfunction shownErrorOf(isShown: boolean, error: string | null) {\n  if (isShown) {\n    return error;\n  }\n  return null;\n}\n\nfunction saveMessageOf(showsQuietError: boolean) {\n  if (showsQuietError) {\n    return 'Fix the quiet hours to save';\n  }\n  return undefined;\n}\n\ntype TimeSelectProps = {\n  label: string;\n  value: string;\n  describedBy?: string;\n  isInvalid: boolean;\n  onValueChange: (value: string) => void;\n};\n\nfunction TimeSelect({\n  label,\n  value,\n  describedBy,\n  isInvalid,\n  onValueChange,\n}: TimeSelectProps) {\n  function changeValue(nextValue: unknown) {\n    const option = QUIET_TIMES.find(\n      (candidate) => candidate.value === nextValue\n    );\n    if (option) {\n      onValueChange(option.value);\n    }\n  }\n\n  return (\n    <Select items={QUIET_TIMES} value={value} onValueChange={changeValue}>\n      <SelectTrigger\n        aria-label={label}\n        aria-invalid={isInvalid}\n        aria-describedby={describedBy}\n        className='w-24 tabular-nums'\n      >\n        <SelectValue />\n      </SelectTrigger>\n      <SelectContent align='end'>\n        {QUIET_TIMES.map((time) => (\n          <SelectItem key={time.value} value={time.value}>\n            {time.label}\n          </SelectItem>\n        ))}\n      </SelectContent>\n    </Select>\n  );\n}\n\ntype NotificationsPageProps = {\n  values: NotificationValues;\n  onSaved: (values: NotificationValues) => void;\n};\n\nexport function NotificationsPage({ values, onSaved }: NotificationsPageProps) {\n  const settings = useSettingsDraft<NotificationValues>(values, onSaved);\n  const [channelId, setChannelId] = useState<ChannelId>('email');\n  const [hasSwitched, setHasSwitched] = useState(false);\n  const [isQuietErrorShown, setIsQuietErrorShown] = useState(false);\n  const quietErrorId = useId();\n  const draft = settings.draft;\n  const email = channelOf('email');\n  const push = channelOf('push');\n  const desktop = channelOf('desktop');\n  const quietError = quietErrorOf(draft);\n  const hasQuietError = Boolean(quietError);\n  const showsQuietError = isQuietErrorShown && hasQuietError;\n  const shownQuietError = shownErrorOf(showsQuietError, quietError);\n  const quietDescribedBy = describedByOf(showsQuietError, quietErrorId);\n  const quietLine = quietLineOf(draft);\n  const showsQuietTimes = draft.quietHours && draft.pushOn;\n  const deliveryLine = DELIVERY_LINE[draft.emailDelivery];\n  const saveMessage = saveMessageOf(showsQuietError);\n  const navItems: NavItem<ChannelId>[] = CHANNELS.map((channel) => ({\n    id: channel.id,\n    label: channel.label,\n    icon: channel.icon,\n    hasChanges: hasChangeIn(settings.changedKeys, channel.keys),\n  }));\n\n  function openChannel(nextChannelId: ChannelId) {\n    setChannelId(nextChannelId);\n    setHasSwitched(true);\n  }\n\n  function switchValue(key: SwitchKey, checked: boolean) {\n    settings.change(key, checked);\n  }\n\n  function changeDelivery(delivery: Delivery) {\n    settings.change('emailDelivery', delivery);\n  }\n\n  function changeQuietHours(checked: boolean) {\n    settings.change('quietHours', checked);\n    setIsQuietErrorShown(false);\n  }\n\n  function changeQuietFrom(time: string) {\n    settings.change('quietFrom', time);\n    setIsQuietErrorShown(false);\n  }\n\n  function changeQuietTo(time: string) {\n    settings.change('quietTo', time);\n    setIsQuietErrorShown(false);\n  }\n\n  function changeSound(checked: boolean) {\n    settings.change('desktopSound', checked);\n  }\n\n  function changePreview(checked: boolean) {\n    settings.change('desktopPreview', checked);\n  }\n\n  function save() {\n    if (hasQuietError) {\n      setIsQuietErrorShown(true);\n      openChannel('push');\n      return;\n    }\n    settings.save();\n  }\n\n  function discard() {\n    settings.discard();\n    setIsQuietErrorShown(false);\n  }\n\n  const bar = (\n    <UnsavedBar\n      isShown={settings.isBarShown}\n      status={settings.status}\n      changeCount={settings.changedKeys.length}\n      message={saveMessage}\n      onDiscard={discard}\n      onSave={save}\n    />\n  );\n\n  return (\n    <SettingsPage\n      title='Notifications'\n      line='Choose what reaches you on each channel. Mentions and tasks assigned to you always land in the app inbox.'\n      bar={bar}\n    >\n      <SectionTabs\n        label='Channels'\n        items={navItems}\n        value={channelId}\n        onValueChange={openChannel}\n      >\n        <SectionPanel value='email' animatesIn={hasSwitched}>\n          <ChannelEvents\n            channel={email}\n            values={draft}\n            onSwitch={switchValue}\n          />\n          <SettingsSection\n            title='Delivery'\n            line='Group emails so your inbox stays readable'\n          >\n            <ChoiceRow\n              label='Send emails'\n              line={<SwappingLine text={deliveryLine} />}\n              value={draft.emailDelivery}\n              options={DELIVERIES}\n              disabled={!draft.emailOn}\n              onValueChange={changeDelivery}\n            />\n          </SettingsSection>\n        </SectionPanel>\n        <SectionPanel value='push' animatesIn={hasSwitched}>\n          <ChannelEvents channel={push} values={draft} onSwitch={switchValue} />\n          <SettingsSection\n            title='Quiet hours'\n            line='Your phone stays silent at night, in your time zone'\n          >\n            <div>\n              <SwitchRow\n                label='Quiet hours'\n                line={<SwappingLine text={quietLine} />}\n                checked={draft.quietHours}\n                disabled={!draft.pushOn}\n                onCheckedChange={changeQuietHours}\n              />\n              <Fold isOpen={showsQuietTimes}>\n                <SettingsRow\n                  label='Silent between'\n                  line='Push waits and arrives together when it ends'\n                >\n                  <div className='flex items-center gap-2'>\n                    <TimeSelect\n                      label='Quiet hours start'\n                      value={draft.quietFrom}\n                      describedBy={quietDescribedBy}\n                      isInvalid={showsQuietError}\n                      onValueChange={changeQuietFrom}\n                    />\n                    <span className='text-muted-foreground text-xs'>and</span>\n                    <TimeSelect\n                      label='Quiet hours end'\n                      value={draft.quietTo}\n                      describedBy={quietDescribedBy}\n                      isInvalid={showsQuietError}\n                      onValueChange={changeQuietTo}\n                    />\n                  </div>\n                  <ErrorPresence id={quietErrorId} error={shownQuietError} />\n                </SettingsRow>\n              </Fold>\n            </div>\n          </SettingsSection>\n        </SectionPanel>\n        <SectionPanel value='desktop' animatesIn={hasSwitched}>\n          <ChannelEvents\n            channel={desktop}\n            values={draft}\n            onSwitch={switchValue}\n          />\n          <SettingsSection\n            title='On screen'\n            line='How a desktop notification looks and sounds'\n          >\n            <SwitchRow\n              label='Play a sound'\n              line='A short chime, at most once a minute'\n              checked={draft.desktopSound}\n              disabled={!draft.desktopOn}\n              onCheckedChange={changeSound}\n            />\n            <SwitchRow\n              label='Show the message'\n              line='Off shows only who wrote and on which task'\n              checked={draft.desktopPreview}\n              disabled={!draft.desktopOn}\n              onCheckedChange={changePreview}\n            />\n          </SettingsSection>\n        </SectionPanel>\n      </SectionTabs>\n    </SettingsPage>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-03/notifications-page.tsx"
    },
    {
      "path": "registry/ndeko/templates/settings/application-03/channel-sections.tsx",
      "content": "'use client';\n\nimport {\n  AnimatePresence,\n  motion,\n  type Transition,\n  type Variants,\n} from 'motion/react';\nimport { useId } from 'react';\n\nimport { usePrefersReducedMotion } from '@/registry/ndeko/hooks/use-prefers-reduced-motion';\nimport { AnimatedSize } from '@/registry/ndeko/ui/animated-size';\n\nimport type { Channel, NotificationValues, SwitchKey } from './data';\nimport { SETTINGS_SURFACE_BASE, SwitchRow } from './settings-kit';\n\nconst SWAP_TRANSITION: Transition = { duration: 0.15, ease: [0.2, 0, 0, 1] };\n\nconst LINE_VARIANTS: Variants = {\n  enter: { opacity: 0, y: 4 },\n  visible: { opacity: 1, y: 0 },\n  exit: { opacity: 0, y: -4 },\n};\n\nconst FADE_VARIANTS: Variants = {\n  enter: { opacity: 0 },\n  visible: { opacity: 1 },\n  exit: { opacity: 0 },\n};\n\nfunction lineVariantsOf(shouldReduceMotion: boolean | null) {\n  if (shouldReduceMotion) {\n    return FADE_VARIANTS;\n  }\n  return LINE_VARIANTS;\n}\n\n/** A row line that swaps with the value it describes. */\nexport function SwappingLine({ text }: { text: string }) {\n  const shouldReduceMotion = usePrefersReducedMotion();\n  const variants = lineVariantsOf(shouldReduceMotion);\n\n  return (\n    <span className='relative block'>\n      <AnimatePresence mode='popLayout' initial={false}>\n        <motion.span\n          key={text}\n          variants={variants}\n          initial='enter'\n          animate='visible'\n          exit='exit'\n          transition={SWAP_TRANSITION}\n          className='block'\n        >\n          {text}\n        </motion.span>\n      </AnimatePresence>\n    </span>\n  );\n}\n\ntype FoldProps = {\n  isOpen: boolean;\n  children: React.ReactNode;\n};\n\n/** Rows that fold into the row above them. The surface resizes, the rows below stay put. */\nexport function Fold({ isOpen, children }: FoldProps) {\n  return (\n    <AnimatedSize className='m-0' contentClassName='p-0'>\n      {isOpen && (\n        <div className='hairline-t border-border hairline-divide-y divide-border'>\n          {children}\n        </div>\n      )}\n    </AnimatedSize>\n  );\n}\n\ntype ChannelEventsProps = {\n  channel: Channel;\n  values: NotificationValues;\n  onSwitch: (key: SwitchKey, checked: boolean) => void;\n};\n\n/** The channel switch heads its own list; turning it off folds the events away. */\nexport function ChannelEvents({\n  channel,\n  values,\n  onSwitch,\n}: ChannelEventsProps) {\n  const headingId = useId();\n  const isOn = values[channel.masterKey];\n  const masterLine = masterLineOf(channel, isOn);\n\n  function switchMaster(checked: boolean) {\n    onSwitch(channel.masterKey, checked);\n  }\n\n  return (\n    <section aria-labelledby={headingId} className='flex flex-col gap-3'>\n      <h2 id={headingId} className='text-sm font-medium'>\n        {channel.eventsTitle}\n      </h2>\n      <div className={SETTINGS_SURFACE_BASE}>\n        <SwitchRow\n          label={channel.masterLabel}\n          line={<SwappingLine text={masterLine} />}\n          checked={isOn}\n          onCheckedChange={switchMaster}\n        />\n        <Fold isOpen={isOn}>\n          {channel.events.map((event) => {\n            function switchEvent(checked: boolean) {\n              onSwitch(event.key, checked);\n            }\n\n            return (\n              <SwitchRow\n                key={event.key}\n                label={event.label}\n                line={event.line}\n                checked={values[event.key]}\n                onCheckedChange={switchEvent}\n              />\n            );\n          })}\n        </Fold>\n      </div>\n    </section>\n  );\n}\n\nfunction masterLineOf(channel: Channel, isOn: boolean) {\n  if (isOn) {\n    return channel.masterLine;\n  }\n  return channel.offLine;\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-03/channel-sections.tsx"
    },
    {
      "path": "registry/ndeko/templates/settings/application-03/workspace-page.tsx",
      "content": "'use client';\n\nimport { useId, useState } from 'react';\n\nimport {\n  SettingsIcon,\n  TriangleAlertIcon,\n  UsersIcon,\n} from '@/registry/ndeko/lib/icons';\nimport { CompanyMark } from '@/registry/ndeko/ui/company-mark';\n\nimport { DangerZone } from './danger-zone';\nimport {\n  INVITE_POLICIES,\n  type Role,\n  ROLE_OPTIONS,\n  TIME_ZONES,\n  WORKSPACE_FACTS,\n  WORKSPACE_FIELD_SECTION,\n  WORKSPACE_HOST,\n  WORKSPACE_ID,\n  WORKSPACE_SECTION_KEYS,\n  type WorkspaceField,\n  type WorkspaceSectionId,\n  type WorkspaceValues,\n} from './data';\nimport { RoleChoice } from './role-choice';\nimport {\n  SETTINGS_SURFACE_BASE,\n  SectionPanel,\n  SectionTabs,\n  SelectRow,\n  SettingsPage,\n  SettingsRow,\n  SettingsSection,\n  SwitchRow,\n  TextRow,\n  UnsavedBar,\n  hasChangeIn,\n  useSettingsDraft,\n  type NavItem,\n} from './settings-kit';\n\ntype WorkspaceErrors = Partial<Record<WorkspaceField, string>>;\n\nconst SECTIONS = [\n  { id: 'general', label: 'General', icon: SettingsIcon },\n  { id: 'members', label: 'Members', icon: UsersIcon },\n  { id: 'danger', label: 'Danger zone', icon: TriangleAlertIcon },\n] as const;\n\nconst FIELD_ORDER: WorkspaceField[] = ['name', 'slug', 'allowedDomain'];\n\nconst SLUG_PATTERN = /^[a-z0-9]+(-[a-z0-9]+)*$/;\n\nconst DOMAIN_PATTERN = /^[a-z0-9-]+(\\.[a-z0-9-]+)+$/;\n\nfunction errorsOf(values: WorkspaceValues): WorkspaceErrors {\n  const errors: WorkspaceErrors = {};\n  const name = values.name.trim();\n  const domain = values.allowedDomain.trim();\n  const hasDomain = domain.length > 0;\n  const isSlugValid = SLUG_PATTERN.test(values.slug);\n  const isDomainValid = DOMAIN_PATTERN.test(domain);\n  const isDomainMalformed = hasDomain && !isDomainValid;\n  if (name.length === 0) {\n    errors.name = 'Give the workspace a name';\n  }\n  if (!isSlugValid) {\n    errors.slug = 'Use lowercase letters and digits, joined by single hyphens';\n  }\n  if (isDomainMalformed) {\n    errors.allowedDomain = 'Enter a domain like lattice.example, without the @';\n  }\n  return errors;\n}\n\nfunction firstErrorFieldOf(errors: WorkspaceErrors) {\n  const field = FIELD_ORDER.find((candidate) => Boolean(errors[candidate]));\n  if (field) {\n    return field;\n  }\n  return null;\n}\n\nfunction withoutError(errors: WorkspaceErrors, field: WorkspaceField) {\n  if (!errors[field]) {\n    return errors;\n  }\n  const next = { ...errors };\n  delete next[field];\n  return next;\n}\n\nfunction fixMessageOf(errors: WorkspaceErrors) {\n  const messages = Object.values(errors);\n  const count = messages.filter(Boolean).length;\n  if (count === 0) {\n    return undefined;\n  }\n  if (count === 1) {\n    return 'Fix 1 field to save';\n  }\n  return `Fix ${count} fields to save`;\n}\n\nfunction slugLineOf(slug: string) {\n  const address = `${WORKSPACE_HOST}${slug}`;\n  return `${address}, old links redirect for 30 days`;\n}\n\nfunction domainLineOf(domain: string) {\n  const trimmed = domain.trim();\n  if (trimmed.length === 0) {\n    return 'Empty: people join only with an invitation';\n  }\n  return `Anyone with an @${trimmed} address can join`;\n}\n\nfunction fieldIdOf(field: WorkspaceField) {\n  return `workspace-${field}`;\n}\n\nfunction focusField(field: WorkspaceField) {\n  const fieldId = fieldIdOf(field);\n  window.requestAnimationFrame(() => {\n    document.getElementById(fieldId)?.focus();\n  });\n}\n\n/** The workspace has no logo of its own yet, so it wears a mark drawn from its id: renaming it keeps the mark. */\nfunction WorkspaceTile() {\n  return <CompanyMark seed={WORKSPACE_ID} className='size-10 rounded-lg' />;\n}\n\ntype WorkspacePageProps = {\n  values: WorkspaceValues;\n  onSaved: (values: WorkspaceValues) => void;\n};\n\nexport function WorkspacePage({ values, onSaved }: WorkspacePageProps) {\n  const settings = useSettingsDraft<WorkspaceValues>(values, onSaved);\n  const [section, setSection] = useState<WorkspaceSectionId>('general');\n  const [hasSwitched, setHasSwitched] = useState(false);\n  const [shownErrors, setShownErrors] = useState<WorkspaceErrors>({});\n  const roleHeadingId = useId();\n  const draft = settings.draft;\n  const savedName = settings.savedValues.name;\n  const fixMessage = fixMessageOf(shownErrors);\n  const slugLine = slugLineOf(draft.slug);\n  const domainLine = domainLineOf(draft.allowedDomain);\n  const navItems: NavItem<WorkspaceSectionId>[] = SECTIONS.map((item) => ({\n    id: item.id,\n    label: item.label,\n    icon: item.icon,\n    hasChanges: hasChangeIn(\n      settings.changedKeys,\n      WORKSPACE_SECTION_KEYS[item.id]\n    ),\n  }));\n\n  function openSection(nextSection: WorkspaceSectionId) {\n    setSection(nextSection);\n    setHasSwitched(true);\n  }\n\n  function changeField<Field extends WorkspaceField>(\n    field: Field,\n    value: WorkspaceValues[Field]\n  ) {\n    settings.change(field, value);\n    setShownErrors((previous) => withoutError(previous, field));\n  }\n\n  function save() {\n    const errors = errorsOf(draft);\n    const firstField = firstErrorFieldOf(errors);\n    setShownErrors(errors);\n    if (!firstField) {\n      settings.save();\n      return;\n    }\n    const fieldSection = WORKSPACE_FIELD_SECTION[firstField];\n    if (fieldSection !== section) {\n      openSection(fieldSection);\n    }\n    focusField(firstField);\n  }\n\n  function discard() {\n    settings.discard();\n    setShownErrors({});\n  }\n\n  function changeName(name: string) {\n    changeField('name', name);\n  }\n\n  function changeSlug(slug: string) {\n    const lowered = slug.toLowerCase();\n    changeField('slug', lowered);\n  }\n\n  function changeTimeZone(timeZone: string) {\n    changeField('timeZone', timeZone);\n  }\n\n  function changeRole(role: Role) {\n    changeField('defaultRole', role);\n  }\n\n  function changeInvitePolicy(policy: string) {\n    const option = INVITE_POLICIES.find(\n      (candidate) => candidate.value === policy\n    );\n    if (option) {\n      changeField('invitePolicy', option.value);\n    }\n  }\n\n  function changeApproveJoins(checked: boolean) {\n    changeField('approveJoins', checked);\n  }\n\n  function changeDomain(domain: string) {\n    const lowered = domain.toLowerCase();\n    changeField('allowedDomain', lowered);\n  }\n\n  const bar = (\n    <UnsavedBar\n      isShown={settings.isBarShown}\n      status={settings.status}\n      changeCount={settings.changedKeys.length}\n      message={fixMessage}\n      onDiscard={discard}\n      onSave={save}\n    />\n  );\n\n  return (\n    <SettingsPage\n      title='Workspace'\n      line={`The name, the address and who can join ${settings.savedValues.name}. Changes here apply to all ${WORKSPACE_FACTS.members} members.`}\n      bar={bar}\n    >\n      <SectionTabs\n        label='Workspace sections'\n        items={navItems}\n        value={section}\n        onValueChange={openSection}\n      >\n        <SectionPanel value='general' animatesIn={hasSwitched}>\n          <SettingsSection\n            title='General'\n            line='How the workspace shows in the sidebar, links and emails'\n          >\n            <SettingsRow\n              label='Workspace tile'\n              line='No logo yet, so the tile shows the first letter of the name'\n            >\n              <WorkspaceTile />\n            </SettingsRow>\n            <TextRow\n              inputId={fieldIdOf('name')}\n              label='Name'\n              line='Shown in the sidebar and in invitations'\n              value={draft.name}\n              error={shownErrors.name}\n              autoComplete='organization'\n              maxLength={48}\n              onValueChange={changeName}\n            />\n            <TextRow\n              inputId={fieldIdOf('slug')}\n              label='Address'\n              line={slugLine}\n              value={draft.slug}\n              error={shownErrors.slug}\n              autoComplete='off'\n              maxLength={40}\n              onValueChange={changeSlug}\n            />\n            <SelectRow\n              label='Time zone'\n              line='Days in reports and timesheets close at midnight here'\n              value={draft.timeZone}\n              options={TIME_ZONES}\n              onValueChange={changeTimeZone}\n            />\n          </SettingsSection>\n        </SectionPanel>\n        <SectionPanel value='members' animatesIn={hasSwitched}>\n          <section\n            aria-labelledby={roleHeadingId}\n            className='flex flex-col gap-3'\n          >\n            <div className='flex flex-col gap-0.5'>\n              <h2 id={roleHeadingId} className='text-sm font-medium'>\n                Default role for new members\n              </h2>\n              <p className='text-muted-foreground text-xs'>\n                Given to everyone who joins from now on; people already in keep\n                their role\n              </p>\n            </div>\n            <div className={SETTINGS_SURFACE_BASE}>\n              <RoleChoice\n                labelledBy={roleHeadingId}\n                options={ROLE_OPTIONS}\n                value={draft.defaultRole}\n                onValueChange={changeRole}\n              />\n            </div>\n          </section>\n          <SettingsSection\n            title='Joining'\n            line='Invitations and the people who can send them'\n          >\n            <SelectRow\n              label='Who can invite'\n              line='Invitations last 7 days'\n              value={draft.invitePolicy}\n              options={INVITE_POLICIES}\n              onValueChange={changeInvitePolicy}\n            />\n            <SwitchRow\n              label='Approve new members'\n              line='People who join with a link wait until an admin lets them in'\n              checked={draft.approveJoins}\n              onCheckedChange={changeApproveJoins}\n            />\n            <TextRow\n              inputId={fieldIdOf('allowedDomain')}\n              label='Allowed email domain'\n              line={domainLine}\n              placeholder='company.com'\n              value={draft.allowedDomain}\n              error={shownErrors.allowedDomain}\n              autoComplete='off'\n              maxLength={64}\n              onValueChange={changeDomain}\n            />\n          </SettingsSection>\n        </SectionPanel>\n        <SectionPanel value='danger' animatesIn={hasSwitched}>\n          <SettingsSection\n            title='Danger zone'\n            line='These apply at once and do not wait for Save'\n          >\n            <DangerZone workspaceName={savedName} />\n          </SettingsSection>\n        </SectionPanel>\n      </SectionTabs>\n    </SettingsPage>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-03/workspace-page.tsx"
    },
    {
      "path": "registry/ndeko/templates/settings/application-03/role-choice.tsx",
      "content": "'use client';\n\nimport { RadioGroup, RadioGroupItem } from '@/registry/ndeko/ui/radio-group';\n\nimport type { Role, RoleOption } from './data';\n\nfunction holdersLineOf(holders: number) {\n  if (holders === 1) {\n    return '1 person has this role today';\n  }\n  return `${holders} people have this role today`;\n}\n\ntype RoleChoiceProps = {\n  labelledBy: string;\n  options: RoleOption[];\n  value: Role;\n  onValueChange: (role: Role) => void;\n};\n\n/** A choice that changes what new people can do: each option says what it allows and who holds it now. */\nexport function RoleChoice({\n  labelledBy,\n  options,\n  value,\n  onValueChange,\n}: RoleChoiceProps) {\n  function changeValue(nextValue: unknown) {\n    const option = options.find((candidate) => candidate.value === nextValue);\n    if (option) {\n      onValueChange(option.value);\n    }\n  }\n\n  return (\n    <RadioGroup\n      aria-labelledby={labelledBy}\n      value={value}\n      onValueChange={changeValue}\n      className='hairline-divide-y divide-border gap-0'\n    >\n      {options.map((option) => {\n        const holdersLine = holdersLineOf(option.holders);\n\n        return (\n          <label\n            key={option.value}\n            className='has-data-checked:bg-primary/[0.06] flex cursor-pointer items-start gap-3 px-4 py-3 transition-colors duration-150 first:rounded-t-xl last:rounded-b-xl'\n          >\n            <RadioGroupItem value={option.value} className='mt-0.5' />\n            <span className='flex min-w-0 flex-col gap-0.5'>\n              <span className='text-[13px] font-medium'>{option.label}</span>\n              <span className='text-muted-foreground text-xs'>\n                {option.line}\n              </span>\n              <span className='text-muted-foreground text-xs tabular-nums'>\n                {holdersLine}\n              </span>\n            </span>\n          </label>\n        );\n      })}\n    </RadioGroup>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-03/role-choice.tsx"
    },
    {
      "path": "registry/ndeko/templates/settings/application-03/danger-zone.tsx",
      "content": "'use client';\n\nimport {\n  AnimatePresence,\n  motion,\n  type Transition,\n  type Variants,\n} from 'motion/react';\nimport { useEffect, useId, useRef, useState } from 'react';\n\nimport { usePrefersReducedMotion } from '@/registry/ndeko/hooks/use-prefers-reduced-motion';\nimport { cn } from '@/registry/ndeko/lib/utils';\nimport {\n  AlertDialog,\n  AlertDialogAction,\n  AlertDialogCancel,\n  AlertDialogContent,\n  AlertDialogDescription,\n  AlertDialogFooter,\n  AlertDialogHeader,\n  AlertDialogTitle,\n} from '@/registry/ndeko/ui/alert-dialog';\nimport { AnimatedSize } from '@/registry/ndeko/ui/animated-size';\nimport { Button } from '@/registry/ndeko/ui/button';\nimport { Input } from '@/registry/ndeko/ui/input';\n\nimport { WORKSPACE_FACTS } from './data';\nimport { SettingsRow } from './settings-kit';\n\nconst HOLD_MS = 2000;\n\nconst SWAP_TRANSITION: Transition = { duration: 0.15, ease: [0.2, 0, 0, 1] };\n\nconst SWAP_VARIANTS: Variants = {\n  enter: { opacity: 0, scale: 0.6, filter: 'blur(2px)' },\n  visible: { opacity: 1, scale: 1, filter: 'blur(0px)' },\n  exit: { opacity: 0, scale: 0.6, filter: 'blur(2px)' },\n};\n\nconst LINE_VARIANTS: Variants = {\n  enter: { opacity: 0, y: 4 },\n  visible: { opacity: 1, y: 0 },\n  exit: { opacity: 0, y: -4 },\n};\n\nconst FADE_VARIANTS: Variants = {\n  enter: { opacity: 0 },\n  visible: { opacity: 1 },\n  exit: { opacity: 0 },\n};\n\nconst COUNT_FORMAT = new Intl.NumberFormat('en');\n\nfunction swapVariantsOf(shouldReduceMotion: boolean | null) {\n  if (shouldReduceMotion) {\n    return FADE_VARIANTS;\n  }\n  return SWAP_VARIANTS;\n}\n\nfunction lineVariantsOf(shouldReduceMotion: boolean | null) {\n  if (shouldReduceMotion) {\n    return FADE_VARIANTS;\n  }\n  return LINE_VARIANTS;\n}\n\nfunction clearTimer(timerRef: React.RefObject<number | null>) {\n  if (timerRef.current === null) {\n    return;\n  }\n  window.clearTimeout(timerRef.current);\n  timerRef.current = null;\n}\n\nfunction isHoldKey(event: React.KeyboardEvent) {\n  const isSpace = event.key === ' ';\n  const isEnter = event.key === 'Enter';\n  return isSpace || isEnter;\n}\n\n/**\n * Clip-path moves the fill; with reduced motion the fill fades in over the same two seconds,\n * because the theme drops clip-path transitions in that mode.\n */\nfunction holdFillClassOf(\n  isHolding: boolean,\n  shouldReduceMotion: boolean | null\n) {\n  if (shouldReduceMotion) {\n    return cn(\n      'opacity-0 transition-opacity duration-200',\n      isHolding && 'opacity-100 duration-[2000ms] ease-linear'\n    );\n  }\n  return cn(\n    '[clip-path:inset(0_100%_0_0)] transition-[clip-path] duration-200 ease-(--ease-out-strong)',\n    isHolding && '[clip-path:inset(0_0_0_0)] duration-[2000ms] ease-linear'\n  );\n}\n\nfunction holdLabelOf(isHolding: boolean, label: string) {\n  if (isHolding) {\n    return 'Keep holding';\n  }\n  return label;\n}\n\ntype HoldButtonProps = {\n  label: string;\n  hint: string;\n  onComplete: () => void;\n};\n\n/** A destructive action that asks for intent: the fill crosses the pill while it is pressed and drains on release. */\nfunction HoldButton({ label, hint, onComplete }: HoldButtonProps) {\n  const [isHolding, setIsHolding] = useState(false);\n  const timerRef = useRef<number | null>(null);\n  const hintId = useId();\n  const shouldReduceMotion = usePrefersReducedMotion();\n  const variants = swapVariantsOf(shouldReduceMotion);\n  const fillClass = holdFillClassOf(isHolding, shouldReduceMotion);\n  const shownLabel = holdLabelOf(isHolding, label);\n\n  useEffect(() => {\n    return () => clearTimer(timerRef);\n  }, []);\n\n  function startHold() {\n    if (timerRef.current !== null) {\n      return;\n    }\n    setIsHolding(true);\n    timerRef.current = window.setTimeout(() => {\n      timerRef.current = null;\n      setIsHolding(false);\n      onComplete();\n    }, HOLD_MS);\n  }\n\n  function stopHold() {\n    clearTimer(timerRef);\n    setIsHolding(false);\n  }\n\n  function pressKey(event: React.KeyboardEvent<HTMLButtonElement>) {\n    const isHold = isHoldKey(event);\n    if (!isHold) {\n      return;\n    }\n    event.preventDefault();\n    if (!event.repeat) {\n      startHold();\n    }\n  }\n\n  function releaseKey(event: React.KeyboardEvent<HTMLButtonElement>) {\n    if (isHoldKey(event)) {\n      stopHold();\n    }\n  }\n\n  return (\n    <>\n      <Button\n        variant='outline'\n        aria-describedby={hintId}\n        onPointerDown={startHold}\n        onPointerUp={stopHold}\n        onPointerLeave={stopHold}\n        onPointerCancel={stopHold}\n        onKeyDown={pressKey}\n        onKeyUp={releaseKey}\n        onBlur={stopHold}\n        className='text-destructive-ink touch-none overflow-hidden select-none [-webkit-touch-callout:none]'\n      >\n        <span\n          aria-hidden='true'\n          className={cn('bg-destructive/15 absolute inset-0', fillClass)}\n        />\n        <AnimatedSize as='span' axis='width' contentClassName='relative flex'>\n          <AnimatePresence mode='popLayout' initial={false}>\n            <motion.span\n              key={shownLabel}\n              variants={variants}\n              initial='enter'\n              animate='visible'\n              exit='exit'\n              transition={SWAP_TRANSITION}\n            >\n              {shownLabel}\n            </motion.span>\n          </AnimatePresence>\n        </AnimatedSize>\n      </Button>\n      <span id={hintId} className='sr-only'>\n        {hint}\n      </span>\n    </>\n  );\n}\n\nfunction SwappingLine({ text }: { text: string }) {\n  const shouldReduceMotion = usePrefersReducedMotion();\n  const variants = lineVariantsOf(shouldReduceMotion);\n\n  return (\n    <span className='relative block'>\n      <AnimatePresence mode='popLayout' initial={false}>\n        <motion.span\n          key={text}\n          variants={variants}\n          initial='enter'\n          animate='visible'\n          exit='exit'\n          transition={SWAP_TRANSITION}\n          className='block'\n        >\n          {text}\n        </motion.span>\n      </AnimatePresence>\n    </span>\n  );\n}\n\ntype SwapSlotProps = {\n  slotKey: string;\n  children: React.ReactNode;\n};\n\nfunction SwapSlot({ slotKey, children }: SwapSlotProps) {\n  const shouldReduceMotion = usePrefersReducedMotion();\n  const variants = swapVariantsOf(shouldReduceMotion);\n\n  return (\n    <AnimatedSize axis='width' contentClassName='relative flex justify-end'>\n      <AnimatePresence mode='popLayout' initial={false}>\n        <motion.span\n          key={slotKey}\n          variants={variants}\n          initial='enter'\n          animate='visible'\n          exit='exit'\n          transition={SWAP_TRANSITION}\n          className='flex'\n        >\n          {children}\n        </motion.span>\n      </AnimatePresence>\n    </AnimatedSize>\n  );\n}\n\nfunction countOf(count: number, singular: string, plural: string) {\n  const digits = COUNT_FORMAT.format(count);\n  if (count === 1) {\n    return `1 ${singular}`;\n  }\n  return `${digits} ${plural}`;\n}\n\nconst MEMBERS_LABEL = countOf(WORKSPACE_FACTS.members, 'member', 'members');\n\nconst PROJECTS_LABEL = countOf(WORKSPACE_FACTS.projects, 'project', 'projects');\n\nconst TASKS_LABEL = countOf(WORKSPACE_FACTS.tasks, 'task', 'tasks');\n\nconst GRACE_LABEL = countOf(WORKSPACE_FACTS.graceDays, 'day', 'days');\n\nfunction accessLineOf(members: number) {\n  if (members === 1) {\n    return '1 member loses access';\n  }\n  return `${MEMBERS_LABEL} lose access`;\n}\n\nconst ACCESS_LINE = accessLineOf(WORKSPACE_FACTS.members);\n\nfunction archiveLineOf(isArchived: boolean) {\n  if (isArchived) {\n    return 'Archived just now. Everyone can read, nobody can edit or track time';\n  }\n  return 'Everyone keeps read access; nobody can edit or track time until you restore it';\n}\n\nfunction deleteLineOf(isScheduled: boolean) {\n  if (isScheduled) {\n    return `Deletion scheduled for ${WORKSPACE_FACTS.deletionDate}. Until then you can cancel it`;\n  }\n  return `After ${GRACE_LABEL}, removes ${MEMBERS_LABEL}, ${PROJECTS_LABEL} and ${TASKS_LABEL}`;\n}\n\ntype DangerZoneProps = {\n  workspaceName: string;\n};\n\n/** Destructive rows apply at once: archive asks for a two-second hold, delete asks for the name. */\nexport function DangerZone({ workspaceName }: DangerZoneProps) {\n  const [isArchived, setIsArchived] = useState(false);\n  const [isDeletionScheduled, setIsDeletionScheduled] = useState(false);\n  const [isDialogOpen, setIsDialogOpen] = useState(false);\n  const [typedName, setTypedName] = useState('');\n  const confirmFieldId = useId();\n  const isNameTyped = typedName.trim() === workspaceName;\n  const archiveLine = archiveLineOf(isArchived);\n  const deleteLine = deleteLineOf(isDeletionScheduled);\n  const archiveSlotKey = String(isArchived);\n  const deleteSlotKey = String(isDeletionScheduled);\n\n  function archive() {\n    setIsArchived(true);\n  }\n\n  function restore() {\n    setIsArchived(false);\n  }\n\n  function openDeletion() {\n    setTypedName('');\n    setIsDialogOpen(true);\n  }\n\n  function changeTypedName(event: React.ChangeEvent<HTMLInputElement>) {\n    setTypedName(event.target.value);\n  }\n\n  function scheduleDeletion() {\n    setIsDeletionScheduled(true);\n  }\n\n  function cancelDeletion() {\n    setIsDeletionScheduled(false);\n  }\n\n  return (\n    <>\n      <SettingsRow\n        label='Archive workspace'\n        line={<SwappingLine text={archiveLine} />}\n      >\n        <SwapSlot slotKey={archiveSlotKey}>\n          {isArchived && (\n            <Button variant='outline' onClick={restore}>\n              Restore workspace\n            </Button>\n          )}\n          {!isArchived && (\n            <HoldButton\n              label='Hold to archive'\n              hint='Press and hold for two seconds to archive the workspace'\n              onComplete={archive}\n            />\n          )}\n        </SwapSlot>\n      </SettingsRow>\n      <SettingsRow\n        label='Delete workspace'\n        line={<SwappingLine text={deleteLine} />}\n      >\n        <SwapSlot slotKey={deleteSlotKey}>\n          {isDeletionScheduled && (\n            <Button variant='outline' onClick={cancelDeletion}>\n              Cancel deletion\n            </Button>\n          )}\n          {!isDeletionScheduled && (\n            <Button\n              variant='outline'\n              onClick={openDeletion}\n              className='text-destructive-ink'\n            >\n              Delete workspace\n            </Button>\n          )}\n        </SwapSlot>\n      </SettingsRow>\n      <AlertDialog open={isDialogOpen} onOpenChange={setIsDialogOpen}>\n        <AlertDialogContent>\n          <AlertDialogHeader>\n            <AlertDialogTitle>{`Delete ${workspaceName}?`}</AlertDialogTitle>\n            <AlertDialogDescription>\n              {`Nothing is removed for ${GRACE_LABEL}. After that it cannot be undone.`}\n            </AlertDialogDescription>\n          </AlertDialogHeader>\n          <ul className='bg-foreground/[0.03] hairline-divide-y divide-border flex flex-col rounded-lg text-[13px]'>\n            <li className='px-3 py-2'>{ACCESS_LINE}</li>\n            <li className='px-3 py-2'>{`${PROJECTS_LABEL} and ${TASKS_LABEL} are deleted`}</li>\n            <li className='px-3 py-2'>\n              Timesheets stay downloadable until the end\n            </li>\n          </ul>\n          <div className='flex flex-col gap-1.5'>\n            <label\n              htmlFor={confirmFieldId}\n              className='text-muted-foreground text-xs'\n            >\n              Type{' '}\n              <span className='text-foreground font-medium'>\n                {workspaceName}\n              </span>{' '}\n              to confirm\n            </label>\n            <Input\n              id={confirmFieldId}\n              value={typedName}\n              autoComplete='off'\n              spellCheck={false}\n              onChange={changeTypedName}\n            />\n          </div>\n          <AlertDialogFooter>\n            <AlertDialogCancel>Keep workspace</AlertDialogCancel>\n            <AlertDialogAction\n              variant='destructive'\n              disabled={!isNameTyped}\n              onClick={scheduleDeletion}\n            >\n              Delete workspace\n            </AlertDialogAction>\n          </AlertDialogFooter>\n        </AlertDialogContent>\n      </AlertDialog>\n    </>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-03/danger-zone.tsx"
    },
    {
      "path": "registry/ndeko/templates/settings/application-03/settings-kit.tsx",
      "content": "'use client';\n\nimport { Radio as RadioPrimitive } from '@base-ui/react/radio';\nimport { RadioGroup as RadioGroupPrimitive } from '@base-ui/react/radio-group';\nimport { Tabs as TabsPrimitive } from '@base-ui/react/tabs';\nimport {\n  AnimatePresence,\n  motion,\n  type Transition,\n  type Variants,\n} from 'motion/react';\nimport { useEffect, useId, useState } from 'react';\n\nimport { usePrefersReducedMotion } from '@/registry/ndeko/hooks/use-prefers-reduced-motion';\nimport {\n  CheckIcon,\n  LoaderCircleIcon,\n  type Icon,\n} from '@/registry/ndeko/lib/icons';\nimport { AnimatedSize } from '@/registry/ndeko/ui/animated-size';\nimport { Button } from '@/registry/ndeko/ui/button';\nimport { Input, type InputProps } from '@/registry/ndeko/ui/input';\nimport {\n  Select,\n  SelectContent,\n  SelectItem,\n  SelectTrigger,\n  SelectValue,\n} from '@/registry/ndeko/ui/select';\nimport { Switch } from '@/registry/ndeko/ui/switch';\n\nexport const SETTINGS_SURFACE_BASE =\n  'bg-card hairline-ring ring-border rounded-xl shadow-[0_1px_2px_rgb(0_0_0/0.04)] dark:bg-foreground/[0.03]';\n\nexport const SETTINGS_SURFACE = `${SETTINGS_SURFACE_BASE} hairline-divide-y divide-border`;\n\nconst ROW_LABEL = 'text-[13px] font-medium';\n\nconst SAVE_DELAY_MS = 800;\n\nconst SAVED_HOLD_MS = 1100;\n\nconst SWAP_TRANSITION: Transition = { duration: 0.15, ease: [0.2, 0, 0, 1] };\n\nconst THUMB_TRAVEL: Transition = { duration: 0.2, ease: [0.2, 0, 0, 1] };\n\nconst INSTANT: Transition = { duration: 0 };\n\nconst ENTER: Transition = { duration: 0.2, ease: [0.23, 1, 0.32, 1] };\n\nconst LEAVE: Transition = { duration: 0.14, ease: [0.23, 1, 0.32, 1] };\n\nconst SWAP_VARIANTS: Variants = {\n  enter: { opacity: 0, scale: 0.6, filter: 'blur(2px)' },\n  visible: { opacity: 1, scale: 1, filter: 'blur(0px)' },\n  exit: { opacity: 0, scale: 0.6, filter: 'blur(2px)' },\n};\n\nconst BAR_VARIANTS: Variants = {\n  enter: { opacity: 0, y: 12, scale: 0.98 },\n  visible: { opacity: 1, y: 0, scale: 1, transition: ENTER },\n  exit: { opacity: 0, y: 8, scale: 0.98, transition: LEAVE },\n};\n\nconst PANEL_VARIANTS: Variants = {\n  enter: { opacity: 0, y: 4 },\n  visible: { opacity: 1, y: 0, transition: ENTER },\n};\n\nconst DOT_VARIANTS: Variants = {\n  enter: { opacity: 0, scale: 0.4 },\n  visible: { opacity: 1, scale: 1, transition: ENTER },\n  exit: { opacity: 0, scale: 0.4, transition: LEAVE },\n};\n\nconst ERROR_VARIANTS: Variants = {\n  enter: { height: 0, opacity: 0 },\n  visible: { height: 'auto', opacity: 1, transition: ENTER },\n  exit: { height: 0, opacity: 0, transition: LEAVE },\n};\n\nconst FADE_VARIANTS: Variants = {\n  enter: { opacity: 0 },\n  visible: { opacity: 1, transition: ENTER },\n  exit: { opacity: 0, transition: LEAVE },\n};\n\nfunction swapVariantsOf(shouldReduceMotion: boolean | null) {\n  if (shouldReduceMotion) {\n    return FADE_VARIANTS;\n  }\n  return SWAP_VARIANTS;\n}\n\nfunction barVariantsOf(shouldReduceMotion: boolean | null) {\n  if (shouldReduceMotion) {\n    return FADE_VARIANTS;\n  }\n  return BAR_VARIANTS;\n}\n\nfunction panelVariantsOf(shouldReduceMotion: boolean | null) {\n  if (shouldReduceMotion) {\n    return FADE_VARIANTS;\n  }\n  return PANEL_VARIANTS;\n}\n\nfunction errorVariantsOf(shouldReduceMotion: boolean | null) {\n  if (shouldReduceMotion) {\n    return FADE_VARIANTS;\n  }\n  return ERROR_VARIANTS;\n}\n\nexport function describedByOf(hasError: boolean, errorId: string) {\n  if (hasError) {\n    return errorId;\n  }\n  return undefined;\n}\n\nfunction thumbTravelOf(shouldReduceMotion: boolean | null) {\n  if (shouldReduceMotion) {\n    return INSTANT;\n  }\n  return THUMB_TRAVEL;\n}\n\nfunction dotVariantsOf(shouldReduceMotion: boolean | null) {\n  if (shouldReduceMotion) {\n    return FADE_VARIANTS;\n  }\n  return DOT_VARIANTS;\n}\n\nexport type SaveStatus = 'idle' | 'saving' | 'saved';\n\ntype SettingsValues = Record<string, unknown>;\n\nfunction changedKeysOf<Values extends SettingsValues>(\n  saved: Values,\n  draft: Values\n) {\n  const keys = Object.keys(saved);\n  return keys.filter((key) => !Object.is(saved[key], draft[key]));\n}\n\n/** An edit made while Saved is still showing starts a new round of changes. */\nfunction statusAfterEditOf(current: SaveStatus): SaveStatus {\n  if (current === 'saved') {\n    return 'idle';\n  }\n  return current;\n}\n\n/**\n * Keeps the saved values and the draft apart. Saving stands in for a request with a fixed\n * delay, then holds the Saved state long enough to be read. The shell hears each save, so a\n * page opened again starts from what was saved.\n */\nexport function useSettingsDraft<Values extends SettingsValues>(\n  initialValues: Values,\n  onSaved: (values: Values) => void\n) {\n  const [savedValues, setSavedValues] = useState(initialValues);\n  const [draft, setDraft] = useState(initialValues);\n  const [pending, setPending] = useState<Values | null>(null);\n  const [status, setStatus] = useState<SaveStatus>('idle');\n  const changedKeys = changedKeysOf(savedValues, draft);\n  const hasChanges = changedKeys.length > 0;\n  const isSettled = status === 'idle';\n  const isBarShown = hasChanges || !isSettled;\n\n  useEffect(() => {\n    if (status !== 'saving') {\n      return;\n    }\n    const timer = window.setTimeout(() => {\n      if (pending) {\n        setSavedValues(pending);\n        onSaved(pending);\n      }\n      setStatus('saved');\n    }, SAVE_DELAY_MS);\n    return () => window.clearTimeout(timer);\n  }, [status, pending, onSaved]);\n\n  useEffect(() => {\n    if (status !== 'saved') {\n      return;\n    }\n    const timer = window.setTimeout(() => setStatus('idle'), SAVED_HOLD_MS);\n    return () => window.clearTimeout(timer);\n  }, [status]);\n\n  function change<Key extends keyof Values>(key: Key, value: Values[Key]) {\n    setDraft((previous) => ({ ...previous, [key]: value }));\n    setStatus(statusAfterEditOf);\n  }\n\n  function discard() {\n    setDraft(savedValues);\n  }\n\n  function save() {\n    if (status === 'saving') {\n      return;\n    }\n    setPending(draft);\n    setStatus('saving');\n  }\n\n  return {\n    savedValues,\n    draft,\n    changedKeys,\n    status,\n    isBarShown,\n    change,\n    discard,\n    save,\n  };\n}\n\nexport function hasChangeIn(changedKeys: string[], sectionKeys: string[]) {\n  return sectionKeys.some((key) => changedKeys.includes(key));\n}\n\ntype SettingsPageProps = {\n  title: string;\n  line: string;\n  bar: React.ReactNode;\n  children: React.ReactNode;\n};\n\nexport function SettingsPage({\n  title,\n  line,\n  bar,\n  children,\n}: SettingsPageProps) {\n  return (\n    <div className='flex min-h-0 w-full flex-1 flex-col overflow-y-auto'>\n      <div className='mx-auto flex w-full max-w-4xl flex-1 flex-col gap-6 px-4 py-8 md:gap-8 md:px-6 md:py-10'>\n        <header className='flex flex-col gap-1'>\n          <h1 className='text-2xl font-semibold text-balance sm:text-3xl'>\n            {title}\n          </h1>\n          <p className='text-muted-foreground text-[13px] text-pretty'>\n            {line}\n          </p>\n        </header>\n        {children}\n      </div>\n      {bar}\n    </div>\n  );\n}\n\nexport type NavItem<Id extends string> = {\n  id: Id;\n  label: string;\n  icon: Icon;\n  hasChanges: boolean;\n};\n\nfunction UnsavedDot({ isShown }: { isShown: boolean }) {\n  const shouldReduceMotion = usePrefersReducedMotion();\n  const variants = dotVariantsOf(shouldReduceMotion);\n\n  return (\n    <AnimatePresence initial={false}>\n      {isShown && (\n        <motion.span\n          key='dot'\n          variants={variants}\n          initial='enter'\n          animate='visible'\n          exit='exit'\n          className='bg-primary ml-auto size-1.5 shrink-0 rounded-full'\n        >\n          <span className='sr-only'>Unsaved changes</span>\n        </motion.span>\n      )}\n    </AnimatePresence>\n  );\n}\n\ntype SectionTabsProps<Id extends string> = {\n  label: string;\n  items: NavItem<Id>[];\n  value: Id;\n  onValueChange: (id: Id) => void;\n  children: React.ReactNode;\n};\n\n/** Sections as tabs: a rail beside the column on wide screens, a row above it on phones. One highlight travels between them. */\nexport function SectionTabs<Id extends string>({\n  label,\n  items,\n  value,\n  onValueChange,\n  children,\n}: SectionTabsProps<Id>) {\n  function changeValue(nextValue: unknown) {\n    const item = items.find((candidate) => candidate.id === nextValue);\n    if (item) {\n      onValueChange(item.id);\n    }\n  }\n\n  return (\n    <TabsPrimitive.Root\n      value={value}\n      onValueChange={changeValue}\n      orientation='vertical'\n      className='flex flex-col gap-6 md:grid md:grid-cols-[11rem_minmax(0,42rem)] md:items-start md:gap-10'\n    >\n      <TabsPrimitive.List\n        aria-label={label}\n        className='relative -mx-4 flex gap-1 overflow-x-auto px-4 md:sticky md:top-10 md:mx-0 md:flex-col md:overflow-visible md:px-0'\n      >\n        {items.map((item) => {\n          const ItemIcon = item.icon;\n\n          return (\n            <TabsPrimitive.Tab\n              key={item.id}\n              value={item.id}\n              className='text-muted-foreground hover:text-foreground data-active:text-foreground focus-visible:ring-ring/25 relative z-10 flex h-8 shrink-0 cursor-pointer items-center gap-2 rounded-md px-2.5 text-left text-[13px] font-medium whitespace-nowrap transition-colors duration-150 outline-none focus-visible:ring-[3px] [&_svg]:size-4 [&_svg]:shrink-0'\n            >\n              <ItemIcon />\n              {item.label}\n              <UnsavedDot isShown={item.hasChanges} />\n            </TabsPrimitive.Tab>\n          );\n        })}\n        <TabsPrimitive.Indicator className='bg-foreground/[0.06] pointer-events-none absolute top-0 left-0 h-(--active-tab-height) w-(--active-tab-width) translate-x-(--active-tab-left) translate-y-(--active-tab-top) rounded-md transition-[translate,width,height] duration-[250ms] ease-(--ease-in-out-strong)' />\n      </TabsPrimitive.List>\n      {children}\n    </TabsPrimitive.Root>\n  );\n}\n\ntype SectionPanelProps = {\n  value: string;\n  /** False on the section shown at first, so nothing moves on load. */\n  animatesIn: boolean;\n  children: React.ReactNode;\n};\n\nfunction panelInitialOf(animatesIn: boolean) {\n  if (animatesIn) {\n    return 'enter';\n  }\n  return false;\n}\n\nexport function SectionPanel({\n  value,\n  animatesIn,\n  children,\n}: SectionPanelProps) {\n  const shouldReduceMotion = usePrefersReducedMotion();\n  const variants = panelVariantsOf(shouldReduceMotion);\n  const initial = panelInitialOf(animatesIn);\n\n  return (\n    <TabsPrimitive.Panel\n      value={value}\n      className='focus-visible:ring-ring/25 rounded-xl outline-none focus-visible:ring-[3px]'\n    >\n      <motion.div\n        variants={variants}\n        initial={initial}\n        animate='visible'\n        className='flex flex-col gap-8'\n      >\n        {children}\n      </motion.div>\n    </TabsPrimitive.Panel>\n  );\n}\n\ntype SettingsSectionProps = {\n  title: string;\n  line?: string;\n  action?: React.ReactNode;\n  children: React.ReactNode;\n};\n\nexport function SettingsSection({\n  title,\n  line,\n  action,\n  children,\n}: SettingsSectionProps) {\n  const headingId = useId();\n\n  return (\n    <section aria-labelledby={headingId} className='flex flex-col gap-3'>\n      <div className='flex items-end justify-between gap-3'>\n        <div className='flex flex-col gap-0.5'>\n          <h2 id={headingId} className='text-sm font-medium'>\n            {title}\n          </h2>\n          {line && <p className='text-muted-foreground text-xs'>{line}</p>}\n        </div>\n        {action}\n      </div>\n      <div className={SETTINGS_SURFACE}>{children}</div>\n    </section>\n  );\n}\n\ntype SettingsRowProps = {\n  label: string;\n  line: React.ReactNode;\n  labelId?: string;\n  lineId?: string;\n  htmlFor?: string;\n  children: React.ReactNode;\n};\n\nexport function SettingsRow({\n  label,\n  line,\n  labelId,\n  lineId,\n  htmlFor,\n  children,\n}: SettingsRowProps) {\n  return (\n    <div className='flex min-h-14 flex-col gap-3 px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:gap-6'>\n      <div className='flex min-w-0 flex-col gap-0.5'>\n        {htmlFor && (\n          <label id={labelId} htmlFor={htmlFor} className={ROW_LABEL}>\n            {label}\n          </label>\n        )}\n        {!htmlFor && (\n          <p id={labelId} className={ROW_LABEL}>\n            {label}\n          </p>\n        )}\n        <p id={lineId} className='text-muted-foreground text-xs'>\n          {line}\n        </p>\n      </div>\n      <div className='flex shrink-0 flex-col sm:items-end'>{children}</div>\n    </div>\n  );\n}\n\nfunction saveLabelOf(status: SaveStatus) {\n  if (status === 'saving') {\n    return 'Saving';\n  }\n  if (status === 'saved') {\n    return 'Saved';\n  }\n  return 'Save changes';\n}\n\nfunction saveGlyphOf(status: SaveStatus) {\n  if (status === 'saving') {\n    return {\n      key: 'saving',\n      icon: <LoaderCircleIcon className='animate-spin' />,\n    };\n  }\n  if (status === 'saved') {\n    return { key: 'saved', icon: <CheckIcon /> };\n  }\n  return null;\n}\n\ntype SaveButtonProps = {\n  status: SaveStatus;\n  onSave: () => void;\n};\n\n/** The label becomes its next state and the pill resizes to it: Save changes, Saving, Saved. */\nfunction SaveButton({ status, onSave }: SaveButtonProps) {\n  const shouldReduceMotion = usePrefersReducedMotion();\n  const variants = swapVariantsOf(shouldReduceMotion);\n  const label = saveLabelOf(status);\n  const glyph = saveGlyphOf(status);\n  const isBusy = status !== 'idle';\n\n  return (\n    <Button\n      size='sm'\n      disabled={isBusy}\n      focusableWhenDisabled\n      onClick={onSave}\n      className='data-disabled:opacity-100'\n    >\n      <AnimatedSize\n        as='span'\n        axis='width'\n        contentClassName='relative flex items-center gap-1.5'\n      >\n        <AnimatePresence mode='popLayout' initial={false}>\n          {glyph && (\n            <motion.span\n              key={glyph.key}\n              variants={variants}\n              initial='enter'\n              animate='visible'\n              exit='exit'\n              transition={SWAP_TRANSITION}\n              className='flex'\n            >\n              {glyph.icon}\n            </motion.span>\n          )}\n        </AnimatePresence>\n        <AnimatePresence mode='popLayout' initial={false}>\n          <motion.span\n            key={label}\n            variants={variants}\n            initial='enter'\n            animate='visible'\n            exit='exit'\n            transition={SWAP_TRANSITION}\n          >\n            {label}\n          </motion.span>\n        </AnimatePresence>\n      </AnimatedSize>\n    </Button>\n  );\n}\n\nfunction changeCountLabelOf(count: number) {\n  if (count === 1) {\n    return '1 unsaved change';\n  }\n  return `${count} unsaved changes`;\n}\n\nfunction barMessageOf(status: SaveStatus, changeCount: number) {\n  if (status === 'saved') {\n    return 'All changes saved';\n  }\n  return changeCountLabelOf(changeCount);\n}\n\ntype UnsavedBarProps = {\n  isShown: boolean;\n  status: SaveStatus;\n  changeCount: number;\n  /** Replaces the count, for example to say what blocks the save. */\n  message?: string;\n  onDiscard: () => void;\n  onSave: () => void;\n};\n\nexport function UnsavedBar({\n  isShown,\n  status,\n  changeCount,\n  message,\n  onDiscard,\n  onSave,\n}: UnsavedBarProps) {\n  const shouldReduceMotion = usePrefersReducedMotion();\n  const variants = barVariantsOf(shouldReduceMotion);\n  const defaultText = barMessageOf(status, changeCount);\n  const text = message ?? defaultText;\n  const isBusy = status !== 'idle';\n\n  return (\n    <div className='pointer-events-none sticky bottom-0 z-20 flex justify-center px-4 pb-4'>\n      <AnimatePresence initial={false}>\n        {isShown && (\n          <motion.div\n            key='unsaved-bar'\n            role='region'\n            aria-label='Unsaved changes'\n            variants={variants}\n            initial='enter'\n            animate='visible'\n            exit='exit'\n            className='surface-raised pointer-events-auto flex w-full max-w-md items-center gap-2 rounded-full py-1.5 pr-1.5 pl-4'\n          >\n            <p\n              role='status'\n              className='min-w-0 flex-1 truncate text-[13px] tabular-nums'\n            >\n              {text}\n            </p>\n            <Button\n              variant='ghost'\n              size='sm'\n              disabled={isBusy}\n              onClick={onDiscard}\n            >\n              Discard\n            </Button>\n            <SaveButton status={status} onSave={onSave} />\n          </motion.div>\n        )}\n      </AnimatePresence>\n    </div>\n  );\n}\n\nexport type ChoiceOption<Value extends string> = {\n  value: Value;\n  label: string;\n};\n\ntype SegmentedChoiceProps<Value extends string> = {\n  options: ChoiceOption<Value>[];\n  value: Value;\n  labelledBy?: string;\n  describedBy?: string;\n  disabled?: boolean;\n  onValueChange: (value: Value) => void;\n};\n\n/** A setting with two to four values as one segmented radio group. The thumb slides to the picked value. */\nexport function SegmentedChoice<Value extends string>({\n  options,\n  value,\n  labelledBy,\n  describedBy,\n  disabled,\n  onValueChange,\n}: SegmentedChoiceProps<Value>) {\n  const shouldReduceMotion = usePrefersReducedMotion();\n  const travel = thumbTravelOf(shouldReduceMotion);\n  const thumbId = useId();\n\n  function changeValue(nextValue: unknown) {\n    const option = options.find((candidate) => candidate.value === nextValue);\n    if (option) {\n      onValueChange(option.value);\n    }\n  }\n\n  return (\n    <RadioGroupPrimitive\n      value={value}\n      onValueChange={changeValue}\n      disabled={disabled}\n      aria-labelledby={labelledBy}\n      aria-describedby={describedBy}\n      className='bg-foreground/[0.05] inline-flex w-fit items-center gap-0.5 rounded-lg p-0.5 data-disabled:opacity-50'\n    >\n      {options.map((option) => {\n        const isPicked = option.value === value;\n\n        return (\n          <RadioPrimitive.Root\n            key={option.value}\n            value={option.value}\n            className='text-muted-foreground hover:text-foreground data-checked:text-foreground focus-visible:ring-ring/25 relative inline-flex h-7 cursor-pointer items-center justify-center rounded-md px-3 text-[13px] font-medium whitespace-nowrap transition-colors duration-150 outline-none focus-visible:ring-[3px] data-disabled:cursor-not-allowed'\n          >\n            {isPicked && (\n              <motion.span\n                aria-hidden='true'\n                layoutId={thumbId}\n                transition={travel}\n                className='bg-card hairline-ring ring-foreground/10 dark:bg-foreground/[0.09] absolute inset-0 rounded-md shadow-[0_1px_2px_rgb(0_0_0/0.08)]'\n              />\n            )}\n            <span className='relative'>{option.label}</span>\n          </RadioPrimitive.Root>\n        );\n      })}\n    </RadioGroupPrimitive>\n  );\n}\n\ntype ErrorPresenceProps = {\n  id: string;\n  error?: string | null;\n};\n\n/** A field error that grows in under its control and folds away once the person types again. */\nexport function ErrorPresence({ id, error }: ErrorPresenceProps) {\n  const shouldReduceMotion = usePrefersReducedMotion();\n  const variants = errorVariantsOf(shouldReduceMotion);\n\n  return (\n    <AnimatePresence initial={false}>\n      {error && (\n        <motion.p\n          key='error'\n          id={id}\n          variants={variants}\n          initial='enter'\n          animate='visible'\n          exit='exit'\n          className='text-destructive-ink overflow-hidden text-xs sm:max-w-64 sm:text-right'\n        >\n          <span className='block pt-1.5'>{error}</span>\n        </motion.p>\n      )}\n    </AnimatePresence>\n  );\n}\n\ntype TextRowProps = Pick<\n  InputProps,\n  'type' | 'autoComplete' | 'inputMode' | 'placeholder' | 'maxLength'\n> & {\n  label: string;\n  line: string;\n  value: string;\n  error?: string;\n  inputId?: string;\n  onValueChange: (value: string) => void;\n};\n\nexport function TextRow({\n  label,\n  line,\n  value,\n  error,\n  inputId,\n  onValueChange,\n  ...inputProps\n}: TextRowProps) {\n  const generatedId = useId();\n  const errorId = useId();\n  const id = inputId ?? generatedId;\n  const hasError = Boolean(error);\n  const describedBy = describedByOf(hasError, errorId);\n\n  function changeValue(event: React.ChangeEvent<HTMLInputElement>) {\n    onValueChange(event.target.value);\n  }\n\n  return (\n    <SettingsRow label={label} line={line} htmlFor={id}>\n      <Input\n        id={id}\n        value={value}\n        aria-invalid={hasError}\n        aria-describedby={describedBy}\n        onChange={changeValue}\n        className='w-full sm:w-64'\n        {...inputProps}\n      />\n      <ErrorPresence id={errorId} error={error} />\n    </SettingsRow>\n  );\n}\n\ntype SwitchRowProps = {\n  label: string;\n  line: React.ReactNode;\n  checked: boolean;\n  disabled?: boolean;\n  onCheckedChange: (checked: boolean) => void;\n};\n\nexport function SwitchRow({\n  label,\n  line,\n  checked,\n  disabled,\n  onCheckedChange,\n}: SwitchRowProps) {\n  const labelId = useId();\n  const lineId = useId();\n\n  return (\n    <SettingsRow label={label} line={line} labelId={labelId} lineId={lineId}>\n      <Switch\n        checked={checked}\n        disabled={disabled}\n        onCheckedChange={onCheckedChange}\n        aria-labelledby={labelId}\n        aria-describedby={lineId}\n      />\n    </SettingsRow>\n  );\n}\n\ntype SelectOption = { value: string; label: string };\n\ntype SelectRowProps = {\n  label: string;\n  line: React.ReactNode;\n  value: string;\n  options: SelectOption[];\n  disabled?: boolean;\n  onValueChange: (value: string) => void;\n};\n\nexport function SelectRow({\n  label,\n  line,\n  value,\n  options,\n  disabled,\n  onValueChange,\n}: SelectRowProps) {\n  const labelId = useId();\n\n  function changeValue(nextValue: unknown) {\n    const option = options.find((candidate) => candidate.value === nextValue);\n    if (option) {\n      onValueChange(option.value);\n    }\n  }\n\n  return (\n    <SettingsRow label={label} line={line} labelId={labelId}>\n      <Select\n        items={options}\n        value={value}\n        disabled={disabled}\n        onValueChange={changeValue}\n      >\n        <SelectTrigger aria-labelledby={labelId} className='w-full sm:w-64'>\n          <SelectValue />\n        </SelectTrigger>\n        <SelectContent align='end'>\n          {options.map((option) => (\n            <SelectItem key={option.value} value={option.value}>\n              {option.label}\n            </SelectItem>\n          ))}\n        </SelectContent>\n      </Select>\n    </SettingsRow>\n  );\n}\n\ntype ChoiceRowProps<Value extends string> = {\n  label: string;\n  line: React.ReactNode;\n  value: Value;\n  options: ChoiceOption<Value>[];\n  disabled?: boolean;\n  onValueChange: (value: Value) => void;\n};\n\nexport function ChoiceRow<Value extends string>({\n  label,\n  line,\n  value,\n  options,\n  disabled,\n  onValueChange,\n}: ChoiceRowProps<Value>) {\n  const labelId = useId();\n  const lineId = useId();\n\n  return (\n    <SettingsRow label={label} line={line} labelId={labelId} lineId={lineId}>\n      <SegmentedChoice\n        options={options}\n        value={value}\n        labelledBy={labelId}\n        describedBy={lineId}\n        disabled={disabled}\n        onValueChange={onValueChange}\n      />\n    </SettingsRow>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-03/settings-kit.tsx"
    },
    {
      "path": "registry/ndeko/templates/settings/application-03/data.ts",
      "content": "import {\n  BellIcon,\n  MailIcon,\n  MonitorIcon,\n  SettingsIcon,\n  SmartphoneIcon,\n  UserIcon,\n  type Icon,\n} from '@/registry/ndeko/lib/icons';\n\nexport type PageId = 'profile' | 'notifications' | 'workspace';\n\nexport type Entity = {\n  id: string;\n  name: string;\n  color: string;\n};\n\nexport type Workspace = {\n  id: string;\n  name: string;\n  memberCount: number;\n};\n\nexport type NavItem = {\n  id: PageId;\n  label: string;\n  icon: Icon;\n};\n\nexport type NavGroup = {\n  id: string;\n  label?: string;\n  team?: Entity;\n  items: NavItem[];\n};\n\nexport type Person = {\n  id: string;\n  name: string;\n  role: string;\n  /** The uploaded profile photo, when there is one. */\n  avatar?: string;\n};\n\nexport const WORKSPACE_ID = 'lattice';\n\nexport const CURRENT_USER_ID = 'amara';\n\nexport const PEOPLE: Person[] = [\n  {\n    id: 'amara',\n    name: 'Amara Okafor',\n    role: 'Product designer',\n  },\n  {\n    id: 'lucas',\n    name: 'Lucas Moreau',\n    role: 'Engineering lead',\n  },\n  {\n    id: 'priya',\n    name: 'Priya Raman',\n    role: 'Frontend engineer',\n  },\n  {\n    id: 'mateo',\n    name: 'Mateo Silva',\n    role: 'Backend engineer',\n  },\n  {\n    id: 'hana',\n    name: 'Hana Kobayashi',\n    role: 'Product manager',\n  },\n  {\n    id: 'jonas',\n    name: 'Jonas Weber',\n    role: 'QA engineer',\n  },\n];\n\nexport const SETTINGS_GROUPS: NavGroup[] = [\n  {\n    id: 'account',\n    label: 'Account',\n    items: [\n      { id: 'profile', label: 'Profile', icon: UserIcon },\n      { id: 'notifications', label: 'Notifications', icon: BellIcon },\n    ],\n  },\n  {\n    id: 'workspace',\n    label: 'Workspace',\n    items: [{ id: 'workspace', label: 'General', icon: SettingsIcon }],\n  },\n];\n\nexport type ProfileSectionId = 'profile' | 'contact' | 'region';\n\nexport type WeekStart = 'monday' | 'sunday';\n\nexport type TimeFormat = '24h' | '12h';\n\nexport type ProfileValues = {\n  photo: string;\n  name: string;\n  username: string;\n  title: string;\n  bio: string;\n  email: string;\n  phone: string;\n  showEmail: boolean;\n  language: string;\n  timeZone: string;\n  weekStart: WeekStart;\n  timeFormat: TimeFormat;\n};\n\nexport type ProfileField = keyof ProfileValues;\n\nexport const INITIAL_PROFILE: ProfileValues = {\n  photo: '',\n  name: 'Amara Okafor',\n  username: 'amara',\n  title: 'Product designer',\n  bio: 'Designs the onboarding and the reports. Ask me about empty states.',\n  email: 'amara.okafor@lattice.example',\n  phone: '',\n  showEmail: true,\n  language: 'en-GB',\n  timeZone: 'africa-lagos',\n  weekStart: 'monday',\n  timeFormat: '24h',\n};\n\nexport const PROFILE_HOST = 'lattice.example/';\n\nexport const BIO_MAX_LENGTH = 160;\n\nconst MEGABYTE = 1024 * 1024;\n\nexport const PHOTO_MAX_BYTES = 2 * MEGABYTE;\n\nexport const PHOTO_TYPES = ['image/png', 'image/jpeg', 'image/webp'];\n\nexport const PROFILE_SECTION_KEYS: Record<ProfileSectionId, ProfileField[]> = {\n  profile: ['photo', 'name', 'username', 'title', 'bio'],\n  contact: ['email', 'phone', 'showEmail'],\n  region: ['language', 'timeZone', 'weekStart', 'timeFormat'],\n};\n\nexport const LANGUAGES = [\n  { value: 'en-GB', label: 'English (United Kingdom)' },\n  { value: 'en-US', label: 'English (United States)' },\n  { value: 'fr-FR', label: 'Français' },\n  { value: 'pt-PT', label: 'Português' },\n  { value: 'sw', label: 'Kiswahili' },\n];\n\nexport const TIME_ZONES = [\n  { value: 'africa-lagos', label: 'Lagos, West Africa Time' },\n  { value: 'africa-kinshasa', label: 'Kinshasa, West Africa Time' },\n  { value: 'europe-london', label: 'London, Greenwich Mean Time' },\n  { value: 'europe-paris', label: 'Paris, Central European Time' },\n  { value: 'america-new-york', label: 'New York, Eastern Time' },\n  { value: 'asia-tokyo', label: 'Tokyo, Japan Standard Time' },\n];\n\nexport const WEEK_STARTS: { value: WeekStart; label: string }[] = [\n  { value: 'monday', label: 'Monday' },\n  { value: 'sunday', label: 'Sunday' },\n];\n\nexport const TIME_FORMATS: { value: TimeFormat; label: string }[] = [\n  { value: '24h', label: '24-hour' },\n  { value: '12h', label: '12-hour' },\n];\n\nexport const TIME_FORMAT_SAMPLE: Record<TimeFormat, string> = {\n  '24h': 'A meeting at half past two shows as 14:30',\n  '12h': 'A meeting at half past two shows as 2:30 PM',\n};\n\nexport type ChannelId = 'email' | 'push' | 'desktop';\n\nexport type Delivery = 'instant' | 'hourly' | 'daily';\n\nexport type NotificationValues = {\n  emailOn: boolean;\n  emailMentions: boolean;\n  emailAssigned: boolean;\n  emailComments: boolean;\n  emailStatus: boolean;\n  emailDue: boolean;\n  emailWeekly: boolean;\n  emailDelivery: Delivery;\n  pushOn: boolean;\n  pushMentions: boolean;\n  pushAssigned: boolean;\n  pushComments: boolean;\n  pushDue: boolean;\n  quietHours: boolean;\n  quietFrom: string;\n  quietTo: string;\n  desktopOn: boolean;\n  desktopMentions: boolean;\n  desktopAssigned: boolean;\n  desktopComments: boolean;\n  desktopStatus: boolean;\n  desktopSound: boolean;\n  desktopPreview: boolean;\n};\n\nexport type NotificationKey = keyof NotificationValues;\n\nexport type SwitchKey = Exclude<\n  NotificationKey,\n  'emailDelivery' | 'quietFrom' | 'quietTo'\n>;\n\nexport type ChannelEvent = {\n  key: SwitchKey;\n  label: string;\n  line: string;\n};\n\nexport type Channel = {\n  id: ChannelId;\n  label: string;\n  icon: Icon;\n  masterKey: SwitchKey;\n  masterLabel: string;\n  masterLine: string;\n  eventsTitle: string;\n  offLine: string;\n  keys: NotificationKey[];\n  events: ChannelEvent[];\n};\n\nexport const INITIAL_NOTIFICATIONS: NotificationValues = {\n  emailOn: true,\n  emailMentions: true,\n  emailAssigned: true,\n  emailComments: false,\n  emailStatus: false,\n  emailDue: true,\n  emailWeekly: true,\n  emailDelivery: 'hourly',\n  pushOn: true,\n  pushMentions: true,\n  pushAssigned: true,\n  pushComments: true,\n  pushDue: false,\n  quietHours: true,\n  quietFrom: '21:00',\n  quietTo: '08:00',\n  desktopOn: false,\n  desktopMentions: true,\n  desktopAssigned: true,\n  desktopComments: false,\n  desktopStatus: false,\n  desktopSound: false,\n  desktopPreview: true,\n};\n\nexport const CHANNELS: Channel[] = [\n  {\n    id: 'email',\n    label: 'Email',\n    icon: MailIcon,\n    masterKey: 'emailOn',\n    masterLabel: 'Email notifications',\n    masterLine: 'Sent to amara.okafor@lattice.example',\n    eventsTitle: 'What reaches your inbox',\n    offLine: 'Email is off. Turn it on to choose what reaches your inbox',\n    keys: [\n      'emailOn',\n      'emailMentions',\n      'emailAssigned',\n      'emailComments',\n      'emailStatus',\n      'emailDue',\n      'emailWeekly',\n      'emailDelivery',\n    ],\n    events: [\n      {\n        key: 'emailMentions',\n        label: 'Mentions',\n        line: 'Someone writes @amara in a task or a comment',\n      },\n      {\n        key: 'emailAssigned',\n        label: 'Assigned to you',\n        line: 'A task lands on your list',\n      },\n      {\n        key: 'emailComments',\n        label: 'Comments on your tasks',\n        line: 'Replies on tasks you created or own',\n      },\n      {\n        key: 'emailStatus',\n        label: 'Status changes',\n        line: 'Tasks you follow move to another status',\n      },\n      {\n        key: 'emailDue',\n        label: 'Due date reminders',\n        line: 'The morning a task of yours is due',\n      },\n      {\n        key: 'emailWeekly',\n        label: 'Weekly summary',\n        line: 'Monday morning: your hours and what closed last week',\n      },\n    ],\n  },\n  {\n    id: 'push',\n    label: 'Mobile push',\n    icon: SmartphoneIcon,\n    masterKey: 'pushOn',\n    masterLabel: 'Push notifications',\n    masterLine: 'On the 2 phones signed in to Lattice Studio',\n    eventsTitle: 'What buzzes your phone',\n    offLine: 'Push is off. Turn it on to choose what reaches your phone',\n    keys: [\n      'pushOn',\n      'pushMentions',\n      'pushAssigned',\n      'pushComments',\n      'pushDue',\n      'quietHours',\n      'quietFrom',\n      'quietTo',\n    ],\n    events: [\n      {\n        key: 'pushMentions',\n        label: 'Mentions',\n        line: 'Someone writes @amara in a task or a comment',\n      },\n      {\n        key: 'pushAssigned',\n        label: 'Assigned to you',\n        line: 'A task lands on your list',\n      },\n      {\n        key: 'pushComments',\n        label: 'Comments on your tasks',\n        line: 'Replies on tasks you created or own',\n      },\n      {\n        key: 'pushDue',\n        label: 'Due date reminders',\n        line: 'An hour before a task of yours is due',\n      },\n    ],\n  },\n  {\n    id: 'desktop',\n    label: 'Desktop',\n    icon: MonitorIcon,\n    masterKey: 'desktopOn',\n    masterLabel: 'Desktop notifications',\n    masterLine: 'In this browser while Lattice Studio is open',\n    eventsTitle: 'What pops up on screen',\n    offLine: 'Desktop is off. Turn it on to choose what pops up on screen',\n    keys: [\n      'desktopOn',\n      'desktopMentions',\n      'desktopAssigned',\n      'desktopComments',\n      'desktopStatus',\n      'desktopSound',\n      'desktopPreview',\n    ],\n    events: [\n      {\n        key: 'desktopMentions',\n        label: 'Mentions',\n        line: 'Someone writes @amara in a task or a comment',\n      },\n      {\n        key: 'desktopAssigned',\n        label: 'Assigned to you',\n        line: 'A task lands on your list',\n      },\n      {\n        key: 'desktopComments',\n        label: 'Comments on your tasks',\n        line: 'Replies on tasks you created or own',\n      },\n      {\n        key: 'desktopStatus',\n        label: 'Status changes',\n        line: 'Tasks you follow move to another status',\n      },\n    ],\n  },\n];\n\nexport const DELIVERIES: { value: Delivery; label: string }[] = [\n  { value: 'instant', label: 'Instant' },\n  { value: 'hourly', label: 'Hourly' },\n  { value: 'daily', label: 'Daily' },\n];\n\nexport const DELIVERY_LINE: Record<Delivery, string> = {\n  instant: 'One email per notification, as it happens',\n  hourly: 'One email an hour at most, grouping what happened',\n  daily: 'One email at 8:00 with the day before',\n};\n\nexport const QUIET_TIMES = [\n  { value: '18:00', label: '18:00' },\n  { value: '19:00', label: '19:00' },\n  { value: '20:00', label: '20:00' },\n  { value: '21:00', label: '21:00' },\n  { value: '22:00', label: '22:00' },\n  { value: '23:00', label: '23:00' },\n  { value: '06:00', label: '06:00' },\n  { value: '07:00', label: '07:00' },\n  { value: '08:00', label: '08:00' },\n  { value: '09:00', label: '09:00' },\n];\n\nexport type WorkspaceSectionId = 'general' | 'members' | 'danger';\n\nexport type Role = 'member' | 'viewer' | 'guest';\n\nexport type InvitePolicy = 'admins' | 'admins-members';\n\nexport type WorkspaceValues = {\n  name: string;\n  slug: string;\n  timeZone: string;\n  defaultRole: Role;\n  invitePolicy: InvitePolicy;\n  approveJoins: boolean;\n  allowedDomain: string;\n};\n\nexport type WorkspaceField = keyof WorkspaceValues;\n\nexport type RoleOption = {\n  value: Role;\n  label: string;\n  line: string;\n  /** How many people hold the role today, so the choice reads against real numbers. */\n  holders: number;\n};\n\nexport const INITIAL_WORKSPACE: WorkspaceValues = {\n  name: 'Lattice Studio',\n  slug: 'lattice-studio',\n  timeZone: 'africa-lagos',\n  defaultRole: 'member',\n  invitePolicy: 'admins-members',\n  approveJoins: true,\n  allowedDomain: 'lattice.example',\n};\n\nexport const WORKSPACE_HOST = 'app.lattice.example/';\n\nexport const WORKSPACE_FACTS = {\n  members: 14,\n  projects: 6,\n  tasks: 1284,\n  graceDays: 14,\n  deletionDate: '19 November 2026',\n};\n\nexport const WORKSPACE_SECTION_KEYS: Record<\n  WorkspaceSectionId,\n  WorkspaceField[]\n> = {\n  general: ['name', 'slug', 'timeZone'],\n  members: ['defaultRole', 'invitePolicy', 'approveJoins', 'allowedDomain'],\n  danger: [],\n};\n\nexport const WORKSPACE_FIELD_SECTION: Record<\n  WorkspaceField,\n  WorkspaceSectionId\n> = {\n  name: 'general',\n  slug: 'general',\n  timeZone: 'general',\n  defaultRole: 'members',\n  invitePolicy: 'members',\n  approveJoins: 'members',\n  allowedDomain: 'members',\n};\n\nexport const ROLE_OPTIONS: RoleOption[] = [\n  {\n    value: 'member',\n    label: 'Member',\n    line: 'Creates and edits tasks, tracks time, sees every project',\n    holders: 11,\n  },\n  {\n    value: 'viewer',\n    label: 'Viewer',\n    line: 'Reads and comments, cannot track time or edit',\n    holders: 2,\n  },\n  {\n    value: 'guest',\n    label: 'Guest',\n    line: 'Sees only the projects someone invites them to',\n    holders: 1,\n  },\n];\n\nexport const INVITE_POLICIES: { value: InvitePolicy; label: string }[] = [\n  { value: 'admins', label: 'Admins only' },\n  { value: 'admins-members', label: 'Admins and members' },\n];\n",
      "type": "registry:component",
      "target": "components/templates/application-03/data.ts"
    }
  ],
  "categories": [
    "templates",
    "settings"
  ],
  "type": "registry:block"
}