@webority/ui-react 0.57.0 → 0.59.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"./warnInvalidValue.js";import t from"./warnUnknownProps.js";import n from"./useWuiControl.js";import{useEffect as r}from"react";import{jsx as i}from"react/jsx-runtime";import"@webority/ui-elements/elements/consent-banner";import{getConsent as a,saveConsent as o}from"@webority/analytics/site";var s=[`bottom-left`,`bottom-right`];function
|
|
1
|
+
import e from"./warnInvalidValue.js";import t from"./warnUnknownProps.js";import n from"./useWuiControl.js";import{useEffect as r}from"react";import{jsx as i}from"react/jsx-runtime";import"@webority/ui-elements/elements/consent-banner";import{getConsent as a,saveConsent as o}from"@webority/analytics/site";var s=[`bottom-left`,`bottom-right`],c=[`analytics`,`functional`,`marketing`];function l({heading:l,description:u,policyHref:d,policyLabel:f,analyticsDescription:p,functionalDescription:m,marketingDescription:h,categories:g,position:_=`bottom-left`,standalone:v=!1,className:y=``,style:b,...x}){t(`AppConsentBanner`,x),e(`AppConsentBanner`,`position`,_,s);for(let t of g??[])e(`AppConsentBanner`,`categories`,t,c);let{setRef:S,innerRef:C}=n({on:{"wui-consent-save":e=>{o(e.detail),C.current&&(C.current.preferences=a())}}});return r(()=>{let e=C.current;if(!e)return;let t=a();e.preferences=t,t.decided||e.open()},[C]),i(`wui-consent-banner`,{ref:S,position:_,heading:l||void 0,description:u||void 0,"policy-href":d||void 0,"policy-label":f||void 0,"analytics-description":p||void 0,"functional-description":m||void 0,"marketing-description":h||void 0,categories:g?.length?g.join(` `):void 0,standalone:v||void 0,class:y||void 0,style:b,...x})}export{l as default};
|
|
@@ -28,12 +28,13 @@ import "@webority/ui-elements/elements/consent-banner";
|
|
|
28
28
|
* @param {string} [props.analyticsDescription] What the analytics category covers.
|
|
29
29
|
* @param {string} [props.functionalDescription] What the functional category covers.
|
|
30
30
|
* @param {string} [props.marketingDescription] What the marketing category covers.
|
|
31
|
+
* @param {Array<"analytics"|"functional"|"marketing">} [props.categories=['analytics','functional','marketing']] The optional categories to show. Essential always shows. A category left out has no row, saves as off and is never granted by Accept all.
|
|
31
32
|
* @param {"bottom-left"|"bottom-right"} [props.position='bottom-left'] Which corner it pins to.
|
|
32
33
|
* @param {boolean} [props.standalone=false] Render sealed in a shadow root with bundled styles, for a page that does not load `@webority/theme`.
|
|
33
34
|
* @param {string} [props.className] Extra classes on the element.
|
|
34
35
|
* @param {import('react').CSSProperties} [props.style] Inline style; lands on the element with `className`.
|
|
35
36
|
*/
|
|
36
|
-
export default function AppConsentBanner({ heading, description, policyHref, policyLabel, analyticsDescription, functionalDescription, marketingDescription, position, standalone, className, style, ...rest }: {
|
|
37
|
+
export default function AppConsentBanner({ heading, description, policyHref, policyLabel, analyticsDescription, functionalDescription, marketingDescription, categories, position, standalone, className, style, ...rest }: {
|
|
37
38
|
heading?: string;
|
|
38
39
|
description?: string;
|
|
39
40
|
policyHref?: string;
|
|
@@ -41,6 +42,7 @@ export default function AppConsentBanner({ heading, description, policyHref, pol
|
|
|
41
42
|
analyticsDescription?: string;
|
|
42
43
|
functionalDescription?: string;
|
|
43
44
|
marketingDescription?: string;
|
|
45
|
+
categories?: Array<"analytics" | "functional" | "marketing">;
|
|
44
46
|
position?: "bottom-left" | "bottom-right";
|
|
45
47
|
standalone?: boolean;
|
|
46
48
|
className?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webority/ui-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.59.0",
|
|
4
4
|
"description": "Webority shared React component library — App* primitives on react-bootstrap + the @webority/theme design system.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"type": "module",
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
},
|
|
28
28
|
"sideEffects": false,
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@webority/theme": "0.
|
|
31
|
-
"@webority/ui-elements": "0.
|
|
30
|
+
"@webority/theme": "0.59.0",
|
|
31
|
+
"@webority/ui-elements": "0.59.0"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"@webority/analytics": "^0.
|
|
34
|
+
"@webority/analytics": "^0.22.0",
|
|
35
35
|
"bootstrap": "5.3.3",
|
|
36
36
|
"react": "^19.0.0",
|
|
37
37
|
"react-bootstrap": "^2.10.0",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@types/react": "^19.2.17",
|
|
46
46
|
"@vitejs/plugin-react": "^6.0.1",
|
|
47
47
|
"@vitest/coverage-v8": "5.0.1",
|
|
48
|
-
"@webority/analytics": "0.
|
|
48
|
+
"@webority/analytics": "0.22.0",
|
|
49
49
|
"bootstrap": "5.3.3",
|
|
50
50
|
"jsdom": "30.1.1",
|
|
51
51
|
"react": "^19.2.6",
|