@ng-prism/core 22.2.0-beta.0 → 22.2.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -135,13 +135,14 @@ Link to a `@Showcase`-decorated component for combined API docs + custom renderi
135
135
 
136
136
  ## Official Plugins
137
137
 
138
- | Plugin | Package | Description |
139
- | --------- | ---------------------------- | -------------------------------------------- |
140
- | JSDoc | `@ng-prism/plugin-jsdoc` | API documentation from JSDoc comments |
141
- | Figma | `@ng-prism/plugin-figma` | Figma design embed + visual diff |
142
- | Box Model | `@ng-prism/plugin-box-model` | CSS box model inspector |
143
- | Perf | `@ng-prism/plugin-perf` | Render performance profiling |
144
- | Coverage | `@ng-prism/plugin-coverage` | Per-component test coverage from Istanbul/v8 |
138
+ | Plugin | Package | Description |
139
+ | --------- | ------------------------------------ | ------------------------------------------------------------- |
140
+ | JSDoc | `@ng-prism/plugin-jsdoc` | API documentation from JSDoc comments |
141
+ | Figma | `@ng-prism/plugin-figma` | Figma design embed + visual diff |
142
+ | Box Model | `@ng-prism/plugin-box-model` | CSS box model inspector |
143
+ | Perf | `@ng-prism/plugin-perf` | Render performance profiling |
144
+ | Coverage | `@ng-prism/plugin-coverage` | Per-component test coverage from Istanbul/v8 |
145
+ | VRT | `@ng-prism/plugin-visual-regression` | Per-variant visual regression report from a screenshot runner |
145
146
 
146
147
  > **Note:** Accessibility auditing (axe-core) is built into ng-prism core — no plugin needed.
147
148
 
