valtech-components 2.0.774 → 2.0.776
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/pattern.component.mjs +19 -11
- 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 +212 -12
- package/fesm2022/valtech-components.mjs.map +1 -1
- package/lib/components/atoms/pattern/pattern.component.d.ts +3 -3
- package/lib/components/atoms/pattern/types.d.ts +2 -2
- 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
|
@@ -39,9 +39,9 @@ export declare class PatternComponent implements OnDestroy {
|
|
|
39
39
|
private readonly chevronDensity;
|
|
40
40
|
private readonly preserveAspect;
|
|
41
41
|
private readonly animated;
|
|
42
|
-
/** ms entre
|
|
42
|
+
/** ms entre reshuffles (modo animated). Default 8000ms — "de vez en cuando". */
|
|
43
43
|
private readonly reshuffleInterval;
|
|
44
|
-
/**
|
|
44
|
+
/** Tiles a cambiar por tick. 0 → reseed grid completo (default). >0 → staggered. */
|
|
45
45
|
private readonly tilesPerTick;
|
|
46
46
|
private timer?;
|
|
47
47
|
/** Object-first input. Cambios disparan re-render por signals. */
|
|
@@ -57,7 +57,7 @@ export declare class PatternComponent implements OnDestroy {
|
|
|
57
57
|
constructor();
|
|
58
58
|
/**
|
|
59
59
|
* Reemplaza `count` tiles random del grid actual con tiles nuevos generados.
|
|
60
|
-
* Usado
|
|
60
|
+
* Usado para staggered reshuffle (opt-in via `tilesPerTick > 0`).
|
|
61
61
|
*/
|
|
62
62
|
private mutateRandomTiles;
|
|
63
63
|
ngOnDestroy(): void;
|
|
@@ -7,12 +7,12 @@ 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 whole-grid reshuffle (cada 8s — default):
|
|
11
11
|
* ```html
|
|
12
12
|
* <val-pattern [props]="{ palette: 'ink', cols: 16, rows: 8, animated: true }" />
|
|
13
13
|
* ```
|
|
14
14
|
*
|
|
15
|
-
* @example Animated
|
|
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
|
* ```
|
|
@@ -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';
|