@ng-prism/core 22.2.0-beta.5 → 22.2.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.
Files changed (119) hide show
  1. package/dist/app/canvas/canvas-bg.styles.d.ts +19 -0
  2. package/dist/app/canvas/canvas-bg.styles.d.ts.map +1 -0
  3. package/dist/app/canvas/canvas-bg.styles.js +58 -0
  4. package/dist/app/canvas/prism-canvas-bg-pill.component.d.ts.map +1 -1
  5. package/dist/app/canvas/prism-canvas-bg-pill.component.js +3 -3
  6. package/dist/app/canvas/prism-canvas-toolbar.component.d.ts +25 -7
  7. package/dist/app/canvas/prism-canvas-toolbar.component.d.ts.map +1 -1
  8. package/dist/app/canvas/prism-canvas-toolbar.component.js +152 -121
  9. package/dist/app/canvas/prism-template-popover.component.d.ts +0 -3
  10. package/dist/app/canvas/prism-template-popover.component.d.ts.map +1 -1
  11. package/dist/app/canvas/prism-template-popover.component.js +43 -59
  12. package/dist/app/component-head/head-metrics.d.ts +41 -0
  13. package/dist/app/component-head/head-metrics.d.ts.map +1 -0
  14. package/dist/app/component-head/head-metrics.js +39 -0
  15. package/dist/app/component-head/prism-component-head.component.d.ts +10 -2
  16. package/dist/app/component-head/prism-component-head.component.d.ts.map +1 -1
  17. package/dist/app/component-head/prism-component-head.component.js +107 -209
  18. package/dist/app/component-head/prism-head-gauge.component.d.ts +23 -0
  19. package/dist/app/component-head/prism-head-gauge.component.d.ts.map +1 -0
  20. package/dist/app/component-head/prism-head-gauge.component.js +123 -0
  21. package/dist/app/component-head/prism-head-info.component.d.ts +23 -0
  22. package/dist/app/component-head/prism-head-info.component.d.ts.map +1 -0
  23. package/dist/app/component-head/prism-head-info.component.js +124 -0
  24. package/dist/app/component-head/prism-stat.component.d.ts +10 -4
  25. package/dist/app/component-head/prism-stat.component.d.ts.map +1 -1
  26. package/dist/app/component-head/prism-stat.component.js +34 -44
  27. package/dist/app/header/prism-header.component.js +2 -2
  28. package/dist/app/icons/icon-registry.d.ts.map +1 -1
  29. package/dist/app/icons/icon-registry.js +2 -0
  30. package/dist/app/index.d.ts +3 -1
  31. package/dist/app/index.d.ts.map +1 -1
  32. package/dist/app/index.js +26 -1
  33. package/dist/app/layout-menu/prism-layout-menu.component.js +2 -2
  34. package/dist/app/overview/overview-panel.d.ts +3 -0
  35. package/dist/app/overview/overview-panel.d.ts.map +1 -0
  36. package/dist/app/overview/overview-panel.js +9 -0
  37. package/dist/app/overview/overview-visibility.d.ts +15 -0
  38. package/dist/app/overview/overview-visibility.d.ts.map +1 -0
  39. package/dist/app/overview/overview-visibility.js +18 -0
  40. package/dist/app/overview/prism-overview-cell.component.d.ts +29 -0
  41. package/dist/app/overview/prism-overview-cell.component.d.ts.map +1 -0
  42. package/dist/app/overview/prism-overview-cell.component.js +136 -0
  43. package/dist/app/overview/prism-overview.component.d.ts +17 -0
  44. package/dist/app/overview/prism-overview.component.d.ts.map +1 -0
  45. package/dist/app/overview/prism-overview.component.js +53 -0
  46. package/dist/app/page-renderer/prism-page-renderer.component.d.ts.map +1 -1
  47. package/dist/app/page-renderer/prism-page-renderer.component.js +3 -3
  48. package/dist/app/panels/a11y/a11y-header-badge.component.d.ts.map +1 -1
  49. package/dist/app/panels/a11y/a11y-header-badge.component.js +21 -30
  50. package/dist/app/panels/builtin-panels.d.ts.map +1 -1
  51. package/dist/app/panels/builtin-panels.js +2 -0
  52. package/dist/app/panels/panel-host/prism-panel-host.component.d.ts.map +1 -1
  53. package/dist/app/panels/panel-host/prism-panel-host.component.js +15 -11
  54. package/dist/app/renderer/prism-renderer.component.d.ts +0 -1
  55. package/dist/app/renderer/prism-renderer.component.d.ts.map +1 -1
  56. package/dist/app/renderer/prism-renderer.component.js +9 -71
  57. package/dist/app/renderer/projectable-content.d.ts +10 -0
  58. package/dist/app/renderer/projectable-content.d.ts.map +1 -0
  59. package/dist/app/renderer/projectable-content.js +60 -0
  60. package/dist/app/services/prism-capture.service.d.ts.map +1 -1
  61. package/dist/app/services/prism-capture.service.js +20 -0
  62. package/dist/app/services/prism-layout.service.d.ts +0 -3
  63. package/dist/app/services/prism-layout.service.d.ts.map +1 -1
  64. package/dist/app/services/prism-layout.service.js +0 -8
  65. package/dist/app/services/prism-panel.service.d.ts +18 -0
  66. package/dist/app/services/prism-panel.service.d.ts.map +1 -1
  67. package/dist/app/services/prism-panel.service.js +28 -0
  68. package/dist/app/shared/prism-metric-badge.component.d.ts +32 -0
  69. package/dist/app/shared/prism-metric-badge.component.d.ts.map +1 -0
  70. package/dist/app/shared/prism-metric-badge.component.js +70 -0
  71. package/dist/app/shell/prism-shell.component.d.ts +0 -1
  72. package/dist/app/shell/prism-shell.component.d.ts.map +1 -1
  73. package/dist/app/shell/prism-shell.component.js +56 -48
  74. package/dist/app/sidebar/navigation-decorations.d.ts +6 -3
  75. package/dist/app/sidebar/navigation-decorations.d.ts.map +1 -1
  76. package/dist/app/sidebar/navigation-decorations.js +7 -4
  77. package/dist/app/sidebar/prism-sidebar.component.d.ts +11 -7
  78. package/dist/app/sidebar/prism-sidebar.component.d.ts.map +1 -1
  79. package/dist/app/sidebar/prism-sidebar.component.js +61 -83
  80. package/dist/app/theme/prism-default-theme.d.ts.map +1 -1
  81. package/dist/app/theme/prism-default-theme.js +44 -4
  82. package/dist/app/variant-ribbon/prism-variant-ribbon.component.d.ts +4 -1
  83. package/dist/app/variant-ribbon/prism-variant-ribbon.component.d.ts.map +1 -1
  84. package/dist/app/variant-ribbon/prism-variant-ribbon.component.js +13 -26
  85. package/dist/app/variant-ribbon/spectrum.d.ts +19 -0
  86. package/dist/app/variant-ribbon/spectrum.d.ts.map +1 -0
  87. package/dist/app/variant-ribbon/spectrum.js +15 -0
  88. package/dist/app/view-tab-bar/next-view-id.d.ts +12 -0
  89. package/dist/app/view-tab-bar/next-view-id.d.ts.map +1 -0
  90. package/dist/app/view-tab-bar/next-view-id.js +16 -0
  91. package/dist/app/view-tab-bar/prism-view-panel-host.component.d.ts +0 -1
  92. package/dist/app/view-tab-bar/prism-view-panel-host.component.d.ts.map +1 -1
  93. package/dist/app/view-tab-bar/prism-view-panel-host.component.js +10 -11
  94. package/dist/app/view-tab-bar/prism-view-tab-bar.component.d.ts +0 -1
  95. package/dist/app/view-tab-bar/prism-view-tab-bar.component.d.ts.map +1 -1
  96. package/dist/app/view-tab-bar/prism-view-tab-bar.component.js +6 -13
  97. package/dist/transformer/cli.js +0 -0
  98. package/package.json +1 -1
  99. package/dist/app/canvas/prism-code-drawer.component.d.ts +0 -14
  100. package/dist/app/canvas/prism-code-drawer.component.d.ts.map +0 -1
  101. package/dist/app/canvas/prism-code-drawer.component.js +0 -116
  102. package/dist/app/component-header/prism-component-header.component.d.ts +0 -8
  103. package/dist/app/component-header/prism-component-header.component.d.ts.map +0 -1
  104. package/dist/app/component-header/prism-component-header.component.js +0 -77
  105. package/dist/cli/audit-a11y/aggregator.d.ts +0 -10
  106. package/dist/cli/audit-a11y/aggregator.d.ts.map +0 -1
  107. package/dist/cli/audit-a11y/aggregator.js +0 -64
  108. package/dist/cli/audit-a11y/auditor.d.ts +0 -14
  109. package/dist/cli/audit-a11y/auditor.d.ts.map +0 -1
  110. package/dist/cli/audit-a11y/auditor.js +0 -104
  111. package/dist/cli/audit-a11y/cli.d.ts +0 -3
  112. package/dist/cli/audit-a11y/cli.d.ts.map +0 -1
  113. package/dist/cli/audit-a11y/cli.js +0 -143
  114. package/dist/cli/audit-a11y/index.d.ts +0 -4
  115. package/dist/cli/audit-a11y/index.d.ts.map +0 -1
  116. package/dist/cli/audit-a11y/index.js +0 -3
  117. package/dist/cli/audit-a11y/static-server.d.ts +0 -11
  118. package/dist/cli/audit-a11y/static-server.d.ts.map +0 -1
  119. package/dist/cli/audit-a11y/static-server.js +0 -61