@@ -7,6 +7,15 @@ export declare class PrismCanvasToolbarComponent {
7
7
  protected readonly variantBg: PrismVariantBgService;
8
8
  protected readonly layout: PrismLayoutService;
9
9
  protected setBg(bg: CanvasBg): void;
10
+ /**
11
+ * The backgrounds a user can cycle through — deliberately not every
12
+ * {@link CanvasBg}.
13
+ *
14
+ * `transparent` is missing on purpose. It renders as the checkerboard while
15
+ * browsing, so offering it next to `checker` would be two buttons that paint
16
+ * the same thing; the difference only exists in a capture, which is not a
17
+ * thing this toolbar can show. It stays a value a `@Showcase` declares.
18
+ */
10
19
  protected readonly bgs: CanvasBg[];
11
20
  protected readonly zooms: {
12
21
  value: number;
@@ -1 +1 @@
1
- {"version":3,"file":"prism-canvas-toolbar.component.d.ts","sourceRoot":"","sources":["../../../src/app/canvas/prism-canvas-toolbar.component.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,kBAAkB,EAClB,KAAK,QAAQ,EACd,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;;AAEzE,qBA+Ka,2BAA2B;IACtC,SAAS,CAAC,QAAQ,CAAC,MAAM,qBAA8B;IACvD,SAAS,CAAC,QAAQ,CAAC,SAAS,wBAAiC;IAC7D,SAAS,CAAC,QAAQ,CAAC,MAAM,qBAA8B;IAEvD,SAAS,CAAC,KAAK,CAAC,EAAE,EAAE,QAAQ,GAAG,IAAI;IAQnC,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE,QAAQ,EAAE,CAMhC;IACF,SAAS,CAAC,QAAQ,CAAC,KAAK;;;QAKtB;IAEF,SAAS,CAAC,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;yCA3B5B,2BAA2B;2CAA3B,2BAA2B;CA8BvC"}
1
+ {"version":3,"file":"prism-canvas-toolbar.component.d.ts","sourceRoot":"","sources":["../../../src/app/canvas/prism-canvas-toolbar.component.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,kBAAkB,EAClB,KAAK,QAAQ,EACd,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;;AAEzE,qBA+Ka,2BAA2B;IACtC,SAAS,CAAC,QAAQ,CAAC,MAAM,qBAA8B;IACvD,SAAS,CAAC,QAAQ,CAAC,SAAS,wBAAiC;IAC7D,SAAS,CAAC,QAAQ,CAAC,MAAM,qBAA8B;IAEvD,SAAS,CAAC,KAAK,CAAC,EAAE,EAAE,QAAQ,GAAG,IAAI;IAQnC;;;;;;;;OAQG;IACH,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE,QAAQ,EAAE,CAMhC;IACF,SAAS,CAAC,QAAQ,CAAC,KAAK;;;QAKtB;IAEF,SAAS,CAAC,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;yCApC5B,2BAA2B;2CAA3B,2BAA2B;CAuCvC"}
@@ -53,6 +53,15 @@ export class PrismCanvasToolbarComponent {
53
53
  this.canvas.setBg(bg);
54
54
  }
55
55
  }
56
+ /**
57
+ * The backgrounds a user can cycle through — deliberately not every
58
+ * {@link CanvasBg}.
59
+ *
60
+ * `transparent` is missing on purpose. It renders as the checkerboard while
61
+ * browsing, so offering it next to `checker` would be two buttons that paint
62
+ * the same thing; the difference only exists in a capture, which is not a
63
+ * thing this toolbar can show. It stays a value a `@Showcase` declares.
64
+ */
56
65
  bgs = [
57
66
  'dots',
58
67
  'plain',
@@ -1 +1 @@
1
- {"version":3,"file":"prism-renderer.component.d.ts","sourceRoot":"","sources":["../../../src/app/renderer/prism-renderer.component.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,QAAQ,EAER,KAAK,IAAI,EAIV,MAAM,eAAe,CAAC;AAYvB,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AAGjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;;AAMhF,qBAqJa,sBAAsB;IACjC,SAAS,CAAC,QAAQ,CAAC,IAAI,OAAQ;IAC/B,SAAS,CAAC,QAAQ,CAAC,iBAAiB,yBAAkC;IACtE,SAAS,CAAC,QAAQ,CAAC,eAAe,uBAAgC;IAClE,SAAS,CAAC,QAAQ,CAAC,aAAa,qBAA8B;IAC9D,SAAS,CAAC,QAAQ,CAAC,OAAO,sBAA+B;IACzD,SAAS,CAAC,QAAQ,CAAC,SAAS,wBAAiC;IAC7D,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAgC;IAChE,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAgC;IAChE,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAoB;IAC7C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAsB;IACjD,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAmC;IACxD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAE3B;IAEH,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA6B;IAC1D,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA8B;IAE5D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAEpB;IACH,OAAO,CAAC,YAAY,CAAsC;IAC1D,OAAO,CAAC,mBAAmB,CAAsC;IACjE,OAAO,CAAC,oBAAoB,CAChB;IACZ,OAAO,CAAC,YAAY,CAAS;IAE7B,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAoC;IACjE,QAAQ,CAAC,aAAa,+DAAsC;IAC5D,wFAAwF;IACxF,SAAS,CAAC,QAAQ,CAAC,WAAW,gDAQ3B;IACH,6GAA6G;IAC7G,SAAS,CAAC,QAAQ,CAAC,YAAY,4FAU5B;IACH,SAAS,CAAC,QAAQ,CAAC,aAAa;;MAA6C;IAC7E,SAAS,CAAC,QAAQ,CAAC,eAAe,yFAG/B;;IAmFH,OAAO,CAAC,eAAe;IA6FvB,OAAO,CAAC,OAAO;yCAxOJ,sBAAsB;2CAAtB,sBAAsB;CAsPlC"}
1
+ {"version":3,"file":"prism-renderer.component.d.ts","sourceRoot":"","sources":["../../../src/app/renderer/prism-renderer.component.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,QAAQ,EAER,KAAK,IAAI,EAIV,MAAM,eAAe,CAAC;AAYvB,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AAGjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;;AAMhF,qBA4Ja,sBAAsB;IACjC,SAAS,CAAC,QAAQ,CAAC,IAAI,OAAQ;IAC/B,SAAS,CAAC,QAAQ,CAAC,iBAAiB,yBAAkC;IACtE,SAAS,CAAC,QAAQ,CAAC,eAAe,uBAAgC;IAClE,SAAS,CAAC,QAAQ,CAAC,aAAa,qBAA8B;IAC9D,SAAS,CAAC,QAAQ,CAAC,OAAO,sBAA+B;IACzD,SAAS,CAAC,QAAQ,CAAC,SAAS,wBAAiC;IAC7D,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAgC;IAChE,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAgC;IAChE,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAoB;IAC7C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAsB;IACjD,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAmC;IACxD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAE3B;IAEH,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA6B;IAC1D,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA8B;IAE5D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAEpB;IACH,OAAO,CAAC,YAAY,CAAsC;IAC1D,OAAO,CAAC,mBAAmB,CAAsC;IACjE,OAAO,CAAC,oBAAoB,CAChB;IACZ,OAAO,CAAC,YAAY,CAAS;IAE7B,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAoC;IACjE,QAAQ,CAAC,aAAa,+DAAsC;IAC5D,wFAAwF;IACxF,SAAS,CAAC,QAAQ,CAAC,WAAW,gDAQ3B;IACH,6GAA6G;IAC7G,SAAS,CAAC,QAAQ,CAAC,YAAY,4FAU5B;IACH,SAAS,CAAC,QAAQ,CAAC,aAAa;;MAA6C;IAC7E,SAAS,CAAC,QAAQ,CAAC,eAAe,yFAG/B;;IAmFH,OAAO,CAAC,eAAe;IA6FvB,OAAO,CAAC,OAAO;yCAxOJ,sBAAsB;2CAAtB,sBAAsB;CAsPlC"}
@@ -255,7 +255,7 @@ export class PrismRendererComponent {
255
255
  i0.ɵɵconditional(ctx.activeOverlay() ? 5 : -1);
256
256
  } }, dependencies: [PrismCanvasRulersComponent,
257
257
  PrismCanvasBgPillComponent,
258
- NgComponentOutlet], styles: ["[_nghost-%COMP%] { display: block; min-height: 0; flex: 1; }\n\n .prism-canvas-stage[_ngcontent-%COMP%] {\n position: relative;\n overflow: auto;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 32px;\n min-height: 200px;\n height: 100%;\n background-color: var(--prism-bg-surface);\n background-image: radial-gradient(circle, var(--prism-dot) 1px, transparent 1px);\n background-size: 20px 20px;\n transition: filter var(--dur-base);\n --prism-canvas-overlay-top: 12px;\n --prism-canvas-overlay-inline: 20px;\n }\n .prism-canvas-stage[data-rulers][_ngcontent-%COMP%] {\n --prism-canvas-overlay-top: 28px;\n --prism-canvas-overlay-inline: 28px;\n }\n\n .prism-canvas-stage[data-bg=\"plain\"][_ngcontent-%COMP%] {\n background-image: none;\n }\n \n\n\n\n\n .prism-canvas-stage[data-bg=\"light\"][_ngcontent-%COMP%] {\n background-color: var(--prism-void-light, #f7f5fc);\n background-image: none;\n }\n .prism-canvas-stage[data-bg=\"dark\"][_ngcontent-%COMP%] {\n background-color: var(--prism-void-dark, #07050f);\n background-image: none;\n }\n .prism-canvas-stage[data-bg=\"checker\"][_ngcontent-%COMP%] {\n background-image:\n linear-gradient(45deg, var(--prism-border) 25%, transparent 25%),\n linear-gradient(-45deg, var(--prism-border) 25%, transparent 25%),\n linear-gradient(45deg, transparent 75%, var(--prism-border) 75%),\n linear-gradient(-45deg, transparent 75%, var(--prism-border) 75%);\n background-size: 16px 16px;\n background-position: 0 0, 0 8px, 8px -8px, -8px 0;\n }\n\n .stage-crosshair[_ngcontent-%COMP%] {\n position: absolute;\n inset: 0;\n pointer-events: none;\n opacity: 0;\n transition: opacity var(--dur-base);\n }\n .stage-crosshair.visible[_ngcontent-%COMP%] { opacity: 1; }\n .stage-crosshair[_ngcontent-%COMP%]::before, \n .stage-crosshair[_ngcontent-%COMP%]::after {\n content: '';\n position: absolute;\n background: color-mix(in srgb, var(--prism-primary) 20%, transparent);\n }\n .stage-crosshair[_ngcontent-%COMP%]::before { left: 0; right: 0; top: 50%; height: 1px; }\n .stage-crosshair[_ngcontent-%COMP%]::after { top: 0; bottom: 0; left: 50%; width: 1px; }\n\n .canvas-badges[_ngcontent-%COMP%] {\n position: absolute;\n top: var(--prism-canvas-overlay-top);\n left: var(--prism-canvas-overlay-inline);\n display: flex;\n gap: 6px;\n pointer-events: none;\n transition: top var(--dur-base), left var(--dur-base);\n }\n .c-badge[_ngcontent-%COMP%] {\n font-family: var(--font-mono);\n font-size: var(--fs-xs);\n padding: 3px 7px;\n border-radius: 4px;\n background: color-mix(in srgb, var(--prism-bg-elevated) 90%, transparent);\n border: 1px solid var(--prism-border);\n color: var(--prism-text-muted);\n backdrop-filter: blur(8px);\n }\n\n .demo-wrap[_ngcontent-%COMP%] {\n position: relative;\n display: inline-block;\n transform: scale(var(--zoom, 1));\n transition: transform 0.18s;\n }\n .demo-wrap[data-canvas-layout=\"stretch\"][_ngcontent-%COMP%] {\n display: block;\n width: 100%;\n max-width: 800px;\n }"] });
258
+ NgComponentOutlet], styles: ["[_nghost-%COMP%] { display: block; min-height: 0; flex: 1; }\n\n .prism-canvas-stage[_ngcontent-%COMP%] {\n position: relative;\n overflow: auto;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 32px;\n min-height: 200px;\n height: 100%;\n background-color: var(--prism-bg-surface);\n background-image: radial-gradient(circle, var(--prism-dot) 1px, transparent 1px);\n background-size: 20px 20px;\n transition: filter var(--dur-base);\n --prism-canvas-overlay-top: 12px;\n --prism-canvas-overlay-inline: 20px;\n }\n .prism-canvas-stage[data-rulers][_ngcontent-%COMP%] {\n --prism-canvas-overlay-top: 28px;\n --prism-canvas-overlay-inline: 28px;\n }\n\n .prism-canvas-stage[data-bg=\"plain\"][_ngcontent-%COMP%] {\n background-image: none;\n }\n \n\n\n\n\n .prism-canvas-stage[data-bg=\"light\"][_ngcontent-%COMP%] {\n background-color: var(--prism-void-light, #f7f5fc);\n background-image: none;\n }\n .prism-canvas-stage[data-bg=\"dark\"][_ngcontent-%COMP%] {\n background-color: var(--prism-void-dark, #07050f);\n background-image: none;\n }\n \n\n\n\n\n\n .prism-canvas-stage[data-bg=\"checker\"][_ngcontent-%COMP%], \n .prism-canvas-stage[data-bg=\"transparent\"][_ngcontent-%COMP%] {\n background-image:\n linear-gradient(45deg, var(--prism-border) 25%, transparent 25%),\n linear-gradient(-45deg, var(--prism-border) 25%, transparent 25%),\n linear-gradient(45deg, transparent 75%, var(--prism-border) 75%),\n linear-gradient(-45deg, transparent 75%, var(--prism-border) 75%);\n background-size: 16px 16px;\n background-position: 0 0, 0 8px, 8px -8px, -8px 0;\n }\n\n .stage-crosshair[_ngcontent-%COMP%] {\n position: absolute;\n inset: 0;\n pointer-events: none;\n opacity: 0;\n transition: opacity var(--dur-base);\n }\n .stage-crosshair.visible[_ngcontent-%COMP%] { opacity: 1; }\n .stage-crosshair[_ngcontent-%COMP%]::before, \n .stage-crosshair[_ngcontent-%COMP%]::after {\n content: '';\n position: absolute;\n background: color-mix(in srgb, var(--prism-primary) 20%, transparent);\n }\n .stage-crosshair[_ngcontent-%COMP%]::before { left: 0; right: 0; top: 50%; height: 1px; }\n .stage-crosshair[_ngcontent-%COMP%]::after { top: 0; bottom: 0; left: 50%; width: 1px; }\n\n .canvas-badges[_ngcontent-%COMP%] {\n position: absolute;\n top: var(--prism-canvas-overlay-top);\n left: var(--prism-canvas-overlay-inline);\n display: flex;\n gap: 6px;\n pointer-events: none;\n transition: top var(--dur-base), left var(--dur-base);\n }\n .c-badge[_ngcontent-%COMP%] {\n font-family: var(--font-mono);\n font-size: var(--fs-xs);\n padding: 3px 7px;\n border-radius: 4px;\n background: color-mix(in srgb, var(--prism-bg-elevated) 90%, transparent);\n border: 1px solid var(--prism-border);\n color: var(--prism-text-muted);\n backdrop-filter: blur(8px);\n }\n\n .demo-wrap[_ngcontent-%COMP%] {\n position: relative;\n display: inline-block;\n transform: scale(var(--zoom, 1));\n transition: transform 0.18s;\n }\n .demo-wrap[data-canvas-layout=\"stretch\"][_ngcontent-%COMP%] {\n display: block;\n width: 100%;\n max-width: 800px;\n }"] });
259
259
  }
