@ffid-br/tailor-ui 0.13.0 → 0.14.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/dist/style.css CHANGED
@@ -291,6 +291,75 @@
291
291
  .tailor-result__description { font-size: 15px; line-height: 1.5; opacity: 0.8; }
292
292
  .tailor-result__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; }
293
293
 
294
+ /* TailorResult celebrate — painel Ink, check Lime e uma rajada curta de faíscas, uma vez. */
295
+ .tailor-result--celebrate { --tailor-result-color: var(--tailor-black); --tailor-result-text: var(--tailor-brand-primary); }
296
+ .tailor-result__burst { position: absolute; top: 50%; left: 50%; width: 0; height: 0; pointer-events: none; transform: translateY(-34px); }
297
+ .tailor-result__spark {
298
+ position: absolute; top: -3px; left: -3px; width: 6px; height: 6px; background: var(--tailor-brand-primary); opacity: 0;
299
+ animation: tailor-result-spark 0.7s var(--tailor-ease-out) 0.55s 1 both;
300
+ }
301
+ @keyframes tailor-result-spark {
302
+ 0% { opacity: 1; transform: rotate(var(--tailor-spark-angle)) translateY(-30px); }
303
+ 100% { opacity: 0; transform: rotate(var(--tailor-spark-angle)) translateY(-72px) scale(0.5); }
304
+ }
305
+
306
+ /* TailorExplain — "como ler esta tela": peso visual baixo, régua fina, sem card. */
307
+ .tailor-explain { font-family: var(--tailor-brand-body-font); color: var(--tailor-brand-text); border-left: 3px solid var(--tailor-brand-primary); padding-left: 13px; }
308
+ .tailor-explain__toggle {
309
+ display: inline-flex; align-items: center; gap: 8px; padding: 8px 0; min-height: 34px; border: 0; background: none; cursor: pointer;
310
+ font: inherit; font-size: 13px; font-weight: 500; color: var(--tailor-brand-text-muted);
311
+ }
312
+ .tailor-explain__toggle:hover { color: var(--tailor-brand-text); }
313
+ .tailor-explain__toggle:focus-visible, .tailor-explain__done:focus-visible { outline: 3px solid var(--tailor-brand-primary); outline-offset: 2px; }
314
+ .tailor-explain__chevron { width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform 0.2s var(--tailor-ease-out); }
315
+ .tailor-explain--open .tailor-explain__chevron { transform: rotate(45deg); }
316
+ .tailor-explain__body { display: grid; gap: 8px; padding: 0 0 13px; font-size: 14px; line-height: 1.6; max-width: 68ch; }
317
+ .tailor-explain__body > p { margin: 0; }
318
+ .tailor-explain__items { display: grid; gap: 8px; margin: 0; }
319
+ .tailor-explain__items dt { font-weight: 500; }
320
+ .tailor-explain__items dd { margin: 0; color: var(--tailor-brand-text-muted); }
321
+ .tailor-explain__done { justify-self: start; padding: 4px 0; border: 0; background: none; cursor: pointer; font: inherit; font-size: 13px; color: var(--tailor-brand-text); text-decoration: underline; text-underline-offset: 3px; }
322
+
323
+ /* TailorGlossary — termo sublinhado pontilhado; o balão fica fora do fluxo, sem empurrar o texto. */
324
+ .tailor-glossary { position: relative; display: inline; }
325
+ .tailor-glossary__term {
326
+ display: inline; padding: 0; border: 0; background: none; cursor: help; font: inherit; color: inherit;
327
+ text-decoration: underline dotted; text-underline-offset: 3px; border-radius: var(--tailor-brand-radius);
328
+ }
329
+ .tailor-glossary__term:focus-visible { outline: 3px solid var(--tailor-brand-primary); outline-offset: 2px; }
330
+ .tailor-glossary__tip {
331
+ position: absolute; left: 0; bottom: calc(100% + 6px); z-index: 30; width: max-content; max-width: min(260px, 80vw); padding: 8px 13px;
332
+ background: var(--tailor-black); color: var(--tailor-white); font: 400 13px/1.5 var(--tailor-brand-body-font); text-align: left;
333
+ border-radius: var(--tailor-brand-radius); visibility: hidden; opacity: 0; transition: opacity 0.15s var(--tailor-ease-out), visibility 0.15s;
334
+ }
335
+ .tailor-glossary__tip[data-open="true"] { visibility: visible; opacity: 1; }
336
+ :where(.dark, [data-theme="dark"]) .tailor-glossary__tip { background: var(--tailor-white); color: var(--tailor-black); }
337
+
338
+ /* TailorTour — véu, recorte do elemento e balão. */
339
+ .tailor-tour { position: fixed; inset: 0; z-index: 100; }
340
+ .tailor-tour__veil { position: fixed; inset: 0; background: rgb(0 0 0 / 0.55); }
341
+ .tailor-tour__spot { position: fixed; pointer-events: none; border: 2px solid var(--tailor-brand-primary); box-shadow: 0 0 0 9999px rgb(0 0 0 / 0.55); transition: all 0.2s var(--tailor-ease-out); }
342
+ .tailor-tour__card {
343
+ position: fixed; padding: 21px; background: var(--tailor-white); color: var(--tailor-brand-text); outline: none;
344
+ font-family: var(--tailor-brand-body-font); box-shadow: 0 8px 34px rgb(0 0 0 / 0.25); border-radius: var(--tailor-brand-radius);
345
+ }
346
+ :where(.dark, [data-theme="dark"]) .tailor-tour__card { background: var(--tailor-black); border: 1px solid var(--tailor-brand-border); }
347
+ .tailor-tour__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 13px; margin-bottom: 8px; }
348
+ .tailor-tour__title { margin: 0; font-family: var(--tailor-brand-heading-font); font-size: 18px; font-weight: var(--tailor-brand-heading-weight); line-height: 1.2; }
349
+ .tailor-tour__x { display: inline-flex; padding: 4px; border: 0; background: none; cursor: pointer; color: var(--tailor-brand-text-muted); }
350
+ .tailor-tour__x:hover { color: var(--tailor-brand-text); }
351
+ .tailor-tour__text { font-size: 15px; line-height: 1.6; }
352
+ .tailor-tour__foot { display: flex; align-items: center; justify-content: space-between; gap: 13px; margin-top: 21px; }
353
+ .tailor-tour__count { font-size: 13px; color: var(--tailor-brand-text-muted); }
354
+ .tailor-tour__nav { display: flex; gap: 8px; }
355
+ .tailor-tour__btn {
356
+ min-height: 34px; padding: 0 13px; border: 1px solid var(--tailor-brand-border); background: none; cursor: pointer; font: inherit; font-size: 14px;
357
+ color: var(--tailor-brand-text); border-radius: var(--tailor-brand-radius);
358
+ }
359
+ .tailor-tour__btn--primary { border-color: var(--tailor-brand-primary); background: var(--tailor-brand-primary); color: var(--tailor-brand-on-primary); font-weight: 500; }
360
+ .tailor-tour__skip { margin-top: 13px; padding: 0; border: 0; background: none; cursor: pointer; font: inherit; font-size: 13px; color: var(--tailor-brand-text-muted); text-decoration: underline; text-underline-offset: 3px; }
361
+ .tailor-tour__x:focus-visible, .tailor-tour__btn:focus-visible, .tailor-tour__skip:focus-visible { outline: 3px solid var(--tailor-brand-primary); outline-offset: 2px; }
362
+
294
363
  /* TailorField — rótulo, controle e mensagem. Erro: borda e ponto vermelhos, um empurrão curto para chamar o olho. */
