@brucesantos/design-space 0.6.0 → 0.9.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 (40) hide show
  1. package/CHANGELOG.md +264 -0
  2. package/README.md +249 -122
  3. package/dist/adapters/useScenarioData.d.ts +2 -0
  4. package/dist/controls/params.d.ts +13 -5
  5. package/dist/controls/state.d.ts +44 -11
  6. package/dist/deploy/index.d.ts +4 -4
  7. package/dist/design-space.css +1 -1
  8. package/dist/frame/index.d.ts +93 -0
  9. package/dist/handoff/index.d.ts +3 -2
  10. package/dist/index-DxIx4GAk.js +439 -0
  11. package/dist/index-DxIx4GAk.js.map +1 -0
  12. package/dist/index.d.ts +7 -10
  13. package/dist/index.js +2107 -1993
  14. package/dist/index.js.map +1 -1
  15. package/dist/registry/index.d.ts +115 -27
  16. package/dist/shell/Canvas.d.ts +19 -0
  17. package/dist/shell/FrameView.d.ts +9 -0
  18. package/dist/shell/Panel.d.ts +38 -0
  19. package/dist/shell/Resizer.d.ts +14 -0
  20. package/dist/shell/Sidebar.d.ts +15 -7
  21. package/dist/shell/Stage.d.ts +0 -20
  22. package/dist/shell/Topbar.d.ts +20 -12
  23. package/dist/shell/icons.d.ts +9 -0
  24. package/dist/shell/labels.d.ts +85 -119
  25. package/dist/shell/prMarkdown.d.ts +43 -0
  26. package/dist/shell/storage.d.ts +14 -0
  27. package/dist/testing/index.d.ts +9 -11
  28. package/dist/testing.js +20 -31
  29. package/dist/testing.js.map +1 -1
  30. package/dist/types/index.d.ts +115 -119
  31. package/dist/version.d.ts +2 -0
  32. package/package.json +3 -3
  33. package/dist/a11y/accessible-tree.d.ts +0 -37
  34. package/dist/a11y/contrast.d.ts +0 -62
  35. package/dist/a11y/useKeyboardMode.d.ts +0 -23
  36. package/dist/contrast-B8xa1UIu.js +0 -389
  37. package/dist/contrast-B8xa1UIu.js.map +0 -1
  38. package/dist/shell/Controls.d.ts +0 -11
  39. package/dist/shell/Home.d.ts +0 -12
  40. package/dist/shell/Inspector.d.ts +0 -13
@@ -1,17 +1,54 @@
1
- import { ComponentPreview, ComponentPreviewFixture, Fixture, Flow, HandoffScope, Module, Persona, ProductDefinition, Rule, Scenario, ScenarioStatus, ScenarioView } from '../types/index.js';
1
+ import { ComponentPreview, Control, ControlGroup, ComponentPreviewFixture, Fixture, HandoffScope, Persona, ProductDefinition, RouteDefinition, Rule, Scenario } from '../types/index.js';
2
2
  import { ValidationIssue } from './validate.js';