260
260
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PrismRendererComponent, [{
261
261
  type: Component,
@@ -301,11 +301,11 @@ export class PrismRendererComponent {
301
301
  }
302
302
  </div>
303
303
  </div>
304
- `, styles: ["\n :host { display: block; min-height: 0; flex: 1; }\n\n .prism-canvas-stage {\n position: relative;\n overflow: auto;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 32px;\n min-height: 200px;\n height: 100%;\n background-color: var(--prism-bg-surface);\n background-image: radial-gradient(circle, var(--prism-dot) 1px, transparent 1px);\n background-size: 20px 20px;\n transition: filter var(--dur-base);\n --prism-canvas-overlay-top: 12px;\n --prism-canvas-overlay-inline: 20px;\n }\n .prism-canvas-stage[data-rulers] {\n --prism-canvas-overlay-top: 28px;\n --prism-canvas-overlay-inline: 28px;\n }\n\n .prism-canvas-stage[data-bg=\"plain\"] {\n background-image: none;\n }\n /* Flat, not dotted. \"light\" and \"dark\" name a surface a component was\n designed against \u2014 and they are the two backgrounds whose colour is\n absolute rather than a theme token, which is what makes them the values\n to declare for a screenshot baseline. \"dots\" already exists for anyone\n who wants the grid. */\n .prism-canvas-stage[data-bg=\"light\"] {\n background-color: var(--prism-void-light, #f7f5fc);\n background-image: none;\n }\n .prism-canvas-stage[data-bg=\"dark\"] {\n background-color: var(--prism-void-dark, #07050f);\n background-image: none;\n }\n .prism-canvas-stage[data-bg=\"checker\"] {\n background-image:\n linear-gradient(45deg, var(--prism-border) 25%, transparent 25%),\n linear-gradient(-45deg, var(--prism-border) 25%, transparent 25%),\n linear-gradient(45deg, transparent 75%, var(--prism-border) 75%),\n linear-gradient(-45deg, transparent 75%, var(--prism-border) 75%);\n background-size: 16px 16px;\n background-position: 0 0, 0 8px, 8px -8px, -8px 0;\n }\n\n .stage-crosshair {\n position: absolute;\n inset: 0;\n pointer-events: none;\n opacity: 0;\n transition: opacity var(--dur-base);\n }\n .stage-crosshair.visible { opacity: 1; }\n .stage-crosshair::before,\n .stage-crosshair::after {\n content: '';\n position: absolute;\n background: color-mix(in srgb, var(--prism-primary) 20%, transparent);\n }\n .stage-crosshair::before { left: 0; right: 0; top: 50%; height: 1px; }\n .stage-crosshair::after { top: 0; bottom: 0; left: 50%; width: 1px; }\n\n .canvas-badges {\n position: absolute;\n top: var(--prism-canvas-overlay-top);\n left: var(--prism-canvas-overlay-inline);\n display: flex;\n gap: 6px;\n pointer-events: none;\n transition: top var(--dur-base), left var(--dur-base);\n }\n .c-badge {\n font-family: var(--font-mono);\n font-size: var(--fs-xs);\n padding: 3px 7px;\n border-radius: 4px;\n background: color-mix(in srgb, var(--prism-bg-elevated) 90%, transparent);\n border: 1px solid var(--prism-border);\n color: var(--prism-text-muted);\n backdrop-filter: blur(8px);\n }\n\n .demo-wrap {\n position: relative;\n display: inline-block;\n transform: scale(var(--zoom, 1));\n transition: transform 0.18s;\n }\n .demo-wrap[data-canvas-layout=\"stretch\"] {\n display: block;\n width: 100%;\n max-width: 800px;\n }\n\n "] }]
304
+ `, styles: ["\n :host { display: block; min-height: 0; flex: 1; }\n\n .prism-canvas-stage {\n position: relative;\n overflow: auto;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 32px;\n min-height: 200px;\n height: 100%;\n background-color: var(--prism-bg-surface);\n background-image: radial-gradient(circle, var(--prism-dot) 1px, transparent 1px);\n background-size: 20px 20px;\n transition: filter var(--dur-base);\n --prism-canvas-overlay-top: 12px;\n --prism-canvas-overlay-inline: 20px;\n }\n .prism-canvas-stage[data-rulers] {\n --prism-canvas-overlay-top: 28px;\n --prism-canvas-overlay-inline: 28px;\n }\n\n .prism-canvas-stage[data-bg=\"plain\"] {\n background-image: none;\n }\n /* Flat, not dotted. \"light\" and \"dark\" name a surface a component was\n designed against \u2014 and they are the two backgrounds whose colour is\n absolute rather than a theme token, which is what makes them the values\n to declare for a screenshot baseline. \"dots\" already exists for anyone\n who wants the grid. */\n .prism-canvas-stage[data-bg=\"light\"] {\n background-color: var(--prism-void-light, #f7f5fc);\n background-image: none;\n }\n .prism-canvas-stage[data-bg=\"dark\"] {\n background-color: var(--prism-void-dark, #07050f);\n background-image: none;\n }\n /* \"transparent\" shares the checkerboard on purpose. The two say the same\n thing in the two media the canvas has: while browsing, the checkerboard\n is already the UI's word for \"no surface here\"; in a capture it becomes\n literal transparency. A stage that were really see-through in the app\n would just show the shell through the canvas, which means nothing. The\n split between the two lives entirely in CAPTURE_STYLES. */\n .prism-canvas-stage[data-bg=\"checker\"],\n .prism-canvas-stage[data-bg=\"transparent\"] {\n background-image:\n linear-gradient(45deg, var(--prism-border) 25%, transparent 25%),\n linear-gradient(-45deg, var(--prism-border) 25%, transparent 25%),\n linear-gradient(45deg, transparent 75%, var(--prism-border) 75%),\n linear-gradient(-45deg, transparent 75%, var(--prism-border) 75%);\n background-size: 16px 16px;\n background-position: 0 0, 0 8px, 8px -8px, -8px 0;\n }\n\n .stage-crosshair {\n position: absolute;\n inset: 0;\n pointer-events: none;\n opacity: 0;\n transition: opacity var(--dur-base);\n }\n .stage-crosshair.visible { opacity: 1; }\n .stage-crosshair::before,\n .stage-crosshair::after {\n content: '';\n position: absolute;\n background: color-mix(in srgb, var(--prism-primary) 20%, transparent);\n }\n .stage-crosshair::before { left: 0; right: 0; top: 50%; height: 1px; }\n .stage-crosshair::after { top: 0; bottom: 0; left: 50%; width: 1px; }\n\n .canvas-badges {\n position: absolute;\n top: var(--prism-canvas-overlay-top);\n left: var(--prism-canvas-overlay-inline);\n display: flex;\n gap: 6px;\n pointer-events: none;\n transition: top var(--dur-base), left var(--dur-base);\n }\n .c-badge {\n font-family: var(--font-mono);\n font-size: var(--fs-xs);\n padding: 3px 7px;\n border-radius: 4px;\n background: color-mix(in srgb, var(--prism-bg-elevated) 90%, transparent);\n border: 1px solid var(--prism-border);\n color: var(--prism-text-muted);\n backdrop-filter: blur(8px);\n }\n\n .demo-wrap {\n position: relative;\n display: inline-block;\n transform: scale(var(--zoom, 1));\n transition: transform 0.18s;\n }\n .demo-wrap[data-canvas-layout=\"stretch\"] {\n display: block;\n width: 100%;\n max-width: 800px;\n }\n\n "] }]
305
305
  }], () => [], { outlet: [{ type: i0.ViewChild, args: ['outlet', { ...{
306
306
  read: ViewContainerRef,
307
307
  }, isSignal: true }] }] }); })();
