valtech-components 2.0.877 → 2.0.878

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,39 +6,64 @@
6
6
  *
7
7
  * Original spec: `assets/Valtech Pattern System.html` (single-page demo).
8
8
  * Cada motif es función `(fill: string) => string` que devuelve SVG inner
9
- * markup. Tile es 100×100 unidades; el motif se renderiza dentro de un `<g
9
+ * markup. Tile es 100x100 unidades; el motif se renderiza dentro de un `<g
10
10
  * transform="translate(col*100 row*100)">` con un `<rect width=100 height=100
11
11
  * fill=bg/>` de fondo.
12
12
  */
13
- export type PatternMotifKey = 'chev-r' | 'chev-l' | 'chev-d' | 'chev-u' | 'tri-tl' | 'tri-tr' | 'tri-bl' | 'tri-br' | 'solid' | 'diamond' | 'small-r' | 'small-l' | 'arrow-r' | 'arrow-l' | 'house-d' | 'half-l' | 'half-t';
13
+ export type PatternMotifKey = 'chev-r' | 'chev-l' | 'chev-d' | 'chev-u' | 'tri-tl' | 'tri-tr' | 'tri-bl' | 'tri-br' | 'solid' | 'diamond' | 'small-r' | 'small-l' | 'arrow-r' | 'arrow-l' | 'house-d' | 'half-l' | 'half-t' | 'circle' | 'circle-sm' | 'dot' | 'cross' | 'x-mark' | 'slash-r' | 'slash-l' | 'corner-tl' | 'corner-tr' | 'corner-bl' | 'corner-br';
14
14
  export declare const PATTERN_MOTIFS: Record<PatternMotifKey, (fg: string) => string>;
15
15
  export declare const MOTIF_KEYS: PatternMotifKey[];
16
- /** Chevron family — orientations + size variants + arrows. */
16
+ /** Chevron family — orientaciones + variantes pequeñas. */
17
17
  export declare const CHEV_KEYS: PatternMotifKey[];
18
+ /** Stroke family — líneas y cruces (complementan chevrons). */
19
+ export declare const STROKE_KEYS: PatternMotifKey[];
20
+ /** Circle / dot family — formas curvas centradas. */
21
+ export declare const CIRCLE_KEYS: PatternMotifKey[];
22
+ /** Diamond solo — forma geométrica angular centrada. */
23
+ export declare const SHAPE_KEYS: PatternMotifKey[];
18
24
  /** Triangle / half-fill family. */
19
25
  export declare const TRI_KEYS: PatternMotifKey[];
20
- /** Center shape family (currently solo diamond). */
21
- export declare const SHAPE_KEYS: PatternMotifKey[];
22
- /** No-foreground tiles — solo el rect de fondo. */
26
+ /** Corner arc family mezcla suave con triangles. */
27
+ export declare const CORNER_KEYS: PatternMotifKey[];
28
+ /** No-foreground tiles — solo rect de fondo. */
23
29
  export declare const SOLID_KEYS: PatternMotifKey[];
24
- /** Built-in palettes — dark → light (8 colors). */
25
- export type PatternPaletteKey = 'purple' | 'ink' | 'lavender';
30
+ /** Built-in palettes — 8 colores dark → light. */
31
+ export type PatternPaletteKey = 'purple' | 'ink' | 'lavender' | 'midnight' | 'ember' | 'forest' | 'rose' | 'gold' | 'mono';
26
32
  export declare const PATTERN_PALETTES: Record<PatternPaletteKey, string[]>;
27
33
  /**
28
- * Mulberry32 seeded RNG devuelve función `()=>[0,1)`.
29
- * Deterministic: mismo seed → misma secuencia. Útil para patrones reproducibles.
34
+ * Preset de composición del patrón. Controla qué familias predominan.
35
+ *
36
+ * - `branded` → Chevrons dominantes (identidad Valtech `>_`). Default.
37
+ * - `geometric` → Triángulos, esquinas y círculos. Más arquitectónico.
38
+ * - `minimal` → Espacios sólidos con trazos sutiles. Limpio, corporativo.
39
+ * - `dense` → Mezcla rica de todas las familias. Máxima textura.
30
40
  */
31
- export declare function mulberry32(seed: number): () => number;
41
+ export type PatternStyleKey = 'branded' | 'geometric' | 'minimal' | 'dense';
42
+ export interface PatternDensityConfig {
43
+ /** Probabilidad de chevron family. */
44
+ chev: number;
45
+ /** Probabilidad de stroke family (cross, x, slash). */
46
+ stroke: number;
47
+ /** Probabilidad de círculos. */
48
+ circle: number;
49
+ /** Probabilidad de diamond. */
50
+ shape: number;
51
+ /** Probabilidad de solid (espacio vacío). */
52
+ solid: number;
53
+ }
54
+ export declare const PATTERN_STYLE_CONFIGS: Record<PatternStyleKey, PatternDensityConfig>;
32
55
  /**
33
- * Densidad de chevrons (0..1). El resto se reparte entre solid (20%), shape
34
- * (15%) y tri (resto), proporcional al gap left después del threshold.
56
+ * Mulberry32 seeded RNG devuelve función `()=>[0,1)`.
57
+ * Deterministic: mismo seed misma secuencia.
35
58
  */
59
+ export declare function mulberry32(seed: number): () => number;
36
60
  export interface PatternGenConfig {
37
61
  cols: number;
38
62
  rows: number;
39
63
  seed: number;
40
64
  palette: string[];
41
65
  chevronDensity?: number;
66
+ style?: PatternStyleKey;
42
67
  }
43
68
  export interface PatternTile {
44
69
  motif: PatternMotifKey;
@@ -46,15 +71,13 @@ export interface PatternTile {
46
71
  fg: string;
47
72
  }
48
73
  /**
49
- * Genera UN tile con motif/bg/fg respetando densidades + contraste.
50
- * Caller pasa rng (Math.random o seeded) útil para reshuffle individual de
51
- * tiles en `val-pattern` sin regenerar la grid completa.
74
+ * Genera UN tile respetando densidades de familia + contraste de palette.
75
+ * Acepta un config opcional de densidades (de PatternStyleKey o chevronDensity legacy).
52
76
  */
53
- export declare function generateRandomTile(palette: string[], chevronDensity?: number, rng?: () => number): PatternTile;
54
- /** Genera matriz de tiles aplicando densidades + reglas de contraste. */
77
+ export declare function generateRandomTile(palette: string[], chevronDensity?: number, rng?: () => number, densityConfig?: PatternDensityConfig): PatternTile;
78
+ /** Genera matriz completa de tiles. */
55
79
  export declare function generatePatternTiles(cfg: PatternGenConfig): PatternTile[];
56
80
  /**
57
81
  * Renderiza el inner SVG (sin el `<svg>` root) para una matriz de tiles.
58
- * Caller wraps en `<svg viewBox="0 0 {cols*100} {rows*100}" preserveAspectRatio="xMidYMid slice">`.
59
82
  */
60
83
  export declare function renderPatternSvgInner(tiles: PatternTile[], cols: number, baseColor: string): string;
@@ -37,14 +37,12 @@ export declare class PatternComponent implements OnDestroy {
37
37
  private readonly seed;
38
38
  private readonly paletteRef;
39
39
  private readonly chevronDensity;
40
+ private readonly patternStyle;
40
41
  private readonly preserveAspect;
41
42
  private readonly animated;
42
- /** ms entre reshuffles (modo animated). Default 8000ms — "de vez en cuando". */
43
43
  private readonly reshuffleInterval;
44
- /** Tiles a cambiar por tick. 0 → reseed grid completo (default). >0 → staggered. */
45
44
  private readonly tilesPerTick;
46
45
  private timer?;
47
- /** Object-first input. Cambios disparan re-render por signals. */
48
46
  set props(value: PatternMetadata | undefined);
49
47
  /**
50
48
  * Tiles signal — mutable. Se regenera completa cuando cambia seed/cols/rows/
@@ -1,4 +1,4 @@
1
- import { PatternPaletteKey } from './motifs';
1
+ import { PatternPaletteKey, PatternStyleKey } from './motifs';
2
2
  /**
3
3
  * Configuración del componente `val-pattern`.
4
4
  *
@@ -7,22 +7,38 @@ import { PatternPaletteKey } from './motifs';
7
7
  * <val-pattern [props]="{ palette: 'purple', cols: 12, rows: 4, seed: 42 }" />
8
8
  * ```
