hubg-app-shell 0.1.2 → 0.1.3
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/AppShell.d.ts +18 -4
- package/dist/components/AppShell.d.ts.map +1 -1
- package/dist/components/Header.d.ts +20 -1
- package/dist/components/Header.d.ts.map +1 -1
- package/dist/components/ModuleHost.d.ts +5 -2
- package/dist/components/ModuleHost.d.ts.map +1 -1
- package/dist/components/ShellErrorBoundary.d.ts +6 -6
- package/dist/components/ShellErrorBoundary.d.ts.map +1 -1
- package/dist/components/SideNavigation.d.ts +0 -2
- package/dist/components/SideNavigation.d.ts.map +1 -1
- package/dist/components/ui/accordion.d.ts.map +1 -1
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/context/ShellContext.d.ts +3 -6
- package/dist/context/ShellContext.d.ts.map +1 -1
- package/dist/events/EventBus.d.ts +9 -4
- package/dist/events/EventBus.d.ts.map +1 -1
- package/dist/index.cjs.js +1658 -1167
- package/dist/index.cjs.js.map +23 -15
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +1774 -1279
- package/dist/index.es.js.map +23 -15
- package/dist/platform/createPlatformAPI.d.ts +9 -4
- package/dist/platform/createPlatformAPI.d.ts.map +1 -1
- package/dist/registry/ModuleRegistry.d.ts +8 -3
- package/dist/registry/ModuleRegistry.d.ts.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/types/context.d.ts +7 -3
- package/dist/types/context.d.ts.map +1 -1
- package/dist/types/module.d.ts +9 -7
- package/dist/types/module.d.ts.map +1 -1
- package/dist/types/navigation.d.ts +13 -21
- package/dist/types/navigation.d.ts.map +1 -1
- package/dist/utils/getInitials.d.ts +3 -0
- package/dist/utils/getInitials.d.ts.map +1 -0
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -65,13 +65,17 @@ var __export = (target, all) => {
|
|
|
65
65
|
// src/bundle-entry.tsx
|
|
66
66
|
var exports_bundle_entry = {};
|
|
67
67
|
__export(exports_bundle_entry, {
|
|
68
|
-
AppShell: () => AppShell
|
|
68
|
+
AppShell: () => AppShell,
|
|
69
|
+
EventBus: () => EventBus,
|
|
70
|
+
ModuleHost: () => ModuleHost,
|
|
71
|
+
ModuleRegistry: () => ModuleRegistry,
|
|
72
|
+
ShellErrorBoundary: () => ShellErrorBoundary,
|
|
73
|
+
ShellProvider: () => ShellProvider,
|
|
74
|
+
createPlatformAPI: () => createPlatformAPI,
|
|
75
|
+
useShell: () => useShell
|
|
69
76
|
});
|
|
70
77
|
module.exports = __toCommonJS(exports_bundle_entry);
|
|
71
78
|
|
|
72
|
-
// src/components/AppShell.tsx
|
|
73
|
-
var React52 = __toESM(require("react"), 1);
|
|
74
|
-
|
|
75
79
|
// src/context/ShellContext.tsx
|
|
76
80
|
var import_react = require("react");
|
|
77
81
|
var jsx_runtime = require("react/jsx-runtime");
|
|
@@ -85,27 +89,168 @@ function useShell() {
|
|
|
85
89
|
}
|
|
86
90
|
function ShellProvider({ children, initialRoute }) {
|
|
87
91
|
const [navCollapsed, setNavCollapsed] = import_react.useState(false);
|
|
88
|
-
const [pageTitle, setPageTitle] = import_react.useState(undefined);
|
|
89
92
|
const [activeRoute, setActiveRoute] = import_react.useState(initialRoute);
|
|
90
|
-
const
|
|
91
|
-
const stableSetPageTitle = import_react.useCallback((t) => setPageTitle(t), []);
|
|
92
|
-
const stableSetActiveRoute = import_react.useCallback((r) => setActiveRoute(r), []);
|
|
93
|
-
const value = import_react.useMemo(() => ({
|
|
94
|
-
navCollapsed,
|
|
95
|
-
setNavCollapsed: stableSetNavCollapsed,
|
|
96
|
-
pageTitle,
|
|
97
|
-
setPageTitle: stableSetPageTitle,
|
|
98
|
-
activeRoute,
|
|
99
|
-
setActiveRoute: stableSetActiveRoute
|
|
100
|
-
}), [navCollapsed, stableSetNavCollapsed, pageTitle, stableSetPageTitle, activeRoute, stableSetActiveRoute]);
|
|
93
|
+
const value = import_react.useMemo(() => ({ navCollapsed, setNavCollapsed, activeRoute, setActiveRoute }), [navCollapsed, activeRoute]);
|
|
101
94
|
return /* @__PURE__ */ jsx_runtime.jsx(ShellContext.Provider, {
|
|
102
95
|
value,
|
|
103
96
|
children
|
|
104
97
|
});
|
|
105
98
|
}
|
|
99
|
+
// src/events/EventBus.ts
|
|
100
|
+
class EventBus {
|
|
101
|
+
handlers = new Map;
|
|
102
|
+
onHandlerError;
|
|
103
|
+
publish(event) {
|
|
104
|
+
const bucket = this.handlers.get(event.type);
|
|
105
|
+
if (!bucket)
|
|
106
|
+
return;
|
|
107
|
+
for (const handler of [...bucket]) {
|
|
108
|
+
try {
|
|
109
|
+
handler(event);
|
|
110
|
+
} catch (err) {
|
|
111
|
+
console.error(`[AppShell EventBus] Handler error for "${event.type}"`, err);
|
|
112
|
+
this.onHandlerError?.(err, event);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
subscribe(eventType, handler) {
|
|
117
|
+
let bucket = this.handlers.get(eventType);
|
|
118
|
+
if (!bucket) {
|
|
119
|
+
bucket = new Set;
|
|
120
|
+
this.handlers.set(eventType, bucket);
|
|
121
|
+
}
|
|
122
|
+
bucket.add(handler);
|
|
123
|
+
return () => {
|
|
124
|
+
bucket.delete(handler);
|
|
125
|
+
if (bucket.size === 0)
|
|
126
|
+
this.handlers.delete(eventType);
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
clearModule(handlers) {
|
|
130
|
+
for (const unsubscribe of handlers) {
|
|
131
|
+
unsubscribe();
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
publishContextUpdate(field, value) {
|
|
135
|
+
this.publish({ type: "context:updated", payload: { [field]: value } });
|
|
136
|
+
}
|
|
137
|
+
publishThemeUpdate(payload) {
|
|
138
|
+
this.publish({ type: "theme:updated", payload });
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
// src/registry/ModuleRegistry.ts
|
|
142
|
+
class ModuleRegistry {
|
|
143
|
+
registry = new Map;
|
|
144
|
+
cache = new Map;
|
|
145
|
+
register(definition) {
|
|
146
|
+
if (this.registry.has(definition.id)) {
|
|
147
|
+
console.warn(`[AppShell ModuleRegistry] Overwriting existing module: "${definition.id}"`);
|
|
148
|
+
this.cache.delete(definition.id);
|
|
149
|
+
}
|
|
150
|
+
this.registry.set(definition.id, definition);
|
|
151
|
+
return this;
|
|
152
|
+
}
|
|
153
|
+
registerMany(definitions) {
|
|
154
|
+
for (const def of definitions)
|
|
155
|
+
this.register(def);
|
|
156
|
+
return this;
|
|
157
|
+
}
|
|
158
|
+
unregister(moduleId) {
|
|
159
|
+
this.registry.delete(moduleId);
|
|
160
|
+
this.cache.delete(moduleId);
|
|
161
|
+
return this;
|
|
162
|
+
}
|
|
163
|
+
resolve(moduleId) {
|
|
164
|
+
return this.registry.get(moduleId);
|
|
165
|
+
}
|
|
166
|
+
async load(moduleId) {
|
|
167
|
+
const cached = this.cache.get(moduleId);
|
|
168
|
+
if (cached)
|
|
169
|
+
return cached;
|
|
170
|
+
const def = this.resolve(moduleId);
|
|
171
|
+
if (!def) {
|
|
172
|
+
throw new Error(`[AppShell ModuleRegistry] Module not found: "${moduleId}"`);
|
|
173
|
+
}
|
|
174
|
+
const promise = def.load().then((mod) => {
|
|
175
|
+
if (mod.id !== moduleId) {
|
|
176
|
+
console.warn(`[AppShell ModuleRegistry] Module id mismatch: registered as "${moduleId}", module reports "${mod.id}"`);
|
|
177
|
+
}
|
|
178
|
+
return mod;
|
|
179
|
+
});
|
|
180
|
+
this.cache.set(moduleId, promise);
|
|
181
|
+
promise.catch(() => this.cache.delete(moduleId));
|
|
182
|
+
return promise;
|
|
183
|
+
}
|
|
184
|
+
isRegistered(moduleId) {
|
|
185
|
+
return this.registry.has(moduleId);
|
|
186
|
+
}
|
|
187
|
+
get registeredIds() {
|
|
188
|
+
return [...this.registry.keys()];
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
// src/platform/createPlatformAPI.ts
|
|
192
|
+
var METHODS_WITH_BODY = new Set(["POST", "PUT", "PATCH", "DELETE"]);
|
|
193
|
+
var DEFAULT_TIMEOUT_MS = 30000;
|
|
194
|
+
function createPlatformAPI(options) {
|
|
195
|
+
const {
|
|
196
|
+
moduleId,
|
|
197
|
+
getContext,
|
|
198
|
+
navigate,
|
|
199
|
+
eventBus,
|
|
200
|
+
fetchFn,
|
|
201
|
+
timeoutMs = DEFAULT_TIMEOUT_MS
|
|
202
|
+
} = options;
|
|
203
|
+
const doFetch = fetchFn ?? defaultFetch;
|
|
204
|
+
return {
|
|
205
|
+
getContext() {
|
|
206
|
+
return getContext();
|
|
207
|
+
},
|
|
208
|
+
getTheme() {
|
|
209
|
+
return getContext().theme;
|
|
210
|
+
},
|
|
211
|
+
navigate(path) {
|
|
212
|
+
navigate(path);
|
|
213
|
+
},
|
|
214
|
+
publish(event) {
|
|
215
|
+
const annotated = { ...event, _sourceModuleId: moduleId };
|
|
216
|
+
eventBus.publish(annotated);
|
|
217
|
+
},
|
|
218
|
+
subscribe(eventType, handler) {
|
|
219
|
+
return eventBus.subscribe(eventType, handler);
|
|
220
|
+
},
|
|
221
|
+
async apiRequest(request) {
|
|
222
|
+
const { method, url, data, headers } = request;
|
|
223
|
+
const hasBody = METHODS_WITH_BODY.has(method) && data !== undefined;
|
|
224
|
+
const init = {
|
|
225
|
+
method,
|
|
226
|
+
credentials: "same-origin",
|
|
227
|
+
headers: {
|
|
228
|
+
...hasBody ? { "Content-Type": "application/json" } : {},
|
|
229
|
+
...headers
|
|
230
|
+
},
|
|
231
|
+
...hasBody ? { body: JSON.stringify(data) } : {}
|
|
232
|
+
};
|
|
233
|
+
if (timeoutMs > 0 && typeof AbortController !== "undefined") {
|
|
234
|
+
const controller = new AbortController;
|
|
235
|
+
const timer = setTimeout(() => controller.abort(), timeoutMs);
|
|
236
|
+
try {
|
|
237
|
+
return await doFetch(url, { ...init, signal: controller.signal });
|
|
238
|
+
} finally {
|
|
239
|
+
clearTimeout(timer);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
return doFetch(url, init);
|
|
243
|
+
}
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
function defaultFetch(url, init) {
|
|
247
|
+
return fetch(url, init);
|
|
248
|
+
}
|
|
249
|
+
// src/components/AppShell.tsx
|
|
250
|
+
var React53 = __toESM(require("react"), 1);
|
|
106
251
|
|
|
107
|
-
// src/components/
|
|
108
|
-
var
|
|
252
|
+
// src/components/ShellErrorBoundary.tsx
|
|
253
|
+
var import_react4 = __toESM(require("react"), 1);
|
|
109
254
|
// ../../node_modules/.pnpm/lucide-react@0.511.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
|
|
110
255
|
var import_react3 = require("react");
|
|
111
256
|
|
|
@@ -180,8 +325,24 @@ var createLucideIcon = (iconName, iconNode) => {
|
|
|
180
325
|
return Component;
|
|
181
326
|
};
|
|
182
327
|
|
|
328
|
+
// ../../node_modules/.pnpm/lucide-react@0.511.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/loader-circle.js
|
|
329
|
+
var __iconNode = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]];
|
|
330
|
+
var LoaderCircle = createLucideIcon("loader-circle", __iconNode);
|
|
331
|
+
// ../../node_modules/.pnpm/lucide-react@0.511.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/triangle-alert.js
|
|
332
|
+
var __iconNode2 = [
|
|
333
|
+
[
|
|
334
|
+
"path",
|
|
335
|
+
{
|
|
336
|
+
d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",
|
|
337
|
+
key: "wmoenq"
|
|
338
|
+
}
|
|
339
|
+
],
|
|
340
|
+
["path", { d: "M12 9v4", key: "juzpu7" }],
|
|
341
|
+
["path", { d: "M12 17h.01", key: "p32p05" }]
|
|
342
|
+
];
|
|
343
|
+
var TriangleAlert = createLucideIcon("triangle-alert", __iconNode2);
|
|
183
344
|
// ../../node_modules/.pnpm/lucide-react@0.511.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/bell.js
|
|
184
|
-
var
|
|
345
|
+
var __iconNode3 = [
|
|
185
346
|
["path", { d: "M10.268 21a2 2 0 0 0 3.464 0", key: "vwvbt9" }],
|
|
186
347
|
[
|
|
187
348
|
"path",
|
|
@@ -191,38 +352,43 @@ var __iconNode = [
|
|
|
191
352
|
}
|
|
192
353
|
]
|
|
193
354
|
];
|
|
194
|
-
var Bell = createLucideIcon("bell",
|
|
355
|
+
var Bell = createLucideIcon("bell", __iconNode3);
|
|
195
356
|
// ../../node_modules/.pnpm/lucide-react@0.511.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/check.js
|
|
196
|
-
var
|
|
197
|
-
var Check = createLucideIcon("check",
|
|
198
|
-
// ../../node_modules/.pnpm/lucide-react@0.511.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/chevron-down.js
|
|
199
|
-
var __iconNode3 = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
|
|
200
|
-
var ChevronDown = createLucideIcon("chevron-down", __iconNode3);
|
|
357
|
+
var __iconNode4 = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
|
|
358
|
+
var Check = createLucideIcon("check", __iconNode4);
|
|
201
359
|
// ../../node_modules/.pnpm/lucide-react@0.511.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/chevron-left.js
|
|
202
|
-
var
|
|
203
|
-
var ChevronLeft = createLucideIcon("chevron-left",
|
|
360
|
+
var __iconNode5 = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]];
|
|
361
|
+
var ChevronLeft = createLucideIcon("chevron-left", __iconNode5);
|
|
204
362
|
// ../../node_modules/.pnpm/lucide-react@0.511.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/chevron-right.js
|
|
205
|
-
var
|
|
206
|
-
var ChevronRight = createLucideIcon("chevron-right",
|
|
363
|
+
var __iconNode6 = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
|
|
364
|
+
var ChevronRight = createLucideIcon("chevron-right", __iconNode6);
|
|
207
365
|
// ../../node_modules/.pnpm/lucide-react@0.511.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/circle.js
|
|
208
|
-
var
|
|
209
|
-
var Circle = createLucideIcon("circle",
|
|
366
|
+
var __iconNode7 = [["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]];
|
|
367
|
+
var Circle = createLucideIcon("circle", __iconNode7);
|
|
210
368
|
// ../../node_modules/.pnpm/lucide-react@0.511.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/external-link.js
|
|
211
|
-
var
|
|
369
|
+
var __iconNode8 = [
|
|
212
370
|
["path", { d: "M15 3h6v6", key: "1q9fwt" }],
|
|
213
371
|
["path", { d: "M10 14 21 3", key: "gplh6r" }],
|
|
214
372
|
["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
|
|
215
373
|
];
|
|
216
|
-
var ExternalLink = createLucideIcon("external-link",
|
|
374
|
+
var ExternalLink = createLucideIcon("external-link", __iconNode8);
|
|
217
375
|
// ../../node_modules/.pnpm/lucide-react@0.511.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/log-out.js
|
|
218
|
-
var
|
|
376
|
+
var __iconNode9 = [
|
|
219
377
|
["path", { d: "m16 17 5-5-5-5", key: "1bji2h" }],
|
|
220
378
|
["path", { d: "M21 12H9", key: "dn1m92" }],
|
|
221
379
|
["path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4", key: "1uf3rs" }]
|
|
222
380
|
];
|
|
223
|
-
var LogOut = createLucideIcon("log-out",
|
|
381
|
+
var LogOut = createLucideIcon("log-out", __iconNode9);
|
|
382
|
+
// ../../node_modules/.pnpm/lucide-react@0.511.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/refresh-cw.js
|
|
383
|
+
var __iconNode10 = [
|
|
384
|
+
["path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8", key: "v9h5vc" }],
|
|
385
|
+
["path", { d: "M21 3v5h-5", key: "1q7to0" }],
|
|
386
|
+
["path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16", key: "3uifl3" }],
|
|
387
|
+
["path", { d: "M8 16H3v5", key: "1cv678" }]
|
|
388
|
+
];
|
|
389
|
+
var RefreshCw = createLucideIcon("refresh-cw", __iconNode10);
|
|
224
390
|
// ../../node_modules/.pnpm/lucide-react@0.511.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/settings.js
|
|
225
|
-
var
|
|
391
|
+
var __iconNode11 = [
|
|
226
392
|
[
|
|
227
393
|
"path",
|
|
228
394
|
{
|
|
@@ -232,618 +398,149 @@ var __iconNode9 = [
|
|
|
232
398
|
],
|
|
233
399
|
["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
|
|
234
400
|
];
|
|
235
|
-
var Settings = createLucideIcon("settings",
|
|
401
|
+
var Settings = createLucideIcon("settings", __iconNode11);
|
|
236
402
|
// ../../node_modules/.pnpm/lucide-react@0.511.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/users.js
|
|
237
|
-
var
|
|
403
|
+
var __iconNode12 = [
|
|
238
404
|
["path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2", key: "1yyitq" }],
|
|
239
405
|
["path", { d: "M16 3.128a4 4 0 0 1 0 7.744", key: "16gr8j" }],
|
|
240
406
|
["path", { d: "M22 21v-2a4 4 0 0 0-3-3.87", key: "kshegd" }],
|
|
241
407
|
["circle", { cx: "9", cy: "7", r: "4", key: "nufk8" }]
|
|
242
408
|
];
|
|
243
|
-
var Users = createLucideIcon("users",
|
|
244
|
-
//
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
var
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
function createContext22(rootComponentName, defaultContext) {
|
|
259
|
-
const Context = React2.createContext(defaultContext);
|
|
260
|
-
Context.displayName = rootComponentName + "Context";
|
|
261
|
-
const Provider = /* @__PURE__ */ __name((props) => {
|
|
262
|
-
const { children, ...context } = props;
|
|
263
|
-
const value = React2.useMemo(() => context, Object.values(context));
|
|
264
|
-
return /* @__PURE__ */ import_jsx_runtime.jsx(Context.Provider, { value, children });
|
|
265
|
-
}, "Provider");
|
|
266
|
-
Provider.displayName = rootComponentName + "Provider";
|
|
267
|
-
function useContext22(consumerName, options = {}) {
|
|
268
|
-
const { optional = false } = options;
|
|
269
|
-
const context = React2.useContext(Context);
|
|
270
|
-
if (context)
|
|
271
|
-
return context;
|
|
272
|
-
if (defaultContext !== undefined)
|
|
273
|
-
return defaultContext;
|
|
274
|
-
if (optional)
|
|
275
|
-
return;
|
|
276
|
-
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
277
|
-
}
|
|
278
|
-
__name(useContext22, "useContext");
|
|
279
|
-
return [Provider, useContext22];
|
|
280
|
-
}
|
|
281
|
-
__name(createContext22, "createContext");
|
|
282
|
-
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
283
|
-
let defaultContexts = [];
|
|
284
|
-
function createContext3(rootComponentName, defaultContext) {
|
|
285
|
-
const BaseContext = React2.createContext(defaultContext);
|
|
286
|
-
BaseContext.displayName = rootComponentName + "Context";
|
|
287
|
-
const index = defaultContexts.length;
|
|
288
|
-
defaultContexts = [...defaultContexts, defaultContext];
|
|
289
|
-
const Provider = /* @__PURE__ */ __name((props) => {
|
|
290
|
-
const { scope, children, ...context } = props;
|
|
291
|
-
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
292
|
-
const value = React2.useMemo(() => context, Object.values(context));
|
|
293
|
-
return /* @__PURE__ */ import_jsx_runtime.jsx(Context.Provider, { value, children });
|
|
294
|
-
}, "Provider");
|
|
295
|
-
Provider.displayName = rootComponentName + "Provider";
|
|
296
|
-
function useContext22(consumerName, scope, options = {}) {
|
|
297
|
-
const { optional = false } = options;
|
|
298
|
-
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
299
|
-
const context = React2.useContext(Context);
|
|
300
|
-
if (context)
|
|
301
|
-
return context;
|
|
302
|
-
if (defaultContext !== undefined)
|
|
303
|
-
return defaultContext;
|
|
304
|
-
if (optional)
|
|
305
|
-
return;
|
|
306
|
-
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
307
|
-
}
|
|
308
|
-
__name(useContext22, "useContext");
|
|
309
|
-
return [Provider, useContext22];
|
|
310
|
-
}
|
|
311
|
-
__name(createContext3, "createContext");
|
|
312
|
-
const createScope = /* @__PURE__ */ __name(() => {
|
|
313
|
-
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
314
|
-
return React2.createContext(defaultContext);
|
|
315
|
-
});
|
|
316
|
-
return /* @__PURE__ */ __name(function useScope(scope) {
|
|
317
|
-
const contexts = scope?.[scopeName] || scopeContexts;
|
|
318
|
-
return React2.useMemo(() => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }), [scope, contexts]);
|
|
319
|
-
}, "useScope");
|
|
320
|
-
}, "createScope");
|
|
321
|
-
createScope.scopeName = scopeName;
|
|
322
|
-
return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];
|
|
323
|
-
}
|
|
324
|
-
__name(createContextScope, "createContextScope");
|
|
325
|
-
function composeContextScopes(...scopes) {
|
|
326
|
-
const baseScope = scopes[0];
|
|
327
|
-
if (scopes.length === 1)
|
|
328
|
-
return baseScope;
|
|
329
|
-
const createScope = /* @__PURE__ */ __name(() => {
|
|
330
|
-
const scopeHooks = scopes.map((createScope2) => ({
|
|
331
|
-
useScope: createScope2(),
|
|
332
|
-
scopeName: createScope2.scopeName
|
|
333
|
-
}));
|
|
334
|
-
return /* @__PURE__ */ __name(function useComposedScopes(overrideScopes) {
|
|
335
|
-
const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
|
|
336
|
-
const scopeProps = useScope(overrideScopes);
|
|
337
|
-
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
338
|
-
return { ...nextScopes2, ...currentScope };
|
|
339
|
-
}, {});
|
|
340
|
-
return React2.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
341
|
-
}, "useComposedScopes");
|
|
342
|
-
}, "createScope");
|
|
343
|
-
createScope.scopeName = baseScope.scopeName;
|
|
344
|
-
return createScope;
|
|
409
|
+
var Users = createLucideIcon("users", __iconNode12);
|
|
410
|
+
// ../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
411
|
+
function r(e) {
|
|
412
|
+
var t, f, n = "";
|
|
413
|
+
if (typeof e == "string" || typeof e == "number")
|
|
414
|
+
n += e;
|
|
415
|
+
else if (typeof e == "object")
|
|
416
|
+
if (Array.isArray(e)) {
|
|
417
|
+
var o = e.length;
|
|
418
|
+
for (t = 0;t < o; t++)
|
|
419
|
+
e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
420
|
+
} else
|
|
421
|
+
for (f in e)
|
|
422
|
+
e[f] && (n && (n += " "), n += f);
|
|
423
|
+
return n;
|
|
345
424
|
}
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
var __defProp3 = Object.defineProperty;
|
|
351
|
-
var __name2 = (target, value) => __defProp3(target, "name", { value, configurable: true });
|
|
352
|
-
function useCallbackRef(callback) {
|
|
353
|
-
const callbackRef = React3.useRef(callback);
|
|
354
|
-
React3.useEffect(() => {
|
|
355
|
-
callbackRef.current = callback;
|
|
356
|
-
});
|
|
357
|
-
return React3.useMemo(() => (...args) => callbackRef.current?.(...args), []);
|
|
425
|
+
function clsx() {
|
|
426
|
+
for (var e, t, f = 0, n = "", o = arguments.length;f < o; f++)
|
|
427
|
+
(e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
428
|
+
return n;
|
|
358
429
|
}
|
|
359
|
-
__name2(useCallbackRef, "useCallbackRef");
|
|
360
|
-
|
|
361
|
-
// ../../node_modules/.pnpm/@radix-ui+react-use-layout-effect@1.1.4_@types+react@18.3.31_react@18.3.1/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
|
|
362
|
-
var React4 = __toESM(require("react"), 1);
|
|
363
|
-
var useLayoutEffect2 = globalThis?.document ? React4.useLayoutEffect : () => {};
|
|
364
|
-
|
|
365
|
-
// ../../node_modules/.pnpm/@radix-ui+react-primitive@2.1.10_@types+react-dom@18.3.7_@types+react@18.3.31__@types+r_dba614f83980a1ab9805a3f12c0d2bc2/node_modules/@radix-ui/react-primitive/dist/index.mjs
|
|
366
|
-
var React7 = __toESM(require("react"), 1);
|
|
367
|
-
var ReactDOM = __toESM(require("react-dom"), 1);
|
|
368
430
|
|
|
369
|
-
// ../../node_modules/.pnpm
|
|
370
|
-
var
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
var __defProp4 = Object.defineProperty;
|
|
375
|
-
var __name3 = (target, value) => __defProp4(target, "name", { value, configurable: true });
|
|
376
|
-
function setRef(ref, value) {
|
|
377
|
-
if (typeof ref === "function") {
|
|
378
|
-
return ref(value);
|
|
379
|
-
} else if (ref !== null && ref !== undefined) {
|
|
380
|
-
ref.current = value;
|
|
431
|
+
// ../../node_modules/.pnpm/tailwind-merge@3.6.0/node_modules/tailwind-merge/dist/bundle-mjs.mjs
|
|
432
|
+
var concatArrays = (array1, array2) => {
|
|
433
|
+
const combinedArray = new Array(array1.length + array2.length);
|
|
434
|
+
for (let i = 0;i < array1.length; i++) {
|
|
435
|
+
combinedArray[i] = array1[i];
|
|
381
436
|
}
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
return
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
__name3(composeRefs, "composeRefs");
|
|
409
|
-
function useComposedRefs(...refs) {
|
|
410
|
-
return React5.useCallback(composeRefs(...refs), refs);
|
|
411
|
-
}
|
|
412
|
-
__name3(useComposedRefs, "useComposedRefs");
|
|
413
|
-
|
|
414
|
-
// ../../node_modules/.pnpm/@radix-ui+react-slot@1.3.3_@types+react@18.3.31_react@18.3.1/node_modules/@radix-ui/react-slot/dist/index.mjs
|
|
415
|
-
var __defProp5 = Object.defineProperty;
|
|
416
|
-
var __name4 = (target, value) => __defProp5(target, "name", { value, configurable: true });
|
|
417
|
-
function createSlot(ownerName) {
|
|
418
|
-
const Slot2 = React6.forwardRef((props, forwardedRef) => {
|
|
419
|
-
let { children, ...slotProps } = props;
|
|
420
|
-
let slottableElement = null;
|
|
421
|
-
let hasSlottable = false;
|
|
422
|
-
const newChildren = [];
|
|
423
|
-
if (isLazyComponent(children) && typeof use === "function") {
|
|
424
|
-
children = use(children._payload);
|
|
425
|
-
}
|
|
426
|
-
React6.Children.forEach(children, (maybeSlottable) => {
|
|
427
|
-
if (isSlottable(maybeSlottable)) {
|
|
428
|
-
hasSlottable = true;
|
|
429
|
-
const slottable = maybeSlottable;
|
|
430
|
-
let child = "child" in slottable.props ? slottable.props.child : slottable.props.children;
|
|
431
|
-
if (isLazyComponent(child) && typeof use === "function") {
|
|
432
|
-
child = use(child._payload);
|
|
433
|
-
}
|
|
434
|
-
slottableElement = getSlottableElementFromSlottable(slottable, child);
|
|
435
|
-
newChildren.push(slottableElement?.props?.children);
|
|
436
|
-
} else {
|
|
437
|
-
newChildren.push(maybeSlottable);
|
|
438
|
-
}
|
|
439
|
-
});
|
|
440
|
-
if (slottableElement) {
|
|
441
|
-
slottableElement = React6.cloneElement(slottableElement, undefined, newChildren);
|
|
442
|
-
} else if (!hasSlottable && React6.Children.count(children) === 1 && React6.isValidElement(children)) {
|
|
443
|
-
slottableElement = children;
|
|
437
|
+
for (let i = 0;i < array2.length; i++) {
|
|
438
|
+
combinedArray[array1.length + i] = array2[i];
|
|
439
|
+
}
|
|
440
|
+
return combinedArray;
|
|
441
|
+
};
|
|
442
|
+
var createClassValidatorObject = (classGroupId, validator) => ({
|
|
443
|
+
classGroupId,
|
|
444
|
+
validator
|
|
445
|
+
});
|
|
446
|
+
var createClassPartObject = (nextPart = new Map, validators = null, classGroupId) => ({
|
|
447
|
+
nextPart,
|
|
448
|
+
validators,
|
|
449
|
+
classGroupId
|
|
450
|
+
});
|
|
451
|
+
var CLASS_PART_SEPARATOR = "-";
|
|
452
|
+
var EMPTY_CONFLICTS = [];
|
|
453
|
+
var ARBITRARY_PROPERTY_PREFIX = "arbitrary..";
|
|
454
|
+
var createClassGroupUtils = (config) => {
|
|
455
|
+
const classMap = createClassMap(config);
|
|
456
|
+
const {
|
|
457
|
+
conflictingClassGroups,
|
|
458
|
+
conflictingClassGroupModifiers
|
|
459
|
+
} = config;
|
|
460
|
+
const getClassGroupId = (className) => {
|
|
461
|
+
if (className.startsWith("[") && className.endsWith("]")) {
|
|
462
|
+
return getGroupIdForArbitraryProperty(className);
|
|
444
463
|
}
|
|
445
|
-
const
|
|
446
|
-
const
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
464
|
+
const classParts = className.split(CLASS_PART_SEPARATOR);
|
|
465
|
+
const startIndex = classParts[0] === "" && classParts.length > 1 ? 1 : 0;
|
|
466
|
+
return getGroupRecursive(classParts, startIndex, classMap);
|
|
467
|
+
};
|
|
468
|
+
const getConflictingClassGroupIds = (classGroupId, hasPostfixModifier) => {
|
|
469
|
+
if (hasPostfixModifier) {
|
|
470
|
+
const modifierConflicts = conflictingClassGroupModifiers[classGroupId];
|
|
471
|
+
const baseConflicts = conflictingClassGroups[classGroupId];
|
|
472
|
+
if (modifierConflicts) {
|
|
473
|
+
if (baseConflicts) {
|
|
474
|
+
return concatArrays(baseConflicts, modifierConflicts);
|
|
475
|
+
}
|
|
476
|
+
return modifierConflicts;
|
|
450
477
|
}
|
|
451
|
-
return
|
|
452
|
-
}
|
|
453
|
-
const mergedProps = mergeProps(slotProps, slottableElement.props ?? {});
|
|
454
|
-
if (slottableElement.type !== React6.Fragment) {
|
|
455
|
-
mergedProps.ref = forwardedRef ? composedRef : slottableElementRef;
|
|
478
|
+
return baseConflicts || EMPTY_CONFLICTS;
|
|
456
479
|
}
|
|
457
|
-
return
|
|
458
|
-
}
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
var
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
Slottable2.__radixId = SLOTTABLE_IDENTIFIER;
|
|
469
|
-
return Slottable2;
|
|
470
|
-
}
|
|
471
|
-
__name4(createSlottable, "createSlottable");
|
|
472
|
-
var getSlottableElementFromSlottable = /* @__PURE__ */ __name4((slottable, child) => {
|
|
473
|
-
if ("child" in slottable.props) {
|
|
474
|
-
const child2 = slottable.props.child;
|
|
475
|
-
if (!React6.isValidElement(child2))
|
|
476
|
-
return null;
|
|
477
|
-
return React6.cloneElement(child2, undefined, slottable.props.children(child2.props.children));
|
|
480
|
+
return conflictingClassGroups[classGroupId] || EMPTY_CONFLICTS;
|
|
481
|
+
};
|
|
482
|
+
return {
|
|
483
|
+
getClassGroupId,
|
|
484
|
+
getConflictingClassGroupIds
|
|
485
|
+
};
|
|
486
|
+
};
|
|
487
|
+
var getGroupRecursive = (classParts, startIndex, classPartObject) => {
|
|
488
|
+
const classPathsLength = classParts.length - startIndex;
|
|
489
|
+
if (classPathsLength === 0) {
|
|
490
|
+
return classPartObject.classGroupId;
|
|
478
491
|
}
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
}
|
|
497
|
-
} else if (propName === "style") {
|
|
498
|
-
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
|
|
499
|
-
} else if (propName === "className") {
|
|
500
|
-
overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
|
|
492
|
+
const currentClassPart = classParts[startIndex];
|
|
493
|
+
const nextClassPartObject = classPartObject.nextPart.get(currentClassPart);
|
|
494
|
+
if (nextClassPartObject) {
|
|
495
|
+
const result = getGroupRecursive(classParts, startIndex + 1, nextClassPartObject);
|
|
496
|
+
if (result)
|
|
497
|
+
return result;
|
|
498
|
+
}
|
|
499
|
+
const validators = classPartObject.validators;
|
|
500
|
+
if (validators === null) {
|
|
501
|
+
return;
|
|
502
|
+
}
|
|
503
|
+
const classRest = startIndex === 0 ? classParts.join(CLASS_PART_SEPARATOR) : classParts.slice(startIndex).join(CLASS_PART_SEPARATOR);
|
|
504
|
+
const validatorsLength = validators.length;
|
|
505
|
+
for (let i = 0;i < validatorsLength; i++) {
|
|
506
|
+
const validatorObj = validators[i];
|
|
507
|
+
if (validatorObj.validator(classRest)) {
|
|
508
|
+
return validatorObj.classGroupId;
|
|
501
509
|
}
|
|
502
510
|
}
|
|
503
|
-
return
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
+
return;
|
|
512
|
+
};
|
|
513
|
+
var getGroupIdForArbitraryProperty = (className) => className.slice(1, -1).indexOf(":") === -1 ? undefined : (() => {
|
|
514
|
+
const content = className.slice(1, -1);
|
|
515
|
+
const colonIndex = content.indexOf(":");
|
|
516
|
+
const property = content.slice(0, colonIndex);
|
|
517
|
+
return property ? ARBITRARY_PROPERTY_PREFIX + property : undefined;
|
|
518
|
+
})();
|
|
519
|
+
var createClassMap = (config) => {
|
|
520
|
+
const {
|
|
521
|
+
theme,
|
|
522
|
+
classGroups
|
|
523
|
+
} = config;
|
|
524
|
+
return processClassGroups(classGroups, theme);
|
|
525
|
+
};
|
|
526
|
+
var processClassGroups = (classGroups, theme) => {
|
|
527
|
+
const classMap = createClassPartObject();
|
|
528
|
+
for (const classGroupId in classGroups) {
|
|
529
|
+
const group = classGroups[classGroupId];
|
|
530
|
+
processClassesRecursively(group, classMap, classGroupId, theme);
|
|
511
531
|
}
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
532
|
+
return classMap;
|
|
533
|
+
};
|
|
534
|
+
var processClassesRecursively = (classGroup, classPartObject, classGroupId, theme) => {
|
|
535
|
+
const len = classGroup.length;
|
|
536
|
+
for (let i = 0;i < len; i++) {
|
|
537
|
+
const classDefinition = classGroup[i];
|
|
538
|
+
processClassDefinition(classDefinition, classPartObject, classGroupId, theme);
|
|
516
539
|
}
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
return React6.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
|
522
|
-
}
|
|
523
|
-
__name4(isSlottable, "isSlottable");
|
|
524
|
-
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
|
525
|
-
function isLazyComponent(element) {
|
|
526
|
-
return element != null && typeof element === "object" && "$$typeof" in element && element.$$typeof === REACT_LAZY_TYPE && "_payload" in element && isPromiseLike(element._payload);
|
|
527
|
-
}
|
|
528
|
-
__name4(isLazyComponent, "isLazyComponent");
|
|
529
|
-
function isPromiseLike(value) {
|
|
530
|
-
return typeof value === "object" && value !== null && "then" in value;
|
|
531
|
-
}
|
|
532
|
-
__name4(isPromiseLike, "isPromiseLike");
|
|
533
|
-
var createSlotError = /* @__PURE__ */ __name4((ownerName) => {
|
|
534
|
-
return `${ownerName} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`;
|
|
535
|
-
}, "createSlotError");
|
|
536
|
-
var createSlottableError = /* @__PURE__ */ __name4((ownerName) => {
|
|
537
|
-
return `${ownerName} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`;
|
|
538
|
-
}, "createSlottableError");
|
|
539
|
-
var use = React6[" use ".trim().toString()];
|
|
540
|
-
|
|
541
|
-
// ../../node_modules/.pnpm/@radix-ui+react-primitive@2.1.10_@types+react-dom@18.3.7_@types+react@18.3.31__@types+r_dba614f83980a1ab9805a3f12c0d2bc2/node_modules/@radix-ui/react-primitive/dist/index.mjs
|
|
542
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
543
|
-
var __defProp6 = Object.defineProperty;
|
|
544
|
-
var __name5 = (target, value) => __defProp6(target, "name", { value, configurable: true });
|
|
545
|
-
var NODES = [
|
|
546
|
-
"a",
|
|
547
|
-
"button",
|
|
548
|
-
"div",
|
|
549
|
-
"form",
|
|
550
|
-
"h2",
|
|
551
|
-
"h3",
|
|
552
|
-
"img",
|
|
553
|
-
"input",
|
|
554
|
-
"label",
|
|
555
|
-
"li",
|
|
556
|
-
"nav",
|
|
557
|
-
"ol",
|
|
558
|
-
"p",
|
|
559
|
-
"select",
|
|
560
|
-
"span",
|
|
561
|
-
"svg",
|
|
562
|
-
"ul"
|
|
563
|
-
];
|
|
564
|
-
var Primitive = NODES.reduce((primitive, node) => {
|
|
565
|
-
const Slot = createSlot(`Primitive.${node}`);
|
|
566
|
-
const Node2 = React7.forwardRef((props, forwardedRef) => {
|
|
567
|
-
const { asChild, ...primitiveProps } = props;
|
|
568
|
-
const Comp = asChild ? Slot : node;
|
|
569
|
-
if (typeof window !== "undefined") {
|
|
570
|
-
window[Symbol.for("radix-ui")] = true;
|
|
571
|
-
}
|
|
572
|
-
return /* @__PURE__ */ import_jsx_runtime2.jsx(Comp, { ...primitiveProps, ref: forwardedRef });
|
|
573
|
-
});
|
|
574
|
-
Node2.displayName = `Primitive.${node}`;
|
|
575
|
-
return { ...primitive, [node]: Node2 };
|
|
576
|
-
}, {});
|
|
577
|
-
function dispatchDiscreteCustomEvent(target, event) {
|
|
578
|
-
if (target)
|
|
579
|
-
ReactDOM.flushSync(() => target.dispatchEvent(event));
|
|
580
|
-
}
|
|
581
|
-
__name5(dispatchDiscreteCustomEvent, "dispatchDiscreteCustomEvent");
|
|
582
|
-
|
|
583
|
-
// ../../node_modules/.pnpm/@radix-ui+react-avatar@1.2.6_@types+react-dom@18.3.7_@types+react@18.3.31__@types+react_e6c996e5557b18a376135b2452a80188/node_modules/@radix-ui/react-avatar/dist/index.mjs
|
|
584
|
-
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
585
|
-
"use client";
|
|
586
|
-
var __defProp7 = Object.defineProperty;
|
|
587
|
-
var __name6 = (target, value) => __defProp7(target, "name", { value, configurable: true });
|
|
588
|
-
var AVATAR_NAME = "Avatar";
|
|
589
|
-
var [createAvatarContext, createAvatarScope] = createContextScope(AVATAR_NAME);
|
|
590
|
-
var STATIC_IMAGE_COUNT_STATE = [
|
|
591
|
-
0,
|
|
592
|
-
() => {
|
|
593
|
-
return;
|
|
594
|
-
}
|
|
595
|
-
];
|
|
596
|
-
var [AvatarProvider, useAvatarContext] = createAvatarContext(AVATAR_NAME);
|
|
597
|
-
var Avatar = /* @__PURE__ */ React8.forwardRef(/* @__PURE__ */ __name6(function Avatar2(props, forwardedRef) {
|
|
598
|
-
const { __scopeAvatar, ...avatarProps } = props;
|
|
599
|
-
const [imageLoadingStatus, setImageLoadingStatus] = React8.useState("idle");
|
|
600
|
-
const [imageCount, setImageCount] = useImageCount();
|
|
601
|
-
return /* @__PURE__ */ import_jsx_runtime3.jsx(AvatarProvider, {
|
|
602
|
-
scope: __scopeAvatar,
|
|
603
|
-
imageLoadingStatus,
|
|
604
|
-
setImageLoadingStatus,
|
|
605
|
-
imageCount,
|
|
606
|
-
setImageCount,
|
|
607
|
-
children: /* @__PURE__ */ import_jsx_runtime3.jsx(Primitive.span, { ...avatarProps, ref: forwardedRef })
|
|
608
|
-
});
|
|
609
|
-
}, "Avatar"));
|
|
610
|
-
var IMAGE_NAME = "AvatarImage";
|
|
611
|
-
var AvatarImage = /* @__PURE__ */ React8.forwardRef(/* @__PURE__ */ __name6(function AvatarImage2(props, forwardedRef) {
|
|
612
|
-
const { __scopeAvatar, src, onLoadingStatusChange, ...imageProps } = props;
|
|
613
|
-
const context = useAvatarContext(IMAGE_NAME, __scopeAvatar);
|
|
614
|
-
useUpdateImageCount(context.setImageCount);
|
|
615
|
-
const imageLoadingStatus = useImageLoadingStatus(src, {
|
|
616
|
-
referrerPolicy: imageProps.referrerPolicy,
|
|
617
|
-
crossOrigin: imageProps.crossOrigin,
|
|
618
|
-
loadingStatus: context.imageLoadingStatus,
|
|
619
|
-
setLoadingStatus: context.setImageLoadingStatus
|
|
620
|
-
});
|
|
621
|
-
const handleLoadingStatusChange = useCallbackRef((status) => {
|
|
622
|
-
onLoadingStatusChange?.(status);
|
|
623
|
-
});
|
|
624
|
-
const loadingStatusRef = React8.useRef(imageLoadingStatus);
|
|
625
|
-
useLayoutEffect2(() => {
|
|
626
|
-
const previousLoadingStatus = loadingStatusRef.current;
|
|
627
|
-
loadingStatusRef.current = imageLoadingStatus;
|
|
628
|
-
if (imageLoadingStatus !== previousLoadingStatus) {
|
|
629
|
-
handleLoadingStatusChange(imageLoadingStatus);
|
|
630
|
-
}
|
|
631
|
-
}, [imageLoadingStatus, handleLoadingStatusChange]);
|
|
632
|
-
return imageLoadingStatus === "loaded" ? /* @__PURE__ */ import_jsx_runtime3.jsx(Primitive.img, { ...imageProps, ref: forwardedRef, src }) : null;
|
|
633
|
-
}, "AvatarImage"));
|
|
634
|
-
var FALLBACK_NAME = "AvatarFallback";
|
|
635
|
-
var AvatarFallback = /* @__PURE__ */ React8.forwardRef(/* @__PURE__ */ __name6(function AvatarFallback2(props, forwardedRef) {
|
|
636
|
-
const { __scopeAvatar, delayMs, ...fallbackProps } = props;
|
|
637
|
-
const context = useAvatarContext(FALLBACK_NAME, __scopeAvatar);
|
|
638
|
-
const [canRender, setCanRender] = React8.useState(delayMs === undefined);
|
|
639
|
-
React8.useEffect(() => {
|
|
640
|
-
if (delayMs !== undefined) {
|
|
641
|
-
const timerId = window.setTimeout(() => setCanRender(true), delayMs);
|
|
642
|
-
return () => window.clearTimeout(timerId);
|
|
643
|
-
}
|
|
644
|
-
}, [delayMs]);
|
|
645
|
-
return canRender && context.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ import_jsx_runtime3.jsx(Primitive.span, { ...fallbackProps, ref: forwardedRef }) : null;
|
|
646
|
-
}, "AvatarFallback"));
|
|
647
|
-
function useImageLoadingStatus(src, {
|
|
648
|
-
loadingStatus,
|
|
649
|
-
setLoadingStatus,
|
|
650
|
-
referrerPolicy,
|
|
651
|
-
crossOrigin
|
|
652
|
-
}) {
|
|
653
|
-
useLayoutEffect2(() => {
|
|
654
|
-
if (!src) {
|
|
655
|
-
setLoadingStatus("error");
|
|
656
|
-
return;
|
|
657
|
-
}
|
|
658
|
-
const image = new window.Image;
|
|
659
|
-
const handleLoad = /* @__PURE__ */ __name6((event) => {
|
|
660
|
-
const image2 = event.currentTarget;
|
|
661
|
-
setLoadingStatus(getImageLoadingStatus(image2));
|
|
662
|
-
}, "handleLoad");
|
|
663
|
-
const handleError = /* @__PURE__ */ __name6(() => setLoadingStatus("error"), "handleError");
|
|
664
|
-
image.addEventListener("load", handleLoad);
|
|
665
|
-
image.addEventListener("error", handleError);
|
|
666
|
-
if (referrerPolicy) {
|
|
667
|
-
image.referrerPolicy = referrerPolicy;
|
|
668
|
-
}
|
|
669
|
-
image.crossOrigin = crossOrigin ?? null;
|
|
670
|
-
image.src = src;
|
|
671
|
-
setLoadingStatus(getImageLoadingStatus(image));
|
|
672
|
-
return () => {
|
|
673
|
-
image.removeEventListener("load", handleLoad);
|
|
674
|
-
image.removeEventListener("error", handleError);
|
|
675
|
-
setLoadingStatus("idle");
|
|
676
|
-
};
|
|
677
|
-
}, [src, crossOrigin, referrerPolicy, setLoadingStatus]);
|
|
678
|
-
return loadingStatus;
|
|
679
|
-
}
|
|
680
|
-
__name6(useImageLoadingStatus, "useImageLoadingStatus");
|
|
681
|
-
function getImageLoadingStatus(image) {
|
|
682
|
-
return image.complete ? image.naturalWidth > 0 ? "loaded" : "error" : "loading";
|
|
683
|
-
}
|
|
684
|
-
__name6(getImageLoadingStatus, "getImageLoadingStatus");
|
|
685
|
-
function useImageCount() {
|
|
686
|
-
let state = STATIC_IMAGE_COUNT_STATE;
|
|
687
|
-
if (IS_DEVELOPMENT) {
|
|
688
|
-
state = React8.useState(0);
|
|
689
|
-
const [imageCount] = state;
|
|
690
|
-
const hasWarnedRef = React8.useRef(false);
|
|
691
|
-
React8.useEffect(() => {
|
|
692
|
-
if (imageCount > 1 && !hasWarnedRef.current) {
|
|
693
|
-
hasWarnedRef.current = true;
|
|
694
|
-
console.warn("Avatar: Only one `Avatar.Image` component should be rendered per `Avatar.Root`, but multiple were detected. This will lead to unexpected behavior.");
|
|
695
|
-
}
|
|
696
|
-
}, [imageCount]);
|
|
697
|
-
}
|
|
698
|
-
return state;
|
|
699
|
-
}
|
|
700
|
-
__name6(useImageCount, "useImageCount");
|
|
701
|
-
function useUpdateImageCount(setImageCount) {
|
|
702
|
-
if (IS_DEVELOPMENT) {
|
|
703
|
-
React8.useEffect(() => {
|
|
704
|
-
setImageCount((imageCount) => imageCount + 1);
|
|
705
|
-
return () => {
|
|
706
|
-
setImageCount((imageCount) => imageCount - 1);
|
|
707
|
-
};
|
|
708
|
-
}, [setImageCount]);
|
|
709
|
-
}
|
|
710
|
-
}
|
|
711
|
-
__name6(useUpdateImageCount, "useUpdateImageCount");
|
|
712
|
-
|
|
713
|
-
// ../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
714
|
-
function r(e) {
|
|
715
|
-
var t, f, n = "";
|
|
716
|
-
if (typeof e == "string" || typeof e == "number")
|
|
717
|
-
n += e;
|
|
718
|
-
else if (typeof e == "object")
|
|
719
|
-
if (Array.isArray(e)) {
|
|
720
|
-
var o = e.length;
|
|
721
|
-
for (t = 0;t < o; t++)
|
|
722
|
-
e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
723
|
-
} else
|
|
724
|
-
for (f in e)
|
|
725
|
-
e[f] && (n && (n += " "), n += f);
|
|
726
|
-
return n;
|
|
727
|
-
}
|
|
728
|
-
function clsx() {
|
|
729
|
-
for (var e, t, f = 0, n = "", o = arguments.length;f < o; f++)
|
|
730
|
-
(e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
731
|
-
return n;
|
|
732
|
-
}
|
|
733
|
-
|
|
734
|
-
// ../../node_modules/.pnpm/tailwind-merge@3.6.0/node_modules/tailwind-merge/dist/bundle-mjs.mjs
|
|
735
|
-
var concatArrays = (array1, array2) => {
|
|
736
|
-
const combinedArray = new Array(array1.length + array2.length);
|
|
737
|
-
for (let i = 0;i < array1.length; i++) {
|
|
738
|
-
combinedArray[i] = array1[i];
|
|
739
|
-
}
|
|
740
|
-
for (let i = 0;i < array2.length; i++) {
|
|
741
|
-
combinedArray[array1.length + i] = array2[i];
|
|
742
|
-
}
|
|
743
|
-
return combinedArray;
|
|
744
|
-
};
|
|
745
|
-
var createClassValidatorObject = (classGroupId, validator) => ({
|
|
746
|
-
classGroupId,
|
|
747
|
-
validator
|
|
748
|
-
});
|
|
749
|
-
var createClassPartObject = (nextPart = new Map, validators = null, classGroupId) => ({
|
|
750
|
-
nextPart,
|
|
751
|
-
validators,
|
|
752
|
-
classGroupId
|
|
753
|
-
});
|
|
754
|
-
var CLASS_PART_SEPARATOR = "-";
|
|
755
|
-
var EMPTY_CONFLICTS = [];
|
|
756
|
-
var ARBITRARY_PROPERTY_PREFIX = "arbitrary..";
|
|
757
|
-
var createClassGroupUtils = (config) => {
|
|
758
|
-
const classMap = createClassMap(config);
|
|
759
|
-
const {
|
|
760
|
-
conflictingClassGroups,
|
|
761
|
-
conflictingClassGroupModifiers
|
|
762
|
-
} = config;
|
|
763
|
-
const getClassGroupId = (className) => {
|
|
764
|
-
if (className.startsWith("[") && className.endsWith("]")) {
|
|
765
|
-
return getGroupIdForArbitraryProperty(className);
|
|
766
|
-
}
|
|
767
|
-
const classParts = className.split(CLASS_PART_SEPARATOR);
|
|
768
|
-
const startIndex = classParts[0] === "" && classParts.length > 1 ? 1 : 0;
|
|
769
|
-
return getGroupRecursive(classParts, startIndex, classMap);
|
|
770
|
-
};
|
|
771
|
-
const getConflictingClassGroupIds = (classGroupId, hasPostfixModifier) => {
|
|
772
|
-
if (hasPostfixModifier) {
|
|
773
|
-
const modifierConflicts = conflictingClassGroupModifiers[classGroupId];
|
|
774
|
-
const baseConflicts = conflictingClassGroups[classGroupId];
|
|
775
|
-
if (modifierConflicts) {
|
|
776
|
-
if (baseConflicts) {
|
|
777
|
-
return concatArrays(baseConflicts, modifierConflicts);
|
|
778
|
-
}
|
|
779
|
-
return modifierConflicts;
|
|
780
|
-
}
|
|
781
|
-
return baseConflicts || EMPTY_CONFLICTS;
|
|
782
|
-
}
|
|
783
|
-
return conflictingClassGroups[classGroupId] || EMPTY_CONFLICTS;
|
|
784
|
-
};
|
|
785
|
-
return {
|
|
786
|
-
getClassGroupId,
|
|
787
|
-
getConflictingClassGroupIds
|
|
788
|
-
};
|
|
789
|
-
};
|
|
790
|
-
var getGroupRecursive = (classParts, startIndex, classPartObject) => {
|
|
791
|
-
const classPathsLength = classParts.length - startIndex;
|
|
792
|
-
if (classPathsLength === 0) {
|
|
793
|
-
return classPartObject.classGroupId;
|
|
794
|
-
}
|
|
795
|
-
const currentClassPart = classParts[startIndex];
|
|
796
|
-
const nextClassPartObject = classPartObject.nextPart.get(currentClassPart);
|
|
797
|
-
if (nextClassPartObject) {
|
|
798
|
-
const result = getGroupRecursive(classParts, startIndex + 1, nextClassPartObject);
|
|
799
|
-
if (result)
|
|
800
|
-
return result;
|
|
801
|
-
}
|
|
802
|
-
const validators = classPartObject.validators;
|
|
803
|
-
if (validators === null) {
|
|
804
|
-
return;
|
|
805
|
-
}
|
|
806
|
-
const classRest = startIndex === 0 ? classParts.join(CLASS_PART_SEPARATOR) : classParts.slice(startIndex).join(CLASS_PART_SEPARATOR);
|
|
807
|
-
const validatorsLength = validators.length;
|
|
808
|
-
for (let i = 0;i < validatorsLength; i++) {
|
|
809
|
-
const validatorObj = validators[i];
|
|
810
|
-
if (validatorObj.validator(classRest)) {
|
|
811
|
-
return validatorObj.classGroupId;
|
|
812
|
-
}
|
|
813
|
-
}
|
|
814
|
-
return;
|
|
815
|
-
};
|
|
816
|
-
var getGroupIdForArbitraryProperty = (className) => className.slice(1, -1).indexOf(":") === -1 ? undefined : (() => {
|
|
817
|
-
const content = className.slice(1, -1);
|
|
818
|
-
const colonIndex = content.indexOf(":");
|
|
819
|
-
const property = content.slice(0, colonIndex);
|
|
820
|
-
return property ? ARBITRARY_PROPERTY_PREFIX + property : undefined;
|
|
821
|
-
})();
|
|
822
|
-
var createClassMap = (config) => {
|
|
823
|
-
const {
|
|
824
|
-
theme,
|
|
825
|
-
classGroups
|
|
826
|
-
} = config;
|
|
827
|
-
return processClassGroups(classGroups, theme);
|
|
828
|
-
};
|
|
829
|
-
var processClassGroups = (classGroups, theme) => {
|
|
830
|
-
const classMap = createClassPartObject();
|
|
831
|
-
for (const classGroupId in classGroups) {
|
|
832
|
-
const group = classGroups[classGroupId];
|
|
833
|
-
processClassesRecursively(group, classMap, classGroupId, theme);
|
|
834
|
-
}
|
|
835
|
-
return classMap;
|
|
836
|
-
};
|
|
837
|
-
var processClassesRecursively = (classGroup, classPartObject, classGroupId, theme) => {
|
|
838
|
-
const len = classGroup.length;
|
|
839
|
-
for (let i = 0;i < len; i++) {
|
|
840
|
-
const classDefinition = classGroup[i];
|
|
841
|
-
processClassDefinition(classDefinition, classPartObject, classGroupId, theme);
|
|
842
|
-
}
|
|
843
|
-
};
|
|
844
|
-
var processClassDefinition = (classDefinition, classPartObject, classGroupId, theme) => {
|
|
845
|
-
if (typeof classDefinition === "string") {
|
|
846
|
-
processStringDefinition(classDefinition, classPartObject, classGroupId);
|
|
540
|
+
};
|
|
541
|
+
var processClassDefinition = (classDefinition, classPartObject, classGroupId, theme) => {
|
|
542
|
+
if (typeof classDefinition === "string") {
|
|
543
|
+
processStringDefinition(classDefinition, classPartObject, classGroupId);
|
|
847
544
|
return;
|
|
848
545
|
}
|
|
849
546
|
if (typeof classDefinition === "function") {
|
|
@@ -2558,21 +2255,566 @@ function cn(...inputs) {
|
|
|
2558
2255
|
return twMerge(clsx(inputs));
|
|
2559
2256
|
}
|
|
2560
2257
|
|
|
2258
|
+
// src/components/ShellErrorBoundary.tsx
|
|
2259
|
+
var jsx_runtime2 = require("react/jsx-runtime");
|
|
2260
|
+
|
|
2261
|
+
class ShellErrorBoundary extends import_react4.default.Component {
|
|
2262
|
+
constructor(props) {
|
|
2263
|
+
super(props);
|
|
2264
|
+
this.state = { hasError: false, error: null };
|
|
2265
|
+
}
|
|
2266
|
+
static getDerivedStateFromError(error) {
|
|
2267
|
+
return { hasError: true, error };
|
|
2268
|
+
}
|
|
2269
|
+
componentDidCatch(error, info) {
|
|
2270
|
+
console.error("[AppShell] Uncaught error:", error, info.componentStack);
|
|
2271
|
+
this.props.onError?.(error, info);
|
|
2272
|
+
}
|
|
2273
|
+
handleRetry = () => {
|
|
2274
|
+
this.setState({ hasError: false, error: null });
|
|
2275
|
+
};
|
|
2276
|
+
render() {
|
|
2277
|
+
if (this.state.hasError && this.state.error) {
|
|
2278
|
+
if (this.props.fallback) {
|
|
2279
|
+
return this.props.fallback(this.state.error, this.handleRetry);
|
|
2280
|
+
}
|
|
2281
|
+
return /* @__PURE__ */ jsx_runtime2.jsx(DefaultErrorFallback, {
|
|
2282
|
+
error: this.state.error,
|
|
2283
|
+
onRetry: this.handleRetry
|
|
2284
|
+
});
|
|
2285
|
+
}
|
|
2286
|
+
return this.props.children;
|
|
2287
|
+
}
|
|
2288
|
+
}
|
|
2289
|
+
function DefaultErrorFallback({ error, onRetry }) {
|
|
2290
|
+
const message = "An unexpected error occurred. Please try again.";
|
|
2291
|
+
return /* @__PURE__ */ jsx_runtime2.jsxs("div", {
|
|
2292
|
+
role: "alert",
|
|
2293
|
+
className: cn("flex h-full flex-col items-center justify-center gap-4 p-8", "text-center"),
|
|
2294
|
+
children: [
|
|
2295
|
+
/* @__PURE__ */ jsx_runtime2.jsx("div", {
|
|
2296
|
+
className: "flex h-12 w-12 items-center justify-center rounded-full bg-status-danger-subtle",
|
|
2297
|
+
children: /* @__PURE__ */ jsx_runtime2.jsx(TriangleAlert, {
|
|
2298
|
+
className: "h-6 w-6 text-status-danger-bold",
|
|
2299
|
+
"aria-hidden": "true"
|
|
2300
|
+
})
|
|
2301
|
+
}),
|
|
2302
|
+
/* @__PURE__ */ jsx_runtime2.jsxs("div", {
|
|
2303
|
+
className: "max-w-sm space-y-1",
|
|
2304
|
+
children: [
|
|
2305
|
+
/* @__PURE__ */ jsx_runtime2.jsx("h2", {
|
|
2306
|
+
className: "text-sm font-semibold text-content-default",
|
|
2307
|
+
children: "This section failed to load"
|
|
2308
|
+
}),
|
|
2309
|
+
/* @__PURE__ */ jsx_runtime2.jsx("p", {
|
|
2310
|
+
className: "text-xs text-content-subtle",
|
|
2311
|
+
children: message
|
|
2312
|
+
})
|
|
2313
|
+
]
|
|
2314
|
+
}),
|
|
2315
|
+
/* @__PURE__ */ jsx_runtime2.jsxs("button", {
|
|
2316
|
+
type: "button",
|
|
2317
|
+
onClick: onRetry,
|
|
2318
|
+
className: cn("inline-flex items-center gap-2 rounded-radius-100", "bg-action-primary px-4 py-2 text-xs font-medium text-content-inverse", "hover:bg-action-primary-hover", "focus-visible:outline-none focus-visible:ring-2", "focus-visible:ring-action-primary focus-visible:ring-offset-2", "transition-colors"),
|
|
2319
|
+
children: [
|
|
2320
|
+
/* @__PURE__ */ jsx_runtime2.jsx(RefreshCw, {
|
|
2321
|
+
className: "h-3 w-3",
|
|
2322
|
+
"aria-hidden": "true"
|
|
2323
|
+
}),
|
|
2324
|
+
"Try again"
|
|
2325
|
+
]
|
|
2326
|
+
})
|
|
2327
|
+
]
|
|
2328
|
+
});
|
|
2329
|
+
}
|
|
2330
|
+
|
|
2331
|
+
// src/components/Header.tsx
|
|
2332
|
+
var React42 = __toESM(require("react"), 1);
|
|
2333
|
+
|
|
2334
|
+
// src/components/ui/avatar.tsx
|
|
2335
|
+
var React10 = __toESM(require("react"), 1);
|
|
2336
|
+
|
|
2337
|
+
// ../../node_modules/.pnpm/@radix-ui+react-avatar@1.2.6_@types+react-dom@18.3.7_@types+react@18.3.31__@types+react_e6c996e5557b18a376135b2452a80188/node_modules/@radix-ui/react-avatar/dist/index.mjs
|
|
2338
|
+
var React9 = __toESM(require("react"), 1);
|
|
2339
|
+
|
|
2340
|
+
// ../../node_modules/.pnpm/@radix-ui+primitive@1.1.7/node_modules/@radix-ui/primitive/dist/internal/is-development.true.mjs
|
|
2341
|
+
var IS_DEVELOPMENT = true;
|
|
2342
|
+
|
|
2343
|
+
// ../../node_modules/.pnpm/@radix-ui+react-context@1.2.2_@types+react@18.3.31_react@18.3.1/node_modules/@radix-ui/react-context/dist/index.mjs
|
|
2344
|
+
var React3 = __toESM(require("react"), 1);
|
|
2345
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
2346
|
+
var __defProp2 = Object.defineProperty;
|
|
2347
|
+
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
|
|
2348
|
+
function createContext22(rootComponentName, defaultContext) {
|
|
2349
|
+
const Context = React3.createContext(defaultContext);
|
|
2350
|
+
Context.displayName = rootComponentName + "Context";
|
|
2351
|
+
const Provider = /* @__PURE__ */ __name((props) => {
|
|
2352
|
+
const { children, ...context } = props;
|
|
2353
|
+
const value = React3.useMemo(() => context, Object.values(context));
|
|
2354
|
+
return /* @__PURE__ */ import_jsx_runtime.jsx(Context.Provider, { value, children });
|
|
2355
|
+
}, "Provider");
|
|
2356
|
+
Provider.displayName = rootComponentName + "Provider";
|
|
2357
|
+
function useContext22(consumerName, options = {}) {
|
|
2358
|
+
const { optional = false } = options;
|
|
2359
|
+
const context = React3.useContext(Context);
|
|
2360
|
+
if (context)
|
|
2361
|
+
return context;
|
|
2362
|
+
if (defaultContext !== undefined)
|
|
2363
|
+
return defaultContext;
|
|
2364
|
+
if (optional)
|
|
2365
|
+
return;
|
|
2366
|
+
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
2367
|
+
}
|
|
2368
|
+
__name(useContext22, "useContext");
|
|
2369
|
+
return [Provider, useContext22];
|
|
2370
|
+
}
|
|
2371
|
+
__name(createContext22, "createContext");
|
|
2372
|
+
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
2373
|
+
let defaultContexts = [];
|
|
2374
|
+
function createContext3(rootComponentName, defaultContext) {
|
|
2375
|
+
const BaseContext = React3.createContext(defaultContext);
|
|
2376
|
+
BaseContext.displayName = rootComponentName + "Context";
|
|
2377
|
+
const index = defaultContexts.length;
|
|
2378
|
+
defaultContexts = [...defaultContexts, defaultContext];
|
|
2379
|
+
const Provider = /* @__PURE__ */ __name((props) => {
|
|
2380
|
+
const { scope, children, ...context } = props;
|
|
2381
|
+
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
2382
|
+
const value = React3.useMemo(() => context, Object.values(context));
|
|
2383
|
+
return /* @__PURE__ */ import_jsx_runtime.jsx(Context.Provider, { value, children });
|
|
2384
|
+
}, "Provider");
|
|
2385
|
+
Provider.displayName = rootComponentName + "Provider";
|
|
2386
|
+
function useContext22(consumerName, scope, options = {}) {
|
|
2387
|
+
const { optional = false } = options;
|
|
2388
|
+
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
2389
|
+
const context = React3.useContext(Context);
|
|
2390
|
+
if (context)
|
|
2391
|
+
return context;
|
|
2392
|
+
if (defaultContext !== undefined)
|
|
2393
|
+
return defaultContext;
|
|
2394
|
+
if (optional)
|
|
2395
|
+
return;
|
|
2396
|
+
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
2397
|
+
}
|
|
2398
|
+
__name(useContext22, "useContext");
|
|
2399
|
+
return [Provider, useContext22];
|
|
2400
|
+
}
|
|
2401
|
+
__name(createContext3, "createContext");
|
|
2402
|
+
const createScope = /* @__PURE__ */ __name(() => {
|
|
2403
|
+
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
2404
|
+
return React3.createContext(defaultContext);
|
|
2405
|
+
});
|
|
2406
|
+
return /* @__PURE__ */ __name(function useScope(scope) {
|
|
2407
|
+
const contexts = scope?.[scopeName] || scopeContexts;
|
|
2408
|
+
return React3.useMemo(() => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }), [scope, contexts]);
|
|
2409
|
+
}, "useScope");
|
|
2410
|
+
}, "createScope");
|
|
2411
|
+
createScope.scopeName = scopeName;
|
|
2412
|
+
return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];
|
|
2413
|
+
}
|
|
2414
|
+
__name(createContextScope, "createContextScope");
|
|
2415
|
+
function composeContextScopes(...scopes) {
|
|
2416
|
+
const baseScope = scopes[0];
|
|
2417
|
+
if (scopes.length === 1)
|
|
2418
|
+
return baseScope;
|
|
2419
|
+
const createScope = /* @__PURE__ */ __name(() => {
|
|
2420
|
+
const scopeHooks = scopes.map((createScope2) => ({
|
|
2421
|
+
useScope: createScope2(),
|
|
2422
|
+
scopeName: createScope2.scopeName
|
|
2423
|
+
}));
|
|
2424
|
+
return /* @__PURE__ */ __name(function useComposedScopes(overrideScopes) {
|
|
2425
|
+
const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
|
|
2426
|
+
const scopeProps = useScope(overrideScopes);
|
|
2427
|
+
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
2428
|
+
return { ...nextScopes2, ...currentScope };
|
|
2429
|
+
}, {});
|
|
2430
|
+
return React3.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
2431
|
+
}, "useComposedScopes");
|
|
2432
|
+
}, "createScope");
|
|
2433
|
+
createScope.scopeName = baseScope.scopeName;
|
|
2434
|
+
return createScope;
|
|
2435
|
+
}
|
|
2436
|
+
__name(composeContextScopes, "composeContextScopes");
|
|
2437
|
+
|
|
2438
|
+
// ../../node_modules/.pnpm/@radix-ui+react-use-callback-ref@1.1.4_@types+react@18.3.31_react@18.3.1/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs
|
|
2439
|
+
var React4 = __toESM(require("react"), 1);
|
|
2440
|
+
var __defProp3 = Object.defineProperty;
|
|
2441
|
+
var __name2 = (target, value) => __defProp3(target, "name", { value, configurable: true });
|
|
2442
|
+
function useCallbackRef(callback) {
|
|
2443
|
+
const callbackRef = React4.useRef(callback);
|
|
2444
|
+
React4.useEffect(() => {
|
|
2445
|
+
callbackRef.current = callback;
|
|
2446
|
+
});
|
|
2447
|
+
return React4.useMemo(() => (...args) => callbackRef.current?.(...args), []);
|
|
2448
|
+
}
|
|
2449
|
+
__name2(useCallbackRef, "useCallbackRef");
|
|
2450
|
+
|
|
2451
|
+
// ../../node_modules/.pnpm/@radix-ui+react-use-layout-effect@1.1.4_@types+react@18.3.31_react@18.3.1/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
|
|
2452
|
+
var React5 = __toESM(require("react"), 1);
|
|
2453
|
+
var useLayoutEffect2 = globalThis?.document ? React5.useLayoutEffect : () => {};
|
|
2454
|
+
|
|
2455
|
+
// ../../node_modules/.pnpm/@radix-ui+react-primitive@2.1.10_@types+react-dom@18.3.7_@types+react@18.3.31__@types+r_dba614f83980a1ab9805a3f12c0d2bc2/node_modules/@radix-ui/react-primitive/dist/index.mjs
|
|
2456
|
+
var React8 = __toESM(require("react"), 1);
|
|
2457
|
+
var ReactDOM = __toESM(require("react-dom"), 1);
|
|
2458
|
+
|
|
2459
|
+
// ../../node_modules/.pnpm/@radix-ui+react-slot@1.3.3_@types+react@18.3.31_react@18.3.1/node_modules/@radix-ui/react-slot/dist/index.mjs
|
|
2460
|
+
var React7 = __toESM(require("react"), 1);
|
|
2461
|
+
|
|
2462
|
+
// ../../node_modules/.pnpm/@radix-ui+react-compose-refs@1.1.5_@types+react@18.3.31_react@18.3.1/node_modules/@radix-ui/react-compose-refs/dist/index.mjs
|
|
2463
|
+
var React6 = __toESM(require("react"), 1);
|
|
2464
|
+
var __defProp4 = Object.defineProperty;
|
|
2465
|
+
var __name3 = (target, value) => __defProp4(target, "name", { value, configurable: true });
|
|
2466
|
+
function setRef(ref, value) {
|
|
2467
|
+
if (typeof ref === "function") {
|
|
2468
|
+
return ref(value);
|
|
2469
|
+
} else if (ref !== null && ref !== undefined) {
|
|
2470
|
+
ref.current = value;
|
|
2471
|
+
}
|
|
2472
|
+
}
|
|
2473
|
+
__name3(setRef, "setRef");
|
|
2474
|
+
function composeRefs(...refs) {
|
|
2475
|
+
return (node) => {
|
|
2476
|
+
let hasCleanup = false;
|
|
2477
|
+
const cleanups = refs.map((ref) => {
|
|
2478
|
+
const cleanup = setRef(ref, node);
|
|
2479
|
+
if (!hasCleanup && typeof cleanup == "function") {
|
|
2480
|
+
hasCleanup = true;
|
|
2481
|
+
}
|
|
2482
|
+
return cleanup;
|
|
2483
|
+
});
|
|
2484
|
+
if (hasCleanup) {
|
|
2485
|
+
return () => {
|
|
2486
|
+
for (let i = 0;i < cleanups.length; i++) {
|
|
2487
|
+
const cleanup = cleanups[i];
|
|
2488
|
+
if (typeof cleanup == "function") {
|
|
2489
|
+
cleanup();
|
|
2490
|
+
} else {
|
|
2491
|
+
setRef(refs[i], null);
|
|
2492
|
+
}
|
|
2493
|
+
}
|
|
2494
|
+
};
|
|
2495
|
+
}
|
|
2496
|
+
};
|
|
2497
|
+
}
|
|
2498
|
+
__name3(composeRefs, "composeRefs");
|
|
2499
|
+
function useComposedRefs(...refs) {
|
|
2500
|
+
return React6.useCallback(composeRefs(...refs), refs);
|
|
2501
|
+
}
|
|
2502
|
+
__name3(useComposedRefs, "useComposedRefs");
|
|
2503
|
+
|
|
2504
|
+
// ../../node_modules/.pnpm/@radix-ui+react-slot@1.3.3_@types+react@18.3.31_react@18.3.1/node_modules/@radix-ui/react-slot/dist/index.mjs
|
|
2505
|
+
var __defProp5 = Object.defineProperty;
|
|
2506
|
+
var __name4 = (target, value) => __defProp5(target, "name", { value, configurable: true });
|
|
2507
|
+
function createSlot(ownerName) {
|
|
2508
|
+
const Slot2 = React7.forwardRef((props, forwardedRef) => {
|
|
2509
|
+
let { children, ...slotProps } = props;
|
|
2510
|
+
let slottableElement = null;
|
|
2511
|
+
let hasSlottable = false;
|
|
2512
|
+
const newChildren = [];
|
|
2513
|
+
if (isLazyComponent(children) && typeof use === "function") {
|
|
2514
|
+
children = use(children._payload);
|
|
2515
|
+
}
|
|
2516
|
+
React7.Children.forEach(children, (maybeSlottable) => {
|
|
2517
|
+
if (isSlottable(maybeSlottable)) {
|
|
2518
|
+
hasSlottable = true;
|
|
2519
|
+
const slottable = maybeSlottable;
|
|
2520
|
+
let child = "child" in slottable.props ? slottable.props.child : slottable.props.children;
|
|
2521
|
+
if (isLazyComponent(child) && typeof use === "function") {
|
|
2522
|
+
child = use(child._payload);
|
|
2523
|
+
}
|
|
2524
|
+
slottableElement = getSlottableElementFromSlottable(slottable, child);
|
|
2525
|
+
newChildren.push(slottableElement?.props?.children);
|
|
2526
|
+
} else {
|
|
2527
|
+
newChildren.push(maybeSlottable);
|
|
2528
|
+
}
|
|
2529
|
+
});
|
|
2530
|
+
if (slottableElement) {
|
|
2531
|
+
slottableElement = React7.cloneElement(slottableElement, undefined, newChildren);
|
|
2532
|
+
} else if (!hasSlottable && React7.Children.count(children) === 1 && React7.isValidElement(children)) {
|
|
2533
|
+
slottableElement = children;
|
|
2534
|
+
}
|
|
2535
|
+
const slottableElementRef = slottableElement ? getElementRef(slottableElement) : undefined;
|
|
2536
|
+
const composedRef = useComposedRefs(forwardedRef, slottableElementRef);
|
|
2537
|
+
if (!slottableElement) {
|
|
2538
|
+
if (children || children === 0) {
|
|
2539
|
+
throw new Error(hasSlottable ? createSlottableError(ownerName) : createSlotError(ownerName));
|
|
2540
|
+
}
|
|
2541
|
+
return children;
|
|
2542
|
+
}
|
|
2543
|
+
const mergedProps = mergeProps(slotProps, slottableElement.props ?? {});
|
|
2544
|
+
if (slottableElement.type !== React7.Fragment) {
|
|
2545
|
+
mergedProps.ref = forwardedRef ? composedRef : slottableElementRef;
|
|
2546
|
+
}
|
|
2547
|
+
return React7.cloneElement(slottableElement, mergedProps);
|
|
2548
|
+
});
|
|
2549
|
+
Slot2.displayName = `${ownerName}.Slot`;
|
|
2550
|
+
return Slot2;
|
|
2551
|
+
}
|
|
2552
|
+
__name4(createSlot, "createSlot");
|
|
2553
|
+
var Slot = /* @__PURE__ */ createSlot("Slot");
|
|
2554
|
+
var SLOTTABLE_IDENTIFIER = Symbol.for("radix.slottable");
|
|
2555
|
+
function createSlottable(ownerName) {
|
|
2556
|
+
const Slottable2 = /* @__PURE__ */ __name4((props) => ("child" in props) ? props.children(props.child) : props.children, "Slottable");
|
|
2557
|
+
Slottable2.displayName = `${ownerName}.Slottable`;
|
|
2558
|
+
Slottable2.__radixId = SLOTTABLE_IDENTIFIER;
|
|
2559
|
+
return Slottable2;
|
|
2560
|
+
}
|
|
2561
|
+
__name4(createSlottable, "createSlottable");
|
|
2562
|
+
var getSlottableElementFromSlottable = /* @__PURE__ */ __name4((slottable, child) => {
|
|
2563
|
+
if ("child" in slottable.props) {
|
|
2564
|
+
const child2 = slottable.props.child;
|
|
2565
|
+
if (!React7.isValidElement(child2))
|
|
2566
|
+
return null;
|
|
2567
|
+
return React7.cloneElement(child2, undefined, slottable.props.children(child2.props.children));
|
|
2568
|
+
}
|
|
2569
|
+
return React7.isValidElement(child) ? child : null;
|
|
2570
|
+
}, "getSlottableElementFromSlottable");
|
|
2571
|
+
function mergeProps(slotProps, childProps) {
|
|
2572
|
+
const overrideProps = { ...childProps };
|
|
2573
|
+
for (const propName in childProps) {
|
|
2574
|
+
const slotPropValue = slotProps[propName];
|
|
2575
|
+
const childPropValue = childProps[propName];
|
|
2576
|
+
const isHandler = /^on[A-Z]/.test(propName);
|
|
2577
|
+
if (isHandler) {
|
|
2578
|
+
if (slotPropValue && childPropValue) {
|
|
2579
|
+
overrideProps[propName] = (...args) => {
|
|
2580
|
+
const result = childPropValue(...args);
|
|
2581
|
+
slotPropValue(...args);
|
|
2582
|
+
return result;
|
|
2583
|
+
};
|
|
2584
|
+
} else if (slotPropValue) {
|
|
2585
|
+
overrideProps[propName] = slotPropValue;
|
|
2586
|
+
}
|
|
2587
|
+
} else if (propName === "style") {
|
|
2588
|
+
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
|
|
2589
|
+
} else if (propName === "className") {
|
|
2590
|
+
overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
|
|
2591
|
+
}
|
|
2592
|
+
}
|
|
2593
|
+
return { ...slotProps, ...overrideProps };
|
|
2594
|
+
}
|
|
2595
|
+
__name4(mergeProps, "mergeProps");
|
|
2596
|
+
function getElementRef(element) {
|
|
2597
|
+
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
|
2598
|
+
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
2599
|
+
if (mayWarn) {
|
|
2600
|
+
return element.ref;
|
|
2601
|
+
}
|
|
2602
|
+
getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
|
|
2603
|
+
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
2604
|
+
if (mayWarn) {
|
|
2605
|
+
return element.props.ref;
|
|
2606
|
+
}
|
|
2607
|
+
return element.props.ref || element.ref;
|
|
2608
|
+
}
|
|
2609
|
+
__name4(getElementRef, "getElementRef");
|
|
2610
|
+
function isSlottable(child) {
|
|
2611
|
+
return React7.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
|
2612
|
+
}
|
|
2613
|
+
__name4(isSlottable, "isSlottable");
|
|
2614
|
+
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
|
2615
|
+
function isLazyComponent(element) {
|
|
2616
|
+
return element != null && typeof element === "object" && "$$typeof" in element && element.$$typeof === REACT_LAZY_TYPE && "_payload" in element && isPromiseLike(element._payload);
|
|
2617
|
+
}
|
|
2618
|
+
__name4(isLazyComponent, "isLazyComponent");
|
|
2619
|
+
function isPromiseLike(value) {
|
|
2620
|
+
return typeof value === "object" && value !== null && "then" in value;
|
|
2621
|
+
}
|
|
2622
|
+
__name4(isPromiseLike, "isPromiseLike");
|
|
2623
|
+
var createSlotError = /* @__PURE__ */ __name4((ownerName) => {
|
|
2624
|
+
return `${ownerName} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`;
|
|
2625
|
+
}, "createSlotError");
|
|
2626
|
+
var createSlottableError = /* @__PURE__ */ __name4((ownerName) => {
|
|
2627
|
+
return `${ownerName} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`;
|
|
2628
|
+
}, "createSlottableError");
|
|
2629
|
+
var use = React7[" use ".trim().toString()];
|
|
2630
|
+
|
|
2631
|
+
// ../../node_modules/.pnpm/@radix-ui+react-primitive@2.1.10_@types+react-dom@18.3.7_@types+react@18.3.31__@types+r_dba614f83980a1ab9805a3f12c0d2bc2/node_modules/@radix-ui/react-primitive/dist/index.mjs
|
|
2632
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
2633
|
+
var __defProp6 = Object.defineProperty;
|
|
2634
|
+
var __name5 = (target, value) => __defProp6(target, "name", { value, configurable: true });
|
|
2635
|
+
var NODES = [
|
|
2636
|
+
"a",
|
|
2637
|
+
"button",
|
|
2638
|
+
"div",
|
|
2639
|
+
"form",
|
|
2640
|
+
"h2",
|
|
2641
|
+
"h3",
|
|
2642
|
+
"img",
|
|
2643
|
+
"input",
|
|
2644
|
+
"label",
|
|
2645
|
+
"li",
|
|
2646
|
+
"nav",
|
|
2647
|
+
"ol",
|
|
2648
|
+
"p",
|
|
2649
|
+
"select",
|
|
2650
|
+
"span",
|
|
2651
|
+
"svg",
|
|
2652
|
+
"ul"
|
|
2653
|
+
];
|
|
2654
|
+
var Primitive = NODES.reduce((primitive, node) => {
|
|
2655
|
+
const Slot = createSlot(`Primitive.${node}`);
|
|
2656
|
+
const Node2 = React8.forwardRef((props, forwardedRef) => {
|
|
2657
|
+
const { asChild, ...primitiveProps } = props;
|
|
2658
|
+
const Comp = asChild ? Slot : node;
|
|
2659
|
+
if (typeof window !== "undefined") {
|
|
2660
|
+
window[Symbol.for("radix-ui")] = true;
|
|
2661
|
+
}
|
|
2662
|
+
return /* @__PURE__ */ import_jsx_runtime2.jsx(Comp, { ...primitiveProps, ref: forwardedRef });
|
|
2663
|
+
});
|
|
2664
|
+
Node2.displayName = `Primitive.${node}`;
|
|
2665
|
+
return { ...primitive, [node]: Node2 };
|
|
2666
|
+
}, {});
|
|
2667
|
+
function dispatchDiscreteCustomEvent(target, event) {
|
|
2668
|
+
if (target)
|
|
2669
|
+
ReactDOM.flushSync(() => target.dispatchEvent(event));
|
|
2670
|
+
}
|
|
2671
|
+
__name5(dispatchDiscreteCustomEvent, "dispatchDiscreteCustomEvent");
|
|
2672
|
+
|
|
2673
|
+
// ../../node_modules/.pnpm/@radix-ui+react-avatar@1.2.6_@types+react-dom@18.3.7_@types+react@18.3.31__@types+react_e6c996e5557b18a376135b2452a80188/node_modules/@radix-ui/react-avatar/dist/index.mjs
|
|
2674
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
2675
|
+
"use client";
|
|
2676
|
+
var __defProp7 = Object.defineProperty;
|
|
2677
|
+
var __name6 = (target, value) => __defProp7(target, "name", { value, configurable: true });
|
|
2678
|
+
var AVATAR_NAME = "Avatar";
|
|
2679
|
+
var [createAvatarContext, createAvatarScope] = createContextScope(AVATAR_NAME);
|
|
2680
|
+
var STATIC_IMAGE_COUNT_STATE = [
|
|
2681
|
+
0,
|
|
2682
|
+
() => {
|
|
2683
|
+
return;
|
|
2684
|
+
}
|
|
2685
|
+
];
|
|
2686
|
+
var [AvatarProvider, useAvatarContext] = createAvatarContext(AVATAR_NAME);
|
|
2687
|
+
var Avatar = /* @__PURE__ */ React9.forwardRef(/* @__PURE__ */ __name6(function Avatar2(props, forwardedRef) {
|
|
2688
|
+
const { __scopeAvatar, ...avatarProps } = props;
|
|
2689
|
+
const [imageLoadingStatus, setImageLoadingStatus] = React9.useState("idle");
|
|
2690
|
+
const [imageCount, setImageCount] = useImageCount();
|
|
2691
|
+
return /* @__PURE__ */ import_jsx_runtime3.jsx(AvatarProvider, {
|
|
2692
|
+
scope: __scopeAvatar,
|
|
2693
|
+
imageLoadingStatus,
|
|
2694
|
+
setImageLoadingStatus,
|
|
2695
|
+
imageCount,
|
|
2696
|
+
setImageCount,
|
|
2697
|
+
children: /* @__PURE__ */ import_jsx_runtime3.jsx(Primitive.span, { ...avatarProps, ref: forwardedRef })
|
|
2698
|
+
});
|
|
2699
|
+
}, "Avatar"));
|
|
2700
|
+
var IMAGE_NAME = "AvatarImage";
|
|
2701
|
+
var AvatarImage = /* @__PURE__ */ React9.forwardRef(/* @__PURE__ */ __name6(function AvatarImage2(props, forwardedRef) {
|
|
2702
|
+
const { __scopeAvatar, src, onLoadingStatusChange, ...imageProps } = props;
|
|
2703
|
+
const context = useAvatarContext(IMAGE_NAME, __scopeAvatar);
|
|
2704
|
+
useUpdateImageCount(context.setImageCount);
|
|
2705
|
+
const imageLoadingStatus = useImageLoadingStatus(src, {
|
|
2706
|
+
referrerPolicy: imageProps.referrerPolicy,
|
|
2707
|
+
crossOrigin: imageProps.crossOrigin,
|
|
2708
|
+
loadingStatus: context.imageLoadingStatus,
|
|
2709
|
+
setLoadingStatus: context.setImageLoadingStatus
|
|
2710
|
+
});
|
|
2711
|
+
const handleLoadingStatusChange = useCallbackRef((status) => {
|
|
2712
|
+
onLoadingStatusChange?.(status);
|
|
2713
|
+
});
|
|
2714
|
+
const loadingStatusRef = React9.useRef(imageLoadingStatus);
|
|
2715
|
+
useLayoutEffect2(() => {
|
|
2716
|
+
const previousLoadingStatus = loadingStatusRef.current;
|
|
2717
|
+
loadingStatusRef.current = imageLoadingStatus;
|
|
2718
|
+
if (imageLoadingStatus !== previousLoadingStatus) {
|
|
2719
|
+
handleLoadingStatusChange(imageLoadingStatus);
|
|
2720
|
+
}
|
|
2721
|
+
}, [imageLoadingStatus, handleLoadingStatusChange]);
|
|
2722
|
+
return imageLoadingStatus === "loaded" ? /* @__PURE__ */ import_jsx_runtime3.jsx(Primitive.img, { ...imageProps, ref: forwardedRef, src }) : null;
|
|
2723
|
+
}, "AvatarImage"));
|
|
2724
|
+
var FALLBACK_NAME = "AvatarFallback";
|
|
2725
|
+
var AvatarFallback = /* @__PURE__ */ React9.forwardRef(/* @__PURE__ */ __name6(function AvatarFallback2(props, forwardedRef) {
|
|
2726
|
+
const { __scopeAvatar, delayMs, ...fallbackProps } = props;
|
|
2727
|
+
const context = useAvatarContext(FALLBACK_NAME, __scopeAvatar);
|
|
2728
|
+
const [canRender, setCanRender] = React9.useState(delayMs === undefined);
|
|
2729
|
+
React9.useEffect(() => {
|
|
2730
|
+
if (delayMs !== undefined) {
|
|
2731
|
+
const timerId = window.setTimeout(() => setCanRender(true), delayMs);
|
|
2732
|
+
return () => window.clearTimeout(timerId);
|
|
2733
|
+
}
|
|
2734
|
+
}, [delayMs]);
|
|
2735
|
+
return canRender && context.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ import_jsx_runtime3.jsx(Primitive.span, { ...fallbackProps, ref: forwardedRef }) : null;
|
|
2736
|
+
}, "AvatarFallback"));
|
|
2737
|
+
function useImageLoadingStatus(src, {
|
|
2738
|
+
loadingStatus,
|
|
2739
|
+
setLoadingStatus,
|
|
2740
|
+
referrerPolicy,
|
|
2741
|
+
crossOrigin
|
|
2742
|
+
}) {
|
|
2743
|
+
useLayoutEffect2(() => {
|
|
2744
|
+
if (!src) {
|
|
2745
|
+
setLoadingStatus("error");
|
|
2746
|
+
return;
|
|
2747
|
+
}
|
|
2748
|
+
const image = new window.Image;
|
|
2749
|
+
const handleLoad = /* @__PURE__ */ __name6((event) => {
|
|
2750
|
+
const image2 = event.currentTarget;
|
|
2751
|
+
setLoadingStatus(getImageLoadingStatus(image2));
|
|
2752
|
+
}, "handleLoad");
|
|
2753
|
+
const handleError = /* @__PURE__ */ __name6(() => setLoadingStatus("error"), "handleError");
|
|
2754
|
+
image.addEventListener("load", handleLoad);
|
|
2755
|
+
image.addEventListener("error", handleError);
|
|
2756
|
+
if (referrerPolicy) {
|
|
2757
|
+
image.referrerPolicy = referrerPolicy;
|
|
2758
|
+
}
|
|
2759
|
+
image.crossOrigin = crossOrigin ?? null;
|
|
2760
|
+
image.src = src;
|
|
2761
|
+
setLoadingStatus(getImageLoadingStatus(image));
|
|
2762
|
+
return () => {
|
|
2763
|
+
image.removeEventListener("load", handleLoad);
|
|
2764
|
+
image.removeEventListener("error", handleError);
|
|
2765
|
+
setLoadingStatus("idle");
|
|
2766
|
+
};
|
|
2767
|
+
}, [src, crossOrigin, referrerPolicy, setLoadingStatus]);
|
|
2768
|
+
return loadingStatus;
|
|
2769
|
+
}
|
|
2770
|
+
__name6(useImageLoadingStatus, "useImageLoadingStatus");
|
|
2771
|
+
function getImageLoadingStatus(image) {
|
|
2772
|
+
return image.complete ? image.naturalWidth > 0 ? "loaded" : "error" : "loading";
|
|
2773
|
+
}
|
|
2774
|
+
__name6(getImageLoadingStatus, "getImageLoadingStatus");
|
|
2775
|
+
function useImageCount() {
|
|
2776
|
+
let state = STATIC_IMAGE_COUNT_STATE;
|
|
2777
|
+
if (IS_DEVELOPMENT) {
|
|
2778
|
+
state = React9.useState(0);
|
|
2779
|
+
const [imageCount] = state;
|
|
2780
|
+
const hasWarnedRef = React9.useRef(false);
|
|
2781
|
+
React9.useEffect(() => {
|
|
2782
|
+
if (imageCount > 1 && !hasWarnedRef.current) {
|
|
2783
|
+
hasWarnedRef.current = true;
|
|
2784
|
+
console.warn("Avatar: Only one `Avatar.Image` component should be rendered per `Avatar.Root`, but multiple were detected. This will lead to unexpected behavior.");
|
|
2785
|
+
}
|
|
2786
|
+
}, [imageCount]);
|
|
2787
|
+
}
|
|
2788
|
+
return state;
|
|
2789
|
+
}
|
|
2790
|
+
__name6(useImageCount, "useImageCount");
|
|
2791
|
+
function useUpdateImageCount(setImageCount) {
|
|
2792
|
+
if (IS_DEVELOPMENT) {
|
|
2793
|
+
React9.useEffect(() => {
|
|
2794
|
+
setImageCount((imageCount) => imageCount + 1);
|
|
2795
|
+
return () => {
|
|
2796
|
+
setImageCount((imageCount) => imageCount - 1);
|
|
2797
|
+
};
|
|
2798
|
+
}, [setImageCount]);
|
|
2799
|
+
}
|
|
2800
|
+
}
|
|
2801
|
+
__name6(useUpdateImageCount, "useUpdateImageCount");
|
|
2802
|
+
|
|
2561
2803
|
// src/components/ui/avatar.tsx
|
|
2562
|
-
var
|
|
2563
|
-
var Avatar2 =
|
|
2804
|
+
var jsx_runtime3 = require("react/jsx-runtime");
|
|
2805
|
+
var Avatar2 = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx_runtime3.jsx(Avatar, {
|
|
2564
2806
|
ref,
|
|
2565
2807
|
className: cn("relative flex h-8 w-8 shrink-0 overflow-hidden rounded-full", className),
|
|
2566
2808
|
...props
|
|
2567
2809
|
}));
|
|
2568
2810
|
Avatar2.displayName = Avatar.displayName;
|
|
2569
|
-
var AvatarImage2 =
|
|
2811
|
+
var AvatarImage2 = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx_runtime3.jsx(AvatarImage, {
|
|
2570
2812
|
ref,
|
|
2571
2813
|
className: cn("aspect-square h-full w-full object-cover", className),
|
|
2572
2814
|
...props
|
|
2573
2815
|
}));
|
|
2574
2816
|
AvatarImage2.displayName = AvatarImage.displayName;
|
|
2575
|
-
var AvatarFallback2 =
|
|
2817
|
+
var AvatarFallback2 = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx_runtime3.jsx(AvatarFallback, {
|
|
2576
2818
|
ref,
|
|
2577
2819
|
className: cn("flex h-full w-full items-center justify-center rounded-full", "bg-action-primary text-xs font-semibold text-content-inverse", className),
|
|
2578
2820
|
...props
|
|
@@ -2580,10 +2822,10 @@ var AvatarFallback2 = React9.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
2580
2822
|
AvatarFallback2.displayName = AvatarFallback.displayName;
|
|
2581
2823
|
|
|
2582
2824
|
// src/components/ui/dropdown-menu.tsx
|
|
2583
|
-
var
|
|
2825
|
+
var React39 = __toESM(require("react"), 1);
|
|
2584
2826
|
|
|
2585
2827
|
// ../../node_modules/.pnpm/@radix-ui+react-dropdown-menu@2.1.24_@types+react-dom@18.3.7_@types+react@18.3.31__@typ_cccb57b67c4362d4d715c3f09d78a900/node_modules/@radix-ui/react-dropdown-menu/dist/index.mjs
|
|
2586
|
-
var
|
|
2828
|
+
var React38 = __toESM(require("react"), 1);
|
|
2587
2829
|
|
|
2588
2830
|
// ../../node_modules/.pnpm/@radix-ui+primitive@1.1.7/node_modules/@radix-ui/primitive/dist/index.mjs
|
|
2589
2831
|
var __defProp8 = Object.defineProperty;
|
|
@@ -2638,20 +2880,20 @@ function isFrame(element) {
|
|
|
2638
2880
|
__name7(isFrame, "isFrame");
|
|
2639
2881
|
|
|
2640
2882
|
// ../../node_modules/.pnpm/@radix-ui+react-use-controllable-state@1.2.6_@types+react@18.3.31_react@18.3.1/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
|
|
2641
|
-
var
|
|
2883
|
+
var React12 = __toESM(require("react"), 1);
|
|
2642
2884
|
var React22 = __toESM(require("react"), 1);
|
|
2643
2885
|
|
|
2644
2886
|
// ../../node_modules/.pnpm/@radix-ui+react-use-effect-event@0.0.5_@types+react@18.3.31_react@18.3.1/node_modules/@radix-ui/react-use-effect-event/dist/index.mjs
|
|
2645
|
-
var
|
|
2887
|
+
var React11 = __toESM(require("react"), 1);
|
|
2646
2888
|
var __defProp9 = Object.defineProperty;
|
|
2647
2889
|
var __name8 = (target, value) => __defProp9(target, "name", { value, configurable: true });
|
|
2648
|
-
var useReactEffectEvent =
|
|
2649
|
-
var useReactInsertionEffect =
|
|
2890
|
+
var useReactEffectEvent = React11[" useEffectEvent ".trim().toString()];
|
|
2891
|
+
var useReactInsertionEffect = React11[" useInsertionEffect ".trim().toString()];
|
|
2650
2892
|
function useEffectEvent(callback) {
|
|
2651
2893
|
if (typeof useReactEffectEvent === "function") {
|
|
2652
2894
|
return useReactEffectEvent(callback);
|
|
2653
2895
|
}
|
|
2654
|
-
const ref =
|
|
2896
|
+
const ref = React11.useRef(() => {
|
|
2655
2897
|
throw new Error("Cannot call an event handler while rendering.");
|
|
2656
2898
|
});
|
|
2657
2899
|
if (typeof useReactInsertionEffect === "function") {
|
|
@@ -2663,14 +2905,14 @@ function useEffectEvent(callback) {
|
|
|
2663
2905
|
ref.current = callback;
|
|
2664
2906
|
});
|
|
2665
2907
|
}
|
|
2666
|
-
return
|
|
2908
|
+
return React11.useMemo(() => (...args) => ref.current?.(...args), []);
|
|
2667
2909
|
}
|
|
2668
2910
|
__name8(useEffectEvent, "useEffectEvent");
|
|
2669
2911
|
|
|
2670
2912
|
// ../../node_modules/.pnpm/@radix-ui+react-use-controllable-state@1.2.6_@types+react@18.3.31_react@18.3.1/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
|
|
2671
2913
|
var __defProp10 = Object.defineProperty;
|
|
2672
2914
|
var __name9 = (target, value) => __defProp10(target, "name", { value, configurable: true });
|
|
2673
|
-
var useInsertionEffect =
|
|
2915
|
+
var useInsertionEffect = React12[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
|
|
2674
2916
|
function useControllableState({
|
|
2675
2917
|
prop,
|
|
2676
2918
|
defaultProp,
|
|
@@ -2684,8 +2926,8 @@ function useControllableState({
|
|
|
2684
2926
|
const isControlled = prop !== undefined;
|
|
2685
2927
|
const value = isControlled ? prop : uncontrolledProp;
|
|
2686
2928
|
if (IS_DEVELOPMENT) {
|
|
2687
|
-
const isControlledRef =
|
|
2688
|
-
|
|
2929
|
+
const isControlledRef = React12.useRef(prop !== undefined);
|
|
2930
|
+
React12.useEffect(() => {
|
|
2689
2931
|
const wasControlled = isControlledRef.current;
|
|
2690
2932
|
if (wasControlled !== isControlled) {
|
|
2691
2933
|
const from = wasControlled ? "controlled" : "uncontrolled";
|
|
@@ -2695,7 +2937,7 @@ function useControllableState({
|
|
|
2695
2937
|
isControlledRef.current = isControlled;
|
|
2696
2938
|
}, [isControlled, caller]);
|
|
2697
2939
|
}
|
|
2698
|
-
const setValue =
|
|
2940
|
+
const setValue = React12.useCallback((nextValue) => {
|
|
2699
2941
|
if (isControlled) {
|
|
2700
2942
|
const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;
|
|
2701
2943
|
if (value2 !== prop) {
|
|
@@ -2712,13 +2954,13 @@ function useUncontrolledState({
|
|
|
2712
2954
|
defaultProp,
|
|
2713
2955
|
onChange
|
|
2714
2956
|
}) {
|
|
2715
|
-
const [value, setValue] =
|
|
2716
|
-
const prevValueRef =
|
|
2717
|
-
const onChangeRef =
|
|
2957
|
+
const [value, setValue] = React12.useState(defaultProp);
|
|
2958
|
+
const prevValueRef = React12.useRef(value);
|
|
2959
|
+
const onChangeRef = React12.useRef(onChange);
|
|
2718
2960
|
useInsertionEffect(() => {
|
|
2719
2961
|
onChangeRef.current = onChange;
|
|
2720
2962
|
}, [onChange]);
|
|
2721
|
-
|
|
2963
|
+
React12.useEffect(() => {
|
|
2722
2964
|
if (prevValueRef.current !== value) {
|
|
2723
2965
|
onChangeRef.current?.(value);
|
|
2724
2966
|
prevValueRef.current = value;
|
|
@@ -2789,10 +3031,10 @@ function useControllableStateReducer(reducer, userArgs, initialArg, init) {
|
|
|
2789
3031
|
__name9(useControllableStateReducer, "useControllableStateReducer");
|
|
2790
3032
|
|
|
2791
3033
|
// ../../node_modules/.pnpm/@radix-ui+react-menu@2.1.24_@types+react-dom@18.3.7_@types+react@18.3.31__@types+react@_5916b0f50695b0c3786ad7b8ea8d8ac9/node_modules/@radix-ui/react-menu/dist/index.mjs
|
|
2792
|
-
var
|
|
3034
|
+
var React37 = __toESM(require("react"), 1);
|
|
2793
3035
|
|
|
2794
3036
|
// ../../node_modules/.pnpm/@radix-ui+react-collection@1.1.15_@types+react-dom@18.3.7_@types+react@18.3.31__@types+_e568781db46e6f5e62f713df7975a3a9/node_modules/@radix-ui/react-collection/dist/index.mjs
|
|
2795
|
-
var
|
|
3037
|
+
var React13 = __toESM(require("react"), 1);
|
|
2796
3038
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
2797
3039
|
var React23 = __toESM(require("react"), 1);
|
|
2798
3040
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
@@ -2805,14 +3047,14 @@ function createCollection(name) {
|
|
|
2805
3047
|
const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(PROVIDER_NAME, { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map });
|
|
2806
3048
|
const CollectionProvider = /* @__PURE__ */ __name10((props) => {
|
|
2807
3049
|
const { scope, children } = props;
|
|
2808
|
-
const ref =
|
|
2809
|
-
const itemMap =
|
|
3050
|
+
const ref = React13.useRef(null);
|
|
3051
|
+
const itemMap = React13.useRef(/* @__PURE__ */ new Map).current;
|
|
2810
3052
|
return /* @__PURE__ */ import_jsx_runtime4.jsx(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children });
|
|
2811
3053
|
}, "CollectionProvider");
|
|
2812
3054
|
CollectionProvider.displayName = PROVIDER_NAME;
|
|
2813
3055
|
const COLLECTION_SLOT_NAME = name + "CollectionSlot";
|
|
2814
3056
|
const CollectionSlotImpl = createSlot(COLLECTION_SLOT_NAME);
|
|
2815
|
-
const CollectionSlot =
|
|
3057
|
+
const CollectionSlot = React13.forwardRef((props, forwardedRef) => {
|
|
2816
3058
|
const { scope, children } = props;
|
|
2817
3059
|
const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
|
|
2818
3060
|
const composedRefs = useComposedRefs(forwardedRef, context.collectionRef);
|
|
@@ -2822,12 +3064,12 @@ function createCollection(name) {
|
|
|
2822
3064
|
const ITEM_SLOT_NAME = name + "CollectionItemSlot";
|
|
2823
3065
|
const ITEM_DATA_ATTR = "data-radix-collection-item";
|
|
2824
3066
|
const CollectionItemSlotImpl = createSlot(ITEM_SLOT_NAME);
|
|
2825
|
-
const CollectionItemSlot =
|
|
3067
|
+
const CollectionItemSlot = React13.forwardRef((props, forwardedRef) => {
|
|
2826
3068
|
const { scope, children, ...itemData } = props;
|
|
2827
|
-
const ref =
|
|
3069
|
+
const ref = React13.useRef(null);
|
|
2828
3070
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
2829
3071
|
const context = useCollectionContext(ITEM_SLOT_NAME, scope);
|
|
2830
|
-
|
|
3072
|
+
React13.useEffect(() => {
|
|
2831
3073
|
context.itemMap.set(ref, { ref, ...itemData });
|
|
2832
3074
|
return () => void context.itemMap.delete(ref);
|
|
2833
3075
|
});
|
|
@@ -2836,7 +3078,7 @@ function createCollection(name) {
|
|
|
2836
3078
|
CollectionItemSlot.displayName = ITEM_SLOT_NAME;
|
|
2837
3079
|
function useCollection(scope) {
|
|
2838
3080
|
const context = useCollectionContext(name + "CollectionConsumer", scope);
|
|
2839
|
-
const getItems =
|
|
3081
|
+
const getItems = React13.useCallback(() => {
|
|
2840
3082
|
const collectionNode = context.collectionRef.current;
|
|
2841
3083
|
if (!collectionNode)
|
|
2842
3084
|
return [];
|
|
@@ -3323,20 +3565,20 @@ function getChildListObserver(callback) {
|
|
|
3323
3565
|
__name10(getChildListObserver, "getChildListObserver");
|
|
3324
3566
|
|
|
3325
3567
|
// ../../node_modules/.pnpm/@radix-ui+react-direction@1.1.4_@types+react@18.3.31_react@18.3.1/node_modules/@radix-ui/react-direction/dist/index.mjs
|
|
3326
|
-
var
|
|
3568
|
+
var React14 = __toESM(require("react"), 1);
|
|
3327
3569
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
3328
3570
|
"use client";
|
|
3329
3571
|
var __defProp12 = Object.defineProperty;
|
|
3330
3572
|
var __name11 = (target, value) => __defProp12(target, "name", { value, configurable: true });
|
|
3331
|
-
var DirectionContext =
|
|
3573
|
+
var DirectionContext = React14.createContext(undefined);
|
|
3332
3574
|
function useDirection(localDir) {
|
|
3333
|
-
const globalDir =
|
|
3575
|
+
const globalDir = React14.useContext(DirectionContext);
|
|
3334
3576
|
return localDir || globalDir || "ltr";
|
|
3335
3577
|
}
|
|
3336
3578
|
__name11(useDirection, "useDirection");
|
|
3337
3579
|
|
|
3338
3580
|
// ../../node_modules/.pnpm/@radix-ui+react-dismissable-layer@1.1.19_@types+react-dom@18.3.7_@types+react@18.3.31___4f2024a88a120e800aa2287adeb24710/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
|
|
3339
|
-
var
|
|
3581
|
+
var React15 = __toESM(require("react"), 1);
|
|
3340
3582
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
3341
3583
|
"use client";
|
|
3342
3584
|
var __defProp13 = Object.defineProperty;
|
|
@@ -3345,13 +3587,13 @@ var CONTEXT_UPDATE = "dismissableLayer.update";
|
|
|
3345
3587
|
var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
|
|
3346
3588
|
var FOCUS_OUTSIDE = "dismissableLayer.focusOutside";
|
|
3347
3589
|
var originalBodyPointerEvents;
|
|
3348
|
-
var DismissableLayerContext =
|
|
3590
|
+
var DismissableLayerContext = React15.createContext({
|
|
3349
3591
|
layers: /* @__PURE__ */ new Set,
|
|
3350
3592
|
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set,
|
|
3351
3593
|
branches: /* @__PURE__ */ new Set,
|
|
3352
3594
|
dismissableSurfaces: /* @__PURE__ */ new Set
|
|
3353
3595
|
});
|
|
3354
|
-
var DismissableLayer = /* @__PURE__ */
|
|
3596
|
+
var DismissableLayer = /* @__PURE__ */ React15.forwardRef(/* @__PURE__ */ __name12(function DismissableLayer2(props, forwardedRef) {
|
|
3355
3597
|
const {
|
|
3356
3598
|
disableOutsidePointerEvents = false,
|
|
3357
3599
|
deferPointerDownOutside = false,
|
|
@@ -3362,10 +3604,10 @@ var DismissableLayer = /* @__PURE__ */ React14.forwardRef(/* @__PURE__ */ __name
|
|
|
3362
3604
|
onDismiss,
|
|
3363
3605
|
...layerProps
|
|
3364
3606
|
} = props;
|
|
3365
|
-
const context =
|
|
3366
|
-
const [node, setNode] =
|
|
3607
|
+
const context = React15.useContext(DismissableLayerContext);
|
|
3608
|
+
const [node, setNode] = React15.useState(null);
|
|
3367
3609
|
const ownerDocument = node?.ownerDocument ?? globalThis?.document;
|
|
3368
|
-
const [, force] =
|
|
3610
|
+
const [, force] = React15.useState({});
|
|
3369
3611
|
const composedRefs = useComposedRefs(forwardedRef, setNode);
|
|
3370
3612
|
const layers = Array.from(context.layers);
|
|
3371
3613
|
const [highestLayerWithOutsidePointerEventsDisabled] = [
|
|
@@ -3375,7 +3617,7 @@ var DismissableLayer = /* @__PURE__ */ React14.forwardRef(/* @__PURE__ */ __name
|
|
|
3375
3617
|
const index = node ? layers.indexOf(node) : -1;
|
|
3376
3618
|
const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;
|
|
3377
3619
|
const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;
|
|
3378
|
-
const isDeferredPointerDownOutsideRef =
|
|
3620
|
+
const isDeferredPointerDownOutsideRef = React15.useRef(false);
|
|
3379
3621
|
const pointerDownOutside = usePointerDownOutside((event) => {
|
|
3380
3622
|
onPointerDownOutside?.(event);
|
|
3381
3623
|
onInteractOutside?.(event);
|
|
@@ -3386,7 +3628,7 @@ var DismissableLayer = /* @__PURE__ */ React14.forwardRef(/* @__PURE__ */ __name
|
|
|
3386
3628
|
deferPointerDownOutside,
|
|
3387
3629
|
isDeferredPointerDownOutsideRef,
|
|
3388
3630
|
dismissableSurfaces: context.dismissableSurfaces,
|
|
3389
|
-
shouldHandlePointerDownOutside:
|
|
3631
|
+
shouldHandlePointerDownOutside: React15.useCallback((target) => {
|
|
3390
3632
|
if (!(target instanceof Node)) {
|
|
3391
3633
|
return false;
|
|
3392
3634
|
}
|
|
@@ -3418,14 +3660,14 @@ var DismissableLayer = /* @__PURE__ */ React14.forwardRef(/* @__PURE__ */ __name
|
|
|
3418
3660
|
onDismiss();
|
|
3419
3661
|
}
|
|
3420
3662
|
});
|
|
3421
|
-
|
|
3663
|
+
React15.useEffect(() => {
|
|
3422
3664
|
if (!isHighestLayer) {
|
|
3423
3665
|
return;
|
|
3424
3666
|
}
|
|
3425
3667
|
ownerDocument.addEventListener("keydown", handleKeyDown, { capture: true });
|
|
3426
3668
|
return () => ownerDocument.removeEventListener("keydown", handleKeyDown, { capture: true });
|
|
3427
3669
|
}, [ownerDocument, isHighestLayer, handleKeyDown]);
|
|
3428
|
-
|
|
3670
|
+
React15.useEffect(() => {
|
|
3429
3671
|
if (!node)
|
|
3430
3672
|
return;
|
|
3431
3673
|
if (disableOutsidePointerEvents) {
|
|
@@ -3446,7 +3688,7 @@ var DismissableLayer = /* @__PURE__ */ React14.forwardRef(/* @__PURE__ */ __name
|
|
|
3446
3688
|
}
|
|
3447
3689
|
};
|
|
3448
3690
|
}, [node, ownerDocument, disableOutsidePointerEvents, context]);
|
|
3449
|
-
|
|
3691
|
+
React15.useEffect(() => {
|
|
3450
3692
|
return () => {
|
|
3451
3693
|
if (!node)
|
|
3452
3694
|
return;
|
|
@@ -3455,7 +3697,7 @@ var DismissableLayer = /* @__PURE__ */ React14.forwardRef(/* @__PURE__ */ __name
|
|
|
3455
3697
|
dispatchUpdate();
|
|
3456
3698
|
};
|
|
3457
3699
|
}, [node, context]);
|
|
3458
|
-
|
|
3700
|
+
React15.useEffect(() => {
|
|
3459
3701
|
const handleUpdate = /* @__PURE__ */ __name12(() => force({}), "handleUpdate");
|
|
3460
3702
|
document.addEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
3461
3703
|
return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
@@ -3473,9 +3715,9 @@ var DismissableLayer = /* @__PURE__ */ React14.forwardRef(/* @__PURE__ */ __name
|
|
|
3473
3715
|
});
|
|
3474
3716
|
}, "DismissableLayer"));
|
|
3475
3717
|
function useDismissableLayerSurface() {
|
|
3476
|
-
const context =
|
|
3477
|
-
const [node, setNode] =
|
|
3478
|
-
|
|
3718
|
+
const context = React15.useContext(DismissableLayerContext);
|
|
3719
|
+
const [node, setNode] = React15.useState(null);
|
|
3720
|
+
React15.useEffect(() => {
|
|
3479
3721
|
if (!node) {
|
|
3480
3722
|
return;
|
|
3481
3723
|
}
|
|
@@ -3497,11 +3739,11 @@ function usePointerDownOutside(onPointerDownOutside, args) {
|
|
|
3497
3739
|
shouldHandlePointerDownOutside = IS_TRUE
|
|
3498
3740
|
} = args;
|
|
3499
3741
|
const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);
|
|
3500
|
-
const isPointerInsideReactTreeRef =
|
|
3501
|
-
const isPointerDownOutsideRef =
|
|
3502
|
-
const interceptedOutsideInteractionEventsRef =
|
|
3503
|
-
const handleClickRef =
|
|
3504
|
-
|
|
3742
|
+
const isPointerInsideReactTreeRef = React15.useRef(false);
|
|
3743
|
+
const isPointerDownOutsideRef = React15.useRef(false);
|
|
3744
|
+
const interceptedOutsideInteractionEventsRef = React15.useRef(/* @__PURE__ */ new Map);
|
|
3745
|
+
const handleClickRef = React15.useRef(() => {});
|
|
3746
|
+
React15.useEffect(() => {
|
|
3505
3747
|
function resetOutsideInteraction() {
|
|
3506
3748
|
isPointerDownOutsideRef.current = false;
|
|
3507
3749
|
isDeferredPointerDownOutsideRef.current = false;
|
|
@@ -3610,8 +3852,8 @@ function usePointerDownOutside(onPointerDownOutside, args) {
|
|
|
3610
3852
|
__name12(usePointerDownOutside, "usePointerDownOutside");
|
|
3611
3853
|
function useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {
|
|
3612
3854
|
const handleFocusOutside = useCallbackRef(onFocusOutside);
|
|
3613
|
-
const isFocusInsideReactTreeRef =
|
|
3614
|
-
|
|
3855
|
+
const isFocusInsideReactTreeRef = React15.useRef(false);
|
|
3856
|
+
React15.useEffect(() => {
|
|
3615
3857
|
const handleFocus = /* @__PURE__ */ __name12((event) => {
|
|
3616
3858
|
if (event.target && !isFocusInsideReactTreeRef.current) {
|
|
3617
3859
|
const eventDetail = { originalEvent: event };
|
|
@@ -3648,7 +3890,7 @@ function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
|
|
|
3648
3890
|
__name12(handleAndDispatchCustomEvent, "handleAndDispatchCustomEvent");
|
|
3649
3891
|
|
|
3650
3892
|
// ../../node_modules/.pnpm/@radix-ui+react-focus-guards@1.1.6_@types+react@18.3.31_react@18.3.1/node_modules/@radix-ui/react-focus-guards/dist/index.mjs
|
|
3651
|
-
var
|
|
3893
|
+
var React16 = __toESM(require("react"), 1);
|
|
3652
3894
|
"use client";
|
|
3653
3895
|
var __defProp14 = Object.defineProperty;
|
|
3654
3896
|
var __name13 = (target, value) => __defProp14(target, "name", { value, configurable: true });
|
|
@@ -3660,7 +3902,7 @@ function FocusGuards(props) {
|
|
|
3660
3902
|
}
|
|
3661
3903
|
__name13(FocusGuards, "FocusGuards");
|
|
3662
3904
|
function useFocusGuards() {
|
|
3663
|
-
|
|
3905
|
+
React16.useEffect(() => {
|
|
3664
3906
|
if (!guards) {
|
|
3665
3907
|
guards = { start: createFocusGuard(), end: createFocusGuard() };
|
|
3666
3908
|
}
|
|
@@ -3696,7 +3938,7 @@ function createFocusGuard() {
|
|
|
3696
3938
|
__name13(createFocusGuard, "createFocusGuard");
|
|
3697
3939
|
|
|
3698
3940
|
// ../../node_modules/.pnpm/@radix-ui+react-focus-scope@1.1.16_@types+react-dom@18.3.7_@types+react@18.3.31__@types_161760c0d51338f080e5b66a9ea35f08/node_modules/@radix-ui/react-focus-scope/dist/index.mjs
|
|
3699
|
-
var
|
|
3941
|
+
var React17 = __toESM(require("react"), 1);
|
|
3700
3942
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
3701
3943
|
"use client";
|
|
3702
3944
|
var __defProp15 = Object.defineProperty;
|
|
@@ -3704,7 +3946,7 @@ var __name14 = (target, value) => __defProp15(target, "name", { value, configura
|
|
|
3704
3946
|
var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount";
|
|
3705
3947
|
var AUTOFOCUS_ON_UNMOUNT = "focusScope.autoFocusOnUnmount";
|
|
3706
3948
|
var EVENT_OPTIONS = { bubbles: false, cancelable: true };
|
|
3707
|
-
var FocusScope = /* @__PURE__ */
|
|
3949
|
+
var FocusScope = /* @__PURE__ */ React17.forwardRef(/* @__PURE__ */ __name14(function FocusScope2(props, forwardedRef) {
|
|
3708
3950
|
const {
|
|
3709
3951
|
loop = false,
|
|
3710
3952
|
trapped = false,
|
|
@@ -3712,12 +3954,12 @@ var FocusScope = /* @__PURE__ */ React16.forwardRef(/* @__PURE__ */ __name14(fun
|
|
|
3712
3954
|
onUnmountAutoFocus: onUnmountAutoFocusProp,
|
|
3713
3955
|
...scopeProps
|
|
3714
3956
|
} = props;
|
|
3715
|
-
const [container, setContainer] =
|
|
3957
|
+
const [container, setContainer] = React17.useState(null);
|
|
3716
3958
|
const onMountAutoFocus = useCallbackRef(onMountAutoFocusProp);
|
|
3717
3959
|
const onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp);
|
|
3718
|
-
const lastFocusedElementRef =
|
|
3960
|
+
const lastFocusedElementRef = React17.useRef(null);
|
|
3719
3961
|
const composedRefs = useComposedRefs(forwardedRef, setContainer);
|
|
3720
|
-
const focusScope =
|
|
3962
|
+
const focusScope = React17.useRef({
|
|
3721
3963
|
paused: false,
|
|
3722
3964
|
pause() {
|
|
3723
3965
|
this.paused = true;
|
|
@@ -3726,7 +3968,7 @@ var FocusScope = /* @__PURE__ */ React16.forwardRef(/* @__PURE__ */ __name14(fun
|
|
|
3726
3968
|
this.paused = false;
|
|
3727
3969
|
}
|
|
3728
3970
|
}).current;
|
|
3729
|
-
|
|
3971
|
+
React17.useEffect(() => {
|
|
3730
3972
|
if (trapped) {
|
|
3731
3973
|
let handleFocusIn2 = function(event) {
|
|
3732
3974
|
if (focusScope.paused || !container)
|
|
@@ -3771,7 +4013,7 @@ var FocusScope = /* @__PURE__ */ React16.forwardRef(/* @__PURE__ */ __name14(fun
|
|
|
3771
4013
|
};
|
|
3772
4014
|
}
|
|
3773
4015
|
}, [trapped, container, focusScope.paused]);
|
|
3774
|
-
|
|
4016
|
+
React17.useEffect(() => {
|
|
3775
4017
|
if (container) {
|
|
3776
4018
|
focusScopesStack.add(focusScope);
|
|
3777
4019
|
const previouslyFocusedElement = document.activeElement;
|
|
@@ -3802,7 +4044,7 @@ var FocusScope = /* @__PURE__ */ React16.forwardRef(/* @__PURE__ */ __name14(fun
|
|
|
3802
4044
|
};
|
|
3803
4045
|
}
|
|
3804
4046
|
}, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]);
|
|
3805
|
-
const handleKeyDown =
|
|
4047
|
+
const handleKeyDown = React17.useCallback((event) => {
|
|
3806
4048
|
if (!loop && !trapped)
|
|
3807
4049
|
return;
|
|
3808
4050
|
if (focusScope.paused)
|
|
@@ -3932,15 +4174,15 @@ function removeLinks(items) {
|
|
|
3932
4174
|
__name14(removeLinks, "removeLinks");
|
|
3933
4175
|
|
|
3934
4176
|
// ../../node_modules/.pnpm/@radix-ui+react-id@1.1.4_@types+react@18.3.31_react@18.3.1/node_modules/@radix-ui/react-id/dist/index.mjs
|
|
3935
|
-
var
|
|
4177
|
+
var React18 = __toESM(require("react"), 1);
|
|
3936
4178
|
var __defProp16 = Object.defineProperty;
|
|
3937
4179
|
var __name15 = (target, value) => __defProp16(target, "name", { value, configurable: true });
|
|
3938
|
-
var useReactId =
|
|
4180
|
+
var useReactId = React18[" useId ".trim().toString()] || (() => {
|
|
3939
4181
|
return;
|
|
3940
4182
|
});
|
|
3941
4183
|
var count2 = 0;
|
|
3942
4184
|
function useId(deterministicId) {
|
|
3943
|
-
const [id, setId] =
|
|
4185
|
+
const [id, setId] = React18.useState(useReactId());
|
|
3944
4186
|
useLayoutEffect2(() => {
|
|
3945
4187
|
if (!deterministicId)
|
|
3946
4188
|
setId((reactId) => reactId ?? String(count2++));
|
|
@@ -3950,7 +4192,7 @@ function useId(deterministicId) {
|
|
|
3950
4192
|
__name15(useId, "useId");
|
|
3951
4193
|
|
|
3952
4194
|
// ../../node_modules/.pnpm/@radix-ui+react-popper@1.3.7_@types+react-dom@18.3.7_@types+react@18.3.31__@types+react_eb61390ffeb98719c4501fa966467838/node_modules/@radix-ui/react-popper/dist/index.mjs
|
|
3953
|
-
var
|
|
4195
|
+
var React21 = __toESM(require("react"), 1);
|
|
3954
4196
|
|
|
3955
4197
|
// ../../node_modules/.pnpm/@floating-ui+utils@0.2.12/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
|
|
3956
4198
|
var sides = ["top", "right", "bottom", "left"];
|
|
@@ -5533,12 +5775,12 @@ var computePosition2 = (reference, floating, options) => {
|
|
|
5533
5775
|
};
|
|
5534
5776
|
|
|
5535
5777
|
// ../../node_modules/.pnpm/@floating-ui+react-dom@2.1.9_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs
|
|
5536
|
-
var
|
|
5537
|
-
var
|
|
5778
|
+
var React19 = __toESM(require("react"), 1);
|
|
5779
|
+
var import_react5 = require("react");
|
|
5538
5780
|
var ReactDOM2 = __toESM(require("react-dom"), 1);
|
|
5539
5781
|
var isClient = typeof document !== "undefined";
|
|
5540
5782
|
var noop = function noop() {};
|
|
5541
|
-
var index2 = isClient ?
|
|
5783
|
+
var index2 = isClient ? import_react5.useLayoutEffect : noop;
|
|
5542
5784
|
function deepEqual(a, b) {
|
|
5543
5785
|
if (a === b) {
|
|
5544
5786
|
return true;
|
|
@@ -5599,7 +5841,7 @@ function roundByDPR(element, value) {
|
|
|
5599
5841
|
return Math.round(value * dpr) / dpr;
|
|
5600
5842
|
}
|
|
5601
5843
|
function useLatestRef(value) {
|
|
5602
|
-
const ref =
|
|
5844
|
+
const ref = React19.useRef(value);
|
|
5603
5845
|
index2(() => {
|
|
5604
5846
|
ref.current = value;
|
|
5605
5847
|
});
|
|
@@ -5622,7 +5864,7 @@ function useFloating(options) {
|
|
|
5622
5864
|
whileElementsMounted,
|
|
5623
5865
|
open
|
|
5624
5866
|
} = options;
|
|
5625
|
-
const [data, setData] =
|
|
5867
|
+
const [data, setData] = React19.useState({
|
|
5626
5868
|
x: 0,
|
|
5627
5869
|
y: 0,
|
|
5628
5870
|
strategy,
|
|
@@ -5630,19 +5872,19 @@ function useFloating(options) {
|
|
|
5630
5872
|
middlewareData: {},
|
|
5631
5873
|
isPositioned: false
|
|
5632
5874
|
});
|
|
5633
|
-
const [latestMiddleware, setLatestMiddleware] =
|
|
5875
|
+
const [latestMiddleware, setLatestMiddleware] = React19.useState(middleware);
|
|
5634
5876
|
if (!deepEqual(latestMiddleware, middleware)) {
|
|
5635
5877
|
setLatestMiddleware(middleware);
|
|
5636
5878
|
}
|
|
5637
|
-
const [_reference, _setReference] =
|
|
5638
|
-
const [_floating, _setFloating] =
|
|
5639
|
-
const setReference =
|
|
5879
|
+
const [_reference, _setReference] = React19.useState(null);
|
|
5880
|
+
const [_floating, _setFloating] = React19.useState(null);
|
|
5881
|
+
const setReference = React19.useCallback((node) => {
|
|
5640
5882
|
if (node !== referenceRef.current) {
|
|
5641
5883
|
referenceRef.current = node;
|
|
5642
5884
|
_setReference(node);
|
|
5643
5885
|
}
|
|
5644
5886
|
}, []);
|
|
5645
|
-
const setFloating =
|
|
5887
|
+
const setFloating = React19.useCallback((node) => {
|
|
5646
5888
|
if (node !== floatingRef.current) {
|
|
5647
5889
|
floatingRef.current = node;
|
|
5648
5890
|
_setFloating(node);
|
|
@@ -5650,14 +5892,14 @@ function useFloating(options) {
|
|
|
5650
5892
|
}, []);
|
|
5651
5893
|
const referenceEl = externalReference || _reference;
|
|
5652
5894
|
const floatingEl = externalFloating || _floating;
|
|
5653
|
-
const referenceRef =
|
|
5654
|
-
const floatingRef =
|
|
5655
|
-
const dataRef =
|
|
5895
|
+
const referenceRef = React19.useRef(null);
|
|
5896
|
+
const floatingRef = React19.useRef(null);
|
|
5897
|
+
const dataRef = React19.useRef(data);
|
|
5656
5898
|
const hasWhileElementsMounted = whileElementsMounted != null;
|
|
5657
5899
|
const whileElementsMountedRef = useLatestRef(whileElementsMounted);
|
|
5658
5900
|
const platformRef = useLatestRef(platform);
|
|
5659
5901
|
const openRef = useLatestRef(open);
|
|
5660
|
-
const update =
|
|
5902
|
+
const update = React19.useCallback(() => {
|
|
5661
5903
|
if (!referenceRef.current || !floatingRef.current) {
|
|
5662
5904
|
return;
|
|
5663
5905
|
}
|
|
@@ -5691,7 +5933,7 @@ function useFloating(options) {
|
|
|
5691
5933
|
}));
|
|
5692
5934
|
}
|
|
5693
5935
|
}, [open]);
|
|
5694
|
-
const isMountedRef =
|
|
5936
|
+
const isMountedRef = React19.useRef(false);
|
|
5695
5937
|
index2(() => {
|
|
5696
5938
|
isMountedRef.current = true;
|
|
5697
5939
|
return () => {
|
|
@@ -5710,17 +5952,17 @@ function useFloating(options) {
|
|
|
5710
5952
|
update();
|
|
5711
5953
|
}
|
|
5712
5954
|
}, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]);
|
|
5713
|
-
const refs =
|
|
5955
|
+
const refs = React19.useMemo(() => ({
|
|
5714
5956
|
reference: referenceRef,
|
|
5715
5957
|
floating: floatingRef,
|
|
5716
5958
|
setReference,
|
|
5717
5959
|
setFloating
|
|
5718
5960
|
}), [setReference, setFloating]);
|
|
5719
|
-
const elements =
|
|
5961
|
+
const elements = React19.useMemo(() => ({
|
|
5720
5962
|
reference: referenceEl,
|
|
5721
5963
|
floating: floatingEl
|
|
5722
5964
|
}), [referenceEl, floatingEl]);
|
|
5723
|
-
const floatingStyles =
|
|
5965
|
+
const floatingStyles = React19.useMemo(() => {
|
|
5724
5966
|
const initialStyles = {
|
|
5725
5967
|
position: strategy,
|
|
5726
5968
|
left: 0,
|
|
@@ -5746,7 +5988,7 @@ function useFloating(options) {
|
|
|
5746
5988
|
top: y
|
|
5747
5989
|
};
|
|
5748
5990
|
}, [strategy, transform, elements.floating, data.x, data.y]);
|
|
5749
|
-
return
|
|
5991
|
+
return React19.useMemo(() => ({
|
|
5750
5992
|
...data,
|
|
5751
5993
|
update,
|
|
5752
5994
|
refs,
|
|
@@ -5842,11 +6084,11 @@ var arrow3 = (options, deps) => {
|
|
|
5842
6084
|
};
|
|
5843
6085
|
|
|
5844
6086
|
// ../../node_modules/.pnpm/@radix-ui+react-use-size@1.1.4_@types+react@18.3.31_react@18.3.1/node_modules/@radix-ui/react-use-size/dist/index.mjs
|
|
5845
|
-
var
|
|
6087
|
+
var React20 = __toESM(require("react"), 1);
|
|
5846
6088
|
var __defProp17 = Object.defineProperty;
|
|
5847
6089
|
var __name16 = (target, value) => __defProp17(target, "name", { value, configurable: true });
|
|
5848
6090
|
function useSize(element) {
|
|
5849
|
-
const [size, setSize] =
|
|
6091
|
+
const [size, setSize] = React20.useState(undefined);
|
|
5850
6092
|
useLayoutEffect2(() => {
|
|
5851
6093
|
if (element) {
|
|
5852
6094
|
setSize({ width: element.offsetWidth, height: element.offsetHeight });
|
|
@@ -5891,8 +6133,8 @@ var [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);
|
|
|
5891
6133
|
var [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);
|
|
5892
6134
|
var Popper = /* @__PURE__ */ __name17((props) => {
|
|
5893
6135
|
const { __scopePopper, children } = props;
|
|
5894
|
-
const [anchor, setAnchor] =
|
|
5895
|
-
const [placementState, setPlacementState] =
|
|
6136
|
+
const [anchor, setAnchor] = React21.useState(null);
|
|
6137
|
+
const [placementState, setPlacementState] = React21.useState(undefined);
|
|
5896
6138
|
return /* @__PURE__ */ import_jsx_runtime9.jsx(PopperProvider, {
|
|
5897
6139
|
scope: __scopePopper,
|
|
5898
6140
|
anchor,
|
|
@@ -5903,20 +6145,20 @@ var Popper = /* @__PURE__ */ __name17((props) => {
|
|
|
5903
6145
|
});
|
|
5904
6146
|
}, "Popper");
|
|
5905
6147
|
var ANCHOR_NAME = "PopperAnchor";
|
|
5906
|
-
var PopperAnchor = /* @__PURE__ */
|
|
6148
|
+
var PopperAnchor = /* @__PURE__ */ React21.forwardRef(/* @__PURE__ */ __name17(function PopperAnchor2(props, forwardedRef) {
|
|
5907
6149
|
const { __scopePopper, virtualRef, ...anchorProps } = props;
|
|
5908
6150
|
const context = usePopperContext(ANCHOR_NAME, __scopePopper);
|
|
5909
|
-
const ref =
|
|
6151
|
+
const ref = React21.useRef(null);
|
|
5910
6152
|
const onAnchorChange = context.onAnchorChange;
|
|
5911
|
-
const callbackRef =
|
|
6153
|
+
const callbackRef = React21.useCallback((node) => {
|
|
5912
6154
|
ref.current = node;
|
|
5913
6155
|
if (node) {
|
|
5914
6156
|
onAnchorChange(node);
|
|
5915
6157
|
}
|
|
5916
6158
|
}, [onAnchorChange]);
|
|
5917
6159
|
const composedRefs = useComposedRefs(forwardedRef, callbackRef);
|
|
5918
|
-
const anchorRef =
|
|
5919
|
-
|
|
6160
|
+
const anchorRef = React21.useRef(null);
|
|
6161
|
+
React21.useEffect(() => {
|
|
5920
6162
|
if (!virtualRef) {
|
|
5921
6163
|
return;
|
|
5922
6164
|
}
|
|
@@ -5938,7 +6180,7 @@ var PopperAnchor = /* @__PURE__ */ React20.forwardRef(/* @__PURE__ */ __name17(f
|
|
|
5938
6180
|
}, "PopperAnchor"));
|
|
5939
6181
|
var CONTENT_NAME = "PopperContent";
|
|
5940
6182
|
var [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME);
|
|
5941
|
-
var PopperContent = /* @__PURE__ */
|
|
6183
|
+
var PopperContent = /* @__PURE__ */ React21.forwardRef(/* @__PURE__ */ __name17(function PopperContent2(props, forwardedRef) {
|
|
5942
6184
|
const {
|
|
5943
6185
|
__scopePopper,
|
|
5944
6186
|
side = "bottom",
|
|
@@ -5956,9 +6198,9 @@ var PopperContent = /* @__PURE__ */ React20.forwardRef(/* @__PURE__ */ __name17(
|
|
|
5956
6198
|
...contentProps
|
|
5957
6199
|
} = props;
|
|
5958
6200
|
const context = usePopperContext(CONTENT_NAME, __scopePopper);
|
|
5959
|
-
const [content, setContent] =
|
|
6201
|
+
const [content, setContent] = React21.useState(null);
|
|
5960
6202
|
const composedRefs = useComposedRefs(forwardedRef, setContent);
|
|
5961
|
-
const [arrow, setArrow] =
|
|
6203
|
+
const [arrow, setArrow] = React21.useState(null);
|
|
5962
6204
|
const arrowSize = useSize(arrow);
|
|
5963
6205
|
const arrowWidth = arrowSize?.width ?? 0;
|
|
5964
6206
|
const arrowHeight = arrowSize?.height ?? 0;
|
|
@@ -6029,7 +6271,7 @@ var PopperContent = /* @__PURE__ */ React20.forwardRef(/* @__PURE__ */ __name17(
|
|
|
6029
6271
|
const arrowX = middlewareData.arrow?.x;
|
|
6030
6272
|
const arrowY = middlewareData.arrow?.y;
|
|
6031
6273
|
const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;
|
|
6032
|
-
const [contentZIndex, setContentZIndex] =
|
|
6274
|
+
const [contentZIndex, setContentZIndex] = React21.useState();
|
|
6033
6275
|
useLayoutEffect2(() => {
|
|
6034
6276
|
if (content)
|
|
6035
6277
|
setContentZIndex(window.getComputedStyle(content).zIndex);
|
|
@@ -6118,28 +6360,28 @@ var Anchor = PopperAnchor;
|
|
|
6118
6360
|
var Content = PopperContent;
|
|
6119
6361
|
|
|
6120
6362
|
// ../../node_modules/.pnpm/@radix-ui+react-portal@1.1.17_@types+react-dom@18.3.7_@types+react@18.3.31__@types+reac_35c248e3d41b4a33144a8517e72175a4/node_modules/@radix-ui/react-portal/dist/index.mjs
|
|
6121
|
-
var
|
|
6363
|
+
var React24 = __toESM(require("react"), 1);
|
|
6122
6364
|
var ReactDOM3 = __toESM(require("react-dom"), 1);
|
|
6123
6365
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
6124
6366
|
"use client";
|
|
6125
6367
|
var __defProp19 = Object.defineProperty;
|
|
6126
6368
|
var __name18 = (target, value) => __defProp19(target, "name", { value, configurable: true });
|
|
6127
|
-
var Portal = /* @__PURE__ */
|
|
6369
|
+
var Portal = /* @__PURE__ */ React24.forwardRef(/* @__PURE__ */ __name18(function Portal2(props, forwardedRef) {
|
|
6128
6370
|
const { container: containerProp, ...portalProps } = props;
|
|
6129
|
-
const [mounted, setMounted] =
|
|
6371
|
+
const [mounted, setMounted] = React24.useState(false);
|
|
6130
6372
|
useLayoutEffect2(() => setMounted(true), []);
|
|
6131
6373
|
const container = containerProp || mounted && globalThis?.document?.body;
|
|
6132
6374
|
return container ? ReactDOM3.createPortal(/* @__PURE__ */ import_jsx_runtime10.jsx(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
|
|
6133
6375
|
}, "Portal"));
|
|
6134
6376
|
|
|
6135
6377
|
// ../../node_modules/.pnpm/@radix-ui+react-presence@1.1.10_@types+react-dom@18.3.7_@types+react@18.3.31__@types+re_62e566fb7823886e0e3d5565144169f1/node_modules/@radix-ui/react-presence/dist/index.mjs
|
|
6136
|
-
var React24 = __toESM(require("react"), 1);
|
|
6137
6378
|
var React25 = __toESM(require("react"), 1);
|
|
6379
|
+
var React26 = __toESM(require("react"), 1);
|
|
6138
6380
|
"use client";
|
|
6139
6381
|
var __defProp20 = Object.defineProperty;
|
|
6140
6382
|
var __name19 = (target, value) => __defProp20(target, "name", { value, configurable: true });
|
|
6141
6383
|
function useStateMachine(initialState, machine) {
|
|
6142
|
-
return
|
|
6384
|
+
return React26.useReducer((state, event) => {
|
|
6143
6385
|
const nextState = machine[state][event];
|
|
6144
6386
|
return nextState ?? state;
|
|
6145
6387
|
}, initialState);
|
|
@@ -6148,17 +6390,17 @@ __name19(useStateMachine, "useStateMachine");
|
|
|
6148
6390
|
var Presence = /* @__PURE__ */ __name19((props) => {
|
|
6149
6391
|
const { present, children } = props;
|
|
6150
6392
|
const presence = usePresence(present);
|
|
6151
|
-
const child = typeof children === "function" ? children({ present: presence.isPresent }) :
|
|
6393
|
+
const child = typeof children === "function" ? children({ present: presence.isPresent }) : React25.Children.only(children);
|
|
6152
6394
|
const ref = useStableComposedRefs(presence.ref, getElementRef2(child));
|
|
6153
6395
|
const forceMount = typeof children === "function";
|
|
6154
|
-
return forceMount || presence.isPresent ?
|
|
6396
|
+
return forceMount || presence.isPresent ? React25.cloneElement(child, { ref }) : null;
|
|
6155
6397
|
}, "Presence");
|
|
6156
6398
|
function usePresence(present) {
|
|
6157
|
-
const [node, setNode] =
|
|
6158
|
-
const stylesRef =
|
|
6159
|
-
const prevPresentRef =
|
|
6160
|
-
const prevAnimationNameRef =
|
|
6161
|
-
const mountAnimationNameRef =
|
|
6399
|
+
const [node, setNode] = React25.useState();
|
|
6400
|
+
const stylesRef = React25.useRef(null);
|
|
6401
|
+
const prevPresentRef = React25.useRef(present);
|
|
6402
|
+
const prevAnimationNameRef = React25.useRef("none");
|
|
6403
|
+
const mountAnimationNameRef = React25.useRef(undefined);
|
|
6162
6404
|
const initialState = present ? "mounted" : "unmounted";
|
|
6163
6405
|
const [state, send] = useStateMachine(initialState, {
|
|
6164
6406
|
mounted: {
|
|
@@ -6173,7 +6415,7 @@ function usePresence(present) {
|
|
|
6173
6415
|
MOUNT: "mounted"
|
|
6174
6416
|
}
|
|
6175
6417
|
});
|
|
6176
|
-
|
|
6418
|
+
React25.useEffect(() => {
|
|
6177
6419
|
if (state === "mounted") {
|
|
6178
6420
|
prevAnimationNameRef.current = mountAnimationNameRef.current ?? getAnimationName(stylesRef.current);
|
|
6179
6421
|
mountAnimationNameRef.current = undefined;
|
|
@@ -6244,7 +6486,7 @@ function usePresence(present) {
|
|
|
6244
6486
|
}, [node, send]);
|
|
6245
6487
|
return {
|
|
6246
6488
|
isPresent: ["mounted", "unmountSuspended"].includes(state),
|
|
6247
|
-
ref:
|
|
6489
|
+
ref: React25.useCallback((node2) => {
|
|
6248
6490
|
if (node2) {
|
|
6249
6491
|
const styles = getComputedStyle(node2);
|
|
6250
6492
|
stylesRef.current = styles;
|
|
@@ -6266,9 +6508,9 @@ function setRef2(ref, value) {
|
|
|
6266
6508
|
}
|
|
6267
6509
|
__name19(setRef2, "setRef");
|
|
6268
6510
|
function useStableComposedRefs(...refs) {
|
|
6269
|
-
const refsRef =
|
|
6511
|
+
const refsRef = React25.useRef(refs);
|
|
6270
6512
|
refsRef.current = refs;
|
|
6271
|
-
return
|
|
6513
|
+
return React25.useCallback((node) => {
|
|
6272
6514
|
const currentRefs = refsRef.current;
|
|
6273
6515
|
let hasCleanup = false;
|
|
6274
6516
|
const cleanups = currentRefs.map((ref) => {
|
|
@@ -6313,17 +6555,17 @@ function getElementRef2(element) {
|
|
|
6313
6555
|
__name19(getElementRef2, "getElementRef");
|
|
6314
6556
|
|
|
6315
6557
|
// ../../node_modules/.pnpm/@radix-ui+react-roving-focus@1.1.19_@types+react-dom@18.3.7_@types+react@18.3.31__@type_d5b0f6117fe35925e77b051a5d0d3813/node_modules/@radix-ui/react-roving-focus/dist/index.mjs
|
|
6316
|
-
var
|
|
6558
|
+
var React29 = __toESM(require("react"), 1);
|
|
6317
6559
|
|
|
6318
6560
|
// ../../node_modules/.pnpm/@radix-ui+react-use-is-hydrated@0.1.3_@types+react@18.3.31_react@18.3.1/node_modules/@radix-ui/react-use-is-hydrated/dist/index.mjs
|
|
6319
|
-
var React26 = __toESM(require("react"), 1);
|
|
6320
6561
|
var React27 = __toESM(require("react"), 1);
|
|
6562
|
+
var React28 = __toESM(require("react"), 1);
|
|
6321
6563
|
var __defProp21 = Object.defineProperty;
|
|
6322
6564
|
var __name20 = (target, value) => __defProp21(target, "name", { value, configurable: true });
|
|
6323
6565
|
var _isHydrated = false;
|
|
6324
6566
|
function useIsHydrated() {
|
|
6325
|
-
const [isHydrated, setIsHydrated] =
|
|
6326
|
-
|
|
6567
|
+
const [isHydrated, setIsHydrated] = React28.useState(_isHydrated);
|
|
6568
|
+
React28.useEffect(() => {
|
|
6327
6569
|
if (!_isHydrated) {
|
|
6328
6570
|
_isHydrated = true;
|
|
6329
6571
|
setIsHydrated(true);
|
|
@@ -6332,7 +6574,7 @@ function useIsHydrated() {
|
|
|
6332
6574
|
return isHydrated;
|
|
6333
6575
|
}
|
|
6334
6576
|
__name20(useIsHydrated, "useIsHydrated");
|
|
6335
|
-
var useReactSyncExternalStore =
|
|
6577
|
+
var useReactSyncExternalStore = React27[" useSyncExternalStore ".trim().toString()];
|
|
6336
6578
|
function subscribe() {
|
|
6337
6579
|
return () => {};
|
|
6338
6580
|
}
|
|
@@ -6354,10 +6596,10 @@ var GROUP_NAME = "RovingFocusGroup";
|
|
|
6354
6596
|
var [Collection, useCollection, createCollectionScope] = createCollection(GROUP_NAME);
|
|
6355
6597
|
var [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope(GROUP_NAME, [createCollectionScope]);
|
|
6356
6598
|
var [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME);
|
|
6357
|
-
var RovingFocusGroup = /* @__PURE__ */
|
|
6599
|
+
var RovingFocusGroup = /* @__PURE__ */ React29.forwardRef(/* @__PURE__ */ __name21(function RovingFocusGroup2(props, forwardedRef) {
|
|
6358
6600
|
return /* @__PURE__ */ import_jsx_runtime11.jsx(Collection.Provider, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ import_jsx_runtime11.jsx(Collection.Slot, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ import_jsx_runtime11.jsx(RovingFocusGroupImpl, { ...props, ref: forwardedRef }) }) });
|
|
6359
6601
|
}, "RovingFocusGroup"));
|
|
6360
|
-
var RovingFocusGroupImpl = /* @__PURE__ */
|
|
6602
|
+
var RovingFocusGroupImpl = /* @__PURE__ */ React29.forwardRef(/* @__PURE__ */ __name21(function RovingFocusGroupImpl2(props, forwardedRef) {
|
|
6361
6603
|
const {
|
|
6362
6604
|
__scopeRovingFocusGroup,
|
|
6363
6605
|
orientation,
|
|
@@ -6370,7 +6612,7 @@ var RovingFocusGroupImpl = /* @__PURE__ */ React28.forwardRef(/* @__PURE__ */ __
|
|
|
6370
6612
|
preventScrollOnEntryFocus = false,
|
|
6371
6613
|
...groupProps
|
|
6372
6614
|
} = props;
|
|
6373
|
-
const ref =
|
|
6615
|
+
const ref = React29.useRef(null);
|
|
6374
6616
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
6375
6617
|
const direction = useDirection(dir);
|
|
6376
6618
|
const [currentTabStopId, setCurrentTabStopId] = useControllableState({
|
|
@@ -6379,12 +6621,12 @@ var RovingFocusGroupImpl = /* @__PURE__ */ React28.forwardRef(/* @__PURE__ */ __
|
|
|
6379
6621
|
onChange: onCurrentTabStopIdChange,
|
|
6380
6622
|
caller: GROUP_NAME
|
|
6381
6623
|
});
|
|
6382
|
-
const [isTabbingBackOut, setIsTabbingBackOut] =
|
|
6624
|
+
const [isTabbingBackOut, setIsTabbingBackOut] = React29.useState(false);
|
|
6383
6625
|
const handleEntryFocus = useCallbackRef(onEntryFocus);
|
|
6384
6626
|
const getItems = useCollection(__scopeRovingFocusGroup);
|
|
6385
|
-
const isClickFocusRef =
|
|
6386
|
-
const [focusableItemsCount, setFocusableItemsCount] =
|
|
6387
|
-
|
|
6627
|
+
const isClickFocusRef = React29.useRef(false);
|
|
6628
|
+
const [focusableItemsCount, setFocusableItemsCount] = React29.useState(0);
|
|
6629
|
+
React29.useEffect(() => {
|
|
6388
6630
|
const node = ref.current;
|
|
6389
6631
|
if (node) {
|
|
6390
6632
|
node.addEventListener(ENTRY_FOCUS, handleEntryFocus);
|
|
@@ -6397,10 +6639,10 @@ var RovingFocusGroupImpl = /* @__PURE__ */ React28.forwardRef(/* @__PURE__ */ __
|
|
|
6397
6639
|
dir: direction,
|
|
6398
6640
|
loop,
|
|
6399
6641
|
currentTabStopId,
|
|
6400
|
-
onItemFocus:
|
|
6401
|
-
onItemShiftTab:
|
|
6402
|
-
onFocusableItemAdd:
|
|
6403
|
-
onFocusableItemRemove:
|
|
6642
|
+
onItemFocus: React29.useCallback((tabStopId) => setCurrentTabStopId(tabStopId), [setCurrentTabStopId]),
|
|
6643
|
+
onItemShiftTab: React29.useCallback(() => setIsTabbingBackOut(true), []),
|
|
6644
|
+
onFocusableItemAdd: React29.useCallback(() => setFocusableItemsCount((prevCount) => prevCount + 1), []),
|
|
6645
|
+
onFocusableItemRemove: React29.useCallback(() => setFocusableItemsCount((prevCount) => prevCount - 1), []),
|
|
6404
6646
|
children: /* @__PURE__ */ import_jsx_runtime11.jsx(Primitive.div, {
|
|
6405
6647
|
tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,
|
|
6406
6648
|
"data-orientation": orientation,
|
|
@@ -6431,7 +6673,7 @@ var RovingFocusGroupImpl = /* @__PURE__ */ React28.forwardRef(/* @__PURE__ */ __
|
|
|
6431
6673
|
});
|
|
6432
6674
|
}, "RovingFocusGroupImpl"));
|
|
6433
6675
|
var ITEM_NAME = "RovingFocusGroupItem";
|
|
6434
|
-
var RovingFocusGroupItem = /* @__PURE__ */
|
|
6676
|
+
var RovingFocusGroupItem = /* @__PURE__ */ React29.forwardRef(/* @__PURE__ */ __name21(function RovingFocusGroupItem2(props, forwardedRef) {
|
|
6435
6677
|
const {
|
|
6436
6678
|
__scopeRovingFocusGroup,
|
|
6437
6679
|
focusable = true,
|
|
@@ -6454,7 +6696,7 @@ var RovingFocusGroupItem = /* @__PURE__ */ React28.forwardRef(/* @__PURE__ */ __
|
|
|
6454
6696
|
onFocusableItemAdd();
|
|
6455
6697
|
return () => onFocusableItemRemove();
|
|
6456
6698
|
}, [isHydrated, focusable, onFocusableItemAdd, onFocusableItemRemove]);
|
|
6457
|
-
|
|
6699
|
+
React29.useEffect(() => {
|
|
6458
6700
|
if (isHydrated || !focusable) {
|
|
6459
6701
|
return;
|
|
6460
6702
|
}
|
|
@@ -6709,10 +6951,10 @@ function __spreadArray(to, from, pack) {
|
|
|
6709
6951
|
}
|
|
6710
6952
|
|
|
6711
6953
|
// ../../node_modules/.pnpm/react-remove-scroll@2.7.2_@types+react@18.3.31_react@18.3.1/node_modules/react-remove-scroll/dist/es2015/Combination.js
|
|
6712
|
-
var
|
|
6954
|
+
var React36 = __toESM(require("react"));
|
|
6713
6955
|
|
|
6714
6956
|
// ../../node_modules/.pnpm/react-remove-scroll@2.7.2_@types+react@18.3.31_react@18.3.1/node_modules/react-remove-scroll/dist/es2015/UI.js
|
|
6715
|
-
var
|
|
6957
|
+
var React32 = __toESM(require("react"));
|
|
6716
6958
|
|
|
6717
6959
|
// ../../node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types+react@18.3.31_react@18.3.1/node_modules/react-remove-scroll-bar/dist/es2015/constants.js
|
|
6718
6960
|
var zeroRightClassName = "right-scroll-bar-position";
|
|
@@ -6720,7 +6962,7 @@ var fullWidthClassName = "width-before-scroll-bar";
|
|
|
6720
6962
|
var noScrollbarsClassName = "with-scroll-bars-hidden";
|
|
6721
6963
|
var removedBarSizeVariable = "--removed-body-scroll-bar-size";
|
|
6722
6964
|
// ../../node_modules/.pnpm/use-callback-ref@1.3.3_@types+react@18.3.31_react@18.3.1/node_modules/use-callback-ref/dist/es2015/useMergeRef.js
|
|
6723
|
-
var
|
|
6965
|
+
var React30 = __toESM(require("react"));
|
|
6724
6966
|
|
|
6725
6967
|
// ../../node_modules/.pnpm/use-callback-ref@1.3.3_@types+react@18.3.31_react@18.3.1/node_modules/use-callback-ref/dist/es2015/assignRef.js
|
|
6726
6968
|
function assignRef(ref, value) {
|
|
@@ -6733,9 +6975,9 @@ function assignRef(ref, value) {
|
|
|
6733
6975
|
}
|
|
6734
6976
|
|
|
6735
6977
|
// ../../node_modules/.pnpm/use-callback-ref@1.3.3_@types+react@18.3.31_react@18.3.1/node_modules/use-callback-ref/dist/es2015/useRef.js
|
|
6736
|
-
var
|
|
6978
|
+
var import_react6 = require("react");
|
|
6737
6979
|
function useCallbackRef2(initialValue, callback) {
|
|
6738
|
-
var ref =
|
|
6980
|
+
var ref = import_react6.useState(function() {
|
|
6739
6981
|
return {
|
|
6740
6982
|
value: initialValue,
|
|
6741
6983
|
callback,
|
|
@@ -6758,7 +7000,7 @@ function useCallbackRef2(initialValue, callback) {
|
|
|
6758
7000
|
}
|
|
6759
7001
|
|
|
6760
7002
|
// ../../node_modules/.pnpm/use-callback-ref@1.3.3_@types+react@18.3.31_react@18.3.1/node_modules/use-callback-ref/dist/es2015/useMergeRef.js
|
|
6761
|
-
var useIsomorphicLayoutEffect = typeof window !== "undefined" ?
|
|
7003
|
+
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React30.useLayoutEffect : React30.useEffect;
|
|
6762
7004
|
var currentValues = new WeakMap;
|
|
6763
7005
|
function useMergeRefs(refs, defaultValue) {
|
|
6764
7006
|
var callbackRef = useCallbackRef2(defaultValue || null, function(newValue) {
|
|
@@ -6873,7 +7115,7 @@ function createSidecarMedium(options) {
|
|
|
6873
7115
|
return medium;
|
|
6874
7116
|
}
|
|
6875
7117
|
// ../../node_modules/.pnpm/use-sidecar@1.1.3_@types+react@18.3.31_react@18.3.1/node_modules/use-sidecar/dist/es2015/exports.js
|
|
6876
|
-
var
|
|
7118
|
+
var React31 = __toESM(require("react"));
|
|
6877
7119
|
var SideCar = function(_a) {
|
|
6878
7120
|
var sideCar = _a.sideCar, rest = __rest(_a, ["sideCar"]);
|
|
6879
7121
|
if (!sideCar) {
|
|
@@ -6883,7 +7125,7 @@ var SideCar = function(_a) {
|
|
|
6883
7125
|
if (!Target) {
|
|
6884
7126
|
throw new Error("Sidecar medium not found");
|
|
6885
7127
|
}
|
|
6886
|
-
return
|
|
7128
|
+
return React31.createElement(Target, __assign({}, rest));
|
|
6887
7129
|
};
|
|
6888
7130
|
SideCar.isSideCarExport = true;
|
|
6889
7131
|
function exportSidecar(medium, exported) {
|
|
@@ -6897,9 +7139,9 @@ var effectCar = createSidecarMedium();
|
|
|
6897
7139
|
var nothing = function() {
|
|
6898
7140
|
return;
|
|
6899
7141
|
};
|
|
6900
|
-
var RemoveScroll =
|
|
6901
|
-
var ref =
|
|
6902
|
-
var _a =
|
|
7142
|
+
var RemoveScroll = React32.forwardRef(function(props, parentRef) {
|
|
7143
|
+
var ref = React32.useRef(null);
|
|
7144
|
+
var _a = React32.useState({
|
|
6903
7145
|
onScrollCapture: nothing,
|
|
6904
7146
|
onWheelCapture: nothing,
|
|
6905
7147
|
onTouchMoveCapture: nothing
|
|
@@ -6908,7 +7150,7 @@ var RemoveScroll = React31.forwardRef(function(props, parentRef) {
|
|
|
6908
7150
|
var SideCar = sideCar;
|
|
6909
7151
|
var containerRef = useMergeRefs([ref, parentRef]);
|
|
6910
7152
|
var containerProps = __assign(__assign({}, rest), callbacks);
|
|
6911
|
-
return
|
|
7153
|
+
return React32.createElement(React32.Fragment, null, enabled && React32.createElement(SideCar, { sideCar: effectCar, removeScrollBar, shards, noRelative, noIsolation, inert, setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref, gapMode }), forwardProps ? React32.cloneElement(React32.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef })) : React32.createElement(Container, __assign({}, containerProps, { className, ref: containerRef }), children));
|
|
6912
7154
|
});
|
|
6913
7155
|
RemoveScroll.defaultProps = {
|
|
6914
7156
|
enabled: true,
|
|
@@ -6921,13 +7163,13 @@ RemoveScroll.classNames = {
|
|
|
6921
7163
|
};
|
|
6922
7164
|
|
|
6923
7165
|
// ../../node_modules/.pnpm/react-remove-scroll@2.7.2_@types+react@18.3.31_react@18.3.1/node_modules/react-remove-scroll/dist/es2015/SideEffect.js
|
|
6924
|
-
var
|
|
7166
|
+
var React35 = __toESM(require("react"));
|
|
6925
7167
|
|
|
6926
7168
|
// ../../node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types+react@18.3.31_react@18.3.1/node_modules/react-remove-scroll-bar/dist/es2015/component.js
|
|
6927
|
-
var
|
|
7169
|
+
var React34 = __toESM(require("react"));
|
|
6928
7170
|
|
|
6929
7171
|
// ../../node_modules/.pnpm/react-style-singleton@2.2.3_@types+react@18.3.31_react@18.3.1/node_modules/react-style-singleton/dist/es2015/hook.js
|
|
6930
|
-
var
|
|
7172
|
+
var React33 = __toESM(require("react"));
|
|
6931
7173
|
|
|
6932
7174
|
// ../../node_modules/.pnpm/get-nonce@1.0.1/node_modules/get-nonce/dist/es2015/index.js
|
|
6933
7175
|
var currentNonce;
|
|
@@ -6991,7 +7233,7 @@ var stylesheetSingleton = function() {
|
|
|
6991
7233
|
var styleHookSingleton = function() {
|
|
6992
7234
|
var sheet = stylesheetSingleton();
|
|
6993
7235
|
return function(styles, isDynamic) {
|
|
6994
|
-
|
|
7236
|
+
React33.useEffect(function() {
|
|
6995
7237
|
sheet.add(styles);
|
|
6996
7238
|
return function() {
|
|
6997
7239
|
sheet.remove();
|
|
@@ -7101,7 +7343,7 @@ var getCurrentUseCounter = function() {
|
|
|
7101
7343
|
return isFinite(counter) ? counter : 0;
|
|
7102
7344
|
};
|
|
7103
7345
|
var useLockAttribute = function() {
|
|
7104
|
-
|
|
7346
|
+
React34.useEffect(function() {
|
|
7105
7347
|
document.body.setAttribute(lockAttribute, (getCurrentUseCounter() + 1).toString());
|
|
7106
7348
|
return function() {
|
|
7107
7349
|
var newCounter = getCurrentUseCounter() - 1;
|
|
@@ -7116,10 +7358,10 @@ var useLockAttribute = function() {
|
|
|
7116
7358
|
var RemoveScrollBar = function(_a) {
|
|
7117
7359
|
var { noRelative, noImportant, gapMode: _b } = _a, gapMode = _b === undefined ? "margin" : _b;
|
|
7118
7360
|
useLockAttribute();
|
|
7119
|
-
var gap =
|
|
7361
|
+
var gap = React34.useMemo(function() {
|
|
7120
7362
|
return getGapWidth(gapMode);
|
|
7121
7363
|
}, [gapMode]);
|
|
7122
|
-
return
|
|
7364
|
+
return React34.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? "!important" : "") });
|
|
7123
7365
|
};
|
|
7124
7366
|
|
|
7125
7367
|
// ../../node_modules/.pnpm/react-remove-scroll@2.7.2_@types+react@18.3.31_react@18.3.1/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js
|
|
@@ -7255,16 +7497,16 @@ var generateStyle = function(id) {
|
|
|
7255
7497
|
var idCounter = 0;
|
|
7256
7498
|
var lockStack = [];
|
|
7257
7499
|
function RemoveScrollSideCar(props) {
|
|
7258
|
-
var shouldPreventQueue =
|
|
7259
|
-
var touchStartRef =
|
|
7260
|
-
var activeAxis =
|
|
7261
|
-
var id =
|
|
7262
|
-
var Style =
|
|
7263
|
-
var lastProps =
|
|
7264
|
-
|
|
7500
|
+
var shouldPreventQueue = React35.useRef([]);
|
|
7501
|
+
var touchStartRef = React35.useRef([0, 0]);
|
|
7502
|
+
var activeAxis = React35.useRef();
|
|
7503
|
+
var id = React35.useState(idCounter++)[0];
|
|
7504
|
+
var Style = React35.useState(styleSingleton)[0];
|
|
7505
|
+
var lastProps = React35.useRef(props);
|
|
7506
|
+
React35.useEffect(function() {
|
|
7265
7507
|
lastProps.current = props;
|
|
7266
7508
|
}, [props]);
|
|
7267
|
-
|
|
7509
|
+
React35.useEffect(function() {
|
|
7268
7510
|
if (props.inert) {
|
|
7269
7511
|
document.body.classList.add("block-interactivity-".concat(id));
|
|
7270
7512
|
var allow_1 = __spreadArray([props.lockRef.current], (props.shards || []).map(extractRef), true).filter(Boolean);
|
|
@@ -7280,7 +7522,7 @@ function RemoveScrollSideCar(props) {
|
|
|
7280
7522
|
}
|
|
7281
7523
|
return;
|
|
7282
7524
|
}, [props.inert, props.lockRef.current, props.shards]);
|
|
7283
|
-
var shouldCancelEvent =
|
|
7525
|
+
var shouldCancelEvent = React35.useCallback(function(event, parent) {
|
|
7284
7526
|
if ("touches" in event && event.touches.length === 2 || event.type === "wheel" && event.ctrlKey) {
|
|
7285
7527
|
return !lastProps.current.allowPinchZoom;
|
|
7286
7528
|
}
|
|
@@ -7322,7 +7564,7 @@ function RemoveScrollSideCar(props) {
|
|
|
7322
7564
|
var cancelingAxis = activeAxis.current || currentAxis;
|
|
7323
7565
|
return handleScroll(cancelingAxis, parent, event, cancelingAxis === "h" ? deltaX : deltaY, true);
|
|
7324
7566
|
}, []);
|
|
7325
|
-
var shouldPrevent =
|
|
7567
|
+
var shouldPrevent = React35.useCallback(function(_event) {
|
|
7326
7568
|
var event = _event;
|
|
7327
7569
|
if (!lockStack.length || lockStack[lockStack.length - 1] !== Style) {
|
|
7328
7570
|
return;
|
|
@@ -7349,7 +7591,7 @@ function RemoveScrollSideCar(props) {
|
|
|
7349
7591
|
}
|
|
7350
7592
|
}
|
|
7351
7593
|
}, []);
|
|
7352
|
-
var shouldCancel =
|
|
7594
|
+
var shouldCancel = React35.useCallback(function(name, delta, target, should) {
|
|
7353
7595
|
var event = { name, delta, target, should, shadowParent: getOutermostShadowParent(target) };
|
|
7354
7596
|
shouldPreventQueue.current.push(event);
|
|
7355
7597
|
setTimeout(function() {
|
|
@@ -7358,17 +7600,17 @@ function RemoveScrollSideCar(props) {
|
|
|
7358
7600
|
});
|
|
7359
7601
|
}, 1);
|
|
7360
7602
|
}, []);
|
|
7361
|
-
var scrollTouchStart =
|
|
7603
|
+
var scrollTouchStart = React35.useCallback(function(event) {
|
|
7362
7604
|
touchStartRef.current = getTouchXY(event);
|
|
7363
7605
|
activeAxis.current = undefined;
|
|
7364
7606
|
}, []);
|
|
7365
|
-
var scrollWheel =
|
|
7607
|
+
var scrollWheel = React35.useCallback(function(event) {
|
|
7366
7608
|
shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
7367
7609
|
}, []);
|
|
7368
|
-
var scrollTouchMove =
|
|
7610
|
+
var scrollTouchMove = React35.useCallback(function(event) {
|
|
7369
7611
|
shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
7370
7612
|
}, []);
|
|
7371
|
-
|
|
7613
|
+
React35.useEffect(function() {
|
|
7372
7614
|
lockStack.push(Style);
|
|
7373
7615
|
props.setCallbacks({
|
|
7374
7616
|
onScrollCapture: scrollWheel,
|
|
@@ -7388,7 +7630,7 @@ function RemoveScrollSideCar(props) {
|
|
|
7388
7630
|
};
|
|
7389
7631
|
}, []);
|
|
7390
7632
|
var { removeScrollBar, inert } = props;
|
|
7391
|
-
return
|
|
7633
|
+
return React35.createElement(React35.Fragment, null, inert ? React35.createElement(Style, { styles: generateStyle(id) }) : null, removeScrollBar ? React35.createElement(RemoveScrollBar, { noRelative: props.noRelative, gapMode: props.gapMode }) : null);
|
|
7392
7634
|
}
|
|
7393
7635
|
function getOutermostShadowParent(node) {
|
|
7394
7636
|
var shadowParent = null;
|
|
@@ -7406,8 +7648,8 @@ function getOutermostShadowParent(node) {
|
|
|
7406
7648
|
var sidecar_default = exportSidecar(effectCar, RemoveScrollSideCar);
|
|
7407
7649
|
|
|
7408
7650
|
// ../../node_modules/.pnpm/react-remove-scroll@2.7.2_@types+react@18.3.31_react@18.3.1/node_modules/react-remove-scroll/dist/es2015/Combination.js
|
|
7409
|
-
var ReactRemoveScroll =
|
|
7410
|
-
return
|
|
7651
|
+
var ReactRemoveScroll = React36.forwardRef(function(props, ref) {
|
|
7652
|
+
return React36.createElement(RemoveScroll, __assign({}, props, { ref, sideCar: sidecar_default }));
|
|
7411
7653
|
});
|
|
7412
7654
|
ReactRemoveScroll.classNames = RemoveScroll.classNames;
|
|
7413
7655
|
var Combination_default = ReactRemoveScroll;
|
|
@@ -7443,11 +7685,11 @@ var [MenuRootProvider, useMenuRootContext] = createMenuContext(MENU_NAME);
|
|
|
7443
7685
|
var Menu = /* @__PURE__ */ __name22((props) => {
|
|
7444
7686
|
const { __scopeMenu, open = false, children, dir, onOpenChange, modal = true } = props;
|
|
7445
7687
|
const popperScope = usePopperScope(__scopeMenu);
|
|
7446
|
-
const [content, setContent] =
|
|
7447
|
-
const isUsingKeyboardRef =
|
|
7688
|
+
const [content, setContent] = React37.useState(null);
|
|
7689
|
+
const isUsingKeyboardRef = React37.useRef(false);
|
|
7448
7690
|
const handleOpenChange = useCallbackRef(onOpenChange);
|
|
7449
7691
|
const direction = useDirection(dir);
|
|
7450
|
-
|
|
7692
|
+
React37.useEffect(() => {
|
|
7451
7693
|
const handleKeyDown = /* @__PURE__ */ __name22(() => {
|
|
7452
7694
|
isUsingKeyboardRef.current = true;
|
|
7453
7695
|
document.addEventListener("pointerdown", handlePointer, { capture: true, once: true });
|
|
@@ -7461,7 +7703,7 @@ var Menu = /* @__PURE__ */ __name22((props) => {
|
|
|
7461
7703
|
document.removeEventListener("pointermove", handlePointer, { capture: true });
|
|
7462
7704
|
};
|
|
7463
7705
|
}, []);
|
|
7464
|
-
|
|
7706
|
+
React37.useEffect(() => {
|
|
7465
7707
|
if (!open) {
|
|
7466
7708
|
return;
|
|
7467
7709
|
}
|
|
@@ -7477,7 +7719,7 @@ var Menu = /* @__PURE__ */ __name22((props) => {
|
|
|
7477
7719
|
onContentChange: setContent,
|
|
7478
7720
|
children: /* @__PURE__ */ import_jsx_runtime12.jsx(MenuRootProvider, {
|
|
7479
7721
|
scope: __scopeMenu,
|
|
7480
|
-
onClose:
|
|
7722
|
+
onClose: React37.useCallback(() => handleOpenChange(false), [handleOpenChange]),
|
|
7481
7723
|
isUsingKeyboardRef,
|
|
7482
7724
|
dir: direction,
|
|
7483
7725
|
modal,
|
|
@@ -7485,7 +7727,7 @@ var Menu = /* @__PURE__ */ __name22((props) => {
|
|
|
7485
7727
|
})
|
|
7486
7728
|
}) });
|
|
7487
7729
|
}, "Menu");
|
|
7488
|
-
var MenuAnchor = /* @__PURE__ */
|
|
7730
|
+
var MenuAnchor = /* @__PURE__ */ React37.forwardRef(/* @__PURE__ */ __name22(function MenuAnchor2(props, forwardedRef) {
|
|
7489
7731
|
const { __scopeMenu, ...anchorProps } = props;
|
|
7490
7732
|
const popperScope = usePopperScope(__scopeMenu);
|
|
7491
7733
|
return /* @__PURE__ */ import_jsx_runtime12.jsx(Anchor, { ...popperScope, ...anchorProps, ref: forwardedRef });
|
|
@@ -7501,18 +7743,18 @@ var MenuPortal = /* @__PURE__ */ __name22((props) => {
|
|
|
7501
7743
|
}, "MenuPortal");
|
|
7502
7744
|
var CONTENT_NAME2 = "MenuContent";
|
|
7503
7745
|
var [MenuContentProvider, useMenuContentContext] = createMenuContext(CONTENT_NAME2);
|
|
7504
|
-
var MenuContent = /* @__PURE__ */
|
|
7746
|
+
var MenuContent = /* @__PURE__ */ React37.forwardRef(/* @__PURE__ */ __name22(function MenuContent2(props, forwardedRef) {
|
|
7505
7747
|
const portalContext = usePortalContext(CONTENT_NAME2, props.__scopeMenu);
|
|
7506
7748
|
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
7507
7749
|
const context = useMenuContext(CONTENT_NAME2, props.__scopeMenu);
|
|
7508
7750
|
const rootContext = useMenuRootContext(CONTENT_NAME2, props.__scopeMenu);
|
|
7509
7751
|
return /* @__PURE__ */ import_jsx_runtime12.jsx(Collection2.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ import_jsx_runtime12.jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ import_jsx_runtime12.jsx(Collection2.Slot, { scope: props.__scopeMenu, children: rootContext.modal ? /* @__PURE__ */ import_jsx_runtime12.jsx(MenuRootContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ import_jsx_runtime12.jsx(MenuRootContentNonModal, { ...contentProps, ref: forwardedRef }) }) }) });
|
|
7510
7752
|
}, "MenuContent"));
|
|
7511
|
-
var MenuRootContentModal = /* @__PURE__ */
|
|
7753
|
+
var MenuRootContentModal = /* @__PURE__ */ React37.forwardRef(/* @__PURE__ */ __name22(function MenuRootContentModal2(props, forwardedRef) {
|
|
7512
7754
|
const context = useMenuContext(CONTENT_NAME2, props.__scopeMenu);
|
|
7513
|
-
const ref =
|
|
7755
|
+
const ref = React37.useRef(null);
|
|
7514
7756
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
7515
|
-
|
|
7757
|
+
React37.useEffect(() => {
|
|
7516
7758
|
const content = ref.current;
|
|
7517
7759
|
if (content)
|
|
7518
7760
|
return hideOthers(content);
|
|
@@ -7527,7 +7769,7 @@ var MenuRootContentModal = /* @__PURE__ */ React36.forwardRef(/* @__PURE__ */ __
|
|
|
7527
7769
|
onDismiss: () => context.onOpenChange(false)
|
|
7528
7770
|
});
|
|
7529
7771
|
}, "MenuRootContentModal"));
|
|
7530
|
-
var MenuRootContentNonModal = /* @__PURE__ */
|
|
7772
|
+
var MenuRootContentNonModal = /* @__PURE__ */ React37.forwardRef(/* @__PURE__ */ __name22(function MenuRootContentNonModal2(props, forwardedRef) {
|
|
7531
7773
|
const context = useMenuContext(CONTENT_NAME2, props.__scopeMenu);
|
|
7532
7774
|
return /* @__PURE__ */ import_jsx_runtime12.jsx(MenuContentImpl, {
|
|
7533
7775
|
...props,
|
|
@@ -7539,7 +7781,7 @@ var MenuRootContentNonModal = /* @__PURE__ */ React36.forwardRef(/* @__PURE__ */
|
|
|
7539
7781
|
});
|
|
7540
7782
|
}, "MenuRootContentNonModal"));
|
|
7541
7783
|
var Slot2 = createSlot("MenuContent.ScrollLock");
|
|
7542
|
-
var MenuContentImpl = /* @__PURE__ */
|
|
7784
|
+
var MenuContentImpl = /* @__PURE__ */ React37.forwardRef(/* @__PURE__ */ __name22(function MenuContentImpl2(props, forwardedRef) {
|
|
7543
7785
|
const {
|
|
7544
7786
|
__scopeMenu,
|
|
7545
7787
|
loop = false,
|
|
@@ -7561,16 +7803,16 @@ var MenuContentImpl = /* @__PURE__ */ React36.forwardRef(/* @__PURE__ */ __name2
|
|
|
7561
7803
|
const popperScope = usePopperScope(__scopeMenu);
|
|
7562
7804
|
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu);
|
|
7563
7805
|
const getItems = useCollection2(__scopeMenu);
|
|
7564
|
-
const [currentItemId, setCurrentItemId] =
|
|
7565
|
-
const contentRef =
|
|
7806
|
+
const [currentItemId, setCurrentItemId] = React37.useState(null);
|
|
7807
|
+
const contentRef = React37.useRef(null);
|
|
7566
7808
|
const composedRefs = useComposedRefs(forwardedRef, contentRef, context.onContentChange);
|
|
7567
|
-
const timerRef =
|
|
7568
|
-
const searchRef =
|
|
7569
|
-
const pointerGraceTimerRef =
|
|
7570
|
-
const pointerGraceIntentRef =
|
|
7571
|
-
const pointerDirRef =
|
|
7572
|
-
const lastPointerXRef =
|
|
7573
|
-
const ScrollLockWrapper = disableOutsideScroll ? Combination_default :
|
|
7809
|
+
const timerRef = React37.useRef(0);
|
|
7810
|
+
const searchRef = React37.useRef("");
|
|
7811
|
+
const pointerGraceTimerRef = React37.useRef(0);
|
|
7812
|
+
const pointerGraceIntentRef = React37.useRef(null);
|
|
7813
|
+
const pointerDirRef = React37.useRef("right");
|
|
7814
|
+
const lastPointerXRef = React37.useRef(0);
|
|
7815
|
+
const ScrollLockWrapper = disableOutsideScroll ? Combination_default : React37.Fragment;
|
|
7574
7816
|
const scrollLockWrapperProps = disableOutsideScroll ? { as: Slot2, allowPinchZoom: true } : undefined;
|
|
7575
7817
|
const handleTypeaheadSearch = /* @__PURE__ */ __name22((key) => {
|
|
7576
7818
|
const search = searchRef.current + key;
|
|
@@ -7590,33 +7832,33 @@ var MenuContentImpl = /* @__PURE__ */ React36.forwardRef(/* @__PURE__ */ __name2
|
|
|
7590
7832
|
setTimeout(() => newItem.focus());
|
|
7591
7833
|
}
|
|
7592
7834
|
}, "handleTypeaheadSearch");
|
|
7593
|
-
|
|
7835
|
+
React37.useEffect(() => {
|
|
7594
7836
|
return () => window.clearTimeout(timerRef.current);
|
|
7595
7837
|
}, []);
|
|
7596
7838
|
useFocusGuards();
|
|
7597
|
-
const isPointerMovingToSubmenu =
|
|
7839
|
+
const isPointerMovingToSubmenu = React37.useCallback((event) => {
|
|
7598
7840
|
const isMovingTowards = pointerDirRef.current === pointerGraceIntentRef.current?.side;
|
|
7599
7841
|
return isMovingTowards && isPointerInGraceArea(event, pointerGraceIntentRef.current?.area);
|
|
7600
7842
|
}, []);
|
|
7601
7843
|
return /* @__PURE__ */ import_jsx_runtime12.jsx(MenuContentProvider, {
|
|
7602
7844
|
scope: __scopeMenu,
|
|
7603
7845
|
searchRef,
|
|
7604
|
-
onItemEnter:
|
|
7846
|
+
onItemEnter: React37.useCallback((event) => {
|
|
7605
7847
|
if (isPointerMovingToSubmenu(event))
|
|
7606
7848
|
event.preventDefault();
|
|
7607
7849
|
}, [isPointerMovingToSubmenu]),
|
|
7608
|
-
onItemLeave:
|
|
7850
|
+
onItemLeave: React37.useCallback((event) => {
|
|
7609
7851
|
if (isPointerMovingToSubmenu(event))
|
|
7610
7852
|
return;
|
|
7611
7853
|
contentRef.current?.focus();
|
|
7612
7854
|
setCurrentItemId(null);
|
|
7613
7855
|
}, [isPointerMovingToSubmenu]),
|
|
7614
|
-
onTriggerLeave:
|
|
7856
|
+
onTriggerLeave: React37.useCallback((event) => {
|
|
7615
7857
|
if (isPointerMovingToSubmenu(event))
|
|
7616
7858
|
event.preventDefault();
|
|
7617
7859
|
}, [isPointerMovingToSubmenu]),
|
|
7618
7860
|
pointerGraceTimerRef,
|
|
7619
|
-
onPointerGraceIntentChange:
|
|
7861
|
+
onPointerGraceIntentChange: React37.useCallback((intent) => {
|
|
7620
7862
|
pointerGraceIntentRef.current = intent;
|
|
7621
7863
|
}, []),
|
|
7622
7864
|
children: /* @__PURE__ */ import_jsx_runtime12.jsx(ScrollLockWrapper, { ...scrollLockWrapperProps, children: /* @__PURE__ */ import_jsx_runtime12.jsx(FocusScope, {
|
|
@@ -7702,19 +7944,19 @@ var MenuContentImpl = /* @__PURE__ */ React36.forwardRef(/* @__PURE__ */ __name2
|
|
|
7702
7944
|
}) })
|
|
7703
7945
|
});
|
|
7704
7946
|
}, "MenuContentImpl"));
|
|
7705
|
-
var MenuLabel = /* @__PURE__ */
|
|
7947
|
+
var MenuLabel = /* @__PURE__ */ React37.forwardRef(/* @__PURE__ */ __name22(function MenuLabel2(props, forwardedRef) {
|
|
7706
7948
|
const { __scopeMenu, ...labelProps } = props;
|
|
7707
7949
|
return /* @__PURE__ */ import_jsx_runtime12.jsx(Primitive.div, { ...labelProps, ref: forwardedRef });
|
|
7708
7950
|
}, "MenuLabel"));
|
|
7709
7951
|
var ITEM_NAME2 = "MenuItem";
|
|
7710
7952
|
var ITEM_SELECT = "menu.itemSelect";
|
|
7711
|
-
var MenuItem = /* @__PURE__ */
|
|
7953
|
+
var MenuItem = /* @__PURE__ */ React37.forwardRef(/* @__PURE__ */ __name22(function MenuItem2(props, forwardedRef) {
|
|
7712
7954
|
const { disabled = false, onSelect, ...itemProps } = props;
|
|
7713
|
-
const ref =
|
|
7955
|
+
const ref = React37.useRef(null);
|
|
7714
7956
|
const rootContext = useMenuRootContext(ITEM_NAME2, props.__scopeMenu);
|
|
7715
7957
|
const contentContext = useMenuContentContext(ITEM_NAME2, props.__scopeMenu);
|
|
7716
7958
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
7717
|
-
const isPointerDownRef =
|
|
7959
|
+
const isPointerDownRef = React37.useRef(false);
|
|
7718
7960
|
const handleSelect = /* @__PURE__ */ __name22(() => {
|
|
7719
7961
|
const menuItem = ref.current;
|
|
7720
7962
|
if (!disabled && menuItem) {
|
|
@@ -7756,15 +7998,15 @@ var MenuItem = /* @__PURE__ */ React36.forwardRef(/* @__PURE__ */ __name22(funct
|
|
|
7756
7998
|
})
|
|
7757
7999
|
});
|
|
7758
8000
|
}, "MenuItem"));
|
|
7759
|
-
var MenuItemImpl = /* @__PURE__ */
|
|
8001
|
+
var MenuItemImpl = /* @__PURE__ */ React37.forwardRef(/* @__PURE__ */ __name22(function MenuItemImpl2(props, forwardedRef) {
|
|
7760
8002
|
const { __scopeMenu, disabled = false, textValue, ...itemProps } = props;
|
|
7761
8003
|
const contentContext = useMenuContentContext(ITEM_NAME2, __scopeMenu);
|
|
7762
8004
|
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu);
|
|
7763
|
-
const ref =
|
|
8005
|
+
const ref = React37.useRef(null);
|
|
7764
8006
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
7765
|
-
const [isFocused, setIsFocused] =
|
|
7766
|
-
const [textContent, setTextContent] =
|
|
7767
|
-
|
|
8007
|
+
const [isFocused, setIsFocused] = React37.useState(false);
|
|
8008
|
+
const [textContent, setTextContent] = React37.useState("");
|
|
8009
|
+
React37.useEffect(() => {
|
|
7768
8010
|
const menuItem = ref.current;
|
|
7769
8011
|
if (menuItem) {
|
|
7770
8012
|
setTextContent((menuItem.textContent ?? "").trim());
|
|
@@ -7798,7 +8040,7 @@ var MenuItemImpl = /* @__PURE__ */ React36.forwardRef(/* @__PURE__ */ __name22(f
|
|
|
7798
8040
|
}) })
|
|
7799
8041
|
});
|
|
7800
8042
|
}, "MenuItemImpl"));
|
|
7801
|
-
var MenuCheckboxItem = /* @__PURE__ */
|
|
8043
|
+
var MenuCheckboxItem = /* @__PURE__ */ React37.forwardRef(/* @__PURE__ */ __name22(function MenuCheckboxItem2(props, forwardedRef) {
|
|
7802
8044
|
const { checked = false, onCheckedChange, ...checkboxItemProps } = props;
|
|
7803
8045
|
return /* @__PURE__ */ import_jsx_runtime12.jsx(ItemIndicatorProvider, { scope: props.__scopeMenu, checked, children: /* @__PURE__ */ import_jsx_runtime12.jsx(MenuItem, {
|
|
7804
8046
|
role: "menuitemcheckbox",
|
|
@@ -7812,7 +8054,7 @@ var MenuCheckboxItem = /* @__PURE__ */ React36.forwardRef(/* @__PURE__ */ __name
|
|
|
7812
8054
|
var RADIO_GROUP_NAME = "MenuRadioGroup";
|
|
7813
8055
|
var [RadioGroupProvider, useRadioGroupContext] = createMenuContext(RADIO_GROUP_NAME, { value: undefined, onValueChange: /* @__PURE__ */ __name22(() => {}, "onValueChange") });
|
|
7814
8056
|
var RADIO_ITEM_NAME = "MenuRadioItem";
|
|
7815
|
-
var MenuRadioItem = /* @__PURE__ */
|
|
8057
|
+
var MenuRadioItem = /* @__PURE__ */ React37.forwardRef(/* @__PURE__ */ __name22(function MenuRadioItem2(props, forwardedRef) {
|
|
7816
8058
|
const { value, ...radioItemProps } = props;
|
|
7817
8059
|
const context = useRadioGroupContext(RADIO_ITEM_NAME, props.__scopeMenu);
|
|
7818
8060
|
const checked = value === context.value;
|
|
@@ -7827,7 +8069,7 @@ var MenuRadioItem = /* @__PURE__ */ React36.forwardRef(/* @__PURE__ */ __name22(
|
|
|
7827
8069
|
}, "MenuRadioItem"));
|
|
7828
8070
|
var ITEM_INDICATOR_NAME = "MenuItemIndicator";
|
|
7829
8071
|
var [ItemIndicatorProvider, useItemIndicatorContext] = createMenuContext(ITEM_INDICATOR_NAME, { checked: false });
|
|
7830
|
-
var MenuItemIndicator = /* @__PURE__ */
|
|
8072
|
+
var MenuItemIndicator = /* @__PURE__ */ React37.forwardRef(/* @__PURE__ */ __name22(function MenuItemIndicator2(props, forwardedRef) {
|
|
7831
8073
|
const { __scopeMenu, forceMount, ...itemIndicatorProps } = props;
|
|
7832
8074
|
const indicatorContext = useItemIndicatorContext(ITEM_INDICATOR_NAME, __scopeMenu);
|
|
7833
8075
|
return /* @__PURE__ */ import_jsx_runtime12.jsx(Presence, {
|
|
@@ -7839,7 +8081,7 @@ var MenuItemIndicator = /* @__PURE__ */ React36.forwardRef(/* @__PURE__ */ __nam
|
|
|
7839
8081
|
})
|
|
7840
8082
|
});
|
|
7841
8083
|
}, "MenuItemIndicator"));
|
|
7842
|
-
var MenuSeparator = /* @__PURE__ */
|
|
8084
|
+
var MenuSeparator = /* @__PURE__ */ React37.forwardRef(/* @__PURE__ */ __name22(function MenuSeparator2(props, forwardedRef) {
|
|
7843
8085
|
const { __scopeMenu, ...separatorProps } = props;
|
|
7844
8086
|
return /* @__PURE__ */ import_jsx_runtime12.jsx(Primitive.div, {
|
|
7845
8087
|
role: "separator",
|
|
@@ -7851,21 +8093,21 @@ var MenuSeparator = /* @__PURE__ */ React36.forwardRef(/* @__PURE__ */ __name22(
|
|
|
7851
8093
|
var SUB_NAME = "MenuSub";
|
|
7852
8094
|
var [MenuSubProvider, useMenuSubContext] = createMenuContext(SUB_NAME);
|
|
7853
8095
|
var SUB_TRIGGER_NAME = "MenuSubTrigger";
|
|
7854
|
-
var MenuSubTrigger = /* @__PURE__ */
|
|
8096
|
+
var MenuSubTrigger = /* @__PURE__ */ React37.forwardRef(/* @__PURE__ */ __name22(function MenuSubTrigger2(props, forwardedRef) {
|
|
7855
8097
|
const context = useMenuContext(SUB_TRIGGER_NAME, props.__scopeMenu);
|
|
7856
8098
|
const rootContext = useMenuRootContext(SUB_TRIGGER_NAME, props.__scopeMenu);
|
|
7857
8099
|
const subContext = useMenuSubContext(SUB_TRIGGER_NAME, props.__scopeMenu);
|
|
7858
8100
|
const contentContext = useMenuContentContext(SUB_TRIGGER_NAME, props.__scopeMenu);
|
|
7859
|
-
const openTimerRef =
|
|
8101
|
+
const openTimerRef = React37.useRef(null);
|
|
7860
8102
|
const { pointerGraceTimerRef, onPointerGraceIntentChange } = contentContext;
|
|
7861
8103
|
const scope = { __scopeMenu: props.__scopeMenu };
|
|
7862
|
-
const clearOpenTimer =
|
|
8104
|
+
const clearOpenTimer = React37.useCallback(() => {
|
|
7863
8105
|
if (openTimerRef.current)
|
|
7864
8106
|
window.clearTimeout(openTimerRef.current);
|
|
7865
8107
|
openTimerRef.current = null;
|
|
7866
8108
|
}, []);
|
|
7867
|
-
|
|
7868
|
-
|
|
8109
|
+
React37.useEffect(() => clearOpenTimer, [clearOpenTimer]);
|
|
8110
|
+
React37.useEffect(() => {
|
|
7869
8111
|
const pointerGraceTimer = pointerGraceTimerRef.current;
|
|
7870
8112
|
return () => {
|
|
7871
8113
|
window.clearTimeout(pointerGraceTimer);
|
|
@@ -7946,13 +8188,13 @@ var MenuSubTrigger = /* @__PURE__ */ React36.forwardRef(/* @__PURE__ */ __name22
|
|
|
7946
8188
|
}) });
|
|
7947
8189
|
}, "MenuSubTrigger"));
|
|
7948
8190
|
var SUB_CONTENT_NAME = "MenuSubContent";
|
|
7949
|
-
var MenuSubContent = /* @__PURE__ */
|
|
8191
|
+
var MenuSubContent = /* @__PURE__ */ React37.forwardRef(/* @__PURE__ */ __name22(function MenuSubContent2(props, forwardedRef) {
|
|
7950
8192
|
const portalContext = usePortalContext(CONTENT_NAME2, props.__scopeMenu);
|
|
7951
8193
|
const { forceMount = portalContext.forceMount, align = "start", ...subContentProps } = props;
|
|
7952
8194
|
const context = useMenuContext(CONTENT_NAME2, props.__scopeMenu);
|
|
7953
8195
|
const rootContext = useMenuRootContext(CONTENT_NAME2, props.__scopeMenu);
|
|
7954
8196
|
const subContext = useMenuSubContext(SUB_CONTENT_NAME, props.__scopeMenu);
|
|
7955
|
-
const ref =
|
|
8197
|
+
const ref = React37.useRef(null);
|
|
7956
8198
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
7957
8199
|
return /* @__PURE__ */ import_jsx_runtime12.jsx(Collection2.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ import_jsx_runtime12.jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ import_jsx_runtime12.jsx(Collection2.Slot, { scope: props.__scopeMenu, children: /* @__PURE__ */ import_jsx_runtime12.jsx(MenuContentImpl, {
|
|
7958
8200
|
id: subContext.contentId,
|
|
@@ -8089,7 +8331,7 @@ var DropdownMenu = /* @__PURE__ */ __name23((props) => {
|
|
|
8089
8331
|
modal = true
|
|
8090
8332
|
} = props;
|
|
8091
8333
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
8092
|
-
const triggerRef =
|
|
8334
|
+
const triggerRef = React38.useRef(null);
|
|
8093
8335
|
const [open, setOpen] = useControllableState({
|
|
8094
8336
|
prop: openProp,
|
|
8095
8337
|
defaultProp: defaultOpen ?? false,
|
|
@@ -8103,13 +8345,13 @@ var DropdownMenu = /* @__PURE__ */ __name23((props) => {
|
|
|
8103
8345
|
contentId: useId(),
|
|
8104
8346
|
open,
|
|
8105
8347
|
onOpenChange: setOpen,
|
|
8106
|
-
onOpenToggle:
|
|
8348
|
+
onOpenToggle: React38.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
|
8107
8349
|
modal,
|
|
8108
8350
|
children: /* @__PURE__ */ import_jsx_runtime13.jsx(Root3, { ...menuScope, open, onOpenChange: setOpen, dir, modal, children })
|
|
8109
8351
|
});
|
|
8110
8352
|
}, "DropdownMenu");
|
|
8111
8353
|
var TRIGGER_NAME = "DropdownMenuTrigger";
|
|
8112
|
-
var DropdownMenuTrigger = /* @__PURE__ */
|
|
8354
|
+
var DropdownMenuTrigger = /* @__PURE__ */ React38.forwardRef(/* @__PURE__ */ __name23(function DropdownMenuTrigger2(props, forwardedRef) {
|
|
8113
8355
|
const { __scopeDropdownMenu, disabled = false, ...triggerProps } = props;
|
|
8114
8356
|
const context = useDropdownMenuContext(TRIGGER_NAME, __scopeDropdownMenu);
|
|
8115
8357
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
@@ -8150,11 +8392,11 @@ var DropdownMenuPortal = /* @__PURE__ */ __name23((props) => {
|
|
|
8150
8392
|
return /* @__PURE__ */ import_jsx_runtime13.jsx(Portal2, { ...menuScope, ...portalProps });
|
|
8151
8393
|
}, "DropdownMenuPortal");
|
|
8152
8394
|
var CONTENT_NAME3 = "DropdownMenuContent";
|
|
8153
|
-
var DropdownMenuContent = /* @__PURE__ */
|
|
8395
|
+
var DropdownMenuContent = /* @__PURE__ */ React38.forwardRef(/* @__PURE__ */ __name23(function DropdownMenuContent2(props, forwardedRef) {
|
|
8154
8396
|
const { __scopeDropdownMenu, ...contentProps } = props;
|
|
8155
8397
|
const context = useDropdownMenuContext(CONTENT_NAME3, __scopeDropdownMenu);
|
|
8156
8398
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
8157
|
-
const hasInteractedOutsideRef =
|
|
8399
|
+
const hasInteractedOutsideRef = React38.useRef(false);
|
|
8158
8400
|
return /* @__PURE__ */ import_jsx_runtime13.jsx(Content2, {
|
|
8159
8401
|
id: context.contentId,
|
|
8160
8402
|
"aria-labelledby": context.triggerId,
|
|
@@ -8186,42 +8428,42 @@ var DropdownMenuContent = /* @__PURE__ */ React37.forwardRef(/* @__PURE__ */ __n
|
|
|
8186
8428
|
}
|
|
8187
8429
|
});
|
|
8188
8430
|
}, "DropdownMenuContent"));
|
|
8189
|
-
var DropdownMenuLabel = /* @__PURE__ */
|
|
8431
|
+
var DropdownMenuLabel = /* @__PURE__ */ React38.forwardRef(/* @__PURE__ */ __name23(function DropdownMenuLabel2(props, forwardedRef) {
|
|
8190
8432
|
const { __scopeDropdownMenu, ...labelProps } = props;
|
|
8191
8433
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
8192
8434
|
return /* @__PURE__ */ import_jsx_runtime13.jsx(Label, { ...menuScope, ...labelProps, ref: forwardedRef });
|
|
8193
8435
|
}, "DropdownMenuLabel"));
|
|
8194
|
-
var DropdownMenuItem = /* @__PURE__ */
|
|
8436
|
+
var DropdownMenuItem = /* @__PURE__ */ React38.forwardRef(/* @__PURE__ */ __name23(function DropdownMenuItem2(props, forwardedRef) {
|
|
8195
8437
|
const { __scopeDropdownMenu, ...itemProps } = props;
|
|
8196
8438
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
8197
8439
|
return /* @__PURE__ */ import_jsx_runtime13.jsx(Item2, { ...menuScope, ...itemProps, ref: forwardedRef });
|
|
8198
8440
|
}, "DropdownMenuItem"));
|
|
8199
|
-
var DropdownMenuCheckboxItem = /* @__PURE__ */
|
|
8441
|
+
var DropdownMenuCheckboxItem = /* @__PURE__ */ React38.forwardRef(/* @__PURE__ */ __name23(function DropdownMenuCheckboxItem2(props, forwardedRef) {
|
|
8200
8442
|
const { __scopeDropdownMenu, ...checkboxItemProps } = props;
|
|
8201
8443
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
8202
8444
|
return /* @__PURE__ */ import_jsx_runtime13.jsx(CheckboxItem, { ...menuScope, ...checkboxItemProps, ref: forwardedRef });
|
|
8203
8445
|
}, "DropdownMenuCheckboxItem"));
|
|
8204
|
-
var DropdownMenuRadioItem = /* @__PURE__ */
|
|
8446
|
+
var DropdownMenuRadioItem = /* @__PURE__ */ React38.forwardRef(/* @__PURE__ */ __name23(function DropdownMenuRadioItem2(props, forwardedRef) {
|
|
8205
8447
|
const { __scopeDropdownMenu, ...radioItemProps } = props;
|
|
8206
8448
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
8207
8449
|
return /* @__PURE__ */ import_jsx_runtime13.jsx(RadioItem, { ...menuScope, ...radioItemProps, ref: forwardedRef });
|
|
8208
8450
|
}, "DropdownMenuRadioItem"));
|
|
8209
|
-
var DropdownMenuItemIndicator = /* @__PURE__ */
|
|
8451
|
+
var DropdownMenuItemIndicator = /* @__PURE__ */ React38.forwardRef(/* @__PURE__ */ __name23(function DropdownMenuItemIndicator2(props, forwardedRef) {
|
|
8210
8452
|
const { __scopeDropdownMenu, ...itemIndicatorProps } = props;
|
|
8211
8453
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
8212
8454
|
return /* @__PURE__ */ import_jsx_runtime13.jsx(ItemIndicator, { ...menuScope, ...itemIndicatorProps, ref: forwardedRef });
|
|
8213
8455
|
}, "DropdownMenuItemIndicator"));
|
|
8214
|
-
var DropdownMenuSeparator = /* @__PURE__ */
|
|
8456
|
+
var DropdownMenuSeparator = /* @__PURE__ */ React38.forwardRef(/* @__PURE__ */ __name23(function DropdownMenuSeparator2(props, forwardedRef) {
|
|
8215
8457
|
const { __scopeDropdownMenu, ...separatorProps } = props;
|
|
8216
8458
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
8217
8459
|
return /* @__PURE__ */ import_jsx_runtime13.jsx(Separator, { ...menuScope, ...separatorProps, ref: forwardedRef });
|
|
8218
8460
|
}, "DropdownMenuSeparator"));
|
|
8219
|
-
var DropdownMenuSubTrigger = /* @__PURE__ */
|
|
8461
|
+
var DropdownMenuSubTrigger = /* @__PURE__ */ React38.forwardRef(/* @__PURE__ */ __name23(function DropdownMenuSubTrigger2(props, forwardedRef) {
|
|
8220
8462
|
const { __scopeDropdownMenu, ...subTriggerProps } = props;
|
|
8221
8463
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
8222
8464
|
return /* @__PURE__ */ import_jsx_runtime13.jsx(SubTrigger, { ...menuScope, ...subTriggerProps, ref: forwardedRef });
|
|
8223
8465
|
}, "DropdownMenuSubTrigger"));
|
|
8224
|
-
var DropdownMenuSubContent = /* @__PURE__ */
|
|
8466
|
+
var DropdownMenuSubContent = /* @__PURE__ */ React38.forwardRef(/* @__PURE__ */ __name23(function DropdownMenuSubContent2(props, forwardedRef) {
|
|
8225
8467
|
const { __scopeDropdownMenu, ...subContentProps } = props;
|
|
8226
8468
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
8227
8469
|
return /* @__PURE__ */ import_jsx_runtime13.jsx(SubContent, {
|
|
@@ -8254,29 +8496,29 @@ var SubTrigger2 = DropdownMenuSubTrigger;
|
|
|
8254
8496
|
var SubContent2 = DropdownMenuSubContent;
|
|
8255
8497
|
|
|
8256
8498
|
// src/components/ui/dropdown-menu.tsx
|
|
8257
|
-
var
|
|
8499
|
+
var jsx_runtime4 = require("react/jsx-runtime");
|
|
8258
8500
|
var DropdownMenu2 = Root22;
|
|
8259
8501
|
var DropdownMenuTrigger2 = Trigger;
|
|
8260
|
-
var DropdownMenuSubTrigger2 =
|
|
8502
|
+
var DropdownMenuSubTrigger2 = React39.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsx_runtime4.jsxs(SubTrigger2, {
|
|
8261
8503
|
ref,
|
|
8262
8504
|
className: cn("flex cursor-default select-none items-center gap-2 rounded-radius-100 px-2 py-1.5 text-sm outline-none", "focus:bg-surface-raised data-[state=open]:bg-surface-raised", inset && "pl-8", "[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", className),
|
|
8263
8505
|
...props,
|
|
8264
8506
|
children: [
|
|
8265
8507
|
children,
|
|
8266
|
-
/* @__PURE__ */
|
|
8508
|
+
/* @__PURE__ */ jsx_runtime4.jsx(ChevronRight, {
|
|
8267
8509
|
className: "ml-auto"
|
|
8268
8510
|
})
|
|
8269
8511
|
]
|
|
8270
8512
|
}));
|
|
8271
8513
|
DropdownMenuSubTrigger2.displayName = SubTrigger2.displayName;
|
|
8272
|
-
var DropdownMenuSubContent2 =
|
|
8514
|
+
var DropdownMenuSubContent2 = React39.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx_runtime4.jsx(SubContent2, {
|
|
8273
8515
|
ref,
|
|
8274
8516
|
className: cn("z-50 min-w-[8rem] overflow-hidden rounded-radius-200 border border-line-default", "bg-surface-raised p-1 text-content-default shadow-elevation-2", "data-[state=open]:animate-in data-[state=closed]:animate-out", "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", "data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95", "data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2", "data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", className),
|
|
8275
8517
|
...props
|
|
8276
8518
|
}));
|
|
8277
8519
|
DropdownMenuSubContent2.displayName = SubContent2.displayName;
|
|
8278
|
-
var DropdownMenuContent2 =
|
|
8279
|
-
children: /* @__PURE__ */
|
|
8520
|
+
var DropdownMenuContent2 = React39.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx_runtime4.jsx(Portal22, {
|
|
8521
|
+
children: /* @__PURE__ */ jsx_runtime4.jsx(Content22, {
|
|
8280
8522
|
ref,
|
|
8281
8523
|
sideOffset,
|
|
8282
8524
|
className: cn("z-50 min-w-[8rem] overflow-hidden rounded-radius-200 border border-line-default", "bg-surface-raised p-1 text-content-default shadow-elevation-2", "data-[state=open]:animate-in data-[state=closed]:animate-out", "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", "data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95", "data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2", "data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", className),
|
|
@@ -8284,22 +8526,22 @@ var DropdownMenuContent2 = React38.forwardRef(({ className, sideOffset = 4, ...p
|
|
|
8284
8526
|
})
|
|
8285
8527
|
}));
|
|
8286
8528
|
DropdownMenuContent2.displayName = Content22.displayName;
|
|
8287
|
-
var DropdownMenuItem2 =
|
|
8529
|
+
var DropdownMenuItem2 = React39.forwardRef(({ className, inset, destructive, ...props }, ref) => /* @__PURE__ */ jsx_runtime4.jsx(Item22, {
|
|
8288
8530
|
ref,
|
|
8289
8531
|
className: cn("relative flex cursor-default select-none items-center gap-2 rounded-radius-100 px-2 py-1.5 text-sm outline-none transition-colors", "data-[highlighted]:bg-surface-overlay data-[highlighted]:text-content-default", "data-[disabled]:pointer-events-none data-[disabled]:opacity-50", "[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", inset && "pl-8", destructive && "text-status-danger-bold focus:text-status-danger-bold", className),
|
|
8290
8532
|
...props
|
|
8291
8533
|
}));
|
|
8292
8534
|
DropdownMenuItem2.displayName = Item22.displayName;
|
|
8293
|
-
var DropdownMenuCheckboxItem2 =
|
|
8535
|
+
var DropdownMenuCheckboxItem2 = React39.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsx_runtime4.jsxs(CheckboxItem2, {
|
|
8294
8536
|
ref,
|
|
8295
|
-
className: cn("relative flex cursor-default select-none items-center rounded-radius-100 py-1.5 pl-8 pr-2 text-sm outline-none transition-colors", "
|
|
8537
|
+
className: cn("relative flex cursor-default select-none items-center rounded-radius-100 py-1.5 pl-8 pr-2 text-sm outline-none transition-colors", "data-[highlighted]:bg-surface-overlay data-[highlighted]:text-content-default", "data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className),
|
|
8296
8538
|
checked,
|
|
8297
8539
|
...props,
|
|
8298
8540
|
children: [
|
|
8299
|
-
/* @__PURE__ */
|
|
8541
|
+
/* @__PURE__ */ jsx_runtime4.jsx("span", {
|
|
8300
8542
|
className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center",
|
|
8301
|
-
children: /* @__PURE__ */
|
|
8302
|
-
children: /* @__PURE__ */
|
|
8543
|
+
children: /* @__PURE__ */ jsx_runtime4.jsx(ItemIndicator2, {
|
|
8544
|
+
children: /* @__PURE__ */ jsx_runtime4.jsx(Check, {
|
|
8303
8545
|
className: "h-4 w-4"
|
|
8304
8546
|
})
|
|
8305
8547
|
})
|
|
@@ -8308,15 +8550,15 @@ var DropdownMenuCheckboxItem2 = React38.forwardRef(({ className, children, check
|
|
|
8308
8550
|
]
|
|
8309
8551
|
}));
|
|
8310
8552
|
DropdownMenuCheckboxItem2.displayName = CheckboxItem2.displayName;
|
|
8311
|
-
var DropdownMenuRadioItem2 =
|
|
8553
|
+
var DropdownMenuRadioItem2 = React39.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx_runtime4.jsxs(RadioItem2, {
|
|
8312
8554
|
ref,
|
|
8313
|
-
className: cn("relative flex cursor-default select-none items-center rounded-radius-100 py-1.5 pl-8 pr-2 text-sm outline-none transition-colors", "
|
|
8555
|
+
className: cn("relative flex cursor-default select-none items-center rounded-radius-100 py-1.5 pl-8 pr-2 text-sm outline-none transition-colors", "data-[highlighted]:bg-surface-overlay data-[highlighted]:text-content-default", "data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className),
|
|
8314
8556
|
...props,
|
|
8315
8557
|
children: [
|
|
8316
|
-
/* @__PURE__ */
|
|
8558
|
+
/* @__PURE__ */ jsx_runtime4.jsx("span", {
|
|
8317
8559
|
className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center",
|
|
8318
|
-
children: /* @__PURE__ */
|
|
8319
|
-
children: /* @__PURE__ */
|
|
8560
|
+
children: /* @__PURE__ */ jsx_runtime4.jsx(ItemIndicator2, {
|
|
8561
|
+
children: /* @__PURE__ */ jsx_runtime4.jsx(Circle, {
|
|
8320
8562
|
className: "h-2 w-2 fill-current"
|
|
8321
8563
|
})
|
|
8322
8564
|
})
|
|
@@ -8325,13 +8567,13 @@ var DropdownMenuRadioItem2 = React38.forwardRef(({ className, children, ...props
|
|
|
8325
8567
|
]
|
|
8326
8568
|
}));
|
|
8327
8569
|
DropdownMenuRadioItem2.displayName = RadioItem2.displayName;
|
|
8328
|
-
var DropdownMenuLabel2 =
|
|
8570
|
+
var DropdownMenuLabel2 = React39.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx_runtime4.jsx(Label2, {
|
|
8329
8571
|
ref,
|
|
8330
8572
|
className: cn("px-2 py-1.5 text-xs font-semibold text-content-subtle", inset && "pl-8", className),
|
|
8331
8573
|
...props
|
|
8332
8574
|
}));
|
|
8333
8575
|
DropdownMenuLabel2.displayName = Label2.displayName;
|
|
8334
|
-
var DropdownMenuSeparator2 =
|
|
8576
|
+
var DropdownMenuSeparator2 = React39.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx_runtime4.jsx(Separator2, {
|
|
8335
8577
|
ref,
|
|
8336
8578
|
className: cn("-mx-1 my-1 h-px bg-line-default", className),
|
|
8337
8579
|
...props
|
|
@@ -8340,23 +8582,23 @@ DropdownMenuSeparator2.displayName = Separator2.displayName;
|
|
|
8340
8582
|
var DropdownMenuShortcut = ({
|
|
8341
8583
|
className,
|
|
8342
8584
|
...props
|
|
8343
|
-
}) => /* @__PURE__ */
|
|
8585
|
+
}) => /* @__PURE__ */ jsx_runtime4.jsx("span", {
|
|
8344
8586
|
className: cn("ml-auto text-xs tracking-widest text-content-subtle", className),
|
|
8345
8587
|
...props
|
|
8346
8588
|
});
|
|
8347
8589
|
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
8348
8590
|
|
|
8349
8591
|
// src/components/ui/separator.tsx
|
|
8350
|
-
var
|
|
8592
|
+
var React41 = __toESM(require("react"), 1);
|
|
8351
8593
|
|
|
8352
8594
|
// ../../node_modules/.pnpm/@radix-ui+react-separator@1.1.15_@types+react-dom@18.3.7_@types+react@18.3.31__@types+r_4a12feba46caccd3ef696040f49a7ac3/node_modules/@radix-ui/react-separator/dist/index.mjs
|
|
8353
|
-
var
|
|
8595
|
+
var React40 = __toESM(require("react"), 1);
|
|
8354
8596
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
8355
8597
|
var __defProp25 = Object.defineProperty;
|
|
8356
8598
|
var __name24 = (target, value) => __defProp25(target, "name", { value, configurable: true });
|
|
8357
8599
|
var DEFAULT_ORIENTATION = "horizontal";
|
|
8358
8600
|
var ORIENTATIONS = ["horizontal", "vertical"];
|
|
8359
|
-
var Separator3 = /* @__PURE__ */
|
|
8601
|
+
var Separator3 = /* @__PURE__ */ React40.forwardRef(/* @__PURE__ */ __name24(function Separator2(props, forwardedRef) {
|
|
8360
8602
|
const { decorative, orientation: orientationProp = DEFAULT_ORIENTATION, ...domProps } = props;
|
|
8361
8603
|
const orientation = isValidOrientation(orientationProp) ? orientationProp : DEFAULT_ORIENTATION;
|
|
8362
8604
|
const ariaOrientation = orientation === "vertical" ? orientation : undefined;
|
|
@@ -8375,8 +8617,8 @@ __name24(isValidOrientation, "isValidOrientation");
|
|
|
8375
8617
|
var Root4 = Separator3;
|
|
8376
8618
|
|
|
8377
8619
|
// src/components/ui/separator.tsx
|
|
8378
|
-
var
|
|
8379
|
-
var Separator4 =
|
|
8620
|
+
var jsx_runtime5 = require("react/jsx-runtime");
|
|
8621
|
+
var Separator4 = React41.forwardRef(({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ jsx_runtime5.jsx(Root4, {
|
|
8380
8622
|
ref,
|
|
8381
8623
|
decorative,
|
|
8382
8624
|
orientation,
|
|
@@ -8385,13 +8627,27 @@ var Separator4 = React40.forwardRef(({ className, orientation = "horizontal", de
|
|
|
8385
8627
|
}));
|
|
8386
8628
|
Separator4.displayName = Root4.displayName;
|
|
8387
8629
|
|
|
8388
|
-
// src/
|
|
8389
|
-
var jsx_runtime5 = require("react/jsx-runtime");
|
|
8630
|
+
// src/utils/getInitials.ts
|
|
8390
8631
|
function getInitials(name) {
|
|
8391
8632
|
return name.split(" ").filter(Boolean).slice(0, 2).map((w) => w[0]?.toUpperCase() ?? "").join("");
|
|
8392
8633
|
}
|
|
8634
|
+
|
|
8635
|
+
// src/components/Header.tsx
|
|
8636
|
+
var jsx_runtime6 = require("react/jsx-runtime");
|
|
8637
|
+
function safeHref(url) {
|
|
8638
|
+
if (!url)
|
|
8639
|
+
return;
|
|
8640
|
+
try {
|
|
8641
|
+
const parsed = new URL(url);
|
|
8642
|
+
if (parsed.protocol !== "https:" && parsed.protocol !== "http:")
|
|
8643
|
+
return;
|
|
8644
|
+
return url;
|
|
8645
|
+
} catch {
|
|
8646
|
+
return;
|
|
8647
|
+
}
|
|
8648
|
+
}
|
|
8393
8649
|
function IconButton({ label, children, className, ...props }) {
|
|
8394
|
-
return /* @__PURE__ */
|
|
8650
|
+
return /* @__PURE__ */ jsx_runtime6.jsx("button", {
|
|
8395
8651
|
type: "button",
|
|
8396
8652
|
"aria-label": label,
|
|
8397
8653
|
className: cn("flex h-8 w-8 items-center justify-center rounded-md", "text-content-subtle transition-colors", "hover:bg-surface-raised hover:text-content-default", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action-primary", className),
|
|
@@ -8399,23 +8655,24 @@ function IconButton({ label, children, className, ...props }) {
|
|
|
8399
8655
|
children
|
|
8400
8656
|
});
|
|
8401
8657
|
}
|
|
8402
|
-
function UserMenu({ user, tenant }) {
|
|
8403
|
-
|
|
8658
|
+
function UserMenu({ user, tenant, settingsHref, logoutHref }) {
|
|
8659
|
+
const communityHref = safeHref(tenant.communityUrl);
|
|
8660
|
+
return /* @__PURE__ */ jsx_runtime6.jsxs(DropdownMenu2, {
|
|
8404
8661
|
children: [
|
|
8405
|
-
/* @__PURE__ */
|
|
8662
|
+
/* @__PURE__ */ jsx_runtime6.jsx(DropdownMenuTrigger2, {
|
|
8406
8663
|
asChild: true,
|
|
8407
|
-
children: /* @__PURE__ */
|
|
8664
|
+
children: /* @__PURE__ */ jsx_runtime6.jsx("button", {
|
|
8408
8665
|
type: "button",
|
|
8409
|
-
"aria-label": `
|
|
8410
|
-
className: cn("rounded-full outline-none", "
|
|
8411
|
-
children: /* @__PURE__ */
|
|
8666
|
+
"aria-label": `Open user menu for ${user.name}`,
|
|
8667
|
+
className: cn("rounded-full outline-none", "focus-visible:ring-2 focus-visible:ring-action-primary focus-visible:ring-offset-2", "transition-opacity hover:opacity-80"),
|
|
8668
|
+
children: /* @__PURE__ */ jsx_runtime6.jsxs(Avatar2, {
|
|
8412
8669
|
className: "h-8 w-8",
|
|
8413
8670
|
children: [
|
|
8414
|
-
/* @__PURE__ */
|
|
8671
|
+
/* @__PURE__ */ jsx_runtime6.jsx(AvatarImage2, {
|
|
8415
8672
|
src: user.avatar,
|
|
8416
8673
|
alt: user.name
|
|
8417
8674
|
}),
|
|
8418
|
-
/* @__PURE__ */
|
|
8675
|
+
/* @__PURE__ */ jsx_runtime6.jsx(AvatarFallback2, {
|
|
8419
8676
|
className: "text-xs",
|
|
8420
8677
|
children: getInitials(user.name)
|
|
8421
8678
|
})
|
|
@@ -8423,65 +8680,68 @@ function UserMenu({ user, tenant }) {
|
|
|
8423
8680
|
})
|
|
8424
8681
|
})
|
|
8425
8682
|
}),
|
|
8426
|
-
/* @__PURE__ */
|
|
8683
|
+
/* @__PURE__ */ jsx_runtime6.jsxs(DropdownMenuContent2, {
|
|
8427
8684
|
align: "end",
|
|
8428
8685
|
className: "w-56",
|
|
8429
8686
|
children: [
|
|
8430
|
-
/* @__PURE__ */
|
|
8687
|
+
/* @__PURE__ */ jsx_runtime6.jsx(DropdownMenuLabel2, {
|
|
8431
8688
|
className: "font-normal",
|
|
8432
|
-
children: /* @__PURE__ */
|
|
8689
|
+
children: /* @__PURE__ */ jsx_runtime6.jsxs("div", {
|
|
8433
8690
|
className: "flex flex-col gap-0.5",
|
|
8434
8691
|
children: [
|
|
8435
|
-
/* @__PURE__ */
|
|
8692
|
+
/* @__PURE__ */ jsx_runtime6.jsx("span", {
|
|
8436
8693
|
className: "text-sm font-semibold text-content-default",
|
|
8437
8694
|
children: user.name
|
|
8438
8695
|
}),
|
|
8439
|
-
/* @__PURE__ */
|
|
8440
|
-
className: "text-xs text-content-subtle
|
|
8696
|
+
/* @__PURE__ */ jsx_runtime6.jsx("span", {
|
|
8697
|
+
className: "truncate text-xs text-content-subtle",
|
|
8441
8698
|
children: user.email
|
|
8442
8699
|
})
|
|
8443
8700
|
]
|
|
8444
8701
|
})
|
|
8445
8702
|
}),
|
|
8446
|
-
/* @__PURE__ */
|
|
8447
|
-
/* @__PURE__ */
|
|
8703
|
+
/* @__PURE__ */ jsx_runtime6.jsx(DropdownMenuSeparator2, {}),
|
|
8704
|
+
communityHref && /* @__PURE__ */ jsx_runtime6.jsx(DropdownMenuItem2, {
|
|
8448
8705
|
asChild: true,
|
|
8449
|
-
children: /* @__PURE__ */
|
|
8450
|
-
href:
|
|
8706
|
+
children: /* @__PURE__ */ jsx_runtime6.jsxs("a", {
|
|
8707
|
+
href: communityHref,
|
|
8451
8708
|
target: "_blank",
|
|
8452
8709
|
rel: "noreferrer",
|
|
8453
8710
|
className: "cursor-pointer",
|
|
8454
8711
|
children: [
|
|
8455
|
-
/* @__PURE__ */
|
|
8456
|
-
className: "h-4 w-4"
|
|
8712
|
+
/* @__PURE__ */ jsx_runtime6.jsx(ExternalLink, {
|
|
8713
|
+
className: "h-4 w-4",
|
|
8714
|
+
"aria-hidden": "true"
|
|
8457
8715
|
}),
|
|
8458
8716
|
"Open Community"
|
|
8459
8717
|
]
|
|
8460
8718
|
})
|
|
8461
8719
|
}),
|
|
8462
|
-
/* @__PURE__ */
|
|
8720
|
+
/* @__PURE__ */ jsx_runtime6.jsx(DropdownMenuItem2, {
|
|
8463
8721
|
asChild: true,
|
|
8464
|
-
children: /* @__PURE__ */
|
|
8465
|
-
href:
|
|
8722
|
+
children: /* @__PURE__ */ jsx_runtime6.jsxs("a", {
|
|
8723
|
+
href: settingsHref,
|
|
8466
8724
|
className: "cursor-pointer",
|
|
8467
8725
|
children: [
|
|
8468
|
-
/* @__PURE__ */
|
|
8469
|
-
className: "h-4 w-4"
|
|
8726
|
+
/* @__PURE__ */ jsx_runtime6.jsx(Settings, {
|
|
8727
|
+
className: "h-4 w-4",
|
|
8728
|
+
"aria-hidden": "true"
|
|
8470
8729
|
}),
|
|
8471
8730
|
"Settings"
|
|
8472
8731
|
]
|
|
8473
8732
|
})
|
|
8474
8733
|
}),
|
|
8475
|
-
/* @__PURE__ */
|
|
8476
|
-
/* @__PURE__ */
|
|
8734
|
+
/* @__PURE__ */ jsx_runtime6.jsx(DropdownMenuSeparator2, {}),
|
|
8735
|
+
/* @__PURE__ */ jsx_runtime6.jsx(DropdownMenuItem2, {
|
|
8477
8736
|
asChild: true,
|
|
8478
8737
|
destructive: true,
|
|
8479
|
-
children: /* @__PURE__ */
|
|
8480
|
-
href:
|
|
8738
|
+
children: /* @__PURE__ */ jsx_runtime6.jsxs("a", {
|
|
8739
|
+
href: logoutHref,
|
|
8481
8740
|
className: "cursor-pointer",
|
|
8482
8741
|
children: [
|
|
8483
|
-
/* @__PURE__ */
|
|
8484
|
-
className: "h-4 w-4"
|
|
8742
|
+
/* @__PURE__ */ jsx_runtime6.jsx(LogOut, {
|
|
8743
|
+
className: "h-4 w-4",
|
|
8744
|
+
"aria-hidden": "true"
|
|
8485
8745
|
}),
|
|
8486
8746
|
"Log out"
|
|
8487
8747
|
]
|
|
@@ -8492,54 +8752,70 @@ function UserMenu({ user, tenant }) {
|
|
|
8492
8752
|
]
|
|
8493
8753
|
});
|
|
8494
8754
|
}
|
|
8495
|
-
var Header =
|
|
8496
|
-
|
|
8755
|
+
var Header = React42.memo(function Header({
|
|
8756
|
+
user,
|
|
8757
|
+
tenant,
|
|
8758
|
+
rightSlot,
|
|
8759
|
+
settingsHref = "/settings/profile",
|
|
8760
|
+
logoutHref = "/member/logout",
|
|
8761
|
+
onMembersOnlineClick,
|
|
8762
|
+
onNotificationsClick
|
|
8763
|
+
}) {
|
|
8764
|
+
const hasUtilityButtons = onMembersOnlineClick || onNotificationsClick;
|
|
8765
|
+
const hasRightContent = rightSlot != null || hasUtilityButtons;
|
|
8766
|
+
return /* @__PURE__ */ jsx_runtime6.jsxs("header", {
|
|
8497
8767
|
className: cn("app-shell-header", "flex h-12 shrink-0 items-center justify-end gap-1 px-4", "border-b border-line-default bg-surface-default", "z-10"),
|
|
8498
8768
|
children: [
|
|
8499
|
-
/* @__PURE__ */
|
|
8769
|
+
onMembersOnlineClick && /* @__PURE__ */ jsx_runtime6.jsx(IconButton, {
|
|
8500
8770
|
label: "Members online",
|
|
8501
|
-
|
|
8502
|
-
|
|
8771
|
+
onClick: onMembersOnlineClick,
|
|
8772
|
+
children: /* @__PURE__ */ jsx_runtime6.jsx(Users, {
|
|
8773
|
+
className: "h-4 w-4",
|
|
8774
|
+
"aria-hidden": "true"
|
|
8503
8775
|
})
|
|
8504
8776
|
}),
|
|
8505
|
-
/* @__PURE__ */
|
|
8777
|
+
onNotificationsClick && /* @__PURE__ */ jsx_runtime6.jsx(IconButton, {
|
|
8506
8778
|
label: "Notifications",
|
|
8507
|
-
|
|
8508
|
-
|
|
8779
|
+
onClick: onNotificationsClick,
|
|
8780
|
+
children: /* @__PURE__ */ jsx_runtime6.jsx(Bell, {
|
|
8781
|
+
className: "h-4 w-4",
|
|
8782
|
+
"aria-hidden": "true"
|
|
8509
8783
|
})
|
|
8510
8784
|
}),
|
|
8511
|
-
rightSlot != null && /* @__PURE__ */
|
|
8785
|
+
rightSlot != null && /* @__PURE__ */ jsx_runtime6.jsxs(jsx_runtime6.Fragment, {
|
|
8512
8786
|
children: [
|
|
8513
|
-
/* @__PURE__ */
|
|
8787
|
+
hasUtilityButtons && /* @__PURE__ */ jsx_runtime6.jsx(Separator4, {
|
|
8514
8788
|
orientation: "vertical",
|
|
8515
8789
|
className: "mx-1 h-4"
|
|
8516
8790
|
}),
|
|
8517
8791
|
rightSlot
|
|
8518
8792
|
]
|
|
8519
8793
|
}),
|
|
8520
|
-
/* @__PURE__ */
|
|
8794
|
+
hasRightContent && /* @__PURE__ */ jsx_runtime6.jsx(Separator4, {
|
|
8521
8795
|
orientation: "vertical",
|
|
8522
8796
|
className: "mx-1 h-4"
|
|
8523
8797
|
}),
|
|
8524
|
-
/* @__PURE__ */
|
|
8798
|
+
/* @__PURE__ */ jsx_runtime6.jsx(UserMenu, {
|
|
8525
8799
|
user,
|
|
8526
|
-
tenant
|
|
8800
|
+
tenant,
|
|
8801
|
+
settingsHref,
|
|
8802
|
+
logoutHref
|
|
8527
8803
|
})
|
|
8528
8804
|
]
|
|
8529
8805
|
});
|
|
8530
8806
|
});
|
|
8531
8807
|
|
|
8532
8808
|
// src/components/SideNavigation.tsx
|
|
8533
|
-
var
|
|
8809
|
+
var React52 = __toESM(require("react"), 1);
|
|
8534
8810
|
|
|
8535
8811
|
// src/components/ui/accordion.tsx
|
|
8536
|
-
var
|
|
8812
|
+
var React45 = __toESM(require("react"), 1);
|
|
8537
8813
|
|
|
8538
8814
|
// ../../node_modules/.pnpm/@radix-ui+react-accordion@1.2.20_@types+react-dom@18.3.7_@types+react@18.3.31__@types+r_6e1de0feb05f9758311ca62a4562cf78/node_modules/@radix-ui/react-accordion/dist/index.mjs
|
|
8539
|
-
var
|
|
8815
|
+
var React44 = __toESM(require("react"), 1);
|
|
8540
8816
|
|
|
8541
8817
|
// ../../node_modules/.pnpm/@radix-ui+react-collapsible@1.1.20_@types+react-dom@18.3.7_@types+react@18.3.31__@types_95df58d005192586eb1c943efded7427/node_modules/@radix-ui/react-collapsible/dist/index.mjs
|
|
8542
|
-
var
|
|
8818
|
+
var React43 = __toESM(require("react"), 1);
|
|
8543
8819
|
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
8544
8820
|
"use client";
|
|
8545
8821
|
var __defProp26 = Object.defineProperty;
|
|
@@ -8547,7 +8823,7 @@ var __name25 = (target, value) => __defProp26(target, "name", { value, configura
|
|
|
8547
8823
|
var COLLAPSIBLE_NAME = "Collapsible";
|
|
8548
8824
|
var [createCollapsibleContext, createCollapsibleScope] = createContextScope(COLLAPSIBLE_NAME);
|
|
8549
8825
|
var [CollapsibleProvider, useCollapsibleContext] = createCollapsibleContext(COLLAPSIBLE_NAME);
|
|
8550
|
-
var Collapsible = /* @__PURE__ */
|
|
8826
|
+
var Collapsible = /* @__PURE__ */ React43.forwardRef(/* @__PURE__ */ __name25(function Collapsible2(props, forwardedRef) {
|
|
8551
8827
|
const {
|
|
8552
8828
|
__scopeCollapsible,
|
|
8553
8829
|
open: openProp,
|
|
@@ -8567,7 +8843,7 @@ var Collapsible = /* @__PURE__ */ React42.forwardRef(/* @__PURE__ */ __name25(fu
|
|
|
8567
8843
|
disabled,
|
|
8568
8844
|
contentId: useId(),
|
|
8569
8845
|
open,
|
|
8570
|
-
onOpenToggle:
|
|
8846
|
+
onOpenToggle: React43.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
|
8571
8847
|
children: /* @__PURE__ */ import_jsx_runtime15.jsx(Primitive.div, {
|
|
8572
8848
|
"data-state": getState(open),
|
|
8573
8849
|
"data-disabled": disabled ? "" : undefined,
|
|
@@ -8577,7 +8853,7 @@ var Collapsible = /* @__PURE__ */ React42.forwardRef(/* @__PURE__ */ __name25(fu
|
|
|
8577
8853
|
});
|
|
8578
8854
|
}, "Collapsible"));
|
|
8579
8855
|
var TRIGGER_NAME2 = "CollapsibleTrigger";
|
|
8580
|
-
var CollapsibleTrigger = /* @__PURE__ */
|
|
8856
|
+
var CollapsibleTrigger = /* @__PURE__ */ React43.forwardRef(/* @__PURE__ */ __name25(function CollapsibleTrigger2(props, forwardedRef) {
|
|
8581
8857
|
const { __scopeCollapsible, ...triggerProps } = props;
|
|
8582
8858
|
const context = useCollapsibleContext(TRIGGER_NAME2, __scopeCollapsible);
|
|
8583
8859
|
return /* @__PURE__ */ import_jsx_runtime15.jsx(Primitive.button, {
|
|
@@ -8593,25 +8869,25 @@ var CollapsibleTrigger = /* @__PURE__ */ React42.forwardRef(/* @__PURE__ */ __na
|
|
|
8593
8869
|
});
|
|
8594
8870
|
}, "CollapsibleTrigger"));
|
|
8595
8871
|
var CONTENT_NAME4 = "CollapsibleContent";
|
|
8596
|
-
var CollapsibleContent = /* @__PURE__ */
|
|
8872
|
+
var CollapsibleContent = /* @__PURE__ */ React43.forwardRef(/* @__PURE__ */ __name25(function CollapsibleContent2(props, forwardedRef) {
|
|
8597
8873
|
const { forceMount, ...contentProps } = props;
|
|
8598
8874
|
const context = useCollapsibleContext(CONTENT_NAME4, props.__scopeCollapsible);
|
|
8599
8875
|
return /* @__PURE__ */ import_jsx_runtime15.jsx(Presence, { present: forceMount || context.open, children: ({ present }) => /* @__PURE__ */ import_jsx_runtime15.jsx(CollapsibleContentImpl, { ...contentProps, ref: forwardedRef, present }) });
|
|
8600
8876
|
}, "CollapsibleContent"));
|
|
8601
|
-
var CollapsibleContentImpl = /* @__PURE__ */
|
|
8877
|
+
var CollapsibleContentImpl = /* @__PURE__ */ React43.forwardRef(/* @__PURE__ */ __name25(function CollapsibleContentImpl2(props, forwardedRef) {
|
|
8602
8878
|
const { __scopeCollapsible, present, children, ...contentProps } = props;
|
|
8603
8879
|
const context = useCollapsibleContext(CONTENT_NAME4, __scopeCollapsible);
|
|
8604
|
-
const [isPresent, setIsPresent] =
|
|
8605
|
-
const ref =
|
|
8880
|
+
const [isPresent, setIsPresent] = React43.useState(present);
|
|
8881
|
+
const ref = React43.useRef(null);
|
|
8606
8882
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
8607
|
-
const heightRef =
|
|
8883
|
+
const heightRef = React43.useRef(0);
|
|
8608
8884
|
const height = heightRef.current;
|
|
8609
|
-
const widthRef =
|
|
8885
|
+
const widthRef = React43.useRef(0);
|
|
8610
8886
|
const width = widthRef.current;
|
|
8611
8887
|
const isOpen = context.open || isPresent;
|
|
8612
|
-
const isMountAnimationPreventedRef =
|
|
8613
|
-
const originalStylesRef =
|
|
8614
|
-
|
|
8888
|
+
const isMountAnimationPreventedRef = React43.useRef(isOpen);
|
|
8889
|
+
const originalStylesRef = React43.useRef(undefined);
|
|
8890
|
+
React43.useEffect(() => {
|
|
8615
8891
|
const rAF = requestAnimationFrame(() => isMountAnimationPreventedRef.current = false);
|
|
8616
8892
|
return () => cancelAnimationFrame(rAF);
|
|
8617
8893
|
}, []);
|
|
@@ -8670,7 +8946,7 @@ var [createAccordionContext, createAccordionScope] = createContextScope(ACCORDIO
|
|
|
8670
8946
|
createCollapsibleScope
|
|
8671
8947
|
]);
|
|
8672
8948
|
var useCollapsibleScope = createCollapsibleScope();
|
|
8673
|
-
var Accordion = /* @__PURE__ */
|
|
8949
|
+
var Accordion = /* @__PURE__ */ React44.forwardRef(/* @__PURE__ */ __name26(function Accordion2(props, forwardedRef) {
|
|
8674
8950
|
const { type, ...accordionProps } = props;
|
|
8675
8951
|
const singleProps = accordionProps;
|
|
8676
8952
|
const multipleProps = accordionProps;
|
|
@@ -8678,7 +8954,7 @@ var Accordion = /* @__PURE__ */ React43.forwardRef(/* @__PURE__ */ __name26(func
|
|
|
8678
8954
|
}, "Accordion"));
|
|
8679
8955
|
var [AccordionValueProvider, useAccordionValueContext] = createAccordionContext(ACCORDION_NAME);
|
|
8680
8956
|
var [AccordionCollapsibleProvider, useAccordionCollapsibleContext] = createAccordionContext(ACCORDION_NAME, { collapsible: false });
|
|
8681
|
-
var AccordionImplSingle = /* @__PURE__ */
|
|
8957
|
+
var AccordionImplSingle = /* @__PURE__ */ React44.forwardRef(/* @__PURE__ */ __name26(function AccordionImplSingle2(props, forwardedRef) {
|
|
8682
8958
|
const {
|
|
8683
8959
|
value: valueProp,
|
|
8684
8960
|
defaultValue,
|
|
@@ -8694,13 +8970,13 @@ var AccordionImplSingle = /* @__PURE__ */ React43.forwardRef(/* @__PURE__ */ __n
|
|
|
8694
8970
|
});
|
|
8695
8971
|
return /* @__PURE__ */ import_jsx_runtime16.jsx(AccordionValueProvider, {
|
|
8696
8972
|
scope: props.__scopeAccordion,
|
|
8697
|
-
value:
|
|
8973
|
+
value: React44.useMemo(() => value ? [value] : [], [value]),
|
|
8698
8974
|
onItemOpen: setValue,
|
|
8699
|
-
onItemClose:
|
|
8975
|
+
onItemClose: React44.useCallback(() => collapsible && setValue(""), [collapsible, setValue]),
|
|
8700
8976
|
children: /* @__PURE__ */ import_jsx_runtime16.jsx(AccordionCollapsibleProvider, { scope: props.__scopeAccordion, collapsible, children: /* @__PURE__ */ import_jsx_runtime16.jsx(AccordionImpl, { ...accordionSingleProps, ref: forwardedRef }) })
|
|
8701
8977
|
});
|
|
8702
8978
|
}, "AccordionImplSingle"));
|
|
8703
|
-
var AccordionImplMultiple = /* @__PURE__ */
|
|
8979
|
+
var AccordionImplMultiple = /* @__PURE__ */ React44.forwardRef(/* @__PURE__ */ __name26(function AccordionImplMultiple2(props, forwardedRef) {
|
|
8704
8980
|
const {
|
|
8705
8981
|
value: valueProp,
|
|
8706
8982
|
defaultValue,
|
|
@@ -8713,8 +8989,8 @@ var AccordionImplMultiple = /* @__PURE__ */ React43.forwardRef(/* @__PURE__ */ _
|
|
|
8713
8989
|
onChange: onValueChange,
|
|
8714
8990
|
caller: ACCORDION_NAME
|
|
8715
8991
|
});
|
|
8716
|
-
const handleItemOpen =
|
|
8717
|
-
const handleItemClose =
|
|
8992
|
+
const handleItemOpen = React44.useCallback((itemValue) => setValue((prevValue = []) => [...prevValue, itemValue]), [setValue]);
|
|
8993
|
+
const handleItemClose = React44.useCallback((itemValue) => setValue((prevValue = []) => prevValue.filter((value2) => value2 !== itemValue)), [setValue]);
|
|
8718
8994
|
return /* @__PURE__ */ import_jsx_runtime16.jsx(AccordionValueProvider, {
|
|
8719
8995
|
scope: props.__scopeAccordion,
|
|
8720
8996
|
value,
|
|
@@ -8724,9 +9000,9 @@ var AccordionImplMultiple = /* @__PURE__ */ React43.forwardRef(/* @__PURE__ */ _
|
|
|
8724
9000
|
});
|
|
8725
9001
|
}, "AccordionImplMultiple"));
|
|
8726
9002
|
var [AccordionImplProvider, useAccordionContext] = createAccordionContext(ACCORDION_NAME);
|
|
8727
|
-
var AccordionImpl = /* @__PURE__ */
|
|
9003
|
+
var AccordionImpl = /* @__PURE__ */ React44.forwardRef(/* @__PURE__ */ __name26(function AccordionImpl2(props, forwardedRef) {
|
|
8728
9004
|
const { __scopeAccordion, disabled, dir, orientation = "vertical", ...accordionProps } = props;
|
|
8729
|
-
const accordionRef =
|
|
9005
|
+
const accordionRef = React44.useRef(null);
|
|
8730
9006
|
const composedRefs = useComposedRefs(accordionRef, forwardedRef);
|
|
8731
9007
|
const getItems = useCollection3(__scopeAccordion);
|
|
8732
9008
|
const direction = useDirection(dir);
|
|
@@ -8810,7 +9086,7 @@ var AccordionImpl = /* @__PURE__ */ React43.forwardRef(/* @__PURE__ */ __name26(
|
|
|
8810
9086
|
}, "AccordionImpl"));
|
|
8811
9087
|
var ITEM_NAME3 = "AccordionItem";
|
|
8812
9088
|
var [AccordionItemProvider, useAccordionItemContext] = createAccordionContext(ITEM_NAME3);
|
|
8813
|
-
var AccordionItem = /* @__PURE__ */
|
|
9089
|
+
var AccordionItem = /* @__PURE__ */ React44.forwardRef(/* @__PURE__ */ __name26(function AccordionItem2(props, forwardedRef) {
|
|
8814
9090
|
const { __scopeAccordion, value, ...accordionItemProps } = props;
|
|
8815
9091
|
const accordionContext = useAccordionContext(ITEM_NAME3, __scopeAccordion);
|
|
8816
9092
|
const valueContext = useAccordionValueContext(ITEM_NAME3, __scopeAccordion);
|
|
@@ -8842,7 +9118,7 @@ var AccordionItem = /* @__PURE__ */ React43.forwardRef(/* @__PURE__ */ __name26(
|
|
|
8842
9118
|
});
|
|
8843
9119
|
}, "AccordionItem"));
|
|
8844
9120
|
var HEADER_NAME = "AccordionHeader";
|
|
8845
|
-
var AccordionHeader = /* @__PURE__ */
|
|
9121
|
+
var AccordionHeader = /* @__PURE__ */ React44.forwardRef(/* @__PURE__ */ __name26(function AccordionHeader2(props, forwardedRef) {
|
|
8846
9122
|
const { __scopeAccordion, ...headerProps } = props;
|
|
8847
9123
|
const accordionContext = useAccordionContext(ACCORDION_NAME, __scopeAccordion);
|
|
8848
9124
|
const itemContext = useAccordionItemContext(HEADER_NAME, __scopeAccordion);
|
|
@@ -8855,7 +9131,7 @@ var AccordionHeader = /* @__PURE__ */ React43.forwardRef(/* @__PURE__ */ __name2
|
|
|
8855
9131
|
});
|
|
8856
9132
|
}, "AccordionHeader"));
|
|
8857
9133
|
var TRIGGER_NAME3 = "AccordionTrigger";
|
|
8858
|
-
var AccordionTrigger = /* @__PURE__ */
|
|
9134
|
+
var AccordionTrigger = /* @__PURE__ */ React44.forwardRef(/* @__PURE__ */ __name26(function AccordionTrigger2(props, forwardedRef) {
|
|
8859
9135
|
const { __scopeAccordion, ...triggerProps } = props;
|
|
8860
9136
|
const accordionContext = useAccordionContext(ACCORDION_NAME, __scopeAccordion);
|
|
8861
9137
|
const itemContext = useAccordionItemContext(TRIGGER_NAME3, __scopeAccordion);
|
|
@@ -8871,7 +9147,7 @@ var AccordionTrigger = /* @__PURE__ */ React43.forwardRef(/* @__PURE__ */ __name
|
|
|
8871
9147
|
}) });
|
|
8872
9148
|
}, "AccordionTrigger"));
|
|
8873
9149
|
var CONTENT_NAME5 = "AccordionContent";
|
|
8874
|
-
var AccordionContent = /* @__PURE__ */
|
|
9150
|
+
var AccordionContent = /* @__PURE__ */ React44.forwardRef(/* @__PURE__ */ __name26(function AccordionContent2(props, forwardedRef) {
|
|
8875
9151
|
const { __scopeAccordion, ...contentProps } = props;
|
|
8876
9152
|
const accordionContext = useAccordionContext(ACCORDION_NAME, __scopeAccordion);
|
|
8877
9153
|
const itemContext = useAccordionItemContext(CONTENT_NAME5, __scopeAccordion);
|
|
@@ -8901,34 +9177,38 @@ var Trigger22 = AccordionTrigger;
|
|
|
8901
9177
|
var Content23 = AccordionContent;
|
|
8902
9178
|
|
|
8903
9179
|
// src/components/ui/accordion.tsx
|
|
8904
|
-
var
|
|
9180
|
+
var jsx_runtime7 = require("react/jsx-runtime");
|
|
8905
9181
|
var Accordion2 = Root23;
|
|
8906
|
-
var AccordionItem2 =
|
|
9182
|
+
var AccordionItem2 = React45.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx_runtime7.jsx(Item3, {
|
|
8907
9183
|
ref,
|
|
8908
9184
|
className: cn(className),
|
|
8909
9185
|
...props
|
|
8910
9186
|
}));
|
|
8911
9187
|
AccordionItem2.displayName = "AccordionItem";
|
|
8912
|
-
var AccordionTrigger2 =
|
|
8913
|
-
|
|
8914
|
-
children: /* @__PURE__ */
|
|
8915
|
-
|
|
8916
|
-
|
|
8917
|
-
|
|
8918
|
-
|
|
8919
|
-
|
|
8920
|
-
|
|
8921
|
-
|
|
8922
|
-
|
|
8923
|
-
|
|
9188
|
+
var AccordionTrigger2 = React45.forwardRef(({ className, children, hideChevron = false, ...props }, ref) => /* @__PURE__ */ jsx_runtime7.jsx(Header2, {
|
|
9189
|
+
asChild: true,
|
|
9190
|
+
children: /* @__PURE__ */ jsx_runtime7.jsx("div", {
|
|
9191
|
+
className: "flex",
|
|
9192
|
+
children: /* @__PURE__ */ jsx_runtime7.jsxs(Trigger22, {
|
|
9193
|
+
ref,
|
|
9194
|
+
className: cn("flex flex-1 items-center gap-2 text-sm font-medium outline-none transition-all", "[&[data-state=open]>svg.accordion-chevron]:rotate-90", className),
|
|
9195
|
+
...props,
|
|
9196
|
+
children: [
|
|
9197
|
+
children,
|
|
9198
|
+
!hideChevron && /* @__PURE__ */ jsx_runtime7.jsx(ChevronRight, {
|
|
9199
|
+
"aria-hidden": "true",
|
|
9200
|
+
className: "accordion-chevron ml-auto h-3.5 w-3.5 shrink-0 text-muted-foreground/60 transition-transform duration-150"
|
|
9201
|
+
})
|
|
9202
|
+
]
|
|
9203
|
+
})
|
|
8924
9204
|
})
|
|
8925
9205
|
}));
|
|
8926
9206
|
AccordionTrigger2.displayName = "AccordionTrigger";
|
|
8927
|
-
var AccordionContent2 =
|
|
9207
|
+
var AccordionContent2 = React45.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx_runtime7.jsx(Content23, {
|
|
8928
9208
|
ref,
|
|
8929
9209
|
className: "overflow-hidden data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",
|
|
8930
9210
|
...props,
|
|
8931
|
-
children: /* @__PURE__ */
|
|
9211
|
+
children: /* @__PURE__ */ jsx_runtime7.jsx("div", {
|
|
8932
9212
|
className: cn("pb-1 pt-0.5", className),
|
|
8933
9213
|
children
|
|
8934
9214
|
})
|
|
@@ -8936,7 +9216,7 @@ var AccordionContent2 = React44.forwardRef(({ className, children, ...props }, r
|
|
|
8936
9216
|
AccordionContent2.displayName = "AccordionContent";
|
|
8937
9217
|
|
|
8938
9218
|
// src/components/ui/button.tsx
|
|
8939
|
-
var
|
|
9219
|
+
var React46 = __toESM(require("react"), 1);
|
|
8940
9220
|
|
|
8941
9221
|
// ../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.mjs
|
|
8942
9222
|
var falsyToString = (value) => typeof value === "boolean" ? `${value}` : value === 0 ? "0" : value;
|
|
@@ -8983,7 +9263,7 @@ var cva = (base, config) => (props) => {
|
|
|
8983
9263
|
};
|
|
8984
9264
|
|
|
8985
9265
|
// src/components/ui/button.tsx
|
|
8986
|
-
var
|
|
9266
|
+
var jsx_runtime8 = require("react/jsx-runtime");
|
|
8987
9267
|
var buttonVariants = cva([
|
|
8988
9268
|
"inline-flex items-center justify-center gap-2 whitespace-nowrap",
|
|
8989
9269
|
"rounded-radius-100 text-sm font-medium",
|
|
@@ -9012,9 +9292,10 @@ var buttonVariants = cva([
|
|
|
9012
9292
|
size: "default"
|
|
9013
9293
|
}
|
|
9014
9294
|
});
|
|
9015
|
-
var Button =
|
|
9295
|
+
var Button = React46.forwardRef(({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
9016
9296
|
const Comp = asChild ? Slot : "button";
|
|
9017
|
-
return /* @__PURE__ */
|
|
9297
|
+
return /* @__PURE__ */ jsx_runtime8.jsx(Comp, {
|
|
9298
|
+
type: asChild ? undefined : "button",
|
|
9018
9299
|
className: cn(buttonVariants({ variant, size, className })),
|
|
9019
9300
|
ref,
|
|
9020
9301
|
...props
|
|
@@ -9023,7 +9304,7 @@ var Button = React45.forwardRef(({ className, variant, size, asChild = false, ..
|
|
|
9023
9304
|
Button.displayName = "Button";
|
|
9024
9305
|
|
|
9025
9306
|
// src/components/ui/scroll-area.tsx
|
|
9026
|
-
var
|
|
9307
|
+
var React48 = __toESM(require("react"), 1);
|
|
9027
9308
|
|
|
9028
9309
|
// ../../node_modules/.pnpm/@radix-ui+react-scroll-area@1.2.18_@types+react-dom@18.3.7_@types+react@18.3.31__@types_44cf8b004accc7732570bde73f91c617/node_modules/@radix-ui/react-scroll-area/dist/index.mjs
|
|
9029
9310
|
var React210 = __toESM(require("react"), 1);
|
|
@@ -9037,13 +9318,13 @@ function clamp2(value, [min, max]) {
|
|
|
9037
9318
|
__name27(clamp2, "clamp");
|
|
9038
9319
|
|
|
9039
9320
|
// ../../node_modules/.pnpm/@radix-ui+react-scroll-area@1.2.18_@types+react-dom@18.3.7_@types+react@18.3.31__@types_44cf8b004accc7732570bde73f91c617/node_modules/@radix-ui/react-scroll-area/dist/index.mjs
|
|
9040
|
-
var
|
|
9321
|
+
var React47 = __toESM(require("react"), 1);
|
|
9041
9322
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
9042
9323
|
"use client";
|
|
9043
9324
|
var __defProp29 = Object.defineProperty;
|
|
9044
9325
|
var __name28 = (target, value) => __defProp29(target, "name", { value, configurable: true });
|
|
9045
9326
|
function useStateMachine2(initialState, machine) {
|
|
9046
|
-
return
|
|
9327
|
+
return React47.useReducer((state, event) => {
|
|
9047
9328
|
const nextState = machine[state][event];
|
|
9048
9329
|
return nextState ?? state;
|
|
9049
9330
|
}, initialState);
|
|
@@ -9702,40 +9983,40 @@ var Viewport = ScrollAreaViewport;
|
|
|
9702
9983
|
var Corner = ScrollAreaCorner;
|
|
9703
9984
|
|
|
9704
9985
|
// src/components/ui/scroll-area.tsx
|
|
9705
|
-
var
|
|
9706
|
-
var ScrollArea2 =
|
|
9986
|
+
var jsx_runtime9 = require("react/jsx-runtime");
|
|
9987
|
+
var ScrollArea2 = React48.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx_runtime9.jsxs(Root6, {
|
|
9707
9988
|
ref,
|
|
9708
9989
|
className: cn("relative overflow-hidden", className),
|
|
9709
9990
|
...props,
|
|
9710
9991
|
children: [
|
|
9711
|
-
/* @__PURE__ */
|
|
9992
|
+
/* @__PURE__ */ jsx_runtime9.jsx(Viewport, {
|
|
9712
9993
|
className: "h-full w-full rounded-[inherit]",
|
|
9713
9994
|
children
|
|
9714
9995
|
}),
|
|
9715
|
-
/* @__PURE__ */
|
|
9716
|
-
/* @__PURE__ */
|
|
9996
|
+
/* @__PURE__ */ jsx_runtime9.jsx(ScrollBar, {}),
|
|
9997
|
+
/* @__PURE__ */ jsx_runtime9.jsx(Corner, {})
|
|
9717
9998
|
]
|
|
9718
9999
|
}));
|
|
9719
10000
|
ScrollArea2.displayName = Root6.displayName;
|
|
9720
|
-
var ScrollBar =
|
|
10001
|
+
var ScrollBar = React48.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ jsx_runtime9.jsx(ScrollAreaScrollbar, {
|
|
9721
10002
|
ref,
|
|
9722
10003
|
orientation,
|
|
9723
10004
|
className: cn("flex touch-none select-none transition-colors", orientation === "vertical" && "h-full w-2 border-l border-l-transparent p-[1px]", orientation === "horizontal" && "h-2 flex-col border-t border-t-transparent p-[1px]", className),
|
|
9724
10005
|
...props,
|
|
9725
|
-
children: /* @__PURE__ */
|
|
10006
|
+
children: /* @__PURE__ */ jsx_runtime9.jsx(ScrollAreaThumb, {
|
|
9726
10007
|
className: "relative flex-1 rounded-full bg-line-default"
|
|
9727
10008
|
})
|
|
9728
10009
|
}));
|
|
9729
10010
|
ScrollBar.displayName = ScrollAreaScrollbar.displayName;
|
|
9730
10011
|
|
|
9731
10012
|
// src/components/ui/tooltip.tsx
|
|
9732
|
-
var
|
|
10013
|
+
var React51 = __toESM(require("react"), 1);
|
|
9733
10014
|
|
|
9734
10015
|
// ../../node_modules/.pnpm/@radix-ui+react-tooltip@1.2.16_@types+react-dom@18.3.7_@types+react@18.3.31__@types+rea_6bca503763256159376adbcc7b8f4fe8/node_modules/@radix-ui/react-tooltip/dist/index.mjs
|
|
9735
|
-
var
|
|
10016
|
+
var React50 = __toESM(require("react"), 1);
|
|
9736
10017
|
|
|
9737
10018
|
// ../../node_modules/.pnpm/@radix-ui+react-visually-hidden@1.2.11_@types+react-dom@18.3.7_@types+react@18.3.31__@t_642d100dd60f054d3c0d9c38ece6c812/node_modules/@radix-ui/react-visually-hidden/dist/index.mjs
|
|
9738
|
-
var
|
|
10019
|
+
var React49 = __toESM(require("react"), 1);
|
|
9739
10020
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
9740
10021
|
var __defProp30 = Object.defineProperty;
|
|
9741
10022
|
var __name29 = (target, value) => __defProp30(target, "name", { value, configurable: true });
|
|
@@ -9751,7 +10032,7 @@ var VISUALLY_HIDDEN_STYLES = Object.freeze({
|
|
|
9751
10032
|
whiteSpace: "nowrap",
|
|
9752
10033
|
wordWrap: "normal"
|
|
9753
10034
|
});
|
|
9754
|
-
var VisuallyHidden = /* @__PURE__ */
|
|
10035
|
+
var VisuallyHidden = /* @__PURE__ */ React49.forwardRef(/* @__PURE__ */ __name29(function VisuallyHidden2(props, forwardedRef) {
|
|
9755
10036
|
return /* @__PURE__ */ import_jsx_runtime18.jsx(Primitive.span, {
|
|
9756
10037
|
...props,
|
|
9757
10038
|
ref: forwardedRef,
|
|
@@ -9781,10 +10062,10 @@ var TooltipProvider = /* @__PURE__ */ __name30((props) => {
|
|
|
9781
10062
|
disableHoverableContent = false,
|
|
9782
10063
|
children
|
|
9783
10064
|
} = props;
|
|
9784
|
-
const isOpenDelayedRef =
|
|
9785
|
-
const isPointerInTransitRef =
|
|
9786
|
-
const skipDelayTimerRef =
|
|
9787
|
-
|
|
10065
|
+
const isOpenDelayedRef = React50.useRef(true);
|
|
10066
|
+
const isPointerInTransitRef = React50.useRef(false);
|
|
10067
|
+
const skipDelayTimerRef = React50.useRef(0);
|
|
10068
|
+
React50.useEffect(() => {
|
|
9788
10069
|
const skipDelayTimer = skipDelayTimerRef.current;
|
|
9789
10070
|
return () => window.clearTimeout(skipDelayTimer);
|
|
9790
10071
|
}, []);
|
|
@@ -9792,20 +10073,20 @@ var TooltipProvider = /* @__PURE__ */ __name30((props) => {
|
|
|
9792
10073
|
scope: __scopeTooltip,
|
|
9793
10074
|
isOpenDelayedRef,
|
|
9794
10075
|
delayDuration,
|
|
9795
|
-
onOpen:
|
|
10076
|
+
onOpen: React50.useCallback(() => {
|
|
9796
10077
|
if (skipDelayDuration <= 0)
|
|
9797
10078
|
return;
|
|
9798
10079
|
window.clearTimeout(skipDelayTimerRef.current);
|
|
9799
10080
|
isOpenDelayedRef.current = false;
|
|
9800
10081
|
}, [skipDelayDuration]),
|
|
9801
|
-
onClose:
|
|
10082
|
+
onClose: React50.useCallback(() => {
|
|
9802
10083
|
if (skipDelayDuration <= 0)
|
|
9803
10084
|
return;
|
|
9804
10085
|
window.clearTimeout(skipDelayTimerRef.current);
|
|
9805
10086
|
skipDelayTimerRef.current = window.setTimeout(() => isOpenDelayedRef.current = true, skipDelayDuration);
|
|
9806
10087
|
}, [skipDelayDuration]),
|
|
9807
10088
|
isPointerInTransitRef,
|
|
9808
|
-
onPointerInTransitChange:
|
|
10089
|
+
onPointerInTransitChange: React50.useCallback((inTransit) => {
|
|
9809
10090
|
isPointerInTransitRef.current = inTransit;
|
|
9810
10091
|
}, []),
|
|
9811
10092
|
disableHoverableContent,
|
|
@@ -9826,13 +10107,13 @@ var Tooltip = /* @__PURE__ */ __name30((props) => {
|
|
|
9826
10107
|
} = props;
|
|
9827
10108
|
const providerContext = useTooltipProviderContext(TOOLTIP_NAME, props.__scopeTooltip);
|
|
9828
10109
|
const popperScope = usePopperScope2(__scopeTooltip);
|
|
9829
|
-
const [trigger, setTrigger] =
|
|
9830
|
-
const [contentIdState, setContentId] =
|
|
10110
|
+
const [trigger, setTrigger] = React50.useState(null);
|
|
10111
|
+
const [contentIdState, setContentId] = React50.useState(undefined);
|
|
9831
10112
|
const generatedContentId = useId();
|
|
9832
|
-
const openTimerRef =
|
|
10113
|
+
const openTimerRef = React50.useRef(0);
|
|
9833
10114
|
const disableHoverableContent = disableHoverableContentProp ?? providerContext.disableHoverableContent;
|
|
9834
10115
|
const delayDuration = delayDurationProp ?? providerContext.delayDuration;
|
|
9835
|
-
const wasOpenDelayedRef =
|
|
10116
|
+
const wasOpenDelayedRef = React50.useRef(false);
|
|
9836
10117
|
const [open, setOpen] = useControllableState({
|
|
9837
10118
|
prop: openProp,
|
|
9838
10119
|
defaultProp: defaultOpen ?? false,
|
|
@@ -9847,21 +10128,21 @@ var Tooltip = /* @__PURE__ */ __name30((props) => {
|
|
|
9847
10128
|
}, "onChange"),
|
|
9848
10129
|
caller: TOOLTIP_NAME
|
|
9849
10130
|
});
|
|
9850
|
-
const stateAttribute =
|
|
10131
|
+
const stateAttribute = React50.useMemo(() => {
|
|
9851
10132
|
return open ? wasOpenDelayedRef.current ? "delayed-open" : "instant-open" : "closed";
|
|
9852
10133
|
}, [open]);
|
|
9853
|
-
const handleOpen =
|
|
10134
|
+
const handleOpen = React50.useCallback(() => {
|
|
9854
10135
|
window.clearTimeout(openTimerRef.current);
|
|
9855
10136
|
openTimerRef.current = 0;
|
|
9856
10137
|
wasOpenDelayedRef.current = false;
|
|
9857
10138
|
setOpen(true);
|
|
9858
10139
|
}, [setOpen]);
|
|
9859
|
-
const handleClose =
|
|
10140
|
+
const handleClose = React50.useCallback(() => {
|
|
9860
10141
|
window.clearTimeout(openTimerRef.current);
|
|
9861
10142
|
openTimerRef.current = 0;
|
|
9862
10143
|
setOpen(false);
|
|
9863
10144
|
}, [setOpen]);
|
|
9864
|
-
const handleDelayedOpen =
|
|
10145
|
+
const handleDelayedOpen = React50.useCallback(() => {
|
|
9865
10146
|
window.clearTimeout(openTimerRef.current);
|
|
9866
10147
|
openTimerRef.current = window.setTimeout(() => {
|
|
9867
10148
|
wasOpenDelayedRef.current = true;
|
|
@@ -9869,7 +10150,7 @@ var Tooltip = /* @__PURE__ */ __name30((props) => {
|
|
|
9869
10150
|
openTimerRef.current = 0;
|
|
9870
10151
|
}, delayDuration);
|
|
9871
10152
|
}, [delayDuration, setOpen]);
|
|
9872
|
-
|
|
10153
|
+
React50.useEffect(() => {
|
|
9873
10154
|
return () => {
|
|
9874
10155
|
if (openTimerRef.current) {
|
|
9875
10156
|
window.clearTimeout(openTimerRef.current);
|
|
@@ -9886,13 +10167,13 @@ var Tooltip = /* @__PURE__ */ __name30((props) => {
|
|
|
9886
10167
|
stateAttribute,
|
|
9887
10168
|
trigger,
|
|
9888
10169
|
onTriggerChange: setTrigger,
|
|
9889
|
-
onTriggerEnter:
|
|
10170
|
+
onTriggerEnter: React50.useCallback(() => {
|
|
9890
10171
|
if (providerContext.isOpenDelayedRef.current)
|
|
9891
10172
|
handleDelayedOpen();
|
|
9892
10173
|
else
|
|
9893
10174
|
handleOpen();
|
|
9894
10175
|
}, [providerContext.isOpenDelayedRef, handleDelayedOpen, handleOpen]),
|
|
9895
|
-
onTriggerLeave:
|
|
10176
|
+
onTriggerLeave: React50.useCallback(() => {
|
|
9896
10177
|
if (disableHoverableContent) {
|
|
9897
10178
|
handleClose();
|
|
9898
10179
|
} else {
|
|
@@ -9907,17 +10188,17 @@ var Tooltip = /* @__PURE__ */ __name30((props) => {
|
|
|
9907
10188
|
}) });
|
|
9908
10189
|
}, "Tooltip");
|
|
9909
10190
|
var TRIGGER_NAME4 = "TooltipTrigger";
|
|
9910
|
-
var TooltipTrigger = /* @__PURE__ */
|
|
10191
|
+
var TooltipTrigger = /* @__PURE__ */ React50.forwardRef(/* @__PURE__ */ __name30(function TooltipTrigger2(props, forwardedRef) {
|
|
9911
10192
|
const { __scopeTooltip, ...triggerProps } = props;
|
|
9912
10193
|
const context = useTooltipContext(TRIGGER_NAME4, __scopeTooltip);
|
|
9913
10194
|
const providerContext = useTooltipProviderContext(TRIGGER_NAME4, __scopeTooltip);
|
|
9914
10195
|
const popperScope = usePopperScope2(__scopeTooltip);
|
|
9915
|
-
const ref =
|
|
10196
|
+
const ref = React50.useRef(null);
|
|
9916
10197
|
const composedRefs = useComposedRefs(forwardedRef, ref, context.onTriggerChange);
|
|
9917
|
-
const isPointerDownRef =
|
|
9918
|
-
const hasPointerMoveOpenedRef =
|
|
9919
|
-
const handlePointerUp =
|
|
9920
|
-
|
|
10198
|
+
const isPointerDownRef = React50.useRef(false);
|
|
10199
|
+
const hasPointerMoveOpenedRef = React50.useRef(false);
|
|
10200
|
+
const handlePointerUp = React50.useCallback(() => isPointerDownRef.current = false, []);
|
|
10201
|
+
React50.useEffect(() => {
|
|
9921
10202
|
return () => document.removeEventListener("pointerup", handlePointerUp);
|
|
9922
10203
|
}, [handlePointerUp]);
|
|
9923
10204
|
return /* @__PURE__ */ import_jsx_runtime19.jsx(Anchor, { asChild: true, ...popperScope, children: /* @__PURE__ */ import_jsx_runtime19.jsx(Primitive.button, {
|
|
@@ -9962,26 +10243,26 @@ var TooltipPortal = /* @__PURE__ */ __name30((props) => {
|
|
|
9962
10243
|
return /* @__PURE__ */ import_jsx_runtime19.jsx(PortalProvider2, { scope: __scopeTooltip, forceMount, children: /* @__PURE__ */ import_jsx_runtime19.jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ import_jsx_runtime19.jsx(Portal, { asChild: true, container, children }) }) });
|
|
9963
10244
|
}, "TooltipPortal");
|
|
9964
10245
|
var CONTENT_NAME6 = "TooltipContent";
|
|
9965
|
-
var TooltipContent = /* @__PURE__ */
|
|
10246
|
+
var TooltipContent = /* @__PURE__ */ React50.forwardRef(/* @__PURE__ */ __name30(function TooltipContent2(props, forwardedRef) {
|
|
9966
10247
|
const portalContext = usePortalContext2(CONTENT_NAME6, props.__scopeTooltip);
|
|
9967
10248
|
const { forceMount = portalContext.forceMount, side = "top", ...contentProps } = props;
|
|
9968
10249
|
const context = useTooltipContext(CONTENT_NAME6, props.__scopeTooltip);
|
|
9969
10250
|
return /* @__PURE__ */ import_jsx_runtime19.jsx(Presence, { present: forceMount || context.open, children: context.disableHoverableContent ? /* @__PURE__ */ import_jsx_runtime19.jsx(TooltipContentImpl, { side, ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ import_jsx_runtime19.jsx(TooltipContentHoverable, { side, ...contentProps, ref: forwardedRef }) });
|
|
9970
10251
|
}, "TooltipContent"));
|
|
9971
|
-
var TooltipContentHoverable = /* @__PURE__ */
|
|
10252
|
+
var TooltipContentHoverable = /* @__PURE__ */ React50.forwardRef(/* @__PURE__ */ __name30(function TooltipContentHoverable2(props, forwardedRef) {
|
|
9972
10253
|
const context = useTooltipContext(CONTENT_NAME6, props.__scopeTooltip);
|
|
9973
10254
|
const providerContext = useTooltipProviderContext(CONTENT_NAME6, props.__scopeTooltip);
|
|
9974
|
-
const ref =
|
|
10255
|
+
const ref = React50.useRef(null);
|
|
9975
10256
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
9976
|
-
const [pointerGraceArea, setPointerGraceArea] =
|
|
10257
|
+
const [pointerGraceArea, setPointerGraceArea] = React50.useState(null);
|
|
9977
10258
|
const { trigger, onClose } = context;
|
|
9978
10259
|
const content = ref.current;
|
|
9979
10260
|
const { onPointerInTransitChange } = providerContext;
|
|
9980
|
-
const handleRemoveGraceArea =
|
|
10261
|
+
const handleRemoveGraceArea = React50.useCallback(() => {
|
|
9981
10262
|
setPointerGraceArea(null);
|
|
9982
10263
|
onPointerInTransitChange(false);
|
|
9983
10264
|
}, [onPointerInTransitChange]);
|
|
9984
|
-
const handleCreateGraceArea =
|
|
10265
|
+
const handleCreateGraceArea = React50.useCallback((event, hoverTarget) => {
|
|
9985
10266
|
const currentTarget = event.currentTarget;
|
|
9986
10267
|
const exitPoint = { x: event.clientX, y: event.clientY };
|
|
9987
10268
|
const exitSide = getExitSideFromRect(exitPoint, currentTarget.getBoundingClientRect());
|
|
@@ -9991,10 +10272,10 @@ var TooltipContentHoverable = /* @__PURE__ */ React49.forwardRef(/* @__PURE__ */
|
|
|
9991
10272
|
setPointerGraceArea(graceArea);
|
|
9992
10273
|
onPointerInTransitChange(true);
|
|
9993
10274
|
}, [onPointerInTransitChange]);
|
|
9994
|
-
|
|
10275
|
+
React50.useEffect(() => {
|
|
9995
10276
|
return () => handleRemoveGraceArea();
|
|
9996
10277
|
}, [handleRemoveGraceArea]);
|
|
9997
|
-
|
|
10278
|
+
React50.useEffect(() => {
|
|
9998
10279
|
if (trigger && content) {
|
|
9999
10280
|
const handleTriggerLeave = /* @__PURE__ */ __name30((event) => handleCreateGraceArea(event, content), "handleTriggerLeave");
|
|
10000
10281
|
const handleContentLeave = /* @__PURE__ */ __name30((event) => handleCreateGraceArea(event, trigger), "handleContentLeave");
|
|
@@ -10006,7 +10287,7 @@ var TooltipContentHoverable = /* @__PURE__ */ React49.forwardRef(/* @__PURE__ */
|
|
|
10006
10287
|
};
|
|
10007
10288
|
}
|
|
10008
10289
|
}, [trigger, content, handleCreateGraceArea, handleRemoveGraceArea]);
|
|
10009
|
-
|
|
10290
|
+
React50.useEffect(() => {
|
|
10010
10291
|
if (pointerGraceArea) {
|
|
10011
10292
|
const handleTrackPointerGrace = /* @__PURE__ */ __name30((event) => {
|
|
10012
10293
|
const target = event.target;
|
|
@@ -10027,7 +10308,7 @@ var TooltipContentHoverable = /* @__PURE__ */ React49.forwardRef(/* @__PURE__ */
|
|
|
10027
10308
|
return /* @__PURE__ */ import_jsx_runtime19.jsx(TooltipContentImpl, { ...props, ref: composedRefs });
|
|
10028
10309
|
}, "TooltipContentHoverable"));
|
|
10029
10310
|
var Slottable = createSlottable("TooltipContent");
|
|
10030
|
-
var TooltipContentImpl = /* @__PURE__ */
|
|
10311
|
+
var TooltipContentImpl = /* @__PURE__ */ React50.forwardRef(/* @__PURE__ */ __name30(function TooltipContentImpl2(props, forwardedRef) {
|
|
10031
10312
|
const {
|
|
10032
10313
|
__scopeTooltip,
|
|
10033
10314
|
children,
|
|
@@ -10040,11 +10321,11 @@ var TooltipContentImpl = /* @__PURE__ */ React49.forwardRef(/* @__PURE__ */ __na
|
|
|
10040
10321
|
const context = useTooltipContext(CONTENT_NAME6, __scopeTooltip);
|
|
10041
10322
|
const popperScope = usePopperScope2(__scopeTooltip);
|
|
10042
10323
|
const { onClose } = context;
|
|
10043
|
-
|
|
10324
|
+
React50.useEffect(() => {
|
|
10044
10325
|
document.addEventListener(TOOLTIP_OPEN, onClose);
|
|
10045
10326
|
return () => document.removeEventListener(TOOLTIP_OPEN, onClose);
|
|
10046
10327
|
}, [onClose]);
|
|
10047
|
-
|
|
10328
|
+
React50.useEffect(() => {
|
|
10048
10329
|
if (context.trigger) {
|
|
10049
10330
|
const handleScroll = /* @__PURE__ */ __name30((event) => {
|
|
10050
10331
|
if (event.target instanceof Node && event.target.contains(context.trigger)) {
|
|
@@ -10220,12 +10501,12 @@ var Portal3 = TooltipPortal;
|
|
|
10220
10501
|
var Content24 = TooltipContent;
|
|
10221
10502
|
|
|
10222
10503
|
// src/components/ui/tooltip.tsx
|
|
10223
|
-
var
|
|
10504
|
+
var jsx_runtime10 = require("react/jsx-runtime");
|
|
10224
10505
|
var TooltipProvider2 = Provider;
|
|
10225
10506
|
var Tooltip2 = Root32;
|
|
10226
10507
|
var TooltipTrigger2 = Trigger3;
|
|
10227
|
-
var TooltipContent2 =
|
|
10228
|
-
children: /* @__PURE__ */
|
|
10508
|
+
var TooltipContent2 = React51.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx_runtime10.jsx(Portal3, {
|
|
10509
|
+
children: /* @__PURE__ */ jsx_runtime10.jsx(Content24, {
|
|
10229
10510
|
ref,
|
|
10230
10511
|
sideOffset,
|
|
10231
10512
|
className: cn("z-50 overflow-hidden rounded-radius-100", "bg-surface-overlay-inverse px-3 py-1.5", "text-xs text-content-inverse", "shadow-elevation-1", "animate-in fade-in-0 zoom-in-95", "data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95", "data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2", "data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", className),
|
|
@@ -10235,7 +10516,7 @@ var TooltipContent2 = React50.forwardRef(({ className, sideOffset = 4, ...props
|
|
|
10235
10516
|
TooltipContent2.displayName = Content24.displayName;
|
|
10236
10517
|
|
|
10237
10518
|
// src/components/SideNavigation.tsx
|
|
10238
|
-
var
|
|
10519
|
+
var jsx_runtime11 = require("react/jsx-runtime");
|
|
10239
10520
|
function isVisible(item, permissions) {
|
|
10240
10521
|
if (!item.enabled)
|
|
10241
10522
|
return false;
|
|
@@ -10246,75 +10527,84 @@ function isVisible(item, permissions) {
|
|
|
10246
10527
|
function flatChildren(item) {
|
|
10247
10528
|
return item.childGroups ? item.childGroups.flatMap((g) => g.items) : item.children ?? [];
|
|
10248
10529
|
}
|
|
10249
|
-
function getInitials2(name) {
|
|
10250
|
-
return name.split(" ").filter(Boolean).slice(0, 2).map((w) => w[0]?.toUpperCase() ?? "").join("");
|
|
10251
|
-
}
|
|
10252
10530
|
function TenantBrand({
|
|
10253
10531
|
tenant,
|
|
10254
10532
|
brandColor = "#f97316"
|
|
10255
10533
|
}) {
|
|
10256
|
-
return /* @__PURE__ */
|
|
10257
|
-
className: "flex items-center gap-2
|
|
10534
|
+
return /* @__PURE__ */ jsx_runtime11.jsxs("div", {
|
|
10535
|
+
className: "flex items-center gap-2 p-2",
|
|
10258
10536
|
children: [
|
|
10259
|
-
/* @__PURE__ */
|
|
10260
|
-
className: "h-
|
|
10537
|
+
/* @__PURE__ */ jsx_runtime11.jsxs(Avatar2, {
|
|
10538
|
+
className: "h-8 w-8 rounded-md",
|
|
10261
10539
|
children: [
|
|
10262
|
-
/* @__PURE__ */
|
|
10540
|
+
/* @__PURE__ */ jsx_runtime11.jsx(AvatarImage2, {
|
|
10263
10541
|
src: tenant.logo,
|
|
10264
10542
|
alt: tenant.name
|
|
10265
10543
|
}),
|
|
10266
|
-
/* @__PURE__ */
|
|
10544
|
+
/* @__PURE__ */ jsx_runtime11.jsx(AvatarFallback2, {
|
|
10267
10545
|
style: { backgroundColor: brandColor },
|
|
10268
10546
|
className: "rounded-md text-[11px] font-bold text-white",
|
|
10269
|
-
children:
|
|
10547
|
+
children: getInitials(tenant.name)
|
|
10270
10548
|
})
|
|
10271
10549
|
]
|
|
10272
10550
|
}),
|
|
10273
|
-
/* @__PURE__ */
|
|
10274
|
-
className: "flex-1 truncate text-sm font-semibold text-
|
|
10551
|
+
/* @__PURE__ */ jsx_runtime11.jsx("span", {
|
|
10552
|
+
className: "flex-1 truncate text-sm font-semibold text-sidebar-foreground",
|
|
10275
10553
|
children: tenant.name
|
|
10276
10554
|
})
|
|
10277
10555
|
]
|
|
10278
10556
|
});
|
|
10279
10557
|
}
|
|
10558
|
+
var menuButtonBase = "flex h-8 w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none transition-colors";
|
|
10559
|
+
function SubItem({
|
|
10560
|
+
item,
|
|
10561
|
+
isActive,
|
|
10562
|
+
onNavigate
|
|
10563
|
+
}) {
|
|
10564
|
+
return /* @__PURE__ */ jsx_runtime11.jsx("button", {
|
|
10565
|
+
type: "button",
|
|
10566
|
+
onClick: () => onNavigate(item.route),
|
|
10567
|
+
"aria-current": isActive ? "page" : undefined,
|
|
10568
|
+
className: cn("flex h-7 w-full min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2", "text-[13px] text-muted-foreground outline-none transition-colors", "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground", isActive ? "bg-sidebar-accent font-medium text-sidebar-accent-foreground" : "font-normal"),
|
|
10569
|
+
children: /* @__PURE__ */ jsx_runtime11.jsx("span", {
|
|
10570
|
+
className: "truncate",
|
|
10571
|
+
children: item.label
|
|
10572
|
+
})
|
|
10573
|
+
});
|
|
10574
|
+
}
|
|
10280
10575
|
function NavLeaf({
|
|
10281
10576
|
item,
|
|
10282
10577
|
isActive,
|
|
10283
10578
|
collapsed,
|
|
10284
|
-
indent = false,
|
|
10285
10579
|
onNavigate
|
|
10286
10580
|
}) {
|
|
10287
10581
|
const Icon = item.icon;
|
|
10288
|
-
const btn = /* @__PURE__ */
|
|
10289
|
-
|
|
10290
|
-
size: "sm",
|
|
10291
|
-
"aria-current": isActive ? "page" : undefined,
|
|
10582
|
+
const btn = /* @__PURE__ */ jsx_runtime11.jsxs("button", {
|
|
10583
|
+
type: "button",
|
|
10292
10584
|
onClick: () => onNavigate(item.route),
|
|
10293
|
-
|
|
10585
|
+
"aria-current": isActive ? "page" : undefined,
|
|
10586
|
+
className: cn(menuButtonBase, "text-sidebar-foreground", "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground", isActive ? "bg-sidebar-accent font-medium text-sidebar-accent-foreground" : "font-normal", collapsed && "justify-center"),
|
|
10294
10587
|
children: [
|
|
10295
|
-
|
|
10296
|
-
"
|
|
10297
|
-
className: "absolute left-0 top-1/2 h-5 w-0.5 -translate-y-1/2 rounded-r-full bg-action-primary"
|
|
10588
|
+
Icon && /* @__PURE__ */ jsx_runtime11.jsx(Icon, {
|
|
10589
|
+
className: "h-4 w-4 shrink-0 text-muted-foreground"
|
|
10298
10590
|
}),
|
|
10299
|
-
|
|
10300
|
-
className:
|
|
10301
|
-
}),
|
|
10302
|
-
!collapsed && /* @__PURE__ */ jsx_runtime10.jsx("span", {
|
|
10303
|
-
className: "flex-1 truncate text-left leading-none",
|
|
10591
|
+
!collapsed && /* @__PURE__ */ jsx_runtime11.jsx("span", {
|
|
10592
|
+
className: "flex-1 truncate",
|
|
10304
10593
|
children: item.label
|
|
10305
10594
|
})
|
|
10306
10595
|
]
|
|
10307
10596
|
});
|
|
10308
10597
|
if (collapsed) {
|
|
10309
|
-
return /* @__PURE__ */
|
|
10598
|
+
return /* @__PURE__ */ jsx_runtime11.jsxs(Tooltip2, {
|
|
10310
10599
|
delayDuration: 200,
|
|
10311
10600
|
children: [
|
|
10312
|
-
/* @__PURE__ */
|
|
10601
|
+
/* @__PURE__ */ jsx_runtime11.jsx(TooltipTrigger2, {
|
|
10313
10602
|
asChild: true,
|
|
10314
10603
|
children: btn
|
|
10315
10604
|
}),
|
|
10316
|
-
/* @__PURE__ */
|
|
10605
|
+
/* @__PURE__ */ jsx_runtime11.jsx(TooltipContent2, {
|
|
10317
10606
|
side: "right",
|
|
10607
|
+
className: "text-xs font-medium",
|
|
10318
10608
|
children: item.label
|
|
10319
10609
|
})
|
|
10320
10610
|
]
|
|
@@ -10334,24 +10624,24 @@ function NavGroup({
|
|
|
10334
10624
|
if (visible.length === 0)
|
|
10335
10625
|
return null;
|
|
10336
10626
|
const defaultOpen = visible.filter((item) => flatChildren(item).some((c) => activeRoute === c.route || activeRoute.startsWith(c.route + "/"))).map((item) => item.id)[0];
|
|
10337
|
-
return /* @__PURE__ */
|
|
10627
|
+
return /* @__PURE__ */ jsx_runtime11.jsxs("section", {
|
|
10338
10628
|
children: [
|
|
10339
|
-
label && !collapsed && /* @__PURE__ */
|
|
10340
|
-
className: "mb-1
|
|
10629
|
+
label && !collapsed && /* @__PURE__ */ jsx_runtime11.jsx("p", {
|
|
10630
|
+
className: "mb-1 px-2 text-[11px] font-medium uppercase tracking-wider text-muted-foreground",
|
|
10341
10631
|
children: label
|
|
10342
10632
|
}),
|
|
10343
|
-
/* @__PURE__ */
|
|
10633
|
+
/* @__PURE__ */ jsx_runtime11.jsx(Accordion2, {
|
|
10344
10634
|
type: "single",
|
|
10345
10635
|
collapsible: true,
|
|
10346
10636
|
defaultValue: defaultOpen,
|
|
10347
|
-
className: "
|
|
10637
|
+
className: "flex flex-col gap-1",
|
|
10348
10638
|
children: visible.map((item) => {
|
|
10349
10639
|
const children = flatChildren(item).filter((c) => isVisible(c, permissions));
|
|
10350
10640
|
const isChildActive = children.some((c) => activeRoute === c.route || activeRoute.startsWith(c.route + "/"));
|
|
10351
10641
|
const isItemActive = activeRoute === item.route || activeRoute.startsWith(item.route + "/");
|
|
10352
10642
|
const Icon = item.icon;
|
|
10353
10643
|
if (children.length === 0) {
|
|
10354
|
-
return /* @__PURE__ */
|
|
10644
|
+
return /* @__PURE__ */ jsx_runtime11.jsx(NavLeaf, {
|
|
10355
10645
|
item,
|
|
10356
10646
|
isActive: isItemActive,
|
|
10357
10647
|
collapsed,
|
|
@@ -10359,68 +10649,58 @@ function NavGroup({
|
|
|
10359
10649
|
}, item.id);
|
|
10360
10650
|
}
|
|
10361
10651
|
if (collapsed) {
|
|
10362
|
-
return /* @__PURE__ */
|
|
10652
|
+
return /* @__PURE__ */ jsx_runtime11.jsx(NavLeaf, {
|
|
10363
10653
|
item,
|
|
10364
10654
|
isActive: isItemActive || isChildActive,
|
|
10365
10655
|
collapsed: true,
|
|
10366
10656
|
onNavigate: () => onNavigate(children[0]?.route ?? item.route)
|
|
10367
10657
|
}, item.id);
|
|
10368
10658
|
}
|
|
10369
|
-
return /* @__PURE__ */
|
|
10659
|
+
return /* @__PURE__ */ jsx_runtime11.jsxs(AccordionItem2, {
|
|
10370
10660
|
value: item.id,
|
|
10371
10661
|
className: "border-none",
|
|
10372
10662
|
children: [
|
|
10373
|
-
/* @__PURE__ */
|
|
10374
|
-
className: cn("
|
|
10663
|
+
/* @__PURE__ */ jsx_runtime11.jsxs(AccordionTrigger2, {
|
|
10664
|
+
className: cn(menuButtonBase, "text-sidebar-foreground hover:no-underline", "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground", isChildActive || isItemActive ? "bg-sidebar-accent font-medium text-sidebar-accent-foreground" : "font-normal"),
|
|
10375
10665
|
children: [
|
|
10376
|
-
|
|
10377
|
-
"
|
|
10378
|
-
className: "absolute left-0 top-1/2 h-5 w-0.5 -translate-y-1/2 rounded-r-full bg-action-primary"
|
|
10379
|
-
}),
|
|
10380
|
-
Icon && /* @__PURE__ */ jsx_runtime10.jsx(Icon, {
|
|
10381
|
-
className: cn("h-4 w-4 shrink-0", isChildActive ? "text-action-primary" : "text-content-subtle")
|
|
10666
|
+
Icon && /* @__PURE__ */ jsx_runtime11.jsx(Icon, {
|
|
10667
|
+
className: "h-4 w-4 shrink-0 text-muted-foreground"
|
|
10382
10668
|
}),
|
|
10383
|
-
/* @__PURE__ */
|
|
10384
|
-
className: "flex-1 truncate text-left
|
|
10669
|
+
/* @__PURE__ */ jsx_runtime11.jsx("span", {
|
|
10670
|
+
className: "flex-1 truncate text-left",
|
|
10385
10671
|
children: item.label
|
|
10386
10672
|
})
|
|
10387
10673
|
]
|
|
10388
10674
|
}),
|
|
10389
|
-
/* @__PURE__ */
|
|
10390
|
-
className: "pb-0",
|
|
10391
|
-
children:
|
|
10392
|
-
className: "
|
|
10393
|
-
children: item.childGroups.
|
|
10675
|
+
/* @__PURE__ */ jsx_runtime11.jsx(AccordionContent2, {
|
|
10676
|
+
className: "pb-0 pt-0.5",
|
|
10677
|
+
children: /* @__PURE__ */ jsx_runtime11.jsx("ul", {
|
|
10678
|
+
className: "mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border/60 px-2.5 py-0.5",
|
|
10679
|
+
children: item.childGroups ? item.childGroups.flatMap((group) => {
|
|
10394
10680
|
const gv = group.items.filter((c) => isVisible(c, permissions));
|
|
10395
10681
|
if (gv.length === 0)
|
|
10396
|
-
return
|
|
10397
|
-
return
|
|
10398
|
-
|
|
10399
|
-
/* @__PURE__ */
|
|
10400
|
-
className: "
|
|
10682
|
+
return [];
|
|
10683
|
+
return [
|
|
10684
|
+
/* @__PURE__ */ jsx_runtime11.jsx("li", {
|
|
10685
|
+
children: /* @__PURE__ */ jsx_runtime11.jsx("p", {
|
|
10686
|
+
className: "px-2 pb-1 pt-3 text-[11px] font-medium uppercase tracking-wider text-sidebar-foreground/60 first:pt-1",
|
|
10401
10687
|
children: group.label
|
|
10402
|
-
}),
|
|
10403
|
-
/* @__PURE__ */ jsx_runtime10.jsx("div", {
|
|
10404
|
-
className: "space-y-0.5",
|
|
10405
|
-
children: gv.map((child) => /* @__PURE__ */ jsx_runtime10.jsx(NavLeaf, {
|
|
10406
|
-
item: child,
|
|
10407
|
-
isActive: activeRoute === child.route || activeRoute.startsWith(child.route + "/"),
|
|
10408
|
-
collapsed: false,
|
|
10409
|
-
indent: true,
|
|
10410
|
-
onNavigate
|
|
10411
|
-
}, child.id))
|
|
10412
10688
|
})
|
|
10413
|
-
|
|
10414
|
-
|
|
10415
|
-
|
|
10416
|
-
|
|
10417
|
-
|
|
10418
|
-
|
|
10419
|
-
|
|
10420
|
-
|
|
10421
|
-
|
|
10422
|
-
|
|
10423
|
-
|
|
10689
|
+
}, `label-${group.id}`),
|
|
10690
|
+
...gv.map((child) => /* @__PURE__ */ jsx_runtime11.jsx("li", {
|
|
10691
|
+
children: /* @__PURE__ */ jsx_runtime11.jsx(SubItem, {
|
|
10692
|
+
item: child,
|
|
10693
|
+
isActive: activeRoute === child.route || activeRoute.startsWith(child.route + "/"),
|
|
10694
|
+
onNavigate
|
|
10695
|
+
})
|
|
10696
|
+
}, child.id))
|
|
10697
|
+
];
|
|
10698
|
+
}) : children.map((child) => /* @__PURE__ */ jsx_runtime11.jsx("li", {
|
|
10699
|
+
children: /* @__PURE__ */ jsx_runtime11.jsx(SubItem, {
|
|
10700
|
+
item: child,
|
|
10701
|
+
isActive: activeRoute === child.route || activeRoute.startsWith(child.route + "/"),
|
|
10702
|
+
onNavigate
|
|
10703
|
+
})
|
|
10424
10704
|
}, child.id))
|
|
10425
10705
|
})
|
|
10426
10706
|
})
|
|
@@ -10431,7 +10711,7 @@ function NavGroup({
|
|
|
10431
10711
|
]
|
|
10432
10712
|
});
|
|
10433
10713
|
}
|
|
10434
|
-
var SideNavigation =
|
|
10714
|
+
var SideNavigation = React52.memo(function SideNavigation({
|
|
10435
10715
|
config,
|
|
10436
10716
|
permissions,
|
|
10437
10717
|
onNavigate,
|
|
@@ -10440,26 +10720,42 @@ var SideNavigation = React51.memo(function SideNavigation({
|
|
|
10440
10720
|
footerNavItems
|
|
10441
10721
|
}) {
|
|
10442
10722
|
const { navCollapsed, setNavCollapsed, activeRoute } = useShell();
|
|
10443
|
-
return /* @__PURE__ */
|
|
10444
|
-
children: /* @__PURE__ */
|
|
10723
|
+
return /* @__PURE__ */ jsx_runtime11.jsx(TooltipProvider2, {
|
|
10724
|
+
children: /* @__PURE__ */ jsx_runtime11.jsxs("nav", {
|
|
10445
10725
|
"aria-label": "Application navigation",
|
|
10446
10726
|
"data-collapsed": navCollapsed,
|
|
10447
|
-
className: cn("relative flex h-full flex-col", "border-r border-
|
|
10727
|
+
className: cn("relative flex h-full flex-col", "border-r border-sidebar-border bg-sidebar", "transition-[width] duration-200 ease-linear", navCollapsed ? "w-12" : "w-64"),
|
|
10448
10728
|
children: [
|
|
10449
|
-
|
|
10450
|
-
className: "shrink-0 border-b border-
|
|
10451
|
-
children: /* @__PURE__ */
|
|
10729
|
+
/* @__PURE__ */ jsx_runtime11.jsx("div", {
|
|
10730
|
+
className: cn("shrink-0", !navCollapsed && "border-b border-sidebar-border"),
|
|
10731
|
+
children: navCollapsed ? /* @__PURE__ */ jsx_runtime11.jsx("div", {
|
|
10732
|
+
className: "flex justify-center p-2",
|
|
10733
|
+
children: /* @__PURE__ */ jsx_runtime11.jsxs(Avatar2, {
|
|
10734
|
+
className: "h-8 w-8 rounded-md",
|
|
10735
|
+
children: [
|
|
10736
|
+
/* @__PURE__ */ jsx_runtime11.jsx(AvatarImage2, {
|
|
10737
|
+
src: tenant.logo,
|
|
10738
|
+
alt: tenant.name
|
|
10739
|
+
}),
|
|
10740
|
+
/* @__PURE__ */ jsx_runtime11.jsx(AvatarFallback2, {
|
|
10741
|
+
style: { backgroundColor: tenantBrandColor ?? "#f97316" },
|
|
10742
|
+
className: "rounded-md text-[11px] font-bold text-white",
|
|
10743
|
+
children: getInitials(tenant.name)
|
|
10744
|
+
})
|
|
10745
|
+
]
|
|
10746
|
+
})
|
|
10747
|
+
}) : /* @__PURE__ */ jsx_runtime11.jsx(TenantBrand, {
|
|
10452
10748
|
tenant,
|
|
10453
10749
|
brandColor: tenantBrandColor
|
|
10454
10750
|
})
|
|
10455
10751
|
}),
|
|
10456
|
-
/* @__PURE__ */
|
|
10752
|
+
/* @__PURE__ */ jsx_runtime11.jsx(ScrollArea2, {
|
|
10457
10753
|
className: "flex-1",
|
|
10458
|
-
children: /* @__PURE__ */
|
|
10459
|
-
className:
|
|
10460
|
-
children: /* @__PURE__ */
|
|
10461
|
-
className: "
|
|
10462
|
-
children: config.groups.map((group) => /* @__PURE__ */
|
|
10754
|
+
children: /* @__PURE__ */ jsx_runtime11.jsx("div", {
|
|
10755
|
+
className: "p-2",
|
|
10756
|
+
children: /* @__PURE__ */ jsx_runtime11.jsx("div", {
|
|
10757
|
+
className: "flex flex-col gap-4",
|
|
10758
|
+
children: config.groups.map((group) => /* @__PURE__ */ jsx_runtime11.jsx(NavGroup, {
|
|
10463
10759
|
label: group.label,
|
|
10464
10760
|
items: group.items,
|
|
10465
10761
|
activeRoute,
|
|
@@ -10470,9 +10766,9 @@ var SideNavigation = React51.memo(function SideNavigation({
|
|
|
10470
10766
|
})
|
|
10471
10767
|
})
|
|
10472
10768
|
}),
|
|
10473
|
-
footerNavItems && footerNavItems.length > 0 && /* @__PURE__ */
|
|
10474
|
-
className:
|
|
10475
|
-
children: /* @__PURE__ */
|
|
10769
|
+
footerNavItems && footerNavItems.length > 0 && /* @__PURE__ */ jsx_runtime11.jsx("div", {
|
|
10770
|
+
className: "shrink-0 border-t border-sidebar-border p-2",
|
|
10771
|
+
children: /* @__PURE__ */ jsx_runtime11.jsx(NavGroup, {
|
|
10476
10772
|
items: footerNavItems,
|
|
10477
10773
|
activeRoute,
|
|
10478
10774
|
collapsed: navCollapsed,
|
|
@@ -10480,25 +10776,25 @@ var SideNavigation = React51.memo(function SideNavigation({
|
|
|
10480
10776
|
onNavigate
|
|
10481
10777
|
})
|
|
10482
10778
|
}),
|
|
10483
|
-
/* @__PURE__ */
|
|
10779
|
+
/* @__PURE__ */ jsx_runtime11.jsxs(Tooltip2, {
|
|
10484
10780
|
delayDuration: 300,
|
|
10485
10781
|
children: [
|
|
10486
|
-
/* @__PURE__ */
|
|
10782
|
+
/* @__PURE__ */ jsx_runtime11.jsx(TooltipTrigger2, {
|
|
10487
10783
|
asChild: true,
|
|
10488
|
-
children: /* @__PURE__ */
|
|
10784
|
+
children: /* @__PURE__ */ jsx_runtime11.jsx(Button, {
|
|
10489
10785
|
variant: "ghost",
|
|
10490
10786
|
size: "icon",
|
|
10491
10787
|
"aria-label": navCollapsed ? "Expand sidebar" : "Collapse sidebar",
|
|
10492
10788
|
onClick: () => setNavCollapsed((v) => !v),
|
|
10493
|
-
className: cn("absolute -right-3 top-[
|
|
10494
|
-
children: navCollapsed ? /* @__PURE__ */
|
|
10789
|
+
className: cn("absolute -right-3 top-[60px] z-20 h-6 w-6 rounded-full", "border border-sidebar-border bg-sidebar shadow-sm", "opacity-0 transition-opacity hover:opacity-100 focus-visible:opacity-100"),
|
|
10790
|
+
children: navCollapsed ? /* @__PURE__ */ jsx_runtime11.jsx(ChevronRight, {
|
|
10495
10791
|
className: "h-3 w-3"
|
|
10496
|
-
}) : /* @__PURE__ */
|
|
10792
|
+
}) : /* @__PURE__ */ jsx_runtime11.jsx(ChevronLeft, {
|
|
10497
10793
|
className: "h-3 w-3"
|
|
10498
10794
|
})
|
|
10499
10795
|
})
|
|
10500
10796
|
}),
|
|
10501
|
-
/* @__PURE__ */
|
|
10797
|
+
/* @__PURE__ */ jsx_runtime11.jsx(TooltipContent2, {
|
|
10502
10798
|
side: "right",
|
|
10503
10799
|
children: navCollapsed ? "Expand sidebar" : "Collapse sidebar"
|
|
10504
10800
|
})
|
|
@@ -10510,53 +10806,88 @@ var SideNavigation = React51.memo(function SideNavigation({
|
|
|
10510
10806
|
});
|
|
10511
10807
|
|
|
10512
10808
|
// src/components/AppShell.tsx
|
|
10513
|
-
var
|
|
10809
|
+
var jsx_runtime12 = require("react/jsx-runtime");
|
|
10514
10810
|
function AppShellInner({
|
|
10515
10811
|
context,
|
|
10516
10812
|
navigationConfig,
|
|
10517
10813
|
children,
|
|
10814
|
+
activeRoute: activeRouteProp,
|
|
10518
10815
|
onNavigate,
|
|
10519
10816
|
tenantBrandColor,
|
|
10520
10817
|
footerNavItems
|
|
10521
10818
|
}) {
|
|
10522
|
-
const { setActiveRoute, navCollapsed } = useShell();
|
|
10523
|
-
|
|
10524
|
-
|
|
10819
|
+
const { setActiveRoute, setNavCollapsed, navCollapsed } = useShell();
|
|
10820
|
+
React53.useEffect(() => {
|
|
10821
|
+
if (activeRouteProp !== undefined)
|
|
10822
|
+
setActiveRoute(activeRouteProp);
|
|
10823
|
+
}, [activeRouteProp, setActiveRoute]);
|
|
10824
|
+
React53.useEffect(() => {
|
|
10825
|
+
try {
|
|
10826
|
+
const stored = localStorage.getItem("app-shell:nav-collapsed");
|
|
10827
|
+
if (stored !== null)
|
|
10828
|
+
setNavCollapsed(stored === "true");
|
|
10829
|
+
} catch {}
|
|
10830
|
+
}, [setNavCollapsed]);
|
|
10831
|
+
React53.useEffect(() => {
|
|
10832
|
+
try {
|
|
10833
|
+
localStorage.setItem("app-shell:nav-collapsed", String(navCollapsed));
|
|
10834
|
+
} catch {}
|
|
10835
|
+
}, [navCollapsed]);
|
|
10836
|
+
React53.useEffect(() => {
|
|
10837
|
+
document.body.style.setProperty("--shell-sidebar-width", navCollapsed ? "3rem" : "16rem");
|
|
10525
10838
|
document.body.style.setProperty("--shell-header-height", "3rem");
|
|
10526
10839
|
return () => {
|
|
10527
10840
|
document.body.style.removeProperty("--shell-sidebar-width");
|
|
10528
10841
|
document.body.style.removeProperty("--shell-header-height");
|
|
10529
10842
|
};
|
|
10530
10843
|
}, [navCollapsed]);
|
|
10531
|
-
const handleNavigate =
|
|
10844
|
+
const handleNavigate = React53.useCallback((path) => {
|
|
10532
10845
|
setActiveRoute(path);
|
|
10533
|
-
onNavigate
|
|
10534
|
-
|
|
10846
|
+
if (onNavigate) {
|
|
10847
|
+
onNavigate(path);
|
|
10848
|
+
} else if (typeof window !== "undefined" && window.location.pathname !== path) {
|
|
10535
10849
|
window.history.pushState(null, "", path);
|
|
10536
10850
|
}
|
|
10537
10851
|
}, [setActiveRoute, onNavigate]);
|
|
10538
|
-
|
|
10852
|
+
React53.useEffect(() => {
|
|
10853
|
+
if (onNavigate)
|
|
10854
|
+
return;
|
|
10539
10855
|
if (typeof window === "undefined")
|
|
10540
10856
|
return;
|
|
10541
10857
|
const handler = () => setActiveRoute(window.location.pathname);
|
|
10542
10858
|
window.addEventListener("popstate", handler);
|
|
10543
10859
|
return () => window.removeEventListener("popstate", handler);
|
|
10544
|
-
}, [setActiveRoute]);
|
|
10545
|
-
const shellRef =
|
|
10546
|
-
|
|
10860
|
+
}, [onNavigate, setActiveRoute]);
|
|
10861
|
+
const shellRef = React53.useRef(null);
|
|
10862
|
+
const prevOverrideKeysRef = React53.useRef([]);
|
|
10863
|
+
React53.useEffect(() => {
|
|
10547
10864
|
const el = shellRef.current;
|
|
10548
|
-
if (!el
|
|
10865
|
+
if (!el)
|
|
10549
10866
|
return;
|
|
10550
|
-
for (const
|
|
10551
|
-
|
|
10867
|
+
for (const key of prevOverrideKeysRef.current) {
|
|
10868
|
+
if (!context.theme.overrides?.[key]) {
|
|
10869
|
+
el.style.removeProperty(key);
|
|
10870
|
+
}
|
|
10871
|
+
}
|
|
10872
|
+
const currentKeys = [];
|
|
10873
|
+
if (context.theme.overrides) {
|
|
10874
|
+
for (const [prop, value] of Object.entries(context.theme.overrides)) {
|
|
10875
|
+
el.style.setProperty(prop, value);
|
|
10876
|
+
currentKeys.push(prop);
|
|
10877
|
+
}
|
|
10552
10878
|
}
|
|
10879
|
+
prevOverrideKeysRef.current = currentKeys;
|
|
10880
|
+
return () => {
|
|
10881
|
+
for (const key of currentKeys) {
|
|
10882
|
+
el.style.removeProperty(key);
|
|
10883
|
+
}
|
|
10884
|
+
};
|
|
10553
10885
|
}, [context.theme.overrides]);
|
|
10554
|
-
return /* @__PURE__ */
|
|
10886
|
+
return /* @__PURE__ */ jsx_runtime12.jsxs("div", {
|
|
10555
10887
|
ref: shellRef,
|
|
10556
|
-
"
|
|
10557
|
-
className: cn("app-shell flex h-screen overflow-hidden", "bg-surface-default text-content-default"),
|
|
10888
|
+
className: cn("app-shell flex h-screen overflow-hidden", "bg-surface-default text-content-default", context.theme.mode === "dark" && "dark"),
|
|
10558
10889
|
children: [
|
|
10559
|
-
/* @__PURE__ */
|
|
10890
|
+
/* @__PURE__ */ jsx_runtime12.jsx(SideNavigation, {
|
|
10560
10891
|
config: navigationConfig,
|
|
10561
10892
|
permissions: context.permissions,
|
|
10562
10893
|
onNavigate: handleNavigate,
|
|
@@ -10564,16 +10895,17 @@ function AppShellInner({
|
|
|
10564
10895
|
tenantBrandColor,
|
|
10565
10896
|
footerNavItems
|
|
10566
10897
|
}),
|
|
10567
|
-
/* @__PURE__ */
|
|
10898
|
+
/* @__PURE__ */ jsx_runtime12.jsxs("div", {
|
|
10568
10899
|
className: "flex min-w-0 flex-1 flex-col overflow-hidden",
|
|
10569
10900
|
children: [
|
|
10570
|
-
/* @__PURE__ */
|
|
10901
|
+
/* @__PURE__ */ jsx_runtime12.jsx(Header, {
|
|
10571
10902
|
user: context.user,
|
|
10572
10903
|
tenant: context.tenant
|
|
10573
10904
|
}),
|
|
10574
|
-
/* @__PURE__ */
|
|
10905
|
+
/* @__PURE__ */ jsx_runtime12.jsx("main", {
|
|
10906
|
+
id: "shell-main-content",
|
|
10575
10907
|
className: "min-w-0 flex-1 overflow-auto",
|
|
10576
|
-
|
|
10908
|
+
tabIndex: -1,
|
|
10577
10909
|
children
|
|
10578
10910
|
})
|
|
10579
10911
|
]
|
|
@@ -10581,15 +10913,174 @@ function AppShellInner({
|
|
|
10581
10913
|
]
|
|
10582
10914
|
});
|
|
10583
10915
|
}
|
|
10584
|
-
function AppShell(props) {
|
|
10916
|
+
function AppShell({ onError, ...props }) {
|
|
10585
10917
|
const initialRoute = props.activeRoute ?? (typeof window !== "undefined" ? window.location.pathname : "/");
|
|
10586
|
-
return /* @__PURE__ */
|
|
10587
|
-
|
|
10588
|
-
children: /* @__PURE__ */
|
|
10589
|
-
|
|
10918
|
+
return /* @__PURE__ */ jsx_runtime12.jsx(ShellErrorBoundary, {
|
|
10919
|
+
onError,
|
|
10920
|
+
children: /* @__PURE__ */ jsx_runtime12.jsx(ShellProvider, {
|
|
10921
|
+
initialRoute,
|
|
10922
|
+
children: /* @__PURE__ */ jsx_runtime12.jsx(AppShellInner, {
|
|
10923
|
+
...props
|
|
10924
|
+
})
|
|
10925
|
+
})
|
|
10926
|
+
});
|
|
10927
|
+
}
|
|
10928
|
+
// src/components/ModuleHost.tsx
|
|
10929
|
+
var import_react7 = require("react");
|
|
10930
|
+
var jsx_runtime13 = require("react/jsx-runtime");
|
|
10931
|
+
function ModuleLoadingState() {
|
|
10932
|
+
return /* @__PURE__ */ jsx_runtime13.jsxs("div", {
|
|
10933
|
+
role: "status",
|
|
10934
|
+
"aria-live": "polite",
|
|
10935
|
+
"aria-label": "Loading module",
|
|
10936
|
+
className: "flex flex-1 flex-col items-center justify-center gap-3 p-8 text-content-subtle",
|
|
10937
|
+
children: [
|
|
10938
|
+
/* @__PURE__ */ jsx_runtime13.jsx(LoaderCircle, {
|
|
10939
|
+
className: "h-8 w-8 animate-spin text-action-primary",
|
|
10940
|
+
"aria-hidden": "true"
|
|
10941
|
+
}),
|
|
10942
|
+
/* @__PURE__ */ jsx_runtime13.jsx("p", {
|
|
10943
|
+
className: "text-sm",
|
|
10944
|
+
children: "Loading…"
|
|
10945
|
+
})
|
|
10946
|
+
]
|
|
10947
|
+
});
|
|
10948
|
+
}
|
|
10949
|
+
function ModuleErrorState({ error, moduleId, onRetry }) {
|
|
10950
|
+
return /* @__PURE__ */ jsx_runtime13.jsxs("div", {
|
|
10951
|
+
role: "alert",
|
|
10952
|
+
className: "flex flex-1 flex-col items-center justify-center gap-4 p-8 text-center",
|
|
10953
|
+
children: [
|
|
10954
|
+
/* @__PURE__ */ jsx_runtime13.jsx("div", {
|
|
10955
|
+
className: "flex h-12 w-12 items-center justify-center rounded-full bg-status-danger/10",
|
|
10956
|
+
children: /* @__PURE__ */ jsx_runtime13.jsx(TriangleAlert, {
|
|
10957
|
+
className: "h-6 w-6 text-status-danger-bold",
|
|
10958
|
+
"aria-hidden": "true"
|
|
10959
|
+
})
|
|
10960
|
+
}),
|
|
10961
|
+
/* @__PURE__ */ jsx_runtime13.jsxs("div", {
|
|
10962
|
+
className: "space-y-1",
|
|
10963
|
+
children: [
|
|
10964
|
+
/* @__PURE__ */ jsx_runtime13.jsx("p", {
|
|
10965
|
+
className: "text-sm font-semibold text-content-default",
|
|
10966
|
+
children: "Failed to load module"
|
|
10967
|
+
}),
|
|
10968
|
+
/* @__PURE__ */ jsx_runtime13.jsxs("p", {
|
|
10969
|
+
className: "text-xs text-content-subtle",
|
|
10970
|
+
children: [
|
|
10971
|
+
"Module: ",
|
|
10972
|
+
/* @__PURE__ */ jsx_runtime13.jsx("code", {
|
|
10973
|
+
className: "font-mono",
|
|
10974
|
+
children: moduleId
|
|
10975
|
+
})
|
|
10976
|
+
]
|
|
10977
|
+
})
|
|
10978
|
+
]
|
|
10979
|
+
}),
|
|
10980
|
+
/* @__PURE__ */ jsx_runtime13.jsxs(Button, {
|
|
10981
|
+
variant: "secondary",
|
|
10982
|
+
size: "sm",
|
|
10983
|
+
onClick: onRetry,
|
|
10984
|
+
children: [
|
|
10985
|
+
/* @__PURE__ */ jsx_runtime13.jsx(RefreshCw, {
|
|
10986
|
+
className: "h-3.5 w-3.5",
|
|
10987
|
+
"aria-hidden": "true"
|
|
10988
|
+
}),
|
|
10989
|
+
"Retry"
|
|
10990
|
+
]
|
|
10991
|
+
})
|
|
10992
|
+
]
|
|
10993
|
+
});
|
|
10994
|
+
}
|
|
10995
|
+
function useModuleMount(module2, context, platform, containerRef) {
|
|
10996
|
+
const [state, setState] = import_react7.useState({ lifecycle: "loading", error: null });
|
|
10997
|
+
const instanceRef = import_react7.useRef(null);
|
|
10998
|
+
const [retryCount, setRetryCount] = import_react7.useState(0);
|
|
10999
|
+
import_react7.useEffect(() => {
|
|
11000
|
+
const container = containerRef.current;
|
|
11001
|
+
if (!module2 || !container)
|
|
11002
|
+
return;
|
|
11003
|
+
let cancelled = false;
|
|
11004
|
+
setState({ lifecycle: "loading", error: null });
|
|
11005
|
+
if (instanceRef.current?.unmount) {
|
|
11006
|
+
instanceRef.current.unmount();
|
|
11007
|
+
instanceRef.current = null;
|
|
11008
|
+
}
|
|
11009
|
+
const run = async () => {
|
|
11010
|
+
try {
|
|
11011
|
+
setState({ lifecycle: "loaded", error: null });
|
|
11012
|
+
const instance = module2.mount(container, context, platform);
|
|
11013
|
+
if (cancelled) {
|
|
11014
|
+
instance.unmount?.();
|
|
11015
|
+
return;
|
|
11016
|
+
}
|
|
11017
|
+
instanceRef.current = instance;
|
|
11018
|
+
setState({ lifecycle: "active", error: null });
|
|
11019
|
+
} catch (err) {
|
|
11020
|
+
if (cancelled)
|
|
11021
|
+
return;
|
|
11022
|
+
const error = err instanceof Error ? err : new Error(String(err));
|
|
11023
|
+
setState({ lifecycle: "failed", error });
|
|
11024
|
+
}
|
|
11025
|
+
};
|
|
11026
|
+
run();
|
|
11027
|
+
return () => {
|
|
11028
|
+
cancelled = true;
|
|
11029
|
+
if (instanceRef.current?.unmount) {
|
|
11030
|
+
instanceRef.current.unmount();
|
|
11031
|
+
instanceRef.current = null;
|
|
11032
|
+
}
|
|
11033
|
+
};
|
|
11034
|
+
}, [module2, retryCount]);
|
|
11035
|
+
return {
|
|
11036
|
+
...state,
|
|
11037
|
+
retry: () => setRetryCount((n) => n + 1)
|
|
11038
|
+
};
|
|
11039
|
+
}
|
|
11040
|
+
function ModuleHost({
|
|
11041
|
+
module: module2,
|
|
11042
|
+
moduleId,
|
|
11043
|
+
context,
|
|
11044
|
+
platform,
|
|
11045
|
+
className,
|
|
11046
|
+
onError
|
|
11047
|
+
}) {
|
|
11048
|
+
const containerRef = import_react7.useRef(null);
|
|
11049
|
+
const { lifecycle, error, retry } = useModuleMount(module2, context, platform, containerRef);
|
|
11050
|
+
import_react7.useEffect(() => {
|
|
11051
|
+
if (lifecycle === "active") {
|
|
11052
|
+
containerRef.current?.focus();
|
|
11053
|
+
}
|
|
11054
|
+
}, [lifecycle]);
|
|
11055
|
+
return /* @__PURE__ */ jsx_runtime13.jsx(ShellErrorBoundary, {
|
|
11056
|
+
onError,
|
|
11057
|
+
children: /* @__PURE__ */ jsx_runtime13.jsxs("div", {
|
|
11058
|
+
"aria-label": `${moduleId} module`,
|
|
11059
|
+
className: cn("app-shell-module-host", "relative flex flex-1 flex-col overflow-hidden", className),
|
|
11060
|
+
children: [
|
|
11061
|
+
lifecycle === "loading" && /* @__PURE__ */ jsx_runtime13.jsx("div", {
|
|
11062
|
+
className: "absolute inset-0 z-10 flex bg-surface-default",
|
|
11063
|
+
children: /* @__PURE__ */ jsx_runtime13.jsx(ModuleLoadingState, {})
|
|
11064
|
+
}),
|
|
11065
|
+
lifecycle === "failed" && error && /* @__PURE__ */ jsx_runtime13.jsx("div", {
|
|
11066
|
+
className: "absolute inset-0 z-10 flex bg-surface-default",
|
|
11067
|
+
children: /* @__PURE__ */ jsx_runtime13.jsx(ModuleErrorState, {
|
|
11068
|
+
error,
|
|
11069
|
+
moduleId,
|
|
11070
|
+
onRetry: retry
|
|
11071
|
+
})
|
|
11072
|
+
}),
|
|
11073
|
+
/* @__PURE__ */ jsx_runtime13.jsx("div", {
|
|
11074
|
+
ref: containerRef,
|
|
11075
|
+
tabIndex: -1,
|
|
11076
|
+
"data-module-id": moduleId,
|
|
11077
|
+
"data-module-state": lifecycle,
|
|
11078
|
+
"aria-hidden": lifecycle !== "active",
|
|
11079
|
+
className: "absolute inset-0 overflow-auto outline-none"
|
|
11080
|
+
})
|
|
11081
|
+
]
|
|
10590
11082
|
})
|
|
10591
11083
|
});
|
|
10592
11084
|
}
|
|
10593
11085
|
|
|
10594
|
-
//# debugId=
|
|
10595
|
-
//# sourceMappingURL=index.cjs.js.map
|
|
11086
|
+
//# debugId=64B6598BBDA68AC764756E2164756E21
|