308
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PrismRendererComponent, { className: "PrismRendererComponent", filePath: "app/renderer/prism-renderer.component.ts", lineNumber: 189 }); })();
308
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PrismRendererComponent, { className: "PrismRendererComponent", filePath: "app/renderer/prism-renderer.component.ts", lineNumber: 196 }); })();
309
309
  // SAFETY: `content` originates from `@Showcase({ variants: [{ content }] })`
310
310
  // in developer-authored source code. It is trusted by ng-prism's threat model
311
311
  // (see SECURITY.md). Sanitization would strip the Angular component/directive
@@ -3,13 +3,36 @@ import * as i0 from "@angular/core";
3
3
  export declare const CAPTURE_PARAM = "capture";
4
4
  /** Attribute set on `<html>` while capture mode is active. */
5
5
  export declare const CAPTURE_ATTRIBUTE = "data-prism-capture";
6
+ /**
7
+ * Everything capture mode makes see-through for `bg: 'transparent'`.
8
+ *
9
+ * A screenshot tool clips the *composited* page, so a transparent stage alone
10
+ * buys nothing: the wrappers behind it keep painting and the PNG comes back
11
+ * opaque. The stage and every ancestor that paints have to go at once, which
12
+ * is why this is one selector rather than a rule per layer.
13
+ *
14
+ * `html` and `body` are insurance rather than observation — ng-prism paints
15
+ * neither, but a consuming app's global stylesheet can, and the guarantee this
16
+ * makes is "nothing opaque between the component and the document root".
17
+ * Above `html` the backdrop is the browser's own and no stylesheet reaches it;
18
+ * a runner has to clear that with `omitBackground: true`.
19
+ *
20
+ * Scoped by `:has()` to a *transparent* stage, so the other five backgrounds
21
+ * behave exactly as before. Exported so a test can assert the invariant
22
+ * against the real DOM rather than against this list — the list is the
23
+ * fragile part of the feature. A renamed wrapper or a newly introduced
24
+ * painting layer turns the capture opaque again, and an opaque capture still
25
+ * looks correct; it just silently stops testing transparency.
26
+ */
27
+ export declare const CAPTURE_TRANSPARENT_SELECTOR: string;
6
28
  /**
7
29
  * Capture-isolation mode.
8
30
  *
9
31
  * Screenshot tools clip the composited page to the capture target's box, so
10
32
  * anything painted behind or inside `.demo-wrap` ends up in the image. Capture
11
- * mode strips the canvas background down to its opaque, patternless colour —
12
- * keeping whatever `@Showcase({ bg })` declared suppresses every piece of
33
+ * mode strips the canvas background down to its patternless colour — keeping
34
+ * whatever `@Showcase({ bg })` declared, or clearing the whole paint chain to
35
+ * real transparency for `bg: 'transparent'` — suppresses every piece of
13
36
  * canvas chrome, locks zoom to 1 and freezes animation, so a variant renders
14
37
  * identically on every run.
15
38
  *
@@ -1 +1 @@
1
- {"version":3,"file":"prism-capture.service.d.ts","sourceRoot":"","sources":["../../../src/app/services/prism-capture.service.ts"],"names":[],"mappings":";AAEA,sFAAsF;AACtF,eAAO,MAAM,aAAa,YAAY,CAAC;AAEvC,8DAA8D;AAC9D,eAAO,MAAM,iBAAiB,uBAAuB,CAAC;AAqCtD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBACa,mBAAmB;IAC9B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAItB;IAEF,kEAAkE;IAClE,QAAQ,CAAC,MAAM,0CAA6B;;IAM5C,OAAO,CAAC,eAAe;yCAdZ,mBAAmB;6CAAnB,mBAAmB;CAuB/B;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAIzD"}
1
+ {"version":3,"file":"prism-capture.service.d.ts","sourceRoot":"","sources":["../../../src/app/services/prism-capture.service.ts"],"names":[],"mappings":";AAEA,sFAAsF;AACtF,eAAO,MAAM,aAAa,YAAY,CAAC;AAEvC,8DAA8D;AAC9D,eAAO,MAAM,iBAAiB,uBAAuB,CAAC;AAItD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,4BAA4B,QAEgG,CAAC;AA8C1I;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBACa,mBAAmB;IAC9B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAItB;IAEF,kEAAkE;IAClE,QAAQ,CAAC,MAAM,0CAA6B;;IAM5C,OAAO,CAAC,eAAe;yCAdZ,mBAAmB;6CAAnB,mBAAmB;CAuB/B;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAIzD"}
@@ -5,6 +5,29 @@ export const CAPTURE_PARAM = 'capture';
5
5
  /** Attribute set on `<html>` while capture mode is active. */
