@ffid-br/tailor-ui 0.16.0 → 0.18.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 CHANGED
@@ -370,14 +370,14 @@ Num botão da cor da marca, troque a cor do ponto do loader: `className="[--tail
370
370
 
371
371
  ## Ícones dos apps e entrada entre apps
372
372
 
373
- Cada app tem um ícone (o favicon) e um nome, num registro só (`TAILOR_APPS`): `accounts` (Conta, C), `crm` (CRM, R), `pilot` (Marketing, M), `bi` (BI, B), `genius` (Genius, G) e `nr1` (NR1, N). A diferença é a letra primeiro e a cor depois, na grade 8x8 com o ponto verde logo depois da letra; em 16px nenhum par se confunde. O mesmo registro alimenta o launcher, a barra lateral e a transição.
373
+ Cada app tem um ícone (o favicon) e um nome, num registro só (`TAILOR_APPS`): `accounts` (Accounts, C), `crm` (Studio, R), `pilot` (Pilot, M), `bi` (BI, B), `genius` (Gestão, G) e `nr1` (NR1, N). A diferença é a letra primeiro e a cor depois, na grade 8x8 com o ponto verde logo depois da letra; em 16px nenhum par se confunde. O mesmo registro alimenta o launcher, a barra lateral e a transição.
374
374
 
375
375
  ```tsx
376
376
  import { TailorAppIcon, appPorChave, tailorTitle } from '@ffid-br/tailor-ui';
377
377
 
378
378
  <TailorAppIcon app="pilot" size={34} /> {/* também aceita a chave do /clients/uses: "gpt", "ffid.ai.studio" */}
