valtech-components 2.0.773 → 2.0.775
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/esm2022/lib/components/atoms/pattern/motifs.mjs +41 -26
- package/esm2022/lib/components/atoms/pattern/pattern.component.mjs +48 -15
- package/esm2022/lib/components/atoms/pattern/types.mjs +1 -1
- package/esm2022/lib/components/organisms/cookie-banner/cookie-banner.component.mjs +199 -0
- package/esm2022/lib/components/organisms/cookie-banner/types.mjs +2 -0
- package/esm2022/lib/version.mjs +2 -2
- package/esm2022/public-api.mjs +3 -1
- package/fesm2022/valtech-components.mjs +280 -40
- package/fesm2022/valtech-components.mjs.map +1 -1
- package/lib/components/atoms/pattern/motifs.d.ts +6 -0
- package/lib/components/atoms/pattern/pattern.component.d.ts +13 -1
- package/lib/components/atoms/pattern/types.d.ts +17 -3
- package/lib/components/organisms/cookie-banner/cookie-banner.component.d.ts +36 -0
- package/lib/components/organisms/cookie-banner/types.d.ts +62 -0
- package/lib/version.d.ts +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +2 -0
|
@@ -45,6 +45,12 @@ export interface PatternTile {
|
|
|
45
45
|
bg: string;
|
|
46
46
|
fg: string;
|
|
47
47
|
}
|
|
48
|
+
/**
|
|
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.
|
|
52
|
+
*/
|
|
53
|
+
export declare function generateRandomTile(palette: string[], chevronDensity?: number, rng?: () => number): PatternTile;
|
|
48
54
|
/** Genera matriz de tiles aplicando densidades + reglas de contraste. */
|
|
49
55
|
export declare function generatePatternTiles(cfg: PatternGenConfig): PatternTile[];
|
|
50
56
|
/**
|
|
@@ -39,15 +39,27 @@ export declare class PatternComponent implements OnDestroy {
|
|
|
39
39
|
private readonly chevronDensity;
|
|
40
40
|
private readonly preserveAspect;
|
|
41
41
|
private readonly animated;
|
|
42
|
+
/** ms entre updates individuales de tiles (modo animated). Default 1200ms. */
|
|
42
43
|
private readonly reshuffleInterval;
|
|
44
|
+
/** Cuántos tiles cambiar por tick (default 1 → cambio sutil). */
|
|
45
|
+
private readonly tilesPerTick;
|
|
43
46
|
private timer?;
|
|
44
47
|
/** Object-first input. Cambios disparan re-render por signals. */
|
|
45
48
|
set props(value: PatternMetadata | undefined);
|
|
46
|
-
/**
|
|
49
|
+
/**
|
|
50
|
+
* Tiles signal — mutable. Se regenera completa cuando cambia seed/cols/rows/
|
|
51
|
+
* palette/density. En modo animated, tiles individuales se sobrescriben sin
|
|
52
|
+
* tocar el resto (efecto staggered).
|
|
53
|
+
*/
|
|
47
54
|
private readonly tiles;
|
|
48
55
|
/** SVG completo como string sanitized para `[innerHTML]`. */
|
|
49
56
|
readonly svgHtml: import("@angular/core").Signal<SafeHtml>;
|
|
50
57
|
constructor();
|
|
58
|
+
/**
|
|
59
|
+
* Reemplaza `count` tiles random del grid actual con tiles nuevos generados.
|
|
60
|
+
* Usado por el modo animated para staggered reshuffle.
|
|
61
|
+
*/
|
|
62
|
+
private mutateRandomTiles;
|
|
51
63
|
ngOnDestroy(): void;
|
|
52
64
|
private resolvePalette;
|
|
53
65
|
private randomSeed;
|
|
@@ -7,10 +7,15 @@ import { PatternPaletteKey } from './motifs';
|
|
|
7
7
|
* <val-pattern [props]="{ palette: 'purple', cols: 12, rows: 4, seed: 42 }" />
|
|
8
8
|
* ```
|
|
9
9
|
*
|
|
10
|
-
* @example Animated (
|
|
10
|
+
* @example Animated staggered (1 tile cada 1.2s, sutil):
|
|
11
11
|
* ```html
|
|
12
12
|
* <val-pattern [props]="{ palette: 'ink', cols: 16, rows: 8, animated: true }" />
|
|
13
13
|
* ```
|
|
14
|
+
*
|
|
15
|
+
* @example Animated más activo (2 tiles cada 800ms):
|
|
16
|
+
* ```html
|
|
17
|
+
* <val-pattern [props]="{ animated: true, reshuffleInterval: 800, tilesPerTick: 2 }" />
|
|
18
|
+
* ```
|
|
14
19
|
*/
|
|
15
20
|
export interface PatternMetadata {
|
|
16
21
|
/**
|
|
@@ -33,12 +38,21 @@ export interface PatternMetadata {
|
|
|
33
38
|
*/
|
|
34
39
|
chevronDensity?: number;
|
|
35
40
|
/**
|
|
36
|
-
* Si `true`, el patrón
|
|
41
|
+
* Si `true`, el patrón hace **staggered reshuffle**: cada `reshuffleInterval`
|
|
42
|
+
* ms se reemplazan `tilesPerTick` tiles random — NO la grid entera.
|
|
37
43
|
* Default: `false`.
|
|
38
44
|
*/
|
|
39
45
|
animated?: boolean;
|
|
40
|
-
/**
|
|
46
|
+
/**
|
|
47
|
+
* ms entre updates individuales de tiles (modo animated).
|
|
48
|
+
* Default: `1200` (~1 tile cada 1.2s con `tilesPerTick: 1`).
|
|
49
|
+
*/
|
|
41
50
|
reshuffleInterval?: number;
|
|
51
|
+
/**
|
|
52
|
+
* Cuántos tiles cambiar por tick (modo animated). Default: `1` (cambio sutil).
|
|
53
|
+
* Subir a 2-4 para efecto más vivo.
|
|
54
|
+
*/
|
|
55
|
+
tilesPerTick?: number;
|
|
42
56
|
/**
|
|
43
57
|
* `slice` (default) — el patrón cubre todo el contenedor manteniendo aspect,
|
|
44
58
|
* cropeando si necesario. `meet` — fit completo sin crop, deja espacio.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
|
+
import { CookieBannerMetadata } from './types';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* `val-cookie-banner` — bottom/top fixed banner asking the user to choose
|
|
6
|
+
* a cookie consent option. Presentational only: emits events on each
|
|
7
|
+
* action, the parent decides what to do (typically wiring to
|
|
8
|
+
* `AnalyticsService` from `valtech-components`).
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* <val-cookie-banner
|
|
12
|
+
* [props]="bannerProps()"
|
|
13
|
+
* (accept)="onAccept()"
|
|
14
|
+
* (reject)="onReject()"
|
|
15
|
+
* (customize)="onCustomize()"
|
|
16
|
+
* (dismiss)="onDismiss()"
|
|
17
|
+
* />
|
|
18
|
+
*
|
|
19
|
+
* Wire `props.visible` to `analytics.consentState().hasDecided === false`
|
|
20
|
+
* so the banner auto-hides once the user makes a choice.
|
|
21
|
+
*/
|
|
22
|
+
export declare class CookieBannerComponent {
|
|
23
|
+
/** Banner configuration object. */
|
|
24
|
+
props: CookieBannerMetadata;
|
|
25
|
+
/** Fired when the user clicks the primary "accept" button. */
|
|
26
|
+
accept: EventEmitter<void>;
|
|
27
|
+
/** Fired when the user clicks the secondary "reject" button. */
|
|
28
|
+
reject: EventEmitter<void>;
|
|
29
|
+
/** Fired when the user clicks the tertiary "customize/configure" button. */
|
|
30
|
+
customize: EventEmitter<void>;
|
|
31
|
+
/** Fired when the user clicks the dismiss (X) icon. */
|
|
32
|
+
dismiss: EventEmitter<void>;
|
|
33
|
+
constructor();
|
|
34
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CookieBannerComponent, never>;
|
|
35
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CookieBannerComponent, "val-cookie-banner", never, { "props": { "alias": "props"; "required": false; }; }, { "accept": "accept"; "reject": "reject"; "customize": "customize"; "dismiss": "dismiss"; }, never, never, true, never>;
|
|
36
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Color } from '@ionic/core';
|
|
2
|
+
/** Position of the banner relative to the viewport. */
|
|
3
|
+
export type CookieBannerPosition = 'bottom' | 'top';
|
|
4
|
+
/**
|
|
5
|
+
* Configuration for `val-cookie-banner`.
|
|
6
|
+
*
|
|
7
|
+
* The banner is purely presentational: it shows configurable text and
|
|
8
|
+
* up to three action buttons. It does NOT couple to any consent service —
|
|
9
|
+
* the parent decides what to do on each event (accept/reject/customize).
|
|
10
|
+
*
|
|
11
|
+
* Typical wiring (with `AnalyticsService` from valtech-components):
|
|
12
|
+
* - `accept` → `analytics.grantAllConsent()`
|
|
13
|
+
* - `reject` → `analytics.denyAllConsent()`
|
|
14
|
+
* - `customize` → `router.navigate(['/cookies'])`
|
|
15
|
+
*
|
|
16
|
+
* Visibility is controlled by the parent via `[visible]` — typically
|
|
17
|
+
* tied to `analytics.consentState().hasDecided === false`.
|
|
18
|
+
*/
|
|
19
|
+
export interface CookieBannerMetadata {
|
|
20
|
+
/** Whether the banner is shown. Parent toggles based on `hasDecided`. */
|
|
21
|
+
visible: boolean;
|
|
22
|
+
/** Where the banner anchors. Default `'bottom'`. */
|
|
23
|
+
position?: CookieBannerPosition;
|
|
24
|
+
/** Short title above the message (optional). */
|
|
25
|
+
title?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Main message shown to the user. Plain text — newlines respected.
|
|
28
|
+
* For inline links, use `policyHref` + `policyLinkText` so the link
|
|
29
|
+
* renders consistently after the message.
|
|
30
|
+
*/
|
|
31
|
+
message: string;
|
|
32
|
+
/** Optional inline link appended to the message (e.g. "More info"). */
|
|
33
|
+
policyLinkText?: string;
|
|
34
|
+
/** Href for the inline policy link (relative or absolute). */
|
|
35
|
+
policyHref?: string;
|
|
36
|
+
/** Label for the "accept all" primary action. */
|
|
37
|
+
acceptText: string;
|
|
38
|
+
/** Label for the "reject / essential only" secondary action. */
|
|
39
|
+
rejectText: string;
|
|
40
|
+
/**
|
|
41
|
+
* Label for the "configure / customize" tertiary action. When omitted,
|
|
42
|
+
* the button is not rendered (simple two-button mode).
|
|
43
|
+
*/
|
|
44
|
+
customizeText?: string;
|
|
45
|
+
/** Router link applied to the customize button (e.g. `'/cookies'`). */
|
|
46
|
+
customizeRouterLink?: string;
|
|
47
|
+
/** Show an `X` icon to dismiss the banner without deciding. Default `false`. */
|
|
48
|
+
dismissible?: boolean;
|
|
49
|
+
/** Color of the primary action button. Default `'primary'`. */
|
|
50
|
+
acceptColor?: Color;
|
|
51
|
+
/** Color of the secondary action button. Default `'medium'`. */
|
|
52
|
+
rejectColor?: Color;
|
|
53
|
+
/** Color of the tertiary action button. Default `'dark'`. */
|
|
54
|
+
customizeColor?: Color;
|
|
55
|
+
/**
|
|
56
|
+
* Max width of the inner banner container. Defaults to `'1200px'` so it
|
|
57
|
+
* doesn't span the full viewport on large screens.
|
|
58
|
+
*/
|
|
59
|
+
maxWidth?: string;
|
|
60
|
+
/** Apply translucent (glass-style) backdrop. Default `false`. */
|
|
61
|
+
translucent?: boolean;
|
|
62
|
+
}
|
package/lib/version.d.ts
CHANGED
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -172,6 +172,8 @@ export * from './lib/components/organisms/article/article.component';
|
|
|
172
172
|
export * from './lib/components/organisms/article/types';
|
|
173
173
|
export * from './lib/components/organisms/banner/banner.component';
|
|
174
174
|
export * from './lib/components/organisms/banner/types';
|
|
175
|
+
export * from './lib/components/organisms/cookie-banner/cookie-banner.component';
|
|
176
|
+
export * from './lib/components/organisms/cookie-banner/types';
|
|
175
177
|
export * from './lib/components/organisms/footer/footer.component';
|
|
176
178
|
export * from './lib/components/organisms/form/factory';
|
|
177
179
|
export * from './lib/components/organisms/form/form-footer/form-footer.component';
|