295
364
  .tailor-field { display: grid; gap: 8px; font-family: var(--tailor-font); color: var(--tailor-brand-text); }
296
365
  .tailor-field__label { display: flex; align-items: baseline; gap: 8px; font-size: 13px; font-weight: 500; }
@@ -497,6 +566,8 @@ textarea.tailor-field__control { padding: 8px 13px; min-height: 89px; }
497
566
  .tailor-user-menu__panel::before { display: none; }
498
567
  .tailor-toast { animation: none; }
499
568
  .tailor-result, .tailor-result > * { animation: none !important; }
569
+ .tailor-result__burst { display: none; }
570
+ .tailor-explain__chevron, .tailor-glossary__tip, .tailor-tour__spot { transition: none; }
500
571
  .tailor-loader__reticencias::after { animation: none; content: '...'; }
501
572
  .tailor-ponto-pisca { animation: none; }
502
573
  .tailor-mascote__corpo, .tailor-mascote__olho, .tailor-mascote__verde { animation: none; }
@@ -533,3 +604,95 @@ textarea.tailor-field__control { padding: 8px 13px; min-height: 89px; }
533
604
  .tailor-nov__entry-title { margin: 4px 0 0; font-size: 16px; font-weight: 500; }
534
605
  .tailor-nov__list { margin: 13px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; line-height: 1.5; }
