@uninspired/cookie-banner 0.0.6 → 0.0.7
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/dist/components/Banner/Banner.js +2 -2
- package/dist/react/index.cjs +25 -22
- package/dist/react/index.js +20 -17
- package/dist/script/index.cjs +1 -1
- package/dist/script/index.js +40 -40
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "preact/jsx-runtime";
|
|
2
2
|
import { useMemo, useState } from "react";
|
|
3
3
|
import { cls, clx } from "../../utils/classes";
|
|
4
4
|
import { Button } from "../Button";
|
|
@@ -20,7 +20,7 @@ const BannerContent = ({ noTarget = true, heading = "We use cookies.", subheadin
|
|
|
20
20
|
[classes.open]: settingsOpen,
|
|
21
21
|
}) })] }) })] }), _jsx(CollapsibleContent, { className: clx({
|
|
22
22
|
[classes.settings]: true,
|
|
23
|
-
}), children: _jsx(AccordionRoot, { type: "single", collapsible: true, value: openItem, onValueChange: setOpenItem, children: items.map((item) => (_jsx(BannerItem, { ...item, openItem: openItem }, item.value))) }) }), _jsxs("div", { className: classes.footer, children: [_jsx("div", { className: classes.legal, children: privacyPolicy && (_jsx(Text, { size: "caption", children: _jsx("a", { href: privacyPolicy.url, target: "_blank", children: privacyPolicy.label }) })) }), _jsxs("div", { className: classes.actions, children: [_jsx(DialogClose, { asChild: true, children: _jsx(Button, { variant: "neutral", onClick: () => onDeclineAll(), children: declineLabel }) }), _jsx(DialogClose, { asChild: true, children: _jsx(Button, { variant: "brand", onClick: () => onSave(), children: saveLabel }) })] })] })] }) }) }));
|
|
23
|
+
}), children: _jsx(AccordionRoot, { type: "single", collapsible: true, value: openItem, onValueChange: setOpenItem, children: _jsx(_Fragment, { children: items.map((item) => (_jsx(BannerItem, { ...item, openItem: openItem }, item.value))) }) }) }), _jsxs("div", { className: classes.footer, children: [_jsx("div", { className: classes.legal, children: privacyPolicy && (_jsx(Text, { size: "caption", children: _jsx("a", { href: privacyPolicy.url, target: "_blank", children: privacyPolicy.label }) })) }), _jsxs("div", { className: classes.actions, children: [_jsx(DialogClose, { asChild: true, children: _jsx(Button, { variant: "neutral", onClick: () => onDeclineAll(), children: declineLabel }) }), _jsx(DialogClose, { asChild: true, children: _jsx(Button, { variant: "brand", onClick: () => onSave(), children: saveLabel }) })] })] })] }) }) }));
|
|
24
24
|
};
|
|
25
25
|
export const Banner = ({ localStorageKey = "cb-selection", items, ...rest }) => {
|
|
26
26
|
const selectionItems = useMemo(() => items
|
package/dist/react/index.cjs
CHANGED
|
@@ -5,12 +5,12 @@ const ReactDOM = require("react-dom");
|
|
|
5
5
|
function _interopNamespaceDefault(e) {
|
|
6
6
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
7
7
|
if (e) {
|
|
8
|
-
for (const
|
|
9
|
-
if (
|
|
10
|
-
const d = Object.getOwnPropertyDescriptor(e,
|
|
11
|
-
Object.defineProperty(n,
|
|
8
|
+
for (const k2 in e) {
|
|
9
|
+
if (k2 !== "default") {
|
|
10
|
+
const d = Object.getOwnPropertyDescriptor(e, k2);
|
|
11
|
+
Object.defineProperty(n, k2, d.get ? d : {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: () => e[
|
|
13
|
+
get: () => e[k2]
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -21,6 +21,9 @@ function _interopNamespaceDefault(e) {
|
|
|
21
21
|
const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
|
|
22
22
|
const ReactDOM__namespace = /* @__PURE__ */ _interopNamespaceDefault(ReactDOM);
|
|
23
23
|
var l;
|
|
24
|
+
function k(n) {
|
|
25
|
+
return n.children;
|
|
26
|
+
}
|
|
24
27
|
l = { __e: function(n, l2, u2, t) {
|
|
25
28
|
for (var i, r, o; l2 = l2.__; ) if ((i = l2.__c) && !i.__) try {
|
|
26
29
|
if ((r = i.constructor) && null != r.getDerivedStateFromError && (i.setState(r.getDerivedStateFromError(n)), o = i.__d), null != i.componentDidCatch && (i.componentDidCatch(n, t || {}), o = i.__d), o) return i.__E = i;
|
|
@@ -155,9 +158,9 @@ function $constructor(name, initializer2, params) {
|
|
|
155
158
|
const proto = _.prototype;
|
|
156
159
|
const keys = Object.keys(proto);
|
|
157
160
|
for (let i = 0; i < keys.length; i++) {
|
|
158
|
-
const
|
|
159
|
-
if (!(
|
|
160
|
-
inst[
|
|
161
|
+
const k2 = keys[i];
|
|
162
|
+
if (!(k2 in inst)) {
|
|
163
|
+
inst[k2] = proto[k2].bind(inst);
|
|
161
164
|
}
|
|
162
165
|
}
|
|
163
166
|
}
|
|
@@ -273,8 +276,8 @@ function normalizeParams(_params) {
|
|
|
273
276
|
return {};
|
|
274
277
|
}
|
|
275
278
|
function optionalKeys(shape) {
|
|
276
|
-
return Object.keys(shape).filter((
|
|
277
|
-
return shape[
|
|
279
|
+
return Object.keys(shape).filter((k2) => {
|
|
280
|
+
return shape[k2]._zod.optin === "optional" && shape[k2]._zod.optout === "optional";
|
|
278
281
|
});
|
|
279
282
|
}
|
|
280
283
|
function aborted(x, startIndex = 0) {
|
|
@@ -557,9 +560,9 @@ function handlePropertyResult(result, final, key, input, isOptionalOut) {
|
|
|
557
560
|
}
|
|
558
561
|
function normalizeDef(def) {
|
|
559
562
|
const keys = Object.keys(def.shape);
|
|
560
|
-
for (const
|
|
561
|
-
if (!def.shape?.[
|
|
562
|
-
throw new Error(`Invalid element at key "${
|
|
563
|
+
for (const k2 of keys) {
|
|
564
|
+
if (!def.shape?.[k2]?._zod?.traits?.has("$ZodType")) {
|
|
565
|
+
throw new Error(`Invalid element at key "${k2}": expected a Zod schema`);
|
|
563
566
|
}
|
|
564
567
|
}
|
|
565
568
|
const okeys = optionalKeys(def.shape);
|
|
@@ -744,11 +747,11 @@ const $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUn
|
|
|
744
747
|
const pv = option._zod.propValues;
|
|
745
748
|
if (!pv || Object.keys(pv).length === 0)
|
|
746
749
|
throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(option)}"`);
|
|
747
|
-
for (const [
|
|
748
|
-
if (!propValues[
|
|
749
|
-
propValues[
|
|
750
|
+
for (const [k2, v] of Object.entries(pv)) {
|
|
751
|
+
if (!propValues[k2])
|
|
752
|
+
propValues[k2] = /* @__PURE__ */ new Set();
|
|
750
753
|
for (const val of v) {
|
|
751
|
-
propValues[
|
|
754
|
+
propValues[k2].add(val);
|
|
752
755
|
}
|
|
753
756
|
}
|
|
754
757
|
}
|
|
@@ -1107,7 +1110,7 @@ var hasRequiredReactJsxRuntime_production_min;
|
|
|
1107
1110
|
function requireReactJsxRuntime_production_min() {
|
|
1108
1111
|
if (hasRequiredReactJsxRuntime_production_min) return reactJsxRuntime_production_min;
|
|
1109
1112
|
hasRequiredReactJsxRuntime_production_min = 1;
|
|
1110
|
-
var f2 = React,
|
|
1113
|
+
var f2 = React, k2 = /* @__PURE__ */ Symbol.for("react.element"), l2 = /* @__PURE__ */ Symbol.for("react.fragment"), m = Object.prototype.hasOwnProperty, n = f2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, p = { key: true, ref: true, __self: true, __source: true };
|
|
1111
1114
|
function q(c, a, g) {
|
|
1112
1115
|
var b, d = {}, e = null, h = null;
|
|
1113
1116
|
void 0 !== g && (e = "" + g);
|
|
@@ -1115,7 +1118,7 @@ function requireReactJsxRuntime_production_min() {
|
|
|
1115
1118
|
void 0 !== a.ref && (h = a.ref);
|
|
1116
1119
|
for (b in a) m.call(a, b) && !p.hasOwnProperty(b) && (d[b] = a[b]);
|
|
1117
1120
|
if (c && c.defaultProps) for (b in a = c.defaultProps, a) void 0 === d[b] && (d[b] = a[b]);
|
|
1118
|
-
return { $$typeof:
|
|
1121
|
+
return { $$typeof: k2, type: c, key: e, ref: h, props: d, _owner: n.current };
|
|
1119
1122
|
}
|
|
1120
1123
|
reactJsxRuntime_production_min.Fragment = l2;
|
|
1121
1124
|
reactJsxRuntime_production_min.jsx = q;
|
|
@@ -1952,8 +1955,8 @@ function requireReactJsxRuntime_development() {
|
|
|
1952
1955
|
{
|
|
1953
1956
|
if (hasOwnProperty.call(props, "key")) {
|
|
1954
1957
|
var componentName = getComponentNameFromType(type);
|
|
1955
|
-
var keys = Object.keys(props).filter(function(
|
|
1956
|
-
return
|
|
1958
|
+
var keys = Object.keys(props).filter(function(k2) {
|
|
1959
|
+
return k2 !== "key";
|
|
1957
1960
|
});
|
|
1958
1961
|
var beforeExample = keys.length > 0 ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
1959
1962
|
if (!didWarnAboutKeySpread[componentName + beforeExample]) {
|
|
@@ -4950,7 +4953,7 @@ const BannerContent = ({
|
|
|
4950
4953
|
collapsible: true,
|
|
4951
4954
|
value: openItem,
|
|
4952
4955
|
onValueChange: setOpenItem,
|
|
4953
|
-
children: items.map((item) => /* @__PURE__ */ u(BannerItem, { ...item, openItem }, item.value))
|
|
4956
|
+
children: /* @__PURE__ */ u(k, { children: items.map((item) => /* @__PURE__ */ u(BannerItem, { ...item, openItem }, item.value)) })
|
|
4954
4957
|
}
|
|
4955
4958
|
)
|
|
4956
4959
|
}
|
package/dist/react/index.js
CHANGED
|
@@ -2,6 +2,9 @@ import * as React from "react";
|
|
|
2
2
|
import React__default, { forwardRef, createElement, useMemo, useState, useEffect, useCallback, useContext, createContext } from "react";
|
|
3
3
|
import * as ReactDOM from "react-dom";
|
|
4
4
|
var l;
|
|
5
|
+
function k(n) {
|
|
6
|
+
return n.children;
|
|
7
|
+
}
|
|
5
8
|
l = { __e: function(n, l2, u2, t) {
|
|
6
9
|
for (var i, r, o; l2 = l2.__; ) if ((i = l2.__c) && !i.__) try {
|
|
7
10
|
if ((r = i.constructor) && null != r.getDerivedStateFromError && (i.setState(r.getDerivedStateFromError(n)), o = i.__d), null != i.componentDidCatch && (i.componentDidCatch(n, t || {}), o = i.__d), o) return i.__E = i;
|
|
@@ -136,9 +139,9 @@ function $constructor(name, initializer2, params) {
|
|
|
136
139
|
const proto = _.prototype;
|
|
137
140
|
const keys = Object.keys(proto);
|
|
138
141
|
for (let i = 0; i < keys.length; i++) {
|
|
139
|
-
const
|
|
140
|
-
if (!(
|
|
141
|
-
inst[
|
|
142
|
+
const k2 = keys[i];
|
|
143
|
+
if (!(k2 in inst)) {
|
|
144
|
+
inst[k2] = proto[k2].bind(inst);
|
|
142
145
|
}
|
|
143
146
|
}
|
|
144
147
|
}
|
|
@@ -254,8 +257,8 @@ function normalizeParams(_params) {
|
|
|
254
257
|
return {};
|
|
255
258
|
}
|
|
256
259
|
function optionalKeys(shape) {
|
|
257
|
-
return Object.keys(shape).filter((
|
|
258
|
-
return shape[
|
|
260
|
+
return Object.keys(shape).filter((k2) => {
|
|
261
|
+
return shape[k2]._zod.optin === "optional" && shape[k2]._zod.optout === "optional";
|
|
259
262
|
});
|
|
260
263
|
}
|
|
261
264
|
function aborted(x, startIndex = 0) {
|
|
@@ -538,9 +541,9 @@ function handlePropertyResult(result, final, key, input, isOptionalOut) {
|
|
|
538
541
|
}
|
|
539
542
|
function normalizeDef(def) {
|
|
540
543
|
const keys = Object.keys(def.shape);
|
|
541
|
-
for (const
|
|
542
|
-
if (!def.shape?.[
|
|
543
|
-
throw new Error(`Invalid element at key "${
|
|
544
|
+
for (const k2 of keys) {
|
|
545
|
+
if (!def.shape?.[k2]?._zod?.traits?.has("$ZodType")) {
|
|
546
|
+
throw new Error(`Invalid element at key "${k2}": expected a Zod schema`);
|
|
544
547
|
}
|
|
545
548
|
}
|
|
546
549
|
const okeys = optionalKeys(def.shape);
|
|
@@ -725,11 +728,11 @@ const $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUn
|
|
|
725
728
|
const pv = option._zod.propValues;
|
|
726
729
|
if (!pv || Object.keys(pv).length === 0)
|
|
727
730
|
throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(option)}"`);
|
|
728
|
-
for (const [
|
|
729
|
-
if (!propValues[
|
|
730
|
-
propValues[
|
|
731
|
+
for (const [k2, v] of Object.entries(pv)) {
|
|
732
|
+
if (!propValues[k2])
|
|
733
|
+
propValues[k2] = /* @__PURE__ */ new Set();
|
|
731
734
|
for (const val of v) {
|
|
732
|
-
propValues[
|
|
735
|
+
propValues[k2].add(val);
|
|
733
736
|
}
|
|
734
737
|
}
|
|
735
738
|
}
|
|
@@ -1088,7 +1091,7 @@ var hasRequiredReactJsxRuntime_production_min;
|
|
|
1088
1091
|
function requireReactJsxRuntime_production_min() {
|
|
1089
1092
|
if (hasRequiredReactJsxRuntime_production_min) return reactJsxRuntime_production_min;
|
|
1090
1093
|
hasRequiredReactJsxRuntime_production_min = 1;
|
|
1091
|
-
var f2 = React__default,
|
|
1094
|
+
var f2 = React__default, k2 = /* @__PURE__ */ Symbol.for("react.element"), l2 = /* @__PURE__ */ Symbol.for("react.fragment"), m = Object.prototype.hasOwnProperty, n = f2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, p = { key: true, ref: true, __self: true, __source: true };
|
|
1092
1095
|
function q(c, a, g) {
|
|
1093
1096
|
var b, d = {}, e = null, h = null;
|
|
1094
1097
|
void 0 !== g && (e = "" + g);
|
|
@@ -1096,7 +1099,7 @@ function requireReactJsxRuntime_production_min() {
|
|
|
1096
1099
|
void 0 !== a.ref && (h = a.ref);
|
|
1097
1100
|
for (b in a) m.call(a, b) && !p.hasOwnProperty(b) && (d[b] = a[b]);
|
|
1098
1101
|
if (c && c.defaultProps) for (b in a = c.defaultProps, a) void 0 === d[b] && (d[b] = a[b]);
|
|
1099
|
-
return { $$typeof:
|
|
1102
|
+
return { $$typeof: k2, type: c, key: e, ref: h, props: d, _owner: n.current };
|
|
1100
1103
|
}
|
|
1101
1104
|
reactJsxRuntime_production_min.Fragment = l2;
|
|
1102
1105
|
reactJsxRuntime_production_min.jsx = q;
|
|
@@ -1933,8 +1936,8 @@ function requireReactJsxRuntime_development() {
|
|
|
1933
1936
|
{
|
|
1934
1937
|
if (hasOwnProperty.call(props, "key")) {
|
|
1935
1938
|
var componentName = getComponentNameFromType(type);
|
|
1936
|
-
var keys = Object.keys(props).filter(function(
|
|
1937
|
-
return
|
|
1939
|
+
var keys = Object.keys(props).filter(function(k2) {
|
|
1940
|
+
return k2 !== "key";
|
|
1938
1941
|
});
|
|
1939
1942
|
var beforeExample = keys.length > 0 ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
1940
1943
|
if (!didWarnAboutKeySpread[componentName + beforeExample]) {
|
|
@@ -4931,7 +4934,7 @@ const BannerContent = ({
|
|
|
4931
4934
|
collapsible: true,
|
|
4932
4935
|
value: openItem,
|
|
4933
4936
|
onValueChange: setOpenItem,
|
|
4934
|
-
children: items.map((item) => /* @__PURE__ */ u(BannerItem, { ...item, openItem }, item.value))
|
|
4937
|
+
children: /* @__PURE__ */ u(k, { children: items.map((item) => /* @__PURE__ */ u(BannerItem, { ...item, openItem }, item.value)) })
|
|
4935
4938
|
}
|
|
4936
4939
|
)
|
|
4937
4940
|
}
|
package/dist/script/index.cjs
CHANGED
|
@@ -42,4 +42,4 @@
|
|
|
42
42
|
|
|
43
43
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
44
44
|
|
|
45
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return P(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Kc="DialogDescriptionWarning",qc=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Xr(Kc).contentName}}.`;return P(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Gc=jr,Yc=Br,Xc=Zr,Jc=Kr,bn=Gr;const Qc=({noTarget:e=!0,heading:t="We use cookies.",subheading:n="Please define your selection below.",selectLabel:r="Select",hideLabel:o="Hide",saveLabel:i="Save selection",declineLabel:c="Decline all",defaultSettingsOpen:s=!0,privacyPolicy:a,items:u})=>{const{onSave:l,onDeclineAll:d,selectionTaken:_}=Sr(),[g,y]=I(void 0),[f,v]=I(s);return p(Gc,{open:!_,children:p(Yc,{className:Ot(F.root,e?F.noTarget:""),children:p(rr,{open:f,onOpenChange:v,className:F.collapsible,children:[p("div",{className:F.header,children:[p("div",{className:F.heading,children:[p(Xc,{asChild:!0,children:p(te,{weight:"bold",children:t})}),p(Jc,{asChild:!0,children:p(te,{size:"caption",color:"muted",children:n})})]}),p(or,{asChild:!0,children:p(nt,{variant:"ghost",children:[f?o:r," ",p(Cs,{size:12,className:ft({[F.chevron]:!0,[F.open]:f})})]})})]}),p(ir,{className:ft({[F.settings]:!0}),children:p(ls,{type:"single",collapsible:!0,value:g,onValueChange:y,children:u.map(m=>p(Ms,{...m,openItem:g},m.value))})}),p("div",{className:F.footer,children:[p("div",{className:F.legal,children:a&&p(te,{size:"caption",children:p("a",{href:a.url,target:"_blank",children:a.label})})}),p("div",{className:F.actions,children:[p(bn,{asChild:!0,children:p(nt,{variant:"neutral",onClick:()=>d(),children:c})}),p(bn,{asChild:!0,children:p(nt,{variant:"brand",onClick:()=>l(),children:i})})]})]})]})})})},ea=({localStorageKey:e="cb-selection",items:t,...n})=>{const r=D(()=>t.filter(o=>!o.required).map(o=>({value:o.value,script:o.script,defaultSelected:o.defaultSelected,required:o.required})),[t]);return p(xs,{items:r,localStorageKey:e,children:p(Qc,{items:t,...n})})};function ta(e,t){const n=t===void 0;let r;if(typeof t=="string"){const o=document.querySelector(t);if(!o)throw new Error(`Element with selector "${t}" not found`);r=o}else r=t;h.render(p(ea,{noTarget:n,...e}),r??document.body)}exports.mountBanner=ta;
|
|
45
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return P(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Kc="DialogDescriptionWarning",qc=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Xr(Kc).contentName}}.`;return P(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Gc=jr,Yc=Br,Xc=Zr,Jc=Kr,bn=Gr;const Qc=({noTarget:e=!0,heading:t="We use cookies.",subheading:n="Please define your selection below.",selectLabel:r="Select",hideLabel:o="Hide",saveLabel:i="Save selection",declineLabel:c="Decline all",defaultSettingsOpen:s=!0,privacyPolicy:a,items:u})=>{const{onSave:l,onDeclineAll:d,selectionTaken:_}=Sr(),[g,y]=I(void 0),[f,v]=I(s);return p(Gc,{open:!_,children:p(Yc,{className:Ot(F.root,e?F.noTarget:""),children:p(rr,{open:f,onOpenChange:v,className:F.collapsible,children:[p("div",{className:F.header,children:[p("div",{className:F.heading,children:[p(Xc,{asChild:!0,children:p(te,{weight:"bold",children:t})}),p(Jc,{asChild:!0,children:p(te,{size:"caption",color:"muted",children:n})})]}),p(or,{asChild:!0,children:p(nt,{variant:"ghost",children:[f?o:r," ",p(Cs,{size:12,className:ft({[F.chevron]:!0,[F.open]:f})})]})})]}),p(ir,{className:ft({[F.settings]:!0}),children:p(ls,{type:"single",collapsible:!0,value:g,onValueChange:y,children:p(h.Fragment,{children:u.map(m=>p(Ms,{...m,openItem:g},m.value))})})}),p("div",{className:F.footer,children:[p("div",{className:F.legal,children:a&&p(te,{size:"caption",children:p("a",{href:a.url,target:"_blank",children:a.label})})}),p("div",{className:F.actions,children:[p(bn,{asChild:!0,children:p(nt,{variant:"neutral",onClick:()=>d(),children:c})}),p(bn,{asChild:!0,children:p(nt,{variant:"brand",onClick:()=>l(),children:i})})]})]})]})})})},ea=({localStorageKey:e="cb-selection",items:t,...n})=>{const r=D(()=>t.filter(o=>!o.required).map(o=>({value:o.value,script:o.script,defaultSelected:o.defaultSelected,required:o.required})),[t]);return p(xs,{items:r,localStorageKey:e,children:p(Qc,{items:t,...n})})};function ta(e,t){const n=t===void 0;let r;if(typeof t=="string"){const o=document.querySelector(t);if(!o)throw new Error(`Element with selector "${t}" not found`);r=o}else r=t;h.render(p(ea,{noTarget:n,...e}),r??document.body)}exports.mountBanner=ta;
|
package/dist/script/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { options as z, Fragment as
|
|
1
|
+
import { options as z, Fragment as F, Component as se, createRef as On, createContext as ee, createElement as T, toChildArray as Q, cloneElement as io, render as Ae, hydrate as so } from "preact";
|
|
2
2
|
var co = 0;
|
|
3
3
|
function p(e, t, n, r, o, i) {
|
|
4
4
|
t || (t = {});
|
|
@@ -332,8 +332,8 @@ z.unmount = function(e) {
|
|
|
332
332
|
}
|
|
333
333
|
this.__b = null;
|
|
334
334
|
}
|
|
335
|
-
var o = t.__a && T(
|
|
336
|
-
return o && (o.__u &= -33), [T(
|
|
335
|
+
var o = t.__a && T(F, null, e.fallback);
|
|
336
|
+
return o && (o.__u &= -33), [T(F, null, t.__a ? null : e.children), o];
|
|
337
337
|
};
|
|
338
338
|
var en = function(e, t, n) {
|
|
339
339
|
if (++n[1] === n[0] && e.l.delete(t), e.props.revealOrder && (e.props.revealOrder[0] !== "t" || !e.l.size)) for (n = e.i; n; ) {
|
|
@@ -455,7 +455,7 @@ function G(e) {
|
|
|
455
455
|
return !!e && e.$$typeof === $n;
|
|
456
456
|
}
|
|
457
457
|
function Wn(e) {
|
|
458
|
-
return G(e) && e.type ===
|
|
458
|
+
return G(e) && e.type === F;
|
|
459
459
|
}
|
|
460
460
|
function Bn(e) {
|
|
461
461
|
return !!e && typeof e.displayName == "string" && e.displayName.startsWith("Memo(");
|
|
@@ -473,12 +473,12 @@ var Vn = function(e, t) {
|
|
|
473
473
|
return e(t);
|
|
474
474
|
}, kt = function(e, t) {
|
|
475
475
|
return e(t);
|
|
476
|
-
}, Kn =
|
|
476
|
+
}, Kn = F, qn = G, I = { useState: R, useId: Et, useReducer: Te, useEffect: E, useLayoutEffect: te, useInsertionEffect: It, useTransition: Rt, useDeferredValue: At, useSyncExternalStore: Nt, startTransition: Ot, useRef: w, useImperativeHandle: wt, useMemo: D, useCallback: M, useContext: Y, useDebugValue: St, version: "18.3.1", Children: K, render: Ln, hydrate: Fn, unmountComponentAtNode: Hn, createPortal: zn, createElement: T, createContext: ee, createFactory: jn, cloneElement: ge, createRef: On, Fragment: F, isValidElement: G, isElement: qn, isFragment: Wn, isMemo: Bn, findDOMNode: Zn, Component: se, PureComponent: Ve, memo: Tn, forwardRef: P, flushSync: kt, unstable_batchedUpdates: Vn, StrictMode: Kn, Suspense: Pe, SuspenseList: _e, lazy: Mn, __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: Un };
|
|
477
477
|
const Gn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
478
478
|
__proto__: null,
|
|
479
479
|
Children: K,
|
|
480
480
|
Component: se,
|
|
481
|
-
Fragment:
|
|
481
|
+
Fragment: F,
|
|
482
482
|
PureComponent: Ve,
|
|
483
483
|
StrictMode: Kn,
|
|
484
484
|
Suspense: Pe,
|
|
@@ -561,7 +561,7 @@ const No = "_root_hw69b_1", Oo = "_neutral_hw69b_17", Ao = "_brand_hw69b_30", Ro
|
|
|
561
561
|
...o
|
|
562
562
|
}
|
|
563
563
|
)
|
|
564
|
-
), zo = "_root_1wsw7_42", $o = "_noTarget_1wsw7_53", Lo = "_collapsible_1wsw7_62", Fo = "_header_1wsw7_65", Uo = "_heading_1wsw7_72", jo = "_chevron_1wsw7_78", Wo = "_open_1wsw7_83", Bo = "_settings_1wsw7_89", Ho = "_footer_1wsw7_103", Zo = "_legal_1wsw7_110", Vo = "_actions_1wsw7_113",
|
|
564
|
+
), zo = "_root_1wsw7_42", $o = "_noTarget_1wsw7_53", Lo = "_collapsible_1wsw7_62", Fo = "_header_1wsw7_65", Uo = "_heading_1wsw7_72", jo = "_chevron_1wsw7_78", Wo = "_open_1wsw7_83", Bo = "_settings_1wsw7_89", Ho = "_footer_1wsw7_103", Zo = "_legal_1wsw7_110", Vo = "_actions_1wsw7_113", j = {
|
|
565
565
|
root: zo,
|
|
566
566
|
noTarget: $o,
|
|
567
567
|
collapsible: Lo,
|
|
@@ -1356,7 +1356,7 @@ function Wi(e) {
|
|
|
1356
1356
|
const { children: o, ...i } = n;
|
|
1357
1357
|
if (G(o)) {
|
|
1358
1358
|
const c = Vi(o), s = Zi(i, o.props);
|
|
1359
|
-
return o.type !==
|
|
1359
|
+
return o.type !== F && (s.ref = r ? or(r, c) : c), ge(o, s);
|
|
1360
1360
|
}
|
|
1361
1361
|
return K.count(o) > 1 ? K.only(null) : null;
|
|
1362
1362
|
});
|
|
@@ -1423,7 +1423,7 @@ function Ki(e) {
|
|
|
1423
1423
|
r
|
|
1424
1424
|
];
|
|
1425
1425
|
}
|
|
1426
|
-
function
|
|
1426
|
+
function W(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
|
|
1427
1427
|
return function(o) {
|
|
1428
1428
|
if (e?.(o), n === !1 || !o.defaultPrevented)
|
|
1429
1429
|
return t?.(o);
|
|
@@ -1628,7 +1628,7 @@ var cr = "CollapsibleTrigger", ar = P(
|
|
|
1628
1628
|
disabled: o.disabled,
|
|
1629
1629
|
...r,
|
|
1630
1630
|
ref: t,
|
|
1631
|
-
onClick:
|
|
1631
|
+
onClick: W(e.onClick, o.onOpenToggle)
|
|
1632
1632
|
}
|
|
1633
1633
|
);
|
|
1634
1634
|
}
|
|
@@ -1752,9 +1752,9 @@ var [_r, fs] = tt(B), [vr, ps] = tt(
|
|
|
1752
1752
|
);
|
|
1753
1753
|
}), [hs, nt] = tt(B), hr = I.forwardRef(
|
|
1754
1754
|
(e, t) => {
|
|
1755
|
-
const { __scopeAccordion: n, disabled: r, dir: o, orientation: i = "vertical", ...c } = e, s = I.useRef(null), a = L(s, t), u = ls(n), d = as(o) === "ltr", _ =
|
|
1755
|
+
const { __scopeAccordion: n, disabled: r, dir: o, orientation: i = "vertical", ...c } = e, s = I.useRef(null), a = L(s, t), u = ls(n), d = as(o) === "ltr", _ = W(e.onKeyDown, (m) => {
|
|
1756
1756
|
if (!us.includes(m.key)) return;
|
|
1757
|
-
const g = m.target, f = u().filter((
|
|
1757
|
+
const g = m.target, f = u().filter((U) => !U.ref.current?.disabled), v = f.findIndex((U) => U.ref.current === g), h = f.length;
|
|
1758
1758
|
if (v === -1) return;
|
|
1759
1759
|
m.preventDefault();
|
|
1760
1760
|
let y = v;
|
|
@@ -2026,7 +2026,7 @@ var rt = "Switch", [Ds] = ke(rt), [xs, Ms] = Ds(rt), Pr = P(
|
|
|
2026
2026
|
value: a,
|
|
2027
2027
|
...d,
|
|
2028
2028
|
ref: g,
|
|
2029
|
-
onClick:
|
|
2029
|
+
onClick: W(e.onClick, (b) => {
|
|
2030
2030
|
y((C) => !C), v && (f.current = b.isPropagationStopped(), f.current || b.stopPropagation());
|
|
2031
2031
|
})
|
|
2032
2032
|
}
|
|
@@ -2305,11 +2305,11 @@ var Vs = "DismissableLayer", bt = "dismissableLayer.update", Ks = "dismissableLa
|
|
|
2305
2305
|
onDismiss: s,
|
|
2306
2306
|
...a
|
|
2307
2307
|
} = e, u = Y(kr), [l, d] = R(null), _ = l?.ownerDocument ?? globalThis?.document, [, m] = R({}), g = L(t, (S) => d(S)), f = Array.from(u.layers), [v] = [...u.layersWithOutsidePointerEventsDisabled].slice(-1), h = f.indexOf(v), y = l ? f.indexOf(l) : -1, b = u.layersWithOutsidePointerEventsDisabled.size > 0, C = y >= h, O = Xs((S) => {
|
|
2308
|
-
const
|
|
2308
|
+
const U = S.target, le = [...u.branches].some((we) => we.contains(U));
|
|
2309
2309
|
!C || le || (o?.(S), c?.(S), S.defaultPrevented || s?.());
|
|
2310
2310
|
}, _), k = Js((S) => {
|
|
2311
|
-
const
|
|
2312
|
-
[...u.branches].some((we) => we.contains(
|
|
2311
|
+
const U = S.target;
|
|
2312
|
+
[...u.branches].some((we) => we.contains(U)) || (i?.(S), c?.(S), S.defaultPrevented || s?.());
|
|
2313
2313
|
}, _);
|
|
2314
2314
|
return Zs((S) => {
|
|
2315
2315
|
y === u.layers.size - 1 && (r?.(S), !S.defaultPrevented && s && (S.preventDefault(), s()));
|
|
@@ -2332,9 +2332,9 @@ var Vs = "DismissableLayer", bt = "dismissableLayer.update", Ks = "dismissableLa
|
|
|
2332
2332
|
pointerEvents: b ? C ? "auto" : "none" : void 0,
|
|
2333
2333
|
...e.style
|
|
2334
2334
|
},
|
|
2335
|
-
onFocusCapture:
|
|
2336
|
-
onBlurCapture:
|
|
2337
|
-
onPointerDownCapture:
|
|
2335
|
+
onFocusCapture: W(e.onFocusCapture, k.onFocusCapture),
|
|
2336
|
+
onBlurCapture: W(e.onBlurCapture, k.onBlurCapture),
|
|
2337
|
+
onPointerDownCapture: W(
|
|
2338
2338
|
e.onPointerDownCapture,
|
|
2339
2339
|
O.onPointerDownCapture
|
|
2340
2340
|
)
|
|
@@ -2698,7 +2698,7 @@ var Fr = vc(), pt = function() {
|
|
|
2698
2698
|
onTouchMoveCapture: pt
|
|
2699
2699
|
}), o = r[0], i = r[1], c = e.forwardProps, s = e.children, a = e.className, u = e.removeScrollBar, l = e.enabled, d = e.shards, _ = e.sideCar, m = e.noRelative, g = e.noIsolation, f = e.inert, v = e.allowPinchZoom, h = e.as, y = h === void 0 ? "div" : h, b = e.gapMode, C = $r(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), O = _, k = fc([n, t]), S = H(H({}, C), o);
|
|
2700
2700
|
return T(
|
|
2701
|
-
|
|
2701
|
+
F,
|
|
2702
2702
|
null,
|
|
2703
2703
|
l && T(O, { sideCar: Fr, removeScrollBar: u, shards: d, noRelative: m, noIsolation: g, inert: f, setCallbacks: i, allowPinchZoom: !!v, lockRef: n, gapMode: b }),
|
|
2704
2704
|
c ? ge(K.only(s), H(H({}, S), { ref: k })) : T(y, H({}, S, { className: a, ref: k }), s)
|
|
@@ -2950,7 +2950,7 @@ function Uc(e) {
|
|
|
2950
2950
|
var h = Ue(f), y = n.current, b = "deltaX" in f ? f.deltaX : y[0] - h[0], C = "deltaY" in f ? f.deltaY : y[1] - h[1], O, k = f.target, S = Math.abs(b) > Math.abs(C) ? "h" : "v";
|
|
2951
2951
|
if ("touches" in f && S === "h" && k.type === "range")
|
|
2952
2952
|
return !1;
|
|
2953
|
-
var
|
|
2953
|
+
var U = window.getSelection(), le = U && U.anchorNode, we = le ? le === k || le.contains(k) : !1;
|
|
2954
2954
|
if (we)
|
|
2955
2955
|
return !1;
|
|
2956
2956
|
var xe = Sn(S, k);
|
|
@@ -3006,7 +3006,7 @@ function Uc(e) {
|
|
|
3006
3006
|
}, []);
|
|
3007
3007
|
var m = e.removeScrollBar, g = e.inert;
|
|
3008
3008
|
return T(
|
|
3009
|
-
|
|
3009
|
+
F,
|
|
3010
3010
|
null,
|
|
3011
3011
|
g ? T(i, { styles: Lc(o) }) : null,
|
|
3012
3012
|
m ? T(Rc, { noRelative: e.noRelative, gapMode: e.gapMode }) : null
|
|
@@ -3115,7 +3115,7 @@ var qr = "DialogTrigger", qc = P(
|
|
|
3115
3115
|
"data-state": jt(o.open),
|
|
3116
3116
|
...r,
|
|
3117
3117
|
ref: i,
|
|
3118
|
-
onClick:
|
|
3118
|
+
onClick: W(e.onClick, o.onOpenToggle)
|
|
3119
3119
|
}
|
|
3120
3120
|
);
|
|
3121
3121
|
}
|
|
@@ -3167,14 +3167,14 @@ var Qc = P(
|
|
|
3167
3167
|
ref: o,
|
|
3168
3168
|
trapFocus: n.open,
|
|
3169
3169
|
disableOutsidePointerEvents: !0,
|
|
3170
|
-
onCloseAutoFocus:
|
|
3170
|
+
onCloseAutoFocus: W(e.onCloseAutoFocus, (i) => {
|
|
3171
3171
|
i.preventDefault(), n.triggerRef.current?.focus();
|
|
3172
3172
|
}),
|
|
3173
|
-
onPointerDownOutside:
|
|
3173
|
+
onPointerDownOutside: W(e.onPointerDownOutside, (i) => {
|
|
3174
3174
|
const c = i.detail.originalEvent, s = c.button === 0 && c.ctrlKey === !0;
|
|
3175
3175
|
(c.button === 2 || s) && i.preventDefault();
|
|
3176
3176
|
}),
|
|
3177
|
-
onFocusOutside:
|
|
3177
|
+
onFocusOutside: W(
|
|
3178
3178
|
e.onFocusOutside,
|
|
3179
3179
|
(i) => i.preventDefault()
|
|
3180
3180
|
)
|
|
@@ -3205,7 +3205,7 @@ var Qc = P(
|
|
|
3205
3205
|
), Xr = P(
|
|
3206
3206
|
(e, t) => {
|
|
3207
3207
|
const { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: o, onCloseAutoFocus: i, ...c } = e, s = V(ce, n), a = w(null), u = L(t, a);
|
|
3208
|
-
return sc(), /* @__PURE__ */ p(
|
|
3208
|
+
return sc(), /* @__PURE__ */ p(F, { children: [
|
|
3209
3209
|
/* @__PURE__ */ p(
|
|
3210
3210
|
Mr,
|
|
3211
3211
|
{
|
|
@@ -3229,7 +3229,7 @@ var Qc = P(
|
|
|
3229
3229
|
)
|
|
3230
3230
|
}
|
|
3231
3231
|
),
|
|
3232
|
-
/* @__PURE__ */ p(
|
|
3232
|
+
/* @__PURE__ */ p(F, { children: [
|
|
3233
3233
|
/* @__PURE__ */ p(ta, { titleId: s.titleId }),
|
|
3234
3234
|
/* @__PURE__ */ p(ra, { contentRef: a, descriptionId: s.descriptionId })
|
|
3235
3235
|
] })
|
|
@@ -3258,7 +3258,7 @@ var to = "DialogClose", no = P(
|
|
|
3258
3258
|
type: "button",
|
|
3259
3259
|
...r,
|
|
3260
3260
|
ref: t,
|
|
3261
|
-
onClick:
|
|
3261
|
+
onClick: W(e.onClick, () => o.onOpenChange(!1))
|
|
3262
3262
|
}
|
|
3263
3263
|
);
|
|
3264
3264
|
}
|
|
@@ -3303,16 +3303,16 @@ const aa = ({
|
|
|
3303
3303
|
return /* @__PURE__ */ p(oa, { open: !_, children: /* @__PURE__ */ p(
|
|
3304
3304
|
ia,
|
|
3305
3305
|
{
|
|
3306
|
-
className: Dt(
|
|
3306
|
+
className: Dt(j.root, e ? j.noTarget : ""),
|
|
3307
3307
|
children: /* @__PURE__ */ p(
|
|
3308
3308
|
lr,
|
|
3309
3309
|
{
|
|
3310
3310
|
open: f,
|
|
3311
3311
|
onOpenChange: v,
|
|
3312
|
-
className:
|
|
3312
|
+
className: j.collapsible,
|
|
3313
3313
|
children: [
|
|
3314
|
-
/* @__PURE__ */ p("div", { className:
|
|
3315
|
-
/* @__PURE__ */ p("div", { className:
|
|
3314
|
+
/* @__PURE__ */ p("div", { className: j.header, children: [
|
|
3315
|
+
/* @__PURE__ */ p("div", { className: j.heading, children: [
|
|
3316
3316
|
/* @__PURE__ */ p(sa, { asChild: !0, children: /* @__PURE__ */ p(ie, { weight: "bold", children: t }) }),
|
|
3317
3317
|
/* @__PURE__ */ p(ca, { asChild: !0, children: /* @__PURE__ */ p(ie, { size: "caption", color: "muted", children: n }) })
|
|
3318
3318
|
] }),
|
|
@@ -3324,8 +3324,8 @@ const aa = ({
|
|
|
3324
3324
|
{
|
|
3325
3325
|
size: 12,
|
|
3326
3326
|
className: gt({
|
|
3327
|
-
[
|
|
3328
|
-
[
|
|
3327
|
+
[j.chevron]: !0,
|
|
3328
|
+
[j.open]: f
|
|
3329
3329
|
})
|
|
3330
3330
|
}
|
|
3331
3331
|
)
|
|
@@ -3335,7 +3335,7 @@ const aa = ({
|
|
|
3335
3335
|
fr,
|
|
3336
3336
|
{
|
|
3337
3337
|
className: gt({
|
|
3338
|
-
[
|
|
3338
|
+
[j.settings]: !0
|
|
3339
3339
|
}),
|
|
3340
3340
|
children: /* @__PURE__ */ p(
|
|
3341
3341
|
ys,
|
|
@@ -3344,14 +3344,14 @@ const aa = ({
|
|
|
3344
3344
|
collapsible: !0,
|
|
3345
3345
|
value: m,
|
|
3346
3346
|
onValueChange: g,
|
|
3347
|
-
children: u.map((h) => /* @__PURE__ */ p(Hs, { ...h, openItem: m }, h.value))
|
|
3347
|
+
children: /* @__PURE__ */ p(F, { children: u.map((h) => /* @__PURE__ */ p(Hs, { ...h, openItem: m }, h.value)) })
|
|
3348
3348
|
}
|
|
3349
3349
|
)
|
|
3350
3350
|
}
|
|
3351
3351
|
),
|
|
3352
|
-
/* @__PURE__ */ p("div", { className:
|
|
3353
|
-
/* @__PURE__ */ p("div", { className:
|
|
3354
|
-
/* @__PURE__ */ p("div", { className:
|
|
3352
|
+
/* @__PURE__ */ p("div", { className: j.footer, children: [
|
|
3353
|
+
/* @__PURE__ */ p("div", { className: j.legal, children: a && /* @__PURE__ */ p(ie, { size: "caption", children: /* @__PURE__ */ p("a", { href: a.url, target: "_blank", children: a.label }) }) }),
|
|
3354
|
+
/* @__PURE__ */ p("div", { className: j.actions, children: [
|
|
3355
3355
|
/* @__PURE__ */ p(Nn, { asChild: !0, children: /* @__PURE__ */ p(at, { variant: "neutral", onClick: () => d(), children: c }) }),
|
|
3356
3356
|
/* @__PURE__ */ p(Nn, { asChild: !0, children: /* @__PURE__ */ p(at, { variant: "brand", onClick: () => l(), children: i }) })
|
|
3357
3357
|
] })
|