@softize/opus 30.0.0 → 31.1.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/CHANGELOG.md +123 -0
- package/bin/lib/check.mjs +109 -101
- package/bin/lib/copy.mjs +2973 -1801
- package/docs/adr/0043-neutral-surfaces-and-interactions-use-opaque-role-tokens.md +52 -0
- package/docs/adr/0044-neutral-appearance-derives-from-bounded-axes-per-mode.md +27 -2
- package/docs/adr/0060-surface-composition-separates-chrome-and-intro.md +142 -0
- package/docs/adr/0064-action-list-com-itens-e-fontes-externas.md +47 -0
- package/docs/adr/0065-presentation-composes-settings-sections.md +295 -0
- package/docs/adr/0066-civil-date-input-and-calendar-list.md +28 -0
- package/docs/adr/README.md +6 -0
- package/package.json +1 -1
- package/registry/skills/build-opus-ui/SKILL.md +21 -19
- package/registry/skills/build-opus-ui/references/evaluations.md +13 -11
- package/registry/skills/build-opus-ui/references/ui-patterns.md +24 -27
- package/src/core/presentation.ts +938 -32
- package/src/core/types.ts +2 -0
- package/src/ui/components/patterns/form.tsx +22 -1
- package/src/ui/components/patterns/grouped-list.ts +2 -2
- package/src/ui/components/patterns/list-calendar.tsx +129 -0
- package/src/ui/components/patterns/list.tsx +612 -382
- package/src/ui/components/patterns/page-heading-context.tsx +12 -5
- package/src/ui/components/patterns/page.tsx +227 -197
- package/src/ui/components/patterns/presentation-fields.tsx +246 -0
- package/src/ui/components/patterns/presentation-sections.tsx +494 -0
- package/src/ui/components/patterns/presentation.tsx +1142 -229
- package/src/ui/components/patterns/structural-header.tsx +23 -32
- package/src/ui/components/patterns/surface-anatomy.ts +27 -217
- package/src/ui/components/patterns/surface.tsx +19 -29
- package/src/ui/components/patterns/trigger.tsx +10 -2
- package/src/ui/components/primitives/calendar.tsx +39 -18
- package/src/ui/components/primitives/close-button.tsx +11 -3
- package/src/ui/components/primitives/command.tsx +2 -8
- package/src/ui/components/primitives/date-input.tsx +276 -0
- package/src/ui/components/primitives/detail.tsx +1 -1
- package/src/ui/components/primitives/dialog.tsx +19 -81
- package/src/ui/components/primitives/drawer.tsx +17 -79
- package/src/ui/components/primitives/field.tsx +1 -1
- package/src/ui/components/primitives/pagination.tsx +3 -2
- package/src/ui/components/primitives/table.tsx +1 -1
- package/src/ui/components/primitives/tabs.tsx +13 -2
- package/src/ui/docs/content/action-form.md +6 -1
- package/src/ui/docs/content/action-list.md +156 -68
- package/src/ui/docs/content/action-trigger.md +5 -0
- package/src/ui/docs/content/button.md +5 -6
- package/src/ui/docs/content/calendar-month-view.md +50 -0
- package/src/ui/docs/content/calendar.md +6 -1
- package/src/ui/docs/content/command.md +62 -50
- package/src/ui/docs/content/compositions.md +129 -459
- package/src/ui/docs/content/date-input.md +67 -0
- package/src/ui/docs/content/dialog.md +44 -112
- package/src/ui/docs/content/drawer.md +44 -103
- package/src/ui/docs/content/field.md +2 -1
- package/src/ui/docs/content/input.md +3 -0
- package/src/ui/docs/content/page.md +204 -412
- package/src/ui/docs/content/presentation.md +371 -23
- package/src/ui/docs/content/separator.md +1 -1
- package/src/ui/docs/content/surface.md +65 -120
- package/src/ui/docs/content/tokens.md +18 -4
- package/src/ui/docs/registry.tsx +38 -9
- package/src/ui/drivers/context.tsx +11 -4
- package/src/ui/drivers/react.tsx +27 -7
- package/src/ui/meta.ts +17 -6
- package/src/ui/react.tsx +41 -8
- package/src/ui/theme.css +44 -33
|
@@ -11,13 +11,21 @@ escolher um valor em um formulário, use [`Select`](/ui/select).
|
|
|
11
11
|
<CommandList>
|
|
12
12
|
<CommandEmpty>Nada encontrado.</CommandEmpty>
|
|
13
13
|
<CommandGroup heading="Sessões">
|
|
14
|
-
<CommandItem
|
|
15
|
-
|
|
14
|
+
<CommandItem>
|
|
15
|
+
<FolderGit2 /> Onboarding do faturamento
|
|
16
|
+
</CommandItem>
|
|
17
|
+
<CommandItem>
|
|
18
|
+
<FolderGit2 /> Integração com o ERP
|
|
19
|
+
</CommandItem>
|
|
16
20
|
</CommandGroup>
|
|
17
21
|
<CommandSeparator />
|
|
18
22
|
<CommandGroup heading="Ações">
|
|
19
|
-
<CommandItem
|
|
20
|
-
|
|
23
|
+
<CommandItem>
|
|
24
|
+
<Plus /> Criar sessão <CommandShortcut>⌘N</CommandShortcut>
|
|
25
|
+
</CommandItem>
|
|
26
|
+
<CommandItem>
|
|
27
|
+
<Play /> Iniciar ambiente
|
|
28
|
+
</CommandItem>
|
|
21
29
|
</CommandGroup>
|
|
22
30
|
</CommandList>
|
|
23
31
|
</Command>
|
|
@@ -26,23 +34,23 @@ escolher um valor em um formulário, use [`Select`](/ui/select).
|
|
|
26
34
|
## Paleta de comandos em modal
|
|
27
35
|
|
|
28
36
|
`CommandDialog` apresenta a mesma lista dentro de um [`Dialog`](/ui/dialog), com um cabeçalho
|
|
29
|
-
|
|
37
|
+
padrão que mostra o título e o botão de fechar. A descrição fica disponível somente para
|
|
30
38
|
tecnologias assistivas. O componente não registra atalho de teclado: para abrir a paleta com
|
|
31
39
|
⌘K, o aplicativo escuta o evento e altera `open`, como no exemplo.
|
|
32
40
|
|
|
33
41
|
```tsx preview
|
|
34
|
-
const [open, setOpen] = useState(false)
|
|
42
|
+
const [open, setOpen] = useState(false);
|
|
35
43
|
|
|
36
44
|
useEffect(() => {
|
|
37
45
|
const onKeyDown = (event: KeyboardEvent): void => {
|
|
38
|
-
if (event.key.toLowerCase() ===
|
|
39
|
-
event.preventDefault()
|
|
40
|
-
setOpen((current) => !current)
|
|
46
|
+
if (event.key.toLowerCase() === "k" && (event.metaKey || event.ctrlKey)) {
|
|
47
|
+
event.preventDefault();
|
|
48
|
+
setOpen((current) => !current);
|
|
41
49
|
}
|
|
42
|
-
}
|
|
43
|
-
document.addEventListener(
|
|
44
|
-
return () => document.removeEventListener(
|
|
45
|
-
}, [])
|
|
50
|
+
};
|
|
51
|
+
document.addEventListener("keydown", onKeyDown);
|
|
52
|
+
return () => document.removeEventListener("keydown", onKeyDown);
|
|
53
|
+
}, []);
|
|
46
54
|
|
|
47
55
|
render(
|
|
48
56
|
<>
|
|
@@ -54,63 +62,67 @@ render(
|
|
|
54
62
|
<CommandList>
|
|
55
63
|
<CommandEmpty>Nada encontrado.</CommandEmpty>
|
|
56
64
|
<CommandGroup heading="IA">
|
|
57
|
-
<CommandItem onSelect={() => setOpen(false)}
|
|
58
|
-
|
|
65
|
+
<CommandItem onSelect={() => setOpen(false)}>
|
|
66
|
+
<Bot /> Chamar agente
|
|
67
|
+
</CommandItem>
|
|
68
|
+
<CommandItem onSelect={() => setOpen(false)}>
|
|
69
|
+
<Sparkles /> Importar skill
|
|
70
|
+
</CommandItem>
|
|
59
71
|
</CommandGroup>
|
|
60
72
|
</CommandList>
|
|
61
73
|
</CommandDialog>
|
|
62
74
|
</>,
|
|
63
|
-
)
|
|
75
|
+
);
|
|
64
76
|
```
|
|
65
77
|
|
|
66
78
|
## Propriedades de Command
|
|
67
79
|
|
|
68
|
-
| Propriedade
|
|
69
|
-
|
|
70
|
-
| `shouldFilter`
|
|
71
|
-
| `filter`
|
|
72
|
-
| `value`
|
|
73
|
-
| `onValueChange` | `(value: string) => void`
|
|
74
|
-
| `loop`
|
|
75
|
-
| `label`
|
|
76
|
-
| `className`
|
|
80
|
+
| Propriedade | Tipo | Padrão | Descrição |
|
|
81
|
+
| --------------- | ---------------------------------------------------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------- |
|
|
82
|
+
| `shouldFilter` | `boolean` | `true` | Com `false`, desliga a filtragem e a ordenação automáticas; o aplicativo passa a renderizar somente os itens que correspondem à busca. |
|
|
83
|
+
| `filter` | `(value: string, search: string, keywords?: string[]) => number` | | Pontua cada item para a busca atual, de `0` (oculto) a `1` (melhor resultado). |
|
|
84
|
+
| `value` | `string` | | Item destacado no modo controlado. |
|
|
85
|
+
| `onValueChange` | `(value: string) => void` | | Chamado quando o item destacado muda. |
|
|
86
|
+
| `loop` | `boolean` | `false` | Faz as setas voltarem ao início ou ao fim da lista. |
|
|
87
|
+
| `label` | `string` | | Nome acessível do menu, sem exibição visual. |
|
|
88
|
+
| `className` | `string` | | Classes adicionais aplicadas à raiz. |
|
|
77
89
|
|
|
78
90
|
## Propriedades de CommandInput
|
|
79
91
|
|
|
80
|
-
| Propriedade
|
|
81
|
-
|
|
82
|
-
| `placeholder`
|
|
83
|
-
| `value`
|
|
84
|
-
| `onValueChange` | `(search: string) => void` |
|
|
85
|
-
| `disabled`
|
|
86
|
-
| `className`
|
|
92
|
+
| Propriedade | Tipo | Padrão | Descrição |
|
|
93
|
+
| --------------- | -------------------------- | ------- | ------------------------------------------------------------------------ |
|
|
94
|
+
| `placeholder` | `string` | | Texto exibido enquanto a busca está vazia. |
|
|
95
|
+
| `value` | `string` | | Texto da busca no modo controlado. |
|
|
96
|
+
| `onValueChange` | `(search: string) => void` | | Chamado quando o texto da busca muda. |
|
|
97
|
+
| `disabled` | `boolean` | `false` | Desabilita o campo de busca. |
|
|
98
|
+
| `className` | `string` | | Classes adicionais aplicadas ao campo; o ícone de busca fica no wrapper. |
|
|
87
99
|
|
|
88
100
|
## Propriedades de CommandDialog
|
|
89
101
|
|
|
90
|
-
| Propriedade
|
|
91
|
-
|
|
92
|
-
| `open`
|
|
93
|
-
| `onOpenChange`
|
|
94
|
-
| `title`
|
|
95
|
-
| `description`
|
|
96
|
-
| `showCloseButton` | `boolean`
|
|
97
|
-
| `className`
|
|
102
|
+
| Propriedade | Tipo | Padrão | Descrição |
|
|
103
|
+
| ----------------- | ------------------------- | ------------------------------------ | ------------------------------------------------------------------------------------- |
|
|
104
|
+
| `open` | `boolean` | | Estado do modal no modo controlado. |
|
|
105
|
+
| `onOpenChange` | `(open: boolean) => void` | | Atualiza o estado do modal; pode ser conectado ao atalho do aplicativo. |
|
|
106
|
+
| `title` | `string` | `'Paleta de comandos'` | Título exibido no header padrão; também nomeia o diálogo para tecnologias assistivas. |
|
|
107
|
+
| `description` | `string` | `'Busque um comando para executar…'` | Descrição disponível somente para tecnologias assistivas. |
|
|
108
|
+
| `showCloseButton` | `boolean` | `true` | Exibe o botão de fechamento. |
|
|
109
|
+
| `className` | `string` | | Classes do conteúdo do diálogo, como a largura. |
|
|
98
110
|
|
|
99
111
|
## Propriedades de CommandItem
|
|
100
112
|
|
|
101
|
-
| Propriedade | Tipo
|
|
102
|
-
|
|
103
|
-
| `onSelect`
|
|
104
|
-
| `value`
|
|
105
|
-
| `keywords`
|
|
106
|
-
| `disabled`
|
|
113
|
+
| Propriedade | Tipo | Padrão | Descrição |
|
|
114
|
+
| ----------- | ------------------------- | ------- | ----------------------------------------------------------------------------------------- |
|
|
115
|
+
| `onSelect` | `(value: string) => void` | | Chamado ao selecionar o item por clique ou teclado. |
|
|
116
|
+
| `value` | `string` | | Valor estável usado na busca e no destaque. Sem ele, o valor é inferido do texto do item. |
|
|
117
|
+
| `keywords` | `string[]` | | Termos adicionais considerados na busca. |
|
|
118
|
+
| `disabled` | `boolean` | `false` | Impede a seleção do item. |
|
|
107
119
|
|
|
108
120
|
## Propriedades de CommandGroup
|
|
109
121
|
|
|
110
|
-
| Propriedade | Tipo
|
|
111
|
-
|
|
112
|
-
| `heading`
|
|
113
|
-
| `value`
|
|
122
|
+
| Propriedade | Tipo | Padrão | Descrição |
|
|
123
|
+
| ----------- | ----------------- | ------ | -------------------------------------------------------------------- |
|
|
124
|
+
| `heading` | `React.ReactNode` | | Título exibido acima dos itens do grupo. |
|
|
125
|
+
| `value` | `string` | | Identificador do grupo; obrigatório e único quando não há `heading`. |
|
|
114
126
|
|
|
115
127
|
`CommandList` limita a altura a `18.75rem` e rola o excedente; `CommandEmpty` aparece somente quando
|
|
116
128
|
nenhum item corresponde à busca; `CommandSeparator` divide grupos; e `CommandShortcut` mostra, à
|