@@ -1,149 +1,52 @@
1
1
  import { Component, inject, computed, ChangeDetectionStrategy, } from '@angular/core';
2
- import { PrismIconComponent } from '../icons/prism-icon.component.js';
3
2
  import { PrismNavigationService } from '../services/prism-navigation.service.js';
4
3
  import { A11yAuditService } from '../panels/a11y/a11y-audit.service.js';
5
- import { PrismStatComponent } from './prism-stat.component.js';
4
+ import { PrismHeadInfoComponent } from './prism-head-info.component.js';
5
+ import { PrismHeadGaugeComponent } from './prism-head-gauge.component.js';
6
6
  import * as i0 from "@angular/core";
7
- function PrismComponentHeadComponent_Conditional_0_Conditional_13_Conditional_1_Template(rf, ctx) { if (rf & 1) {
8
- i0.ɵɵelement(0, "prism-icon", 15);
9
- } if (rf & 2) {
10
- i0.ɵɵproperty("size", 13);
11
- } }
12
- function PrismComponentHeadComponent_Conditional_0_Conditional_13_Conditional_2_Template(rf, ctx) { if (rf & 1) {
13
- i0.ɵɵelement(0, "span", 16);
14
- } }
15
- function PrismComponentHeadComponent_Conditional_0_Conditional_13_Conditional_3_Template(rf, ctx) { if (rf & 1) {
16
- i0.ɵɵelement(0, "span", 17);
17
- } }
18
- function PrismComponentHeadComponent_Conditional_0_Conditional_13_Template(rf, ctx) { if (rf & 1) {
7
+ const _c0 = [[["", "headEnd", ""]]];
8
+ const _c1 = ["[headEnd]"];
9
+ const _c2 = () => [];
10
+ function PrismComponentHeadComponent_Conditional_0_Conditional_6_Template(rf, ctx) { if (rf & 1) {
19
11
  i0.ɵɵelementStart(0, "span");
20
- i0.ɵɵconditionalCreate(1, PrismComponentHeadComponent_Conditional_0_Conditional_13_Conditional_1_Template, 1, 1, "prism-icon", 15)(2, PrismComponentHeadComponent_Conditional_0_Conditional_13_Conditional_2_Template, 1, 0, "span", 16)(3, PrismComponentHeadComponent_Conditional_0_Conditional_13_Conditional_3_Template, 1, 0, "span", 17);
21
- i0.ɵɵelementStart(4, "span", 18);
22
- i0.ɵɵtext(5);
23
- i0.ɵɵelementEnd()();
24
- } if (rf & 2) {
25
- const s_r1 = ctx;
26
- const ctx_r1 = i0.ɵɵnextContext(2);
27
- i0.ɵɵclassMap(i0.ɵɵinterpolate1("comp-status comp-status--", s_r1));
28
- i0.ɵɵattribute("title", ctx_r1.statusBadge().tooltip);
29
- i0.ɵɵadvance();
30
- i0.ɵɵconditional(s_r1 === "stable" ? 1 : s_r1 === "wip" ? 2 : 3);
31
- i0.ɵɵadvance(4);
32
- i0.ɵɵtextInterpolate(ctx_r1.statusBadge().label);
33
- } }
34
- function PrismComponentHeadComponent_Conditional_0_Conditional_14_Template(rf, ctx) { if (rf & 1) {
35
- i0.ɵɵelementStart(0, "p", 7);
36
- i0.ɵɵtext(1);
37
- i0.ɵɵelementEnd();
38
- } if (rf & 2) {
39
- const c_r3 = i0.ɵɵnextContext();
40
- i0.ɵɵadvance();
41
- i0.ɵɵtextInterpolate(c_r3.meta.showcaseConfig.description);
42
- } }
43
- function PrismComponentHeadComponent_Conditional_0_Conditional_15_For_2_Template(rf, ctx) { if (rf & 1) {
44
- i0.ɵɵelementStart(0, "span", 19);
45
- i0.ɵɵtext(1);
46
- i0.ɵɵelementEnd();
47
- } if (rf & 2) {
48
- const tag_r4 = ctx.$implicit;
49
- i0.ɵɵadvance();
50
- i0.ɵɵtextInterpolate(tag_r4);
51
- } }
52
- function PrismComponentHeadComponent_Conditional_0_Conditional_15_Template(rf, ctx) { if (rf & 1) {
53
- i0.ɵɵelementStart(0, "div", 8);
54
- i0.ɵɵrepeaterCreate(1, PrismComponentHeadComponent_Conditional_0_Conditional_15_For_2_Template, 2, 1, "span", 19, i0.ɵɵrepeaterTrackByIdentity);
12
+ i0.ɵɵelement(1, "span", 8);
13
+ i0.ɵɵtext(2);
55
14
  i0.ɵɵelementEnd();
56
15
  } if (rf & 2) {
57
- const c_r3 = i0.ɵɵnextContext();
58
- i0.ɵɵadvance();
59
- i0.ɵɵrepeater(c_r3.meta.showcaseConfig.tags);
60
- } }
61
- function PrismComponentHeadComponent_Conditional_0_Conditional_17_Template(rf, ctx) { if (rf & 1) {
62
- i0.ɵɵelement(0, "prism-stat", 10);
63
- } if (rf & 2) {
64
- const ctx_r1 = i0.ɵɵnextContext(2);
65
- i0.ɵɵproperty("value", ctx_r1.variantCount());
66
- } }
67
- function PrismComponentHeadComponent_Conditional_0_Conditional_18_Template(rf, ctx) { if (rf & 1) {
68
- i0.ɵɵelement(0, "prism-stat", 11);
69
- } if (rf & 2) {
16
+ const badge_r1 = ctx;
70
17
  const ctx_r1 = i0.ɵɵnextContext(2);
71
- i0.ɵɵproperty("value", ctx_r1.coveragePercent() + "%")("pill", ctx_r1.coveragePercent() >= 90 ? "OK" : "WARN")("pillVariant", ctx_r1.coveragePercent() >= 90 ? "ok" : "warn");
72
- } }
73
- function PrismComponentHeadComponent_Conditional_0_Conditional_19_Template(rf, ctx) { if (rf & 1) {
74
- i0.ɵɵelement(0, "prism-stat", 12);
75
- } if (rf & 2) {
76
- const ctx_r1 = i0.ɵɵnextContext(2);
77
- i0.ɵɵproperty("value", ctx_r1.bundleSize());
78
- } }
79
- function PrismComponentHeadComponent_Conditional_0_Conditional_20_Template(rf, ctx) { if (rf & 1) {
80
- i0.ɵɵelement(0, "prism-stat", 13);
81
- } if (rf & 2) {
82
- const ctx_r1 = i0.ɵɵnextContext(2);
83
- i0.ɵɵproperty("value", ctx_r1.a11yScore())("pillVariant", ctx_r1.a11yScore() >= 90 ? "ok" : "warn");
84
- } }
85
- function PrismComponentHeadComponent_Conditional_0_Conditional_21_Template(rf, ctx) { if (rf & 1) {
86
- i0.ɵɵelement(0, "prism-stat", 14);
87
- } if (rf & 2) {
88
- const vrt_r5 = ctx;
89
- i0.ɵɵproperty("value", vrt_r5.value)("pillVariant", vrt_r5.variant);
18
+ i0.ɵɵclassMap(i0.ɵɵinterpolate1("comp-status comp-status--", ctx_r1.status()));
19
+ i0.ɵɵattribute("title", badge_r1.tooltip);
20
+ i0.ɵɵadvance(2);
21
+ i0.ɵɵtextInterpolate1(" ", badge_r1.label, " ");
90
22
  } }
91
23
  function PrismComponentHeadComponent_Conditional_0_Template(rf, ctx) { if (rf & 1) {
92
- i0.ɵɵelementStart(0, "section", 0)(1, "div", 1)(2, "div")(3, "div", 2)(4, "span");
93
- i0.ɵɵtext(5);
94
- i0.ɵɵelementEnd();
95
- i0.ɵɵelement(6, "prism-icon", 3);
96
- i0.ɵɵelementStart(7, "span");
97
- i0.ɵɵtext(8);
98
- i0.ɵɵelementEnd()();
99
- i0.ɵɵelementStart(9, "h1", 4);
100
- i0.ɵɵtext(10);
101
- i0.ɵɵelementStart(11, "span", 5);
102
- i0.ɵɵtext(12);
103
- i0.ɵɵelementEnd();
104
- i0.ɵɵconditionalCreate(13, PrismComponentHeadComponent_Conditional_0_Conditional_13_Template, 6, 6, "span", 6);
24
+ i0.ɵɵelementStart(0, "section", 0)(1, "span", 1);
25
+ i0.ɵɵtext(2);
105
26
  i0.ɵɵelementEnd();
106
- i0.ɵɵconditionalCreate(14, PrismComponentHeadComponent_Conditional_0_Conditional_14_Template, 2, 1, "p", 7);
107
- i0.ɵɵconditionalCreate(15, PrismComponentHeadComponent_Conditional_0_Conditional_15_Template, 3, 0, "div", 8);
27
+ i0.ɵɵelementStart(3, "h1", 2);
28
+ i0.ɵɵtext(4);
108
29
  i0.ɵɵelementEnd();
109
- i0.ɵɵelementStart(16, "div", 9);
110
- i0.ɵɵconditionalCreate(17, PrismComponentHeadComponent_Conditional_0_Conditional_17_Template, 1, 1, "prism-stat", 10);
111
- i0.ɵɵconditionalCreate(18, PrismComponentHeadComponent_Conditional_0_Conditional_18_Template, 1, 3, "prism-stat", 11);
112
- i0.ɵɵconditionalCreate(19, PrismComponentHeadComponent_Conditional_0_Conditional_19_Template, 1, 1, "prism-stat", 12);
113
- i0.ɵɵconditionalCreate(20, PrismComponentHeadComponent_Conditional_0_Conditional_20_Template, 1, 2, "prism-stat", 13);
114
- i0.ɵɵconditionalCreate(21, PrismComponentHeadComponent_Conditional_0_Conditional_21_Template, 1, 2, "prism-stat", 14);
115
- i0.ɵɵelementEnd()()();
30
+ i0.ɵɵelement(5, "prism-head-info", 3);
31
+ i0.ɵɵconditionalCreate(6, PrismComponentHeadComponent_Conditional_0_Conditional_6_Template, 3, 5, "span", 4);
32
+ i0.ɵɵelement(7, "span", 5)(8, "prism-head-gauge", 6);
33
+ i0.ɵɵelementStart(9, "span", 7);
34
+ i0.ɵɵprojection(10);
35
+ i0.ɵɵelementEnd()();
116
36
  } if (rf & 2) {
117
- let tmp_7_0;
118
- let tmp_14_0;
37
+ let tmp_8_0;
119
38
  const c_r3 = ctx;
120
39
  const ctx_r1 = i0.ɵɵnextContext();
121
- i0.ɵɵadvance(5);
40
+ i0.ɵɵadvance(2);
122
41
  i0.ɵɵtextInterpolate(ctx_r1.category());
123
- i0.ɵɵadvance();
124
- i0.ɵɵproperty("size", 10);
125
42
  i0.ɵɵadvance(2);
126
43
  i0.ɵɵtextInterpolate(c_r3.meta.showcaseConfig.title);
127
- i0.ɵɵadvance(2);
128
- i0.ɵɵtextInterpolate1(" ", c_r3.meta.showcaseConfig.title, " ");
129
- i0.ɵɵadvance(2);
130
- i0.ɵɵtextInterpolate1("<", c_r3.meta.componentMeta.selector, ">");
131
- i0.ɵɵadvance();
132
- i0.ɵɵconditional((tmp_7_0 = ctx_r1.status()) ? 13 : -1, tmp_7_0);
133
44
  i0.ɵɵadvance();
134
- i0.ɵɵconditional(c_r3.meta.showcaseConfig.description ? 14 : -1);
45
+ i0.ɵɵproperty("selector", c_r3.meta.componentMeta.selector)("description", c_r3.meta.showcaseConfig.description)("tags", c_r3.meta.showcaseConfig.tags ?? i0.ɵɵpureFunction0(8, _c2))("variantCount", ctx_r1.variantCount());
135
46
  i0.ɵɵadvance();
136
- i0.ɵɵconditional(c_r3.meta.showcaseConfig.tags?.length ? 15 : -1);
47
+ i0.ɵɵconditional((tmp_8_0 = ctx_r1.statusBadge()) ? 6 : -1, tmp_8_0);
137
48
  i0.ɵɵadvance(2);
138
- i0.ɵɵconditional(ctx_r1.variantCount() > 0 ? 17 : -1);
139
- i0.ɵɵadvance();
140
- i0.ɵɵconditional(ctx_r1.coveragePercent() !== null ? 18 : -1);
141
- i0.ɵɵadvance();
142
- i0.ɵɵconditional(ctx_r1.bundleSize() !== null ? 19 : -1);
143
- i0.ɵɵadvance();
144
- i0.ɵɵconditional(ctx_r1.a11yScore() !== null ? 20 : -1);
145
- i0.ɵɵadvance();
146
- i0.ɵɵconditional((tmp_14_0 = ctx_r1.vrtStat()) ? 21 : -1, tmp_14_0);
49
+ i0.ɵɵproperty("metrics", ctx_r1.metrics());
147
50
  } }
148
51
  const STATUS_BADGES = {
149
52
  stable: {
@@ -193,17 +96,21 @@ export class PrismComponentHeadComponent {
193
96
  return null;
194
97
  }, /* @ts-ignore */
195
98
  ...(ngDevMode ? [{ debugName: "coveragePercent" }] : /* istanbul ignore next */ []));
196
- bundleSize = computed(() => {
197
- const meta = this.componentMeta();
198
- const perf = meta?.['perf'];
199
- const bundle = perf?.['bundle'];
200
- if (bundle && typeof bundle['gzipKb'] === 'number')
201
- return bundle['gzipKb'] + ' kb';
202
- if (bundle && typeof bundle['sizeKb'] === 'number')
203
- return bundle['sizeKb'] + ' kb';
204
- return null;
205
- }, /* @ts-ignore */
206
- ...(ngDevMode ? [{ debugName: "bundleSize" }] : /* istanbul ignore next */ []));
99
+ /*
100
+ * There is deliberately no bundle metric here.
101
+ *
102
+ * The computed that used to produce one read `meta.perf.bundle.gzipKb` and
103
+ * `.sizeKb`. `@ng-prism/plugin-perf` writes neither: `bundle-scanner.ts`
104
+ * stores `sourceSize` and `gzipEstimate`, and `perf.types.ts` declares only
105
+ * those two. So the value was always null, and the old head simply hid the
106
+ * tile — a gauge row reading `Bundle —` on every component is noise, not
107
+ * information.
108
+ *
109
+ * Do not re-add the read against the real key names without first settling
110
+ * whether `gzipEstimate` is bytes or kilobytes. The old code appended ' kb'
111
+ * to whatever it found, and that question belongs to the perf plugin, not
112
+ * to the head.
113
+ */
207
114
  a11yScore = computed(() => {
208
115
  return this.auditService.scoreResult()?.score ?? null;
209
116
  }, /* @ts-ignore */
@@ -226,6 +133,39 @@ export class PrismComponentHeadComponent {
226
133
  : null;
227
134
  }, /* @ts-ignore */
228
135
  ...(ngDevMode ? [{ debugName: "vrtStat" }] : /* istanbul ignore next */ []));
136
+ /**
137
+ * The full metric list for the gauge, in source order.
138
+ *
139
+ * Order matters: `summarizeMetrics` breaks severity ties by position, so
140
+ * this sequence is what makes the chip show a stable metric rather than
141
+ * flickering between two equally bad ones.
142
+ */
143
+ metrics = computed(() => {
144
+ const coverage = this.coveragePercent();
145
+ const a11y = this.a11yScore();
146
+ const vrt = this.vrtStat();
147
+ return [
148
+ {
149
+ id: 'coverage',
150
+ label: 'Coverage',
151
+ value: coverage === null ? '—' : `${coverage}%`,
152
+ variant: coverage === null ? 'none' : coverage >= 90 ? 'ok' : 'warn',
153
+ },
154
+ {
155
+ id: 'a11y',
156
+ label: 'A11y score',
157
+ value: a11y === null ? '—' : String(a11y),
158
+ variant: a11y === null ? 'none' : a11y >= 90 ? 'ok' : 'warn',
159
+ },
160
+ {
161
+ id: 'vrt',
162
+ label: 'VRT diff',
163
+ value: vrt === null ? '—' : vrt.value,
164
+ variant: vrt === null ? 'none' : vrt.variant,
165
+ },
166
+ ];
167
+ }, /* @ts-ignore */
168
+ ...(ngDevMode ? [{ debugName: "metrics" }] : /* istanbul ignore next */ []));
229
169
  componentMeta = computed(() => {
230
170
  const c = this.comp();
231
171
  const meta = c?.meta.showcaseConfig.meta;
@@ -235,87 +175,45 @@ export class PrismComponentHeadComponent {
235
175
  }, /* @ts-ignore */
236
176
  ...(ngDevMode ? [{ debugName: "componentMeta" }] : /* istanbul ignore next */ []));
237
177
  static ɵfac = function PrismComponentHeadComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || PrismComponentHeadComponent)(); };
238
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: PrismComponentHeadComponent, selectors: [["prism-component-head"]], decls: 1, vars: 1, consts: [[1, "comp-head"], [1, "comp-head-top"], [1, "comp-crumb"], ["name", "chevron-right", 3, "size"], [1, "comp-title"], [1, "comp-selector"], [3, "class"], [1, "comp-desc"], [1, "comp-tags"], [1, "comp-head-stats"], ["label", "Variants", 3, "value"], ["label", "Coverage", 3, "value", "pill", "pillVariant"], ["label", "Bundle", 3, "value"], ["label", "Score", "pill", "A11y", 3, "value", "pillVariant"], ["label", "VRT Diff", "pill", "VRT", 3, "value", "pillVariant"], ["name", "check", 3, "size"], ["aria-hidden", "true", 1, "comp-status-ring"], ["aria-hidden", "true", 1, "comp-status-dot"], [1, "comp-status-label"], [1, "comp-tag"]], template: function PrismComponentHeadComponent_Template(rf, ctx) { if (rf & 1) {
239
- i0.ɵɵconditionalCreate(0, PrismComponentHeadComponent_Conditional_0_Template, 22, 13, "section", 0);
178
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: PrismComponentHeadComponent, selectors: [["prism-component-head"]], ngContentSelectors: _c1, decls: 1, vars: 1, consts: [[1, "comp-head"], [1, "comp-crumb"], [1, "comp-title"], [3, "selector", "description", "tags", "variantCount"], [3, "class"], [1, "comp-spacer"], [3, "metrics"], [1, "comp-head-end"], ["aria-hidden", "true", 1, "comp-status-mark"]], template: function PrismComponentHeadComponent_Template(rf, ctx) { if (rf & 1) {
179
+ i0.ɵɵprojectionDef(_c0);
180
+ i0.ɵɵconditionalCreate(0, PrismComponentHeadComponent_Conditional_0_Template, 11, 9, "section", 0);
240
181
  } if (rf & 2) {
241
182
  let tmp_0_0;
242
183
  i0.ɵɵconditional((tmp_0_0 = ctx.comp()) ? 0 : -1, tmp_0_0);
243
- } }, dependencies: [PrismIconComponent, PrismStatComponent], styles: ["[_nghost-%COMP%] { display: block; flex-shrink: 0; }\n\n .comp-head[_ngcontent-%COMP%] {\n padding: 12px 28px;\n background: var(--%NS%prism-bg);\n border-bottom: 1px solid var(--%NS%prism-border);\n position: relative;\n }\n .comp-head[_ngcontent-%COMP%]::before {\n content: '';\n position: absolute;\n left: 0;\n top: 0;\n bottom: 0;\n width: 6px;\n background: linear-gradient(180deg, var(--%NS%prism-primary-from) 0%, var(--%NS%prism-accent) 50%, var(--%NS%prism-primary-to) 100%);\n }\n\n .comp-head-top[_ngcontent-%COMP%] {\n display: flex;\n align-items: flex-start;\n justify-content: space-between;\n gap: 16px;\n }\n\n .comp-crumb[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 6px;\n font-size: var(--%NS%fs-sm);\n color: var(--%NS%prism-text-ghost);\n margin-bottom: 6px;\n font-weight: 500;\n letter-spacing: 0.04em;\n text-transform: uppercase;\n }\n .comp-crumb[_ngcontent-%COMP%] prism-icon[_ngcontent-%COMP%] { opacity: 0.6; }\n\n .comp-title[_ngcontent-%COMP%] {\n margin: 0;\n font-size: var(--%NS%fs-2xl);\n font-weight: 700;\n letter-spacing: -0.02em;\n color: var(--%NS%prism-text);\n display: flex;\n align-items: center;\n gap: 10px;\n }\n\n .comp-selector[_ngcontent-%COMP%] {\n font-family: var(--%NS%font-mono);\n font-size: 12px;\n color: var(--%NS%prism-primary);\n padding: 3px 8px;\n border-radius: var(--%NS%radius-sm);\n background: color-mix(in srgb, var(--%NS%prism-primary) 10%, transparent);\n border: 1px solid color-mix(in srgb, var(--%NS%prism-primary) 20%, transparent);\n font-weight: 500;\n }\n\n .comp-status[_ngcontent-%COMP%] {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n height: 24px;\n padding: 0 10px 0 8px;\n border-radius: 5px;\n font-size: 11.5px;\n font-weight: 600;\n letter-spacing: 0.02em;\n border: 1px solid;\n background: transparent;\n }\n .comp-status-label[_ngcontent-%COMP%] { line-height: 1; }\n .comp-status-dot[_ngcontent-%COMP%] {\n width: 7px;\n height: 7px;\n border-radius: 50%;\n background: currentColor;\n }\n .comp-status-ring[_ngcontent-%COMP%] {\n width: 8px;\n height: 8px;\n border-radius: 50%;\n border: 1.5px solid currentColor;\n background: transparent;\n box-sizing: border-box;\n }\n .comp-status[_ngcontent-%COMP%] prism-icon[_ngcontent-%COMP%] { display: inline-flex; }\n\n .comp-status--stable[_ngcontent-%COMP%] {\n color: var(--%NS%prism-success);\n background: color-mix(in srgb, var(--%NS%prism-success) 10%, transparent);\n border-color: color-mix(in srgb, var(--%NS%prism-success) 35%, transparent);\n }\n .comp-status--beta[_ngcontent-%COMP%] {\n color: #60a5fa;\n background: color-mix(in srgb, #60a5fa 10%, transparent);\n border-color: color-mix(in srgb, #60a5fa 35%, transparent);\n }\n .comp-status--wip[_ngcontent-%COMP%] {\n color: var(--%NS%prism-warn);\n background: color-mix(in srgb, var(--%NS%prism-warn) 10%, transparent);\n border-color: color-mix(in srgb, var(--%NS%prism-warn) 35%, transparent);\n }\n .comp-status--deprecated[_ngcontent-%COMP%] {\n color: var(--%NS%prism-text-muted);\n background: var(--%NS%prism-input-bg);\n border-color: var(--%NS%prism-border-strong);\n }\n\n .comp-desc[_ngcontent-%COMP%] {\n margin: 6px 0 0;\n font-size: var(--%NS%fs-lg);\n color: var(--%NS%prism-text-2);\n max-width: 72ch;\n line-height: 1.55;\n }\n\n .comp-tags[_ngcontent-%COMP%] {\n margin-top: 10px;\n display: flex;\n gap: 6px;\n flex-wrap: wrap;\n }\n .comp-tag[_ngcontent-%COMP%] {\n padding: 2px 8px;\n font-size: 11px;\n font-weight: 500;\n border-radius: var(--%NS%radius-xs);\n background: color-mix(in srgb, var(--%NS%prism-primary) 12%, transparent);\n color: var(--%NS%prism-primary);\n border: 1px solid color-mix(in srgb, var(--%NS%prism-primary) 20%, transparent);\n }\n\n .comp-head-stats[_ngcontent-%COMP%] {\n display: flex;\n gap: 18px;\n flex-shrink: 0;\n }"] });
184
+ } }, dependencies: [PrismHeadInfoComponent, PrismHeadGaugeComponent], styles: ["[_nghost-%COMP%] { display: block; flex-shrink: 0; }\n\n .comp-head[_ngcontent-%COMP%] {\n height: var(--%NS%band-head);\n display: flex;\n align-items: center;\n gap: var(--%NS%sp-3);\n padding: 0 var(--%NS%sp-5);\n background: var(--%NS%prism-bg);\n border-bottom: 1px solid var(--%NS%prism-border);\n }\n\n \n\n\n\n\n\n\n .comp-crumb[_ngcontent-%COMP%] {\n flex: 0 8 auto;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n font-size: var(--%NS%fs-xs);\n color: var(--%NS%prism-text-ghost);\n letter-spacing: 0.06em;\n text-transform: uppercase;\n white-space: nowrap;\n }\n .comp-crumb[_ngcontent-%COMP%]::after { content: ' /'; }\n\n .comp-title[_ngcontent-%COMP%] {\n flex: 0 1 auto;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n margin: 0;\n font-size: var(--%NS%fs-xl);\n font-weight: 600;\n letter-spacing: -0.015em;\n color: var(--%NS%prism-text);\n white-space: nowrap;\n }\n\n .comp-spacer[_ngcontent-%COMP%] { flex: 1; }\n\n .comp-status[_ngcontent-%COMP%], \n prism-head-info[_ngcontent-%COMP%], \n prism-head-gauge[_ngcontent-%COMP%], \n .comp-head-end[_ngcontent-%COMP%] { flex: none; }\n\n \n\n\n .comp-head-end[_ngcontent-%COMP%] { display: inline-flex; align-items: center; }\n .comp-head-end[_ngcontent-%COMP%]:empty { display: none; }\n\n \n\n\n\n .comp-status[_ngcontent-%COMP%] {\n display: inline-flex;\n align-items: center;\n gap: var(--%NS%sp-2);\n height: 18px;\n padding: 0 var(--%NS%sp-3) 0 var(--%NS%sp-2);\n border-radius: var(--%NS%radius-xs);\n border: 1px solid currentColor;\n font-size: var(--%NS%fs-xs);\n font-weight: 600;\n letter-spacing: 0.03em;\n white-space: nowrap;\n color: var(--%NS%prism-text-muted);\n }\n .comp-status-mark[_ngcontent-%COMP%] {\n width: 6px;\n height: 6px;\n border-radius: 50%;\n background: currentColor;\n }\n .comp-status--stable[_ngcontent-%COMP%] {\n color: var(--%NS%prism-mark-nominal);\n background: color-mix(in srgb, var(--%NS%prism-mark-nominal) 10%, transparent);\n }\n .comp-status--beta[_ngcontent-%COMP%], \n .comp-status--wip[_ngcontent-%COMP%] {\n color: var(--%NS%prism-mark-attention);\n background: color-mix(in srgb, var(--%NS%prism-mark-attention) 10%, transparent);\n }\n .comp-status--wip[_ngcontent-%COMP%] .comp-status-mark[_ngcontent-%COMP%] {\n background: transparent;\n border: 1.5px solid currentColor;\n box-sizing: border-box;\n width: 7px;\n height: 7px;\n }\n .comp-status--deprecated[_ngcontent-%COMP%] {\n color: var(--%NS%prism-mark-critical);\n background: color-mix(in srgb, var(--%NS%prism-mark-critical) 12%, transparent);\n border-color: color-mix(in srgb, var(--%NS%prism-mark-critical) 55%, transparent);\n }"] });
244
185
  }
