@gyramais/gyra-design 0.2.35 → 0.2.38
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/components/Chart/index.js +29 -0
- package/dist/components/Chart/index.js.map +1 -0
- package/dist/components/ChatWidget/index.js +45 -0
- package/dist/components/ChatWidget/index.js.map +1 -0
- package/dist/components/Checkbox/index.js +45 -0
- package/dist/components/Checkbox/index.js.map +1 -0
- package/dist/components/Col/index.js +7 -0
- package/dist/components/Col/index.js.map +1 -0
- package/dist/components/Collapse/index.js +45 -0
- package/dist/components/Collapse/index.js.map +1 -0
- package/dist/components/ContextMenu/index.js +7 -0
- package/dist/components/ContextMenu/index.js.map +1 -0
- package/dist/components/DistributionBar/index.js +7 -0
- package/dist/components/DistributionBar/index.js.map +1 -0
- package/dist/components/Divider/index.js +7 -0
- package/dist/components/Divider/index.js.map +1 -0
- package/dist/components/Drawer/index.js +45 -0
- package/dist/components/Drawer/index.js.map +1 -0
- package/dist/components/DropdownMenu/index.js +7 -0
- package/dist/components/DropdownMenu/index.js.map +1 -0
- package/dist/components/Email/index.js +2 -0
- package/dist/components/Email/index.js.map +1 -0
- package/dist/components/Empty/index.js +45 -0
- package/dist/components/Empty/index.js.map +1 -0
- package/dist/components/Filter/index.js +50 -0
- package/dist/components/Filter/index.js.map +1 -0
- package/dist/components/FloatingCard/index.js +45 -0
- package/dist/components/FloatingCard/index.js.map +1 -0
- package/dist/components/Form/index.js +2 -0
- package/dist/components/Form/index.js.map +1 -0
- package/dist/components/Gauge/index.js +7 -0
- package/dist/components/Gauge/index.js.map +1 -0
- package/dist/components/HoverCard/index.js +7 -0
- package/dist/components/HoverCard/index.js.map +1 -0
- package/dist/components/Icon/index.js +7 -0
- package/dist/components/Icon/index.js.map +1 -0
- package/dist/components/IconDisplay/index.js +7 -0
- package/dist/components/IconDisplay/index.js.map +1 -0
- package/dist/components/Information/index.js +7 -0
- package/dist/components/Information/index.js.map +1 -0
- package/dist/components/Input/index.js +25 -0
- package/dist/components/Input/index.js.map +1 -0
- package/dist/components/Label/index.js +2 -0
- package/dist/components/Label/index.js.map +1 -0
- package/dist/components/Layout/index.js +7 -0
- package/dist/components/Layout/index.js.map +1 -0
- package/dist/components/List/index.js +45 -0
- package/dist/components/List/index.js.map +1 -0
- package/dist/components/Loading/index.js +7 -0
- package/dist/components/Loading/index.js.map +1 -0
- package/dist/components/Logo/index.js +7 -0
- package/dist/components/Logo/index.js.map +1 -0
- package/dist/components/Menubar/index.js +7 -0
- package/dist/components/Menubar/index.js.map +1 -0
- package/dist/components/Modal/index.js +63 -0
- package/dist/components/Modal/index.js.map +1 -0
- package/dist/components/MultiSelectPicker/index.js +45 -0
- package/dist/components/MultiSelectPicker/index.js.map +1 -0
- package/dist/components/OperatorPicker/index.js +45 -0
- package/dist/components/OperatorPicker/index.js.map +1 -0
- package/dist/components/PickerPopover/index.js +45 -0
- package/dist/components/PickerPopover/index.js.map +1 -0
- package/dist/components/Popover/index.js +7 -0
- package/dist/components/Popover/index.js.map +1 -0
- package/dist/components/ProcessingChip/index.js +7 -0
- package/dist/components/ProcessingChip/index.js.map +1 -0
- package/dist/components/Progress/index.js +7 -0
- package/dist/components/Progress/index.js.map +1 -0
- package/dist/components/RadioGroup/index.js +7 -0
- package/dist/components/RadioGroup/index.js.map +1 -0
- package/dist/components/RichInput/index.js +12 -0
- package/dist/components/RichInput/index.js.map +1 -0
- package/dist/components/Row/index.js +7 -0
- package/dist/components/Row/index.js.map +1 -0
- package/dist/components/RuleSearchPicker/index.js +45 -0
- package/dist/components/RuleSearchPicker/index.js.map +1 -0
- package/dist/components/ScoreBar/index.js +7 -0
- package/dist/components/ScoreBar/index.js.map +1 -0
- package/dist/components/SegmentedPicker/index.js +45 -0
- package/dist/components/SegmentedPicker/index.js.map +1 -0
- package/dist/components/SegmentedToggle/index.js +7 -0
- package/dist/components/SegmentedToggle/index.js.map +1 -0
- package/dist/components/Select/index.js +45 -0
- package/dist/components/Select/index.js.map +1 -0
- package/dist/components/SelectTree/index.js +50 -0
- package/dist/components/SelectTree/index.js.map +1 -0
- package/dist/components/Selector/index.js +7 -0
- package/dist/components/Selector/index.js.map +1 -0
- package/dist/components/StatusTag/index.js +7 -0
- package/dist/components/StatusTag/index.js.map +1 -0
- package/dist/components/Stepper/index.js +7 -0
- package/dist/components/Stepper/index.js.map +1 -0
- package/dist/components/Switch/index.js +7 -0
- package/dist/components/Switch/index.js.map +1 -0
- package/dist/components/SyncChip/index.js +45 -0
- package/dist/components/SyncChip/index.js.map +1 -0
- package/dist/components/Table/index.js +45 -0
- package/dist/components/Table/index.js.map +1 -0
- package/dist/components/Tabs/index.js +7 -0
- package/dist/components/Tabs/index.js.map +1 -0
- package/dist/components/Tag/index.js +7 -0
- package/dist/components/Tag/index.js.map +1 -0
- package/dist/components/Toast/index.js +2 -0
- package/dist/components/Toast/index.js.map +1 -0
- package/dist/components/Tooltip/index.js +7 -0
- package/dist/components/Tooltip/index.js.map +1 -0
- package/dist/components/TourGuide/index.js +7 -0
- package/dist/components/TourGuide/index.js.map +1 -0
- package/dist/components/Waypoint/index.js +24 -0
- package/dist/components/Waypoint/index.js.map +1 -0
- package/dist/fonts/IBMPlexMono-400-latin-ext.woff2 +0 -0
- package/dist/fonts/IBMPlexMono-400-latin.woff2 +0 -0
- package/dist/fonts/IBMPlexMono-500-latin-ext.woff2 +0 -0
- package/dist/fonts/IBMPlexMono-500-latin.woff2 +0 -0
- package/dist/fonts/Inter-Variable-latin-ext.woff2 +0 -0
- package/dist/fonts/Inter-Variable-latin.woff2 +0 -0
- package/dist/fonts/Lexend-Variable-latin-ext.woff2 +0 -0
- package/dist/fonts/Lexend-Variable-latin.woff2 +0 -0
- package/package.json +2 -2
- package/dist/emails/balance-sheet-finalized/email-layout.d.ts +0 -46
- package/dist/emails/balance-sheet-finalized/email-layout.js +0 -180
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Layout base de email no padrao do design system Gyra+ Toolbox
|
|
4
|
-
* (claude design — gyra-toolbox-design-system). Tokens: azul #1256FF
|
|
5
|
-
* (acao/primary), teal #1FB58A (accent), roxo #7C4EFF (IA/parecer),
|
|
6
|
-
* neutrals Apple-gray, fonte Inter.
|
|
7
|
-
*
|
|
8
|
-
* Reutilizavel: cada email passa titulo, paragrafos, destaques (chips),
|
|
9
|
-
* um bloco opcional "Parecer de IA" (faixa roxa) e botoes — o HTML
|
|
10
|
-
* completo (logo, card, tipografia, footer) e' montado aqui.
|
|
11
|
-
*
|
|
12
|
-
* Email-safe: tabelas + inline-style (clients ignoram <style> externo,
|
|
13
|
-
* flexbox e Material Symbols). Gradientes tem fallback solido.
|
|
14
|
-
*/
|
|
15
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.buildEmail = buildEmail;
|
|
17
|
-
const C = {
|
|
18
|
-
blue: '#1256FF',
|
|
19
|
-
teal: '#1FB58A',
|
|
20
|
-
aiPurple: '#7C4EFF',
|
|
21
|
-
aiPurpleText: '#6635E0',
|
|
22
|
-
bg: '#F5F5F7',
|
|
23
|
-
card: '#FFFFFF',
|
|
24
|
-
fg1: '#1D1D1F',
|
|
25
|
-
fg2: '#636366',
|
|
26
|
-
fg3: '#8E8E93',
|
|
27
|
-
border: '#D2D2D7',
|
|
28
|
-
borderSubtle: '#E8E8ED',
|
|
29
|
-
aiCardBg: '#F6F4FF', // flatten do gradiente roxo (fallback Outlook)
|
|
30
|
-
aiBorder: 'rgba(124,78,255,0.22)',
|
|
31
|
-
};
|
|
32
|
-
const VERDICT = {
|
|
33
|
-
ok: { bg: '#E8F9ED', color: '#1A7D37' },
|
|
34
|
-
warn: { bg: '#FFF4E0', color: '#946200' },
|
|
35
|
-
danger: { bg: '#FFEDEC', color: '#C93430' },
|
|
36
|
-
info: { bg: '#EBF4FF', color: '#0055D4' },
|
|
37
|
-
};
|
|
38
|
-
const FONT = "'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Arial,sans-serif";
|
|
39
|
-
const LOGO_URL = 'https://gyra-file-prod.s3.us-west-2.amazonaws.com/assets/gyra-logo-color.png';
|
|
40
|
-
const esc = (s) => String(s ?? '')
|
|
41
|
-
.replace(/&/g, '&')
|
|
42
|
-
.replace(/</g, '<')
|
|
43
|
-
.replace(/>/g, '>')
|
|
44
|
-
.replace(/"/g, '"')
|
|
45
|
-
.replace(/'/g, ''');
|
|
46
|
-
/**
|
|
47
|
-
* So' permite http(s). Bloqueia schemes perigosos (javascript:, data:)
|
|
48
|
-
* que poderiam virar href executavel. URL invalida vira '#'.
|
|
49
|
-
*/
|
|
50
|
-
function safeUrl(url) {
|
|
51
|
-
try {
|
|
52
|
-
const u = new URL(String(url));
|
|
53
|
-
return u.protocol === 'http:' || u.protocol === 'https:' ? u.href : '#';
|
|
54
|
-
}
|
|
55
|
-
catch {
|
|
56
|
-
return '#';
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
function renderButton(btn) {
|
|
60
|
-
const isPrimary = (btn.variant ?? 'primary') === 'primary';
|
|
61
|
-
const bg = isPrimary ? C.blue : C.card;
|
|
62
|
-
const color = isPrimary ? '#FFFFFF' : C.blue;
|
|
63
|
-
const border = isPrimary ? C.blue : C.border;
|
|
64
|
-
return `
|
|
65
|
-
<table role="presentation" cellpadding="0" cellspacing="0" style="margin:8px 8px 0 0;display:inline-block;">
|
|
66
|
-
<tr>
|
|
67
|
-
<td style="border-radius:10px;background:${bg};border:1px solid ${border};">
|
|
68
|
-
<a href="${esc(safeUrl(btn.url))}" target="_blank"
|
|
69
|
-
style="display:inline-block;padding:12px 22px;font-family:${FONT};font-size:14px;font-weight:600;color:${color};text-decoration:none;border-radius:10px;">
|
|
70
|
-
${esc(btn.label)}
|
|
71
|
-
</a>
|
|
72
|
-
</td>
|
|
73
|
-
</tr>
|
|
74
|
-
</table>`;
|
|
75
|
-
}
|
|
76
|
-
function renderHighlight(h, widthPct) {
|
|
77
|
-
return `
|
|
78
|
-
<td width="${widthPct}%" style="padding:6px;" valign="top">
|
|
79
|
-
<table role="presentation" width="100%" cellpadding="0" cellspacing="0"
|
|
80
|
-
style="background:#FAFAFA;border:1px solid ${C.borderSubtle};border-radius:12px;">
|
|
81
|
-
<tr><td style="padding:14px 16px;font-family:${FONT};">
|
|
82
|
-
<div style="font-size:12px;color:${C.fg2};margin-bottom:4px;">${esc(h.label)}</div>
|
|
83
|
-
<div style="font-size:22px;font-weight:700;color:${h.color || C.fg1};font-family:'Lexend',${FONT};">${esc(h.value)}</div>
|
|
84
|
-
</td></tr>
|
|
85
|
-
</table>
|
|
86
|
-
</td>`;
|
|
87
|
-
}
|
|
88
|
-
function renderAiParecer(p) {
|
|
89
|
-
const v = p.verdict
|
|
90
|
-
? (() => {
|
|
91
|
-
const t = VERDICT[p.verdictTone || 'info'];
|
|
92
|
-
// table/td (Outlook ignora padding/border-radius em <span>).
|
|
93
|
-
return `<table role="presentation" cellpadding="0" cellspacing="0" style="display:inline-block;"><tr>
|
|
94
|
-
<td style="background:${t.bg};border-radius:999px;padding:4px 10px;font-family:${FONT};font-size:11px;font-weight:700;letter-spacing:0.04em;text-transform:uppercase;color:${t.color};white-space:nowrap;">${esc(p.verdict)}</td></tr></table>`;
|
|
95
|
-
})()
|
|
96
|
-
: '';
|
|
97
|
-
return `
|
|
98
|
-
<table role="presentation" width="100%" cellpadding="0" cellspacing="0"
|
|
99
|
-
style="margin:18px 0 4px;background:${C.aiCardBg};border:1px solid ${C.aiBorder};border-radius:12px;">
|
|
100
|
-
<tr><td style="padding:16px 18px;font-family:${FONT};">
|
|
101
|
-
<table role="presentation" width="100%" cellpadding="0" cellspacing="0"><tr>
|
|
102
|
-
<td valign="middle" width="28">
|
|
103
|
-
<div style="width:22px;height:22px;border-radius:50%;background:${C.aiPurple};color:#fff;text-align:center;line-height:22px;font-size:13px;">✦</div>
|
|
104
|
-
</td>
|
|
105
|
-
<td valign="middle" style="padding-left:8px;">
|
|
106
|
-
<span style="font-size:11px;font-weight:700;letter-spacing:0.06em;text-transform:uppercase;color:${C.aiPurpleText};">Parecer GYRA+IA</span>
|
|
107
|
-
</td>
|
|
108
|
-
<td valign="middle" align="right">${v}</td>
|
|
109
|
-
</tr></table>
|
|
110
|
-
<p style="margin:10px 0 0;font-size:14px;line-height:1.55;color:${C.fg2};">${esc(p.text)}</p>
|
|
111
|
-
${p.footer
|
|
112
|
-
? `<div style="margin-top:10px;padding-top:10px;border-top:1px dashed ${C.aiBorder};font-size:11px;color:${C.fg3};">${esc(p.footer)}</div>`
|
|
113
|
-
: ''}
|
|
114
|
-
</td></tr>
|
|
115
|
-
</table>`;
|
|
116
|
-
}
|
|
117
|
-
function buildEmail(input) {
|
|
118
|
-
const { preheader, greeting, title, paragraphs = [], highlights = [], aiParecer, buttons = [], footerNote, } = input;
|
|
119
|
-
const highlightWidth = highlights.length
|
|
120
|
-
? Math.floor(100 / highlights.length)
|
|
121
|
-
: 100;
|
|
122
|
-
const highlightsRow = highlights.length
|
|
123
|
-
? `<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="margin:8px 0 4px;"><tr>${highlights
|
|
124
|
-
.map((h) => renderHighlight(h, highlightWidth))
|
|
125
|
-
.join('')}</tr></table>`
|
|
126
|
-
: '';
|
|
127
|
-
const paragraphsHtml = paragraphs
|
|
128
|
-
.map((p) => `<p style="margin:0 0 14px;font-family:${FONT};font-size:15px;line-height:1.6;color:${C.fg2};">${esc(p)}</p>`)
|
|
129
|
-
.join('');
|
|
130
|
-
const buttonsHtml = buttons.length
|
|
131
|
-
? `<div style="margin-top:18px;">${buttons.map(renderButton).join('')}</div>`
|
|
132
|
-
: '';
|
|
133
|
-
return `<!DOCTYPE html>
|
|
134
|
-
<html lang="pt-BR">
|
|
135
|
-
<head>
|
|
136
|
-
<meta charset="utf-8" />
|
|
137
|
-
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
|
|
138
|
-
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
139
|
-
<title>${esc(title)}</title>
|
|
140
|
-
</head>
|
|
141
|
-
<body style="margin:0;padding:0;background:${C.bg};">
|
|
142
|
-
${preheader
|
|
143
|
-
? `<div style="display:none;max-height:0;overflow:hidden;opacity:0;">${esc(preheader)}</div>`
|
|
144
|
-
: ''}
|
|
145
|
-
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="background:${C.bg};padding:24px 0;">
|
|
146
|
-
<tr>
|
|
147
|
-
<td align="center">
|
|
148
|
-
<table role="presentation" width="600" cellpadding="0" cellspacing="0" style="width:600px;max-width:92%;">
|
|
149
|
-
<tr>
|
|
150
|
-
<td style="padding:8px 4px 20px;">
|
|
151
|
-
<img src="${LOGO_URL}" alt="GYRA+" height="30" style="height:30px;display:block;" />
|
|
152
|
-
</td>
|
|
153
|
-
</tr>
|
|
154
|
-
<tr>
|
|
155
|
-
<td style="background:${C.card};border:1px solid ${C.borderSubtle};border-radius:16px;padding:32px;">
|
|
156
|
-
${greeting
|
|
157
|
-
? `<p style="margin:0 0 6px;font-family:${FONT};font-size:14px;color:${C.fg2};">${esc(greeting)}</p>`
|
|
158
|
-
: ''}
|
|
159
|
-
<h1 style="margin:0 0 18px;font-family:'Lexend',${FONT};font-size:23px;line-height:1.3;color:${C.fg1};">${esc(title)}</h1>
|
|
160
|
-
${paragraphsHtml}
|
|
161
|
-
${highlightsRow}
|
|
162
|
-
${aiParecer ? renderAiParecer(aiParecer) : ''}
|
|
163
|
-
${buttonsHtml}
|
|
164
|
-
</td>
|
|
165
|
-
</tr>
|
|
166
|
-
<tr>
|
|
167
|
-
<td style="padding:20px 8px;font-family:${FONT};font-size:12px;line-height:1.5;color:${C.fg3};">
|
|
168
|
-
${footerNote
|
|
169
|
-
? `<p style="margin:0 0 8px;">${esc(footerNote)}</p>`
|
|
170
|
-
: ''}
|
|
171
|
-
<p style="margin:0;">GYRA+ • Esta é uma mensagem automática, não responda este email.</p>
|
|
172
|
-
</td>
|
|
173
|
-
</tr>
|
|
174
|
-
</table>
|
|
175
|
-
</td>
|
|
176
|
-
</tr>
|
|
177
|
-
</table>
|
|
178
|
-
</body>
|
|
179
|
-
</html>`;
|
|
180
|
-
}
|