9
9
  *
10
- * @example Animated whole-grid reshuffle (cada 8s — default):
10
+ * @example Animated whole-grid reshuffle (cada 10s):
11
11
  * ```html
12
- * <val-pattern [props]="{ palette: 'ink', cols: 16, rows: 8, animated: true }" />
12
+ * <val-pattern [props]="{ palette: 'midnight', cols: 14, rows: 5, animated: true, reshuffleInterval: 10000 }" />
13
13
  * ```
14
14
  *
15
15
  * @example Animated staggered (2 tiles cada 800ms — sutil):
16
16
  * ```html
17
17
  * <val-pattern [props]="{ animated: true, reshuffleInterval: 800, tilesPerTick: 2 }" />
18
18
  * ```
19
+ *
20
+ * @example Preset geométrico con paleta ember:
21
+ * ```html
22
+ * <val-pattern [props]="{ palette: 'ember', style: 'geometric', cols: 10, rows: 4 }" />
23
+ * ```
19
24
  */
20
25
  export interface PatternMetadata {
21
26
  /**
22
- * Palette built-in (`'purple' | 'ink' | 'lavender'`) o array custom de 8
23
- * colores dark light. Default: `'purple'`.
27
+ * Palette built-in o array custom de 8 colores dark → light.
28
+ * Built-ins: `'purple' | 'ink' | 'lavender' | 'midnight' | 'ember' | 'forest' | 'rose' | 'gold' | 'mono'`.
29
+ * Default: `'purple'`.
24
30
  */
25
31
  palette?: PatternPaletteKey | string[];
32
+ /**
33
+ * Preset de composición de familias de motifs.
34
+ * - `branded` → Chevrons dominantes (identidad Valtech). Default.
35
+ * - `geometric` → Triángulos, esquinas redondeadas y círculos.
36
+ * - `minimal` → Mayoría sólido con trazos sutiles. Look corporativo limpio.
37
+ * - `dense` → Mezcla rica de todas las familias. Máxima textura.
38
+ *
39
+ * Cuando se usa `style`, sobreescribe `chevronDensity`.
40
+ */
41
+ style?: PatternStyleKey;
26
42
  /** Columnas del grid. Default: 12. */
27
43
  cols?: number;
28
44
  /** Filas del grid. Default: 4. */
@@ -33,29 +49,31 @@ export interface PatternMetadata {
33
49
  */
34
50
  seed?: number;
35
51
  /**
36
- * Densidad de chevrons (0..1). El resto se reparte entre solid/shape/tri.
52
+ * Densidad de chevrons (0..1). Ignorado si se pasa `style`.
37
53
  * Default: `0.55`.
38
54
  */
39
55
  chevronDensity?: number;
40
56
  /**
41
- * Si `true`, el patrón hace **staggered reshuffle**: cada `reshuffleInterval`
42
- * ms se reemplazan `tilesPerTick` tiles random NO la grid entera.
57
+ * Si `true`, el patrón anima tiles periódicamente.
58
+ * Con `tilesPerTick: 0` (default): reseed completo de la grid.
59
+ * Con `tilesPerTick > 0`: reshuffle parcial (staggered — más sutil).
43
60
  * Default: `false`.
44
61
  */
45
62
  animated?: boolean;
46
63
  /**
47
- * ms entre updates individuales de tiles (modo animated).
48
- * Default: `1200` (~1 tile cada 1.2s con `tilesPerTick: 1`).
64
+ * ms entre updates (modo animated).
65
+ * Default: `8000`.
49
66
  */
50
67
  reshuffleInterval?: number;
51
68
  /**
52
- * Cuántos tiles cambiar por tick (modo animated). Default: `1` (cambio sutil).
53
- * Subir a 2-4 para efecto más vivo.
69
+ * Cuántos tiles cambiar por tick (modo animated).
70
+ * `0` reseed grid completa. `1-N` staggered sutil.
71
+ * Default: `0`.
54
72
  */
55
73
  tilesPerTick?: number;
56
74
  /**
57
- * `slice` (default) — el patrón cubre todo el contenedor manteniendo aspect,
58
- * cropeando si necesario. `meet` — fit completo sin crop, deja espacio.
75
+ * `slice` (default) — cubre todo el contenedor con crop si necesario.
76
+ * `meet` — fit completo sin crop.
59
77
  */
60
78
  preserveAspect?: 'slice' | 'meet';
61
79
  }
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 = "2.0.877";
5
+ export declare const VERSION = "2.0.878";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valtech-components",
3
- "version": "2.0.877",
3
+ "version": "2.0.878",
4
4
  "private": false,
5
5
  "bin": {
6
6
  "valtech-firebase-config": "./src/lib/services/firebase/scripts/generate-sw-config.js"