379
- appPorChave('gpt')?.nome; // "Genius"
380
- document.title = tailorTitle('pilot', 'Campanhas'); // "Campanhas | Marketing | Tailor.ia"
379
+ appPorChave('gpt')?.nome; // "Gestão"
380
+ document.title = tailorTitle('pilot', 'Campanhas'); // "Campanhas | Pilot | Tailor.ia"
381
381
  ```
382
382
 
383
383
  **Título da aba:** `<Página> | <App> | Tailor.ia` (sem página: `<App> | Tailor.ia`). Com várias abas o navegador corta o título e sobra o começo: quem separa um app do outro é o ícone, não o texto.
@@ -407,7 +407,28 @@ const [recusou, setRecusou] = useState(false);
407
407
  - `falhou`: troca o loader por "Não foi possível entrar" e a ação "Entrar de novo".
408
408
  - `timeoutMs` (13000): sem resposta nesse tempo, avisa que está demorando e oferece a mesma ação.
409
409
  - `sidebar`: `expandida` (padrão), `recolhida` ou `nenhuma`; `breakpoint`: `lg` (padrão) ou `md`, o mesmo da `TailorSidebar`.
410
- - `TailorHandoffSaida app="crm" ativo`: avisinho "Abrindo CRM" no canto do app de origem, para o clique no launcher.
410
+ - `TailorHandoffSaida app="crm" ativo`: avisinho "Abrindo Studio" no canto (`rotulo` troca o texto) do app de origem, para o clique no launcher.
411
+
412
+ ### `TailorAppLauncher`: o seletor de apps
413
+
414
+ Um botão de grade e o painel com os apps da conta, cada um com o ícone e o nome do `TAILOR_APPS` (chave sem registro cai na inicial). O app atual vem marcado ("Você está aqui") e não é link. Fecha com Esc (o foco volta ao botão), clique fora ou Tab para fora; no celular o painel respeita a margem de 16px. Sem dependência: estado, `focusin` e posição fixa calculada do botão.
415
+
416
+ ```tsx
417
+ import { TailorAppLauncher } from '@ffid-br/tailor-ui';
418
+
419
+ <TailorAppLauncher
420
+ apps={products.map((p) => ({ chave: p.key, url: p.url }))} // do /clients/uses
421
+ atual="pilot"
422
+ carregando={loading}
423
+ montarUrl={(url) => buildSsoUrl(url)} // opcional, pode ser async
424
+ posicao="direita" // botão na barra lateral
425
+ />
426
+ ```
427
+
428
+ - `montarUrl`: chamada no clique. A aba abre na hora (`window.open('about:blank')`, `opener = null`) e a location troca quando a URL chega, para o navegador não bloquear como popup; se a aba não abrir, usa `location.assign`. Enquanto isso aparece o `TailorHandoffSaida`. Se `montarUrl` falhar, abre a URL sem token. Sem `montarUrl`, é um link `target="_blank"` comum.
429
+ - `posicao`: `baixo-fim` (padrão), `baixo-inicio` ou `direita` (barra lateral).
430
+ - `carregando`: esqueleto no painel. Sem apps e sem `carregando`, não renderiza nada.
431
+ - Duas chaves do mesmo app (`crm` e `ffid.ai.studio`) viram um item só.
411
432
 
412
433
  ## Receita: transição login → app
413
434
 
@@ -491,6 +512,11 @@ Gatilho com contador verde das não vistas (9+); abrir marca como visto (localSt
491
512
 
492
513
  ## Mudanças
493
514
 
515
+ ### 0.18.0
516
+
517
+ - `TailorAppLauncher`: o seletor de apps padrão (ver "Ícones dos apps e entrada entre apps").
518
+ - O Genius passa a se chamar **Gestão** no registro (`TAILOR_APPS.genius.nome`): launcher, `tailorTitle` ("... | Gestão | Tailor.ia") e o ícone (SVG regerado). A chave `genius` e as chaves de produto `gpt`/`genius` não mudam.
519
+
494
520
  ### 0.16.0
495
521
 
496
522
  Espaçamento na escala da marca (4/8/16/24/40/64/104 px, `--tailor-space-*`). **Mudança visual intencional.** Empilha no 0.15.0.
@@ -1,4 +1,4 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="32" height="32" shape-rendering="crispEdges" role="img" aria-label="Conta">
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="32" height="32" shape-rendering="crispEdges" role="img" aria-label="Accounts">
2
2
  <rect width="32" height="32" fill="#000000"/>
3
3
  <path d="M8 4h4v4h-4zM12 4h4v4h-4zM16 4h4v4h-4zM20 4h4v4h-4zM4 8h4v4h-4zM4 12h4v4h-4zM4 16h4v4h-4zM8 20h4v4h-4zM12 20h4v4h-4zM16 20h4v4h-4zM20 20h4v4h-4z" fill="#FFFFFF"/>
4
4
  <rect x="24" y="24" width="4" height="4" fill="#90F208"/>
@@ -1,4 +1,4 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="32" height="32" shape-rendering="crispEdges" role="img" aria-label="CRM">
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="32" height="32" shape-rendering="crispEdges" role="img" aria-label="Studio">
2
2
  <rect width="32" height="32" fill="#90F208"/>
3
3
  <path d="M4 4h4v4h-4zM8 4h4v4h-4zM12 4h4v4h-4zM16 4h4v4h-4zM4 8h4v4h-4zM20 8h4v4h-4zM4 12h4v4h-4zM8 12h4v4h-4zM12 12h4v4h-4zM16 12h4v4h-4zM4 16h4v4h-4zM16 16h4v4h-4zM4 20h4v4h-4zM20 20h4v4h-4z" fill="#000000"/>
4
4
  <rect x="24" y="24" width="4" height="4" fill="#000000"/>
@@ -1,4 +1,4 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="32" height="32" shape-rendering="crispEdges" role="img" aria-label="Genius">
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="32" height="32" shape-rendering="crispEdges" role="img" aria-label="Gestão">
2
2
  <rect width="32" height="32" fill="#000000"/>
3
3
  <path d="M8 4h4v4h-4zM12 4h4v4h-4zM16 4h4v4h-4zM20 4h4v4h-4zM4 8h4v4h-4zM4 12h4v4h-4zM12 12h4v4h-4zM16 12h4v4h-4zM20 12h4v4h-4zM4 16h4v4h-4zM20 16h4v4h-4zM8 20h4v4h-4zM12 20h4v4h-4zM16 20h4v4h-4zM20 20h4v4h-4z" fill="#90F208"/>
4
4
  <rect x="24" y="24" width="4" height="4" fill="#FFFFFF"/>
@@ -1,4 +1,4 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="32" height="32" shape-rendering="crispEdges" role="img" aria-label="Marketing">
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="32" height="32" shape-rendering="crispEdges" role="img" aria-label="Pilot">
2
2
  <rect width="32" height="32" fill="#3C6600"/>
3
3
  <path d="M4 4h4v4h-4zM20 4h4v4h-4zM4 8h4v4h-4zM8 8h4v4h-4zM16 8h4v4h-4zM20 8h4v4h-4zM4 12h4v4h-4zM12 12h4v4h-4zM20 12h4v4h-4zM4 16h4v4h-4zM20 16h4v4h-4zM4 20h4v4h-4zM20 20h4v4h-4z" fill="#FFFFFF"/>
4
4
  <rect x="24" y="24" width="4" height="4" fill="#90F208"/>