@tc96/cli 0.27.0 → 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.
- package/README.md +4 -4
- package/cli.js +82 -27
- package/package.json +1 -1
- package/registry/agenda-1.json +1297 -0
- package/registry/aggregate.json +1 -1
- package/registry/ai-chat-1.json +91 -0
- package/registry/checklist.json +21 -7
- package/registry/collection.json +624 -351
- package/registry/crm-1.json +1317 -0
- package/registry/crm-2.json +1400 -0
- package/registry/dashboard-5.json +167 -0
- package/registry/dashboard-6.json +143 -0
- package/registry/dashboard-7.json +188 -0
- package/registry/documents-1.json +1322 -0
- package/registry/finance-1.json +845 -0
- package/registry/finance-2.json +973 -0
- package/registry/finance-3.json +1436 -0
- package/registry/{workflow-editor.json → flow-1.json} +37 -37
- package/registry/{agent-builder.json → flow-2.json} +55 -55
- package/registry/{run-monitor.json → flow-3.json} +16 -16
- package/registry/{impact-map.json → flow-4.json} +16 -16
- package/registry/inbox-1.json +1184 -0
- package/registry/inventory-1.json +828 -0
- package/registry/inventory-2.json +956 -0
- package/registry/legal-1.json +1345 -0
- package/registry/legal-2.json +1279 -0
- package/registry/legal-3.json +1273 -0
- package/registry/legal-4.json +1273 -0
- package/registry/legal-5.json +1393 -0
- package/registry/legal-6.json +1309 -0
- package/registry/legal-7.json +1315 -0
- package/registry/legal-8.json +1358 -0
- package/registry/legal-9.json +1381 -0
- package/registry/marketing-1.json +833 -0
- package/registry/marketing-2.json +961 -0
- package/registry/navbar-1.json +6 -6
- package/registry/navbar-10.json +50 -0
- package/registry/navbar-11.json +48 -0
- package/registry/navbar-12.json +48 -0
- package/registry/navbar-6.json +48 -0
- package/registry/navbar-7.json +72 -0
- package/registry/navbar-8.json +50 -0
- package/registry/navbar-9.json +54 -0
- package/registry/projects-1.json +865 -0
- package/registry/projects-2.json +993 -0
- package/registry/projects-3.json +1346 -0
- package/registry/properties.json +65 -58
- package/registry/record-group.json +5 -1
- package/registry/revenue-1.json +834 -0
- package/registry/revenue-2.json +968 -0
- package/registry/revenue-3.json +821 -0
- package/registry/revenue-4.json +949 -0
- package/registry/rich-text-editor-1.json +172 -0
- package/registry/rich-text-editor-2.json +158 -0
- package/registry/rich-text-editor-3.json +198 -0
- package/registry/rich-text-editor-4.json +200 -0
- package/registry/rich-text-editor-5.json +237 -0
- package/registry/rich-text-editor.json +27 -7
- package/registry/{settings-1.json → settings-account-1.json} +17 -17
- package/registry/{settings-23.json → settings-account-2.json} +17 -17
- package/registry/{settings-7.json → settings-catalog-1.json} +17 -17
- package/registry/{settings-16.json → settings-catalog-10.json} +17 -17
- package/registry/{settings-8.json → settings-catalog-2.json} +17 -17
- package/registry/{settings-9.json → settings-catalog-3.json} +17 -17
- package/registry/{settings-10.json → settings-catalog-4.json} +29 -20
- package/registry/{settings-11.json → settings-catalog-5.json} +17 -17
- package/registry/{settings-12.json → settings-catalog-6.json} +17 -17
- package/registry/{settings-13.json → settings-catalog-7.json} +17 -17
- package/registry/{settings-14.json → settings-catalog-8.json} +29 -19
- package/registry/{settings-15.json → settings-catalog-9.json} +28 -18
- package/registry/{settings-19.json → settings-integration-1.json} +17 -17
- package/registry/settings-integration-2.json +122 -0
- package/registry/{settings-22.json → settings-integration-3.json} +17 -17
- package/registry/settings-integration-4.json +129 -0
- package/registry/settings-integration-5.json +122 -0
- package/registry/settings-integration-6.json +92 -0
- package/registry/{settings-21.json → settings-integration-7.json} +23 -17
- package/registry/settings-integration-8.json +593 -0
- package/registry/{settings-20.json → settings-notification-channel-1.json} +17 -17
- package/registry/{settings-2.json → settings-preference-1.json} +17 -17
- package/registry/{settings-3.json → settings-preference-2.json} +17 -17
- package/registry/{settings-4.json → settings-preference-3.json} +17 -17
- package/registry/{settings-18.json → settings-role-permission-1.json} +17 -17
- package/registry/{settings-17.json → settings-security-1.json} +17 -17
- package/registry/{settings-5.json → settings-workspace-1.json} +28 -28
- package/registry/{settings-6.json → settings-workspace-2.json} +31 -31
- package/registry/support-1.json +853 -0
- package/registry/support-2.json +981 -0
- package/registry/support-3.json +762 -0
- package/registry/support-4.json +538 -0
- package/registry/team-1.json +829 -0
- package/registry/team-2.json +957 -0
- package/registry/ui/gauge.json +1 -1
- package/registry/ui/menu.json +1 -1
- package/registry/ui/property-meta.json +16 -0
- package/registry/ui/property-tone.json +12 -0
- package/registry/ui/scroll-area.json +1 -1
- package/registry/ui/select.json +1 -1
- package/registry/view.json +624 -351
- package/registry/app-shell-5.json +0 -106
- package/registry/bulk-import-1.json +0 -151
- package/registry/collection-layouts.json +0 -836
- package/registry/collection-views.json +0 -836
- package/registry/detail-sheet.json +0 -54
- package/registry/icon-row.json +0 -52
- package/registry/lookup-create-1.json +0 -157
- package/registry/next-steps-1.json +0 -147
- package/registry/settings-shell.json +0 -60
|
@@ -1,60 +1,60 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "settings-
|
|
2
|
+
"name": "settings-workspace-1",
|
|
3
3
|
"type": "registry:block",
|
|
4
4
|
"files": [
|
|
5
5
|
{
|
|
6
|
-
"path": "blocks/application/settings/
|
|
6
|
+
"path": "blocks/application/settings/shared/labels.ts",
|
|
7
7
|
"type": "registry:file",
|
|
8
|
-
"content": "
|
|
9
|
-
"target": "~/packages/ui/src/blocks/application/settings/
|
|
8
|
+
"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",
|
|
9
|
+
"target": "~/packages/ui/src/blocks/application/settings/shared/labels.ts"
|
|
10
10
|
},
|
|
11
11
|
{
|
|
12
|
-
"path": "blocks/application/settings/settings-
|
|
12
|
+
"path": "blocks/application/settings/shared/settings-load-state.tsx",
|
|
13
13
|
"type": "registry:file",
|
|
14
|
-
"content": "import {
|
|
15
|
-
"target": "~/packages/ui/src/blocks/application/settings/settings-
|
|
14
|
+
"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",
|
|
15
|
+
"target": "~/packages/ui/src/blocks/application/settings/shared/settings-load-state.tsx"
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
|
-
"path": "blocks/application/settings/
|
|
18
|
+
"path": "blocks/application/settings/shared/settings-skeleton.tsx",
|
|
19
19
|
"type": "registry:file",
|
|
20
|
-
"content": "import {
|
|
21
|
-
"target": "~/packages/ui/src/blocks/application/settings/
|
|
20
|
+
"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",
|
|
21
|
+
"target": "~/packages/ui/src/blocks/application/settings/shared/settings-skeleton.tsx"
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
|
-
"path": "blocks/application/settings/
|
|
24
|
+
"path": "blocks/application/settings/shared/types.ts",
|
|
25
25
|
"type": "registry:file",
|
|
26
|
-
"content": "
|
|
27
|
-
"target": "~/packages/ui/src/blocks/application/settings/
|
|
26
|
+
"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",
|
|
27
|
+
"target": "~/packages/ui/src/blocks/application/settings/shared/types.ts"
|
|
28
28
|
},
|
|
29
29
|
{
|
|
30
|
-
"path": "blocks/application/settings/settings-
|
|
30
|
+
"path": "blocks/application/settings/workspace/settings-workspace-1/index.ts",
|
|
31
31
|
"type": "registry:file",
|
|
32
|
-
"content": "
|
|
33
|
-
"target": "~/packages/ui/src/blocks/application/settings/settings-
|
|
32
|
+
"content": "export { SettingsWorkspace1 } from './settings-workspace-1'\nexport type {\n SettingsWorkspace1Labels,\n SettingsWorkspace1Props,\n SettingsWorkspace1TimeZone,\n} from './types'\n",
|
|
33
|
+
"target": "~/packages/ui/src/blocks/application/settings/workspace/settings-workspace-1/index.ts"
|
|
34
34
|
},
|
|
35
35
|
{
|
|
36
|
-
"path": "blocks/application/settings/
|
|
36
|
+
"path": "blocks/application/settings/workspace/settings-workspace-1/labels.ts",
|
|
37
37
|
"type": "registry:file",
|
|
38
|
-
"content": "import type {
|
|
39
|
-
"target": "~/packages/ui/src/blocks/application/settings/
|
|
38
|
+
"content": "import { defaultSettingsLoadLabels } from '../../shared/labels'\nimport type { SettingsWorkspace1Labels } from './types'\n\nexport const defaultSettingsWorkspace1Labels: SettingsWorkspace1Labels = {\n ...defaultSettingsLoadLabels,\n errorTitle: 'Não foi possível carregar o workspace',\n loading: 'Carregando workspace',\n dangerTitle: 'Zona de perigo',\n deleteDescription:\n 'Exclui todos os registros e remove o acesso de todos os membros',\n deleteTitle: 'Excluir workspace',\n deleteWorkspace: 'Excluir workspace',\n logoDescription: 'Exibido na barra lateral e nos e-mails de convite',\n logoTitle: 'Logo',\n nameLabel: 'Nome do workspace',\n timeZoneDescription: 'Usado em prazos, relatórios e e-mails agendados',\n timeZoneLabel: 'Fuso horário',\n uploadLogo: 'Enviar logo',\n urlDescription: 'Alterar quebra os links compartilhados antes',\n urlLabel: 'URL do workspace',\n urlPrefix: 'app.example.com/',\n workspaceDescription: (name) =>\n `Detalhes que todos os membros de ${name} veem.`,\n workspaceTitle: 'Workspace',\n}\n",
|
|
39
|
+
"target": "~/packages/ui/src/blocks/application/settings/workspace/settings-workspace-1/labels.ts"
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
|
-
"path": "blocks/application/settings/
|
|
42
|
+
"path": "blocks/application/settings/workspace/settings-workspace-1/settings-workspace-1-skeleton.tsx",
|
|
43
43
|
"type": "registry:file",
|
|
44
|
-
"content": "import {
|
|
45
|
-
"target": "~/packages/ui/src/blocks/application/settings/
|
|
44
|
+
"content": "import { SettingsRowsSkeleton } from '../../shared/settings-skeleton'\n\nexport function SettingsWorkspace1Skeleton() {\n return (\n <>\n <SettingsRowsSkeleton count={1} start=\"avatar\" end=\"button\" />\n <SettingsRowsSkeleton count={3} end=\"select\" />\n </>\n )\n}\n",
|
|
45
|
+
"target": "~/packages/ui/src/blocks/application/settings/workspace/settings-workspace-1/settings-workspace-1-skeleton.tsx"
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
|
-
"path": "blocks/application/settings/
|
|
48
|
+
"path": "blocks/application/settings/workspace/settings-workspace-1/settings-workspace-1.tsx",
|
|
49
49
|
"type": "registry:file",
|
|
50
|
-
"content": "import {
|
|
51
|
-
"target": "~/packages/ui/src/blocks/application/settings/
|
|
50
|
+
"content": "import { CameraIcon } from '@phosphor-icons/react'\nimport { Avatar, AvatarFallback } from '@tc96/ui/avatar'\nimport { Button } from '@tc96/ui/button'\nimport { Input } from '@tc96/ui/input'\nimport {\n InputGroup,\n InputGroupAddon,\n InputGroupInput,\n InputGroupText,\n} from '@tc96/ui/input-group'\nimport { SettingsRow } from '@tc96/ui/patterns/surfaces/settings/composition/settings-row/settings-row'\nimport { SettingsSection } from '@tc96/ui/patterns/surfaces/settings/composition/settings-section/settings-section'\nimport {\n SettingsSectionDescription,\n SettingsSectionHeader,\n SettingsSectionTitle,\n} from '@tc96/ui/patterns/surfaces/settings/composition/settings-section/settings-section-header'\nimport {\n Select,\n SelectItem,\n SelectPopup,\n SelectTrigger,\n SelectValue,\n} from '@tc96/ui/select'\nimport { cn } from '@tc96/utils'\nimport { useState } from 'react'\nimport { settingsLoadState } from '../../shared/settings-load-state'\nimport { defaultSettingsWorkspace1Labels } from './labels'\nimport { SettingsWorkspace1Skeleton } from './settings-workspace-1-skeleton'\nimport type { SettingsWorkspace1Props } from './types'\n\ninterface AvatarUploadTriggerProps {\n initials: string\n label: string\n onClick?: () => void\n}\n\nfunction AvatarUploadTrigger({\n initials,\n label,\n onClick,\n}: Readonly<AvatarUploadTriggerProps>) {\n return (\n <Avatar\n aria-label={label}\n className=\"group cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background\"\n onClick={onClick}\n render={<button type=\"button\" />}\n >\n <AvatarFallback>{initials}</AvatarFallback>\n <span\n aria-hidden=\"true\"\n className=\"absolute inset-0 flex items-center justify-center bg-foreground/64 text-background opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100\"\n >\n <CameraIcon aria-hidden=\"true\" className=\"size-4\" />\n </span>\n </Avatar>\n )\n}\n\nexport function SettingsWorkspace1({\n error,\n onRetry,\n pending,\n className,\n initials,\n labels: labelsProp,\n name,\n onDeleteWorkspace,\n onNameCommit,\n onSlugCommit,\n onTimeZoneChange,\n onUploadLogo,\n slug,\n timeZone: timeZoneProp,\n timeZones,\n}: Readonly<SettingsWorkspace1Props>) {\n const labels = { ...defaultSettingsWorkspace1Labels, ...labelsProp }\n const loadState = settingsLoadState({\n error,\n labels,\n onRetry,\n pending,\n skeleton: <SettingsWorkspace1Skeleton />,\n })\n const [timeZone, setTimeZone] = useState(timeZoneProp)\n\n return (\n <div\n className={cn('mx-auto flex w-full max-w-2xl flex-col gap-8', className)}\n >\n <SettingsSection\n header={\n <SettingsSectionHeader>\n <SettingsSectionTitle>{labels.workspaceTitle}</SettingsSectionTitle>\n <SettingsSectionDescription>\n {labels.workspaceDescription(name)}\n </SettingsSectionDescription>\n </SettingsSectionHeader>\n }\n >\n {loadState ?? (\n <>\n <SettingsRow\n description={labels.logoDescription}\n endSlot={\n <AvatarUploadTrigger\n initials={initials}\n label={labels.uploadLogo}\n onClick={onUploadLogo}\n />\n }\n title={labels.logoTitle}\n />\n <SettingsRow\n endSlot={\n <Input\n aria-label={labels.nameLabel}\n className=\"w-64\"\n defaultValue={name}\n onBlur={(event) => onNameCommit?.(event.currentTarget.value)}\n />\n }\n title={labels.nameLabel}\n />\n <SettingsRow\n description={labels.urlDescription}\n endSlot={\n <InputGroup className=\"w-64\">\n <InputGroupAddon>\n <InputGroupText>{labels.urlPrefix}</InputGroupText>\n </InputGroupAddon>\n <InputGroupInput\n aria-label={labels.urlLabel}\n defaultValue={slug}\n onBlur={(event) =>\n onSlugCommit?.(event.currentTarget.value)\n }\n />\n </InputGroup>\n }\n title={labels.urlLabel}\n />\n <SettingsRow\n description={labels.timeZoneDescription}\n endSlot={\n <Select\n items={timeZones}\n onValueChange={(next) => {\n if (!next) return\n setTimeZone(next)\n onTimeZoneChange?.(next)\n }}\n value={timeZone}\n >\n <SelectTrigger\n aria-label={labels.timeZoneLabel}\n className=\"w-64\"\n >\n <SelectValue />\n </SelectTrigger>\n <SelectPopup>\n {timeZones.map((item) => (\n <SelectItem key={item.value} value={item.value}>\n {item.label}\n </SelectItem>\n ))}\n </SelectPopup>\n </Select>\n }\n title={labels.timeZoneLabel}\n />\n </>\n )}\n </SettingsSection>\n {loadState ? null : (\n <SettingsSection\n header={\n <SettingsSectionHeader>\n <SettingsSectionTitle>{labels.dangerTitle}</SettingsSectionTitle>\n </SettingsSectionHeader>\n }\n >\n <SettingsRow\n description={labels.deleteDescription}\n endSlot={\n <Button\n onClick={onDeleteWorkspace}\n size=\"sm\"\n variant=\"destructive\"\n >\n {labels.deleteWorkspace}\n </Button>\n }\n title={labels.deleteTitle}\n />\n </SettingsSection>\n )}\n </div>\n )\n}\n",
|
|
51
|
+
"target": "~/packages/ui/src/blocks/application/settings/workspace/settings-workspace-1/settings-workspace-1.tsx"
|
|
52
52
|
},
|
|
53
53
|
{
|
|
54
|
-
"path": "blocks/application/settings/
|
|
54
|
+
"path": "blocks/application/settings/workspace/settings-workspace-1/types.ts",
|
|
55
55
|
"type": "registry:file",
|
|
56
|
-
"content": "
|
|
57
|
-
"target": "~/packages/ui/src/blocks/application/settings/
|
|
56
|
+
"content": "import type { SettingsLoadLabels, SettingsLoadProps } from '../../shared/types'\nexport interface SettingsWorkspace1TimeZone {\n label: string\n value: string\n}\n\nexport interface SettingsWorkspace1Labels extends SettingsLoadLabels {\n dangerTitle: string\n deleteDescription: string\n deleteTitle: string\n deleteWorkspace: string\n logoDescription: string\n logoTitle: string\n nameLabel: string\n timeZoneDescription: string\n timeZoneLabel: string\n uploadLogo: string\n urlDescription: string\n urlLabel: string\n urlPrefix: string\n workspaceDescription: (name: string) => string\n workspaceTitle: string\n}\n\nexport interface SettingsWorkspace1Props extends SettingsLoadProps {\n className?: string\n initials: string\n labels?: Partial<SettingsWorkspace1Labels>\n name: string\n onDeleteWorkspace?: () => void\n onNameCommit?: (value: string) => void\n onSlugCommit?: (value: string) => void\n onTimeZoneChange?: (value: string) => void\n onUploadLogo?: () => void\n slug: string\n timeZone: string\n timeZones: SettingsWorkspace1TimeZone[]\n}\n",
|
|
57
|
+
"target": "~/packages/ui/src/blocks/application/settings/workspace/settings-workspace-1/types.ts"
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
60
|
"path": "patterns/surfaces/settings/composition/settings-row/settings-row.tsx",
|
|
@@ -1,66 +1,66 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "settings-
|
|
2
|
+
"name": "settings-workspace-2",
|
|
3
3
|
"type": "registry:block",
|
|
4
4
|
"files": [
|
|
5
5
|
{
|
|
6
|
-
"path": "blocks/application/settings/
|
|
6
|
+
"path": "blocks/application/settings/shared/labels.ts",
|
|
7
7
|
"type": "registry:file",
|
|
8
|
-
"content": "
|
|
9
|
-
"target": "~/packages/ui/src/blocks/application/settings/
|
|
8
|
+
"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",
|
|
9
|
+
"target": "~/packages/ui/src/blocks/application/settings/shared/labels.ts"
|
|
10
10
|
},
|
|
11
11
|
{
|
|
12
|
-
"path": "blocks/application/settings/settings-
|
|
12
|
+
"path": "blocks/application/settings/shared/settings-load-state.tsx",
|
|
13
13
|
"type": "registry:file",
|
|
14
|
-
"content": "import {
|
|
15
|
-
"target": "~/packages/ui/src/blocks/application/settings/settings-
|
|
14
|
+
"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",
|
|
15
|
+
"target": "~/packages/ui/src/blocks/application/settings/shared/settings-load-state.tsx"
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
|
-
"path": "blocks/application/settings/
|
|
18
|
+
"path": "blocks/application/settings/shared/settings-row-actions.tsx",
|
|
19
19
|
"type": "registry:file",
|
|
20
|
-
"content": "import {
|
|
21
|
-
"target": "~/packages/ui/src/blocks/application/settings/
|
|
20
|
+
"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",
|
|
21
|
+
"target": "~/packages/ui/src/blocks/application/settings/shared/settings-row-actions.tsx"
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
|
-
"path": "blocks/application/settings/
|
|
24
|
+
"path": "blocks/application/settings/shared/settings-skeleton.tsx",
|
|
25
25
|
"type": "registry:file",
|
|
26
|
-
"content": "import {
|
|
27
|
-
"target": "~/packages/ui/src/blocks/application/settings/
|
|
26
|
+
"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",
|
|
27
|
+
"target": "~/packages/ui/src/blocks/application/settings/shared/settings-skeleton.tsx"
|
|
28
28
|
},
|
|
29
29
|
{
|
|
30
|
-
"path": "blocks/application/settings/
|
|
30
|
+
"path": "blocks/application/settings/shared/types.ts",
|
|
31
31
|
"type": "registry:file",
|
|
32
|
-
"content": "
|
|
33
|
-
"target": "~/packages/ui/src/blocks/application/settings/
|
|
32
|
+
"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",
|
|
33
|
+
"target": "~/packages/ui/src/blocks/application/settings/shared/types.ts"
|
|
34
34
|
},
|
|
35
35
|
{
|
|
36
|
-
"path": "blocks/application/settings/
|
|
36
|
+
"path": "blocks/application/settings/workspace/settings-workspace-2/index.ts",
|
|
37
37
|
"type": "registry:file",
|
|
38
|
-
"content": "
|
|
39
|
-
"target": "~/packages/ui/src/blocks/application/settings/
|
|
38
|
+
"content": "export { SettingsWorkspace2 } from './settings-workspace-2'\nexport type {\n SettingsWorkspace2Invitation,\n SettingsWorkspace2InvitationAction,\n SettingsWorkspace2Labels,\n SettingsWorkspace2Member,\n SettingsWorkspace2MemberAction,\n SettingsWorkspace2Props,\n SettingsWorkspace2Role,\n SettingsWorkspace2Seats,\n} from './types'\n",
|
|
39
|
+
"target": "~/packages/ui/src/blocks/application/settings/workspace/settings-workspace-2/index.ts"
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
|
-
"path": "blocks/application/settings/
|
|
42
|
+
"path": "blocks/application/settings/workspace/settings-workspace-2/labels.ts",
|
|
43
43
|
"type": "registry:file",
|
|
44
|
-
"content": "import {
|
|
45
|
-
"target": "~/packages/ui/src/blocks/application/settings/
|
|
44
|
+
"content": "import { defaultSettingsLoadLabels } from '../../shared/labels'\nimport type { SettingsWorkspace2Labels } from './types'\n\nexport const defaultSettingsWorkspace2Labels: SettingsWorkspace2Labels = {\n ...defaultSettingsLoadLabels,\n errorTitle: 'Não foi possível carregar os membros',\n loading: 'Carregando membros',\n actions: (name) => `Ações de ${name}`,\n invitationMeta: (role, sent) => `${role} · Enviado ${sent}`,\n invitationsTitle: 'Convites pendentes',\n invite: 'Convidar membros',\n memberRole: (name) => `Papel de ${name}`,\n owner: 'Proprietário',\n pending: 'Pendente',\n removeMember: 'Remover do workspace',\n resendInvitation: 'Reenviar convite',\n revokeInvitation: 'Revogar convite',\n seats: (used, limit, plan) =>\n `${used} de ${limit} vagas usadas no plano ${plan}.`,\n title: 'Membros',\n}\n",
|
|
45
|
+
"target": "~/packages/ui/src/blocks/application/settings/workspace/settings-workspace-2/labels.ts"
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
|
-
"path": "blocks/application/settings/
|
|
48
|
+
"path": "blocks/application/settings/workspace/settings-workspace-2/settings-workspace-2-skeleton.tsx",
|
|
49
49
|
"type": "registry:file",
|
|
50
|
-
"content": "import {
|
|
51
|
-
"target": "~/packages/ui/src/blocks/application/settings/
|
|
50
|
+
"content": "import { SettingsRowsSkeleton } from '../../shared/settings-skeleton'\n\nexport function SettingsWorkspace2Skeleton() {\n return <SettingsRowsSkeleton count={4} start=\"avatar\" end=\"select\" />\n}\n",
|
|
51
|
+
"target": "~/packages/ui/src/blocks/application/settings/workspace/settings-workspace-2/settings-workspace-2-skeleton.tsx"
|
|
52
52
|
},
|
|
53
53
|
{
|
|
54
|
-
"path": "blocks/application/settings/
|
|
54
|
+
"path": "blocks/application/settings/workspace/settings-workspace-2/settings-workspace-2.tsx",
|
|
55
55
|
"type": "registry:file",
|
|
56
|
-
"content": "import {
|
|
57
|
-
"target": "~/packages/ui/src/blocks/application/settings/
|
|
56
|
+
"content": "import { Avatar, AvatarFallback } from '@tc96/ui/avatar'\nimport { Badge } from '@tc96/ui/badge'\nimport { Button } from '@tc96/ui/button'\nimport { SettingsRow } from '@tc96/ui/patterns/surfaces/settings/composition/settings-row/settings-row'\nimport { SettingsSection } from '@tc96/ui/patterns/surfaces/settings/composition/settings-section/settings-section'\nimport {\n SettingsSectionDescription,\n SettingsSectionHeader,\n SettingsSectionTitle,\n} from '@tc96/ui/patterns/surfaces/settings/composition/settings-section/settings-section-header'\nimport {\n Select,\n SelectItem,\n SelectPopup,\n SelectTrigger,\n SelectValue,\n} from '@tc96/ui/select'\nimport { Text } from '@tc96/ui/text'\nimport { cn } from '@tc96/utils'\nimport { useState } from 'react'\nimport { settingsLoadState } from '../../shared/settings-load-state'\nimport { SettingsRowActions } from '../../shared/settings-row-actions'\nimport { defaultSettingsWorkspace2Labels } from './labels'\nimport { SettingsWorkspace2Skeleton } from './settings-workspace-2-skeleton'\nimport type {\n SettingsWorkspace2InvitationAction,\n SettingsWorkspace2Labels,\n SettingsWorkspace2Member,\n SettingsWorkspace2MemberAction,\n SettingsWorkspace2Props,\n SettingsWorkspace2Role,\n} from './types'\n\ninterface MemberRowProps {\n labels: SettingsWorkspace2Labels\n member: SettingsWorkspace2Member\n onMemberAction?: SettingsWorkspace2Props['onMemberAction']\n onRoleChange?: SettingsWorkspace2Props['onRoleChange']\n owner: boolean\n roles: SettingsWorkspace2Role[]\n}\n\nfunction MemberRow({\n labels,\n member,\n onMemberAction,\n onRoleChange,\n owner,\n roles,\n}: Readonly<MemberRowProps>) {\n const [role, setRole] = useState(member.role)\n\n return (\n <SettingsRow\n description={member.email}\n endSlot={\n owner ? (\n <Text\n foreground=\"muted\"\n render={<span>{labels.owner}</span>}\n size=\"sm\"\n />\n ) : (\n <div className=\"flex items-center gap-3\">\n <Select\n items={roles}\n onValueChange={(next) => {\n if (!next) return\n setRole(next)\n onRoleChange?.(member.id, next)\n }}\n value={role}\n >\n <SelectTrigger\n aria-label={labels.memberRole(member.name)}\n className=\"w-32\"\n >\n <SelectValue />\n </SelectTrigger>\n <SelectPopup>\n {roles.map((option) => (\n <SelectItem key={option.value} value={option.value}>\n {option.label}\n </SelectItem>\n ))}\n </SelectPopup>\n </Select>\n {onMemberAction ? (\n <SettingsRowActions\n actions={[\n {\n destructive: true,\n id: 'remove',\n label: labels.removeMember,\n },\n ]}\n label={labels.actions(member.name)}\n onAction={(action) =>\n onMemberAction(\n member.id,\n action as SettingsWorkspace2MemberAction,\n )\n }\n />\n ) : null}\n </div>\n )\n }\n startSlot={\n <Avatar>\n <AvatarFallback>{member.initials}</AvatarFallback>\n </Avatar>\n }\n title={member.name}\n />\n )\n}\n\nexport function SettingsWorkspace2({\n error,\n onRetry,\n pending,\n className,\n invitations,\n labels: labelsProp,\n members,\n onInvitationAction,\n onInvite,\n onMemberAction,\n onRoleChange,\n ownerRole = 'owner',\n roles,\n seats,\n}: Readonly<SettingsWorkspace2Props>) {\n const labels = { ...defaultSettingsWorkspace2Labels, ...labelsProp }\n const loadState = settingsLoadState({\n error,\n labels,\n onRetry,\n pending,\n skeleton: <SettingsWorkspace2Skeleton />,\n })\n const roleLabel = (role: string) =>\n roles.find((option) => option.value === role)?.label ?? role\n\n return (\n <div\n className={cn('mx-auto flex w-full max-w-2xl flex-col gap-8', className)}\n >\n <SettingsSection\n header={\n <SettingsSectionHeader\n actions={\n onInvite ? (\n <Button onClick={onInvite} size=\"sm\">\n {labels.invite}\n </Button>\n ) : undefined\n }\n >\n <SettingsSectionTitle>{labels.title}</SettingsSectionTitle>\n {seats ? (\n <SettingsSectionDescription>\n {labels.seats(members.length, seats.limit, seats.plan)}\n </SettingsSectionDescription>\n ) : null}\n </SettingsSectionHeader>\n }\n >\n {loadState ??\n members.map((member) => (\n <MemberRow\n key={member.id}\n labels={labels}\n member={member}\n onMemberAction={onMemberAction}\n onRoleChange={onRoleChange}\n owner={member.role === ownerRole}\n roles={roles}\n />\n ))}\n </SettingsSection>\n {!loadState && invitations.length > 0 ? (\n <SettingsSection\n header={\n <SettingsSectionHeader>\n <SettingsSectionTitle>\n {labels.invitationsTitle}\n </SettingsSectionTitle>\n </SettingsSectionHeader>\n }\n >\n {invitations.map((invitation) => (\n <SettingsRow\n description={labels.invitationMeta(\n roleLabel(invitation.role),\n invitation.sent,\n )}\n endSlot={\n <div className=\"flex items-center gap-3\">\n <Badge variant=\"outline\">{labels.pending}</Badge>\n {onInvitationAction ? (\n <SettingsRowActions\n actions={[\n { id: 'resend', label: labels.resendInvitation },\n {\n destructive: true,\n id: 'revoke',\n label: labels.revokeInvitation,\n },\n ]}\n label={labels.actions(invitation.email)}\n onAction={(action) =>\n onInvitationAction(\n invitation.id,\n action as SettingsWorkspace2InvitationAction,\n )\n }\n />\n ) : null}\n </div>\n }\n key={invitation.id}\n title={invitation.email}\n />\n ))}\n </SettingsSection>\n ) : null}\n </div>\n )\n}\n",
|
|
57
|
+
"target": "~/packages/ui/src/blocks/application/settings/workspace/settings-workspace-2/settings-workspace-2.tsx"
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
|
-
"path": "blocks/application/settings/
|
|
60
|
+
"path": "blocks/application/settings/workspace/settings-workspace-2/types.ts",
|
|
61
61
|
"type": "registry:file",
|
|
62
|
-
"content": "
|
|
63
|
-
"target": "~/packages/ui/src/blocks/application/settings/
|
|
62
|
+
"content": "import type { SettingsLoadLabels, SettingsLoadProps } from '../../shared/types'\nexport interface SettingsWorkspace2Role {\n label: string\n value: string\n}\n\nexport interface SettingsWorkspace2Member {\n email: string\n id: string\n initials: string\n name: string\n role: string\n}\n\nexport interface SettingsWorkspace2Invitation {\n email: string\n id: string\n role: string\n sent: string\n}\n\nexport interface SettingsWorkspace2Seats {\n limit: number\n plan: string\n}\n\nexport type SettingsWorkspace2MemberAction = 'remove'\n\nexport type SettingsWorkspace2InvitationAction = 'resend' | 'revoke'\n\nexport interface SettingsWorkspace2Labels extends SettingsLoadLabels {\n actions: (name: string) => string\n invitationMeta: (role: string, sent: string) => string\n invitationsTitle: string\n invite: string\n memberRole: (name: string) => string\n owner: string\n pending: string\n removeMember: string\n resendInvitation: string\n revokeInvitation: string\n seats: (used: number, limit: number, plan: string) => string\n title: string\n}\n\nexport interface SettingsWorkspace2Props extends SettingsLoadProps {\n className?: string\n invitations: SettingsWorkspace2Invitation[]\n labels?: Partial<SettingsWorkspace2Labels>\n members: SettingsWorkspace2Member[]\n onInvitationAction?: (\n invitationId: string,\n action: SettingsWorkspace2InvitationAction,\n ) => void\n onInvite?: () => void\n onMemberAction?: (\n memberId: string,\n action: SettingsWorkspace2MemberAction,\n ) => void\n onRoleChange?: (memberId: string, role: string) => void\n ownerRole?: string\n roles: SettingsWorkspace2Role[]\n seats?: SettingsWorkspace2Seats\n}\n",
|
|
63
|
+
"target": "~/packages/ui/src/blocks/application/settings/workspace/settings-workspace-2/types.ts"
|
|
64
64
|
},
|
|
65
65
|
{
|
|
66
66
|
"path": "patterns/surfaces/settings/composition/settings-row/settings-row.tsx",
|