3
- export type ModuleNode = {
4
- module: Module;
5
- scenarios: Scenario[];
3
+ /**
4
+ * Uma tela: uma rota declarada e as variações dela.
5
+ *
6
+ * `variations` vazio é caso válido — a rota ainda é uma tela, aberta numa
7
+ * variação implícita, sem fixture.
8
+ */
9
+ export type ScreenNode = {
10
+ /** O `path` da rota. Estável e único, serve de identificador da tela. */
11
+ id: string;
12
+ /** `route.name`, ou o título do primeiro cenário, ou o `path`. */
13
+ name: string;
14
+ description: string | undefined;
15
+ route: RouteDefinition;
16
+ /**
17
+ * Caminho concreto para abrir a tela quando não há variação: o `path` com
18
+ * `*` removido. Parâmetros `:id` ficam literais.
19
+ */
20
+ href: string;
21
+ /** Cenários da rota, na ordem de `scenarios`. */
22
+ variations: Scenario[];
23
+ /** `route.group`, sem espaços nas pontas; `undefined` quando a tela não tem fluxo. */
24
+ group: string | undefined;
25
+ /** `route.controls`, ou lista vazia. */
26
+ controls: ControlGroup[];
27
+ };
28
+ /**
29
+ * Um fluxo: as telas que declaram o mesmo `route.group`, na ordem de `routes`.
30
+ * O fluxo sem nome reúne as telas sem `group` e vem sempre primeiro.
31
+ */
32
+ export type FlowNode = {
33
+ name: string | undefined;
34
+ screens: ScreenNode[];
35
+ };
36
+ /** Um valor de controle pedido pela URL que o motor não pôde usar. */
37
+ export type InvalidControl = {
38
+ id: string;
39
+ value: string;
40
+ /** `unknown-control`: a tela não tem esse controle. `invalid-value`: o valor não é uma das opções. */
41
+ reason: "unknown-control" | "invalid-value";
42
+ /** Valor usado no lugar, quando o controle existe. */
43
+ fallback?: string;
44
+ };
45
+ export type ControlResolution = {
46
+ /** Valor de cada controle da tela, na ordem declarada. */
47
+ values: Record<string, string>;
48
+ invalid: InvalidControl[];
6
49
  };
7
50
  export type ScenarioQueryOptions = {
8
- /** Coleção consultada. Padrão: trabalho ativo. */
9
- view?: ScenarioView;
10
- /** Inclui o catálogo completo. Reservado a diagnóstico e compatibilidade. */
11
- includePorted?: boolean;
12
- /** @deprecated Deep links agora inferem `view: "ported"`. */
13
- activeScenario?: string;
14
- /** Recorte de handoff aplicado depois da visão ativa/portada. */
51
+ /** Recorte de handoff. Sem ele, todo cenário registrado é visível. */
15
52
  handoff?: HandoffScope;
16
53
  };
17
54
  export type ComponentFixtureResolution = {
@@ -23,10 +60,8 @@ export type ComponentFixtureResolution = {
23
60
  };
24
61
  export type Registry = {
25
62
  product: ProductDefinition;
26
- /** Árvore de navegação: módulos com seus cenários, na ordem declarada. */
27
- tree: ModuleNode[];
28
- /** Cenários cujo prefixo não corresponde a nenhum módulo registrado. */
29
- orphans: Scenario[];
63
+ /** Telas na ordem de `routes`, cada uma com suas variações. */
64
+ screens: ScreenNode[];
30
65
  issues: ValidationIssue[];
31
66
  scenario: (id: string | undefined) => Scenario | undefined;
32
67
  component: (id: string | undefined) => ComponentPreview | undefined;
@@ -35,28 +70,81 @@ export type Registry = {
35
70
  persona: (id: string | undefined) => Persona | undefined;
36
71
  fixture: (id: string | undefined) => Fixture | undefined;
37
72
  rule: (id: string | undefined) => Rule | undefined;
38
- module: (id: string | undefined) => Module | undefined;
39
- flow: (id: string | undefined) => Flow | undefined;
73
+ /** Tela por id (o `path` da rota). */
74
+ screen: (id: string | undefined) => ScreenNode | undefined;
75
+ /** Tela que renderiza um endereço, pelo mesmo casamento do roteador. */
76
+ screenForPath: (path: string) => ScreenNode | undefined;
77
+ /** Tela da qual o cenário é variação. */
78
+ screenOf: (scenario: Scenario | undefined) => ScreenNode | undefined;
79
+ /** Telas permitidas pelo recorte, com variações também filtradas. */
80
+ screensFor: (options?: ScenarioQueryOptions) => ScreenNode[];
81
+ /** Telas permitidas pelo recorte, agrupadas por fluxo (`route.group`). */
82
+ flows: (options?: ScenarioQueryOptions) => FlowNode[];
83
+ /** O fluxo de uma tela, com as telas dele permitidas pelo recorte. */
84
+ flowOf: (screen: ScreenNode | undefined, options?: ScenarioQueryOptions) => FlowNode | undefined;
85
+ /** Controles da tela, na ordem dos grupos. */
86
+ controlsOf: (screen: ScreenNode | undefined) => Control[];
87
+ /**
88
+ * Valores dos controles da tela: o padrão de cada controle, depois o que o
89
+ * cenário fixa, depois o que a URL pede. Pedido inválido cai no valor de baixo
90
+ * e volta em `invalid`.
91
+ */
92
+ resolveControls: (screen: ScreenNode | undefined, input?: {
93
+ scenario?: Scenario;
94
+ requested?: Record<string, string>;
95
+ }) => ControlResolution;
40
96
  /** Regras de um cenário, resolvidas e na ordem declarada. */
41
97
  rulesOf: (scenario: Scenario | undefined) => Rule[];
42
98
  /** Permissões efetivas: as do cenário, ou as da persona quando ausentes. */
43
99
  permissionsOf: (scenario: Scenario | undefined) => string[];
44
- /** Cenários que abrem a mesma rota. Serve para o seletor de situação. */
100
+ /** Variações da tela que renderiza `route`. */
45
101
  scenariosForRoute: (route: string, options?: ScenarioQueryOptions) => Scenario[];
46
- /** Cenários da visão pedida; trabalho ativo é o padrão. */
102
+ /** Cenários permitidos pelo recorte; sem handoff devolve todos. */
47
103
  activeScenarios: (options?: ScenarioQueryOptions) => Scenario[];
48
- /** Árvore filtrada para navegação, preservando `tree` como catálogo completo. */
49
- treeFor: (options?: ScenarioQueryOptions) => ModuleNode[];
50
- orphansFor: (options?: ScenarioQueryOptions) => Scenario[];
51
104
  /**
52
- * Busca por vocabulário de negócio. Um PO precisa achar "aprovação bloqueada"
53
- * sem saber o id nem o nome do arquivo (§15.1 "Compreensão de negócio").
105
+ * Busca de cenário por vocabulário de negócio, sem diferenciar acento nem
106
+ * caixa: "aprovacao" acha "Aprovação".
54
107
  */
55
108
  search: (query: string, options?: ScenarioQueryOptions) => Scenario[];
56
- byStatus: (status: ScenarioStatus, options?: ScenarioQueryOptions) => Scenario[];
109
+ /** Busca de telas: nome, descrição, rota, fluxo e as variações de cada uma. */
110
+ searchScreens: (query: string, options?: ScenarioQueryOptions) => ScreenNode[];
111
+ /** Busca de componentes: nome, descrição, grupo, id e `source`. */
112
+ searchComponents: (query: string, handoff?: HandoffScope) => ComponentPreview[];
57
113
  /** Componentes permitidos pelo recorte; sem handoff devolve o catálogo. */
58
114
  componentsFor: (handoff?: HandoffScope) => ComponentPreview[];
59
- /** Contagem por status, para o cabeçalho de cobertura. */
60
- coverage: (options?: ScenarioQueryOptions) => Record<ScenarioStatus, number>;
115
+ /**
116
+ * Componentes usados por uma tela: `route.components` e depois a união de
117
+ * `components` das variações, na ordem em que aparecem. Id sem componente
118
+ * registrado fica de fora.
119
+ */
120
+ componentsOfScreen: (screen: ScreenNode | undefined, scenario?: Scenario) => ComponentPreview[];
121
+ /** Telas que listam o componente em `route.components` ou em um cenário. */
122
+ usagesOf: (componentId: string | undefined, options?: ScenarioQueryOptions) => ScreenNode[];
61
123
  };
62
124
  export declare function createRegistry(product: ProductDefinition): Registry;
125
+ /**
126
+ * Minúsculas sem acento e sem espaço nas pontas: "Aprovação" acha "aprovacao".
127
+ * A navegação usa exatamente a mesma regra do registry.
128
+ */
129
+ export declare function normalizeSearch(value: string): string;
130
+ /**
131
+ * Telas agrupadas por fluxo, na ordem em que cada fluxo aparece. As telas sem
132
+ * fluxo formam o primeiro grupo, sem nome.
133
+ */
134
+ export declare function groupScreens(screens: ScreenNode[]): FlowNode[];
135
+ /** Valor padrão de um controle: `default` quando é uma opção, senão a primeira. */
136
+ export declare function controlDefault(control: Control): string;
137
+ /**
138
+ * Resolve os valores de um conjunto de grupos de controles. Precedência, do mais
139
+ * fraco ao mais forte: padrão do controle, valor do cenário, pedido da URL. Um
140
+ * valor que não é opção do controle nunca é usado.
141
+ */
142
+ export declare function resolveScreenControls(groups: ControlGroup[], input?: {
143
+ scenario?: Scenario;
144
+ requested?: Record<string, string>;
145
+ }): ControlResolution;
146
+ /**
147
+ * `true` quando os valores atuais ainda são a combinação que o cenário fixa. É o
148
+ * que decide se o atalho aparece destacado depois de um controle mudar.
149
+ */
150
+ export declare function scenarioMatchesControls(scenario: Scenario | undefined, values: Record<string, string> | undefined): boolean;
@@ -0,0 +1,19 @@
1
+ import { DesignSpaceLocation } from '../controls/state.js';
2
+ import { FrameShortcut } from '../frame/index.js';
3
+ import { ViewportSetting } from '../types/index.js';
4
+ export type CanvasProps = {
5
+ location: DesignSpaceLocation;
6
+ viewport: ViewportSetting;
7
+ /**
8
+ * Zoom em porcentagem. Em 100 (o padrão), um viewport mais largo que a área
9
+ * central encolhe até caber; o valor efetivo volta por `onEffectiveZoom`.
10
+ */
11
+ zoom: number;
12
+ onEffectiveZoom?: (zoom: number) => void;
13
+ title: string;
14
+ /** Desliga o ponteiro no quadro enquanto uma lateral é arrastada. */
15
+ resizing: boolean;
16
+ onFrameNavigate: (url: string, replace: boolean) => void;
17
+ onShortcut: (key: FrameShortcut) => void;
18
+ };
19
+ export declare function Canvas({ location, viewport, zoom, title, resizing, onFrameNavigate, onShortcut, onEffectiveZoom, }: CanvasProps): import("react").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { ProductDefinition } from '../types/index.js';
2
+ import { Registry } from '../registry/index.js';
3
+ import { FrameShortcut } from '../frame/index.js';
4
+ export declare function FrameView({ product, registry }: {
5
+ product: ProductDefinition;
6
+ registry: Registry;
7
+ }): import("react").JSX.Element;
8
+ /** O atalho do chrome que este evento representa, se algum. */
9
+ export declare function frameShortcutOf(event: Pick<KeyboardEvent, "key" | "metaKey" | "ctrlKey" | "altKey" | "shiftKey">): FrameShortcut | undefined;
@@ -0,0 +1,38 @@
1
+ import { ComponentFixtureResolution, Registry, ScreenNode } from '../registry/index.js';
2
+ import { DeployContext } from '../deploy/index.js';
3
+ import { DesignSpaceLocation } from '../controls/state.js';
4
+ import { ComponentPreview, Control, ControlsState, PanelTab, Scenario } from '../types/index.js';
5
+ export type PanelProps = {
6
+ registry: Registry;
7
+ controls: ControlsState;
8
+ deploy: DeployContext;
9
+ /** Endereço aberto: é o link da tela aberta no "Copiar para o PR". */
10
+ location: DesignSpaceLocation;
11
+ screen: ScreenNode | undefined;
12
+ /** Cenário ativo quando ele é variação da tela aberta. */
13
+ variation: Scenario | undefined;
14
+ component: ComponentPreview | undefined;
15
+ componentFixture: ComponentFixtureResolution;
16
+ tab: PanelTab;
17
+ onTab: (tab: PanelTab) => void;
18
+ onOpenScenario: (scenarioId: string) => void;
19
+ onOpenComponent: (componentId: string) => void;
20
+ onChange: (patch: Partial<ControlsState>) => void;
21
+ width: number;
22
+ onResize: (width: number) => void;
23
+ onResizeStart: () => void;
24
+ onResizeEnd: () => void;
25
+ };
26
+ export declare function Panel(props: PanelProps): import("react").JSX.Element;
27
+ /**
28
+ * Até quatro opções curtas cabem como botões segmentados na largura do painel;
29
+ * acima disso, um select.
30
+ */
31
+ export declare function isSegmentedControl(control: Control): boolean;
32
+ /** Cmd/Ctrl+F: o filtro do painel no lugar da busca do navegador. */
33
+ export declare function isFilterShortcut(event: Pick<KeyboardEvent, "key" | "metaKey" | "ctrlKey" | "altKey" | "shiftKey">): boolean;
34
+ /**
35
+ * Esconde as linhas do painel que não casam com o filtro, sem diferenciar
36
+ * acento nem caixa. Devolve `true` quando o filtro não deixou nada visível.
37
+ */
38
+ export declare function applyFilter(root: HTMLElement | null, query: string): boolean;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Alça de redimensionamento das laterais. Arrasta com o ponteiro e responde às
3
+ * setas do teclado, de 16 em 16 px.
4
+ */
5
+ export type ResizerProps = {
6
+ /** Lado da lateral: a esquerda cresce para a direita, a direita, para a esquerda. */
7
+ side: "left" | "right";
8
+ label: string;
9
+ value: number;
10
+ onChange: (value: number) => void;
11
+ onStart?: () => void;
12
+ onEnd?: () => void;
13
+ };
14
+ export declare function Resizer({ side, label, value, onChange, onStart, onEnd }: ResizerProps): import("react").JSX.Element;
@@ -1,14 +1,22 @@
1
1
  import { Registry } from '../registry/index.js';
2
- import { ControlsState, Scenario, ScenarioView } from '../types/index.js';
2
+ import { ComponentPreview, HandoffScope } from '../types/index.js';
3
3
  export type SidebarProps = {
4
4
  registry: Registry;
5
- activeScenario: Scenario | undefined;
5
+ handoff: HandoffScope | undefined;
6
+ activeScreen: string | undefined;
6
7
  activeComponent: string | undefined;
7
- controls: ControlsState;
8
- onOpenScenario: (scenarioId: string) => void;
8
+ onOpenScreen: (screenId: string) => void;
9
9
  onOpenComponent: (componentId: string) => void;
10
- onViewChange: (view: ScenarioView) => void;
10
+ width: number;
11
+ onResize: (width: number) => void;
12
+ onResizeStart: () => void;
13
+ onResizeEnd: () => void;
11
14
  };
12
- export declare function Sidebar({ registry, activeScenario, activeComponent, controls, onOpenScenario, onOpenComponent, onViewChange, }: SidebarProps): import("react").JSX.Element;
15
+ export declare function Sidebar({ registry, handoff, activeScreen, activeComponent, onOpenScreen, onOpenComponent, width, onResize, onResizeStart, onResizeEnd, }: SidebarProps): import("react").JSX.Element;
16
+ /** Componentes agrupados por `group`, na ordem em que cada grupo aparece. */
17
+ export declare function groupComponents(components: ComponentPreview[], ungrouped: string): {
18
+ group: string;
19
+ items: ComponentPreview[];
20
+ }[];
21
+ /** Command/Ctrl + K, sem outros modificadores. */
13
22
  export declare function isSearchShortcut(event: Pick<KeyboardEvent, "key" | "metaKey" | "ctrlKey" | "altKey" | "shiftKey">): boolean;
14
- export declare function nextItemId(ids: string[], currentId: string | undefined, offset: number): string | undefined;
@@ -1,24 +1,4 @@
1
1
  import { ReactNode } from 'react';
2
- import { TabStop } from '../a11y/useKeyboardMode.js';
3
- import { ViewportSetting } from '../types/index.js';
4
- export type StageProps = {
5
- viewport: ViewportSetting;
6
- textScale: number;
7
- reducedMotion: boolean;
8
- keyboardMode: boolean;
9
- children: ReactNode;
10
- };
11
- export declare const Stage: import('react').ForwardRefExoticComponent<StageProps & import('react').RefAttributes<HTMLDivElement>>;
12
- /**
13
- * Numeração da ordem de tabulação sobreposta ao palco.
14
- *
15
- * O amarelo marca `tabindex` positivo, que fura a ordem natural do documento —
16
- * quase sempre um problema, e invisível de qualquer outra forma.
17
- */
18
- export declare function TabOrderOverlay({ stops }: {
19
- stops: TabStop[];
20
- }): import("react").JSX.Element | null;
21
- /** Estado vazio do palco: sem cenário ativo, ou rota sem cenário declarado. */
22
2
  export declare function StageEmpty({ title, children }: {
23
3
  title: string;
24
4
  children?: ReactNode;
@@ -1,16 +1,24 @@
1
1
  import { DeployContext } from '../deploy/index.js';
2
- import { ChromeTheme, HandoffScope, ProductDefinition, Scenario, ScenarioView } from '../types/index.js';
2
+ import { ValidationIssue } from '../registry/validate.js';
3
+ import { ChromeTheme, ViewportSetting } from '../types/index.js';
4
+ /** Degraus do zoom, como os de um navegador. */
5
+ export declare const ZOOM_STEPS: readonly [25, 33, 50, 67, 75, 90, 100, 110, 125, 150];
6
+ export declare function nextZoom(current: number, direction: 1 | -1): number;
3
7
  export type TopbarProps = {
4
- product: ProductDefinition;
5
- scenario: Scenario | undefined;
8
+ productName: string;
6
9
  deploy: DeployContext;
7
- inspectorOpen: boolean;
8
- chromeTheme: ChromeTheme;
9
- view: ScenarioView;
10
- handoff?: HandoffScope;
11
- onToggleInspector: () => void;
12
- onToggleChromeTheme: () => void;
10
+ viewportId: string;
11
+ viewport: ViewportSetting;
12
+ zoom: number;
13
+ rotated: boolean;
14
+ theme: ChromeTheme;
15
+ issues: ValidationIssue[];
16
+ /** URL absoluta do estado atual. */
17
+ linkUrl: string;
18
+ onViewport: (id: string) => void;
19
+ onRotate: () => void;
20
+ onZoom: (zoom: number) => void;
21
+ onCleanReview: () => void;
22
+ onToggleTheme: () => void;
13
23
  };
14
- export declare function Topbar({ product, scenario, deploy, inspectorOpen, chromeTheme, view, handoff, onToggleInspector, onToggleChromeTheme, }: TopbarProps): import("react").JSX.Element;
15
- export declare function buildCleanReviewUrl(href: string): string;
16
- export declare function buildHomeUrl(origin: string, chromeTheme: ChromeTheme, view?: ScenarioView, handoff?: HandoffScope): string;
24
+ export declare function Topbar({ productName, viewportId, viewport, zoom, rotated, theme, issues, linkUrl, onViewport, onRotate, onZoom, onCleanReview, onToggleTheme, }: TopbarProps): import("react").JSX.Element;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Ícones do chrome: traço simples, `currentColor`, 16px. Sem texto, sem cor.
3
+ * Todo ícone é decorativo; o nome acessível fica no botão que o contém.
4
+ */
5
+ export type IconName = "mobile" | "tablet" | "desktop" | "fit" | "rotate" | "minus" | "plus" | "link" | "check" | "fullscreen" | "sun" | "moon" | "panel" | "alert" | "chevron" | "search" | "copy";
6
+ export declare function Icon({ name, size }: {
7
+ name: IconName;
8
+ size?: number;
9
+ }): import("react").JSX.Element;
@@ -1,163 +1,135 @@
1
- import { KeyboardCoverage, NetworkState, ScenarioStatus } from '../types/index.js';
1
+ import { NetworkState } from '../types/index.js';
2
2
  export type Labels = {
3
- status: Record<ScenarioStatus, string>;
4
- statusMeaning: Record<ScenarioStatus, string>;
5
3
  network: Record<NetworkState, string>;
6
- keyboard: Record<KeyboardCoverage, string>;
7
4
  /** Rótulo de viewport por id: `fit`, `mobile`, `tablet`, `desktop`, `custom`. */
8
5
  viewport: Record<string, string>;
9
6
  topbar: {
10
- homeTitle: (product: string) => string;
11
- toggleNav: string;
7
+ region: string;
8
+ viewportGroup: string;
9
+ rotate: string;
10
+ zoomOut: string;
11
+ zoomIn: string;
12
+ zoomReset: string;
13
+ zoomValue: (percent: number) => string;
12
14
  copyLink: string;
13
15
  copied: string;
14
16
  copyPrompt: string;
15
17
  cleanReview: string;
16
- cleanReviewTitle: string;
17
- panel: string;
18
18
  lightMode: string;
19
19
  darkMode: string;
20
+ engineVersion: (version: string) => string;
21
+ diagnostics: (errors: number, warnings: number) => string;
20
22
  branchTitle: (branch: string) => string;
21
23
  commitTitle: (commit: string) => string;
22
24
  envTitle: (env: string) => string;
23
25
  };
24
26
  sidebar: {
25
27
  region: string;
26
- flowsTab: string;
28
+ tabs: string;
29
+ screensTab: string;
27
30
  componentsTab: string;
28
31
  searchPlaceholder: string;
29
32
  searchLabel: string;
30
- componentSearchPlaceholder: string;
31
- componentSearchLabel: string;
32
33
  searchShortcut: string;
33
34
  noMatch: (query: string) => string;
34
- matchCount: (total: number) => string;
35
- noComponentMatch: (query: string) => string;
36
- componentMatchCount: (total: number) => string;
37
- activeWork: string;
38
- portedReferences: (total: number) => string;
39
- viewPorted: (total: number) => string;
40
- backToActive: string;
41
- currentView: (view: string) => string;
42
- noActiveWork: string;
43
- noPortedReferences: string;
44
- /** @deprecated Mantido para overrides escritos para 0.4.0. */
45
- showPorted: string;
46
- /** @deprecated Deep links portados agora abrem a visão correspondente. */
47
- activePorted: string;
48
- /** @deprecated Grupos vazios não são mais renderizados. */
49
- emptyModule: string;
35
+ emptyScreens: string;
50
36
  emptyComponents: string;
51
- withoutModule: string;
52
- scope: string;
53
- scopeData: string;
54
- scopePersona: string;
55
- scopeNetwork: string;
37
+ ungrouped: string;
38
+ toggleGroup: (group: string) => string;
39
+ resize: string;
56
40
  };
57
- controls: {
41
+ panel: {
58
42
  region: string;
43
+ searchPlaceholder: string;
44
+ searchLabel: string;
45
+ searchShortcut: string;
46
+ noMatch: (query: string) => string;
47
+ tabs: string;
48
+ variationsTab: string;
49
+ infoTab: string;
50
+ resize: string;
51
+ variationsList: string;
52
+ defaultVariation: string;
53
+ defaultVariationHint: string;
54
+ noVariations: string;
55
+ noComponentVariations: string;
56
+ nothingSelected: string;
59
57
  persona: string;
60
- fixture: string;
61
- componentFixture: string;
62
58
  network: string;
63
- viewport: string;
64
- customWidth: string;
65
59
  theme: string;
66
60
  locale: string;
67
61
  dataSource: string;
68
62
  fixturesOption: string;
69
- a11y: string;
70
- keyboardMode: string;
71
- keyboardModeTitle: string;
72
- reducedMotion: string;
73
- reducedMotionTitle: string;
74
- textScale: string;
75
63
  none: string;
64
+ fixtureFallback: (requested: string, fallback: string) => string;
65
+ /** Título do bloco de persona, rede, tema, idioma e fonte de dados. */
66
+ context: string;
67
+ /** Título do bloco dos cenários da tela, depois dos controles. */
68
+ shortcuts: string;
69
+ toggleGroup: (group: string) => string;
70
+ openComponent: (component: string) => string;
76
71
  };
77
- inspector: {
78
- region: string;
79
- tabScenario: string;
80
- tabA11y: string;
81
- tabDiagnostics: string;
82
- diagnosticsWithErrors: (count: number) => string;
83
- noScenario: string;
84
- componentReference: string;
85
- componentGroup: string;
86
- componentFixture: string;
87
- componentFixtureDescription: string;
88
- componentFixtureFallback: (requested: string, fallback: string) => string;
89
- taskScope: string;
90
- taskScopeDescription: string;
91
- inheritedScope: string;
92
- inheritedScopeDescription: string;
93
- screenScope: string;
94
- screenScopeDescription: string;
95
- productScope: string;
96
- productScopeDescription: string;
97
- situation: string;
98
- reproduction: string;
72
+ info: {
73
+ screen: string;
74
+ variation: string;
75
+ component: string;
76
+ name: string;
99
77
  id: string;
78
+ group: string;
79
+ description: string;
80
+ source: string;
81
+ usedIn: string;
82
+ notUsed: string;
100
83
  route: string;
101
84
  persona: string;
102
- personaSwapped: string;
103
- data: string;
104
- network: string;
105
- goal: (goal: string) => string;
106
85
  permissions: string;
86
+ intent: string;
107
87
  preconditions: string;
108
- rules: string;
109
88
  actions: string;
110
89
  expected: string;
111
- approval: string;
112
- approvalPendingStatus: string;
113
- approvalPendingMeaning: string;
114
- approvalMissing: string;
115
- openApproved: string;
116
- engineering: string;
117
- a11yContract: string;
118
- keyboard: string;
119
- contrast: string;
120
- contrastTarget: (target: string) => string;
121
- announces: string;
122
- focusedElement: string;
123
- keyboardModeOff: string;
124
- pressTab: (tabStops: number) => string;
125
- role: string;
126
- name: string;
127
- noAccessibleName: string;
128
- nameFrom: string;
129
- description: string;
130
- selector: string;
131
- focusableButHidden: string;
132
- tabStopsInStage: (tabStops: number) => string;
133
- tokenContrast: string;
134
- noContrastPairs: string;
135
- pair: string;
136
- ratio: string;
137
- pairsFailing: (count: number) => string;
138
- automatedIsFloor: string;
139
- coverage: string;
140
- scenariosRegistered: (count: number) => string;
141
- scenarioContract: string;
90
+ rules: string;
91
+ components: string;
92
+ ticket: string;
93
+ flow: string;
94
+ controls: string;
95
+ copyForPr: string;
96
+ copiedForPr: string;
97
+ copyPrompt: string;
98
+ };
99
+ diagnostics: {
100
+ title: string;
142
101
  noIssues: string;
143
- diagnosticsProductNotice: string;
102
+ error: string;
103
+ warning: string;
104
+ close: string;
105
+ invalidControl: (id: string, value: string, fallback: string) => string;
106
+ unknownControl: (id: string, value: string) => string;
144
107
  };
145
- home: {
146
- lead: (total: number) => string;
147
- statusLegend: string;
148
- withoutModule: string;
149
- withoutModuleHint: string;
150
- emptyModule: string;
151
- keyboardBadge: string;
152
- noActiveWork: string;
153
- noPortedReferences: string;
108
+ /** Texto do markdown gerado por "Copiar para o PR". */
109
+ pr: {
110
+ variations: string;
111
+ components: string;
112
+ component: string;
113
+ source: string;
114
+ expected: string;
115
+ commit: (shortCommit: string) => string;
116
+ immutableLink: string;
117
+ noExpected: string;
118
+ empty: string;
119
+ open: string;
120
+ controls: string;
121
+ shortcuts: string;
122
+ defaultOption: string;
154
123
  };
155
124
  shell: {
156
125
  restoreChrome: string;
126
+ frameTitle: (product: string) => string;
157
127
  noRoute: string;
158
128
  noRouteHint: string;
159
129
  outsideHandoff: string;
160
130
  outsideHandoffHint: string;
131
+ empty: string;
132
+ emptyHint: string;
161
133
  };
162
134
  };
163
135
  /** Português. É o padrão, não uma obrigação. */
@@ -177,16 +149,10 @@ export declare function resolveLabels(override?: LabelsOverride): Labels;
177
149
  /**
178
150
  * Rótulos resolvidos, para o chrome inteiro.
179
151
  *
180
- * O padrão do contexto é o português, então `Home` e `Stage` — exportados e
181
- * montáveis fora do `DesignSpace` — continuam funcionando sem provider.
152
+ * O padrão do contexto é o português, então `StageEmpty` — exportado e
153
+ * montável fora do `DesignSpace` — continua funcionando sem provider.
182
154
  */
183
155
  export declare const LabelsContext: import('react').Context<Labels>;
184
156
  export declare function useLabels(): Labels;
185
- /** @deprecated Use `useLabels().status`, ou `DEFAULT_LABELS.status` fora de React. */
186
- export declare const STATUS_LABELS: Record<ScenarioStatus, string>;
187
- /** @deprecated Use `useLabels().statusMeaning`. */
188
- export declare const STATUS_MEANING: Record<ScenarioStatus, string>;
189
157
  /** @deprecated Use `useLabels().network`. */
190
158
  export declare const NETWORK_LABELS: Record<NetworkState, string>;
191
- /** @deprecated Use `useLabels().keyboard`. */
192
- export declare const KEYBOARD_LABELS: Record<KeyboardCoverage, string>;