245
186
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PrismComponentHeadComponent, [{
246
187
  type: Component,
247
- args: [{ selector: 'prism-component-head', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [PrismIconComponent, PrismStatComponent], template: `
188
+ args: [{ selector: 'prism-component-head', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [PrismHeadInfoComponent, PrismHeadGaugeComponent], template: `
248
189
  @if (comp(); as c) {
249
190
  <section class="comp-head">
250
- <div class="comp-head-top">
251
- <div>
252
- <div class="comp-crumb">
253
- <span>{{ category() }}</span>
254
- <prism-icon name="chevron-right" [size]="10" />
255
- <span>{{ c.meta.showcaseConfig.title }}</span>
256
- </div>
257
- <h1 class="comp-title">
258
- {{ c.meta.showcaseConfig.title }}
259
- <span class="comp-selector"
260
- >&lt;{{ c.meta.componentMeta.selector }}&gt;</span
261
- >
262
- @if (status(); as s) {
263
- <span
264
- class="comp-status comp-status--{{ s }}"
265
- [attr.title]="statusBadge()!.tooltip"
266
- >
267
- @if (s === 'stable') {
268
- <prism-icon name="check" [size]="13" />
269
- } @else if (s === 'wip') {
270
- <span class="comp-status-ring" aria-hidden="true"></span>
271
- } @else {
272
- <span class="comp-status-dot" aria-hidden="true"></span>
273
- }
274
- <span class="comp-status-label">{{ statusBadge()!.label }}</span>
275
- </span>
276
- }
277
- </h1>
278
- @if (c.meta.showcaseConfig.description) {
279
- <p class="comp-desc">{{ c.meta.showcaseConfig.description }}</p>
280
- } @if (c.meta.showcaseConfig.tags?.length) {
281
- <div class="comp-tags">
282
- @for (tag of c.meta.showcaseConfig.tags; track tag) {
283
- <span class="comp-tag">{{ tag }}</span>
284
- }
285
- </div>
286
- }
287
- </div>
288
- <div class="comp-head-stats">
289
- @if (variantCount() > 0) {
290
- <prism-stat [value]="variantCount()" label="Variants" />
291
- } @if (coveragePercent() !== null) {
292
- <prism-stat
293
- [value]="coveragePercent()! + '%'"
294
- label="Coverage"
295
- [pill]="coveragePercent()! >= 90 ? 'OK' : 'WARN'"
296
- [pillVariant]="coveragePercent()! >= 90 ? 'ok' : 'warn'"
297
- />
298
- } @if (bundleSize() !== null) {
299
- <prism-stat [value]="bundleSize()!" label="Bundle" />
300
- } @if (a11yScore() !== null) {
301
- <prism-stat
302
- [value]="a11yScore()!"
303
- label="Score"
304
- pill="A11y"
305
- [pillVariant]="a11yScore()! >= 90 ? 'ok' : 'warn'"
306
- />
307
- } @if (vrtStat(); as vrt) {
308
- <prism-stat
309
- [value]="vrt.value"
310
- label="VRT Diff"
311
- pill="VRT"
312
- [pillVariant]="vrt.variant"
313
- />
314
- }
315
- </div>
316
- </div>
191
+ <span class="comp-crumb">{{ category() }}</span>
192
+ <h1 class="comp-title">{{ c.meta.showcaseConfig.title }}</h1>
193
+
194
+ <prism-head-info
195
+ [selector]="c.meta.componentMeta.selector"
196
+ [description]="c.meta.showcaseConfig.description"
197
+ [tags]="c.meta.showcaseConfig.tags ?? []"
198
+ [variantCount]="variantCount()"
199
+ />
200
+
201
+ @if (statusBadge(); as badge) {
202
+ <span
203
+ class="comp-status comp-status--{{ status() }}"
204
+ [attr.title]="badge.tooltip"
205
+ >
206
+ <span class="comp-status-mark" aria-hidden="true"></span>
207
+ {{ badge.label }}
208
+ </span>
209
+ }
210
+
211
+ <span class="comp-spacer"></span>
212
+
213
+ <prism-head-gauge [metrics]="metrics()" />
214
+ <span class="comp-head-end"><ng-content select="[headEnd]" /></span>
317
215
  </section>
318
216
  }
319
- `, styles: ["\n :host { display: block; flex-shrink: 0; }\n\n .comp-head {\n padding: 12px 28px;\n background: var(--prism-bg);\n border-bottom: 1px solid var(--prism-border);\n position: relative;\n }\n .comp-head::before {\n content: '';\n position: absolute;\n left: 0;\n top: 0;\n bottom: 0;\n width: 6px;\n background: linear-gradient(180deg, var(--prism-primary-from) 0%, var(--prism-accent) 50%, var(--prism-primary-to) 100%);\n }\n\n .comp-head-top {\n display: flex;\n align-items: flex-start;\n justify-content: space-between;\n gap: 16px;\n }\n\n .comp-crumb {\n display: flex;\n align-items: center;\n gap: 6px;\n font-size: var(--fs-sm);\n color: var(--prism-text-ghost);\n margin-bottom: 6px;\n font-weight: 500;\n letter-spacing: 0.04em;\n text-transform: uppercase;\n }\n .comp-crumb prism-icon { opacity: 0.6; }\n\n .comp-title {\n margin: 0;\n font-size: var(--fs-2xl);\n font-weight: 700;\n letter-spacing: -0.02em;\n color: var(--prism-text);\n display: flex;\n align-items: center;\n gap: 10px;\n }\n\n .comp-selector {\n font-family: var(--font-mono);\n font-size: 12px;\n color: var(--prism-primary);\n padding: 3px 8px;\n border-radius: var(--radius-sm);\n background: color-mix(in srgb, var(--prism-primary) 10%, transparent);\n border: 1px solid color-mix(in srgb, var(--prism-primary) 20%, transparent);\n font-weight: 500;\n }\n\n .comp-status {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n height: 24px;\n padding: 0 10px 0 8px;\n border-radius: 5px;\n font-size: 11.5px;\n font-weight: 600;\n letter-spacing: 0.02em;\n border: 1px solid;\n background: transparent;\n }\n .comp-status-label { line-height: 1; }\n .comp-status-dot {\n width: 7px;\n height: 7px;\n border-radius: 50%;\n background: currentColor;\n }\n .comp-status-ring {\n width: 8px;\n height: 8px;\n border-radius: 50%;\n border: 1.5px solid currentColor;\n background: transparent;\n box-sizing: border-box;\n }\n .comp-status prism-icon { display: inline-flex; }\n\n .comp-status--stable {\n color: var(--prism-success);\n background: color-mix(in srgb, var(--prism-success) 10%, transparent);\n border-color: color-mix(in srgb, var(--prism-success) 35%, transparent);\n }\n .comp-status--beta {\n color: #60a5fa;\n background: color-mix(in srgb, #60a5fa 10%, transparent);\n border-color: color-mix(in srgb, #60a5fa 35%, transparent);\n }\n .comp-status--wip {\n color: var(--prism-warn);\n background: color-mix(in srgb, var(--prism-warn) 10%, transparent);\n border-color: color-mix(in srgb, var(--prism-warn) 35%, transparent);\n }\n .comp-status--deprecated {\n color: var(--prism-text-muted);\n background: var(--prism-input-bg);\n border-color: var(--prism-border-strong);\n }\n\n .comp-desc {\n margin: 6px 0 0;\n font-size: var(--fs-lg);\n color: var(--prism-text-2);\n max-width: 72ch;\n line-height: 1.55;\n }\n\n .comp-tags {\n margin-top: 10px;\n display: flex;\n gap: 6px;\n flex-wrap: wrap;\n }\n .comp-tag {\n padding: 2px 8px;\n font-size: 11px;\n font-weight: 500;\n border-radius: var(--radius-xs);\n background: color-mix(in srgb, var(--prism-primary) 12%, transparent);\n color: var(--prism-primary);\n border: 1px solid color-mix(in srgb, var(--prism-primary) 20%, transparent);\n }\n\n .comp-head-stats {\n display: flex;\n gap: 18px;\n flex-shrink: 0;\n }\n "] }]
217
+ `, styles: ["\n :host { display: block; flex-shrink: 0; }\n\n .comp-head {\n height: var(--band-head);\n display: flex;\n align-items: center;\n gap: var(--sp-3);\n padding: 0 var(--sp-5);\n background: var(--prism-bg);\n border-bottom: 1px solid var(--prism-border);\n }\n\n /* The text yields, the controls never do. A long category and a long title\n would otherwise push the gauge out of a fixed-height row whose ancestors\n clip \u2014 making the measurement unreachable in exactly the case where you\n most want to read it, and costing the gauge the fixed position it was\n designed around. The trade is deliberate: a title truncated with an\n ellipsis, so the chip stays put at the right edge. The crumb gives way\n first, being the least important text in the row. */\n .comp-crumb {\n flex: 0 8 auto;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n font-size: var(--fs-xs);\n color: var(--prism-text-ghost);\n letter-spacing: 0.06em;\n text-transform: uppercase;\n white-space: nowrap;\n }\n .comp-crumb::after { content: ' /'; }\n\n .comp-title {\n flex: 0 1 auto;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n margin: 0;\n font-size: var(--fs-xl);\n font-weight: 600;\n letter-spacing: -0.015em;\n color: var(--prism-text);\n white-space: nowrap;\n }\n\n .comp-spacer { flex: 1; }\n\n .comp-status,\n prism-head-info,\n prism-head-gauge,\n .comp-head-end { flex: none; }\n\n /* Wraps the slot rather than styling the projected element, which this\n stylesheet cannot reach. :empty keeps the row's trailing gap from\n appearing when nothing is projected \u2014 comment anchors do not count. */\n .comp-head-end { display: inline-flex; align-items: center; }\n .comp-head-end:empty { display: none; }\n\n /* Always an outline, never a filled surface \u2014 deprecated separates itself\n by hue, not by weight. A filled alarm-coloured chip in a permanently\n visible band is exactly the \"red as background texture\" problem this\n redesign exists to fix. */\n .comp-status {\n display: inline-flex;\n align-items: center;\n gap: var(--sp-2);\n height: 18px;\n padding: 0 var(--sp-3) 0 var(--sp-2);\n border-radius: var(--radius-xs);\n border: 1px solid currentColor;\n font-size: var(--fs-xs);\n font-weight: 600;\n letter-spacing: 0.03em;\n white-space: nowrap;\n color: var(--prism-text-muted);\n }\n .comp-status-mark {\n width: 6px;\n height: 6px;\n border-radius: 50%;\n background: currentColor;\n }\n .comp-status--stable {\n color: var(--prism-mark-nominal);\n background: color-mix(in srgb, var(--prism-mark-nominal) 10%, transparent);\n }\n .comp-status--beta,\n .comp-status--wip {\n color: var(--prism-mark-attention);\n background: color-mix(in srgb, var(--prism-mark-attention) 10%, transparent);\n }\n .comp-status--wip .comp-status-mark {\n background: transparent;\n border: 1.5px solid currentColor;\n box-sizing: border-box;\n width: 7px;\n height: 7px;\n }\n .comp-status--deprecated {\n color: var(--prism-mark-critical);\n background: color-mix(in srgb, var(--prism-mark-critical) 12%, transparent);\n border-color: color-mix(in srgb, var(--prism-mark-critical) 55%, transparent);\n }\n "] }]
320
218
  }], null, null); })();
