@justeattakeaway/pie-cookie-banner 0.14.0 → 0.15.0
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/custom-elements.json +6 -0
- package/dist/react.d.ts +11 -8
- package/dist/react.js +9 -9
- package/package.json +10 -10
- package/src/defs-react.ts +3 -0
- package/src/react.ts +15 -4
package/custom-elements.json
CHANGED
package/dist/react.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { CSSResult } from 'lit';
|
|
2
|
-
import type { EventName } from '@lit/react';
|
|
3
2
|
import type { LitElement } from 'lit';
|
|
4
3
|
import { PieSwitch } from '@justeattakeaway/pie-switch';
|
|
5
|
-
import
|
|
4
|
+
import * as React_2 from 'react';
|
|
6
5
|
import { TemplateResult } from 'lit';
|
|
7
6
|
|
|
8
7
|
export declare interface CookieBannerLocale {
|
|
@@ -89,12 +88,7 @@ export declare const ON_COOKIE_BANNER_NECESSARY_ONLY = "pie-cookie-banner-necess
|
|
|
89
88
|
*/
|
|
90
89
|
export declare const ON_COOKIE_BANNER_PREFS_SAVED = "pie-cookie-banner-prefs-saved";
|
|
91
90
|
|
|
92
|
-
export declare const PieCookieBanner:
|
|
93
|
-
onPieCookieBannerAcceptAll: EventName<CustomEvent<any>>;
|
|
94
|
-
onPieCookieBannerNecessaryOnly: EventName<CustomEvent<any>>;
|
|
95
|
-
onPieCookieBannerManagePrefs: EventName<CustomEvent<any>>;
|
|
96
|
-
onPieCookieBannerPrefsSaved: EventName<CustomEvent<any>>;
|
|
97
|
-
}>;
|
|
91
|
+
export declare const PieCookieBanner: React_2.ForwardRefExoticComponent<CookieBannerProps & React_2.RefAttributes<PieCookieBanner_2> & PieCookieBannerEvents & ReactBaseType>;
|
|
98
92
|
|
|
99
93
|
/**
|
|
100
94
|
* @tagname pie-cookie-banner
|
|
@@ -175,6 +169,13 @@ declare class PieCookieBanner_2 extends LitElement implements CookieBannerProps
|
|
|
175
169
|
static styles: CSSResult;
|
|
176
170
|
}
|
|
177
171
|
|
|
172
|
+
declare type PieCookieBannerEvents = {
|
|
173
|
+
onPieCookieBannerAcceptAll?: (event: CustomEvent<any>) => void;
|
|
174
|
+
onPieCookieBannerNecessaryOnly?: (event: CustomEvent<any>) => void;
|
|
175
|
+
onPieCookieBannerManagePrefs?: (event: CustomEvent<any>) => void;
|
|
176
|
+
onPieCookieBannerPrefsSaved?: (event: CustomEvent<any>) => void;
|
|
177
|
+
};
|
|
178
|
+
|
|
178
179
|
export declare interface Preference {
|
|
179
180
|
id: PreferenceIds;
|
|
180
181
|
checked?: boolean;
|
|
@@ -187,4 +188,6 @@ export declare type PreferenceIds = 'all' | 'necessary' | 'functional' | 'analyt
|
|
|
187
188
|
|
|
188
189
|
export declare const preferences: Preference[];
|
|
189
190
|
|
|
191
|
+
declare type ReactBaseType = React_2.HTMLAttributes<HTMLElement>;
|
|
192
|
+
|
|
190
193
|
export { }
|
package/dist/react.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as e from "react";
|
|
2
2
|
import { createComponent as o } from "@lit/react";
|
|
3
|
-
import { PieCookieBanner as
|
|
4
|
-
import { ON_COOKIE_BANNER_ACCEPT_ALL as A, ON_COOKIE_BANNER_MANAGE_PREFS as
|
|
3
|
+
import { PieCookieBanner as n } from "./index.js";
|
|
4
|
+
import { ON_COOKIE_BANNER_ACCEPT_ALL as A, ON_COOKIE_BANNER_MANAGE_PREFS as f, ON_COOKIE_BANNER_NECESSARY_ONLY as l, ON_COOKIE_BANNER_PREFS_SAVED as R, preferences as S } from "./index.js";
|
|
5
5
|
import "lit";
|
|
6
6
|
import "lit/decorators.js";
|
|
7
7
|
import "lit/directives/repeat.js";
|
|
@@ -12,9 +12,9 @@ import "@justeattakeaway/pie-link";
|
|
|
12
12
|
import "@justeattakeaway/pie-modal";
|
|
13
13
|
import "@justeattakeaway/pie-switch";
|
|
14
14
|
import "@justeattakeaway/pie-webc-core";
|
|
15
|
-
const
|
|
15
|
+
const r = o({
|
|
16
16
|
displayName: "PieCookieBanner",
|
|
17
|
-
elementClass:
|
|
17
|
+
elementClass: n,
|
|
18
18
|
react: e,
|
|
19
19
|
tagName: "pie-cookie-banner",
|
|
20
20
|
events: {
|
|
@@ -27,12 +27,12 @@ const O = o({
|
|
|
27
27
|
onPieCookieBannerPrefsSaved: "pie-cookie-banner-prefs-saved"
|
|
28
28
|
// when a user clicks save preferences.
|
|
29
29
|
}
|
|
30
|
-
});
|
|
30
|
+
}), O = r;
|
|
31
31
|
export {
|
|
32
32
|
A as ON_COOKIE_BANNER_ACCEPT_ALL,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
f as ON_COOKIE_BANNER_MANAGE_PREFS,
|
|
34
|
+
l as ON_COOKIE_BANNER_NECESSARY_ONLY,
|
|
35
|
+
R as ON_COOKIE_BANNER_PREFS_SAVED,
|
|
36
36
|
O as PieCookieBanner,
|
|
37
|
-
|
|
37
|
+
S as preferences
|
|
38
38
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@justeattakeaway/pie-cookie-banner",
|
|
3
3
|
"description": "PIE Design System Cookie Banner built using Web Components",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.15.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -34,18 +34,18 @@
|
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@custom-elements-manifest/analyzer": "0.9.0",
|
|
36
36
|
"@justeat/pie-design-tokens": "5.9.0",
|
|
37
|
-
"@justeattakeaway/pie-components-config": "0.
|
|
38
|
-
"@justeattakeaway/pie-wrapper-react": "0.
|
|
37
|
+
"@justeattakeaway/pie-components-config": "0.9.0",
|
|
38
|
+
"@justeattakeaway/pie-wrapper-react": "0.13.0",
|
|
39
39
|
"cem-plugin-module-file-extensions": "0.0.5"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@justeattakeaway/pie-button": "0.
|
|
43
|
-
"@justeattakeaway/pie-divider": "0.
|
|
44
|
-
"@justeattakeaway/pie-icon-button": "0.
|
|
45
|
-
"@justeattakeaway/pie-link": "0.
|
|
46
|
-
"@justeattakeaway/pie-modal": "0.
|
|
47
|
-
"@justeattakeaway/pie-switch": "0.
|
|
48
|
-
"@justeattakeaway/pie-webc-core": "0.
|
|
42
|
+
"@justeattakeaway/pie-button": "0.45.0",
|
|
43
|
+
"@justeattakeaway/pie-divider": "0.12.0",
|
|
44
|
+
"@justeattakeaway/pie-icon-button": "0.27.0",
|
|
45
|
+
"@justeattakeaway/pie-link": "0.14.0",
|
|
46
|
+
"@justeattakeaway/pie-modal": "0.38.0",
|
|
47
|
+
"@justeattakeaway/pie-switch": "0.24.0",
|
|
48
|
+
"@justeattakeaway/pie-webc-core": "0.17.0"
|
|
49
49
|
},
|
|
50
50
|
"volta": {
|
|
51
51
|
"extends": "../../../package.json"
|
package/src/react.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
|
|
2
1
|
import * as React from 'react';
|
|
3
2
|
import { createComponent, EventName } from '@lit/react';
|
|
4
|
-
import { PieCookieBanner as
|
|
3
|
+
import { PieCookieBanner as PieCookieBannerLit } from './index';
|
|
4
|
+
import { CookieBannerProps } from './defs';
|
|
5
5
|
|
|
6
6
|
export * from './defs';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
const PieCookieBannerReact = createComponent({
|
|
9
9
|
displayName: 'PieCookieBanner',
|
|
10
|
-
elementClass:
|
|
10
|
+
elementClass: PieCookieBannerLit,
|
|
11
11
|
react: React,
|
|
12
12
|
tagName: 'pie-cookie-banner',
|
|
13
13
|
events: {
|
|
@@ -17,3 +17,14 @@ export const PieCookieBanner = createComponent({
|
|
|
17
17
|
onPieCookieBannerPrefsSaved: 'pie-cookie-banner-prefs-saved' as EventName<CustomEvent>, // when a user clicks save preferences.
|
|
18
18
|
},
|
|
19
19
|
});
|
|
20
|
+
|
|
21
|
+
type ReactBaseType = React.HTMLAttributes<HTMLElement>
|
|
22
|
+
|
|
23
|
+
type PieCookieBannerEvents = {
|
|
24
|
+
onPieCookieBannerAcceptAll?: (event: CustomEvent<any>) => void;
|
|
25
|
+
onPieCookieBannerNecessaryOnly?: (event: CustomEvent<any>) => void;
|
|
26
|
+
onPieCookieBannerManagePrefs?: (event: CustomEvent<any>) => void;
|
|
27
|
+
onPieCookieBannerPrefsSaved?: (event: CustomEvent<any>) => void;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const PieCookieBanner = PieCookieBannerReact as React.ForwardRefExoticComponent<React.PropsWithoutRef<CookieBannerProps> & React.RefAttributes<PieCookieBannerLit> & PieCookieBannerEvents & ReactBaseType>;
|