@tc96/cli 0.0.0-stage → 0.27.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 (200) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +213 -2
  3. package/cli.js +1395 -0
  4. package/package.json +35 -4
  5. package/registry/agent-builder.json +503 -0
  6. package/registry/aggregate.json +4 -0
  7. package/registry/app-shell-1.json +81 -0
  8. package/registry/app-shell-2.json +89 -0
  9. package/registry/app-shell-3.json +109 -0
  10. package/registry/app-shell-4.json +104 -0
  11. package/registry/app-shell-5.json +106 -0
  12. package/registry/bulk-import-1.json +151 -0
  13. package/registry/card-1.json +104 -0
  14. package/registry/card-2.json +97 -0
  15. package/registry/card-3.json +104 -0
  16. package/registry/card-4.json +98 -0
  17. package/registry/card-5.json +85 -0
  18. package/registry/card-6.json +98 -0
  19. package/registry/card-7.json +104 -0
  20. package/registry/card-8.json +106 -0
  21. package/registry/card-9.json +92 -0
  22. package/registry/charts.json +30 -0
  23. package/registry/chat-assistant.json +110 -0
  24. package/registry/chats-panel.json +97 -0
  25. package/registry/checklist.json +307 -0
  26. package/registry/collection-layouts.json +836 -0
  27. package/registry/collection-views.json +836 -0
  28. package/registry/collection.json +831 -0
  29. package/registry/dashboard-1.json +160 -0
  30. package/registry/dashboard-2.json +153 -0
  31. package/registry/dashboard-3.json +154 -0
  32. package/registry/dashboard-4.json +168 -0
  33. package/registry/detail-sheet.json +54 -0
  34. package/registry/editable.json +36 -0
  35. package/registry/empty-state-1.json +40 -0
  36. package/registry/empty-state-2.json +39 -0
  37. package/registry/empty-state-3.json +61 -0
  38. package/registry/empty-state-4.json +39 -0
  39. package/registry/empty-state-5.json +47 -0
  40. package/registry/empty-state-6.json +40 -0
  41. package/registry/flow-canvas.json +198 -0
  42. package/registry/flow-inspector.json +151 -0
  43. package/registry/flow-step-library.json +112 -0
  44. package/registry/forgot-password-1.json +73 -0
  45. package/registry/forgot-password-2.json +73 -0
  46. package/registry/icon-row.json +52 -0
  47. package/registry/impact-map.json +75 -0
  48. package/registry/list-1.json +129 -0
  49. package/registry/list-2.json +117 -0
  50. package/registry/list-3.json +129 -0
  51. package/registry/list-4.json +105 -0
  52. package/registry/list-5.json +98 -0
  53. package/registry/list-6.json +92 -0
  54. package/registry/list.json +52 -0
  55. package/registry/login-1.json +89 -0
  56. package/registry/login-10.json +88 -0
  57. package/registry/login-2.json +81 -0
  58. package/registry/login-3.json +90 -0
  59. package/registry/login-4.json +81 -0
  60. package/registry/login-5.json +82 -0
  61. package/registry/login-6.json +88 -0
  62. package/registry/login-7.json +83 -0
  63. package/registry/login-8.json +81 -0
  64. package/registry/login-9.json +88 -0
  65. package/registry/lookup-create-1.json +157 -0
  66. package/registry/magic-link-6.json +79 -0
  67. package/registry/navbar-1.json +66 -0
  68. package/registry/navbar-2.json +48 -0
  69. package/registry/navbar-3.json +50 -0
  70. package/registry/navbar-4.json +39 -0
  71. package/registry/navbar-5.json +50 -0
  72. package/registry/next-steps-1.json +147 -0
  73. package/registry/onboarding-1.json +114 -0
  74. package/registry/onboarding-2.json +78 -0
  75. package/registry/onboarding-3.json +71 -0
  76. package/registry/otp-1.json +73 -0
  77. package/registry/properties.json +523 -0
  78. package/registry/record-dialog.json +88 -0
  79. package/registry/record-group.json +190 -0
  80. package/registry/record-preview.json +70 -0
  81. package/registry/record-status-list.json +70 -0
  82. package/registry/reset-password-1.json +92 -0
  83. package/registry/reset-password-2.json +98 -0
  84. package/registry/reset-password-6.json +91 -0
  85. package/registry/rich-text-editor.json +93 -0
  86. package/registry/run-monitor.json +198 -0
  87. package/registry/settings-1.json +119 -0
  88. package/registry/settings-10.json +218 -0
  89. package/registry/settings-11.json +129 -0
  90. package/registry/settings-12.json +130 -0
  91. package/registry/settings-13.json +130 -0
  92. package/registry/settings-14.json +173 -0
  93. package/registry/settings-15.json +149 -0
  94. package/registry/settings-16.json +129 -0
  95. package/registry/settings-17.json +117 -0
  96. package/registry/settings-18.json +117 -0
  97. package/registry/settings-19.json +125 -0
  98. package/registry/settings-2.json +123 -0
  99. package/registry/settings-20.json +112 -0
  100. package/registry/settings-21.json +116 -0
  101. package/registry/settings-22.json +118 -0
  102. package/registry/settings-23.json +118 -0
  103. package/registry/settings-3.json +123 -0
  104. package/registry/settings-4.json +116 -0
  105. package/registry/settings-5.json +119 -0
  106. package/registry/settings-6.json +125 -0
  107. package/registry/settings-7.json +128 -0
  108. package/registry/settings-8.json +116 -0
  109. package/registry/settings-9.json +118 -0
  110. package/registry/settings-shell.json +60 -0
  111. package/registry/settings.json +82 -0
  112. package/registry/signup-1.json +100 -0
  113. package/registry/signup-2.json +93 -0
  114. package/registry/signup-3.json +83 -0
  115. package/registry/signup-6.json +99 -0
  116. package/registry/state-surface.json +58 -0
  117. package/registry/stats-1.json +116 -0
  118. package/registry/stats-2.json +115 -0
  119. package/registry/stats-3.json +97 -0
  120. package/registry/stats-4.json +92 -0
  121. package/registry/stats-5.json +103 -0
  122. package/registry/stats-6.json +105 -0
  123. package/registry/stats-7.json +103 -0
  124. package/registry/stats.json +64 -0
  125. package/registry/timeline-1.json +97 -0
  126. package/registry/timeline-2.json +102 -0
  127. package/registry/timeline-3.json +68 -0
  128. package/registry/timeline-4.json +86 -0
  129. package/registry/ui/accordion.json +15 -0
  130. package/registry/ui/alert-dialog.json +14 -0
  131. package/registry/ui/alert.json +50 -0
  132. package/registry/ui/autocomplete.json +18 -0
  133. package/registry/ui/avatar.json +14 -0
  134. package/registry/ui/badge.json +51 -0
  135. package/registry/ui/breadcrumb.json +15 -0
  136. package/registry/ui/button.json +25 -0
  137. package/registry/ui/calendar.json +15 -0
  138. package/registry/ui/card.json +14 -0
  139. package/registry/ui/chat.json +115 -0
  140. package/registry/ui/checkbox-group.json +14 -0
  141. package/registry/ui/checkbox.json +14 -0
  142. package/registry/ui/collapsible.json +14 -0
  143. package/registry/ui/combobox.json +18 -0
  144. package/registry/ui/command.json +17 -0
  145. package/registry/ui/composer-clipboard.json +14 -0
  146. package/registry/ui/composer-document.json +14 -0
  147. package/registry/ui/composer-editor.json +16 -0
  148. package/registry/ui/composer-query.json +12 -0
  149. package/registry/ui/composer.json +17 -0
  150. package/registry/ui/context-menu.json +23 -0
  151. package/registry/ui/dialog.json +18 -0
  152. package/registry/ui/drawer.json +18 -0
  153. package/registry/ui/empty.json +14 -0
  154. package/registry/ui/field.json +22 -0
  155. package/registry/ui/fieldset.json +14 -0
  156. package/registry/ui/form.json +14 -0
  157. package/registry/ui/frame.json +12 -0
  158. package/registry/ui/gauge.json +31 -0
  159. package/registry/ui/group.json +17 -0
  160. package/registry/ui/icon-frame.json +31 -0
  161. package/registry/ui/input-group.json +17 -0
  162. package/registry/ui/input.json +14 -0
  163. package/registry/ui/kbd.json +12 -0
  164. package/registry/ui/label.json +14 -0
  165. package/registry/ui/menu.json +39 -0
  166. package/registry/ui/meter.json +14 -0
  167. package/registry/ui/number-field.json +17 -0
  168. package/registry/ui/otp-field.json +31 -0
  169. package/registry/ui/pagination.json +17 -0
  170. package/registry/ui/popover.json +14 -0
  171. package/registry/ui/preview-card.json +14 -0
  172. package/registry/ui/progress.json +14 -0
  173. package/registry/ui/radio-group.json +14 -0
  174. package/registry/ui/render-anchor.json +12 -0
  175. package/registry/ui/scroll-area.json +14 -0
  176. package/registry/ui/segmented-control.json +14 -0
  177. package/registry/ui/select.json +16 -0
  178. package/registry/ui/separator.json +14 -0
  179. package/registry/ui/sheet.json +18 -0
  180. package/registry/ui/sidebar.json +25 -0
  181. package/registry/ui/skeleton.json +24 -0
  182. package/registry/ui/slider.json +14 -0
  183. package/registry/ui/spinner.json +14 -0
  184. package/registry/ui/switch.json +14 -0
  185. package/registry/ui/table.json +14 -0
  186. package/registry/ui/tabs.json +16 -0
  187. package/registry/ui/text.json +31 -0
  188. package/registry/ui/textarea.json +14 -0
  189. package/registry/ui/toast.json +89 -0
  190. package/registry/ui/toggle-group.json +18 -0
  191. package/registry/ui/toggle.json +15 -0
  192. package/registry/ui/toolbar.json +14 -0
  193. package/registry/ui/tooltip.json +14 -0
  194. package/registry/ui/use-composer-editor.json +17 -0
  195. package/registry/ui/use-copy-to-clipboard.json +12 -0
  196. package/registry/ui/use-media-query.json +12 -0
  197. package/registry/view.json +831 -0
  198. package/registry/widgets.json +319 -0
  199. package/registry/wizard.json +89 -0
  200. package/registry/workflow-editor.json +460 -0
