lib-pixelbuild 0.2.1 → 0.2.3

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 (98) hide show
  1. package/dist/builders/PageBuilder.js +42 -26
  2. package/dist/components/ButtonsComponent.d.ts +5 -0
  3. package/dist/components/ButtonsComponent.js +45 -0
  4. package/dist/components/CardComponent.js +31 -6
  5. package/dist/components/FormComponent.js +9 -4
  6. package/dist/components/{CarouselComponent.d.ts → IconComponent.d.ts} +3 -2
  7. package/dist/components/IconComponent.js +12 -0
  8. package/dist/components/ImageComponent.d.ts +5 -0
  9. package/dist/components/ImageComponent.js +18 -0
  10. package/dist/components/ListComponent.js +5 -2
  11. package/dist/components/LoadingComponent.js +2 -2
  12. package/dist/components/MapComponent.js +11 -12
  13. package/dist/components/SliderComponent.d.ts +0 -1
  14. package/dist/components/SliderComponent.js +173 -93
  15. package/dist/components/SocialIconsComponent.d.ts +3 -2
  16. package/dist/components/SocialIconsComponent.js +20 -16
  17. package/dist/components/TextComponent.js +5 -3
  18. package/dist/constants/ComponentEnum.d.ts +2 -0
  19. package/dist/constants/ComponentEnum.js +2 -0
  20. package/dist/designSystem/baseCss.d.ts +8 -0
  21. package/dist/designSystem/baseCss.js +406 -0
  22. package/dist/designSystem/buildSiteCss.d.ts +8 -0
  23. package/dist/designSystem/buildSiteCss.js +11 -0
  24. package/dist/designSystem/index.d.ts +6 -0
  25. package/dist/designSystem/index.js +5 -0
  26. package/dist/designSystem/theme.d.ts +9 -0
  27. package/dist/designSystem/theme.js +11 -0
  28. package/dist/designSystem/themeVars.d.ts +8 -0
  29. package/dist/designSystem/themeVars.js +9 -0
  30. package/dist/designSystem/tokens.d.ts +82 -0
  31. package/dist/designSystem/tokens.js +144 -0
  32. package/dist/elements/AlertElement.js +4 -4
  33. package/dist/elements/ButtonElement.js +21 -7
  34. package/dist/elements/ElementColWrapper.js +11 -2
  35. package/dist/elements/IconElement.js +5 -5
  36. package/dist/elements/IconMap.js +101 -28
  37. package/dist/elements/InputElement.js +10 -9
  38. package/dist/elements/TextElement.js +5 -1
  39. package/dist/factories/ButtonActionFactory.d.ts +3 -4
  40. package/dist/factories/ButtonActionFactory.js +2 -2
  41. package/dist/factories/ComponentFactory.d.ts +2 -1
  42. package/dist/factories/ComponentFactory.js +29 -12
  43. package/dist/index.d.ts +20 -5
  44. package/dist/index.js +15 -1
  45. package/dist/layouts/Footer.js +13 -2
  46. package/dist/layouts/Header.js +43 -16
  47. package/dist/layouts/SiteLayout.d.ts +8 -1
  48. package/dist/layouts/SiteLayout.js +36 -3
  49. package/dist/renderers/BlockRenderer.d.ts +8 -0
  50. package/dist/renderers/BlockRenderer.js +68 -0
  51. package/dist/services/EmailService.d.ts +14 -5
  52. package/dist/services/EmailService.js +21 -24
  53. package/dist/stores/UseFormStore.d.ts +7 -2
  54. package/dist/stores/UseFormStore.js +8 -3
  55. package/dist/types/{SectionColumnType.d.ts → BlockType.d.ts} +2 -6
  56. package/dist/types/ComponentType.d.ts +3 -0
  57. package/dist/types/ElementType.d.ts +1 -0
  58. package/dist/types/EmailSettingsType.d.ts +5 -0
  59. package/dist/types/HeaderPropertiesType.d.ts +1 -0
  60. package/dist/types/MailBodyType.d.ts +2 -0
  61. package/dist/types/PageType.d.ts +2 -2
  62. package/dist/types/SocialPropertiesType.d.ts +3 -11
  63. package/dist/types/StylesType.d.ts +12 -0
  64. package/dist/types/WebsitePropertiesType.d.ts +2 -0
  65. package/dist/types/WebsiteType.d.ts +6 -0
  66. package/dist/ui/PbAlert.d.ts +10 -0
  67. package/dist/ui/PbAlert.js +8 -0
  68. package/dist/ui/PbButton.d.ts +20 -0
  69. package/dist/ui/PbButton.js +20 -0
  70. package/dist/ui/PbCol.d.ts +14 -0
  71. package/dist/ui/PbCol.js +43 -0
  72. package/dist/ui/PbContainer.d.ts +7 -0
  73. package/dist/ui/PbContainer.js +17 -0
  74. package/dist/ui/PbRow.d.ts +7 -0
  75. package/dist/ui/PbRow.js +17 -0
  76. package/dist/ui/PbSpinner.d.ts +3 -0
  77. package/dist/ui/PbSpinner.js +5 -0
  78. package/dist/ui/index.d.ts +6 -0
  79. package/dist/ui/index.js +6 -0
  80. package/dist/utils/emailTemplate.d.ts +7 -0
  81. package/dist/utils/emailTemplate.js +66 -0
  82. package/dist/utils/fonts.d.ts +2 -0
  83. package/dist/utils/fonts.js +10 -0
  84. package/dist/utils/imageCustomization.d.ts +3 -0
  85. package/dist/utils/imageCustomization.js +9 -0
  86. package/dist/utils/responsiveProperties.d.ts +2 -0
  87. package/dist/utils/responsiveProperties.js +28 -0
  88. package/dist/utils/responsiveStyles.d.ts +6 -0
  89. package/dist/utils/responsiveStyles.js +73 -0
  90. package/package.json +1 -8
  91. package/dist/components/CarouselComponent.js +0 -6
  92. package/dist/layouts/Menu.d.ts +0 -5
  93. package/dist/layouts/Menu.js +0 -34
  94. package/dist/renderers/SectionRenderer.d.ts +0 -6
  95. package/dist/renderers/SectionRenderer.js +0 -73
  96. package/dist/types/SectionType.d.ts +0 -10
  97. /package/dist/types/{SectionColumnType.js → BlockType.js} +0 -0
  98. /package/dist/types/{SectionType.js → EmailSettingsType.js} +0 -0