6
6
  export const CAPTURE_ATTRIBUTE = 'data-prism-capture';
7
7
  const STYLE_ELEMENT_ID = 'ng-prism-capture-styles';
8
+ /**
9
+ * Everything capture mode makes see-through for `bg: 'transparent'`.
10
+ *
11
+ * A screenshot tool clips the *composited* page, so a transparent stage alone
12
+ * buys nothing: the wrappers behind it keep painting and the PNG comes back
13
+ * opaque. The stage and every ancestor that paints have to go at once, which
14
+ * is why this is one selector rather than a rule per layer.
15
+ *
16
+ * `html` and `body` are insurance rather than observation — ng-prism paints
17
+ * neither, but a consuming app's global stylesheet can, and the guarantee this
18
+ * makes is "nothing opaque between the component and the document root".
19
+ * Above `html` the backdrop is the browser's own and no stylesheet reaches it;
20
+ * a runner has to clear that with `omitBackground: true`.
21
+ *
22
+ * Scoped by `:has()` to a *transparent* stage, so the other five backgrounds
23
+ * behave exactly as before. Exported so a test can assert the invariant
24
+ * against the real DOM rather than against this list — the list is the
25
+ * fragile part of the feature. A renamed wrapper or a newly introduced
26
+ * painting layer turns the capture opaque again, and an opaque capture still
27
+ * looks correct; it just silently stops testing transparency.
28
+ */
29
+ export const CAPTURE_TRANSPARENT_SELECTOR = `[${CAPTURE_ATTRIBUTE}] .prism-canvas-stage[data-bg='transparent'],\n` +
30
+ `[${CAPTURE_ATTRIBUTE}] :is(html, body, .prism-shell, .prism-main, .prism-canvas-wrap):has(.prism-canvas-stage[data-bg='transparent'])`;
8
31
  /**
9
32
  * Global stylesheet applied in capture mode.
10
33
  *
@@ -22,6 +45,12 @@ const STYLE_ELEMENT_ID = 'ng-prism-capture-styles';
22
45
  * beneath it shifts whenever the component changes size and every pixel behind
23
46
  * it differs after an unrelated resize. `!important` is required: the stage's
24
47
  * own rules are component-scoped and therefore more specific than this one.
48
+ *
49
+ * `transparent` is the one value that drops the colour too, and it cannot do
50
+ * that on the stage alone — see {@link CAPTURE_TRANSPARENT_SELECTOR} for the
51
+ * layers involved. Alpha is not what the paragraph above rules out: a pattern
52
+ * has a phase that moves when the component resizes, an alpha channel is a
53
+ * per-pixel value that does not.
25
54
  */