@@ -0,0 +1,125 @@
1
+ {
2
+ "name": "settings-6",
3
+ "type": "registry:block",
4
+ "files": [
5
+ {
6
+ "path": "blocks/application/settings/settings-6/index.ts",
7
+ "type": "registry:file",
8
+ "content": "export { Settings6 } from './settings-6'\nexport type {\n Settings6Invitation,\n Settings6InvitationAction,\n Settings6Labels,\n Settings6Member,\n Settings6MemberAction,\n Settings6Props,\n Settings6Role,\n Settings6Seats,\n} from './types'\n",
9
+ "target": "~/packages/ui/src/blocks/application/settings/settings-6/index.ts"
10
+ },
11
+ {
12
+ "path": "blocks/application/settings/settings-6/labels.ts",
13
+ "type": "registry:file",
14
+ "content": "import { defaultSettingsLoadLabels } from '../shared/labels'\nimport type { Settings6Labels } from './types'\n\nexport const defaultSettings6Labels: Settings6Labels = {\n ...defaultSettingsLoadLabels,\n errorTitle: 'Não foi possível carregar os membros',\n loading: 'Carregando membros',\n actions: (name) => `Ações de ${name}`,\n invitationMeta: (role, sent) => `${role} · Enviado ${sent}`,\n invitationsTitle: 'Convites pendentes',\n invite: 'Convidar membros',\n memberRole: (name) => `Papel de ${name}`,\n owner: 'Proprietário',\n pending: 'Pendente',\n removeMember: 'Remover do workspace',\n resendInvitation: 'Reenviar convite',\n revokeInvitation: 'Revogar convite',\n seats: (used, limit, plan) =>\n `${used} de ${limit} vagas usadas no plano ${plan}.`,\n title: 'Membros',\n}\n",
15
+ "target": "~/packages/ui/src/blocks/application/settings/settings-6/labels.ts"
16
+ },
17
+ {
18
+ "path": "blocks/application/settings/settings-6/settings-6-skeleton.tsx",
19
+ "type": "registry:file",
20
+ "content": "import { SettingsRowsSkeleton } from '../shared/settings-skeleton'\n\nexport function Settings6Skeleton() {\n return <SettingsRowsSkeleton count={4} start=\"avatar\" end=\"select\" />\n}\n",
21
+ "target": "~/packages/ui/src/blocks/application/settings/settings-6/settings-6-skeleton.tsx"
22
+ },
23
+ {
24
+ "path": "blocks/application/settings/settings-6/settings-6.tsx",
25
+ "type": "registry:file",
26
+ "content": "import { Avatar, AvatarFallback } from '@tc96/ui/avatar'\nimport { Badge } from '@tc96/ui/badge'\nimport { Button } from '@tc96/ui/button'\nimport { SettingsRow } from '@tc96/ui/patterns/surfaces/settings/composition/settings-row/settings-row'\nimport { SettingsSection } from '@tc96/ui/patterns/surfaces/settings/composition/settings-section/settings-section'\nimport {\n SettingsSectionDescription,\n SettingsSectionHeader,\n SettingsSectionTitle,\n} from '@tc96/ui/patterns/surfaces/settings/composition/settings-section/settings-section-header'\nimport {\n Select,\n SelectItem,\n SelectPopup,\n SelectTrigger,\n SelectValue,\n} from '@tc96/ui/select'\nimport { Text } from '@tc96/ui/text'\nimport { cn } from '@tc96/utils'\nimport { useState } from 'react'\nimport { settingsLoadState } from '../shared/settings-load-state'\nimport { SettingsRowActions } from '../shared/settings-row-actions'\nimport { defaultSettings6Labels } from './labels'\nimport { Settings6Skeleton } from './settings-6-skeleton'\nimport type {\n Settings6InvitationAction,\n Settings6Labels,\n Settings6Member,\n Settings6MemberAction,\n Settings6Props,\n Settings6Role,\n} from './types'\n\ninterface MemberRowProps {\n labels: Settings6Labels\n member: Settings6Member\n onMemberAction?: Settings6Props['onMemberAction']\n onRoleChange?: Settings6Props['onRoleChange']\n owner: boolean\n roles: Settings6Role[]\n}\n\nfunction MemberRow({\n labels,\n member,\n onMemberAction,\n onRoleChange,\n owner,\n roles,\n}: Readonly<MemberRowProps>) {\n const [role, setRole] = useState(member.role)\n\n return (\n <SettingsRow\n description={member.email}\n endSlot={\n owner ? (\n <Text\n foreground=\"muted\"\n render={<span>{labels.owner}</span>}\n size=\"sm\"\n />\n ) : (\n <div className=\"flex items-center gap-3\">\n <Select\n items={roles}\n onValueChange={(next) => {\n if (!next) return\n setRole(next)\n onRoleChange?.(member.id, next)\n }}\n value={role}\n >\n <SelectTrigger\n aria-label={labels.memberRole(member.name)}\n className=\"w-32\"\n >\n <SelectValue />\n </SelectTrigger>\n <SelectPopup>\n {roles.map((option) => (\n <SelectItem key={option.value} value={option.value}>\n {option.label}\n </SelectItem>\n ))}\n </SelectPopup>\n </Select>\n {onMemberAction ? (\n <SettingsRowActions\n actions={[\n {\n destructive: true,\n id: 'remove',\n label: labels.removeMember,\n },\n ]}\n label={labels.actions(member.name)}\n onAction={(action) =>\n onMemberAction(member.id, action as Settings6MemberAction)\n }\n />\n ) : null}\n </div>\n )\n }\n startSlot={\n <Avatar>\n <AvatarFallback>{member.initials}</AvatarFallback>\n </Avatar>\n }\n title={member.name}\n />\n )\n}\n\nexport function Settings6({\n error,\n onRetry,\n pending,\n className,\n invitations,\n labels: labelsProp,\n members,\n onInvitationAction,\n onInvite,\n onMemberAction,\n onRoleChange,\n ownerRole = 'owner',\n roles,\n seats,\n}: Readonly<Settings6Props>) {\n const labels = { ...defaultSettings6Labels, ...labelsProp }\n const loadState = settingsLoadState({\n error,\n labels,\n onRetry,\n pending,\n skeleton: <Settings6Skeleton />,\n })\n const roleLabel = (role: string) =>\n roles.find((option) => option.value === role)?.label ?? role\n\n return (\n <div\n className={cn('mx-auto flex w-full max-w-2xl flex-col gap-8', className)}\n >\n <SettingsSection\n header={\n <SettingsSectionHeader\n actions={\n onInvite ? (\n <Button onClick={onInvite} size=\"sm\">\n {labels.invite}\n </Button>\n ) : undefined\n }\n >\n <SettingsSectionTitle>{labels.title}</SettingsSectionTitle>\n {seats ? (\n <SettingsSectionDescription>\n {labels.seats(members.length, seats.limit, seats.plan)}\n </SettingsSectionDescription>\n ) : null}\n </SettingsSectionHeader>\n }\n >\n {loadState ??\n members.map((member) => (\n <MemberRow\n key={member.id}\n labels={labels}\n member={member}\n onMemberAction={onMemberAction}\n onRoleChange={onRoleChange}\n owner={member.role === ownerRole}\n roles={roles}\n />\n ))}\n </SettingsSection>\n {!loadState && invitations.length > 0 ? (\n <SettingsSection\n header={\n <SettingsSectionHeader>\n <SettingsSectionTitle>\n {labels.invitationsTitle}\n </SettingsSectionTitle>\n </SettingsSectionHeader>\n }\n >\n {invitations.map((invitation) => (\n <SettingsRow\n description={labels.invitationMeta(\n roleLabel(invitation.role),\n invitation.sent,\n )}\n endSlot={\n <div className=\"flex items-center gap-3\">\n <Badge variant=\"outline\">{labels.pending}</Badge>\n {onInvitationAction ? (\n <SettingsRowActions\n actions={[\n { id: 'resend', label: labels.resendInvitation },\n {\n destructive: true,\n id: 'revoke',\n label: labels.revokeInvitation,\n },\n ]}\n label={labels.actions(invitation.email)}\n onAction={(action) =>\n onInvitationAction(\n invitation.id,\n action as Settings6InvitationAction,\n )\n }\n />\n ) : null}\n </div>\n }\n key={invitation.id}\n title={invitation.email}\n />\n ))}\n </SettingsSection>\n ) : null}\n </div>\n )\n}\n",
27
+ "target": "~/packages/ui/src/blocks/application/settings/settings-6/settings-6.tsx"
28
+ },
29
+ {
30
+ "path": "blocks/application/settings/settings-6/types.ts",
31
+ "type": "registry:file",
32
+ "content": "import type { SettingsLoadLabels, SettingsLoadProps } from '../shared/types'\nexport interface Settings6Role {\n label: string\n value: string\n}\n\nexport interface Settings6Member {\n email: string\n id: string\n initials: string\n name: string\n role: string\n}\n\nexport interface Settings6Invitation {\n email: string\n id: string\n role: string\n sent: string\n}\n\nexport interface Settings6Seats {\n limit: number\n plan: string\n}\n\nexport type Settings6MemberAction = 'remove'\n\nexport type Settings6InvitationAction = 'resend' | 'revoke'\n\nexport interface Settings6Labels extends SettingsLoadLabels {\n actions: (name: string) => string\n invitationMeta: (role: string, sent: string) => string\n invitationsTitle: string\n invite: string\n memberRole: (name: string) => string\n owner: string\n pending: string\n removeMember: string\n resendInvitation: string\n revokeInvitation: string\n seats: (used: number, limit: number, plan: string) => string\n title: string\n}\n\nexport interface Settings6Props extends SettingsLoadProps {\n className?: string\n invitations: Settings6Invitation[]\n labels?: Partial<Settings6Labels>\n members: Settings6Member[]\n onInvitationAction?: (\n invitationId: string,\n action: Settings6InvitationAction,\n ) => void\n onInvite?: () => void\n onMemberAction?: (memberId: string, action: Settings6MemberAction) => void\n onRoleChange?: (memberId: string, role: string) => void\n ownerRole?: string\n roles: Settings6Role[]\n seats?: Settings6Seats\n}\n",
33
+ "target": "~/packages/ui/src/blocks/application/settings/settings-6/types.ts"
34
+ },
35
+ {
36
+ "path": "blocks/application/settings/shared/labels.ts",
37
+ "type": "registry:file",
38
+ "content": "import type { SettingsLoadLabels } from './types'\n\nexport const defaultSettingsLoadLabels: Pick<\n SettingsLoadLabels,\n 'errorDescription' | 'retry'\n> = {\n errorDescription: 'Verifique sua conexão e tente novamente.',\n retry: 'Tentar novamente',\n}\n",
39
+ "target": "~/packages/ui/src/blocks/application/settings/shared/labels.ts"
40
+ },
41
+ {
42
+ "path": "blocks/application/settings/shared/settings-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 type { ReactNode } from 'react'\nimport { SettingsSkeleton } from './settings-skeleton'\nimport type { SettingsLoadLabels, SettingsLoadProps } from './types'\n\nexport interface SettingsLoadStateOptions extends SettingsLoadProps {\n labels: SettingsLoadLabels\n skeleton: ReactNode\n}\n\nexport function settingsLoadState({\n error,\n labels,\n onRetry,\n pending,\n skeleton,\n}: Readonly<SettingsLoadStateOptions>): ReactNode {\n if (pending)\n return (\n <SettingsSkeleton label={labels.loading}>{skeleton}</SettingsSkeleton>\n )\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/settings/shared/settings-load-state.tsx"
46
+ },
47
+ {
48
+ "path": "blocks/application/settings/shared/settings-row-actions.tsx",
49
+ "type": "registry:file",
50
+ "content": "import { DotsThreeIcon } from '@phosphor-icons/react'\nimport { Button } from '@tc96/ui/button'\nimport { Menu, MenuItem, MenuPopup, MenuTrigger } from '@tc96/ui/menu'\nimport type { SettingsRowAction } from './types'\n\nexport interface SettingsRowActionsProps {\n actions: SettingsRowAction[]\n label: string\n onAction: (actionId: string) => void\n}\n\nexport function SettingsRowActions({\n actions,\n label,\n onAction,\n}: Readonly<SettingsRowActionsProps>) {\n if (actions.length === 0) return null\n\n return (\n <Menu>\n <MenuTrigger\n aria-label={label}\n render={<Button size=\"icon-sm\" variant=\"ghost\" />}\n >\n <DotsThreeIcon aria-hidden=\"true\" />\n </MenuTrigger>\n <MenuPopup align=\"end\">\n {actions.map((action) => (\n <MenuItem\n key={action.id}\n onClick={() => onAction(action.id)}\n variant={action.destructive ? 'destructive' : undefined}\n >\n {action.label}\n </MenuItem>\n ))}\n </MenuPopup>\n </Menu>\n )\n}\n",
51
+ "target": "~/packages/ui/src/blocks/application/settings/shared/settings-row-actions.tsx"
52
+ },
53
+ {
54
+ "path": "blocks/application/settings/shared/settings-skeleton.tsx",
55
+ "type": "registry:file",
56
+ "content": "import { Card } from '@tc96/ui/card'\nimport { Skeleton } from '@tc96/ui/skeleton'\nimport { cn } from '@tc96/utils'\nimport type { ReactNode } from 'react'\n\ntype RowStart = 'avatar' | 'icon' | 'none'\ntype RowEnd = 'button' | 'menu' | 'none' | 'select' | 'switch'\n\nconst placeholderIds = (prefix: string, length: number) =>\n Array.from({ length }, (_, index) => `${prefix}-${index}`)\n\nconst titleWidths = ['w-40', 'w-32', 'w-48', 'w-36', 'w-44']\nconst descriptionWidths = ['w-64', 'w-56', 'w-72', 'w-60', 'w-52']\n\nexport function SettingsSkeleton({\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('flex flex-col divide-y', className)}\n data-slot=\"settings-skeleton\"\n >\n {children}\n </output>\n )\n}\n\nexport function SettingsSectionSkeleton({\n action = false,\n children,\n description = false,\n}: Readonly<{ action?: boolean; children: ReactNode; description?: boolean }>) {\n return (\n <div className=\"flex flex-col gap-3\">\n <div className=\"flex items-end justify-between gap-3\">\n <div className=\"flex min-w-0 flex-col gap-1\">\n <Skeleton className=\"h-5 w-32\" />\n {description ? <Skeleton className=\"h-4 w-72 max-w-full\" /> : null}\n </div>\n {action ? <Skeleton className=\"h-8 w-24 shrink-0\" /> : null}\n </div>\n <Card>\n <div className=\"flex flex-col divide-y px-6\">{children}</div>\n </Card>\n </div>\n )\n}\n\nfunction RowEndSkeleton({ end }: Readonly<{ end: RowEnd }>) {\n if (end === 'switch')\n return <Skeleton className=\"h-5 w-9 shrink-0 rounded-full\" />\n if (end === 'select') return <Skeleton className=\"h-8 w-36 shrink-0\" />\n if (end === 'button') return <Skeleton className=\"h-8 w-24 shrink-0\" />\n if (end === 'menu') return <Skeleton className=\"size-8 shrink-0\" />\n return null\n}\n\nexport function SettingsRowsSkeleton({\n count,\n description = true,\n end = 'none',\n start = 'none',\n}: Readonly<{\n count: number\n description?: boolean\n end?: RowEnd\n start?: RowStart\n}>) {\n return placeholderIds('row', count).map((id, index) => (\n <div className=\"flex items-center gap-3 py-3\" key={id}>\n {start === 'avatar' ? (\n <Skeleton className=\"size-10 shrink-0 rounded-full\" />\n ) : null}\n {start === 'icon' ? <Skeleton className=\"size-4 shrink-0\" /> : null}\n <div className=\"flex min-w-0 flex-1 flex-col gap-1.5\">\n <Skeleton className={cn('h-4 max-w-full', titleWidths[index % 5])} />\n {description ? (\n <Skeleton\n className={cn('h-3.5 max-w-full', descriptionWidths[index % 5])}\n />\n ) : null}\n </div>\n <RowEndSkeleton end={end} />\n </div>\n ))\n}\n\nexport function SettingsCollapsedSkeleton({\n children,\n}: Readonly<{ children: ReactNode }>) {\n return (\n <div className=\"my-1 flex flex-col first:mt-4 last:mb-4\">\n <Skeleton className=\"h-10 w-full rounded-lg\" />\n <div className=\"flex flex-col px-4\">{children}</div>\n </div>\n )\n}\n\nexport function SettingsTableSkeleton({\n columns,\n rows,\n}: Readonly<{ columns: number; rows: number }>) {\n return (\n <div className=\"flex flex-col divide-y py-2\">\n {placeholderIds('row', rows + 1).map((rowId, row) => (\n <div\n className=\"grid gap-4 py-3\"\n key={rowId}\n style={{ gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))` }}\n >\n {placeholderIds('cell', columns).map((cellId) => (\n <Skeleton\n className={row === 0 ? 'h-3.5 w-16' : 'h-4 w-full'}\n key={cellId}\n />\n ))}\n </div>\n ))}\n </div>\n )\n}\n",
57
+ "target": "~/packages/ui/src/blocks/application/settings/shared/settings-skeleton.tsx"
58
+ },
59
+ {
60
+ "path": "blocks/application/settings/shared/types.ts",
61
+ "type": "registry:file",
62
+ "content": "export interface SettingsRowAction {\n destructive?: boolean\n id: string\n label: string\n}\n\nexport interface SettingsOption {\n label: string\n value: string\n}\n\nexport interface SettingsLoadLabels {\n errorDescription: string\n errorTitle: string\n loading: string\n retry: string\n}\n\nexport interface SettingsLoadProps {\n error?: boolean\n onRetry?: () => void\n pending?: boolean\n}\n",
63
+ "target": "~/packages/ui/src/blocks/application/settings/shared/types.ts"
64
+ },
65
+ {
66
+ "path": "patterns/surfaces/settings/composition/settings-row/settings-row.tsx",
67
+ "type": "registry:file",
68
+ "content": "import { Text } from '@tc96/ui/text'\nimport { cn } from '@tc96/utils'\nimport type { ReactElement } from 'react'\nimport type { SettingsRowProps } from '../../core'\n\nexport function SettingsRow({\n className,\n description,\n endSlot,\n startSlot,\n title,\n}: Readonly<SettingsRowProps>): ReactElement {\n return (\n <div\n className={cn('flex items-center gap-3 py-3', className)}\n data-slot=\"settings-row\"\n >\n {startSlot ? (\n <div\n className=\"flex shrink-0 items-center [&>svg]:size-4\"\n data-slot=\"settings-row-start\"\n >\n {startSlot}\n </div>\n ) : null}\n <div className=\"min-w-0 flex-1\" data-slot=\"settings-row-heading\">\n <Text\n render={<p data-slot=\"settings-row-title\">{title}</p>}\n size=\"sm\"\n weight=\"semibold\"\n />\n {description ? (\n <Text\n foreground=\"muted\"\n render={<p data-slot=\"settings-row-description\">{description}</p>}\n size=\"sm\"\n />\n ) : null}\n </div>\n {endSlot ? (\n <div\n className=\"ms-3 flex shrink-0 items-center gap-2\"\n data-slot=\"settings-row-end\"\n >\n {endSlot}\n </div>\n ) : null}\n </div>\n )\n}\n",
69
+ "target": "~/packages/ui/src/patterns/surfaces/settings/composition/settings-row/settings-row.tsx"
70
+ },
71
+ {
72
+ "path": "patterns/surfaces/settings/composition/settings-section/settings-section-context.ts",
73
+ "type": "registry:file",
74
+ "content": "import { createContext, useContext } from 'react'\n\nexport const SettingsSectionTitleIdContext = createContext<string | undefined>(\n undefined,\n)\n\nexport function useSettingsSectionTitleId(): string | undefined {\n return useContext(SettingsSectionTitleIdContext)\n}\n",
75
+ "target": "~/packages/ui/src/patterns/surfaces/settings/composition/settings-section/settings-section-context.ts"
76
+ },
77
+ {
78
+ "path": "patterns/surfaces/settings/composition/settings-section/settings-section-header.tsx",
79
+ "type": "registry:file",
80
+ "content": "import { Text } from '@tc96/ui/text'\nimport { cn } from '@tc96/utils'\nimport type { ReactElement } from 'react'\nimport type {\n SettingsSectionDescriptionProps,\n SettingsSectionHeaderProps,\n SettingsSectionTitleProps,\n} from '../../core'\nimport { useSettingsSectionTitleId } from './settings-section-context'\n\nexport function SettingsSectionHeader({\n actions,\n children,\n className,\n}: Readonly<SettingsSectionHeaderProps>): ReactElement {\n return (\n <div\n className={cn('flex items-end justify-between gap-3', className)}\n data-slot=\"settings-section-header\"\n >\n <div className=\"flex min-w-0 flex-col gap-1\">{children}</div>\n {actions ? (\n <div className=\"shrink-0\" data-slot=\"settings-section-actions\">\n {actions}\n </div>\n ) : null}\n </div>\n )\n}\n\nexport function SettingsSectionTitle({\n children,\n className,\n}: Readonly<SettingsSectionTitleProps>): ReactElement {\n const id = useSettingsSectionTitleId()\n\n return (\n <Text\n className={className}\n render={\n <h2 data-slot=\"settings-section-title\" id={id}>\n {children}\n </h2>\n }\n size=\"base\"\n weight=\"medium\"\n />\n )\n}\n\nexport function SettingsSectionDescription({\n children,\n className,\n}: Readonly<SettingsSectionDescriptionProps>): ReactElement {\n return (\n <Text\n className={className}\n foreground=\"muted\"\n render={<p data-slot=\"settings-section-description\">{children}</p>}\n size=\"sm\"\n />\n )\n}\n",
81
+ "target": "~/packages/ui/src/patterns/surfaces/settings/composition/settings-section/settings-section-header.tsx"
82
+ },
83
+ {
84
+ "path": "patterns/surfaces/settings/composition/settings-section/settings-section.tsx",
85
+ "type": "registry:file",
86
+ "content": "import { Card } from '@tc96/ui/card'\nimport { cn } from '@tc96/utils'\nimport { type ReactElement, useId } from 'react'\nimport type { SettingsSectionProps } from '../../core'\nimport { SettingsSectionTitleIdContext } from './settings-section-context'\n\nexport function SettingsSection({\n children,\n className,\n header,\n}: Readonly<SettingsSectionProps>): ReactElement {\n const titleId = `settings-section-title-${useId()}`\n const card = (\n <Card>\n <div\n className=\"divide-y px-6 has-[[data-slot=record-group]]:px-4 has-[[data-slot=settings-collapsed]]:px-4\"\n data-slot=\"settings-section-rows\"\n >\n {children}\n </div>\n </Card>\n )\n\n if (!header) {\n return (\n <div className={className} data-slot=\"settings-section\">\n {card}\n </div>\n )\n }\n\n return (\n <section\n aria-labelledby={titleId}\n className={cn('flex flex-col gap-3', className)}\n data-slot=\"settings-section\"\n >\n <SettingsSectionTitleIdContext.Provider value={titleId}>\n {header}\n </SettingsSectionTitleIdContext.Provider>\n {card}\n </section>\n )\n}\n",
87
+ "target": "~/packages/ui/src/patterns/surfaces/settings/composition/settings-section/settings-section.tsx"
88
+ },
89
+ {
90
+ "path": "patterns/surfaces/settings/core.ts",
91
+ "type": "registry:file",
92
+ "content": "import type { ReactNode } from 'react'\n\nexport interface SettingsSectionProps {\n children?: ReactNode\n className?: string\n header?: ReactNode\n}\n\nexport interface SettingsSectionHeaderProps {\n actions?: ReactNode\n children?: ReactNode\n className?: string\n}\n\nexport interface SettingsSectionTitleProps {\n children?: ReactNode\n className?: string\n}\n\nexport interface SettingsSectionDescriptionProps {\n children?: ReactNode\n className?: string\n}\n\nexport interface SettingsRowProps {\n className?: string\n description?: ReactNode\n endSlot?: ReactNode\n startSlot?: ReactNode\n title: ReactNode\n}\n\nexport interface SettingsCollapsedProps {\n actions?: ReactNode\n children?: ReactNode\n className?: string\n defaultOpen?: boolean\n onOpenChange?: (open: boolean) => void\n open?: boolean\n title: ReactNode\n}\n",
93
+ "target": "~/packages/ui/src/patterns/surfaces/settings/core.ts"
94
+ },
95
+ {
96
+ "path": "patterns/surfaces/state/composition/state-surface/state-surface.tsx",
97
+ "type": "registry:file",
98
+ "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",
99
+ "target": "~/packages/ui/src/patterns/surfaces/state/composition/state-surface/state-surface.tsx"
100
+ },
101
+ {
102
+ "path": "patterns/surfaces/state/core.ts",
103
+ "type": "registry:file",
104
+ "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",
105
+ "target": "~/packages/ui/src/patterns/surfaces/state/core.ts"
106
+ }
107
+ ],
108
+ "dependencies": [
109
+ "@phosphor-icons/react@2.1.10",
110
+ "react@19.1.1"
111
+ ],
112
+ "registryDependencies": [
113
+ "@ui/avatar",
114
+ "@ui/badge",
115
+ "@ui/button",
116
+ "@ui/card",
117
+ "@ui/empty",
118
+ "@ui/icon-frame",
119
+ "@ui/menu",
120
+ "@ui/select",
121
+ "@ui/skeleton",
122
+ "@ui/text"
123
+ ],
124
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json"
125
+ }
@@ -0,0 +1,128 @@
1
+ {
2
+ "name": "settings-7",
3
+ "type": "registry:block",
4
+ "files": [
5
+ {
6
+ "path": "blocks/application/settings/settings-7/index.ts",
7
+ "type": "registry:file",
8
+ "content": "export { Settings7 } from './settings-7'\nexport type {\n Settings7Action,\n Settings7Labels,\n Settings7Props,\n Settings7Tag,\n} from './types'\n",
9
+ "target": "~/packages/ui/src/blocks/application/settings/settings-7/index.ts"
10
+ },
11
+ {
12
+ "path": "blocks/application/settings/settings-7/labels.ts",
13
+ "type": "registry:file",
14
+ "content": "import { defaultSettingsLoadLabels } from '../shared/labels'\nimport type { Settings7Labels } from './types'\n\nconst plural = (value: number, one: string, many: string) =>\n `${value} ${value === 1 ? one : many}`\n\nexport const defaultSettings7Labels: Settings7Labels = {\n ...defaultSettingsLoadLabels,\n errorTitle: 'Não foi possível carregar as tags',\n loading: 'Carregando tags',\n actions: (name) => `Ações de ${name}`,\n addSubtag: 'Adicionar subtag',\n delete: 'Excluir',\n description: 'Organize leads e tarefas com tags e subtags.',\n edit: 'Editar',\n emptyDescription: 'Crie uma tag para organizar leads e tarefas.',\n emptyTitle: 'Nenhuma tag ainda',\n newTag: 'Nova tag',\n subtagOf: (parent) => `Subtag de ${parent}`,\n title: 'Tags',\n usage: (leads, tasks) =>\n `${plural(leads, 'lead', 'leads')} · ${plural(tasks, 'tarefa', 'tarefas')}`,\n}\n",
15
+ "target": "~/packages/ui/src/blocks/application/settings/settings-7/labels.ts"
16
+ },
17
+ {
18
+ "path": "blocks/application/settings/settings-7/settings-7-skeleton.tsx",
19
+ "type": "registry:file",
20
+ "content": "import { SettingsRowsSkeleton } from '../shared/settings-skeleton'\n\nexport function Settings7Skeleton() {\n return <SettingsRowsSkeleton count={5} description={false} end=\"menu\" />\n}\n",
21
+ "target": "~/packages/ui/src/blocks/application/settings/settings-7/settings-7-skeleton.tsx"
22
+ },
23
+ {
24
+ "path": "blocks/application/settings/settings-7/settings-7.tsx",
25
+ "type": "registry:file",
26
+ "content": "import { ArrowElbowDownRightIcon } from '@phosphor-icons/react'\nimport { Button } from '@tc96/ui/button'\nimport { SettingsRow } from '@tc96/ui/patterns/surfaces/settings/composition/settings-row/settings-row'\nimport { SettingsSection } from '@tc96/ui/patterns/surfaces/settings/composition/settings-section/settings-section'\nimport {\n SettingsSectionDescription,\n SettingsSectionHeader,\n SettingsSectionTitle,\n} from '@tc96/ui/patterns/surfaces/settings/composition/settings-section/settings-section-header'\nimport { StateSurface } from '@tc96/ui/patterns/surfaces/state/composition/state-surface/state-surface'\nimport { Text } from '@tc96/ui/text'\nimport { cn } from '@tc96/utils'\nimport { settingsLoadState } from '../shared/settings-load-state'\nimport { SettingsRowActions } from '../shared/settings-row-actions'\nimport { SettingsSwatch } from '../shared/settings-swatch'\nimport { defaultSettings7Labels } from './labels'\nimport { Settings7Skeleton } from './settings-7-skeleton'\nimport type {\n Settings7Action,\n Settings7Labels,\n Settings7Props,\n Settings7Tag,\n} from './types'\n\ninterface TagRowProps {\n labels: Settings7Labels\n onTagAction?: Settings7Props['onTagAction']\n parent?: string\n tag: Settings7Tag\n}\n\nfunction TagRow({ labels, onTagAction, parent, tag }: Readonly<TagRowProps>) {\n const actions = [\n { id: 'edit', label: labels.edit },\n ...(parent ? [] : [{ id: 'add-subtag', label: labels.addSubtag }]),\n { destructive: true, id: 'delete', label: labels.delete },\n ]\n\n return (\n <SettingsRow\n className={parent ? 'ps-2' : undefined}\n description={parent ? labels.subtagOf(parent) : undefined}\n endSlot={\n <div className=\"flex items-center gap-3\">\n <Text\n foreground=\"muted\"\n render={<span>{labels.usage(tag.leads, tag.tasks)}</span>}\n size=\"sm\"\n />\n {onTagAction ? (\n <SettingsRowActions\n actions={actions}\n label={labels.actions(tag.name)}\n onAction={(action) =>\n onTagAction(tag.id, action as Settings7Action)\n }\n />\n ) : null}\n </div>\n }\n startSlot={\n parent ? (\n <span className=\"flex items-center gap-2\">\n <ArrowElbowDownRightIcon\n aria-hidden=\"true\"\n className=\"size-4 text-muted-foreground\"\n />\n <SettingsSwatch className={tag.colorClassName} />\n </span>\n ) : (\n <SettingsSwatch className={tag.colorClassName} />\n )\n }\n title={tag.name}\n />\n )\n}\n\nexport function Settings7({\n error,\n onRetry,\n pending,\n className,\n labels: labelsProp,\n onCreate,\n onTagAction,\n tags,\n}: Readonly<Settings7Props>) {\n const labels = { ...defaultSettings7Labels, ...labelsProp }\n const loadState = settingsLoadState({\n error,\n labels,\n onRetry,\n pending,\n skeleton: <Settings7Skeleton />,\n })\n\n return (\n <SettingsSection\n className={cn('mx-auto w-full max-w-2xl', className)}\n header={\n <SettingsSectionHeader\n actions={\n onCreate ? (\n <Button onClick={onCreate} size=\"sm\">\n {labels.newTag}\n </Button>\n ) : undefined\n }\n >\n <SettingsSectionTitle>{labels.title}</SettingsSectionTitle>\n <SettingsSectionDescription>\n {labels.description}\n </SettingsSectionDescription>\n </SettingsSectionHeader>\n }\n >\n {loadState ??\n (tags.length === 0 ? (\n <StateSurface\n description={labels.emptyDescription}\n kind=\"empty\"\n title={labels.emptyTitle}\n />\n ) : (\n tags.flatMap((tag) => [\n <TagRow\n key={tag.id}\n labels={labels}\n onTagAction={onTagAction}\n tag={tag}\n />,\n ...(tag.subtags ?? []).map((subtag) => (\n <TagRow\n key={subtag.id}\n labels={labels}\n onTagAction={onTagAction}\n parent={tag.name}\n tag={subtag}\n />\n )),\n ])\n ))}\n </SettingsSection>\n )\n}\n",
27
+ "target": "~/packages/ui/src/blocks/application/settings/settings-7/settings-7.tsx"
28
+ },
29
+ {
30
+ "path": "blocks/application/settings/settings-7/types.ts",
31
+ "type": "registry:file",
32
+ "content": "import type { SettingsLoadLabels, SettingsLoadProps } from '../shared/types'\nexport interface Settings7Tag {\n colorClassName: string\n id: string\n leads: number\n name: string\n subtags?: Settings7Tag[]\n tasks: number\n}\n\nexport interface Settings7Labels extends SettingsLoadLabels {\n actions: (name: string) => string\n addSubtag: string\n delete: string\n description: string\n edit: string\n emptyDescription: string\n emptyTitle: string\n newTag: string\n subtagOf: (parent: string) => string\n usage: (leads: number, tasks: number) => string\n title: string\n}\n\nexport type Settings7Action = 'edit' | 'add-subtag' | 'delete'\n\nexport interface Settings7Props extends SettingsLoadProps {\n className?: string\n labels?: Partial<Settings7Labels>\n onCreate?: () => void\n onTagAction?: (tagId: string, action: Settings7Action) => void\n tags: Settings7Tag[]\n}\n",
33
+ "target": "~/packages/ui/src/blocks/application/settings/settings-7/types.ts"
34
+ },
35
+ {
36
+ "path": "blocks/application/settings/shared/labels.ts",
37
+ "type": "registry:file",
38
+ "content": "import type { SettingsLoadLabels } from './types'\n\nexport const defaultSettingsLoadLabels: Pick<\n SettingsLoadLabels,\n 'errorDescription' | 'retry'\n> = {\n errorDescription: 'Verifique sua conexão e tente novamente.',\n retry: 'Tentar novamente',\n}\n",
39
+ "target": "~/packages/ui/src/blocks/application/settings/shared/labels.ts"
40
+ },
41
+ {
42
+ "path": "blocks/application/settings/shared/settings-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 type { ReactNode } from 'react'\nimport { SettingsSkeleton } from './settings-skeleton'\nimport type { SettingsLoadLabels, SettingsLoadProps } from './types'\n\nexport interface SettingsLoadStateOptions extends SettingsLoadProps {\n labels: SettingsLoadLabels\n skeleton: ReactNode\n}\n\nexport function settingsLoadState({\n error,\n labels,\n onRetry,\n pending,\n skeleton,\n}: Readonly<SettingsLoadStateOptions>): ReactNode {\n if (pending)\n return (\n <SettingsSkeleton label={labels.loading}>{skeleton}</SettingsSkeleton>\n )\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/settings/shared/settings-load-state.tsx"
46
+ },
47
+ {
48
+ "path": "blocks/application/settings/shared/settings-row-actions.tsx",
49
+ "type": "registry:file",
50
+ "content": "import { DotsThreeIcon } from '@phosphor-icons/react'\nimport { Button } from '@tc96/ui/button'\nimport { Menu, MenuItem, MenuPopup, MenuTrigger } from '@tc96/ui/menu'\nimport type { SettingsRowAction } from './types'\n\nexport interface SettingsRowActionsProps {\n actions: SettingsRowAction[]\n label: string\n onAction: (actionId: string) => void\n}\n\nexport function SettingsRowActions({\n actions,\n label,\n onAction,\n}: Readonly<SettingsRowActionsProps>) {\n if (actions.length === 0) return null\n\n return (\n <Menu>\n <MenuTrigger\n aria-label={label}\n render={<Button size=\"icon-sm\" variant=\"ghost\" />}\n >\n <DotsThreeIcon aria-hidden=\"true\" />\n </MenuTrigger>\n <MenuPopup align=\"end\">\n {actions.map((action) => (\n <MenuItem\n key={action.id}\n onClick={() => onAction(action.id)}\n variant={action.destructive ? 'destructive' : undefined}\n >\n {action.label}\n </MenuItem>\n ))}\n </MenuPopup>\n </Menu>\n )\n}\n",
51
+ "target": "~/packages/ui/src/blocks/application/settings/shared/settings-row-actions.tsx"
52
+ },
53
+ {
54
+ "path": "blocks/application/settings/shared/settings-skeleton.tsx",
55
+ "type": "registry:file",
56
+ "content": "import { Card } from '@tc96/ui/card'\nimport { Skeleton } from '@tc96/ui/skeleton'\nimport { cn } from '@tc96/utils'\nimport type { ReactNode } from 'react'\n\ntype RowStart = 'avatar' | 'icon' | 'none'\ntype RowEnd = 'button' | 'menu' | 'none' | 'select' | 'switch'\n\nconst placeholderIds = (prefix: string, length: number) =>\n Array.from({ length }, (_, index) => `${prefix}-${index}`)\n\nconst titleWidths = ['w-40', 'w-32', 'w-48', 'w-36', 'w-44']\nconst descriptionWidths = ['w-64', 'w-56', 'w-72', 'w-60', 'w-52']\n\nexport function SettingsSkeleton({\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('flex flex-col divide-y', className)}\n data-slot=\"settings-skeleton\"\n >\n {children}\n </output>\n )\n}\n\nexport function SettingsSectionSkeleton({\n action = false,\n children,\n description = false,\n}: Readonly<{ action?: boolean; children: ReactNode; description?: boolean }>) {\n return (\n <div className=\"flex flex-col gap-3\">\n <div className=\"flex items-end justify-between gap-3\">\n <div className=\"flex min-w-0 flex-col gap-1\">\n <Skeleton className=\"h-5 w-32\" />\n {description ? <Skeleton className=\"h-4 w-72 max-w-full\" /> : null}\n </div>\n {action ? <Skeleton className=\"h-8 w-24 shrink-0\" /> : null}\n </div>\n <Card>\n <div className=\"flex flex-col divide-y px-6\">{children}</div>\n </Card>\n </div>\n )\n}\n\nfunction RowEndSkeleton({ end }: Readonly<{ end: RowEnd }>) {\n if (end === 'switch')\n return <Skeleton className=\"h-5 w-9 shrink-0 rounded-full\" />\n if (end === 'select') return <Skeleton className=\"h-8 w-36 shrink-0\" />\n if (end === 'button') return <Skeleton className=\"h-8 w-24 shrink-0\" />\n if (end === 'menu') return <Skeleton className=\"size-8 shrink-0\" />\n return null\n}\n\nexport function SettingsRowsSkeleton({\n count,\n description = true,\n end = 'none',\n start = 'none',\n}: Readonly<{\n count: number\n description?: boolean\n end?: RowEnd\n start?: RowStart\n}>) {\n return placeholderIds('row', count).map((id, index) => (\n <div className=\"flex items-center gap-3 py-3\" key={id}>\n {start === 'avatar' ? (\n <Skeleton className=\"size-10 shrink-0 rounded-full\" />\n ) : null}\n {start === 'icon' ? <Skeleton className=\"size-4 shrink-0\" /> : null}\n <div className=\"flex min-w-0 flex-1 flex-col gap-1.5\">\n <Skeleton className={cn('h-4 max-w-full', titleWidths[index % 5])} />\n {description ? (\n <Skeleton\n className={cn('h-3.5 max-w-full', descriptionWidths[index % 5])}\n />\n ) : null}\n </div>\n <RowEndSkeleton end={end} />\n </div>\n ))\n}\n\nexport function SettingsCollapsedSkeleton({\n children,\n}: Readonly<{ children: ReactNode }>) {\n return (\n <div className=\"my-1 flex flex-col first:mt-4 last:mb-4\">\n <Skeleton className=\"h-10 w-full rounded-lg\" />\n <div className=\"flex flex-col px-4\">{children}</div>\n </div>\n )\n}\n\nexport function SettingsTableSkeleton({\n columns,\n rows,\n}: Readonly<{ columns: number; rows: number }>) {\n return (\n <div className=\"flex flex-col divide-y py-2\">\n {placeholderIds('row', rows + 1).map((rowId, row) => (\n <div\n className=\"grid gap-4 py-3\"\n key={rowId}\n style={{ gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))` }}\n >\n {placeholderIds('cell', columns).map((cellId) => (\n <Skeleton\n className={row === 0 ? 'h-3.5 w-16' : 'h-4 w-full'}\n key={cellId}\n />\n ))}\n </div>\n ))}\n </div>\n )\n}\n",
57
+ "target": "~/packages/ui/src/blocks/application/settings/shared/settings-skeleton.tsx"
58
+ },
59
+ {
60
+ "path": "blocks/application/settings/shared/settings-swatch.tsx",
61
+ "type": "registry:file",
62
+ "content": "import { cn } from '@tc96/utils'\n\nexport function SettingsSwatch({ className }: Readonly<{ className: string }>) {\n return (\n <span aria-hidden=\"true\" className={cn('size-3 rounded-full', className)} />\n )\n}\n",
63
+ "target": "~/packages/ui/src/blocks/application/settings/shared/settings-swatch.tsx"
64
+ },
65
+ {
66
+ "path": "blocks/application/settings/shared/types.ts",
67
+ "type": "registry:file",
68
+ "content": "export interface SettingsRowAction {\n destructive?: boolean\n id: string\n label: string\n}\n\nexport interface SettingsOption {\n label: string\n value: string\n}\n\nexport interface SettingsLoadLabels {\n errorDescription: string\n errorTitle: string\n loading: string\n retry: string\n}\n\nexport interface SettingsLoadProps {\n error?: boolean\n onRetry?: () => void\n pending?: boolean\n}\n",
69
+ "target": "~/packages/ui/src/blocks/application/settings/shared/types.ts"
70
+ },
71
+ {
72
+ "path": "patterns/surfaces/settings/composition/settings-row/settings-row.tsx",
73
+ "type": "registry:file",
74
+ "content": "import { Text } from '@tc96/ui/text'\nimport { cn } from '@tc96/utils'\nimport type { ReactElement } from 'react'\nimport type { SettingsRowProps } from '../../core'\n\nexport function SettingsRow({\n className,\n description,\n endSlot,\n startSlot,\n title,\n}: Readonly<SettingsRowProps>): ReactElement {\n return (\n <div\n className={cn('flex items-center gap-3 py-3', className)}\n data-slot=\"settings-row\"\n >\n {startSlot ? (\n <div\n className=\"flex shrink-0 items-center [&>svg]:size-4\"\n data-slot=\"settings-row-start\"\n >\n {startSlot}\n </div>\n ) : null}\n <div className=\"min-w-0 flex-1\" data-slot=\"settings-row-heading\">\n <Text\n render={<p data-slot=\"settings-row-title\">{title}</p>}\n size=\"sm\"\n weight=\"semibold\"\n />\n {description ? (\n <Text\n foreground=\"muted\"\n render={<p data-slot=\"settings-row-description\">{description}</p>}\n size=\"sm\"\n />\n ) : null}\n </div>\n {endSlot ? (\n <div\n className=\"ms-3 flex shrink-0 items-center gap-2\"\n data-slot=\"settings-row-end\"\n >\n {endSlot}\n </div>\n ) : null}\n </div>\n )\n}\n",
75
+ "target": "~/packages/ui/src/patterns/surfaces/settings/composition/settings-row/settings-row.tsx"
76
+ },
77
+ {
78
+ "path": "patterns/surfaces/settings/composition/settings-section/settings-section-context.ts",
79
+ "type": "registry:file",
80
+ "content": "import { createContext, useContext } from 'react'\n\nexport const SettingsSectionTitleIdContext = createContext<string | undefined>(\n undefined,\n)\n\nexport function useSettingsSectionTitleId(): string | undefined {\n return useContext(SettingsSectionTitleIdContext)\n}\n",
81
+ "target": "~/packages/ui/src/patterns/surfaces/settings/composition/settings-section/settings-section-context.ts"
82
+ },
83
+ {
84
+ "path": "patterns/surfaces/settings/composition/settings-section/settings-section-header.tsx",
85
+ "type": "registry:file",
86
+ "content": "import { Text } from '@tc96/ui/text'\nimport { cn } from '@tc96/utils'\nimport type { ReactElement } from 'react'\nimport type {\n SettingsSectionDescriptionProps,\n SettingsSectionHeaderProps,\n SettingsSectionTitleProps,\n} from '../../core'\nimport { useSettingsSectionTitleId } from './settings-section-context'\n\nexport function SettingsSectionHeader({\n actions,\n children,\n className,\n}: Readonly<SettingsSectionHeaderProps>): ReactElement {\n return (\n <div\n className={cn('flex items-end justify-between gap-3', className)}\n data-slot=\"settings-section-header\"\n >\n <div className=\"flex min-w-0 flex-col gap-1\">{children}</div>\n {actions ? (\n <div className=\"shrink-0\" data-slot=\"settings-section-actions\">\n {actions}\n </div>\n ) : null}\n </div>\n )\n}\n\nexport function SettingsSectionTitle({\n children,\n className,\n}: Readonly<SettingsSectionTitleProps>): ReactElement {\n const id = useSettingsSectionTitleId()\n\n return (\n <Text\n className={className}\n render={\n <h2 data-slot=\"settings-section-title\" id={id}>\n {children}\n </h2>\n }\n size=\"base\"\n weight=\"medium\"\n />\n )\n}\n\nexport function SettingsSectionDescription({\n children,\n className,\n}: Readonly<SettingsSectionDescriptionProps>): ReactElement {\n return (\n <Text\n className={className}\n foreground=\"muted\"\n render={<p data-slot=\"settings-section-description\">{children}</p>}\n size=\"sm\"\n />\n )\n}\n",
87
+ "target": "~/packages/ui/src/patterns/surfaces/settings/composition/settings-section/settings-section-header.tsx"
88
+ },
89
+ {
90
+ "path": "patterns/surfaces/settings/composition/settings-section/settings-section.tsx",
91
+ "type": "registry:file",
92
+ "content": "import { Card } from '@tc96/ui/card'\nimport { cn } from '@tc96/utils'\nimport { type ReactElement, useId } from 'react'\nimport type { SettingsSectionProps } from '../../core'\nimport { SettingsSectionTitleIdContext } from './settings-section-context'\n\nexport function SettingsSection({\n children,\n className,\n header,\n}: Readonly<SettingsSectionProps>): ReactElement {\n const titleId = `settings-section-title-${useId()}`\n const card = (\n <Card>\n <div\n className=\"divide-y px-6 has-[[data-slot=record-group]]:px-4 has-[[data-slot=settings-collapsed]]:px-4\"\n data-slot=\"settings-section-rows\"\n >\n {children}\n </div>\n </Card>\n )\n\n if (!header) {\n return (\n <div className={className} data-slot=\"settings-section\">\n {card}\n </div>\n )\n }\n\n return (\n <section\n aria-labelledby={titleId}\n className={cn('flex flex-col gap-3', className)}\n data-slot=\"settings-section\"\n >\n <SettingsSectionTitleIdContext.Provider value={titleId}>\n {header}\n </SettingsSectionTitleIdContext.Provider>\n {card}\n </section>\n )\n}\n",
93
+ "target": "~/packages/ui/src/patterns/surfaces/settings/composition/settings-section/settings-section.tsx"
94
+ },
95
+ {
96
+ "path": "patterns/surfaces/settings/core.ts",
97
+ "type": "registry:file",
98
+ "content": "import type { ReactNode } from 'react'\n\nexport interface SettingsSectionProps {\n children?: ReactNode\n className?: string\n header?: ReactNode\n}\n\nexport interface SettingsSectionHeaderProps {\n actions?: ReactNode\n children?: ReactNode\n className?: string\n}\n\nexport interface SettingsSectionTitleProps {\n children?: ReactNode\n className?: string\n}\n\nexport interface SettingsSectionDescriptionProps {\n children?: ReactNode\n className?: string\n}\n\nexport interface SettingsRowProps {\n className?: string\n description?: ReactNode\n endSlot?: ReactNode\n startSlot?: ReactNode\n title: ReactNode\n}\n\nexport interface SettingsCollapsedProps {\n actions?: ReactNode\n children?: ReactNode\n className?: string\n defaultOpen?: boolean\n onOpenChange?: (open: boolean) => void\n open?: boolean\n title: ReactNode\n}\n",
99
+ "target": "~/packages/ui/src/patterns/surfaces/settings/core.ts"
100
+ },
101
+ {
102
+ "path": "patterns/surfaces/state/composition/state-surface/state-surface.tsx",
103
+ "type": "registry:file",
104
+ "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",
105
+ "target": "~/packages/ui/src/patterns/surfaces/state/composition/state-surface/state-surface.tsx"
106
+ },
107
+ {
108
+ "path": "patterns/surfaces/state/core.ts",
109
+ "type": "registry:file",
110
+ "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",
111
+ "target": "~/packages/ui/src/patterns/surfaces/state/core.ts"
112
+ }
113
+ ],
114
+ "dependencies": [
115
+ "@phosphor-icons/react@2.1.10",
116
+ "react@19.1.1"
117
+ ],
118
+ "registryDependencies": [
119
+ "@ui/button",
120
+ "@ui/card",
121
+ "@ui/empty",
122
+ "@ui/icon-frame",
123
+ "@ui/menu",
124
+ "@ui/skeleton",
125
+ "@ui/text"
126
+ ],
127
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json"
128
+ }
@@ -0,0 +1,116 @@
1
+ {
2
+ "name": "settings-8",
3
+ "type": "registry:block",
4
+ "files": [
5
+ {
6
+ "path": "blocks/application/settings/settings-8/index.ts",
7
+ "type": "registry:file",
8
+ "content": "export { Settings8 } from './settings-8'\nexport type { Settings8Labels, Settings8Props } from './types'\n",
9
+ "target": "~/packages/ui/src/blocks/application/settings/settings-8/index.ts"
10
+ },
11
+ {
12
+ "path": "blocks/application/settings/settings-8/labels.ts",
13
+ "type": "registry:file",
14
+ "content": "import { defaultSettingsLoadLabels } from '../shared/labels'\nimport type { Settings8Labels } from './types'\n\nexport const defaultSettings8Labels: Settings8Labels = {\n ...defaultSettingsLoadLabels,\n errorTitle: 'Não foi possível carregar os SLAs',\n loading: 'Carregando SLAs',\n description:\n 'Aplique prazos às issues que correspondem às regras de automação',\n enable: 'Ativar SLAs',\n title: 'SLAs',\n}\n",
15
+ "target": "~/packages/ui/src/blocks/application/settings/settings-8/labels.ts"
16
+ },
17
+ {
18
+ "path": "blocks/application/settings/settings-8/settings-8-skeleton.tsx",
19
+ "type": "registry:file",
20
+ "content": "import { SettingsRowsSkeleton } from '../shared/settings-skeleton'\n\nexport function Settings8Skeleton() {\n return <SettingsRowsSkeleton count={1} end=\"switch\" />\n}\n",
21
+ "target": "~/packages/ui/src/blocks/application/settings/settings-8/settings-8-skeleton.tsx"
22
+ },
23
+ {
24
+ "path": "blocks/application/settings/settings-8/settings-8.tsx",
25
+ "type": "registry:file",
26
+ "content": "import { SettingsRow } from '@tc96/ui/patterns/surfaces/settings/composition/settings-row/settings-row'\nimport { SettingsSection } from '@tc96/ui/patterns/surfaces/settings/composition/settings-section/settings-section'\nimport {\n SettingsSectionHeader,\n SettingsSectionTitle,\n} from '@tc96/ui/patterns/surfaces/settings/composition/settings-section/settings-section-header'\nimport { Switch } from '@tc96/ui/switch'\nimport { cn } from '@tc96/utils'\nimport { settingsLoadState } from '../shared/settings-load-state'\nimport { defaultSettings8Labels } from './labels'\nimport { Settings8Skeleton } from './settings-8-skeleton'\nimport type { Settings8Props } from './types'\n\nexport function Settings8({\n error,\n onRetry,\n pending,\n className,\n enabled = false,\n labels: labelsProp,\n onEnabledChange,\n}: Readonly<Settings8Props>) {\n const labels = { ...defaultSettings8Labels, ...labelsProp }\n const loadState = settingsLoadState({\n error,\n labels,\n onRetry,\n pending,\n skeleton: <Settings8Skeleton />,\n })\n\n return (\n <SettingsSection\n className={cn('mx-auto w-full max-w-2xl', className)}\n header={\n <SettingsSectionHeader>\n <SettingsSectionTitle>{labels.title}</SettingsSectionTitle>\n </SettingsSectionHeader>\n }\n >\n {loadState ?? (\n <SettingsRow\n description={labels.description}\n endSlot={\n <Switch\n aria-label={labels.enable}\n checked={enabled}\n onCheckedChange={onEnabledChange}\n />\n }\n title={labels.enable}\n />\n )}\n </SettingsSection>\n )\n}\n",
27
+ "target": "~/packages/ui/src/blocks/application/settings/settings-8/settings-8.tsx"
28
+ },
29
+ {
30
+ "path": "blocks/application/settings/settings-8/types.ts",
31
+ "type": "registry:file",
32
+ "content": "import type { SettingsLoadLabels, SettingsLoadProps } from '../shared/types'\nexport interface Settings8Labels extends SettingsLoadLabels {\n description: string\n enable: string\n title: string\n}\n\nexport interface Settings8Props extends SettingsLoadProps {\n className?: string\n enabled?: boolean\n labels?: Partial<Settings8Labels>\n onEnabledChange?: (enabled: boolean) => void\n}\n",
33
+ "target": "~/packages/ui/src/blocks/application/settings/settings-8/types.ts"
34
+ },
35
+ {
36
+ "path": "blocks/application/settings/shared/labels.ts",
37
+ "type": "registry:file",
38
+ "content": "import type { SettingsLoadLabels } from './types'\n\nexport const defaultSettingsLoadLabels: Pick<\n SettingsLoadLabels,\n 'errorDescription' | 'retry'\n> = {\n errorDescription: 'Verifique sua conexão e tente novamente.',\n retry: 'Tentar novamente',\n}\n",
39
+ "target": "~/packages/ui/src/blocks/application/settings/shared/labels.ts"
40
+ },
41
+ {
42
+ "path": "blocks/application/settings/shared/settings-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 type { ReactNode } from 'react'\nimport { SettingsSkeleton } from './settings-skeleton'\nimport type { SettingsLoadLabels, SettingsLoadProps } from './types'\n\nexport interface SettingsLoadStateOptions extends SettingsLoadProps {\n labels: SettingsLoadLabels\n skeleton: ReactNode\n}\n\nexport function settingsLoadState({\n error,\n labels,\n onRetry,\n pending,\n skeleton,\n}: Readonly<SettingsLoadStateOptions>): ReactNode {\n if (pending)\n return (\n <SettingsSkeleton label={labels.loading}>{skeleton}</SettingsSkeleton>\n )\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/settings/shared/settings-load-state.tsx"
46
+ },
47
+ {
48
+ "path": "blocks/application/settings/shared/settings-skeleton.tsx",
49
+ "type": "registry:file",
50
+ "content": "import { Card } from '@tc96/ui/card'\nimport { Skeleton } from '@tc96/ui/skeleton'\nimport { cn } from '@tc96/utils'\nimport type { ReactNode } from 'react'\n\ntype RowStart = 'avatar' | 'icon' | 'none'\ntype RowEnd = 'button' | 'menu' | 'none' | 'select' | 'switch'\n\nconst placeholderIds = (prefix: string, length: number) =>\n Array.from({ length }, (_, index) => `${prefix}-${index}`)\n\nconst titleWidths = ['w-40', 'w-32', 'w-48', 'w-36', 'w-44']\nconst descriptionWidths = ['w-64', 'w-56', 'w-72', 'w-60', 'w-52']\n\nexport function SettingsSkeleton({\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('flex flex-col divide-y', className)}\n data-slot=\"settings-skeleton\"\n >\n {children}\n </output>\n )\n}\n\nexport function SettingsSectionSkeleton({\n action = false,\n children,\n description = false,\n}: Readonly<{ action?: boolean; children: ReactNode; description?: boolean }>) {\n return (\n <div className=\"flex flex-col gap-3\">\n <div className=\"flex items-end justify-between gap-3\">\n <div className=\"flex min-w-0 flex-col gap-1\">\n <Skeleton className=\"h-5 w-32\" />\n {description ? <Skeleton className=\"h-4 w-72 max-w-full\" /> : null}\n </div>\n {action ? <Skeleton className=\"h-8 w-24 shrink-0\" /> : null}\n </div>\n <Card>\n <div className=\"flex flex-col divide-y px-6\">{children}</div>\n </Card>\n </div>\n )\n}\n\nfunction RowEndSkeleton({ end }: Readonly<{ end: RowEnd }>) {\n if (end === 'switch')\n return <Skeleton className=\"h-5 w-9 shrink-0 rounded-full\" />\n if (end === 'select') return <Skeleton className=\"h-8 w-36 shrink-0\" />\n if (end === 'button') return <Skeleton className=\"h-8 w-24 shrink-0\" />\n if (end === 'menu') return <Skeleton className=\"size-8 shrink-0\" />\n return null\n}\n\nexport function SettingsRowsSkeleton({\n count,\n description = true,\n end = 'none',\n start = 'none',\n}: Readonly<{\n count: number\n description?: boolean\n end?: RowEnd\n start?: RowStart\n}>) {\n return placeholderIds('row', count).map((id, index) => (\n <div className=\"flex items-center gap-3 py-3\" key={id}>\n {start === 'avatar' ? (\n <Skeleton className=\"size-10 shrink-0 rounded-full\" />\n ) : null}\n {start === 'icon' ? <Skeleton className=\"size-4 shrink-0\" /> : null}\n <div className=\"flex min-w-0 flex-1 flex-col gap-1.5\">\n <Skeleton className={cn('h-4 max-w-full', titleWidths[index % 5])} />\n {description ? (\n <Skeleton\n className={cn('h-3.5 max-w-full', descriptionWidths[index % 5])}\n />\n ) : null}\n </div>\n <RowEndSkeleton end={end} />\n </div>\n ))\n}\n\nexport function SettingsCollapsedSkeleton({\n children,\n}: Readonly<{ children: ReactNode }>) {\n return (\n <div className=\"my-1 flex flex-col first:mt-4 last:mb-4\">\n <Skeleton className=\"h-10 w-full rounded-lg\" />\n <div className=\"flex flex-col px-4\">{children}</div>\n </div>\n )\n}\n\nexport function SettingsTableSkeleton({\n columns,\n rows,\n}: Readonly<{ columns: number; rows: number }>) {\n return (\n <div className=\"flex flex-col divide-y py-2\">\n {placeholderIds('row', rows + 1).map((rowId, row) => (\n <div\n className=\"grid gap-4 py-3\"\n key={rowId}\n style={{ gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))` }}\n >\n {placeholderIds('cell', columns).map((cellId) => (\n <Skeleton\n className={row === 0 ? 'h-3.5 w-16' : 'h-4 w-full'}\n key={cellId}\n />\n ))}\n </div>\n ))}\n </div>\n )\n}\n",
51
+ "target": "~/packages/ui/src/blocks/application/settings/shared/settings-skeleton.tsx"
52
+ },
53
+ {
54
+ "path": "blocks/application/settings/shared/types.ts",
55
+ "type": "registry:file",
56
+ "content": "export interface SettingsRowAction {\n destructive?: boolean\n id: string\n label: string\n}\n\nexport interface SettingsOption {\n label: string\n value: string\n}\n\nexport interface SettingsLoadLabels {\n errorDescription: string\n errorTitle: string\n loading: string\n retry: string\n}\n\nexport interface SettingsLoadProps {\n error?: boolean\n onRetry?: () => void\n pending?: boolean\n}\n",
57
+ "target": "~/packages/ui/src/blocks/application/settings/shared/types.ts"
58
+ },
59
+ {
60
+ "path": "patterns/surfaces/settings/composition/settings-row/settings-row.tsx",
61
+ "type": "registry:file",
62
+ "content": "import { Text } from '@tc96/ui/text'\nimport { cn } from '@tc96/utils'\nimport type { ReactElement } from 'react'\nimport type { SettingsRowProps } from '../../core'\n\nexport function SettingsRow({\n className,\n description,\n endSlot,\n startSlot,\n title,\n}: Readonly<SettingsRowProps>): ReactElement {\n return (\n <div\n className={cn('flex items-center gap-3 py-3', className)}\n data-slot=\"settings-row\"\n >\n {startSlot ? (\n <div\n className=\"flex shrink-0 items-center [&>svg]:size-4\"\n data-slot=\"settings-row-start\"\n >\n {startSlot}\n </div>\n ) : null}\n <div className=\"min-w-0 flex-1\" data-slot=\"settings-row-heading\">\n <Text\n render={<p data-slot=\"settings-row-title\">{title}</p>}\n size=\"sm\"\n weight=\"semibold\"\n />\n {description ? (\n <Text\n foreground=\"muted\"\n render={<p data-slot=\"settings-row-description\">{description}</p>}\n size=\"sm\"\n />\n ) : null}\n </div>\n {endSlot ? (\n <div\n className=\"ms-3 flex shrink-0 items-center gap-2\"\n data-slot=\"settings-row-end\"\n >\n {endSlot}\n </div>\n ) : null}\n </div>\n )\n}\n",
63
+ "target": "~/packages/ui/src/patterns/surfaces/settings/composition/settings-row/settings-row.tsx"
64
+ },
65
+ {
66
+ "path": "patterns/surfaces/settings/composition/settings-section/settings-section-context.ts",
67
+ "type": "registry:file",
68
+ "content": "import { createContext, useContext } from 'react'\n\nexport const SettingsSectionTitleIdContext = createContext<string | undefined>(\n undefined,\n)\n\nexport function useSettingsSectionTitleId(): string | undefined {\n return useContext(SettingsSectionTitleIdContext)\n}\n",
69
+ "target": "~/packages/ui/src/patterns/surfaces/settings/composition/settings-section/settings-section-context.ts"
70
+ },
71
+ {
72
+ "path": "patterns/surfaces/settings/composition/settings-section/settings-section-header.tsx",
73
+ "type": "registry:file",
74
+ "content": "import { Text } from '@tc96/ui/text'\nimport { cn } from '@tc96/utils'\nimport type { ReactElement } from 'react'\nimport type {\n SettingsSectionDescriptionProps,\n SettingsSectionHeaderProps,\n SettingsSectionTitleProps,\n} from '../../core'\nimport { useSettingsSectionTitleId } from './settings-section-context'\n\nexport function SettingsSectionHeader({\n actions,\n children,\n className,\n}: Readonly<SettingsSectionHeaderProps>): ReactElement {\n return (\n <div\n className={cn('flex items-end justify-between gap-3', className)}\n data-slot=\"settings-section-header\"\n >\n <div className=\"flex min-w-0 flex-col gap-1\">{children}</div>\n {actions ? (\n <div className=\"shrink-0\" data-slot=\"settings-section-actions\">\n {actions}\n </div>\n ) : null}\n </div>\n )\n}\n\nexport function SettingsSectionTitle({\n children,\n className,\n}: Readonly<SettingsSectionTitleProps>): ReactElement {\n const id = useSettingsSectionTitleId()\n\n return (\n <Text\n className={className}\n render={\n <h2 data-slot=\"settings-section-title\" id={id}>\n {children}\n </h2>\n }\n size=\"base\"\n weight=\"medium\"\n />\n )\n}\n\nexport function SettingsSectionDescription({\n children,\n className,\n}: Readonly<SettingsSectionDescriptionProps>): ReactElement {\n return (\n <Text\n className={className}\n foreground=\"muted\"\n render={<p data-slot=\"settings-section-description\">{children}</p>}\n size=\"sm\"\n />\n )\n}\n",
75
+ "target": "~/packages/ui/src/patterns/surfaces/settings/composition/settings-section/settings-section-header.tsx"
76
+ },
77
+ {
78
+ "path": "patterns/surfaces/settings/composition/settings-section/settings-section.tsx",
79
+ "type": "registry:file",
80
+ "content": "import { Card } from '@tc96/ui/card'\nimport { cn } from '@tc96/utils'\nimport { type ReactElement, useId } from 'react'\nimport type { SettingsSectionProps } from '../../core'\nimport { SettingsSectionTitleIdContext } from './settings-section-context'\n\nexport function SettingsSection({\n children,\n className,\n header,\n}: Readonly<SettingsSectionProps>): ReactElement {\n const titleId = `settings-section-title-${useId()}`\n const card = (\n <Card>\n <div\n className=\"divide-y px-6 has-[[data-slot=record-group]]:px-4 has-[[data-slot=settings-collapsed]]:px-4\"\n data-slot=\"settings-section-rows\"\n >\n {children}\n </div>\n </Card>\n )\n\n if (!header) {\n return (\n <div className={className} data-slot=\"settings-section\">\n {card}\n </div>\n )\n }\n\n return (\n <section\n aria-labelledby={titleId}\n className={cn('flex flex-col gap-3', className)}\n data-slot=\"settings-section\"\n >\n <SettingsSectionTitleIdContext.Provider value={titleId}>\n {header}\n </SettingsSectionTitleIdContext.Provider>\n {card}\n </section>\n )\n}\n",
81
+ "target": "~/packages/ui/src/patterns/surfaces/settings/composition/settings-section/settings-section.tsx"
82
+ },
83
+ {
84
+ "path": "patterns/surfaces/settings/core.ts",
85
+ "type": "registry:file",
86
+ "content": "import type { ReactNode } from 'react'\n\nexport interface SettingsSectionProps {\n children?: ReactNode\n className?: string\n header?: ReactNode\n}\n\nexport interface SettingsSectionHeaderProps {\n actions?: ReactNode\n children?: ReactNode\n className?: string\n}\n\nexport interface SettingsSectionTitleProps {\n children?: ReactNode\n className?: string\n}\n\nexport interface SettingsSectionDescriptionProps {\n children?: ReactNode\n className?: string\n}\n\nexport interface SettingsRowProps {\n className?: string\n description?: ReactNode\n endSlot?: ReactNode\n startSlot?: ReactNode\n title: ReactNode\n}\n\nexport interface SettingsCollapsedProps {\n actions?: ReactNode\n children?: ReactNode\n className?: string\n defaultOpen?: boolean\n onOpenChange?: (open: boolean) => void\n open?: boolean\n title: ReactNode\n}\n",
87
+ "target": "~/packages/ui/src/patterns/surfaces/settings/core.ts"
88
+ },
89
+ {
90
+ "path": "patterns/surfaces/state/composition/state-surface/state-surface.tsx",
91
+ "type": "registry:file",
92
+ "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",
93
+ "target": "~/packages/ui/src/patterns/surfaces/state/composition/state-surface/state-surface.tsx"
94
+ },
95
+ {
96
+ "path": "patterns/surfaces/state/core.ts",
97
+ "type": "registry:file",
98
+ "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",
99
+ "target": "~/packages/ui/src/patterns/surfaces/state/core.ts"
100
+ }
101
+ ],
102
+ "dependencies": [
103
+ "@phosphor-icons/react@2.1.10",
104
+ "react@19.1.1"
105
+ ],
106
+ "registryDependencies": [
107
+ "@ui/button",
108
+ "@ui/card",
109
+ "@ui/empty",
110
+ "@ui/icon-frame",
111
+ "@ui/skeleton",
112
+ "@ui/switch",
113
+ "@ui/text"
114
+ ],
115
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json"
116
+ }