535
606
  .tailor-nov__more { align-self: flex-start; padding: 8px 0; border: 0; background: none; cursor: pointer; font: inherit; font-size: 14px; color: var(--tailor-brand-text); text-decoration: underline; text-underline-offset: 3px; }
607
+
608
+ /* TailorStat — número com contexto. Sem cartão: tipografia e um fio entre os indicadores. */
609
+ :where(:root) { --tailor-stat-good: var(--tailor-brand-primary-text); --tailor-stat-bad: #B8002B; }
610
+ :where(.dark, [data-theme="dark"]) { --tailor-stat-bad: #FF6B8A; }
611
+ .tailor-stat { display: flex; flex-direction: column; gap: 5px; min-width: 0; padding: 0; border: 0; background: none; text-align: left; font-family: var(--tailor-brand-body-font, var(--tailor-font)); color: var(--tailor-brand-text); text-decoration: none; }
612
+ .tailor-stat__label { font-size: 13px; color: var(--tailor-brand-text-muted); }
613
+ .tailor-stat__main { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px 13px; }
614
+ .tailor-stat__value { font-family: var(--tailor-font-num); font-size: 34px; font-weight: 500; line-height: 1.1; font-variant-numeric: tabular-nums; }
615
+ .tailor-stat__delta { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--tailor-brand-text-muted); }
616
+ .tailor-stat__delta--good { color: var(--tailor-stat-good); }
617
+ .tailor-stat__delta--bad { color: var(--tailor-stat-bad); }
618
+ .tailor-stat__arrow { width: 12px; height: 12px; flex-shrink: 0; }
619
+ .tailor-stat__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
620
+ .tailor-stat__sub, .tailor-stat__hint { font-size: 12px; color: var(--tailor-brand-text-muted); font-variant-numeric: tabular-nums; }
621
+ .tailor-stat__meaning { font-size: 14px; line-height: 1.4; max-width: 34ch; }
622
+ .tailor-stat__goal { display: grid; gap: 5px; max-width: 233px; }
623
+ .tailor-stat__goal-text { font-size: 12px; color: var(--tailor-brand-text-muted); font-variant-numeric: tabular-nums; }
624
+ .tailor-stat__goal-track { display: block; height: 3px; background: var(--tailor-brand-border); }
625
+ .tailor-stat__goal-fill { display: block; height: 100%; background: var(--tailor-brand-primary); }
626
+ .tailor-stat--compact { gap: 3px; }
627
+ .tailor-stat--compact .tailor-stat__value { font-size: 21px; }
628
+ .tailor-stat--inline { display: inline-flex; flex-direction: row; align-items: baseline; gap: 8px; }
629
+ .tailor-stat--inline .tailor-stat__main { display: contents; }
630
+ .tailor-stat--inline .tailor-stat__label { order: -1; }
631
+ .tailor-stat--inline .tailor-stat__value { font-size: inherit; font-weight: 600; }
632
+ .tailor-stat--action { cursor: pointer; }
633
+ .tailor-stat--action:hover .tailor-stat__value { text-decoration: underline; text-decoration-color: var(--tailor-brand-primary); text-decoration-thickness: 3px; text-underline-offset: 4px; }
634
+ .tailor-stat--action:focus-visible { outline: 2px solid var(--tailor-brand-text); outline-offset: 4px; }
635
+ .tailor-stat-group { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--tailor-stat-min, 200px)), 1fr)); gap: 34px 0; }
636
+ .tailor-stat-group > * { padding: 0 34px; border-left: 1px solid var(--tailor-brand-border); }
637
+ .tailor-stat-group > :first-child { padding-left: 0; border-left: 0; }
638
+ .tailor-stat-group--bordered { gap: 13px; }
639
+ .tailor-stat-group--bordered > * { padding: 21px; border: 1px solid var(--tailor-brand-border); }
640
+
641
+ /* TailorEmpty */
642
+ .tailor-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 13px; max-width: 55ch; padding: 34px 0; font-family: var(--tailor-brand-body-font, var(--tailor-font)); color: var(--tailor-brand-text); }
643
+ .tailor-empty__art { color: var(--tailor-brand-border); }
644
+ .tailor-empty__dot { fill: var(--tailor-brand-primary); }
645
+ .tailor-empty__title { margin: 0; font-size: 21px; font-weight: var(--tailor-brand-heading-weight, 500); line-height: 1.2; }
646
+ .tailor-empty__description { font-size: 14px; line-height: 1.5; color: var(--tailor-brand-text-muted); }
647
+ .tailor-empty__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
648
+ a.tailor-btn { text-decoration: none; }
649
+
650
+ /* TailorMonogram — 8 pares fundo/texto (AA nos dois temas, conferido no teste). */
651
+ :root {
652
+ --tailor-mono-0-bg: #E3F5C2; --tailor-mono-0-fg: #2B4A00;
653
+ --tailor-mono-1-bg: #D6E8FF; --tailor-mono-1-fg: #12335E;
654
+ --tailor-mono-2-bg: #FFE0CC; --tailor-mono-2-fg: #6B2A00;
655
+ --tailor-mono-3-bg: #F3D9F5; --tailor-mono-3-fg: #5A1A63;
656
+ --tailor-mono-4-bg: #CFF1EC; --tailor-mono-4-fg: #0B4A42;
657
+ --tailor-mono-5-bg: #FFD9DF; --tailor-mono-5-fg: #7A0F26;
658
+ --tailor-mono-6-bg: #FFF0B8; --tailor-mono-6-fg: #5C4300;
659
+ --tailor-mono-7-bg: #E4E4E4; --tailor-mono-7-fg: #1F1F1F;
660
+ }
661
+ :where(.dark, [data-theme="dark"]) {
662
+ --tailor-mono-0-bg: #2B4A00; --tailor-mono-0-fg: #D9F5A5;
663
+ --tailor-mono-1-bg: #12335E; --tailor-mono-1-fg: #CFE2FF;
664
+ --tailor-mono-2-bg: #6B2A00; --tailor-mono-2-fg: #FFD9C2;
665
+ --tailor-mono-3-bg: #5A1A63; --tailor-mono-3-fg: #F0CFF3;
666
+ --tailor-mono-4-bg: #0B4A42; --tailor-mono-4-fg: #C2EFE8;
667
+ --tailor-mono-5-bg: #7A0F26; --tailor-mono-5-fg: #FFD0D8;
668
+ --tailor-mono-6-bg: #5C4300; --tailor-mono-6-fg: #FFE9A8;
669
+ --tailor-mono-7-bg: #333333; --tailor-mono-7-fg: #EEEEEE;
670
+ }
671
+ .tailor-monogram { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; width: 34px; height: 34px; border-radius: var(--tailor-brand-radius, 0); font-family: var(--tailor-brand-body-font, var(--tailor-font)); font-size: 13px; font-weight: 600; line-height: 1; letter-spacing: 0.02em; user-select: none; }
672
+ .tailor-monogram--sm { width: 21px; height: 21px; font-size: 9px; }
673
+ .tailor-monogram--lg { width: 55px; height: 55px; font-size: 21px; }
674
+ .tailor-monogram__img { width: 100%; height: 100%; object-fit: cover; }
675
+ .tailor-monogram--tone-0 { background: var(--tailor-mono-0-bg); color: var(--tailor-mono-0-fg); }
676
+ .tailor-monogram--tone-1 { background: var(--tailor-mono-1-bg); color: var(--tailor-mono-1-fg); }
677
+ .tailor-monogram--tone-2 { background: var(--tailor-mono-2-bg); color: var(--tailor-mono-2-fg); }
678
+ .tailor-monogram--tone-3 { background: var(--tailor-mono-3-bg); color: var(--tailor-mono-3-fg); }
679
+ .tailor-monogram--tone-4 { background: var(--tailor-mono-4-bg); color: var(--tailor-mono-4-fg); }
680
+ .tailor-monogram--tone-5 { background: var(--tailor-mono-5-bg); color: var(--tailor-mono-5-fg); }
681
+ .tailor-monogram--tone-6 { background: var(--tailor-mono-6-bg); color: var(--tailor-mono-6-fg); }
682
+ .tailor-monogram--tone-7 { background: var(--tailor-mono-7-bg); color: var(--tailor-mono-7-fg); }
683
+
684
+ /* TailorInsight — leitura da IA: um fio verde à esquerda, texto corrido, sem cartão. */
685
+ .tailor-insight { display: grid; gap: 8px; max-width: 72ch; padding: 3px 0 3px 21px; border-left: 3px solid var(--tailor-brand-primary); font-family: var(--tailor-brand-body-font, var(--tailor-font)); color: var(--tailor-brand-text); }
686
+ .tailor-insight--error { border-left-color: var(--tailor-stat-bad); }
687
+ .tailor-insight--empty { border-left-color: var(--tailor-brand-border); }
688
+ .tailor-insight__meta { display: flex; flex-wrap: wrap; gap: 3px 13px; font-size: 12px; color: var(--tailor-brand-text-muted); }
689
+ .tailor-insight__ai { font-weight: 600; color: var(--tailor-brand-text); }
690
+ .tailor-insight__takeaway { margin: 0; font-size: 18px; font-weight: 500; line-height: 1.4; }
691
+ .tailor-insight__why { margin: 0; font-size: 14px; line-height: 1.5; color: var(--tailor-brand-text-muted); }
692
+ .tailor-insight__actions { margin-top: 5px; }
693
+ .tailor-insight__sources { margin: 0; font-size: 12px; color: var(--tailor-brand-text-muted); }
694
+ .tailor-insight__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 21px; font-size: 12px; color: var(--tailor-brand-text-muted); }
695
+ .tailor-insight__feedback { display: inline-flex; align-items: center; gap: 13px; }
696
+ .tailor-insight__link { padding: 0; border: 0; background: none; font: inherit; color: var(--tailor-brand-primary-text); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
697
+ .tailor-insight__link[aria-pressed="true"] { font-weight: 700; text-decoration-thickness: 2px; }
698
+ .tailor-insight__link:focus-visible { outline: 2px solid var(--tailor-brand-text); outline-offset: 2px; }
@@ -0,0 +1,11 @@
1
+ export type TailorActionSpec = {
2
+ label: string;
3
+ onClick?: () => void;
4
+ href?: string;
5
+ };
6
+ /** Ação como botão (`onClick`) ou como link com cara de botão (`href`). Uso interno de Empty e Insight. */
7
+ export declare function TailorAction({ action, variant, size }: {
8
+ action: TailorActionSpec;
9
+ variant?: 'primary' | 'secondary' | 'ghost';
10
+ size?: 'sm' | 'md';
11
+ }): import("react").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { default as React } from 'react';
2
+ import { TailorActionSpec } from './TailorAction';
3
+ export type TailorEmptyProps = {
4
+ /** Diz o que falta e já aponta o caminho ("Nenhuma campanha ainda"). */
5
+ title: string;
6
+ description?: React.ReactNode;
7
+ /** A ação principal: um botão (`onClick`) ou um link (`href`). */
8
+ action?: TailorActionSpec;
9
+ secondaryAction?: TailorActionSpec;
10
+ /** Troca a marca discreta padrão por uma ilustração sua. */
11
+ illustration?: React.ReactNode;
12
+ className?: string;
13
+ };
14
+ /** Estado vazio que convida a agir: marca discreta, o que falta, e o próximo passo. */
15
+ export declare function TailorEmpty({ title, description, action, secondaryAction, illustration, className }: TailorEmptyProps): React.JSX.Element;
@@ -0,0 +1,22 @@
1
+ import { default as React } from 'react';
2
+ export type TailorExplainProps = {
3
+ /** Cabeçalho do bloco. Padrão: "Como ler esta tela". */
4
+ title?: string;
5
+ /** Texto livre. Use `items` para o formato "termo: explicação". */
6
+ children?: React.ReactNode;
7
+ /** Lista de "o que é cada coisa". */
8
+ items?: Array<{
9
+ label: string;
10
+ text: React.ReactNode;
11
+ }>;
12
+ /** Lembra no navegador se a pessoa recolheu (`tailor-explain:<storageKey>`). Sem ele, não lembra. */
13
+ storageKey?: string;
14
+ /** Aberto na primeira visita. Padrão: true. */
15
+ defaultOpen?: boolean;
16
+ className?: string;
17
+ };
18
+ /**
19
+ * "O que é esta tela": explicação curta, em linguagem simples, que a pessoa recolhe
20
+ * e não volta sozinha. Pensado para ficar logo abaixo do `TailorPageHeader`.
21
+ */
22
+ export declare function TailorExplain({ title, children, items, storageKey, defaultOpen, className }: TailorExplainProps): React.JSX.Element;
@@ -0,0 +1,14 @@
1
+ import { default as React } from 'react';
2
+ export type TailorGlossaryProps = {
3
+ /** A palavra como aparece no texto. */
4
+ term: React.ReactNode;
5
+ /** A explicação, em uma ou duas frases. */
6
+ children: React.ReactNode;
7
+ className?: string;
8
+ };
9
+ /**
10
+ * Termo técnico dentro de uma frase, com a explicação num balão. Abre ao passar o mouse,
11
+ * ao tocar ou com Enter/Espaço; Esc, tocar fora ou sair do termo fecha. O balão fica fora
12
+ * do fluxo (position: absolute), então o texto em volta não se mexe.
13
+ */
14
+ export declare function TailorGlossary({ term, children, className }: TailorGlossaryProps): React.JSX.Element;
@@ -0,0 +1,26 @@
1
+ import { default as React } from 'react';
2
+ import { TailorActionSpec } from './TailorAction';
3
+ export type TailorInsightProps = {
4
+ status: 'loading' | 'ready' | 'error' | 'empty';
5
+ /** A conclusão em uma ou duas frases. No `error` e no `empty`, troca o texto padrão. */
6
+ takeaway?: string;
7
+ /** Por que a IA concluiu isso, em português simples. */
8
+ why?: string;
9
+ /** O próximo passo sugerido. */
10
+ nextAction?: TailorActionSpec;
11
+ /** De onde vieram os números ("Campanhas de outubro", "Funil Vendas"). */
12
+ sources?: string[];
13
+ confidence?: 'alta' | 'media' | 'baixa';
14
+ generatedAt?: Date | string | number;
15
+ /** Mostra "Atualizar" (no erro, "Tentar de novo"). */
16
+ onRefresh?: () => void;
17
+ /** Mostra "Ajudou?" com sim e não. */
18
+ onFeedback?: (vote: 'up' | 'down') => void;
19
+ className?: string;
20
+ };
21
+ /**
22
+ * A leitura da IA sobre a tela, em texto: conclusão, motivo e próximo passo.
23
+ * Sempre marcada "Gerado por IA" (sem emoji) e com as fontes à vista. Só a
24
+ * interface: quem gera o texto é o app.
25
+ */
26
+ export declare function TailorInsight({ status, takeaway, why, nextAction, sources, confidence, generatedAt, onRefresh, onFeedback, className }: TailorInsightProps): React.JSX.Element;
@@ -0,0 +1,17 @@
1
+ export type TailorMonogramProps = {
2
+ /** Define a cor: o mesmo `id` tem a mesma cor em qualquer tela. */
3
+ id: string;
4
+ name: string;
5
+ size?: 'sm' | 'md' | 'lg';
6
+ /** Foto. Quando existe (e carrega), vence as iniciais. */
7
+ src?: string;
8
+ className?: string;
9
+ };
10
+ /** Quantidade de cores da paleta (`--tailor-mono-N-*` no style.css). */
11
+ export declare const MONOGRAM_TONES = 8;
12
+ /** Duas letras: primeira e última palavra do nome, sem "de/da/do". Uma palavra só dá as duas primeiras letras. */
13
+ export declare function monogramInitials(name: string): string;
14
+ /** Índice estável (0 a 7) do `id`: hash FNV-1a, o mesmo em qualquer máquina. */
15
+ export declare function monogramTone(id: string): number;
16
+ /** Iniciais num quadrado de cor estável por `id`; com foto, mostra a foto. */
17
+ export declare function TailorMonogram({ id, name, size, src, className }: TailorMonogramProps): import("react").JSX.Element;
@@ -9,7 +9,7 @@ export type TailorNovidade = {
9
9
  };
10
10
  /**
11
11
  * Quantas novidades (lista com a mais recente primeiro) são mais novas que a última vista.
12
- * Nunca viu: todas. Guarda o id mais recente visto no localStorage; storage bloqueado só não lembra.
12
+ * Nunca viu: só as dos últimos 30 dias, para o histórico antigo não chegar como novo. Guarda o id mais recente visto no localStorage; storage bloqueado só não lembra.
13
13
  */
14
14
  export declare function useNovidades(novidades: TailorNovidade[], { chave, usuario }: {
15
15
  chave: string;
@@ -15,6 +15,12 @@ export type TailorResultProps = {
15
15
  onClose?: () => void;
16
16
  /** Botões abaixo do texto (ex.: "Tentar de novo" no erro). */
17
17
  actions?: React.ReactNode;
18
+ /**
19
+ * Só no sucesso: momento de "concluído" (fim de etapa, meta batida). O painel vira Ink com o
20
+ * check em Lime e uma única rajada curta de faíscas sai do ícone. Sem movimento para quem
21
+ * prefere menos (fica só o painel Ink e o check, parados). Padrão: false.
22
+ */
23
+ celebrate?: boolean;
18
24
  className?: string;
19
25
  };
20
26
  /**
@@ -24,4 +30,4 @@ export type TailorResultProps = {
24
30
  * mesmo ponto e `onClose` fecha o modal. Cobre o pai, que precisa de
25
31
  * `position: relative`.
26
32
  */
27
- export declare function TailorResult({ status, title, description, origin, closeAfter, onClose, actions, className }: TailorResultProps): React.JSX.Element;
33
+ export declare function TailorResult({ status, title, description, origin, closeAfter, onClose, actions, celebrate, className }: TailorResultProps): React.JSX.Element;
@@ -0,0 +1,52 @@
1
+ import { default as React } from 'react';
2
+ export type TailorStatFormat = 'number' | 'currency' | 'percent' | 'text';
3
+ export type TailorStatProps = {
4
+ /** O que o número mede, em palavras de quem lê ("Respostas"). */
5
+ label: string;
6
+ value: number | string | null | undefined;
7
+ /** `percent` recebe fração (0,3 = 30%). Padrão: `number` se o valor for número, senão `text`. */
8
+ format?: TailorStatFormat;
9
+ /** Valor do período anterior: a variação percentual e a direção saem daqui. */
10
+ previous?: number;
11
+ /** Variação já calculada (fração: 0,12 = +12%). Vence `previous`. */
12
+ delta?: number;
13
+ /** Meta na mesma unidade do valor: mostra quanto falta e a barra de avanço. */
14
+ goal?: number;
15
+ /** Uma linha em português simples ("de cada 10 que leram, 3 responderam"). */
16
+ meaning?: string;
17
+ /** Subir é bom ou ruim? Define a cor da variação (custo por lead: `down`). Padrão: `up`. */
18
+ goodWhen?: 'up' | 'down';
19
+ /** Nota curta de rodapé (período, fonte). */
20
+ hint?: string;
21
+ loading?: boolean;
22
+ /** `compact`: rótulo, valor e variação em coluna enxuta. `inline`: tudo numa linha, para frases e cabeçalhos. */
23
+ variant?: 'default' | 'compact' | 'inline';
24
+ onClick?: () => void;
25
+ href?: string;
26
+ className?: string;
27
+ };
28
+ export type TailorStatDirection = 'up' | 'down' | 'flat';
29
+ export type TailorStatDelta = {
30
+ ratio: number;
31
+ direction: TailorStatDirection;
32
+ };
33
+ /** Variação (fração) entre o valor e o anterior. Sem base (anterior 0 ou ausente) não há percentual: devolve `null`. */
34
+ export declare function statDelta(value: number, previous: number): TailorStatDelta | null;
35
+ /**
36
+ * Um número com contexto: de onde veio, se melhorou, quanto falta para a meta e
37
+ * o que ele quer dizer. A variação nunca depende só da cor: tem seta, sinal e
38
+ * texto para o leitor de tela.
39
+ */
40
+ export declare function TailorStat({ label, value, format, previous, delta, goal, meaning, goodWhen, hint, loading, variant, onClick, href, className }: TailorStatProps): React.JSX.Element;
41
+ export type TailorStatGroupProps = {
42
+ children: React.ReactNode;
43
+ /** Largura mínima de cada indicador. Padrão: 200. */
44
+ minWidth?: number;
45
+ /** Contorno em cada indicador. Padrão: sem, só um fio entre eles. */
46
+ bordered?: boolean;
47
+ /** Nome do grupo para o leitor de tela. */
48
+ label?: string;
49
+ className?: string;
50
+ };
51
+ /** Indicadores lado a lado: quebram de linha sozinhos conforme a largura. Sem cartões por padrão. */
52
+ export declare function TailorStatGroup({ children, minWidth, bordered, label, className }: TailorStatGroupProps): React.JSX.Element;
@@ -0,0 +1,26 @@
1
+ import { default as React } from 'react';
2
+ export type TailorTourStep = {
3
+ /** Valor do atributo `data-tour` do elemento, ou um seletor CSS (começando por `#`, `.` ou `[`). */
4
+ target: string;
5
+ title: string;
6
+ text: React.ReactNode;
7
+ };
8
+ export type TailorTourProps = {
9
+ steps: TailorTourStep[];
10
+ /** Padrão: true. Com `storageKey`, só abre se a pessoa ainda não concluiu nem pulou. */
11
+ open?: boolean;
12
+ /** Lembra no navegador que o tour acabou (`tailor-tour:<storageKey>`), seja concluindo ou pulando. */
13
+ storageKey?: string;
14
+ /** "Entendi" no último passo. */
15
+ onClose?: () => void;
16
+ /** Pular, X e Esc. Sem ele, valem como `onClose`. */
17
+ onSkip?: () => void;
18
+ };
19
+ /** Esquece que o tour foi visto, para a pessoa poder refazê-lo (ex.: botão "Ver o tour de novo"). */
20
+ export declare const resetTour: (storageKey: string) => void;
21
+ /**
22
+ * Tour guiado: escurece a tela, recorta o elemento da vez e explica numa frase. Passo cujo
23
+ * elemento não está na tela é pulado. Esc pula; as setas andam. É um diálogo modal: prende o
24
+ * Tab no balão e devolve o foco a quem o tinha. Com "menos movimento", rola e recorta sem animar.
25
+ */
26
+ export declare function TailorTour({ steps, open, storageKey, onClose, onSkip }: TailorTourProps): React.ReactPortal | null;
@@ -19,6 +19,11 @@ export type TailorMessages = {
19
19
  seePrevious: string;
20
20
  close: string;
21
21
  unseen: (count: string) => string;
22
+ howToRead: string;
23
+ gotIt: string;
24
+ nextStep: string;
25
+ step: (step: number, total: number) => string;
26
+ skipTour: string;
22
27
  };
23
28
  export declare const TAILOR_MESSAGES: Record<string, TailorMessages>;
24
29
  export type TailorLocale = {
@@ -38,3 +38,18 @@ export { TailorButton } from './components/TailorButton';
38
38
  export type { TailorButtonProps } from './components/TailorButton';
39
39
  export { TailorNovidades, TailorNovidadesDialog, useNovidades } from './components/TailorNovidades';
40
40
  export type { TailorNovidade, TailorNovidadesProps, TailorNovidadesDialogProps } from './components/TailorNovidades';
41
+ export { TailorStat, TailorStatGroup, statDelta } from './components/TailorStat';
42
+ export type { TailorStatProps, TailorStatGroupProps, TailorStatFormat, TailorStatDelta, TailorStatDirection } from './components/TailorStat';
43
+ export { TailorEmpty } from './components/TailorEmpty';
44
+ export type { TailorEmptyProps } from './components/TailorEmpty';
45
+ export type { TailorActionSpec } from './components/TailorAction';
46
+ export { TailorMonogram, monogramInitials, monogramTone, MONOGRAM_TONES } from './components/TailorMonogram';
47
+ export type { TailorMonogramProps } from './components/TailorMonogram';
48
+ export { TailorInsight } from './components/TailorInsight';
49
+ export type { TailorInsightProps } from './components/TailorInsight';
50
+ export { TailorExplain } from './components/TailorExplain';
51
+ export type { TailorExplainProps } from './components/TailorExplain';
52
+ export { TailorGlossary } from './components/TailorGlossary';
53
+ export type { TailorGlossaryProps } from './components/TailorGlossary';
54
+ export { TailorTour, resetTour } from './components/TailorTour';
55
+ export type { TailorTourProps, TailorTourStep } from './components/TailorTour';
@@ -0,0 +1,4 @@
1
+ /** Lê a preferência "menos movimento" na hora (para decidir, por exemplo, o tipo de rolagem). */
2
+ export declare const prefersReducedMotion: () => boolean;
3
+ /** A preferência "menos movimento" do sistema, acompanhando mudanças. */
4
+ export declare function useReducedMotion(): boolean;
@@ -0,0 +1,3 @@
1
+ /** localStorage que não quebra em modo privado ou com storage bloqueado: só não lembra. */
2
+ export declare const lerStorage: (k: string) => string | null;
3
+ export declare const gravarStorage: (k: string, v: string | null) => void;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ffid-br/tailor-ui",
3
3
  "private": false,
4
- "version": "0.13.0",
4
+ "version": "0.14.0",
5
5
  "description": "Primitivos de marca Tailor.ia em React: loader, intro, transição de login, lockup e barra lateral.",
6
6
  "type": "module",
7
7
  "main": "dist/index.umd.js",