26
55
  const CAPTURE_STYLES = `
27
56
  [${CAPTURE_ATTRIBUTE}] *,
@@ -36,14 +65,20 @@ const CAPTURE_STYLES = `
36
65
  [${CAPTURE_ATTRIBUTE}] .prism-canvas-stage {
37
66
  background-image: none !important;
38
67
  }
68
+
69
+ ${CAPTURE_TRANSPARENT_SELECTOR} {
70
+ background-color: transparent !important;
71
+ background-image: none !important;
72
+ }
39
73
  `;
40
74
  /**
41
75
  * Capture-isolation mode.
42
76
  *
43
77
  * Screenshot tools clip the composited page to the capture target's box, so
44
78
  * anything painted behind or inside `.demo-wrap` ends up in the image. Capture
45
- * mode strips the canvas background down to its opaque, patternless colour —
46
- * keeping whatever `@Showcase({ bg })` declared suppresses every piece of
79
+ * mode strips the canvas background down to its patternless colour — keeping
80
+ * whatever `@Showcase({ bg })` declared, or clearing the whole paint chain to
81
+ * real transparency for `bg: 'transparent'` — suppresses every piece of
47
82
  * canvas chrome, locks zoom to 1 and freezes animation, so a variant renders
48
83
  * identically on every run.
49
84
  *
@@ -30,7 +30,10 @@ export declare class PrismVariantBgService {
30
30
  * on whichever theme the runner's browser started in — a baseline that
31
31
  * flips with a persisted UI preference. The fixed default is also exactly
32
32
  * what the discovery manifest reports for the variant, so what a tool is
33
- * told and what it screenshots cannot drift apart.
33
+ * told and what it screenshots cannot drift apart. That default is
34
+ * `transparent`, which removes the theme dependency outright instead of
35
+ * pinning one theme's colour: an undeclared variant has no opinion about its
36
+ * surface, and no surface is the honest capture of that.
34
37
  *
35
38
  * Interactive mode keeps `canvas.bg()`: there the dot grid on the themed
36
39
  * surface is the point, and forcing `light` would break dark-theme browsing.
@@ -1 +1 @@
1
- {"version":3,"file":"prism-variant-bg.service.d.ts","sourceRoot":"","sources":["../../../src/app/services/prism-variant-bg.service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;;AAU/D,qBACa,qBAAqB;IAChC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA8B;IACrD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAkC;IAC7D,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAgC;IACzD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA+B;IAEvD,QAAQ,CAAC,WAAW,kDAOjB;IAEH,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAiC;IAC3D,QAAQ,CAAC,QAAQ,kDAA+B;IAEhD;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,QAAQ,CAAC,SAAS,2CAIhB;IAEF,gFAAgF;IAChF,QAAQ,CAAC,WAAW,0CAMjB;;IAUH,WAAW,CAAC,EAAE,EAAE,QAAQ,GAAG,IAAI;IAI/B,aAAa,IAAI,IAAI;yCAxEV,qBAAqB;6CAArB,qBAAqB;CA2EjC"}
1
+ {"version":3,"file":"prism-variant-bg.service.d.ts","sourceRoot":"","sources":["../../../src/app/services/prism-variant-bg.service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;;AAU/D,qBACa,qBAAqB;IAChC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA8B;IACrD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAkC;IAC7D,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAgC;IACzD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA+B;IAEvD,QAAQ,CAAC,WAAW,kDAOjB;IAEH,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAiC;IAC3D,QAAQ,CAAC,QAAQ,kDAA+B;IAEhD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH,QAAQ,CAAC,SAAS,2CAIhB;IAEF,gFAAgF;IAChF,QAAQ,CAAC,WAAW,0CAMjB;;IAUH,WAAW,CAAC,EAAE,EAAE,QAAQ,GAAG,IAAI;IAI/B,aAAa,IAAI,IAAI;yCA3EV,qBAAqB;6CAArB,qBAAqB;CA8EjC"}
@@ -42,7 +42,10 @@ export class PrismVariantBgService {
42
42
  * on whichever theme the runner's browser started in — a baseline that
43
43
  * flips with a persisted UI preference. The fixed default is also exactly
44
44
  * what the discovery manifest reports for the variant, so what a tool is
45
- * told and what it screenshots cannot drift apart.
45
+ * told and what it screenshots cannot drift apart. That default is
46
+ * `transparent`, which removes the theme dependency outright instead of
47
+ * pinning one theme's colour: an undeclared variant has no opinion about its
48
+ * surface, and no surface is the honest capture of that.
46
49
  *
47
50
  * Interactive mode keeps `canvas.bg()`: there the dot grid on the themed
48
51
  * surface is the point, and forcing `light` would break dark-theme browsing.
@@ -1,3 +1,11 @@
1
- export type CanvasBg = 'dots' | 'plain' | 'light' | 'dark' | 'checker';
1
+ export type CanvasBg = 'dots' | 'plain' | 'light' | 'dark' | 'checker' | 'transparent';
2
+ /**
3
+ * Every value {@link CanvasBg} accepts.
4
+ *
5
+ * This is the type's value list, not the list a user can cycle through — the
6
+ * canvas toolbar keeps its own, deliberately shorter one. Persisted canvas
7
+ * state is validated against *this* list, so a value that only a decorator can
8
+ * declare still round-trips rather than being discarded as unknown.
9
+ */
2
10
  export declare const CANVAS_BGS: readonly CanvasBg[];
3
11
  //# sourceMappingURL=canvas-bg.type.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"canvas-bg.type.d.ts","sourceRoot":"","sources":["../../src/shared/canvas-bg.type.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;AAEvE,eAAO,MAAM,UAAU,EAAE,SAAS,QAAQ,EAMhC,CAAC"}
1
+ {"version":3,"file":"canvas-bg.type.d.ts","sourceRoot":"","sources":["../../src/shared/canvas-bg.type.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAChB,MAAM,GACN,OAAO,GACP,OAAO,GACP,MAAM,GACN,SAAS,GACT,aAAa,CAAC;AAElB;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,EAAE,SAAS,QAAQ,EAOhC,CAAC"}
@@ -1,7 +1,16 @@
1
+ /**
2
+ * Every value {@link CanvasBg} accepts.
3
+ *
4
+ * This is the type's value list, not the list a user can cycle through — the
5
+ * canvas toolbar keeps its own, deliberately shorter one. Persisted canvas
6
+ * state is validated against *this* list, so a value that only a decorator can
7
+ * declare still round-trips rather than being discarded as unknown.
8
+ */
1
9
  export const CANVAS_BGS = [
2
10
  'dots',
3
11
  'plain',
4
12
  'light',
5
13
  'dark',
6
14
  'checker',
15
+ 'transparent',
7
16
  ];
@@ -2,18 +2,37 @@ import type { CanvasBg } from './canvas-bg.type.js';
2
2
  /**
3
3
  * The surface a variant is reported to render on when nothing declares one.
4
4
  *
5
- * `checker` is the "no opinion declared" answer: the checkerboard is the
6
- * universal signal for an undefined or transparent backdrop, it makes an
7
- * undeclared component visible as such while browsing, and it is exactly how
8
- * the visual-regression panel already frames a capture whose background it
9
- * cannot account for.
10
- *
11
- * Note what it does *not* buy. `checker` carries no colour of its own — it
12
- * patterns over `--prism-bg-surface`, a *theme* token and capture mode
13
- * strips the pattern and keeps the colour. So the surface behind an undeclared
14
- * component in a screenshot still follows whichever theme the runner's browser
15
- * started in. A variant that is under visual regression should declare `light`
16
- * or `dark`, the two backgrounds whose colour is absolute.
5
+ * An undeclared variant is the "no opinion" case, and `transparent` is the
6
+ * honest capture of no opinion. The alternative, `checker`, patterns over
7
+ * `--prism-bg-surface` a *theme* token and capture mode strips the pattern
8
+ * and keeps the colour, so an undeclared variant used to be photographed on
9
+ * whichever theme the runner's browser happened to start in. That is not a
10
+ * neutral default; it is the runner's theme leaking into a baseline. Alpha
11
+ * carries no such dependency, and it is not the thing capture mode's
12
+ * determinism argument rules out: a pattern has a phase that shifts when a
13
+ * centred component resizes, an alpha channel is a per-pixel value that does
14
+ * not move.
15
+ *
16
+ * In the app both values look identical — `transparent` renders as the same
17
+ * checkerboard, which is the UI's way of saying "no surface here". The change
18
+ * is only visible in a capture.
19
+ *
20
+ * The cost is real and worth stating plainly: a runner that does not pass
21
+ * `omitBackground: true` gets an opaque capture over whatever the browser
22
+ * painted, because the page's own backdrop is below every stylesheet. See
23
+ * `docs/guide/visual-regression.md#capturing-transparency`.
24
+ *
25
+ * What to declare, now that the default no longer decides it for you:
26
+ *
27
+ * - `light` or `dark` when the component was designed against a surface.
28
+ * Their colours are absolute rather than theme tokens, which is what makes
29
+ * them stable across runners.
30
+ * - `transparent` when the component's own transparency is the thing under
31
+ * test — an outlined button, an icon, a divider. Flattening one onto an
32
+ * opaque colour makes a transparent fill and a painted fill produce the
33
+ * same pixels.
34
+ * - `dots`, `plain` or `checker` for browsing. All three follow the active
35
+ * theme, so a baseline recorded on one is only as stable as the theme.
17
36
  */
