@tc96/cli 0.0.0-stage → 0.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (248) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +213 -2
  3. package/cli.js +1450 -0
  4. package/package.json +35 -4
  5. package/registry/agenda-1.json +1297 -0
  6. package/registry/aggregate.json +4 -0
  7. package/registry/ai-chat-1.json +91 -0
  8. package/registry/app-shell-1.json +81 -0
  9. package/registry/app-shell-2.json +89 -0
  10. package/registry/app-shell-3.json +109 -0
  11. package/registry/app-shell-4.json +104 -0
  12. package/registry/card-1.json +104 -0
  13. package/registry/card-2.json +97 -0
  14. package/registry/card-3.json +104 -0
  15. package/registry/card-4.json +98 -0
  16. package/registry/card-5.json +85 -0
  17. package/registry/card-6.json +98 -0
  18. package/registry/card-7.json +104 -0
  19. package/registry/card-8.json +106 -0
  20. package/registry/card-9.json +92 -0
  21. package/registry/charts.json +30 -0
  22. package/registry/chat-assistant.json +110 -0
  23. package/registry/chats-panel.json +97 -0
  24. package/registry/checklist.json +321 -0
  25. package/registry/collection.json +1104 -0
  26. package/registry/crm-1.json +1317 -0
  27. package/registry/crm-2.json +1400 -0
  28. package/registry/dashboard-1.json +160 -0
  29. package/registry/dashboard-2.json +153 -0
  30. package/registry/dashboard-3.json +154 -0
  31. package/registry/dashboard-4.json +168 -0
  32. package/registry/dashboard-5.json +167 -0
  33. package/registry/dashboard-6.json +143 -0
  34. package/registry/dashboard-7.json +188 -0
  35. package/registry/documents-1.json +1322 -0
  36. package/registry/editable.json +36 -0
  37. package/registry/empty-state-1.json +40 -0
  38. package/registry/empty-state-2.json +39 -0
  39. package/registry/empty-state-3.json +61 -0
  40. package/registry/empty-state-4.json +39 -0
  41. package/registry/empty-state-5.json +47 -0
  42. package/registry/empty-state-6.json +40 -0
  43. package/registry/finance-1.json +845 -0
  44. package/registry/finance-2.json +973 -0
  45. package/registry/finance-3.json +1436 -0
  46. package/registry/flow-1.json +460 -0
  47. package/registry/flow-2.json +503 -0
  48. package/registry/flow-3.json +198 -0
  49. package/registry/flow-4.json +75 -0
  50. package/registry/flow-canvas.json +198 -0
  51. package/registry/flow-inspector.json +151 -0
  52. package/registry/flow-step-library.json +112 -0
  53. package/registry/forgot-password-1.json +73 -0
  54. package/registry/forgot-password-2.json +73 -0
  55. package/registry/inbox-1.json +1184 -0
  56. package/registry/inventory-1.json +828 -0
  57. package/registry/inventory-2.json +956 -0
  58. package/registry/legal-1.json +1345 -0
  59. package/registry/legal-2.json +1279 -0
  60. package/registry/legal-3.json +1273 -0
  61. package/registry/legal-4.json +1273 -0
  62. package/registry/legal-5.json +1393 -0
  63. package/registry/legal-6.json +1309 -0
  64. package/registry/legal-7.json +1315 -0
  65. package/registry/legal-8.json +1358 -0
  66. package/registry/legal-9.json +1381 -0
  67. package/registry/list-1.json +129 -0
  68. package/registry/list-2.json +117 -0
  69. package/registry/list-3.json +129 -0
  70. package/registry/list-4.json +105 -0
  71. package/registry/list-5.json +98 -0
  72. package/registry/list-6.json +92 -0
  73. package/registry/list.json +52 -0
  74. package/registry/login-1.json +89 -0
  75. package/registry/login-10.json +88 -0
  76. package/registry/login-2.json +81 -0
  77. package/registry/login-3.json +90 -0
  78. package/registry/login-4.json +81 -0
  79. package/registry/login-5.json +82 -0
  80. package/registry/login-6.json +88 -0
  81. package/registry/login-7.json +83 -0
  82. package/registry/login-8.json +81 -0
  83. package/registry/login-9.json +88 -0
  84. package/registry/magic-link-6.json +79 -0
  85. package/registry/marketing-1.json +833 -0
  86. package/registry/marketing-2.json +961 -0
  87. package/registry/navbar-1.json +66 -0
  88. package/registry/navbar-10.json +50 -0
  89. package/registry/navbar-11.json +48 -0
  90. package/registry/navbar-12.json +48 -0
  91. package/registry/navbar-2.json +48 -0
  92. package/registry/navbar-3.json +50 -0
  93. package/registry/navbar-4.json +39 -0
  94. package/registry/navbar-5.json +50 -0
  95. package/registry/navbar-6.json +48 -0
  96. package/registry/navbar-7.json +72 -0
  97. package/registry/navbar-8.json +50 -0
  98. package/registry/navbar-9.json +54 -0
  99. package/registry/onboarding-1.json +114 -0
  100. package/registry/onboarding-2.json +78 -0
  101. package/registry/onboarding-3.json +71 -0
  102. package/registry/otp-1.json +73 -0
  103. package/registry/projects-1.json +865 -0
  104. package/registry/projects-2.json +993 -0
  105. package/registry/projects-3.json +1346 -0
  106. package/registry/properties.json +530 -0
  107. package/registry/record-dialog.json +88 -0
  108. package/registry/record-group.json +194 -0
  109. package/registry/record-preview.json +70 -0
  110. package/registry/record-status-list.json +70 -0
  111. package/registry/reset-password-1.json +92 -0
  112. package/registry/reset-password-2.json +98 -0
  113. package/registry/reset-password-6.json +91 -0
  114. package/registry/revenue-1.json +834 -0
  115. package/registry/revenue-2.json +968 -0
  116. package/registry/revenue-3.json +821 -0
  117. package/registry/revenue-4.json +949 -0
  118. package/registry/rich-text-editor-1.json +172 -0
  119. package/registry/rich-text-editor-2.json +158 -0
  120. package/registry/rich-text-editor-3.json +198 -0
  121. package/registry/rich-text-editor-4.json +200 -0
  122. package/registry/rich-text-editor-5.json +237 -0
  123. package/registry/rich-text-editor.json +113 -0
  124. package/registry/settings-account-1.json +119 -0
  125. package/registry/settings-account-2.json +118 -0
  126. package/registry/settings-catalog-1.json +128 -0
  127. package/registry/settings-catalog-10.json +129 -0
  128. package/registry/settings-catalog-2.json +116 -0
  129. package/registry/settings-catalog-3.json +118 -0
  130. package/registry/settings-catalog-4.json +227 -0
  131. package/registry/settings-catalog-5.json +129 -0
  132. package/registry/settings-catalog-6.json +130 -0
  133. package/registry/settings-catalog-7.json +130 -0
  134. package/registry/settings-catalog-8.json +183 -0
  135. package/registry/settings-catalog-9.json +159 -0
  136. package/registry/settings-integration-1.json +125 -0
  137. package/registry/settings-integration-2.json +122 -0
  138. package/registry/settings-integration-3.json +118 -0
  139. package/registry/settings-integration-4.json +129 -0
  140. package/registry/settings-integration-5.json +122 -0
  141. package/registry/settings-integration-6.json +92 -0
  142. package/registry/settings-integration-7.json +122 -0
  143. package/registry/settings-integration-8.json +593 -0
  144. package/registry/settings-notification-channel-1.json +112 -0
  145. package/registry/settings-preference-1.json +123 -0
  146. package/registry/settings-preference-2.json +123 -0
  147. package/registry/settings-preference-3.json +116 -0
  148. package/registry/settings-role-permission-1.json +117 -0
  149. package/registry/settings-security-1.json +117 -0
  150. package/registry/settings-workspace-1.json +119 -0
  151. package/registry/settings-workspace-2.json +125 -0
  152. package/registry/settings.json +82 -0
  153. package/registry/signup-1.json +100 -0
  154. package/registry/signup-2.json +93 -0
  155. package/registry/signup-3.json +83 -0
  156. package/registry/signup-6.json +99 -0
  157. package/registry/state-surface.json +58 -0
  158. package/registry/stats-1.json +116 -0
  159. package/registry/stats-2.json +115 -0
  160. package/registry/stats-3.json +97 -0
  161. package/registry/stats-4.json +92 -0
  162. package/registry/stats-5.json +103 -0
  163. package/registry/stats-6.json +105 -0
  164. package/registry/stats-7.json +103 -0
  165. package/registry/stats.json +64 -0
  166. package/registry/support-1.json +853 -0
  167. package/registry/support-2.json +981 -0
  168. package/registry/support-3.json +762 -0
  169. package/registry/support-4.json +538 -0
  170. package/registry/team-1.json +829 -0
  171. package/registry/team-2.json +957 -0
  172. package/registry/timeline-1.json +97 -0
  173. package/registry/timeline-2.json +102 -0
  174. package/registry/timeline-3.json +68 -0
  175. package/registry/timeline-4.json +86 -0
  176. package/registry/ui/accordion.json +15 -0
  177. package/registry/ui/alert-dialog.json +14 -0
  178. package/registry/ui/alert.json +50 -0
  179. package/registry/ui/autocomplete.json +18 -0
  180. package/registry/ui/avatar.json +14 -0
  181. package/registry/ui/badge.json +51 -0
  182. package/registry/ui/breadcrumb.json +15 -0
  183. package/registry/ui/button.json +25 -0
  184. package/registry/ui/calendar.json +15 -0
  185. package/registry/ui/card.json +14 -0
  186. package/registry/ui/chat.json +115 -0
  187. package/registry/ui/checkbox-group.json +14 -0
  188. package/registry/ui/checkbox.json +14 -0
  189. package/registry/ui/collapsible.json +14 -0
  190. package/registry/ui/combobox.json +18 -0
  191. package/registry/ui/command.json +17 -0
  192. package/registry/ui/composer-clipboard.json +14 -0
  193. package/registry/ui/composer-document.json +14 -0
  194. package/registry/ui/composer-editor.json +16 -0
  195. package/registry/ui/composer-query.json +12 -0
  196. package/registry/ui/composer.json +17 -0
  197. package/registry/ui/context-menu.json +23 -0
  198. package/registry/ui/dialog.json +18 -0
  199. package/registry/ui/drawer.json +18 -0
  200. package/registry/ui/empty.json +14 -0
  201. package/registry/ui/field.json +22 -0
  202. package/registry/ui/fieldset.json +14 -0
  203. package/registry/ui/form.json +14 -0
  204. package/registry/ui/frame.json +12 -0
  205. package/registry/ui/gauge.json +31 -0
  206. package/registry/ui/group.json +17 -0
  207. package/registry/ui/icon-frame.json +31 -0
  208. package/registry/ui/input-group.json +17 -0
  209. package/registry/ui/input.json +14 -0
  210. package/registry/ui/kbd.json +12 -0
  211. package/registry/ui/label.json +14 -0
  212. package/registry/ui/menu.json +39 -0
  213. package/registry/ui/meter.json +14 -0
  214. package/registry/ui/number-field.json +17 -0
  215. package/registry/ui/otp-field.json +31 -0
  216. package/registry/ui/pagination.json +17 -0
  217. package/registry/ui/popover.json +14 -0
  218. package/registry/ui/preview-card.json +14 -0
  219. package/registry/ui/progress.json +14 -0
  220. package/registry/ui/property-meta.json +16 -0
  221. package/registry/ui/property-tone.json +12 -0
  222. package/registry/ui/radio-group.json +14 -0
  223. package/registry/ui/render-anchor.json +12 -0
  224. package/registry/ui/scroll-area.json +14 -0
  225. package/registry/ui/segmented-control.json +14 -0
  226. package/registry/ui/select.json +16 -0
  227. package/registry/ui/separator.json +14 -0
  228. package/registry/ui/sheet.json +18 -0
  229. package/registry/ui/sidebar.json +25 -0
  230. package/registry/ui/skeleton.json +24 -0
  231. package/registry/ui/slider.json +14 -0
  232. package/registry/ui/spinner.json +14 -0
  233. package/registry/ui/switch.json +14 -0
  234. package/registry/ui/table.json +14 -0
  235. package/registry/ui/tabs.json +16 -0
  236. package/registry/ui/text.json +31 -0
  237. package/registry/ui/textarea.json +14 -0
  238. package/registry/ui/toast.json +89 -0
  239. package/registry/ui/toggle-group.json +18 -0
  240. package/registry/ui/toggle.json +15 -0
  241. package/registry/ui/toolbar.json +14 -0
  242. package/registry/ui/tooltip.json +14 -0
  243. package/registry/ui/use-composer-editor.json +17 -0
  244. package/registry/ui/use-copy-to-clipboard.json +12 -0
  245. package/registry/ui/use-media-query.json +12 -0
  246. package/registry/view.json +1104 -0
  247. package/registry/widgets.json +319 -0
  248. package/registry/wizard.json +89 -0