321
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PrismComponentHeadComponent, { className: "PrismComponentHeadComponent", filePath: "app/component-head/prism-component-head.component.ts", lineNumber: 258 }); })();
219
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PrismComponentHeadComponent, { className: "PrismComponentHeadComponent", filePath: "app/component-head/prism-component-head.component.ts", lineNumber: 179 }); })();
@@ -0,0 +1,23 @@
1
+ import { type HeadMetric } from './head-metrics.js';
2
+ import * as i0 from "@angular/core";
3
+ /**
4
+ * Measurement disclosure for the component head.
5
+ *
6
+ * Replaces four always-present stat tiles with one element of fixed width at a
7
+ * fixed position, so the row does not shift when you switch components. It
8
+ * shows a plain count in the nominal green while everything is within
9
+ * threshold, and the worst value in plain text when it is not. The full
10
+ * readout is one click away and never disappears.
11
+ *
12
+ * It knows no individual metric. The list arrives already resolved, in the
13
+ * same shape `decorateItem` produces for the sidebar, which is less code than
14
+ * the five @if branches it replaces and keeps the colour rule in one place.
15
+ */
16
+ export declare class PrismHeadGaugeComponent {
17
+ readonly metrics: import("@angular/core").InputSignal<readonly HeadMetric[]>;
18
+ protected readonly summary: import("@angular/core").Signal<import("./head-metrics.js").GaugeSummary>;
19
+ protected readonly ariaLabel: import("@angular/core").Signal<string>;
20
+ static ɵfac: i0.ɵɵFactoryDeclaration<PrismHeadGaugeComponent, never>;
21
+ static ɵcmp: i0.ɵɵComponentDeclaration<PrismHeadGaugeComponent, "prism-head-gauge", never, { "metrics": { "alias": "metrics"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
22
+ }
23
+ //# sourceMappingURL=prism-head-gauge.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prism-head-gauge.component.d.ts","sourceRoot":"","sources":["../../../src/app/component-head/prism-head-gauge.component.ts"],"names":[],"mappings":"AAMA,OAAO,EAAoB,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;;AAGtE;;;;;;;;;;;;GAYG;AACH,qBAmHa,uBAAuB;IAClC,QAAQ,CAAC,OAAO,6DAA2C;IAC3D,SAAS,CAAC,QAAQ,CAAC,OAAO,2EAAoD;IAC9E,SAAS,CAAC,QAAQ,CAAC,SAAS,yCAOzB;yCAVQ,uBAAuB;2CAAvB,uBAAuB;CAWnC"}
@@ -0,0 +1,123 @@
1
+ import { ChangeDetectionStrategy, Component, computed, input, } from '@angular/core';
2
+ import { summarizeMetrics } from './head-metrics.js';
3
+ import { PrismStatComponent } from './prism-stat.component.js';
4
+ import * as i0 from "@angular/core";
5
+ const _forTrack0 = ($index, $item) => $item.id;
6
+ function PrismHeadGaugeComponent_Conditional_2_Conditional_2_Template(rf, ctx) { if (rf & 1) {
7
+ i0.ɵɵelementStart(0, "span", 5);
8
+ i0.ɵɵtext(1);
9
+ i0.ɵɵelementEnd();
10
+ } if (rf & 2) {
11
+ const ctx_r0 = i0.ɵɵnextContext(2);
12
+ i0.ɵɵadvance();
13
+ i0.ɵɵtextInterpolate1("+", ctx_r0.summary().others);
14
+ } }
15
+ function PrismHeadGaugeComponent_Conditional_2_Template(rf, ctx) { if (rf & 1) {
16
+ i0.ɵɵelementStart(0, "span", 2);
17
+ i0.ɵɵtext(1);
18
+ i0.ɵɵelementEnd();
19
+ i0.ɵɵconditionalCreate(2, PrismHeadGaugeComponent_Conditional_2_Conditional_2_Template, 2, 1, "span", 5);
20
+ } if (rf & 2) {
21
+ const worst_r2 = ctx;
22
+ const ctx_r0 = i0.ɵɵnextContext();
23
+ i0.ɵɵadvance();
24
+ i0.ɵɵtextInterpolate2("", worst_r2.label, " ", worst_r2.value);
25
+ i0.ɵɵadvance();
26
+ i0.ɵɵconditional(ctx_r0.summary().others > 0 ? 2 : -1);
27
+ } }
28
+ function PrismHeadGaugeComponent_Conditional_3_Template(rf, ctx) { if (rf & 1) {
29
+ i0.ɵɵelementStart(0, "span", 2);
30
+ i0.ɵɵtext(1);
31
+ i0.ɵɵelementEnd();
32
+ } if (rf & 2) {
33
+ const ctx_r0 = i0.ɵɵnextContext();
34
+ i0.ɵɵadvance();
35
+ i0.ɵɵtextInterpolate(ctx_r0.summary().measured);
36
+ } }
37
+ function PrismHeadGaugeComponent_For_6_Template(rf, ctx) { if (rf & 1) {
38
+ i0.ɵɵelement(0, "prism-stat", 4);
39
+ } if (rf & 2) {
40
+ const m_r3 = ctx.$implicit;
41
+ i0.ɵɵproperty("label", m_r3.label)("value", m_r3.value)("variant", m_r3.variant);
42
+ } }
43
+ /**
44
+ * Measurement disclosure for the component head.
45
+ *
46
+ * Replaces four always-present stat tiles with one element of fixed width at a
47
+ * fixed position, so the row does not shift when you switch components. It
48
+ * shows a plain count in the nominal green while everything is within
49
+ * threshold, and the worst value in plain text when it is not. The full
50
+ * readout is one click away and never disappears.
51
+ *
52
+ * It knows no individual metric. The list arrives already resolved, in the
53
+ * same shape `decorateItem` produces for the sidebar, which is less code than
54
+ * the five @if branches it replaces and keeps the colour rule in one place.
55
+ */
56
+ export class PrismHeadGaugeComponent {
57
+ metrics = input.required(/* @ts-ignore */
58
+ ...(ngDevMode ? [{ debugName: "metrics" }] : /* istanbul ignore next */ []));
59
+ summary = computed(() => summarizeMetrics(this.metrics()), /* @ts-ignore */
60
+ ...(ngDevMode ? [{ debugName: "summary" }] : /* istanbul ignore next */ []));
61
+ ariaLabel = computed(() => {
62
+ const s = this.summary();
63
+ return s.worst === null
64
+ ? `${s.measured} metrics, all within threshold`
65
+ : `${s.worst.label} ${s.worst.value}${s.others > 0 ? `, ${s.others} more deviating` : ''}`;
66
+ }, /* @ts-ignore */
67
+ ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
68
+ static ɵfac = function PrismHeadGaugeComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || PrismHeadGaugeComponent)(); };
69
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: PrismHeadGaugeComponent, selectors: [["prism-head-gauge"]], inputs: { metrics: [1, "metrics"] }, decls: 7, vars: 9, consts: [["type", "button", "popovertarget", "prism-head-gauge", 1, "gauge"], ["aria-hidden", "true", 1, "gauge__dot"], [1, "gauge__text"], ["popover", "", "id", "prism-head-gauge", "role", "dialog", "aria-label", "Component metrics", 1, "gauge-card"], [3, "label", "value", "variant"], [1, "gauge__more"]], template: function PrismHeadGaugeComponent_Template(rf, ctx) { if (rf & 1) {
70
+ i0.ɵɵelementStart(0, "button", 0);
71
+ i0.ɵɵelement(1, "span", 1);
72
+ i0.ɵɵconditionalCreate(2, PrismHeadGaugeComponent_Conditional_2_Template, 3, 3)(3, PrismHeadGaugeComponent_Conditional_3_Template, 2, 1, "span", 2);
73
+ i0.ɵɵelementEnd();
74
+ i0.ɵɵelementStart(4, "div", 3);
75
+ i0.ɵɵrepeaterCreate(5, PrismHeadGaugeComponent_For_6_Template, 1, 3, "prism-stat", 4, _forTrack0);
76
+ i0.ɵɵelementEnd();
77
+ } if (rf & 2) {
78
+ let tmp_5_0;
79
+ i0.ɵɵclassProp("gauge--ok", ctx.summary().variant === "ok")("gauge--warn", ctx.summary().variant === "warn")("gauge--danger", ctx.summary().variant === "danger");
80
+ i0.ɵɵattribute("aria-label", ctx.ariaLabel())("title", ctx.ariaLabel());
81
+ i0.ɵɵadvance(2);
82
+ i0.ɵɵconditional((tmp_5_0 = ctx.summary().worst) ? 2 : 3, tmp_5_0);
83
+ i0.ɵɵadvance(3);
84
+ i0.ɵɵrepeater(ctx.metrics());
85
+ } }, dependencies: [PrismStatComponent], styles: ["[_nghost-%COMP%] { display: inline-flex; }\n\n .gauge[_ngcontent-%COMP%] {\n display: inline-flex;\n align-items: center;\n gap: var(--%NS%sp-2);\n height: 20px;\n padding: 0 var(--%NS%sp-3);\n border: 1px solid var(--%NS%prism-border);\n border-radius: var(--%NS%radius-xs);\n background: transparent;\n color: var(--%NS%prism-text-muted);\n font-family: var(--%NS%font-mono);\n font-size: var(--%NS%fs-xs);\n font-variant-numeric: tabular-nums;\n white-space: nowrap;\n cursor: pointer;\n anchor-name: --prism-head-gauge;\n }\n .gauge[_ngcontent-%COMP%]:focus-visible {\n outline: 2px solid var(--%NS%prism-primary);\n outline-offset: 1px;\n }\n .gauge__dot[_ngcontent-%COMP%] {\n width: 5px;\n height: 5px;\n border-radius: 50%;\n background: currentColor;\n opacity: 0.5;\n }\n .gauge__more[_ngcontent-%COMP%] { opacity: 0.6; }\n\n \n\n\n .gauge--ok[_ngcontent-%COMP%] {\n color: var(--%NS%prism-mark-nominal);\n border-color: color-mix(in srgb, var(--%NS%prism-mark-nominal) 40%, transparent);\n }\n .gauge--warn[_ngcontent-%COMP%] {\n color: var(--%NS%prism-mark-attention);\n border-color: color-mix(in srgb, var(--%NS%prism-mark-attention) 40%, transparent);\n }\n .gauge--danger[_ngcontent-%COMP%] {\n color: var(--%NS%prism-mark-critical);\n border-color: color-mix(in srgb, var(--%NS%prism-mark-critical) 45%, transparent);\n }\n .gauge--ok[_ngcontent-%COMP%] .gauge__dot[_ngcontent-%COMP%], \n .gauge--warn[_ngcontent-%COMP%] .gauge__dot[_ngcontent-%COMP%], \n .gauge--danger[_ngcontent-%COMP%] .gauge__dot[_ngcontent-%COMP%] { opacity: 1; }\n\n .gauge-card[_ngcontent-%COMP%] {\n margin: 0;\n padding: var(--%NS%sp-2);\n min-width: 200px;\n border: 1px solid var(--%NS%prism-border-strong);\n border-radius: var(--%NS%radius-md);\n background: var(--%NS%prism-bg-elevated);\n box-shadow: 0 8px 28px -10px rgba(0, 0, 0, 0.45);\n gap: 1px;\n position-anchor: --prism-head-gauge;\n position-area: block-end span-inline-start;\n position-try-fallbacks: flip-block, flip-inline;\n inset: auto;\n }\n\n \n\n\n\n .gauge-card[_ngcontent-%COMP%]:popover-open {\n display: flex;\n flex-direction: column;\n }"] });
86
+ }
87
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PrismHeadGaugeComponent, [{
88
+ type: Component,
89
+ args: [{ selector: 'prism-head-gauge', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [PrismStatComponent], template: `
90
+ <button
91
+ class="gauge"
92
+ type="button"
93
+ [class.gauge--ok]="summary().variant === 'ok'"
94
+ [class.gauge--warn]="summary().variant === 'warn'"
95
+ [class.gauge--danger]="summary().variant === 'danger'"
96
+ popovertarget="prism-head-gauge"
97
+ [attr.aria-label]="ariaLabel()"
98
+ [attr.title]="ariaLabel()"
99
+ >
100
+ <span class="gauge__dot" aria-hidden="true"></span>
101
+ @if (summary().worst; as worst) {
102
+ <span class="gauge__text">{{ worst.label }} {{ worst.value }}</span>
103
+ @if (summary().others > 0) {
104
+ <span class="gauge__more">+{{ summary().others }}</span>
105
+ } } @else {
106
+ <span class="gauge__text">{{ summary().measured }}</span>
107
+ }
108
+ </button>
109
+
110
+ <div
111
+ popover
112
+ id="prism-head-gauge"
113
+ class="gauge-card"
114
+ role="dialog"
115
+ aria-label="Component metrics"
116
+ >
117
+ @for (m of metrics(); track m.id) {
118
+ <prism-stat [label]="m.label" [value]="m.value" [variant]="m.variant" />
119
+ }
120
+ </div>
121
+ `, styles: ["\n :host { display: inline-flex; }\n\n .gauge {\n display: inline-flex;\n align-items: center;\n gap: var(--sp-2);\n height: 20px;\n padding: 0 var(--sp-3);\n border: 1px solid var(--prism-border);\n border-radius: var(--radius-xs);\n background: transparent;\n color: var(--prism-text-muted);\n font-family: var(--font-mono);\n font-size: var(--fs-xs);\n font-variant-numeric: tabular-nums;\n white-space: nowrap;\n cursor: pointer;\n anchor-name: --prism-head-gauge;\n }\n .gauge:focus-visible {\n outline: 2px solid var(--prism-primary);\n outline-offset: 1px;\n }\n .gauge__dot {\n width: 5px;\n height: 5px;\n border-radius: 50%;\n background: currentColor;\n opacity: 0.5;\n }\n .gauge__more { opacity: 0.6; }\n\n /* The quiet state is green now, not grey: the gauge says \"these values\n were measured and all of them are fine\", which is a result, not an\n absence. A metric with no data at all stays grey in the readout rows. */\n .gauge--ok {\n color: var(--prism-mark-nominal);\n border-color: color-mix(in srgb, var(--prism-mark-nominal) 40%, transparent);\n }\n .gauge--warn {\n color: var(--prism-mark-attention);\n border-color: color-mix(in srgb, var(--prism-mark-attention) 40%, transparent);\n }\n .gauge--danger {\n color: var(--prism-mark-critical);\n border-color: color-mix(in srgb, var(--prism-mark-critical) 45%, transparent);\n }\n .gauge--ok .gauge__dot,\n .gauge--warn .gauge__dot,\n .gauge--danger .gauge__dot { opacity: 1; }\n\n .gauge-card {\n margin: 0;\n padding: var(--sp-2);\n min-width: 200px;\n border: 1px solid var(--prism-border-strong);\n border-radius: var(--radius-md);\n background: var(--prism-bg-elevated);\n box-shadow: 0 8px 28px -10px rgba(0, 0, 0, 0.45);\n gap: 1px;\n position-anchor: --prism-head-gauge;\n position-area: block-end span-inline-start;\n position-try-fallbacks: flip-block, flip-inline;\n inset: auto;\n }\n\n /* display belongs on :popover-open and nowhere else \u2014 see the note in\n prism-template-popover.component.ts. An author display on the base\n rule outranks the UA's [popover]:not(:popover-open) { display: none }\n and pins the readout open. */\n .gauge-card:popover-open {\n display: flex;\n flex-direction: column;\n }\n "] }]
122
+ }], null, { metrics: [{ type: i0.Input, args: [{ isSignal: true, alias: "metrics", required: true }] }] }); })();
123
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PrismHeadGaugeComponent, { className: "PrismHeadGaugeComponent", filePath: "app/component-head/prism-head-gauge.component.ts", lineNumber: 138 }); })();
@@ -0,0 +1,23 @@
1
+ import * as i0 from "@angular/core";
2
+ /**
3
+ * Identity disclosure for the component head.
4
+ *
5
+ * Selector, description and tags all answer "what is this component" — a
6
+ * question you read once on arrival and never again while building. Keeping
7
+ * them permanently on screen cost a 128px band to say something that belongs
8
+ * behind one glyph.
9
+ *
10
+ * Opening is click-only, through the native Popover API. Escape, click-outside
11
+ * dismissal and top-layer placement come with it declaratively; a hover panel
12
+ * would mean rebuilding all three by hand, and crossing the gap between icon
13
+ * and card without the card closing is its own problem.
14
+ */
15
+ export declare class PrismHeadInfoComponent {
16
+ readonly selector: import("@angular/core").InputSignal<string>;
17
+ readonly description: import("@angular/core").InputSignal<string | undefined>;
18
+ readonly tags: import("@angular/core").InputSignal<readonly string[]>;
19
+ readonly variantCount: import("@angular/core").InputSignal<number>;
20
+ static ɵfac: i0.ɵɵFactoryDeclaration<PrismHeadInfoComponent, never>;
21
+ static ɵcmp: i0.ɵɵComponentDeclaration<PrismHeadInfoComponent, "prism-head-info", never, { "selector": { "alias": "selector"; "required": true; "isSignal": true; }; "description": { "alias": "description"; "required": false; "isSignal": true; }; "tags": { "alias": "tags"; "required": false; "isSignal": true; }; "variantCount": { "alias": "variantCount"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
22
+ }
23
+ //# sourceMappingURL=prism-head-info.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prism-head-info.component.d.ts","sourceRoot":"","sources":["../../../src/app/component-head/prism-head-info.component.ts"],"names":[],"mappings":";AAGA;;;;;;;;;;;;GAYG;AACH,qBAgHa,sBAAsB;IACjC,QAAQ,CAAC,QAAQ,8CAA4B;IAC7C,QAAQ,CAAC,WAAW,0DAAwC;IAC5D,QAAQ,CAAC,IAAI,yDAAgC;IAC7C,QAAQ,CAAC,YAAY,8CAAoB;yCAJ9B,sBAAsB;2CAAtB,sBAAsB;CAKlC"}