@blueprint-platform/components 0.2.0 → 0.2.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.
@@ -1,28 +1,32 @@
1
- import { ChangeDetectionStrategy, Component, input } from '@angular/core';
1
+ import { Directive, input } from '@angular/core';
2
2
  import { BrnAvatar } from '@spartan-ng/brain/avatar';
3
3
  import { classes } from '@blueprint-platform/ui/utils';
4
4
 
5
- @Component({
6
- selector: 'hlm-avatar',
7
- changeDetection: ChangeDetectionStrategy.OnPush,
5
+ /**
6
+ * A plain `@Directive` composing `BrnAvatar` via `hostDirectives`, not
7
+ * `extends` — `@spartan-ng/brain@1.9.0` moved `BrnAvatarImage`/`BrnAvatarFallback`
8
+ * to `inject(BrnAvatar)` for shared load-status state, which only resolves if
9
+ * `BrnAvatar` is actually registered as a directive on this host (what
10
+ * `hostDirectives` does); plain class inheritance never provided it, causing
11
+ * a real runtime NG0201 even though it type-checked and built cleanly. No
12
+ * template here either — upstream dropped the old `@if (status() ===
13
+ * 'loaded')`-conditional `<ng-content>` switch; image/fallback are always
14
+ * both present in the caller's markup now and self-hide via their own
15
+ * `[style.visibility]` host bindings, so this directive has nothing to render.
16
+ */
17
+ @Directive({
18
+ selector: '[hlmAvatar],hlm-avatar',
19
+ exportAs: 'hlmAvatar',
20
+ hostDirectives: [BrnAvatar],
8
21
  host: {
9
22
  'data-slot': 'avatar',
10
23
  '[attr.data-size]': 'size()',
11
24
  },
12
- template: `
13
- @if (_image()?.canShow()) {
14
- <ng-content select="[hlmAvatarImage],[brnAvatarImage]" />
15
- } @else {
16
- <ng-content select="[hlmAvatarFallback],[brnAvatarFallback]" />
17
- }
18
- <ng-content />
19
- `,
20
25
  })
21
- export class HlmAvatar extends BrnAvatar {
26
+ export class HlmAvatar {
22
27
  public readonly size = input<'default' | 'sm' | 'lg'>('default');
23
28
 
24
29
  constructor() {
25
- super();
26
30
  classes(
27
31
  () =>
28
32
  'size-8 rounded-full after:rounded-full data-[size=lg]:size-10 data-[size=sm]:size-6 group/avatar after:border-border relative flex shrink-0 select-none after:absolute after:inset-0 after:border after:mix-blend-darken dark:after:mix-blend-lighten',
@@ -3,6 +3,13 @@
3
3
  * generated project should pin. `@spartan-ng/brain` covers every `@spartan-ng/brain/*`
4
4
  * subpath (one package, many entry points). `@angular/*`, `clsx` type-only, `rxjs`
5
5
  * etc. are provided by the Angular app itself and are intentionally absent.
6
+ *
7
+ * `@spartan-ng/brain` is pinned to the exact minor verified against our copied
8
+ * component sources, not left wide open at `^1.0.0` — a real break was found
9
+ * (and fixed) where a fresh install resolved 1.9.0, whose `BrnAvatar` shape
10
+ * had changed from 1.3.2 (content-child `_image()` removed in favor of a
11
+ * public `status()` signal) and broke `HlmAvatar`'s template. `^1.0.0` lets
12
+ * any future 1.x minor silently reintroduce the same class of break.
6
13
  */
7
14
  export declare const UI_NPM_DEPS: Record<string, string>;
8
15
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"npm-deps.d.ts","sourceRoot":"","sources":["file:///d:/blueprint-platform/packages/components/src/generators/ui/lib/npm-deps.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAU9C,CAAC;AA2BF;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAgB5E"}
1
+ {"version":3,"file":"npm-deps.d.ts","sourceRoot":"","sources":["file:///D:/blueprint-platform/packages/components/src/generators/ui/lib/npm-deps.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAU9C,CAAC;AA2BF;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAgB5E"}
@@ -10,9 +10,16 @@ const resolve_deps_1 = require("./resolve-deps");
10
10
  * generated project should pin. `@spartan-ng/brain` covers every `@spartan-ng/brain/*`
11
11
  * subpath (one package, many entry points). `@angular/*`, `clsx` type-only, `rxjs`
12
12
  * etc. are provided by the Angular app itself and are intentionally absent.
13
+ *
14
+ * `@spartan-ng/brain` is pinned to the exact minor verified against our copied
15
+ * component sources, not left wide open at `^1.0.0` — a real break was found
16
+ * (and fixed) where a fresh install resolved 1.9.0, whose `BrnAvatar` shape
17
+ * had changed from 1.3.2 (content-child `_image()` removed in favor of a
18
+ * public `status()` signal) and broke `HlmAvatar`'s template. `^1.0.0` lets
19
+ * any future 1.x minor silently reintroduce the same class of break.
13
20
  */
14
21
  exports.UI_NPM_DEPS = {
15
- '@spartan-ng/brain': '^1.0.0',
22
+ '@spartan-ng/brain': '^1.9.0',
16
23
  '@ng-icons/core': '^32.0.0',
17
24
  '@ng-icons/lucide': '^32.0.0',
18
25
  'class-variance-authority': '^0.7.0',
@@ -1 +1 @@
1
- {"version":3,"file":"resolve-deps.d.ts","sourceRoot":"","sources":["file:///d:/blueprint-platform/packages/components/src/generators/ui/lib/resolve-deps.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,eAAO,MAAM,YAAY,QAAiD,CAAC;AAE3E;;;;GAIG;AACH,eAAO,MAAM,eAAe,UAAuD,CAAC;AAEpF,0DAA0D;AAC1D,wBAAgB,iBAAiB,IAAI,MAAM,EAAE,CAI5C;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAErD;AAYD,mDAAmD;AACnD,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAcjD;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG;IACnD,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAWA"}
1
+ {"version":3,"file":"resolve-deps.d.ts","sourceRoot":"","sources":["file:///D:/blueprint-platform/packages/components/src/generators/ui/lib/resolve-deps.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,eAAO,MAAM,YAAY,QAAiD,CAAC;AAE3E;;;;GAIG;AACH,eAAO,MAAM,eAAe,UAAuD,CAAC;AAEpF,0DAA0D;AAC1D,wBAAgB,iBAAiB,IAAI,MAAM,EAAE,CAI5C;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAErD;AAYD,mDAAmD;AACnD,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAcjD;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG;IACnD,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAWA"}
@@ -1 +1 @@
1
- {"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["file:///d:/blueprint-platform/packages/components/src/generators/ui/ui.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EAOL,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAgB7C,wBAA8B,WAAW,CACvC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,iBAAiB,qCA6F3B"}
1
+ {"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["file:///D:/blueprint-platform/packages/components/src/generators/ui/ui.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EAOL,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAgB7C,wBAA8B,WAAW,CACvC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,iBAAiB,qCA6F3B"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["file:///d:/blueprint-platform/packages/components/src/index.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["file:///D:/blueprint-platform/packages/components/src/index.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blueprint-platform/components",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },