@gyramais/gyra-design 0.2.33 → 0.2.35

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 (122) hide show
  1. package/dist/emails/balance-sheet-finalized/email-layout.d.ts +46 -0
  2. package/dist/emails/balance-sheet-finalized/email-layout.js +180 -0
  3. package/dist/index.css +0 -2
  4. package/package.json +2 -2
  5. package/dist/components/Chart/index.js +0 -29
  6. package/dist/components/Chart/index.js.map +0 -1
  7. package/dist/components/ChatWidget/index.js +0 -45
  8. package/dist/components/ChatWidget/index.js.map +0 -1
  9. package/dist/components/Checkbox/index.js +0 -45
  10. package/dist/components/Checkbox/index.js.map +0 -1
  11. package/dist/components/Col/index.js +0 -7
  12. package/dist/components/Col/index.js.map +0 -1
  13. package/dist/components/Collapse/index.js +0 -45
  14. package/dist/components/Collapse/index.js.map +0 -1
  15. package/dist/components/ContextMenu/index.js +0 -7
  16. package/dist/components/ContextMenu/index.js.map +0 -1
  17. package/dist/components/DistributionBar/index.js +0 -7
  18. package/dist/components/DistributionBar/index.js.map +0 -1
  19. package/dist/components/Divider/index.js +0 -7
  20. package/dist/components/Divider/index.js.map +0 -1
  21. package/dist/components/Drawer/index.js +0 -45
  22. package/dist/components/Drawer/index.js.map +0 -1
  23. package/dist/components/DropdownMenu/index.js +0 -7
  24. package/dist/components/DropdownMenu/index.js.map +0 -1
  25. package/dist/components/Email/index.js +0 -2
  26. package/dist/components/Email/index.js.map +0 -1
  27. package/dist/components/Empty/index.js +0 -45
  28. package/dist/components/Empty/index.js.map +0 -1
  29. package/dist/components/Filter/index.js +0 -50
  30. package/dist/components/Filter/index.js.map +0 -1
  31. package/dist/components/FloatingCard/index.js +0 -45
  32. package/dist/components/FloatingCard/index.js.map +0 -1
  33. package/dist/components/Form/index.js +0 -2
  34. package/dist/components/Form/index.js.map +0 -1
  35. package/dist/components/Gauge/index.js +0 -7
  36. package/dist/components/Gauge/index.js.map +0 -1
  37. package/dist/components/HoverCard/index.js +0 -7
  38. package/dist/components/HoverCard/index.js.map +0 -1
  39. package/dist/components/Icon/index.js +0 -7
  40. package/dist/components/Icon/index.js.map +0 -1
  41. package/dist/components/IconDisplay/index.js +0 -7
  42. package/dist/components/IconDisplay/index.js.map +0 -1
  43. package/dist/components/Information/index.js +0 -7
  44. package/dist/components/Information/index.js.map +0 -1
  45. package/dist/components/Input/index.js +0 -25
  46. package/dist/components/Input/index.js.map +0 -1
  47. package/dist/components/Label/index.js +0 -2
  48. package/dist/components/Label/index.js.map +0 -1
  49. package/dist/components/Layout/index.js +0 -7
  50. package/dist/components/Layout/index.js.map +0 -1
  51. package/dist/components/List/index.js +0 -45
  52. package/dist/components/List/index.js.map +0 -1
  53. package/dist/components/Loading/index.js +0 -7
  54. package/dist/components/Loading/index.js.map +0 -1
  55. package/dist/components/Logo/index.js +0 -7
  56. package/dist/components/Logo/index.js.map +0 -1
  57. package/dist/components/Menubar/index.js +0 -7
  58. package/dist/components/Menubar/index.js.map +0 -1
  59. package/dist/components/Modal/index.js +0 -63
  60. package/dist/components/Modal/index.js.map +0 -1
  61. package/dist/components/MultiSelectPicker/index.js +0 -45
  62. package/dist/components/MultiSelectPicker/index.js.map +0 -1
  63. package/dist/components/OperatorPicker/index.js +0 -45
  64. package/dist/components/OperatorPicker/index.js.map +0 -1
  65. package/dist/components/PickerPopover/index.js +0 -45
  66. package/dist/components/PickerPopover/index.js.map +0 -1
  67. package/dist/components/Popover/index.js +0 -7
  68. package/dist/components/Popover/index.js.map +0 -1
  69. package/dist/components/ProcessingChip/index.js +0 -7
  70. package/dist/components/ProcessingChip/index.js.map +0 -1
  71. package/dist/components/Progress/index.js +0 -7
  72. package/dist/components/Progress/index.js.map +0 -1
  73. package/dist/components/RadioGroup/index.js +0 -7
  74. package/dist/components/RadioGroup/index.js.map +0 -1
  75. package/dist/components/RichInput/index.js +0 -12
  76. package/dist/components/RichInput/index.js.map +0 -1
  77. package/dist/components/Row/index.js +0 -7
  78. package/dist/components/Row/index.js.map +0 -1
  79. package/dist/components/RuleSearchPicker/index.js +0 -45
  80. package/dist/components/RuleSearchPicker/index.js.map +0 -1
  81. package/dist/components/ScoreBar/index.js +0 -7
  82. package/dist/components/ScoreBar/index.js.map +0 -1
  83. package/dist/components/SegmentedPicker/index.js +0 -45
  84. package/dist/components/SegmentedPicker/index.js.map +0 -1
  85. package/dist/components/SegmentedToggle/index.js +0 -7
  86. package/dist/components/SegmentedToggle/index.js.map +0 -1
  87. package/dist/components/Select/index.js +0 -45
  88. package/dist/components/Select/index.js.map +0 -1
  89. package/dist/components/SelectTree/index.js +0 -50
  90. package/dist/components/SelectTree/index.js.map +0 -1
  91. package/dist/components/Selector/index.js +0 -7
  92. package/dist/components/Selector/index.js.map +0 -1
  93. package/dist/components/StatusTag/index.js +0 -7
  94. package/dist/components/StatusTag/index.js.map +0 -1
  95. package/dist/components/Stepper/index.js +0 -7
  96. package/dist/components/Stepper/index.js.map +0 -1
  97. package/dist/components/Switch/index.js +0 -7
  98. package/dist/components/Switch/index.js.map +0 -1
  99. package/dist/components/SyncChip/index.js +0 -45
  100. package/dist/components/SyncChip/index.js.map +0 -1
  101. package/dist/components/Table/index.js +0 -45
  102. package/dist/components/Table/index.js.map +0 -1
  103. package/dist/components/Tabs/index.js +0 -7
  104. package/dist/components/Tabs/index.js.map +0 -1
  105. package/dist/components/Tag/index.js +0 -7
  106. package/dist/components/Tag/index.js.map +0 -1
  107. package/dist/components/Toast/index.js +0 -2
  108. package/dist/components/Toast/index.js.map +0 -1
  109. package/dist/components/Tooltip/index.js +0 -7
  110. package/dist/components/Tooltip/index.js.map +0 -1
  111. package/dist/components/TourGuide/index.js +0 -7
  112. package/dist/components/TourGuide/index.js.map +0 -1
  113. package/dist/components/Waypoint/index.js +0 -24
  114. package/dist/components/Waypoint/index.js.map +0 -1
  115. package/dist/fonts/IBMPlexMono-400-latin-ext.woff2 +0 -0
  116. package/dist/fonts/IBMPlexMono-400-latin.woff2 +0 -0
  117. package/dist/fonts/IBMPlexMono-500-latin-ext.woff2 +0 -0
  118. package/dist/fonts/IBMPlexMono-500-latin.woff2 +0 -0
  119. package/dist/fonts/Inter-Variable-latin-ext.woff2 +0 -0
  120. package/dist/fonts/Inter-Variable-latin.woff2 +0 -0
  121. package/dist/fonts/Lexend-Variable-latin-ext.woff2 +0 -0
  122. package/dist/fonts/Lexend-Variable-latin.woff2 +0 -0
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Layout base de email no padrao do design system Gyra+ Toolbox
3
+ * (claude design — gyra-toolbox-design-system). Tokens: azul #1256FF
4
+ * (acao/primary), teal #1FB58A (accent), roxo #7C4EFF (IA/parecer),
5
+ * neutrals Apple-gray, fonte Inter.
6
+ *
7
+ * Reutilizavel: cada email passa titulo, paragrafos, destaques (chips),
8
+ * um bloco opcional "Parecer de IA" (faixa roxa) e botoes — o HTML
9
+ * completo (logo, card, tipografia, footer) e' montado aqui.
10
+ *
11
+ * Email-safe: tabelas + inline-style (clients ignoram <style> externo,
12
+ * flexbox e Material Symbols). Gradientes tem fallback solido.
13
+ */
14
+ export type EmailButton = {
15
+ label: string;
16
+ url: string;
17
+ variant?: 'primary' | 'secondary';
18
+ };
19
+ export type EmailHighlight = {
20
+ label: string;
21
+ value: string;
22
+ /** cor do valor (ex: risco). Default: tinta padrao. */
23
+ color?: string;
24
+ };
25
+ export type AiParecerTone = 'ok' | 'warn' | 'danger' | 'info';
26
+ export type EmailAiParecer = {
27
+ /** chip de veredito (ex: "Médio", "Consistente"). */
28
+ verdict?: string;
29
+ verdictTone?: AiParecerTone;
30
+ /** corpo do parecer. */
31
+ text: string;
32
+ /** rodape (ex: "GYRA+IA · Confiança 96%"). */
33
+ footer?: string;
34
+ };
35
+ export type EmailLayoutInput = {
36
+ preheader?: string;
37
+ greeting?: string;
38
+ title: string;
39
+ paragraphs?: string[];
40
+ highlights?: EmailHighlight[];
41
+ /** Faixa "Parecer de IA" (gradiente roxo→azul). */
42
+ aiParecer?: EmailAiParecer;
43
+ buttons?: EmailButton[];
44
+ footerNote?: string;
45
+ };
46
+ export declare function buildEmail(input: EmailLayoutInput): string;
@@ -0,0 +1,180 @@
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, '&amp;')
42
+ .replace(/</g, '&lt;')
43
+ .replace(/>/g, '&gt;')
44
+ .replace(/"/g, '&quot;')
45
+ .replace(/'/g, '&#39;');
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;">&#10022;</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
+ }
package/dist/index.css CHANGED
@@ -10166,7 +10166,6 @@ h6 {
10166
10166
 
10167
10167
  /* CARD STYLE — v2 flat: 1px hairline borders, no shadows */
10168
10168
  .gyramais-table-container.gyramais-table-card-container {
10169
- overflow: hidden;
10170
10169
  border-radius: 12px;
10171
10170
  border-width: 1px;
10172
10171
  border-color: var(--color-border-secondary);
@@ -10307,7 +10306,6 @@ h6 {
10307
10306
  .gyramais-table-container,
10308
10307
  .gyramais-table-container.gyramais-table-card-container,
10309
10308
  .gyramais-table-container.gyramais-table-bordered-container {
10310
- overflow-x: auto !important;
10311
10309
  -webkit-overflow-scrolling: touch;
10312
10310
  }
10313
10311
  .gyramais-table-container table {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gyramais/gyra-design",
3
- "version": "0.2.33",
3
+ "version": "0.2.35",
4
4
  "description": "Gyramais Design System",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",
@@ -107,4 +107,4 @@
107
107
  "storybook": "8.1.11",
108
108
  "tailwindcss": "^3.3.5"
109
109
  }
110
- }
110
+ }