@@ -0,0 +1,109 @@
1
+ {
2
+ "name": "app-shell-3",
3
+ "type": "registry:block",
4
+ "files": [
5
+ {
6
+ "path": "blocks/application/shell/app-shell-3/app-shell-3.tsx",
7
+ "type": "registry:file",
8
+ "content": "'use client'\n\nimport { renderAnchor } from '@tc96/ui/render-anchor'\nimport {\n Sidebar,\n SidebarContent,\n SidebarFooter,\n SidebarHeader,\n SidebarInset,\n SidebarProvider,\n} from '@tc96/ui/sidebar'\nimport { cn } from '@tc96/utils'\nimport type { ReactElement } from 'react'\nimport { resolveShellLabels } from '../shared/labels'\nimport { ShellBackButton } from '../shared/shell-back-button'\nimport { ShellHeader } from '../shared/shell-header'\nimport { ShellNav } from '../shared/shell-nav'\nimport { ShellNotifications } from '../shared/shell-notifications'\nimport type { AppShellBaseProps, ShellNotification } from '../shared/types'\nimport { UserMenu } from '../shared/user-menu'\nimport { WorkspaceSwitcher } from '../shared/workspace-switcher'\nimport { ProjectNav, type ShellProject } from './project-nav'\nimport { type ShellUsage, UsageCard } from './usage-card'\n\nexport interface AppShell3Props extends AppShellBaseProps {\n notifications?: ShellNotification[]\n onMarkAllRead?: () => void\n onNotificationSelect?: (notificationId: string) => void\n projects?: ShellProject[]\n usage?: ShellUsage\n}\n\nexport function AppShell3({\n actions,\n breadcrumbs,\n children,\n defaultOpen,\n labels: labelsProp,\n navigation,\n notifications,\n onMarkAllRead,\n onNotificationSelect,\n onOpenChange,\n onSignOut,\n onThemeChange,\n onWorkspaceChange,\n open,\n padded = true,\n projects,\n renderLink = renderAnchor,\n settings,\n theme,\n usage,\n user,\n userActions,\n workspaceId,\n workspaces,\n}: Readonly<AppShell3Props>): ReactElement {\n const labels = resolveShellLabels(labelsProp)\n\n return (\n <SidebarProvider\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n open={open}\n >\n <Sidebar collapsible=\"icon\" variant=\"inset\">\n <SidebarHeader>\n {settings ? (\n <ShellBackButton\n labels={labels}\n renderLink={renderLink}\n settings={settings}\n />\n ) : (\n <WorkspaceSwitcher\n labels={labels}\n onWorkspaceChange={onWorkspaceChange}\n workspaceId={workspaceId}\n workspaces={workspaces}\n />\n )}\n </SidebarHeader>\n <SidebarContent>\n <ShellNav\n groups={settings ? settings.navigation : navigation}\n label={settings ? labels.settingsNavigation : labels.navigation}\n labels={labels}\n renderLink={renderLink}\n />\n {!settings && projects?.length ? (\n <ProjectNav\n label={labels.projects}\n projects={projects}\n renderLink={renderLink}\n />\n ) : null}\n </SidebarContent>\n {settings ? null : (\n <SidebarFooter>\n {usage ? <UsageCard usage={usage} /> : null}\n <UserMenu\n labels={labels}\n onSignOut={onSignOut}\n onThemeChange={onThemeChange}\n theme={theme}\n user={user}\n userActions={userActions}\n />\n </SidebarFooter>\n )}\n </Sidebar>\n <SidebarInset className=\"min-w-0\">\n <ShellHeader\n actions={\n notifications || actions ? (\n <>\n {notifications ? (\n <ShellNotifications\n labels={labels}\n notifications={notifications}\n onMarkAllRead={onMarkAllRead}\n onNotificationSelect={onNotificationSelect}\n />\n ) : null}\n {actions}\n </>\n ) : undefined\n }\n breadcrumbs={breadcrumbs}\n labels={labels}\n renderLink={renderLink}\n />\n <div className={cn('flex flex-1 flex-col', padded && 'gap-4 p-4')}>\n {children}\n </div>\n </SidebarInset>\n </SidebarProvider>\n )\n}\n",
9
+ "target": "~/packages/ui/src/blocks/application/shell/app-shell-3/app-shell-3.tsx"
10
+ },
11
+ {
12
+ "path": "blocks/application/shell/app-shell-3/index.ts",
13
+ "type": "registry:file",
14
+ "content": "export type {\n AppShellBaseProps,\n ShellAction,\n ShellBreadcrumbItem,\n ShellLabels,\n ShellNavGroup,\n ShellNavItem,\n ShellNavSubItem,\n ShellNotification,\n ShellRenderLink,\n ShellSettings,\n ShellTheme,\n ShellUser,\n ShellWorkspace,\n} from '../shared/types'\nexport { AppShell3, type AppShell3Props } from './app-shell-3'\nexport type { ShellProject } from './project-nav'\nexport type { ShellUsage } from './usage-card'\n",
15
+ "target": "~/packages/ui/src/blocks/application/shell/app-shell-3/index.ts"
16
+ },
17
+ {
18
+ "path": "blocks/application/shell/app-shell-3/project-nav.tsx",
19
+ "type": "registry:file",
20
+ "content": "'use client'\n\nimport { ProgressRing } from '@tc96/ui/patterns/widgets/shared/progress-ring'\nimport {\n SidebarGroup,\n SidebarGroupLabel,\n SidebarMenu,\n SidebarMenuBadge,\n SidebarMenuButton,\n SidebarMenuItem,\n} from '@tc96/ui/sidebar'\nimport type { ReactElement } from 'react'\nimport type { ShellRenderLink } from '../shared/types'\n\nexport interface ShellProject {\n active?: boolean\n href: string\n progress: number\n title: string\n}\n\nexport interface ProjectNavProps {\n label: string\n projects: ShellProject[]\n renderLink: ShellRenderLink\n}\n\nexport function ProjectNav({\n label,\n projects,\n renderLink,\n}: Readonly<ProjectNavProps>): ReactElement {\n return (\n <nav aria-label={label}>\n <SidebarGroup>\n <SidebarGroupLabel>{label}</SidebarGroupLabel>\n <SidebarMenu>\n {projects.map((project) => (\n <SidebarMenuItem key={project.href}>\n <SidebarMenuButton\n aria-current={project.active ? 'page' : undefined}\n isActive={project.active}\n render={renderLink(project.href)}\n tooltip={project.title}\n >\n <ProgressRing\n className=\"size-4\"\n ratio={project.progress}\n strokeWidth={16}\n />\n <span>{project.title}</span>\n </SidebarMenuButton>\n <SidebarMenuBadge>\n {Math.round(Math.min(Math.max(project.progress, 0), 1) * 100)}%\n </SidebarMenuBadge>\n </SidebarMenuItem>\n ))}\n </SidebarMenu>\n </SidebarGroup>\n </nav>\n )\n}\n",
21
+ "target": "~/packages/ui/src/blocks/application/shell/app-shell-3/project-nav.tsx"
22
+ },
23
+ {
24
+ "path": "blocks/application/shell/app-shell-3/usage-card.tsx",
25
+ "type": "registry:file",
26
+ "content": "'use client'\n\nimport { Gauge } from '@tc96/ui/gauge'\nimport { type ReactElement, type ReactNode, useId } from 'react'\n\nexport interface ShellUsage {\n action?: ReactNode\n description?: string\n label: string\n max: number\n value: number\n valueLabel: string\n}\n\nexport interface UsageCardProps {\n usage: ShellUsage\n}\n\nexport function UsageCard({ usage }: Readonly<UsageCardProps>): ReactElement {\n const labelId = useId()\n return (\n <div className=\"flex flex-col gap-2 rounded-lg bg-sidebar-accent p-3 text-sidebar-accent-foreground group-data-[collapsible=icon]:hidden\">\n <div className=\"flex flex-col gap-2\">\n <span className=\"font-medium text-xs\" id={labelId}>\n {usage.label}\n </span>\n <Gauge\n aria-labelledby={labelId}\n getAriaValueText={() => usage.valueLabel}\n max={usage.max}\n value={usage.value}\n />\n <span className=\"text-xs tabular-nums\">{usage.valueLabel}</span>\n </div>\n {usage.description ? (\n <p className=\"text-xs\">{usage.description}</p>\n ) : null}\n {usage.action}\n </div>\n )\n}\n",
27
+ "target": "~/packages/ui/src/blocks/application/shell/app-shell-3/usage-card.tsx"
28
+ },
29
+ {
30
+ "path": "blocks/application/shell/shared/labels.ts",
31
+ "type": "registry:file",
32
+ "content": "import type { ShellLabels } from './types'\n\nexport const defaultShellLabels: ShellLabels = {\n account: 'Conta',\n backToApp: 'Voltar ao app',\n breadcrumb: 'Trilha de navegação',\n itemActions: (title) => `Ações de ${title}`,\n markAllRead: 'Marcar todas como lidas',\n navigation: 'Navegação principal',\n notifications: 'Notificações',\n notificationsEmpty: 'Nenhuma notificação.',\n notificationsTrigger: (unread) =>\n unread ? `Notificações, ${unread} não lidas` : 'Notificações',\n projects: 'Projetos',\n search: 'Buscar',\n searchClose: 'Fechar',\n searchEmpty: 'Nenhuma página encontrada.',\n searchNavigate: 'Navegar',\n searchOpen: 'Abrir',\n searchPlaceholder: 'Buscar páginas…',\n sections: 'Seções',\n settingsNavigation: 'Navegação de configurações',\n signOut: 'Sair',\n switchWorkspace: 'Trocar workspace',\n theme: 'Tema',\n themeDark: 'Escuro',\n themeLight: 'Claro',\n themeSystem: 'Sistema',\n toggleSidebar: 'Alternar barra lateral',\n unread: 'Não lida',\n workspaces: 'Workspaces',\n}\n\nexport function resolveShellLabels(labels?: Partial<ShellLabels>): ShellLabels {\n return { ...defaultShellLabels, ...labels }\n}\n",
33
+ "target": "~/packages/ui/src/blocks/application/shell/shared/labels.ts"
34
+ },
35
+ {
36
+ "path": "blocks/application/shell/shared/shell-back-button.tsx",
37
+ "type": "registry:file",
38
+ "content": "'use client'\n\nimport { ArrowLeftIcon } from '@phosphor-icons/react'\nimport {\n SidebarMenu,\n SidebarMenuButton,\n SidebarMenuItem,\n} from '@tc96/ui/sidebar'\nimport type { ReactElement } from 'react'\nimport type { ShellLabels, ShellRenderLink, ShellSettings } from './types'\n\nexport interface ShellBackButtonProps {\n labels: ShellLabels\n renderLink: ShellRenderLink\n settings: ShellSettings\n}\n\nexport function ShellBackButton({\n labels,\n renderLink,\n settings,\n}: Readonly<ShellBackButtonProps>): ReactElement {\n return (\n <SidebarMenu>\n <SidebarMenuItem>\n <SidebarMenuButton\n onClick={settings.onBack}\n render={settings.backHref ? renderLink(settings.backHref) : undefined}\n tooltip={labels.backToApp}\n type={settings.backHref ? undefined : 'button'}\n >\n <ArrowLeftIcon aria-hidden=\"true\" />\n <span>{labels.backToApp}</span>\n </SidebarMenuButton>\n </SidebarMenuItem>\n </SidebarMenu>\n )\n}\n",
39
+ "target": "~/packages/ui/src/blocks/application/shell/shared/shell-back-button.tsx"
40
+ },
41
+ {
42
+ "path": "blocks/application/shell/shared/shell-header.tsx",
43
+ "type": "registry:file",
44
+ "content": "'use client'\n\nimport {\n Breadcrumb,\n BreadcrumbItem,\n BreadcrumbLink,\n BreadcrumbList,\n BreadcrumbPage,\n BreadcrumbSeparator,\n} from '@tc96/ui/breadcrumb'\nimport { Separator } from '@tc96/ui/separator'\nimport { SidebarTrigger } from '@tc96/ui/sidebar'\nimport { Fragment, type ReactElement, type ReactNode } from 'react'\nimport type { ShellBreadcrumbItem, ShellLabels, ShellRenderLink } from './types'\n\nexport interface ShellBreadcrumbProps {\n items: ShellBreadcrumbItem[]\n labels: ShellLabels\n renderLink: ShellRenderLink\n}\n\nexport function ShellBreadcrumb({\n items,\n labels,\n renderLink,\n}: Readonly<ShellBreadcrumbProps>): ReactElement {\n return (\n <Breadcrumb aria-label={labels.breadcrumb}>\n <BreadcrumbList>\n {items.map((item, index) => {\n const current = index === items.length - 1\n return (\n <Fragment key={`${index}-${item.label}`}>\n <BreadcrumbItem\n className={current ? undefined : 'hidden md:inline-flex'}\n >\n {current ? <BreadcrumbPage>{item.label}</BreadcrumbPage> : null}\n {!current && item.href ? (\n <BreadcrumbLink render={renderLink(item.href)}>\n {item.label}\n </BreadcrumbLink>\n ) : null}\n {!current && !item.href ? item.label : null}\n </BreadcrumbItem>\n {current ? null : (\n <BreadcrumbSeparator className=\"hidden md:inline-flex\" />\n )}\n </Fragment>\n )\n })}\n </BreadcrumbList>\n </Breadcrumb>\n )\n}\n\nexport interface ShellHeaderProps {\n actions?: ReactNode\n breadcrumbs?: ShellBreadcrumbItem[]\n children?: ReactNode\n labels: ShellLabels\n renderLink: ShellRenderLink\n}\n\nexport function ShellHeader({\n actions,\n breadcrumbs,\n children,\n labels,\n renderLink,\n}: Readonly<ShellHeaderProps>): ReactElement {\n return (\n <header className=\"flex h-14 shrink-0 items-center gap-2 border-b px-4\">\n <SidebarTrigger aria-label={labels.toggleSidebar} className=\"-ms-1\" />\n {breadcrumbs?.length ? (\n <>\n <Separator className=\"me-2 h-4\" orientation=\"vertical\" />\n <ShellBreadcrumb\n items={breadcrumbs}\n labels={labels}\n renderLink={renderLink}\n />\n </>\n ) : null}\n {children}\n {actions ? (\n <div className=\"ms-auto flex items-center gap-2\">{actions}</div>\n ) : null}\n </header>\n )\n}\n",
45
+ "target": "~/packages/ui/src/blocks/application/shell/shared/shell-header.tsx"
46
+ },
47
+ {
48
+ "path": "blocks/application/shell/shared/shell-nav.tsx",
49
+ "type": "registry:file",
50
+ "content": "'use client'\n\nimport { CaretRightIcon, DotsThreeIcon } from '@phosphor-icons/react'\nimport {\n Collapsible,\n CollapsiblePanel,\n CollapsibleTrigger,\n} from '@tc96/ui/collapsible'\nimport { Menu, MenuItem, MenuPopup, MenuTrigger } from '@tc96/ui/menu'\nimport {\n SidebarGroup,\n SidebarGroupLabel,\n SidebarMenu,\n SidebarMenuAction,\n SidebarMenuBadge,\n SidebarMenuButton,\n SidebarMenuItem,\n SidebarMenuSub,\n SidebarMenuSubButton,\n SidebarMenuSubItem,\n} from '@tc96/ui/sidebar'\nimport { type ReactElement, useId } from 'react'\nimport type {\n ShellLabels,\n ShellNavGroup,\n ShellNavItem,\n ShellRenderLink,\n} from './types'\n\ninterface ShellNavItemProps {\n item: ShellNavItem\n labels: ShellLabels\n renderLink: ShellRenderLink\n}\n\nfunction ShellNavLeaf({\n item,\n labels,\n renderLink,\n}: Readonly<ShellNavItemProps>): ReactElement {\n const hasActions = Boolean(item.actions?.length)\n\n return (\n <SidebarMenuItem>\n <SidebarMenuButton\n aria-current={item.active ? 'page' : undefined}\n isActive={item.active}\n render={item.href ? renderLink(item.href) : undefined}\n tooltip={item.title}\n >\n {item.icon}\n <span>{item.title}</span>\n </SidebarMenuButton>\n {hasActions ? (\n <Menu>\n <MenuTrigger\n render={\n <SidebarMenuAction\n aria-label={labels.itemActions(item.title)}\n showOnHover\n />\n }\n >\n <DotsThreeIcon aria-hidden=\"true\" />\n </MenuTrigger>\n <MenuPopup align=\"start\" side=\"right\">\n {item.actions?.map((action) => (\n <MenuItem\n key={action.label}\n onClick={action.onSelect}\n variant={action.variant}\n >\n {action.icon}\n {action.label}\n </MenuItem>\n ))}\n </MenuPopup>\n </Menu>\n ) : null}\n {!hasActions && item.badge !== undefined ? (\n <SidebarMenuBadge>{item.badge}</SidebarMenuBadge>\n ) : null}\n </SidebarMenuItem>\n )\n}\n\nfunction ShellNavBranch({\n item,\n renderLink,\n}: Readonly<ShellNavItemProps>): ReactElement {\n const open = Boolean(item.active || item.items?.some((sub) => sub.active))\n\n return (\n <SidebarMenuItem>\n <Collapsible defaultOpen={open}>\n <CollapsibleTrigger\n render={\n <SidebarMenuButton isActive={item.active} tooltip={item.title} />\n }\n >\n {item.icon}\n <span>{item.title}</span>\n <CaretRightIcon\n aria-hidden=\"true\"\n className=\"ms-auto transition-transform in-data-panel-open:rotate-90\"\n />\n </CollapsibleTrigger>\n <CollapsiblePanel>\n <SidebarMenuSub>\n {item.items?.map((sub) => (\n <SidebarMenuSubItem key={sub.href}>\n <SidebarMenuSubButton\n aria-current={sub.active ? 'page' : undefined}\n isActive={sub.active}\n render={renderLink(sub.href)}\n >\n <span className=\"truncate\">{sub.title}</span>\n {sub.badge !== undefined ? (\n <SidebarMenuBadge className=\"static ms-auto text-current\">\n {sub.badge}\n </SidebarMenuBadge>\n ) : null}\n </SidebarMenuSubButton>\n </SidebarMenuSubItem>\n ))}\n </SidebarMenuSub>\n </CollapsiblePanel>\n </Collapsible>\n </SidebarMenuItem>\n )\n}\n\ninterface ShellNavSectionProps {\n group: ShellNavGroup\n labels: ShellLabels\n renderLink: ShellRenderLink\n}\n\nfunction ShellNavSection({\n group,\n labels,\n renderLink,\n}: Readonly<ShellNavSectionProps>): ReactElement {\n const labelId = useId()\n\n return (\n <SidebarGroup>\n <SidebarGroupLabel id={labelId}>{group.label}</SidebarGroupLabel>\n <SidebarMenu aria-labelledby={labelId}>\n {group.items.map((item) =>\n item.items?.length ? (\n <ShellNavBranch\n item={item}\n key={item.title}\n labels={labels}\n renderLink={renderLink}\n />\n ) : (\n <ShellNavLeaf\n item={item}\n key={item.title}\n labels={labels}\n renderLink={renderLink}\n />\n ),\n )}\n </SidebarMenu>\n </SidebarGroup>\n )\n}\n\nexport interface ShellNavProps {\n groups: ShellNavGroup[]\n label: string\n labels: ShellLabels\n renderLink: ShellRenderLink\n}\n\nexport function ShellNav({\n groups,\n label,\n labels,\n renderLink,\n}: Readonly<ShellNavProps>): ReactElement {\n return (\n <nav aria-label={label}>\n {groups.map((group) => (\n <ShellNavSection\n group={group}\n key={group.label}\n labels={labels}\n renderLink={renderLink}\n />\n ))}\n </nav>\n )\n}\n",
51
+ "target": "~/packages/ui/src/blocks/application/shell/shared/shell-nav.tsx"
52
+ },
53
+ {
54
+ "path": "blocks/application/shell/shared/shell-notifications.tsx",
55
+ "type": "registry:file",
56
+ "content": "'use client'\n\nimport { BellIcon } from '@phosphor-icons/react'\nimport { Badge } from '@tc96/ui/badge'\nimport { Button } from '@tc96/ui/button'\nimport {\n Popover,\n PopoverPopup,\n PopoverTitle,\n PopoverTrigger,\n} from '@tc96/ui/popover'\nimport { cn } from '@tc96/utils'\nimport type { ReactElement } from 'react'\nimport type { ShellLabels, ShellNotification } from './types'\n\nexport interface ShellNotificationsProps {\n labels: ShellLabels\n notifications: ShellNotification[]\n onMarkAllRead?: () => void\n onNotificationSelect?: (notificationId: string) => void\n}\n\nexport function ShellNotifications({\n labels,\n notifications,\n onMarkAllRead,\n onNotificationSelect,\n}: Readonly<ShellNotificationsProps>): ReactElement {\n const unread = notifications.filter(\n (notification) => notification.unread,\n ).length\n\n return (\n <Popover>\n <PopoverTrigger\n render={\n <Button\n aria-label={labels.notificationsTrigger(unread)}\n className=\"relative\"\n size=\"icon\"\n variant=\"ghost\"\n />\n }\n >\n <BellIcon aria-hidden=\"true\" />\n {unread ? (\n <Badge aria-hidden className=\"absolute -end-1 -top-1\">\n {unread}\n </Badge>\n ) : null}\n </PopoverTrigger>\n <PopoverPopup align=\"end\" className=\"w-80\">\n <div className=\"flex items-center justify-between gap-2\">\n <PopoverTitle>{labels.notifications}</PopoverTitle>\n {onMarkAllRead && unread ? (\n <Button onClick={onMarkAllRead} size=\"sm\" variant=\"ghost\">\n {labels.markAllRead}\n </Button>\n ) : null}\n </div>\n {notifications.length ? (\n <ul className=\"-mx-2 mt-2 flex flex-col\">\n {notifications.map((notification) => (\n <li key={notification.id}>\n <button\n className=\"flex w-full gap-3 rounded-md px-2 py-2 text-start hover:bg-accent\"\n onClick={() => onNotificationSelect?.(notification.id)}\n type=\"button\"\n >\n <span\n aria-hidden\n className={cn(\n 'mt-1.5 size-2 shrink-0 rounded-full',\n notification.unread ? 'bg-primary' : 'bg-transparent',\n )}\n />\n <span className=\"flex min-w-0 flex-col gap-0.5\">\n <span className=\"font-medium text-sm\">\n {notification.title}\n </span>\n {notification.description ? (\n <span className=\"text-muted-foreground text-sm\">\n {notification.description}\n </span>\n ) : null}\n <span className=\"text-muted-foreground text-xs\">\n {notification.time}\n {notification.unread ? (\n <span className=\"sr-only\">, {labels.unread}</span>\n ) : null}\n </span>\n </span>\n </button>\n </li>\n ))}\n </ul>\n ) : (\n <p className=\"mt-2 text-muted-foreground text-sm\">\n {labels.notificationsEmpty}\n </p>\n )}\n </PopoverPopup>\n </Popover>\n )\n}\n",
57
+ "target": "~/packages/ui/src/blocks/application/shell/shared/shell-notifications.tsx"
58
+ },
59
+ {
60
+ "path": "blocks/application/shell/shared/types.ts",
61
+ "type": "registry:file",
62
+ "content": "import type { RenderLink } from '@tc96/ui/render-anchor'\nimport type { ReactNode } from 'react'\n\nexport type ShellRenderLink = RenderLink\n\nexport interface ShellAction {\n icon?: ReactNode\n label: string\n onSelect: () => void\n variant?: 'default' | 'destructive'\n}\n\nexport interface ShellNavSubItem {\n active?: boolean\n badge?: ReactNode\n href: string\n title: string\n}\n\nexport interface ShellNavItem {\n actions?: ShellAction[]\n active?: boolean\n badge?: ReactNode\n href?: string\n icon?: ReactNode\n items?: ShellNavSubItem[]\n title: string\n}\n\nexport interface ShellNavGroup {\n items: ShellNavItem[]\n label: string\n}\n\nexport interface ShellWorkspace {\n description?: string\n id: string\n logo?: ReactNode\n name: string\n}\n\nexport interface ShellUser {\n avatarUrl?: string\n email: string\n name: string\n}\n\nexport interface ShellBreadcrumbItem {\n href?: string\n label: string\n}\n\nexport type ShellTheme = 'light' | 'dark' | 'system'\n\nexport interface ShellNotification {\n description?: string\n id: string\n time: string\n title: string\n unread?: boolean\n}\n\nexport interface ShellLabels {\n account: string\n backToApp: string\n breadcrumb: string\n itemActions: (title: string) => string\n markAllRead: string\n navigation: string\n notifications: string\n notificationsEmpty: string\n notificationsTrigger: (unread: number) => string\n projects: string\n search: string\n searchClose: string\n searchEmpty: string\n searchNavigate: string\n searchOpen: string\n searchPlaceholder: string\n sections: string\n settingsNavigation: string\n signOut: string\n switchWorkspace: string\n theme: string\n themeDark: string\n themeLight: string\n themeSystem: string\n toggleSidebar: string\n unread: string\n workspaces: string\n}\n\nexport type ShellSettings = { navigation: ShellNavGroup[] } & (\n | { backHref: string; onBack?: never }\n | { backHref?: never; onBack: () => void }\n)\n\nexport interface AppShellBaseProps {\n actions?: ReactNode\n breadcrumbs?: ShellBreadcrumbItem[]\n children?: ReactNode\n defaultOpen?: boolean\n labels?: Partial<ShellLabels>\n navigation: ShellNavGroup[]\n onOpenChange?: (open: boolean) => void\n onSignOut?: () => void\n onThemeChange?: (theme: ShellTheme) => void\n onWorkspaceChange?: (workspaceId: string) => void\n open?: boolean\n padded?: boolean\n renderLink?: ShellRenderLink\n settings?: ShellSettings\n theme?: ShellTheme\n user: ShellUser\n userActions?: ShellAction[]\n workspaceId: string\n workspaces: ShellWorkspace[]\n}\n",
63
+ "target": "~/packages/ui/src/blocks/application/shell/shared/types.ts"
64
+ },
65
+ {
66
+ "path": "blocks/application/shell/shared/user-menu.tsx",
67
+ "type": "registry:file",
68
+ "content": "'use client'\n\nimport { CaretUpDownIcon, SignOutIcon } from '@phosphor-icons/react'\nimport { Avatar, AvatarFallback, AvatarImage } from '@tc96/ui/avatar'\nimport { getInitials } from '@tc96/ui/helpers/initials'\nimport {\n Menu,\n MenuGroup,\n MenuGroupLabel,\n MenuItem,\n MenuPopup,\n MenuRadioGroup,\n MenuRadioItem,\n MenuSeparator,\n MenuTrigger,\n} from '@tc96/ui/menu'\nimport {\n SidebarMenu,\n SidebarMenuButton,\n SidebarMenuItem,\n useSidebar,\n} from '@tc96/ui/sidebar'\nimport type { ReactElement } from 'react'\nimport type { ShellAction, ShellLabels, ShellTheme, ShellUser } from './types'\n\nexport interface UserAvatarProps {\n user: ShellUser\n}\n\nexport function UserAvatar({ user }: Readonly<UserAvatarProps>): ReactElement {\n return (\n <Avatar>\n {user.avatarUrl ? <AvatarImage alt=\"\" src={user.avatarUrl} /> : null}\n <AvatarFallback className=\"text-foreground\">\n {getInitials(user.name)}\n </AvatarFallback>\n </Avatar>\n )\n}\n\nexport interface UserMenuProps {\n compact?: boolean\n labels: ShellLabels\n onSignOut?: () => void\n onThemeChange?: (theme: ShellTheme) => void\n theme?: ShellTheme\n user: ShellUser\n userActions?: ShellAction[]\n}\n\nexport function UserMenu({\n compact = false,\n labels,\n onSignOut,\n onThemeChange,\n theme,\n user,\n userActions,\n}: Readonly<UserMenuProps>): ReactElement {\n const { isMobile } = useSidebar()\n const themes: { label: string; value: ShellTheme }[] = [\n { label: labels.themeLight, value: 'light' },\n { label: labels.themeDark, value: 'dark' },\n { label: labels.themeSystem, value: 'system' },\n ]\n\n return (\n <SidebarMenu>\n <SidebarMenuItem>\n <Menu>\n <MenuTrigger\n render={\n <SidebarMenuButton\n className={compact ? 'h-8 p-0' : undefined}\n size=\"lg\"\n tooltip={\n compact\n ? { children: labels.account, hidden: false }\n : labels.account\n }\n />\n }\n >\n <UserAvatar user={user} />\n <span className=\"grid flex-1 text-start text-sm leading-tight\">\n <span className=\"truncate font-medium\">{user.name}</span>\n <span className=\"truncate text-xs\">{user.email}</span>\n </span>\n <CaretUpDownIcon aria-hidden=\"true\" className=\"ms-auto\" />\n </MenuTrigger>\n <MenuPopup\n align=\"end\"\n className=\"min-w-56\"\n side={isMobile ? 'bottom' : 'right'}\n >\n <MenuGroup>\n <MenuGroupLabel>{labels.account}</MenuGroupLabel>\n {userActions?.map((action) => (\n <MenuItem\n key={action.label}\n onClick={action.onSelect}\n variant={action.variant}\n >\n {action.icon}\n {action.label}\n </MenuItem>\n ))}\n </MenuGroup>\n {theme && onThemeChange ? (\n <>\n <MenuSeparator />\n <MenuGroup>\n <MenuGroupLabel>{labels.theme}</MenuGroupLabel>\n <MenuRadioGroup\n onValueChange={(value) =>\n onThemeChange(value as ShellTheme)\n }\n value={theme}\n >\n {themes.map((option) => (\n <MenuRadioItem key={option.value} value={option.value}>\n {option.label}\n </MenuRadioItem>\n ))}\n </MenuRadioGroup>\n </MenuGroup>\n </>\n ) : null}\n {onSignOut ? (\n <>\n <MenuSeparator />\n <MenuItem onClick={onSignOut}>\n <SignOutIcon aria-hidden=\"true\" />\n {labels.signOut}\n </MenuItem>\n </>\n ) : null}\n </MenuPopup>\n </Menu>\n </SidebarMenuItem>\n </SidebarMenu>\n )\n}\n",
69
+ "target": "~/packages/ui/src/blocks/application/shell/shared/user-menu.tsx"
70
+ },
71
+ {
72
+ "path": "blocks/application/shell/shared/workspace-switcher.tsx",
73
+ "type": "registry:file",
74
+ "content": "'use client'\n\nimport { CaretUpDownIcon } from '@phosphor-icons/react'\nimport { getInitials } from '@tc96/ui/helpers/initials'\nimport { IconFrame } from '@tc96/ui/icon-frame'\nimport {\n Menu,\n MenuGroup,\n MenuGroupLabel,\n MenuPopup,\n MenuRadioGroup,\n MenuRadioItem,\n MenuTrigger,\n} from '@tc96/ui/menu'\nimport {\n SidebarMenu,\n SidebarMenuButton,\n SidebarMenuItem,\n useSidebar,\n} from '@tc96/ui/sidebar'\nimport type { ReactElement } from 'react'\nimport type { ShellLabels, ShellWorkspace } from './types'\n\nexport interface WorkspaceLogoProps {\n workspace: ShellWorkspace\n}\n\nexport function WorkspaceLogo({\n workspace,\n}: Readonly<WorkspaceLogoProps>): ReactElement {\n return (\n <IconFrame\n aria-hidden\n className=\"size-8 bg-sidebar-primary text-sidebar-primary-foreground text-sm\"\n shape=\"rounded\"\n >\n {workspace.logo ?? getInitials(workspace.name, 1)}\n </IconFrame>\n )\n}\n\nexport interface WorkspaceSwitcherProps {\n compact?: boolean\n labels: ShellLabels\n onWorkspaceChange?: (workspaceId: string) => void\n workspaceId: string\n workspaces: ShellWorkspace[]\n}\n\nexport function WorkspaceSwitcher({\n compact = false,\n labels,\n onWorkspaceChange,\n workspaceId,\n workspaces,\n}: Readonly<WorkspaceSwitcherProps>): ReactElement | null {\n const { isMobile } = useSidebar()\n const active =\n workspaces.find((workspace) => workspace.id === workspaceId) ??\n workspaces[0]\n if (!active) return null\n\n return (\n <SidebarMenu>\n <SidebarMenuItem>\n <Menu>\n <MenuTrigger\n render={\n <SidebarMenuButton\n className={compact ? 'h-8 p-0' : undefined}\n size=\"lg\"\n tooltip={\n compact\n ? { children: active.name, hidden: false }\n : labels.switchWorkspace\n }\n />\n }\n >\n <WorkspaceLogo workspace={active} />\n <span className=\"grid flex-1 text-start text-sm leading-tight\">\n <span className=\"truncate font-medium\">{active.name}</span>\n {active.description ? (\n <span className=\"truncate text-xs\">{active.description}</span>\n ) : null}\n </span>\n <CaretUpDownIcon aria-hidden=\"true\" className=\"ms-auto\" />\n </MenuTrigger>\n <MenuPopup\n align=\"start\"\n className=\"min-w-56\"\n side={isMobile ? 'bottom' : 'right'}\n >\n <MenuGroup>\n <MenuGroupLabel>{labels.workspaces}</MenuGroupLabel>\n <MenuRadioGroup\n onValueChange={(value) => onWorkspaceChange?.(String(value))}\n value={active.id}\n >\n {workspaces.map((workspace) => (\n <MenuRadioItem\n closeOnClick\n key={workspace.id}\n value={workspace.id}\n >\n {workspace.name}\n </MenuRadioItem>\n ))}\n </MenuRadioGroup>\n </MenuGroup>\n </MenuPopup>\n </Menu>\n </SidebarMenuItem>\n </SidebarMenu>\n )\n}\n",
75
+ "target": "~/packages/ui/src/blocks/application/shell/shared/workspace-switcher.tsx"
76
+ },
77
+ {
78
+ "path": "helpers/initials.ts",
79
+ "type": "registry:file",
80
+ "content": "/**\n * Builds the initials shown in an avatar fallback: the first letter of the\n * first words of a label, upper-cased.\n *\n * @param label - A person or entity name; surrounding and repeated whitespace is ignored.\n * @param size - How many words contribute a letter. Defaults to two.\n * @returns The initials, or an empty string for a blank label.\n */\nexport function getInitials(label: string, size = 2): string {\n return label\n .split(/\\s+/)\n .filter(Boolean)\n .slice(0, size)\n .map((part) => part[0])\n .join('')\n .toUpperCase()\n}\n\n/**\n * Picks the text of an avatar fallback: the explicit fallback a person carries,\n * or the initials of its label when there is none.\n *\n * @param person - Anything with a `label` and an optional `fallback`.\n * @param size - How many words contribute a letter when the label is used. Defaults to two.\n * @returns The fallback as given (only `undefined` falls through, so an empty\n * string is kept), otherwise the initials of the label.\n */\nexport function resolveInitials(\n person: { label: string; fallback?: string },\n size = 2,\n): string {\n return person.fallback ?? getInitials(person.label, size)\n}\n",
81
+ "target": "~/packages/ui/src/helpers/initials.ts"
82
+ },
83
+ {
84
+ "path": "patterns/widgets/shared/progress-ring.tsx",
85
+ "type": "registry:file",
86
+ "content": "import { GaugeRing } from '@tc96/ui/gauge'\nimport { cn } from '@tc96/utils'\nimport type { ComponentProps, ReactElement, ReactNode } from 'react'\n\nexport interface ProgressRingProps\n extends Omit<ComponentProps<'div'>, 'children'> {\n children?: ReactNode\n empty?: boolean\n ratio: number\n strokeWidth?: number\n}\n\nexport function clampRatio(current: number, target: number): number {\n return target > 0 ? Math.min(Math.max(current / target, 0), 1) : 0\n}\n\nexport function ProgressRing({\n children,\n className,\n empty = false,\n ratio,\n strokeWidth = 10,\n ...props\n}: Readonly<ProgressRingProps>): ReactElement {\n return (\n <GaugeRing\n className={cn('size-10', className)}\n data-slot=\"progress-ring\"\n empty={empty}\n ratio={ratio}\n strokeWidth={strokeWidth}\n {...props}\n >\n {children}\n </GaugeRing>\n )\n}\n",
87
+ "target": "~/packages/ui/src/patterns/widgets/shared/progress-ring.tsx"
88
+ }
89
+ ],
90
+ "dependencies": [
91
+ "@phosphor-icons/react@2.1.10",
92
+ "react@19.1.1"
93
+ ],
94
+ "registryDependencies": [
95
+ "@ui/avatar",
96
+ "@ui/badge",
97
+ "@ui/breadcrumb",
98
+ "@ui/button",
99
+ "@ui/collapsible",
100
+ "@ui/gauge",
101
+ "@ui/icon-frame",
102
+ "@ui/menu",
103
+ "@ui/popover",
104
+ "@ui/render-anchor",
105
+ "@ui/separator",
106
+ "@ui/sidebar"
107
+ ],
108
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json"
109
+ }
@@ -0,0 +1,104 @@
1
+ {
2
+ "name": "app-shell-4",
3
+ "type": "registry:block",
4
+ "files": [
5
+ {
6
+ "path": "blocks/application/shell/app-shell-4/app-shell-4.tsx",
7
+ "type": "registry:file",
8
+ "content": "'use client'\n\nimport { MagnifyingGlassIcon } from '@phosphor-icons/react'\nimport { Button } from '@tc96/ui/button'\nimport { renderAnchor } from '@tc96/ui/render-anchor'\nimport { Separator } from '@tc96/ui/separator'\nimport {\n Sidebar,\n SidebarContent,\n SidebarFooter,\n SidebarHeader,\n SidebarInset,\n SidebarProvider,\n} from '@tc96/ui/sidebar'\nimport { cn } from '@tc96/utils'\nimport type { CSSProperties, ReactElement } from 'react'\nimport { resolveShellLabels } from '../shared/labels'\nimport { ShellBackButton } from '../shared/shell-back-button'\nimport { ShellHeader } from '../shared/shell-header'\nimport { ShellNav } from '../shared/shell-nav'\nimport { ShellNotifications } from '../shared/shell-notifications'\nimport { ShellSearch, ShellSearchShortcut } from '../shared/shell-search'\nimport type { AppShellBaseProps, ShellNotification } from '../shared/types'\nimport { UserMenu } from '../shared/user-menu'\nimport { WorkspaceSwitcher } from '../shared/workspace-switcher'\nimport { SectionRail, type ShellSection } from './section-rail'\n\nexport interface AppShell4Props extends Omit<AppShellBaseProps, 'navigation'> {\n notifications?: ShellNotification[]\n onMarkAllRead?: () => void\n onNavigate?: (href: string) => void\n onNotificationSelect?: (notificationId: string) => void\n onSectionChange?: (sectionId: string) => void\n sectionId: string\n sections: ShellSection[]\n}\n\nconst sidebarWidth = {\n '--sidebar-width': 'calc(var(--sidebar-width-icon) + 16rem)',\n} as CSSProperties\n\nexport function AppShell4({\n actions,\n breadcrumbs,\n children,\n defaultOpen,\n labels: labelsProp,\n notifications,\n onMarkAllRead,\n onNavigate,\n onNotificationSelect,\n onOpenChange,\n onSectionChange,\n onSignOut,\n onThemeChange,\n onWorkspaceChange,\n open,\n padded = true,\n renderLink = renderAnchor,\n sectionId,\n sections,\n settings,\n theme,\n user,\n userActions,\n workspaceId,\n workspaces,\n}: Readonly<AppShell4Props>): ReactElement {\n const labels = resolveShellLabels(labelsProp)\n const active =\n sections.find((section) => section.id === sectionId) ?? sections[0]\n const searchGroups = sections.map((section) => ({\n items: section.navigation.flatMap((group) => group.items),\n label: section.title,\n }))\n\n return (\n <SidebarProvider\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n open={open}\n style={sidebarWidth}\n >\n <Sidebar\n className=\"overflow-hidden *:data-[sidebar=sidebar]:flex-row\"\n collapsible=\"icon\"\n >\n <Sidebar className=\"w-(--sidebar-width-icon)\" collapsible=\"none\">\n <SidebarHeader>\n <WorkspaceSwitcher\n compact\n labels={labels}\n onWorkspaceChange={onWorkspaceChange}\n workspaceId={workspaceId}\n workspaces={workspaces}\n />\n </SidebarHeader>\n <SidebarContent className=\"px-2\">\n <SectionRail\n label={labels.sections}\n onSectionChange={onSectionChange}\n sectionId={settings ? '' : (active?.id ?? sectionId)}\n sections={sections}\n />\n </SidebarContent>\n <SidebarFooter>\n <UserMenu\n compact\n labels={labels}\n onSignOut={onSignOut}\n onThemeChange={onThemeChange}\n theme={theme}\n user={user}\n userActions={userActions}\n />\n </SidebarFooter>\n </Sidebar>\n <Separator orientation=\"vertical\" />\n <Sidebar className=\"min-w-0 flex-1\" collapsible=\"none\">\n {settings ? (\n <>\n <SidebarHeader className=\"h-14 justify-center\">\n <ShellBackButton\n labels={labels}\n renderLink={renderLink}\n settings={settings}\n />\n </SidebarHeader>\n <SidebarContent>\n <ShellNav\n groups={settings.navigation}\n label={labels.settingsNavigation}\n labels={labels}\n renderLink={renderLink}\n />\n </SidebarContent>\n </>\n ) : null}\n {!settings && active ? (\n <>\n <SidebarHeader className=\"h-14 justify-center px-4\">\n <h2 className=\"truncate font-medium text-base\">\n {active.title}\n </h2>\n </SidebarHeader>\n <SidebarContent>\n <ShellNav\n groups={active.navigation}\n label={active.title}\n labels={labels}\n renderLink={renderLink}\n />\n </SidebarContent>\n </>\n ) : null}\n </Sidebar>\n </Sidebar>\n <SidebarInset className=\"min-w-0\">\n <ShellHeader\n actions={\n <>\n <ShellSearch\n groups={searchGroups}\n labels={labels}\n onNavigate={onNavigate}\n trigger={<Button size=\"sm\" variant=\"outline\" />}\n >\n <MagnifyingGlassIcon aria-hidden=\"true\" />\n <span className=\"max-sm:sr-only\">{labels.search}</span>\n <span className=\"max-sm:hidden\">\n <ShellSearchShortcut />\n </span>\n </ShellSearch>\n {notifications ? (\n <ShellNotifications\n labels={labels}\n notifications={notifications}\n onMarkAllRead={onMarkAllRead}\n onNotificationSelect={onNotificationSelect}\n />\n ) : null}\n {actions}\n </>\n }\n breadcrumbs={breadcrumbs}\n labels={labels}\n renderLink={renderLink}\n />\n <div className={cn('flex flex-1 flex-col', padded && 'gap-4 p-4')}>\n {children}\n </div>\n </SidebarInset>\n </SidebarProvider>\n )\n}\n",
9
+ "target": "~/packages/ui/src/blocks/application/shell/app-shell-4/app-shell-4.tsx"
10
+ },
11
+ {
12
+ "path": "blocks/application/shell/app-shell-4/index.ts",
13
+ "type": "registry:file",
14
+ "content": "export type {\n ShellAction,\n ShellBreadcrumbItem,\n ShellLabels,\n ShellNavGroup,\n ShellNavItem,\n ShellNavSubItem,\n ShellNotification,\n ShellRenderLink,\n ShellSettings,\n ShellTheme,\n ShellUser,\n ShellWorkspace,\n} from '../shared/types'\nexport { AppShell4, type AppShell4Props } from './app-shell-4'\nexport type { ShellSection } from './section-rail'\n",
15
+ "target": "~/packages/ui/src/blocks/application/shell/app-shell-4/index.ts"
16
+ },
17
+ {
18
+ "path": "blocks/application/shell/app-shell-4/section-rail.tsx",
19
+ "type": "registry:file",
20
+ "content": "'use client'\n\nimport {\n SidebarMenu,\n SidebarMenuButton,\n SidebarMenuItem,\n useSidebar,\n} from '@tc96/ui/sidebar'\nimport type { ReactElement, ReactNode } from 'react'\nimport type { ShellNavGroup } from '../shared/types'\n\nexport interface ShellSection {\n icon: ReactNode\n id: string\n navigation: ShellNavGroup[]\n title: string\n}\n\nexport interface SectionRailProps {\n label: string\n onSectionChange?: (sectionId: string) => void\n sectionId: string\n sections: ShellSection[]\n}\n\nexport function SectionRail({\n label,\n onSectionChange,\n sectionId,\n sections,\n}: Readonly<SectionRailProps>): ReactElement {\n const { setOpen } = useSidebar()\n\n return (\n <nav aria-label={label}>\n <SidebarMenu>\n {sections.map((section) => (\n <SidebarMenuItem key={section.id}>\n <SidebarMenuButton\n aria-pressed={section.id === sectionId}\n className=\"px-2\"\n isActive={section.id === sectionId}\n onClick={() => {\n onSectionChange?.(section.id)\n setOpen(true)\n }}\n tooltip={{ children: section.title, hidden: false }}\n >\n {section.icon}\n <span>{section.title}</span>\n </SidebarMenuButton>\n </SidebarMenuItem>\n ))}\n </SidebarMenu>\n </nav>\n )\n}\n",
21
+ "target": "~/packages/ui/src/blocks/application/shell/app-shell-4/section-rail.tsx"
22
+ },
23
+ {
24
+ "path": "blocks/application/shell/shared/labels.ts",
25
+ "type": "registry:file",
26
+ "content": "import type { ShellLabels } from './types'\n\nexport const defaultShellLabels: ShellLabels = {\n account: 'Conta',\n backToApp: 'Voltar ao app',\n breadcrumb: 'Trilha de navegação',\n itemActions: (title) => `Ações de ${title}`,\n markAllRead: 'Marcar todas como lidas',\n navigation: 'Navegação principal',\n notifications: 'Notificações',\n notificationsEmpty: 'Nenhuma notificação.',\n notificationsTrigger: (unread) =>\n unread ? `Notificações, ${unread} não lidas` : 'Notificações',\n projects: 'Projetos',\n search: 'Buscar',\n searchClose: 'Fechar',\n searchEmpty: 'Nenhuma página encontrada.',\n searchNavigate: 'Navegar',\n searchOpen: 'Abrir',\n searchPlaceholder: 'Buscar páginas…',\n sections: 'Seções',\n settingsNavigation: 'Navegação de configurações',\n signOut: 'Sair',\n switchWorkspace: 'Trocar workspace',\n theme: 'Tema',\n themeDark: 'Escuro',\n themeLight: 'Claro',\n themeSystem: 'Sistema',\n toggleSidebar: 'Alternar barra lateral',\n unread: 'Não lida',\n workspaces: 'Workspaces',\n}\n\nexport function resolveShellLabels(labels?: Partial<ShellLabels>): ShellLabels {\n return { ...defaultShellLabels, ...labels }\n}\n",
27
+ "target": "~/packages/ui/src/blocks/application/shell/shared/labels.ts"
28
+ },
29
+ {
30
+ "path": "blocks/application/shell/shared/shell-back-button.tsx",
31
+ "type": "registry:file",
32
+ "content": "'use client'\n\nimport { ArrowLeftIcon } from '@phosphor-icons/react'\nimport {\n SidebarMenu,\n SidebarMenuButton,\n SidebarMenuItem,\n} from '@tc96/ui/sidebar'\nimport type { ReactElement } from 'react'\nimport type { ShellLabels, ShellRenderLink, ShellSettings } from './types'\n\nexport interface ShellBackButtonProps {\n labels: ShellLabels\n renderLink: ShellRenderLink\n settings: ShellSettings\n}\n\nexport function ShellBackButton({\n labels,\n renderLink,\n settings,\n}: Readonly<ShellBackButtonProps>): ReactElement {\n return (\n <SidebarMenu>\n <SidebarMenuItem>\n <SidebarMenuButton\n onClick={settings.onBack}\n render={settings.backHref ? renderLink(settings.backHref) : undefined}\n tooltip={labels.backToApp}\n type={settings.backHref ? undefined : 'button'}\n >\n <ArrowLeftIcon aria-hidden=\"true\" />\n <span>{labels.backToApp}</span>\n </SidebarMenuButton>\n </SidebarMenuItem>\n </SidebarMenu>\n )\n}\n",
33
+ "target": "~/packages/ui/src/blocks/application/shell/shared/shell-back-button.tsx"
34
+ },
35
+ {
36
+ "path": "blocks/application/shell/shared/shell-header.tsx",
37
+ "type": "registry:file",
38
+ "content": "'use client'\n\nimport {\n Breadcrumb,\n BreadcrumbItem,\n BreadcrumbLink,\n BreadcrumbList,\n BreadcrumbPage,\n BreadcrumbSeparator,\n} from '@tc96/ui/breadcrumb'\nimport { Separator } from '@tc96/ui/separator'\nimport { SidebarTrigger } from '@tc96/ui/sidebar'\nimport { Fragment, type ReactElement, type ReactNode } from 'react'\nimport type { ShellBreadcrumbItem, ShellLabels, ShellRenderLink } from './types'\n\nexport interface ShellBreadcrumbProps {\n items: ShellBreadcrumbItem[]\n labels: ShellLabels\n renderLink: ShellRenderLink\n}\n\nexport function ShellBreadcrumb({\n items,\n labels,\n renderLink,\n}: Readonly<ShellBreadcrumbProps>): ReactElement {\n return (\n <Breadcrumb aria-label={labels.breadcrumb}>\n <BreadcrumbList>\n {items.map((item, index) => {\n const current = index === items.length - 1\n return (\n <Fragment key={`${index}-${item.label}`}>\n <BreadcrumbItem\n className={current ? undefined : 'hidden md:inline-flex'}\n >\n {current ? <BreadcrumbPage>{item.label}</BreadcrumbPage> : null}\n {!current && item.href ? (\n <BreadcrumbLink render={renderLink(item.href)}>\n {item.label}\n </BreadcrumbLink>\n ) : null}\n {!current && !item.href ? item.label : null}\n </BreadcrumbItem>\n {current ? null : (\n <BreadcrumbSeparator className=\"hidden md:inline-flex\" />\n )}\n </Fragment>\n )\n })}\n </BreadcrumbList>\n </Breadcrumb>\n )\n}\n\nexport interface ShellHeaderProps {\n actions?: ReactNode\n breadcrumbs?: ShellBreadcrumbItem[]\n children?: ReactNode\n labels: ShellLabels\n renderLink: ShellRenderLink\n}\n\nexport function ShellHeader({\n actions,\n breadcrumbs,\n children,\n labels,\n renderLink,\n}: Readonly<ShellHeaderProps>): ReactElement {\n return (\n <header className=\"flex h-14 shrink-0 items-center gap-2 border-b px-4\">\n <SidebarTrigger aria-label={labels.toggleSidebar} className=\"-ms-1\" />\n {breadcrumbs?.length ? (\n <>\n <Separator className=\"me-2 h-4\" orientation=\"vertical\" />\n <ShellBreadcrumb\n items={breadcrumbs}\n labels={labels}\n renderLink={renderLink}\n />\n </>\n ) : null}\n {children}\n {actions ? (\n <div className=\"ms-auto flex items-center gap-2\">{actions}</div>\n ) : null}\n </header>\n )\n}\n",
39
+ "target": "~/packages/ui/src/blocks/application/shell/shared/shell-header.tsx"
40
+ },
41
+ {
42
+ "path": "blocks/application/shell/shared/shell-nav.tsx",
43
+ "type": "registry:file",
44
+ "content": "'use client'\n\nimport { CaretRightIcon, DotsThreeIcon } from '@phosphor-icons/react'\nimport {\n Collapsible,\n CollapsiblePanel,\n CollapsibleTrigger,\n} from '@tc96/ui/collapsible'\nimport { Menu, MenuItem, MenuPopup, MenuTrigger } from '@tc96/ui/menu'\nimport {\n SidebarGroup,\n SidebarGroupLabel,\n SidebarMenu,\n SidebarMenuAction,\n SidebarMenuBadge,\n SidebarMenuButton,\n SidebarMenuItem,\n SidebarMenuSub,\n SidebarMenuSubButton,\n SidebarMenuSubItem,\n} from '@tc96/ui/sidebar'\nimport { type ReactElement, useId } from 'react'\nimport type {\n ShellLabels,\n ShellNavGroup,\n ShellNavItem,\n ShellRenderLink,\n} from './types'\n\ninterface ShellNavItemProps {\n item: ShellNavItem\n labels: ShellLabels\n renderLink: ShellRenderLink\n}\n\nfunction ShellNavLeaf({\n item,\n labels,\n renderLink,\n}: Readonly<ShellNavItemProps>): ReactElement {\n const hasActions = Boolean(item.actions?.length)\n\n return (\n <SidebarMenuItem>\n <SidebarMenuButton\n aria-current={item.active ? 'page' : undefined}\n isActive={item.active}\n render={item.href ? renderLink(item.href) : undefined}\n tooltip={item.title}\n >\n {item.icon}\n <span>{item.title}</span>\n </SidebarMenuButton>\n {hasActions ? (\n <Menu>\n <MenuTrigger\n render={\n <SidebarMenuAction\n aria-label={labels.itemActions(item.title)}\n showOnHover\n />\n }\n >\n <DotsThreeIcon aria-hidden=\"true\" />\n </MenuTrigger>\n <MenuPopup align=\"start\" side=\"right\">\n {item.actions?.map((action) => (\n <MenuItem\n key={action.label}\n onClick={action.onSelect}\n variant={action.variant}\n >\n {action.icon}\n {action.label}\n </MenuItem>\n ))}\n </MenuPopup>\n </Menu>\n ) : null}\n {!hasActions && item.badge !== undefined ? (\n <SidebarMenuBadge>{item.badge}</SidebarMenuBadge>\n ) : null}\n </SidebarMenuItem>\n )\n}\n\nfunction ShellNavBranch({\n item,\n renderLink,\n}: Readonly<ShellNavItemProps>): ReactElement {\n const open = Boolean(item.active || item.items?.some((sub) => sub.active))\n\n return (\n <SidebarMenuItem>\n <Collapsible defaultOpen={open}>\n <CollapsibleTrigger\n render={\n <SidebarMenuButton isActive={item.active} tooltip={item.title} />\n }\n >\n {item.icon}\n <span>{item.title}</span>\n <CaretRightIcon\n aria-hidden=\"true\"\n className=\"ms-auto transition-transform in-data-panel-open:rotate-90\"\n />\n </CollapsibleTrigger>\n <CollapsiblePanel>\n <SidebarMenuSub>\n {item.items?.map((sub) => (\n <SidebarMenuSubItem key={sub.href}>\n <SidebarMenuSubButton\n aria-current={sub.active ? 'page' : undefined}\n isActive={sub.active}\n render={renderLink(sub.href)}\n >\n <span className=\"truncate\">{sub.title}</span>\n {sub.badge !== undefined ? (\n <SidebarMenuBadge className=\"static ms-auto text-current\">\n {sub.badge}\n </SidebarMenuBadge>\n ) : null}\n </SidebarMenuSubButton>\n </SidebarMenuSubItem>\n ))}\n </SidebarMenuSub>\n </CollapsiblePanel>\n </Collapsible>\n </SidebarMenuItem>\n )\n}\n\ninterface ShellNavSectionProps {\n group: ShellNavGroup\n labels: ShellLabels\n renderLink: ShellRenderLink\n}\n\nfunction ShellNavSection({\n group,\n labels,\n renderLink,\n}: Readonly<ShellNavSectionProps>): ReactElement {\n const labelId = useId()\n\n return (\n <SidebarGroup>\n <SidebarGroupLabel id={labelId}>{group.label}</SidebarGroupLabel>\n <SidebarMenu aria-labelledby={labelId}>\n {group.items.map((item) =>\n item.items?.length ? (\n <ShellNavBranch\n item={item}\n key={item.title}\n labels={labels}\n renderLink={renderLink}\n />\n ) : (\n <ShellNavLeaf\n item={item}\n key={item.title}\n labels={labels}\n renderLink={renderLink}\n />\n ),\n )}\n </SidebarMenu>\n </SidebarGroup>\n )\n}\n\nexport interface ShellNavProps {\n groups: ShellNavGroup[]\n label: string\n labels: ShellLabels\n renderLink: ShellRenderLink\n}\n\nexport function ShellNav({\n groups,\n label,\n labels,\n renderLink,\n}: Readonly<ShellNavProps>): ReactElement {\n return (\n <nav aria-label={label}>\n {groups.map((group) => (\n <ShellNavSection\n group={group}\n key={group.label}\n labels={labels}\n renderLink={renderLink}\n />\n ))}\n </nav>\n )\n}\n",
45
+ "target": "~/packages/ui/src/blocks/application/shell/shared/shell-nav.tsx"
46
+ },
47
+ {
48
+ "path": "blocks/application/shell/shared/shell-notifications.tsx",
49
+ "type": "registry:file",
50
+ "content": "'use client'\n\nimport { BellIcon } from '@phosphor-icons/react'\nimport { Badge } from '@tc96/ui/badge'\nimport { Button } from '@tc96/ui/button'\nimport {\n Popover,\n PopoverPopup,\n PopoverTitle,\n PopoverTrigger,\n} from '@tc96/ui/popover'\nimport { cn } from '@tc96/utils'\nimport type { ReactElement } from 'react'\nimport type { ShellLabels, ShellNotification } from './types'\n\nexport interface ShellNotificationsProps {\n labels: ShellLabels\n notifications: ShellNotification[]\n onMarkAllRead?: () => void\n onNotificationSelect?: (notificationId: string) => void\n}\n\nexport function ShellNotifications({\n labels,\n notifications,\n onMarkAllRead,\n onNotificationSelect,\n}: Readonly<ShellNotificationsProps>): ReactElement {\n const unread = notifications.filter(\n (notification) => notification.unread,\n ).length\n\n return (\n <Popover>\n <PopoverTrigger\n render={\n <Button\n aria-label={labels.notificationsTrigger(unread)}\n className=\"relative\"\n size=\"icon\"\n variant=\"ghost\"\n />\n }\n >\n <BellIcon aria-hidden=\"true\" />\n {unread ? (\n <Badge aria-hidden className=\"absolute -end-1 -top-1\">\n {unread}\n </Badge>\n ) : null}\n </PopoverTrigger>\n <PopoverPopup align=\"end\" className=\"w-80\">\n <div className=\"flex items-center justify-between gap-2\">\n <PopoverTitle>{labels.notifications}</PopoverTitle>\n {onMarkAllRead && unread ? (\n <Button onClick={onMarkAllRead} size=\"sm\" variant=\"ghost\">\n {labels.markAllRead}\n </Button>\n ) : null}\n </div>\n {notifications.length ? (\n <ul className=\"-mx-2 mt-2 flex flex-col\">\n {notifications.map((notification) => (\n <li key={notification.id}>\n <button\n className=\"flex w-full gap-3 rounded-md px-2 py-2 text-start hover:bg-accent\"\n onClick={() => onNotificationSelect?.(notification.id)}\n type=\"button\"\n >\n <span\n aria-hidden\n className={cn(\n 'mt-1.5 size-2 shrink-0 rounded-full',\n notification.unread ? 'bg-primary' : 'bg-transparent',\n )}\n />\n <span className=\"flex min-w-0 flex-col gap-0.5\">\n <span className=\"font-medium text-sm\">\n {notification.title}\n </span>\n {notification.description ? (\n <span className=\"text-muted-foreground text-sm\">\n {notification.description}\n </span>\n ) : null}\n <span className=\"text-muted-foreground text-xs\">\n {notification.time}\n {notification.unread ? (\n <span className=\"sr-only\">, {labels.unread}</span>\n ) : null}\n </span>\n </span>\n </button>\n </li>\n ))}\n </ul>\n ) : (\n <p className=\"mt-2 text-muted-foreground text-sm\">\n {labels.notificationsEmpty}\n </p>\n )}\n </PopoverPopup>\n </Popover>\n )\n}\n",
51
+ "target": "~/packages/ui/src/blocks/application/shell/shared/shell-notifications.tsx"
52
+ },
53
+ {
54
+ "path": "blocks/application/shell/shared/shell-search.tsx",
55
+ "type": "registry:file",
56
+ "content": "'use client'\n\nimport {\n ArrowDownIcon,\n ArrowElbowDownLeftIcon,\n ArrowUpIcon,\n} from '@phosphor-icons/react'\nimport {\n Command,\n CommandCollection,\n CommandDialog,\n CommandDialogPopup,\n CommandDialogTrigger,\n CommandEmpty,\n CommandFooter,\n CommandGroup,\n CommandGroupLabel,\n CommandInput,\n CommandItem,\n CommandList,\n CommandPanel,\n} from '@tc96/ui/command'\nimport { Kbd, KbdGroup } from '@tc96/ui/kbd'\nimport {\n type ReactElement,\n type ReactNode,\n useEffect,\n useMemo,\n useState,\n} from 'react'\nimport type { ShellLabels, ShellNavGroup } from './types'\n\ninterface ShellRoute {\n label: string\n value: string\n}\n\ninterface ShellRouteGroup {\n items: ShellRoute[]\n value: string\n}\n\nexport function toShellRoutes(groups: ShellNavGroup[]): ShellRouteGroup[] {\n return groups\n .map((group) => ({\n items: group.items.flatMap((item) => [\n ...(item.href ? [{ label: item.title, value: item.href }] : []),\n ...(item.items ?? []).map((sub) => ({\n label: `${item.title} / ${sub.title}`,\n value: sub.href,\n })),\n ]),\n value: group.label,\n }))\n .filter((group) => group.items.length)\n}\n\nexport function ShellSearchShortcut(): ReactElement {\n return (\n <KbdGroup>\n <Kbd>⌘</Kbd>\n <Kbd>K</Kbd>\n </KbdGroup>\n )\n}\n\nexport interface ShellSearchProps {\n children: ReactNode\n groups: ShellNavGroup[]\n labels: ShellLabels\n onNavigate?: (href: string) => void\n trigger: ReactElement\n}\n\nexport function ShellSearch({\n children,\n groups,\n labels,\n onNavigate,\n trigger,\n}: Readonly<ShellSearchProps>): ReactElement {\n const [open, setOpen] = useState(false)\n const routes = useMemo(() => toShellRoutes(groups), [groups])\n\n useEffect(() => {\n const toggle = (event: KeyboardEvent) => {\n if (event.key.toLowerCase() === 'k' && (event.metaKey || event.ctrlKey)) {\n event.preventDefault()\n setOpen((current) => !current)\n }\n }\n document.addEventListener('keydown', toggle)\n return () => document.removeEventListener('keydown', toggle)\n }, [])\n\n return (\n <CommandDialog onOpenChange={setOpen} open={open}>\n <CommandDialogTrigger render={trigger}>{children}</CommandDialogTrigger>\n <CommandDialogPopup aria-label={labels.search}>\n <Command items={routes}>\n <CommandInput\n aria-label={labels.search}\n placeholder={labels.searchPlaceholder}\n />\n <CommandPanel>\n <CommandEmpty>{labels.searchEmpty}</CommandEmpty>\n <CommandList>\n {(group: ShellRouteGroup) => (\n <CommandGroup items={group.items} key={group.value}>\n <CommandGroupLabel>{group.value}</CommandGroupLabel>\n <CommandCollection>\n {(route: ShellRoute) => (\n <CommandItem\n key={route.value}\n onClick={() => {\n setOpen(false)\n onNavigate?.(route.value)\n }}\n value={route}\n >\n {route.label}\n </CommandItem>\n )}\n </CommandCollection>\n </CommandGroup>\n )}\n </CommandList>\n </CommandPanel>\n <CommandFooter>\n <span className=\"flex items-center gap-2\">\n <KbdGroup>\n <Kbd>\n <ArrowUpIcon aria-hidden=\"true\" />\n </Kbd>\n <Kbd>\n <ArrowDownIcon aria-hidden=\"true\" />\n </Kbd>\n </KbdGroup>\n {labels.searchNavigate}\n </span>\n <span className=\"flex items-center gap-2\">\n <Kbd>\n <ArrowElbowDownLeftIcon aria-hidden=\"true\" />\n </Kbd>\n {labels.searchOpen}\n </span>\n <span className=\"flex items-center gap-2\">\n <Kbd>Esc</Kbd>\n {labels.searchClose}\n </span>\n </CommandFooter>\n </Command>\n </CommandDialogPopup>\n </CommandDialog>\n )\n}\n",
57
+ "target": "~/packages/ui/src/blocks/application/shell/shared/shell-search.tsx"
58
+ },
59
+ {
60
+ "path": "blocks/application/shell/shared/types.ts",
61
+ "type": "registry:file",
62
+ "content": "import type { RenderLink } from '@tc96/ui/render-anchor'\nimport type { ReactNode } from 'react'\n\nexport type ShellRenderLink = RenderLink\n\nexport interface ShellAction {\n icon?: ReactNode\n label: string\n onSelect: () => void\n variant?: 'default' | 'destructive'\n}\n\nexport interface ShellNavSubItem {\n active?: boolean\n badge?: ReactNode\n href: string\n title: string\n}\n\nexport interface ShellNavItem {\n actions?: ShellAction[]\n active?: boolean\n badge?: ReactNode\n href?: string\n icon?: ReactNode\n items?: ShellNavSubItem[]\n title: string\n}\n\nexport interface ShellNavGroup {\n items: ShellNavItem[]\n label: string\n}\n\nexport interface ShellWorkspace {\n description?: string\n id: string\n logo?: ReactNode\n name: string\n}\n\nexport interface ShellUser {\n avatarUrl?: string\n email: string\n name: string\n}\n\nexport interface ShellBreadcrumbItem {\n href?: string\n label: string\n}\n\nexport type ShellTheme = 'light' | 'dark' | 'system'\n\nexport interface ShellNotification {\n description?: string\n id: string\n time: string\n title: string\n unread?: boolean\n}\n\nexport interface ShellLabels {\n account: string\n backToApp: string\n breadcrumb: string\n itemActions: (title: string) => string\n markAllRead: string\n navigation: string\n notifications: string\n notificationsEmpty: string\n notificationsTrigger: (unread: number) => string\n projects: string\n search: string\n searchClose: string\n searchEmpty: string\n searchNavigate: string\n searchOpen: string\n searchPlaceholder: string\n sections: string\n settingsNavigation: string\n signOut: string\n switchWorkspace: string\n theme: string\n themeDark: string\n themeLight: string\n themeSystem: string\n toggleSidebar: string\n unread: string\n workspaces: string\n}\n\nexport type ShellSettings = { navigation: ShellNavGroup[] } & (\n | { backHref: string; onBack?: never }\n | { backHref?: never; onBack: () => void }\n)\n\nexport interface AppShellBaseProps {\n actions?: ReactNode\n breadcrumbs?: ShellBreadcrumbItem[]\n children?: ReactNode\n defaultOpen?: boolean\n labels?: Partial<ShellLabels>\n navigation: ShellNavGroup[]\n onOpenChange?: (open: boolean) => void\n onSignOut?: () => void\n onThemeChange?: (theme: ShellTheme) => void\n onWorkspaceChange?: (workspaceId: string) => void\n open?: boolean\n padded?: boolean\n renderLink?: ShellRenderLink\n settings?: ShellSettings\n theme?: ShellTheme\n user: ShellUser\n userActions?: ShellAction[]\n workspaceId: string\n workspaces: ShellWorkspace[]\n}\n",
63
+ "target": "~/packages/ui/src/blocks/application/shell/shared/types.ts"
64
+ },
65
+ {
66
+ "path": "blocks/application/shell/shared/user-menu.tsx",
67
+ "type": "registry:file",
68
+ "content": "'use client'\n\nimport { CaretUpDownIcon, SignOutIcon } from '@phosphor-icons/react'\nimport { Avatar, AvatarFallback, AvatarImage } from '@tc96/ui/avatar'\nimport { getInitials } from '@tc96/ui/helpers/initials'\nimport {\n Menu,\n MenuGroup,\n MenuGroupLabel,\n MenuItem,\n MenuPopup,\n MenuRadioGroup,\n MenuRadioItem,\n MenuSeparator,\n MenuTrigger,\n} from '@tc96/ui/menu'\nimport {\n SidebarMenu,\n SidebarMenuButton,\n SidebarMenuItem,\n useSidebar,\n} from '@tc96/ui/sidebar'\nimport type { ReactElement } from 'react'\nimport type { ShellAction, ShellLabels, ShellTheme, ShellUser } from './types'\n\nexport interface UserAvatarProps {\n user: ShellUser\n}\n\nexport function UserAvatar({ user }: Readonly<UserAvatarProps>): ReactElement {\n return (\n <Avatar>\n {user.avatarUrl ? <AvatarImage alt=\"\" src={user.avatarUrl} /> : null}\n <AvatarFallback className=\"text-foreground\">\n {getInitials(user.name)}\n </AvatarFallback>\n </Avatar>\n )\n}\n\nexport interface UserMenuProps {\n compact?: boolean\n labels: ShellLabels\n onSignOut?: () => void\n onThemeChange?: (theme: ShellTheme) => void\n theme?: ShellTheme\n user: ShellUser\n userActions?: ShellAction[]\n}\n\nexport function UserMenu({\n compact = false,\n labels,\n onSignOut,\n onThemeChange,\n theme,\n user,\n userActions,\n}: Readonly<UserMenuProps>): ReactElement {\n const { isMobile } = useSidebar()\n const themes: { label: string; value: ShellTheme }[] = [\n { label: labels.themeLight, value: 'light' },\n { label: labels.themeDark, value: 'dark' },\n { label: labels.themeSystem, value: 'system' },\n ]\n\n return (\n <SidebarMenu>\n <SidebarMenuItem>\n <Menu>\n <MenuTrigger\n render={\n <SidebarMenuButton\n className={compact ? 'h-8 p-0' : undefined}\n size=\"lg\"\n tooltip={\n compact\n ? { children: labels.account, hidden: false }\n : labels.account\n }\n />\n }\n >\n <UserAvatar user={user} />\n <span className=\"grid flex-1 text-start text-sm leading-tight\">\n <span className=\"truncate font-medium\">{user.name}</span>\n <span className=\"truncate text-xs\">{user.email}</span>\n </span>\n <CaretUpDownIcon aria-hidden=\"true\" className=\"ms-auto\" />\n </MenuTrigger>\n <MenuPopup\n align=\"end\"\n className=\"min-w-56\"\n side={isMobile ? 'bottom' : 'right'}\n >\n <MenuGroup>\n <MenuGroupLabel>{labels.account}</MenuGroupLabel>\n {userActions?.map((action) => (\n <MenuItem\n key={action.label}\n onClick={action.onSelect}\n variant={action.variant}\n >\n {action.icon}\n {action.label}\n </MenuItem>\n ))}\n </MenuGroup>\n {theme && onThemeChange ? (\n <>\n <MenuSeparator />\n <MenuGroup>\n <MenuGroupLabel>{labels.theme}</MenuGroupLabel>\n <MenuRadioGroup\n onValueChange={(value) =>\n onThemeChange(value as ShellTheme)\n }\n value={theme}\n >\n {themes.map((option) => (\n <MenuRadioItem key={option.value} value={option.value}>\n {option.label}\n </MenuRadioItem>\n ))}\n </MenuRadioGroup>\n </MenuGroup>\n </>\n ) : null}\n {onSignOut ? (\n <>\n <MenuSeparator />\n <MenuItem onClick={onSignOut}>\n <SignOutIcon aria-hidden=\"true\" />\n {labels.signOut}\n </MenuItem>\n </>\n ) : null}\n </MenuPopup>\n </Menu>\n </SidebarMenuItem>\n </SidebarMenu>\n )\n}\n",
69
+ "target": "~/packages/ui/src/blocks/application/shell/shared/user-menu.tsx"
70
+ },
71
+ {
72
+ "path": "blocks/application/shell/shared/workspace-switcher.tsx",
73
+ "type": "registry:file",
74
+ "content": "'use client'\n\nimport { CaretUpDownIcon } from '@phosphor-icons/react'\nimport { getInitials } from '@tc96/ui/helpers/initials'\nimport { IconFrame } from '@tc96/ui/icon-frame'\nimport {\n Menu,\n MenuGroup,\n MenuGroupLabel,\n MenuPopup,\n MenuRadioGroup,\n MenuRadioItem,\n MenuTrigger,\n} from '@tc96/ui/menu'\nimport {\n SidebarMenu,\n SidebarMenuButton,\n SidebarMenuItem,\n useSidebar,\n} from '@tc96/ui/sidebar'\nimport type { ReactElement } from 'react'\nimport type { ShellLabels, ShellWorkspace } from './types'\n\nexport interface WorkspaceLogoProps {\n workspace: ShellWorkspace\n}\n\nexport function WorkspaceLogo({\n workspace,\n}: Readonly<WorkspaceLogoProps>): ReactElement {\n return (\n <IconFrame\n aria-hidden\n className=\"size-8 bg-sidebar-primary text-sidebar-primary-foreground text-sm\"\n shape=\"rounded\"\n >\n {workspace.logo ?? getInitials(workspace.name, 1)}\n </IconFrame>\n )\n}\n\nexport interface WorkspaceSwitcherProps {\n compact?: boolean\n labels: ShellLabels\n onWorkspaceChange?: (workspaceId: string) => void\n workspaceId: string\n workspaces: ShellWorkspace[]\n}\n\nexport function WorkspaceSwitcher({\n compact = false,\n labels,\n onWorkspaceChange,\n workspaceId,\n workspaces,\n}: Readonly<WorkspaceSwitcherProps>): ReactElement | null {\n const { isMobile } = useSidebar()\n const active =\n workspaces.find((workspace) => workspace.id === workspaceId) ??\n workspaces[0]\n if (!active) return null\n\n return (\n <SidebarMenu>\n <SidebarMenuItem>\n <Menu>\n <MenuTrigger\n render={\n <SidebarMenuButton\n className={compact ? 'h-8 p-0' : undefined}\n size=\"lg\"\n tooltip={\n compact\n ? { children: active.name, hidden: false }\n : labels.switchWorkspace\n }\n />\n }\n >\n <WorkspaceLogo workspace={active} />\n <span className=\"grid flex-1 text-start text-sm leading-tight\">\n <span className=\"truncate font-medium\">{active.name}</span>\n {active.description ? (\n <span className=\"truncate text-xs\">{active.description}</span>\n ) : null}\n </span>\n <CaretUpDownIcon aria-hidden=\"true\" className=\"ms-auto\" />\n </MenuTrigger>\n <MenuPopup\n align=\"start\"\n className=\"min-w-56\"\n side={isMobile ? 'bottom' : 'right'}\n >\n <MenuGroup>\n <MenuGroupLabel>{labels.workspaces}</MenuGroupLabel>\n <MenuRadioGroup\n onValueChange={(value) => onWorkspaceChange?.(String(value))}\n value={active.id}\n >\n {workspaces.map((workspace) => (\n <MenuRadioItem\n closeOnClick\n key={workspace.id}\n value={workspace.id}\n >\n {workspace.name}\n </MenuRadioItem>\n ))}\n </MenuRadioGroup>\n </MenuGroup>\n </MenuPopup>\n </Menu>\n </SidebarMenuItem>\n </SidebarMenu>\n )\n}\n",
75
+ "target": "~/packages/ui/src/blocks/application/shell/shared/workspace-switcher.tsx"
76
+ },
77
+ {
78
+ "path": "helpers/initials.ts",
79
+ "type": "registry:file",
80
+ "content": "/**\n * Builds the initials shown in an avatar fallback: the first letter of the\n * first words of a label, upper-cased.\n *\n * @param label - A person or entity name; surrounding and repeated whitespace is ignored.\n * @param size - How many words contribute a letter. Defaults to two.\n * @returns The initials, or an empty string for a blank label.\n */\nexport function getInitials(label: string, size = 2): string {\n return label\n .split(/\\s+/)\n .filter(Boolean)\n .slice(0, size)\n .map((part) => part[0])\n .join('')\n .toUpperCase()\n}\n\n/**\n * Picks the text of an avatar fallback: the explicit fallback a person carries,\n * or the initials of its label when there is none.\n *\n * @param person - Anything with a `label` and an optional `fallback`.\n * @param size - How many words contribute a letter when the label is used. Defaults to two.\n * @returns The fallback as given (only `undefined` falls through, so an empty\n * string is kept), otherwise the initials of the label.\n */\nexport function resolveInitials(\n person: { label: string; fallback?: string },\n size = 2,\n): string {\n return person.fallback ?? getInitials(person.label, size)\n}\n",
81
+ "target": "~/packages/ui/src/helpers/initials.ts"
82
+ }
83
+ ],
84
+ "dependencies": [
85
+ "@phosphor-icons/react@2.1.10",
86
+ "react@19.1.1"
87
+ ],
88
+ "registryDependencies": [
89
+ "@ui/avatar",
90
+ "@ui/badge",
91
+ "@ui/breadcrumb",
92
+ "@ui/button",
93
+ "@ui/collapsible",
94
+ "@ui/command",
95
+ "@ui/icon-frame",
96
+ "@ui/kbd",
97
+ "@ui/menu",
98
+ "@ui/popover",
99
+ "@ui/render-anchor",
100
+ "@ui/separator",
101
+ "@ui/sidebar"
102
+ ],
103
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json"
104
+ }
@@ -0,0 +1,104 @@
1
+ {
2
+ "name": "card-1",
3
+ "type": "registry:block",
4
+ "files": [
5
+ {
6
+ "path": "blocks/application/card/card-1/card-1-skeleton.tsx",
7
+ "type": "registry:file",
8
+ "content": "import { Skeleton } from '@tc96/ui/skeleton'\nimport { CardSkeleton } from '../shared/card-load-state'\n\nexport function Card1Skeleton({ label }: Readonly<{ label: string }>) {\n return (\n <CardSkeleton className=\"p-5\" label={label}>\n <div className=\"grid gap-3 sm:grid-cols-2 lg:grid-cols-3\">\n {['a', 'b', 'c', 'd', 'e', 'f'].map((id) => (\n <div className=\"grid gap-2 rounded-lg bg-muted/50 p-4\" key={id}>\n <Skeleton className=\"h-4 w-20\" />\n <Skeleton className=\"h-5 w-32\" />\n </div>\n ))}\n </div>\n </CardSkeleton>\n )\n}\n",
9
+ "target": "~/packages/ui/src/blocks/application/card/card-1/card-1-skeleton.tsx"
10
+ },
11
+ {
12
+ "path": "blocks/application/card/card-1/card-1.tsx",
13
+ "type": "registry:file",
14
+ "content": "import { CardPanel } from '@tc96/ui/card'\nimport { IconFrame } from '@tc96/ui/icon-frame'\nimport { AvatarStack } from '@tc96/ui/patterns/widgets/shared/avatar-stack'\nimport { WidgetShell } from '@tc96/ui/patterns/widgets/shared/widget-shell'\nimport { CardBadge } from '../shared/card-badge'\nimport { cardLoadState } from '../shared/card-load-state'\nimport { Card1Skeleton } from './card-1-skeleton'\nimport { defaultCard1Labels } from './labels'\nimport type { Card1Accent, Card1Fact, Card1Props } from './types'\n\nfunction FactAccent({\n accent,\n label,\n}: Readonly<{ accent: Card1Accent; label: string }>) {\n if (accent.kind === 'badge') return <CardBadge {...accent.badge} />\n if (accent.kind === 'people')\n return <AvatarStack aria-label={label} people={accent.people} size=\"sm\" />\n return (\n <IconFrame aria-hidden=\"true\" shape=\"rounded\" size=\"sm\">\n {accent.icon}\n </IconFrame>\n )\n}\n\nfunction FactTile({ fact }: Readonly<{ fact: Card1Fact }>) {\n return (\n <div\n className=\"grid min-w-0 content-start gap-2 rounded-lg bg-muted/50 p-4\"\n data-fact={fact.id}\n >\n <dt className=\"truncate text-muted-foreground text-sm\">{fact.label}</dt>\n <dd className=\"flex min-w-0 items-center justify-between gap-3\">\n <span className=\"min-w-0 truncate font-medium text-base\">\n {fact.value}\n </span>\n {fact.accent ? (\n <FactAccent accent={fact.accent} label={fact.label} />\n ) : null}\n </dd>\n </div>\n )\n}\n\nexport function Card1({\n error,\n onRetry,\n pending,\n className,\n facts,\n labels: labelsProp,\n}: Readonly<Card1Props>) {\n const labels = { ...defaultCard1Labels, ...labelsProp }\n const loadState = cardLoadState({\n error,\n labels,\n onRetry,\n pending,\n skeleton: <Card1Skeleton label={labels.loading} />,\n })\n\n if (loadState)\n return (\n <WidgetShell aria-label={labels.title} className={className}>\n {loadState}\n </WidgetShell>\n )\n\n return (\n <WidgetShell aria-label={labels.title} className={className}>\n <CardPanel className=\"p-5\">\n <dl className=\"grid gap-3 sm:grid-cols-2 lg:grid-cols-3\">\n {facts.map((fact) => (\n <FactTile fact={fact} key={fact.id} />\n ))}\n </dl>\n </CardPanel>\n </WidgetShell>\n )\n}\n",
15
+ "target": "~/packages/ui/src/blocks/application/card/card-1/card-1.tsx"
16
+ },
17
+ {
18
+ "path": "blocks/application/card/card-1/index.ts",
19
+ "type": "registry:file",
20
+ "content": "export { Card1 } from './card-1'\nexport type { Card1Accent, Card1Fact, Card1Labels, Card1Props } from './types'\n",
21
+ "target": "~/packages/ui/src/blocks/application/card/card-1/index.ts"
22
+ },
23
+ {
24
+ "path": "blocks/application/card/card-1/labels.ts",
25
+ "type": "registry:file",
26
+ "content": "import { defaultCardLoadLabels } from '../shared/labels'\nimport type { Card1Labels } from './types'\n\nexport const defaultCard1Labels: Card1Labels = {\n ...defaultCardLoadLabels,\n errorTitle: 'Não foi possível carregar os detalhes',\n loading: 'Carregando detalhes',\n title: 'Detalhes',\n}\n",
27
+ "target": "~/packages/ui/src/blocks/application/card/card-1/labels.ts"
28
+ },
29
+ {
30
+ "path": "blocks/application/card/card-1/types.ts",
31
+ "type": "registry:file",
32
+ "content": "import type { AvatarStackPerson } from '@tc96/ui/patterns/widgets/shared/avatar-stack'\nimport type { ReactNode } from 'react'\nimport type {\n CardBadgeData,\n CardLoadLabels,\n CardLoadProps,\n} from '../shared/types'\n\nexport type Card1Accent =\n | { badge: CardBadgeData; kind: 'badge' }\n | { icon: ReactNode; kind: 'icon' }\n | { kind: 'people'; people: AvatarStackPerson[] }\n\nexport interface Card1Fact {\n accent?: Card1Accent\n id: string\n label: string\n value: string\n}\n\nexport interface Card1Labels extends CardLoadLabels {\n title: string\n}\n\nexport interface Card1Props extends CardLoadProps {\n className?: string\n facts: Card1Fact[]\n labels?: Partial<Card1Labels>\n}\n",
33
+ "target": "~/packages/ui/src/blocks/application/card/card-1/types.ts"
34
+ },
35
+ {
36
+ "path": "blocks/application/card/shared/card-badge.tsx",
37
+ "type": "registry:file",
38
+ "content": "import { Badge } from '@tc96/ui/badge'\nimport type { CardBadgeData } from './types'\n\nexport function CardBadge({\n label,\n tone = 'secondary',\n}: Readonly<CardBadgeData>) {\n return <Badge variant={tone}>{label}</Badge>\n}\n",
39
+ "target": "~/packages/ui/src/blocks/application/card/shared/card-badge.tsx"
40
+ },
41
+ {
42
+ "path": "blocks/application/card/shared/card-load-state.tsx",
43
+ "type": "registry:file",
44
+ "content": "import { Button } from '@tc96/ui/button'\nimport { StateSurface } from '@tc96/ui/patterns/surfaces/state/composition/state-surface/state-surface'\nimport { cn } from '@tc96/utils'\nimport type { ReactNode } from 'react'\nimport type { CardLoadLabels, CardLoadProps } from './types'\n\nexport function CardSkeleton({\n children,\n className,\n label,\n}: Readonly<{ children: ReactNode; className?: string; label: string }>) {\n return (\n <output\n aria-busy=\"true\"\n aria-label={label}\n className={cn('block', className)}\n data-slot=\"card-skeleton\"\n >\n {children}\n </output>\n )\n}\n\nexport function cardLoadState({\n error,\n labels,\n onRetry,\n pending,\n skeleton,\n}: Readonly<\n CardLoadProps & { labels: CardLoadLabels; skeleton: ReactNode }\n>): ReactNode {\n if (pending) return skeleton\n if (error)\n return (\n <StateSurface\n actions={\n onRetry ? (\n <Button onClick={onRetry} size=\"sm\" variant=\"outline\">\n {labels.retry}\n </Button>\n ) : undefined\n }\n description={labels.errorDescription}\n kind=\"error\"\n title={labels.errorTitle}\n />\n )\n return null\n}\n",
45
+ "target": "~/packages/ui/src/blocks/application/card/shared/card-load-state.tsx"
46
+ },
47
+ {
48
+ "path": "blocks/application/card/shared/labels.ts",
49
+ "type": "registry:file",
50
+ "content": "import type { CardLoadLabels } from './types'\n\nexport const defaultCardLoadLabels: Pick<\n CardLoadLabels,\n 'errorDescription' | 'retry'\n> = {\n errorDescription: 'Verifique sua conexão e tente novamente.',\n retry: 'Tentar novamente',\n}\n",
51
+ "target": "~/packages/ui/src/blocks/application/card/shared/labels.ts"
52
+ },
53
+ {
54
+ "path": "blocks/application/card/shared/types.ts",
55
+ "type": "registry:file",
56
+ "content": "export type CardBadgeTone =\n | 'error'\n | 'info'\n | 'outline'\n | 'secondary'\n | 'success'\n | 'warning'\n\nexport interface CardBadgeData {\n label: string\n tone?: CardBadgeTone\n}\n\nexport interface CardLoadLabels {\n errorDescription: string\n errorTitle: string\n loading: string\n retry: string\n}\n\nexport interface CardLoadProps {\n error?: boolean\n onRetry?: () => void\n pending?: boolean\n}\n\nexport interface CardMenuAction {\n id: string\n label: string\n}\n",
57
+ "target": "~/packages/ui/src/blocks/application/card/shared/types.ts"
58
+ },
59
+ {
60
+ "path": "helpers/initials.ts",
61
+ "type": "registry:file",
62
+ "content": "/**\n * Builds the initials shown in an avatar fallback: the first letter of the\n * first words of a label, upper-cased.\n *\n * @param label - A person or entity name; surrounding and repeated whitespace is ignored.\n * @param size - How many words contribute a letter. Defaults to two.\n * @returns The initials, or an empty string for a blank label.\n */\nexport function getInitials(label: string, size = 2): string {\n return label\n .split(/\\s+/)\n .filter(Boolean)\n .slice(0, size)\n .map((part) => part[0])\n .join('')\n .toUpperCase()\n}\n\n/**\n * Picks the text of an avatar fallback: the explicit fallback a person carries,\n * or the initials of its label when there is none.\n *\n * @param person - Anything with a `label` and an optional `fallback`.\n * @param size - How many words contribute a letter when the label is used. Defaults to two.\n * @returns The fallback as given (only `undefined` falls through, so an empty\n * string is kept), otherwise the initials of the label.\n */\nexport function resolveInitials(\n person: { label: string; fallback?: string },\n size = 2,\n): string {\n return person.fallback ?? getInitials(person.label, size)\n}\n",
63
+ "target": "~/packages/ui/src/helpers/initials.ts"
64
+ },
65
+ {
66
+ "path": "patterns/surfaces/state/composition/state-surface/state-surface.tsx",
67
+ "type": "registry:file",
68
+ "content": "import {\n FileMagnifyingGlassIcon,\n LockIcon,\n MagnifyingGlassIcon,\n TrayIcon,\n WarningIcon,\n} from '@phosphor-icons/react'\nimport {\n Empty,\n EmptyContent,\n EmptyDescription,\n EmptyHeader,\n EmptyMedia,\n EmptyTitle,\n} from '@tc96/ui/empty'\nimport { IconFrame } from '@tc96/ui/icon-frame'\nimport { cn } from '@tc96/utils'\nimport type { ReactNode } from 'react'\nimport {\n STATE_SURFACE_ICON_COLORS,\n STATE_SURFACE_ROLES,\n type StateSurfaceKind,\n type StateSurfaceProps,\n} from '../../core'\n\nconst KIND_ICONS = {\n empty: TrayIcon,\n error: WarningIcon,\n 'no-result': MagnifyingGlassIcon,\n 'not-found': FileMagnifyingGlassIcon,\n permission: LockIcon,\n} as const satisfies Record<StateSurfaceKind, typeof TrayIcon>\n\nexport function StateSurface({\n actions,\n className,\n description,\n icon,\n kind,\n title,\n}: StateSurfaceProps): ReactNode {\n const Icon = KIND_ICONS[kind]\n const iconColor = STATE_SURFACE_ICON_COLORS[kind]\n\n return (\n <Empty\n className={className}\n data-kind={kind}\n role={STATE_SURFACE_ROLES[kind]}\n >\n <EmptyHeader>\n {icon === null ? null : (\n <EmptyMedia>\n <IconFrame\n className={cn(!iconColor && 'bg-muted/60')}\n color={iconColor}\n shape=\"rounded\"\n size=\"xl\"\n >\n {icon === undefined ? <Icon aria-hidden=\"true\" /> : icon}\n </IconFrame>\n </EmptyMedia>\n )}\n <EmptyTitle>{title}</EmptyTitle>\n <EmptyDescription>{description}</EmptyDescription>\n </EmptyHeader>\n {actions ? (\n <EmptyContent className=\"flex-row flex-wrap justify-center gap-2\">\n {actions}\n </EmptyContent>\n ) : null}\n </Empty>\n )\n}\n",
69
+ "target": "~/packages/ui/src/patterns/surfaces/state/composition/state-surface/state-surface.tsx"
70
+ },
71
+ {
72
+ "path": "patterns/surfaces/state/core.ts",
73
+ "type": "registry:file",
74
+ "content": "import type { ReactNode } from 'react'\n\nexport const STATE_SURFACE_KINDS = [\n 'empty',\n 'no-result',\n 'error',\n 'permission',\n 'not-found',\n] as const\n\nexport type StateSurfaceKind = (typeof STATE_SURFACE_KINDS)[number]\n\nexport type StateGuardState = 'data' | 'loading' | StateSurfaceKind\n\nexport type StateSurfaceRole = 'alert' | 'status'\n\nexport const STATE_SURFACE_ROLES = {\n empty: 'status',\n error: 'alert',\n 'no-result': 'status',\n 'not-found': 'status',\n permission: 'alert',\n} as const satisfies Record<StateSurfaceKind, StateSurfaceRole>\n\nexport const STATE_SURFACE_ICON_COLORS: Partial<\n Record<StateSurfaceKind, string>\n> = {\n error: 'var(--destructive)',\n permission: 'var(--destructive)',\n}\n\nexport interface StateSurfaceProps {\n actions?: ReactNode\n className?: string\n description: ReactNode\n icon?: ReactNode\n kind: StateSurfaceKind\n title: ReactNode\n}\n\nexport type StateGuardProps = {\n children: ReactNode\n} & (\n | { state: 'data'; surface?: Omit<StateSurfaceProps, 'kind'> }\n | {\n state: 'loading'\n surface: Pick<StateSurfaceProps, 'className' | 'title'> & {\n description?: ReactNode\n }\n }\n | { state: StateSurfaceKind; surface: Omit<StateSurfaceProps, 'kind'> }\n)\n",
75
+ "target": "~/packages/ui/src/patterns/surfaces/state/core.ts"
76
+ },
77
+ {
78
+ "path": "patterns/widgets/shared/avatar-stack.tsx",
79
+ "type": "registry:file",
80
+ "content": "import { Avatar, AvatarFallback, AvatarImage } from '@tc96/ui/avatar'\nimport { resolveInitials } from '@tc96/ui/helpers/initials'\nimport { cn } from '@tc96/utils'\nimport type { ComponentProps, ReactElement } from 'react'\n\nexport interface AvatarStackPerson {\n fallback?: string\n id: string\n imageUrl?: string\n label: string\n}\n\nexport type AvatarStackSize = 'default' | 'sm'\n\nconst avatarClassNames: Record<AvatarStackSize, string | undefined> = {\n default: undefined,\n sm: '[--avatar-size:--spacing(6)] text-[0.625rem]',\n}\n\nconst overflowClassNames: Record<AvatarStackSize, string> = {\n default: 'size-8 text-xs',\n sm: 'size-6 text-[0.625rem]',\n}\n\nexport interface AvatarStackProps\n extends Omit<ComponentProps<'ul'>, 'children'> {\n 'aria-label'?: string\n max?: number\n people: readonly AvatarStackPerson[]\n size?: AvatarStackSize\n}\n\nexport function AvatarStack({\n 'aria-label': ariaLabel = 'Pessoas',\n className,\n max = 3,\n people,\n size = 'default',\n ...props\n}: Readonly<AvatarStackProps>): ReactElement {\n const shown = people.slice(0, max)\n const hidden = people.slice(max)\n\n return (\n <ul\n aria-label={ariaLabel}\n className={cn('flex items-center -space-x-2', className)}\n data-slot=\"avatar-stack\"\n {...props}\n >\n {shown.map((person) => (\n <li\n className=\"flex rounded-full border border-input bg-card\"\n key={person.id}\n >\n <Avatar className={avatarClassNames[size]} data-size={size}>\n {person.imageUrl ? (\n <AvatarImage alt=\"\" src={person.imageUrl} />\n ) : null}\n <AvatarFallback>{resolveInitials(person)}</AvatarFallback>\n </Avatar>\n <span className=\"sr-only\">{person.label}</span>\n </li>\n ))}\n {hidden.length ? (\n <li className=\"flex rounded-full border border-input bg-card\">\n <span\n className={cn(\n 'inline-flex shrink-0 items-center justify-center rounded-full bg-muted font-medium text-muted-foreground tabular-nums',\n overflowClassNames[size],\n )}\n data-slot=\"avatar-stack-overflow\"\n >\n <span aria-hidden=\"true\">+{hidden.length}</span>\n <span className=\"sr-only\">\n {hidden.map((person) => person.label).join(', ')}\n </span>\n </span>\n </li>\n ) : null}\n </ul>\n )\n}\n",
81
+ "target": "~/packages/ui/src/patterns/widgets/shared/avatar-stack.tsx"
82
+ },
83
+ {
84
+ "path": "patterns/widgets/shared/widget-shell.tsx",
85
+ "type": "registry:file",
86
+ "content": "import { Card } from '@tc96/ui/card'\nimport { cn } from '@tc96/utils'\nimport type { ComponentProps, ReactElement } from 'react'\n\nexport interface WidgetShellProps extends ComponentProps<typeof Card> {}\n\nexport function WidgetShell({\n className,\n render = <section />,\n ...props\n}: Readonly<WidgetShellProps>): ReactElement {\n return (\n <Card\n className={cn('min-w-0 border-transparent', className)}\n render={render}\n {...props}\n />\n )\n}\n",
87
+ "target": "~/packages/ui/src/patterns/widgets/shared/widget-shell.tsx"
88
+ }
89
+ ],
90
+ "dependencies": [
91
+ "@phosphor-icons/react@2.1.10",
92
+ "react@19.1.1"
93
+ ],
94
+ "registryDependencies": [
95
+ "@ui/avatar",
96
+ "@ui/badge",
97
+ "@ui/button",
98
+ "@ui/card",
99
+ "@ui/empty",
100
+ "@ui/icon-frame",
101
+ "@ui/skeleton"
102
+ ],
103
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json"
104
+ }