@@ -0,0 +1,406 @@
1
+ /**
2
+ * CSS base do site público (sem Bootstrap).
3
+ *
4
+ * Classes utilitárias e de componentes usadas pelo `lib-pixelbuild`. Todos os
5
+ * valores de destaque usam `var(--pb-*)` com fallback, então o design system
6
+ * (Etapa 1) sobrescreve os tokens sem tocar nestes estilos.
7
+ */
8
+ export const baseCss = `
9
+ /* ─── Reset e tipografia base ─────────────────────────────── */
10
+ .pb-root, .pb-root *, .pb-root *::before, .pb-root *::after {
11
+ box-sizing: border-box;
12
+ }
13
+ .pb-root {
14
+ margin: 0;
15
+ font-family: var(--pb-font-family, 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif);
16
+ font-size: var(--pb-font-size-base, 16px);
17
+ line-height: var(--pb-line-height, 1.6);
18
+ color: var(--pb-color-text, #1f2937);
19
+ background-color: var(--pb-color-background, #ffffff);
20
+ -webkit-font-smoothing: antialiased;
21
+ text-rendering: optimizeLegibility;
22
+ }
23
+ .pb-root h1, .pb-root h2, .pb-root h3, .pb-root h4, .pb-root h5, .pb-root h6 {
24
+ margin: 0 0 0.5em;
25
+ font-weight: var(--pb-font-weight-bold, 700);
26
+ line-height: 1.2;
27
+ color: var(--pb-color-heading, #111827);
28
+ }
29
+ .pb-root img {
30
+ max-width: 100%;
31
+ height: auto;
32
+ }
33
+ .pb-root a {
34
+ color: var(--pb-color-primary, #f58220);
35
+ text-decoration: none;
36
+ }
37
+ .pb-root a:hover {
38
+ text-decoration: underline;
39
+ }
40
+
41
+ /* ─── Layout: container / grade ───────────────────────────── */
42
+ .pb-container {
43
+ width: 100%;
44
+ margin-inline: auto;
45
+ padding-inline: var(--pb-gutter, 1.5rem);
46
+ }
47
+ .pb-container-fluid {
48
+ max-width: none !important;
49
+ padding-inline: var(--pb-gutter, 1.5rem);
50
+ }
51
+ @media (min-width: 576px) {
52
+ .pb-container { max-width: 540px; }
53
+ }
54
+ @media (min-width: 768px) {
55
+ .pb-container { max-width: 720px; }
56
+ }
57
+ @media (min-width: 992px) {
58
+ .pb-container { max-width: 960px; }
59
+ }
60
+ @media (min-width: 1200px) {
61
+ .pb-container { max-width: 1140px; }
62
+ }
63
+ @media (min-width: 1400px) {
64
+ .pb-container { max-width: 1320px; }
65
+ }
66
+
67
+ .pb-row {
68
+ display: grid;
69
+ grid-template-columns: repeat(12, minmax(0, 1fr));
70
+ gap: var(--pb-gutter, 1.5rem);
71
+ }
72
+ .pb-col {
73
+ min-width: 0;
74
+ }
75
+
76
+ /* ─── Botões ──────────────────────────────────────────────── */
77
+ .pb-button {
78
+ display: inline-flex;
79
+ align-items: center;
80
+ justify-content: center;
81
+ gap: 0.5em;
82
+ padding: 0.5em 1.25em;
83
+ font-family: inherit;
84
+ font-size: 1rem;
85
+ font-weight: var(--pb-font-weight-bold, 700);
86
+ line-height: 1.5;
87
+ text-align: center;
88
+ text-decoration: none;
89
+ border: 1px solid transparent;
90
+ border-radius: var(--pb-radius-md, 8px);
91
+ cursor: pointer;
92
+ transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
93
+ }
94
+ .pb-button:hover { text-decoration: none; }
95
+ .pb-button:disabled {
96
+ opacity: 0.55;
97
+ cursor: not-allowed;
98
+ }
99
+
100
+ .pb-button-primary {
101
+ background-color: var(--pb-color-primary, #f58220);
102
+ border-color: var(--pb-color-primary, #f58220);
103
+ color: #ffffff;
104
+ }
105
+ .pb-button-primary:hover:not(:disabled) {
106
+ background-color: color-mix(in srgb, var(--pb-color-primary, #f58220) 88%, #000);
107
+ border-color: color-mix(in srgb, var(--pb-color-primary, #f58220) 88%, #000);
108
+ }
109
+ .pb-button-secondary {
110
+ background-color: var(--pb-color-secondary, #64748b);
111
+ border-color: var(--pb-color-secondary, #64748b);
112
+ color: #ffffff;
113
+ }
114
+ .pb-button-success {
115
+ background-color: var(--pb-color-success, #16a34a);
116
+ border-color: var(--pb-color-success, #16a34a);
117
+ color: #ffffff;
118
+ }
119
+ .pb-button-danger {
120
+ background-color: var(--pb-color-danger, #dc2626);
121
+ border-color: var(--pb-color-danger, #dc2626);
122
+ color: #ffffff;
123
+ }
124
+ .pb-button-warning {
125
+ background-color: var(--pb-color-warning, #f59e0b);
126
+ border-color: var(--pb-color-warning, #f59e0b);
127
+ color: #1f2937;
128
+ }
129
+ .pb-button-info {
130
+ background-color: var(--pb-color-info, #0ea5e9);
131
+ border-color: var(--pb-color-info, #0ea5e9);
132
+ color: #ffffff;
133
+ }
134
+ .pb-button-light {
135
+ background-color: var(--pb-color-light, #f8fafc);
136
+ border-color: var(--pb-color-border, #e5e7eb);
137
+ color: var(--pb-color-text, #1f2937);
138
+ }
139
+ .pb-button-dark {
140
+ background-color: var(--pb-color-dark, #0f172a);
141
+ border-color: var(--pb-color-dark, #0f172a);
142
+ color: #ffffff;
143
+ }
144
+ .pb-button-outline-primary {
145
+ background-color: transparent;
146
+ border-color: var(--pb-color-primary, #f58220);
147
+ color: var(--pb-color-primary, #f58220);
148
+ }
149
+ .pb-button-outline-primary:hover:not(:disabled) {
150
+ background-color: var(--pb-color-primary, #f58220);
151
+ color: #ffffff;
152
+ }
153
+ .pb-button-outline-secondary {
154
+ background-color: transparent;
155
+ border-color: var(--pb-color-secondary, #64748b);
156
+ color: var(--pb-color-secondary, #64748b);
157
+ }
158
+ .pb-button-outline-secondary:hover:not(:disabled) {
159
+ background-color: var(--pb-color-secondary, #64748b);
160
+ color: #ffffff;
161
+ }
162
+ .pb-button-link {
163
+ background-color: transparent;
164
+ border-color: transparent;
165
+ color: var(--pb-color-primary, #f58220);
166
+ padding-inline: 0.5em;
167
+ }
168
+ .pb-button-sm {
169
+ padding: 0.375em 0.875em;
170
+ font-size: 0.875rem;
171
+ border-radius: var(--pb-radius-sm, 4px);
172
+ }
173
+ .pb-button-lg {
174
+ padding: 0.625em 1.5em;
175
+ font-size: 1.125rem;
176
+ border-radius: var(--pb-radius-lg, 12px);
177
+ }
178
+
179
+ /* ─── Spinner ─────────────────────────────────────────────── */
180
+ .pb-spinner {
181
+ display: inline-block;
182
+ width: 1.5rem;
183
+ height: 1.5rem;
184
+ border: 0.2em solid currentColor;
185
+ border-right-color: transparent;
186
+ border-radius: 50%;
187
+ animation: pb-spin 0.75s linear infinite;
188
+ vertical-align: -0.25em;
189
+ }
190
+ .pb-spinner-sm {
191
+ width: 1rem;
192
+ height: 1rem;
193
+ border-width: 0.18em;
194
+ }
195
+ @keyframes pb-spin {
196
+ to { transform: rotate(360deg); }
197
+ }
198
+
199
+ /* ─── Alertas ─────────────────────────────────────────────── */
200
+ .pb-alert {
201
+ padding: var(--pb-space-md, 16px) var(--pb-space-lg, 24px);
202
+ border: 1px solid;
203
+ border-radius: var(--pb-radius-md, 8px);
204
+ margin-bottom: var(--pb-space-md, 16px);
205
+ }
206
+ .pb-alert-title {
207
+ font-weight: var(--pb-font-weight-bold, 700);
208
+ margin-bottom: 0.25em;
209
+ }
210
+ .pb-alert-primary {
211
+ background-color: color-mix(in srgb, var(--pb-color-primary, #f58220) 10%, #fff);
212
+ border-color: color-mix(in srgb, var(--pb-color-primary, #f58220) 35%, #fff);
213
+ color: var(--pb-color-text, #1f2937);
214
+ }
215
+ .pb-alert-info {
216
+ background-color: color-mix(in srgb, var(--pb-color-info, #0ea5e9) 10%, #fff);
217
+ border-color: color-mix(in srgb, var(--pb-color-info, #0ea5e9) 35%, #fff);
218
+ color: var(--pb-color-text, #1f2937);
219
+ }
220
+ .pb-alert-success {
221
+ background-color: color-mix(in srgb, var(--pb-color-success, #16a34a) 10%, #fff);
222
+ border-color: color-mix(in srgb, var(--pb-color-success, #16a34a) 35%, #fff);
223
+ color: var(--pb-color-text, #1f2937);
224
+ }
225
+ .pb-alert-warning {
226
+ background-color: color-mix(in srgb, var(--pb-color-warning, #f59e0b) 12%, #fff);
227
+ border-color: color-mix(in srgb, var(--pb-color-warning, #f59e0b) 35%, #fff);
228
+ color: var(--pb-color-text, #1f2937);
229
+ }
230
+ .pb-alert-danger {
231
+ background-color: color-mix(in srgb, var(--pb-color-danger, #dc2626) 10%, #fff);
232
+ border-color: color-mix(in srgb, var(--pb-color-danger, #dc2626) 35%, #fff);
233
+ color: var(--pb-color-text, #1f2937);
234
+ }
235
+ .pb-alert-secondary {
236
+ background-color: var(--pb-color-light, #f8fafc);
237
+ border-color: var(--pb-color-border, #e5e7eb);
238
+ color: var(--pb-color-text, #1f2937);
239
+ }
240
+
241
+ /* ─── Formulários ─────────────────────────────────────────── */
242
+ .pb-form-group {
243
+ margin-bottom: var(--pb-space-md, 16px);
244
+ }
245
+ .pb-form-label {
246
+ display: block;
247
+ margin-bottom: 0.375rem;
248
+ font-weight: var(--pb-font-weight-bold, 700);
249
+ color: var(--pb-color-text, #1f2937);
250
+ }
251
+ .pb-form-control,
252
+ .pb-form-select,
253
+ .pb-form-textarea {
254
+ display: block;
255
+ width: 100%;
256
+ padding: 0.5em 0.75em;
257
+ font-family: inherit;
258
+ font-size: 1rem;
259
+ line-height: 1.5;
260
+ color: var(--pb-color-text, #1f2937);
261
+ background-color: var(--pb-color-surface, #ffffff);
262
+ border: 1px solid var(--pb-color-border, #e5e7eb);
263
+ border-radius: var(--pb-radius-sm, 4px);
264
+ transition: border-color 0.15s ease, box-shadow 0.15s ease;
265
+ }
266
+ .pb-form-control:focus,
267
+ .pb-form-select:focus,
268
+ .pb-form-textarea:focus {
269
+ outline: none;
270
+ border-color: var(--pb-color-primary, #f58220);
271
+ box-shadow: 0 0 0 3px color-mix(in srgb, var(--pb-color-primary, #f58220) 20%, transparent);
272
+ }
273
+ .pb-form-control-invalid,
274
+ .pb-form-select-invalid,
275
+ .pb-form-textarea-invalid {
276
+ border-color: var(--pb-color-danger, #dc2626);
277
+ }
278
+ .pb-invalid-feedback {
279
+ display: block;
280
+ margin-top: 0.375rem;
281
+ font-size: 0.875rem;
282
+ color: var(--pb-color-danger, #dc2626);
283
+ }
284
+ .pb-form-check {
285
+ display: flex;
286
+ align-items: center;
287
+ gap: 0.5rem;
288
+ margin-bottom: 0.5rem;
289
+ }
290
+ .pb-form-check-input {
291
+ width: 1.1em;
292
+ height: 1.1em;
293
+ accent-color: var(--pb-color-primary, #f58220);
294
+ flex-shrink: 0;
295
+ }
296
+ .pb-form-check-label {
297
+ font-weight: normal;
298
+ margin-bottom: 0;
299
+ }
300
+
301
+ /* ─── Header ──────────────────────────────────────────────── */
302
+ .pb-header {
303
+ width: 100%;
304
+ }
305
+ .pb-header-inner {
306
+ display: flex;
307
+ align-items: center;
308
+ justify-content: space-between;
309
+ gap: var(--pb-space-md, 16px);
310
+ flex-wrap: wrap;
311
+ padding-block: var(--pb-space-sm, 8px);
312
+ }
313
+ .pb-brand {
314
+ display: inline-flex;
315
+ align-items: center;
316
+ text-decoration: none;
317
+ }
318
+ .pb-brand img {
319
+ max-height: 56px;
320
+ width: auto;
321
+ }
322
+ .pb-nav {
323
+ display: flex;
324
+ align-items: center;
325
+ gap: 0.5rem;
326
+ flex-wrap: wrap;
327
+ }
328
+ .pb-nav-link {
329
+ display: inline-block;
330
+ padding: 0.5rem 0.75rem;
331
+ color: inherit;
332
+ text-decoration: none;
333
+ font-weight: 500;
334
+ border-bottom: 2px solid transparent;
335
+ transition: color 0.2s ease, border-color 0.2s ease;
336
+ }
337
+ .pb-nav-link:hover {
338
+ text-decoration: none;
339
+ opacity: 0.85;
340
+ }
341
+ .pb-nav-link-active {
342
+ border-bottom-color: currentColor;
343
+ }
344
+ .pb-nav-toggle {
345
+ display: none;
346
+ padding: 0.375rem 0.625rem;
347
+ font-size: 1.25rem;
348
+ line-height: 1;
349
+ background: transparent;
350
+ border: 1px solid var(--pb-color-border, #e5e7eb);
351
+ border-radius: var(--pb-radius-sm, 4px);
352
+ cursor: pointer;
353
+ color: inherit;
354
+ }
355
+ @media (max-width: 991.98px) {
356
+ .pb-nav-toggle { display: inline-flex; align-items: center; }
357
+ .pb-nav { display: none; }
358
+ .pb-nav-open { display: flex; flex-direction: column; width: 100%; }
359
+ }
360
+
361
+ /* ─── Footer ──────────────────────────────────────────────── */
362
+ .pb-footer {
363
+ width: 100%;
364
+ padding-block: var(--pb-space-xl, 32px);
365
+ color: var(--pb-color-text, #1f2937);
366
+ }
367
+ .pb-footer-divider {
368
+ border: none;
369
+ border-top: 1px solid var(--pb-color-border, #e5e7eb);
370
+ margin: var(--pb-space-lg, 24px) 0;
371
+ }
372
+ .pb-social-icons {
373
+ display: flex;
374
+ justify-content: center;
375
+ gap: var(--pb-space-sm, 8px);
376
+ flex-wrap: wrap;
377
+ }
378
+ .pb-social-icon {
379
+ display: inline-flex;
380
+ align-items: center;
381
+ justify-content: center;
382
+ font-size: 1.5rem;
383
+ color: inherit;
384
+ text-decoration: none;
385
+ }
386
+ .pb-social-icon:hover {
387
+ text-decoration: none;
388
+ opacity: 0.8;
389
+ }
390
+
391
+ /* ─── Loading ─────────────────────────────────────────────── */
392
+ .pb-loading {
393
+ min-height: 100vh;
394
+ display: flex;
395
+ flex-direction: column;
396
+ align-items: center;
397
+ justify-content: center;
398
+ gap: var(--pb-space-sm, 8px);
399
+ font-weight: 600;
400
+ letter-spacing: 0.08em;
401
+ }
402
+
403
+ /* ─── Utilitários de alinhamento ──────────────────────────── */
404
+ .pb-text-center { text-align: center; }
405
+ .pb-mb-0 { margin-bottom: 0; }
406
+ `;
@@ -0,0 +1,8 @@
1
+ import { type PartialDesignTokens } from './tokens.js';
2
+ /**
3
+ * Compõe o CSS completo do site público: variáveis de tema (`:root`) + CSS base.
4
+ *
5
+ * Usado pelo host (ex.: o preview do editor injeta no iframe) e pelo
6
+ * `SiteLayout` (site público).
7
+ */
8
+ export declare function buildSiteCss(designSystem?: PartialDesignTokens): string;
@@ -0,0 +1,11 @@
1
+ import { baseCss } from './baseCss.js';
2
+ import { buildTokenCss } from './tokens.js';
3
+ /**
4
+ * Compõe o CSS completo do site público: variáveis de tema (`:root`) + CSS base.
5
+ *
6
+ * Usado pelo host (ex.: o preview do editor injeta no iframe) e pelo
7
+ * `SiteLayout` (site público).
8
+ */
9
+ export function buildSiteCss(designSystem) {
10
+ return `${buildTokenCss(designSystem)}\n${baseCss}`;
11
+ }
@@ -0,0 +1,6 @@
1
+ export type { DesignTokens, DesignColors, DesignTypography, DesignSpacing, DesignRadius, DesignShadow, PartialDesignTokens, DeepPartial } from './tokens.js';
2
+ export { defaultTokens, mergeTokens, tokenToCssVars, buildTokenCss, buildThemeVars } from './tokens.js';
3
+ export { baseCss } from './baseCss.js';
4
+ export { buildSiteCss } from './buildSiteCss.js';
5
+ export { themeVarsStyle } from './themeVars.js';
6
+ export { ThemeStyle } from './theme.js';
@@ -0,0 +1,5 @@
1
+ export { defaultTokens, mergeTokens, tokenToCssVars, buildTokenCss, buildThemeVars } from './tokens.js';
2
+ export { baseCss } from './baseCss.js';
3
+ export { buildSiteCss } from './buildSiteCss.js';
4
+ export { themeVarsStyle } from './themeVars.js';
5
+ export { ThemeStyle } from './theme.js';
@@ -0,0 +1,9 @@
1
+ import type { PartialDesignTokens } from './tokens.js';
2
+ /**
3
+ * Injetor de tema em formato JSX. Renderiza um `<style>` com as variáveis de
4
+ * token e o CSS base. Usado em aplicações que não controlam o `<head>`
5
+ * diretamente (ex.: preview via portal).
6
+ */
7
+ export declare function ThemeStyle({ designSystem }: {
8
+ readonly designSystem?: PartialDesignTokens;
9
+ }): import("react").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { buildSiteCss } from './buildSiteCss.js';
3
+ /**
4
+ * Injetor de tema em formato JSX. Renderiza um `<style>` com as variáveis de
5
+ * token e o CSS base. Usado em aplicações que não controlam o `<head>`
6
+ * diretamente (ex.: preview via portal).
7
+ */
8
+ export function ThemeStyle({ designSystem }) {
9
+ const css = buildSiteCss(designSystem);
10
+ return _jsx("style", { dangerouslySetInnerHTML: { __html: css } });
11
+ }
@@ -0,0 +1,8 @@
1
+ import type { CSSProperties } from 'react';
2
+ import { type PartialDesignTokens } from './tokens.js';
3
+ /**
4
+ * Converte os tokens do design system em um objeto de estilo válido para React
5
+ * (propriedades CSS custom `--pb-*`), para aplicar inline em um elemento raiz.
6
+ * Assim a alteração de um token reflete em tempo real no preview.
7
+ */
8
+ export declare function themeVarsStyle(designSystem?: PartialDesignTokens): CSSProperties;
@@ -0,0 +1,9 @@
1
+ import { buildThemeVars } from './tokens.js';
2
+ /**
3
+ * Converte os tokens do design system em um objeto de estilo válido para React
4
+ * (propriedades CSS custom `--pb-*`), para aplicar inline em um elemento raiz.
5
+ * Assim a alteração de um token reflete em tempo real no preview.
6
+ */
7
+ export function themeVarsStyle(designSystem) {
8
+ return buildThemeVars(designSystem);
9
+ }
@@ -0,0 +1,82 @@
1
+ /**
2
+ * Design System tokens.
3
+ *
4
+ * Fontes de verdade para cores, tipografia, espaçamento, raio e sombra do site
5
+ * público. Cada token é exposto como uma variável CSS `--pb-*` e os componentes
6
+ * do `lib-pixelbuild` consomem via `var(--pb-*, <fallback>)`, de forma que um
7
+ * site sem design system configurado continua com aparência padrão.
8
+ */
9
+ export interface DesignColors {
10
+ primary: string;
11
+ secondary: string;
12
+ success: string;
13
+ danger: string;
14
+ warning: string;
15
+ info: string;
16
+ light: string;
17
+ dark: string;
18
+ background: string;
19
+ surface: string;
20
+ text: string;
21
+ heading: string;
22
+ muted: string;
23
+ border: string;
24
+ }
25
+ export interface DesignTypography {
26
+ fontFamily: string;
27
+ fontSizeBase: string;
28
+ fontWeightNormal: string;
29
+ fontWeightBold: string;
30
+ lineHeight: string;
31
+ }
32
+ export interface DesignSpacing {
33
+ none: string;
34
+ xs: string;
35
+ sm: string;
36
+ md: string;
37
+ lg: string;
38
+ xl: string;
39
+ xxl: string;
40
+ }
41
+ export interface DesignRadius {
42
+ none: string;
43
+ sm: string;
44
+ md: string;
45
+ lg: string;
46
+ full: string;
47
+ }
48
+ export interface DesignShadow {
49
+ none: string;
50
+ sm: string;
51
+ md: string;
52
+ lg: string;
53
+ }
54
+ export interface DesignTokens {
55
+ colors: DesignColors;
56
+ typography: DesignTypography;
57
+ spacing: DesignSpacing;
58
+ radius: DesignRadius;
59
+ shadow: DesignShadow;
60
+ gutter: string;
61
+ }
62
+ /** Versão em que qualquer grupo/token pode ser omitido (parcial aninhado). */
63
+ export type DeepPartial<T> = {
64
+ [K in keyof T]?: T[K] extends object ? DeepPartial<T[K]> : T[K];
65
+ };
66
+ export type PartialDesignTokens = DeepPartial<DesignTokens>;
67
+ /**
68
+ * Valores padrão. Mantidos neutros e modernos para que um site sem
69
+ * personalização não tenha cara de "framework genérico".
70
+ */
71
+ export declare const defaultTokens: DesignTokens;
72
+ export declare function mergeTokens(base: DesignTokens, partial?: PartialDesignTokens): DesignTokens;
73
+ /** Mapeia os tokens para pares `--pb-*` → valor. */
74
+ export declare function tokenToCssVars(tokens: DesignTokens): Record<string, string>;
75
+ /** Gera o bloco `:root { --pb-*: ... }` a partir dos tokens (com defaults). */
76
+ export declare function buildTokenCss(tokens?: PartialDesignTokens): string;
77
+ /**
78
+ * Retorna o mapa de variáveis `--pb-*` (com defaults mesclados) para aplicação
79
+ * inline em um elemento raiz — permite que a troca de token reflita em tempo
80
+ * real no preview sem reinjetar o `<head>`.
81
+ */
82
+ export declare function buildThemeVars(designSystem?: PartialDesignTokens): Record<string, string>;