@ffid-br/tailor-ui 0.11.0 → 0.13.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 +16 -0
- package/dist/index.es.js +963 -845
- package/dist/index.umd.js +1 -1
- package/dist/style.css +31 -0
- package/dist/types/components/TailorNovidades.d.ts +44 -0
- package/dist/types/i18n.d.ts +5 -0
- package/dist/types/index.d.ts +2 -0
- package/package.json +1 -1
package/dist/style.css
CHANGED
|
@@ -502,3 +502,34 @@ textarea.tailor-field__control { padding: 8px 13px; min-height: 89px; }
|
|
|
502
502
|
.tailor-mascote__corpo, .tailor-mascote__olho, .tailor-mascote__verde { animation: none; }
|
|
503
503
|
.tailor-mv *, .tailor-mv *::after { animation: none !important; transition: none !important; }
|
|
504
504
|
}
|
|
505
|
+
|
|
506
|
+
/* TailorNovidades — changelog do app. Cores da marca, cantos retos. */
|
|
507
|
+
.tailor-nov__trigger {
|
|
508
|
+
display: inline-flex; align-items: center; gap: 8px; padding: 6px 8px; border: 0; background: none; cursor: pointer;
|
|
509
|
+
font: inherit; font-size: 14px; color: var(--tailor-brand-text); border-radius: var(--tailor-brand-radius);
|
|
510
|
+
}
|
|
511
|
+
.tailor-nov__trigger:hover { background: var(--tailor-brand-border); }
|
|
512
|
+
.tailor-nov__trigger:focus-visible, .tailor-nov__close:focus-visible, .tailor-nov__more:focus-visible { outline: 3px solid var(--tailor-brand-primary); outline-offset: 2px; }
|
|
513
|
+
.tailor-nov__dot { width: 8px; height: 8px; background: var(--tailor-brand-text-muted); border-radius: var(--tailor-brand-radius); }
|
|
514
|
+
.tailor-nov__count {
|
|
515
|
+
min-width: 21px; padding: 0 6px; background: var(--tailor-brand-primary); color: var(--tailor-brand-on-primary);
|
|
516
|
+
font-size: 12px; font-weight: 500; line-height: 21px; text-align: center; font-variant-numeric: lining-nums; border-radius: var(--tailor-brand-radius);
|
|
517
|
+
}
|
|
518
|
+
.tailor-nov__overlay { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgb(0 0 0 / 0.5); }
|
|
519
|
+
.tailor-nov {
|
|
520
|
+
display: flex; flex-direction: column; width: 100%; max-width: 560px; max-height: 80vh; background: var(--tailor-white);
|
|
521
|
+
color: var(--tailor-brand-text); font-family: var(--tailor-brand-body-font); border-radius: var(--tailor-brand-radius);
|
|
522
|
+
}
|
|
523
|
+
:where(.dark, [data-theme="dark"]) .tailor-nov { background: var(--tailor-black); border: 1px solid var(--tailor-brand-border); }
|
|
524
|
+
.tailor-nov__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 13px; padding: 21px 21px 13px; border-bottom: 1px solid var(--tailor-brand-border); }
|
|
525
|
+
.tailor-nov__title { margin: 0; font-family: var(--tailor-brand-heading-font); font-weight: var(--tailor-brand-heading-weight); font-size: 26px; line-height: 1.2; }
|
|
526
|
+
.tailor-nov__sub { margin: 4px 0 0; font-size: 13px; color: var(--tailor-brand-text-muted); }
|
|
527
|
+
.tailor-nov__close { flex-shrink: 0; display: inline-flex; padding: 6px; border: 0; background: none; cursor: pointer; color: var(--tailor-brand-text-muted); border-radius: var(--tailor-brand-radius); }
|
|
528
|
+
.tailor-nov__close:hover { color: var(--tailor-brand-text); }
|
|
529
|
+
.tailor-nov__body { flex: 1; overflow-y: auto; padding: 21px; display: flex; flex-direction: column; gap: 34px; }
|
|
530
|
+
.tailor-nov__entry { margin: 0; }
|
|
531
|
+
.tailor-nov__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; font-size: 12px; color: var(--tailor-brand-text-muted); }
|
|
532
|
+
.tailor-nov__tela { padding-left: 8px; border-left: 1px solid var(--tailor-brand-border); }
|
|
533
|
+
.tailor-nov__entry-title { margin: 4px 0 0; font-size: 16px; font-weight: 500; }
|
|
534
|
+
.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
|
+
.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; }
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export type TailorNovidade = {
|
|
2
|
+
id: string;
|
|
3
|
+
/** YYYY-MM-DD */
|
|
4
|
+
data: string;
|
|
5
|
+
titulo: string;
|
|
6
|
+
itens: string[];
|
|
7
|
+
/** Tela a que a mudança se refere (ex.: "Campanhas"). */
|
|
8
|
+
tela?: string;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
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.
|
|
13
|
+
*/
|
|
14
|
+
export declare function useNovidades(novidades: TailorNovidade[], { chave, usuario }: {
|
|
15
|
+
chave: string;
|
|
16
|
+
usuario?: string;
|
|
17
|
+
}): {
|
|
18
|
+
naoVistas: number;
|
|
19
|
+
marcarVistas: () => void;
|
|
20
|
+
};
|
|
21
|
+
export type TailorNovidadesDialogProps = {
|
|
22
|
+
aberto: boolean;
|
|
23
|
+
onFechar: () => void;
|
|
24
|
+
/** Mais recente primeiro. */
|
|
25
|
+
novidades: TailorNovidade[];
|
|
26
|
+
/** Quantas aparecem de início; o resto fica atrás de "Ver anteriores". Padrão: 5. */
|
|
27
|
+
limite?: number;
|
|
28
|
+
titulo?: string;
|
|
29
|
+
subtitulo?: string;
|
|
30
|
+
};
|
|
31
|
+
/** Modal com o changelog do app. Esc, clique fora e o botão fechar devolvem o foco a quem abriu. */
|
|
32
|
+
export declare function TailorNovidadesDialog({ aberto, onFechar, novidades, limite, titulo, subtitulo }: TailorNovidadesDialogProps): import('react').ReactPortal | null;
|
|
33
|
+
export type TailorNovidadesProps = {
|
|
34
|
+
novidades: TailorNovidade[];
|
|
35
|
+
/** Identifica o app no localStorage (ex.: "crm"). */
|
|
36
|
+
chave: string;
|
|
37
|
+
usuario?: string;
|
|
38
|
+
limite?: number;
|
|
39
|
+
/** Texto do gatilho. Padrão: "Novidades". */
|
|
40
|
+
rotulo?: string;
|
|
41
|
+
className?: string;
|
|
42
|
+
};
|
|
43
|
+
/** Gatilho compacto + modal. Contador verde com as não vistas (9+); abrir marca tudo como visto. */
|
|
44
|
+
export declare function TailorNovidades({ novidades, chave, usuario, limite, rotulo, className }: TailorNovidadesProps): import("react").JSX.Element;
|
package/dist/types/i18n.d.ts
CHANGED
|
@@ -14,6 +14,11 @@ export type TailorMessages = {
|
|
|
14
14
|
dismiss: string;
|
|
15
15
|
skip: string;
|
|
16
16
|
required: string;
|
|
17
|
+
news: string;
|
|
18
|
+
newsSubtitle: string;
|
|
19
|
+
seePrevious: string;
|
|
20
|
+
close: string;
|
|
21
|
+
unseen: (count: string) => string;
|
|
17
22
|
};
|
|
18
23
|
export declare const TAILOR_MESSAGES: Record<string, TailorMessages>;
|
|
19
24
|
export type TailorLocale = {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -36,3 +36,5 @@ export { TailorField } from './components/TailorField';
|
|
|
36
36
|
export type { TailorFieldProps } from './components/TailorField';
|
|
37
37
|
export { TailorButton } from './components/TailorButton';
|
|
38
38
|
export type { TailorButtonProps } from './components/TailorButton';
|
|
39
|
+
export { TailorNovidades, TailorNovidadesDialog, useNovidades } from './components/TailorNovidades';
|
|
40
|
+
export type { TailorNovidade, TailorNovidadesProps, TailorNovidadesDialogProps } from './components/TailorNovidades';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ffid-br/tailor-ui",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.13.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",
|