@tc96/cli 0.0.0-stage → 0.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (200) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +213 -2
  3. package/cli.js +1395 -0
  4. package/package.json +35 -4
  5. package/registry/agent-builder.json +503 -0
  6. package/registry/aggregate.json +4 -0
  7. package/registry/app-shell-1.json +81 -0
  8. package/registry/app-shell-2.json +89 -0
  9. package/registry/app-shell-3.json +109 -0
  10. package/registry/app-shell-4.json +104 -0
  11. package/registry/app-shell-5.json +106 -0
  12. package/registry/bulk-import-1.json +151 -0
  13. package/registry/card-1.json +104 -0
  14. package/registry/card-2.json +97 -0
  15. package/registry/card-3.json +104 -0
  16. package/registry/card-4.json +98 -0
  17. package/registry/card-5.json +85 -0
  18. package/registry/card-6.json +98 -0
  19. package/registry/card-7.json +104 -0
  20. package/registry/card-8.json +106 -0
  21. package/registry/card-9.json +92 -0
  22. package/registry/charts.json +30 -0
  23. package/registry/chat-assistant.json +110 -0
  24. package/registry/chats-panel.json +97 -0
  25. package/registry/checklist.json +307 -0
  26. package/registry/collection-layouts.json +836 -0
  27. package/registry/collection-views.json +836 -0
  28. package/registry/collection.json +831 -0
  29. package/registry/dashboard-1.json +160 -0
  30. package/registry/dashboard-2.json +153 -0
  31. package/registry/dashboard-3.json +154 -0
  32. package/registry/dashboard-4.json +168 -0
  33. package/registry/detail-sheet.json +54 -0
  34. package/registry/editable.json +36 -0
  35. package/registry/empty-state-1.json +40 -0
  36. package/registry/empty-state-2.json +39 -0
  37. package/registry/empty-state-3.json +61 -0
  38. package/registry/empty-state-4.json +39 -0
  39. package/registry/empty-state-5.json +47 -0
  40. package/registry/empty-state-6.json +40 -0
  41. package/registry/flow-canvas.json +198 -0
  42. package/registry/flow-inspector.json +151 -0
  43. package/registry/flow-step-library.json +112 -0
  44. package/registry/forgot-password-1.json +73 -0
  45. package/registry/forgot-password-2.json +73 -0
  46. package/registry/icon-row.json +52 -0
  47. package/registry/impact-map.json +75 -0
  48. package/registry/list-1.json +129 -0
  49. package/registry/list-2.json +117 -0
  50. package/registry/list-3.json +129 -0
  51. package/registry/list-4.json +105 -0
  52. package/registry/list-5.json +98 -0
  53. package/registry/list-6.json +92 -0
  54. package/registry/list.json +52 -0
  55. package/registry/login-1.json +89 -0
  56. package/registry/login-10.json +88 -0
  57. package/registry/login-2.json +81 -0
  58. package/registry/login-3.json +90 -0
  59. package/registry/login-4.json +81 -0
  60. package/registry/login-5.json +82 -0
  61. package/registry/login-6.json +88 -0
  62. package/registry/login-7.json +83 -0
  63. package/registry/login-8.json +81 -0
  64. package/registry/login-9.json +88 -0
  65. package/registry/lookup-create-1.json +157 -0
  66. package/registry/magic-link-6.json +79 -0
  67. package/registry/navbar-1.json +66 -0
  68. package/registry/navbar-2.json +48 -0
  69. package/registry/navbar-3.json +50 -0
  70. package/registry/navbar-4.json +39 -0
  71. package/registry/navbar-5.json +50 -0
  72. package/registry/next-steps-1.json +147 -0
  73. package/registry/onboarding-1.json +114 -0
  74. package/registry/onboarding-2.json +78 -0
  75. package/registry/onboarding-3.json +71 -0
  76. package/registry/otp-1.json +73 -0
  77. package/registry/properties.json +523 -0
  78. package/registry/record-dialog.json +88 -0
  79. package/registry/record-group.json +190 -0
  80. package/registry/record-preview.json +70 -0
  81. package/registry/record-status-list.json +70 -0
  82. package/registry/reset-password-1.json +92 -0
  83. package/registry/reset-password-2.json +98 -0
  84. package/registry/reset-password-6.json +91 -0
  85. package/registry/rich-text-editor.json +93 -0
  86. package/registry/run-monitor.json +198 -0
  87. package/registry/settings-1.json +119 -0
  88. package/registry/settings-10.json +218 -0
  89. package/registry/settings-11.json +129 -0
  90. package/registry/settings-12.json +130 -0
  91. package/registry/settings-13.json +130 -0
  92. package/registry/settings-14.json +173 -0
  93. package/registry/settings-15.json +149 -0
  94. package/registry/settings-16.json +129 -0
  95. package/registry/settings-17.json +117 -0
  96. package/registry/settings-18.json +117 -0
  97. package/registry/settings-19.json +125 -0
  98. package/registry/settings-2.json +123 -0
  99. package/registry/settings-20.json +112 -0
  100. package/registry/settings-21.json +116 -0
  101. package/registry/settings-22.json +118 -0
  102. package/registry/settings-23.json +118 -0
  103. package/registry/settings-3.json +123 -0
  104. package/registry/settings-4.json +116 -0
  105. package/registry/settings-5.json +119 -0
  106. package/registry/settings-6.json +125 -0
  107. package/registry/settings-7.json +128 -0
  108. package/registry/settings-8.json +116 -0
  109. package/registry/settings-9.json +118 -0
  110. package/registry/settings-shell.json +60 -0
  111. package/registry/settings.json +82 -0
  112. package/registry/signup-1.json +100 -0
  113. package/registry/signup-2.json +93 -0
  114. package/registry/signup-3.json +83 -0
  115. package/registry/signup-6.json +99 -0
  116. package/registry/state-surface.json +58 -0
  117. package/registry/stats-1.json +116 -0
  118. package/registry/stats-2.json +115 -0
  119. package/registry/stats-3.json +97 -0
  120. package/registry/stats-4.json +92 -0
  121. package/registry/stats-5.json +103 -0
  122. package/registry/stats-6.json +105 -0
  123. package/registry/stats-7.json +103 -0
  124. package/registry/stats.json +64 -0
  125. package/registry/timeline-1.json +97 -0
  126. package/registry/timeline-2.json +102 -0
  127. package/registry/timeline-3.json +68 -0
  128. package/registry/timeline-4.json +86 -0
  129. package/registry/ui/accordion.json +15 -0
  130. package/registry/ui/alert-dialog.json +14 -0
  131. package/registry/ui/alert.json +50 -0
  132. package/registry/ui/autocomplete.json +18 -0
  133. package/registry/ui/avatar.json +14 -0
  134. package/registry/ui/badge.json +51 -0
  135. package/registry/ui/breadcrumb.json +15 -0
  136. package/registry/ui/button.json +25 -0
  137. package/registry/ui/calendar.json +15 -0
  138. package/registry/ui/card.json +14 -0
  139. package/registry/ui/chat.json +115 -0
  140. package/registry/ui/checkbox-group.json +14 -0
  141. package/registry/ui/checkbox.json +14 -0
  142. package/registry/ui/collapsible.json +14 -0
  143. package/registry/ui/combobox.json +18 -0
  144. package/registry/ui/command.json +17 -0
  145. package/registry/ui/composer-clipboard.json +14 -0
  146. package/registry/ui/composer-document.json +14 -0
  147. package/registry/ui/composer-editor.json +16 -0
  148. package/registry/ui/composer-query.json +12 -0
  149. package/registry/ui/composer.json +17 -0
  150. package/registry/ui/context-menu.json +23 -0
  151. package/registry/ui/dialog.json +18 -0
  152. package/registry/ui/drawer.json +18 -0
  153. package/registry/ui/empty.json +14 -0
  154. package/registry/ui/field.json +22 -0
  155. package/registry/ui/fieldset.json +14 -0
  156. package/registry/ui/form.json +14 -0
  157. package/registry/ui/frame.json +12 -0
  158. package/registry/ui/gauge.json +31 -0
  159. package/registry/ui/group.json +17 -0
  160. package/registry/ui/icon-frame.json +31 -0
  161. package/registry/ui/input-group.json +17 -0
  162. package/registry/ui/input.json +14 -0
  163. package/registry/ui/kbd.json +12 -0
  164. package/registry/ui/label.json +14 -0
  165. package/registry/ui/menu.json +39 -0
  166. package/registry/ui/meter.json +14 -0
  167. package/registry/ui/number-field.json +17 -0
  168. package/registry/ui/otp-field.json +31 -0
  169. package/registry/ui/pagination.json +17 -0
  170. package/registry/ui/popover.json +14 -0
  171. package/registry/ui/preview-card.json +14 -0
  172. package/registry/ui/progress.json +14 -0
  173. package/registry/ui/radio-group.json +14 -0
  174. package/registry/ui/render-anchor.json +12 -0
  175. package/registry/ui/scroll-area.json +14 -0
  176. package/registry/ui/segmented-control.json +14 -0
  177. package/registry/ui/select.json +16 -0
  178. package/registry/ui/separator.json +14 -0
  179. package/registry/ui/sheet.json +18 -0
  180. package/registry/ui/sidebar.json +25 -0
  181. package/registry/ui/skeleton.json +24 -0
  182. package/registry/ui/slider.json +14 -0
  183. package/registry/ui/spinner.json +14 -0
  184. package/registry/ui/switch.json +14 -0
  185. package/registry/ui/table.json +14 -0
  186. package/registry/ui/tabs.json +16 -0
  187. package/registry/ui/text.json +31 -0
  188. package/registry/ui/textarea.json +14 -0
  189. package/registry/ui/toast.json +89 -0
  190. package/registry/ui/toggle-group.json +18 -0
  191. package/registry/ui/toggle.json +15 -0
  192. package/registry/ui/toolbar.json +14 -0
  193. package/registry/ui/tooltip.json +14 -0
  194. package/registry/ui/use-composer-editor.json +17 -0
  195. package/registry/ui/use-copy-to-clipboard.json +12 -0
  196. package/registry/ui/use-media-query.json +12 -0
  197. package/registry/view.json +831 -0
  198. package/registry/widgets.json +319 -0
  199. package/registry/wizard.json +89 -0
  200. package/registry/workflow-editor.json +460 -0
