@uninspired/cookie-banner 0.0.7 → 0.0.8
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 +12 -9
- package/dist/react/index.cjs +68 -727
- package/dist/react/index.js +63 -722
- package/dist/react/style.css +0 -128
- package/dist/script/index.cjs +13 -13
- package/dist/script/index.js +1256 -1752
- package/dist/script/style.css +1 -1
- package/package.json +1 -1
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 k in e) {
|
|
9
|
+
if (k !== "default") {
|
|
10
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
11
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: () => e[
|
|
13
|
+
get: () => e[k]
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -21,9 +21,6 @@ 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
|
-
}
|
|
27
24
|
l = { __e: function(n, l2, u2, t) {
|
|
28
25
|
for (var i, r, o; l2 = l2.__; ) if ((i = l2.__c) && !i.__) try {
|
|
29
26
|
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;
|
|
@@ -47,27 +44,27 @@ function cls(...classes2) {
|
|
|
47
44
|
function clx(classes2) {
|
|
48
45
|
return Object.entries(classes2).filter(([, value]) => value).map(([key]) => key).join(" ");
|
|
49
46
|
}
|
|
50
|
-
const root$
|
|
47
|
+
const root$2 = "_root_hw69b_1";
|
|
51
48
|
const neutral = "_neutral_hw69b_17";
|
|
52
49
|
const brand = "_brand_hw69b_30";
|
|
53
50
|
const ghost = "_ghost_hw69b_43";
|
|
54
|
-
const classes$
|
|
55
|
-
root: root$
|
|
51
|
+
const classes$2 = {
|
|
52
|
+
root: root$2,
|
|
56
53
|
neutral,
|
|
57
54
|
brand,
|
|
58
55
|
ghost
|
|
59
56
|
};
|
|
60
57
|
const Button = ({ variant = "neutral", ...rest }) => {
|
|
61
|
-
return /* @__PURE__ */ u("button", { className: cls(classes$
|
|
58
|
+
return /* @__PURE__ */ u("button", { className: cls(classes$2.root, classes$2[variant]), ...rest });
|
|
62
59
|
};
|
|
63
|
-
const root$
|
|
60
|
+
const root$1 = "_root_14l5h_1";
|
|
64
61
|
const muted = "_muted_14l5h_4";
|
|
65
62
|
const body = "_body_14l5h_8";
|
|
66
63
|
const normal = "_normal_14l5h_14";
|
|
67
64
|
const bold = "_bold_14l5h_18";
|
|
68
65
|
const caption = "_caption_14l5h_23";
|
|
69
|
-
const classes$
|
|
70
|
-
root: root$
|
|
66
|
+
const classes$1 = {
|
|
67
|
+
root: root$1,
|
|
71
68
|
muted,
|
|
72
69
|
body,
|
|
73
70
|
normal,
|
|
@@ -88,55 +85,37 @@ const Text = ({
|
|
|
88
85
|
Component,
|
|
89
86
|
{
|
|
90
87
|
className: cls(
|
|
91
|
-
classes$
|
|
92
|
-
classes$
|
|
93
|
-
classes$
|
|
94
|
-
classes$
|
|
88
|
+
classes$1.root,
|
|
89
|
+
classes$1[size],
|
|
90
|
+
classes$1[weight],
|
|
91
|
+
classes$1[color]
|
|
95
92
|
),
|
|
96
93
|
...rest
|
|
97
94
|
}
|
|
98
95
|
)
|
|
99
96
|
);
|
|
100
97
|
};
|
|
101
|
-
const root
|
|
98
|
+
const root = "_root_1wsw7_42";
|
|
102
99
|
const noTarget = "_noTarget_1wsw7_53";
|
|
103
100
|
const collapsible = "_collapsible_1wsw7_62";
|
|
104
|
-
const header
|
|
101
|
+
const header = "_header_1wsw7_65";
|
|
105
102
|
const heading = "_heading_1wsw7_72";
|
|
106
|
-
const chevron
|
|
107
|
-
const open
|
|
108
|
-
const settings = "_settings_1wsw7_89";
|
|
103
|
+
const chevron = "_chevron_1wsw7_78";
|
|
104
|
+
const open = "_open_1wsw7_83";
|
|
109
105
|
const footer = "_footer_1wsw7_103";
|
|
110
106
|
const legal = "_legal_1wsw7_110";
|
|
111
|
-
const actions
|
|
112
|
-
const classes
|
|
113
|
-
root
|
|
107
|
+
const actions = "_actions_1wsw7_113";
|
|
108
|
+
const classes = {
|
|
109
|
+
root,
|
|
114
110
|
noTarget,
|
|
115
111
|
collapsible,
|
|
116
|
-
header: header$1,
|
|
117
|
-
heading,
|
|
118
|
-
chevron: chevron$1,
|
|
119
|
-
open: open$1,
|
|
120
|
-
settings,
|
|
121
|
-
footer,
|
|
122
|
-
legal,
|
|
123
|
-
actions: actions$1
|
|
124
|
-
};
|
|
125
|
-
const root$1 = "_root_mqtha_19";
|
|
126
|
-
const header = "_header_mqtha_24";
|
|
127
|
-
const label = "_label_mqtha_33";
|
|
128
|
-
const actions = "_actions_mqtha_39";
|
|
129
|
-
const chevron = "_chevron_mqtha_45";
|
|
130
|
-
const open = "_open_mqtha_51";
|
|
131
|
-
const description = "_description_mqtha_58";
|
|
132
|
-
const classes$1 = {
|
|
133
|
-
root: root$1,
|
|
134
112
|
header,
|
|
135
|
-
|
|
136
|
-
actions,
|
|
113
|
+
heading,
|
|
137
114
|
chevron,
|
|
138
115
|
open,
|
|
139
|
-
|
|
116
|
+
footer,
|
|
117
|
+
legal,
|
|
118
|
+
actions
|
|
140
119
|
};
|
|
141
120
|
function $constructor(name, initializer2, params) {
|
|
142
121
|
function init(inst, def) {
|
|
@@ -158,9 +137,9 @@ function $constructor(name, initializer2, params) {
|
|
|
158
137
|
const proto = _.prototype;
|
|
159
138
|
const keys = Object.keys(proto);
|
|
160
139
|
for (let i = 0; i < keys.length; i++) {
|
|
161
|
-
const
|
|
162
|
-
if (!(
|
|
163
|
-
inst[
|
|
140
|
+
const k = keys[i];
|
|
141
|
+
if (!(k in inst)) {
|
|
142
|
+
inst[k] = proto[k].bind(inst);
|
|
164
143
|
}
|
|
165
144
|
}
|
|
166
145
|
}
|
|
@@ -276,8 +255,8 @@ function normalizeParams(_params) {
|
|
|
276
255
|
return {};
|
|
277
256
|
}
|
|
278
257
|
function optionalKeys(shape) {
|
|
279
|
-
return Object.keys(shape).filter((
|
|
280
|
-
return shape[
|
|
258
|
+
return Object.keys(shape).filter((k) => {
|
|
259
|
+
return shape[k]._zod.optin === "optional" && shape[k]._zod.optout === "optional";
|
|
281
260
|
});
|
|
282
261
|
}
|
|
283
262
|
function aborted(x, startIndex = 0) {
|
|
@@ -560,9 +539,9 @@ function handlePropertyResult(result, final, key, input, isOptionalOut) {
|
|
|
560
539
|
}
|
|
561
540
|
function normalizeDef(def) {
|
|
562
541
|
const keys = Object.keys(def.shape);
|
|
563
|
-
for (const
|
|
564
|
-
if (!def.shape?.[
|
|
565
|
-
throw new Error(`Invalid element at key "${
|
|
542
|
+
for (const k of keys) {
|
|
543
|
+
if (!def.shape?.[k]?._zod?.traits?.has("$ZodType")) {
|
|
544
|
+
throw new Error(`Invalid element at key "${k}": expected a Zod schema`);
|
|
566
545
|
}
|
|
567
546
|
}
|
|
568
547
|
const okeys = optionalKeys(def.shape);
|
|
@@ -747,11 +726,11 @@ const $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUn
|
|
|
747
726
|
const pv = option._zod.propValues;
|
|
748
727
|
if (!pv || Object.keys(pv).length === 0)
|
|
749
728
|
throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(option)}"`);
|
|
750
|
-
for (const [
|
|
751
|
-
if (!propValues[
|
|
752
|
-
propValues[
|
|
729
|
+
for (const [k, v] of Object.entries(pv)) {
|
|
730
|
+
if (!propValues[k])
|
|
731
|
+
propValues[k] = /* @__PURE__ */ new Set();
|
|
753
732
|
for (const val of v) {
|
|
754
|
-
propValues[
|
|
733
|
+
propValues[k].add(val);
|
|
755
734
|
}
|
|
756
735
|
}
|
|
757
736
|
}
|
|
@@ -1110,7 +1089,7 @@ var hasRequiredReactJsxRuntime_production_min;
|
|
|
1110
1089
|
function requireReactJsxRuntime_production_min() {
|
|
1111
1090
|
if (hasRequiredReactJsxRuntime_production_min) return reactJsxRuntime_production_min;
|
|
1112
1091
|
hasRequiredReactJsxRuntime_production_min = 1;
|
|
1113
|
-
var f2 = React,
|
|
1092
|
+
var f2 = React, k = /* @__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 };
|
|
1114
1093
|
function q(c, a, g) {
|
|
1115
1094
|
var b, d = {}, e = null, h = null;
|
|
1116
1095
|
void 0 !== g && (e = "" + g);
|
|
@@ -1118,7 +1097,7 @@ function requireReactJsxRuntime_production_min() {
|
|
|
1118
1097
|
void 0 !== a.ref && (h = a.ref);
|
|
1119
1098
|
for (b in a) m.call(a, b) && !p.hasOwnProperty(b) && (d[b] = a[b]);
|
|
1120
1099
|
if (c && c.defaultProps) for (b in a = c.defaultProps, a) void 0 === d[b] && (d[b] = a[b]);
|
|
1121
|
-
return { $$typeof:
|
|
1100
|
+
return { $$typeof: k, type: c, key: e, ref: h, props: d, _owner: n.current };
|
|
1122
1101
|
}
|
|
1123
1102
|
reactJsxRuntime_production_min.Fragment = l2;
|
|
1124
1103
|
reactJsxRuntime_production_min.jsx = q;
|
|
@@ -1955,8 +1934,8 @@ function requireReactJsxRuntime_development() {
|
|
|
1955
1934
|
{
|
|
1956
1935
|
if (hasOwnProperty.call(props, "key")) {
|
|
1957
1936
|
var componentName = getComponentNameFromType(type);
|
|
1958
|
-
var keys = Object.keys(props).filter(function(
|
|
1959
|
-
return
|
|
1937
|
+
var keys = Object.keys(props).filter(function(k) {
|
|
1938
|
+
return k !== "key";
|
|
1960
1939
|
});
|
|
1961
1940
|
var beforeExample = keys.length > 0 ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
1962
1941
|
if (!didWarnAboutKeySpread[componentName + beforeExample]) {
|
|
@@ -2194,68 +2173,6 @@ function getElementRef$1(element) {
|
|
|
2194
2173
|
}
|
|
2195
2174
|
return element.props.ref || element.ref;
|
|
2196
2175
|
}
|
|
2197
|
-
function createCollection(name) {
|
|
2198
|
-
const PROVIDER_NAME = name + "CollectionProvider";
|
|
2199
|
-
const [createCollectionContext, createCollectionScope2] = createContextScope(PROVIDER_NAME);
|
|
2200
|
-
const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(
|
|
2201
|
-
PROVIDER_NAME,
|
|
2202
|
-
{ collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
|
|
2203
|
-
);
|
|
2204
|
-
const CollectionProvider = (props) => {
|
|
2205
|
-
const { scope, children } = props;
|
|
2206
|
-
const ref = React.useRef(null);
|
|
2207
|
-
const itemMap = React.useRef(/* @__PURE__ */ new Map()).current;
|
|
2208
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children });
|
|
2209
|
-
};
|
|
2210
|
-
CollectionProvider.displayName = PROVIDER_NAME;
|
|
2211
|
-
const COLLECTION_SLOT_NAME = name + "CollectionSlot";
|
|
2212
|
-
const CollectionSlotImpl = /* @__PURE__ */ createSlot(COLLECTION_SLOT_NAME);
|
|
2213
|
-
const CollectionSlot = React.forwardRef(
|
|
2214
|
-
(props, forwardedRef) => {
|
|
2215
|
-
const { scope, children } = props;
|
|
2216
|
-
const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
|
|
2217
|
-
const composedRefs = useComposedRefs(forwardedRef, context.collectionRef);
|
|
2218
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(CollectionSlotImpl, { ref: composedRefs, children });
|
|
2219
|
-
}
|
|
2220
|
-
);
|
|
2221
|
-
CollectionSlot.displayName = COLLECTION_SLOT_NAME;
|
|
2222
|
-
const ITEM_SLOT_NAME = name + "CollectionItemSlot";
|
|
2223
|
-
const ITEM_DATA_ATTR = "data-radix-collection-item";
|
|
2224
|
-
const CollectionItemSlotImpl = /* @__PURE__ */ createSlot(ITEM_SLOT_NAME);
|
|
2225
|
-
const CollectionItemSlot = React.forwardRef(
|
|
2226
|
-
(props, forwardedRef) => {
|
|
2227
|
-
const { scope, children, ...itemData } = props;
|
|
2228
|
-
const ref = React.useRef(null);
|
|
2229
|
-
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
2230
|
-
const context = useCollectionContext(ITEM_SLOT_NAME, scope);
|
|
2231
|
-
React.useEffect(() => {
|
|
2232
|
-
context.itemMap.set(ref, { ref, ...itemData });
|
|
2233
|
-
return () => void context.itemMap.delete(ref);
|
|
2234
|
-
});
|
|
2235
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(CollectionItemSlotImpl, { ...{ [ITEM_DATA_ATTR]: "" }, ref: composedRefs, children });
|
|
2236
|
-
}
|
|
2237
|
-
);
|
|
2238
|
-
CollectionItemSlot.displayName = ITEM_SLOT_NAME;
|
|
2239
|
-
function useCollection2(scope) {
|
|
2240
|
-
const context = useCollectionContext(name + "CollectionConsumer", scope);
|
|
2241
|
-
const getItems = React.useCallback(() => {
|
|
2242
|
-
const collectionNode = context.collectionRef.current;
|
|
2243
|
-
if (!collectionNode) return [];
|
|
2244
|
-
const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));
|
|
2245
|
-
const items = Array.from(context.itemMap.values());
|
|
2246
|
-
const orderedItems = items.sort(
|
|
2247
|
-
(a, b) => orderedNodes.indexOf(a.ref.current) - orderedNodes.indexOf(b.ref.current)
|
|
2248
|
-
);
|
|
2249
|
-
return orderedItems;
|
|
2250
|
-
}, [context.collectionRef, context.itemMap]);
|
|
2251
|
-
return getItems;
|
|
2252
|
-
}
|
|
2253
|
-
return [
|
|
2254
|
-
{ Provider: CollectionProvider, Slot: CollectionSlot, ItemSlot: CollectionItemSlot },
|
|
2255
|
-
useCollection2,
|
|
2256
|
-
createCollectionScope2
|
|
2257
|
-
];
|
|
2258
|
-
}
|
|
2259
2176
|
function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
|
|
2260
2177
|
return function handleEvent(event) {
|
|
2261
2178
|
originalEventHandler?.(event);
|
|
@@ -2497,7 +2414,7 @@ function useId(deterministicId) {
|
|
|
2497
2414
|
return deterministicId || (id ? `radix-${id}` : "");
|
|
2498
2415
|
}
|
|
2499
2416
|
var COLLAPSIBLE_NAME = "Collapsible";
|
|
2500
|
-
var [createCollapsibleContext
|
|
2417
|
+
var [createCollapsibleContext] = createContextScope(COLLAPSIBLE_NAME);
|
|
2501
2418
|
var [CollapsibleProvider, useCollapsibleContext] = createCollapsibleContext(COLLAPSIBLE_NAME);
|
|
2502
2419
|
var Collapsible = React__namespace.forwardRef(
|
|
2503
2420
|
(props, forwardedRef) => {
|
|
@@ -2526,7 +2443,7 @@ var Collapsible = React__namespace.forwardRef(
|
|
|
2526
2443
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2527
2444
|
Primitive.div,
|
|
2528
2445
|
{
|
|
2529
|
-
"data-state": getState$
|
|
2446
|
+
"data-state": getState$1(open2),
|
|
2530
2447
|
"data-disabled": disabled ? "" : void 0,
|
|
2531
2448
|
...collapsibleProps,
|
|
2532
2449
|
ref: forwardedRef
|
|
@@ -2537,18 +2454,18 @@ var Collapsible = React__namespace.forwardRef(
|
|
|
2537
2454
|
}
|
|
2538
2455
|
);
|
|
2539
2456
|
Collapsible.displayName = COLLAPSIBLE_NAME;
|
|
2540
|
-
var TRIGGER_NAME$
|
|
2457
|
+
var TRIGGER_NAME$1 = "CollapsibleTrigger";
|
|
2541
2458
|
var CollapsibleTrigger = React__namespace.forwardRef(
|
|
2542
2459
|
(props, forwardedRef) => {
|
|
2543
2460
|
const { __scopeCollapsible, ...triggerProps } = props;
|
|
2544
|
-
const context = useCollapsibleContext(TRIGGER_NAME$
|
|
2461
|
+
const context = useCollapsibleContext(TRIGGER_NAME$1, __scopeCollapsible);
|
|
2545
2462
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2546
2463
|
Primitive.button,
|
|
2547
2464
|
{
|
|
2548
2465
|
type: "button",
|
|
2549
2466
|
"aria-controls": context.contentId,
|
|
2550
2467
|
"aria-expanded": context.open || false,
|
|
2551
|
-
"data-state": getState$
|
|
2468
|
+
"data-state": getState$1(context.open),
|
|
2552
2469
|
"data-disabled": context.disabled ? "" : void 0,
|
|
2553
2470
|
disabled: context.disabled,
|
|
2554
2471
|
...triggerProps,
|
|
@@ -2558,19 +2475,19 @@ var CollapsibleTrigger = React__namespace.forwardRef(
|
|
|
2558
2475
|
);
|
|
2559
2476
|
}
|
|
2560
2477
|
);
|
|
2561
|
-
CollapsibleTrigger.displayName = TRIGGER_NAME$
|
|
2562
|
-
var CONTENT_NAME$
|
|
2478
|
+
CollapsibleTrigger.displayName = TRIGGER_NAME$1;
|
|
2479
|
+
var CONTENT_NAME$1 = "CollapsibleContent";
|
|
2563
2480
|
var CollapsibleContent = React__namespace.forwardRef(
|
|
2564
2481
|
(props, forwardedRef) => {
|
|
2565
2482
|
const { forceMount, ...contentProps } = props;
|
|
2566
|
-
const context = useCollapsibleContext(CONTENT_NAME$
|
|
2483
|
+
const context = useCollapsibleContext(CONTENT_NAME$1, props.__scopeCollapsible);
|
|
2567
2484
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(Presence, { present: forceMount || context.open, children: ({ present }) => /* @__PURE__ */ jsxRuntimeExports.jsx(CollapsibleContentImpl, { ...contentProps, ref: forwardedRef, present }) });
|
|
2568
2485
|
}
|
|
2569
2486
|
);
|
|
2570
|
-
CollapsibleContent.displayName = CONTENT_NAME$
|
|
2487
|
+
CollapsibleContent.displayName = CONTENT_NAME$1;
|
|
2571
2488
|
var CollapsibleContentImpl = React__namespace.forwardRef((props, forwardedRef) => {
|
|
2572
2489
|
const { __scopeCollapsible, present, children, ...contentProps } = props;
|
|
2573
|
-
const context = useCollapsibleContext(CONTENT_NAME$
|
|
2490
|
+
const context = useCollapsibleContext(CONTENT_NAME$1, __scopeCollapsible);
|
|
2574
2491
|
const [isPresent, setIsPresent] = React__namespace.useState(present);
|
|
2575
2492
|
const ref = React__namespace.useRef(null);
|
|
2576
2493
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
@@ -2607,7 +2524,7 @@ var CollapsibleContentImpl = React__namespace.forwardRef((props, forwardedRef) =
|
|
|
2607
2524
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2608
2525
|
Primitive.div,
|
|
2609
2526
|
{
|
|
2610
|
-
"data-state": getState$
|
|
2527
|
+
"data-state": getState$1(context.open),
|
|
2611
2528
|
"data-disabled": context.disabled ? "" : void 0,
|
|
2612
2529
|
id: context.contentId,
|
|
2613
2530
|
hidden: !isOpen,
|
|
@@ -2622,307 +2539,11 @@ var CollapsibleContentImpl = React__namespace.forwardRef((props, forwardedRef) =
|
|
|
2622
2539
|
}
|
|
2623
2540
|
);
|
|
2624
2541
|
});
|
|
2625
|
-
function getState$
|
|
2542
|
+
function getState$1(open2) {
|
|
2626
2543
|
return open2 ? "open" : "closed";
|
|
2627
2544
|
}
|
|
2628
|
-
var Root$
|
|
2545
|
+
var Root$1 = Collapsible;
|
|
2629
2546
|
var Trigger = CollapsibleTrigger;
|
|
2630
|
-
var Content$1 = CollapsibleContent;
|
|
2631
|
-
var DirectionContext = React__namespace.createContext(void 0);
|
|
2632
|
-
function useDirection(localDir) {
|
|
2633
|
-
const globalDir = React__namespace.useContext(DirectionContext);
|
|
2634
|
-
return localDir || globalDir || "ltr";
|
|
2635
|
-
}
|
|
2636
|
-
var ACCORDION_NAME = "Accordion";
|
|
2637
|
-
var ACCORDION_KEYS = ["Home", "End", "ArrowDown", "ArrowUp", "ArrowLeft", "ArrowRight"];
|
|
2638
|
-
var [Collection, useCollection, createCollectionScope] = createCollection(ACCORDION_NAME);
|
|
2639
|
-
var [createAccordionContext] = createContextScope(ACCORDION_NAME, [
|
|
2640
|
-
createCollectionScope,
|
|
2641
|
-
createCollapsibleScope
|
|
2642
|
-
]);
|
|
2643
|
-
var useCollapsibleScope = createCollapsibleScope();
|
|
2644
|
-
var Accordion = React.forwardRef(
|
|
2645
|
-
(props, forwardedRef) => {
|
|
2646
|
-
const { type, ...accordionProps } = props;
|
|
2647
|
-
const singleProps = accordionProps;
|
|
2648
|
-
const multipleProps = accordionProps;
|
|
2649
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(Collection.Provider, { scope: props.__scopeAccordion, children: type === "multiple" ? /* @__PURE__ */ jsxRuntimeExports.jsx(AccordionImplMultiple, { ...multipleProps, ref: forwardedRef }) : /* @__PURE__ */ jsxRuntimeExports.jsx(AccordionImplSingle, { ...singleProps, ref: forwardedRef }) });
|
|
2650
|
-
}
|
|
2651
|
-
);
|
|
2652
|
-
Accordion.displayName = ACCORDION_NAME;
|
|
2653
|
-
var [AccordionValueProvider, useAccordionValueContext] = createAccordionContext(ACCORDION_NAME);
|
|
2654
|
-
var [AccordionCollapsibleProvider, useAccordionCollapsibleContext] = createAccordionContext(
|
|
2655
|
-
ACCORDION_NAME,
|
|
2656
|
-
{ collapsible: false }
|
|
2657
|
-
);
|
|
2658
|
-
var AccordionImplSingle = React.forwardRef(
|
|
2659
|
-
(props, forwardedRef) => {
|
|
2660
|
-
const {
|
|
2661
|
-
value: valueProp,
|
|
2662
|
-
defaultValue,
|
|
2663
|
-
onValueChange = () => {
|
|
2664
|
-
},
|
|
2665
|
-
collapsible: collapsible2 = false,
|
|
2666
|
-
...accordionSingleProps
|
|
2667
|
-
} = props;
|
|
2668
|
-
const [value, setValue] = useControllableState({
|
|
2669
|
-
prop: valueProp,
|
|
2670
|
-
defaultProp: defaultValue ?? "",
|
|
2671
|
-
onChange: onValueChange,
|
|
2672
|
-
caller: ACCORDION_NAME
|
|
2673
|
-
});
|
|
2674
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2675
|
-
AccordionValueProvider,
|
|
2676
|
-
{
|
|
2677
|
-
scope: props.__scopeAccordion,
|
|
2678
|
-
value: React.useMemo(() => value ? [value] : [], [value]),
|
|
2679
|
-
onItemOpen: setValue,
|
|
2680
|
-
onItemClose: React.useCallback(() => collapsible2 && setValue(""), [collapsible2, setValue]),
|
|
2681
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(AccordionCollapsibleProvider, { scope: props.__scopeAccordion, collapsible: collapsible2, children: /* @__PURE__ */ jsxRuntimeExports.jsx(AccordionImpl, { ...accordionSingleProps, ref: forwardedRef }) })
|
|
2682
|
-
}
|
|
2683
|
-
);
|
|
2684
|
-
}
|
|
2685
|
-
);
|
|
2686
|
-
var AccordionImplMultiple = React.forwardRef((props, forwardedRef) => {
|
|
2687
|
-
const {
|
|
2688
|
-
value: valueProp,
|
|
2689
|
-
defaultValue,
|
|
2690
|
-
onValueChange = () => {
|
|
2691
|
-
},
|
|
2692
|
-
...accordionMultipleProps
|
|
2693
|
-
} = props;
|
|
2694
|
-
const [value, setValue] = useControllableState({
|
|
2695
|
-
prop: valueProp,
|
|
2696
|
-
defaultProp: defaultValue ?? [],
|
|
2697
|
-
onChange: onValueChange,
|
|
2698
|
-
caller: ACCORDION_NAME
|
|
2699
|
-
});
|
|
2700
|
-
const handleItemOpen = React.useCallback(
|
|
2701
|
-
(itemValue) => setValue((prevValue = []) => [...prevValue, itemValue]),
|
|
2702
|
-
[setValue]
|
|
2703
|
-
);
|
|
2704
|
-
const handleItemClose = React.useCallback(
|
|
2705
|
-
(itemValue) => setValue((prevValue = []) => prevValue.filter((value2) => value2 !== itemValue)),
|
|
2706
|
-
[setValue]
|
|
2707
|
-
);
|
|
2708
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2709
|
-
AccordionValueProvider,
|
|
2710
|
-
{
|
|
2711
|
-
scope: props.__scopeAccordion,
|
|
2712
|
-
value,
|
|
2713
|
-
onItemOpen: handleItemOpen,
|
|
2714
|
-
onItemClose: handleItemClose,
|
|
2715
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(AccordionCollapsibleProvider, { scope: props.__scopeAccordion, collapsible: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(AccordionImpl, { ...accordionMultipleProps, ref: forwardedRef }) })
|
|
2716
|
-
}
|
|
2717
|
-
);
|
|
2718
|
-
});
|
|
2719
|
-
var [AccordionImplProvider, useAccordionContext] = createAccordionContext(ACCORDION_NAME);
|
|
2720
|
-
var AccordionImpl = React.forwardRef(
|
|
2721
|
-
(props, forwardedRef) => {
|
|
2722
|
-
const { __scopeAccordion, disabled, dir, orientation = "vertical", ...accordionProps } = props;
|
|
2723
|
-
const accordionRef = React.useRef(null);
|
|
2724
|
-
const composedRefs = useComposedRefs(accordionRef, forwardedRef);
|
|
2725
|
-
const getItems = useCollection(__scopeAccordion);
|
|
2726
|
-
const direction = useDirection(dir);
|
|
2727
|
-
const isDirectionLTR = direction === "ltr";
|
|
2728
|
-
const handleKeyDown = composeEventHandlers(props.onKeyDown, (event) => {
|
|
2729
|
-
if (!ACCORDION_KEYS.includes(event.key)) return;
|
|
2730
|
-
const target = event.target;
|
|
2731
|
-
const triggerCollection = getItems().filter((item) => !item.ref.current?.disabled);
|
|
2732
|
-
const triggerIndex = triggerCollection.findIndex((item) => item.ref.current === target);
|
|
2733
|
-
const triggerCount = triggerCollection.length;
|
|
2734
|
-
if (triggerIndex === -1) return;
|
|
2735
|
-
event.preventDefault();
|
|
2736
|
-
let nextIndex = triggerIndex;
|
|
2737
|
-
const homeIndex = 0;
|
|
2738
|
-
const endIndex = triggerCount - 1;
|
|
2739
|
-
const moveNext = () => {
|
|
2740
|
-
nextIndex = triggerIndex + 1;
|
|
2741
|
-
if (nextIndex > endIndex) {
|
|
2742
|
-
nextIndex = homeIndex;
|
|
2743
|
-
}
|
|
2744
|
-
};
|
|
2745
|
-
const movePrev = () => {
|
|
2746
|
-
nextIndex = triggerIndex - 1;
|
|
2747
|
-
if (nextIndex < homeIndex) {
|
|
2748
|
-
nextIndex = endIndex;
|
|
2749
|
-
}
|
|
2750
|
-
};
|
|
2751
|
-
switch (event.key) {
|
|
2752
|
-
case "Home":
|
|
2753
|
-
nextIndex = homeIndex;
|
|
2754
|
-
break;
|
|
2755
|
-
case "End":
|
|
2756
|
-
nextIndex = endIndex;
|
|
2757
|
-
break;
|
|
2758
|
-
case "ArrowRight":
|
|
2759
|
-
if (orientation === "horizontal") {
|
|
2760
|
-
if (isDirectionLTR) {
|
|
2761
|
-
moveNext();
|
|
2762
|
-
} else {
|
|
2763
|
-
movePrev();
|
|
2764
|
-
}
|
|
2765
|
-
}
|
|
2766
|
-
break;
|
|
2767
|
-
case "ArrowDown":
|
|
2768
|
-
if (orientation === "vertical") {
|
|
2769
|
-
moveNext();
|
|
2770
|
-
}
|
|
2771
|
-
break;
|
|
2772
|
-
case "ArrowLeft":
|
|
2773
|
-
if (orientation === "horizontal") {
|
|
2774
|
-
if (isDirectionLTR) {
|
|
2775
|
-
movePrev();
|
|
2776
|
-
} else {
|
|
2777
|
-
moveNext();
|
|
2778
|
-
}
|
|
2779
|
-
}
|
|
2780
|
-
break;
|
|
2781
|
-
case "ArrowUp":
|
|
2782
|
-
if (orientation === "vertical") {
|
|
2783
|
-
movePrev();
|
|
2784
|
-
}
|
|
2785
|
-
break;
|
|
2786
|
-
}
|
|
2787
|
-
const clampedIndex = nextIndex % triggerCount;
|
|
2788
|
-
triggerCollection[clampedIndex].ref.current?.focus();
|
|
2789
|
-
});
|
|
2790
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2791
|
-
AccordionImplProvider,
|
|
2792
|
-
{
|
|
2793
|
-
scope: __scopeAccordion,
|
|
2794
|
-
disabled,
|
|
2795
|
-
direction: dir,
|
|
2796
|
-
orientation,
|
|
2797
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Collection.Slot, { scope: __scopeAccordion, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2798
|
-
Primitive.div,
|
|
2799
|
-
{
|
|
2800
|
-
...accordionProps,
|
|
2801
|
-
"data-orientation": orientation,
|
|
2802
|
-
ref: composedRefs,
|
|
2803
|
-
onKeyDown: disabled ? void 0 : handleKeyDown
|
|
2804
|
-
}
|
|
2805
|
-
) })
|
|
2806
|
-
}
|
|
2807
|
-
);
|
|
2808
|
-
}
|
|
2809
|
-
);
|
|
2810
|
-
var ITEM_NAME = "AccordionItem";
|
|
2811
|
-
var [AccordionItemProvider, useAccordionItemContext] = createAccordionContext(ITEM_NAME);
|
|
2812
|
-
var AccordionItem = React.forwardRef(
|
|
2813
|
-
(props, forwardedRef) => {
|
|
2814
|
-
const { __scopeAccordion, value, ...accordionItemProps } = props;
|
|
2815
|
-
const accordionContext = useAccordionContext(ITEM_NAME, __scopeAccordion);
|
|
2816
|
-
const valueContext = useAccordionValueContext(ITEM_NAME, __scopeAccordion);
|
|
2817
|
-
const collapsibleScope = useCollapsibleScope(__scopeAccordion);
|
|
2818
|
-
const triggerId = useId();
|
|
2819
|
-
const open2 = value && valueContext.value.includes(value) || false;
|
|
2820
|
-
const disabled = accordionContext.disabled || props.disabled;
|
|
2821
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2822
|
-
AccordionItemProvider,
|
|
2823
|
-
{
|
|
2824
|
-
scope: __scopeAccordion,
|
|
2825
|
-
open: open2,
|
|
2826
|
-
disabled,
|
|
2827
|
-
triggerId,
|
|
2828
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2829
|
-
Root$2,
|
|
2830
|
-
{
|
|
2831
|
-
"data-orientation": accordionContext.orientation,
|
|
2832
|
-
"data-state": getState$2(open2),
|
|
2833
|
-
...collapsibleScope,
|
|
2834
|
-
...accordionItemProps,
|
|
2835
|
-
ref: forwardedRef,
|
|
2836
|
-
disabled,
|
|
2837
|
-
open: open2,
|
|
2838
|
-
onOpenChange: (open22) => {
|
|
2839
|
-
if (open22) {
|
|
2840
|
-
valueContext.onItemOpen(value);
|
|
2841
|
-
} else {
|
|
2842
|
-
valueContext.onItemClose(value);
|
|
2843
|
-
}
|
|
2844
|
-
}
|
|
2845
|
-
}
|
|
2846
|
-
)
|
|
2847
|
-
}
|
|
2848
|
-
);
|
|
2849
|
-
}
|
|
2850
|
-
);
|
|
2851
|
-
AccordionItem.displayName = ITEM_NAME;
|
|
2852
|
-
var HEADER_NAME = "AccordionHeader";
|
|
2853
|
-
var AccordionHeader = React.forwardRef(
|
|
2854
|
-
(props, forwardedRef) => {
|
|
2855
|
-
const { __scopeAccordion, ...headerProps } = props;
|
|
2856
|
-
const accordionContext = useAccordionContext(ACCORDION_NAME, __scopeAccordion);
|
|
2857
|
-
const itemContext = useAccordionItemContext(HEADER_NAME, __scopeAccordion);
|
|
2858
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2859
|
-
Primitive.h3,
|
|
2860
|
-
{
|
|
2861
|
-
"data-orientation": accordionContext.orientation,
|
|
2862
|
-
"data-state": getState$2(itemContext.open),
|
|
2863
|
-
"data-disabled": itemContext.disabled ? "" : void 0,
|
|
2864
|
-
...headerProps,
|
|
2865
|
-
ref: forwardedRef
|
|
2866
|
-
}
|
|
2867
|
-
);
|
|
2868
|
-
}
|
|
2869
|
-
);
|
|
2870
|
-
AccordionHeader.displayName = HEADER_NAME;
|
|
2871
|
-
var TRIGGER_NAME$1 = "AccordionTrigger";
|
|
2872
|
-
var AccordionTrigger = React.forwardRef(
|
|
2873
|
-
(props, forwardedRef) => {
|
|
2874
|
-
const { __scopeAccordion, ...triggerProps } = props;
|
|
2875
|
-
const accordionContext = useAccordionContext(ACCORDION_NAME, __scopeAccordion);
|
|
2876
|
-
const itemContext = useAccordionItemContext(TRIGGER_NAME$1, __scopeAccordion);
|
|
2877
|
-
const collapsibleContext = useAccordionCollapsibleContext(TRIGGER_NAME$1, __scopeAccordion);
|
|
2878
|
-
const collapsibleScope = useCollapsibleScope(__scopeAccordion);
|
|
2879
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(Collection.ItemSlot, { scope: __scopeAccordion, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2880
|
-
Trigger,
|
|
2881
|
-
{
|
|
2882
|
-
"aria-disabled": itemContext.open && !collapsibleContext.collapsible || void 0,
|
|
2883
|
-
"data-orientation": accordionContext.orientation,
|
|
2884
|
-
id: itemContext.triggerId,
|
|
2885
|
-
...collapsibleScope,
|
|
2886
|
-
...triggerProps,
|
|
2887
|
-
ref: forwardedRef
|
|
2888
|
-
}
|
|
2889
|
-
) });
|
|
2890
|
-
}
|
|
2891
|
-
);
|
|
2892
|
-
AccordionTrigger.displayName = TRIGGER_NAME$1;
|
|
2893
|
-
var CONTENT_NAME$1 = "AccordionContent";
|
|
2894
|
-
var AccordionContent = React.forwardRef(
|
|
2895
|
-
(props, forwardedRef) => {
|
|
2896
|
-
const { __scopeAccordion, ...contentProps } = props;
|
|
2897
|
-
const accordionContext = useAccordionContext(ACCORDION_NAME, __scopeAccordion);
|
|
2898
|
-
const itemContext = useAccordionItemContext(CONTENT_NAME$1, __scopeAccordion);
|
|
2899
|
-
const collapsibleScope = useCollapsibleScope(__scopeAccordion);
|
|
2900
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2901
|
-
Content$1,
|
|
2902
|
-
{
|
|
2903
|
-
role: "region",
|
|
2904
|
-
"aria-labelledby": itemContext.triggerId,
|
|
2905
|
-
"data-orientation": accordionContext.orientation,
|
|
2906
|
-
...collapsibleScope,
|
|
2907
|
-
...contentProps,
|
|
2908
|
-
ref: forwardedRef,
|
|
2909
|
-
style: {
|
|
2910
|
-
["--radix-accordion-content-height"]: "var(--radix-collapsible-content-height)",
|
|
2911
|
-
["--radix-accordion-content-width"]: "var(--radix-collapsible-content-width)",
|
|
2912
|
-
...props.style
|
|
2913
|
-
}
|
|
2914
|
-
}
|
|
2915
|
-
);
|
|
2916
|
-
}
|
|
2917
|
-
);
|
|
2918
|
-
AccordionContent.displayName = CONTENT_NAME$1;
|
|
2919
|
-
function getState$2(open2) {
|
|
2920
|
-
return open2 ? "open" : "closed";
|
|
2921
|
-
}
|
|
2922
|
-
var Root2 = Accordion;
|
|
2923
|
-
var Item = AccordionItem;
|
|
2924
|
-
var Trigger2 = AccordionTrigger;
|
|
2925
|
-
var Content2 = AccordionContent;
|
|
2926
2547
|
const mergeClasses = (...classes2) => classes2.filter((className, index, array) => {
|
|
2927
2548
|
return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index;
|
|
2928
2549
|
}).join(" ").trim();
|
|
@@ -2999,207 +2620,8 @@ const createLucideIcon = (iconName, iconNode) => {
|
|
|
2999
2620
|
Component.displayName = toPascalCase(iconName);
|
|
3000
2621
|
return Component;
|
|
3001
2622
|
};
|
|
3002
|
-
const __iconNode$1 = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
|
|
3003
|
-
const ChevronDown = createLucideIcon("chevron-down", __iconNode$1);
|
|
3004
2623
|
const __iconNode = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]];
|
|
3005
2624
|
const ChevronUp = createLucideIcon("chevron-up", __iconNode);
|
|
3006
|
-
function usePrevious(value) {
|
|
3007
|
-
const ref = React__namespace.useRef({ value, previous: value });
|
|
3008
|
-
return React__namespace.useMemo(() => {
|
|
3009
|
-
if (ref.current.value !== value) {
|
|
3010
|
-
ref.current.previous = ref.current.value;
|
|
3011
|
-
ref.current.value = value;
|
|
3012
|
-
}
|
|
3013
|
-
return ref.current.previous;
|
|
3014
|
-
}, [value]);
|
|
3015
|
-
}
|
|
3016
|
-
function useSize(element) {
|
|
3017
|
-
const [size, setSize] = React__namespace.useState(void 0);
|
|
3018
|
-
useLayoutEffect2(() => {
|
|
3019
|
-
if (element) {
|
|
3020
|
-
setSize({ width: element.offsetWidth, height: element.offsetHeight });
|
|
3021
|
-
const resizeObserver = new ResizeObserver((entries) => {
|
|
3022
|
-
if (!Array.isArray(entries)) {
|
|
3023
|
-
return;
|
|
3024
|
-
}
|
|
3025
|
-
if (!entries.length) {
|
|
3026
|
-
return;
|
|
3027
|
-
}
|
|
3028
|
-
const entry = entries[0];
|
|
3029
|
-
let width;
|
|
3030
|
-
let height;
|
|
3031
|
-
if ("borderBoxSize" in entry) {
|
|
3032
|
-
const borderSizeEntry = entry["borderBoxSize"];
|
|
3033
|
-
const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry;
|
|
3034
|
-
width = borderSize["inlineSize"];
|
|
3035
|
-
height = borderSize["blockSize"];
|
|
3036
|
-
} else {
|
|
3037
|
-
width = element.offsetWidth;
|
|
3038
|
-
height = element.offsetHeight;
|
|
3039
|
-
}
|
|
3040
|
-
setSize({ width, height });
|
|
3041
|
-
});
|
|
3042
|
-
resizeObserver.observe(element, { box: "border-box" });
|
|
3043
|
-
return () => resizeObserver.unobserve(element);
|
|
3044
|
-
} else {
|
|
3045
|
-
setSize(void 0);
|
|
3046
|
-
}
|
|
3047
|
-
}, [element]);
|
|
3048
|
-
return size;
|
|
3049
|
-
}
|
|
3050
|
-
var SWITCH_NAME = "Switch";
|
|
3051
|
-
var [createSwitchContext] = createContextScope(SWITCH_NAME);
|
|
3052
|
-
var [SwitchProvider, useSwitchContext] = createSwitchContext(SWITCH_NAME);
|
|
3053
|
-
var Switch$1 = React__namespace.forwardRef(
|
|
3054
|
-
(props, forwardedRef) => {
|
|
3055
|
-
const {
|
|
3056
|
-
__scopeSwitch,
|
|
3057
|
-
name,
|
|
3058
|
-
checked: checkedProp,
|
|
3059
|
-
defaultChecked,
|
|
3060
|
-
required,
|
|
3061
|
-
disabled,
|
|
3062
|
-
value = "on",
|
|
3063
|
-
onCheckedChange,
|
|
3064
|
-
form,
|
|
3065
|
-
...switchProps
|
|
3066
|
-
} = props;
|
|
3067
|
-
const [button, setButton] = React__namespace.useState(null);
|
|
3068
|
-
const composedRefs = useComposedRefs(forwardedRef, (node) => setButton(node));
|
|
3069
|
-
const hasConsumerStoppedPropagationRef = React__namespace.useRef(false);
|
|
3070
|
-
const isFormControl = button ? form || !!button.closest("form") : true;
|
|
3071
|
-
const [checked, setChecked] = useControllableState({
|
|
3072
|
-
prop: checkedProp,
|
|
3073
|
-
defaultProp: defaultChecked ?? false,
|
|
3074
|
-
onChange: onCheckedChange,
|
|
3075
|
-
caller: SWITCH_NAME
|
|
3076
|
-
});
|
|
3077
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs(SwitchProvider, { scope: __scopeSwitch, checked, disabled, children: [
|
|
3078
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
3079
|
-
Primitive.button,
|
|
3080
|
-
{
|
|
3081
|
-
type: "button",
|
|
3082
|
-
role: "switch",
|
|
3083
|
-
"aria-checked": checked,
|
|
3084
|
-
"aria-required": required,
|
|
3085
|
-
"data-state": getState$1(checked),
|
|
3086
|
-
"data-disabled": disabled ? "" : void 0,
|
|
3087
|
-
disabled,
|
|
3088
|
-
value,
|
|
3089
|
-
...switchProps,
|
|
3090
|
-
ref: composedRefs,
|
|
3091
|
-
onClick: composeEventHandlers(props.onClick, (event) => {
|
|
3092
|
-
setChecked((prevChecked) => !prevChecked);
|
|
3093
|
-
if (isFormControl) {
|
|
3094
|
-
hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();
|
|
3095
|
-
if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();
|
|
3096
|
-
}
|
|
3097
|
-
})
|
|
3098
|
-
}
|
|
3099
|
-
),
|
|
3100
|
-
isFormControl && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
3101
|
-
SwitchBubbleInput,
|
|
3102
|
-
{
|
|
3103
|
-
control: button,
|
|
3104
|
-
bubbles: !hasConsumerStoppedPropagationRef.current,
|
|
3105
|
-
name,
|
|
3106
|
-
value,
|
|
3107
|
-
checked,
|
|
3108
|
-
required,
|
|
3109
|
-
disabled,
|
|
3110
|
-
form,
|
|
3111
|
-
style: { transform: "translateX(-100%)" }
|
|
3112
|
-
}
|
|
3113
|
-
)
|
|
3114
|
-
] });
|
|
3115
|
-
}
|
|
3116
|
-
);
|
|
3117
|
-
Switch$1.displayName = SWITCH_NAME;
|
|
3118
|
-
var THUMB_NAME = "SwitchThumb";
|
|
3119
|
-
var SwitchThumb = React__namespace.forwardRef(
|
|
3120
|
-
(props, forwardedRef) => {
|
|
3121
|
-
const { __scopeSwitch, ...thumbProps } = props;
|
|
3122
|
-
const context = useSwitchContext(THUMB_NAME, __scopeSwitch);
|
|
3123
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
3124
|
-
Primitive.span,
|
|
3125
|
-
{
|
|
3126
|
-
"data-state": getState$1(context.checked),
|
|
3127
|
-
"data-disabled": context.disabled ? "" : void 0,
|
|
3128
|
-
...thumbProps,
|
|
3129
|
-
ref: forwardedRef
|
|
3130
|
-
}
|
|
3131
|
-
);
|
|
3132
|
-
}
|
|
3133
|
-
);
|
|
3134
|
-
SwitchThumb.displayName = THUMB_NAME;
|
|
3135
|
-
var BUBBLE_INPUT_NAME = "SwitchBubbleInput";
|
|
3136
|
-
var SwitchBubbleInput = React__namespace.forwardRef(
|
|
3137
|
-
({
|
|
3138
|
-
__scopeSwitch,
|
|
3139
|
-
control,
|
|
3140
|
-
checked,
|
|
3141
|
-
bubbles = true,
|
|
3142
|
-
...props
|
|
3143
|
-
}, forwardedRef) => {
|
|
3144
|
-
const ref = React__namespace.useRef(null);
|
|
3145
|
-
const composedRefs = useComposedRefs(ref, forwardedRef);
|
|
3146
|
-
const prevChecked = usePrevious(checked);
|
|
3147
|
-
const controlSize = useSize(control);
|
|
3148
|
-
React__namespace.useEffect(() => {
|
|
3149
|
-
const input = ref.current;
|
|
3150
|
-
if (!input) return;
|
|
3151
|
-
const inputProto = window.HTMLInputElement.prototype;
|
|
3152
|
-
const descriptor = Object.getOwnPropertyDescriptor(
|
|
3153
|
-
inputProto,
|
|
3154
|
-
"checked"
|
|
3155
|
-
);
|
|
3156
|
-
const setChecked = descriptor.set;
|
|
3157
|
-
if (prevChecked !== checked && setChecked) {
|
|
3158
|
-
const event = new Event("click", { bubbles });
|
|
3159
|
-
setChecked.call(input, checked);
|
|
3160
|
-
input.dispatchEvent(event);
|
|
3161
|
-
}
|
|
3162
|
-
}, [prevChecked, checked, bubbles]);
|
|
3163
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
3164
|
-
"input",
|
|
3165
|
-
{
|
|
3166
|
-
type: "checkbox",
|
|
3167
|
-
"aria-hidden": true,
|
|
3168
|
-
defaultChecked: checked,
|
|
3169
|
-
...props,
|
|
3170
|
-
tabIndex: -1,
|
|
3171
|
-
ref: composedRefs,
|
|
3172
|
-
style: {
|
|
3173
|
-
...props.style,
|
|
3174
|
-
...controlSize,
|
|
3175
|
-
position: "absolute",
|
|
3176
|
-
pointerEvents: "none",
|
|
3177
|
-
opacity: 0,
|
|
3178
|
-
margin: 0
|
|
3179
|
-
}
|
|
3180
|
-
}
|
|
3181
|
-
);
|
|
3182
|
-
}
|
|
3183
|
-
);
|
|
3184
|
-
SwitchBubbleInput.displayName = BUBBLE_INPUT_NAME;
|
|
3185
|
-
function getState$1(checked) {
|
|
3186
|
-
return checked ? "checked" : "unchecked";
|
|
3187
|
-
}
|
|
3188
|
-
var Root$1 = Switch$1;
|
|
3189
|
-
var Thumb = SwitchThumb;
|
|
3190
|
-
const root = "_root_dibqz_1";
|
|
3191
|
-
const thumb = "_thumb_dibqz_38";
|
|
3192
|
-
const classes = {
|
|
3193
|
-
root,
|
|
3194
|
-
"switch": "_switch_dibqz_8",
|
|
3195
|
-
thumb
|
|
3196
|
-
};
|
|
3197
|
-
const Switch = ({ label: label2, id, ...rest }) => {
|
|
3198
|
-
return /* @__PURE__ */ u("div", { className: classes.root, children: [
|
|
3199
|
-
label2 && /* @__PURE__ */ u(Text, { className: classes.label, as: "label", htmlFor: id, children: label2 }),
|
|
3200
|
-
/* @__PURE__ */ u(Root$1, { className: classes.switch, ...rest, children: /* @__PURE__ */ u(Thumb, { className: classes.thumb }) })
|
|
3201
|
-
] });
|
|
3202
|
-
};
|
|
3203
2625
|
const selectionSchema = /* @__PURE__ */ record(/* @__PURE__ */ string(), /* @__PURE__ */ boolean());
|
|
3204
2626
|
const SelectionContext = React.createContext(null);
|
|
3205
2627
|
const SelectionProvider = ({
|
|
@@ -3320,68 +2742,6 @@ function useSelection() {
|
|
|
3320
2742
|
}
|
|
3321
2743
|
return context;
|
|
3322
2744
|
}
|
|
3323
|
-
const BannerItem = ({
|
|
3324
|
-
value,
|
|
3325
|
-
label: label2,
|
|
3326
|
-
sublabel,
|
|
3327
|
-
required = false,
|
|
3328
|
-
description: description2,
|
|
3329
|
-
openItem
|
|
3330
|
-
}) => {
|
|
3331
|
-
const { toggleSelection, selection } = useSelection();
|
|
3332
|
-
const selected = React.useMemo(
|
|
3333
|
-
() => selection?.[value] ?? false,
|
|
3334
|
-
[selection, value]
|
|
3335
|
-
);
|
|
3336
|
-
React.useEffect(() => {
|
|
3337
|
-
toggleSelection(value, selected);
|
|
3338
|
-
}, [value, selected]);
|
|
3339
|
-
const checked = React.useMemo(
|
|
3340
|
-
() => required ? true : selected,
|
|
3341
|
-
[required, selected]
|
|
3342
|
-
);
|
|
3343
|
-
const onCheckedChange = React.useMemo(
|
|
3344
|
-
() => (checked2) => required ? () => {
|
|
3345
|
-
} : toggleSelection(value, checked2),
|
|
3346
|
-
[required, toggleSelection, value]
|
|
3347
|
-
);
|
|
3348
|
-
const disabled = React.useMemo(() => required, [required]);
|
|
3349
|
-
return /* @__PURE__ */ u(Item, { value, className: classes$1.root, children: [
|
|
3350
|
-
/* @__PURE__ */ u("div", { className: classes$1.header, children: [
|
|
3351
|
-
/* @__PURE__ */ u(Trigger2, { asChild: true, children: /* @__PURE__ */ u("div", { className: classes$1.label, children: [
|
|
3352
|
-
/* @__PURE__ */ u(Text, { weight: "bold", children: label2 }),
|
|
3353
|
-
sublabel && /* @__PURE__ */ u(Text, { size: "caption", color: "muted", children: sublabel })
|
|
3354
|
-
] }) }),
|
|
3355
|
-
/* @__PURE__ */ u("div", { className: classes$1.actions, children: [
|
|
3356
|
-
/* @__PURE__ */ u(
|
|
3357
|
-
Switch,
|
|
3358
|
-
{
|
|
3359
|
-
checked,
|
|
3360
|
-
onCheckedChange,
|
|
3361
|
-
disabled
|
|
3362
|
-
}
|
|
3363
|
-
),
|
|
3364
|
-
/* @__PURE__ */ u(Trigger2, { asChild: true, children: /* @__PURE__ */ u(
|
|
3365
|
-
ChevronDown,
|
|
3366
|
-
{
|
|
3367
|
-
size: 16,
|
|
3368
|
-
className: clx({
|
|
3369
|
-
[classes$1.chevron]: true,
|
|
3370
|
-
[classes$1.open]: openItem === value
|
|
3371
|
-
})
|
|
3372
|
-
}
|
|
3373
|
-
) })
|
|
3374
|
-
] })
|
|
3375
|
-
] }),
|
|
3376
|
-
description2 && /* @__PURE__ */ u(Content2, { className: classes$1.description, children: /* @__PURE__ */ u(
|
|
3377
|
-
Text,
|
|
3378
|
-
{
|
|
3379
|
-
size: "caption",
|
|
3380
|
-
dangerouslySetInnerHTML: { __html: description2 }
|
|
3381
|
-
}
|
|
3382
|
-
) })
|
|
3383
|
-
] });
|
|
3384
|
-
};
|
|
3385
2745
|
function useCallbackRef$1(callback) {
|
|
3386
2746
|
const callbackRef = React__namespace.useRef(callback);
|
|
3387
2747
|
React__namespace.useEffect(() => {
|
|
@@ -4903,25 +4263,24 @@ const BannerContent = ({
|
|
|
4903
4263
|
saveLabel = "Save selection",
|
|
4904
4264
|
declineLabel = "Decline all",
|
|
4905
4265
|
defaultSettingsOpen = true,
|
|
4906
|
-
privacyPolicy
|
|
4907
|
-
items
|
|
4266
|
+
privacyPolicy
|
|
4267
|
+
// items,
|
|
4908
4268
|
}) => {
|
|
4909
4269
|
const { onSave, onDeclineAll, selectionTaken } = useSelection();
|
|
4910
|
-
const [openItem, setOpenItem] = React.useState(void 0);
|
|
4911
4270
|
const [settingsOpen, setSettingsOpen] = React.useState(defaultSettingsOpen);
|
|
4912
4271
|
return /* @__PURE__ */ u(Root, { open: !selectionTaken, children: /* @__PURE__ */ u(
|
|
4913
4272
|
Content,
|
|
4914
4273
|
{
|
|
4915
|
-
className: cls(classes
|
|
4274
|
+
className: cls(classes.root, noTarget2 ? classes.noTarget : ""),
|
|
4916
4275
|
children: /* @__PURE__ */ u(
|
|
4917
|
-
Root$
|
|
4276
|
+
Root$1,
|
|
4918
4277
|
{
|
|
4919
4278
|
open: settingsOpen,
|
|
4920
4279
|
onOpenChange: setSettingsOpen,
|
|
4921
|
-
className: classes
|
|
4280
|
+
className: classes.collapsible,
|
|
4922
4281
|
children: [
|
|
4923
|
-
/* @__PURE__ */ u("div", { className: classes
|
|
4924
|
-
/* @__PURE__ */ u("div", { className: classes
|
|
4282
|
+
/* @__PURE__ */ u("div", { className: classes.header, children: [
|
|
4283
|
+
/* @__PURE__ */ u("div", { className: classes.heading, children: [
|
|
4925
4284
|
/* @__PURE__ */ u(Title, { asChild: true, children: /* @__PURE__ */ u(Text, { weight: "bold", children: heading2 }) }),
|
|
4926
4285
|
/* @__PURE__ */ u(Description, { asChild: true, children: /* @__PURE__ */ u(Text, { size: "caption", color: "muted", children: subheading }) })
|
|
4927
4286
|
] }),
|
|
@@ -4933,34 +4292,16 @@ const BannerContent = ({
|
|
|
4933
4292
|
{
|
|
4934
4293
|
size: 12,
|
|
4935
4294
|
className: clx({
|
|
4936
|
-
[classes
|
|
4937
|
-
[classes
|
|
4295
|
+
[classes.chevron]: true,
|
|
4296
|
+
[classes.open]: settingsOpen
|
|
4938
4297
|
})
|
|
4939
4298
|
}
|
|
4940
4299
|
)
|
|
4941
4300
|
] }) })
|
|
4942
4301
|
] }),
|
|
4943
|
-
/* @__PURE__ */ u(
|
|
4944
|
-
|
|
4945
|
-
{
|
|
4946
|
-
className: clx({
|
|
4947
|
-
[classes$2.settings]: true
|
|
4948
|
-
}),
|
|
4949
|
-
children: /* @__PURE__ */ u(
|
|
4950
|
-
Root2,
|
|
4951
|
-
{
|
|
4952
|
-
type: "single",
|
|
4953
|
-
collapsible: true,
|
|
4954
|
-
value: openItem,
|
|
4955
|
-
onValueChange: setOpenItem,
|
|
4956
|
-
children: /* @__PURE__ */ u(k, { children: items.map((item) => /* @__PURE__ */ u(BannerItem, { ...item, openItem }, item.value)) })
|
|
4957
|
-
}
|
|
4958
|
-
)
|
|
4959
|
-
}
|
|
4960
|
-
),
|
|
4961
|
-
/* @__PURE__ */ u("div", { className: classes$2.footer, children: [
|
|
4962
|
-
/* @__PURE__ */ u("div", { className: classes$2.legal, children: privacyPolicy && /* @__PURE__ */ u(Text, { size: "caption", children: /* @__PURE__ */ u("a", { href: privacyPolicy.url, target: "_blank", children: privacyPolicy.label }) }) }),
|
|
4963
|
-
/* @__PURE__ */ u("div", { className: classes$2.actions, children: [
|
|
4302
|
+
/* @__PURE__ */ u("div", { className: classes.footer, children: [
|
|
4303
|
+
/* @__PURE__ */ u("div", { className: classes.legal, children: privacyPolicy && /* @__PURE__ */ u(Text, { size: "caption", children: /* @__PURE__ */ u("a", { href: privacyPolicy.url, target: "_blank", children: privacyPolicy.label }) }) }),
|
|
4304
|
+
/* @__PURE__ */ u("div", { className: classes.actions, children: [
|
|
4964
4305
|
/* @__PURE__ */ u(Close, { asChild: true, children: /* @__PURE__ */ u(Button, { variant: "neutral", onClick: () => onDeclineAll(), children: declineLabel }) }),
|
|
4965
4306
|
/* @__PURE__ */ u(Close, { asChild: true, children: /* @__PURE__ */ u(Button, { variant: "brand", onClick: () => onSave(), children: saveLabel }) })
|
|
4966
4307
|
] })
|