valtech-components 4.0.62 → 4.0.63

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.
@@ -6,15 +6,21 @@ import * as i0 from "@angular/core";
6
6
  * app (p.ej. el callback OAuth) que deben verse iguales al arranque, en vez de
7
7
  * un segundo loader casi-duplicado.
8
8
  *
9
- * El logo apunta por defecto a `assets/images/main-{light,dark}.svg` los mismos
10
- * assets de la app consumer que usa el splash de `index.html` y resuelven en
11
- * runtime contra la app. Override por inputs si hace falta. Fondo overridable con
9
+ * Por defecto renderiza el logo de la app via la CSS var `--main-logo` (un `<div>`
10
+ * con `background-image`) cada frontend del factory define `--main-logo` y la
11
+ * flipea en dark, asi el splash toma el logo correcto sin que el consumer pase nada.
12
+ * Override opcional: si se pasan `logoLight`/`logoDark` (no vacios), renderiza un
13
+ * `<img>` con ese src (comportamiento clasico, back-compat). Fondo overridable con
12
14
  * las CSS vars `--val-splash-bg` / `--val-splash-bg-dark`.
13
15
  */
14
16
  export declare class SplashComponent {
15
- /** Logo para tema claro. Default = asset de la app (igual que index.html). */
17
+ /**
18
+ * Override opcional — src del logo para tema claro. Vacío (default) activa el
19
+ * modo `--main-logo` (un `<div>` con `background-image: var(--main-logo)` que
20
+ * toma el logo de la app y respeta dark). Pasalo (no vacío) para forzar `<img>`.
21
+ */
16
22
  readonly logoLight: import("@angular/core").InputSignal<string>;
17
- /** Logo para tema oscuro (vía prefers-color-scheme). */
23
+ /** Override opcional — src del logo para tema oscuro (vía prefers-color-scheme). Solo aplica si `logoLight` no es vacío. */
18
24
  readonly logoDark: import("@angular/core").InputSignal<string>;
19
25
  /** Texto alternativo del logo. */
20
26
  readonly alt: import("@angular/core").InputSignal<string>;
@@ -0,0 +1,48 @@
1
+ import { EventEmitter } from '@angular/core';
2
+ import { PillMetadata } from '../pill/types';
3
+ import { EntityCardMetadata } from './types';
4
+ import * as i0 from "@angular/core";
5
+ /**
6
+ * val-entity-card
7
+ *
8
+ * Generic entity card / list row. Two use-cases in one component:
9
+ *
10
+ * 1. **Navigable entity** (`clickable: true`, no `actions`) — the whole card is
11
+ * a button: chevron on the right, `role="button"` + keyboard support, emits
12
+ * `(cardClick)` with the `token`.
13
+ * 2. **Row with action(s)** (`actions: ButtonMetadata[]`) — buttons on the
14
+ * right, each emits `(actionClick)` with its own token.
15
+ *
16
+ * Presentational — all text fields are already-resolved strings (no i18n of its
17
+ * own). Dark-safe: surface/borders/text use theme tokens only.
18
+ *
19
+ * @example
20
+ * ```html
21
+ * <val-entity-card
22
+ * [props]="{ chip: { label: 'En vivo', color: 'success' }, title: 'Bingo', subtitle: 'Hoy 20:00', clickable: true, token: 'evt-1' }"
23
+ * (cardClick)="open($event)" />
24
+ * ```
25
+ */
26
+ export declare class EntityCardComponent {
27
+ /** Component configuration (object-first). */
28
+ readonly props: import("@angular/core").InputSignal<Partial<EntityCardMetadata>>;
29
+ /** Emits the `token` when the card is navigable and gets clicked/activated. */
30
+ cardClick: EventEmitter<string>;
31
+ /** Emits the token of the clicked action button. */
32
+ actionClick: EventEmitter<string>;
33
+ /** Merged config. */
34
+ readonly config: import("@angular/core").Signal<EntityCardMetadata>;
35
+ /** Action buttons (empty array when none). */
36
+ readonly actions: import("@angular/core").Signal<import("valtech-components").ButtonMetadata[]>;
37
+ /**
38
+ * Badge-mode pill props for the status chip, or null when absent.
39
+ * `chip.color` is a free-form string (Ionic color name or CSS) per the public
40
+ * contract; cast to satisfy `PillMetadata.color` (Ionic `Color` union).
41
+ */
42
+ readonly chipPillProps: import("@angular/core").Signal<Partial<PillMetadata>>;
43
+ /** Card is navigable only when `clickable` and there are no actions. */
44
+ readonly isNavigable: import("@angular/core").Signal<boolean>;
45
+ onCardClick(): void;
46
+ static ɵfac: i0.ɵɵFactoryDeclaration<EntityCardComponent, never>;
47
+ static ɵcmp: i0.ɵɵComponentDeclaration<EntityCardComponent, "val-entity-card", never, { "props": { "alias": "props"; "required": false; "isSignal": true; }; }, { "cardClick": "cardClick"; "actionClick": "actionClick"; }, never, never, true, never>;
48
+ }
@@ -0,0 +1,74 @@
1
+ import { ButtonMetadata } from '../../types';
2
+ /**
3
+ * Optional status chip rendered as an eyebrow at the top-left of the card.
4
+ * Rendered via `val-pill` (badge mode).
5
+ */
6
+ export interface EntityCardChip {
7
+ /** Already-resolved label string. */
8
+ label: string;
9
+ /** Ionic color name (`primary`…`dark`) or CSS color. Default: `medium`. */
10
+ color?: string;
11
+ }
12
+ /**
13
+ * Configuration for `val-entity-card`.
14
+ *
15
+ * Presentational molecule — every text field is an already-resolved string
16
+ * (the consumer translates via `I18nService.t()`). No i18n of its own.
17
+ *
18
+ * Covers two real use-cases:
19
+ *
20
+ * 1. **Navigable entity** — set `clickable: true` (and no `actions`). The whole
21
+ * card becomes a button: shows a chevron, gains `role="button"` + keyboard
22
+ * support, and emits `(cardClick)` with `token`.
23
+ *
24
+ * 2. **Row with action(s)** — provide `actions` (e.g. a prize row with an
25
+ * "edit"/"assign" button). Each button emits `(actionClick)` with its token.
26
+ * When `actions` is present the card is NOT navigable (no chevron).
27
+ *
28
+ * @example Navigable event
29
+ * ```html
30
+ * <val-entity-card
31
+ * [props]="{
32
+ * chip: { label: 'En vivo', color: 'success' },
33
+ * title: 'Bingo Solidario',
34
+ * subtitle: 'Hoy 20:00 · 120 jugadores',
35
+ * clickable: true,
36
+ * token: 'evt-1'
37
+ * }"
38
+ * (cardClick)="open($event)" />
39
+ * ```
40
+ *
41
+ * @example Prize row with an action
42
+ * ```html
43
+ * <val-entity-card
44
+ * [props]="{
45
+ * title: 'Línea',
46
+ * subtitle: 'Smart TV 50\"',
47
+ * endNote: 'Ganador: María P.',
48
+ * actions: [
49
+ * { text: 'Editar', color: 'dark', fill: 'clear', type: 'button', state: 'ENABLED', token: 'prize-1' }
50
+ * ]
51
+ * }"
52
+ * (actionClick)="edit($event)" />
53
+ * ```
54
+ */
55
+ export interface EntityCardMetadata {
56
+ /** Optional status badge, top-left of the card. Rendered with `val-pill`. */
57
+ chip?: EntityCardChip;
58
+ /** Main text (weight 700). Already resolved. */
59
+ title: string;
60
+ /** Secondary muted line. Already resolved. */
61
+ subtitle?: string;
62
+ /** Additional secondary note (e.g. "Ganador: X"), muted, below `subtitle`. */
63
+ endNote?: string;
64
+ /** Action buttons rendered on the right (one `val-button` each). */
65
+ actions?: ButtonMetadata[];
66
+ /**
67
+ * When `true` and there are NO `actions`, the whole card is navigable:
68
+ * shows a chevron, `role="button"` + `tabindex`, keyboard activation, and
69
+ * emits `(cardClick)`.
70
+ */
71
+ clickable?: boolean;
72
+ /** Identifier emitted on `(cardClick)`. */
73
+ token?: string;
74
+ }
package/lib/version.d.ts CHANGED
@@ -2,4 +2,4 @@
2
2
  * Current version of valtech-components.
3
3
  * This is automatically updated during the publish process.
4
4
  */
5
- export declare const VERSION = "4.0.62";
5
+ export declare const VERSION = "4.0.63";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valtech-components",
3
- "version": "4.0.62",
3
+ "version": "4.0.63",
4
4
  "private": false,
5
5
  "bin": {
6
6
  "valtech-firebase-config": "./src/lib/services/firebase/scripts/generate-sw-config.js"
package/public-api.d.ts CHANGED
@@ -181,6 +181,8 @@ export * from './lib/components/molecules/article-card/article-card.component';
181
181
  export * from './lib/components/molecules/article-card/types';
182
182
  export * from './lib/components/molecules/cta-card/cta-card.component';
183
183
  export * from './lib/components/molecules/cta-card/types';
184
+ export * from './lib/components/molecules/entity-card/entity-card.component';
185
+ export * from './lib/components/molecules/entity-card/types';
184
186
  export * from './lib/components/molecules/invitation-card/invitation-card.component';
185
187
  export * from './lib/components/molecules/invitation-card/types';
186
188
  export * from './lib/components/molecules/member-card/member-card.component';