@@ -0,0 +1,73 @@
1
+ {
2
+ "name": "otp-1",
3
+ "type": "registry:block",
4
+ "files": [
5
+ {
6
+ "path": "blocks/application/auth/otp-1/index.ts",
7
+ "type": "registry:file",
8
+ "content": "export type {\n AuthBaseProps,\n AuthCommonLabels,\n AuthFieldErrors,\n AuthRenderLink,\n} from '../shared/types'\nexport { Otp1 } from './otp-1'\nexport type { OtpLabels, OtpProps, OtpValues } from './types'\n",
9
+ "target": "~/packages/ui/src/blocks/application/auth/otp-1/index.ts"
10
+ },
11
+ {
12
+ "path": "blocks/application/auth/otp-1/labels.ts",
13
+ "type": "registry:file",
14
+ "content": "import { defaultAuthCommonLabels } from '../shared/labels'\nimport type { OtpLabels } from './types'\n\nexport const defaultOtpLabels: OtpLabels = {\n code: 'Código de verificação',\n description: (length, destination) =>\n destination\n ? `Enviamos um código de ${length} dígitos para ${destination}.`\n : `Enviamos um código de ${length} dígitos.`,\n didNotReceive: 'Não recebeu o código?',\n digit: (position, total) => `Dígito ${position} de ${total}`,\n errorTitle: defaultAuthCommonLabels.errorTitle,\n resend: 'Reenviar código',\n resendIn: (seconds) => `Reenviar em ${seconds}s`,\n submit: 'Verificar',\n title: 'Verifique seu código',\n}\n",
15
+ "target": "~/packages/ui/src/blocks/application/auth/otp-1/labels.ts"
16
+ },
17
+ {
18
+ "path": "blocks/application/auth/otp-1/otp-1.tsx",
19
+ "type": "registry:file",
20
+ "content": "'use client'\n\nimport { Button } from '@tc96/ui/button'\nimport { Field, FieldError, FieldLabel } from '@tc96/ui/field'\nimport { Form } from '@tc96/ui/form'\nimport { OTPField, OTPFieldInput } from '@tc96/ui/otp-field'\nimport { type ReactElement, useId, useMemo, useRef } from 'react'\nimport { AuthCard } from '../shared/auth-card'\nimport { resolveAuthLabels } from '../shared/labels'\nimport { toFormErrors } from '../shared/to-form-errors'\nimport { useFocusFirstInvalid } from '../shared/use-focus-first-invalid'\nimport { defaultOtpLabels } from './labels'\nimport type { OtpProps } from './types'\n\nexport function Otp1({\n destination,\n error,\n fieldErrors,\n labels: labelsProp,\n length = 6,\n logo,\n onComplete,\n onResend,\n onSubmit,\n pending = false,\n resendIn = 0,\n}: Readonly<OtpProps>): ReactElement {\n const labels = resolveAuthLabels(defaultOtpLabels, labelsProp)\n const formRef = useRef<HTMLFormElement>(null)\n const alertRef = useRef<HTMLDivElement>(null)\n const firstDigitLabelId = useId()\n const errors = useMemo(() => toFormErrors(fieldErrors), [fieldErrors])\n const positions = useMemo(\n () => Array.from({ length }, (_, index) => index + 1),\n [length],\n )\n const counting = resendIn > 0\n\n useFocusFirstInvalid({ alertRef, error, fieldErrors, formRef })\n\n return (\n <AuthCard\n alertRef={alertRef}\n description={labels.description(length, destination)}\n error={error}\n errorTitle={labels.errorTitle}\n footer={\n onResend ? (\n <>\n <span>{labels.didNotReceive}</span>\n <Button\n className=\"underline\"\n disabled={counting || pending}\n onClick={() => onResend()}\n size=\"sm\"\n variant=\"link\"\n >\n {counting ? labels.resendIn(resendIn) : labels.resend}\n </Button>\n </>\n ) : undefined\n }\n logo={logo}\n title={labels.title}\n >\n <Form\n aria-busy={pending}\n className=\"flex flex-col gap-4\"\n errors={errors}\n onFormSubmit={(values) => {\n const code = String(values.code ?? '')\n if (pending || code.length < length) return\n onSubmit({ code })\n }}\n ref={formRef}\n >\n <Field className=\"items-center\" name=\"code\">\n <FieldLabel>{labels.code}</FieldLabel>\n <OTPField\n length={length}\n onValueComplete={(code) => onComplete?.(code)}\n required\n >\n {positions.map((position) => (\n <OTPFieldInput\n aria-label={labels.digit(position, length)}\n aria-labelledby={position === 1 ? firstDigitLabelId : undefined}\n key={position}\n />\n ))}\n </OTPField>\n <span hidden id={firstDigitLabelId}>\n {labels.digit(1, length)}\n </span>\n <FieldError />\n </Field>\n <Button className=\"w-full\" loading={pending} type=\"submit\">\n {labels.submit}\n </Button>\n </Form>\n </AuthCard>\n )\n}\n",
21
+ "target": "~/packages/ui/src/blocks/application/auth/otp-1/otp-1.tsx"
22
+ },
23
+ {
24
+ "path": "blocks/application/auth/otp-1/types.ts",
25
+ "type": "registry:file",
26
+ "content": "import type {\n AuthBaseProps,\n AuthCommonLabels,\n AuthFieldErrors,\n} from '../shared/types'\n\nexport interface OtpValues {\n code: string\n}\n\nexport interface OtpLabels extends Pick<AuthCommonLabels, 'errorTitle'> {\n code: string\n description: (length: number, destination?: string) => string\n didNotReceive: string\n digit: (position: number, total: number) => string\n resend: string\n resendIn: (seconds: number) => string\n submit: string\n title: string\n}\n\nexport interface OtpProps extends AuthBaseProps<OtpLabels> {\n destination?: string\n fieldErrors?: AuthFieldErrors<OtpValues>\n length?: number\n onComplete?: (code: string) => void\n onResend?: () => void\n onSubmit: (values: OtpValues) => void\n resendIn?: number\n}\n",
27
+ "target": "~/packages/ui/src/blocks/application/auth/otp-1/types.ts"
28
+ },
29
+ {
30
+ "path": "blocks/application/auth/shared/auth-card.tsx",
31
+ "type": "registry:file",
32
+ "content": "'use client'\n\nimport { Alert, AlertDescription, AlertTitle } from '@tc96/ui/alert'\nimport {\n Card,\n CardDescription,\n CardHeader,\n CardPanel,\n CardTitle,\n} from '@tc96/ui/card'\nimport type { ReactElement, ReactNode, Ref } from 'react'\n\nexport interface AuthCardProps {\n alertRef?: Ref<HTMLDivElement>\n children?: ReactNode\n description?: ReactNode\n error?: string\n errorTitle: string\n footer?: ReactNode\n logo?: ReactNode\n notice?: ReactNode\n title: ReactNode\n titleRef?: Ref<HTMLDivElement>\n}\n\nexport function AuthCard({\n alertRef,\n children,\n description,\n error,\n errorTitle,\n footer,\n logo,\n notice,\n title,\n titleRef,\n}: Readonly<AuthCardProps>): ReactElement {\n return (\n <main className=\"flex min-h-svh items-center justify-center p-4 sm:p-6\">\n <div className=\"flex w-full max-w-sm flex-col gap-6\">\n <Card>\n <CardHeader className=\"justify-items-center text-center\">\n {logo ? (\n <div className=\"mb-2 flex justify-center\">{logo}</div>\n ) : null}\n <CardTitle\n ref={titleRef}\n render={(props) => <h1 {...props} />}\n tabIndex={titleRef ? -1 : undefined}\n >\n {title}\n </CardTitle>\n {description ? (\n <CardDescription>{description}</CardDescription>\n ) : null}\n </CardHeader>\n <CardPanel className=\"flex flex-col gap-4\">\n {error ? (\n <Alert ref={alertRef} tabIndex={-1} variant=\"error\">\n <AlertTitle>{errorTitle}</AlertTitle>\n <AlertDescription>{error}</AlertDescription>\n </Alert>\n ) : null}\n {children}\n </CardPanel>\n </Card>\n {footer ? (\n <div\n className=\"flex flex-wrap items-center justify-center gap-1 text-muted-foreground text-sm\"\n data-slot=\"auth-footer\"\n >\n {footer}\n </div>\n ) : null}\n {notice}\n </div>\n </main>\n )\n}\n",
33
+ "target": "~/packages/ui/src/blocks/application/auth/shared/auth-card.tsx"
34
+ },
35
+ {
36
+ "path": "blocks/application/auth/shared/labels.ts",
37
+ "type": "registry:file",
38
+ "content": "import type { AuthCommonLabels, AuthNewPasswordLabels } from './types'\n\nexport const defaultAuthCommonLabels: AuthCommonLabels = {\n email: 'E-mail',\n errorTitle: 'Não foi possível continuar',\n hidePassword: 'Ocultar senha',\n password: 'Senha',\n providerContinue: (label) => `Continuar com ${label}`,\n providersGroup: 'Entrar com outro serviço',\n providersSeparator: 'ou continue com e-mail',\n showPassword: 'Mostrar senha',\n}\n\nexport const defaultAuthNewPasswordLabels: AuthNewPasswordLabels = {\n confirmPassword: 'Confirmar senha',\n passwordMismatch: 'As senhas não coincidem.',\n suggestionLowercase: 'minúscula',\n suggestionMet: 'atendida',\n suggestionMissing: 'faltando',\n suggestionNumber: 'número',\n suggestionSymbol: 'símbolo',\n suggestionUppercase: 'maiúscula',\n}\n\nexport function resolveAuthLabels<TLabels>(\n defaults: TLabels,\n labels?: Partial<TLabels>,\n): TLabels {\n return { ...defaults, ...labels }\n}\n",
39
+ "target": "~/packages/ui/src/blocks/application/auth/shared/labels.ts"
40
+ },
41
+ {
42
+ "path": "blocks/application/auth/shared/to-form-errors.ts",
43
+ "type": "registry:file",
44
+ "content": "export function toFormErrors(\n fieldErrors?: Readonly<Partial<Record<string, string>>>,\n): Record<string, string> {\n const errors: Record<string, string> = {}\n for (const [name, message] of Object.entries(fieldErrors ?? {}))\n if (message) errors[name] = message\n return errors\n}\n",
45
+ "target": "~/packages/ui/src/blocks/application/auth/shared/to-form-errors.ts"
46
+ },
47
+ {
48
+ "path": "blocks/application/auth/shared/types.ts",
49
+ "type": "registry:file",
50
+ "content": "import type { RenderLink } from '@tc96/ui/render-anchor'\nimport type { ReactNode } from 'react'\n\nexport type AuthRenderLink = RenderLink\n\nexport interface AuthProvider {\n icon?: ReactNode\n id: string\n label: string\n}\n\nexport type AuthFieldErrors<TValues> = Partial<Record<keyof TValues, string>>\n\nexport type AuthPasswordSuggestion =\n | 'lowercase'\n | 'uppercase'\n | 'number'\n | 'symbol'\n\nexport interface AuthCommonLabels {\n email: string\n errorTitle: string\n hidePassword: string\n password: string\n providerContinue: (label: string) => string\n providersGroup: string\n providersSeparator: string\n showPassword: string\n}\n\nexport interface AuthNewPasswordLabels {\n confirmPassword: string\n passwordMismatch: string\n suggestionLowercase: string\n suggestionMet: string\n suggestionMissing: string\n suggestionNumber: string\n suggestionSymbol: string\n suggestionUppercase: string\n}\n\nexport interface AuthBaseProps<TLabels> {\n error?: string\n labels?: Partial<TLabels>\n logo?: ReactNode\n pending?: boolean\n renderLink?: AuthRenderLink\n}\n",
51
+ "target": "~/packages/ui/src/blocks/application/auth/shared/types.ts"
52
+ },
53
+ {
54
+ "path": "blocks/application/auth/shared/use-focus-first-invalid.ts",
55
+ "type": "registry:file",
56
+ "content": "'use client'\n\nimport { type RefObject, useEffect, useRef } from 'react'\nimport { toFormErrors } from './to-form-errors'\n\nexport interface UseFocusFirstInvalidOptions {\n alertRef: RefObject<HTMLElement | null>\n error?: string\n fieldErrors?: Readonly<Partial<Record<string, string>>>\n formRef: RefObject<HTMLFormElement | null>\n}\n\nfunction findFirstNamedControl(\n form: HTMLFormElement | null,\n names: readonly string[],\n): HTMLElement | undefined {\n return Array.from(form?.elements ?? []).find(\n (element): element is HTMLElement =>\n element instanceof HTMLElement &&\n !(element instanceof HTMLInputElement && element.type === 'hidden') &&\n names.includes(element.getAttribute('name') ?? ''),\n )\n}\n\nexport function useFocusFirstInvalid({\n alertRef,\n error,\n fieldErrors,\n formRef,\n}: UseFocusFirstInvalidOptions): void {\n const invalidNames = Object.keys(toFormErrors(fieldErrors)).join('\\n')\n const hasError = Boolean(error)\n const previous = useRef({ hasError, invalidNames })\n\n useEffect(() => {\n const before = previous.current\n previous.current = { hasError, invalidNames }\n const hasFieldErrors = invalidNames !== ''\n const filled =\n (hasFieldErrors && before.invalidNames === '') ||\n (hasError && !before.hasError)\n if (!filled) return\n const field = hasFieldErrors\n ? findFirstNamedControl(formRef.current, invalidNames.split('\\n'))\n : undefined\n if (field) field.focus()\n else if (hasError) alertRef.current?.focus()\n }, [alertRef, formRef, hasError, invalidNames])\n}\n",
57
+ "target": "~/packages/ui/src/blocks/application/auth/shared/use-focus-first-invalid.ts"
58
+ }
59
+ ],
60
+ "dependencies": [
61
+ "react@19.1.1"
62
+ ],
63
+ "registryDependencies": [
64
+ "@ui/alert",
65
+ "@ui/button",
66
+ "@ui/card",
67
+ "@ui/field",
68
+ "@ui/form",
69
+ "@ui/otp-field",
70
+ "@ui/render-anchor"
71
+ ],
72
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json"
73
+ }