@marsaude/sira-components 1.0.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.
@@ -0,0 +1,956 @@
1
+ import * as i0 from '@angular/core';
2
+ import { EventEmitter, HostBinding, Output, Input, Component, Directive, NgModule } from '@angular/core';
3
+ import { CommonModule } from '@angular/common';
4
+ import { fromEvent } from 'rxjs';
5
+ import { debounceTime } from 'rxjs/operators';
6
+
7
+ class AlertComponent {
8
+ theme = 'neutral';
9
+ icon;
10
+ title;
11
+ linkText;
12
+ callback = new EventEmitter();
13
+ get classes() {
14
+ return [
15
+ 'sira-alert',
16
+ `sira-alert--${this.theme}`
17
+ ].join(' ');
18
+ }
19
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: AlertComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
20
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.0", type: AlertComponent, isStandalone: true, selector: "div[siraAlert]", inputs: { theme: "theme", icon: "icon", title: "title", linkText: "linkText" }, outputs: { callback: "callback" }, host: { properties: { "class": "this.classes" } }, ngImport: i0, template: `
21
+ @if (icon) {
22
+ <div class="alert-icon">
23
+ <i class="material-icons">{{ icon }}</i>
24
+ </div>
25
+ }
26
+
27
+ <div class="alert-content">
28
+
29
+ @if (title) {
30
+ <h4 class="alert-title">{{ title }}</h4>
31
+ }
32
+
33
+ <div class="alert-description">
34
+ <ng-content></ng-content>
35
+ </div>
36
+
37
+ @if (linkText) {
38
+ <a href="javascript:void(0)" (click)="callback.emit(true)" class="alert-link">{{ linkText }}</a>
39
+ }
40
+ </div>
41
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }] });
42
+ }
43
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: AlertComponent, decorators: [{
44
+ type: Component,
45
+ args: [{
46
+ selector: 'div[siraAlert]',
47
+ standalone: true,
48
+ imports: [CommonModule],
49
+ template: `
50
+ @if (icon) {
51
+ <div class="alert-icon">
52
+ <i class="material-icons">{{ icon }}</i>
53
+ </div>
54
+ }
55
+
56
+ <div class="alert-content">
57
+
58
+ @if (title) {
59
+ <h4 class="alert-title">{{ title }}</h4>
60
+ }
61
+
62
+ <div class="alert-description">
63
+ <ng-content></ng-content>
64
+ </div>
65
+
66
+ @if (linkText) {
67
+ <a href="javascript:void(0)" (click)="callback.emit(true)" class="alert-link">{{ linkText }}</a>
68
+ }
69
+ </div>
70
+ `,
71
+ }]
72
+ }], propDecorators: { theme: [{
73
+ type: Input
74
+ }], icon: [{
75
+ type: Input
76
+ }], title: [{
77
+ type: Input
78
+ }], linkText: [{
79
+ type: Input
80
+ }], callback: [{
81
+ type: Output
82
+ }], classes: [{
83
+ type: HostBinding,
84
+ args: ['class']
85
+ }] } });
86
+
87
+ class BadgeComponent {
88
+ theme = 'neutral';
89
+ variant = 'filled';
90
+ dot = false;
91
+ get classes() {
92
+ return [
93
+ 'sira-badge',
94
+ `sira-badge--${this.theme}`,
95
+ `sira-badge--${this.variant}`,
96
+ this.dot ? 'sira-badge--has-dot' : ''
97
+ ].join(' ');
98
+ }
99
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: BadgeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
100
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.0", type: BadgeComponent, isStandalone: true, selector: "span[siraBadge]", inputs: { theme: "theme", variant: "variant", dot: "dot" }, host: { properties: { "class": "this.classes" } }, ngImport: i0, template: `
101
+ @if (dot) {
102
+ <span class="sira-badge-dot"></span>
103
+ }
104
+
105
+ <span class="text">
106
+ <ng-content></ng-content>
107
+ </span>
108
+
109
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }] });
110
+ }
111
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: BadgeComponent, decorators: [{
112
+ type: Component,
113
+ args: [{
114
+ selector: 'span[siraBadge]',
115
+ standalone: true,
116
+ imports: [CommonModule],
117
+ template: `
118
+ @if (dot) {
119
+ <span class="sira-badge-dot"></span>
120
+ }
121
+
122
+ <span class="text">
123
+ <ng-content></ng-content>
124
+ </span>
125
+
126
+ `,
127
+ }]
128
+ }], propDecorators: { theme: [{
129
+ type: Input
130
+ }], variant: [{
131
+ type: Input
132
+ }], dot: [{
133
+ type: Input
134
+ }], classes: [{
135
+ type: HostBinding,
136
+ args: ['class']
137
+ }] } });
138
+
139
+ class QuickButtonComponent {
140
+ icon = '';
141
+ label = '';
142
+ get classes() {
143
+ return 'sira-quick-button';
144
+ }
145
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: QuickButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
146
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.0", type: QuickButtonComponent, isStandalone: true, selector: "button[siraQuickButton], a[siraQuickButton]", inputs: { icon: "icon", label: "label" }, host: { properties: { "class": "this.classes" } }, ngImport: i0, template: `
147
+ <div class="icon-container">
148
+ @if (icon) {
149
+ <i class="material-icons">{{ icon }}</i>
150
+ }
151
+ </div>
152
+ <span class="label">{{ label }}</span>
153
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }] });
154
+ }
155
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: QuickButtonComponent, decorators: [{
156
+ type: Component,
157
+ args: [{
158
+ selector: 'button[siraQuickButton], a[siraQuickButton]',
159
+ standalone: true,
160
+ imports: [CommonModule],
161
+ template: `
162
+ <div class="icon-container">
163
+ @if (icon) {
164
+ <i class="material-icons">{{ icon }}</i>
165
+ }
166
+ </div>
167
+ <span class="label">{{ label }}</span>
168
+ `,
169
+ }]
170
+ }], propDecorators: { icon: [{
171
+ type: Input
172
+ }], label: [{
173
+ type: Input
174
+ }], classes: [{
175
+ type: HostBinding,
176
+ args: ['class']
177
+ }] } });
178
+
179
+ class CardActionComponent {
180
+ get classes() {
181
+ return [
182
+ 'sira-card--action',
183
+ ].join(' ');
184
+ }
185
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: CardActionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
186
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.0", type: CardActionComponent, isStandalone: true, selector: "div[siraCardAction]", host: { properties: { "class": "this.classes" } }, ngImport: i0, template: `
187
+ <span class="content-wrapper">
188
+ <ng-content></ng-content>
189
+ </span>
190
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }] });
191
+ }
192
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: CardActionComponent, decorators: [{
193
+ type: Component,
194
+ args: [{
195
+ selector: 'div[siraCardAction]',
196
+ standalone: true,
197
+ imports: [CommonModule],
198
+ template: `
199
+ <span class="content-wrapper">
200
+ <ng-content></ng-content>
201
+ </span>
202
+ `,
203
+ }]
204
+ }], propDecorators: { classes: [{
205
+ type: HostBinding,
206
+ args: ['class']
207
+ }] } });
208
+
209
+ class CardBodyComponent {
210
+ get classes() {
211
+ return [
212
+ 'sira-card--body',
213
+ ].join(' ');
214
+ }
215
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: CardBodyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
216
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.0", type: CardBodyComponent, isStandalone: true, selector: "div[siraCardBody]", host: { properties: { "class": "this.classes" } }, ngImport: i0, template: `
217
+ <span class="content-wrapper">
218
+ <ng-content></ng-content>
219
+ </span>
220
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }] });
221
+ }
222
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: CardBodyComponent, decorators: [{
223
+ type: Component,
224
+ args: [{
225
+ selector: 'div[siraCardBody]',
226
+ standalone: true,
227
+ imports: [CommonModule],
228
+ template: `
229
+ <span class="content-wrapper">
230
+ <ng-content></ng-content>
231
+ </span>
232
+ `,
233
+ }]
234
+ }], propDecorators: { classes: [{
235
+ type: HostBinding,
236
+ args: ['class']
237
+ }] } });
238
+
239
+ class CardImageComponent {
240
+ image;
241
+ alt;
242
+ get classes() {
243
+ return [
244
+ 'sira-card--image',
245
+ ].join(' ');
246
+ }
247
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: CardImageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
248
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.0", type: CardImageComponent, isStandalone: true, selector: "div[siraCardImage]", inputs: { image: "image", alt: "alt" }, host: { properties: { "class": "this.classes" } }, ngImport: i0, template: `
249
+ <div class="image" style="background-image: url({{ image }})">
250
+ <ng-content></ng-content>
251
+ </div>
252
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }] });
253
+ }
254
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: CardImageComponent, decorators: [{
255
+ type: Component,
256
+ args: [{
257
+ selector: 'div[siraCardImage]',
258
+ standalone: true,
259
+ imports: [CommonModule],
260
+ template: `
261
+ <div class="image" style="background-image: url({{ image }})">
262
+ <ng-content></ng-content>
263
+ </div>
264
+ `,
265
+ }]
266
+ }], propDecorators: { image: [{
267
+ type: Input
268
+ }], alt: [{
269
+ type: Input
270
+ }], classes: [{
271
+ type: HostBinding,
272
+ args: ['class']
273
+ }] } });
274
+
275
+ class CardComponent {
276
+ theme;
277
+ border = true;
278
+ get classes() {
279
+ return [
280
+ 'sira-card',
281
+ !this.border ? `sira-card--border-none` : '',
282
+ this.theme ? `sira-card--${this.theme}` : '',
283
+ ].join(' ');
284
+ }
285
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: CardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
286
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.0", type: CardComponent, isStandalone: true, selector: "div[siraCard]", inputs: { theme: "theme", border: "border" }, host: { properties: { "class": "this.classes" } }, ngImport: i0, template: `
287
+ <span class="content-wrapper">
288
+ <ng-content></ng-content>
289
+ </span>
290
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }] });
291
+ }
292
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: CardComponent, decorators: [{
293
+ type: Component,
294
+ args: [{
295
+ selector: 'div[siraCard]',
296
+ standalone: true,
297
+ imports: [CommonModule],
298
+ template: `
299
+ <span class="content-wrapper">
300
+ <ng-content></ng-content>
301
+ </span>
302
+ `,
303
+ }]
304
+ }], propDecorators: { theme: [{
305
+ type: Input
306
+ }], border: [{
307
+ type: Input
308
+ }], classes: [{
309
+ type: HostBinding,
310
+ args: ['class']
311
+ }] } });
312
+ const SIRA_CARD_COMPONENTS = [
313
+ CardActionComponent,
314
+ CardBodyComponent,
315
+ CardImageComponent,
316
+ CardComponent
317
+ ];
318
+
319
+ class NavCardComponent {
320
+ title = '';
321
+ subtitle;
322
+ image;
323
+ icon;
324
+ size = 'default';
325
+ full = false;
326
+ get classes() {
327
+ return [
328
+ 'sira-nav-card',
329
+ `sira-nav-card--${this.size}`,
330
+ this.image ? 'has-image' : 'has-icon',
331
+ this.full ? 'full' : ''
332
+ ].join(' ');
333
+ }
334
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: NavCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
335
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.0", type: NavCardComponent, isStandalone: true, selector: "a[siraNavCard], button[siraNavCard]", inputs: { title: "title", subtitle: "subtitle", image: "image", icon: "icon", size: "size", full: "full" }, host: { properties: { "class": "this.classes" } }, ngImport: i0, template: `
336
+ @if (image) {
337
+ <div class="media-container image-mode">
338
+ <div class="image-bg" style="background-image: url('{{image}}')"></div>
339
+ </div>
340
+ } @else if (icon) {
341
+ <div class="media-container icon-mode">
342
+ <i class="material-icons">{{ icon }}</i>
343
+ </div>
344
+ }
345
+
346
+ <div class="content">
347
+ <div class="badge-wrapper">
348
+ <ng-content select="[siraBadge]"></ng-content>
349
+ </div>
350
+
351
+ <span class="title">{{ title }}</span>
352
+
353
+ @if (subtitle) {
354
+ <span class="subtitle">{{ subtitle }}</span>
355
+ }
356
+ </div>
357
+
358
+ <div class="action">
359
+ <i class="material-icons">arrow_forward</i>
360
+ </div>
361
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }] });
362
+ }
363
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: NavCardComponent, decorators: [{
364
+ type: Component,
365
+ args: [{
366
+ selector: 'a[siraNavCard], button[siraNavCard]', // Funciona como link ou botão
367
+ standalone: true,
368
+ imports: [CommonModule],
369
+ template: `
370
+ @if (image) {
371
+ <div class="media-container image-mode">
372
+ <div class="image-bg" style="background-image: url('{{image}}')"></div>
373
+ </div>
374
+ } @else if (icon) {
375
+ <div class="media-container icon-mode">
376
+ <i class="material-icons">{{ icon }}</i>
377
+ </div>
378
+ }
379
+
380
+ <div class="content">
381
+ <div class="badge-wrapper">
382
+ <ng-content select="[siraBadge]"></ng-content>
383
+ </div>
384
+
385
+ <span class="title">{{ title }}</span>
386
+
387
+ @if (subtitle) {
388
+ <span class="subtitle">{{ subtitle }}</span>
389
+ }
390
+ </div>
391
+
392
+ <div class="action">
393
+ <i class="material-icons">arrow_forward</i>
394
+ </div>
395
+ `,
396
+ }]
397
+ }], propDecorators: { title: [{
398
+ type: Input
399
+ }], subtitle: [{
400
+ type: Input
401
+ }], image: [{
402
+ type: Input
403
+ }], icon: [{
404
+ type: Input
405
+ }], size: [{
406
+ type: Input
407
+ }], full: [{
408
+ type: Input
409
+ }], classes: [{
410
+ type: HostBinding,
411
+ args: ['class']
412
+ }] } });
413
+
414
+ class TileCardComponent {
415
+ icon = '';
416
+ title = '';
417
+ actionText = 'Acessar'; // Texto padrão conforme a imagem
418
+ get classes() {
419
+ return ['sira-tile-card'].join(' ');
420
+ }
421
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: TileCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
422
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.0", type: TileCardComponent, isStandalone: true, selector: "a[siraTileCard], button[siraTileCard]", inputs: { icon: "icon", title: "title", actionText: "actionText" }, host: { properties: { "class": "this.classes" } }, ngImport: i0, template: `
423
+ <div class="icon-container">
424
+ @if (icon) {
425
+ <i class="material-icons">{{ icon }}</i>
426
+ }
427
+ </div>
428
+
429
+ <span class="title">{{ title }}</span>
430
+
431
+ <div class="action-footer">
432
+ <span class="action-text">{{ actionText }}</span>
433
+ <i class="material-icons action-icon">arrow_forward</i>
434
+ </div>
435
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }] });
436
+ }
437
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: TileCardComponent, decorators: [{
438
+ type: Component,
439
+ args: [{
440
+ selector: 'a[siraTileCard], button[siraTileCard]', // Permite ser um link ou botão
441
+ standalone: true,
442
+ imports: [CommonModule],
443
+ template: `
444
+ <div class="icon-container">
445
+ @if (icon) {
446
+ <i class="material-icons">{{ icon }}</i>
447
+ }
448
+ </div>
449
+
450
+ <span class="title">{{ title }}</span>
451
+
452
+ <div class="action-footer">
453
+ <span class="action-text">{{ actionText }}</span>
454
+ <i class="material-icons action-icon">arrow_forward</i>
455
+ </div>
456
+ `,
457
+ }]
458
+ }], propDecorators: { icon: [{
459
+ type: Input
460
+ }], title: [{
461
+ type: Input
462
+ }], actionText: [{
463
+ type: Input
464
+ }], classes: [{
465
+ type: HostBinding,
466
+ args: ['class']
467
+ }] } });
468
+
469
+ class TextStyleDirective {
470
+ el;
471
+ renderer;
472
+ tokens = [];
473
+ font;
474
+ color;
475
+ size;
476
+ spacing;
477
+ bgColor;
478
+ weight;
479
+ constructor(el, renderer) {
480
+ this.el = el;
481
+ this.renderer = renderer;
482
+ }
483
+ resizeSub;
484
+ ngOnChanges(_) {
485
+ this.applyStyles();
486
+ }
487
+ ngOnInit() {
488
+ // Recalcula estilos quando o tamanho da janela mudar (tokens responsivos)
489
+ this.resizeSub = fromEvent(window, 'resize')
490
+ .pipe(debounceTime(150))
491
+ .subscribe(() => this.applyStyles());
492
+ }
493
+ ngOnDestroy() {
494
+ this.resizeSub?.unsubscribe();
495
+ }
496
+ applyStyles() {
497
+ const element = this.el.nativeElement;
498
+ const rootStyles = window.getComputedStyle(document.documentElement);
499
+ const styleObj = {};
500
+ const tokenList = Array.isArray(this.tokens)
501
+ ? this.tokens
502
+ : this.tokens?.split(' ').filter(Boolean) ?? [];
503
+ const regex = /(\d{3})\s+([\d.]+px)\/([\d.]+px)\s+(?:"([^"]+)"|'([^']+)')/;
504
+ // Tokens combinados
505
+ tokenList.forEach(token => {
506
+ const tokenValue = rootStyles.getPropertyValue(`--${token.trim()}`).trim();
507
+ const match = tokenValue.match(regex);
508
+ if (match) {
509
+ const [, weight, size, lineHeight, font1, font2] = match;
510
+ const fontFamily = font1 || font2;
511
+ Object.assign(styleObj, {
512
+ 'font-weight': weight,
513
+ 'font-size': size,
514
+ 'line-height': lineHeight,
515
+ 'font-family': fontFamily,
516
+ });
517
+ }
518
+ });
519
+ // Inputs isolados (também via tokens)
520
+ const resolveTokenValue = (tokenName) => {
521
+ if (!tokenName)
522
+ return;
523
+ return rootStyles.getPropertyValue(`--${tokenName.trim()}`).trim() || tokenName;
524
+ };
525
+ const fontResolved = resolveTokenValue(this.font);
526
+ if (fontResolved) {
527
+ // Tenta aplicar parsing como se fosse shorthand de fonte
528
+ const match = fontResolved.match(regex);
529
+ if (match) {
530
+ const [, weight, size, lineHeight, font1, font2] = match;
531
+ styleObj['font-weight'] = weight;
532
+ styleObj['font-size'] = size;
533
+ styleObj['line-height'] = lineHeight;
534
+ styleObj['font-family'] = font1 || font2;
535
+ }
536
+ else {
537
+ styleObj['font-family'] = fontResolved;
538
+ }
539
+ }
540
+ const colorResolved = resolveTokenValue(this.color);
541
+ if (colorResolved)
542
+ styleObj['color'] = colorResolved;
543
+ const sizeResolved = resolveTokenValue(this.size);
544
+ if (sizeResolved)
545
+ styleObj['font-size'] = sizeResolved;
546
+ const weightResolved = resolveTokenValue(this.weight);
547
+ if (weightResolved)
548
+ styleObj['font-weight'] = weightResolved;
549
+ const spacingResolved = resolveTokenValue(this.spacing);
550
+ if (spacingResolved)
551
+ styleObj['margin-bottom'] = spacingResolved;
552
+ const bgColorResolved = resolveTokenValue(this.bgColor);
553
+ if (bgColorResolved)
554
+ styleObj['background-color'] = bgColorResolved;
555
+ // Aplica os estilos no elemento
556
+ Object.entries(styleObj).forEach(([prop, val]) => {
557
+ this.renderer.setStyle(element, prop, val);
558
+ });
559
+ }
560
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: TextStyleDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
561
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.0", type: TextStyleDirective, isStandalone: true, selector: "[textStyle]", inputs: { tokens: ["textStyle", "tokens"], font: "font", color: "color", size: "size", spacing: "spacing", bgColor: "bgColor", weight: "weight" }, usesOnChanges: true, ngImport: i0 });
562
+ }
563
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: TextStyleDirective, decorators: [{
564
+ type: Directive,
565
+ args: [{
566
+ selector: '[textStyle]',
567
+ standalone: true,
568
+ }]
569
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }], propDecorators: { tokens: [{
570
+ type: Input,
571
+ args: ['textStyle']
572
+ }], font: [{
573
+ type: Input
574
+ }], color: [{
575
+ type: Input
576
+ }], size: [{
577
+ type: Input
578
+ }], spacing: [{
579
+ type: Input
580
+ }], bgColor: [{
581
+ type: Input
582
+ }], weight: [{
583
+ type: Input
584
+ }] } });
585
+
586
+ class SectionHeadingComponent {
587
+ size = 'default';
588
+ title;
589
+ subtitle;
590
+ icon;
591
+ iconColor;
592
+ get classes() {
593
+ return [
594
+ 'sira-section--heading',
595
+ this.size === 'small' ? 'sira-section--heading-small' : '',
596
+ !!this.iconColor ? `icon-color--${this.iconColor}` : '',
597
+ ].join(' ');
598
+ }
599
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: SectionHeadingComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
600
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.0", type: SectionHeadingComponent, isStandalone: true, selector: "div[siraSectionHeading]", inputs: { size: "size", title: "title", subtitle: "subtitle", icon: "icon", iconColor: "iconColor" }, host: { properties: { "class": "this.classes" } }, ngImport: i0, template: `
601
+ <span class="content-wrapper">
602
+ @if (icon) {
603
+ <div class="icon">
604
+ <i class="material-icons">{{ icon }}</i>
605
+ </div>
606
+ }
607
+ <div class="text">
608
+ <h2 [textStyle]="size === 'small'? 'mar-label-md': 'mar-label-lg'" color="mar-text-primary">{{ title }}</h2>
609
+ @if (subtitle) {
610
+ <p textStyle="mar-caption-default" color="mar-text-tertiary">{{ subtitle }}</p>
611
+ }
612
+ </div>
613
+ </span>
614
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: TextStyleDirective, selector: "[textStyle]", inputs: ["textStyle", "font", "color", "size", "spacing", "bgColor", "weight"] }] });
615
+ }
616
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: SectionHeadingComponent, decorators: [{
617
+ type: Component,
618
+ args: [{
619
+ selector: 'div[siraSectionHeading]',
620
+ standalone: true,
621
+ imports: [CommonModule, TextStyleDirective],
622
+ template: `
623
+ <span class="content-wrapper">
624
+ @if (icon) {
625
+ <div class="icon">
626
+ <i class="material-icons">{{ icon }}</i>
627
+ </div>
628
+ }
629
+ <div class="text">
630
+ <h2 [textStyle]="size === 'small'? 'mar-label-md': 'mar-label-lg'" color="mar-text-primary">{{ title }}</h2>
631
+ @if (subtitle) {
632
+ <p textStyle="mar-caption-default" color="mar-text-tertiary">{{ subtitle }}</p>
633
+ }
634
+ </div>
635
+ </span>
636
+ `,
637
+ }]
638
+ }], propDecorators: { size: [{
639
+ type: Input
640
+ }], title: [{
641
+ type: Input
642
+ }], subtitle: [{
643
+ type: Input
644
+ }], icon: [{
645
+ type: Input
646
+ }], iconColor: [{
647
+ type: Input
648
+ }], classes: [{
649
+ type: HostBinding,
650
+ args: ['class']
651
+ }] } });
652
+
653
+ class ButtonComponent {
654
+ variant = 'primary';
655
+ loading = false;
656
+ iconOnly = false;
657
+ disabled = false;
658
+ get classes() {
659
+ return [
660
+ 'sira-btn',
661
+ `sira-btn--${this.variant}`,
662
+ this.iconOnly ? 'sira-btn--icon-only' : '',
663
+ this.loading ? 'sira-btn--loading' : ''
664
+ ].join(' ');
665
+ }
666
+ get disabledState() {
667
+ // Fica desabilitado se estiver carregando OU se estiver marcado como disabled
668
+ return (this.loading || this.disabled) ? true : null;
669
+ }
670
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: ButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
671
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.0", type: ButtonComponent, isStandalone: true, selector: "button[siraButton], a[siraButton]", inputs: { variant: "variant", loading: "loading", iconOnly: "iconOnly", disabled: "disabled" }, host: { properties: { "class": "this.classes", "disabled": "this.disabledState" } }, ngImport: i0, template: `
672
+ @if (loading) {
673
+ <span class="loader-overlay">
674
+ <span class="spinner"></span>
675
+ </span>
676
+ }
677
+ <span class="content-wrapper" [style.opacity]="loading ? '0' : '1'">
678
+ <ng-content></ng-content>
679
+ </span>
680
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }] });
681
+ }
682
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: ButtonComponent, decorators: [{
683
+ type: Component,
684
+ args: [{
685
+ selector: 'button[siraButton], a[siraButton]',
686
+ standalone: true,
687
+ imports: [CommonModule],
688
+ template: `
689
+ @if (loading) {
690
+ <span class="loader-overlay">
691
+ <span class="spinner"></span>
692
+ </span>
693
+ }
694
+ <span class="content-wrapper" [style.opacity]="loading ? '0' : '1'">
695
+ <ng-content></ng-content>
696
+ </span>
697
+ `,
698
+ }]
699
+ }], propDecorators: { variant: [{
700
+ type: Input
701
+ }], loading: [{
702
+ type: Input
703
+ }], iconOnly: [{
704
+ type: Input
705
+ }], disabled: [{
706
+ type: Input
707
+ }], classes: [{
708
+ type: HostBinding,
709
+ args: ['class']
710
+ }], disabledState: [{
711
+ type: HostBinding,
712
+ args: ['disabled']
713
+ }] } });
714
+
715
+ class ElementSpacingDirective {
716
+ el;
717
+ renderer;
718
+ spacingToken;
719
+ constructor(el, renderer) {
720
+ this.el = el;
721
+ this.renderer = renderer;
722
+ }
723
+ ngOnInit() {
724
+ this.applySpacing();
725
+ }
726
+ applySpacing() {
727
+ const element = this.el.nativeElement;
728
+ const rootStyles = getComputedStyle(document.documentElement);
729
+ if (!this.spacingToken)
730
+ return;
731
+ const spacingValue = rootStyles
732
+ .getPropertyValue(`--${this.spacingToken.trim()}`)
733
+ .trim();
734
+ if (!spacingValue) {
735
+ console.warn(`Token "--${this.spacingToken}" não encontrado no :root.`);
736
+ return;
737
+ }
738
+ this.renderer.setStyle(element, 'padding-top', spacingValue);
739
+ }
740
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: ElementSpacingDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
741
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.0", type: ElementSpacingDirective, isStandalone: true, selector: "[elementSpacing]", inputs: { spacingToken: ["elementSpacing", "spacingToken"] }, ngImport: i0 });
742
+ }
743
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: ElementSpacingDirective, decorators: [{
744
+ type: Directive,
745
+ args: [{
746
+ selector: '[elementSpacing]',
747
+ standalone: true,
748
+ }]
749
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }], propDecorators: { spacingToken: [{
750
+ type: Input,
751
+ args: ['elementSpacing']
752
+ }] } });
753
+
754
+ class NavbarComponent {
755
+ title = '';
756
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: NavbarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
757
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.0", type: NavbarComponent, isStandalone: true, selector: "navbar", inputs: { title: "title" }, ngImport: i0, template: `
758
+ <header class="navbar-container">
759
+
760
+ <div class="navbar-slot start">
761
+ <ng-content select="[left]"></ng-content>
762
+ </div>
763
+
764
+ <div class="navbar-slot center">
765
+ @if (title) {
766
+ <h1 class="navbar-title">
767
+ {{ title }}
768
+ </h1>
769
+ }
770
+ </div>
771
+
772
+ <div class="navbar-slot end">
773
+ <ng-content select="[right]"></ng-content>
774
+ </div>
775
+
776
+ </header>
777
+ `, isInline: true, styles: [":host{display:block;width:100%}.navbar-container{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;height:54px;padding:var(--mar-spacing-default-xs) var(--mar-spacing-default-sm)}.navbar-slot{display:flex;align-items:center}.navbar-slot.start{justify-content:flex-start}.navbar-slot.center{justify-content:center;padding:0 8px;min-width:0;overflow:hidden}.navbar-slot.end{justify-content:flex-end}.navbar-title{color:var(--mar-text-primary);text-align:center;font:var(--mar-label-md);margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }] });
778
+ }
779
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: NavbarComponent, decorators: [{
780
+ type: Component,
781
+ args: [{ selector: 'navbar', standalone: true, imports: [CommonModule], template: `
782
+ <header class="navbar-container">
783
+
784
+ <div class="navbar-slot start">
785
+ <ng-content select="[left]"></ng-content>
786
+ </div>
787
+
788
+ <div class="navbar-slot center">
789
+ @if (title) {
790
+ <h1 class="navbar-title">
791
+ {{ title }}
792
+ </h1>
793
+ }
794
+ </div>
795
+
796
+ <div class="navbar-slot end">
797
+ <ng-content select="[right]"></ng-content>
798
+ </div>
799
+
800
+ </header>
801
+ `, styles: [":host{display:block;width:100%}.navbar-container{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;height:54px;padding:var(--mar-spacing-default-xs) var(--mar-spacing-default-sm)}.navbar-slot{display:flex;align-items:center}.navbar-slot.start{justify-content:flex-start}.navbar-slot.center{justify-content:center;padding:0 8px;min-width:0;overflow:hidden}.navbar-slot.end{justify-content:flex-end}.navbar-title{color:var(--mar-text-primary);text-align:center;font:var(--mar-label-md);margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}\n"] }]
802
+ }], propDecorators: { title: [{
803
+ type: Input
804
+ }] } });
805
+
806
+ class SectionComponent {
807
+ get classes() {
808
+ return [
809
+ 'sira-section',
810
+ ].join(' ');
811
+ }
812
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: SectionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
813
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.0", type: SectionComponent, isStandalone: true, selector: "div[siraSection]", host: { properties: { "class": "this.classes" } }, ngImport: i0, template: `
814
+ <span class="content-wrapper">
815
+ <ng-content></ng-content>
816
+ </span>
817
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }] });
818
+ }
819
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: SectionComponent, decorators: [{
820
+ type: Component,
821
+ args: [{
822
+ selector: 'div[siraSection]',
823
+ standalone: true,
824
+ imports: [CommonModule],
825
+ template: `
826
+ <span class="content-wrapper">
827
+ <ng-content></ng-content>
828
+ </span>
829
+ `,
830
+ }]
831
+ }], propDecorators: { classes: [{
832
+ type: HostBinding,
833
+ args: ['class']
834
+ }] } });
835
+
836
+ class SectionBodyComponent {
837
+ get classes() {
838
+ return [
839
+ 'sira-section--body',
840
+ ].join(' ');
841
+ }
842
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: SectionBodyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
843
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.0", type: SectionBodyComponent, isStandalone: true, selector: "div[siraSectionBody]", host: { properties: { "class": "this.classes" } }, ngImport: i0, template: `
844
+ <span class="content-wrapper">
845
+ <ng-content></ng-content>
846
+ </span>
847
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }] });
848
+ }
849
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: SectionBodyComponent, decorators: [{
850
+ type: Component,
851
+ args: [{
852
+ selector: 'div[siraSectionBody]',
853
+ standalone: true,
854
+ imports: [CommonModule],
855
+ template: `
856
+ <span class="content-wrapper">
857
+ <ng-content></ng-content>
858
+ </span>
859
+ `,
860
+ }]
861
+ }], propDecorators: { classes: [{
862
+ type: HostBinding,
863
+ args: ['class']
864
+ }] } });
865
+
866
+ // Importe os wrappers de Section se houver (SectionComponent, SectionBodyComponent)
867
+ const COMPONENTS = [
868
+ AlertComponent,
869
+ BadgeComponent,
870
+ ButtonComponent,
871
+ CardComponent,
872
+ CardBodyComponent,
873
+ CardActionComponent,
874
+ CardImageComponent,
875
+ ElementSpacingDirective,
876
+ TextStyleDirective,
877
+ NavCardComponent,
878
+ NavbarComponent,
879
+ SectionComponent,
880
+ SectionHeadingComponent,
881
+ SectionBodyComponent,
882
+ QuickButtonComponent,
883
+ TileCardComponent,
884
+ ];
885
+ class SiraUiModule {
886
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: SiraUiModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
887
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.1.0", ngImport: i0, type: SiraUiModule, imports: [CommonModule, AlertComponent,
888
+ BadgeComponent,
889
+ ButtonComponent,
890
+ CardComponent,
891
+ CardBodyComponent,
892
+ CardActionComponent,
893
+ CardImageComponent,
894
+ ElementSpacingDirective,
895
+ TextStyleDirective,
896
+ NavCardComponent,
897
+ NavbarComponent,
898
+ SectionComponent,
899
+ SectionHeadingComponent,
900
+ SectionBodyComponent,
901
+ QuickButtonComponent,
902
+ TileCardComponent], exports: [AlertComponent,
903
+ BadgeComponent,
904
+ ButtonComponent,
905
+ CardComponent,
906
+ CardBodyComponent,
907
+ CardActionComponent,
908
+ CardImageComponent,
909
+ ElementSpacingDirective,
910
+ TextStyleDirective,
911
+ NavCardComponent,
912
+ NavbarComponent,
913
+ SectionComponent,
914
+ SectionHeadingComponent,
915
+ SectionBodyComponent,
916
+ QuickButtonComponent,
917
+ TileCardComponent] });
918
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: SiraUiModule, imports: [CommonModule, AlertComponent,
919
+ BadgeComponent,
920
+ ButtonComponent,
921
+ CardComponent,
922
+ CardBodyComponent,
923
+ CardActionComponent,
924
+ CardImageComponent,
925
+ NavCardComponent,
926
+ NavbarComponent,
927
+ SectionComponent,
928
+ SectionHeadingComponent,
929
+ SectionBodyComponent,
930
+ QuickButtonComponent,
931
+ TileCardComponent] });
932
+ }
933
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: SiraUiModule, decorators: [{
934
+ type: NgModule,
935
+ args: [{
936
+ imports: [
937
+ CommonModule,
938
+ ...COMPONENTS // Importa os standalones para dentro do módulo
939
+ ],
940
+ exports: [
941
+ ...COMPONENTS // Exporta para quem importar o SiraUiModule
942
+ ]
943
+ }]
944
+ }] });
945
+
946
+ /*
947
+ * Public API Surface of sira-components
948
+ */
949
+ // Exporta o Módulo Principal
950
+
951
+ /**
952
+ * Generated bundle index. Do not edit.
953
+ */
954
+
955
+ export { AlertComponent, BadgeComponent, ButtonComponent, CardActionComponent, CardBodyComponent, CardComponent, CardImageComponent, ElementSpacingDirective, NavCardComponent, NavbarComponent, QuickButtonComponent, SIRA_CARD_COMPONENTS, SectionBodyComponent, SectionComponent, SectionHeadingComponent, SiraUiModule, TextStyleDirective, TileCardComponent };
956
+ //# sourceMappingURL=marsaude-sira-components.mjs.map