@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,183 @@
1
+ {
2
+ "name": "settings-catalog-8",
3
+ "type": "registry:block",
4
+ "files": [
5
+ {
6
+ "path": "blocks/application/settings/catalog/settings-catalog-8/index.ts",
7
+ "type": "registry:file",
8
+ "content": "export { SettingsCatalog8 } from './settings-catalog-8'\nexport type {\n SettingsCatalog8Account,\n SettingsCatalog8AccountType,\n SettingsCatalog8Action,\n SettingsCatalog8Labels,\n SettingsCatalog8Props,\n} from './types'\n",
9
+ "target": "~/packages/ui/src/blocks/application/settings/catalog/settings-catalog-8/index.ts"
10
+ },
11
+ {
12
+ "path": "blocks/application/settings/catalog/settings-catalog-8/labels.ts",
13
+ "type": "registry:file",
14
+ "content": "import { defaultSettingsLoadLabels } from '../../shared/labels'\nimport type {\n SettingsCatalog8AccountType,\n SettingsCatalog8Labels,\n} from './types'\n\nconst accountTypeLabels: Record<SettingsCatalog8AccountType, string> = {\n bank: 'Banco',\n cash: 'Dinheiro',\n}\n\nexport const defaultSettingsCatalog8Labels: SettingsCatalog8Labels = {\n ...defaultSettingsLoadLabels,\n errorTitle: 'Não foi possível carregar as contas',\n loading: 'Carregando contas',\n accountType: (type) => accountTypeLabels[type],\n actions: (name) => `Ações de ${name}`,\n archive: 'Arquivar',\n archived: 'Arquivadas',\n default: 'Padrão',\n description:\n 'Bancos e caixas onde os lançamentos são liquidados. Novos lançamentos começam na conta padrão.',\n edit: 'Editar',\n emptyDescription: 'Crie uma conta para começar a registrar lançamentos.',\n emptyTitle: 'Nenhuma conta ainda',\n makeDefault: 'Tornar padrão',\n newAccount: 'Nova conta',\n opening: (type, balance, date) => `${type} · Abre com ${balance} em ${date}`,\n restore: 'Restaurar',\n title: 'Contas',\n}\n",
15
+ "target": "~/packages/ui/src/blocks/application/settings/catalog/settings-catalog-8/labels.ts"
16
+ },
17
+ {
18
+ "path": "blocks/application/settings/catalog/settings-catalog-8/settings-catalog-8-skeleton.tsx",
19
+ "type": "registry:file",
20
+ "content": "import { SettingsRowsSkeleton } from '../../shared/settings-skeleton'\n\nexport function SettingsCatalog8Skeleton() {\n return <SettingsRowsSkeleton count={4} start=\"icon\" end=\"menu\" />\n}\n",
21
+ "target": "~/packages/ui/src/blocks/application/settings/catalog/settings-catalog-8/settings-catalog-8-skeleton.tsx"
22
+ },
23
+ {
24
+ "path": "blocks/application/settings/catalog/settings-catalog-8/settings-catalog-8.tsx",
25
+ "type": "registry:file",
26
+ "content": "import { BankIcon, StarIcon, WalletIcon } from '@phosphor-icons/react'\nimport { Button } from '@tc96/ui/button'\nimport { formatMediumDate } from '@tc96/ui/helpers/date'\nimport { formatAmount } from '@tc96/ui/helpers/format'\nimport { IconFrame } from '@tc96/ui/icon-frame'\nimport { FlagProperty } from '@tc96/ui/patterns/properties/display/flag/flag-property'\nimport { SettingsCollapsed } from '@tc96/ui/patterns/surfaces/settings/composition/settings-collapsed/settings-collapsed'\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 { cn } from '@tc96/utils'\nimport { settingsLoadState } from '../../shared/settings-load-state'\nimport { SettingsRowActions } from '../../shared/settings-row-actions'\nimport { defaultSettingsCatalog8Labels } from './labels'\nimport { SettingsCatalog8Skeleton } from './settings-catalog-8-skeleton'\nimport type {\n SettingsCatalog8Account,\n SettingsCatalog8AccountType,\n SettingsCatalog8Action,\n SettingsCatalog8Labels,\n SettingsCatalog8Props,\n} from './types'\n\nconst accountIcons = {\n bank: BankIcon,\n cash: WalletIcon,\n} satisfies Record<SettingsCatalog8AccountType, typeof BankIcon>\n\ninterface AccountRowProps {\n account: SettingsCatalog8Account\n archived?: boolean\n currency: string\n isDefault?: boolean\n labels: SettingsCatalog8Labels\n locale: string\n onAccountAction?: SettingsCatalog8Props['onAccountAction']\n}\n\nfunction AccountRow({\n account,\n archived,\n currency,\n isDefault,\n labels,\n locale,\n onAccountAction,\n}: Readonly<AccountRowProps>) {\n const AccountIcon = accountIcons[account.type]\n const actions = archived\n ? [{ id: 'restore', label: labels.restore }]\n : [\n { id: 'edit', label: labels.edit },\n ...(isDefault\n ? []\n : [\n { id: 'make-default', label: labels.makeDefault },\n { destructive: true, id: 'archive', label: labels.archive },\n ]),\n ]\n\n return (\n <SettingsRow\n description={labels.opening(\n labels.accountType(account.type),\n formatAmount(account.openingBalance, { currency, locale }),\n formatMediumDate(\n new Date(`${account.openingOn}T00:00:00Z`),\n locale,\n 'UTC',\n ),\n )}\n endSlot={\n <div className=\"flex items-center gap-3\">\n <FlagProperty\n active={Boolean(isDefault)}\n activeIcon={StarIcon}\n label={labels.default}\n />\n {onAccountAction ? (\n <SettingsRowActions\n actions={actions}\n label={labels.actions(account.name)}\n onAction={(action) =>\n onAccountAction(account.id, action as SettingsCatalog8Action)\n }\n />\n ) : null}\n </div>\n }\n startSlot={\n <IconFrame shape=\"rounded\">\n <AccountIcon aria-hidden=\"true\" className=\"size-4\" />\n </IconFrame>\n }\n title={account.name}\n />\n )\n}\n\nexport function SettingsCatalog8({\n error,\n onRetry,\n pending,\n accounts,\n archivedAccounts = [],\n className,\n currency = 'BRL',\n defaultAccountId,\n labels: labelsProp,\n locale = 'pt-BR',\n onAccountAction,\n onCreate,\n}: Readonly<SettingsCatalog8Props>) {\n const labels = { ...defaultSettingsCatalog8Labels, ...labelsProp }\n const loadState = settingsLoadState({\n error,\n labels,\n onRetry,\n pending,\n skeleton: <SettingsCatalog8Skeleton />,\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.newAccount}\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 <>\n {accounts.length === 0 ? (\n <StateSurface\n description={labels.emptyDescription}\n kind=\"empty\"\n title={labels.emptyTitle}\n />\n ) : (\n accounts.map((account) => (\n <AccountRow\n account={account}\n currency={currency}\n isDefault={account.id === defaultAccountId}\n key={account.id}\n labels={labels}\n locale={locale}\n onAccountAction={onAccountAction}\n />\n ))\n )}\n {archivedAccounts.length > 0 ? (\n <div>\n <SettingsCollapsed defaultOpen={false} title={labels.archived}>\n {archivedAccounts.map((account) => (\n <AccountRow\n account={account}\n archived\n currency={currency}\n key={account.id}\n labels={labels}\n locale={locale}\n onAccountAction={onAccountAction}\n />\n ))}\n </SettingsCollapsed>\n </div>\n ) : null}\n </>\n )}\n </SettingsSection>\n )\n}\n",
27
+ "target": "~/packages/ui/src/blocks/application/settings/catalog/settings-catalog-8/settings-catalog-8.tsx"
28
+ },
29
+ {
30
+ "path": "blocks/application/settings/catalog/settings-catalog-8/types.ts",
31
+ "type": "registry:file",
32
+ "content": "import type { SettingsLoadLabels, SettingsLoadProps } from '../../shared/types'\nexport type SettingsCatalog8AccountType = 'bank' | 'cash'\n\nexport interface SettingsCatalog8Account {\n id: string\n name: string\n openingBalance: number\n openingOn: string\n type: SettingsCatalog8AccountType\n}\n\nexport interface SettingsCatalog8Labels extends SettingsLoadLabels {\n accountType: (type: SettingsCatalog8AccountType) => string\n actions: (name: string) => string\n archive: string\n archived: string\n default: string\n description: string\n edit: string\n emptyDescription: string\n emptyTitle: string\n makeDefault: string\n newAccount: string\n opening: (type: string, balance: string, date: string) => string\n restore: string\n title: string\n}\n\nexport type SettingsCatalog8Action =\n | 'edit'\n | 'make-default'\n | 'archive'\n | 'restore'\n\nexport interface SettingsCatalog8Props extends SettingsLoadProps {\n accounts: SettingsCatalog8Account[]\n archivedAccounts?: SettingsCatalog8Account[]\n className?: string\n currency?: string\n defaultAccountId?: string\n labels?: Partial<SettingsCatalog8Labels>\n locale?: string\n onAccountAction?: (accountId: string, action: SettingsCatalog8Action) => void\n onCreate?: () => void\n}\n",
33
+ "target": "~/packages/ui/src/blocks/application/settings/catalog/settings-catalog-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-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\nexport interface SettingsAppLogoData {\n svg: string\n title?: string\n}\n",
63
+ "target": "~/packages/ui/src/blocks/application/settings/shared/types.ts"
64
+ },
65
+ {
66
+ "path": "helpers/calendar-date.ts",
67
+ "type": "registry:file",
68
+ "content": "/** Span of days {@link calendarRange} produces around an anchor date. */\nexport type CalendarRangeMode = 'day' | 'month' | 'week'\n\n/**\n * A calendar day with no time and no time zone attached. `month` runs from\n * 1 to 12.\n */\nexport interface CalendarDate {\n day: number\n month: number\n year: number\n}\n\nconst DATE_KEY_PATTERN = /^(\\d{4})-(\\d{2})-(\\d{2})$/\n\n/**\n * Serializes a calendar date as `YYYY-MM-DD`, a stable key for maps and DOM\n * attributes.\n *\n * @param date - The calendar date to serialize.\n */\nexport function calendarDateKey(date: CalendarDate): string {\n const month = String(date.month).padStart(2, '0')\n const day = String(date.day).padStart(2, '0')\n\n return `${date.year}-${month}-${day}`\n}\n\n/**\n * Parses a `YYYY-MM-DD` key produced by {@link calendarDateKey}.\n *\n * @param key - The serialized date.\n * @returns The calendar date, or `null` when the text is malformed or names a\n * day that does not exist, such as February 30.\n */\nexport function parseCalendarDateKey(key: string): CalendarDate | null {\n const match = DATE_KEY_PATTERN.exec(key)\n if (!match) return null\n\n const candidate = {\n day: Number(match[3]),\n month: Number(match[2]),\n year: Number(match[1]),\n }\n\n return isSameCalendarDate(candidate, normalizeCalendarDate(candidate))\n ? candidate\n : null\n}\n\n/**\n * Reads the local calendar day of a `Date`, dropping its time.\n *\n * @param date - A valid date, such as the one a date picker selects.\n */\nexport function calendarDateFromDate(date: Date): CalendarDate {\n return {\n day: date.getDate(),\n month: date.getMonth() + 1,\n year: date.getFullYear(),\n }\n}\n\n/**\n * Builds the local midnight `Date` of a calendar date, the value a date\n * picker expects for a day.\n *\n * @param date - The calendar date to convert.\n */\nexport function calendarDateToDate(date: CalendarDate): Date {\n return new Date(date.year, date.month - 1, date.day)\n}\n\n/**\n * Moves a calendar date by a number of days, rolling over months and years.\n *\n * @param date - The starting date.\n * @param days - Days to add; negative values move backwards.\n */\nexport function addCalendarDays(\n date: CalendarDate,\n days: number,\n): CalendarDate {\n return normalizeCalendarDate({ ...date, day: date.day + days })\n}\n\n/**\n * Orders two calendar dates chronologically.\n *\n * @returns Negative when `a` is earlier, positive when later, zero when equal.\n */\nexport function compareCalendarDates(a: CalendarDate, b: CalendarDate): number {\n return a.year - b.year || a.month - b.month || a.day - b.day\n}\n\n/** Whether two calendar dates name the same day. */\nexport function isSameCalendarDate(a: CalendarDate, b: CalendarDate): boolean {\n return compareCalendarDates(a, b) === 0\n}\n\n/**\n * Day of the week of a calendar date.\n *\n * @returns `0` for Sunday through `6` for Saturday.\n */\nexport function calendarDayOfWeek(date: CalendarDate): number {\n return new Date(Date.UTC(date.year, date.month - 1, date.day)).getUTCDay()\n}\n\n/**\n * First day of the week that contains a calendar date.\n *\n * @param date - Any day of the week.\n * @param weekStartsOn - `0` when weeks start on Sunday, `1` on Monday.\n */\nexport function startOfWeek(\n date: CalendarDate,\n weekStartsOn: 0 | 1,\n): CalendarDate {\n const offset = (calendarDayOfWeek(date) - weekStartsOn + 7) % 7\n\n return addCalendarDays(date, -offset)\n}\n\n/**\n * Lists the days a calendar view shows for an anchor date. A month spans from\n * the first week containing the 1st to the last week containing the final day,\n * so adjacent days of neighbouring months are included.\n *\n * @param anchor - The date the view is centred on.\n * @param mode - Whether to list one day, one week or one month.\n * @param weekStartsOn - `0` when weeks start on Sunday, `1` on Monday.\n * @returns The visible days in chronological order.\n */\nexport function calendarRange(\n anchor: CalendarDate,\n mode: CalendarRangeMode,\n weekStartsOn: 0 | 1,\n): CalendarDate[] {\n if (mode === 'day') return [anchor]\n\n if (mode === 'week') {\n const first = startOfWeek(anchor, weekStartsOn)\n\n return Array.from({ length: 7 }, (_, index) =>\n addCalendarDays(first, index),\n )\n }\n\n const firstOfMonth = { ...anchor, day: 1 }\n const lastOfMonth = addCalendarDays(\n {\n ...normalizeCalendarDate({ ...anchor, day: 1, month: anchor.month + 1 }),\n },\n -1,\n )\n const first = startOfWeek(firstOfMonth, weekStartsOn)\n const last = addCalendarDays(startOfWeek(lastOfMonth, weekStartsOn), 6)\n const days: CalendarDate[] = []\n\n for (\n let day = first;\n compareCalendarDates(day, last) <= 0;\n day = addCalendarDays(day, 1)\n ) {\n days.push(day)\n }\n\n return days\n}\n\n/**\n * Normalizes an out-of-range day or month through `Date.UTC`, which rolls it\n * over into the right month and year. Arithmetic stays in year/month/day\n * rather than adding 86400 seconds to an instant, which would break across\n * daylight saving transitions.\n */\nfunction normalizeCalendarDate(date: CalendarDate): CalendarDate {\n const normalized = new Date(Date.UTC(date.year, date.month - 1, date.day))\n\n return {\n day: normalized.getUTCDate(),\n month: normalized.getUTCMonth() + 1,\n year: normalized.getUTCFullYear(),\n }\n}\n",
69
+ "target": "~/packages/ui/src/helpers/calendar-date.ts"
70
+ },
71
+ {
72
+ "path": "helpers/date.ts",
73
+ "type": "registry:file",
74
+ "content": "import type { CalendarDate } from './calendar-date'\nimport { toZonedDateTime } from './zoned-date-time'\n\nconst DATE_ONLY_PATTERN = /^\\d{4}-\\d{2}-\\d{2}$/\nconst MILLISECONDS_IN_DAY = 86_400_000\n\nconst DATE_FORMAT_OPTIONS = {\n dateTime: { dateStyle: 'long', timeStyle: 'short' },\n long: { dateStyle: 'long' },\n medium: { dateStyle: 'medium' },\n numeric: { day: '2-digit', month: '2-digit', year: 'numeric' },\n short: { day: 'numeric', month: 'short' },\n weekdayAndDay: { day: 'numeric', weekday: 'long' },\n} satisfies Record<string, Intl.DateTimeFormatOptions>\n\nconst dateFormatters = new Map<string, Intl.DateTimeFormat>()\nconst relativeDayFormatters = new Map<string, Intl.RelativeTimeFormat>()\n\n/**\n * Type guard for a `Date` whose time is not `NaN`.\n *\n * @param value - Any value, typically the result of parsing user input.\n */\nexport function isValidDate(value: unknown): value is Date {\n return value instanceof Date && !Number.isNaN(value.getTime())\n}\n\n/**\n * Parses an ISO 8601 string, such as the value stored by a date property.\n *\n * @param value - The serialized date; empty values are treated as absent.\n * @returns The parsed date, or `null` when the value is absent or invalid.\n */\nexport function parseIsoDate(value: string | null | undefined): Date | null {\n if (!value) return null\n const date = new Date(value)\n return isValidDate(date) ? date : null\n}\n\n/**\n * Coerces a cell value into a `Date`. A date-only string (`2026-08-04`) is\n * read as local midnight, because `new Date('2026-08-04')` is UTC midnight and\n * would display as the previous day in any negative time zone.\n *\n * @param value - A `Date`, a date string or anything `String()` can serialize.\n * @returns A date that may be invalid; check it with {@link isValidDate}.\n */\nexport function parseDateValue(value: unknown): Date {\n if (value instanceof Date) return value\n const raw = String(value)\n return DATE_ONLY_PATTERN.test(raw)\n ? new Date(`${raw}T00:00:00`)\n : new Date(raw)\n}\n\n/**\n * Serializes the local calendar day of a date as noon UTC, so the day survives\n * a round trip through any time zone.\n *\n * @param date - A date whose local year, month and day are kept.\n * @returns An ISO string such as `2026-06-19T12:00:00.000Z`.\n */\nexport function serializeIsoDay(date: Date): string {\n return new Date(\n Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), 12),\n ).toISOString()\n}\n\n/**\n * Formats a date as day and abbreviated month, without the year.\n *\n * @param date - A valid date.\n * @param locale - A BCP 47 locale tag such as `pt-BR`.\n * @param timeZone - An IANA time zone; when omitted the date is read in the\n * runtime's local zone, which suits local day markers.\n * @returns The formatted date, such as `Jun 19` or `19 de jun.`.\n */\nexport function formatShortDate(\n date: Date,\n locale: string,\n timeZone?: string,\n): string {\n return getDateFormatter('short', locale, timeZone).format(date)\n}\n\n/**\n * Formats a date as two-digit day and month with the full year, so a column\n * of dates aligns.\n *\n * @param date - A valid date.\n * @param locale - A BCP 47 locale tag such as `pt-BR`.\n * @param timeZone - An IANA time zone; when omitted the date is read in the\n * runtime's local zone.\n * @returns The formatted date, such as `11/09/2026` or `09/11/2026`.\n */\nexport function formatNumericDate(\n date: Date,\n locale: string,\n timeZone?: string,\n): string {\n return getDateFormatter('numeric', locale, timeZone).format(date)\n}\n\n/**\n * Formats a date with day, abbreviated month and year, as a date picker\n * trigger shows it.\n *\n * @param date - A valid date.\n * @param locale - A BCP 47 locale tag such as `pt-BR`.\n * @param timeZone - An IANA time zone; when omitted the date is read in the\n * runtime's local zone.\n * @returns The formatted date, such as `Oct 20, 2026` or `20 de out. de 2026`.\n */\nexport function formatMediumDate(\n date: Date,\n locale: string,\n timeZone?: string,\n): string {\n return getDateFormatter('medium', locale, timeZone).format(date)\n}\n\n/**\n * Formats a date with day, full month name and year.\n *\n * @param date - A valid date.\n * @param locale - A BCP 47 locale tag such as `pt-BR`.\n * @param timeZone - An IANA time zone; when omitted the date is read in the\n * runtime's local zone.\n * @returns The formatted date, such as `October 20, 2026` or\n * `20 de outubro de 2026`.\n */\nexport function formatLongDate(\n date: Date,\n locale: string,\n timeZone?: string,\n): string {\n return getDateFormatter('long', locale, timeZone).format(date)\n}\n\n/**\n * Formats a date with day, full month name, year and time of day, as a\n * tooltip over a short or relative date shows it.\n *\n * @param date - A valid date.\n * @param locale - A BCP 47 locale tag such as `pt-BR`.\n * @param timeZone - An IANA time zone; when omitted the date is read in the\n * runtime's local zone.\n * @returns The formatted date and time, such as `October 20, 2026 at 2:30 PM`\n * or `20 de outubro de 2026 às 14:30`.\n */\nexport function formatDateTime(\n date: Date,\n locale: string,\n timeZone?: string,\n): string {\n return getDateFormatter('dateTime', locale, timeZone).format(date)\n}\n\n/**\n * Formats the weekday name with the day of the month, as a day heading over a\n * list of time slots.\n *\n * @param date - A valid date.\n * @param locale - A BCP 47 locale tag such as `pt-BR`.\n * @param timeZone - An IANA time zone; when omitted the date is read in the\n * runtime's local zone.\n * @returns The formatted day, such as `Tuesday 20` or `terça-feira, 20`.\n */\nexport function formatWeekdayAndDay(\n date: Date,\n locale: string,\n timeZone?: string,\n): string {\n return getDateFormatter('weekdayAndDay', locale, timeZone).format(date)\n}\n\n/**\n * Counts the civil days between two instants as seen on the wall clock of a\n * time zone, so an instant just after midnight in that zone counts as the\n * next day even when it is still the previous day in UTC.\n *\n * @param from - The reference instant, usually now.\n * @param to - The instant being measured, such as a due date.\n * @param timeZone - An IANA time zone.\n * @returns Negative when `to` falls on an earlier day than `from`.\n */\nexport function dayOffsetInTimeZone(\n from: Date,\n to: Date,\n timeZone: string,\n): number {\n return (\n dayNumber(toZonedDateTime(to, timeZone).date) -\n dayNumber(toZonedDateTime(from, timeZone).date)\n )\n}\n\n/**\n * Names a day relative to today (`Yesterday`, `Today`, `Tomorrow`, `In 3\n * days`) with the first letter upper-cased for the locale.\n *\n * @param dayOffset - Civil days from today; see {@link dayOffsetInTimeZone}.\n * @param locale - A BCP 47 locale tag such as `pt-BR`.\n */\nexport function formatRelativeDay(dayOffset: number, locale: string): string {\n const label = getRelativeDayFormatter(locale).format(dayOffset, 'day')\n return label.charAt(0).toLocaleUpperCase(locale) + label.slice(1)\n}\n\n/**\n * Moves a date by a number of local calendar days, keeping its time of day.\n *\n * @param date - The starting date; it is not mutated.\n * @param days - Days to add; negative values move backwards.\n */\nexport function addDays(date: Date, days: number): Date {\n const next = new Date(date)\n next.setDate(next.getDate() + days)\n return next\n}\n\n/**\n * Moves a date by a number of months. When the target month is shorter, the\n * day is clamped to its last day, so January 31 plus one month is the end of\n * February instead of early March.\n *\n * @param date - The starting date; it is not mutated.\n * @param months - Months to add; negative values move backwards.\n */\nexport function addMonths(date: Date, months: number): Date {\n const next = new Date(date)\n next.setDate(1)\n next.setMonth(next.getMonth() + months)\n const lastDay = new Date(next.getFullYear(), next.getMonth() + 1, 0).getDate()\n next.setDate(Math.min(date.getDate(), lastDay))\n return next\n}\n\n/**\n * Moves a date by a number of years. February 29 becomes February 28 in a\n * common year.\n *\n * @param date - The starting date; it is not mutated.\n * @param years - Years to add; negative values move backwards.\n */\nexport function addYears(date: Date, years: number): Date {\n return addMonths(date, years * 12)\n}\n\n/** Building an `Intl` formatter costs ~50 formats, so one is kept per key. */\nfunction getDateFormatter(\n style: keyof typeof DATE_FORMAT_OPTIONS,\n locale: string,\n timeZone?: string,\n): Intl.DateTimeFormat {\n const key = `${style}|${locale}|${timeZone ?? ''}`\n const cached = dateFormatters.get(key)\n if (cached) return cached\n\n const formatter = new Intl.DateTimeFormat(locale, {\n ...DATE_FORMAT_OPTIONS[style],\n ...(timeZone ? { timeZone } : {}),\n })\n dateFormatters.set(key, formatter)\n\n return formatter\n}\n\nfunction getRelativeDayFormatter(locale: string): Intl.RelativeTimeFormat {\n const cached = relativeDayFormatters.get(locale)\n if (cached) return cached\n\n const formatter = new Intl.RelativeTimeFormat(locale, { numeric: 'auto' })\n relativeDayFormatters.set(locale, formatter)\n\n return formatter\n}\n\n/** Days since the Unix epoch for a calendar date, ignoring time zones. */\nfunction dayNumber(date: CalendarDate): number {\n return Date.UTC(date.year, date.month - 1, date.day) / MILLISECONDS_IN_DAY\n}\n",
75
+ "target": "~/packages/ui/src/helpers/date.ts"
76
+ },
77
+ {
78
+ "path": "helpers/format.ts",
79
+ "type": "registry:file",
80
+ "content": "/**\n * Options accepted by the amount formatters. They mirror the subset of\n * `Intl.NumberFormat` options the widgets need; `locale`, `currency` and\n * `style` have defaults, everything else is passed through untouched.\n */\nexport interface AmountFormatOptions {\n currency?: string\n locale?: string\n maximumFractionDigits?: number\n minimumFractionDigits?: number\n minimumIntegerDigits?: number\n notation?: 'compact' | 'standard'\n signDisplay?: 'always' | 'auto' | 'exceptZero' | 'never'\n style?: 'currency' | 'decimal' | 'percent'\n}\n\n/** An amount split at its decimal separator; see {@link splitAmountAtDecimal}. */\nexport interface AmountParts {\n fraction: string\n integer: string\n}\n\n/** Locale used when `AmountFormatOptions.locale` is omitted. */\nexport const defaultAmountLocale = 'en-US'\n/** Currency used when `AmountFormatOptions.currency` is omitted. */\nexport const defaultAmountCurrency = 'USD'\n\nconst percentFractionDigits = {\n maximumFractionDigits: 2,\n minimumFractionDigits: 2,\n}\n\n/**\n * Creates the `Intl.NumberFormat` behind {@link formatAmount}. Percentages\n * get two fraction digits unless `maximumFractionDigits` is set, and the\n * currency is only forwarded for the `currency` style.\n *\n * @param options - Formatting options; defaults to US dollars in `en-US`.\n * @returns A reusable formatter for the resolved options.\n */\nexport function createAmountFormatter({\n currency = defaultAmountCurrency,\n locale = defaultAmountLocale,\n style = 'currency',\n ...options\n}: AmountFormatOptions = {}): Intl.NumberFormat {\n const usesPercentDefaults =\n style === 'percent' && options.maximumFractionDigits === undefined\n\n return new Intl.NumberFormat(locale, {\n ...options,\n ...(style === 'currency' ? { currency } : {}),\n ...(usesPercentDefaults ? percentFractionDigits : {}),\n style,\n })\n}\n\n/**\n * Formats a number as currency, decimal or percent. Percentages follow the\n * `Intl` convention: `0.0934` becomes `9.34%`.\n *\n * @param value - The amount to format. Percentages are ratios, not points.\n * @param options - Formatting options; defaults to US dollars in `en-US`.\n * @returns The formatted amount for the locale.\n */\nexport function formatAmount(\n value: number,\n options?: AmountFormatOptions,\n): string {\n return createAmountFormatter(options).format(value)\n}\n\n/** Concatenates the values of `Intl.NumberFormat` parts back into text. */\nfunction joinParts(parts: readonly Intl.NumberFormatPart[]): string {\n return parts.map((part) => part.value).join('')\n}\n\n/**\n * Formats an amount and splits it at the decimal separator, so the fraction\n * (separator, digits and any trailing suffix such as `%`) can be rendered\n * with a lighter style than the integer part.\n *\n * @param value - The amount to format.\n * @param options - Formatting options; defaults to US dollars in `en-US`.\n * @returns The integer part and the fraction; the fraction is empty when the\n * formatted amount has no decimal separator.\n */\nexport function splitAmountAtDecimal(\n value: number,\n options?: AmountFormatOptions,\n): AmountParts {\n const parts = createAmountFormatter(options).formatToParts(value)\n const decimalIndex = parts.findIndex((part) => part.type === 'decimal')\n\n if (decimalIndex === -1) return { fraction: '', integer: joinParts(parts) }\n\n return {\n fraction: joinParts(parts.slice(decimalIndex)),\n integer: joinParts(parts.slice(0, decimalIndex)),\n }\n}\n",
81
+ "target": "~/packages/ui/src/helpers/format.ts"
82
+ },
83
+ {
84
+ "path": "helpers/zoned-date-time.ts",
85
+ "type": "registry:file",
86
+ "content": "import type { CalendarDate } from './calendar-date'\n\n/**\n * A wall-clock reading in some time zone: the calendar day and the minutes\n * elapsed since local midnight.\n */\nexport interface ZonedDateTime {\n date: CalendarDate\n minutes: number\n}\n\nconst formatterCache = new Map<string, Intl.DateTimeFormat>()\n\n/**\n * Returns the formatter for a time zone. `Intl.DateTimeFormat` is expensive\n * to construct, so one instance per zone is kept for the life of the module.\n */\nfunction getFormatter(timeZone: string): Intl.DateTimeFormat {\n const cached = formatterCache.get(timeZone)\n if (cached) return cached\n\n const formatter = new Intl.DateTimeFormat('en-US', {\n day: '2-digit',\n hour: '2-digit',\n hourCycle: 'h23',\n minute: '2-digit',\n month: '2-digit',\n second: '2-digit',\n timeZone,\n year: 'numeric',\n })\n formatterCache.set(timeZone, formatter)\n\n return formatter\n}\n\n/** Numeric date and time fields of an instant, read in a time zone. */\ninterface WallClockParts {\n day: number\n hour: number\n minute: number\n month: number\n second: number\n year: number\n}\n\n/**\n * Reads the wall-clock fields of an instant in a time zone.\n *\n * @param instant - The UTC instant to project.\n * @param timeZone - An IANA time zone.\n */\nfunction wallClockPartsOf(instant: Date, timeZone: string): WallClockParts {\n const parts: Partial<WallClockParts> = {}\n\n for (const part of getFormatter(timeZone).formatToParts(instant)) {\n if (part.type === 'literal') continue\n if (part.type in partKeys)\n parts[partKeys[part.type as keyof typeof partKeys]] = Number(part.value)\n }\n\n return parts as WallClockParts\n}\n\nconst partKeys = {\n day: 'day',\n hour: 'hour',\n minute: 'minute',\n month: 'month',\n second: 'second',\n year: 'year',\n} as const\n\n/**\n * Projects a UTC instant onto the wall clock of a time zone.\n *\n * @param instant - The UTC instant to project.\n * @param timeZone - An IANA time zone.\n * @returns The calendar day and the minutes since local midnight.\n */\nexport function toZonedDateTime(\n instant: Date,\n timeZone: string,\n): ZonedDateTime {\n const parts = wallClockPartsOf(instant, timeZone)\n\n return {\n date: { day: parts.day, month: parts.month, year: parts.year },\n minutes: parts.hour * 60 + parts.minute,\n }\n}\n\n/**\n * Offset of a time zone from UTC at a given instant. The formatter stops at\n * seconds, so the instant is truncated to the second before comparing;\n * otherwise milliseconds would leak into the offset.\n *\n * @param instant - The UTC instant to measure at.\n * @param timeZone - An IANA time zone.\n * @returns The offset in milliseconds; positive east of UTC.\n */\nexport function getTimeZoneOffsetMs(instant: Date, timeZone: string): number {\n const parts = wallClockPartsOf(instant, timeZone)\n const wallAsUtc = Date.UTC(\n parts.year,\n parts.month - 1,\n parts.day,\n parts.hour,\n parts.minute,\n parts.second,\n )\n const truncated =\n instant.getTime() - (((instant.getTime() % 1000) + 1000) % 1000)\n\n return wallAsUtc - truncated\n}\n\n/**\n * Converts a wall-clock reading in a time zone back to a UTC instant without a\n * date library: the wall time is first treated as UTC and then corrected by the\n * zone offset. A second pass handles transition edges, since offsets only\n * change there: an ambiguous time (fall back) keeps the first offset found,\n * and a nonexistent time (spring forward) resolves to the instant after the\n * transition.\n *\n * @param zoned - The calendar day and minutes since local midnight.\n * @param timeZone - An IANA time zone.\n * @returns The UTC instant that shows that wall time in the zone.\n */\nexport function fromZonedDateTime(\n zoned: ZonedDateTime,\n timeZone: string,\n): Date {\n const { date, minutes } = zoned\n const guess = Date.UTC(date.year, date.month - 1, date.day, 0, minutes)\n const firstOffset = getTimeZoneOffsetMs(new Date(guess), timeZone)\n const candidate = guess - firstOffset\n const secondOffset = getTimeZoneOffsetMs(new Date(candidate), timeZone)\n\n if (firstOffset === secondOffset) return new Date(candidate)\n\n const corrected = guess - secondOffset\n const projected = toZonedDateTime(new Date(corrected), timeZone)\n const matchesWall =\n projected.minutes === ((minutes % 1440) + 1440) % 1440 &&\n projected.date.day === date.day &&\n projected.date.month === date.month &&\n projected.date.year === date.year\n\n return matchesWall ? new Date(corrected) : new Date(candidate)\n}\n",
87
+ "target": "~/packages/ui/src/helpers/zoned-date-time.ts"
88
+ },
89
+ {
90
+ "path": "patterns/properties/display/flag/flag-property.tsx",
91
+ "type": "registry:file",
92
+ "content": "'use client'\n\nimport type { PropertyIcon } from '../../shared/property-catalog'\nimport type { PropertyVariant } from '../../shared/property-surface'\nimport { IconLabelProperty } from '../icon-label/icon-label-property'\n\nexport interface FlagPropertyProps {\n active: boolean\n label: string\n activeIcon?: PropertyIcon\n ariaLabel?: string\n className?: string\n iconClassName?: string\n inactiveLabel?: string\n inactiveIcon?: PropertyIcon\n showInactive?: boolean\n variant?: PropertyVariant\n}\n\nexport function FlagProperty({\n active,\n activeIcon,\n ariaLabel,\n className,\n iconClassName,\n inactiveIcon,\n inactiveLabel,\n label,\n showInactive = false,\n variant = 'badge',\n}: Readonly<FlagPropertyProps>) {\n if (!active && !showInactive) return null\n\n return (\n <IconLabelProperty\n ariaLabel={ariaLabel}\n className={className}\n icon={active ? activeIcon : inactiveIcon}\n iconClassName={iconClassName}\n label={active ? label : (inactiveLabel ?? label)}\n variant={variant}\n />\n )\n}\n",
93
+ "target": "~/packages/ui/src/patterns/properties/display/flag/flag-property.tsx"
94
+ },
95
+ {
96
+ "path": "patterns/properties/display/icon-label/icon-label-property.tsx",
97
+ "type": "registry:file",
98
+ "content": "'use client'\n\nimport { cn } from '@tc96/utils'\nimport type { ReactNode } from 'react'\nimport type { PropertyIcon } from '../../shared/property-catalog'\nimport {\n PropertySurface,\n type PropertySurfaceProps,\n type PropertyVariant,\n} from '../../shared/property-surface'\n\nexport type IconLabelPropertyTrailingVisibility = 'always' | 'hover'\n\nexport interface IconLabelPropertyProps {\n label: ReactNode\n ariaLabel?: string\n className?: string\n icon?: PropertyIcon\n iconClassName?: string\n leading?: ReactNode\n muted?: boolean\n render?: PropertySurfaceProps['render']\n trailing?: ReactNode\n trailingVisibility?: IconLabelPropertyTrailingVisibility\n variant?: PropertyVariant\n}\n\nexport function IconLabelProperty({\n ariaLabel,\n className,\n icon: Icon,\n iconClassName,\n label,\n leading,\n muted = false,\n render,\n trailing,\n trailingVisibility = 'always',\n variant = 'badge',\n}: Readonly<IconLabelPropertyProps>) {\n const hidesTrailing = Boolean(trailing) && trailingVisibility === 'hover'\n\n return (\n <PropertySurface\n aria-label={\n ariaLabel\n ? `${ariaLabel}: ${typeof label === 'string' ? label : ''}`.trim()\n : undefined\n }\n className={cn('max-w-full', hidesTrailing && 'group/property', className)}\n muted={muted}\n render={render}\n {...(trailing && ariaLabel ? { role: 'group' } : {})}\n variant={variant}\n >\n {leading}\n {Icon ? (\n <Icon\n aria-hidden\n className={cn('size-4', iconClassName)}\n data-slot=\"property-icon\"\n />\n ) : null}\n <span className=\"truncate\">{label}</span>\n {hidesTrailing ? (\n <span\n className=\"pointer-coarse:opacity-100 flex shrink-0 self-stretch items-center opacity-0 transition-opacity group-focus-within/property:opacity-100 group-hover/property:opacity-100\"\n data-slot=\"property-trailing\"\n >\n {trailing}\n </span>\n ) : (\n trailing\n )}\n </PropertySurface>\n )\n}\n",
99
+ "target": "~/packages/ui/src/patterns/properties/display/icon-label/icon-label-property.tsx"
100
+ },
101
+ {
102
+ "path": "patterns/properties/shared/property-catalog.ts",
103
+ "type": "registry:file",
104
+ "content": "import type { IconWeight } from '@phosphor-icons/react'\nimport type { ComboboxPopup } from '@tc96/ui/combobox'\nimport type { PropertyTone } from '@tc96/ui/lib/property-tone'\nimport type { PopoverPopup } from '@tc96/ui/popover'\nimport type { SelectPopup } from '@tc96/ui/select'\nimport type { ComponentProps, ComponentType, SVGProps } from 'react'\n\nexport {\n type PropertyTone,\n propertyToneClassName,\n} from '@tc96/ui/lib/property-tone'\n\nexport type PropertyIcon = ComponentType<\n SVGProps<SVGSVGElement> & { weight?: IconWeight }\n>\n\nexport interface PropertyOption<TValue extends string = string> {\n value: TValue\n label: string\n icon?: PropertyIcon\n tone?: PropertyTone\n weight?: IconWeight\n}\n\nexport interface PropertyChangeContext<TValue> {\n previousValue: TValue\n}\n\nexport interface PropertyListChangeContext<TItem, TValue> {\n added: TItem | null\n previousValue: readonly TValue[]\n removed: TItem | null\n}\n\nexport type PropertySelectDropdownPlacement = Pick<\n ComponentProps<typeof SelectPopup>,\n 'align' | 'alignItemWithTrigger' | 'alignOffset' | 'side' | 'sideOffset'\n>\n\nexport type PropertyMultiSelectDropdownPlacement = Pick<\n ComponentProps<typeof ComboboxPopup>,\n 'align' | 'alignOffset' | 'side' | 'sideOffset'\n>\n\nexport type PropertyPopoverDropdownPlacement = Pick<\n ComponentProps<typeof PopoverPopup>,\n 'align' | 'alignOffset' | 'side' | 'sideOffset'\n>\n",
105
+ "target": "~/packages/ui/src/patterns/properties/shared/property-catalog.ts"
106
+ },
107
+ {
108
+ "path": "patterns/properties/shared/property-surface.tsx",
109
+ "type": "registry:file",
110
+ "content": "'use client'\n\nimport { mergeProps } from '@base-ui/react/merge-props'\nimport { useRender } from '@base-ui/react/use-render'\nimport { Badge } from '@tc96/ui/badge'\nimport { cn } from '@tc96/utils'\nimport type React from 'react'\n\nexport type PropertyVariant = 'badge' | 'plain'\n\nexport const propertyBadgeClassName =\n 'h-6 min-w-6 px-[calc(--spacing(2.5)-1px)] text-sm sm:h-6 sm:min-w-6 sm:text-sm'\n\nexport interface PropertySurfaceProps extends useRender.ComponentProps<'span'> {\n variant?: PropertyVariant\n muted?: boolean\n}\n\nexport function PropertySurface({\n className,\n muted = false,\n render,\n variant = 'badge',\n ...props\n}: PropertySurfaceProps): React.ReactElement {\n const state = {\n 'data-slot': 'property-surface',\n 'data-variant': variant,\n ...(muted ? { 'data-empty': 'true' } : {}),\n ...(props['aria-label'] && !props.role && !render ? { role: 'img' } : {}),\n }\n const plain = useRender({\n defaultTagName: 'span',\n enabled: variant !== 'badge',\n props: mergeProps<'span'>(\n {\n className: cn(\n muted ? 'text-muted-foreground' : 'text-primary',\n 'inline-flex min-w-0 max-w-full items-center gap-1 whitespace-nowrap text-sm outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-64 [button&,a&]:cursor-pointer',\n '[button&,a&]:-ms-1.5 [button&,a&]:-my-0.5 [button&,a&]:h-6 [button&,a&]:rounded-sm [button&,a&]:px-1.5',\n '[button&,a&]:hover:bg-secondary [button&,a&]:hover:text-secondary-foreground',\n '[button&,a&]:focus-visible:bg-secondary [button&,a&]:focus-visible:text-secondary-foreground',\n '[button&,a&]:data-popup-open:bg-secondary [button&,a&]:data-popup-open:text-secondary-foreground',\n className,\n ),\n ...state,\n },\n props,\n ),\n render,\n })\n\n if (plain) return plain\n\n return (\n <Badge\n className={cn(\n propertyBadgeClassName,\n !muted && 'text-primary',\n className,\n )}\n variant={muted ? 'outline' : 'secondary'}\n {...(render ? { render } : {})}\n {...state}\n {...props}\n />\n )\n}\n",
111
+ "target": "~/packages/ui/src/patterns/properties/shared/property-surface.tsx"
112
+ },
113
+ {
114
+ "path": "patterns/surfaces/settings/composition/settings-collapsed/settings-collapsed.tsx",
115
+ "type": "registry:file",
116
+ "content": "'use client'\n\nimport { CaretDownIcon } from '@phosphor-icons/react'\nimport {\n Collapsible,\n CollapsiblePanel,\n CollapsibleTrigger,\n} from '@tc96/ui/collapsible'\nimport { Text } from '@tc96/ui/text'\nimport { cn } from '@tc96/utils'\nimport { type ReactElement, useId } from 'react'\nimport type { SettingsCollapsedProps } from '../../core'\n\nexport function SettingsCollapsed({\n actions,\n children,\n className,\n defaultOpen = true,\n onOpenChange,\n open,\n title,\n}: Readonly<SettingsCollapsedProps>): ReactElement {\n const titleId = `settings-collapsed-title-${useId()}`\n\n return (\n <Collapsible\n aria-labelledby={titleId}\n className={cn('my-1 flex flex-col first:mt-4 last:mb-4', className)}\n data-slot=\"settings-collapsed\"\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n open={open}\n render={<section />}\n >\n <header className=\"flex min-h-10 items-center justify-between gap-2 rounded-lg bg-muted/80 px-3\">\n <Text\n className=\"min-w-0 flex-1\"\n foreground=\"muted\"\n render={\n <h2 data-slot=\"settings-collapsed-title\" id={titleId}>\n <CollapsibleTrigger className=\"group/trigger flex min-h-10 w-full min-w-0 items-center gap-2 rounded-lg text-start outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background\">\n <CaretDownIcon\n aria-hidden=\"true\"\n className=\"size-4 shrink-0 -rotate-90 transition-transform group-data-panel-open/trigger:rotate-0\"\n />\n <span className=\"min-w-0 break-words\">{title}</span>\n </CollapsibleTrigger>\n </h2>\n }\n size=\"sm\"\n weight=\"medium\"\n />\n {actions ? (\n <div\n className=\"flex shrink-0 items-center gap-1\"\n data-slot=\"settings-collapsed-actions\"\n >\n {actions}\n </div>\n ) : null}\n </header>\n <CollapsiblePanel>\n <div\n className=\"flex flex-col px-4 [&_[data-slot=settings-row]]:py-1\"\n data-slot=\"settings-collapsed-items\"\n >\n {children}\n </div>\n </CollapsiblePanel>\n </Collapsible>\n )\n}\n",
117
+ "target": "~/packages/ui/src/patterns/surfaces/settings/composition/settings-collapsed/settings-collapsed.tsx"
118
+ },
119
+ {
120
+ "path": "patterns/surfaces/settings/composition/settings-row/settings-row.tsx",
121
+ "type": "registry:file",
122
+ "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",
123
+ "target": "~/packages/ui/src/patterns/surfaces/settings/composition/settings-row/settings-row.tsx"
124
+ },
125
+ {
126
+ "path": "patterns/surfaces/settings/composition/settings-section/settings-section-context.ts",
127
+ "type": "registry:file",
128
+ "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",
129
+ "target": "~/packages/ui/src/patterns/surfaces/settings/composition/settings-section/settings-section-context.ts"
130
+ },
131
+ {
132
+ "path": "patterns/surfaces/settings/composition/settings-section/settings-section-header.tsx",
133
+ "type": "registry:file",
134
+ "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",
135
+ "target": "~/packages/ui/src/patterns/surfaces/settings/composition/settings-section/settings-section-header.tsx"
136
+ },
137
+ {
138
+ "path": "patterns/surfaces/settings/composition/settings-section/settings-section.tsx",
139
+ "type": "registry:file",
140
+ "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",
141
+ "target": "~/packages/ui/src/patterns/surfaces/settings/composition/settings-section/settings-section.tsx"
142
+ },
143
+ {
144
+ "path": "patterns/surfaces/settings/core.ts",
145
+ "type": "registry:file",
146
+ "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",
147
+ "target": "~/packages/ui/src/patterns/surfaces/settings/core.ts"
148
+ },
149
+ {
150
+ "path": "patterns/surfaces/state/composition/state-surface/state-surface.tsx",
151
+ "type": "registry:file",
152
+ "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",
153
+ "target": "~/packages/ui/src/patterns/surfaces/state/composition/state-surface/state-surface.tsx"
154
+ },
155
+ {
156
+ "path": "patterns/surfaces/state/core.ts",
157
+ "type": "registry:file",
158
+ "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",
159
+ "target": "~/packages/ui/src/patterns/surfaces/state/core.ts"
160
+ }
161
+ ],
162
+ "dependencies": [
163
+ "@base-ui/react@1.8.0",
164
+ "@phosphor-icons/react@2.1.10",
165
+ "react@19.1.1"
166
+ ],
167
+ "registryDependencies": [
168
+ "@ui/badge",
169
+ "@ui/button",
170
+ "@ui/card",
171
+ "@ui/collapsible",
172
+ "@ui/combobox",
173
+ "@ui/empty",
174
+ "@ui/icon-frame",
175
+ "@ui/menu",
176
+ "@ui/popover",
177
+ "@ui/property-tone",
178
+ "@ui/select",
179
+ "@ui/skeleton",
180
+ "@ui/text"
181
+ ],
182
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json"
183
+ }
@@ -0,0 +1,159 @@
1
+ {
2
+ "name": "settings-catalog-9",
3
+ "type": "registry:block",
4
+ "files": [
5
+ {
6
+ "path": "blocks/application/settings/catalog/settings-catalog-9/index.ts",
7
+ "type": "registry:file",
8
+ "content": "export { SettingsCatalog9 } from './settings-catalog-9'\nexport type {\n SettingsCatalog9Action,\n SettingsCatalog9Category,\n SettingsCatalog9Direction,\n SettingsCatalog9Labels,\n SettingsCatalog9Props,\n} from './types'\n",
9
+ "target": "~/packages/ui/src/blocks/application/settings/catalog/settings-catalog-9/index.ts"
10
+ },
11
+ {
12
+ "path": "blocks/application/settings/catalog/settings-catalog-9/labels.ts",
13
+ "type": "registry:file",
14
+ "content": "import { defaultSettingsLoadLabels } from '../../shared/labels'\nimport type { SettingsCatalog9Direction, SettingsCatalog9Labels } from './types'\n\nconst directionLabels: Record<SettingsCatalog9Direction, string> = {\n expense: 'Despesa',\n income: 'Receita',\n}\n\nexport const defaultSettingsCatalog9Labels: SettingsCatalog9Labels = {\n ...defaultSettingsLoadLabels,\n errorTitle: 'Não foi possível carregar as categorias',\n loading: 'Carregando categorias',\n actions: (name) => `Ações de ${name}`,\n addSubcategory: 'Adicionar subcategoria',\n archive: 'Arquivar',\n archived: 'Arquivadas',\n description:\n 'Como os lançamentos são classificados: honorários, custas, despesas.',\n direction: (direction) => directionLabels[direction],\n edit: 'Editar',\n emptyDescription: 'Crie uma categoria para classificar receitas e despesas.',\n emptyTitle: 'Nenhuma categoria ainda',\n entries: (count) => `${count} ${count === 1 ? 'lançamento' : 'lançamentos'}`,\n newCategory: 'Nova categoria',\n restore: 'Restaurar',\n subcategoryOf: (parent) => `Subcategoria de ${parent}`,\n title: 'Categorias',\n}\n",
15
+ "target": "~/packages/ui/src/blocks/application/settings/catalog/settings-catalog-9/labels.ts"
16
+ },
17
+ {
18
+ "path": "blocks/application/settings/catalog/settings-catalog-9/settings-catalog-9-skeleton.tsx",
19
+ "type": "registry:file",
20
+ "content": "import { SettingsRowsSkeleton } from '../../shared/settings-skeleton'\n\nexport function SettingsCatalog9Skeleton() {\n return <SettingsRowsSkeleton count={4} description={false} end=\"menu\" />\n}\n",
21
+ "target": "~/packages/ui/src/blocks/application/settings/catalog/settings-catalog-9/settings-catalog-9-skeleton.tsx"
22
+ },
23
+ {
24
+ "path": "blocks/application/settings/catalog/settings-catalog-9/settings-catalog-9.tsx",
25
+ "type": "registry:file",
26
+ "content": "import { ArrowElbowDownRightIcon } from '@phosphor-icons/react'\nimport { Button } from '@tc96/ui/button'\nimport { IconLabelProperty } from '@tc96/ui/patterns/properties/display/icon-label/icon-label-property'\nimport { SettingsCollapsed } from '@tc96/ui/patterns/surfaces/settings/composition/settings-collapsed/settings-collapsed'\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 { defaultSettingsCatalog9Labels } from './labels'\nimport { SettingsCatalog9Skeleton } from './settings-catalog-9-skeleton'\nimport type {\n SettingsCatalog9Action,\n SettingsCatalog9Category,\n SettingsCatalog9Direction,\n SettingsCatalog9Labels,\n SettingsCatalog9Props,\n} from './types'\n\nconst directionDots: Record<SettingsCatalog9Direction, string> = {\n expense: 'bg-red-700 dark:bg-red-500',\n income: 'bg-green-700 dark:bg-green-500',\n}\n\ninterface CategoryRowProps {\n archived?: boolean\n category: SettingsCatalog9Category\n labels: SettingsCatalog9Labels\n onCategoryAction?: SettingsCatalog9Props['onCategoryAction']\n parent?: string\n}\n\nfunction CategoryRow({\n archived,\n category,\n labels,\n onCategoryAction,\n parent,\n}: Readonly<CategoryRowProps>) {\n const actions = archived\n ? [{ id: 'restore', label: labels.restore }]\n : [\n { id: 'edit', label: labels.edit },\n ...(parent\n ? []\n : [{ id: 'add-subcategory', label: labels.addSubcategory }]),\n { destructive: true, id: 'archive', label: labels.archive },\n ]\n\n return (\n <SettingsRow\n className={parent ? 'ps-2' : undefined}\n description={parent ? labels.subcategoryOf(parent) : undefined}\n endSlot={\n <div className=\"flex items-center gap-3\">\n <Text\n foreground=\"muted\"\n render={<span>{labels.entries(category.entries)}</span>}\n size=\"sm\"\n />\n {parent ? null : (\n <IconLabelProperty\n label={labels.direction(category.direction)}\n leading={\n <SettingsSwatch\n className={cn('size-2', directionDots[category.direction])}\n />\n }\n />\n )}\n {onCategoryAction ? (\n <SettingsRowActions\n actions={actions}\n label={labels.actions(category.name)}\n onAction={(action) =>\n onCategoryAction(category.id, action as SettingsCatalog9Action)\n }\n />\n ) : null}\n </div>\n }\n startSlot={\n parent ? (\n <ArrowElbowDownRightIcon\n aria-hidden=\"true\"\n className=\"text-muted-foreground\"\n />\n ) : undefined\n }\n title={category.name}\n />\n )\n}\n\nfunction categoryRows(\n list: SettingsCatalog9Category[],\n labels: SettingsCatalog9Labels,\n onCategoryAction: SettingsCatalog9Props['onCategoryAction'],\n archived?: boolean,\n) {\n return list.flatMap((category) => [\n <CategoryRow\n archived={archived}\n category={category}\n key={category.id}\n labels={labels}\n onCategoryAction={onCategoryAction}\n />,\n ...(category.subcategories ?? []).map((subcategory) => (\n <CategoryRow\n archived={archived}\n category={subcategory}\n key={subcategory.id}\n labels={labels}\n onCategoryAction={onCategoryAction}\n parent={category.name}\n />\n )),\n ])\n}\n\nexport function SettingsCatalog9({\n error,\n onRetry,\n pending,\n archivedCategories = [],\n categories,\n className,\n labels: labelsProp,\n onCategoryAction,\n onCreate,\n}: Readonly<SettingsCatalog9Props>) {\n const labels = { ...defaultSettingsCatalog9Labels, ...labelsProp }\n const loadState = settingsLoadState({\n error,\n labels,\n onRetry,\n pending,\n skeleton: <SettingsCatalog9Skeleton />,\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.newCategory}\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 <>\n {categories.length === 0 ? (\n <StateSurface\n description={labels.emptyDescription}\n kind=\"empty\"\n title={labels.emptyTitle}\n />\n ) : (\n categoryRows(categories, labels, onCategoryAction)\n )}\n {archivedCategories.length > 0 ? (\n <div>\n <SettingsCollapsed defaultOpen={false} title={labels.archived}>\n {categoryRows(\n archivedCategories,\n labels,\n onCategoryAction,\n true,\n )}\n </SettingsCollapsed>\n </div>\n ) : null}\n </>\n )}\n </SettingsSection>\n )\n}\n",
27
+ "target": "~/packages/ui/src/blocks/application/settings/catalog/settings-catalog-9/settings-catalog-9.tsx"
28
+ },
29
+ {
30
+ "path": "blocks/application/settings/catalog/settings-catalog-9/types.ts",
31
+ "type": "registry:file",
32
+ "content": "import type { SettingsLoadLabels, SettingsLoadProps } from '../../shared/types'\nexport type SettingsCatalog9Direction = 'income' | 'expense'\n\nexport interface SettingsCatalog9Category {\n direction: SettingsCatalog9Direction\n entries: number\n id: string\n name: string\n subcategories?: SettingsCatalog9Category[]\n}\n\nexport interface SettingsCatalog9Labels extends SettingsLoadLabels {\n actions: (name: string) => string\n addSubcategory: string\n archive: string\n archived: string\n description: string\n direction: (direction: SettingsCatalog9Direction) => string\n edit: string\n emptyDescription: string\n emptyTitle: string\n entries: (count: number) => string\n newCategory: string\n restore: string\n subcategoryOf: (parent: string) => string\n title: string\n}\n\nexport type SettingsCatalog9Action =\n | 'edit'\n | 'add-subcategory'\n | 'archive'\n | 'restore'\n\nexport interface SettingsCatalog9Props extends SettingsLoadProps {\n archivedCategories?: SettingsCatalog9Category[]\n categories: SettingsCatalog9Category[]\n className?: string\n labels?: Partial<SettingsCatalog9Labels>\n onCategoryAction?: (\n categoryId: string,\n action: SettingsCatalog9Action,\n ) => void\n onCreate?: () => void\n}\n",
33
+ "target": "~/packages/ui/src/blocks/application/settings/catalog/settings-catalog-9/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\nexport interface SettingsAppLogoData {\n svg: string\n title?: string\n}\n",
69
+ "target": "~/packages/ui/src/blocks/application/settings/shared/types.ts"
70
+ },
71
+ {
72
+ "path": "patterns/properties/display/icon-label/icon-label-property.tsx",
73
+ "type": "registry:file",
74
+ "content": "'use client'\n\nimport { cn } from '@tc96/utils'\nimport type { ReactNode } from 'react'\nimport type { PropertyIcon } from '../../shared/property-catalog'\nimport {\n PropertySurface,\n type PropertySurfaceProps,\n type PropertyVariant,\n} from '../../shared/property-surface'\n\nexport type IconLabelPropertyTrailingVisibility = 'always' | 'hover'\n\nexport interface IconLabelPropertyProps {\n label: ReactNode\n ariaLabel?: string\n className?: string\n icon?: PropertyIcon\n iconClassName?: string\n leading?: ReactNode\n muted?: boolean\n render?: PropertySurfaceProps['render']\n trailing?: ReactNode\n trailingVisibility?: IconLabelPropertyTrailingVisibility\n variant?: PropertyVariant\n}\n\nexport function IconLabelProperty({\n ariaLabel,\n className,\n icon: Icon,\n iconClassName,\n label,\n leading,\n muted = false,\n render,\n trailing,\n trailingVisibility = 'always',\n variant = 'badge',\n}: Readonly<IconLabelPropertyProps>) {\n const hidesTrailing = Boolean(trailing) && trailingVisibility === 'hover'\n\n return (\n <PropertySurface\n aria-label={\n ariaLabel\n ? `${ariaLabel}: ${typeof label === 'string' ? label : ''}`.trim()\n : undefined\n }\n className={cn('max-w-full', hidesTrailing && 'group/property', className)}\n muted={muted}\n render={render}\n {...(trailing && ariaLabel ? { role: 'group' } : {})}\n variant={variant}\n >\n {leading}\n {Icon ? (\n <Icon\n aria-hidden\n className={cn('size-4', iconClassName)}\n data-slot=\"property-icon\"\n />\n ) : null}\n <span className=\"truncate\">{label}</span>\n {hidesTrailing ? (\n <span\n className=\"pointer-coarse:opacity-100 flex shrink-0 self-stretch items-center opacity-0 transition-opacity group-focus-within/property:opacity-100 group-hover/property:opacity-100\"\n data-slot=\"property-trailing\"\n >\n {trailing}\n </span>\n ) : (\n trailing\n )}\n </PropertySurface>\n )\n}\n",
75
+ "target": "~/packages/ui/src/patterns/properties/display/icon-label/icon-label-property.tsx"
76
+ },
77
+ {
78
+ "path": "patterns/properties/shared/property-catalog.ts",
79
+ "type": "registry:file",
80
+ "content": "import type { IconWeight } from '@phosphor-icons/react'\nimport type { ComboboxPopup } from '@tc96/ui/combobox'\nimport type { PropertyTone } from '@tc96/ui/lib/property-tone'\nimport type { PopoverPopup } from '@tc96/ui/popover'\nimport type { SelectPopup } from '@tc96/ui/select'\nimport type { ComponentProps, ComponentType, SVGProps } from 'react'\n\nexport {\n type PropertyTone,\n propertyToneClassName,\n} from '@tc96/ui/lib/property-tone'\n\nexport type PropertyIcon = ComponentType<\n SVGProps<SVGSVGElement> & { weight?: IconWeight }\n>\n\nexport interface PropertyOption<TValue extends string = string> {\n value: TValue\n label: string\n icon?: PropertyIcon\n tone?: PropertyTone\n weight?: IconWeight\n}\n\nexport interface PropertyChangeContext<TValue> {\n previousValue: TValue\n}\n\nexport interface PropertyListChangeContext<TItem, TValue> {\n added: TItem | null\n previousValue: readonly TValue[]\n removed: TItem | null\n}\n\nexport type PropertySelectDropdownPlacement = Pick<\n ComponentProps<typeof SelectPopup>,\n 'align' | 'alignItemWithTrigger' | 'alignOffset' | 'side' | 'sideOffset'\n>\n\nexport type PropertyMultiSelectDropdownPlacement = Pick<\n ComponentProps<typeof ComboboxPopup>,\n 'align' | 'alignOffset' | 'side' | 'sideOffset'\n>\n\nexport type PropertyPopoverDropdownPlacement = Pick<\n ComponentProps<typeof PopoverPopup>,\n 'align' | 'alignOffset' | 'side' | 'sideOffset'\n>\n",
81
+ "target": "~/packages/ui/src/patterns/properties/shared/property-catalog.ts"
82
+ },
83
+ {
84
+ "path": "patterns/properties/shared/property-surface.tsx",
85
+ "type": "registry:file",
86
+ "content": "'use client'\n\nimport { mergeProps } from '@base-ui/react/merge-props'\nimport { useRender } from '@base-ui/react/use-render'\nimport { Badge } from '@tc96/ui/badge'\nimport { cn } from '@tc96/utils'\nimport type React from 'react'\n\nexport type PropertyVariant = 'badge' | 'plain'\n\nexport const propertyBadgeClassName =\n 'h-6 min-w-6 px-[calc(--spacing(2.5)-1px)] text-sm sm:h-6 sm:min-w-6 sm:text-sm'\n\nexport interface PropertySurfaceProps extends useRender.ComponentProps<'span'> {\n variant?: PropertyVariant\n muted?: boolean\n}\n\nexport function PropertySurface({\n className,\n muted = false,\n render,\n variant = 'badge',\n ...props\n}: PropertySurfaceProps): React.ReactElement {\n const state = {\n 'data-slot': 'property-surface',\n 'data-variant': variant,\n ...(muted ? { 'data-empty': 'true' } : {}),\n ...(props['aria-label'] && !props.role && !render ? { role: 'img' } : {}),\n }\n const plain = useRender({\n defaultTagName: 'span',\n enabled: variant !== 'badge',\n props: mergeProps<'span'>(\n {\n className: cn(\n muted ? 'text-muted-foreground' : 'text-primary',\n 'inline-flex min-w-0 max-w-full items-center gap-1 whitespace-nowrap text-sm outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-64 [button&,a&]:cursor-pointer',\n '[button&,a&]:-ms-1.5 [button&,a&]:-my-0.5 [button&,a&]:h-6 [button&,a&]:rounded-sm [button&,a&]:px-1.5',\n '[button&,a&]:hover:bg-secondary [button&,a&]:hover:text-secondary-foreground',\n '[button&,a&]:focus-visible:bg-secondary [button&,a&]:focus-visible:text-secondary-foreground',\n '[button&,a&]:data-popup-open:bg-secondary [button&,a&]:data-popup-open:text-secondary-foreground',\n className,\n ),\n ...state,\n },\n props,\n ),\n render,\n })\n\n if (plain) return plain\n\n return (\n <Badge\n className={cn(\n propertyBadgeClassName,\n !muted && 'text-primary',\n className,\n )}\n variant={muted ? 'outline' : 'secondary'}\n {...(render ? { render } : {})}\n {...state}\n {...props}\n />\n )\n}\n",
87
+ "target": "~/packages/ui/src/patterns/properties/shared/property-surface.tsx"
88
+ },
89
+ {
90
+ "path": "patterns/surfaces/settings/composition/settings-collapsed/settings-collapsed.tsx",
91
+ "type": "registry:file",
92
+ "content": "'use client'\n\nimport { CaretDownIcon } from '@phosphor-icons/react'\nimport {\n Collapsible,\n CollapsiblePanel,\n CollapsibleTrigger,\n} from '@tc96/ui/collapsible'\nimport { Text } from '@tc96/ui/text'\nimport { cn } from '@tc96/utils'\nimport { type ReactElement, useId } from 'react'\nimport type { SettingsCollapsedProps } from '../../core'\n\nexport function SettingsCollapsed({\n actions,\n children,\n className,\n defaultOpen = true,\n onOpenChange,\n open,\n title,\n}: Readonly<SettingsCollapsedProps>): ReactElement {\n const titleId = `settings-collapsed-title-${useId()}`\n\n return (\n <Collapsible\n aria-labelledby={titleId}\n className={cn('my-1 flex flex-col first:mt-4 last:mb-4', className)}\n data-slot=\"settings-collapsed\"\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n open={open}\n render={<section />}\n >\n <header className=\"flex min-h-10 items-center justify-between gap-2 rounded-lg bg-muted/80 px-3\">\n <Text\n className=\"min-w-0 flex-1\"\n foreground=\"muted\"\n render={\n <h2 data-slot=\"settings-collapsed-title\" id={titleId}>\n <CollapsibleTrigger className=\"group/trigger flex min-h-10 w-full min-w-0 items-center gap-2 rounded-lg text-start outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background\">\n <CaretDownIcon\n aria-hidden=\"true\"\n className=\"size-4 shrink-0 -rotate-90 transition-transform group-data-panel-open/trigger:rotate-0\"\n />\n <span className=\"min-w-0 break-words\">{title}</span>\n </CollapsibleTrigger>\n </h2>\n }\n size=\"sm\"\n weight=\"medium\"\n />\n {actions ? (\n <div\n className=\"flex shrink-0 items-center gap-1\"\n data-slot=\"settings-collapsed-actions\"\n >\n {actions}\n </div>\n ) : null}\n </header>\n <CollapsiblePanel>\n <div\n className=\"flex flex-col px-4 [&_[data-slot=settings-row]]:py-1\"\n data-slot=\"settings-collapsed-items\"\n >\n {children}\n </div>\n </CollapsiblePanel>\n </Collapsible>\n )\n}\n",
93
+ "target": "~/packages/ui/src/patterns/surfaces/settings/composition/settings-collapsed/settings-collapsed.tsx"
94
+ },
95
+ {
96
+ "path": "patterns/surfaces/settings/composition/settings-row/settings-row.tsx",
97
+ "type": "registry:file",
98
+ "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",
99
+ "target": "~/packages/ui/src/patterns/surfaces/settings/composition/settings-row/settings-row.tsx"
100
+ },
101
+ {
102
+ "path": "patterns/surfaces/settings/composition/settings-section/settings-section-context.ts",
103
+ "type": "registry:file",
104
+ "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",
105
+ "target": "~/packages/ui/src/patterns/surfaces/settings/composition/settings-section/settings-section-context.ts"
106
+ },
107
+ {
108
+ "path": "patterns/surfaces/settings/composition/settings-section/settings-section-header.tsx",
109
+ "type": "registry:file",
110
+ "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",
111
+ "target": "~/packages/ui/src/patterns/surfaces/settings/composition/settings-section/settings-section-header.tsx"
112
+ },
113
+ {
114
+ "path": "patterns/surfaces/settings/composition/settings-section/settings-section.tsx",
115
+ "type": "registry:file",
116
+ "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",
117
+ "target": "~/packages/ui/src/patterns/surfaces/settings/composition/settings-section/settings-section.tsx"
118
+ },
119
+ {
120
+ "path": "patterns/surfaces/settings/core.ts",
121
+ "type": "registry:file",
122
+ "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",
123
+ "target": "~/packages/ui/src/patterns/surfaces/settings/core.ts"
124
+ },
125
+ {
126
+ "path": "patterns/surfaces/state/composition/state-surface/state-surface.tsx",
127
+ "type": "registry:file",
128
+ "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",
129
+ "target": "~/packages/ui/src/patterns/surfaces/state/composition/state-surface/state-surface.tsx"
130
+ },
131
+ {
132
+ "path": "patterns/surfaces/state/core.ts",
133
+ "type": "registry:file",
134
+ "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",
135
+ "target": "~/packages/ui/src/patterns/surfaces/state/core.ts"
136
+ }
137
+ ],
138
+ "dependencies": [
139
+ "@base-ui/react@1.8.0",
140
+ "@phosphor-icons/react@2.1.10",
141
+ "react@19.1.1"
142
+ ],
143
+ "registryDependencies": [
144
+ "@ui/badge",
145
+ "@ui/button",
146
+ "@ui/card",
147
+ "@ui/collapsible",
148
+ "@ui/combobox",
149
+ "@ui/empty",
150
+ "@ui/icon-frame",
151
+ "@ui/menu",
152
+ "@ui/popover",
153
+ "@ui/property-tone",
154
+ "@ui/select",
155
+ "@ui/skeleton",
156
+ "@ui/text"
157
+ ],
158
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json"
159
+ }