18
37
  export declare const DEFAULT_VARIANT_BG: CanvasBg;
19
38
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"variant-bg.d.ts","sourceRoot":"","sources":["../../src/shared/variant-bg.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEpD;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,kBAAkB,EAAE,QAAoB,CAAC;AAEtD;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B,EAAE,CAAC,EAAE,QAAQ,CAAC;IACd,QAAQ,CAAC,EAAE,SAAS;QAAE,EAAE,CAAC,EAAE,QAAQ,CAAA;KAAE,EAAE,CAAC;CACzC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,eAAe,EACvB,YAAY,EAAE,MAAM,GACnB,QAAQ,GAAG,IAAI,CAEjB;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,eAAe,EACvB,YAAY,EAAE,MAAM,GACnB,QAAQ,CAEV"}
1
+ {"version":3,"file":"variant-bg.d.ts","sourceRoot":"","sources":["../../src/shared/variant-bg.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,eAAO,MAAM,kBAAkB,EAAE,QAAwB,CAAC;AAE1D;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B,EAAE,CAAC,EAAE,QAAQ,CAAC;IACd,QAAQ,CAAC,EAAE,SAAS;QAAE,EAAE,CAAC,EAAE,QAAQ,CAAA;KAAE,EAAE,CAAC;CACzC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,eAAe,EACvB,YAAY,EAAE,MAAM,GACnB,QAAQ,GAAG,IAAI,CAEjB;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,eAAe,EACvB,YAAY,EAAE,MAAM,GACnB,QAAQ,CAEV"}
@@ -1,20 +1,39 @@
1
1
  /**
2
2
  * The surface a variant is reported to render on when nothing declares one.
3
3
  *
4
- * `checker` is the "no opinion declared" answer: the checkerboard is the
5
- * universal signal for an undefined or transparent backdrop, it makes an
6
- * undeclared component visible as such while browsing, and it is exactly how
7
- * the visual-regression panel already frames a capture whose background it
8
- * cannot account for.
9
- *
10
- * Note what it does *not* buy. `checker` carries no colour of its own — it
11
- * patterns over `--prism-bg-surface`, a *theme* token and capture mode
12
- * strips the pattern and keeps the colour. So the surface behind an undeclared
13
- * component in a screenshot still follows whichever theme the runner's browser
14
- * started in. A variant that is under visual regression should declare `light`
15
- * or `dark`, the two backgrounds whose colour is absolute.
4
+ * An undeclared variant is the "no opinion" case, and `transparent` is the
5
+ * honest capture of no opinion. The alternative, `checker`, patterns over
6
+ * `--prism-bg-surface` a *theme* token and capture mode strips the pattern
7
+ * and keeps the colour, so an undeclared variant used to be photographed on
8
+ * whichever theme the runner's browser happened to start in. That is not a
9
+ * neutral default; it is the runner's theme leaking into a baseline. Alpha
10
+ * carries no such dependency, and it is not the thing capture mode's
11
+ * determinism argument rules out: a pattern has a phase that shifts when a
12
+ * centred component resizes, an alpha channel is a per-pixel value that does
13
+ * not move.
14
+ *
15
+ * In the app both values look identical — `transparent` renders as the same
16
+ * checkerboard, which is the UI's way of saying "no surface here". The change
17
+ * is only visible in a capture.
18
+ *
19
+ * The cost is real and worth stating plainly: a runner that does not pass
20
+ * `omitBackground: true` gets an opaque capture over whatever the browser
21
+ * painted, because the page's own backdrop is below every stylesheet. See
22
+ * `docs/guide/visual-regression.md#capturing-transparency`.
23
+ *
24
+ * What to declare, now that the default no longer decides it for you:
25
+ *
26
+ * - `light` or `dark` when the component was designed against a surface.
27
+ * Their colours are absolute rather than theme tokens, which is what makes
28
+ * them stable across runners.
29
+ * - `transparent` when the component's own transparency is the thing under
30
+ * test — an outlined button, an icon, a divider. Flattening one onto an
31
+ * opaque colour makes a transparent fill and a painted fill produce the
32
+ * same pixels.
33
+ * - `dots`, `plain` or `checker` for browsing. All three follow the active
34
+ * theme, so a baseline recorded on one is only as stable as the theme.
16
35
  */
17
- export const DEFAULT_VARIANT_BG = 'checker';
36
+ export const DEFAULT_VARIANT_BG = 'transparent';
18
37
  /**
19
38
  * The background a variant *declares*, or `null` when it declares none.
20
39
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ng-prism/core",
3
- "version": "22.2.0-beta.0",
3
+ "version": "22.2.0-beta.2",
4
4
  "description": "ng-prism — the Angular-native Storybook alternative. Lightweight component showcase with @Showcase decorator, no story files needed.",
5
5
  "keywords": [
6
6
  "ng-prism",