@leabankab/component-library 8.9.1 → 8.10.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/CHANGELOG.md +15 -0
- package/dist/cookie-consent/copy.d.ts +8 -2
- package/dist/cookie-consent/core.d.ts +18 -3
- package/dist/cookie-consent/react.d.ts +35 -2
- package/dist/cookie-consent-core-BYak3SKZ.cjs +2 -0
- package/dist/cookie-consent-core-BYak3SKZ.cjs.map +1 -0
- package/dist/{cookie-consent-core-lX0QAEAo.mjs → cookie-consent-core-DMnn4IZW.mjs} +25 -15
- package/dist/cookie-consent-core-DMnn4IZW.mjs.map +1 -0
- package/dist/cookie-consent-react.cjs +1 -1
- package/dist/cookie-consent-react.cjs.map +1 -1
- package/dist/cookie-consent-react.mjs +168 -151
- package/dist/cookie-consent-react.mjs.map +1 -1
- package/dist/cookie-consent.cjs +1 -1
- package/dist/cookie-consent.mjs +2 -2
- package/dist/website/alert-banner/alert-banner.d.ts +21 -4
- package/dist/website.cjs +1 -1
- package/dist/website.cjs.map +1 -1
- package/dist/website.css +1 -1
- package/dist/website.mjs +12 -11
- package/dist/website.mjs.map +1 -1
- package/package.json +2 -1
- package/dist/cookie-consent-core-fntGUdFt.cjs +0 -2
- package/dist/cookie-consent-core-fntGUdFt.cjs.map +0 -1
- package/dist/cookie-consent-core-lX0QAEAo.mjs.map +0 -1
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { a as e, c as t,
|
|
3
|
-
import { createContext as
|
|
4
|
-
import { Button as
|
|
5
|
-
import { useRender as
|
|
6
|
-
import { Fragment as
|
|
7
|
-
import { Dialog as
|
|
8
|
-
import { ChevronDown as
|
|
9
|
-
import { Switch as
|
|
10
|
-
import { Accordion as
|
|
2
|
+
import { a as e, c as t, d as n, i as r, l as i, o as a, r as o, s, t as c, u as l } from "./cookie-consent-core-DMnn4IZW.mjs";
|
|
3
|
+
import { createContext as u, isValidElement as d, useContext as f, useEffect as p, useId as m, useLayoutEffect as h, useMemo as ee, useRef as g, useState as _, useSyncExternalStore as te } from "react";
|
|
4
|
+
import { Button as v } from "@base-ui/react/button";
|
|
5
|
+
import { useRender as y } from "@base-ui/react/use-render";
|
|
6
|
+
import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
|
|
7
|
+
import { Dialog as C } from "@base-ui/react/dialog";
|
|
8
|
+
import { ChevronDown as w, X as T } from "lucide-react";
|
|
9
|
+
import { Switch as E } from "@base-ui/react/switch";
|
|
10
|
+
import { Accordion as D } from "@base-ui/react/accordion";
|
|
11
11
|
import './cookie-consent.css';//#region src/utils/merge-class-name.ts
|
|
12
|
-
var
|
|
12
|
+
var O = (e, t) => (n) => [e, typeof t == "function" ? t(n) : t].filter(Boolean).join(" "), k = {
|
|
13
13
|
Button: "_Button_dq81c_1",
|
|
14
14
|
IconButton: "_IconButton_dq81c_141",
|
|
15
15
|
Spinner: "_Spinner_dq81c_172",
|
|
16
16
|
"button-spin": "_button-spin_dq81c_1",
|
|
17
17
|
SrOnly: "_SrOnly_dq81c_190"
|
|
18
|
-
},
|
|
18
|
+
}, ne = (e) => d(e) && (e.props.href != null || e.props.to != null), A = (e) => e.preventDefault();
|
|
19
19
|
function re({ loading: e = !1, disabled: t, className: n, render: r, nativeButton: i, focusableWhenDisabled: a, ref: o, ...s }) {
|
|
20
|
-
let c = !!(t || e), l =
|
|
20
|
+
let c = !!(t || e), l = ne(r), u = {
|
|
21
21
|
"aria-busy": e || void 0,
|
|
22
22
|
"data-loading": e || void 0
|
|
23
23
|
};
|
|
24
|
-
return
|
|
24
|
+
return y({
|
|
25
25
|
enabled: l,
|
|
26
26
|
render: l ? r : void 0,
|
|
27
27
|
ref: o,
|
|
@@ -32,9 +32,9 @@ function re({ loading: e = !1, disabled: t, className: n, render: r, nativeButto
|
|
|
32
32
|
"aria-disabled": c || void 0,
|
|
33
33
|
"data-disabled": c ? "" : void 0,
|
|
34
34
|
className: typeof n == "function" ? n({ disabled: c }) : n,
|
|
35
|
-
onClick: c ?
|
|
35
|
+
onClick: c ? A : s.onClick
|
|
36
36
|
}
|
|
37
|
-
}) || /* @__PURE__ */
|
|
37
|
+
}) || /* @__PURE__ */ x(v, {
|
|
38
38
|
...s,
|
|
39
39
|
...u,
|
|
40
40
|
ref: o,
|
|
@@ -46,37 +46,37 @@ function re({ loading: e = !1, disabled: t, className: n, render: r, nativeButto
|
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
48
|
function ie({ variant: e = "solid", color: t = "primary", size: n = "md", className: r, ...i }) {
|
|
49
|
-
return /* @__PURE__ */
|
|
49
|
+
return /* @__PURE__ */ x(re, {
|
|
50
50
|
...i,
|
|
51
51
|
"data-variant": e,
|
|
52
52
|
"data-color": t,
|
|
53
53
|
"data-size": n,
|
|
54
|
-
className:
|
|
54
|
+
className: O(k.Button, r)
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
57
|
//#endregion
|
|
58
58
|
//#region src/components/buttons/button/button.tsx
|
|
59
|
-
function
|
|
60
|
-
return /* @__PURE__ */ b
|
|
59
|
+
function j({ startIcon: e, endIcon: t, loading: n = !1, loadingLabel: r, children: i, ...a }) {
|
|
60
|
+
return /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ S(ie, {
|
|
61
61
|
...a,
|
|
62
62
|
loading: n,
|
|
63
63
|
"data-start-icon": n || e != null || void 0,
|
|
64
64
|
"data-end-icon": t != null || void 0,
|
|
65
65
|
children: [
|
|
66
|
-
n ? /* @__PURE__ */
|
|
67
|
-
className:
|
|
66
|
+
n ? /* @__PURE__ */ x("span", {
|
|
67
|
+
className: k.Spinner,
|
|
68
68
|
"aria-hidden": !0
|
|
69
69
|
}) : e,
|
|
70
70
|
i,
|
|
71
71
|
t
|
|
72
72
|
]
|
|
73
|
-
}), r != null && /* @__PURE__ */
|
|
73
|
+
}), r != null && /* @__PURE__ */ x("span", {
|
|
74
74
|
role: "status",
|
|
75
|
-
className:
|
|
75
|
+
className: k.SrOnly,
|
|
76
76
|
children: n ? r : null
|
|
77
77
|
})] });
|
|
78
78
|
}
|
|
79
|
-
var
|
|
79
|
+
var M = {
|
|
80
80
|
Backdrop: "_Backdrop_1do7v_8",
|
|
81
81
|
Viewport: "_Viewport_1do7v_22",
|
|
82
82
|
Popup: "_Popup_1do7v_38",
|
|
@@ -86,7 +86,7 @@ var O = {
|
|
|
86
86
|
Content: "_Content_1do7v_111",
|
|
87
87
|
Footer: "_Footer_1do7v_119",
|
|
88
88
|
CloseButton: "_CloseButton_1do7v_135"
|
|
89
|
-
}, ae =
|
|
89
|
+
}, ae = u("no"), oe = () => f(ae);
|
|
90
90
|
//#endregion
|
|
91
91
|
//#region src/i18n/create-translation.ts
|
|
92
92
|
function se(e) {
|
|
@@ -105,86 +105,86 @@ var ce = se({ close: {
|
|
|
105
105
|
se: "Stäng",
|
|
106
106
|
fi: "Sulje",
|
|
107
107
|
es: "Cerrar"
|
|
108
|
-
} }),
|
|
109
|
-
|
|
110
|
-
var
|
|
111
|
-
function
|
|
112
|
-
return /* @__PURE__ */
|
|
108
|
+
} }), le = C.Root;
|
|
109
|
+
C.Trigger;
|
|
110
|
+
var ue = C.Portal;
|
|
111
|
+
function N({ className: e, ...t }) {
|
|
112
|
+
return /* @__PURE__ */ x(C.Backdrop, {
|
|
113
113
|
...t,
|
|
114
|
-
className:
|
|
114
|
+
className: O(M.Backdrop, e)
|
|
115
115
|
});
|
|
116
116
|
}
|
|
117
|
-
function
|
|
118
|
-
return /* @__PURE__ */
|
|
117
|
+
function P({ className: e, ...t }) {
|
|
118
|
+
return /* @__PURE__ */ x(C.Viewport, {
|
|
119
119
|
...t,
|
|
120
|
-
className:
|
|
120
|
+
className: O(M.Viewport, e)
|
|
121
121
|
});
|
|
122
122
|
}
|
|
123
|
-
function
|
|
124
|
-
return /* @__PURE__ */
|
|
123
|
+
function F({ size: e = "sm", fullScreenOnMobile: t, className: n, ...r }) {
|
|
124
|
+
return /* @__PURE__ */ x(C.Popup, {
|
|
125
125
|
...r,
|
|
126
126
|
"data-size": e,
|
|
127
127
|
"data-full-screen-on-mobile": t || void 0,
|
|
128
|
-
className:
|
|
128
|
+
className: O(M.Popup, n)
|
|
129
129
|
});
|
|
130
130
|
}
|
|
131
|
-
function
|
|
132
|
-
return /* @__PURE__ */
|
|
131
|
+
function I({ className: e, ...t }) {
|
|
132
|
+
return /* @__PURE__ */ x("div", {
|
|
133
133
|
...t,
|
|
134
|
-
className: [
|
|
134
|
+
className: [M.Header, e].filter(Boolean).join(" ")
|
|
135
135
|
});
|
|
136
136
|
}
|
|
137
|
-
function
|
|
138
|
-
return /* @__PURE__ */
|
|
137
|
+
function L({ className: e, ...t }) {
|
|
138
|
+
return /* @__PURE__ */ x(C.Title, {
|
|
139
139
|
...t,
|
|
140
|
-
className:
|
|
140
|
+
className: O(M.Title, e)
|
|
141
141
|
});
|
|
142
142
|
}
|
|
143
|
-
function
|
|
144
|
-
return /* @__PURE__ */
|
|
143
|
+
function R({ className: e, ...t }) {
|
|
144
|
+
return /* @__PURE__ */ x(C.Description, {
|
|
145
145
|
...t,
|
|
146
|
-
className:
|
|
146
|
+
className: O(M.Description, e)
|
|
147
147
|
});
|
|
148
148
|
}
|
|
149
|
-
function
|
|
150
|
-
return /* @__PURE__ */
|
|
149
|
+
function z({ className: e, ...t }) {
|
|
150
|
+
return /* @__PURE__ */ x("div", {
|
|
151
151
|
...t,
|
|
152
|
-
className: [
|
|
152
|
+
className: [M.Content, e].filter(Boolean).join(" ")
|
|
153
153
|
});
|
|
154
154
|
}
|
|
155
|
-
function
|
|
156
|
-
return /* @__PURE__ */
|
|
155
|
+
function B({ className: e, ...t }) {
|
|
156
|
+
return /* @__PURE__ */ x("div", {
|
|
157
157
|
...t,
|
|
158
|
-
className: [
|
|
158
|
+
className: [M.Footer, e].filter(Boolean).join(" ")
|
|
159
159
|
});
|
|
160
160
|
}
|
|
161
|
-
|
|
162
|
-
function
|
|
161
|
+
C.Close;
|
|
162
|
+
function V({ label: e, className: t, ...n }) {
|
|
163
163
|
let r = ce();
|
|
164
|
-
return /* @__PURE__ */
|
|
164
|
+
return /* @__PURE__ */ x(C.Close, {
|
|
165
165
|
...n,
|
|
166
166
|
"aria-label": e ?? r.close,
|
|
167
|
-
className:
|
|
168
|
-
children: /* @__PURE__ */
|
|
167
|
+
className: O(M.CloseButton, t),
|
|
168
|
+
children: /* @__PURE__ */ x(T, {
|
|
169
169
|
size: 20,
|
|
170
170
|
"aria-hidden": !0
|
|
171
171
|
})
|
|
172
172
|
});
|
|
173
173
|
}
|
|
174
|
-
var
|
|
174
|
+
var H = {
|
|
175
175
|
Switch: "_Switch_9c9ji_7",
|
|
176
176
|
Thumb: "_Thumb_9c9ji_36"
|
|
177
177
|
};
|
|
178
178
|
//#endregion
|
|
179
179
|
//#region src/components/form/switch/switch.tsx
|
|
180
|
-
function
|
|
181
|
-
return /* @__PURE__ */
|
|
180
|
+
function U({ className: e, ...t }) {
|
|
181
|
+
return /* @__PURE__ */ x(E.Root, {
|
|
182
182
|
...t,
|
|
183
|
-
className:
|
|
184
|
-
children: /* @__PURE__ */
|
|
183
|
+
className: O(H.Switch, e),
|
|
184
|
+
children: /* @__PURE__ */ x(E.Thumb, { className: H.Thumb })
|
|
185
185
|
});
|
|
186
186
|
}
|
|
187
|
-
var
|
|
187
|
+
var W = {
|
|
188
188
|
Root: "_Root_oibl2_13",
|
|
189
189
|
Item: "_Item_oibl2_10",
|
|
190
190
|
Header: "_Header_oibl2_10",
|
|
@@ -196,46 +196,46 @@ var H = {
|
|
|
196
196
|
};
|
|
197
197
|
//#endregion
|
|
198
198
|
//#region src/components/surfaces/accordion/accordion.tsx
|
|
199
|
-
function
|
|
200
|
-
return /* @__PURE__ */
|
|
199
|
+
function de({ variant: e = "outline", iconPosition: t = "end", className: n, ...r }) {
|
|
200
|
+
return /* @__PURE__ */ x(D.Root, {
|
|
201
201
|
...r,
|
|
202
202
|
"data-variant": e,
|
|
203
203
|
"data-icon-position": t,
|
|
204
|
-
className:
|
|
204
|
+
className: O(W.Root, n)
|
|
205
205
|
});
|
|
206
206
|
}
|
|
207
|
-
function
|
|
208
|
-
return /* @__PURE__ */
|
|
207
|
+
function fe({ className: e, ...t }) {
|
|
208
|
+
return /* @__PURE__ */ x(D.Item, {
|
|
209
209
|
...t,
|
|
210
|
-
className:
|
|
210
|
+
className: O(W.Item, e)
|
|
211
211
|
});
|
|
212
212
|
}
|
|
213
|
-
function
|
|
214
|
-
return /* @__PURE__ */
|
|
213
|
+
function pe({ className: e, ...t }) {
|
|
214
|
+
return /* @__PURE__ */ x(D.Header, {
|
|
215
215
|
...t,
|
|
216
|
-
className:
|
|
216
|
+
className: O(W.Header, e)
|
|
217
217
|
});
|
|
218
218
|
}
|
|
219
|
-
function
|
|
220
|
-
return /* @__PURE__ */
|
|
219
|
+
function me({ children: e, className: t, ...n }) {
|
|
220
|
+
return /* @__PURE__ */ S(D.Trigger, {
|
|
221
221
|
...n,
|
|
222
|
-
className:
|
|
223
|
-
children: [/* @__PURE__ */
|
|
224
|
-
className:
|
|
222
|
+
className: O(W.Trigger, t),
|
|
223
|
+
children: [/* @__PURE__ */ x("span", {
|
|
224
|
+
className: W.Label,
|
|
225
225
|
children: e
|
|
226
|
-
}), /* @__PURE__ */
|
|
227
|
-
className:
|
|
226
|
+
}), /* @__PURE__ */ x(w, {
|
|
227
|
+
className: W.Icon,
|
|
228
228
|
size: 20,
|
|
229
229
|
"aria-hidden": !0
|
|
230
230
|
})]
|
|
231
231
|
});
|
|
232
232
|
}
|
|
233
|
-
function
|
|
234
|
-
return /* @__PURE__ */
|
|
233
|
+
function he({ children: e, className: t, ...n }) {
|
|
234
|
+
return /* @__PURE__ */ x(D.Panel, {
|
|
235
235
|
...n,
|
|
236
|
-
className:
|
|
237
|
-
children: /* @__PURE__ */
|
|
238
|
-
className:
|
|
236
|
+
className: O(W.Panel, t),
|
|
237
|
+
children: /* @__PURE__ */ x("div", {
|
|
238
|
+
className: W.Content,
|
|
239
239
|
children: e
|
|
240
240
|
})
|
|
241
241
|
});
|
|
@@ -254,54 +254,54 @@ function q(e, t) {
|
|
|
254
254
|
return null;
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
|
-
function
|
|
257
|
+
function ge(e) {
|
|
258
258
|
let t = e.trim();
|
|
259
259
|
if (!t) return !1;
|
|
260
260
|
let n = q(t);
|
|
261
261
|
return n ? n.protocol === "https:" || n.protocol === "mailto:" : q(t, K)?.origin === K;
|
|
262
262
|
}
|
|
263
|
-
function
|
|
263
|
+
function J({ href: e, resolveHref: t = (e) => e, children: n }) {
|
|
264
264
|
let r = t(e);
|
|
265
|
-
return !r || !
|
|
265
|
+
return !r || !ge(r) ? /* @__PURE__ */ x(b, { children: n }) : /* @__PURE__ */ x("a", {
|
|
266
266
|
href: r.trim(),
|
|
267
267
|
target: "_blank",
|
|
268
268
|
rel: "noopener noreferrer",
|
|
269
269
|
children: n
|
|
270
270
|
});
|
|
271
271
|
}
|
|
272
|
-
function
|
|
272
|
+
function Y({ node: e }) {
|
|
273
273
|
let t = e.text;
|
|
274
|
-
return e.underline && (t = /* @__PURE__ */
|
|
274
|
+
return e.underline && (t = /* @__PURE__ */ x("u", { children: t })), e.italic && (t = /* @__PURE__ */ x("em", { children: t })), e.bold && (t = /* @__PURE__ */ x("strong", { children: t })), /* @__PURE__ */ x(b, { children: t });
|
|
275
275
|
}
|
|
276
|
-
function
|
|
277
|
-
return /* @__PURE__ */
|
|
276
|
+
function X({ nodes: e, resolveHref: t }) {
|
|
277
|
+
return /* @__PURE__ */ x(b, { children: (e ?? []).map((e, n) => e.type === "text" ? /* @__PURE__ */ x(Y, { node: e }, n) : e.type === "link" ? /* @__PURE__ */ x(J, {
|
|
278
278
|
href: e.url ?? "",
|
|
279
279
|
resolveHref: t,
|
|
280
|
-
children: (e.children ?? []).filter((e) => e.type === "text").map((e, t) => /* @__PURE__ */
|
|
280
|
+
children: (e.children ?? []).filter((e) => e.type === "text").map((e, t) => /* @__PURE__ */ x(Y, { node: e }, t))
|
|
281
281
|
}, n) : null) });
|
|
282
282
|
}
|
|
283
|
-
function
|
|
283
|
+
function Z({ node: e, resolveHref: t }) {
|
|
284
284
|
let n = e.format === "ordered" ? "ol" : "ul";
|
|
285
|
-
return /* @__PURE__ */
|
|
285
|
+
return /* @__PURE__ */ x(n, { children: (e.children ?? []).map((e, n) => e.type === "list" ? /* @__PURE__ */ x("li", { children: /* @__PURE__ */ x(Z, {
|
|
286
286
|
node: e,
|
|
287
287
|
resolveHref: t
|
|
288
|
-
}) }, n) : e.type === "list-item" ? /* @__PURE__ */
|
|
288
|
+
}) }, n) : e.type === "list-item" ? /* @__PURE__ */ x("li", { children: /* @__PURE__ */ x(X, {
|
|
289
289
|
nodes: e.children,
|
|
290
290
|
resolveHref: t
|
|
291
291
|
}) }, n) : null) });
|
|
292
292
|
}
|
|
293
|
-
function
|
|
294
|
-
return /* @__PURE__ */
|
|
293
|
+
function _e({ nodes: e, resolveHref: t }) {
|
|
294
|
+
return /* @__PURE__ */ x(b, { children: e.map((e, n) => {
|
|
295
295
|
switch (e.type) {
|
|
296
|
-
case "paragraph": return /* @__PURE__ */
|
|
296
|
+
case "paragraph": return /* @__PURE__ */ x("p", { children: /* @__PURE__ */ x(X, {
|
|
297
297
|
nodes: e.children,
|
|
298
298
|
resolveHref: t
|
|
299
299
|
}) }, n);
|
|
300
|
-
case "heading": return /* @__PURE__ */
|
|
300
|
+
case "heading": return /* @__PURE__ */ x("p", { children: /* @__PURE__ */ x("strong", { children: /* @__PURE__ */ x(X, {
|
|
301
301
|
nodes: e.children,
|
|
302
302
|
resolveHref: t
|
|
303
303
|
}) }) }, n);
|
|
304
|
-
case "list": return /* @__PURE__ */
|
|
304
|
+
case "list": return /* @__PURE__ */ x(Z, {
|
|
305
305
|
node: e,
|
|
306
306
|
resolveHref: t
|
|
307
307
|
}, n);
|
|
@@ -311,7 +311,7 @@ function me({ nodes: e, resolveHref: t }) {
|
|
|
311
311
|
}
|
|
312
312
|
//#endregion
|
|
313
313
|
//#region src/cookie-consent/consent-dialog.tsx
|
|
314
|
-
function
|
|
314
|
+
function Q(e) {
|
|
315
315
|
return {
|
|
316
316
|
necessary: !0,
|
|
317
317
|
preferences: e?.preferences ?? !1,
|
|
@@ -319,22 +319,22 @@ function Z(e) {
|
|
|
319
319
|
marketing: e?.marketing ?? !1
|
|
320
320
|
};
|
|
321
321
|
}
|
|
322
|
-
function
|
|
323
|
-
let i =
|
|
324
|
-
return /* @__PURE__ */
|
|
322
|
+
function ve({ category: e, copy: t, checked: n, onCheckedChange: r }) {
|
|
323
|
+
let i = m(), a = m(), { title: o, description: s } = t.categories[e];
|
|
324
|
+
return /* @__PURE__ */ S(fe, {
|
|
325
325
|
value: e,
|
|
326
|
-
children: [/* @__PURE__ */
|
|
326
|
+
children: [/* @__PURE__ */ S(pe, { children: [/* @__PURE__ */ x(me, { children: /* @__PURE__ */ x("span", {
|
|
327
327
|
id: i,
|
|
328
328
|
children: o
|
|
329
|
-
}) }), /* @__PURE__ */
|
|
329
|
+
}) }), /* @__PURE__ */ x(U, {
|
|
330
330
|
"aria-labelledby": i,
|
|
331
331
|
"aria-describedby": s ? a : void 0,
|
|
332
332
|
checked: n,
|
|
333
333
|
disabled: e === "necessary",
|
|
334
334
|
onCheckedChange: r
|
|
335
|
-
})] }), /* @__PURE__ */
|
|
335
|
+
})] }), /* @__PURE__ */ x(he, {
|
|
336
336
|
keepMounted: !0,
|
|
337
|
-
children: s && /* @__PURE__ */
|
|
337
|
+
children: s && /* @__PURE__ */ x("p", {
|
|
338
338
|
id: a,
|
|
339
339
|
className: G.CategoryDescription,
|
|
340
340
|
children: s
|
|
@@ -342,34 +342,34 @@ function he({ category: e, copy: t, checked: n, onCheckedChange: r }) {
|
|
|
342
342
|
})]
|
|
343
343
|
});
|
|
344
344
|
}
|
|
345
|
-
function
|
|
346
|
-
let l = t !== null, [u, d] =
|
|
347
|
-
return e !== f && (p(e), e && d(
|
|
345
|
+
function ye({ open: e, consent: t, copy: r, resolveHref: i, onAcceptAll: a, onAcceptNecessary: o, onSave: s, onClose: c }) {
|
|
346
|
+
let l = t !== null, [u, d] = _(() => Q(t)), [f, p] = _(e);
|
|
347
|
+
return e !== f && (p(e), e && d(Q(t))), /* @__PURE__ */ x(le, {
|
|
348
348
|
open: e,
|
|
349
349
|
onOpenChange: (e) => {
|
|
350
350
|
!e && l && c();
|
|
351
351
|
},
|
|
352
352
|
disablePointerDismissal: !l,
|
|
353
|
-
children: /* @__PURE__ */
|
|
353
|
+
children: /* @__PURE__ */ S(ue, { children: [/* @__PURE__ */ x(N, {}), /* @__PURE__ */ x(P, { children: /* @__PURE__ */ S(F, {
|
|
354
354
|
fullScreenOnMobile: !0,
|
|
355
355
|
size: "md",
|
|
356
356
|
children: [
|
|
357
|
-
/* @__PURE__ */
|
|
358
|
-
/* @__PURE__ */
|
|
359
|
-
render: /* @__PURE__ */
|
|
357
|
+
/* @__PURE__ */ S(I, { children: [/* @__PURE__ */ x(L, { children: r.modalTitle }), l && /* @__PURE__ */ x(V, { label: r.closeIconLabel })] }),
|
|
358
|
+
/* @__PURE__ */ S(z, { children: [/* @__PURE__ */ x(R, {
|
|
359
|
+
render: /* @__PURE__ */ x("div", {}),
|
|
360
360
|
className: G.Intro,
|
|
361
|
-
children: /* @__PURE__ */
|
|
362
|
-
nodes:
|
|
361
|
+
children: /* @__PURE__ */ x(_e, {
|
|
362
|
+
nodes: r.intro,
|
|
363
363
|
resolveHref: i
|
|
364
364
|
})
|
|
365
|
-
}), /* @__PURE__ */
|
|
365
|
+
}), /* @__PURE__ */ x(de, {
|
|
366
366
|
variant: "solid",
|
|
367
367
|
iconPosition: "start",
|
|
368
368
|
multiple: !0,
|
|
369
369
|
className: G.Categories,
|
|
370
|
-
children:
|
|
370
|
+
children: n.map((e) => /* @__PURE__ */ x(ve, {
|
|
371
371
|
category: e,
|
|
372
|
-
copy:
|
|
372
|
+
copy: r,
|
|
373
373
|
checked: u[e],
|
|
374
374
|
onCheckedChange: (t) => d((n) => ({
|
|
375
375
|
...n,
|
|
@@ -377,28 +377,28 @@ function ge({ open: e, consent: t, copy: n, resolveHref: i, onAcceptAll: a, onAc
|
|
|
377
377
|
}))
|
|
378
378
|
}, e))
|
|
379
379
|
})] }),
|
|
380
|
-
/* @__PURE__ */
|
|
380
|
+
/* @__PURE__ */ S(B, {
|
|
381
381
|
className: G.Actions,
|
|
382
382
|
children: [
|
|
383
|
-
/* @__PURE__ */
|
|
383
|
+
/* @__PURE__ */ x(j, {
|
|
384
384
|
onClick: a,
|
|
385
385
|
color: "secondary",
|
|
386
386
|
size: "sm",
|
|
387
|
-
children:
|
|
387
|
+
children: r.btnAcceptAll
|
|
388
388
|
}),
|
|
389
|
-
/* @__PURE__ */
|
|
389
|
+
/* @__PURE__ */ x(j, {
|
|
390
390
|
onClick: o,
|
|
391
391
|
color: "secondary",
|
|
392
392
|
size: "sm",
|
|
393
|
-
children:
|
|
393
|
+
children: r.btnAcceptNecessary
|
|
394
394
|
}),
|
|
395
|
-
/* @__PURE__ */
|
|
395
|
+
/* @__PURE__ */ x(j, {
|
|
396
396
|
variant: "outline",
|
|
397
397
|
color: "secondary",
|
|
398
398
|
size: "sm",
|
|
399
399
|
className: G.Save,
|
|
400
|
-
onClick: () => s(
|
|
401
|
-
children:
|
|
400
|
+
onClick: () => s(n.filter((e) => u[e])),
|
|
401
|
+
children: r.btnSaveSettings
|
|
402
402
|
})
|
|
403
403
|
]
|
|
404
404
|
})
|
|
@@ -408,36 +408,53 @@ function ge({ open: e, consent: t, copy: n, resolveHref: i, onAcceptAll: a, onAc
|
|
|
408
408
|
}
|
|
409
409
|
//#endregion
|
|
410
410
|
//#region src/cookie-consent/react.tsx
|
|
411
|
-
var
|
|
412
|
-
function
|
|
413
|
-
let { consent:
|
|
414
|
-
|
|
415
|
-
|
|
411
|
+
var be = typeof document > "u" ? p : h, $ = u(null);
|
|
412
|
+
function xe({ market: n, copy: u, resolveHref: d, onConsentChange: f, autoOpen: m = !0, children: h }) {
|
|
413
|
+
let { consent: _, settingsOpen: v, ready: y } = te(l, r, o), b = g(f);
|
|
414
|
+
be(() => {
|
|
415
|
+
b.current = f;
|
|
416
|
+
});
|
|
417
|
+
let C = g(null);
|
|
418
|
+
p(() => {
|
|
419
|
+
let e = () => {
|
|
420
|
+
let { consent: e } = r();
|
|
421
|
+
if (!(e === null || t(e, C.current))) {
|
|
422
|
+
C.current = e;
|
|
423
|
+
try {
|
|
424
|
+
b.current?.(e);
|
|
425
|
+
} catch (e) {
|
|
426
|
+
reportError(e);
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
};
|
|
430
|
+
return e(), l(e);
|
|
431
|
+
}, []), p(() => {
|
|
432
|
+
e({ market: n });
|
|
416
433
|
}, []);
|
|
417
|
-
let
|
|
418
|
-
consent:
|
|
419
|
-
openSettings:
|
|
420
|
-
}), [
|
|
421
|
-
return /* @__PURE__ */
|
|
422
|
-
value:
|
|
423
|
-
children: [
|
|
424
|
-
open:
|
|
425
|
-
consent:
|
|
426
|
-
copy:
|
|
427
|
-
resolveHref:
|
|
428
|
-
onAcceptAll: () =>
|
|
429
|
-
onAcceptNecessary: () =>
|
|
430
|
-
onSave:
|
|
431
|
-
onClose:
|
|
434
|
+
let w = ee(() => ({
|
|
435
|
+
consent: _,
|
|
436
|
+
openSettings: s
|
|
437
|
+
}), [_]), T = y && (v || _ === null && m && !a(navigator.userAgent));
|
|
438
|
+
return /* @__PURE__ */ S($.Provider, {
|
|
439
|
+
value: w,
|
|
440
|
+
children: [h, y && /* @__PURE__ */ x(ye, {
|
|
441
|
+
open: T,
|
|
442
|
+
consent: _,
|
|
443
|
+
copy: u,
|
|
444
|
+
resolveHref: d,
|
|
445
|
+
onAcceptAll: () => i("all"),
|
|
446
|
+
onAcceptNecessary: () => i([]),
|
|
447
|
+
onSave: i,
|
|
448
|
+
onClose: c
|
|
432
449
|
})]
|
|
433
450
|
});
|
|
434
451
|
}
|
|
435
|
-
function
|
|
436
|
-
let e =
|
|
452
|
+
function Se() {
|
|
453
|
+
let e = f($);
|
|
437
454
|
if (!e) throw Error("useCookieConsent must be used inside a CookieConsentProvider.");
|
|
438
455
|
return e;
|
|
439
456
|
}
|
|
440
457
|
//#endregion
|
|
441
|
-
export {
|
|
458
|
+
export { xe as CookieConsentProvider, Se as useCookieConsent };
|
|
442
459
|
|
|
443
460
|
//# sourceMappingURL=cookie-consent-react.mjs.map
|